diff --git a/.circleci/config.yml b/.circleci/config.yml
index 1fc750c49c..62bf478f5d 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -3,7 +3,7 @@ version: 2.1
executors:
golang:
docker:
- - image: cimg/go:1.19
+ - image: cimg/go:1.20.0
commands:
make:
@@ -61,7 +61,7 @@ jobs:
lint:
docker:
- - image: golangci/golangci-lint:v1.50.1
+ - image: golangci/golangci-lint:v1.51.1
steps:
- checkout
- run:
@@ -124,7 +124,7 @@ jobs:
- run:
name: Run simulations
command: |
- make test-sim-multi-seed-short
+ make test-sim-multi-seed-short test-sim-import-export test-sim-deterministic
- store_artifacts:
path: /tmp
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 376c012334..3d21b52c4b 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -18,7 +18,7 @@ updates:
- 0.14.0-beta4
- 0.14.0-beta5
- 0.14.0-rc1
- - dependency-name: github.com/tendermint/tendermint
+ - dependency-name: github.com/cometbft/cometbft
versions:
- 0.34.10
- 0.34.4
@@ -40,6 +40,6 @@ updates:
- dependency-name: github.com/spf13/cobra
versions:
- 1.1.2
- - dependency-name: github.com/tendermint/tm-db
+ - dependency-name: github.com/cometbft/cometbft-db
versions:
- 0.6.4
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000000..3c2ce08d91
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,37 @@
+---
+on: [push, pull_request]
+name: Build
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ name: build
+ steps:
+ - uses: actions/checkout@v3
+ - name: Setup go
+ uses: actions/setup-go@v3
+ with:
+ go-version: "1.20"
+ - run: go build ./...
+
+ tidy:
+ runs-on: ubuntu-latest
+ name: tidy
+ steps:
+ - uses: actions/checkout@v3
+ - name: Setup go
+ uses: actions/setup-go@v3
+ with:
+ go-version: "1.20"
+ - run: |
+ go mod tidy
+ CHANGES_IN_REPO=$(git status --porcelain)
+ if [[ -n "$CHANGES_IN_REPO" ]]; then
+ echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:"
+ git status && git --no-pager diff
+ exit 1
+ fi
diff --git a/.github/workflows/codacy.yml b/.github/workflows/codacy.yml
new file mode 100644
index 0000000000..f94e29a797
--- /dev/null
+++ b/.github/workflows/codacy.yml
@@ -0,0 +1,61 @@
+# This workflow uses actions that are not certified by GitHub.
+# They are provided by a third-party and are governed by
+# separate terms of service, privacy policy, and support
+# documentation.
+
+# This workflow checks out code, performs a Codacy security scan
+# and integrates the results with the
+# GitHub Advanced Security code scanning feature. For more information on
+# the Codacy security scan action usage and parameters, see
+# https://github.com/codacy/codacy-analysis-cli-action.
+# For more information on Codacy Analysis CLI in general, see
+# https://github.com/codacy/codacy-analysis-cli.
+
+name: Codacy Security Scan
+
+on:
+ push:
+ branches: [ "main", "release/v*" ]
+ pull_request:
+ # The branches below must be a subset of the branches above
+ branches: [ "main", "release/v*" ]
+ schedule:
+ - cron: '24 14 * * 5'
+
+permissions:
+ contents: read
+
+jobs:
+ codacy-security-scan:
+ permissions:
+ contents: read # for actions/checkout to fetch code
+ security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
+ actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
+ name: Codacy Security Scan
+ runs-on: ubuntu-latest
+ steps:
+ # Checkout the repository to the GitHub Actions runner
+ - name: Checkout code
+ uses: actions/checkout@v3
+
+ # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis
+ - name: Run Codacy Analysis CLI
+ uses: codacy/codacy-analysis-cli-action@d43127fe38d20c527dc1951ae5aea23148bab738
+ with:
+ # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository
+ # You can also omit the token and run the tools that support default configurations
+ project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
+ verbose: true
+ output: results.sarif
+ format: sarif
+ # Adjust severity of non-security issues
+ gh-code-scanning-compat: true
+ # Force 0 exit code to allow SARIF file generation
+ # This will handover control about PR rejection to the GitHub side
+ max-allowed-issues: 2147483647
+
+ # Upload the SARIF file generated in the previous step
+ - name: Upload SARIF results file
+ uses: github/codeql-action/upload-sarif@v2
+ with:
+ sarif_file: results.sarif
diff --git a/.github/workflows/codeql-cosmos.yml b/.github/workflows/codeql-cosmos.yml
new file mode 100644
index 0000000000..dc02a93341
--- /dev/null
+++ b/.github/workflows/codeql-cosmos.yml
@@ -0,0 +1,40 @@
+name: "CodeQL for cosmos"
+
+on:
+ pull_request:
+ paths:
+ - "**.go"
+ push:
+ branches:
+ - main
+ - release/v*
+ paths:
+ - "**.go"
+
+jobs:
+ analyze:
+ name: Analyze
+ runs-on: ubuntu-latest
+ permissions:
+ actions: read
+ contents: read
+ security-events: write
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v3
+ - uses: actions/setup-go@v3
+ with:
+ go-version: "1.20"
+ # Initializes the CodeQL tools for scanning.
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v2
+ with:
+ languages: "go"
+ queries: crypto-com/cosmos-sdk-codeql@main,security-and-quality
+
+ - name: Build
+ run: make build
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v2
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
new file mode 100644
index 0000000000..49ab76163f
--- /dev/null
+++ b/.github/workflows/codeql.yml
@@ -0,0 +1,40 @@
+name: "CodeQL"
+
+on:
+ pull_request:
+ paths:
+ - "**.go"
+ push:
+ branches:
+ - main
+ - release/v*
+ paths:
+ - "**.go"
+
+jobs:
+ analyze:
+ name: Analyze
+ runs-on: ubuntu-latest
+ permissions:
+ actions: read
+ contents: read
+ security-events: write
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v3
+ - uses: actions/setup-go@v3
+ with:
+ go-version: "1.20"
+ # Initializes the CodeQL tools for scanning.
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v2
+ with:
+ languages: "go"
+ queries: crypto-com/cosmos-sdk-codeql@main,security-and-quality
+
+ - name: Build
+ run: make build
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v2
diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml
new file mode 100644
index 0000000000..b0dedc42e0
--- /dev/null
+++ b/.github/workflows/dependency-review.yml
@@ -0,0 +1,20 @@
+# Dependency Review Action
+#
+# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
+#
+# Source repository: https://github.com/actions/dependency-review-action
+# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
+name: 'Dependency Review'
+on: [pull_request]
+
+permissions:
+ contents: read
+
+jobs:
+ dependency-review:
+ runs-on: ubuntu-latest
+ steps:
+ - name: 'Checkout Repository'
+ uses: actions/checkout@v3
+ - name: 'Dependency Review'
+ uses: actions/dependency-review-action@v3
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml
new file mode 100644
index 0000000000..527164aab1
--- /dev/null
+++ b/.github/workflows/docker.yml
@@ -0,0 +1,23 @@
+---
+name: Build Docker Image on PR
+
+on:
+ pull_request:
+
+jobs:
+ docker:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ - name: Set up QEMU
+ uses: docker/setup-qemu-action@v2
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v2
+ - name: Build without push
+ uses: docker/build-push-action@v4
+ with:
+ context: .
+ platforms: linux/amd64
+ push: false
+ build-args: arch=x86_64
\ No newline at end of file
diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml
new file mode 100644
index 0000000000..d3f6b57560
--- /dev/null
+++ b/.github/workflows/golangci-lint.yml
@@ -0,0 +1,34 @@
+---
+name: golangci-lint
+on:
+ push:
+ tags:
+ - v*
+ branches:
+ - release/v*
+ - main
+ pull_request:
+permissions:
+ contents: read
+ # Optional: allow read access to pull request. Use with `only-new-issues` option.
+ # pull-requests: read
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ golangci:
+ name: lint
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/setup-go@v3
+ with:
+ go-version: "1.20"
+ - uses: actions/checkout@v3
+
+ - name: golangci-lint
+ uses: golangci/golangci-lint-action@v3
+ with:
+ version: latest
+ args: --timeout 10m
diff --git a/.github/workflows/proto-buf-publisher.yml b/.github/workflows/proto-buf-publisher.yml
index 174cae30cb..b9d9af3549 100644
--- a/.github/workflows/proto-buf-publisher.yml
+++ b/.github/workflows/proto-buf-publisher.yml
@@ -6,7 +6,7 @@ on:
branches:
- main
paths:
- - 'proto/**'
+ - "proto/**"
# Sequence of patterns matched against refs/tags
tags:
@@ -17,12 +17,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.3.0
- - uses: bufbuild/buf-setup-action@v1.13.1
+ - uses: bufbuild/buf-setup-action@v1.14.0
# lint checks
- uses: bufbuild/buf-lint-action@v1
with:
- input: 'proto'
+ input: "proto"
# TODO: Add this when project is more stable.
# backward compatibility breaking checks
@@ -34,5 +34,5 @@ jobs:
# publish proto files
- uses: bufbuild/buf-push-action@v1
with:
- input: 'proto'
- buf_token: ${{ secrets.BUF_TOKEN }}
\ No newline at end of file
+ input: "proto"
+ buf_token: ${{ secrets.BUF_TOKEN }}
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
new file mode 100644
index 0000000000..57c103e8d3
--- /dev/null
+++ b/.github/workflows/tests.yml
@@ -0,0 +1,21 @@
+---
+on: [push, pull_request]
+name: Test
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ name: test
+ steps:
+ - name: Install Go
+ uses: actions/setup-go@v3
+ with:
+ go-version: "1.20"
+ - name: Checkout code
+ uses: actions/checkout@v3
+ - name: Test
+ run: go test ./...
diff --git a/.golangci.yml b/.golangci.yml
index 17d5384ea3..456413cab7 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -1,63 +1,92 @@
run:
- tests: false
+ tests: true
+ # timeout for analysis, e.g. 30s, 5m, default is 1m
+ timeout: 5m
linters:
disable-all: true
enable:
- - bodyclose
- - deadcode
- depguard
- dogsled
- errcheck
+ - exportloopref
- goconst
- gocritic
- - gofmt
- - goimports
- - revive
+ - gofumpt
- gosec
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- - prealloc
- - exportloopref
+ - nolintlint
+ - revive
- staticcheck
- - structcheck
- stylecheck
- typecheck
- unconvert
+ - unparam
- unused
- - varcheck
+
+# TODO: fix the sdkerrors.Wrap deprecation warning and re-enable staticcheck
+# TODO: fix the use of deprecated gov style
issues:
exclude-rules:
+ - text: "SA1019: sdkerrors.Register"
+ linters:
+ - staticcheck
+ - text: "sdkerrors.ABCIInfo is deprecated"
+ linters:
+ - staticcheck
+ - text: "sdkerrors.IsOf is deprecated"
+ linters:
+ - staticcheck
+ - text: "Use WeightedProposalMsg instead"
+ linters:
+ - staticcheck
+ - text: "Use MsgSimulatorFn instead"
+ linters:
+ - staticcheck
+ - text: "Error return value of `flagSet.Set` is not checked"
+ linters:
+ - errcheck
+ - text: "SA1019: sdkerrors.Wrapf is deprecated: functionality of this package has been moved to it's own module"
+ linters:
+ - staticcheck
+ - text: "sdkerrors.Error is deprecated: the type has been moved to cosmossdk.io/errors module"
+ linters:
+ - staticcheck
+ - text: "sdkerrors.Wrap is deprecated"
+ linters:
+ - staticcheck
- text: "Use of weak random number generator"
linters:
- gosec
- text: "ST1003:"
linters:
- stylecheck
+ # FIXME: Disabled until golangci-lint updates stylecheck with this fix:
+ # https://github.com/dominikh/go-tools/issues/389
+ - text: "ST1016:"
+ linters:
+ - stylecheck
+ - path: "migrations"
+ text: "SA1019:"
+ linters:
+ - staticcheck
+
+ max-issues-per-linter: 10000
+ max-same-issues: 10000
linters-settings:
dogsled:
max-blank-identifiers: 3
- errcheck:
- # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
- # default is false: such cases aren't reported by default.
- check-blank: true
maligned:
# print struct with more effective memory layout or not, false by default
suggest-new: true
- golint:
- # minimal confidence for issues, default is 0.8
- min-confidence: 0
- prealloc:
- # XXX: we don't recommend using this linter before doing performance profiling.
- # For most programs usage of prealloc will be a premature optimization.
-
- # Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them.
- # True by default.
- simple: false
- range-loops: true # Report preallocation suggestions on range loops, true by default
- for-loops: true # Report preallocation suggestions on for loops, false by default
+ nolintlint:
+ allow-unused: false
+ allow-leading-space: true
+ require-explanation: false
+ require-specific: false
diff --git a/EVENTS.md b/EVENTS.md
index 371e1c405e..2407b3ba98 100644
--- a/EVENTS.md
+++ b/EVENTS.md
@@ -25,8 +25,8 @@ how [CosmJS](https://github.com/cosmos/cosmjs) gets the events it shows to the c
In Tendermint 0.35, the `events` field will be one flattened list of events over all messages. Just as if we concatenated all
the per-message arrays contained in the `log` field. This fix was made as
-[part of an event system refactoring](https://github.com/tendermint/tendermint/pull/6634). This refactoring is also giving us
-[pluggable event indexing engines](https://github.com/tendermint/tendermint/pull/6411), so we can use eg. PostgreSQL to
+[part of an event system refactoring](https://github.com/cometbft/cometbft/pull/6634). This refactoring is also giving us
+[pluggable event indexing engines](https://github.com/cometbft/cometbft/pull/6411), so we can use eg. PostgreSQL to
store and query the events with more powerful indexes.
However, currently (until Tendermint 0.34 used in Cosmos SDK 0.40-0.43), all events of one transaction are "flat-mapped" on type.
diff --git a/Makefile b/Makefile
index d85996fbe9..7e1f57de9f 100644
--- a/Makefile
+++ b/Makefile
@@ -142,7 +142,11 @@ test-sim-import-export: runsim
test-sim-multi-seed-short: runsim
@echo "Running short multi-seed application simulation. This may take awhile!"
- @$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 10 TestFullAppSimulation
+ @$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 5 TestFullAppSimulation
+
+test-sim-deterministic: runsim
+ @echo "Running short multi-seed application simulation. This may take awhile!"
+ @$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 1 1 TestAppStateDeterminism
###############################################################################
### Linting ###
@@ -166,20 +170,19 @@ format: format-tools
###############################################################################
### Protobuf ###
###############################################################################
-PROTO_BUILDER_IMAGE=tendermintdev/sdk-proto-gen:v0.7
-PROTO_FORMATTER_IMAGE=tendermintdev/docker-build-proto@sha256:aabcfe2fc19c31c0f198d4cd26393f5e5ca9502d7ea3feafbfe972448fee7cae
+protoVer=0.11.5
+protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
+protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)
proto-all: proto-format proto-lint proto-gen format
proto-gen:
@echo "Generating Protobuf files"
- $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(PROTO_BUILDER_IMAGE) sh ./scripts/protocgen.sh
+ @$(protoImage) sh ./scripts/protocgen.sh
proto-format:
@echo "Formatting Protobuf files"
- $(DOCKER) run --rm -v $(CURDIR):/workspace \
- --workdir /workspace $(PROTO_FORMATTER_IMAGE) \
- find ./ -name *.proto -exec clang-format -i {} \;
+ @$(protoImage) find ./ -name "*.proto" -exec clang-format -i {} \;
proto-swagger-gen:
@./scripts/protoc-swagger-gen.sh
diff --git a/app/ante.go b/app/ante.go
index e5dd75a938..56828d7a28 100644
--- a/app/ante.go
+++ b/app/ante.go
@@ -1,11 +1,12 @@
package app
import (
+ storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
- ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante"
- "github.com/cosmos/ibc-go/v4/modules/core/keeper"
+ ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
+ "github.com/cosmos/ibc-go/v7/modules/core/keeper"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types"
@@ -18,7 +19,7 @@ type HandlerOptions struct {
IBCKeeper *keeper.Keeper
WasmConfig *wasmTypes.WasmConfig
- TXCounterStoreKey sdk.StoreKey
+ TXCounterStoreKey storetypes.StoreKey
}
func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
@@ -38,29 +39,22 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "tx counter key is required for ante builder")
}
- sigGasConsumer := options.SigGasConsumer
- if sigGasConsumer == nil {
- sigGasConsumer = ante.DefaultSigVerificationGasConsumer
- }
-
anteDecorators := []sdk.AnteDecorator{
ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
wasmkeeper.NewLimitSimulationGasDecorator(options.WasmConfig.SimulationGasLimit), // after setup context to enforce limits early
wasmkeeper.NewCountTXDecorator(options.TXCounterStoreKey),
- ante.NewRejectExtensionOptionsDecorator(),
- ante.NewMempoolFeeDecorator(),
+ ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
ante.NewValidateBasicDecorator(),
ante.NewTxTimeoutHeightDecorator(),
ante.NewValidateMemoDecorator(options.AccountKeeper),
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
- ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper),
- // SetPubKeyDecorator must be called before all signature verification decorators
- ante.NewSetPubKeyDecorator(options.AccountKeeper),
+ ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker),
+ ante.NewSetPubKeyDecorator(options.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators
ante.NewValidateSigCountDecorator(options.AccountKeeper),
- ante.NewSigGasConsumeDecorator(options.AccountKeeper, sigGasConsumer),
+ ante.NewSigGasConsumeDecorator(options.AccountKeeper, options.SigGasConsumer),
ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler),
ante.NewIncrementSequenceDecorator(options.AccountKeeper),
- ibcante.NewAnteDecorator(options.IBCKeeper),
+ ibcante.NewRedundantRelayDecorator(options.IBCKeeper),
}
return sdk.ChainAnteDecorators(anteDecorators...), nil
diff --git a/app/app.go b/app/app.go
index 55d8f7ccec..f1146a2601 100644
--- a/app/app.go
+++ b/app/app.go
@@ -1,29 +1,38 @@
package app
import (
+ "encoding/json"
"fmt"
"io"
- "net/http"
"os"
"path/filepath"
"strings"
+ autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
+ reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1"
+
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
+ "github.com/cosmos/cosmos-sdk/client/flags"
+ nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node"
"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/runtime"
+ runtimeservices "github.com/cosmos/cosmos-sdk/runtime/services"
+ "github.com/cosmos/cosmos-sdk/server"
"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"
+ "github.com/cosmos/cosmos-sdk/store/streaming"
+ storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
+ "github.com/cosmos/cosmos-sdk/version"
"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"
+ "github.com/cosmos/cosmos-sdk/x/auth/posthandler"
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"
@@ -38,11 +47,13 @@ import (
"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/consensus"
+ consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper"
+ consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/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"
@@ -56,9 +67,17 @@ import (
"github.com/cosmos/cosmos-sdk/x/gov"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
+ govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
+ govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
+ "github.com/cosmos/cosmos-sdk/x/group"
+ groupkeeper "github.com/cosmos/cosmos-sdk/x/group/keeper"
+ groupmodule "github.com/cosmos/cosmos-sdk/x/group/module"
"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/nft"
+ nftkeeper "github.com/cosmos/cosmos-sdk/x/nft/keeper"
+ nftmodule "github.com/cosmos/cosmos-sdk/x/nft/module"
"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"
@@ -74,53 +93,63 @@ import (
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"
- icacontroller "github.com/cosmos/ibc-go/v4/modules/apps/27-interchain-accounts/controller"
- 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"
- ibcfee "github.com/cosmos/ibc-go/v4/modules/apps/29-fee"
- ibcfeekeeper "github.com/cosmos/ibc-go/v4/modules/apps/29-fee/keeper"
- ibcfeetypes "github.com/cosmos/ibc-go/v4/modules/apps/29-fee/types"
- transfer "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"
- porttypes "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"
+ ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts"
+ icacontroller "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller"
+ icacontrollerkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/keeper"
+ icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types"
+ icahost "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host"
+ icahostkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/keeper"
+ icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types"
+ icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types"
+ ibcfee "github.com/cosmos/ibc-go/v7/modules/apps/29-fee"
+ ibcfeekeeper "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/keeper"
+ ibcfeetypes "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/types"
+ transfer "github.com/cosmos/ibc-go/v7/modules/apps/transfer"
+ ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper"
+ ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
+ ibc "github.com/cosmos/ibc-go/v7/modules/core"
+ ibcclient "github.com/cosmos/ibc-go/v7/modules/core/02-client"
+ ibcclientclient "github.com/cosmos/ibc-go/v7/modules/core/02-client/client"
+ ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
+ porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types"
+ ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
+ ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
+ ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"
+ ibcmock "github.com/cosmos/ibc-go/v7/testing/mock"
+
+ "github.com/CosmWasm/wasmd/x/tokenfactory/bindings"
+ wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types"
// Note: please do your research before using this in production app, this is a demo and not an officially
// supported IBC team implementation. It has no known issues, but do your own research before using it.
intertx "github.com/cosmos/interchain-accounts/x/inter-tx"
intertxkeeper "github.com/cosmos/interchain-accounts/x/inter-tx/keeper"
intertxtypes "github.com/cosmos/interchain-accounts/x/inter-tx/types"
- "github.com/gorilla/mux"
- "github.com/rakyll/statik/fs"
+
+ dbm "github.com/cometbft/cometbft-db"
+ abci "github.com/cometbft/cometbft/abci/types"
+ "github.com/cometbft/cometbft/libs/log"
+ tmos "github.com/cometbft/cometbft/libs/os"
+ tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/spf13/cast"
- 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"
- tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
- dbm "github.com/tendermint/tm-db"
-
- wasmappparams "github.com/CosmWasm/wasmd/app/params"
+
"github.com/CosmWasm/wasmd/x/wasm"
wasmclient "github.com/CosmWasm/wasmd/x/wasm/client"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
+ // token factory
+ "github.com/CosmWasm/wasmd/x/tokenfactory"
+ tokenfactorykeeper "github.com/CosmWasm/wasmd/x/tokenfactory/keeper"
+ tokenfactorytypes "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+
// unnamed import of statik for swagger UI support
_ "github.com/cosmos/cosmos-sdk/client/docs/statik"
)
-const appName = "WasmApp"
+const (
+ appName = "WasmApp"
+ MockFeePort string = ibcmock.ModuleName + ibcfeetypes.ModuleName
+)
// We pull these out so we can set them with LDFLAGS in the Makefile
var (
@@ -180,7 +209,7 @@ var (
// and genesis verification.
ModuleBasics = module.NewBasicManager(
auth.AppModuleBasic{},
- genutil.AppModuleBasic{},
+ genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator),
bank.AppModuleBasic{},
capability.AppModuleBasic{},
staking.AppModuleBasic{},
@@ -188,29 +217,34 @@ var (
distr.AppModuleBasic{},
gov.NewAppModuleBasic(
append(
- wasmclient.ProposalHandlers, //nolint:staticcheck
+ wasmclient.ProposalHandlers,
paramsclient.ProposalHandler,
- distrclient.ProposalHandler,
- upgradeclient.ProposalHandler,
- upgradeclient.CancelProposalHandler,
+ upgradeclient.LegacyProposalHandler,
+ upgradeclient.LegacyCancelProposalHandler,
ibcclientclient.UpdateClientProposalHandler,
ibcclientclient.UpgradeProposalHandler,
- )...,
+ ),
),
params.AppModuleBasic{},
crisis.AppModuleBasic{},
slashing.AppModuleBasic{},
feegrantmodule.AppModuleBasic{},
- authzmodule.AppModuleBasic{},
- ibc.AppModuleBasic{},
upgrade.AppModuleBasic{},
evidence.AppModuleBasic{},
- transfer.AppModuleBasic{},
+ authzmodule.AppModuleBasic{},
+ groupmodule.AppModuleBasic{},
vesting.AppModuleBasic{},
+ nftmodule.AppModuleBasic{},
+ consensus.AppModuleBasic{},
+ // non sdk modules
wasm.AppModuleBasic{},
+ ibc.AppModuleBasic{},
+ ibctm.AppModuleBasic{},
+ transfer.AppModuleBasic{},
ica.AppModuleBasic{},
intertx.AppModuleBasic{},
ibcfee.AppModuleBasic{},
+ tokenfactory.AppModuleBasic{},
)
// module account permissions
@@ -221,53 +255,60 @@ var (
stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking},
stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking},
govtypes.ModuleName: {authtypes.Burner},
+ nft.ModuleName: nil,
ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
ibcfeetypes.ModuleName: nil,
icatypes.ModuleName: nil,
wasm.ModuleName: {authtypes.Burner},
+ tokenfactorytypes.ModuleName: {authtypes.Minter, authtypes.Burner},
}
)
var (
- _ simapp.App = (*WasmApp)(nil)
+ _ runtime.AppI = (*WasmApp)(nil)
_ servertypes.Application = (*WasmApp)(nil)
)
// WasmApp extended ABCI application
type WasmApp struct {
*baseapp.BaseApp
- legacyAmino *codec.LegacyAmino //nolint:staticcheck
+ legacyAmino *codec.LegacyAmino
appCodec codec.Codec
+ txConfig client.TxConfig
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
+ keys map[string]*storetypes.KVStoreKey
+ tkeys map[string]*storetypes.TransientStoreKey
+ memKeys map[string]*storetypes.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
- EvidenceKeeper evidencekeeper.Keeper
+ AccountKeeper authkeeper.AccountKeeper
+ AuthzKeeper authzkeeper.Keeper
+ BankKeeper bankkeeper.BaseKeeper
+
+ 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
+ EvidenceKeeper evidencekeeper.Keeper
+ FeeGrantKeeper feegrantkeeper.Keeper
+ GroupKeeper groupkeeper.Keeper
+ NFTKeeper nftkeeper.Keeper
+ ConsensusParamsKeeper consensusparamkeeper.Keeper
+
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
IBCFeeKeeper ibcfeekeeper.Keeper
ICAControllerKeeper icacontrollerkeeper.Keeper
+ TokenFactoryKeeper tokenfactorykeeper.Keeper
ICAHostKeeper icahostkeeper.Keeper
InterTxKeeper intertxkeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
- FeeGrantKeeper feegrantkeeper.Keeper
- AuthzKeeper authzkeeper.Keeper
WasmKeeper wasm.Keeper
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
@@ -279,7 +320,7 @@ type WasmApp struct {
ScopedWasmKeeper capabilitykeeper.ScopedKeeper
// the module manager
- mm *module.Manager
+ ModuleManager *module.Manager
// simulation manager
sm *module.SimulationManager
@@ -294,39 +335,66 @@ func NewWasmApp(
db dbm.DB,
traceStore io.Writer,
loadLatest bool,
- skipUpgradeHeights map[int64]bool,
- homePath string,
- invCheckPeriod uint,
- encodingConfig wasmappparams.EncodingConfig,
enabledProposals []wasm.ProposalType,
appOpts servertypes.AppOptions,
wasmOpts []wasm.Option,
baseAppOptions ...func(*baseapp.BaseApp),
) *WasmApp {
+ encodingConfig := MakeEncodingConfig()
+
appCodec, legacyAmino := encodingConfig.Marshaler, encodingConfig.Amino
interfaceRegistry := encodingConfig.InterfaceRegistry
+ txConfig := encodingConfig.TxConfig
- bApp := baseapp.NewBaseApp(appName, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...)
+ bApp := baseapp.NewBaseApp(appName, logger, db, txConfig.TxDecoder(), baseAppOptions...)
bApp.SetCommitMultiStoreTracer(traceStore)
+ bApp.SetVersion(version.Version)
bApp.SetInterfaceRegistry(interfaceRegistry)
+ bApp.SetTxEncoder(txConfig.TxEncoder())
keys := sdk.NewKVStoreKeys(
- authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey,
- minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey,
- govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey,
- evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey,
- feegrant.StoreKey, authzkeeper.StoreKey, wasm.StoreKey, icahosttypes.StoreKey,
- icacontrollertypes.StoreKey, intertxtypes.StoreKey, ibcfeetypes.StoreKey,
+ authtypes.StoreKey,
+ banktypes.StoreKey,
+ stakingtypes.StoreKey,
+ crisistypes.StoreKey,
+ minttypes.StoreKey,
+ distrtypes.StoreKey,
+ slashingtypes.StoreKey,
+ govtypes.StoreKey,
+ paramstypes.StoreKey,
+ consensusparamtypes.StoreKey,
+ upgradetypes.StoreKey,
+ feegrant.StoreKey,
+ evidencetypes.StoreKey,
+ capabilitytypes.StoreKey,
+ authzkeeper.StoreKey,
+ nftkeeper.StoreKey,
+ group.StoreKey,
+ // non sdk store keys
+ ibcexported.StoreKey,
+ ibctransfertypes.StoreKey,
+ ibcfeetypes.StoreKey,
+ wasm.StoreKey,
+ icahosttypes.StoreKey,
+ icacontrollertypes.StoreKey,
+ tokenfactorytypes.StoreKey,
)
+
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)
+ // load state streaming if enabled
+ if _, _, err := streaming.LoadStreamingServices(bApp, appOpts, appCodec, logger, keys); err != nil {
+ logger.Error("failed to load state streaming", "err", err)
+ os.Exit(1)
+ }
+
app := &WasmApp{
BaseApp: bApp,
legacyAmino: legacyAmino,
appCodec: appCodec,
+ txConfig: txConfig,
interfaceRegistry: interfaceRegistry,
- invCheckPeriod: invCheckPeriod,
keys: keys,
tkeys: tkeys,
memKeys: memKeys,
@@ -340,7 +408,8 @@ func NewWasmApp(
)
// set the BaseApp's parameter store
- bApp.SetParamStore(app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramskeeper.ConsensusParamsKeyTable()))
+ app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(appCodec, keys[upgradetypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String())
+ bApp.SetParamStore(&app.ConsensusParamsKeeper)
// add capability keeper and ScopeToModule for ibc module
app.CapabilityKeeper = capabilitykeeper.NewKeeper(
@@ -348,7 +417,8 @@ func NewWasmApp(
keys[capabilitytypes.StoreKey],
memKeys[capabilitytypes.MemStoreKey],
)
- scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibchost.ModuleName)
+
+ scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibcexported.ModuleName)
scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName)
scopedICAControllerKeeper := app.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName)
scopedInterTxKeeper := app.CapabilityKeeper.ScopeToModule(intertxtypes.ModuleName)
@@ -360,100 +430,173 @@ func NewWasmApp(
app.AccountKeeper = authkeeper.NewAccountKeeper(
appCodec,
keys[authtypes.StoreKey],
- app.getSubspace(authtypes.ModuleName),
authtypes.ProtoBaseAccount,
maccPerms,
+ Bech32Prefix,
+ authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
app.BankKeeper = bankkeeper.NewBaseKeeper(
appCodec,
keys[banktypes.StoreKey],
app.AccountKeeper,
- app.getSubspace(banktypes.ModuleName),
- app.ModuleAccountAddrs(),
+ BlockedAddresses(),
+ authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
- app.AuthzKeeper = authzkeeper.NewKeeper(
- keys[authzkeeper.StoreKey],
+ app.StakingKeeper = stakingkeeper.NewKeeper(
appCodec,
- app.BaseApp.MsgServiceRouter(),
+ keys[stakingtypes.StoreKey],
+ app.AccountKeeper,
+ app.BankKeeper,
+ authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
app.FeeGrantKeeper = feegrantkeeper.NewKeeper(
appCodec,
keys[feegrant.StoreKey],
app.AccountKeeper,
)
- 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.StakingKeeper,
app.AccountKeeper,
app.BankKeeper,
authtypes.FeeCollectorName,
+ authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
app.DistrKeeper = distrkeeper.NewKeeper(
appCodec,
keys[distrtypes.StoreKey],
- app.getSubspace(distrtypes.ModuleName),
app.AccountKeeper,
app.BankKeeper,
- &stakingKeeper,
+ app.StakingKeeper,
authtypes.FeeCollectorName,
- app.ModuleAccountAddrs(),
+ authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
+
app.SlashingKeeper = slashingkeeper.NewKeeper(
appCodec,
+ legacyAmino,
keys[slashingtypes.StoreKey],
- &stakingKeeper,
- app.getSubspace(slashingtypes.ModuleName),
+ app.StakingKeeper,
+ authtypes.NewModuleAddress(govtypes.ModuleName).String(),
+ )
+
+ app.TokenFactoryKeeper = tokenfactorykeeper.NewKeeper(
+ keys[tokenfactorytypes.StoreKey],
+ app.GetSubspace(tokenfactorytypes.ModuleName),
+ app.AccountKeeper,
+ app.BankKeeper,
+ app.DistrKeeper,
)
+
+ invCheckPeriod := cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod))
app.CrisisKeeper = crisiskeeper.NewKeeper(
- app.getSubspace(crisistypes.ModuleName),
+ appCodec,
+ keys[crisistypes.StoreKey],
invCheckPeriod,
app.BankKeeper,
authtypes.FeeCollectorName,
+ authtypes.NewModuleAddress(govtypes.ModuleName).String(),
+ )
+
+ app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, keys[feegrant.StoreKey], app.AccountKeeper)
+
+ // register the staking hooks
+ // NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks
+ app.StakingKeeper.SetHooks(
+ stakingtypes.NewMultiStakingHooks(app.DistrKeeper.Hooks(), app.SlashingKeeper.Hooks()),
)
+
+ app.AuthzKeeper = authzkeeper.NewKeeper(keys[authzkeeper.StoreKey], appCodec, app.MsgServiceRouter(), app.AccountKeeper)
+
+ groupConfig := group.DefaultConfig()
+ /*
+ Example of setting group params:
+ groupConfig.MaxMetadataLen = 1000
+ */
+ app.GroupKeeper = groupkeeper.NewKeeper(keys[group.StoreKey], appCodec, app.MsgServiceRouter(), app.AccountKeeper, groupConfig)
+
+ // get skipUpgradeHeights from the app options
+ skipUpgradeHeights := map[int64]bool{}
+ for _, h := range cast.ToIntSlice(appOpts.Get(server.FlagUnsafeSkipUpgrades)) {
+ skipUpgradeHeights[int64(h)] = true
+ }
+ homePath := cast.ToString(appOpts.Get(flags.FlagHome))
+ // set the governance module account as the authority for conducting upgrades
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()),
+ authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
app.IBCKeeper = ibckeeper.NewKeeper(
appCodec,
- keys[ibchost.StoreKey],
- app.getSubspace(ibchost.ModuleName),
+ keys[ibcexported.StoreKey],
+ app.GetSubspace(ibcexported.ModuleName),
app.StakingKeeper,
app.UpgradeKeeper,
scopedIBCKeeper,
)
- // register the proposal types
- govRouter := govtypes.NewRouter()
- govRouter.
- AddRoute(govtypes.RouterKey, govtypes.ProposalHandler).
+ // Register the proposal types
+ // Deprecated: Avoid adding new handlers, instead use the new proposal flow
+ // by granting the governance module the right to execute the message.
+ // See: https://github.com/cosmos/cosmos-sdk/blob/release/v0.46.x/x/gov/spec/01_concepts.md#proposal-messages
+ govRouter := govv1beta1.NewRouter()
+ govRouter.AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler).
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)).
- AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)).
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)).
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper))
+ govConfig := govtypes.DefaultConfig()
+ /*
+ Example of setting gov params:
+ govConfig.MaxMetadataLen = 10000
+ */
+ govKeeper := govkeeper.NewKeeper(
+ appCodec,
+ keys[govtypes.StoreKey],
+ app.AccountKeeper,
+ app.BankKeeper,
+ app.StakingKeeper,
+ app.MsgServiceRouter(),
+ govConfig,
+ authtypes.NewModuleAddress(govtypes.ModuleName).String(),
+ )
+
+ app.GovKeeper = *govKeeper.SetHooks(
+ govtypes.NewMultiGovHooks(
+ // register the governance hooks
+ ),
+ )
+
+ // RegisterUpgradeHandlers is used for registering any on-chain upgrades.
+ // app.RegisterUpgradeHandlers()
+
+ app.NFTKeeper = nftkeeper.NewKeeper(
+ keys[nftkeeper.StoreKey],
+ appCodec,
+ app.AccountKeeper,
+ app.BankKeeper,
+ )
+
+ // create evidence keeper with router
+ 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
+
// IBC Fee Module keeper
app.IBCFeeKeeper = ibcfeekeeper.NewKeeper(
- appCodec, keys[ibcfeetypes.StoreKey], app.getSubspace(ibcfeetypes.ModuleName),
+ appCodec, keys[ibcfeetypes.StoreKey],
app.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware
app.IBCKeeper.ChannelKeeper,
&app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper,
@@ -463,7 +606,7 @@ func NewWasmApp(
app.TransferKeeper = ibctransferkeeper.NewKeeper(
appCodec,
keys[ibctransfertypes.StoreKey],
- app.getSubspace(ibctransfertypes.ModuleName),
+ app.GetSubspace(ibctransfertypes.ModuleName),
app.IBCFeeKeeper, // ISC4 Wrapper: fee IBC middleware
app.IBCKeeper.ChannelKeeper,
&app.IBCKeeper.PortKeeper,
@@ -472,10 +615,19 @@ func NewWasmApp(
scopedTransferKeeper,
)
+ // IBC Fee Module keeper
+ app.IBCFeeKeeper = ibcfeekeeper.NewKeeper(
+ appCodec, keys[ibcfeetypes.StoreKey],
+ app.IBCKeeper.ChannelKeeper, // may be replaced with IBC middleware
+ app.IBCKeeper.ChannelKeeper,
+ &app.IBCKeeper.PortKeeper, app.AccountKeeper, app.BankKeeper,
+ )
+
app.ICAHostKeeper = icahostkeeper.NewKeeper(
appCodec,
keys[icahosttypes.StoreKey],
- app.getSubspace(icahosttypes.SubModuleName),
+ app.GetSubspace(icahosttypes.SubModuleName),
+ app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack
app.IBCKeeper.ChannelKeeper,
&app.IBCKeeper.PortKeeper,
app.AccountKeeper,
@@ -485,7 +637,7 @@ func NewWasmApp(
app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper(
appCodec,
keys[icacontrollertypes.StoreKey],
- app.getSubspace(icacontrollertypes.SubModuleName),
+ app.GetSubspace(icacontrollertypes.SubModuleName),
app.IBCFeeKeeper, // use ics29 fee as ics4Wrapper in middleware stack
app.IBCKeeper.ChannelKeeper,
&app.IBCKeeper.PortKeeper,
@@ -494,15 +646,8 @@ func NewWasmApp(
)
// For wasmd we use the demo controller from https://github.com/cosmos/interchain-accounts but see notes below
- app.InterTxKeeper = intertxkeeper.NewKeeper(appCodec, keys[intertxtypes.StoreKey], app.ICAControllerKeeper, scopedInterTxKeeper)
+ app.InterTxKeeper = intertxkeeper.NewKeeper(appCodec, keys[intertxtypes.StoreKey], app.ICAControllerKeeper, app.ScopedInterTxKeeper)
- // create evidence keeper with router
- evidenceKeeper := evidencekeeper.NewKeeper(
- appCodec,
- keys[evidencetypes.StoreKey],
- &app.StakingKeeper,
- app.SlashingKeeper,
- )
app.EvidenceKeeper = *evidenceKeeper
wasmDir := filepath.Join(homePath, "wasm")
@@ -514,15 +659,16 @@ func NewWasmApp(
// The last arguments can contain custom message handlers, and custom query handlers,
// if we want to allow any custom callbacks
// See https://github.com/CosmWasm/cosmwasm/blob/main/docs/CAPABILITIES-BUILT-IN.md
- availableCapabilities := "iterator,staking,stargate,cosmwasm_1_1,cosmwasm_1_2"
+ availableCapabilities := "iterator,staking,stargate,cosmwasm_1_1,cosmwasm_1_2,token_factory"
+ wasmOpts = append(bindings.RegisterCustomPlugins(&app.BankKeeper, &app.TokenFactoryKeeper), wasmOpts...)
app.WasmKeeper = wasm.NewKeeper(
appCodec,
keys[wasm.StoreKey],
- app.getSubspace(wasm.ModuleName),
+ app.GetSubspace(wasm.ModuleName),
app.AccountKeeper,
app.BankKeeper,
app.StakingKeeper,
- app.DistrKeeper,
+ distrkeeper.NewQuerier(app.DistrKeeper),
app.IBCKeeper.ChannelKeeper,
&app.IBCKeeper.PortKeeper,
scopedWasmKeeper,
@@ -539,6 +685,7 @@ func NewWasmApp(
if len(enabledProposals) != 0 {
govRouter.AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(app.WasmKeeper, enabledProposals))
}
+ app.GovKeeper.SetLegacyRouter(govRouter)
// Create Transfer Stack
var transferStack porttypes.IBCModule
@@ -577,15 +724,6 @@ func NewWasmApp(
AddRoute(icahosttypes.SubModuleName, icaHostStack)
app.IBCKeeper.SetRouter(ibcRouter)
- app.GovKeeper = govkeeper.NewKeeper(
- appCodec,
- keys[govtypes.StoreKey],
- app.getSubspace(govtypes.ModuleName),
- app.AccountKeeper,
- app.BankKeeper,
- &stakingKeeper,
- govRouter,
- )
/**** Module Options ****/
// NOTE: we may consider parsing `appOpts` inside module constructors. For the moment
@@ -594,185 +732,140 @@ func NewWasmApp(
// NOTE: Any module instantiated in the module manager that is later modified
// must be passed by reference here.
- app.mm = module.NewManager(
+ app.ModuleManager = module.NewManager(
genutil.NewAppModule(
app.AccountKeeper,
app.StakingKeeper,
app.BaseApp.DeliverTx,
encodingConfig.TxConfig,
),
- auth.NewAppModule(appCodec, app.AccountKeeper, nil),
+ auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)),
vesting.NewAppModule(app.AccountKeeper, app.BankKeeper),
- bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper),
- capability.NewAppModule(appCodec, *app.CapabilityKeeper),
- 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),
+ bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)),
+ capability.NewAppModule(appCodec, *app.CapabilityKeeper, false),
+ feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry),
+ gov.NewAppModule(appCodec, &app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)),
+ mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)),
+ slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName)),
+ distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)),
+ staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)),
upgrade.NewAppModule(app.UpgradeKeeper),
- wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper),
evidence.NewAppModule(app.EvidenceKeeper),
- feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry),
+ params.NewAppModule(app.ParamsKeeper),
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
+ groupmodule.NewAppModule(appCodec, app.GroupKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
+ nftmodule.NewAppModule(appCodec, app.NFTKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
+ consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper),
+ tokenfactory.NewAppModule(app.TokenFactoryKeeper, app.AccountKeeper, app.BankKeeper),
+ wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter()),
ibc.NewAppModule(app.IBCKeeper),
- params.NewAppModule(app.ParamsKeeper),
transfer.NewAppModule(app.TransferKeeper),
ibcfee.NewAppModule(app.IBCFeeKeeper),
ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper),
- intertx.NewAppModule(appCodec, app.InterTxKeeper),
- crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants), // always be last to make sure that it checks for all invariants and not only part of them
+ crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), // always be last to make sure that it checks for all invariants and not only part of them
)
// 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,
- capabilitytypes.ModuleName,
- minttypes.ModuleName,
- distrtypes.ModuleName,
- slashingtypes.ModuleName,
- evidencetypes.ModuleName,
- stakingtypes.ModuleName,
- authtypes.ModuleName,
- banktypes.ModuleName,
- govtypes.ModuleName,
- crisistypes.ModuleName,
- genutiltypes.ModuleName,
- authz.ModuleName,
- feegrant.ModuleName,
- paramstypes.ModuleName,
- vestingtypes.ModuleName,
+ // NOTE: capability module's beginblocker must come before any modules using capabilities (e.g. IBC)
+ app.ModuleManager.SetOrderBeginBlockers(
+ upgradetypes.ModuleName, capabilitytypes.ModuleName, minttypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName,
+ evidencetypes.ModuleName, stakingtypes.ModuleName,
+ authtypes.ModuleName, banktypes.ModuleName, govtypes.ModuleName, crisistypes.ModuleName, genutiltypes.ModuleName,
+ authz.ModuleName, feegrant.ModuleName, nft.ModuleName, group.ModuleName,
+ paramstypes.ModuleName, vestingtypes.ModuleName, consensusparamtypes.ModuleName,
// additional non simd modules
ibctransfertypes.ModuleName,
- ibchost.ModuleName,
+ ibcexported.ModuleName,
icatypes.ModuleName,
ibcfeetypes.ModuleName,
- intertxtypes.ModuleName,
+ tokenfactorytypes.ModuleName,
wasm.ModuleName,
)
- app.mm.SetOrderEndBlockers(
- crisistypes.ModuleName,
- govtypes.ModuleName,
- stakingtypes.ModuleName,
- capabilitytypes.ModuleName,
- authtypes.ModuleName,
- banktypes.ModuleName,
- distrtypes.ModuleName,
- slashingtypes.ModuleName,
- minttypes.ModuleName,
- genutiltypes.ModuleName,
- evidencetypes.ModuleName,
- authz.ModuleName,
- feegrant.ModuleName,
- paramstypes.ModuleName,
- upgradetypes.ModuleName,
- vestingtypes.ModuleName,
+ app.ModuleManager.SetOrderEndBlockers(
+ crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName,
+ capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName,
+ slashingtypes.ModuleName, minttypes.ModuleName,
+ genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName,
+ feegrant.ModuleName, nft.ModuleName, group.ModuleName,
+ paramstypes.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName, consensusparamtypes.ModuleName,
// additional non simd modules
ibctransfertypes.ModuleName,
- ibchost.ModuleName,
+ ibcexported.ModuleName,
icatypes.ModuleName,
ibcfeetypes.ModuleName,
- intertxtypes.ModuleName,
+ tokenfactorytypes.ModuleName,
wasm.ModuleName,
)
// NOTE: The genutils module must occur after staking so that pools are
// properly initialized with tokens from genesis accounts.
+ // NOTE: The genutils module must also occur after auth so that it can access the params from auth.
// 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,
- genutiltypes.ModuleName,
- evidencetypes.ModuleName,
- authz.ModuleName,
- feegrant.ModuleName,
- paramstypes.ModuleName,
- upgradetypes.ModuleName,
- vestingtypes.ModuleName,
+ genesisModuleOrder := []string{
+ capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName,
+ distrtypes.ModuleName, stakingtypes.ModuleName, slashingtypes.ModuleName, govtypes.ModuleName,
+ minttypes.ModuleName, crisistypes.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authz.ModuleName,
+ feegrant.ModuleName, nft.ModuleName, group.ModuleName, paramstypes.ModuleName, upgradetypes.ModuleName,
+ vestingtypes.ModuleName, consensusparamtypes.ModuleName,
// additional non simd modules
ibctransfertypes.ModuleName,
- ibchost.ModuleName,
+ ibcexported.ModuleName,
icatypes.ModuleName,
ibcfeetypes.ModuleName,
- intertxtypes.ModuleName,
// wasm after ibc transfer
+ tokenfactorytypes.ModuleName,
wasm.ModuleName,
- )
+ }
+ app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...)
+ app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...)
// Uncomment if you want to set a custom migration order here.
- // app.mm.SetOrderMigrations(custom order)
-
- app.mm.RegisterInvariants(&app.CrisisKeeper)
- app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino)
+ // app.ModuleManager.SetOrderMigrations(custom order)
+ app.ModuleManager.RegisterInvariants(app.CrisisKeeper)
app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter())
- app.mm.RegisterServices(app.configurator)
+ app.ModuleManager.RegisterServices(app.configurator)
+
+ autocliv1.RegisterQueryServer(app.GRPCQueryRouter(), runtimeservices.NewAutoCLIQueryService(app.ModuleManager.Modules))
+
+ reflectionSvc, err := runtimeservices.NewReflectionService()
+ if err != nil {
+ panic(err)
+ }
+ reflectionv1.RegisterReflectionServiceServer(app.GRPCQueryRouter(), reflectionSvc)
+
+ // add test gRPC service for testing gRPC queries in isolation
+ // testdata_pulsar.RegisterQueryServer(app.GRPCQueryRouter(), testdata_pulsar.QueryImpl{})
// create the simulation manager and define the order of the modules for deterministic simulations
//
// NOTE: this is not required apps that don't use the simulator for fuzz testing
// transactions
- 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),
- authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, 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),
- transfer.NewAppModule(app.TransferKeeper),
- )
+ overrideModules := map[string]module.AppModuleSimulation{
+ authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)),
+ }
+ app.sm = module.NewSimulationManagerFromAppModules(app.ModuleManager.Modules, overrideModules)
app.sm.RegisterStoreDecoders()
+
// initialize stores
app.MountKVStores(keys)
app.MountTransientStores(tkeys)
app.MountMemoryStores(memKeys)
- anteHandler, err := NewAnteHandler(
- HandlerOptions{
- HandlerOptions: ante.HandlerOptions{
- AccountKeeper: app.AccountKeeper,
- BankKeeper: app.BankKeeper,
- FeegrantKeeper: app.FeeGrantKeeper,
- SignModeHandler: encodingConfig.TxConfig.SignModeHandler(),
- SigGasConsumer: ante.DefaultSigVerificationGasConsumer,
- },
- IBCKeeper: app.IBCKeeper,
- WasmConfig: &wasmConfig,
- TXCounterStoreKey: keys[wasm.StoreKey],
- },
- )
- if err != nil {
- panic(fmt.Errorf("failed to create AnteHandler: %s", err))
- }
-
- app.SetAnteHandler(anteHandler)
+ // initialize BaseApp
app.SetInitChainer(app.InitChainer)
app.SetBeginBlocker(app.BeginBlocker)
app.SetEndBlocker(app.EndBlocker)
+ app.setAnteHandler(encodingConfig.TxConfig, wasmConfig, keys[wasm.StoreKey])
// must be before Loading version
// requires the snapshot store to be created and registered as a BaseAppOption
@@ -793,9 +886,30 @@ func NewWasmApp(
app.ScopedICAControllerKeeper = scopedICAControllerKeeper
app.ScopedInterTxKeeper = scopedInterTxKeeper
+ // In v0.46, the SDK introduces _postHandlers_. PostHandlers are like
+ // antehandlers, but are run _after_ the `runMsgs` execution. They are also
+ // defined as a chain, and have the same signature as antehandlers.
+ //
+ // In baseapp, postHandlers are run in the same store branch as `runMsgs`,
+ // meaning that both `runMsgs` and `postHandler` state will be committed if
+ // both are successful, and both will be reverted if any of the two fails.
+ //
+ // The SDK exposes a default postHandlers chain, which comprises of only
+ // one decorator: the Transaction Tips decorator. However, some chains do
+ // not need it by default, so feel free to comment the next line if you do
+ // not need tips.
+ // To read more about tips:
+ // https://docs.cosmos.network/main/core/tips.html
+ //
+ // Please note that changing any of the anteHandler or postHandler chain is
+ // likely to be a state-machine breaking change, which needs a coordinated
+ // upgrade.
+ app.setPostHandler()
+
if loadLatest {
if err := app.LoadLatestVersion(); err != nil {
- tmos.Exit(fmt.Sprintf("failed to load latest version: %s", err))
+ logger.Error("error on loading last version", "err", err)
+ os.Exit(1)
}
ctx := app.BaseApp.NewUncachedContext(true, tmproto.Header{})
@@ -808,39 +922,63 @@ func NewWasmApp(
return app
}
-// Name returns the name of the App
-func (app *WasmApp) Name() string { return app.BaseApp.Name() }
-
-// ModuleManager returns instance
-func (app *WasmApp) ModuleManager() module.Manager {
- return *app.mm
+func (app *WasmApp) setAnteHandler(txConfig client.TxConfig, wasmConfig wasmTypes.WasmConfig, txCounterStoreKey storetypes.StoreKey) {
+ anteHandler, err := NewAnteHandler(
+ HandlerOptions{
+ HandlerOptions: ante.HandlerOptions{
+ AccountKeeper: app.AccountKeeper,
+ BankKeeper: app.BankKeeper,
+ SignModeHandler: txConfig.SignModeHandler(),
+ FeegrantKeeper: app.FeeGrantKeeper,
+ SigGasConsumer: ante.DefaultSigVerificationGasConsumer,
+ },
+ IBCKeeper: app.IBCKeeper,
+ WasmConfig: &wasmConfig,
+ TXCounterStoreKey: txCounterStoreKey,
+ },
+ )
+ if err != nil {
+ panic(fmt.Errorf("failed to create AnteHandler: %s", err))
+ }
+ app.SetAnteHandler(anteHandler)
}
-// ModuleConfigurator returns instance
-func (app *WasmApp) ModuleConfigurator() module.Configurator {
- return app.configurator
+func (app *WasmApp) setPostHandler() {
+ postHandler, err := posthandler.NewPostHandler(
+ posthandler.HandlerOptions{},
+ )
+ if err != nil {
+ panic(err)
+ }
+
+ app.SetPostHandler(postHandler)
}
+// Name returns the name of the App
+func (app *WasmApp) Name() string { return app.BaseApp.Name() }
+
// BeginBlocker application updates every begin block
func (app *WasmApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {
- return app.mm.BeginBlock(ctx, req)
+ return app.ModuleManager.BeginBlock(ctx, req)
}
// EndBlocker application updates every end block
func (app *WasmApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock {
- return app.mm.EndBlock(ctx, req)
+ return app.ModuleManager.EndBlock(ctx, req)
+}
+
+func (app *WasmApp) Configurator() module.Configurator {
+ return app.configurator
}
// InitChainer application update at chain initialization
func (app *WasmApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain {
var genesisState GenesisState
- if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
+ if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
panic(err)
}
-
- app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap())
-
- return app.mm.InitGenesis(ctx, app.appCodec, genesisState)
+ app.UpgradeKeeper.SetModuleVersionMap(ctx, app.ModuleManager.GetVersionMap())
+ return app.ModuleManager.InitGenesis(ctx, app.appCodec, genesisState)
}
// LoadHeight loads a particular height
@@ -848,28 +986,57 @@ func (app *WasmApp) LoadHeight(height int64) error {
return app.LoadVersion(height)
}
-// ModuleAccountAddrs returns all the app's module account addresses.
-func (app *WasmApp) ModuleAccountAddrs() map[string]bool {
- modAccAddrs := make(map[string]bool)
- for acc := range maccPerms {
- modAccAddrs[authtypes.NewModuleAddress(acc).String()] = true
- }
-
- return modAccAddrs
-}
-
// LegacyAmino returns legacy 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 *WasmApp) LegacyAmino() *codec.LegacyAmino { //nolint:staticcheck
+func (app *WasmApp) LegacyAmino() *codec.LegacyAmino {
return app.legacyAmino
}
-// getSubspace returns a param subspace for a given module name.
+// AppCodec returns 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 *WasmApp) AppCodec() codec.Codec {
+ return app.appCodec
+}
+
+// InterfaceRegistry returns WasmApp's InterfaceRegistry
+func (app *WasmApp) InterfaceRegistry() types.InterfaceRegistry {
+ return app.interfaceRegistry
+}
+
+// TxConfig returns WasmApp's TxConfig
+func (app *WasmApp) TxConfig() client.TxConfig {
+ return app.txConfig
+}
+
+// GetKey returns the KVStoreKey for the provided store key.
//
// NOTE: This is solely to be used for testing purposes.
-func (app *WasmApp) getSubspace(moduleName string) paramstypes.Subspace {
+func (app *WasmApp) GetKey(storeKey string) *storetypes.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 *WasmApp) GetTKey(storeKey string) *storetypes.TransientStoreKey {
+ return app.tkeys[storeKey]
+}
+
+// GetMemKey returns the MemStoreKey for the provided mem key.
+//
+// NOTE: This is solely used for testing purposes.
+func (app *WasmApp) GetMemKey(storeKey string) *storetypes.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 *WasmApp) GetSubspace(moduleName string) paramstypes.Subspace {
subspace, _ := app.ParamsKeeper.GetSubspace(moduleName)
return subspace
}
@@ -883,21 +1050,21 @@ func (app *WasmApp) SimulationManager() *module.SimulationManager {
// API server.
func (app *WasmApp) 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)
+ // Register node gRPC service for grpc-gateway.
+ nodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)
+
+ // Register grpc-gateway routes for all modules.
ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)
// register swagger API from root so that other applications can override easily
- if apiConfig.Swagger {
- RegisterSwaggerAPI(apiSvr.Router)
+ if err := server.RegisterSwaggerAPI(apiSvr.ClientCtx, apiSvr.Router, apiConfig.Swagger); err != nil {
+ panic(err)
}
}
@@ -908,35 +1075,45 @@ func (app *WasmApp) RegisterTxService(clientCtx client.Context) {
// RegisterTendermintService implements the Application.RegisterTendermintService method.
func (app *WasmApp) RegisterTendermintService(clientCtx client.Context) {
- tmservice.RegisterTendermintService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.interfaceRegistry)
-}
-
-func (app *WasmApp) AppCodec() codec.Codec {
- return app.appCodec
+ tmservice.RegisterTendermintService(
+ clientCtx,
+ app.BaseApp.GRPCQueryRouter(),
+ app.interfaceRegistry,
+ app.Query,
+ )
}
-// RegisterSwaggerAPI registers swagger route with API Server
-func RegisterSwaggerAPI(rtr *mux.Router) {
- statikFS, err := fs.New()
- if err != nil {
- panic(err)
- }
-
- staticServer := http.FileServer(statikFS)
- rtr.PathPrefix("/swagger/").Handler(http.StripPrefix("/swagger/", staticServer))
+func (app *WasmApp) RegisterNodeService(clientCtx client.Context) {
+ nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter())
}
// GetMaccPerms returns a copy of the module account permissions
+//
+// NOTE: This is solely to be used for testing purposes.
func GetMaccPerms() map[string][]string {
dupMaccPerms := make(map[string][]string)
for k, v := range maccPerms {
dupMaccPerms[k] = v
}
+
return dupMaccPerms
}
+// BlockedAddresses returns all the app's blocked account addresses.
+func BlockedAddresses() map[string]bool {
+ modAccAddrs := make(map[string]bool)
+ for acc := range GetMaccPerms() {
+ modAccAddrs[authtypes.NewModuleAddress(acc).String()] = true
+ }
+
+ // allow the following addresses to receive funds
+ delete(modAccAddrs, authtypes.NewModuleAddress(govtypes.ModuleName).String())
+
+ return modAccAddrs
+}
+
// initParamsKeeper init params keeper and its subspaces
-func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey sdk.StoreKey) paramskeeper.Keeper {
+func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey) paramskeeper.Keeper {
paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey)
paramsKeeper.Subspace(authtypes.ModuleName)
@@ -945,10 +1122,11 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(minttypes.ModuleName)
paramsKeeper.Subspace(distrtypes.ModuleName)
paramsKeeper.Subspace(slashingtypes.ModuleName)
- paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypes.ParamKeyTable())
+ paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable()) //nolint:staticcheck
paramsKeeper.Subspace(crisistypes.ModuleName)
paramsKeeper.Subspace(ibctransfertypes.ModuleName)
- paramsKeeper.Subspace(ibchost.ModuleName)
+ paramsKeeper.Subspace(ibcexported.ModuleName)
+ paramsKeeper.Subspace(tokenfactorytypes.ModuleName)
paramsKeeper.Subspace(icahosttypes.SubModuleName)
paramsKeeper.Subspace(icacontrollertypes.SubModuleName)
paramsKeeper.Subspace(wasm.ModuleName)
diff --git a/app/app_test.go b/app/app_test.go
index 9a5ec80f88..dbcae4ee34 100644
--- a/app/app_test.go
+++ b/app/app_test.go
@@ -1,55 +1,49 @@
package app
import (
- "encoding/json"
"os"
"testing"
+ dbm "github.com/cometbft/cometbft-db"
+ "github.com/cometbft/cometbft/libs/log"
+ simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
+ sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- "github.com/tendermint/tendermint/libs/log"
- db "github.com/tendermint/tm-db"
-
- abci "github.com/tendermint/tendermint/abci/types"
"github.com/CosmWasm/wasmd/x/wasm"
)
-var emptyWasmOpts []wasm.Option = nil
+var emptyWasmOpts []wasm.Option
func TestWasmdExport(t *testing.T) {
- db := db.NewMemDB()
- gapp := NewWasmApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeEncodingConfig(), wasm.EnableAllProposals, EmptyBaseAppOptions{}, emptyWasmOpts)
-
- genesisState := NewDefaultGenesisState()
- stateBytes, err := json.MarshalIndent(genesisState, "", " ")
- require.NoError(t, err)
-
- // Initialize the chain
- gapp.InitChain(
- abci.RequestInitChain{
- Validators: []abci.ValidatorUpdate{},
- AppStateBytes: stateBytes,
- },
- )
+ db := dbm.NewMemDB()
+ gapp := NewWasmAppWithCustomOptions(t, false, SetupOptions{
+ Logger: log.NewTMLogger(log.NewSyncWriter(os.Stdout)),
+ DB: db,
+ AppOpts: simtestutil.NewAppOptionsWithFlagHome(t.TempDir()),
+ })
gapp.Commit()
// Making a new app object with the db, so that initchain hasn't been called
- newGapp := NewWasmApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeEncodingConfig(), wasm.EnableAllProposals, EmptyBaseAppOptions{}, emptyWasmOpts)
- _, err = newGapp.ExportAppStateAndValidators(false, []string{})
+ newGapp := NewWasmApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, wasm.EnableAllProposals, simtestutil.NewAppOptionsWithFlagHome(t.TempDir()), emptyWasmOpts)
+ _, err := newGapp.ExportAppStateAndValidators(false, []string{}, nil)
require.NoError(t, err, "ExportAppStateAndValidators should not have an error")
}
// ensure that blocked addresses are properly set in bank keeper
func TestBlockedAddrs(t *testing.T) {
- db := db.NewMemDB()
- gapp := NewWasmApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeEncodingConfig(), wasm.EnableAllProposals, EmptyBaseAppOptions{}, emptyWasmOpts)
+ gapp := Setup(t)
- for acc := range maccPerms {
+ for acc := range BlockedAddresses() {
t.Run(acc, func(t *testing.T) {
- require.True(t, gapp.BankKeeper.BlockedAddr(gapp.AccountKeeper.GetModuleAddress(acc)),
- "ensure that blocked addresses are properly set in bank keeper",
- )
+ var addr sdk.AccAddress
+ if modAddr, err := sdk.AccAddressFromBech32(acc); err == nil {
+ addr = modAddr
+ } else {
+ addr = gapp.AccountKeeper.GetModuleAddress(acc)
+ }
+ require.True(t, gapp.BankKeeper.BlockedAddr(addr), "ensure that blocked addresses are properly set in bank keeper")
})
}
}
@@ -89,22 +83,3 @@ func TestGetEnabledProposals(t *testing.T) {
})
}
}
-
-func setGenesis(gapp *WasmApp) error {
- genesisState := NewDefaultGenesisState()
- stateBytes, err := json.MarshalIndent(genesisState, "", " ")
- if err != nil {
- return err
- }
-
- // Initialize the chain
- gapp.InitChain(
- abci.RequestInitChain{
- Validators: []abci.ValidatorUpdate{},
- AppStateBytes: stateBytes,
- },
- )
-
- gapp.Commit()
- return nil
-}
diff --git a/app/apptesting/events.go b/app/apptesting/events.go
new file mode 100644
index 0000000000..f5a434937d
--- /dev/null
+++ b/app/apptesting/events.go
@@ -0,0 +1,17 @@
+package apptesting
+
+import sdk "github.com/cosmos/cosmos-sdk/types"
+
+// AssertEventEmitted asserts that ctx's event manager has emitted the given number of events
+// of the given type.
+func (s *KeeperTestHelper) AssertEventEmitted(ctx sdk.Context, eventTypeExpected string, numEventsExpected int) {
+ allEvents := ctx.EventManager().Events()
+ // filter out other events
+ actualEvents := make([]sdk.Event, 0)
+ for _, event := range allEvents {
+ if event.Type == eventTypeExpected {
+ actualEvents = append(actualEvents, event)
+ }
+ }
+ s.Equal(numEventsExpected, len(actualEvents))
+}
diff --git a/app/apptesting/test_suite.go b/app/apptesting/test_suite.go
new file mode 100644
index 0000000000..c98c7e846c
--- /dev/null
+++ b/app/apptesting/test_suite.go
@@ -0,0 +1,298 @@
+package apptesting
+
+import (
+ "encoding/json"
+ "fmt"
+ "os"
+ "testing"
+ "time"
+
+ "cosmossdk.io/math"
+ dbm "github.com/cometbft/cometbft-db"
+ abci "github.com/cometbft/cometbft/abci/types"
+ "github.com/cometbft/cometbft/crypto/ed25519"
+ "github.com/cometbft/cometbft/libs/log"
+ tmtypes "github.com/cometbft/cometbft/proto/tendermint/types"
+ "github.com/cosmos/cosmos-sdk/baseapp"
+ "github.com/cosmos/cosmos-sdk/client"
+ cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
+ "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
+ "github.com/cosmos/cosmos-sdk/store/rootmulti"
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ "github.com/cosmos/cosmos-sdk/types/tx/signing"
+ authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
+ "github.com/cosmos/cosmos-sdk/x/authz"
+ distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
+ slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
+ stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
+ "github.com/stretchr/testify/require"
+ "github.com/stretchr/testify/suite"
+
+ authzcodec "github.com/CosmWasm/wasmd/x/tokenfactory/types/authzcodec"
+
+ "github.com/CosmWasm/wasmd/app"
+ simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
+ minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
+)
+
+type KeeperTestHelper struct {
+ suite.Suite
+
+ App *app.WasmApp
+ Ctx sdk.Context
+ QueryHelper *baseapp.QueryServiceTestHelper
+ TestAccs []sdk.AccAddress
+}
+
+var (
+ SecondaryDenom = "uion"
+ SecondaryAmount = sdk.NewInt(100000000)
+)
+
+// Setup sets up basic environment for suite (App, Ctx, and test accounts)
+func (s *KeeperTestHelper) Setup() {
+ s.App = app.Setup(s.T())
+ s.Ctx = s.App.BaseApp.NewContext(false, tmtypes.Header{Height: 1, ChainID: "osmosis-1", Time: time.Now().UTC()})
+ s.QueryHelper = &baseapp.QueryServiceTestHelper{
+ GRPCQueryRouter: s.App.GRPCQueryRouter(),
+ Ctx: s.Ctx,
+ }
+ s.TestAccs = CreateRandomAccounts(3)
+}
+
+func (s *KeeperTestHelper) SetupTestForInitGenesis() {
+ db := dbm.NewMemDB()
+ s.App = app.NewWasmAppWithCustomOptions(s.T(), true, app.SetupOptions{
+ Logger: log.NewTMLogger(log.NewSyncWriter(os.Stdout)),
+ DB: db,
+ AppOpts: simtestutil.NewAppOptionsWithFlagHome(s.T().TempDir()),
+ })
+ s.Ctx = s.App.BaseApp.NewContext(true, tmtypes.Header{})
+}
+
+// CreateTestContext creates a test context.
+func (s *KeeperTestHelper) CreateTestContext() sdk.Context {
+ ctx, _ := s.CreateTestContextWithMultiStore()
+ return ctx
+}
+
+// CreateTestContextWithMultiStore creates a test context and returns it together with multi store.
+func (s *KeeperTestHelper) CreateTestContextWithMultiStore() (sdk.Context, sdk.CommitMultiStore) {
+ db := dbm.NewMemDB()
+ logger := log.NewNopLogger()
+
+ ms := rootmulti.NewStore(db, logger)
+
+ return sdk.NewContext(ms, tmtypes.Header{}, false, logger), ms
+}
+
+// CreateTestContext creates a test context.
+func (s *KeeperTestHelper) Commit() {
+ oldHeight := s.Ctx.BlockHeight()
+ oldHeader := s.Ctx.BlockHeader()
+ s.App.Commit()
+ newHeader := tmtypes.Header{Height: oldHeight + 1, ChainID: oldHeader.ChainID, Time: oldHeader.Time.Add(time.Second)}
+ s.App.BeginBlock(abci.RequestBeginBlock{Header: newHeader})
+ s.Ctx = s.App.NewContext(false, newHeader)
+}
+
+// FundAcc funds target address with specified amount.
+func (s *KeeperTestHelper) FundAcc(acc sdk.AccAddress, amounts sdk.Coins) {
+ err := app.FundAccount(s.App.BankKeeper, s.Ctx, acc, amounts)
+ s.Require().NoError(err)
+}
+
+// FundModuleAcc funds target modules with specified amount.
+func (s *KeeperTestHelper) FundModuleAcc(moduleName string, amounts sdk.Coins) {
+ err := app.FundModuleAccount(s.App.BankKeeper, s.Ctx, moduleName, amounts)
+ s.Require().NoError(err)
+}
+
+func (s *KeeperTestHelper) MintCoins(coins sdk.Coins) {
+ err := s.App.BankKeeper.MintCoins(s.Ctx, minttypes.ModuleName, coins)
+ s.Require().NoError(err)
+}
+
+// SetupValidator sets up a validator and returns the ValAddress.
+func (s *KeeperTestHelper) SetupValidator(bondStatus stakingtypes.BondStatus) sdk.ValAddress {
+ valPub := secp256k1.GenPrivKey().PubKey()
+ valAddr := sdk.ValAddress(valPub.Address())
+ bondDenom := s.App.StakingKeeper.GetParams(s.Ctx).BondDenom
+ selfBond := sdk.NewCoins(sdk.Coin{Amount: sdk.DefaultPowerReduction, Denom: bondDenom})
+
+ s.FundAcc(sdk.AccAddress(valAddr), selfBond)
+
+ stakingCoin := sdk.NewCoin(sdk.DefaultBondDenom, selfBond[0].Amount)
+ ZeroCommission := stakingtypes.NewCommissionRates(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec())
+ _, err := stakingtypes.NewMsgCreateValidator(valAddr, valPub, stakingCoin, stakingtypes.Description{}, ZeroCommission, sdk.OneInt())
+ s.Require().NoError(err)
+
+ val, found := s.App.StakingKeeper.GetValidator(s.Ctx, valAddr)
+ s.Require().True(found)
+
+ val = val.UpdateStatus(bondStatus)
+ s.App.StakingKeeper.SetValidator(s.Ctx, val)
+
+ consAddr, err := val.GetConsAddr()
+ s.Suite.Require().NoError(err)
+
+ signingInfo := slashingtypes.NewValidatorSigningInfo(
+ consAddr,
+ s.Ctx.BlockHeight(),
+ 0,
+ time.Unix(0, 0),
+ false,
+ 0,
+ )
+ s.App.SlashingKeeper.SetValidatorSigningInfo(s.Ctx, consAddr, signingInfo)
+
+ return valAddr
+}
+
+// BeginNewBlock starts a new block.
+func (s *KeeperTestHelper) BeginNewBlock() {
+ var valAddr []byte
+
+ validators := s.App.StakingKeeper.GetAllValidators(s.Ctx)
+ if len(validators) >= 1 {
+ valAddrFancy, err := validators[0].GetConsAddr()
+ s.Require().NoError(err)
+ valAddr = valAddrFancy.Bytes()
+ } else {
+ valAddrFancy := s.SetupValidator(stakingtypes.Bonded)
+ validator, _ := s.App.StakingKeeper.GetValidator(s.Ctx, valAddrFancy)
+ valAddr2, _ := validator.GetConsAddr()
+ valAddr = valAddr2.Bytes()
+ }
+
+ s.BeginNewBlockWithProposer(valAddr)
+}
+
+// BeginNewBlockWithProposer begins a new block with a proposer.
+func (s *KeeperTestHelper) BeginNewBlockWithProposer(proposer sdk.ValAddress) {
+ validator, found := s.App.StakingKeeper.GetValidator(s.Ctx, proposer)
+ s.Assert().True(found)
+
+ valConsAddr, err := validator.GetConsAddr()
+ s.Require().NoError(err)
+
+ valAddr := valConsAddr.Bytes()
+
+ newBlockTime := s.Ctx.BlockTime().Add(5 * time.Second)
+
+ header := tmtypes.Header{Height: s.Ctx.BlockHeight() + 1, Time: newBlockTime}
+ newCtx := s.Ctx.WithBlockTime(newBlockTime).WithBlockHeight(s.Ctx.BlockHeight() + 1)
+ s.Ctx = newCtx
+ lastCommitInfo := abci.CommitInfo{
+ Votes: []abci.VoteInfo{{
+ Validator: abci.Validator{Address: valAddr, Power: 1000},
+ SignedLastBlock: true,
+ }},
+ }
+ reqBeginBlock := abci.RequestBeginBlock{Header: header, LastCommitInfo: lastCommitInfo}
+
+ fmt.Println("beginning block ", s.Ctx.BlockHeight())
+ s.App.BeginBlocker(s.Ctx, reqBeginBlock)
+}
+
+// EndBlock ends the block.
+func (s *KeeperTestHelper) EndBlock() {
+ reqEndBlock := abci.RequestEndBlock{Height: s.Ctx.BlockHeight()}
+ s.App.EndBlocker(s.Ctx, reqEndBlock)
+}
+
+// AllocateRewardsToValidator allocates reward tokens to a distribution module then allocates rewards to the validator address.
+func (s *KeeperTestHelper) AllocateRewardsToValidator(valAddr sdk.ValAddress, rewardAmt math.Int) {
+ validator, found := s.App.StakingKeeper.GetValidator(s.Ctx, valAddr)
+ s.Require().True(found)
+
+ // allocate reward tokens to distribution module
+ coins := sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, rewardAmt)}
+ err := app.FundModuleAccount(s.App.BankKeeper, s.Ctx, distrtypes.ModuleName, coins)
+ s.Require().NoError(err)
+
+ // allocate rewards to validator
+ s.Ctx = s.Ctx.WithBlockHeight(s.Ctx.BlockHeight() + 1)
+ decTokens := sdk.DecCoins{{Denom: sdk.DefaultBondDenom, Amount: sdk.NewDec(20000)}}
+ s.App.DistrKeeper.AllocateTokensToValidator(s.Ctx, validator, decTokens)
+}
+
+// BuildTx builds a transaction.
+func (s *KeeperTestHelper) BuildTx(
+ txBuilder client.TxBuilder,
+ msgs []sdk.Msg,
+ sigV2 signing.SignatureV2,
+ memo string, txFee sdk.Coins,
+ gasLimit uint64,
+) authsigning.Tx {
+ err := txBuilder.SetMsgs(msgs[0])
+ s.Require().NoError(err)
+
+ err = txBuilder.SetSignatures(sigV2)
+ s.Require().NoError(err)
+
+ txBuilder.SetMemo(memo)
+ txBuilder.SetFeeAmount(txFee)
+ txBuilder.SetGasLimit(gasLimit)
+
+ return txBuilder.GetTx()
+}
+
+// CreateRandomAccounts is a function return a list of randomly generated AccAddresses
+func CreateRandomAccounts(numAccts int) []sdk.AccAddress {
+ testAddrs := make([]sdk.AccAddress, numAccts)
+ for i := 0; i < numAccts; i++ {
+ pk := ed25519.GenPrivKey().PubKey()
+ testAddrs[i] = sdk.AccAddress(pk.Address())
+ }
+
+ return testAddrs
+}
+
+func TestMessageAuthzSerialization(t *testing.T, msg sdk.Msg) {
+ someDate := time.Date(1, 1, 1, 1, 1, 1, 1, time.UTC)
+ var expire *time.Time
+
+ const (
+ mockGranter string = "cosmos1abc"
+ mockGrantee string = "cosmos1xyz"
+ )
+
+ var (
+ mockMsgGrant authz.MsgGrant
+ mockMsgRevoke authz.MsgRevoke
+ mockMsgExec authz.MsgExec
+ )
+
+ // Authz: Grant Msg
+ typeURL := sdk.MsgTypeURL(msg)
+ grant, err := authz.NewGrant(someDate, authz.NewGenericAuthorization(typeURL), expire)
+ require.NoError(t, err)
+
+ msgGrant := authz.MsgGrant{Granter: mockGranter, Grantee: mockGrantee, Grant: grant}
+ msgGrantBytes := json.RawMessage(sdk.MustSortJSON(authzcodec.ModuleCdc.MustMarshalJSON(&msgGrant)))
+ err = authzcodec.ModuleCdc.UnmarshalJSON(msgGrantBytes, &mockMsgGrant)
+ require.NoError(t, err)
+
+ // Authz: Revoke Msg
+ msgRevoke := authz.MsgRevoke{Granter: mockGranter, Grantee: mockGrantee, MsgTypeUrl: typeURL}
+ msgRevokeByte := json.RawMessage(sdk.MustSortJSON(authzcodec.ModuleCdc.MustMarshalJSON(&msgRevoke)))
+ err = authzcodec.ModuleCdc.UnmarshalJSON(msgRevokeByte, &mockMsgRevoke)
+ require.NoError(t, err)
+
+ // Authz: Exec Msg
+ msgAny, err := cdctypes.NewAnyWithValue(msg)
+ require.NoError(t, err)
+ msgExec := authz.MsgExec{Grantee: mockGrantee, Msgs: []*cdctypes.Any{msgAny}}
+ execMsgByte := json.RawMessage(sdk.MustSortJSON(authzcodec.ModuleCdc.MustMarshalJSON(&msgExec)))
+ err = authzcodec.ModuleCdc.UnmarshalJSON(execMsgByte, &mockMsgExec)
+ require.NoError(t, err)
+ require.Equal(t, msgExec.Msgs[0].Value, mockMsgExec.Msgs[0].Value)
+}
+
+func GenerateTestAddrs() (string, string) {
+ pk1 := ed25519.GenPrivKey().PubKey()
+ validAddr := sdk.AccAddress(pk1.Address()).String()
+ invalidAddr := sdk.AccAddress("invalid").String()
+ return validAddr, invalidAddr
+}
diff --git a/app/export.go b/app/export.go
index c494a9b6da..74c69db60c 100644
--- a/app/export.go
+++ b/app/export.go
@@ -2,9 +2,10 @@ package app
import (
"encoding/json"
+ "fmt"
"log"
- tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
+ tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
sdk "github.com/cosmos/cosmos-sdk/types"
@@ -15,9 +16,7 @@ import (
// ExportAppStateAndValidators exports the state of the application for a genesis
// file.
-func (app *WasmApp) ExportAppStateAndValidators(
- forZeroHeight bool, jailAllowedAddrs []string,
-) (servertypes.ExportedApp, error) {
+func (app *WasmApp) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs []string, modulesToExport []string) (servertypes.ExportedApp, error) {
// as if they could withdraw from the start of the next block
ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()})
@@ -29,7 +28,7 @@ func (app *WasmApp) ExportAppStateAndValidators(
app.prepForZeroHeightGenesis(ctx, jailAllowedAddrs)
}
- genState := app.mm.ExportGenesis(ctx, app.appCodec)
+ genState := app.ModuleManager.ExportGenesisForModules(ctx, app.appCodec, modulesToExport)
appState, err := json.MarshalIndent(genState, "", " ")
if err != nil {
return servertypes.ExportedApp{}, err
@@ -73,7 +72,7 @@ func (app *WasmApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [
// withdraw all validator commission
app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) {
- _, _ = app.DistrKeeper.WithdrawValidatorCommission(ctx, val.GetOperator()) //nolint:errcheck
+ _, _ = app.DistrKeeper.WithdrawValidatorCommission(ctx, val.GetOperator())
return false
})
@@ -85,11 +84,11 @@ func (app *WasmApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [
panic(err)
}
- delAddr, err := sdk.AccAddressFromBech32(delegation.DelegatorAddress)
- if err != nil {
+ delAddr := sdk.MustAccAddressFromBech32(delegation.DelegatorAddress)
+
+ if _, err = app.DistrKeeper.WithdrawDelegationRewards(ctx, delAddr, valAddr); err != nil {
panic(err)
}
- _, _ = app.DistrKeeper.WithdrawDelegationRewards(ctx, delAddr, valAddr) //nolint:errcheck
}
// clear validator slash events
@@ -110,7 +109,9 @@ func (app *WasmApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [
feePool.CommunityPool = feePool.CommunityPool.Add(scraps...)
app.DistrKeeper.SetFeePool(ctx, feePool)
- app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator())
+ if err := app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()); err != nil {
+ panic(err)
+ }
return false
})
@@ -120,12 +121,17 @@ func (app *WasmApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [
if err != nil {
panic(err)
}
- delAddr, err := sdk.AccAddressFromBech32(del.DelegatorAddress)
- if err != nil {
- panic(err)
+ delAddr := sdk.MustAccAddressFromBech32(del.DelegatorAddress)
+
+ if err := app.DistrKeeper.Hooks().BeforeDelegationCreated(ctx, delAddr, valAddr); err != nil {
+ // never called as BeforeDelegationCreated always returns nil
+ panic(fmt.Errorf("error while incrementing period: %w", err))
+ }
+
+ if err := app.DistrKeeper.Hooks().AfterDelegationModified(ctx, delAddr, valAddr); err != nil {
+ // never called as AfterDelegationModified always returns nil
+ panic(fmt.Errorf("error while creating a new delegation period record: %w", err))
}
- app.DistrKeeper.Hooks().BeforeDelegationCreated(ctx, delAddr, valAddr)
- app.DistrKeeper.Hooks().AfterDelegationModified(ctx, delAddr, valAddr)
}
// reset context height
@@ -153,12 +159,12 @@ func (app *WasmApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [
// Iterate through validators by power descending, reset bond heights, and
// update bond intra-tx counters.
- store := ctx.KVStore(app.keys[stakingtypes.StoreKey])
+ store := ctx.KVStore(app.GetKey(stakingtypes.StoreKey))
iter := sdk.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey)
counter := int16(0)
for ; iter.Valid(); iter.Next() {
- addr := sdk.ValAddress(iter.Key()[1:])
+ addr := sdk.ValAddress(stakingtypes.AddressFromValidatorsKey(iter.Key()))
validator, found := app.StakingKeeper.GetValidator(ctx, addr)
if !found {
panic("expected validator, not found")
@@ -173,7 +179,10 @@ func (app *WasmApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [
counter++
}
- iter.Close()
+ if err := iter.Close(); err != nil {
+ app.Logger().Error("error while closing the key-value store reverse prefix iterator: ", err)
+ return
+ }
_, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx)
if err != nil {
diff --git a/app/genesis.go b/app/genesis.go
index 622c15d326..2900679c12 100644
--- a/app/genesis.go
+++ b/app/genesis.go
@@ -2,9 +2,11 @@ package app
import (
"encoding/json"
+
+ "github.com/cosmos/cosmos-sdk/codec"
)
-// GenesisState The genesis state of the blockchain is represented here as a map of raw json
+// GenesisState 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.
@@ -14,7 +16,6 @@ import (
type GenesisState map[string]json.RawMessage
// NewDefaultGenesisState generates the default state for the application.
-func NewDefaultGenesisState() GenesisState {
- encodingConfig := MakeEncodingConfig()
- return ModuleBasics.DefaultGenesis(encodingConfig.Marshaler)
+func NewDefaultGenesisState(cdc codec.JSONCodec) GenesisState {
+ return ModuleBasics.DefaultGenesis(cdc)
}
diff --git a/app/params/params.go b/app/params/params.go
deleted file mode 100644
index b6aa5fb55e..0000000000
--- a/app/params/params.go
+++ /dev/null
@@ -1,7 +0,0 @@
-package params
-
-// Simulation parameter constants
-const (
- StakePerAccount = "stake_per_account"
- InitiallyBondedValidators = "initially_bonded_validators"
-)
diff --git a/app/params/weights.go b/app/params/weights.go
index 4e5452c9b2..997b814382 100644
--- a/app/params/weights.go
+++ b/app/params/weights.go
@@ -40,3 +40,12 @@ const (
DefaultWeightUpdateInstantiateConfigProposal int = 5
DefaultWeightStoreAndInstantiateContractProposal int = 5
)
+
+// Token Factory Weights
+const (
+ DefaultWeightMsgCreateDenom int = 100
+ DefaultWeightMsgMint int = 100
+ DefaultWeightMsgBurn int = 100
+ DefaultWeightMsgChangeAdmin int = 100
+ DefaultWeightMsgSetDenomMetadata int = 100
+)
diff --git a/app/sim_test.go b/app/sim_test.go
index 5e206064e6..6e2932894c 100644
--- a/app/sim_test.go
+++ b/app/sim_test.go
@@ -3,17 +3,35 @@ package app
import (
"encoding/json"
"fmt"
+ "math/rand"
"os"
- "path/filepath"
+ "runtime/debug"
+ "strings"
"testing"
"time"
- "github.com/cosmos/cosmos-sdk/baseapp"
+ govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
+
"github.com/cosmos/cosmos-sdk/codec"
- "github.com/cosmos/cosmos-sdk/simapp"
- sdk "github.com/cosmos/cosmos-sdk/types"
- "github.com/cosmos/cosmos-sdk/types/kv"
"github.com/cosmos/cosmos-sdk/types/module"
+ "github.com/cosmos/ibc-go/v7/testing/simapp"
+
+ "github.com/CosmWasm/wasmd/x/wasm"
+
+ dbm "github.com/cometbft/cometbft-db"
+ abci "github.com/cometbft/cometbft/abci/types"
+ "github.com/cometbft/cometbft/libs/log"
+ tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
+ "github.com/stretchr/testify/require"
+
+ "github.com/cosmos/cosmos-sdk/client/flags"
+ "github.com/cosmos/cosmos-sdk/server"
+ storetypes "github.com/cosmos/cosmos-sdk/store/types"
+
+ "github.com/cosmos/cosmos-sdk/baseapp"
+ "github.com/cosmos/cosmos-sdk/store"
+ simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
+ sdk "github.com/cosmos/cosmos-sdk/types"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper"
@@ -21,100 +39,67 @@ import (
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types"
- "github.com/cosmos/cosmos-sdk/x/feegrant"
- govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
- paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
+ paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
"github.com/cosmos/cosmos-sdk/x/simulation"
+ simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
- ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
- ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host"
- "github.com/stretchr/testify/require"
- "github.com/tendermint/tendermint/libs/log"
- tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
- dbm "github.com/tendermint/tm-db"
-
- "github.com/CosmWasm/wasmd/x/wasm"
- wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
)
+// SimAppChainID hardcoded chainID for simulation
+const SimAppChainID = "simulation-app"
+
// Get flags every time the simulator is run
func init() {
- simapp.GetSimulatorFlags()
+ simcli.GetSimulatorFlags()
}
type StoreKeysPrefixes struct {
- A sdk.StoreKey
- B sdk.StoreKey
+ A storetypes.StoreKey
+ B storetypes.StoreKey
Prefixes [][]byte
}
-// SetupSimulation wraps simapp.SetupSimulation in order to create any export directory if they do not exist yet
-func SetupSimulation(dirPrefix, dbName string) (simtypes.Config, dbm.DB, string, log.Logger, bool, error) {
- config, db, dir, logger, skip, err := simapp.SetupSimulation(dirPrefix, dbName)
- if err != nil {
- return simtypes.Config{}, nil, "", nil, false, err
- }
-
- paths := []string{config.ExportParamsPath, config.ExportStatePath, config.ExportStatsPath}
- for _, path := range paths {
- if len(path) == 0 {
- continue
- }
-
- path = filepath.Dir(path)
- if _, err := os.Stat(path); os.IsNotExist(err) {
- if err := os.MkdirAll(path, os.ModePerm); err != nil {
- panic(err)
- }
- }
- }
-
- return config, db, dir, logger, skip, err
-}
-
-// GetSimulationLog unmarshals the KVPair's Value to the corresponding type based on the
-// each's module store key and the prefix bytes of the KVPair's key.
-func GetSimulationLog(storeName string, sdr sdk.StoreDecoderRegistry, kvAs, kvBs []kv.Pair) (log string) {
- for i := 0; i < len(kvAs); i++ {
- if len(kvAs[i].Value) == 0 && len(kvBs[i].Value) == 0 {
- // skip if the value doesn't have any bytes
- continue
- }
-
- decoder, ok := sdr[storeName]
- if ok {
- log += decoder(kvAs[i], kvBs[i])
- } else {
- log += fmt.Sprintf("store A %q => %q\nstore B %q => %q\n", kvAs[i].Key, kvAs[i].Value, kvBs[i].Key, kvBs[i].Value)
- }
- }
-
- return log
-}
-
// fauxMerkleModeOpt returns a BaseApp option to use a dbStoreAdapter instead of
// an IAVLStore for faster simulation speed.
func fauxMerkleModeOpt(bapp *baseapp.BaseApp) {
bapp.SetFauxMerkleMode()
}
-func TestAppImportExport(t *testing.T) {
- config, db, dir, logger, skip, err := SetupSimulation("leveldb-app-sim", "Simulation")
- if skip {
- t.Skip("skipping application import/export simulation")
- }
- require.NoError(t, err, "simulation setup failed")
+// interBlockCacheOpt returns a BaseApp option function that sets the persistent
+// inter-block write-through cache.
+func interBlockCacheOpt() func(*baseapp.BaseApp) {
+ return baseapp.SetInterBlockCache(store.NewCommitKVStoreCacheManager())
+}
- defer func() {
- db.Close()
- require.NoError(t, os.RemoveAll(dir))
- }()
+func TestFullAppSimulation(t *testing.T) {
+ config, db, _, app := setupSimulationApp(t, "skipping application simulation")
+ // run randomized simulation
+ _, simParams, simErr := simulation.SimulateFromSeed(
+ t,
+ os.Stdout,
+ app.BaseApp,
+ AppStateFn(app.AppCodec(), app.SimulationManager()),
+ simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1
+ simtestutil.SimulationOperations(app, app.AppCodec(), config),
+ ModuleAccountAddrs(),
+ config,
+ app.AppCodec(),
+ )
+
+ // export state and simParams before the simulation error is checked
+ err := simtestutil.CheckExportSimulation(app, config, simParams)
+ require.NoError(t, err)
+ require.NoError(t, simErr)
+
+ if config.Commit {
+ simtestutil.PrintStats(db)
+ }
+}
- encConf := MakeEncodingConfig()
- app := NewWasmApp(logger, db, nil, true, map[int64]bool{}, dir, simapp.FlagPeriodValue, encConf, wasm.EnableAllProposals, EmptyBaseAppOptions{}, nil, fauxMerkleModeOpt)
- require.Equal(t, appName, app.Name())
+func TestAppImportExport(t *testing.T) {
+ config, db, appOptions, app := setupSimulationApp(t, "skipping application import/export simulation")
// Run randomized simulation
_, simParams, simErr := simulation.SimulateFromSeed(
@@ -122,78 +107,82 @@ func TestAppImportExport(t *testing.T) {
os.Stdout,
app.BaseApp,
AppStateFn(app.AppCodec(), app.SimulationManager()),
- simtypes.RandomAccounts,
- simapp.SimulationOperations(app, app.AppCodec(), config),
- app.ModuleAccountAddrs(),
+ simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1
+ simtestutil.SimulationOperations(app, app.AppCodec(), config),
+ ModuleAccountAddrs(),
config,
app.AppCodec(),
)
// export state and simParams before the simulation error is checked
- err = simapp.CheckExportSimulation(app, config, simParams)
+ err := simtestutil.CheckExportSimulation(app, config, simParams)
require.NoError(t, err)
require.NoError(t, simErr)
if config.Commit {
- simapp.PrintStats(db)
+ simtestutil.PrintStats(db)
}
- t.Log("exporting genesis...")
+ fmt.Printf("exporting genesis...\n")
- exported, err := app.ExportAppStateAndValidators(false, []string{})
+ exported, err := app.ExportAppStateAndValidators(false, []string{}, []string{})
require.NoError(t, err)
- t.Log("importing genesis...")
+ fmt.Printf("importing genesis...\n")
- _, newDB, newDir, _, _, err := SetupSimulation("leveldb-app-sim-2", "Simulation-2")
+ newDB, newDir, _, _, err := simtestutil.SetupSimulation(config, "leveldb-app-sim-2", "Simulation-2", simcli.FlagVerboseValue, simcli.FlagEnabledValue)
require.NoError(t, err, "simulation setup failed")
defer func() {
- newDB.Close()
+ require.NoError(t, newDB.Close())
require.NoError(t, os.RemoveAll(newDir))
}()
- newApp := NewWasmApp(logger, newDB, nil, true, map[int64]bool{}, newDir, simapp.FlagPeriodValue, encConf, wasm.EnableAllProposals, EmptyBaseAppOptions{}, nil, fauxMerkleModeOpt)
- require.Equal(t, appName, newApp.Name())
+
+ newApp := NewWasmApp(log.NewNopLogger(), newDB, nil, true, wasm.EnableAllProposals, appOptions, emptyWasmOpts, fauxMerkleModeOpt)
+ require.Equal(t, "WasmApp", newApp.Name())
var genesisState GenesisState
err = json.Unmarshal(exported.AppState, &genesisState)
require.NoError(t, err)
+ defer func() {
+ if r := recover(); r != nil {
+ err := fmt.Sprintf("%v", r)
+ if !strings.Contains(err, "validator set is empty after InitGenesis") {
+ panic(r)
+ }
+ app.Logger().Info("Skipping simulation as all validators have been unbonded")
+ app.Logger().Info("err", err, "stacktrace", string(debug.Stack()))
+ }
+ }()
+
ctxA := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()})
ctxB := newApp.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()})
- newApp.mm.InitGenesis(ctxB, app.AppCodec(), genesisState)
+ newApp.ModuleManager.InitGenesis(ctxB, app.AppCodec(), genesisState)
newApp.StoreConsensusParams(ctxB, exported.ConsensusParams)
- t.Log("comparing stores...")
+ fmt.Printf("comparing stores...\n")
storeKeysPrefixes := []StoreKeysPrefixes{
- {app.keys[authtypes.StoreKey], newApp.keys[authtypes.StoreKey], [][]byte{}},
+ {app.GetKey(authtypes.StoreKey), newApp.GetKey(authtypes.StoreKey), [][]byte{}},
{
- app.keys[stakingtypes.StoreKey], newApp.keys[stakingtypes.StoreKey],
+ app.GetKey(stakingtypes.StoreKey), newApp.GetKey(stakingtypes.StoreKey),
[][]byte{
stakingtypes.UnbondingQueueKey, stakingtypes.RedelegationQueueKey, stakingtypes.ValidatorQueueKey,
- stakingtypes.HistoricalInfoKey,
+ stakingtypes.HistoricalInfoKey, stakingtypes.UnbondingIDKey, stakingtypes.UnbondingIndexKey, stakingtypes.UnbondingTypeKey, stakingtypes.ValidatorUpdatesKey,
},
- },
- {app.keys[slashingtypes.StoreKey], newApp.keys[slashingtypes.StoreKey], [][]byte{}},
- {app.keys[minttypes.StoreKey], newApp.keys[minttypes.StoreKey], [][]byte{}},
- {app.keys[distrtypes.StoreKey], newApp.keys[distrtypes.StoreKey], [][]byte{}},
- {app.keys[banktypes.StoreKey], newApp.keys[banktypes.StoreKey], [][]byte{banktypes.BalancesPrefix}},
- {app.keys[paramstypes.StoreKey], newApp.keys[paramstypes.StoreKey], [][]byte{}},
- {app.keys[govtypes.StoreKey], newApp.keys[govtypes.StoreKey], [][]byte{}},
- {app.keys[evidencetypes.StoreKey], newApp.keys[evidencetypes.StoreKey], [][]byte{}},
- {app.keys[capabilitytypes.StoreKey], newApp.keys[capabilitytypes.StoreKey], [][]byte{}},
- {app.keys[ibchost.StoreKey], newApp.keys[ibchost.StoreKey], [][]byte{}},
- {app.keys[ibctransfertypes.StoreKey], newApp.keys[ibctransfertypes.StoreKey], [][]byte{}},
- {app.keys[authzkeeper.StoreKey], newApp.keys[authzkeeper.StoreKey], [][]byte{}},
- {app.keys[feegrant.StoreKey], newApp.keys[feegrant.StoreKey], [][]byte{}},
- {app.keys[wasm.StoreKey], newApp.keys[wasm.StoreKey], [][]byte{}},
+ }, // ordering may change but it doesn't matter
+ {app.GetKey(slashingtypes.StoreKey), newApp.GetKey(slashingtypes.StoreKey), [][]byte{}},
+ {app.GetKey(minttypes.StoreKey), newApp.GetKey(minttypes.StoreKey), [][]byte{}},
+ {app.GetKey(distrtypes.StoreKey), newApp.GetKey(distrtypes.StoreKey), [][]byte{}},
+ {app.GetKey(banktypes.StoreKey), newApp.GetKey(banktypes.StoreKey), [][]byte{banktypes.BalancesPrefix}},
+ {app.GetKey(paramtypes.StoreKey), newApp.GetKey(paramtypes.StoreKey), [][]byte{}},
+ {app.GetKey(govtypes.StoreKey), newApp.GetKey(govtypes.StoreKey), [][]byte{}},
+ {app.GetKey(evidencetypes.StoreKey), newApp.GetKey(evidencetypes.StoreKey), [][]byte{}},
+ {app.GetKey(capabilitytypes.StoreKey), newApp.GetKey(capabilitytypes.StoreKey), [][]byte{}},
+ {app.GetKey(authzkeeper.StoreKey), newApp.GetKey(authzkeeper.StoreKey), [][]byte{authzkeeper.GrantKey, authzkeeper.GrantQueuePrefix}},
}
- // delete persistent tx counter value
- ctxA.KVStore(app.keys[wasm.StoreKey]).Delete(wasmtypes.TXCounterPrefix)
-
- // diff both stores
for _, skp := range storeKeysPrefixes {
storeA := ctxA.KVStore(skp.A)
storeB := ctxB.KVStore(skp.B)
@@ -201,47 +190,169 @@ func TestAppImportExport(t *testing.T) {
failedKVAs, failedKVBs := sdk.DiffKVStores(storeA, storeB, skp.Prefixes)
require.Equal(t, len(failedKVAs), len(failedKVBs), "unequal sets of key-values to compare")
- t.Logf("compared %d different key/value pairs between %s and %s\n", len(failedKVAs), skp.A, skp.B)
- require.Len(t, failedKVAs, 0, GetSimulationLog(skp.A.Name(), app.SimulationManager().StoreDecoders, failedKVAs, failedKVBs))
+ fmt.Printf("compared %d different key/value pairs between %s and %s\n", len(failedKVAs), skp.A, skp.B)
+ require.Equal(t, 0, len(failedKVAs), simtestutil.GetSimulationLog(skp.A.Name(), app.SimulationManager().StoreDecoders, failedKVAs, failedKVBs))
}
}
-func TestFullAppSimulation(t *testing.T) {
- config, db, dir, logger, skip, err := SetupSimulation("leveldb-app-sim", "Simulation")
- if skip {
- t.Skip("skipping application simulation")
- }
- require.NoError(t, err, "simulation setup failed")
+func TestAppSimulationAfterImport(t *testing.T) {
+ config, db, appOptions, app := setupSimulationApp(t, "skipping application simulation after import")
- defer func() {
- db.Close()
- require.NoError(t, os.RemoveAll(dir))
- }()
- encConf := MakeEncodingConfig()
- app := NewWasmApp(logger, db, nil, true, map[int64]bool{}, t.TempDir(), simapp.FlagPeriodValue,
- encConf, wasm.EnableAllProposals, simapp.EmptyAppOptions{}, nil, fauxMerkleModeOpt)
- require.Equal(t, "WasmApp", app.Name())
-
- // run randomized simulation
- _, simParams, simErr := simulation.SimulateFromSeed(
+ // Run randomized simulation
+ stopEarly, simParams, simErr := simulation.SimulateFromSeed(
t,
os.Stdout,
app.BaseApp,
- AppStateFn(app.appCodec, app.SimulationManager()),
+ AppStateFn(app.AppCodec(), app.SimulationManager()),
simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1
- simapp.SimulationOperations(app, app.AppCodec(), config),
- app.ModuleAccountAddrs(),
+ simtestutil.SimulationOperations(app, app.AppCodec(), config),
+ ModuleAccountAddrs(),
config,
app.AppCodec(),
)
// export state and simParams before the simulation error is checked
- err = simapp.CheckExportSimulation(app, config, simParams)
+ err := simtestutil.CheckExportSimulation(app, config, simParams)
require.NoError(t, err)
require.NoError(t, simErr)
if config.Commit {
- simapp.PrintStats(db)
+ simtestutil.PrintStats(db)
+ }
+
+ if stopEarly {
+ fmt.Println("can't export or import a zero-validator genesis, exiting test...")
+ return
+ }
+
+ fmt.Printf("exporting genesis...\n")
+
+ exported, err := app.ExportAppStateAndValidators(true, []string{}, []string{})
+ require.NoError(t, err)
+
+ fmt.Printf("importing genesis...\n")
+
+ newDB, newDir, _, _, err := simtestutil.SetupSimulation(config, "leveldb-app-sim-2", "Simulation-2", simcli.FlagVerboseValue, simcli.FlagEnabledValue)
+ require.NoError(t, err, "simulation setup failed")
+
+ defer func() {
+ require.NoError(t, newDB.Close())
+ require.NoError(t, os.RemoveAll(newDir))
+ }()
+
+ newApp := NewWasmApp(log.NewNopLogger(), newDB, nil, true, wasm.EnableAllProposals, appOptions, emptyWasmOpts, fauxMerkleModeOpt)
+ require.Equal(t, "WasmApp", newApp.Name())
+
+ newApp.InitChain(abci.RequestInitChain{
+ AppStateBytes: exported.AppState,
+ })
+
+ _, _, err = simulation.SimulateFromSeed(
+ t,
+ os.Stdout,
+ newApp.BaseApp,
+ AppStateFn(app.AppCodec(), app.SimulationManager()),
+ simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1
+ simtestutil.SimulationOperations(newApp, newApp.AppCodec(), config),
+ ModuleAccountAddrs(),
+ config,
+ app.AppCodec(),
+ )
+ require.NoError(t, err)
+}
+
+func setupSimulationApp(t *testing.T, msg string) (simtypes.Config, dbm.DB, simtestutil.AppOptionsMap, *WasmApp) {
+ config := simcli.NewConfigFromFlags()
+ config.ChainID = SimAppChainID
+
+ db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "leveldb-app-sim", "Simulation", simcli.FlagVerboseValue, simcli.FlagEnabledValue)
+ if skip {
+ t.Skip(msg)
+ }
+ require.NoError(t, err, "simulation setup failed")
+
+ t.Cleanup(func() {
+ require.NoError(t, db.Close())
+ require.NoError(t, os.RemoveAll(dir))
+ })
+
+ appOptions := make(simtestutil.AppOptionsMap, 0)
+ appOptions[flags.FlagHome] = dir // ensure a unique folder
+ appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue
+
+ app := NewWasmApp(logger, db, nil, true, wasm.EnableAllProposals, appOptions, emptyWasmOpts, fauxMerkleModeOpt)
+ require.Equal(t, "WasmApp", app.Name())
+ return config, db, appOptions, app
+}
+
+// TODO: Make another test for the fuzzer itself, which just has noOp txs
+// and doesn't depend on the application.
+func TestAppStateDeterminism(t *testing.T) {
+ if !simcli.FlagEnabledValue {
+ t.Skip("skipping application simulation")
+ }
+
+ config := simcli.NewConfigFromFlags()
+ config.InitialBlockHeight = 1
+ config.ExportParamsPath = ""
+ config.OnOperation = false
+ config.AllInvariants = false
+ config.ChainID = SimAppChainID
+
+ numSeeds := 3
+ numTimesToRunPerSeed := 5
+ appHashList := make([]json.RawMessage, numTimesToRunPerSeed)
+
+ appOptions := make(simtestutil.AppOptionsMap, 0)
+ appOptions[flags.FlagHome] = t.TempDir() // ensure a unique folder
+ appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue
+
+ for i := 0; i < numSeeds; i++ {
+ config.Seed = rand.Int63()
+
+ for j := 0; j < numTimesToRunPerSeed; j++ {
+ var logger log.Logger
+ if simcli.FlagVerboseValue {
+ logger = log.TestingLogger()
+ } else {
+ logger = log.NewNopLogger()
+ }
+
+ db := dbm.NewMemDB()
+ app := NewWasmApp(logger, db, nil, true, wasm.EnableAllProposals, appOptions, emptyWasmOpts, interBlockCacheOpt())
+
+ fmt.Printf(
+ "running non-determinism simulation; seed %d: %d/%d, attempt: %d/%d\n",
+ config.Seed, i+1, numSeeds, j+1, numTimesToRunPerSeed,
+ )
+
+ _, _, err := simulation.SimulateFromSeed(
+ t,
+ os.Stdout,
+ app.BaseApp,
+ AppStateFn(app.AppCodec(), app.SimulationManager()),
+ simtypes.RandomAccounts, // Replace with own random account function if using keys other than secp256k1
+ simtestutil.SimulationOperations(app, app.AppCodec(), config),
+ ModuleAccountAddrs(),
+ config,
+ app.AppCodec(),
+ )
+ require.NoError(t, err)
+
+ if config.Commit {
+ simtestutil.PrintStats(db)
+ }
+
+ appHash := app.LastCommitID().Hash
+ appHashList[j] = appHash
+
+ if j != 0 {
+ require.Equal(
+ t, string(appHashList[0]), string(appHashList[j]),
+ "non-determinism in seed %d: %d/%d, attempt: %d/%d\n", config.Seed, i+1, numSeeds, j+1, numTimesToRunPerSeed,
+ )
+ }
+ }
}
}
diff --git a/app/test_access.go b/app/test_access.go
deleted file mode 100644
index 51b8bb9939..0000000000
--- a/app/test_access.go
+++ /dev/null
@@ -1,73 +0,0 @@
-package app
-
-import (
- "testing"
-
- "github.com/cosmos/cosmos-sdk/baseapp"
- "github.com/cosmos/cosmos-sdk/client"
-
- "github.com/CosmWasm/wasmd/app/params"
-
- "github.com/cosmos/cosmos-sdk/codec"
- bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
- capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper"
- stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
- ibctransferkeeper "github.com/cosmos/ibc-go/v4/modules/apps/transfer/keeper"
- ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"
-
- "github.com/CosmWasm/wasmd/x/wasm"
-)
-
-// Deprecated: use public app attributes directly
-type TestSupport struct {
- t testing.TB
- app *WasmApp
-}
-
-func NewTestSupport(t testing.TB, app *WasmApp) *TestSupport {
- return &TestSupport{t: t, app: app}
-}
-
-func (s TestSupport) IBCKeeper() *ibckeeper.Keeper {
- return s.app.IBCKeeper
-}
-
-func (s TestSupport) WasmKeeper() wasm.Keeper {
- return s.app.WasmKeeper
-}
-
-func (s TestSupport) AppCodec() codec.Codec {
- return s.app.appCodec
-}
-
-func (s TestSupport) ScopedWasmIBCKeeper() capabilitykeeper.ScopedKeeper {
- return s.app.ScopedWasmKeeper
-}
-
-func (s TestSupport) ScopeIBCKeeper() capabilitykeeper.ScopedKeeper {
- return s.app.ScopedIBCKeeper
-}
-
-func (s TestSupport) ScopedTransferKeeper() capabilitykeeper.ScopedKeeper {
- return s.app.ScopedTransferKeeper
-}
-
-func (s TestSupport) StakingKeeper() stakingkeeper.Keeper {
- return s.app.StakingKeeper
-}
-
-func (s TestSupport) BankKeeper() bankkeeper.Keeper {
- return s.app.BankKeeper
-}
-
-func (s TestSupport) TransferKeeper() ibctransferkeeper.Keeper {
- return s.app.TransferKeeper
-}
-
-func (s TestSupport) GetBaseApp() *baseapp.BaseApp {
- return s.app.BaseApp
-}
-
-func (s TestSupport) GetTxConfig() client.TxConfig {
- return params.MakeEncodingConfig().TxConfig
-}
diff --git a/app/test_helpers.go b/app/test_helpers.go
index c48425f6ba..60d2fbb514 100644
--- a/app/test_helpers.go
+++ b/app/test_helpers.go
@@ -1,262 +1,236 @@
package app
import (
- "bytes"
- "encoding/hex"
"encoding/json"
"fmt"
+ "math/rand"
+ "os"
"path/filepath"
- "strconv"
"testing"
"time"
+ "cosmossdk.io/math"
+
+ dbm "github.com/cometbft/cometbft-db"
+ abci "github.com/cometbft/cometbft/abci/types"
+ tmjson "github.com/cometbft/cometbft/libs/json"
+ "github.com/cometbft/cometbft/libs/log"
+ tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
+ tmtypes "github.com/cometbft/cometbft/types"
bam "github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
+ "github.com/cosmos/cosmos-sdk/client/flags"
+ "github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
- "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
+ "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
- "github.com/cosmos/cosmos-sdk/simapp/helpers"
+ "github.com/cosmos/cosmos-sdk/server"
+ servertypes "github.com/cosmos/cosmos-sdk/server/types"
"github.com/cosmos/cosmos-sdk/snapshots"
+ snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types"
+ pruningtypes "github.com/cosmos/cosmos-sdk/store/pruning/types"
+ "github.com/cosmos/cosmos-sdk/testutil/mock"
+ "github.com/cosmos/cosmos-sdk/testutil/network"
+ simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
sdk "github.com/cosmos/cosmos-sdk/types"
- "github.com/cosmos/cosmos-sdk/types/errors"
+ "github.com/cosmos/cosmos-sdk/types/module/testutil"
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"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/stretchr/testify/require"
- abci "github.com/tendermint/tendermint/abci/types"
- "github.com/tendermint/tendermint/libs/log"
- tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
- tmtypes "github.com/tendermint/tendermint/types"
- dbm "github.com/tendermint/tm-db"
"github.com/CosmWasm/wasmd/x/wasm"
+ wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
)
-// DefaultConsensusParams defines the default Tendermint consensus params used in
-// WasmApp testing.
-var DefaultConsensusParams = &abci.ConsensusParams{
- Block: &abci.BlockParams{
- MaxBytes: 8000000,
- MaxGas: 1234000000,
- },
- Evidence: &tmproto.EvidenceParams{
- MaxAgeNumBlocks: 302400,
- MaxAgeDuration: 504 * time.Hour, // 3 weeks is the max duration
- MaxBytes: 10000,
- },
- Validator: &tmproto.ValidatorParams{
- PubKeyTypes: []string{
- tmtypes.ABCIPubKeyTypeEd25519,
- },
- },
+// SetupOptions defines arguments that are passed into `WasmApp` constructor.
+type SetupOptions struct {
+ Logger log.Logger
+ DB *dbm.MemDB
+ AppOpts servertypes.AppOptions
+ WasmOpts []wasm.Option
}
func setup(t testing.TB, withGenesis bool, invCheckPeriod uint, opts ...wasm.Option) (*WasmApp, GenesisState) {
nodeHome := t.TempDir()
snapshotDir := filepath.Join(nodeHome, "data", "snapshots")
- snapshotDB, err := sdk.NewLevelDB("metadata", snapshotDir)
+
+ snapshotDB, err := dbm.NewDB("metadata", dbm.GoLevelDBBackend, snapshotDir)
require.NoError(t, err)
t.Cleanup(func() { snapshotDB.Close() })
snapshotStore, err := snapshots.NewStore(snapshotDB, snapshotDir)
require.NoError(t, err)
- baseAppOpts := []func(*bam.BaseApp){bam.SetSnapshotStore(snapshotStore), bam.SetSnapshotKeepRecent(2)}
+ baseAppOpts := []func(*bam.BaseApp){bam.SetSnapshot(snapshotStore, snapshottypes.SnapshotOptions{KeepRecent: 2})}
db := dbm.NewMemDB()
t.Cleanup(func() { db.Close() })
- app := NewWasmApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, nodeHome, invCheckPeriod, MakeEncodingConfig(), wasm.EnableAllProposals, EmptyBaseAppOptions{}, opts, baseAppOpts...)
+
+ appOptions := make(simtestutil.AppOptionsMap, 0)
+ appOptions[flags.FlagHome] = nodeHome // ensure unique folder
+ appOptions[server.FlagInvCheckPeriod] = invCheckPeriod
+
+ app := NewWasmApp(log.NewNopLogger(), db, nil, true, wasmtypes.EnableAllProposals, appOptions, opts, baseAppOpts...)
if withGenesis {
- return app, NewDefaultGenesisState()
+ return app, NewDefaultGenesisState(app.AppCodec())
}
return app, GenesisState{}
}
-// Setup initializes a new WasmApp with DefaultNodeHome for integration tests
-func Setup(isCheckTx bool, opts ...wasm.Option) *WasmApp {
- db := dbm.NewMemDB()
- app := NewWasmApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, MakeEncodingConfig(), wasm.EnableAllProposals, EmptyBaseAppOptions{}, opts)
+// NewWasmAppWithCustomOptions initializes a new WasmApp with custom options.
+func NewWasmAppWithCustomOptions(t *testing.T, isCheckTx bool, options SetupOptions) *WasmApp {
+ t.Helper()
+
+ privVal := mock.NewPV()
+ pubKey, err := privVal.GetPubKey()
+ require.NoError(t, err)
+ // create validator set with single validator
+ validator := tmtypes.NewValidator(pubKey, 1)
+ valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator})
+
+ // generate genesis account
+ senderPrivKey := secp256k1.GenPrivKey()
+ acc := authtypes.NewBaseAccount(senderPrivKey.PubKey().Address().Bytes(), senderPrivKey.PubKey(), 0, 0)
+ balance := banktypes.Balance{
+ Address: acc.GetAddress().String(),
+ Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100000000000000))),
+ }
+
+ app := NewWasmApp(options.Logger, options.DB, nil, true, wasmtypes.EnableAllProposals, options.AppOpts, options.WasmOpts)
+ genesisState := NewDefaultGenesisState(app.appCodec)
+ genesisState, err = GenesisStateWithValSet(app.AppCodec(), genesisState, valSet, []authtypes.GenesisAccount{acc}, balance)
+ require.NoError(t, err)
if !isCheckTx {
- genesisState := NewDefaultGenesisState()
- stateBytes, err := json.MarshalIndent(genesisState, "", " ")
- if err != nil {
- panic(err)
- }
+ // init chain must be called to stop deliverState from being nil
+ stateBytes, err := tmjson.MarshalIndent(genesisState, "", " ")
+ require.NoError(t, err)
+ // Initialize the chain
app.InitChain(
abci.RequestInitChain{
Validators: []abci.ValidatorUpdate{},
- ConsensusParams: DefaultConsensusParams,
+ ConsensusParams: simtestutil.DefaultConsensusParams,
AppStateBytes: stateBytes,
},
)
}
+
return app
}
-// SetupWithGenesisValSet initializes a new WasmApp with a validator set and genesis accounts
-// that also act as delegators. For simplicity, each validator is bonded with a delegation
-// of one consensus engine unit (10^6) in the default token of the WasmApp from first genesis
-// account. A Nop logger is set in WasmApp.
-func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, chainID string, opts []wasm.Option, balances ...banktypes.Balance) *WasmApp {
- app, genesisState := setup(t, true, 5, opts...)
- // set genesis accounts
- authGenesis := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs)
- genesisState[authtypes.ModuleName] = app.appCodec.MustMarshalJSON(authGenesis)
-
- validators := make([]stakingtypes.Validator, 0, len(valSet.Validators))
- delegations := make([]stakingtypes.Delegation, 0, len(valSet.Validators))
+// Setup initializes a new WasmApp. A Nop logger is set in WasmApp.
+func Setup(t *testing.T, opts ...wasm.Option) *WasmApp {
+ t.Helper()
- bondAmt := sdk.TokensFromConsensusPower(1, sdk.DefaultPowerReduction)
+ privVal := mock.NewPV()
+ pubKey, err := privVal.GetPubKey()
+ require.NoError(t, err)
- for _, val := range valSet.Validators {
- pk, err := cryptocodec.FromTmPubKeyInterface(val.PubKey)
- require.NoError(t, err)
- pkAny, err := codectypes.NewAnyWithValue(pk)
- require.NoError(t, err)
- validator := stakingtypes.Validator{
- OperatorAddress: sdk.ValAddress(val.Address).String(),
- ConsensusPubkey: pkAny,
- Jailed: false,
- Status: stakingtypes.Bonded,
- Tokens: bondAmt,
- DelegatorShares: sdk.OneDec(),
- Description: stakingtypes.Description{},
- UnbondingHeight: int64(0),
- UnbondingTime: time.Unix(0, 0).UTC(),
- Commission: stakingtypes.NewCommission(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()),
- MinSelfDelegation: sdk.ZeroInt(),
- }
+ // create validator set with single validator
+ validator := tmtypes.NewValidator(pubKey, 1)
+ valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator})
- validators = append(validators, validator)
- delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress(), val.Address.Bytes(), sdk.OneDec()))
+ // generate genesis account
+ senderPrivKey := secp256k1.GenPrivKey()
+ acc := authtypes.NewBaseAccount(senderPrivKey.PubKey().Address().Bytes(), senderPrivKey.PubKey(), 0, 0)
+ balance := banktypes.Balance{
+ Address: acc.GetAddress().String(),
+ Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100000000000000))),
}
+ chainID := "testing"
+ app := SetupWithGenesisValSet(t, valSet, []authtypes.GenesisAccount{acc}, chainID, opts, balance)
- // set validators and delegations
- var stakingGenesis stakingtypes.GenesisState
- app.AppCodec().MustUnmarshalJSON(genesisState[stakingtypes.ModuleName], &stakingGenesis)
-
- bondDenom := stakingGenesis.Params.BondDenom
-
- // add bonded amount to bonded pool module account
- balances = append(balances, banktypes.Balance{
- Address: authtypes.NewModuleAddress(stakingtypes.BondedPoolName).String(),
- Coins: sdk.Coins{sdk.NewCoin(bondDenom, bondAmt.Mul(sdk.NewInt(int64(len(valSet.Validators)))))},
- })
+ return app
+}
- // set validators and delegations
- stakingGenesis = *stakingtypes.NewGenesisState(stakingGenesis.Params, validators, delegations)
- genesisState[stakingtypes.ModuleName] = app.AppCodec().MustMarshalJSON(&stakingGenesis)
+// SetupWithGenesisValSet initializes a new WasmApp with a validator set and genesis accounts
+// that also act as delegators. For simplicity, each validator is bonded with a delegation
+// of one consensus engine unit in the default token of the WasmApp from first genesis
+// account. A Nop logger is set in WasmApp.
+func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs []authtypes.GenesisAccount, chainID string, opts []wasm.Option, balances ...banktypes.Balance) *WasmApp {
+ t.Helper()
- // update total supply
- bankGenesis := banktypes.NewGenesisState(banktypes.DefaultGenesisState().Params, balances, sdk.NewCoins(), []banktypes.Metadata{})
- genesisState[banktypes.ModuleName] = app.AppCodec().MustMarshalJSON(bankGenesis)
+ app, genesisState := setup(t, true, 5, opts...)
+ genesisState, err := GenesisStateWithValSet(app.AppCodec(), genesisState, valSet, genAccs, balances...)
+ require.NoError(t, err)
stateBytes, err := json.MarshalIndent(genesisState, "", " ")
require.NoError(t, err)
// init chain will set the validator set and initialize the genesis accounts
+ consensusParams := simtestutil.DefaultConsensusParams
+ consensusParams.Block.MaxGas = 100 * simtestutil.DefaultGenTxGas
app.InitChain(
abci.RequestInitChain{
ChainId: chainID,
Validators: []abci.ValidatorUpdate{},
- ConsensusParams: DefaultConsensusParams,
+ ConsensusParams: consensusParams,
AppStateBytes: stateBytes,
},
)
-
// commit genesis changes
app.Commit()
- app.BeginBlock(
- abci.RequestBeginBlock{
- Header: tmproto.Header{
- ChainID: chainID,
- Height: app.LastBlockHeight() + 1,
- AppHash: app.LastCommitID().Hash,
- ValidatorsHash: valSet.Hash(),
- NextValidatorsHash: valSet.Hash(),
- },
- },
- )
+ app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{
+ ChainID: chainID,
+ Height: app.LastBlockHeight() + 1,
+ AppHash: app.LastCommitID().Hash,
+ Time: time.Now().UTC(),
+ ValidatorsHash: valSet.Hash(),
+ NextValidatorsHash: valSet.Hash(),
+ }})
return app
}
-// SetupWithEmptyStore setup a wasmd app instance with empty DB
+// SetupWithEmptyStore set up a wasmd app instance with empty DB
func SetupWithEmptyStore(t testing.TB) *WasmApp {
app, _ := setup(t, false, 0)
return app
}
-type GenerateAccountStrategy func(int) []sdk.AccAddress
-
-// createRandomAccounts is a strategy used by addTestAddrs() in order to generated addresses in random order.
-func createRandomAccounts(accNum int) []sdk.AccAddress {
- testAddrs := make([]sdk.AccAddress, accNum)
- for i := 0; i < accNum; i++ {
- pk := ed25519.GenPrivKey().PubKey()
- testAddrs[i] = sdk.AccAddress(pk.Address())
- }
-
- return testAddrs
-}
-
-// createIncrementalAccounts is a strategy used by addTestAddrs() in order to generated addresses in ascending order.
-func createIncrementalAccounts(accNum int) []sdk.AccAddress {
- addresses := make([]sdk.AccAddress, 0, accNum)
- var buffer bytes.Buffer
-
- // start at 100 so we can make up to 999 test addresses with valid test addresses
- for i := 100; i < (accNum + 100); i++ {
- numString := strconv.Itoa(i)
- buffer.WriteString("A58856F0FD53BF058B4909A21AEC019107BA6") // base address string
+// GenesisStateWithSingleValidator initializes GenesisState with a single validator and genesis accounts
+// that also act as delegators.
+func GenesisStateWithSingleValidator(t *testing.T, app *WasmApp) GenesisState {
+ t.Helper()
- buffer.WriteString(numString) // adding on final two digits to make addresses unique
- res, err := sdk.AccAddressFromHex(buffer.String())
- if err != nil {
- panic(err)
- }
- bech := res.String()
- addr, err := TestAddr(buffer.String(), bech)
- if err != nil {
- panic(err)
- }
+ privVal := mock.NewPV()
+ pubKey, err := privVal.GetPubKey()
+ require.NoError(t, err)
- addresses = append(addresses, addr)
- buffer.Reset()
+ // create validator set with single validator
+ validator := tmtypes.NewValidator(pubKey, 1)
+ valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator})
+
+ // generate genesis account
+ senderPrivKey := secp256k1.GenPrivKey()
+ acc := authtypes.NewBaseAccount(senderPrivKey.PubKey().Address().Bytes(), senderPrivKey.PubKey(), 0, 0)
+ balances := []banktypes.Balance{
+ {
+ Address: acc.GetAddress().String(),
+ Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100000000000000))),
+ },
}
- return addresses
-}
-
-// AddTestAddrsFromPubKeys adds the addresses into the WasmApp providing only the public keys.
-func AddTestAddrsFromPubKeys(app *WasmApp, ctx sdk.Context, pubKeys []cryptotypes.PubKey, accAmt sdk.Int) {
- initCoins := sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), accAmt))
-
- for _, pk := range pubKeys {
- initAccountWithCoins(app, ctx, sdk.AccAddress(pk.Address()), initCoins)
- }
-}
+ genesisState := NewDefaultGenesisState(app.appCodec)
+ genesisState, err = GenesisStateWithValSet(app.AppCodec(), genesisState, valSet, []authtypes.GenesisAccount{acc}, balances...)
+ require.NoError(t, err)
-// AddTestAddrs constructs and returns accNum amount of accounts with an
-// initial balance of accAmt in random order
-func AddTestAddrs(app *WasmApp, ctx sdk.Context, accNum int, accAmt sdk.Int) []sdk.AccAddress {
- return addTestAddrs(app, ctx, accNum, accAmt, createRandomAccounts)
+ return genesisState
}
-// AddTestAddrs constructs and returns accNum amount of accounts with an
+// AddTestAddrsIncremental constructs and returns accNum amount of accounts with an
// initial balance of accAmt in random order
-func AddTestAddrsIncremental(app *WasmApp, ctx sdk.Context, accNum int, accAmt sdk.Int) []sdk.AccAddress {
- return addTestAddrs(app, ctx, accNum, accAmt, createIncrementalAccounts)
+func AddTestAddrsIncremental(app *WasmApp, ctx sdk.Context, accNum int, accAmt math.Int) []sdk.AccAddress {
+ return addTestAddrs(app, ctx, accNum, accAmt, simtestutil.CreateIncrementalAccounts)
}
-func addTestAddrs(app *WasmApp, ctx sdk.Context, accNum int, accAmt sdk.Int, strategy GenerateAccountStrategy) []sdk.AccAddress {
+func addTestAddrs(app *WasmApp, ctx sdk.Context, accNum int, accAmt math.Int, strategy simtestutil.GenerateAccountStrategy) []sdk.AccAddress {
testAddrs := strategy(accNum)
initCoins := sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), accAmt))
- // fill all the addresses with some coins, set the loose pool tokens simultaneously
for _, addr := range testAddrs {
initAccountWithCoins(app, ctx, addr, initCoins)
}
@@ -276,188 +250,140 @@ func initAccountWithCoins(app *WasmApp, ctx sdk.Context, addr sdk.AccAddress, co
}
}
-// ConvertAddrsToValAddrs converts the provided addresses to ValAddress.
-func ConvertAddrsToValAddrs(addrs []sdk.AccAddress) []sdk.ValAddress {
- valAddrs := make([]sdk.ValAddress, len(addrs))
-
- for i, addr := range addrs {
- valAddrs[i] = sdk.ValAddress(addr)
- }
-
- return valAddrs
+// ModuleAccountAddrs provides a list of blocked module accounts from configuration in AppConfig
+//
+// Ported from WasmApp
+func ModuleAccountAddrs() map[string]bool {
+ return BlockedAddresses()
}
-func TestAddr(addr string, bech string) (sdk.AccAddress, error) {
- res, err := sdk.AccAddressFromHex(addr)
- if err != nil {
- return nil, err
- }
- bechexpected := res.String()
- if bech != bechexpected {
- return nil, fmt.Errorf("bech encoding doesn't match reference")
- }
+var emptyWasmOptions []wasm.Option
- bechres, err := sdk.AccAddressFromBech32(bech)
+// NewTestNetworkFixture returns a new WasmApp AppConstructor for network simulation tests
+func NewTestNetworkFixture() network.TestFixture {
+ dir, err := os.MkdirTemp("", "simapp")
if err != nil {
- return nil, err
+ panic(fmt.Sprintf("failed creating temporary directory: %v", err))
}
- if !bytes.Equal(bechres, res) {
- return nil, err
+ defer os.RemoveAll(dir)
+
+ app := NewWasmApp(log.NewNopLogger(), dbm.NewMemDB(), nil, true, wasmtypes.EnableAllProposals, simtestutil.NewAppOptionsWithFlagHome(dir), emptyWasmOptions)
+ appCtr := func(val network.ValidatorI) servertypes.Application {
+ return NewWasmApp(
+ val.GetCtx().Logger, dbm.NewMemDB(), nil, true, wasmtypes.EnableAllProposals,
+ simtestutil.NewAppOptionsWithFlagHome(val.GetCtx().Config.RootDir),
+ emptyWasmOptions,
+ bam.SetPruning(pruningtypes.NewPruningOptionsFromString(val.GetAppConfig().Pruning)),
+ bam.SetMinGasPrices(val.GetAppConfig().MinGasPrices),
+ )
}
- return res, nil
-}
-
-// CheckBalance checks the balance of an account.
-func CheckBalance(t *testing.T, app *WasmApp, addr sdk.AccAddress, balances sdk.Coins) {
- ctxCheck := app.BaseApp.NewContext(true, tmproto.Header{})
- require.True(t, balances.IsEqual(app.BankKeeper.GetAllBalances(ctxCheck, addr)))
+ return network.TestFixture{
+ AppConstructor: appCtr,
+ GenesisState: NewDefaultGenesisState(app.AppCodec()),
+ EncodingConfig: testutil.TestEncodingConfig{
+ InterfaceRegistry: app.InterfaceRegistry(),
+ Codec: app.AppCodec(),
+ TxConfig: app.TxConfig(),
+ Amino: app.LegacyAmino(),
+ },
+ }
}
-const DefaultGas = 1_500_000
-
-// SignCheckDeliver checks a generated signed transaction and simulates a
-// block commitment with the given transaction. A test assertion is made using
-// the parameter 'expPass' against the result. A corresponding result is
-// returned.
-func SignCheckDeliver(
+// SignAndDeliverWithoutCommit signs and delivers a transaction. No commit
+func SignAndDeliverWithoutCommit(
t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, header tmproto.Header, msgs []sdk.Msg,
- chainID string, accNums, accSeqs []uint64, expSimPass, expPass bool, priv ...cryptotypes.PrivKey,
+ chainID string, accNums, accSeqs []uint64, priv ...cryptotypes.PrivKey,
) (sdk.GasInfo, *sdk.Result, error) {
- tx, err := helpers.GenTx(
+ tx, err := simtestutil.GenSignedMockTx(
+ rand.New(rand.NewSource(time.Now().UnixNano())),
txCfg,
msgs,
sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 0)},
- helpers.DefaultGenTxGas,
+ simtestutil.DefaultGenTxGas,
chainID,
accNums,
accSeqs,
priv...,
)
require.NoError(t, err)
- txBytes, err := txCfg.TxEncoder()(tx)
- require.Nil(t, err)
-
- // Must simulate now as CheckTx doesn't run Msgs anymore
- _, res, err := app.Simulate(txBytes)
-
- if expSimPass {
- require.NoError(t, err)
- require.NotNil(t, res)
- } else {
- require.Error(t, err)
- require.Nil(t, res)
- }
// Simulate a sending a transaction and committing a block
- app.BeginBlock(abci.RequestBeginBlock{Header: header})
- gInfo, res, err := app.Deliver(txCfg.TxEncoder(), tx)
-
- if expPass {
- require.NoError(t, err)
- require.NotNil(t, res)
- } else {
- require.Error(t, err)
- require.Nil(t, res)
- }
-
- app.EndBlock(abci.RequestEndBlock{})
- app.Commit()
+ // app.BeginBlock(abci.RequestBeginBlock{Header: header})
+ gInfo, res, err := app.SimDeliver(txCfg.TxEncoder(), tx)
+ // app.EndBlock(abci.RequestEndBlock{})
+ // app.Commit()
return gInfo, res, err
}
-// SignAndDeliver signs and delivers a transaction. No simulation occurs as the
-// ibc testing package causes checkState and deliverState to diverge in block time.
-func SignAndDeliver(
- t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, header tmproto.Header, msgs []sdk.Msg,
- chainID string, accNums, accSeqs []uint64, priv ...cryptotypes.PrivKey,
-) (sdk.GasInfo, *sdk.Result, error) {
- tx, err := helpers.GenTx(
- txCfg,
- msgs,
- sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 0)},
- 2*DefaultGas,
- chainID,
- accNums,
- accSeqs,
- priv...,
- )
- require.NoError(t, err)
+// GenesisStateWithValSet returns a new genesis state with the validator set
+// copied from simtestutil with delegation not added to supply
+func GenesisStateWithValSet(
+ codec codec.Codec,
+ genesisState map[string]json.RawMessage,
+ valSet *tmtypes.ValidatorSet,
+ genAccs []authtypes.GenesisAccount,
+ balances ...banktypes.Balance,
+) (map[string]json.RawMessage, error) {
+ // set genesis accounts
+ authGenesis := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs)
+ genesisState[authtypes.ModuleName] = codec.MustMarshalJSON(authGenesis)
- // Simulate a sending a transaction and committing a block
- app.BeginBlock(abci.RequestBeginBlock{Header: header})
- gInfo, res, err := app.Deliver(txCfg.TxEncoder(), tx)
- return gInfo, res, err
-}
+ validators := make([]stakingtypes.Validator, 0, len(valSet.Validators))
+ delegations := make([]stakingtypes.Delegation, 0, len(valSet.Validators))
-// GenSequenceOfTxs generates a set of signed transactions of messages, such
-// that they differ only by having the sequence numbers incremented between
-// every transaction.
-func GenSequenceOfTxs(txGen client.TxConfig, msgs []sdk.Msg, accNums []uint64, initSeqNums []uint64, numToGenerate int, priv ...cryptotypes.PrivKey) ([]sdk.Tx, error) {
- txs := make([]sdk.Tx, numToGenerate)
- var err error
- for i := 0; i < numToGenerate; i++ {
- txs[i], err = helpers.GenTx(
- txGen,
- msgs,
- sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 0)},
- helpers.DefaultGenTxGas,
- "",
- accNums,
- initSeqNums,
- priv...,
- )
+ bondAmt := sdk.DefaultPowerReduction
+
+ for _, val := range valSet.Validators {
+ pk, err := cryptocodec.FromTmPubKeyInterface(val.PubKey)
if err != nil {
- break
+ return nil, fmt.Errorf("failed to convert pubkey: %w", err)
}
- incrementAllSequenceNumbers(initSeqNums)
- }
- return txs, err
-}
+ pkAny, err := codectypes.NewAnyWithValue(pk)
+ if err != nil {
+ return nil, fmt.Errorf("failed to create new any: %w", err)
+ }
-func incrementAllSequenceNumbers(initSeqNums []uint64) {
- for i := 0; i < len(initSeqNums); i++ {
- initSeqNums[i]++
+ validator := stakingtypes.Validator{
+ OperatorAddress: sdk.ValAddress(val.Address).String(),
+ ConsensusPubkey: pkAny,
+ Jailed: false,
+ Status: stakingtypes.Bonded,
+ Tokens: bondAmt,
+ DelegatorShares: math.LegacyOneDec(),
+ Description: stakingtypes.Description{},
+ UnbondingHeight: int64(0),
+ UnbondingTime: time.Unix(0, 0).UTC(),
+ Commission: stakingtypes.NewCommission(math.LegacyZeroDec(), math.LegacyZeroDec(), math.LegacyZeroDec()),
+ MinSelfDelegation: math.ZeroInt(),
+ }
+ validators = append(validators, validator)
+ delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress(), val.Address.Bytes(), math.LegacyOneDec()))
}
-}
-// CreateTestPubKeys returns a total of numPubKeys public keys in ascending order.
-func CreateTestPubKeys(numPubKeys int) []cryptotypes.PubKey {
- publicKeys := make([]cryptotypes.PubKey, 0, numPubKeys)
- var buffer bytes.Buffer
-
- // start at 10 to avoid changing 1 to 01, 2 to 02, etc
- for i := 100; i < (numPubKeys + 100); i++ {
- numString := strconv.Itoa(i)
- buffer.WriteString("0B485CFC0EECC619440448436F8FC9DF40566F2369E72400281454CB552AF") // base pubkey string
- buffer.WriteString(numString) // adding on final two digits to make pubkeys unique
- publicKeys = append(publicKeys, NewPubKeyFromHex(buffer.String()))
- buffer.Reset()
- }
+ // set validators and delegations
+ stakingGenesis := stakingtypes.NewGenesisState(stakingtypes.DefaultParams(), validators, delegations)
+ genesisState[stakingtypes.ModuleName] = codec.MustMarshalJSON(stakingGenesis)
- return publicKeys
-}
+ // add bonded amount to bonded pool module account
+ balances = append(balances, banktypes.Balance{
+ Address: authtypes.NewModuleAddress(stakingtypes.BondedPoolName).String(),
+ Coins: sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, bondAmt.MulRaw(int64(len(valSet.Validators))))},
+ })
-// NewPubKeyFromHex returns a PubKey from a hex string.
-func NewPubKeyFromHex(pk string) (res cryptotypes.PubKey) {
- pkBytes, err := hex.DecodeString(pk)
- if err != nil {
- panic(err)
- }
- if len(pkBytes) != ed25519.PubKeySize {
- panic(errors.Wrap(errors.ErrInvalidPubKey, "invalid pubkey size"))
+ totalSupply := sdk.NewCoins()
+ for _, b := range balances {
+ // add genesis acc tokens to total supply
+ totalSupply = totalSupply.Add(b.Coins...)
}
- return &ed25519.PubKey{Key: pkBytes}
-}
-// EmptyBaseAppOptions is a stub implementing AppOptions
-type EmptyBaseAppOptions struct{}
-
-// Get implements AppOptions
-func (ao EmptyBaseAppOptions) Get(o string) interface{} {
- return nil
+ // update total supply
+ bankGenesis := banktypes.NewGenesisState(banktypes.DefaultGenesisState().Params, balances, totalSupply, []banktypes.Metadata{}, []banktypes.SendEnabled{})
+ genesisState[banktypes.ModuleName] = codec.MustMarshalJSON(bankGenesis)
+ println(string(genesisState[banktypes.ModuleName]))
+ return genesisState, nil
}
// FundAccount is a utility function that funds an account by minting and
diff --git a/app/upgrades.go b/app/upgrades.go
new file mode 100644
index 0000000000..7d20431349
--- /dev/null
+++ b/app/upgrades.go
@@ -0,0 +1,45 @@
+package app
+
+import (
+ "github.com/cosmos/cosmos-sdk/baseapp"
+ storetypes "github.com/cosmos/cosmos-sdk/store/types"
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ "github.com/cosmos/cosmos-sdk/types/module"
+ paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
+ upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
+)
+
+// UpgradeName defines the on-chain upgrade name for the sample SimApp upgrade
+// from v046 to v047.
+//
+// NOTE: This upgrade defines a reference implementation of what an upgrade
+// could look like when an application is migrating from Cosmos SDK version
+// v0.46.x to v0.47.x.
+const UpgradeName = "v046-to-v047" // add your custom upgrade name
+
+func (app WasmApp) RegisterUpgradeHandlers() {
+ baseAppLegacySS := app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramstypes.ConsensusParamsKeyTable())
+
+ app.UpgradeKeeper.SetUpgradeHandler(
+ UpgradeName,
+ func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
+ // Migrate Tendermint consensus parameters from x/params module to a
+ // dedicated x/consensus module.
+ baseapp.MigrateParams(ctx, baseAppLegacySS, &app.ConsensusParamsKeeper)
+
+ return app.ModuleManager.RunMigrations(ctx, app.Configurator(), fromVM)
+ },
+ )
+
+ upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk()
+ if err != nil {
+ panic(err)
+ }
+
+ if upgradeInfo.Name == UpgradeName && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
+ storeUpgrades := storetypes.StoreUpgrades{}
+
+ // configure store loader that checks if version == upgradeHeight and applies store upgrades
+ app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades))
+ }
+}
diff --git a/benchmarks/app_test.go b/benchmarks/app_test.go
index 88773e6b42..df0ee91327 100644
--- a/benchmarks/app_test.go
+++ b/benchmarks/app_test.go
@@ -2,21 +2,23 @@ package benchmarks
import (
"encoding/json"
+ "math/rand"
"os"
"testing"
"time"
- "github.com/stretchr/testify/require"
+ simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
+ moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
- abci "github.com/tendermint/tendermint/abci/types"
- "github.com/tendermint/tendermint/libs/log"
- tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
- dbm "github.com/tendermint/tm-db"
+ dbm "github.com/cometbft/cometbft-db"
+ abci "github.com/cometbft/cometbft/abci/types"
+ "github.com/cometbft/cometbft/libs/log"
+ tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
+ tmtypes "github.com/cometbft/cometbft/types"
+ "github.com/stretchr/testify/require"
"github.com/cosmos/cosmos-sdk/client"
- "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
- "github.com/cosmos/cosmos-sdk/simapp/helpers"
- simappparams "github.com/cosmos/cosmos-sdk/simapp/params"
+ "github.com/cosmos/cosmos-sdk/testutil/mock"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
@@ -24,32 +26,81 @@ import (
"github.com/CosmWasm/wasmd/app"
"github.com/CosmWasm/wasmd/x/wasm"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
+
+ codectypes "github.com/cosmos/cosmos-sdk/codec/types"
+ "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
+ stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
+
+ cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
)
-func setup(db dbm.DB, withGenesis bool, invCheckPeriod uint, opts ...wasm.Option) (*app.WasmApp, app.GenesisState) {
- encodingConfig := app.MakeEncodingConfig()
- wasmApp := app.NewWasmApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, app.DefaultNodeHome, invCheckPeriod, encodingConfig, wasm.EnableAllProposals, app.EmptyBaseAppOptions{}, opts)
+func setup(db dbm.DB, withGenesis bool, invCheckPeriod uint, opts ...wasm.Option) (*app.WasmApp, app.GenesisState) { //nolint:unparam
+ wasmApp := app.NewWasmApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, wasm.EnableAllProposals, simtestutil.EmptyAppOptions{}, nil)
+
if withGenesis {
- return wasmApp, app.NewDefaultGenesisState()
+ return wasmApp, app.NewDefaultGenesisState(wasmApp.AppCodec())
}
return wasmApp, app.GenesisState{}
}
-// SetupWithGenesisAccounts initializes a new WasmApp with the provided genesis
+// SetupWithGenesisAccountsAndValSet initializes a new WasmApp with the provided genesis
// accounts and possible balances.
-func SetupWithGenesisAccounts(b testing.TB, db dbm.DB, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *app.WasmApp {
+func SetupWithGenesisAccountsAndValSet(b testing.TB, db dbm.DB, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *app.WasmApp {
wasmApp, genesisState := setup(db, true, 0)
authGenesis := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs)
- appCodec := app.NewTestSupport(b, wasmApp).AppCodec()
+ appCodec := wasmApp.AppCodec()
+
+ privVal := mock.NewPV()
+ pubKey, err := privVal.GetPubKey()
+ require.NoError(b, err)
genesisState[authtypes.ModuleName] = appCodec.MustMarshalJSON(authGenesis)
+ validator := tmtypes.NewValidator(pubKey, 1)
+ valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator})
+
+ validators := make([]stakingtypes.Validator, 0, len(valSet.Validators))
+ delegations := make([]stakingtypes.Delegation, 0, len(valSet.Validators))
+
+ bondAmt := sdk.DefaultPowerReduction
+
+ for _, val := range valSet.Validators {
+ pk, _ := cryptocodec.FromTmPubKeyInterface(val.PubKey)
+ pkAny, _ := codectypes.NewAnyWithValue(pk)
+ validator := stakingtypes.Validator{
+ OperatorAddress: sdk.ValAddress(val.Address).String(),
+ ConsensusPubkey: pkAny,
+ Jailed: false,
+ Status: stakingtypes.Bonded,
+ Tokens: bondAmt,
+ DelegatorShares: sdk.OneDec(),
+ Description: stakingtypes.Description{},
+ UnbondingHeight: int64(0),
+ UnbondingTime: time.Unix(0, 0).UTC(),
+ Commission: stakingtypes.NewCommission(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()),
+ MinSelfDelegation: sdk.ZeroInt(),
+ }
+ validators = append(validators, validator)
+ delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress(), val.Address.Bytes(), sdk.OneDec()))
+
+ }
+ // set validators and delegations
+ stakingGenesis := stakingtypes.NewGenesisState(stakingtypes.DefaultParams(), validators, delegations)
+ genesisState[stakingtypes.ModuleName] = appCodec.MustMarshalJSON(stakingGenesis)
+
totalSupply := sdk.NewCoins()
+
+ // add bonded amount to bonded pool module account
+ balances = append(balances, banktypes.Balance{
+ Address: authtypes.NewModuleAddress(stakingtypes.BondedPoolName).String(),
+ Coins: sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, bondAmt)},
+ })
+ // update total supply
for _, b := range balances {
+ // add genesis acc tokens and delegated tokens to total supply
totalSupply = totalSupply.Add(b.Coins...)
}
-
- bankGenesis := banktypes.NewGenesisState(banktypes.DefaultGenesisState().Params, balances, totalSupply, []banktypes.Metadata{})
+ bankGenesis := banktypes.NewGenesisState(banktypes.DefaultGenesisState().Params, balances, totalSupply, []banktypes.Metadata{}, nil)
genesisState[banktypes.ModuleName] = appCodec.MustMarshalJSON(bankGenesis)
stateBytes, err := json.MarshalIndent(genesisState, "", " ")
@@ -57,10 +108,13 @@ func SetupWithGenesisAccounts(b testing.TB, db dbm.DB, genAccs []authtypes.Genes
panic(err)
}
+ consensusParams := simtestutil.DefaultConsensusParams
+ consensusParams.Block.MaxGas = 100 * simtestutil.DefaultGenTxGas
+
wasmApp.InitChain(
abci.RequestInitChain{
Validators: []abci.ValidatorUpdate{},
- ConsensusParams: app.DefaultConsensusParams,
+ ConsensusParams: consensusParams,
AppStateBytes: stateBytes,
},
)
@@ -111,11 +165,11 @@ func InitializeWasmApp(b testing.TB, db dbm.DB, numAccounts int) AppInfo {
Coins: sdk.NewCoins(sdk.NewInt64Coin(denom, 100000000000)),
}
}
- wasmApp := SetupWithGenesisAccounts(b, db, genAccs, bals...)
+ wasmApp := SetupWithGenesisAccountsAndValSet(b, db, genAccs, bals...)
// add wasm contract
height := int64(2)
- txGen := simappparams.MakeTestEncodingConfig().TxConfig
+ txGen := moduletestutil.MakeTestEncodingConfig().TxConfig
wasmApp.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: height, Time: time.Now()}})
// upload the code
@@ -125,9 +179,10 @@ func InitializeWasmApp(b testing.TB, db dbm.DB, numAccounts int) AppInfo {
Sender: addr.String(),
WASMByteCode: cw20Code,
}
- storeTx, err := helpers.GenTx(txGen, []sdk.Msg{&storeMsg}, nil, 55123123, "", []uint64{0}, []uint64{0}, minter)
+ r := rand.New(rand.NewSource(time.Now().UnixNano()))
+ storeTx, err := simtestutil.GenSignedMockTx(r, txGen, []sdk.Msg{&storeMsg}, nil, 55123123, "", []uint64{0}, []uint64{0}, minter)
require.NoError(b, err)
- _, res, err := wasmApp.Deliver(txGen.TxEncoder(), storeTx)
+ _, _, err = wasmApp.SimDeliver(txGen.TxEncoder(), storeTx)
require.NoError(b, err)
codeID := uint64(1)
@@ -159,15 +214,15 @@ func InitializeWasmApp(b testing.TB, db dbm.DB, numAccounts int) AppInfo {
Msg: initBz,
}
gasWanted := 500000 + 10000*uint64(numAccounts)
- initTx, err := helpers.GenTx(txGen, []sdk.Msg{&initMsg}, nil, gasWanted, "", []uint64{0}, []uint64{1}, minter)
+ initTx, err := simtestutil.GenSignedMockTx(r, txGen, []sdk.Msg{&initMsg}, nil, gasWanted, "", []uint64{0}, []uint64{1}, minter)
require.NoError(b, err)
- _, res, err = wasmApp.Deliver(txGen.TxEncoder(), initTx)
+ _, res, err := wasmApp.SimDeliver(txGen.TxEncoder(), initTx)
require.NoError(b, err)
// TODO: parse contract address better
evt := res.Events[len(res.Events)-1]
attr := evt.Attributes[0]
- contractAddr := string(attr.Value)
+ contractAddr := attr.Value
wasmApp.EndBlock(abci.RequestEndBlock{Height: height})
wasmApp.Commit()
@@ -180,7 +235,7 @@ func InitializeWasmApp(b testing.TB, db dbm.DB, numAccounts int) AppInfo {
Denom: denom,
AccNum: 0,
SeqNum: 2,
- TxConfig: simappparams.MakeTestEncodingConfig().TxConfig,
+ TxConfig: moduletestutil.MakeTestEncodingConfig().TxConfig,
}
}
@@ -188,10 +243,12 @@ func GenSequenceOfTxs(b testing.TB, info *AppInfo, msgGen func(*AppInfo) ([]sdk.
fees := sdk.Coins{sdk.NewInt64Coin(info.Denom, 0)}
txs := make([]sdk.Tx, numToGenerate)
+ r := rand.New(rand.NewSource(time.Now().UnixNano()))
for i := 0; i < numToGenerate; i++ {
msgs, err := msgGen(info)
require.NoError(b, err)
- txs[i], err = helpers.GenTx(
+ txs[i], err = simtestutil.GenSignedMockTx(
+ r,
info.TxConfig,
msgs,
fees,
@@ -202,7 +259,7 @@ func GenSequenceOfTxs(b testing.TB, info *AppInfo, msgGen func(*AppInfo) ([]sdk.
info.MinterKey,
)
require.NoError(b, err)
- info.SeqNum += 1
+ info.SeqNum++
}
return txs
diff --git a/benchmarks/bench_test.go b/benchmarks/bench_test.go
index 9001f1abf4..c953c92195 100644
--- a/benchmarks/bench_test.go
+++ b/benchmarks/bench_test.go
@@ -8,9 +8,9 @@ import (
"github.com/stretchr/testify/require"
"github.com/syndtr/goleveldb/leveldb/opt"
- abci "github.com/tendermint/tendermint/abci/types"
- tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
- dbm "github.com/tendermint/tm-db"
+ dbm "github.com/cometbft/cometbft-db"
+ abci "github.com/cometbft/cometbft/abci/types"
+ tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
sdk "github.com/cosmos/cosmos-sdk/types"
@@ -107,15 +107,16 @@ func BenchmarkTxSending(b *testing.B) {
for j := 0; j < blockSize; j++ {
idx := i*blockSize + j
-
- _, _, err := appInfo.App.Check(txEncoder, txs[idx])
- if err != nil {
- panic("something is broken in checking transaction")
- }
- _, _, err = appInfo.App.Deliver(txEncoder, txs[idx])
+ bz, err := txEncoder(txs[idx])
require.NoError(b, err)
+ rsp := appInfo.App.CheckTx(abci.RequestCheckTx{
+ Tx: bz,
+ Type: abci.CheckTxType_New,
+ })
+ require.True(b, rsp.IsOK())
+ dRsp := appInfo.App.DeliverTx(abci.RequestDeliverTx{Tx: bz})
+ require.True(b, dRsp.IsOK())
}
-
appInfo.App.EndBlock(abci.RequestEndBlock{Height: height})
appInfo.App.Commit()
height++
diff --git a/cmd/wasmd/genaccounts.go b/cmd/wasmd/genaccounts.go
index 9acf2cea70..bc33c4b46a 100644
--- a/cmd/wasmd/genaccounts.go
+++ b/cmd/wasmd/genaccounts.go
@@ -2,8 +2,6 @@ package main
import (
"bufio"
- "encoding/json"
- "errors"
"fmt"
"github.com/spf13/cobra"
@@ -13,17 +11,14 @@ import (
"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"
+ auth "github.com/cosmos/cosmos-sdk/x/auth/helpers"
)
const (
flagVestingStart = "vesting-start-time"
flagVestingEnd = "vesting-end-time"
flagVestingAmt = "vesting-amount"
+ flagAppendMode = "append"
)
// AddGenesisAccountCmd returns add-genesis-account cobra Command.
@@ -50,11 +45,12 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa
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)
+ return err
}
+
if keyringBackend != "" && clientCtx.Keyring == nil {
var err error
- kr, err = keyring.New(sdk.KeyringServiceName(), keyringBackend, clientCtx.HomeDir, inBuf)
+ kr, err = keyring.New(sdk.KeyringServiceName(), keyringBackend, clientCtx.HomeDir, inBuf, clientCtx.Codec)
if err != nil {
return err
}
@@ -62,122 +58,34 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa
kr = clientCtx.Keyring
}
- info, err := kr.Key(args[0])
+ k, err := kr.Key(args[0])
if err != nil {
return fmt.Errorf("failed to get address from Keyring: %w", err)
}
- addr = info.GetAddress()
+
+ addr, err = k.GetAddress()
+ if err != nil {
+ return err
+ }
}
- coins, err := sdk.ParseCoinsNormalized(args[1])
+ appendflag, err := cmd.Flags().GetBool(flagAppendMode)
if err != nil {
- return fmt.Errorf("failed to parse coins: %w", err)
+ return err
}
-
vestingStart, err := cmd.Flags().GetInt64(flagVestingStart)
if err != nil {
- return fmt.Errorf("failed to parse vesting start: %w", err)
+ return err
}
vestingEnd, err := cmd.Flags().GetInt64(flagVestingEnd)
if err != nil {
- return fmt.Errorf("failed to parse vesting end: %w", err)
+ return 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)
+ return 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)
+ return auth.AddGenesisAccount(clientCtx.Codec, addr, appendflag, config.GenesisFile(), args[1], vestingAmtStr, vestingStart, vestingEnd)
},
}
@@ -186,6 +94,7 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa
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")
+ cmd.Flags().Bool(flagAppendMode, false, "append the coins to an account already in the genesis.json file")
flags.AddQueryFlagsToCmd(cmd)
return cmd
diff --git a/cmd/wasmd/main.go b/cmd/wasmd/main.go
index 7bd3d01220..3a7719e6cf 100644
--- a/cmd/wasmd/main.go
+++ b/cmd/wasmd/main.go
@@ -12,7 +12,7 @@ import (
func main() {
rootCmd, _ := NewRootCmd()
- if err := svrcmd.Execute(rootCmd, app.DefaultNodeHome); err != nil {
+ if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil {
switch e := err.(type) {
case server.ErrorCode:
os.Exit(e.Code)
diff --git a/cmd/wasmd/root.go b/cmd/wasmd/root.go
index eeaf39aad5..c906c5ce1e 100644
--- a/cmd/wasmd/root.go
+++ b/cmd/wasmd/root.go
@@ -6,30 +6,40 @@ import (
"os"
"path/filepath"
+ rosettaCmd "cosmossdk.io/tools/rosetta/cmd"
+
+ dbm "github.com/cometbft/cometbft-db"
+ tmcfg "github.com/cometbft/cometbft/config"
+ tmcli "github.com/cometbft/cometbft/libs/cli"
+ "github.com/cometbft/cometbft/libs/log"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/config"
"github.com/cosmos/cosmos-sdk/client/debug"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/keys"
+ "github.com/cosmos/cosmos-sdk/client/pruning"
"github.com/cosmos/cosmos-sdk/client/rpc"
"github.com/cosmos/cosmos-sdk/server"
+ serverconfig "github.com/cosmos/cosmos-sdk/server/config"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
"github.com/cosmos/cosmos-sdk/snapshots"
+ snapshottypes "github.com/cosmos/cosmos-sdk/snapshots/types"
"github.com/cosmos/cosmos-sdk/store"
sdk "github.com/cosmos/cosmos-sdk/types"
+ "github.com/cosmos/cosmos-sdk/types/mempool"
"github.com/cosmos/cosmos-sdk/version"
authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/crisis"
+ "github.com/cosmos/cosmos-sdk/x/genutil"
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
+ genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
"github.com/prometheus/client_golang/prometheus"
"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"
+ "github.com/spf13/viper"
"github.com/CosmWasm/wasmd/app"
"github.com/CosmWasm/wasmd/app/params"
@@ -57,7 +67,6 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
WithLegacyAmino(encodingConfig.Amino).
WithInput(os.Stdin).
WithAccountRetriever(authtypes.AccountRetriever{}).
- WithBroadcastMode(flags.BroadcastBlock).
WithHomeDir(app.DefaultNodeHome).
WithViper("")
@@ -83,7 +92,10 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
return err
}
- return server.InterceptConfigsPreRunHandler(cmd, "", nil)
+ customAppTemplate, customAppConfig := initAppConfig()
+ customTMConfig := initTendermintConfig()
+
+ return server.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, customTMConfig)
},
}
@@ -92,10 +104,64 @@ func NewRootCmd() (*cobra.Command, params.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()
+
+ // these values put a higher strain on node memory
+ // cfg.P2P.MaxNumInboundPeers = 100
+ // cfg.P2P.MaxNumOutboundPeers = 40
+
+ return cfg
+}
+
+// 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.
+
+ type CustomAppConfig struct {
+ serverconfig.Config
+
+ Wasm wasmtypes.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 = "0stake"
+ // srvCfg.BaseConfig.IAVLDisableFastNode = true // disable fastnode by default
+
+ customAppConfig := CustomAppConfig{
+ Config: *srvCfg,
+ Wasm: wasmtypes.DefaultWasmConfig(),
+ }
+
+ customAppTemplate := serverconfig.DefaultConfigTemplate +
+ wasmtypes.DefaultConfigTemplate()
+
+ return customAppTemplate, customAppConfig
+}
+
func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) {
+ gentxModule := app.ModuleBasics[genutiltypes.ModuleName].(genutil.AppModuleBasic)
rootCmd.AddCommand(
genutilcli.InitCmd(app.ModuleBasics, app.DefaultNodeHome),
- genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome),
+ genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome, gentxModule.GenTxValidator),
+ genutilcli.MigrateGenesisCmd(),
genutilcli.GenTxCmd(app.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome),
genutilcli.ValidateGenesisCmd(app.ModuleBasics),
AddGenesisAccountCmd(app.DefaultNodeHome),
@@ -103,12 +169,10 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) {
// testnetCmd(app.ModuleBasics, banktypes.GenesisBalancesIterator{}),
debug.Cmd(),
config.Cmd(),
+ pruning.PruningCmd(newApp),
)
- ac := appCreator{
- encCfg: encodingConfig,
- }
- server.AddCommands(rootCmd, app.DefaultNodeHome, ac.newApp, ac.appExport, addModuleInitFlags)
+ server.AddCommands(rootCmd, app.DefaultNodeHome, newApp, appExport, addModuleInitFlags)
// add keybase, auxiliary RPC, query, and tx child commands
rootCmd.AddCommand(
@@ -117,6 +181,8 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) {
txCommand(),
keys.Commands(app.DefaultNodeHome),
)
+ // add rosetta
+ rootCmd.AddCommand(rosettaCmd.RosettaCommand(encodingConfig.InterfaceRegistry, encodingConfig.Marshaler))
}
func addModuleInitFlags(startCmd *cobra.Command) {
@@ -143,7 +209,6 @@ func queryCommand() *cobra.Command {
)
app.ModuleBasics.AddQueryCommands(cmd)
- cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID")
return cmd
}
@@ -167,19 +232,16 @@ func txCommand() *cobra.Command {
authcmd.GetBroadcastCommand(),
authcmd.GetEncodeCommand(),
authcmd.GetDecodeCommand(),
+ authcmd.GetAuxToFeeCommand(),
)
app.ModuleBasics.AddTxCommands(cmd)
- cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID")
return cmd
}
-type appCreator struct {
- encCfg params.EncodingConfig
-}
-
-func (ac appCreator) newApp(
+// newApp creates the application
+func newApp(
logger log.Logger,
db dbm.DB,
traceStore io.Writer,
@@ -202,7 +264,7 @@ func (ac appCreator) newApp(
}
snapshotDir := filepath.Join(cast.ToString(appOpts.Get(flags.FlagHome)), "data", "snapshots")
- snapshotDB, err := sdk.NewLevelDB("metadata", snapshotDir)
+ snapshotDB, err := dbm.NewDB("metadata", server.GetAppDBBackend(appOpts), snapshotDir)
if err != nil {
panic(err)
}
@@ -214,11 +276,13 @@ func (ac appCreator) newApp(
if cast.ToBool(appOpts.Get("telemetry.enabled")) {
wasmOpts = append(wasmOpts, wasmkeeper.WithVMCacheMetrics(prometheus.DefaultRegisterer))
}
+ snapshotOptions := snapshottypes.NewSnapshotOptions(
+ cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval)),
+ cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent)),
+ )
- return app.NewWasmApp(logger, db, traceStore, true, skipUpgradeHeights,
- cast.ToString(appOpts.Get(flags.FlagHome)),
- cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)),
- ac.encCfg,
+ return app.NewWasmApp(
+ logger, db, traceStore, true,
app.GetEnabledProposals(),
appOpts,
wasmOpts,
@@ -230,13 +294,15 @@ func (ac appCreator) newApp(
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.SetSnapshot(snapshotStore, snapshotOptions),
+ baseapp.SetIAVLCacheSize(cast.ToInt(appOpts.Get(server.FlagIAVLCacheSize))),
+ baseapp.SetIAVLDisableFastNode(cast.ToBool(appOpts.Get(server.FlagDisableIAVLFastNode))),
+ baseapp.SetMempool(mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(cast.ToInt(appOpts.Get(server.FlagMempoolMaxTxs))))),
)
}
-func (ac appCreator) appExport(
+// appExport creates a new wasm app (optionally at a given height) and exports state.
+func appExport(
logger log.Logger,
db dbm.DB,
traceStore io.Writer,
@@ -244,6 +310,7 @@ func (ac appCreator) appExport(
forZeroHeight bool,
jailAllowedAddrs []string,
appOpts servertypes.AppOptions,
+ modulesToExport []string,
) (servertypes.ExportedApp, error) {
var wasmApp *app.WasmApp
homePath, ok := appOpts.Get(flags.FlagHome).(string)
@@ -251,17 +318,21 @@ func (ac appCreator) appExport(
return servertypes.ExportedApp{}, errors.New("application home is not set")
}
- loadLatest := height == -1
+ viperAppOpts, ok := appOpts.(*viper.Viper)
+ if !ok {
+ return servertypes.ExportedApp{}, errors.New("appOpts is not viper.Viper")
+ }
+
+ // overwrite the FlagInvCheckPeriod
+ viperAppOpts.Set(server.FlagInvCheckPeriod, 1)
+ appOpts = viperAppOpts
+
var emptyWasmOpts []wasm.Option
wasmApp = app.NewWasmApp(
logger,
db,
traceStore,
- loadLatest,
- map[int64]bool{},
- homePath,
- cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)),
- ac.encCfg,
+ height == -1,
app.GetEnabledProposals(),
appOpts,
emptyWasmOpts,
@@ -273,5 +344,5 @@ func (ac appCreator) appExport(
}
}
- return wasmApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs)
+ return wasmApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs, modulesToExport)
}
diff --git a/contrib/local/01-accounts.sh b/contrib/local/01-accounts.sh
index 1cb4b0e515..a50bca2879 100755
--- a/contrib/local/01-accounts.sh
+++ b/contrib/local/01-accounts.sh
@@ -12,7 +12,7 @@ NEW_ACCOUNT=$(wasmd keys show fred -a)
wasmd q bank balances "$NEW_ACCOUNT" -o json || true
echo "## Transfer tokens"
-wasmd tx bank send validator "$NEW_ACCOUNT" 1ustake --gas 1000000 -y --chain-id=testing --node=http://localhost:26657 -b block -o json | jq
+wasmd tx bank send validator "$NEW_ACCOUNT" 1ustake --gas 1000000 -y --chain-id=testing --node=http://localhost:26657 -b sync -o json | jq
echo "## Check balance again"
wasmd q bank balances "$NEW_ACCOUNT" -o json | jq
diff --git a/contrib/local/02-contracts.sh b/contrib/local/02-contracts.sh
index c445d948b6..fe8b98a9ee 100755
--- a/contrib/local/02-contracts.sh
+++ b/contrib/local/02-contracts.sh
@@ -6,8 +6,9 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
echo "-----------------------"
echo "## Add new CosmWasm contract"
RESP=$(wasmd tx wasm store "$DIR/../../x/wasm/keeper/testdata/hackatom.wasm" \
- --from validator --gas 1500000 -y --chain-id=testing --node=http://localhost:26657 -b block -o json)
-
+ --from validator --gas 1500000 -y --chain-id=testing --node=http://localhost:26657 -b sync -o json)
+sleep 5
+RESP=$(wasmd q tx $(echo "$RESP"| jq -r '.txhash') -o json)
CODE_ID=$(echo "$RESP" | jq -r '.logs[0].events[1].attributes[-1].value')
CODE_HASH=$(echo "$RESP" | jq -r '.logs[0].events[1].attributes[-2].value')
echo "* Code id: $CODE_ID"
@@ -19,24 +20,29 @@ wasmd q wasm code "$CODE_ID" "$TMPDIR"
rm -f "$TMPDIR"
echo "-----------------------"
echo "## List code"
-wasmd query wasm list-code --node=http://localhost:26657 --chain-id=testing -o json | jq
+wasmd query wasm list-code --node=http://localhost:26657 -o json | jq
echo "-----------------------"
echo "## Create new contract instance"
INIT="{\"verifier\":\"$(wasmd keys show validator -a)\", \"beneficiary\":\"$(wasmd keys show fred -a)\"}"
-wasmd tx wasm instantiate "$CODE_ID" "$INIT" --admin="$(wasmd keys show validator -a)" \
+RESP=$(wasmd tx wasm instantiate "$CODE_ID" "$INIT" --admin="$(wasmd keys show validator -a)" \
--from validator --amount="100ustake" --label "local0.1.0" \
- --gas 1000000 -y --chain-id=testing -b block -o json | jq
+ --gas 1000000 -y --chain-id=testing -b sync -o json)
+sleep 5
+wasmd q tx $(echo "$RESP"| jq -r '.txhash') -o json | jq
CONTRACT=$(wasmd query wasm list-contract-by-code "$CODE_ID" -o json | jq -r '.contracts[-1]')
echo "* Contract address: $CONTRACT"
echo "## Create new contract instance with predictable address"
-wasmd tx wasm instantiate2 "$CODE_ID" "$INIT" $(echo -n "testing" | xxd -ps) \
+RESP=$(wasmd tx wasm instantiate2 "$CODE_ID" "$INIT" $(echo -n "testing" | xxd -ps) \
--admin="$(wasmd keys show validator -a)" \
--from validator --amount="100ustake" --label "local0.1.0" \
--fix-msg \
- --gas 1000000 -y --chain-id=testing -b block -o json | jq
+ --gas 1000000 -y --chain-id=testing -b sync -o json)
+sleep 5
+wasmd q tx $(echo "$RESP"| jq -r '.txhash') -o json | jq
+
predictedAdress=$(wasmd q wasm build-address "$CODE_HASH" $(wasmd keys show validator -a) $(echo -n "testing" | xxd -ps) "$INIT")
wasmd q wasm contract "$predictedAdress" -o json | jq
@@ -53,30 +59,39 @@ wasmd query wasm contract-state raw "$CONTRACT" "$KEY" -o json | jq
echo "-----------------------"
echo "## Execute contract $CONTRACT"
MSG='{"release":{}}'
-wasmd tx wasm execute "$CONTRACT" "$MSG" \
+RESP=$(wasmd tx wasm execute "$CONTRACT" "$MSG" \
--from validator \
- --gas 1000000 -y --chain-id=testing -b block -o json | jq
+ --gas 1000000 -y --chain-id=testing -b sync -o json)
+sleep 5
+wasmd q tx $(echo "$RESP"| jq -r '.txhash') -o json | jq
+
echo "-----------------------"
echo "## Set new admin"
echo "### Query old admin: $(wasmd q wasm contract "$CONTRACT" -o json | jq -r '.contract_info.admin')"
echo "### Update contract"
-wasmd tx wasm set-contract-admin "$CONTRACT" "$(wasmd keys show fred -a)" \
- --from validator -y --chain-id=testing -b block -o json | jq
+RESP=$(wasmd tx wasm set-contract-admin "$CONTRACT" "$(wasmd keys show fred -a)" \
+ --from validator -y --chain-id=testing -b sync -o json)
+sleep 5
+wasmd q tx $(echo "$RESP"| jq -r '.txhash') -o json | jq
+
echo "### Query new admin: $(wasmd q wasm contract "$CONTRACT" -o json | jq -r '.contract_info.admin')"
echo "-----------------------"
echo "## Migrate contract"
echo "### Upload new code"
RESP=$(wasmd tx wasm store "$DIR/../../x/wasm/keeper/testdata/burner.wasm" \
- --from validator --gas 1000000 -y --chain-id=testing --node=http://localhost:26657 -b block -o json)
-
+ --from validator --gas 1000000 -y --chain-id=testing --node=http://localhost:26657 -b sync -o json)
+sleep 5
+RESP=$(wasmd q tx $(echo "$RESP"| jq -r '.txhash') -o json)
BURNER_CODE_ID=$(echo "$RESP" | jq -r '.logs[0].events[1].attributes[-1].value')
echo "### Migrate to code id: $BURNER_CODE_ID"
DEST_ACCOUNT=$(wasmd keys show fred -a)
-wasmd tx wasm migrate "$CONTRACT" "$BURNER_CODE_ID" "{\"payout\": \"$DEST_ACCOUNT\"}" --from fred \
- --chain-id=testing -b block -y -o json | jq
+RESP=$(wasmd tx wasm migrate "$CONTRACT" "$BURNER_CODE_ID" "{\"payout\": \"$DEST_ACCOUNT\"}" --from fred \
+ --chain-id=testing -b sync -y -o json )
+sleep 5
+wasmd q tx $(echo "$RESP"| jq -r '.txhash') -o json | jq
echo "### Query destination account: $BURNER_CODE_ID"
wasmd q bank balances "$DEST_ACCOUNT" -o json | jq
@@ -90,6 +105,8 @@ echo "-----------------------"
echo "## Clear contract admin"
echo "### Query old admin: $(wasmd q wasm contract "$CONTRACT" -o json | jq -r '.contract_info.admin')"
echo "### Update contract"
-wasmd tx wasm clear-contract-admin "$CONTRACT" \
- --from fred -y --chain-id=testing -b block -o json | jq
+RESP=$(wasmd tx wasm clear-contract-admin "$CONTRACT" \
+ --from fred -y --chain-id=testing -b sync -o json)
+sleep 5
+wasmd q tx $(echo "$RESP"| jq -r '.txhash') -o json | jq
echo "### Query new admin: $(wasmd q wasm contract "$CONTRACT" -o json | jq -r '.contract_info.admin')"
diff --git a/contrib/local/03-grpc-queries.sh b/contrib/local/03-grpc-queries.sh
index 5eefaf5e08..f1d56d33f4 100755
--- a/contrib/local/03-grpc-queries.sh
+++ b/contrib/local/03-grpc-queries.sh
@@ -4,28 +4,21 @@ set -o errexit -o nounset -o pipefail
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
echo "-----------------------"
-PROTO_THRD="$DIR/../../third_party/proto"
-PROTO_WASMD="$DIR/../../proto"
-PROTO_WASMD_QUERY="$PROTO_WASMD/cosmwasm/wasm/v1/query.proto"
echo "### List all codes"
-RESP=$(grpcurl -plaintext -import-path "$PROTO_THRD" -import-path "$PROTO_WASMD" -proto "$PROTO_WASMD_QUERY" \
- localhost:9090 cosmwasm.wasm.v1.Query/Codes)
+RESP=$(grpcurl -plaintext localhost:9090 cosmwasm.wasm.v1.Query/Codes)
echo "$RESP" | jq
CODE_ID=$(echo "$RESP" | jq -r '.codeInfos[-1].codeId')
echo "### List contracts by code"
-RESP=$(grpcurl -plaintext -import-path "$PROTO_THRD" -import-path "$PROTO_WASMD" -proto "$PROTO_WASMD_QUERY" \
- -d "{\"codeId\": $CODE_ID}" localhost:9090 cosmwasm.wasm.v1.Query/ContractsByCode)
+RESP=$(grpcurl -plaintext -d "{\"codeId\": $CODE_ID}" localhost:9090 cosmwasm.wasm.v1.Query/ContractsByCode)
echo "$RESP" | jq
echo "### Show history for contract"
CONTRACT=$(echo "$RESP" | jq -r ".contracts[-1]")
-grpcurl -plaintext -import-path "$PROTO_THRD" -import-path "$PROTO_WASMD" -proto "$PROTO_WASMD_QUERY" \
- -d "{\"address\": \"$CONTRACT\"}" localhost:9090 cosmwasm.wasm.v1.Query/ContractHistory | jq
+grpcurl -plaintext -d "{\"address\": \"$CONTRACT\"}" localhost:9090 cosmwasm.wasm.v1.Query/ContractHistory | jq
echo "### Show contract state"
-grpcurl -plaintext -import-path "$PROTO_THRD" -import-path "$PROTO_WASMD" -proto "$PROTO_WASMD_QUERY" \
- -d "{\"address\": \"$CONTRACT\"}" localhost:9090 cosmwasm.wasm.v1.Query/AllContractState | jq
+grpcurl -plaintext -d "{\"address\": \"$CONTRACT\"}" localhost:9090 cosmwasm.wasm.v1.Query/AllContractState | jq
echo "Empty state due to 'burner' contract cleanup"
diff --git a/docs/proto/proto-docs.md b/docs/proto/proto-docs.md
index bed0967db1..89bddecb01 100644
--- a/docs/proto/proto-docs.md
+++ b/docs/proto/proto-docs.md
@@ -4,253 +4,62 @@
## Table of Contents
-- [cosmwasm/wasm/v1/authz.proto](#cosmwasm/wasm/v1/authz.proto)
- - [AcceptedMessageKeysFilter](#cosmwasm.wasm.v1.AcceptedMessageKeysFilter)
- - [AcceptedMessagesFilter](#cosmwasm.wasm.v1.AcceptedMessagesFilter)
- - [AllowAllMessagesFilter](#cosmwasm.wasm.v1.AllowAllMessagesFilter)
- - [CombinedLimit](#cosmwasm.wasm.v1.CombinedLimit)
- - [ContractExecutionAuthorization](#cosmwasm.wasm.v1.ContractExecutionAuthorization)
- - [ContractGrant](#cosmwasm.wasm.v1.ContractGrant)
- - [ContractMigrationAuthorization](#cosmwasm.wasm.v1.ContractMigrationAuthorization)
- - [MaxCallsLimit](#cosmwasm.wasm.v1.MaxCallsLimit)
- - [MaxFundsLimit](#cosmwasm.wasm.v1.MaxFundsLimit)
+- [cosmwasm/tokenfactory/v1beta1/authorityMetadata.proto](#cosmwasm/tokenfactory/v1beta1/authorityMetadata.proto)
+ - [DenomAuthorityMetadata](#cosmwasm.tokenfactory.v1beta1.DenomAuthorityMetadata)
-- [cosmwasm/wasm/v1/types.proto](#cosmwasm/wasm/v1/types.proto)
- - [AbsoluteTxPosition](#cosmwasm.wasm.v1.AbsoluteTxPosition)
- - [AccessConfig](#cosmwasm.wasm.v1.AccessConfig)
- - [AccessTypeParam](#cosmwasm.wasm.v1.AccessTypeParam)
- - [CodeInfo](#cosmwasm.wasm.v1.CodeInfo)
- - [ContractCodeHistoryEntry](#cosmwasm.wasm.v1.ContractCodeHistoryEntry)
- - [ContractInfo](#cosmwasm.wasm.v1.ContractInfo)
- - [Model](#cosmwasm.wasm.v1.Model)
- - [Params](#cosmwasm.wasm.v1.Params)
+- [cosmwasm/tokenfactory/v1beta1/params.proto](#cosmwasm/tokenfactory/v1beta1/params.proto)
+ - [Params](#cosmwasm.tokenfactory.v1beta1.Params)
- - [AccessType](#cosmwasm.wasm.v1.AccessType)
- - [ContractCodeHistoryOperationType](#cosmwasm.wasm.v1.ContractCodeHistoryOperationType)
+- [cosmwasm/tokenfactory/v1beta1/genesis.proto](#cosmwasm/tokenfactory/v1beta1/genesis.proto)
+ - [GenesisDenom](#cosmwasm.tokenfactory.v1beta1.GenesisDenom)
+ - [GenesisState](#cosmwasm.tokenfactory.v1beta1.GenesisState)
-- [cosmwasm/wasm/v1/genesis.proto](#cosmwasm/wasm/v1/genesis.proto)
- - [Code](#cosmwasm.wasm.v1.Code)
- - [Contract](#cosmwasm.wasm.v1.Contract)
- - [GenesisState](#cosmwasm.wasm.v1.GenesisState)
- - [Sequence](#cosmwasm.wasm.v1.Sequence)
+- [cosmwasm/tokenfactory/v1beta1/query.proto](#cosmwasm/tokenfactory/v1beta1/query.proto)
+ - [QueryDenomAuthorityMetadataRequest](#cosmwasm.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest)
+ - [QueryDenomAuthorityMetadataResponse](#cosmwasm.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse)
+ - [QueryDenomsFromCreatorRequest](#cosmwasm.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest)
+ - [QueryDenomsFromCreatorResponse](#cosmwasm.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse)
+ - [QueryParamsRequest](#cosmwasm.tokenfactory.v1beta1.QueryParamsRequest)
+ - [QueryParamsResponse](#cosmwasm.tokenfactory.v1beta1.QueryParamsResponse)
-- [cosmwasm/wasm/v1/ibc.proto](#cosmwasm/wasm/v1/ibc.proto)
- - [MsgIBCCloseChannel](#cosmwasm.wasm.v1.MsgIBCCloseChannel)
- - [MsgIBCSend](#cosmwasm.wasm.v1.MsgIBCSend)
+ - [Query](#cosmwasm.tokenfactory.v1beta1.Query)
-- [cosmwasm/wasm/v1/proposal.proto](#cosmwasm/wasm/v1/proposal.proto)
- - [AccessConfigUpdate](#cosmwasm.wasm.v1.AccessConfigUpdate)
- - [ClearAdminProposal](#cosmwasm.wasm.v1.ClearAdminProposal)
- - [ExecuteContractProposal](#cosmwasm.wasm.v1.ExecuteContractProposal)
- - [InstantiateContract2Proposal](#cosmwasm.wasm.v1.InstantiateContract2Proposal)
- - [InstantiateContractProposal](#cosmwasm.wasm.v1.InstantiateContractProposal)
- - [MigrateContractProposal](#cosmwasm.wasm.v1.MigrateContractProposal)
- - [PinCodesProposal](#cosmwasm.wasm.v1.PinCodesProposal)
- - [StoreAndInstantiateContractProposal](#cosmwasm.wasm.v1.StoreAndInstantiateContractProposal)
- - [StoreCodeProposal](#cosmwasm.wasm.v1.StoreCodeProposal)
- - [SudoContractProposal](#cosmwasm.wasm.v1.SudoContractProposal)
- - [UnpinCodesProposal](#cosmwasm.wasm.v1.UnpinCodesProposal)
- - [UpdateAdminProposal](#cosmwasm.wasm.v1.UpdateAdminProposal)
- - [UpdateInstantiateConfigProposal](#cosmwasm.wasm.v1.UpdateInstantiateConfigProposal)
+- [cosmwasm/tokenfactory/v1beta1/tx.proto](#cosmwasm/tokenfactory/v1beta1/tx.proto)
+ - [MsgBurn](#cosmwasm.tokenfactory.v1beta1.MsgBurn)
+ - [MsgBurnResponse](#cosmwasm.tokenfactory.v1beta1.MsgBurnResponse)
+ - [MsgChangeAdmin](#cosmwasm.tokenfactory.v1beta1.MsgChangeAdmin)
+ - [MsgChangeAdminResponse](#cosmwasm.tokenfactory.v1beta1.MsgChangeAdminResponse)
+ - [MsgCreateDenom](#cosmwasm.tokenfactory.v1beta1.MsgCreateDenom)
+ - [MsgCreateDenomResponse](#cosmwasm.tokenfactory.v1beta1.MsgCreateDenomResponse)
+ - [MsgMint](#cosmwasm.tokenfactory.v1beta1.MsgMint)
+ - [MsgMintResponse](#cosmwasm.tokenfactory.v1beta1.MsgMintResponse)
+ - [MsgSetDenomMetadata](#cosmwasm.tokenfactory.v1beta1.MsgSetDenomMetadata)
+ - [MsgSetDenomMetadataResponse](#cosmwasm.tokenfactory.v1beta1.MsgSetDenomMetadataResponse)
-- [cosmwasm/wasm/v1/query.proto](#cosmwasm/wasm/v1/query.proto)
- - [CodeInfoResponse](#cosmwasm.wasm.v1.CodeInfoResponse)
- - [QueryAllContractStateRequest](#cosmwasm.wasm.v1.QueryAllContractStateRequest)
- - [QueryAllContractStateResponse](#cosmwasm.wasm.v1.QueryAllContractStateResponse)
- - [QueryCodeRequest](#cosmwasm.wasm.v1.QueryCodeRequest)
- - [QueryCodeResponse](#cosmwasm.wasm.v1.QueryCodeResponse)
- - [QueryCodesRequest](#cosmwasm.wasm.v1.QueryCodesRequest)
- - [QueryCodesResponse](#cosmwasm.wasm.v1.QueryCodesResponse)
- - [QueryContractHistoryRequest](#cosmwasm.wasm.v1.QueryContractHistoryRequest)
- - [QueryContractHistoryResponse](#cosmwasm.wasm.v1.QueryContractHistoryResponse)
- - [QueryContractInfoRequest](#cosmwasm.wasm.v1.QueryContractInfoRequest)
- - [QueryContractInfoResponse](#cosmwasm.wasm.v1.QueryContractInfoResponse)
- - [QueryContractsByCodeRequest](#cosmwasm.wasm.v1.QueryContractsByCodeRequest)
- - [QueryContractsByCodeResponse](#cosmwasm.wasm.v1.QueryContractsByCodeResponse)
- - [QueryContractsByCreatorRequest](#cosmwasm.wasm.v1.QueryContractsByCreatorRequest)
- - [QueryContractsByCreatorResponse](#cosmwasm.wasm.v1.QueryContractsByCreatorResponse)
- - [QueryParamsRequest](#cosmwasm.wasm.v1.QueryParamsRequest)
- - [QueryParamsResponse](#cosmwasm.wasm.v1.QueryParamsResponse)
- - [QueryPinnedCodesRequest](#cosmwasm.wasm.v1.QueryPinnedCodesRequest)
- - [QueryPinnedCodesResponse](#cosmwasm.wasm.v1.QueryPinnedCodesResponse)
- - [QueryRawContractStateRequest](#cosmwasm.wasm.v1.QueryRawContractStateRequest)
- - [QueryRawContractStateResponse](#cosmwasm.wasm.v1.QueryRawContractStateResponse)
- - [QuerySmartContractStateRequest](#cosmwasm.wasm.v1.QuerySmartContractStateRequest)
- - [QuerySmartContractStateResponse](#cosmwasm.wasm.v1.QuerySmartContractStateResponse)
-
- - [Query](#cosmwasm.wasm.v1.Query)
-
-- [cosmwasm/wasm/v1/tx.proto](#cosmwasm/wasm/v1/tx.proto)
- - [MsgClearAdmin](#cosmwasm.wasm.v1.MsgClearAdmin)
- - [MsgClearAdminResponse](#cosmwasm.wasm.v1.MsgClearAdminResponse)
- - [MsgExecuteContract](#cosmwasm.wasm.v1.MsgExecuteContract)
- - [MsgExecuteContractResponse](#cosmwasm.wasm.v1.MsgExecuteContractResponse)
- - [MsgInstantiateContract](#cosmwasm.wasm.v1.MsgInstantiateContract)
- - [MsgInstantiateContract2](#cosmwasm.wasm.v1.MsgInstantiateContract2)
- - [MsgInstantiateContract2Response](#cosmwasm.wasm.v1.MsgInstantiateContract2Response)
- - [MsgInstantiateContractResponse](#cosmwasm.wasm.v1.MsgInstantiateContractResponse)
- - [MsgMigrateContract](#cosmwasm.wasm.v1.MsgMigrateContract)
- - [MsgMigrateContractResponse](#cosmwasm.wasm.v1.MsgMigrateContractResponse)
- - [MsgStoreCode](#cosmwasm.wasm.v1.MsgStoreCode)
- - [MsgStoreCodeResponse](#cosmwasm.wasm.v1.MsgStoreCodeResponse)
- - [MsgUpdateAdmin](#cosmwasm.wasm.v1.MsgUpdateAdmin)
- - [MsgUpdateAdminResponse](#cosmwasm.wasm.v1.MsgUpdateAdminResponse)
- - [MsgUpdateInstantiateConfig](#cosmwasm.wasm.v1.MsgUpdateInstantiateConfig)
- - [MsgUpdateInstantiateConfigResponse](#cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse)
-
- - [Msg](#cosmwasm.wasm.v1.Msg)
+ - [Msg](#cosmwasm.tokenfactory.v1beta1.Msg)
- [Scalar Value Types](#scalar-value-types)
-
+
Top
-## cosmwasm/wasm/v1/authz.proto
-
-
-
-
-
-### AcceptedMessageKeysFilter
-AcceptedMessageKeysFilter accept only the specific contract message keys in
-the json object to be executed.
-Since: wasmd 0.30
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `keys` | [string](#string) | repeated | Messages is the list of unique keys |
-
-
-
-
-
-
-
-
-### AcceptedMessagesFilter
-AcceptedMessagesFilter accept only the specific raw contract messages to be
-executed.
-Since: wasmd 0.30
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `messages` | [bytes](#bytes) | repeated | Messages is the list of raw contract messages |
-
-
-
-
-
-
-
-
-### AllowAllMessagesFilter
-AllowAllMessagesFilter is a wildcard to allow any type of contract payload
-message.
-Since: wasmd 0.30
-
-
-
-
-
-
-
-
-### CombinedLimit
-CombinedLimit defines the maximal amounts that can be sent to a contract and
-the maximal number of calls executable. Both need to remain >0 to be valid.
-Since: wasmd 0.30
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `calls_remaining` | [uint64](#uint64) | | Remaining number that is decremented on each execution |
-| `amounts` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Amounts is the maximal amount of tokens transferable to the contract. |
-
-
-
-
-
-
-
-
-### ContractExecutionAuthorization
-ContractExecutionAuthorization defines authorization for wasm execute.
-Since: wasmd 0.30
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `grants` | [ContractGrant](#cosmwasm.wasm.v1.ContractGrant) | repeated | Grants for contract executions |
-
-
-
-
-
-
-
-
-### ContractGrant
-ContractGrant a granted permission for a single contract
-Since: wasmd 0.30
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `contract` | [string](#string) | | Contract is the bech32 address of the smart contract |
-| `limit` | [google.protobuf.Any](#google.protobuf.Any) | | Limit defines execution limits that are enforced and updated when the grant is applied. When the limit lapsed the grant is removed. |
-| `filter` | [google.protobuf.Any](#google.protobuf.Any) | | Filter define more fine-grained control on the message payload passed to the contract in the operation. When no filter applies on execution, the operation is prohibited. |
-
-
+## cosmwasm/tokenfactory/v1beta1/authorityMetadata.proto
+
-
-
-### ContractMigrationAuthorization
-ContractMigrationAuthorization defines authorization for wasm contract
-migration. Since: wasmd 0.30
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `grants` | [ContractGrant](#cosmwasm.wasm.v1.ContractGrant) | repeated | Grants for contract migrations |
-
-
-
-
-
-
-
-
-### MaxCallsLimit
-MaxCallsLimit limited number of calls to the contract. No funds transferable.
-Since: wasmd 0.30
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `remaining` | [uint64](#uint64) | | Remaining number that is decremented on each execution |
-
-
-
-
-
-
-
-
-### MaxFundsLimit
-MaxFundsLimit defines the maximal amounts that can be sent to the contract.
-Since: wasmd 0.30
+### DenomAuthorityMetadata
+DenomAuthorityMetadata specifies metadata for addresses that have specific
+capabilities over a token factory denom. Right now there is only one Admin
+permission, but is planned to be extended to the future.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `amounts` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Amounts is the maximal amount of tokens transferable to the contract. |
+| `admin` | [string](#string) | | Can be empty for no admin, or a valid osmosis address |
@@ -266,144 +75,22 @@ Since: wasmd 0.30
-
+
Top
-## cosmwasm/wasm/v1/types.proto
-
-
-
-
-
-### AbsoluteTxPosition
-AbsoluteTxPosition is a unique transaction position that allows for global
-ordering of transactions.
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `block_height` | [uint64](#uint64) | | BlockHeight is the block the contract was created at |
-| `tx_index` | [uint64](#uint64) | | TxIndex is a monotonic counter within the block (actual transaction index, or gas consumed) |
-
-
-
-
-
-
-
-
-### AccessConfig
-AccessConfig access control type.
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `permission` | [AccessType](#cosmwasm.wasm.v1.AccessType) | | |
-| `address` | [string](#string) | | Address Deprecated: replaced by addresses |
-| `addresses` | [string](#string) | repeated | |
-
-
-
-
-
-
-
-
-### AccessTypeParam
-AccessTypeParam
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `value` | [AccessType](#cosmwasm.wasm.v1.AccessType) | | |
-
-
-
-
-
-
-
-
-### CodeInfo
-CodeInfo is data for the uploaded contract WASM code
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `code_hash` | [bytes](#bytes) | | CodeHash is the unique identifier created by wasmvm |
-| `creator` | [string](#string) | | Creator address who initially stored the code |
-| `instantiate_config` | [AccessConfig](#cosmwasm.wasm.v1.AccessConfig) | | InstantiateConfig access control to apply on contract creation, optional |
-
-
-
-
-
-
-
-
-### ContractCodeHistoryEntry
-ContractCodeHistoryEntry metadata to a contract.
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `operation` | [ContractCodeHistoryOperationType](#cosmwasm.wasm.v1.ContractCodeHistoryOperationType) | | |
-| `code_id` | [uint64](#uint64) | | CodeID is the reference to the stored WASM code |
-| `updated` | [AbsoluteTxPosition](#cosmwasm.wasm.v1.AbsoluteTxPosition) | | Updated Tx position when the operation was executed. |
-| `msg` | [bytes](#bytes) | | |
-
-
-
-
-
-
-
-
-### ContractInfo
-ContractInfo stores a WASM contract instance
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `code_id` | [uint64](#uint64) | | CodeID is the reference to the stored Wasm code |
-| `creator` | [string](#string) | | Creator address who initially instantiated the contract |
-| `admin` | [string](#string) | | Admin is an optional address that can execute migrations |
-| `label` | [string](#string) | | Label is optional metadata to be stored with a contract instance. |
-| `created` | [AbsoluteTxPosition](#cosmwasm.wasm.v1.AbsoluteTxPosition) | | Created Tx position when the contract was instantiated. |
-| `ibc_port_id` | [string](#string) | | |
-| `extension` | [google.protobuf.Any](#google.protobuf.Any) | | Extension is an extension point to store custom metadata within the persistence model. |
-
-
-
-
-
-
-
-
-### Model
-Model is a struct that holds a KV pair
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `key` | [bytes](#bytes) | | hex-encode key to read it better (this is often ascii) |
-| `value` | [bytes](#bytes) | | base64-encode raw value |
-
-
-
+## cosmwasm/tokenfactory/v1beta1/params.proto
-
+
### Params
-Params defines the set of wasm parameters.
+Params defines the parameters for the tokenfactory module.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `code_upload_access` | [AccessConfig](#cosmwasm.wasm.v1.AccessConfig) | | |
-| `instantiate_default_permission` | [AccessType](#cosmwasm.wasm.v1.AccessType) | | |
+| `denom_creation_fee` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | |
@@ -411,35 +98,6 @@ Params defines the set of wasm parameters.
-
-
-
-### AccessType
-AccessType permission types
-
-| Name | Number | Description |
-| ---- | ------ | ----------- |
-| ACCESS_TYPE_UNSPECIFIED | 0 | AccessTypeUnspecified placeholder for empty value |
-| ACCESS_TYPE_NOBODY | 1 | AccessTypeNobody forbidden |
-| ACCESS_TYPE_ONLY_ADDRESS | 2 | AccessTypeOnlyAddress restricted to a single address Deprecated: use AccessTypeAnyOfAddresses instead |
-| ACCESS_TYPE_EVERYBODY | 3 | AccessTypeEverybody unrestricted |
-| ACCESS_TYPE_ANY_OF_ADDRESSES | 4 | AccessTypeAnyOfAddresses allow any of the addresses |
-
-
-
-
-
-### ContractCodeHistoryOperationType
-ContractCodeHistoryOperationType actions that caused a code change
-
-| Name | Number | Description |
-| ---- | ------ | ----------- |
-| CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED | 0 | ContractCodeHistoryOperationTypeUnspecified placeholder for empty value |
-| CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT | 1 | ContractCodeHistoryOperationTypeInit on chain contract instantiation |
-| CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE | 2 | ContractCodeHistoryOperationTypeMigrate code migration |
-| CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS | 3 | ContractCodeHistoryOperationTypeGenesis based on genesis data |
-
-
@@ -448,77 +106,41 @@ ContractCodeHistoryOperationType actions that caused a code change
-
+
Top
-## cosmwasm/wasm/v1/genesis.proto
-
-
+## cosmwasm/tokenfactory/v1beta1/genesis.proto
-
-### Code
-Code struct encompasses CodeInfo and CodeBytes
+
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `code_id` | [uint64](#uint64) | | |
-| `code_info` | [CodeInfo](#cosmwasm.wasm.v1.CodeInfo) | | |
-| `code_bytes` | [bytes](#bytes) | | |
-| `pinned` | [bool](#bool) | | Pinned to wasmvm cache |
-
-
-
-
-
-
-
-
-### Contract
-Contract struct encompasses ContractAddress, ContractInfo, and ContractState
+### GenesisDenom
+GenesisDenom defines a tokenfactory denom that is defined within genesis
+state. The structure contains DenomAuthorityMetadata which defines the
+denom's admin.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `contract_address` | [string](#string) | | |
-| `contract_info` | [ContractInfo](#cosmwasm.wasm.v1.ContractInfo) | | |
-| `contract_state` | [Model](#cosmwasm.wasm.v1.Model) | repeated | |
-| `contract_code_history` | [ContractCodeHistoryEntry](#cosmwasm.wasm.v1.ContractCodeHistoryEntry) | repeated | |
+| `denom` | [string](#string) | | |
+| `authority_metadata` | [DenomAuthorityMetadata](#cosmwasm.tokenfactory.v1beta1.DenomAuthorityMetadata) | | |
-
+
### GenesisState
-GenesisState - genesis state of x/wasm
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `params` | [Params](#cosmwasm.wasm.v1.Params) | | |
-| `codes` | [Code](#cosmwasm.wasm.v1.Code) | repeated | |
-| `contracts` | [Contract](#cosmwasm.wasm.v1.Contract) | repeated | |
-| `sequences` | [Sequence](#cosmwasm.wasm.v1.Sequence) | repeated | |
-
-
-
-
-
-
-
-
-### Sequence
-Sequence key and value of an id generation counter
+GenesisState defines the tokenfactory module's genesis state.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `id_key` | [bytes](#bytes) | | |
-| `value` | [uint64](#uint64) | | |
+| `params` | [Params](#cosmwasm.tokenfactory.v1beta1.Params) | | params defines the paramaters of the module. |
+| `factory_denoms` | [GenesisDenom](#cosmwasm.tokenfactory.v1beta1.GenesisDenom) | repeated | |
@@ -534,1002 +156,275 @@ Sequence key and value of an id generation counter
-
+
Top
-## cosmwasm/wasm/v1/ibc.proto
+## cosmwasm/tokenfactory/v1beta1/query.proto
-
+
-### MsgIBCCloseChannel
-MsgIBCCloseChannel port and channel need to be owned by the contract
+### QueryDenomAuthorityMetadataRequest
+QueryDenomAuthorityMetadataRequest defines the request structure for the
+DenomAuthorityMetadata gRPC query.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `channel` | [string](#string) | | |
+| `denom` | [string](#string) | | |
-
+
-### MsgIBCSend
-MsgIBCSend
+### QueryDenomAuthorityMetadataResponse
+QueryDenomAuthorityMetadataResponse defines the response structure for the
+DenomAuthorityMetadata gRPC query.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `channel` | [string](#string) | | the channel by which the packet will be sent |
-| `timeout_height` | [uint64](#uint64) | | Timeout height relative to the current block height. The timeout is disabled when set to 0. |
-| `timeout_timestamp` | [uint64](#uint64) | | Timeout timestamp (in nanoseconds) relative to the current block timestamp. The timeout is disabled when set to 0. |
-| `data` | [bytes](#bytes) | | Data is the payload to transfer. We must not make assumption what format or content is in here. |
-
-
-
-
-
-
-
-
-
-
-
-
+| `authority_metadata` | [DenomAuthorityMetadata](#cosmwasm.tokenfactory.v1beta1.DenomAuthorityMetadata) | | |
-
-Top
-
-## cosmwasm/wasm/v1/proposal.proto
-
+
-### AccessConfigUpdate
-AccessConfigUpdate contains the code id and the access config to be
-applied.
+### QueryDenomsFromCreatorRequest
+QueryDenomsFromCreatorRequest defines the request structure for the
+DenomsFromCreator gRPC query.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `code_id` | [uint64](#uint64) | | CodeID is the reference to the stored WASM code to be updated |
-| `instantiate_permission` | [AccessConfig](#cosmwasm.wasm.v1.AccessConfig) | | InstantiatePermission to apply to the set of code ids |
+| `creator` | [string](#string) | | |
-
+
-### ClearAdminProposal
-ClearAdminProposal gov proposal content type to clear the admin of a
-contract.
+### QueryDenomsFromCreatorResponse
+QueryDenomsFromCreatorRequest defines the response structure for the
+DenomsFromCreator gRPC query.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `title` | [string](#string) | | Title is a short summary |
-| `description` | [string](#string) | | Description is a human readable text |
-| `contract` | [string](#string) | | Contract is the address of the smart contract |
-
+| `denoms` | [string](#string) | repeated | |
-
-### ExecuteContractProposal
-ExecuteContractProposal gov proposal content type to call execute on a
-contract.
+
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `title` | [string](#string) | | Title is a short summary |
-| `description` | [string](#string) | | Description is a human readable text |
-| `run_as` | [string](#string) | | RunAs is the address that is passed to the contract's environment as sender |
-| `contract` | [string](#string) | | Contract is the address of the smart contract |
-| `msg` | [bytes](#bytes) | | Msg json encoded message to be passed to the contract as execute |
-| `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Funds coins that are transferred to the contract on instantiation |
+### QueryParamsRequest
+QueryParamsRequest is the request type for the Query/Params RPC method.
-
+
-### InstantiateContract2Proposal
-InstantiateContract2Proposal gov proposal content type to instantiate
-contract 2
+### QueryParamsResponse
+QueryParamsResponse is the response type for the Query/Params RPC method.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `title` | [string](#string) | | Title is a short summary |
-| `description` | [string](#string) | | Description is a human readable text |
-| `run_as` | [string](#string) | | RunAs is the address that is passed to the contract's enviroment as sender |
-| `admin` | [string](#string) | | Admin is an optional address that can execute migrations |
-| `code_id` | [uint64](#uint64) | | CodeID is the reference to the stored WASM code |
-| `label` | [string](#string) | | Label is optional metadata to be stored with a constract instance. |
-| `msg` | [bytes](#bytes) | | Msg json encode message to be passed to the contract on instantiation |
-| `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Funds coins that are transferred to the contract on instantiation |
-| `salt` | [bytes](#bytes) | | Salt is an arbitrary value provided by the sender. Size can be 1 to 64. |
-| `fix_msg` | [bool](#bool) | | FixMsg include the msg value into the hash for the predictable address. Default is false |
-
-
-
-
-
+| `params` | [Params](#cosmwasm.tokenfactory.v1beta1.Params) | | params defines the parameters of the module. |
-
-### InstantiateContractProposal
-InstantiateContractProposal gov proposal content type to instantiate a
-contract.
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `title` | [string](#string) | | Title is a short summary |
-| `description` | [string](#string) | | Description is a human readable text |
-| `run_as` | [string](#string) | | RunAs is the address that is passed to the contract's environment as sender |
-| `admin` | [string](#string) | | Admin is an optional address that can execute migrations |
-| `code_id` | [uint64](#uint64) | | CodeID is the reference to the stored WASM code |
-| `label` | [string](#string) | | Label is optional metadata to be stored with a constract instance. |
-| `msg` | [bytes](#bytes) | | Msg json encoded message to be passed to the contract on instantiation |
-| `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Funds coins that are transferred to the contract on instantiation |
-
+
+
+
-
+
-### MigrateContractProposal
-MigrateContractProposal gov proposal content type to migrate a contract.
+### Query
+Query defines the gRPC querier service.
+| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
+| ----------- | ------------ | ------------- | ------------| ------- | -------- |
+| `Params` | [QueryParamsRequest](#cosmwasm.tokenfactory.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#cosmwasm.tokenfactory.v1beta1.QueryParamsResponse) | Params defines a gRPC query method that returns the tokenfactory module's parameters. | GET|/osmosis/tokenfactory/v1beta1/params|
+| `DenomAuthorityMetadata` | [QueryDenomAuthorityMetadataRequest](#cosmwasm.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest) | [QueryDenomAuthorityMetadataResponse](#cosmwasm.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse) | DenomAuthorityMetadata defines a gRPC query method for fetching DenomAuthorityMetadata for a particular denom. | GET|/osmosis/tokenfactory/v1beta1/denoms/{denom}/authority_metadata|
+| `DenomsFromCreator` | [QueryDenomsFromCreatorRequest](#cosmwasm.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest) | [QueryDenomsFromCreatorResponse](#cosmwasm.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse) | DenomsFromCreator defines a gRPC query method for fetching all denominations created by a specific admin/creator. | GET|/osmosis/tokenfactory/v1beta1/denoms_from_creator/{creator}|
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `title` | [string](#string) | | Title is a short summary |
-| `description` | [string](#string) | | Description is a human readable text
+
-Note: skipping 3 as this was previously used for unneeded run_as |
-| `contract` | [string](#string) | | Contract is the address of the smart contract |
-| `code_id` | [uint64](#uint64) | | CodeID references the new WASM code |
-| `msg` | [bytes](#bytes) | | Msg json encoded message to be passed to the contract on migration |
+
+Top
+## cosmwasm/tokenfactory/v1beta1/tx.proto
-
+
-### PinCodesProposal
-PinCodesProposal gov proposal content type to pin a set of code ids in the
-wasmvm cache.
+### MsgBurn
+MsgBurn is the sdk.Msg type for allowing an admin account to burn
+a token. For now, we only support burning from the sender account.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `title` | [string](#string) | | Title is a short summary |
-| `description` | [string](#string) | | Description is a human readable text |
-| `code_ids` | [uint64](#uint64) | repeated | CodeIDs references the new WASM codes |
-
+| `sender` | [string](#string) | | |
+| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | |
-
-### StoreAndInstantiateContractProposal
-StoreAndInstantiateContractProposal gov proposal content type to store
-and instantiate the contract.
+
+### MsgBurnResponse
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `title` | [string](#string) | | Title is a short summary |
-| `description` | [string](#string) | | Description is a human readable text |
-| `run_as` | [string](#string) | | RunAs is the address that is passed to the contract's environment as sender |
-| `wasm_byte_code` | [bytes](#bytes) | | WASMByteCode can be raw or gzip compressed |
-| `instantiate_permission` | [AccessConfig](#cosmwasm.wasm.v1.AccessConfig) | | InstantiatePermission to apply on contract creation, optional |
-| `unpin_code` | [bool](#bool) | | UnpinCode code on upload, optional |
-| `admin` | [string](#string) | | Admin is an optional address that can execute migrations |
-| `label` | [string](#string) | | Label is optional metadata to be stored with a constract instance. |
-| `msg` | [bytes](#bytes) | | Msg json encoded message to be passed to the contract on instantiation |
-| `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Funds coins that are transferred to the contract on instantiation |
-| `source` | [string](#string) | | Source is the URL where the code is hosted |
-| `builder` | [string](#string) | | Builder is the docker image used to build the code deterministically, used for smart contract verification |
-| `code_hash` | [bytes](#bytes) | | CodeHash is the SHA256 sum of the code outputted by builder, used for smart contract verification |
-
+
-### StoreCodeProposal
-StoreCodeProposal gov proposal content type to submit WASM code to the system
+### MsgChangeAdmin
+MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign
+adminship of a denom to a new account
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `title` | [string](#string) | | Title is a short summary |
-| `description` | [string](#string) | | Description is a human readable text |
-| `run_as` | [string](#string) | | RunAs is the address that is passed to the contract's environment as sender |
-| `wasm_byte_code` | [bytes](#bytes) | | WASMByteCode can be raw or gzip compressed |
-| `instantiate_permission` | [AccessConfig](#cosmwasm.wasm.v1.AccessConfig) | | InstantiatePermission to apply on contract creation, optional |
-| `unpin_code` | [bool](#bool) | | UnpinCode code on upload, optional |
-| `source` | [string](#string) | | Source is the URL where the code is hosted |
-| `builder` | [string](#string) | | Builder is the docker image used to build the code deterministically, used for smart contract verification |
-| `code_hash` | [bytes](#bytes) | | CodeHash is the SHA256 sum of the code outputted by builder, used for smart contract verification |
+| `sender` | [string](#string) | | |
+| `denom` | [string](#string) | | |
+| `new_admin` | [string](#string) | | |
-
+
-### SudoContractProposal
-SudoContractProposal gov proposal content type to call sudo on a contract.
+### MsgChangeAdminResponse
+MsgChangeAdminResponse defines the response structure for an executed
+MsgChangeAdmin message.
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `title` | [string](#string) | | Title is a short summary |
-| `description` | [string](#string) | | Description is a human readable text |
-| `contract` | [string](#string) | | Contract is the address of the smart contract |
-| `msg` | [bytes](#bytes) | | Msg json encoded message to be passed to the contract as sudo |
+
+### MsgCreateDenom
+MsgCreateDenom defines the message structure for the CreateDenom gRPC service
+method. It allows an account to create a new denom. It requires a sender
+address and a sub denomination. The (sender_address, sub_denomination) tuple
+must be unique and cannot be re-used.
-
-
-### UnpinCodesProposal
-UnpinCodesProposal gov proposal content type to unpin a set of code ids in
-the wasmvm cache.
+The resulting denom created is defined as
+. The resulting denom's admin is
+originally set to be the creator, but this can be changed later. The token
+denom does not indicate the current admin.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `title` | [string](#string) | | Title is a short summary |
-| `description` | [string](#string) | | Description is a human readable text |
-| `code_ids` | [uint64](#uint64) | repeated | CodeIDs references the WASM codes |
+| `sender` | [string](#string) | | |
+| `subdenom` | [string](#string) | | subdenom can be up to 44 "alphanumeric" characters long. |
-
+
-### UpdateAdminProposal
-UpdateAdminProposal gov proposal content type to set an admin for a contract.
+### MsgCreateDenomResponse
+MsgCreateDenomResponse is the return value of MsgCreateDenom
+It returns the full string of the newly created denom
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `title` | [string](#string) | | Title is a short summary |
-| `description` | [string](#string) | | Description is a human readable text |
-| `new_admin` | [string](#string) | | NewAdmin address to be set |
-| `contract` | [string](#string) | | Contract is the address of the smart contract |
+| `new_token_denom` | [string](#string) | | |
-
+
-### UpdateInstantiateConfigProposal
-UpdateInstantiateConfigProposal gov proposal content type to update
-instantiate config to a set of code ids.
+### MsgMint
+MsgMint is the sdk.Msg type for allowing an admin account to mint
+more of a token. For now, we only support minting to the sender account
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `title` | [string](#string) | | Title is a short summary |
-| `description` | [string](#string) | | Description is a human readable text |
-| `access_config_updates` | [AccessConfigUpdate](#cosmwasm.wasm.v1.AccessConfigUpdate) | repeated | AccessConfigUpdate contains the list of code ids and the access config to be applied. |
-
-
-
-
-
-
-
-
-
-
-
-
-
+| `sender` | [string](#string) | | |
+| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | |
-
-Top
-
-## cosmwasm/wasm/v1/query.proto
-
-
-
-
-
-### CodeInfoResponse
-CodeInfoResponse contains code meta data from CodeInfo
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `code_id` | [uint64](#uint64) | | id for legacy support |
-| `creator` | [string](#string) | | |
-| `data_hash` | [bytes](#bytes) | | |
-| `instantiate_permission` | [AccessConfig](#cosmwasm.wasm.v1.AccessConfig) | | |
-
-
-
-
-
-
-
-
-### QueryAllContractStateRequest
-QueryAllContractStateRequest is the request type for the
-Query/AllContractState RPC method
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `address` | [string](#string) | | address is the address of the contract |
-| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. |
-
-
-
-
-
-
-
-
-### QueryAllContractStateResponse
-QueryAllContractStateResponse is the response type for the
-Query/AllContractState RPC method
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `models` | [Model](#cosmwasm.wasm.v1.Model) | repeated | |
-| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. |
-
-
-
-
-
-
-
-
-### QueryCodeRequest
-QueryCodeRequest is the request type for the Query/Code RPC method
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `code_id` | [uint64](#uint64) | | grpc-gateway_out does not support Go style CodID |
-
-
-
-
-
-
-
-
-### QueryCodeResponse
-QueryCodeResponse is the response type for the Query/Code RPC method
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `code_info` | [CodeInfoResponse](#cosmwasm.wasm.v1.CodeInfoResponse) | | |
-| `data` | [bytes](#bytes) | | |
-
-
-
-
-
-
-
-
-### QueryCodesRequest
-QueryCodesRequest is the request type for the Query/Codes RPC method
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. |
-
-
-
-
-
-
-
-
-### QueryCodesResponse
-QueryCodesResponse is the response type for the Query/Codes RPC method
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `code_infos` | [CodeInfoResponse](#cosmwasm.wasm.v1.CodeInfoResponse) | repeated | |
-| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. |
-
-
-
-
-
-
-
-
-### QueryContractHistoryRequest
-QueryContractHistoryRequest is the request type for the Query/ContractHistory
-RPC method
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `address` | [string](#string) | | address is the address of the contract to query |
-| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. |
-
-
-
-
-
-
-
-
-### QueryContractHistoryResponse
-QueryContractHistoryResponse is the response type for the
-Query/ContractHistory RPC method
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `entries` | [ContractCodeHistoryEntry](#cosmwasm.wasm.v1.ContractCodeHistoryEntry) | repeated | |
-| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. |
-
-
-
-
-
-
-
-
-### QueryContractInfoRequest
-QueryContractInfoRequest is the request type for the Query/ContractInfo RPC
-method
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `address` | [string](#string) | | address is the address of the contract to query |
-
-
-
-
-
-
-
-
-### QueryContractInfoResponse
-QueryContractInfoResponse is the response type for the Query/ContractInfo RPC
-method
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `address` | [string](#string) | | address is the address of the contract |
-| `contract_info` | [ContractInfo](#cosmwasm.wasm.v1.ContractInfo) | | |
-
-
-
-
-
-
-
-
-### QueryContractsByCodeRequest
-QueryContractsByCodeRequest is the request type for the Query/ContractsByCode
-RPC method
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `code_id` | [uint64](#uint64) | | grpc-gateway_out does not support Go style CodID |
-| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. |
-
-
-
-
-
-
-
-
-### QueryContractsByCodeResponse
-QueryContractsByCodeResponse is the response type for the
-Query/ContractsByCode RPC method
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `contracts` | [string](#string) | repeated | contracts are a set of contract addresses |
-| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. |
-
-
-
-
-
-
-
-
-### QueryContractsByCreatorRequest
-QueryContractsByCreatorRequest is the request type for the
-Query/ContractsByCreator RPC method.
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `creator_address` | [string](#string) | | CreatorAddress is the address of contract creator |
-| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | Pagination defines an optional pagination for the request. |
-
-
-
-
-
-
-
-
-### QueryContractsByCreatorResponse
-QueryContractsByCreatorResponse is the response type for the
-Query/ContractsByCreator RPC method.
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `contract_addresses` | [string](#string) | repeated | ContractAddresses result set |
-| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | Pagination defines the pagination in the response. |
-
-
-
-
-
-
-
-
-### QueryParamsRequest
-QueryParamsRequest is the request type for the Query/Params RPC method.
-
-
-
-
-
-
-
-
-### QueryParamsResponse
-QueryParamsResponse is the response type for the Query/Params RPC method.
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `params` | [Params](#cosmwasm.wasm.v1.Params) | | params defines the parameters of the module. |
-
-
-
-
-
-
-
-
-### QueryPinnedCodesRequest
-QueryPinnedCodesRequest is the request type for the Query/PinnedCodes
-RPC method
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. |
-
-
-
-
-
-
-
-
-### QueryPinnedCodesResponse
-QueryPinnedCodesResponse is the response type for the
-Query/PinnedCodes RPC method
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `code_ids` | [uint64](#uint64) | repeated | |
-| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. |
-
-
-
-
-
-
-
-
-### QueryRawContractStateRequest
-QueryRawContractStateRequest is the request type for the
-Query/RawContractState RPC method
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `address` | [string](#string) | | address is the address of the contract |
-| `query_data` | [bytes](#bytes) | | |
-
-
-
-
-
-
-
-
-### QueryRawContractStateResponse
-QueryRawContractStateResponse is the response type for the
-Query/RawContractState RPC method
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `data` | [bytes](#bytes) | | Data contains the raw store data |
-
-
-
-
-
-
-
-
-### QuerySmartContractStateRequest
-QuerySmartContractStateRequest is the request type for the
-Query/SmartContractState RPC method
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `address` | [string](#string) | | address is the address of the contract |
-| `query_data` | [bytes](#bytes) | | QueryData contains the query data passed to the contract |
-
-
-
-
-
-
-
-
-### QuerySmartContractStateResponse
-QuerySmartContractStateResponse is the response type for the
-Query/SmartContractState RPC method
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `data` | [bytes](#bytes) | | Data contains the json data returned from the smart contract |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-### Query
-Query provides defines the gRPC querier service
-
-| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
-| ----------- | ------------ | ------------- | ------------| ------- | -------- |
-| `ContractInfo` | [QueryContractInfoRequest](#cosmwasm.wasm.v1.QueryContractInfoRequest) | [QueryContractInfoResponse](#cosmwasm.wasm.v1.QueryContractInfoResponse) | ContractInfo gets the contract meta data | GET|/cosmwasm/wasm/v1/contract/{address}|
-| `ContractHistory` | [QueryContractHistoryRequest](#cosmwasm.wasm.v1.QueryContractHistoryRequest) | [QueryContractHistoryResponse](#cosmwasm.wasm.v1.QueryContractHistoryResponse) | ContractHistory gets the contract code history | GET|/cosmwasm/wasm/v1/contract/{address}/history|
-| `ContractsByCode` | [QueryContractsByCodeRequest](#cosmwasm.wasm.v1.QueryContractsByCodeRequest) | [QueryContractsByCodeResponse](#cosmwasm.wasm.v1.QueryContractsByCodeResponse) | ContractsByCode lists all smart contracts for a code id | GET|/cosmwasm/wasm/v1/code/{code_id}/contracts|
-| `AllContractState` | [QueryAllContractStateRequest](#cosmwasm.wasm.v1.QueryAllContractStateRequest) | [QueryAllContractStateResponse](#cosmwasm.wasm.v1.QueryAllContractStateResponse) | AllContractState gets all raw store data for a single contract | GET|/cosmwasm/wasm/v1/contract/{address}/state|
-| `RawContractState` | [QueryRawContractStateRequest](#cosmwasm.wasm.v1.QueryRawContractStateRequest) | [QueryRawContractStateResponse](#cosmwasm.wasm.v1.QueryRawContractStateResponse) | RawContractState gets single key from the raw store data of a contract | GET|/cosmwasm/wasm/v1/contract/{address}/raw/{query_data}|
-| `SmartContractState` | [QuerySmartContractStateRequest](#cosmwasm.wasm.v1.QuerySmartContractStateRequest) | [QuerySmartContractStateResponse](#cosmwasm.wasm.v1.QuerySmartContractStateResponse) | SmartContractState get smart query result from the contract | GET|/cosmwasm/wasm/v1/contract/{address}/smart/{query_data}|
-| `Code` | [QueryCodeRequest](#cosmwasm.wasm.v1.QueryCodeRequest) | [QueryCodeResponse](#cosmwasm.wasm.v1.QueryCodeResponse) | Code gets the binary code and metadata for a singe wasm code | GET|/cosmwasm/wasm/v1/code/{code_id}|
-| `Codes` | [QueryCodesRequest](#cosmwasm.wasm.v1.QueryCodesRequest) | [QueryCodesResponse](#cosmwasm.wasm.v1.QueryCodesResponse) | Codes gets the metadata for all stored wasm codes | GET|/cosmwasm/wasm/v1/code|
-| `PinnedCodes` | [QueryPinnedCodesRequest](#cosmwasm.wasm.v1.QueryPinnedCodesRequest) | [QueryPinnedCodesResponse](#cosmwasm.wasm.v1.QueryPinnedCodesResponse) | PinnedCodes gets the pinned code ids | GET|/cosmwasm/wasm/v1/codes/pinned|
-| `Params` | [QueryParamsRequest](#cosmwasm.wasm.v1.QueryParamsRequest) | [QueryParamsResponse](#cosmwasm.wasm.v1.QueryParamsResponse) | Params gets the module params | GET|/cosmwasm/wasm/v1/codes/params|
-| `ContractsByCreator` | [QueryContractsByCreatorRequest](#cosmwasm.wasm.v1.QueryContractsByCreatorRequest) | [QueryContractsByCreatorResponse](#cosmwasm.wasm.v1.QueryContractsByCreatorResponse) | ContractsByCreator gets the contracts by creator | GET|/cosmwasm/wasm/v1/contracts/creator/{creator_address}|
-
-
-
-
-
-
-Top
-
-## cosmwasm/wasm/v1/tx.proto
-
-
-
-
-
-### MsgClearAdmin
-MsgClearAdmin removes any admin stored for a smart contract
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `sender` | [string](#string) | | Sender is the actor that signed the messages |
-| `contract` | [string](#string) | | Contract is the address of the smart contract |
-
-
-
-
-
-
-
-
-### MsgClearAdminResponse
-MsgClearAdminResponse returns empty data
-
-
-
-
-
-
-
-
-### MsgExecuteContract
-MsgExecuteContract submits the given message data to a smart contract
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `sender` | [string](#string) | | Sender is the that actor that signed the messages |
-| `contract` | [string](#string) | | Contract is the address of the smart contract |
-| `msg` | [bytes](#bytes) | | Msg json encoded message to be passed to the contract |
-| `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Funds coins that are transferred to the contract on execution |
-
-
-
-
-
-
-
-
-### MsgExecuteContractResponse
-MsgExecuteContractResponse returns execution result data.
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `data` | [bytes](#bytes) | | Data contains bytes to returned from the contract |
-
-
-
-
-
-
-
-
-### MsgInstantiateContract
-MsgInstantiateContract create a new smart contract instance for the given
-code id.
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `sender` | [string](#string) | | Sender is the that actor that signed the messages |
-| `admin` | [string](#string) | | Admin is an optional address that can execute migrations |
-| `code_id` | [uint64](#uint64) | | CodeID is the reference to the stored WASM code |
-| `label` | [string](#string) | | Label is optional metadata to be stored with a contract instance. |
-| `msg` | [bytes](#bytes) | | Msg json encoded message to be passed to the contract on instantiation |
-| `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Funds coins that are transferred to the contract on instantiation |
-
-
-
-
-
-
-
-
-### MsgInstantiateContract2
-MsgInstantiateContract2 create a new smart contract instance for the given
-code id with a predicable address.
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `sender` | [string](#string) | | Sender is the that actor that signed the messages |
-| `admin` | [string](#string) | | Admin is an optional address that can execute migrations |
-| `code_id` | [uint64](#uint64) | | CodeID is the reference to the stored WASM code |
-| `label` | [string](#string) | | Label is optional metadata to be stored with a contract instance. |
-| `msg` | [bytes](#bytes) | | Msg json encoded message to be passed to the contract on instantiation |
-| `funds` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Funds coins that are transferred to the contract on instantiation |
-| `salt` | [bytes](#bytes) | | Salt is an arbitrary value provided by the sender. Size can be 1 to 64. |
-| `fix_msg` | [bool](#bool) | | FixMsg include the msg value into the hash for the predictable address. Default is false |
-
-
-
-
-
-
-
-
-### MsgInstantiateContract2Response
-MsgInstantiateContract2Response return instantiation result data
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `address` | [string](#string) | | Address is the bech32 address of the new contract instance. |
-| `data` | [bytes](#bytes) | | Data contains bytes to returned from the contract |
-
-
-
-
-
-
-
-
-### MsgInstantiateContractResponse
-MsgInstantiateContractResponse return instantiation result data
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `address` | [string](#string) | | Address is the bech32 address of the new contract instance. |
-| `data` | [bytes](#bytes) | | Data contains bytes to returned from the contract |
-
-
-
-
-
-
-
-
-### MsgMigrateContract
-MsgMigrateContract runs a code upgrade/ downgrade for a smart contract
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `sender` | [string](#string) | | Sender is the that actor that signed the messages |
-| `contract` | [string](#string) | | Contract is the address of the smart contract |
-| `code_id` | [uint64](#uint64) | | CodeID references the new WASM code |
-| `msg` | [bytes](#bytes) | | Msg json encoded message to be passed to the contract on migration |
-
-
-
-
-
-
-
-
-### MsgMigrateContractResponse
-MsgMigrateContractResponse returns contract migration result data.
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `data` | [bytes](#bytes) | | Data contains same raw bytes returned as data from the wasm contract. (May be empty) |
-
-
-
-
-
-
-
-
-### MsgStoreCode
-MsgStoreCode submit Wasm code to the system
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `sender` | [string](#string) | | Sender is the that actor that signed the messages |
-| `wasm_byte_code` | [bytes](#bytes) | | WASMByteCode can be raw or gzip compressed |
-| `instantiate_permission` | [AccessConfig](#cosmwasm.wasm.v1.AccessConfig) | | InstantiatePermission access control to apply on contract creation, optional |
-
-
-
-
-
-
-
-
-### MsgStoreCodeResponse
-MsgStoreCodeResponse returns store result data.
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `code_id` | [uint64](#uint64) | | CodeID is the reference to the stored WASM code |
-| `checksum` | [bytes](#bytes) | | Checksum is the sha256 hash of the stored code |
-
-
-
-
-
-
-
-
-### MsgUpdateAdmin
-MsgUpdateAdmin sets a new admin for a smart contract
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| `sender` | [string](#string) | | Sender is the that actor that signed the messages |
-| `new_admin` | [string](#string) | | NewAdmin address to be set |
-| `contract` | [string](#string) | | Contract is the address of the smart contract |
-
+
-
+### MsgMintResponse
-### MsgUpdateAdminResponse
-MsgUpdateAdminResponse returns empty data
-
+
-### MsgUpdateInstantiateConfig
-MsgUpdateInstantiateConfig updates instantiate config for a smart contract
+### MsgSetDenomMetadata
+MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set
+the denom's bank metadata
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| `sender` | [string](#string) | | Sender is the that actor that signed the messages |
-| `code_id` | [uint64](#uint64) | | CodeID references the stored WASM code |
-| `new_instantiate_permission` | [AccessConfig](#cosmwasm.wasm.v1.AccessConfig) | | NewInstantiatePermission is the new access control |
+| `sender` | [string](#string) | | |
+| `metadata` | [cosmos.bank.v1beta1.Metadata](#cosmos.bank.v1beta1.Metadata) | | |
-
+
-### MsgUpdateInstantiateConfigResponse
-MsgUpdateInstantiateConfigResponse returns empty data
+### MsgSetDenomMetadataResponse
+MsgSetDenomMetadataResponse defines the response structure for an executed
+MsgSetDenomMetadata message.
@@ -1542,21 +437,18 @@ MsgUpdateInstantiateConfigResponse returns empty data
-
+
### Msg
-Msg defines the wasm Msg service.
+Msg defines the tokefactory module's gRPC message service.
| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
-| `StoreCode` | [MsgStoreCode](#cosmwasm.wasm.v1.MsgStoreCode) | [MsgStoreCodeResponse](#cosmwasm.wasm.v1.MsgStoreCodeResponse) | StoreCode to submit Wasm code to the system | |
-| `InstantiateContract` | [MsgInstantiateContract](#cosmwasm.wasm.v1.MsgInstantiateContract) | [MsgInstantiateContractResponse](#cosmwasm.wasm.v1.MsgInstantiateContractResponse) | InstantiateContract creates a new smart contract instance for the given code id. | |
-| `InstantiateContract2` | [MsgInstantiateContract2](#cosmwasm.wasm.v1.MsgInstantiateContract2) | [MsgInstantiateContract2Response](#cosmwasm.wasm.v1.MsgInstantiateContract2Response) | InstantiateContract2 creates a new smart contract instance for the given code id with a predictable address | |
-| `ExecuteContract` | [MsgExecuteContract](#cosmwasm.wasm.v1.MsgExecuteContract) | [MsgExecuteContractResponse](#cosmwasm.wasm.v1.MsgExecuteContractResponse) | Execute submits the given message data to a smart contract | |
-| `MigrateContract` | [MsgMigrateContract](#cosmwasm.wasm.v1.MsgMigrateContract) | [MsgMigrateContractResponse](#cosmwasm.wasm.v1.MsgMigrateContractResponse) | Migrate runs a code upgrade/ downgrade for a smart contract | |
-| `UpdateAdmin` | [MsgUpdateAdmin](#cosmwasm.wasm.v1.MsgUpdateAdmin) | [MsgUpdateAdminResponse](#cosmwasm.wasm.v1.MsgUpdateAdminResponse) | UpdateAdmin sets a new admin for a smart contract | |
-| `ClearAdmin` | [MsgClearAdmin](#cosmwasm.wasm.v1.MsgClearAdmin) | [MsgClearAdminResponse](#cosmwasm.wasm.v1.MsgClearAdminResponse) | ClearAdmin removes any admin stored for a smart contract | |
-| `UpdateInstantiateConfig` | [MsgUpdateInstantiateConfig](#cosmwasm.wasm.v1.MsgUpdateInstantiateConfig) | [MsgUpdateInstantiateConfigResponse](#cosmwasm.wasm.v1.MsgUpdateInstantiateConfigResponse) | UpdateInstantiateConfig updates instantiate config for a smart contract | |
+| `CreateDenom` | [MsgCreateDenom](#cosmwasm.tokenfactory.v1beta1.MsgCreateDenom) | [MsgCreateDenomResponse](#cosmwasm.tokenfactory.v1beta1.MsgCreateDenomResponse) | | |
+| `Mint` | [MsgMint](#cosmwasm.tokenfactory.v1beta1.MsgMint) | [MsgMintResponse](#cosmwasm.tokenfactory.v1beta1.MsgMintResponse) | | |
+| `Burn` | [MsgBurn](#cosmwasm.tokenfactory.v1beta1.MsgBurn) | [MsgBurnResponse](#cosmwasm.tokenfactory.v1beta1.MsgBurnResponse) | | |
+| `ChangeAdmin` | [MsgChangeAdmin](#cosmwasm.tokenfactory.v1beta1.MsgChangeAdmin) | [MsgChangeAdminResponse](#cosmwasm.tokenfactory.v1beta1.MsgChangeAdminResponse) | | |
+| `SetDenomMetadata` | [MsgSetDenomMetadata](#cosmwasm.tokenfactory.v1beta1.MsgSetDenomMetadata) | [MsgSetDenomMetadataResponse](#cosmwasm.tokenfactory.v1beta1.MsgSetDenomMetadataResponse) | | |
diff --git a/go.mod b/go.mod
index f0c9ca48ca..f34ff82705 100644
--- a/go.mod
+++ b/go.mod
@@ -1,145 +1,187 @@
module github.com/CosmWasm/wasmd
-go 1.19
+go 1.20
require (
+ cosmossdk.io/api v0.3.1
+ cosmossdk.io/core v0.5.1
+ cosmossdk.io/errors v1.0.0-beta.7
+ cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4
+ cosmossdk.io/tools/rosetta v0.2.1
github.com/CosmWasm/wasmvm v1.2.0
- github.com/cosmos/cosmos-proto v1.0.0-beta.1
- github.com/cosmos/cosmos-sdk v0.45.12
- github.com/cosmos/gogoproto v1.4.3
- github.com/cosmos/iavl v0.19.4
- github.com/cosmos/ibc-go/v4 v4.3.0
- github.com/cosmos/interchain-accounts v0.2.6
+ github.com/cometbft/cometbft v0.37.0-alpha.3
+ github.com/cometbft/cometbft-db v0.7.0
+ github.com/cosmos/cosmos-proto v1.0.0-beta.2
+ github.com/cosmos/cosmos-sdk v0.47.0-rc2.0.20230224204036-a6adb0821462
+ github.com/cosmos/gogogateway v1.2.0 // indirect
+ github.com/cosmos/gogoproto v1.4.6
+ github.com/cosmos/iavl v0.20.0-alpha4
+ github.com/cosmos/ibc-go/v7 v7.0.0-rc0
+ github.com/cosmos/ics23/go v0.9.1-0.20221207100636-b1abd8678aab // indirect
+ github.com/cosmos/interchain-accounts v0.4.1-0.20230129194959-49ab09ed3227
github.com/docker/distribution v2.8.1+incompatible
- github.com/dvsekhvalnov/jose2go v1.5.0
- github.com/gogo/protobuf v1.3.3
+ github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
+ github.com/gogo/protobuf v1.3.2
github.com/golang/protobuf v1.5.2
github.com/google/gofuzz v1.2.0
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.14.0
- github.com/rakyll/statik v0.1.7
+ github.com/rakyll/statik v0.1.7 // indirect
github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa
github.com/spf13/cast v1.5.0
- github.com/spf13/cobra v1.6.0
+ github.com/spf13/cobra v1.6.1
github.com/spf13/pflag v1.0.5
+ github.com/spf13/viper v1.15.0
github.com/stretchr/testify v1.8.1
- github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
- github.com/tendermint/tendermint v0.34.24
- github.com/tendermint/tm-db v0.6.7
- google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e
- google.golang.org/grpc v1.50.1
+ github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d
+ golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb
+ google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44
+ google.golang.org/grpc v1.53.0
gopkg.in/yaml.v2 v2.4.0
)
require (
- filippo.io/edwards25519 v1.0.0-beta.2 // indirect
+ cloud.google.com/go v0.110.0 // indirect
+ cloud.google.com/go/compute v1.18.0 // indirect
+ cloud.google.com/go/compute/metadata v0.2.3 // indirect
+ cloud.google.com/go/iam v0.12.0 // indirect
+ cloud.google.com/go/storage v1.29.0 // indirect
+ cosmossdk.io/depinject v1.0.0-alpha.3 // indirect
+ filippo.io/edwards25519 v1.0.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
github.com/99designs/keyring v1.2.1 // indirect
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
- github.com/Workiva/go-datastructures v1.0.53 // indirect
- github.com/armon/go-metrics v0.4.0 // indirect
+ github.com/armon/go-metrics v0.4.1 // indirect
+ github.com/aws/aws-sdk-go v1.44.203 // indirect
github.com/beorn7/perks v1.0.1 // indirect
+ github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
- github.com/btcsuite/btcd v0.22.2 // indirect
+ github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
+ github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cespare/xxhash v1.1.0 // indirect
- github.com/cespare/xxhash/v2 v2.1.2 // indirect
- github.com/coinbase/rosetta-sdk-go v0.7.0 // indirect
+ github.com/cespare/xxhash/v2 v2.2.0 // indirect
+ github.com/chzyer/readline v1.5.1 // indirect
+ github.com/cockroachdb/apd/v2 v2.0.2 // indirect
+ github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect
github.com/confio/ics23/go v0.9.0 // indirect
- github.com/cosmos/btcutil v1.0.4 // 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/ledger-cosmos-go v0.12.2 // indirect
- github.com/creachadair/taskgroup v0.3.2 // indirect
+ github.com/cosmos/ledger-cosmos-go v0.12.1 // indirect
+ github.com/cosmos/rosetta-sdk-go v0.10.0 // indirect
+ github.com/creachadair/taskgroup v0.4.2 // indirect
github.com/danieljoos/wincred v1.1.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
+ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 // indirect
github.com/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/dgraph-io/ristretto v0.1.1 // indirect
github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect
- github.com/dustin/go-humanize v1.0.0 // indirect
- github.com/felixge/httpsnoop v1.0.1 // indirect
+ github.com/dustin/go-humanize v1.0.1 // indirect
+ github.com/felixge/httpsnoop v1.0.2 // indirect
github.com/fsnotify/fsnotify v1.6.0 // 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-logfmt/logfmt v0.6.0 // indirect
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
- github.com/gogo/gateway v1.1.0 // indirect
+ github.com/gogo/googleapis v1.4.1 // indirect
github.com/golang/glog v1.0.0 // indirect
+ github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
+ github.com/golang/mock v1.6.0 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.2 // indirect
+ github.com/google/go-cmp v0.5.9 // indirect
github.com/google/orderedcode v0.0.1 // indirect
+ github.com/google/uuid v1.3.0 // indirect
+ github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
+ github.com/googleapis/gax-go/v2 v2.7.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/websocket v1.5.0 // 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/go-cleanhttp v0.5.2 // indirect
+ github.com/hashicorp/go-getter v1.7.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
- github.com/hashicorp/golang-lru v0.5.4 // indirect
+ github.com/hashicorp/go-safetemp v1.0.0 // indirect
+ github.com/hashicorp/go-version v1.6.0 // indirect
+ github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
- github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87 // indirect
- github.com/improbable-eng/grpc-web v0.14.1 // indirect
- github.com/inconshreveable/mousetrap v1.0.1 // indirect
+ github.com/hdevalence/ed25519consensus v0.1.0 // indirect
+ github.com/huandu/skiplist v1.2.0 // indirect
+ github.com/improbable-eng/grpc-web v0.15.0 // indirect
+ github.com/inconshreveable/mousetrap v1.1.0 // indirect
+ github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
- github.com/klauspost/compress v1.15.11 // indirect
- github.com/lib/pq v1.10.6 // indirect
+ github.com/json-iterator/go v1.1.12 // indirect
+ github.com/klauspost/compress v1.15.15 // indirect
+ github.com/lib/pq v1.10.7 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
- github.com/magiconair/properties v1.8.6 // indirect
- github.com/mattn/go-colorable v0.1.13 // indirect
- github.com/mattn/go-isatty v0.0.16 // indirect
- github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
+ github.com/magiconair/properties v1.8.7 // indirect
+ github.com/manifoldco/promptui v0.9.0 // indirect
+ github.com/mattn/go-isatty v0.0.17 // indirect
+ github.com/matttproud/golang_protobuf_extensions v1.0.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/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
+ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
+ github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mtibben/percent v0.2.1 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
- github.com/pelletier/go-toml v1.9.5 // indirect
- github.com/pelletier/go-toml/v2 v2.0.5 // indirect
- github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect
+ github.com/pelletier/go-toml/v2 v2.0.6 // indirect
+ github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
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/prometheus/common v0.40.0 // indirect
+ github.com/prometheus/procfs v0.9.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
- github.com/regen-network/cosmos-proto v0.3.1 // indirect
- github.com/rs/cors v1.8.2 // indirect
- github.com/rs/zerolog v1.27.0 // indirect
+ github.com/rs/cors v1.8.3 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
- github.com/spf13/afero v1.9.2 // indirect
+ github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
- github.com/spf13/viper v1.14.0 // indirect
- github.com/subosito/gotenv v1.4.1 // indirect
+ github.com/subosito/gotenv v1.4.2 // indirect
+ github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect
github.com/tendermint/go-amino v0.16.0 // indirect
- github.com/tidwall/btree v1.5.0 // indirect
+ github.com/tidwall/btree v1.6.0 // indirect
+ github.com/ulikunitz/xz v0.5.11 // indirect
github.com/zondax/hid v0.9.1 // indirect
github.com/zondax/ledger-go v0.14.1 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
- golang.org/x/crypto v0.2.0 // indirect
- golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
- golang.org/x/net v0.2.0 // indirect
- golang.org/x/sys v0.2.0 // indirect
- golang.org/x/term v0.2.0 // indirect
- golang.org/x/text v0.4.0 // indirect
- google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 // indirect
+ go.opencensus.io v0.24.0 // indirect
+ golang.org/x/crypto v0.6.0 // indirect
+ golang.org/x/net v0.7.0 // indirect
+ golang.org/x/oauth2 v0.5.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/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
+ google.golang.org/api v0.110.0 // indirect
+ google.golang.org/appengine v1.6.7 // indirect
+ google.golang.org/protobuf v1.28.2-0.20230208135220-49eaa78c6c9c // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
nhooyr.io/websocket v1.8.6 // indirect
+ pgregory.net/rapid v0.5.5 // indirect
+ sigs.k8s.io/yaml v1.3.0 // indirect
)
replace (
+ // use cosmos fork of keyring
+ github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0
+ // use cometbft enabled wasmvm
+ github.com/CosmWasm/wasmvm => github.com/notional-labs/wasmvm v1.0.0-soon2.0.20230224221603-dbeeef0006f5
+ // use cometbft enabled ibc-go
+ github.com/cosmos/ibc-go/v7 => github.com/cosmos/ibc-go/v7 v7.0.0-20230224085028-0a79e38d9199
+ // use cometbft enabled interchain-accounts
+ github.com/cosmos/interchain-accounts => github.com/notional-labs/interchain-accounts v0.0.0-20230224232143-e9404a7e24d2
+ // dgrijalva/jwt-go is deprecated and doesn't receive security updates.
+ // TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134
+ github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2
// Fix upstream GHSA-h395-qcrw-5vmq vulnerability.
// TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409
- github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.7.0
-
- // latest grpc doesn't work with with our modified proto compiler, so we need to enforce
- // the following version across all dependencies.
- 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.24
-
- google.golang.org/grpc => google.golang.org/grpc v1.33.2
+ github.com/gin-gonic/gin => github.com/gin-gonic/gin v1.8.1
)
diff --git a/go.sum b/go.sum
index 63396d4b51..ab8d073419 100644
--- a/go.sum
+++ b/go.sum
@@ -1,3 +1,4 @@
+cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
@@ -16,54 +17,200 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb
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 v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg=
+cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8=
+cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0=
+cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY=
+cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM=
+cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY=
+cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ=
+cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI=
+cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4=
+cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc=
+cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA=
+cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w99A=
+cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc=
+cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU=
+cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA=
+cloud.google.com/go v0.110.0 h1:Zc8gqp3+a9/Eyph2KDmcGaPtbKRIoqq4YTlL4NMD0Ys=
+cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY=
+cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw=
+cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY=
+cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI=
+cloud.google.com/go/analytics v0.12.0/go.mod h1:gkfj9h6XRf9+TS4bmuhPEShsh3hH8PAZzm/41OOhQd4=
+cloud.google.com/go/area120 v0.5.0/go.mod h1:DE/n4mp+iqVyvxHN41Vf1CR602GiHQjFPusMFW6bGR4=
+cloud.google.com/go/area120 v0.6.0/go.mod h1:39yFJqWVgm0UZqWTOdqkLhjoC7uFfgXRC8g/ZegeAh0=
+cloud.google.com/go/artifactregistry v1.6.0/go.mod h1:IYt0oBPSAGYj/kprzsBjZ/4LnG/zOcHyFHjWPCi6SAQ=
+cloud.google.com/go/artifactregistry v1.7.0/go.mod h1:mqTOFOnGZx8EtSqK/ZWcsm/4U8B77rbcLP6ruDU2Ixk=
+cloud.google.com/go/asset v1.5.0/go.mod h1:5mfs8UvcM5wHhqtSv8J1CtxxaQq3AdBxxQi2jGW/K4o=
+cloud.google.com/go/asset v1.7.0/go.mod h1:YbENsRK4+xTiL+Ofoj5Ckf+O17kJtgp3Y3nn4uzZz5s=
+cloud.google.com/go/asset v1.8.0/go.mod h1:mUNGKhiqIdbr8X7KNayoYvyc4HbbFO9URsjbytpUaW0=
+cloud.google.com/go/assuredworkloads v1.5.0/go.mod h1:n8HOZ6pff6re5KYfBXcFvSViQjDwxFkAkmUFffJRbbY=
+cloud.google.com/go/assuredworkloads v1.6.0/go.mod h1:yo2YOk37Yc89Rsd5QMVECvjaMKymF9OP+QXWlKXUkXw=
+cloud.google.com/go/assuredworkloads v1.7.0/go.mod h1:z/736/oNmtGAyU47reJgGN+KVoYoxeLBoj4XkKYscNI=
+cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0=
+cloud.google.com/go/automl v1.6.0/go.mod h1:ugf8a6Fx+zP0D59WLhqgTDsQI9w07o64uf/Is3Nh5p8=
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
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/bigquery v1.42.0/go.mod h1:8dRTJxhtG+vwBKzE5OseQn/hiydoQN3EedCaOdYmxRA=
+cloud.google.com/go/billing v1.4.0/go.mod h1:g9IdKBEFlItS8bTtlrZdVLWSSdSyFUZKXNS02zKMOZY=
+cloud.google.com/go/billing v1.5.0/go.mod h1:mztb1tBc3QekhjSgmpf/CV4LzWXLzCArwpLmP2Gm88s=
+cloud.google.com/go/binaryauthorization v1.1.0/go.mod h1:xwnoWu3Y84jbuHa0zd526MJYmtnVXn0syOjaJgy4+dM=
+cloud.google.com/go/binaryauthorization v1.2.0/go.mod h1:86WKkJHtRcv5ViNABtYMhhNWRrD1Vpi//uKEy7aYEfI=
+cloud.google.com/go/cloudtasks v1.5.0/go.mod h1:fD92REy1x5woxkKEkLdvavGnPJGEn8Uic9nWuLzqCpY=
+cloud.google.com/go/cloudtasks v1.6.0/go.mod h1:C6Io+sxuke9/KNRkbQpihnW93SWDU3uXt92nu85HkYI=
+cloud.google.com/go/compute v0.1.0/go.mod h1:GAesmwr110a34z04OlxYkATPBEfVhkymfTBXtfbBFow=
+cloud.google.com/go/compute v1.3.0/go.mod h1:cCZiE1NHEtai4wiufUhW8I8S1JKkAnhnQJWM7YD99wM=
+cloud.google.com/go/compute v1.5.0/go.mod h1:9SMHyhJlzhlkJqrPAc839t2BZFTSk6Jdj6mkzQJeu0M=
+cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz/FMzPu0s=
+cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU=
+cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U=
+cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU=
+cloud.google.com/go/compute v1.18.0 h1:FEigFqoDbys2cvFkZ9Fjq4gnHBP55anJ0yQyau2f9oY=
+cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs=
+cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
+cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
+cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I=
+cloud.google.com/go/containeranalysis v0.6.0/go.mod h1:HEJoiEIu+lEXM+k7+qLCci0h33lX3ZqoYFdmPcoO7s4=
+cloud.google.com/go/datacatalog v1.3.0/go.mod h1:g9svFY6tuR+j+hrTw3J2dNcmI0dzmSiyOzm8kpLq0a0=
+cloud.google.com/go/datacatalog v1.5.0/go.mod h1:M7GPLNQeLfWqeIm3iuiruhPzkt65+Bx8dAKvScX8jvs=
+cloud.google.com/go/datacatalog v1.6.0/go.mod h1:+aEyF8JKg+uXcIdAmmaMUmZ3q1b/lKLtXCmXdnc0lbc=
+cloud.google.com/go/dataflow v0.6.0/go.mod h1:9QwV89cGoxjjSR9/r7eFDqqjtvbKxAK2BaYU6PVk9UM=
+cloud.google.com/go/dataflow v0.7.0/go.mod h1:PX526vb4ijFMesO1o202EaUmouZKBpjHsTlCtB4parQ=
+cloud.google.com/go/dataform v0.3.0/go.mod h1:cj8uNliRlHpa6L3yVhDOBrUXH+BPAO1+KFMQQNSThKo=
+cloud.google.com/go/dataform v0.4.0/go.mod h1:fwV6Y4Ty2yIFL89huYlEkwUPtS7YZinZbzzj5S9FzCE=
+cloud.google.com/go/datalabeling v0.5.0/go.mod h1:TGcJ0G2NzcsXSE/97yWjIZO0bXj0KbVlINXMG9ud42I=
+cloud.google.com/go/datalabeling v0.6.0/go.mod h1:WqdISuk/+WIGeMkpw/1q7bK/tFEZxsrFJOJdY2bXvTQ=
+cloud.google.com/go/dataqna v0.5.0/go.mod h1:90Hyk596ft3zUQ8NkFfvICSIfHFh1Bc7C4cK3vbhkeo=
+cloud.google.com/go/dataqna v0.6.0/go.mod h1:1lqNpM7rqNLVgWBJyk5NF6Uen2PHym0jtVJonplVsDA=
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/datastream v1.2.0/go.mod h1:i/uTP8/fZwgATHS/XFu0TcNUhuA0twZxxQ3EyCUQMwo=
+cloud.google.com/go/datastream v1.3.0/go.mod h1:cqlOX8xlyYF/uxhiKn6Hbv6WjwPPuI9W2M9SAXwaLLQ=
+cloud.google.com/go/dialogflow v1.15.0/go.mod h1:HbHDWs33WOGJgn6rfzBW1Kv807BE3O1+xGbn59zZWI4=
+cloud.google.com/go/dialogflow v1.16.1/go.mod h1:po6LlzGfK+smoSmTBnbkIZY2w8ffjz/RcGSS+sh1el0=
+cloud.google.com/go/dialogflow v1.17.0/go.mod h1:YNP09C/kXA1aZdBgC/VtXX74G/TKn7XVCcVumTflA+8=
+cloud.google.com/go/documentai v1.7.0/go.mod h1:lJvftZB5NRiFSX4moiye1SMxHx0Bc3x1+p9e/RfXYiU=
+cloud.google.com/go/documentai v1.8.0/go.mod h1:xGHNEB7CtsnySCNrCFdCyyMz44RhFEEX2Q7UD0c5IhU=
+cloud.google.com/go/domains v0.6.0/go.mod h1:T9Rz3GasrpYk6mEGHh4rymIhjlnIuB4ofT1wTxDeT4Y=
+cloud.google.com/go/domains v0.7.0/go.mod h1:PtZeqS1xjnXuRPKE/88Iru/LdfoRyEHYA9nFQf4UKpg=
+cloud.google.com/go/edgecontainer v0.1.0/go.mod h1:WgkZ9tp10bFxqO8BLPqv2LlfmQF1X8lZqwW4r1BTajk=
+cloud.google.com/go/edgecontainer v0.2.0/go.mod h1:RTmLijy+lGpQ7BXuTDa4C4ssxyXT34NIuHIgKuP4s5w=
+cloud.google.com/go/functions v1.6.0/go.mod h1:3H1UA3qiIPRWD7PeZKLvHZ9SaQhR26XIJcC0A5GbvAk=
+cloud.google.com/go/functions v1.7.0/go.mod h1:+d+QBcWM+RsrgZfV9xo6KfA1GlzJfxcfZcRPEhDDfzg=
+cloud.google.com/go/gaming v1.5.0/go.mod h1:ol7rGcxP/qHTRQE/RO4bxkXq+Fix0j6D4LFPzYTIrDM=
+cloud.google.com/go/gaming v1.6.0/go.mod h1:YMU1GEvA39Qt3zWGyAVA9bpYz/yAhTvaQ1t2sK4KPUA=
+cloud.google.com/go/gkeconnect v0.5.0/go.mod h1:c5lsNAg5EwAy7fkqX/+goqFsU1Da/jQFqArp+wGNr/o=
+cloud.google.com/go/gkeconnect v0.6.0/go.mod h1:Mln67KyU/sHJEBY8kFZ0xTeyPtzbq9StAVvEULYK16A=
+cloud.google.com/go/gkehub v0.9.0/go.mod h1:WYHN6WG8w9bXU0hqNxt8rm5uxnk8IH+lPY9J2TV7BK0=
+cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y977wO+hBH0=
+cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc=
+cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY=
+cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc=
+cloud.google.com/go/iam v0.12.0 h1:DRtTY29b75ciH6Ov1PHb4/iat2CLCvrOm40Q0a6DFpE=
+cloud.google.com/go/iam v0.12.0/go.mod h1:knyHGviacl11zrtZUoDuYpDgLjvr28sLQaG0YB2GYAY=
+cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic=
+cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI=
+cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8=
+cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08=
+cloud.google.com/go/longrunning v0.3.0 h1:NjljC+FYPV3uh5/OwWT6pVU+doBqMg2x/rZlE+CamDs=
+cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4=
+cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w=
+cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE=
+cloud.google.com/go/memcache v1.5.0/go.mod h1:dk3fCK7dVo0cUU2c36jKb4VqKPS22BTkf81Xq617aWM=
+cloud.google.com/go/metastore v1.5.0/go.mod h1:2ZNrDcQwghfdtCwJ33nM0+GrBGlVuh8rakL3vdPY3XY=
+cloud.google.com/go/metastore v1.6.0/go.mod h1:6cyQTls8CWXzk45G55x57DVQ9gWg7RiH65+YgPsNh9s=
+cloud.google.com/go/networkconnectivity v1.4.0/go.mod h1:nOl7YL8odKyAOtzNX73/M5/mGZgqqMeryi6UPZTk/rA=
+cloud.google.com/go/networkconnectivity v1.5.0/go.mod h1:3GzqJx7uhtlM3kln0+x5wyFvuVH1pIBJjhCpjzSt75o=
+cloud.google.com/go/networksecurity v0.5.0/go.mod h1:xS6fOCoqpVC5zx15Z/MqkfDwH4+m/61A3ODiDV1xmiQ=
+cloud.google.com/go/networksecurity v0.6.0/go.mod h1:Q5fjhTr9WMI5mbpRYEbiexTzROf7ZbDzvzCrNl14nyU=
+cloud.google.com/go/notebooks v1.2.0/go.mod h1:9+wtppMfVPUeJ8fIWPOq1UnATHISkGXGqTkxeieQ6UY=
+cloud.google.com/go/notebooks v1.3.0/go.mod h1:bFR5lj07DtCPC7YAAJ//vHskFBxA5JzYlH68kXVdk34=
+cloud.google.com/go/osconfig v1.7.0/go.mod h1:oVHeCeZELfJP7XLxcBGTMBvRO+1nQ5tFG9VQTmYS2Fs=
+cloud.google.com/go/osconfig v1.8.0/go.mod h1:EQqZLu5w5XA7eKizepumcvWx+m8mJUhEwiPqWiZeEdg=
+cloud.google.com/go/oslogin v1.4.0/go.mod h1:YdgMXWRaElXz/lDk1Na6Fh5orF7gvmJ0FGLIs9LId4E=
+cloud.google.com/go/oslogin v1.5.0/go.mod h1:D260Qj11W2qx/HVF29zBg+0fd6YCSjSqLUkY/qEenQU=
+cloud.google.com/go/phishingprotection v0.5.0/go.mod h1:Y3HZknsK9bc9dMi+oE8Bim0lczMU6hrX0UpADuMefr0=
+cloud.google.com/go/phishingprotection v0.6.0/go.mod h1:9Y3LBLgy0kDTcYET8ZH3bq/7qni15yVUoAxiFxnlSUA=
+cloud.google.com/go/privatecatalog v0.5.0/go.mod h1:XgosMUvvPyxDjAVNDYxJ7wBW8//hLDDYmnsNcMGq1K0=
+cloud.google.com/go/privatecatalog v0.6.0/go.mod h1:i/fbkZR0hLN29eEWiiwue8Pb+GforiEIBnV9yrRUOKI=
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/recaptchaenterprise v1.3.1/go.mod h1:OdD+q+y4XGeAlxRaMn1Y7/GveP6zmq76byL6tjPE7d4=
+cloud.google.com/go/recaptchaenterprise/v2 v2.1.0/go.mod h1:w9yVqajwroDNTfGuhmOjPDN//rZGySaf6PtFVcSCa7o=
+cloud.google.com/go/recaptchaenterprise/v2 v2.2.0/go.mod h1:/Zu5jisWGeERrd5HnlS3EUGb/D335f9k51B/FVil0jk=
+cloud.google.com/go/recaptchaenterprise/v2 v2.3.0/go.mod h1:O9LwGCjrhGHBQET5CA7dd5NwwNQUErSgEDit1DLNTdo=
+cloud.google.com/go/recommendationengine v0.5.0/go.mod h1:E5756pJcVFeVgaQv3WNpImkFP8a+RptV6dDLGPILjvg=
+cloud.google.com/go/recommendationengine v0.6.0/go.mod h1:08mq2umu9oIqc7tDy8sx+MNJdLG0fUi3vaSVbztHgJ4=
+cloud.google.com/go/recommender v1.5.0/go.mod h1:jdoeiBIVrJe9gQjwd759ecLJbxCDED4A6p+mqoqDvTg=
+cloud.google.com/go/recommender v1.6.0/go.mod h1:+yETpm25mcoiECKh9DEScGzIRyDKpZ0cEhWGo+8bo+c=
+cloud.google.com/go/redis v1.7.0/go.mod h1:V3x5Jq1jzUcg+UNsRvdmsfuFnit1cfe3Z/PGyq/lm4Y=
+cloud.google.com/go/redis v1.8.0/go.mod h1:Fm2szCDavWzBk2cDKxrkmWBqoCiL1+Ctwq7EyqBCA/A=
+cloud.google.com/go/retail v1.8.0/go.mod h1:QblKS8waDmNUhghY2TI9O3JLlFk8jybHeV4BF19FrE4=
+cloud.google.com/go/retail v1.9.0/go.mod h1:g6jb6mKuCS1QKnH/dpu7isX253absFl6iE92nHwlBUY=
+cloud.google.com/go/scheduler v1.4.0/go.mod h1:drcJBmxF3aqZJRhmkHQ9b3uSSpQoltBPGPxGAWROx6s=
+cloud.google.com/go/scheduler v1.5.0/go.mod h1:ri073ym49NW3AfT6DZi21vLZrG07GXr5p3H1KxN5QlI=
+cloud.google.com/go/secretmanager v1.6.0/go.mod h1:awVa/OXF6IiyaU1wQ34inzQNc4ISIDIrId8qE5QGgKA=
+cloud.google.com/go/security v1.5.0/go.mod h1:lgxGdyOKKjHL4YG3/YwIL2zLqMFCKs0UbQwgyZmfJl4=
+cloud.google.com/go/security v1.7.0/go.mod h1:mZklORHl6Bg7CNnnjLH//0UlAlaXqiG7Lb9PsPXLfD0=
+cloud.google.com/go/security v1.8.0/go.mod h1:hAQOwgmaHhztFhiQ41CjDODdWP0+AE1B3sX4OFlq+GU=
+cloud.google.com/go/securitycenter v1.13.0/go.mod h1:cv5qNAqjY84FCN6Y9z28WlkKXyWsgLO832YiWwkCWcU=
+cloud.google.com/go/securitycenter v1.14.0/go.mod h1:gZLAhtyKv85n52XYWt6RmeBdydyxfPeTrpToDPw4Auc=
+cloud.google.com/go/servicedirectory v1.4.0/go.mod h1:gH1MUaZCgtP7qQiI+F+A+OpeKF/HQWgtAddhTbhL2bs=
+cloud.google.com/go/servicedirectory v1.5.0/go.mod h1:QMKFL0NUySbpZJ1UZs3oFAmdvVxhhxB6eJ/Vlp73dfg=
+cloud.google.com/go/speech v1.6.0/go.mod h1:79tcr4FHCimOp56lwC01xnt/WPJZc4v3gzyT7FoBkCM=
+cloud.google.com/go/speech v1.7.0/go.mod h1:KptqL+BAQIhMsj1kOP2la5DSEEerPDuOP/2mmkhHhZQ=
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=
+cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y=
+cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc=
+cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s=
+cloud.google.com/go/storage v1.29.0 h1:6weCgzRvMg7lzuUurI4697AqIRPU1SvzHhynwpW31jI=
+cloud.google.com/go/storage v1.29.0/go.mod h1:4puEjyTKnku6gfKoTfNOU/W+a9JyuVNxjpS5GBrB8h4=
+cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw=
+cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g=
+cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU=
+cloud.google.com/go/videointelligence v1.7.0/go.mod h1:k8pI/1wAhjznARtVT9U1llUaFNPh7muw8QyOUpavru4=
+cloud.google.com/go/vision v1.2.0/go.mod h1:SmNwgObm5DpFBme2xpyOyasvBc1aPdjvMk2bBk0tKD0=
+cloud.google.com/go/vision/v2 v2.2.0/go.mod h1:uCdV4PpN1S0jyCyq8sIM42v2Y6zOLkZs+4R9LrGYwFo=
+cloud.google.com/go/vision/v2 v2.3.0/go.mod h1:UO61abBx9QRMFkNBbf1D8B1LXdS2cGiiCRx0vSpZoUo=
+cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xXZmFiHmGE=
+cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg=
+cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0=
+cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M=
+cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE=
+cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw=
+cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI=
+cosmossdk.io/core v0.5.1/go.mod h1:KZtwHCLjcFuo0nmDc24Xy6CRNEL9Vl/MeimQ2aC7NLE=
+cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw=
+cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU=
+cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w=
+cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE=
+cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4 h1:/jnzJ9zFsL7qkV8LCQ1JH3dYHh2EsKZ3k8Mr6AqqiOA=
+cosmossdk.io/math v1.0.0-beta.6.0.20230216172121-959ce49135e4/go.mod h1:gUVtWwIzfSXqcOT+lBVz2jyjfua8DoBdzRsIyaUAT/8=
+cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw=
+cosmossdk.io/tools/rosetta v0.2.1/go.mod h1:Pqdc1FdvkNV3LcNIkYWt2RQY6IP1ge6YWZk8MhhO9Hw=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
-filippo.io/edwards25519 v1.0.0-beta.2 h1:/BZRNzm8N4K4eWfK28dL4yescorxtO7YG1yun8fy+pI=
-filippo.io/edwards25519 v1.0.0-beta.2/go.mod h1:X+pm78QAUPtFLi1z9PYIlS/bdDnvbCOGKtZ+ACWEf7o=
+filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek=
+filippo.io/edwards25519 v1.0.0/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/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/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg=
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4=
-github.com/CosmWasm/wasmvm v1.2.0 h1:pNCp175id+r/dSa4Ii5zoTkmauOoeipkvepvEJM1bao=
-github.com/CosmWasm/wasmvm v1.2.0/go.mod h1:OIhXFPi9BbcEL1USBj4OIrBTtSSds+9eEql56fsdyfE=
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/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg=
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw=
@@ -71,86 +218,91 @@ github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
-github.com/StackExchange/wmi 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/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/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.0 h1:yCQqn7dwca4ITXb+CbubHmedzaQYHhNhrEXLYUeEe8Q=
-github.com/armon/go-metrics v0.4.0/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4=
+github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA=
+github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A=
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 v1.44.122/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
+github.com/aws/aws-sdk-go v1.44.203 h1:pcsP805b9acL3wUqa4JR2vg1k2wnItkDYNvfmcy6F+U=
+github.com/aws/aws-sdk-go v1.44.203/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g=
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/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas=
+github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4=
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/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/btcutil v1.0.3-0.20201208143702-a53e38424cce h1:YtWJF7RHm2pYCvA5t0RPmAaLUhREsKuKd+SLhxFbFeQ=
-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/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/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw=
+github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4=
+github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
-github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
-github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
-github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
+github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
+github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
+github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
+github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM=
+github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
+github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI=
+github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
+github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04=
+github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8=
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/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
+github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
+github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
+github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI=
+github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
+github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
+github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
+github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
+github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
+github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E=
+github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw=
+github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w=
github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8=
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
-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/coinbase/rosetta-sdk-go/types v1.0.0 h1:jpVIwLcPoOeCR6o1tU+Xv7r5bMONNbHU7MuEHboiFuA=
+github.com/coinbase/rosetta-sdk-go/types v1.0.0/go.mod h1:eq7W2TMRH22GTW0N0beDnN931DW0/WOI1R2sdHNHG4c=
+github.com/cometbft/cometbft v0.37.0-alpha.3 h1:74F+cMr4pd1a2lFn/h4TxXmO8VWi3A2dxyoMcjlMWuQ=
+github.com/cometbft/cometbft v0.37.0-alpha.3/go.mod h1:dUGbIGYoLM11xUruTTJY4Xp9FHh6Nfu3Nots8/+UNSo=
+github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo=
+github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0=
github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4=
github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak=
github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg=
@@ -158,102 +310,106 @@ github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc
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.4 h1:n7C2ngKXo7UC9gNyMNLbzqz7Asuf+7Qv4gnX/rOdQ44=
-github.com/cosmos/btcutil v1.0.4/go.mod h1:Ffqc8Hn6TJUdDgHBwIZLtrLQC1KdJ9jGJl/TvgUaxbU=
-github.com/cosmos/cosmos-proto v1.0.0-beta.1 h1:iDL5qh++NoXxG8hSy93FdYJut4XfgbShIocllGaXx/0=
-github.com/cosmos/cosmos-proto v1.0.0-beta.1/go.mod h1:8k2GNZghi5sDRFw/scPL8gMSowT1vDA+5ouxL8GjaUE=
-github.com/cosmos/cosmos-sdk v0.45.12 h1:Z0kOOjOfHP+loO42KZZo3Y+PAZsoYycyiSckVXzwOm4=
-github.com/cosmos/cosmos-sdk v0.45.12/go.mod h1:ZAdIs09zttoA3aSwQCTK9gecOThUVNnzBSVj3DiS6UY=
+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-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.47.0-rc2.0.20230224204036-a6adb0821462 h1:cN6JEUXF6nnnfPlPTNK+Bv6y93SPSFrQmUe2L7Qj06A=
+github.com/cosmos/cosmos-sdk v0.47.0-rc2.0.20230224204036-a6adb0821462/go.mod h1:eEsQOIKglTmBcNJiaPSIyzO4H/G3iOyupt/oB6qfmWw=
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.3 h1:RP3yyVREh9snv/lsOvmsAPQt8f44LgL281X0IOIhhcI=
-github.com/cosmos/gogoproto v1.4.3/go.mod h1:0hLIG5TR7IvV1fme1HCFKjfzW9X2x0Mo+RooWXCnOWU=
-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.4 h1:t82sN+Y0WeqxDLJRSpNd8YFX5URIrT+p8n6oJbJ2Dok=
-github.com/cosmos/iavl v0.19.4/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/interchain-accounts v0.2.6/go.mod h1:lUzWNzCiCtIEYZefac5+YgEBz2aR39nMS374jIv1c7o=
-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/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE=
+github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI=
+github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU=
+github.com/cosmos/gogoproto v1.4.6 h1:Ee7z15dWJaGlgM2rWrK8N2IX7PQcuccu8oG68jp5RL4=
+github.com/cosmos/gogoproto v1.4.6/go.mod h1:VS/ASYmPgv6zkPKLjR9EB91lwbLHOzaGCirmKKhncfI=
+github.com/cosmos/iavl v0.20.0-alpha4 h1:49SZoxNwah5nqbVE1da8BAhenC7HMSVOTZ0XKVhZpOE=
+github.com/cosmos/iavl v0.20.0-alpha4/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A=
+github.com/cosmos/ibc-go/v7 v7.0.0-20230224085028-0a79e38d9199 h1:DO75YItJU1Q8aTXX8XkhougKhBC90N1jAmW2/kesAXA=
+github.com/cosmos/ibc-go/v7 v7.0.0-20230224085028-0a79e38d9199/go.mod h1:xjtpZpgiiKgdpRR4r6dlxih3tHCJfVGOpeGRvohE2WM=
+github.com/cosmos/ics23/go v0.9.1-0.20221207100636-b1abd8678aab h1:I9ialKTQo7248V827Bba4OuKPmk+FPzmTVHsLXaIJWw=
+github.com/cosmos/ics23/go v0.9.1-0.20221207100636-b1abd8678aab/go.mod h1:2CwqasX5dSD7Hbp/9b6lhK6BwoBDCBldx7gPKRukR60=
+github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo=
+github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA=
+github.com/cosmos/ledger-cosmos-go v0.12.1 h1:sMBxza5p/rNK/06nBSNmsI/WDqI0pVJFVNihy1Y984w=
+github.com/cosmos/ledger-cosmos-go v0.12.1/go.mod h1:dhO6kj+Y+AHIOgAe4L9HL/6NDdyyth4q238I9yFpD2g=
+github.com/cosmos/rosetta-sdk-go v0.10.0 h1:E5RhTruuoA7KTIXUcMicL76cffyeoyvNybzUGSKFTcM=
+github.com/cosmos/rosetta-sdk-go v0.10.0/go.mod h1:SImAZkb96YbwvoRkzSMQB6noNJXFgWl/ENIznEoYQI4=
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.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/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJFxv2Li8=
+github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM=
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/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/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/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc=
-github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218=
+github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0=
+github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4=
+github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc=
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I=
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE=
-github.com/dgraph-io/badger/v2 v2.2007.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/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8=
+github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA=
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 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
+github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
+github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM=
github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU=
-github.com/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/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g=
+github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
+github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
+github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
+github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
+github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
+github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
+github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
+github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/ethereum/go-ethereum v1.9.25/go.mod h1:vMkFiYLHI4tgPw4k2j4MHKoovchFE8plZ0M9VMk4/oM=
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/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/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ=
github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
-github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0=
+github.com/felixge/httpsnoop v1.0.2 h1:+nS9g82KMXccJ/wp0zyRW9ZBHFETmMGtkk+2CTTrW4o=
+github.com/felixge/httpsnoop v1.0.2/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
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.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
-github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
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.7.0 h1:jGB9xAJQ12AIGNB4HguylppmDK1Am9ppF7XnGXXJuoU=
-github.com/gin-gonic/gin v1.7.0/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY=
+github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8=
+github.com/gin-gonic/gin v1.8.1/go.mod h1:ji8BvRH1azfM+SYow9zQ6SZMvR8qOMZHmsCuWR9tTTk=
github.com/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=
@@ -262,37 +418,45 @@ github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2
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-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
+github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4=
+github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
-github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
-github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
-github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
-github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
-github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE=
-github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4=
-github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg=
+github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU=
+github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs=
+github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho=
+github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA=
+github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos=
+github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
+github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0=
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo=
github.com/gobwas/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.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
+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/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0=
-github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic=
+github.com/gofrs/uuid v4.3.0+incompatible h1:CaSVZxm5B+7o45rtab4jC2G37WGYX1zQfuU2i6DSvnc=
+github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
+github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c=
+github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0=
+github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4=
+github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
+github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
+github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
+github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
+github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
+github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
+github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ=
github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4=
@@ -300,13 +464,18 @@ github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4er
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/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
+github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
+github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
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.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8=
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=
@@ -323,11 +492,10 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD
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.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
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=
@@ -343,17 +511,24 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
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.3/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.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
+github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
+github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0=
github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
+github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no=
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/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk=
+github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw=
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=
@@ -366,12 +541,34 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf
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/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
+github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
+github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
+github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
+github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
+github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/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/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
+github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
+github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8=
+github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg=
+github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k=
+github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k=
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/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0=
+github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM=
+github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM=
+github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM=
+github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c=
+github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo=
+github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY=
+github.com/googleapis/gax-go/v2 v2.7.0 h1:IcsPKeInNvYi7eqSaDjiZqDDKu5rsmunY0Y1YupQSSQ=
+github.com/googleapis/gax-go/v2 v2.7.0/go.mod h1:TEop28CZZQ2y+c0VxMUmu1lV+fQx57QpBWsYpwqHJx8=
+github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4=
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/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
@@ -382,17 +579,14 @@ github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z
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.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/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=
@@ -408,6 +602,10 @@ github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyN
github.com/hashicorp/errwrap v1.0.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-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
+github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
+github.com/hashicorp/go-getter v1.7.0 h1:bzrYP+qu/gMrL1au7/aDvkoOVGUJpeKBgbqRHACAFDY=
+github.com/hashicorp/go-getter v1.7.0/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744=
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=
@@ -415,119 +613,113 @@ github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iP
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs=
github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU=
+github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo=
+github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I=
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.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 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc=
-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-20210204194344-59a8610d2b87 h1:uUjLpLt6bVvZ72SQc/B4dXcPBw4Vgd7soowdRl52qEM=
-github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87/go.mod h1:XGsKKeXxeRr95aEOgipvluMPlgjr7dGlk9ZTWOjcUcg=
-github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw=
+github.com/hdevalence/ed25519consensus v0.1.0 h1:jtBwzzcHuTmFrQN6xQZn6CQEO/V9f7HsjsjeEZ6auqU=
+github.com/hdevalence/ed25519consensus v0.1.0/go.mod h1:w3BHWjwJbFU29IRHL1Iqkw3sus+7FctEyM4RqDxYNzo=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
+github.com/huandu/go-assert v1.1.5 h1:fjemmA7sSfYHJD7CUqs9qTwwfdNAx7/j2/ZlHXzNB3c=
+github.com/huandu/go-assert v1.1.5/go.mod h1:yOLvuqZwmcHIC5rIzrBhT7D3Q9c3GFnd0JrPVhn/06U=
+github.com/huandu/skiplist v1.2.0 h1:gox56QD77HzSC0w+Ws3MH3iie755GBJU1OER3h5VsYw=
+github.com/huandu/skiplist v1.2.0/go.mod h1:7v3iFjLcSAzO4fN5B8dvebvo/qsfumiLiDXMrPiHF9w=
github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg=
-github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc=
-github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
-github.com/improbable-eng/grpc-web v0.14.1 h1:NrN4PY71A6tAz2sKDvC5JCauENWp0ykG8Oq1H3cpFvw=
-github.com/improbable-eng/grpc-web v0.14.1/go.mod h1:zEjGHa8DAlkoOXmswrNvhUGEYQA9UI7DhrGeHR1DMGU=
+github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ=
+github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8=
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/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
+github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo=
-github.com/informalsystems/tendermint v0.34.24 h1:2beNEg5tp+U5oj/Md+0xDBsMHGbdue31T3OrstS6xS0=
-github.com/informalsystems/tendermint v0.34.24/go.mod h1:rXVrl4OYzmIa1I91av3iLv2HS0fGSiucyW9J4aMTpKI=
-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/jhump/protoreflect v1.13.1-0.20220928232736-101791cb1b4c h1:XImQJfpJLmGEEd8ll5yPVyL/aEvmgGHW4WYTyNseLOM=
+github.com/jhump/protoreflect v1.12.1-0.20220721211354-060cc04fc18b h1:izTof8BKh/nE1wrKOrloNA5q4odOarjf+Xpe+4qow98=
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
+github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
+github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
+github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
+github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U=
github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4=
-github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
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/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/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU=
+github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
+github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
-github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4=
github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.11.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/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw=
+github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4=
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 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
+github.com/kr/pretty v0.2.1/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/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/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
-github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
-github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
-github.com/lib/pq v1.10.6 h1:jbk+ZieJ0D7EVGJYpL9QTz7/YW6UHbmdnZWYyK5cdBs=
-github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
+github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w=
+github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
+github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw=
+github.com/lib/pq v1.10.7/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/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4=
+github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
-github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo=
-github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
+github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
+github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
+github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA=
+github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg=
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.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
-github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
-github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
-github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
-github.com/mattn/go-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.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-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
+github.com/mattn/go-isatty v0.0.17/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/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/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
+github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
github.com/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=
@@ -536,13 +728,15 @@ github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA
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/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU=
+github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8=
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=
@@ -558,8 +752,6 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW
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/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=
@@ -567,27 +759,30 @@ github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzE
github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
-github.com/neilotoole/errgroup v0.1.5/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE=
-github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
-github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
+github.com/notional-labs/interchain-accounts v0.0.0-20230224232143-e9404a7e24d2 h1:kx78zS/Mj225UzP8mL/Rj7bGqQA1/C2CxVYH/5Je2xE=
+github.com/notional-labs/interchain-accounts v0.0.0-20230224232143-e9404a7e24d2/go.mod h1:75tXHGIsRLuqQw4pcEnEgFRXUxoqMiFf4ednAvviqBE=
+github.com/notional-labs/wasmvm v1.0.0-soon2.0.20230224221603-dbeeef0006f5 h1:xd4IwHVIkSsDPC36+/lhOz4n6VXt9fa5B3eRuYfQ34U=
+github.com/notional-labs/wasmvm v1.0.0-soon2.0.20230224221603-dbeeef0006f5/go.mod h1:yovoW+vdtjJlasbPPrXQ1FpoJzWbkc0AAKhsyCDsIPw=
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/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
-github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA=
-github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
-github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
+github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0=
+github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
+github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
+github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c=
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 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
+github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY=
+github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro=
+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=
@@ -602,25 +797,22 @@ github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJ
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.6.0 h1:IinKAryFFuPONZ7cm6T6E2QX/vcJwSnlaA5lfoaXIiQ=
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/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo=
+github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU=
+github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek=
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/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU=
+github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d h1:htwtWgtQo8YS6JFWWi2DNgY0RwSGJ1ruMoxY6CUUclk=
+github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4=
github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc=
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
+github.com/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=
@@ -636,8 +828,6 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn
github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og=
github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
-github.com/prometheus/client_golang v1.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=
@@ -648,50 +838,37 @@ github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T
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/common v0.40.0 h1:Afz7EVRqGg2Mqqf4JuF9vdvp1pi220m55Pi9T2JnO4Q=
+github.com/prometheus/common v0.40.0/go.mod h1:L65ZJPSmfn/UBWLQIHV7dBrKFidB/wPlF1y5TlSt9OE=
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/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI=
+github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY=
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/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/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho=
+github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M=
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 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
-github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
+github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
+github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
+github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
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/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo=
+github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
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=
@@ -700,8 +877,6 @@ github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0
github.com/sasha-s/go-deadlock v0.3.1 h1:sqv7fDNShgjcaxkO0JNcOAlr8B9+cV5Ey/OB71efZx0=
github.com/sasha-s/go-deadlock v0.3.1/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
-github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY=
-github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
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=
@@ -718,15 +893,15 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO
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/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk=
+github.com/spf13/afero v1.9.3/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.0 h1:42a0n6jwCot1pUmomAp4T7DeMD+20LFv4Q54pxLf2LI=
-github.com/spf13/cobra v1.6.0/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY=
+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=
@@ -735,11 +910,8 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn
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/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q=
-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/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU=
+github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA=
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=
@@ -755,47 +927,40 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/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/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8=
+github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
+github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs=
+github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48=
+github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok=
+github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8=
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/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/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg=
+github.com/tidwall/btree v1.6.0 h1:LDZfKfQIBHGHWSwckhXI0RPSXzlo+KYdjK7FWSqOzzg=
+github.com/tidwall/btree v1.6.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY=
github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
-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.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=
-github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
+github.com/ugorji/go v1.2.7 h1:qYhyWUUd6WbiM+C6JZAUkIJt/1WrjzNHY9+KCIjVqTo=
+github.com/ugorji/go v1.2.7/go.mod h1:nF9osbDWLy6bDVv/Rtoh6QgnvNDpmCalQV5urGCCS6M=
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
-github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=
-github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
+github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0=
+github.com/ugorji/go/codec v1.2.7/go.mod h1:WGN1fab3R1fzQlVQTkfxVtIBhWDRqOviHU95kRgeqEY=
+github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
+github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8=
+github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
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/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/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/ybbus/jsonrpc v2.1.2+incompatible/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE=
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.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=
@@ -812,6 +977,10 @@ 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.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
+go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
+go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
+go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
@@ -820,31 +989,26 @@ go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+
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=
-golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
-golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
-golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
-golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
+golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
+golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
-golang.org/x/crypto v0.2.0 h1:BRXPfhNivWL5Yq0BGQ39a2sW6t44aODpfxkWjYdzewE=
-golang.org/x/crypto v0.2.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
+golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc=
+golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
-golang.org/x/exp v0.0.0-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=
@@ -853,10 +1017,11 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw=
-golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e h1:+WEEuIdZHnUeJJmEUjyYC2gfUMj69yZXw17EnHg/otA=
-golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e/go.mod h1:Kr81I6Kryrl9sr8s2FK3vxD90NdsKWRuOIl2O4CvYbA=
+golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb h1:PaBZQdo+iSDyHT053FjUCgZQ/9uqVwPOcl7KSWhKn6w=
+golang.org/x/exp v0.0.0-20230213192124-5e25df0256eb/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
+golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
@@ -867,23 +1032,23 @@ golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRu
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.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I=
-golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
+golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
-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=
@@ -916,20 +1081,33 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/
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-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
+golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
+golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc=
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
-golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
+golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
-golang.org/x/net v0.2.0 h1:sZfSu1wtKLGlWI4ZZayP0ck9Y73K1ynO6gqzTdBVdPU=
-golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
+golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
+golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
+golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
+golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
+golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
+golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
+golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
+golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
+golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
+golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
+golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g=
+golang.org/x/net v0.7.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=
@@ -939,8 +1117,24 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ
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-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
+golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/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-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
+golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
+golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
+golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
+golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
+golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc=
+golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE=
+golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2/go.mod h1:jaDAt6Dkxork7LmZnYtzbRWj0W47D86a3TGe0YHBvmE=
+golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
+golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
+golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
+golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A=
+golang.org/x/oauth2 v0.5.0 h1:HuArIo48skDwlrvM3sEdHXElYslAMsf3KwRkkW4MC4s=
+golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I=
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=
@@ -951,7 +1145,12 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ
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-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
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=
@@ -981,7 +1180,6 @@ golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7w
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=
@@ -993,42 +1191,66 @@ golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7w
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-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/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-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210603125802-9665404d3644/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-20210616094352-59db8d763f22/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-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210819135213-f52c844e1c1c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20211210111614-af8b64212486/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-20220128215802-99c3d69c2c27/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-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/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-20220610221304-9f5ed59c137d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/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.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A=
-golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.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.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM=
-golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
+golang.org/x/term v0.1.0/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=
@@ -1038,13 +1260,18 @@ 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.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
+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/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
@@ -1069,7 +1296,6 @@ golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
-golang.org/x/tools v0.0.0-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-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
@@ -1090,20 +1316,30 @@ golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE=
-golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/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-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.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE=
+golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
+golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
+golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
+golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
+golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
+golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
+golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM=
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=
+golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
+golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk=
+golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8=
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=
@@ -1124,12 +1360,45 @@ google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz513
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/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU=
+google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94=
+google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo=
+google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4=
+google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw=
+google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU=
+google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k=
+google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
+google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE=
+google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI=
+google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I=
+google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo=
+google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g=
+google.golang.org/api v0.70.0/go.mod h1:Bs4ZM2HGifEvXwd50TtW70ovgJffJYw2oRCOFU/SkfA=
+google.golang.org/api v0.71.0/go.mod h1:4PyU6e6JogV1f9eA4voyrTY2batOLdgZ5qZ5HOCc4j8=
+google.golang.org/api v0.74.0/go.mod h1:ZpfMZOVRMywNyvJFeqL9HRWBgAuRfSjJFpe9QtRRyDs=
+google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA=
+google.golang.org/api v0.77.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69ljA=
+google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw=
+google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg=
+google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o=
+google.golang.org/api v0.85.0/go.mod h1:AqZf8Ep9uZ2pyTvgL+x0D3Zt0eoT9b5E8fmzfu6FO2g=
+google.golang.org/api v0.90.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw=
+google.golang.org/api v0.93.0/go.mod h1:+Sem1dnrKlrXMR/X0bPnMWyluQe4RsNoYfmNLhOIkzw=
+google.golang.org/api v0.95.0/go.mod h1:eADj+UBuxkh5zlrSntJghuNeg8HwQ1w5lTKkuqaETEI=
+google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s=
+google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s=
+google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s=
+google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70=
+google.golang.org/api v0.110.0 h1:l+rh0KYUooe9JGbGVx71tbFo4SMbMTXK3I3ia2QSEeU=
+google.golang.org/api v0.110.0/go.mod h1:7FC4Vvx1Mooxh8C5HWjzZHcavuS2f6pmJpZx60ca7iI=
+google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
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 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
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=
@@ -1153,7 +1422,6 @@ google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfG
google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
-google.golang.org/genproto v0.0.0-20200324203455-a04cca1dde73/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
@@ -1172,11 +1440,120 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D
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-20210222152913-aa3ee6e6a81c/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-20221024183307-1bc688fe9f3e h1:S9GbmC1iCgvbLyAokVCwiO6tVIrU9Y7c5oMx1V/ki/Y=
-google.golang.org/genproto v0.0.0-20221024183307-1bc688fe9f3e/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s=
-google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o=
+google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/genproto v0.0.0-20210329143202-679c6ae281ee/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
+google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A=
+google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A=
+google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
+google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
+google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0=
+google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24=
+google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k=
+google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k=
+google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48=
+google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48=
+google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w=
+google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
+google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
+google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
+google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
+google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY=
+google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
+google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
+google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
+google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
+google.golang.org/genproto v0.0.0-20211221195035-429b39de9b1c/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
+google.golang.org/genproto v0.0.0-20220126215142-9970aeb2e350/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
+google.golang.org/genproto v0.0.0-20220207164111-0872dc986b00/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
+google.golang.org/genproto v0.0.0-20220218161850-94dd64e39d7c/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
+google.golang.org/genproto v0.0.0-20220222213610-43724f9ea8cf/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
+google.golang.org/genproto v0.0.0-20220304144024-325a89244dc8/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
+google.golang.org/genproto v0.0.0-20220310185008-1973136f34c6/go.mod h1:kGP+zUP2Ddo0ayMi4YuN7C3WZyJvGLZRh8Z5wnAqvEI=
+google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E=
+google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E=
+google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
+google.golang.org/genproto v0.0.0-20220413183235-5e96e2839df9/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
+google.golang.org/genproto v0.0.0-20220414192740-2d67ff6cf2b4/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
+google.golang.org/genproto v0.0.0-20220421151946-72621c1f0bd3/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
+google.golang.org/genproto v0.0.0-20220429170224-98d788798c3e/go.mod h1:8w6bsBMX6yCPbAVTeqQHvzxW0EIFigd5lZyahWgyfDo=
+google.golang.org/genproto v0.0.0-20220502173005-c8bf987b8c21/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
+google.golang.org/genproto v0.0.0-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
+google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
+google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4=
+google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
+google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
+google.golang.org/genproto v0.0.0-20220617124728-180714bec0ad/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
+google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
+google.golang.org/genproto v0.0.0-20220628213854-d9e0b6570c03/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA=
+google.golang.org/genproto v0.0.0-20220722212130-b98a9ff5e252/go.mod h1:GkXuJDJ6aQ7lnJcRF+SJVgFdQhypqgl3LB1C9vabdRE=
+google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f/go.mod h1:iHe1svFLAZg9VWz891+QbRMwUv9O/1Ww+/mngYeThbc=
+google.golang.org/genproto v0.0.0-20220815135757-37a418bb8959/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk=
+google.golang.org/genproto v0.0.0-20220817144833-d7fd3f11b9b1/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk=
+google.golang.org/genproto v0.0.0-20220822174746-9e6da59bd2fc/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk=
+google.golang.org/genproto v0.0.0-20220829144015-23454907ede3/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk=
+google.golang.org/genproto v0.0.0-20220829175752-36a9c930ecbf/go.mod h1:dbqgFATTzChvnt+ujMdZwITVAJHFtfyN1qUhDqEiIlk=
+google.golang.org/genproto v0.0.0-20220913154956-18f8339a66a5/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo=
+google.golang.org/genproto v0.0.0-20220914142337-ca0e39ece12f/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo=
+google.golang.org/genproto v0.0.0-20220915135415-7fd63a7952de/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo=
+google.golang.org/genproto v0.0.0-20220916172020-2692e8806bfa/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo=
+google.golang.org/genproto v0.0.0-20220919141832-68c03719ef51/go.mod h1:0Nb8Qy+Sk5eDzHnzlStwW3itdNaWoZA5XeSG+R3JHSo=
+google.golang.org/genproto v0.0.0-20220920201722-2b89144ce006/go.mod h1:ht8XFiar2npT/g4vkk7O0WYS1sHOHbdujxbEp7CJWbw=
+google.golang.org/genproto v0.0.0-20220926165614-551eb538f295/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI=
+google.golang.org/genproto v0.0.0-20220926220553-6981cbe3cfce/go.mod h1:woMGP53BroOrRY3xTxlbr8Y3eB/nzAvvFM83q7kG2OI=
+google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U=
+google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM=
+google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM=
+google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s=
+google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44 h1:EfLuoKW5WfkgVdDy7dTK8qSbH37AX5mj/MFh+bGPz14=
+google.golang.org/genproto v0.0.0-20230216225411-c8e22ba71e44/go.mod h1:8B0gmkoRebU8ukX6HP+4wrVQUY1+6PkQ44BSyIlflHA=
+google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
+google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
+google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM=
+google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
+google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
+google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
+google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
+google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
+google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
+google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
+google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
+google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
+google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
+google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
+google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
+google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
+google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
+google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
+google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
+google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
+google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
+google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
+google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
+google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
+google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
+google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
+google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
+google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
+google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE=
+google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
+google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
+google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
+google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ=
+google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
+google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
+google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
+google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk=
+google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
+google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
+google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI=
+google.golang.org/grpc v1.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc=
+google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw=
+google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
@@ -1189,26 +1566,28 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj
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=
+google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
+google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
+google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
+google.golang.org/protobuf v1.28.2-0.20230208135220-49eaa78c6c9c h1:gDe3xeLH/W6iv5d9xQBo6IwJbCdVcZRiV8xuix6FJW8=
+google.golang.org/protobuf v1.28.2-0.20230208135220-49eaa78c6c9c/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-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U=
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/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
+gopkg.in/cheggaaa/pb.v1 v1.0.27/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/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
-gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c=
-gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
-gopkg.in/urfave/cli.v1 v1.20.0/go.mod h1:vuBzUtMdQeixQj8LVd+/98pzhxNGQoyuPBlsXHOQNO0=
gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
@@ -1224,7 +1603,9 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
+gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
+gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o=
+honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
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=
@@ -1234,8 +1615,12 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
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=
+pgregory.net/rapid v0.5.5/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
+sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
+sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU=
diff --git a/proto/buf.yaml b/proto/buf.yaml
index 9c12bd28b7..1986ac1f6f 100644
--- a/proto/buf.yaml
+++ b/proto/buf.yaml
@@ -1,8 +1,3 @@
-# Generated by "buf config migrate-v1beta1". Edit as necessary, and
-# remove this comment when you're finished.
-#
-# This module represents the "proto" root found in
-# the previous configuration.
version: v1
name: buf.build/cosmwasm/wasmd
deps:
diff --git a/proto/cosmwasm/tokenfactory/v1beta1/authorityMetadata.proto b/proto/cosmwasm/tokenfactory/v1beta1/authorityMetadata.proto
new file mode 100644
index 0000000000..4de2fec8ea
--- /dev/null
+++ b/proto/cosmwasm/tokenfactory/v1beta1/authorityMetadata.proto
@@ -0,0 +1,17 @@
+syntax = "proto3";
+package cosmwasm.tokenfactory.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmos/base/v1beta1/coin.proto";
+
+option go_package = "github.com/CosmWasm/wasmd/x/tokenfactory/types";
+
+// DenomAuthorityMetadata specifies metadata for addresses that have specific
+// capabilities over a token factory denom. Right now there is only one Admin
+// permission, but is planned to be extended to the future.
+message DenomAuthorityMetadata {
+ option (gogoproto.equal) = true;
+
+ // Can be empty for no admin, or a valid osmosis address
+ string admin = 1 [ (gogoproto.moretags) = "yaml:\"admin\"" ];
+}
diff --git a/proto/cosmwasm/tokenfactory/v1beta1/genesis.proto b/proto/cosmwasm/tokenfactory/v1beta1/genesis.proto
new file mode 100644
index 0000000000..18e30511b8
--- /dev/null
+++ b/proto/cosmwasm/tokenfactory/v1beta1/genesis.proto
@@ -0,0 +1,32 @@
+syntax = "proto3";
+package cosmwasm.tokenfactory.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmwasm/tokenfactory/v1beta1/authorityMetadata.proto";
+import "cosmwasm/tokenfactory/v1beta1/params.proto";
+
+option go_package = "github.com/CosmWasm/wasmd/x/tokenfactory/types";
+
+// GenesisState defines the tokenfactory module's genesis state.
+message GenesisState {
+ // params defines the paramaters of the module.
+ Params params = 1 [ (gogoproto.nullable) = false ];
+
+ repeated GenesisDenom factory_denoms = 2 [
+ (gogoproto.moretags) = "yaml:\"factory_denoms\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// GenesisDenom defines a tokenfactory denom that is defined within genesis
+// state. The structure contains DenomAuthorityMetadata which defines the
+// denom's admin.
+message GenesisDenom {
+ option (gogoproto.equal) = true;
+
+ string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ];
+ DenomAuthorityMetadata authority_metadata = 2 [
+ (gogoproto.moretags) = "yaml:\"authority_metadata\"",
+ (gogoproto.nullable) = false
+ ];
+}
diff --git a/proto/cosmwasm/tokenfactory/v1beta1/params.proto b/proto/cosmwasm/tokenfactory/v1beta1/params.proto
new file mode 100644
index 0000000000..7522e36569
--- /dev/null
+++ b/proto/cosmwasm/tokenfactory/v1beta1/params.proto
@@ -0,0 +1,18 @@
+syntax = "proto3";
+package cosmwasm.tokenfactory.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmwasm/tokenfactory/v1beta1/authorityMetadata.proto";
+import "cosmos_proto/cosmos.proto";
+import "cosmos/base/v1beta1/coin.proto";
+
+option go_package = "github.com/CosmWasm/wasmd/x/tokenfactory/types";
+
+// Params defines the parameters for the tokenfactory module.
+message Params {
+ repeated cosmos.base.v1beta1.Coin denom_creation_fee = 1 [
+ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
+ (gogoproto.moretags) = "yaml:\"denom_creation_fee\"",
+ (gogoproto.nullable) = false
+ ];
+}
diff --git a/proto/cosmwasm/tokenfactory/v1beta1/query.proto b/proto/cosmwasm/tokenfactory/v1beta1/query.proto
new file mode 100644
index 0000000000..d8603f45cf
--- /dev/null
+++ b/proto/cosmwasm/tokenfactory/v1beta1/query.proto
@@ -0,0 +1,71 @@
+syntax = "proto3";
+package cosmwasm.tokenfactory.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "google/api/annotations.proto";
+import "cosmos/base/query/v1beta1/pagination.proto";
+import "cosmwasm/tokenfactory/v1beta1/authorityMetadata.proto";
+import "cosmwasm/tokenfactory/v1beta1/params.proto";
+
+option go_package = "github.com/CosmWasm/wasmd/x/tokenfactory/types";
+
+// Query defines the gRPC querier service.
+service Query {
+ // Params defines a gRPC query method that returns the tokenfactory module's
+ // parameters.
+ rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
+ option (google.api.http).get = "/osmosis/tokenfactory/v1beta1/params";
+ }
+
+ // DenomAuthorityMetadata defines a gRPC query method for fetching
+ // DenomAuthorityMetadata for a particular denom.
+ rpc DenomAuthorityMetadata(QueryDenomAuthorityMetadataRequest)
+ returns (QueryDenomAuthorityMetadataResponse) {
+ option (google.api.http).get =
+ "/osmosis/tokenfactory/v1beta1/denoms/{denom}/authority_metadata";
+ }
+
+ // DenomsFromCreator defines a gRPC query method for fetching all
+ // denominations created by a specific admin/creator.
+ rpc DenomsFromCreator(QueryDenomsFromCreatorRequest)
+ returns (QueryDenomsFromCreatorResponse) {
+ option (google.api.http).get =
+ "/osmosis/tokenfactory/v1beta1/denoms_from_creator/{creator}";
+ }
+}
+
+// QueryParamsRequest is the request type for the Query/Params RPC method.
+message QueryParamsRequest {}
+
+// QueryParamsResponse is the response type for the Query/Params RPC method.
+message QueryParamsResponse {
+ // params defines the parameters of the module.
+ Params params = 1 [ (gogoproto.nullable) = false ];
+}
+
+// QueryDenomAuthorityMetadataRequest defines the request structure for the
+// DenomAuthorityMetadata gRPC query.
+message QueryDenomAuthorityMetadataRequest {
+ string denom = 1 [ (gogoproto.moretags) = "yaml:\"denom\"" ];
+}
+
+// QueryDenomAuthorityMetadataResponse defines the response structure for the
+// DenomAuthorityMetadata gRPC query.
+message QueryDenomAuthorityMetadataResponse {
+ DenomAuthorityMetadata authority_metadata = 1 [
+ (gogoproto.moretags) = "yaml:\"authority_metadata\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// QueryDenomsFromCreatorRequest defines the request structure for the
+// DenomsFromCreator gRPC query.
+message QueryDenomsFromCreatorRequest {
+ string creator = 1 [ (gogoproto.moretags) = "yaml:\"creator\"" ];
+}
+
+// QueryDenomsFromCreatorRequest defines the response structure for the
+// DenomsFromCreator gRPC query.
+message QueryDenomsFromCreatorResponse {
+ repeated string denoms = 1 [ (gogoproto.moretags) = "yaml:\"denoms\"" ];
+}
diff --git a/proto/cosmwasm/tokenfactory/v1beta1/tx.proto b/proto/cosmwasm/tokenfactory/v1beta1/tx.proto
new file mode 100644
index 0000000000..2cc984dda0
--- /dev/null
+++ b/proto/cosmwasm/tokenfactory/v1beta1/tx.proto
@@ -0,0 +1,108 @@
+syntax = "proto3";
+package cosmwasm.tokenfactory.v1beta1;
+
+import "gogoproto/gogo.proto";
+import "cosmos/base/v1beta1/coin.proto";
+import "cosmos/bank/v1beta1/bank.proto";
+
+option go_package = "github.com/CosmWasm/wasmd/x/tokenfactory/types";
+
+// Msg defines the tokefactory module's gRPC message service.
+service Msg {
+ rpc CreateDenom(MsgCreateDenom) returns (MsgCreateDenomResponse);
+ rpc Mint(MsgMint) returns (MsgMintResponse);
+ rpc Burn(MsgBurn) returns (MsgBurnResponse);
+ rpc ChangeAdmin(MsgChangeAdmin) returns (MsgChangeAdminResponse);
+ rpc SetDenomMetadata(MsgSetDenomMetadata)
+ returns (MsgSetDenomMetadataResponse);
+
+ // ForceTransfer is deactivated for now because we need to think through edge
+ // cases rpc ForceTransfer(MsgForceTransfer) returns
+ // (MsgForceTransferResponse);
+}
+
+// MsgCreateDenom defines the message structure for the CreateDenom gRPC service
+// method. It allows an account to create a new denom. It requires a sender
+// address and a sub denomination. The (sender_address, sub_denomination) tuple
+// must be unique and cannot be re-used.
+//
+// The resulting denom created is defined as
+// . The resulting denom's admin is
+// originally set to be the creator, but this can be changed later. The token
+// denom does not indicate the current admin.
+message MsgCreateDenom {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ // subdenom can be up to 44 "alphanumeric" characters long.
+ string subdenom = 2 [ (gogoproto.moretags) = "yaml:\"subdenom\"" ];
+}
+
+// MsgCreateDenomResponse is the return value of MsgCreateDenom
+// It returns the full string of the newly created denom
+message MsgCreateDenomResponse {
+ string new_token_denom = 1
+ [ (gogoproto.moretags) = "yaml:\"new_token_denom\"" ];
+}
+
+// MsgMint is the sdk.Msg type for allowing an admin account to mint
+// more of a token. For now, we only support minting to the sender account
+message MsgMint {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ cosmos.base.v1beta1.Coin amount = 2 [
+ (gogoproto.moretags) = "yaml:\"amount\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+message MsgMintResponse {}
+
+// MsgBurn is the sdk.Msg type for allowing an admin account to burn
+// a token. For now, we only support burning from the sender account.
+message MsgBurn {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ cosmos.base.v1beta1.Coin amount = 2 [
+ (gogoproto.moretags) = "yaml:\"amount\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+message MsgBurnResponse {}
+
+// MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign
+// adminship of a denom to a new account
+message MsgChangeAdmin {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ string denom = 2 [ (gogoproto.moretags) = "yaml:\"denom\"" ];
+ string new_admin = 3 [ (gogoproto.moretags) = "yaml:\"new_admin\"" ];
+}
+
+// MsgChangeAdminResponse defines the response structure for an executed
+// MsgChangeAdmin message.
+message MsgChangeAdminResponse {}
+
+// message MsgForceTransfer {
+// string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+// cosmos.base.v1beta1.Coin amount = 2 [
+// (gogoproto.moretags) = "yaml:\"amount\"",
+// (gogoproto.nullable) = false
+// ];
+// string transferFromAddress = 3
+// [ (gogoproto.moretags) = "yaml:\"transfer_from_address\"" ];
+// string transferToAddress = 4
+// [ (gogoproto.moretags) = "yaml:\"transfer_to_address\"" ];
+// }
+
+// message MsgForceTransferResponse {}
+
+// MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set
+// the denom's bank metadata
+message MsgSetDenomMetadata {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ cosmos.bank.v1beta1.Metadata metadata = 2 [
+ (gogoproto.moretags) = "yaml:\"metadata\"",
+ (gogoproto.nullable) = false
+ ];
+}
+
+// MsgSetDenomMetadataResponse defines the response structure for an executed
+// MsgSetDenomMetadata message.
+message MsgSetDenomMetadataResponse {}
\ No newline at end of file
diff --git a/proto/cosmwasm/wasm/v1/query.proto b/proto/cosmwasm/wasm/v1/query.proto
index ffe48d2429..bc94f84087 100644
--- a/proto/cosmwasm/wasm/v1/query.proto
+++ b/proto/cosmwasm/wasm/v1/query.proto
@@ -192,7 +192,7 @@ message CodeInfoResponse {
string creator = 2;
bytes data_hash = 3
[ (gogoproto.casttype) =
- "github.com/tendermint/tendermint/libs/bytes.HexBytes" ];
+ "github.com/cometbft/cometbft/libs/bytes.HexBytes" ];
// Used in v1beta1
reserved 4, 5;
AccessConfig instantiate_permission = 6 [ (gogoproto.nullable) = false ];
@@ -229,8 +229,7 @@ message QueryPinnedCodesRequest {
// QueryPinnedCodesResponse is the response type for the
// Query/PinnedCodes RPC method
message QueryPinnedCodesResponse {
- repeated uint64 code_ids = 1
- [ (gogoproto.nullable) = false, (gogoproto.customname) = "CodeIDs" ];
+ repeated uint64 code_ids = 1 [ (gogoproto.customname) = "CodeIDs" ];
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
diff --git a/proto/cosmwasm/wasm/v1/tx.proto b/proto/cosmwasm/wasm/v1/tx.proto
index 741fbc494c..88a8df7ea8 100644
--- a/proto/cosmwasm/wasm/v1/tx.proto
+++ b/proto/cosmwasm/wasm/v1/tx.proto
@@ -2,6 +2,7 @@ syntax = "proto3";
package cosmwasm.wasm.v1;
import "cosmos/base/v1beta1/coin.proto";
+import "cosmos/msg/v1/msg.proto";
import "gogoproto/gogo.proto";
import "cosmwasm/wasm/v1/types.proto";
@@ -56,6 +57,8 @@ message MsgStoreCodeResponse {
// MsgInstantiateContract create a new smart contract instance for the given
// code id.
message MsgInstantiateContract {
+ option (cosmos.msg.v1.signer) = "sender";
+
// Sender is the that actor that signed the messages
string sender = 1;
// Admin is an optional address that can execute migrations
@@ -76,6 +79,8 @@ message MsgInstantiateContract {
// MsgInstantiateContract2 create a new smart contract instance for the given
// code id with a predicable address.
message MsgInstantiateContract2 {
+ option (cosmos.msg.v1.signer) = "sender";
+
// Sender is the that actor that signed the messages
string sender = 1;
// Admin is an optional address that can execute migrations
@@ -116,6 +121,8 @@ message MsgInstantiateContract2Response {
// MsgExecuteContract submits the given message data to a smart contract
message MsgExecuteContract {
+ option (cosmos.msg.v1.signer) = "sender";
+
// Sender is the that actor that signed the messages
string sender = 1;
// Contract is the address of the smart contract
@@ -137,6 +144,8 @@ message MsgExecuteContractResponse {
// MsgMigrateContract runs a code upgrade/ downgrade for a smart contract
message MsgMigrateContract {
+ option (cosmos.msg.v1.signer) = "sender";
+
// Sender is the that actor that signed the messages
string sender = 1;
// Contract is the address of the smart contract
@@ -156,6 +165,8 @@ message MsgMigrateContractResponse {
// MsgUpdateAdmin sets a new admin for a smart contract
message MsgUpdateAdmin {
+ option (cosmos.msg.v1.signer) = "sender";
+
// Sender is the that actor that signed the messages
string sender = 1;
// NewAdmin address to be set
@@ -169,6 +180,8 @@ message MsgUpdateAdminResponse {}
// MsgClearAdmin removes any admin stored for a smart contract
message MsgClearAdmin {
+ option (cosmos.msg.v1.signer) = "sender";
+
// Sender is the actor that signed the messages
string sender = 1;
// Contract is the address of the smart contract
@@ -180,6 +193,8 @@ message MsgClearAdminResponse {}
// MsgUpdateInstantiateConfig updates instantiate config for a smart contract
message MsgUpdateInstantiateConfig {
+ option (cosmos.msg.v1.signer) = "sender";
+
// Sender is the that actor that signed the messages
string sender = 1;
// CodeID references the stored WASM code
diff --git a/proto/cosmwasm/wasm/v1/types.proto b/proto/cosmwasm/wasm/v1/types.proto
index b68179e2e0..c29617cefd 100644
--- a/proto/cosmwasm/wasm/v1/types.proto
+++ b/proto/cosmwasm/wasm/v1/types.proto
@@ -139,7 +139,7 @@ message AbsoluteTxPosition {
message Model {
// hex-encode key to read it better (this is often ascii)
bytes key = 1 [ (gogoproto.casttype) =
- "github.com/tendermint/tendermint/libs/bytes.HexBytes" ];
+ "github.com/cometbft/cometbft/libs/bytes.HexBytes" ];
// base64-encode raw value
bytes value = 2;
}
diff --git a/tests/e2e/gov_test.go b/tests/e2e/gov_test.go
new file mode 100644
index 0000000000..5ce967da24
--- /dev/null
+++ b/tests/e2e/gov_test.go
@@ -0,0 +1,135 @@
+package e2e_test
+
+import (
+ "testing"
+ "time"
+
+ wasmvmtypes "github.com/CosmWasm/wasmvm/types"
+ "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
+ v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
+ "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
+
+ "github.com/CosmWasm/wasmd/tests/e2e"
+ "github.com/CosmWasm/wasmd/x/wasm/ibctesting"
+)
+
+func TestGovVoteByContract(t *testing.T) {
+ // Given a contract with delegation
+ // And a gov proposal
+ // When the contract sends a vote for the proposal
+ // Then the vote is taken into account
+
+ coord := ibctesting.NewCoordinator(t, 1)
+ chain := coord.GetChain(ibctesting.GetChainID(1))
+ contractAddr := e2e.InstantiateReflectContract(t, chain)
+ chain.Fund(contractAddr, sdk.NewIntFromUint64(1_000_000_000))
+ // a contract with a high delegation amount
+ delegateMsg := wasmvmtypes.CosmosMsg{
+ Staking: &wasmvmtypes.StakingMsg{
+ Delegate: &wasmvmtypes.DelegateMsg{
+ Validator: sdk.ValAddress(chain.Vals.Validators[0].Address).String(),
+ Amount: wasmvmtypes.Coin{
+ Denom: sdk.DefaultBondDenom,
+ Amount: "1000000000",
+ },
+ },
+ },
+ }
+ e2e.MustExecViaReflectContract(t, chain, contractAddr, delegateMsg)
+
+ signer := chain.SenderAccount.GetAddress().String()
+ govKeeper, accountKeeper := chain.App.GovKeeper, chain.App.AccountKeeper
+ communityPoolBalance := chain.Balance(accountKeeper.GetModuleAccount(chain.GetContext(), distributiontypes.ModuleName).GetAddress(), sdk.DefaultBondDenom)
+ require.False(t, communityPoolBalance.IsZero())
+
+ initialDeposit := govKeeper.GetParams(chain.GetContext()).MinDeposit
+ govAcctAddr := govKeeper.GetGovernanceAccount(chain.GetContext()).GetAddress()
+
+ specs := map[string]struct {
+ vote *wasmvmtypes.VoteMsg
+ expPass bool
+ }{
+ "yes": {
+ vote: &wasmvmtypes.VoteMsg{
+ Vote: wasmvmtypes.Yes,
+ },
+ expPass: true,
+ },
+ "no": {
+ vote: &wasmvmtypes.VoteMsg{
+ Vote: wasmvmtypes.No,
+ },
+ expPass: false,
+ },
+ "abstain": {
+ vote: &wasmvmtypes.VoteMsg{
+ Vote: wasmvmtypes.Abstain,
+ },
+ expPass: true,
+ },
+ "no with veto": {
+ vote: &wasmvmtypes.VoteMsg{
+ Vote: wasmvmtypes.NoWithVeto,
+ },
+ expPass: false,
+ },
+ }
+ for name, spec := range specs {
+ t.Run(name, func(t *testing.T) {
+ // given a unique recipient
+ recipientAddr := sdk.AccAddress(secp256k1.GenPrivKey().PubKey().Address().Bytes())
+ // and a new proposal
+ payloadMsg := &distributiontypes.MsgCommunityPoolSpend{
+ Authority: govAcctAddr.String(),
+ Recipient: recipientAddr.String(),
+ Amount: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.OneInt())),
+ }
+ msg, err := v1.NewMsgSubmitProposal(
+ []sdk.Msg{payloadMsg},
+ initialDeposit,
+ signer,
+ "",
+ "my proposal",
+ "testing",
+ )
+ require.NoError(t, err)
+ rsp, gotErr := chain.SendMsgs(msg)
+ require.NoError(t, gotErr)
+ require.Len(t, rsp.MsgResponses, 1)
+ got, ok := rsp.MsgResponses[0].GetCachedValue().(*v1.MsgSubmitProposalResponse)
+ require.True(t, ok)
+ propID := got.ProposalId
+
+ // with other delegators voted yes
+ _, err = chain.SendMsgs(v1.NewMsgVote(chain.SenderAccount.GetAddress(), propID, v1.VoteOption_VOTE_OPTION_YES, ""))
+ require.NoError(t, err)
+
+ // when contract votes
+ spec.vote.ProposalId = propID
+ voteMsg := wasmvmtypes.CosmosMsg{
+ Gov: &wasmvmtypes.GovMsg{
+ Vote: spec.vote,
+ },
+ }
+ e2e.MustExecViaReflectContract(t, chain, contractAddr, voteMsg)
+
+ // then proposal executed after voting period
+ proposal, ok := govKeeper.GetProposal(chain.GetContext(), propID)
+ require.True(t, ok)
+ coord.IncrementTimeBy(proposal.VotingEndTime.Sub(chain.GetContext().BlockTime()) + time.Minute)
+ coord.CommitBlock(chain)
+
+ // and recipient balance updated
+ recipientBalance := chain.Balance(recipientAddr, sdk.DefaultBondDenom)
+ if !spec.expPass {
+ assert.True(t, recipientBalance.IsZero())
+ return
+ }
+ expBalanceAmount := sdk.NewCoin(sdk.DefaultBondDenom, sdk.OneInt())
+ assert.Equal(t, expBalanceAmount.String(), recipientBalance.String())
+ })
+ }
+}
diff --git a/tests/e2e/grants_test.go b/tests/e2e/grants_test.go
index 0920fa0a3d..775cd20692 100644
--- a/tests/e2e/grants_test.go
+++ b/tests/e2e/grants_test.go
@@ -13,6 +13,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+ "github.com/CosmWasm/wasmd/tests/e2e"
"github.com/CosmWasm/wasmd/x/wasm/ibctesting"
"github.com/CosmWasm/wasmd/x/wasm/types"
)
@@ -26,9 +27,9 @@ func TestGrants(t *testing.T) {
// - balance A reduced (on success)
// - balance B not touched
- chain := ibctesting.NewCoordinator(t, 1).GetChain(ibctesting.GetChainID(0))
- codeID := chain.StoreCodeFile("../../x/wasm/keeper/testdata/reflect_1_1.wasm").CodeID
- contractAddr := chain.InstantiateContract(codeID, []byte(`{}`))
+ coord := ibctesting.NewCoordinator(t, 1)
+ chain := coord.GetChain(ibctesting.GetChainID(1))
+ contractAddr := e2e.InstantiateReflectContract(t, chain)
require.NotEmpty(t, contractAddr)
granterAddr := chain.SenderAccount.GetAddress()
@@ -75,7 +76,7 @@ func TestGrants(t *testing.T) {
filter: types.NewAllowAllMessagesFilter(),
senderKey: otherPrivKey,
transferAmount: myAmount,
- expErr: sdkerrors.ErrUnauthorized,
+ expErr: authz.ErrNoAuthorizationFound,
},
}
for name, spec := range specs {
@@ -84,7 +85,8 @@ func TestGrants(t *testing.T) {
grant, err := types.NewContractGrant(contractAddr, spec.limit, spec.filter)
require.NoError(t, err)
authorization := types.NewContractExecutionAuthorization(*grant)
- grantMsg, err := authz.NewMsgGrant(granterAddr, granteeAddr, authorization, time.Now().Add(time.Hour))
+ expiry := time.Now().Add(time.Hour)
+ grantMsg, err := authz.NewMsgGrant(granterAddr, granteeAddr, authorization, &expiry)
require.NoError(t, err)
_, err = chain.SendMsgs(grantMsg)
require.NoError(t, err)
@@ -103,7 +105,7 @@ func TestGrants(t *testing.T) {
// then
if spec.expErr != nil {
- require.ErrorIs(t, gotErr, spec.expErr)
+ require.True(t, spec.expErr.Is(gotErr))
assert.Equal(t, sdk.NewInt(1_000_000), chain.Balance(granteeAddr, sdk.DefaultBondDenom).Amount)
assert.Equal(t, granterStartBalance, chain.Balance(granterAddr, sdk.DefaultBondDenom).Amount)
return
diff --git a/tests/e2e/group_test.go b/tests/e2e/group_test.go
new file mode 100644
index 0000000000..5fefc20021
--- /dev/null
+++ b/tests/e2e/group_test.go
@@ -0,0 +1,71 @@
+package e2e_test
+
+import (
+ "testing"
+ "time"
+
+ "github.com/CosmWasm/wasmd/x/wasm/types"
+
+ "github.com/cometbft/cometbft/libs/rand"
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ "github.com/cosmos/cosmos-sdk/types/address"
+ banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
+ "github.com/cosmos/cosmos-sdk/x/group"
+ "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
+
+ "github.com/CosmWasm/wasmd/tests/e2e"
+ "github.com/CosmWasm/wasmd/x/wasm/ibctesting"
+)
+
+func TestGroupWithContract(t *testing.T) {
+ // Given a group with a contract as only member
+ // When contract submits a proposal with try_execute
+ // Then the payload msg is executed
+
+ coord := ibctesting.NewCoordinator(t, 1)
+ chain := coord.GetChain(ibctesting.GetChainID(1))
+ contractAddr := e2e.InstantiateReflectContract(t, chain)
+ chain.Fund(contractAddr, sdk.NewIntFromUint64(1_000_000_000))
+
+ members := []group.MemberRequest{
+ {
+ Address: contractAddr.String(),
+ Weight: "1",
+ Metadata: "my contract",
+ },
+ }
+ msg, err := group.NewMsgCreateGroupWithPolicy(
+ chain.SenderAccount.GetAddress().String(),
+ members,
+ "my group",
+ "my metadata",
+ false,
+ group.NewPercentageDecisionPolicy("1", time.Second, 0),
+ )
+ require.NoError(t, err)
+ rsp, err := chain.SendMsgs(msg)
+ require.NoError(t, err)
+
+ createRsp := rsp.MsgResponses[0].GetCachedValue().(*group.MsgCreateGroupWithPolicyResponse)
+ groupID, policyAddr := createRsp.GroupId, sdk.MustAccAddressFromBech32(createRsp.GroupPolicyAddress)
+ require.NotEmpty(t, groupID)
+ chain.Fund(policyAddr, sdk.NewIntFromUint64(1_000_000_000))
+ // and a proposal submitted
+ recipientAddr := sdk.AccAddress(rand.Bytes(address.Len))
+
+ payload := []sdk.Msg{banktypes.NewMsgSend(policyAddr, recipientAddr, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.OneInt())))}
+ propMsg, err := group.NewMsgSubmitProposal(policyAddr.String(), []string{contractAddr.String()}, payload, "my proposal", group.Exec_EXEC_TRY, "my title", "my description")
+ require.NoError(t, err)
+
+ rsp = e2e.MustExecViaStargateReflectContract(t, chain, contractAddr, propMsg)
+ bz := rsp.MsgResponses[0].GetCachedValue().(*types.MsgExecuteContractResponse).Data
+ var groupRsp group.MsgSubmitProposalResponse
+ require.NoError(t, chain.Codec.Unmarshal(bz, &groupRsp))
+ // require.NotEmpty(t, groupRsp.ProposalId)
+
+ // and coins received
+ recipientBalance := chain.Balance(recipientAddr, sdk.DefaultBondDenom)
+ expBalanceAmount := sdk.NewCoin(sdk.DefaultBondDenom, sdk.OneInt())
+ assert.Equal(t, expBalanceAmount.String(), recipientBalance.String())
+}
diff --git a/tests/e2e/ibc_fees_test.go b/tests/e2e/ibc_fees_test.go
index fa315ffe60..30fcb5b9c6 100644
--- a/tests/e2e/ibc_fees_test.go
+++ b/tests/e2e/ibc_fees_test.go
@@ -9,11 +9,11 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/address"
- ibcfee "github.com/cosmos/ibc-go/v4/modules/apps/29-fee/types"
- ibctransfertypes "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"
+ ibcfee "github.com/cosmos/ibc-go/v7/modules/apps/29-fee/types"
+ ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
+ clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
+ ibctesting "github.com/cosmos/ibc-go/v7/testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -30,8 +30,8 @@ func TestIBCFeesTransfer(t *testing.T) {
// then the relayer's payee is receiving the fee(s) on success
marshaler := app.MakeEncodingConfig().Marshaler
coord := wasmibctesting.NewCoordinator(t, 2)
- chainA := coord.GetChain(ibctesting.GetChainID(0))
- chainB := coord.GetChain(ibctesting.GetChainID(1))
+ chainA := coord.GetChain(wasmibctesting.GetChainID(1))
+ chainB := coord.GetChain(wasmibctesting.GetChainID(2))
actorChainA := sdk.AccAddress(chainA.SenderPrivKey.PubKey().Address())
actorChainB := sdk.AccAddress(chainB.SenderPrivKey.PubKey().Address())
@@ -61,7 +61,7 @@ func TestIBCFeesTransfer(t *testing.T) {
// when a transfer package is sent
transferCoin := sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(1))
- ibcPayloadMsg := ibctransfertypes.NewMsgTransfer(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, transferCoin, actorChainA.String(), receiver.String(), clienttypes.Height{}, uint64(time.Now().Add(time.Minute).UnixNano()))
+ ibcPayloadMsg := ibctransfertypes.NewMsgTransfer(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, transferCoin, actorChainA.String(), receiver.String(), clienttypes.Height{}, uint64(time.Now().Add(time.Minute).UnixNano()), "testing")
ibcPackageFee := ibcfee.NewFee(oneToken, oneToken, sdk.Coins{})
feeMsg := ibcfee.NewMsgPayPacketFee(ibcPackageFee, ibctransfertypes.PortID, path.EndpointA.ChannelID, actorChainA.String(), nil)
_, err = chainA.SendMsgs(feeMsg, ibcPayloadMsg)
@@ -86,7 +86,7 @@ func TestIBCFeesTransfer(t *testing.T) {
require.NoError(t, err)
// and transfer from B to A
- ibcPayloadMsg = ibctransfertypes.NewMsgTransfer(path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, transferCoin, actorChainB.String(), receiver.String(), clienttypes.Height{}, uint64(time.Now().Add(time.Minute).UnixNano()))
+ ibcPayloadMsg = ibctransfertypes.NewMsgTransfer(path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, transferCoin, actorChainB.String(), receiver.String(), clienttypes.Height{}, uint64(time.Now().Add(time.Minute).UnixNano()), "more testing")
ibcPackageFee = ibcfee.NewFee(oneToken, oneToken, sdk.Coins{})
feeMsg = ibcfee.NewMsgPayPacketFee(ibcPackageFee, ibctransfertypes.PortID, path.EndpointB.ChannelID, actorChainB.String(), nil)
_, err = chainB.SendMsgs(feeMsg, ibcPayloadMsg)
@@ -113,8 +113,8 @@ func TestIBCFeesWasm(t *testing.T) {
// then the relayer's payee is receiving the fee(s) on success
marshaler := app.MakeEncodingConfig().Marshaler
coord := wasmibctesting.NewCoordinator(t, 2)
- chainA := coord.GetChain(ibctesting.GetChainID(0))
- chainB := coord.GetChain(ibctesting.GetChainID(1))
+ chainA := coord.GetChain(wasmibctesting.GetChainID(1))
+ chainB := coord.GetChain(ibctesting.GetChainID(2))
actorChainA := sdk.AccAddress(chainA.SenderPrivKey.PubKey().Address())
actorChainB := sdk.AccAddress(chainB.SenderPrivKey.PubKey().Address())
@@ -192,7 +192,7 @@ func TestIBCFeesWasm(t *testing.T) {
require.NoError(t, err)
// and when sent back from chain B to A
- ibcPayloadMsg := ibctransfertypes.NewMsgTransfer(path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, gotBalance, actorChainB.String(), actorChainA.String(), clienttypes.Height{}, uint64(time.Now().Add(time.Minute).UnixNano()))
+ ibcPayloadMsg := ibctransfertypes.NewMsgTransfer(path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, gotBalance, actorChainB.String(), actorChainA.String(), clienttypes.Height{}, uint64(time.Now().Add(time.Minute).UnixNano()), "even more tests")
ibcPackageFee = ibcfee.NewFee(oneToken, oneToken, sdk.Coins{})
feeMsg = ibcfee.NewMsgPayPacketFee(ibcPackageFee, ibctransfertypes.PortID, path.EndpointB.ChannelID, actorChainB.String(), nil)
_, err = chainB.SendMsgs(feeMsg, ibcPayloadMsg)
diff --git a/tests/e2e/ica_test.go b/tests/e2e/ica_test.go
index 24c0623611..3ac2fdb88c 100644
--- a/tests/e2e/ica_test.go
+++ b/tests/e2e/ica_test.go
@@ -3,15 +3,17 @@ package e2e
import (
"bytes"
"testing"
+ "time"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/address"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
- hosttypes "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"
- channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"
- ibctesting "github.com/cosmos/ibc-go/v4/testing"
- intertxtypes "github.com/cosmos/interchain-accounts/x/inter-tx/types"
+ "github.com/cosmos/gogoproto/proto"
+ icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types"
+ hosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types"
+ icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types"
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
+ ibctesting "github.com/cosmos/ibc-go/v7/testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -26,18 +28,19 @@ func TestICA(t *testing.T) {
// then the ICA owner can submit a message via IBC
// to control their account on the host chain
coord := wasmibctesting.NewCoordinator(t, 2)
- hostChain := coord.GetChain(ibctesting.GetChainID(0))
+ hostChain := coord.GetChain(ibctesting.GetChainID(1))
hostParams := hosttypes.NewParams(true, []string{sdk.MsgTypeURL(&banktypes.MsgSend{})})
hostChain.App.ICAHostKeeper.SetParams(hostChain.GetContext(), hostParams)
- controllerChain := coord.GetChain(ibctesting.GetChainID(1))
+ controllerChain := coord.GetChain(ibctesting.GetChainID(2))
path := wasmibctesting.NewPath(controllerChain, hostChain)
coord.SetupConnections(path)
ownerAddr := sdk.AccAddress(controllerChain.SenderPrivKey.PubKey().Address())
- msg := intertxtypes.NewMsgRegisterAccount(ownerAddr.String(), path.EndpointA.ConnectionID, "")
+ msg := icacontrollertypes.NewMsgRegisterInterchainAccount(path.EndpointA.ConnectionID, ownerAddr.String(), "")
res, err := controllerChain.SendMsgs(msg)
+ require.NoError(t, err)
chanID, portID, version := parseIBCChannelEvents(t, res)
// next open channels on both sides
@@ -48,28 +51,35 @@ func TestICA(t *testing.T) {
Order: channeltypes.ORDERED,
}
path.EndpointB.ChannelConfig = &ibctesting.ChannelConfig{
- PortID: icatypes.PortID,
+ PortID: icatypes.HostPortID,
Version: icatypes.Version,
Order: channeltypes.ORDERED,
}
coord.CreateChannels(path)
// assert ICA exists on controller
- icaRsp, err := controllerChain.App.InterTxKeeper.InterchainAccount(sdk.WrapSDKContext(controllerChain.GetContext()), &intertxtypes.QueryInterchainAccountRequest{
+ icaRsp, err := controllerChain.App.ICAControllerKeeper.InterchainAccount(sdk.WrapSDKContext(controllerChain.GetContext()), &icacontrollertypes.QueryInterchainAccountRequest{
Owner: ownerAddr.String(),
ConnectionId: path.EndpointA.ConnectionID,
})
require.NoError(t, err)
- icaAddr := sdk.MustAccAddressFromBech32(icaRsp.InterchainAccountAddress)
+ icaAddr := sdk.MustAccAddressFromBech32(icaRsp.GetAddress())
hostChain.Fund(icaAddr, sdk.NewInt(1_000))
// submit a tx
targetAddr := sdk.AccAddress(bytes.Repeat([]byte{1}, address.Len))
sendCoin := sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100))
payloadMsg := banktypes.NewMsgSend(icaAddr, targetAddr, sdk.NewCoins(sendCoin))
- msg2, err := intertxtypes.NewMsgSubmitTx(payloadMsg, path.EndpointA.ConnectionID, ownerAddr.String())
+ rawPayloadData, err := icatypes.SerializeCosmosTx(controllerChain.Codec, []proto.Message{payloadMsg})
require.NoError(t, err)
- res, err = controllerChain.SendMsgs(msg2)
+ payloadPacket := icatypes.InterchainAccountPacketData{
+ Type: icatypes.EXECUTE_TX,
+ Data: rawPayloadData,
+ Memo: "testing",
+ }
+ relativeTimeout := uint64(time.Minute.Nanoseconds()) // note this is in nanoseconds
+ msgSendTx := icacontrollertypes.NewMsgSendTx(ownerAddr.String(), path.EndpointA.ConnectionID, relativeTimeout, payloadPacket)
+ _, err = controllerChain.SendMsgs(msgSendTx)
require.NoError(t, err)
assert.Equal(t, 1, len(controllerChain.PendingSendPackets))
diff --git a/tests/e2e/reflect_helper.go b/tests/e2e/reflect_helper.go
new file mode 100644
index 0000000000..c2ebcadbf2
--- /dev/null
+++ b/tests/e2e/reflect_helper.go
@@ -0,0 +1,68 @@
+package e2e
+
+import (
+ "encoding/json"
+ "testing"
+
+ wasmvmtypes "github.com/CosmWasm/wasmvm/types"
+ "github.com/cosmos/cosmos-sdk/codec"
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ "github.com/stretchr/testify/require"
+
+ "github.com/CosmWasm/wasmd/x/wasm/ibctesting"
+ "github.com/CosmWasm/wasmd/x/wasm/keeper/testdata"
+ "github.com/CosmWasm/wasmd/x/wasm/types"
+)
+
+// InstantiateReflectContract store and instantiate a reflect contract instance
+func InstantiateReflectContract(t *testing.T, chain *ibctesting.TestChain) sdk.AccAddress {
+ codeID := chain.StoreCodeFile("../../x/wasm/keeper/testdata/reflect_1_1.wasm").CodeID
+ contractAddr := chain.InstantiateContract(codeID, []byte(`{}`))
+ require.NotEmpty(t, contractAddr)
+ return contractAddr
+}
+
+// MustExecViaReflectContract submit execute message to send payload to reflect contract
+func MustExecViaReflectContract(t *testing.T, chain *ibctesting.TestChain, contractAddr sdk.AccAddress, msgs ...wasmvmtypes.CosmosMsg) *sdk.Result {
+ rsp, err := ExecViaReflectContract(t, chain, contractAddr, msgs)
+ require.NoError(t, err)
+ return rsp
+}
+
+type sdkMessageType interface {
+ codec.ProtoMarshaler
+ sdk.Msg
+}
+
+func MustExecViaStargateReflectContract[T sdkMessageType](t *testing.T, chain *ibctesting.TestChain, contractAddr sdk.AccAddress, msgs ...T) *sdk.Result {
+ vmMsgs := make([]wasmvmtypes.CosmosMsg, len(msgs))
+ for i, m := range msgs {
+ bz, err := chain.Codec.Marshal(m)
+ require.NoError(t, err)
+ vmMsgs[i] = wasmvmtypes.CosmosMsg{
+ Stargate: &wasmvmtypes.StargateMsg{
+ TypeURL: sdk.MsgTypeURL(m),
+ Value: bz,
+ },
+ }
+ }
+ rsp, err := ExecViaReflectContract(t, chain, contractAddr, vmMsgs)
+ require.NoError(t, err)
+ return rsp
+}
+
+// ExecViaReflectContract submit execute message to send payload to reflect contract
+func ExecViaReflectContract(t *testing.T, chain *ibctesting.TestChain, contractAddr sdk.AccAddress, msgs []wasmvmtypes.CosmosMsg) (*sdk.Result, error) {
+ require.NotEmpty(t, msgs)
+ reflectSend := testdata.ReflectHandleMsg{
+ Reflect: &testdata.ReflectPayload{Msgs: msgs},
+ }
+ reflectSendBz, err := json.Marshal(reflectSend)
+ require.NoError(t, err)
+ execMsg := &types.MsgExecuteContract{
+ Sender: chain.SenderAccount.GetAddress().String(),
+ Contract: contractAddr.String(),
+ Msg: reflectSendBz,
+ }
+ return chain.SendMsgs(execMsg)
+}
diff --git a/x/tokenfactory/README.md b/x/tokenfactory/README.md
new file mode 100644
index 0000000000..7d6644e456
--- /dev/null
+++ b/x/tokenfactory/README.md
@@ -0,0 +1,155 @@
+# Token Factory
+
+The tokenfactory module allows any account to create a new token with
+the name `factory/{creator address}/{subdenom}`. Because tokens are
+namespaced by creator address, this allows token minting to be
+permissionless, due to not needing to resolve name collisions. A single
+account can create multiple denoms, by providing a unique subdenom for each
+created denom. Once a denom is created, the original creator is given
+"admin" privileges over the asset. This allows them to:
+
+- Mint their denom to any account
+- Burn their denom from any account
+- Create a transfer of their denom between any two accounts
+- Change the admin. In the future, more admin capabilities may be added. Admins
+ can choose to share admin privileges with other accounts using the authz
+ module. The `ChangeAdmin` functionality, allows changing the master admin
+ account, or even setting it to `""`, meaning no account has admin privileges
+ of the asset.
+
+## Messages
+
+### CreateDenom
+
+Creates a denom of `factory/{creator address}/{subdenom}` given the denom creator
+address and the subdenom. Subdenoms can contain `[a-zA-Z0-9./]`.
+
+```go
+message MsgCreateDenom {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ string subdenom = 2 [ (gogoproto.moretags) = "yaml:\"subdenom\"" ];
+}
+```
+
+**State Modifications:**
+
+- Fund community pool with the denom creation fee from the creator address, set
+ in `Params`.
+- Set `DenomMetaData` via bank keeper.
+- Set `AuthorityMetadata` for the given denom to store the admin for the created
+ denom `factory/{creator address}/{subdenom}`. Admin is automatically set as the
+ Msg sender.
+- Add denom to the `CreatorPrefixStore`, where a state of denoms created per
+ creator is kept.
+
+### Mint
+
+Minting of a specific denom is only allowed for the current admin.
+Note, the current admin is defaulted to the creator of the denom.
+
+```go
+message MsgMint {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ cosmos.base.v1beta1.Coin amount = 2 [
+ (gogoproto.moretags) = "yaml:\"amount\"",
+ (gogoproto.nullable) = false
+ ];
+}
+```
+
+**State Modifications:**
+
+- Safety check the following
+ - Check that the denom minting is created via `tokenfactory` module
+ - Check that the sender of the message is the admin of the denom
+- Mint designated amount of tokens for the denom via `bank` module
+
+### Burn
+
+Burning of a specific denom is only allowed for the current admin.
+Note, the current admin is defaulted to the creator of the denom.
+
+```go
+message MsgBurn {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ cosmos.base.v1beta1.Coin amount = 2 [
+ (gogoproto.moretags) = "yaml:\"amount\"",
+ (gogoproto.nullable) = false
+ ];
+}
+```
+
+**State Modifications:**
+
+- Saftey check the following
+ - Check that the denom minting is created via `tokenfactory` module
+ - Check that the sender of the message is the admin of the denom
+- Burn designated amount of tokens for the denom via `bank` module
+
+### ChangeAdmin
+
+Change the admin of a denom. Note, this is only allowed to be called by the current admin of the denom.
+
+```go
+message MsgChangeAdmin {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ string denom = 2 [ (gogoproto.moretags) = "yaml:\"denom\"" ];
+ string newAdmin = 3 [ (gogoproto.moretags) = "yaml:\"new_admin\"" ];
+}
+```
+
+### SetDenomMetadata
+
+Setting of metadata for a specific denom is only allowed for the admin of the denom.
+It allows the overwriting of the denom metadata in the bank module.
+
+```go
+message MsgChangeAdmin {
+ string sender = 1 [ (gogoproto.moretags) = "yaml:\"sender\"" ];
+ cosmos.bank.v1beta1.Metadata metadata = 2 [ (gogoproto.moretags) = "yaml:\"metadata\"", (gogoproto.nullable) = false ];
+}
+```
+
+**State Modifications:**
+
+- Check that sender of the message is the admin of denom
+- Modify `AuthorityMetadata` state entry to change the admin of the denom
+
+## Expectations from the chain
+
+The chain's bech32 prefix for addresses can be at most 16 characters long.
+
+This comes from denoms having a 128 byte maximum length, enforced from the SDK,
+and us setting longest_subdenom to be 44 bytes.
+
+A token factory token's denom is: `factory/{creator address}/{subdenom}`
+
+Splitting up into sub-components, this has:
+
+- `len(factory) = 7`
+- `2 * len("/") = 2`
+- `len(longest_subdenom)`
+- `len(creator_address) = len(bech32(longest_addr_length, chain_addr_prefix))`.
+
+Longest addr length at the moment is `32 bytes`. Due to SDK error correction
+settings, this means `len(bech32(32, chain_addr_prefix)) = len(chain_addr_prefix) + 1 + 58`.
+Adding this all, we have a total length constraint of `128 = 7 + 2 + len(longest_subdenom) + len(longest_chain_addr_prefix) + 1 + 58`.
+Therefore `len(longest_subdenom) + len(longest_chain_addr_prefix) = 128 - (7 + 2 + 1 + 58) = 60`.
+
+The choice between how we standardized the split these 60 bytes between maxes
+from longest_subdenom and longest_chain_addr_prefix is somewhat arbitrary.
+Considerations going into this:
+
+- Per [BIP-0173](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#bech32)
+ the technically longest HRP for a 32 byte address ('data field') is 31 bytes.
+ (Comes from encode(data) = 59 bytes, and max length = 90 bytes)
+- subdenom should be at least 32 bytes so hashes can go into it
+- longer subdenoms are very helpful for creating human readable denoms
+- chain addresses should prefer being smaller. The longest HRP in cosmos to date is 11 bytes. (`persistence`)
+
+For explicitness, its currently set to `len(longest_subdenom) = 44` and `len(longest_chain_addr_prefix) = 16`.
+
+Please note, if the SDK increases the maximum length of a denom from 128 bytes,
+these caps should increase.
+
+So please don't make code rely on these max lengths for parsing.
diff --git a/x/tokenfactory/bindings/custom_msg_test.go b/x/tokenfactory/bindings/custom_msg_test.go
new file mode 100644
index 0000000000..649709a918
--- /dev/null
+++ b/x/tokenfactory/bindings/custom_msg_test.go
@@ -0,0 +1,275 @@
+package bindings_test
+
+import (
+ "encoding/json"
+ "fmt"
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ "github.com/CosmWasm/wasmd/x/wasm/keeper"
+ wasmvmtypes "github.com/CosmWasm/wasmvm/types"
+ sdk "github.com/cosmos/cosmos-sdk/types"
+
+ "github.com/CosmWasm/wasmd/app"
+ bindings "github.com/CosmWasm/wasmd/x/tokenfactory/bindings/types"
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+)
+
+func TestCreateDenomMsg(t *testing.T) {
+ creator := RandomAccountAddress()
+ osmosis, ctx := SetupCustomApp(t, creator)
+
+ lucky := RandomAccountAddress()
+ reflect := instantiateReflectContract(t, ctx, osmosis, lucky)
+ require.NotEmpty(t, reflect)
+
+ // Fund reflect contract with 100 base denom creation fees
+ reflectAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100)))
+ fundAccount(t, ctx, osmosis, reflect, reflectAmount)
+
+ msg := bindings.TokenMsg{CreateDenom: &bindings.CreateDenom{
+ Subdenom: "SUN",
+ }}
+ err := executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{})
+ require.NoError(t, err)
+
+ // query the denom and see if it matches
+ query := bindings.TokenQuery{
+ FullDenom: &bindings.FullDenom{
+ CreatorAddr: reflect.String(),
+ Subdenom: "SUN",
+ },
+ }
+ resp := bindings.FullDenomResponse{}
+ queryCustom(t, ctx, osmosis, reflect, query, &resp)
+
+ require.Equal(t, resp.Denom, fmt.Sprintf("factory/%s/SUN", reflect.String()))
+}
+
+func TestMintMsg(t *testing.T) {
+ creator := RandomAccountAddress()
+ osmosis, ctx := SetupCustomApp(t, creator)
+
+ lucky := RandomAccountAddress()
+ reflect := instantiateReflectContract(t, ctx, osmosis, lucky)
+ require.NotEmpty(t, reflect)
+
+ // Fund reflect contract with 100 base denom creation fees
+ reflectAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100)))
+ fundAccount(t, ctx, osmosis, reflect, reflectAmount)
+
+ // lucky was broke
+ balances := osmosis.BankKeeper.GetAllBalances(ctx, lucky)
+ require.Empty(t, balances)
+
+ // Create denom for minting
+ msg := bindings.TokenMsg{CreateDenom: &bindings.CreateDenom{
+ Subdenom: "SUN",
+ }}
+ err := executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{})
+ require.NoError(t, err)
+ sunDenom := fmt.Sprintf("factory/%s/%s", reflect.String(), msg.CreateDenom.Subdenom)
+
+ amount, ok := sdk.NewIntFromString("808010808")
+ require.True(t, ok)
+ msg = bindings.TokenMsg{MintTokens: &bindings.MintTokens{
+ Denom: sunDenom,
+ Amount: amount,
+ MintToAddress: lucky.String(),
+ }}
+ err = executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{})
+ require.NoError(t, err)
+
+ balances = osmosis.BankKeeper.GetAllBalances(ctx, lucky)
+ require.Len(t, balances, 1)
+ coin := balances[0]
+ require.Equal(t, amount, coin.Amount)
+ require.Contains(t, coin.Denom, "factory/")
+
+ // query the denom and see if it matches
+ query := bindings.TokenQuery{
+ FullDenom: &bindings.FullDenom{
+ CreatorAddr: reflect.String(),
+ Subdenom: "SUN",
+ },
+ }
+ resp := bindings.FullDenomResponse{}
+ queryCustom(t, ctx, osmosis, reflect, query, &resp)
+
+ require.Equal(t, resp.Denom, coin.Denom)
+
+ // mint the same denom again
+ err = executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{})
+ require.NoError(t, err)
+
+ balances = osmosis.BankKeeper.GetAllBalances(ctx, lucky)
+ require.Len(t, balances, 1)
+ coin = balances[0]
+ require.Equal(t, amount.MulRaw(2), coin.Amount)
+ require.Contains(t, coin.Denom, "factory/")
+
+ // query the denom and see if it matches
+ query = bindings.TokenQuery{
+ FullDenom: &bindings.FullDenom{
+ CreatorAddr: reflect.String(),
+ Subdenom: "SUN",
+ },
+ }
+ resp = bindings.FullDenomResponse{}
+ queryCustom(t, ctx, osmosis, reflect, query, &resp)
+
+ require.Equal(t, resp.Denom, coin.Denom)
+
+ // now mint another amount / denom
+ // create it first
+ msg = bindings.TokenMsg{CreateDenom: &bindings.CreateDenom{
+ Subdenom: "MOON",
+ }}
+ err = executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{})
+ require.NoError(t, err)
+ moonDenom := fmt.Sprintf("factory/%s/%s", reflect.String(), msg.CreateDenom.Subdenom)
+
+ amount = amount.SubRaw(1)
+ msg = bindings.TokenMsg{MintTokens: &bindings.MintTokens{
+ Denom: moonDenom,
+ Amount: amount,
+ MintToAddress: lucky.String(),
+ }}
+ err = executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{})
+ require.NoError(t, err)
+
+ balances = osmosis.BankKeeper.GetAllBalances(ctx, lucky)
+ require.Len(t, balances, 2)
+ coin = balances[0]
+ require.Equal(t, amount, coin.Amount)
+ require.Contains(t, coin.Denom, "factory/")
+
+ // query the denom and see if it matches
+ query = bindings.TokenQuery{
+ FullDenom: &bindings.FullDenom{
+ CreatorAddr: reflect.String(),
+ Subdenom: "MOON",
+ },
+ }
+ resp = bindings.FullDenomResponse{}
+ queryCustom(t, ctx, osmosis, reflect, query, &resp)
+
+ require.Equal(t, resp.Denom, coin.Denom)
+
+ // and check the first denom is unchanged
+ coin = balances[1]
+ require.Equal(t, amount.AddRaw(1).MulRaw(2), coin.Amount)
+ require.Contains(t, coin.Denom, "factory/")
+
+ // query the denom and see if it matches
+ query = bindings.TokenQuery{
+ FullDenom: &bindings.FullDenom{
+ CreatorAddr: reflect.String(),
+ Subdenom: "SUN",
+ },
+ }
+ resp = bindings.FullDenomResponse{}
+ queryCustom(t, ctx, osmosis, reflect, query, &resp)
+
+ require.Equal(t, resp.Denom, coin.Denom)
+}
+
+func TestBurnMsg(t *testing.T) {
+ creator := RandomAccountAddress()
+ osmosis, ctx := SetupCustomApp(t, creator)
+
+ lucky := RandomAccountAddress()
+ reflect := instantiateReflectContract(t, ctx, osmosis, lucky)
+ require.NotEmpty(t, reflect)
+
+ // Fund reflect contract with 100 base denom creation fees
+ reflectAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100)))
+ fundAccount(t, ctx, osmosis, reflect, reflectAmount)
+
+ // lucky was broke
+ balances := osmosis.BankKeeper.GetAllBalances(ctx, lucky)
+ require.Empty(t, balances)
+
+ // Create denom for minting
+ msg := bindings.TokenMsg{CreateDenom: &bindings.CreateDenom{
+ Subdenom: "SUN",
+ }}
+ err := executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{})
+ require.NoError(t, err)
+ sunDenom := fmt.Sprintf("factory/%s/%s", reflect.String(), msg.CreateDenom.Subdenom)
+
+ amount, ok := sdk.NewIntFromString("808010808")
+ require.True(t, ok)
+
+ msg = bindings.TokenMsg{MintTokens: &bindings.MintTokens{
+ Denom: sunDenom,
+ Amount: amount,
+ MintToAddress: lucky.String(),
+ }}
+ err = executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{})
+ require.NoError(t, err)
+
+ // can't burn from different address
+ msg = bindings.TokenMsg{BurnTokens: &bindings.BurnTokens{
+ Denom: sunDenom,
+ Amount: amount,
+ BurnFromAddress: lucky.String(),
+ }}
+ err = executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{})
+ require.Error(t, err)
+
+ // lucky needs to send balance to reflect contract to burn it
+ luckyBalance := osmosis.BankKeeper.GetAllBalances(ctx, lucky)
+ err = osmosis.BankKeeper.SendCoins(ctx, lucky, reflect, luckyBalance)
+ require.NoError(t, err)
+
+ msg = bindings.TokenMsg{BurnTokens: &bindings.BurnTokens{
+ Denom: sunDenom,
+ Amount: amount,
+ BurnFromAddress: reflect.String(),
+ }}
+ err = executeCustom(t, ctx, osmosis, reflect, lucky, msg, sdk.Coin{})
+ require.NoError(t, err)
+}
+
+type ReflectExec struct {
+ ReflectMsg *ReflectMsgs `json:"reflect_msg,omitempty"`
+ ReflectSubMsg *ReflectSubMsgs `json:"reflect_sub_msg,omitempty"`
+}
+
+type ReflectMsgs struct {
+ Msgs []wasmvmtypes.CosmosMsg `json:"msgs"`
+}
+
+type ReflectSubMsgs struct {
+ Msgs []wasmvmtypes.SubMsg `json:"msgs"`
+}
+
+func executeCustom(t *testing.T, ctx sdk.Context, osmosis *app.WasmApp, contract sdk.AccAddress, sender sdk.AccAddress, msg bindings.TokenMsg, funds sdk.Coin) error {
+ wrapped := bindings.TokenFactoryMsg{
+ Token: &msg,
+ }
+ customBz, err := json.Marshal(wrapped)
+ require.NoError(t, err)
+
+ reflectMsg := ReflectExec{
+ ReflectMsg: &ReflectMsgs{
+ Msgs: []wasmvmtypes.CosmosMsg{{
+ Custom: customBz,
+ }},
+ },
+ }
+ reflectBz, err := json.Marshal(reflectMsg)
+ require.NoError(t, err)
+
+ // no funds sent if amount is 0
+ var coins sdk.Coins
+ if !funds.Amount.IsNil() {
+ coins = sdk.Coins{funds}
+ }
+
+ contractKeeper := keeper.NewDefaultPermissionKeeper(osmosis.WasmKeeper)
+ _, err = contractKeeper.Execute(ctx, contract, sender, reflectBz, coins)
+ return err
+}
diff --git a/x/tokenfactory/bindings/custom_query_test.go b/x/tokenfactory/bindings/custom_query_test.go
new file mode 100644
index 0000000000..100f95912d
--- /dev/null
+++ b/x/tokenfactory/bindings/custom_query_test.go
@@ -0,0 +1,74 @@
+package bindings_test
+
+import (
+ "encoding/json"
+ "fmt"
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ wasmvmtypes "github.com/CosmWasm/wasmvm/types"
+ sdk "github.com/cosmos/cosmos-sdk/types"
+
+ "github.com/CosmWasm/wasmd/app"
+ bindings "github.com/CosmWasm/wasmd/x/tokenfactory/bindings/types"
+)
+
+func TestQueryFullDenom(t *testing.T) {
+ actor := RandomAccountAddress()
+ tokenz, ctx := SetupCustomApp(t, actor)
+
+ reflect := instantiateReflectContract(t, ctx, tokenz, actor)
+ require.NotEmpty(t, reflect)
+
+ // query full denom
+ query := bindings.TokenQuery{
+ FullDenom: &bindings.FullDenom{
+ CreatorAddr: reflect.String(),
+ Subdenom: "ustart",
+ },
+ }
+ resp := bindings.FullDenomResponse{}
+ queryCustom(t, ctx, tokenz, reflect, query, &resp)
+
+ expected := fmt.Sprintf("factory/%s/ustart", reflect.String())
+ require.EqualValues(t, expected, resp.Denom)
+}
+
+type ReflectQuery struct {
+ Chain *ChainRequest `json:"chain,omitempty"`
+}
+
+type ChainRequest struct {
+ Request wasmvmtypes.QueryRequest `json:"request"`
+}
+
+type ChainResponse struct {
+ Data []byte `json:"data"`
+}
+
+func queryCustom(t *testing.T, ctx sdk.Context, tokenz *app.WasmApp, contract sdk.AccAddress, request bindings.TokenQuery, response interface{}) {
+ wrapped := bindings.TokenFactoryQuery{
+ Token: &request,
+ }
+ msgBz, err := json.Marshal(wrapped)
+ require.NoError(t, err)
+ fmt.Println(string(msgBz))
+
+ query := ReflectQuery{
+ Chain: &ChainRequest{
+ Request: wasmvmtypes.QueryRequest{Custom: msgBz},
+ },
+ }
+ queryBz, err := json.Marshal(query)
+ require.NoError(t, err)
+ fmt.Println(string(queryBz))
+
+ resBz, err := tokenz.WasmKeeper.QuerySmart(ctx, contract, queryBz)
+ require.NoError(t, err)
+ var resp ChainResponse
+ err = json.Unmarshal(resBz, &resp)
+ require.NoError(t, err)
+ err = json.Unmarshal(resp.Data, response)
+ require.NoError(t, err)
+}
diff --git a/x/tokenfactory/bindings/helpers_test.go b/x/tokenfactory/bindings/helpers_test.go
new file mode 100644
index 0000000000..462f2136a4
--- /dev/null
+++ b/x/tokenfactory/bindings/helpers_test.go
@@ -0,0 +1,102 @@
+package bindings_test
+
+import (
+ "os"
+ "testing"
+ "time"
+
+ "github.com/stretchr/testify/require"
+
+ "github.com/cometbft/cometbft/crypto"
+ "github.com/cometbft/cometbft/crypto/ed25519"
+ tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
+
+ sdk "github.com/cosmos/cosmos-sdk/types"
+
+ "github.com/CosmWasm/wasmd/app"
+ "github.com/CosmWasm/wasmd/x/wasm"
+ "github.com/CosmWasm/wasmd/x/wasm/keeper"
+ minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
+)
+
+func CreateTestInput() (*app.WasmApp, sdk.Context) {
+ var emptyWasmOpts []wasm.Option
+
+ osmosis := app.Setup(&testing.T{}, emptyWasmOpts...)
+ ctx := osmosis.BaseApp.NewContext(false, tmproto.Header{Height: 1, ChainID: "osmosis-1", Time: time.Now().UTC()})
+ return osmosis, ctx
+}
+
+func FundAccount(t *testing.T, ctx sdk.Context, osmosis *app.WasmApp, acct sdk.AccAddress) {
+ // TODO:
+ // err := simapp.FundAccount(osmosis.BankKeeper, ctx, acct, sdk.NewCoins(
+ // sdk.NewCoin("uosmo", sdk.NewInt(10000000000)),
+ // ))
+ // require.NoError(t, err)
+}
+
+// we need to make this deterministic (same every test run), as content might affect gas costs
+func keyPubAddr() (crypto.PrivKey, crypto.PubKey, sdk.AccAddress) {
+ key := ed25519.GenPrivKey()
+ pub := key.PubKey()
+ addr := sdk.AccAddress(pub.Address())
+ return key, pub, addr
+}
+
+func RandomAccountAddress() sdk.AccAddress {
+ _, _, addr := keyPubAddr()
+ return addr
+}
+
+func RandomBech32AccountAddress() string {
+ return RandomAccountAddress().String()
+}
+
+func storeReflectCode(t *testing.T, ctx sdk.Context, tokenz *app.WasmApp, addr sdk.AccAddress) uint64 {
+ wasmCode, err := os.ReadFile("./testdata/token_reflect.wasm")
+ require.NoError(t, err)
+
+ contractKeeper := keeper.NewDefaultPermissionKeeper(tokenz.WasmKeeper)
+ codeID, _, err := contractKeeper.Create(ctx, addr, wasmCode, nil)
+ require.NoError(t, err)
+
+ return codeID
+}
+
+func instantiateReflectContract(t *testing.T, ctx sdk.Context, tokenz *app.WasmApp, funder sdk.AccAddress) sdk.AccAddress {
+ initMsgBz := []byte("{}")
+ contractKeeper := keeper.NewDefaultPermissionKeeper(tokenz.WasmKeeper)
+ codeID := uint64(1)
+ addr, _, err := contractKeeper.Instantiate(ctx, codeID, funder, funder, initMsgBz, "demo contract", nil)
+ require.NoError(t, err)
+
+ return addr
+}
+
+func fundAccount(t *testing.T, ctx sdk.Context, tokenz *app.WasmApp, addr sdk.AccAddress, coins sdk.Coins) {
+ // TODO:
+ // err := simapp.FundAccount(
+ // tokenz.BankKeeper,
+ // ctx,
+ // addr,
+ // coins,
+ // )
+
+ // require.NoError(t, err)
+ err := tokenz.BankKeeper.MintCoins(ctx, minttypes.ModuleName, coins)
+ require.NoError(t, err)
+ err = tokenz.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, addr, coins)
+ require.NoError(t, err)
+}
+
+func SetupCustomApp(t *testing.T, addr sdk.AccAddress) (*app.WasmApp, sdk.Context) {
+ tokenz, ctx := CreateTestInput()
+ wasmKeeper := tokenz.WasmKeeper
+
+ storeReflectCode(t, ctx, tokenz, addr)
+
+ cInfo := wasmKeeper.GetCodeInfo(ctx, 1)
+ require.NotNil(t, cInfo)
+
+ return tokenz, ctx
+}
diff --git a/x/tokenfactory/bindings/message_plugin.go b/x/tokenfactory/bindings/message_plugin.go
new file mode 100644
index 0000000000..606ff849a0
--- /dev/null
+++ b/x/tokenfactory/bindings/message_plugin.go
@@ -0,0 +1,319 @@
+package bindings
+
+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"
+ banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
+
+ bindingstypes "github.com/CosmWasm/wasmd/x/tokenfactory/bindings/types"
+ tokenfactorykeeper "github.com/CosmWasm/wasmd/x/tokenfactory/keeper"
+ tokenfactorytypes "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+)
+
+// CustomMessageDecorator returns decorator for custom CosmWasm bindings messages
+func CustomMessageDecorator(bank *bankkeeper.BaseKeeper, tokenFactory *tokenfactorykeeper.Keeper) func(wasmkeeper.Messenger) wasmkeeper.Messenger {
+ return func(old wasmkeeper.Messenger) wasmkeeper.Messenger {
+ return &CustomMessenger{
+ wrapped: old,
+ bank: bank,
+ tokenFactory: tokenFactory,
+ }
+ }
+}
+
+type CustomMessenger struct {
+ wrapped wasmkeeper.Messenger
+ bank *bankkeeper.BaseKeeper
+ tokenFactory *tokenfactorykeeper.Keeper
+}
+
+var _ wasmkeeper.Messenger = (*CustomMessenger)(nil)
+
+// DispatchMsg executes on the contractMsg.
+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 bindingstypes.TokenFactoryMsg
+ if err := json.Unmarshal(msg.Custom, &contractMsg); err != nil {
+ return nil, nil, sdkerrors.Wrap(err, "token factory msg")
+ }
+ if contractMsg.Token == nil {
+ return nil, nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "nil token field")
+ }
+ tokenMsg := contractMsg.Token
+
+ if tokenMsg.CreateDenom != nil {
+ return m.createDenom(ctx, contractAddr, tokenMsg.CreateDenom)
+ }
+ if tokenMsg.MintTokens != nil {
+ return m.mintTokens(ctx, contractAddr, tokenMsg.MintTokens)
+ }
+ if tokenMsg.ChangeAdmin != nil {
+ return m.changeAdmin(ctx, contractAddr, tokenMsg.ChangeAdmin)
+ }
+ if tokenMsg.BurnTokens != nil {
+ return m.burnTokens(ctx, contractAddr, tokenMsg.BurnTokens)
+ }
+ if tokenMsg.SetMetadata != nil {
+ return m.setMetadata(ctx, contractAddr, tokenMsg.SetMetadata)
+ }
+ }
+ return m.wrapped.DispatchMsg(ctx, contractAddr, contractIBCPortID, msg)
+}
+
+// createDenom creates a new token denom
+func (m *CustomMessenger) createDenom(ctx sdk.Context, contractAddr sdk.AccAddress, createDenom *bindingstypes.CreateDenom) ([]sdk.Event, [][]byte, error) {
+ bz, err := PerformCreateDenom(m.tokenFactory, m.bank, ctx, contractAddr, createDenom)
+ if err != nil {
+ return nil, nil, sdkerrors.Wrap(err, "perform create denom")
+ }
+ // TODO: double check how this is all encoded to the contract
+ return nil, [][]byte{bz}, nil
+}
+
+// PerformCreateDenom is used with createDenom to create a token denom; validates the msgCreateDenom.
+func PerformCreateDenom(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, ctx sdk.Context, contractAddr sdk.AccAddress, createDenom *bindingstypes.CreateDenom) ([]byte, error) {
+ if createDenom == nil {
+ return nil, wasmvmtypes.InvalidRequest{Err: "create denom null create denom"}
+ }
+
+ msgServer := tokenfactorykeeper.NewMsgServerImpl(*f)
+
+ msgCreateDenom := tokenfactorytypes.NewMsgCreateDenom(contractAddr.String(), createDenom.Subdenom)
+
+ if err := msgCreateDenom.ValidateBasic(); err != nil {
+ return nil, sdkerrors.Wrap(err, "failed validating MsgCreateDenom")
+ }
+
+ // Create denom
+ resp, err := msgServer.CreateDenom(
+ sdk.WrapSDKContext(ctx),
+ msgCreateDenom,
+ )
+ if err != nil {
+ return nil, sdkerrors.Wrap(err, "creating denom")
+ }
+
+ if createDenom.Metadata != nil {
+ newDenom := resp.NewTokenDenom
+ err := PerformSetMetadata(f, b, ctx, contractAddr, newDenom, *createDenom.Metadata)
+ if err != nil {
+ return nil, sdkerrors.Wrap(err, "setting metadata")
+ }
+ }
+
+ return resp.Marshal()
+}
+
+// mintTokens mints tokens of a specified denom to an address.
+func (m *CustomMessenger) mintTokens(ctx sdk.Context, contractAddr sdk.AccAddress, mint *bindingstypes.MintTokens) ([]sdk.Event, [][]byte, error) {
+ err := PerformMint(m.tokenFactory, m.bank, ctx, contractAddr, mint)
+ if err != nil {
+ return nil, nil, sdkerrors.Wrap(err, "perform mint")
+ }
+ return nil, nil, nil
+}
+
+// PerformMint used with mintTokens to validate the mint message and mint through token factory.
+func PerformMint(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, ctx sdk.Context, contractAddr sdk.AccAddress, mint *bindingstypes.MintTokens) error {
+ if mint == nil {
+ return wasmvmtypes.InvalidRequest{Err: "mint token null mint"}
+ }
+ rcpt, err := parseAddress(mint.MintToAddress)
+ if err != nil {
+ return err
+ }
+
+ coin := sdk.Coin{Denom: mint.Denom, Amount: mint.Amount}
+ sdkMsg := tokenfactorytypes.NewMsgMint(contractAddr.String(), coin)
+ if err = sdkMsg.ValidateBasic(); err != nil {
+ return err
+ }
+
+ // Mint through token factory / message server
+ msgServer := tokenfactorykeeper.NewMsgServerImpl(*f)
+ _, err = msgServer.Mint(sdk.WrapSDKContext(ctx), sdkMsg)
+ if err != nil {
+ return sdkerrors.Wrap(err, "minting coins from message")
+ }
+ err = b.SendCoins(ctx, contractAddr, rcpt, sdk.NewCoins(coin))
+ if err != nil {
+ return sdkerrors.Wrap(err, "sending newly minted coins from message")
+ }
+ return nil
+}
+
+// changeAdmin changes the admin.
+func (m *CustomMessenger) changeAdmin(ctx sdk.Context, contractAddr sdk.AccAddress, changeAdmin *bindingstypes.ChangeAdmin) ([]sdk.Event, [][]byte, error) {
+ err := ChangeAdmin(m.tokenFactory, ctx, contractAddr, changeAdmin)
+ if err != nil {
+ return nil, nil, sdkerrors.Wrap(err, "failed to change admin")
+ }
+ return nil, nil, nil
+}
+
+// ChangeAdmin is used with changeAdmin to validate changeAdmin messages and to dispatch.
+func ChangeAdmin(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, changeAdmin *bindingstypes.ChangeAdmin) error {
+ if changeAdmin == nil {
+ return wasmvmtypes.InvalidRequest{Err: "changeAdmin is nil"}
+ }
+ newAdminAddr, err := parseAddress(changeAdmin.NewAdminAddress)
+ if err != nil {
+ return err
+ }
+
+ changeAdminMsg := tokenfactorytypes.NewMsgChangeAdmin(contractAddr.String(), changeAdmin.Denom, newAdminAddr.String())
+ if err := changeAdminMsg.ValidateBasic(); err != nil {
+ return err
+ }
+
+ msgServer := tokenfactorykeeper.NewMsgServerImpl(*f)
+ _, err = msgServer.ChangeAdmin(sdk.WrapSDKContext(ctx), changeAdminMsg)
+ if err != nil {
+ return sdkerrors.Wrap(err, "failed changing admin from message")
+ }
+ return nil
+}
+
+// burnTokens burns tokens.
+func (m *CustomMessenger) burnTokens(ctx sdk.Context, contractAddr sdk.AccAddress, burn *bindingstypes.BurnTokens) ([]sdk.Event, [][]byte, error) {
+ err := PerformBurn(m.tokenFactory, ctx, contractAddr, burn)
+ if err != nil {
+ return nil, nil, sdkerrors.Wrap(err, "perform burn")
+ }
+ return nil, nil, nil
+}
+
+// PerformBurn performs token burning after validating tokenBurn message.
+func PerformBurn(f *tokenfactorykeeper.Keeper, ctx sdk.Context, contractAddr sdk.AccAddress, burn *bindingstypes.BurnTokens) error {
+ if burn == nil {
+ return wasmvmtypes.InvalidRequest{Err: "burn token null mint"}
+ }
+ if burn.BurnFromAddress != "" && burn.BurnFromAddress != contractAddr.String() {
+ return wasmvmtypes.InvalidRequest{Err: "BurnFromAddress must be \"\""}
+ }
+
+ coin := sdk.Coin{Denom: burn.Denom, Amount: burn.Amount}
+ sdkMsg := tokenfactorytypes.NewMsgBurn(contractAddr.String(), coin)
+ if err := sdkMsg.ValidateBasic(); err != nil {
+ return err
+ }
+
+ // Burn through token factory / message server
+ msgServer := tokenfactorykeeper.NewMsgServerImpl(*f)
+ _, err := msgServer.Burn(sdk.WrapSDKContext(ctx), sdkMsg)
+ if err != nil {
+ return sdkerrors.Wrap(err, "burning coins from message")
+ }
+ return nil
+}
+
+// createDenom creates a new token denom
+func (m *CustomMessenger) setMetadata(ctx sdk.Context, contractAddr sdk.AccAddress, setMetadata *bindingstypes.SetMetadata) ([]sdk.Event, [][]byte, error) {
+ err := PerformSetMetadata(m.tokenFactory, m.bank, ctx, contractAddr, setMetadata.Denom, setMetadata.Metadata)
+ if err != nil {
+ return nil, nil, sdkerrors.Wrap(err, "perform create denom")
+ }
+ return nil, nil, nil
+}
+
+// PerformSetMetadata is used with setMetadata to add new metadata
+// It also is called inside CreateDenom if optional metadata field is set
+func PerformSetMetadata(f *tokenfactorykeeper.Keeper, b *bankkeeper.BaseKeeper, ctx sdk.Context, contractAddr sdk.AccAddress, denom string, metadata bindingstypes.Metadata) error {
+ // ensure contract address is admin of denom
+ auth, err := f.GetAuthorityMetadata(ctx, denom)
+ if err != nil {
+ return err
+ }
+ if auth.Admin != contractAddr.String() {
+ return wasmvmtypes.InvalidRequest{Err: "only admin can set metadata"}
+ }
+
+ // ensure we are setting proper denom metadata (bank uses Base field, fill it if missing)
+ if metadata.Base == "" {
+ metadata.Base = denom
+ } else if metadata.Base != denom {
+ // this is the key that we set
+ return wasmvmtypes.InvalidRequest{Err: "Base must be the same as denom"}
+ }
+
+ // Create and validate the metadata
+ bankMetadata := WasmMetadataToSdk(metadata)
+ if err := bankMetadata.Validate(); err != nil {
+ return err
+ }
+
+ b.SetDenomMetaData(ctx, bankMetadata)
+ return nil
+}
+
+// GetFullDenom is a function, not method, so the message_plugin can use it
+func GetFullDenom(contract string, subDenom string) (string, error) {
+ // Address validation
+ if _, err := parseAddress(contract); err != nil {
+ return "", err
+ }
+ fullDenom, err := tokenfactorytypes.GetTokenDenom(contract, subDenom)
+ if err != nil {
+ return "", sdkerrors.Wrap(err, "validate sub-denom")
+ }
+
+ return fullDenom, nil
+}
+
+// parseAddress parses address from bech32 string and verifies its format.
+func parseAddress(addr string) (sdk.AccAddress, error) {
+ parsed, err := sdk.AccAddressFromBech32(addr)
+ if err != nil {
+ return nil, sdkerrors.Wrap(err, "address from bech32")
+ }
+ err = sdk.VerifyAddressFormat(parsed)
+ if err != nil {
+ return nil, sdkerrors.Wrap(err, "verify address format")
+ }
+ return parsed, nil
+}
+
+func WasmMetadataToSdk(metadata bindingstypes.Metadata) banktypes.Metadata {
+ denoms := []*banktypes.DenomUnit{}
+ for _, unit := range metadata.DenomUnits {
+ denoms = append(denoms, &banktypes.DenomUnit{
+ Denom: unit.Denom,
+ Exponent: unit.Exponent,
+ Aliases: unit.Aliases,
+ })
+ }
+ return banktypes.Metadata{
+ Description: metadata.Description,
+ Display: metadata.Display,
+ Base: metadata.Base,
+ Name: metadata.Name,
+ Symbol: metadata.Symbol,
+ DenomUnits: denoms,
+ }
+}
+
+func SdkMetadataToWasm(metadata banktypes.Metadata) *bindingstypes.Metadata {
+ denoms := []bindingstypes.DenomUnit{}
+ for _, unit := range metadata.DenomUnits {
+ denoms = append(denoms, bindingstypes.DenomUnit{
+ Denom: unit.Denom,
+ Exponent: unit.Exponent,
+ Aliases: unit.Aliases,
+ })
+ }
+ return &bindingstypes.Metadata{
+ Description: metadata.Description,
+ Display: metadata.Display,
+ Base: metadata.Base,
+ Name: metadata.Name,
+ Symbol: metadata.Symbol,
+ DenomUnits: denoms,
+ }
+}
diff --git a/x/tokenfactory/bindings/queries.go b/x/tokenfactory/bindings/queries.go
new file mode 100644
index 0000000000..c13c290601
--- /dev/null
+++ b/x/tokenfactory/bindings/queries.go
@@ -0,0 +1,57 @@
+package bindings
+
+import (
+ "fmt"
+
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
+
+ bindingstypes "github.com/CosmWasm/wasmd/x/tokenfactory/bindings/types"
+ tokenfactorykeeper "github.com/CosmWasm/wasmd/x/tokenfactory/keeper"
+)
+
+type QueryPlugin struct {
+ bankKeeper *bankkeeper.BaseKeeper
+ tokenFactoryKeeper *tokenfactorykeeper.Keeper
+}
+
+// NewQueryPlugin returns a reference to a new QueryPlugin.
+func NewQueryPlugin(b *bankkeeper.BaseKeeper, tfk *tokenfactorykeeper.Keeper) *QueryPlugin {
+ return &QueryPlugin{
+ bankKeeper: b,
+ tokenFactoryKeeper: tfk,
+ }
+}
+
+// GetDenomAdmin is a query to get denom admin.
+func (qp QueryPlugin) GetDenomAdmin(ctx sdk.Context, denom string) (*bindingstypes.AdminResponse, error) {
+ metadata, err := qp.tokenFactoryKeeper.GetAuthorityMetadata(ctx, denom)
+ if err != nil {
+ return nil, fmt.Errorf("failed to get admin for denom: %s", denom)
+ }
+ return &bindingstypes.AdminResponse{Admin: metadata.Admin}, nil
+}
+
+func (qp QueryPlugin) GetDenomsByCreator(ctx sdk.Context, creator string) (*bindingstypes.DenomsByCreatorResponse, error) {
+ // TODO: validate creator address
+ denoms := qp.tokenFactoryKeeper.GetDenomsFromCreator(ctx, creator)
+ return &bindingstypes.DenomsByCreatorResponse{Denoms: denoms}, nil
+}
+
+func (qp QueryPlugin) GetMetadata(ctx sdk.Context, denom string) (*bindingstypes.MetadataResponse, error) {
+ metadata, found := qp.bankKeeper.GetDenomMetaData(ctx, denom)
+ var parsed *bindingstypes.Metadata
+ if found {
+ parsed = SdkMetadataToWasm(metadata)
+ }
+ return &bindingstypes.MetadataResponse{Metadata: parsed}, nil
+}
+
+func (qp QueryPlugin) GetParams(ctx sdk.Context) (*bindingstypes.ParamsResponse, error) {
+ params := qp.tokenFactoryKeeper.GetParams(ctx)
+ return &bindingstypes.ParamsResponse{
+ Params: bindingstypes.Params{
+ DenomCreationFee: ConvertSdkCoinsToWasmCoins(params.DenomCreationFee),
+ },
+ }, nil
+}
diff --git a/x/tokenfactory/bindings/query_plugin.go b/x/tokenfactory/bindings/query_plugin.go
new file mode 100644
index 0000000000..4ac91cf841
--- /dev/null
+++ b/x/tokenfactory/bindings/query_plugin.go
@@ -0,0 +1,122 @@
+package bindings
+
+import (
+ "encoding/json"
+ "fmt"
+
+ wasmvmtypes "github.com/CosmWasm/wasmvm/types"
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
+
+ bindingstypes "github.com/CosmWasm/wasmd/x/tokenfactory/bindings/types"
+)
+
+// CustomQuerier dispatches custom CosmWasm bindings queries.
+func CustomQuerier(qp *QueryPlugin) func(ctx sdk.Context, request json.RawMessage) ([]byte, error) {
+ return func(ctx sdk.Context, request json.RawMessage) ([]byte, error) {
+ var contractQuery bindingstypes.TokenFactoryQuery
+ if err := json.Unmarshal(request, &contractQuery); err != nil {
+ return nil, sdkerrors.Wrap(err, "osmosis query")
+ }
+ if contractQuery.Token == nil {
+ return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "nil token field")
+ }
+ tokenQuery := contractQuery.Token
+
+ switch {
+ case tokenQuery.FullDenom != nil:
+ creator := tokenQuery.FullDenom.CreatorAddr
+ subdenom := tokenQuery.FullDenom.Subdenom
+
+ fullDenom, err := GetFullDenom(creator, subdenom)
+ if err != nil {
+ return nil, sdkerrors.Wrap(err, "osmo full denom query")
+ }
+
+ res := bindingstypes.FullDenomResponse{
+ Denom: fullDenom,
+ }
+
+ bz, err := json.Marshal(res)
+ if err != nil {
+ return nil, sdkerrors.Wrap(err, "failed to marshal FullDenomResponse")
+ }
+
+ return bz, nil
+
+ case tokenQuery.Admin != nil:
+ res, err := qp.GetDenomAdmin(ctx, tokenQuery.Admin.Denom)
+ if err != nil {
+ return nil, err
+ }
+
+ bz, err := json.Marshal(res)
+ if err != nil {
+ return nil, fmt.Errorf("failed to JSON marshal AdminResponse: %w", err)
+ }
+
+ return bz, nil
+
+ case tokenQuery.Metadata != nil:
+ res, err := qp.GetMetadata(ctx, tokenQuery.Metadata.Denom)
+ if err != nil {
+ return nil, err
+ }
+
+ bz, err := json.Marshal(res)
+ if err != nil {
+ return nil, fmt.Errorf("failed to JSON marshal MetadataResponse: %w", err)
+ }
+
+ return bz, nil
+
+ case tokenQuery.DenomsByCreator != nil:
+ res, err := qp.GetDenomsByCreator(ctx, tokenQuery.DenomsByCreator.Creator)
+ if err != nil {
+ return nil, err
+ }
+
+ bz, err := json.Marshal(res)
+ if err != nil {
+ return nil, fmt.Errorf("failed to JSON marshal DenomsByCreatorResponse: %w", err)
+ }
+
+ return bz, nil
+
+ case tokenQuery.Params != nil:
+ res, err := qp.GetParams(ctx)
+ if err != nil {
+ return nil, err
+ }
+
+ bz, err := json.Marshal(res)
+ if err != nil {
+ return nil, fmt.Errorf("failed to JSON marshal ParamsResponse: %w", err)
+ }
+
+ return bz, nil
+
+ default:
+ return nil, wasmvmtypes.UnsupportedRequest{Kind: "unknown token query variant"}
+ }
+ }
+}
+
+// ConvertSdkCoinsToWasmCoins converts sdk type coins to wasm vm type coins
+func ConvertSdkCoinsToWasmCoins(coins []sdk.Coin) wasmvmtypes.Coins {
+ var toSend wasmvmtypes.Coins
+ for _, coin := range coins {
+ c := ConvertSdkCoinToWasmCoin(coin)
+ toSend = append(toSend, c)
+ }
+ return toSend
+}
+
+// ConvertSdkCoinToWasmCoin converts a sdk type coin to a wasm vm type coin
+func ConvertSdkCoinToWasmCoin(coin sdk.Coin) wasmvmtypes.Coin {
+ return wasmvmtypes.Coin{
+ Denom: coin.Denom,
+ // Note: gamm tokens have 18 decimal places, so 10^22 is common, no longer in u64 range
+ Amount: coin.Amount.String(),
+ }
+}
diff --git a/x/tokenfactory/bindings/testdata/download_releases.sh b/x/tokenfactory/bindings/testdata/download_releases.sh
new file mode 100755
index 0000000000..161a33fd26
--- /dev/null
+++ b/x/tokenfactory/bindings/testdata/download_releases.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+set -o errexit -o nounset -o pipefail
+command -v shellcheck > /dev/null && shellcheck "$0"
+
+if [ $# -ne 1 ]; then
+ echo "Usage: ./download_releases.sh RELEASE_TAG"
+ exit 1
+fi
+
+tag="$1"
+url="https://github.com/CosmWasm/token-bindings/releases/download/$tag/token_reflect.wasm"
+echo "Downloading $url ..."
+wget -O "token_reflect.wasm" "$url"
+
+rm -f version.txt
+echo "$tag" >version.txt
\ No newline at end of file
diff --git a/x/tokenfactory/bindings/testdata/token_reflect.wasm b/x/tokenfactory/bindings/testdata/token_reflect.wasm
new file mode 100644
index 0000000000..0d742e10fc
Binary files /dev/null and b/x/tokenfactory/bindings/testdata/token_reflect.wasm differ
diff --git a/x/tokenfactory/bindings/testdata/version.txt b/x/tokenfactory/bindings/testdata/version.txt
new file mode 100644
index 0000000000..b19b521185
--- /dev/null
+++ b/x/tokenfactory/bindings/testdata/version.txt
@@ -0,0 +1 @@
+v0.8.0
diff --git a/x/tokenfactory/bindings/types/msg.go b/x/tokenfactory/bindings/types/msg.go
new file mode 100644
index 0000000000..3c6cfa2049
--- /dev/null
+++ b/x/tokenfactory/bindings/types/msg.go
@@ -0,0 +1,60 @@
+package types
+
+import "cosmossdk.io/math"
+
+type TokenFactoryMsg struct {
+ Token *TokenMsg `json:"token,omitempty"`
+}
+
+type TokenMsg struct {
+ /// Contracts can create denoms, namespaced under the contract's address.
+ /// A contract may create any number of independent sub-denoms.
+ CreateDenom *CreateDenom `json:"create_denom,omitempty"`
+ /// Contracts can change the admin of a denom that they are the admin of.
+ ChangeAdmin *ChangeAdmin `json:"change_admin,omitempty"`
+ /// Contracts can mint native tokens for an existing factory denom
+ /// that they are the admin of.
+ MintTokens *MintTokens `json:"mint_tokens,omitempty"`
+ /// Contracts can burn native tokens for an existing factory denom
+ /// that they are the admin of.
+ /// Currently, the burn from address must be the admin contract.
+ BurnTokens *BurnTokens `json:"burn_tokens,omitempty"`
+ /// Sets the metadata on a denom which the contract controls
+ SetMetadata *SetMetadata `json:"set_metadata,omitempty"`
+}
+
+// CreateDenom creates a new factory denom, of denomination:
+// factory/{creating contract address}/{Subdenom}
+// Subdenom can be of length at most 44 characters, in [0-9a-zA-Z./]
+// The (creating contract address, subdenom) pair must be unique.
+// The created denom's admin is the creating contract address,
+// but this admin can be changed using the ChangeAdmin binding.
+type CreateDenom struct {
+ Subdenom string `json:"subdenom"`
+ Metadata *Metadata `json:"metadata,omitempty"`
+}
+
+// ChangeAdmin changes the admin for a factory denom.
+// If the NewAdminAddress is empty, the denom has no admin.
+type ChangeAdmin struct {
+ Denom string `json:"denom"`
+ NewAdminAddress string `json:"new_admin_address"`
+}
+
+type MintTokens struct {
+ Denom string `json:"denom"`
+ Amount math.Int `json:"amount"`
+ MintToAddress string `json:"mint_to_address"`
+}
+
+type BurnTokens struct {
+ Denom string `json:"denom"`
+ Amount math.Int `json:"amount"`
+ // BurnFromAddress must be set to "" for now.
+ BurnFromAddress string `json:"burn_from_address"`
+}
+
+type SetMetadata struct {
+ Denom string `json:"denom"`
+ Metadata Metadata `json:"metadata"`
+}
diff --git a/x/tokenfactory/bindings/types/query.go b/x/tokenfactory/bindings/types/query.go
new file mode 100644
index 0000000000..f2dab4994f
--- /dev/null
+++ b/x/tokenfactory/bindings/types/query.go
@@ -0,0 +1,59 @@
+package types
+
+type TokenFactoryQuery struct {
+ Token *TokenQuery `json:"token,omitempty"`
+}
+
+// See https://github.com/CosmWasm/token-bindings/blob/main/packages/bindings/src/query.rs
+type TokenQuery struct {
+ /// Given a subdenom minted by a contract via `OsmosisMsg::MintTokens`,
+ /// returns the full denom as used by `BankMsg::Send`.
+ FullDenom *FullDenom `json:"full_denom,omitempty"`
+ Admin *DenomAdmin `json:"admin,omitempty"`
+ Metadata *GetMetadata `json:"metadata,omitempty"`
+ DenomsByCreator *DenomsByCreator `json:"denoms_by_creator,omitempty"`
+ Params *GetParams `json:"params,omitempty"`
+}
+
+// query types
+
+type FullDenom struct {
+ CreatorAddr string `json:"creator_addr"`
+ Subdenom string `json:"subdenom"`
+}
+
+type GetMetadata struct {
+ Denom string `json:"denom"`
+}
+
+type DenomAdmin struct {
+ Denom string `json:"denom"`
+}
+
+type DenomsByCreator struct {
+ Creator string `json:"creator"`
+}
+
+type GetParams struct{}
+
+// responses
+
+type FullDenomResponse struct {
+ Denom string `json:"denom"`
+}
+
+type AdminResponse struct {
+ Admin string `json:"admin"`
+}
+
+type MetadataResponse struct {
+ Metadata *Metadata `json:"metadata,omitempty"`
+}
+
+type DenomsByCreatorResponse struct {
+ Denoms []string `json:"denoms"`
+}
+
+type ParamsResponse struct {
+ Params Params `json:"params"`
+}
diff --git a/x/tokenfactory/bindings/types/types.go b/x/tokenfactory/bindings/types/types.go
new file mode 100644
index 0000000000..2c75feebbe
--- /dev/null
+++ b/x/tokenfactory/bindings/types/types.go
@@ -0,0 +1,37 @@
+package types
+
+import (
+ wasmvmtypes "github.com/CosmWasm/wasmvm/types"
+)
+
+type Metadata struct {
+ Description string `json:"description"`
+ // DenomUnits represents the list of DenomUnit's for a given coin
+ DenomUnits []DenomUnit `json:"denom_units"`
+ // Base represents the base denom (should be the DenomUnit with exponent = 0).
+ Base string `json:"base"`
+ // Display indicates the suggested denom that should be displayed in clients.
+ Display string `json:"display"`
+ // Name defines the name of the token (eg: Cosmos Atom)
+ Name string `json:"name"`
+ // Symbol is the token symbol usually shown on exchanges (eg: ATOM).
+ // This can be the same as the display.
+ Symbol string `json:"symbol"`
+}
+
+type DenomUnit struct {
+ // Denom represents the string name of the given denom unit (e.g uatom).
+ Denom string `json:"denom"`
+ // Exponent represents power of 10 exponent that one must
+ // raise the base_denom to in order to equal the given DenomUnit's denom
+ // 1 denom = 1^exponent base_denom
+ // (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with
+ // exponent = 6, thus: 1 atom = 10^6 uatom).
+ Exponent uint32 `json:"exponent"`
+ // Aliases is a list of string aliases for the given denom
+ Aliases []string `json:"aliases"`
+}
+
+type Params struct {
+ DenomCreationFee []wasmvmtypes.Coin `json:"denom_creation_fee"`
+}
diff --git a/x/tokenfactory/bindings/validate_msg_test.go b/x/tokenfactory/bindings/validate_msg_test.go
new file mode 100644
index 0000000000..f43e0d15f8
--- /dev/null
+++ b/x/tokenfactory/bindings/validate_msg_test.go
@@ -0,0 +1,429 @@
+package bindings_test
+
+import (
+ "fmt"
+ "testing"
+
+ sdk "github.com/cosmos/cosmos-sdk/types"
+
+ wasmbinding "github.com/CosmWasm/wasmd/x/tokenfactory/bindings"
+ bindings "github.com/CosmWasm/wasmd/x/tokenfactory/bindings/types"
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+
+ "github.com/stretchr/testify/require"
+)
+
+func TestCreateDenom(t *testing.T) {
+ actor := RandomAccountAddress()
+ tokenz, ctx := SetupCustomApp(t, actor)
+
+ // Fund actor with 100 base denom creation fees
+ actorAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100)))
+ fundAccount(t, ctx, tokenz, actor, actorAmount)
+
+ specs := map[string]struct {
+ createDenom *bindings.CreateDenom
+ expErr bool
+ expPanic bool
+ }{
+ "valid sub-denom": {
+ createDenom: &bindings.CreateDenom{
+ Subdenom: "MOON",
+ },
+ },
+ "empty sub-denom": {
+ createDenom: &bindings.CreateDenom{
+ Subdenom: "",
+ },
+ expPanic: true,
+ },
+ "invalid sub-denom": {
+ createDenom: &bindings.CreateDenom{
+ Subdenom: "sub-denom@2",
+ },
+ expErr: true,
+ },
+ "null create denom": {
+ createDenom: nil,
+ expErr: true,
+ },
+ }
+ for name, spec := range specs {
+ t.Run(name, func(t *testing.T) {
+ if spec.expPanic {
+ require.Panics(t, func() {
+ _, err := wasmbinding.PerformCreateDenom(&tokenz.TokenFactoryKeeper, &tokenz.BankKeeper, ctx, actor, spec.createDenom)
+ require.Error(t, err)
+ })
+ return
+ }
+ // when
+ _, gotErr := wasmbinding.PerformCreateDenom(&tokenz.TokenFactoryKeeper, &tokenz.BankKeeper, ctx, actor, spec.createDenom)
+ // then
+ if spec.expErr {
+ require.Error(t, gotErr)
+ return
+ }
+ require.NoError(t, gotErr)
+ })
+ }
+}
+
+func TestChangeAdmin(t *testing.T) {
+ const validDenom = "validdenom"
+
+ tokenCreator := RandomAccountAddress()
+
+ specs := map[string]struct {
+ actor sdk.AccAddress
+ changeAdmin *bindings.ChangeAdmin
+
+ expErrMsg string
+ }{
+ "valid": {
+ changeAdmin: &bindings.ChangeAdmin{
+ Denom: fmt.Sprintf("factory/%s/%s", tokenCreator.String(), validDenom),
+ NewAdminAddress: RandomBech32AccountAddress(),
+ },
+ actor: tokenCreator,
+ },
+ "typo in factory in denom name": {
+ changeAdmin: &bindings.ChangeAdmin{
+ Denom: fmt.Sprintf("facory/%s/%s", tokenCreator.String(), validDenom),
+ NewAdminAddress: RandomBech32AccountAddress(),
+ },
+ actor: tokenCreator,
+ expErrMsg: "denom prefix is incorrect. Is: facory. Should be: factory: invalid denom",
+ },
+ "invalid address in denom": {
+ changeAdmin: &bindings.ChangeAdmin{
+ Denom: fmt.Sprintf("factory/%s/%s", RandomBech32AccountAddress(), validDenom),
+ NewAdminAddress: RandomBech32AccountAddress(),
+ },
+ actor: tokenCreator,
+ expErrMsg: "failed changing admin from message: unauthorized account",
+ },
+ "other denom name in 3 part name": {
+ changeAdmin: &bindings.ChangeAdmin{
+ Denom: fmt.Sprintf("factory/%s/%s", tokenCreator.String(), "invalid denom"),
+ NewAdminAddress: RandomBech32AccountAddress(),
+ },
+ actor: tokenCreator,
+ expErrMsg: fmt.Sprintf("invalid denom: factory/%s/invalid denom", tokenCreator.String()),
+ },
+ "empty denom": {
+ changeAdmin: &bindings.ChangeAdmin{
+ Denom: "",
+ NewAdminAddress: RandomBech32AccountAddress(),
+ },
+ actor: tokenCreator,
+ expErrMsg: "invalid denom: ",
+ },
+ "empty address": {
+ changeAdmin: &bindings.ChangeAdmin{
+ Denom: fmt.Sprintf("factory/%s/%s", tokenCreator.String(), validDenom),
+ NewAdminAddress: "",
+ },
+ actor: tokenCreator,
+ expErrMsg: "address from bech32: empty address string is not allowed",
+ },
+ "creator is a different address": {
+ changeAdmin: &bindings.ChangeAdmin{
+ Denom: fmt.Sprintf("factory/%s/%s", tokenCreator.String(), validDenom),
+ NewAdminAddress: RandomBech32AccountAddress(),
+ },
+ actor: RandomAccountAddress(),
+ expErrMsg: "failed changing admin from message: unauthorized account",
+ },
+ "change to the same address": {
+ changeAdmin: &bindings.ChangeAdmin{
+ Denom: fmt.Sprintf("factory/%s/%s", tokenCreator.String(), validDenom),
+ NewAdminAddress: tokenCreator.String(),
+ },
+ actor: tokenCreator,
+ },
+ "nil binding": {
+ actor: tokenCreator,
+ expErrMsg: "invalid request: changeAdmin is nil - original request: ",
+ },
+ }
+ for name, spec := range specs {
+ t.Run(name, func(t *testing.T) {
+ // Setup
+ tokenz, ctx := SetupCustomApp(t, tokenCreator)
+
+ // Fund actor with 100 base denom creation fees
+ actorAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100)))
+ fundAccount(t, ctx, tokenz, tokenCreator, actorAmount)
+
+ _, err := wasmbinding.PerformCreateDenom(&tokenz.TokenFactoryKeeper, &tokenz.BankKeeper, ctx, tokenCreator, &bindings.CreateDenom{
+ Subdenom: validDenom,
+ })
+ require.NoError(t, err)
+
+ err = wasmbinding.ChangeAdmin(&tokenz.TokenFactoryKeeper, ctx, spec.actor, spec.changeAdmin)
+ if len(spec.expErrMsg) > 0 {
+ require.Error(t, err)
+ actualErrMsg := err.Error()
+ require.Equal(t, spec.expErrMsg, actualErrMsg)
+ return
+ }
+ require.NoError(t, err)
+ })
+ }
+}
+
+func TestMint(t *testing.T) {
+ creator := RandomAccountAddress()
+ tokenz, ctx := SetupCustomApp(t, creator)
+
+ // Fund actor with 100 base denom creation fees
+ tokenCreationFeeAmt := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100)))
+ fundAccount(t, ctx, tokenz, creator, tokenCreationFeeAmt)
+
+ // Create denoms for valid mint tests
+ validDenom := bindings.CreateDenom{
+ Subdenom: "MOON",
+ }
+ _, err := wasmbinding.PerformCreateDenom(&tokenz.TokenFactoryKeeper, &tokenz.BankKeeper, ctx, creator, &validDenom)
+ require.NoError(t, err)
+
+ emptyDenom := bindings.CreateDenom{
+ Subdenom: "",
+ }
+
+ require.Panics(t, func() {
+ _, err := wasmbinding.PerformCreateDenom(&tokenz.TokenFactoryKeeper, &tokenz.BankKeeper, ctx, creator, &emptyDenom)
+ require.Error(t, err)
+ })
+ // _, err = wasmbinding.PerformCreateDenom(&tokenz.TokenFactoryKeeper, &tokenz.BankKeeper, ctx, creator, &emptyDenom)
+ // require.Error(t, err)
+
+ validDenomStr := fmt.Sprintf("factory/%s/%s", creator.String(), validDenom.Subdenom)
+ emptyDenomStr := fmt.Sprintf("factory/%s/%s", creator.String(), emptyDenom.Subdenom)
+
+ lucky := RandomAccountAddress()
+
+ // lucky was broke
+ balances := tokenz.BankKeeper.GetAllBalances(ctx, lucky)
+ require.Empty(t, balances)
+
+ amount, ok := sdk.NewIntFromString("8080")
+ require.True(t, ok)
+
+ specs := map[string]struct {
+ mint *bindings.MintTokens
+ expErr bool
+ }{
+ "valid mint": {
+ mint: &bindings.MintTokens{
+ Denom: validDenomStr,
+ Amount: amount,
+ MintToAddress: lucky.String(),
+ },
+ },
+ "empty sub-denom": {
+ mint: &bindings.MintTokens{
+ Denom: emptyDenomStr,
+ Amount: amount,
+ MintToAddress: lucky.String(),
+ },
+ expErr: true,
+ },
+ "nonexistent sub-denom": {
+ mint: &bindings.MintTokens{
+ Denom: fmt.Sprintf("factory/%s/%s", creator.String(), "SUN"),
+ Amount: amount,
+ MintToAddress: lucky.String(),
+ },
+ expErr: true,
+ },
+ "invalid sub-denom": {
+ mint: &bindings.MintTokens{
+ Denom: "sub-denom_2",
+ Amount: amount,
+ MintToAddress: lucky.String(),
+ },
+ expErr: true,
+ },
+ "zero amount": {
+ mint: &bindings.MintTokens{
+ Denom: validDenomStr,
+ Amount: sdk.ZeroInt(),
+ MintToAddress: lucky.String(),
+ },
+ expErr: true,
+ },
+ "negative amount": {
+ mint: &bindings.MintTokens{
+ Denom: validDenomStr,
+ Amount: amount.Neg(),
+ MintToAddress: lucky.String(),
+ },
+ expErr: true,
+ },
+ "empty recipient": {
+ mint: &bindings.MintTokens{
+ Denom: validDenomStr,
+ Amount: amount,
+ MintToAddress: "",
+ },
+ expErr: true,
+ },
+ "invalid recipient": {
+ mint: &bindings.MintTokens{
+ Denom: validDenomStr,
+ Amount: amount,
+ MintToAddress: "invalid",
+ },
+ expErr: true,
+ },
+ "null mint": {
+ mint: nil,
+ expErr: true,
+ },
+ }
+ for name, spec := range specs {
+ t.Run(name, func(t *testing.T) {
+ // when
+ gotErr := wasmbinding.PerformMint(&tokenz.TokenFactoryKeeper, &tokenz.BankKeeper, ctx, creator, spec.mint)
+ // then
+ if spec.expErr {
+ require.Error(t, gotErr)
+ return
+ }
+ require.NoError(t, gotErr)
+ })
+ }
+}
+
+func TestBurn(t *testing.T) {
+ creator := RandomAccountAddress()
+ tokenz, ctx := SetupCustomApp(t, creator)
+
+ // Fund actor with 100 base denom creation fees
+ tokenCreationFeeAmt := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100)))
+ fundAccount(t, ctx, tokenz, creator, tokenCreationFeeAmt)
+
+ // Create denoms for valid burn tests
+ validDenom := bindings.CreateDenom{
+ Subdenom: "MOON",
+ }
+ _, err := wasmbinding.PerformCreateDenom(&tokenz.TokenFactoryKeeper, &tokenz.BankKeeper, ctx, creator, &validDenom)
+ require.NoError(t, err)
+
+ emptyDenom := bindings.CreateDenom{
+ Subdenom: "",
+ }
+ require.Panics(t, func() {
+ _, err := wasmbinding.PerformCreateDenom(&tokenz.TokenFactoryKeeper, &tokenz.BankKeeper, ctx, creator, &emptyDenom)
+ require.Error(t, err)
+ })
+
+ lucky := RandomAccountAddress()
+
+ // lucky was broke
+ balances := tokenz.BankKeeper.GetAllBalances(ctx, lucky)
+ require.Empty(t, balances)
+
+ validDenomStr := fmt.Sprintf("factory/%s/%s", creator.String(), validDenom.Subdenom)
+ emptyDenomStr := fmt.Sprintf("factory/%s/%s", creator.String(), emptyDenom.Subdenom)
+ mintAmount, ok := sdk.NewIntFromString("8080")
+ require.True(t, ok)
+
+ specs := map[string]struct {
+ burn *bindings.BurnTokens
+ expErr bool
+ }{
+ "valid burn": {
+ burn: &bindings.BurnTokens{
+ Denom: validDenomStr,
+ Amount: mintAmount,
+ BurnFromAddress: creator.String(),
+ },
+ expErr: false,
+ },
+ "non admin address": {
+ burn: &bindings.BurnTokens{
+ Denom: validDenomStr,
+ Amount: mintAmount,
+ BurnFromAddress: lucky.String(),
+ },
+ expErr: true,
+ },
+ "empty sub-denom": {
+ burn: &bindings.BurnTokens{
+ Denom: emptyDenomStr,
+ Amount: mintAmount,
+ BurnFromAddress: creator.String(),
+ },
+ expErr: true,
+ },
+ "invalid sub-denom": {
+ burn: &bindings.BurnTokens{
+ Denom: "sub-denom_2",
+ Amount: mintAmount,
+ BurnFromAddress: creator.String(),
+ },
+ expErr: true,
+ },
+ "non-minted denom": {
+ burn: &bindings.BurnTokens{
+ Denom: fmt.Sprintf("factory/%s/%s", creator.String(), "SUN"),
+ Amount: mintAmount,
+ BurnFromAddress: creator.String(),
+ },
+ expErr: true,
+ },
+ "zero amount": {
+ burn: &bindings.BurnTokens{
+ Denom: validDenomStr,
+ Amount: sdk.ZeroInt(),
+ BurnFromAddress: creator.String(),
+ },
+ expErr: true,
+ },
+ "negative amount": {
+ burn: nil,
+ expErr: true,
+ },
+ "null burn": {
+ burn: &bindings.BurnTokens{
+ Denom: validDenomStr,
+ Amount: mintAmount.Neg(),
+ BurnFromAddress: creator.String(),
+ },
+ expErr: true,
+ },
+ }
+
+ for name, spec := range specs {
+ t.Run(name, func(t *testing.T) {
+ // Mint valid denom str and empty denom string for burn test
+ mintBinding := &bindings.MintTokens{
+ Denom: validDenomStr,
+ Amount: mintAmount,
+ MintToAddress: creator.String(),
+ }
+ err := wasmbinding.PerformMint(&tokenz.TokenFactoryKeeper, &tokenz.BankKeeper, ctx, creator, mintBinding)
+ require.NoError(t, err)
+
+ emptyDenomMintBinding := &bindings.MintTokens{
+ Denom: emptyDenomStr,
+ Amount: mintAmount,
+ MintToAddress: creator.String(),
+ }
+ err = wasmbinding.PerformMint(&tokenz.TokenFactoryKeeper, &tokenz.BankKeeper, ctx, creator, emptyDenomMintBinding)
+ require.Error(t, err)
+
+ // when
+ gotErr := wasmbinding.PerformBurn(&tokenz.TokenFactoryKeeper, ctx, creator, spec.burn)
+ // then
+ if spec.expErr {
+ require.Error(t, gotErr)
+ return
+ }
+ require.NoError(t, gotErr)
+ })
+ }
+}
diff --git a/x/tokenfactory/bindings/validate_queries_test.go b/x/tokenfactory/bindings/validate_queries_test.go
new file mode 100644
index 0000000000..e21d73d5e1
--- /dev/null
+++ b/x/tokenfactory/bindings/validate_queries_test.go
@@ -0,0 +1,115 @@
+package bindings_test
+
+import (
+ "fmt"
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
+
+ sdk "github.com/cosmos/cosmos-sdk/types"
+
+ wasmbinding "github.com/CosmWasm/wasmd/x/tokenfactory/bindings"
+)
+
+func TestFullDenom(t *testing.T) {
+ actor := RandomAccountAddress()
+
+ specs := map[string]struct {
+ addr string
+ subdenom string
+ expFullDenom string
+ expErr bool
+ }{
+ "valid address": {
+ addr: actor.String(),
+ subdenom: "subDenom1",
+ expFullDenom: fmt.Sprintf("factory/%s/subDenom1", actor.String()),
+ },
+ "empty address": {
+ addr: "",
+ subdenom: "subDenom1",
+ expErr: true,
+ },
+ "invalid address": {
+ addr: "invalid",
+ subdenom: "subDenom1",
+ expErr: true,
+ },
+ "empty sub-denom": {
+ addr: actor.String(),
+ subdenom: "",
+ expFullDenom: fmt.Sprintf("factory/%s/", actor.String()),
+ },
+ "invalid sub-denom (contains @)": {
+ addr: actor.String(),
+ subdenom: "sub@denom",
+ expErr: true,
+ },
+ }
+ for name, spec := range specs {
+ t.Run(name, func(t *testing.T) {
+ // when
+ gotFullDenom, gotErr := wasmbinding.GetFullDenom(spec.addr, spec.subdenom)
+ // then
+ if spec.expErr {
+ require.Error(t, gotErr)
+ return
+ }
+ require.NoError(t, gotErr)
+ assert.Equal(t, spec.expFullDenom, gotFullDenom, "exp %s but got %s", spec.expFullDenom, gotFullDenom)
+ })
+ }
+}
+
+func TestDenomAdmin(t *testing.T) {
+ addr := RandomAccountAddress()
+ app, ctx := SetupCustomApp(t, addr)
+
+ // set token creation fee to zero to make testing easier
+ tfParams := app.TokenFactoryKeeper.GetParams(ctx)
+ tfParams.DenomCreationFee = sdk.NewCoins()
+ app.TokenFactoryKeeper.SetParams(ctx, tfParams)
+
+ // create a subdenom via the token factory
+ admin := sdk.AccAddress([]byte("addr1_______________"))
+ tfDenom, err := app.TokenFactoryKeeper.CreateDenom(ctx, admin.String(), "subdenom")
+ require.NoError(t, err)
+ require.NotEmpty(t, tfDenom)
+
+ queryPlugin := wasmbinding.NewQueryPlugin(&app.BankKeeper, &app.TokenFactoryKeeper)
+
+ testCases := []struct {
+ name string
+ denom string
+ expectErr bool
+ expectAdmin string
+ }{
+ {
+ name: "valid token factory denom",
+ denom: tfDenom,
+ expectAdmin: admin.String(),
+ },
+ {
+ name: "invalid token factory denom",
+ denom: "uosmo",
+ expectErr: false,
+ expectAdmin: "",
+ },
+ }
+
+ for _, tc := range testCases {
+ tc := tc
+
+ t.Run(tc.name, func(t *testing.T) {
+ resp, err := queryPlugin.GetDenomAdmin(ctx, tc.denom)
+ if tc.expectErr {
+ require.Error(t, err)
+ } else {
+ require.NoError(t, err)
+ require.NotNil(t, resp)
+ require.Equal(t, tc.expectAdmin, resp.Admin)
+ }
+ })
+ }
+}
diff --git a/x/tokenfactory/bindings/wasm.go b/x/tokenfactory/bindings/wasm.go
new file mode 100644
index 0000000000..d4732db444
--- /dev/null
+++ b/x/tokenfactory/bindings/wasm.go
@@ -0,0 +1,29 @@
+package bindings
+
+import (
+ "github.com/CosmWasm/wasmd/x/wasm"
+
+ wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
+
+ tokenfactorykeeper "github.com/CosmWasm/wasmd/x/tokenfactory/keeper"
+ bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
+)
+
+func RegisterCustomPlugins(
+ bank *bankkeeper.BaseKeeper,
+ tokenFactory *tokenfactorykeeper.Keeper,
+) []wasmkeeper.Option {
+ wasmQueryPlugin := NewQueryPlugin(bank, tokenFactory)
+
+ queryPluginOpt := wasmkeeper.WithQueryPlugins(&wasmkeeper.QueryPlugins{
+ Custom: CustomQuerier(wasmQueryPlugin),
+ })
+ messengerDecoratorOpt := wasmkeeper.WithMessageHandlerDecorator(
+ CustomMessageDecorator(bank, tokenFactory),
+ )
+
+ return []wasm.Option{
+ queryPluginOpt,
+ messengerDecoratorOpt,
+ }
+}
diff --git a/x/tokenfactory/client/cli/query.go b/x/tokenfactory/client/cli/query.go
new file mode 100644
index 0000000000..d748e2f9b2
--- /dev/null
+++ b/x/tokenfactory/client/cli/query.go
@@ -0,0 +1,122 @@
+package cli
+
+import (
+ "fmt"
+
+ // "strings"
+
+ "github.com/spf13/cobra"
+
+ "github.com/cosmos/cosmos-sdk/client"
+ "github.com/cosmos/cosmos-sdk/client/flags"
+
+ // "github.com/cosmos/cosmos-sdk/client/flags"
+ // sdk "github.com/cosmos/cosmos-sdk/types"
+
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+)
+
+// GetQueryCmd returns the cli query commands for this module
+func GetQueryCmd() *cobra.Command {
+ // Group tokenfactory queries under a subcommand
+ cmd := &cobra.Command{
+ Use: types.ModuleName,
+ Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName),
+ DisableFlagParsing: true,
+ SuggestionsMinimumDistance: 2,
+ RunE: client.ValidateCmd,
+ }
+
+ cmd.AddCommand(
+ GetParams(),
+ GetCmdDenomAuthorityMetadata(),
+ GetCmdDenomsFromCreator(),
+ )
+
+ return cmd
+}
+
+// GetParams returns the params for the module
+func GetParams() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "params [flags]",
+ Short: "Get the params for the x/tokenfactory module",
+ 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.Params(cmd.Context(), &types.QueryParamsRequest{})
+ if err != nil {
+ return err
+ }
+
+ return clientCtx.PrintProto(res)
+ },
+ }
+
+ flags.AddQueryFlagsToCmd(cmd)
+
+ return cmd
+}
+
+// GetCmdDenomAuthorityMetadata returns the authority metadata for a queried denom
+func GetCmdDenomAuthorityMetadata() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "denom-authority-metadata [denom] [flags]",
+ Short: "Get the authority metadata for a specific denom",
+ 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.DenomAuthorityMetadata(cmd.Context(), &types.QueryDenomAuthorityMetadataRequest{
+ Denom: args[0],
+ })
+ if err != nil {
+ return err
+ }
+
+ return clientCtx.PrintProto(res)
+ },
+ }
+
+ flags.AddQueryFlagsToCmd(cmd)
+
+ return cmd
+}
+
+// GetCmdDenomsFromCreator a command to get a list of all tokens created by a specific creator address
+func GetCmdDenomsFromCreator() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "denoms-from-creator [creator address] [flags]",
+ Short: "Returns a list of all tokens created by a specific creator address",
+ 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.DenomsFromCreator(cmd.Context(), &types.QueryDenomsFromCreatorRequest{
+ Creator: args[0],
+ })
+ if err != nil {
+ return err
+ }
+
+ return clientCtx.PrintProto(res)
+ },
+ }
+
+ flags.AddQueryFlagsToCmd(cmd)
+
+ return cmd
+}
diff --git a/x/tokenfactory/client/cli/tx.go b/x/tokenfactory/client/cli/tx.go
new file mode 100644
index 0000000000..2d86c905b9
--- /dev/null
+++ b/x/tokenfactory/client/cli/tx.go
@@ -0,0 +1,188 @@
+package cli
+
+import (
+ "fmt"
+
+ "github.com/spf13/cobra"
+
+ "github.com/cosmos/cosmos-sdk/client"
+ "github.com/cosmos/cosmos-sdk/client/flags"
+ "github.com/cosmos/cosmos-sdk/client/tx"
+ sdk "github.com/cosmos/cosmos-sdk/types"
+
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+)
+
+// GetTxCmd returns the transaction commands for this module
+func GetTxCmd() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: types.ModuleName,
+ Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName),
+ DisableFlagParsing: true,
+ SuggestionsMinimumDistance: 2,
+ RunE: client.ValidateCmd,
+ }
+
+ cmd.AddCommand(
+ NewCreateDenomCmd(),
+ NewMintCmd(),
+ NewBurnCmd(),
+ // NewForceTransferCmd(),
+ NewChangeAdminCmd(),
+ )
+
+ return cmd
+}
+
+// NewCreateDenomCmd broadcast MsgCreateDenom
+func NewCreateDenomCmd() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "create-denom [subdenom] [flags]",
+ Short: "create a new denom from an account",
+ Args: cobra.ExactArgs(1),
+ RunE: func(cmd *cobra.Command, args []string) error {
+ clientCtx, err := client.GetClientTxContext(cmd)
+ if err != nil {
+ return err
+ }
+
+ txf := tx.NewFactoryCLI(clientCtx, cmd.Flags()).WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever)
+
+ msg := types.NewMsgCreateDenom(
+ clientCtx.GetFromAddress().String(),
+ args[0],
+ )
+
+ return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg)
+ },
+ }
+
+ flags.AddTxFlagsToCmd(cmd)
+ return cmd
+}
+
+// NewMintCmd broadcast MsgMint
+func NewMintCmd() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "mint [amount] [flags]",
+ Short: "Mint a denom to an address. Must have admin authority to do so.",
+ Args: cobra.ExactArgs(1),
+ RunE: func(cmd *cobra.Command, args []string) error {
+ clientCtx, err := client.GetClientTxContext(cmd)
+ if err != nil {
+ return err
+ }
+
+ txf := tx.NewFactoryCLI(clientCtx, cmd.Flags()).WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever)
+
+ amount, err := sdk.ParseCoinNormalized(args[0])
+ if err != nil {
+ return err
+ }
+
+ msg := types.NewMsgMint(
+ clientCtx.GetFromAddress().String(),
+ amount,
+ )
+
+ return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg)
+ },
+ }
+
+ flags.AddTxFlagsToCmd(cmd)
+ return cmd
+}
+
+// NewBurnCmd broadcast MsgBurn
+func NewBurnCmd() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "burn [amount] [flags]",
+ Short: "Burn tokens from an address. Must have admin authority to do so.",
+ Args: cobra.ExactArgs(1),
+ RunE: func(cmd *cobra.Command, args []string) error {
+ clientCtx, err := client.GetClientTxContext(cmd)
+ if err != nil {
+ return err
+ }
+
+ txf := tx.NewFactoryCLI(clientCtx, cmd.Flags()).WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever)
+
+ amount, err := sdk.ParseCoinNormalized(args[0])
+ if err != nil {
+ return err
+ }
+
+ msg := types.NewMsgBurn(
+ clientCtx.GetFromAddress().String(),
+ amount,
+ )
+
+ return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg)
+ },
+ }
+
+ flags.AddTxFlagsToCmd(cmd)
+ return cmd
+}
+
+// // NewForceTransferCmd broadcast MsgForceTransfer
+// func NewForceTransferCmd() *cobra.Command {
+// cmd := &cobra.Command{
+// Use: "force-transfer [amount] [transfer-from-address] [transfer-to-address] [flags]",
+// Short: "Force transfer tokens from one address to another address. Must have admin authority to do so.",
+// Args: cobra.ExactArgs(3),
+// RunE: func(cmd *cobra.Command, args []string) error {
+// clientCtx, err := client.GetClientTxContext(cmd)
+// if err != nil {
+// return err
+// }
+
+// txf := tx.NewFactoryCLI(clientCtx, cmd.Flags()).WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever)
+
+// amount, err := sdk.ParseCoinNormalized(args[0])
+// if err != nil {
+// return err
+// }
+
+// msg := types.NewMsgForceTransfer(
+// clientCtx.GetFromAddress().String(),
+// amount,
+// args[1],
+// args[2],
+// )
+
+// return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg)
+// },
+// }
+
+// flags.AddTxFlagsToCmd(cmd)
+// return cmd
+// }
+
+// NewChangeAdminCmd broadcast MsgChangeAdmin
+func NewChangeAdminCmd() *cobra.Command {
+ cmd := &cobra.Command{
+ Use: "change-admin [denom] [new-admin-address] [flags]",
+ Short: "Changes the admin address for a factory-created denom. Must have admin authority to do so.",
+ Args: cobra.ExactArgs(2),
+ RunE: func(cmd *cobra.Command, args []string) error {
+ clientCtx, err := client.GetClientTxContext(cmd)
+ if err != nil {
+ return err
+ }
+
+ txf := tx.NewFactoryCLI(clientCtx, cmd.Flags()).WithTxConfig(clientCtx.TxConfig).WithAccountRetriever(clientCtx.AccountRetriever)
+
+ msg := types.NewMsgChangeAdmin(
+ clientCtx.GetFromAddress().String(),
+ args[0],
+ args[1],
+ )
+
+ return tx.GenerateOrBroadcastTxWithFactory(clientCtx, txf, msg)
+ },
+ }
+
+ flags.AddTxFlagsToCmd(cmd)
+ return cmd
+}
diff --git a/x/tokenfactory/keeper/admins.go b/x/tokenfactory/keeper/admins.go
new file mode 100644
index 0000000000..d43898a256
--- /dev/null
+++ b/x/tokenfactory/keeper/admins.go
@@ -0,0 +1,49 @@
+package keeper
+
+import (
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ "github.com/gogo/protobuf/proto"
+
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+)
+
+// GetAuthorityMetadata returns the authority metadata for a specific denom
+func (k Keeper) GetAuthorityMetadata(ctx sdk.Context, denom string) (types.DenomAuthorityMetadata, error) {
+ bz := k.GetDenomPrefixStore(ctx, denom).Get([]byte(types.DenomAuthorityMetadataKey))
+
+ metadata := types.DenomAuthorityMetadata{}
+ err := proto.Unmarshal(bz, &metadata)
+ if err != nil {
+ return types.DenomAuthorityMetadata{}, err
+ }
+ return metadata, nil
+}
+
+// setAuthorityMetadata stores authority metadata for a specific denom
+func (k Keeper) setAuthorityMetadata(ctx sdk.Context, denom string, metadata types.DenomAuthorityMetadata) error {
+ err := metadata.Validate()
+ if err != nil {
+ return err
+ }
+
+ store := k.GetDenomPrefixStore(ctx, denom)
+
+ bz, err := proto.Marshal(&metadata)
+ if err != nil {
+ return err
+ }
+
+ store.Set([]byte(types.DenomAuthorityMetadataKey), bz)
+ return nil
+}
+
+func (k Keeper) setAdmin(ctx sdk.Context, denom string, admin string) error {
+ metadata, err := k.GetAuthorityMetadata(ctx, denom)
+ if err != nil {
+ return err
+ }
+
+ metadata.Admin = admin
+
+ return k.setAuthorityMetadata(ctx, denom, metadata)
+}
diff --git a/x/tokenfactory/keeper/admins_test.go b/x/tokenfactory/keeper/admins_test.go
new file mode 100644
index 0000000000..f3c149986d
--- /dev/null
+++ b/x/tokenfactory/keeper/admins_test.go
@@ -0,0 +1,405 @@
+package keeper_test
+
+import (
+ "fmt"
+
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
+
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+)
+
+func (suite *KeeperTestSuite) TestAdminMsgs() {
+ addr0bal := int64(0)
+ addr1bal := int64(0)
+
+ bankKeeper := suite.App.BankKeeper
+
+ suite.CreateDefaultDenom()
+ // Make sure that the admin is set correctly
+ queryRes, err := suite.queryClient.DenomAuthorityMetadata(suite.Ctx.Context(), &types.QueryDenomAuthorityMetadataRequest{
+ Denom: suite.defaultDenom,
+ })
+ suite.Require().NoError(err)
+ suite.Require().Equal(suite.TestAccs[0].String(), queryRes.AuthorityMetadata.Admin)
+
+ // Test minting to admins own account
+ _, err = suite.msgServer.Mint(sdk.WrapSDKContext(suite.Ctx), types.NewMsgMint(suite.TestAccs[0].String(), sdk.NewInt64Coin(suite.defaultDenom, 10)))
+ addr0bal += 10
+ suite.Require().NoError(err)
+ suite.Require().True(bankKeeper.GetBalance(suite.Ctx, suite.TestAccs[0], suite.defaultDenom).Amount.Int64() == addr0bal, bankKeeper.GetBalance(suite.Ctx, suite.TestAccs[0], suite.defaultDenom))
+
+ // // Test force transferring
+ // _, err = suite.msgServer.ForceTransfer(sdk.WrapSDKContext(suite.Ctx), types.NewMsgForceTransfer(suite.TestAccs[0].String(), sdk.NewInt64Coin(denom, 5), suite.TestAccs[1].String(), suite.TestAccs[0].String()))
+ // suite.Require().NoError(err)
+ // suite.Require().True(bankKeeper.GetBalance(suite.Ctx, suite.TestAccs[0], denom).IsEqual(sdk.NewInt64Coin(denom, 15)))
+ // suite.Require().True(bankKeeper.GetBalance(suite.Ctx, suite.TestAccs[1], denom).IsEqual(sdk.NewInt64Coin(denom, 5)))
+
+ // Test burning from own account
+ _, err = suite.msgServer.Burn(sdk.WrapSDKContext(suite.Ctx), types.NewMsgBurn(suite.TestAccs[0].String(), sdk.NewInt64Coin(suite.defaultDenom, 5)))
+ suite.Require().NoError(err)
+ suite.Require().True(bankKeeper.GetBalance(suite.Ctx, suite.TestAccs[1], suite.defaultDenom).Amount.Int64() == addr1bal)
+
+ // Test Change Admin
+ _, err = suite.msgServer.ChangeAdmin(sdk.WrapSDKContext(suite.Ctx), types.NewMsgChangeAdmin(suite.TestAccs[0].String(), suite.defaultDenom, suite.TestAccs[1].String()))
+ suite.Require().NoError(err)
+
+ queryRes, err = suite.queryClient.DenomAuthorityMetadata(suite.Ctx.Context(), &types.QueryDenomAuthorityMetadataRequest{
+ Denom: suite.defaultDenom,
+ })
+ suite.Require().NoError(err)
+ suite.Require().Equal(suite.TestAccs[1].String(), queryRes.AuthorityMetadata.Admin)
+
+ // Make sure old admin can no longer do actions
+ _, err = suite.msgServer.Burn(sdk.WrapSDKContext(suite.Ctx), types.NewMsgBurn(suite.TestAccs[0].String(), sdk.NewInt64Coin(suite.defaultDenom, 5)))
+ suite.Require().Error(err)
+
+ // Make sure the new admin works
+ _, err = suite.msgServer.Mint(sdk.WrapSDKContext(suite.Ctx), types.NewMsgMint(suite.TestAccs[1].String(), sdk.NewInt64Coin(suite.defaultDenom, 5)))
+ addr1bal += 5
+ suite.Require().NoError(err)
+ suite.Require().True(bankKeeper.GetBalance(suite.Ctx, suite.TestAccs[1], suite.defaultDenom).Amount.Int64() == addr1bal)
+
+ // Try setting admin to empty
+ _, err = suite.msgServer.ChangeAdmin(sdk.WrapSDKContext(suite.Ctx), types.NewMsgChangeAdmin(suite.TestAccs[1].String(), suite.defaultDenom, ""))
+ suite.Require().NoError(err)
+ queryRes, err = suite.queryClient.DenomAuthorityMetadata(suite.Ctx.Context(), &types.QueryDenomAuthorityMetadataRequest{
+ Denom: suite.defaultDenom,
+ })
+ suite.Require().NoError(err)
+ suite.Require().Equal("", queryRes.AuthorityMetadata.Admin)
+}
+
+// TestMintDenom ensures the following properties of the MintMessage:
+// * Noone can mint tokens for a denom that doesn't exist
+// * Only the admin of a denom can mint tokens for it
+// * The admin of a denom can mint tokens for it
+func (suite *KeeperTestSuite) TestMintDenom() {
+ var addr0bal int64
+
+ // Create a denom
+ suite.CreateDefaultDenom()
+
+ for _, tc := range []struct {
+ desc string
+ amount int64
+ mintDenom string
+ admin string
+ valid bool
+ }{
+ {
+ desc: "denom does not exist",
+ amount: 10,
+ mintDenom: "factory/osmo1t7egva48prqmzl59x5ngv4zx0dtrwewc9m7z44/evmos",
+ admin: suite.TestAccs[0].String(),
+ valid: false,
+ },
+ {
+ desc: "mint is not by the admin",
+ amount: 10,
+ mintDenom: suite.defaultDenom,
+ admin: suite.TestAccs[1].String(),
+ valid: false,
+ },
+ {
+ desc: "success case",
+ amount: 10,
+ mintDenom: suite.defaultDenom,
+ admin: suite.TestAccs[0].String(),
+ valid: true,
+ },
+ } {
+ suite.Run(fmt.Sprintf("Case %s", tc.desc), func() {
+ // Test minting to admins own account
+ bankKeeper := suite.App.BankKeeper
+ _, err := suite.msgServer.Mint(sdk.WrapSDKContext(suite.Ctx), types.NewMsgMint(tc.admin, sdk.NewInt64Coin(tc.mintDenom, 10)))
+ if tc.valid {
+ addr0bal += 10
+ suite.Require().NoError(err)
+ suite.Require().Equal(bankKeeper.GetBalance(suite.Ctx, suite.TestAccs[0], suite.defaultDenom).Amount.Int64(), addr0bal, bankKeeper.GetBalance(suite.Ctx, suite.TestAccs[0], suite.defaultDenom))
+ } else {
+ suite.Require().Error(err)
+ }
+ })
+ }
+}
+
+func (suite *KeeperTestSuite) TestBurnDenom() {
+ var addr0bal int64
+
+ // Create a denom.
+ suite.CreateDefaultDenom()
+
+ // mint 10 default token for testAcc[0]
+ _, err := suite.msgServer.Mint(sdk.WrapSDKContext(suite.Ctx), types.NewMsgMint(suite.TestAccs[0].String(), sdk.NewInt64Coin(suite.defaultDenom, 10)))
+ suite.Require().NoError(err)
+ addr0bal += 10
+
+ for _, tc := range []struct {
+ desc string
+ amount int64
+ burnDenom string
+ admin string
+ valid bool
+ }{
+ {
+ desc: "denom does not exist",
+ amount: 10,
+ burnDenom: "factory/osmo1t7egva48prqmzl59x5ngv4zx0dtrwewc9m7z44/evmos",
+ admin: suite.TestAccs[0].String(),
+ valid: false,
+ },
+ {
+ desc: "burn is not by the admin",
+ amount: 10,
+ burnDenom: suite.defaultDenom,
+ admin: suite.TestAccs[1].String(),
+ valid: false,
+ },
+ {
+ desc: "burn amount is bigger than minted amount",
+ amount: 1000,
+ burnDenom: suite.defaultDenom,
+ admin: suite.TestAccs[1].String(),
+ valid: false,
+ },
+ {
+ desc: "success case",
+ amount: 10,
+ burnDenom: suite.defaultDenom,
+ admin: suite.TestAccs[0].String(),
+ valid: true,
+ },
+ } {
+ suite.Run(fmt.Sprintf("Case %s", tc.desc), func() {
+ // Test minting to admins own account
+ bankKeeper := suite.App.BankKeeper
+ _, err := suite.msgServer.Burn(sdk.WrapSDKContext(suite.Ctx), types.NewMsgBurn(tc.admin, sdk.NewInt64Coin(tc.burnDenom, 10)))
+ if tc.valid {
+ addr0bal -= 10
+ suite.Require().NoError(err)
+ suite.Require().True(bankKeeper.GetBalance(suite.Ctx, suite.TestAccs[0], suite.defaultDenom).Amount.Int64() == addr0bal, bankKeeper.GetBalance(suite.Ctx, suite.TestAccs[0], suite.defaultDenom))
+ } else {
+ suite.Require().Error(err)
+ suite.Require().True(bankKeeper.GetBalance(suite.Ctx, suite.TestAccs[0], suite.defaultDenom).Amount.Int64() == addr0bal, bankKeeper.GetBalance(suite.Ctx, suite.TestAccs[0], suite.defaultDenom))
+ }
+ })
+ }
+}
+
+func (suite *KeeperTestSuite) TestChangeAdminDenom() {
+ for _, tc := range []struct {
+ desc string
+ msgChangeAdmin func(denom string) *types.MsgChangeAdmin
+ expectedChangeAdminPass bool
+ expectedAdminIndex int
+ msgMint func(denom string) *types.MsgMint
+ expectedMintPass bool
+ }{
+ {
+ desc: "creator admin can't mint after setting to '' ",
+ msgChangeAdmin: func(denom string) *types.MsgChangeAdmin {
+ return types.NewMsgChangeAdmin(suite.TestAccs[0].String(), denom, "")
+ },
+ expectedChangeAdminPass: true,
+ expectedAdminIndex: -1,
+ msgMint: func(denom string) *types.MsgMint {
+ return types.NewMsgMint(suite.TestAccs[0].String(), sdk.NewInt64Coin(denom, 5))
+ },
+ expectedMintPass: false,
+ },
+ {
+ desc: "non-admins can't change the existing admin",
+ msgChangeAdmin: func(denom string) *types.MsgChangeAdmin {
+ return types.NewMsgChangeAdmin(suite.TestAccs[1].String(), denom, suite.TestAccs[2].String())
+ },
+ expectedChangeAdminPass: false,
+ expectedAdminIndex: 0,
+ },
+ {
+ desc: "success change admin",
+ msgChangeAdmin: func(denom string) *types.MsgChangeAdmin {
+ return types.NewMsgChangeAdmin(suite.TestAccs[0].String(), denom, suite.TestAccs[1].String())
+ },
+ expectedAdminIndex: 1,
+ expectedChangeAdminPass: true,
+ msgMint: func(denom string) *types.MsgMint {
+ return types.NewMsgMint(suite.TestAccs[1].String(), sdk.NewInt64Coin(denom, 5))
+ },
+ expectedMintPass: true,
+ },
+ } {
+ suite.Run(fmt.Sprintf("Case %s", tc.desc), func() {
+ // setup test
+ suite.SetupTest()
+
+ // Create a denom and mint
+ res, err := suite.msgServer.CreateDenom(sdk.WrapSDKContext(suite.Ctx), types.NewMsgCreateDenom(suite.TestAccs[0].String(), "bitcoin"))
+ suite.Require().NoError(err)
+
+ testDenom := res.GetNewTokenDenom()
+
+ _, err = suite.msgServer.Mint(sdk.WrapSDKContext(suite.Ctx), types.NewMsgMint(suite.TestAccs[0].String(), sdk.NewInt64Coin(testDenom, 10)))
+ suite.Require().NoError(err)
+
+ _, err = suite.msgServer.ChangeAdmin(sdk.WrapSDKContext(suite.Ctx), tc.msgChangeAdmin(testDenom))
+ if tc.expectedChangeAdminPass {
+ suite.Require().NoError(err)
+ } else {
+ suite.Require().Error(err)
+ }
+
+ queryRes, err := suite.queryClient.DenomAuthorityMetadata(suite.Ctx.Context(), &types.QueryDenomAuthorityMetadataRequest{
+ Denom: testDenom,
+ })
+ suite.Require().NoError(err)
+
+ // expectedAdminIndex with negative value is assumed as admin with value of ""
+ const emptyStringAdminIndexFlag = -1
+ if tc.expectedAdminIndex == emptyStringAdminIndexFlag {
+ suite.Require().Equal("", queryRes.AuthorityMetadata.Admin)
+ } else {
+ suite.Require().Equal(suite.TestAccs[tc.expectedAdminIndex].String(), queryRes.AuthorityMetadata.Admin)
+ }
+
+ // we test mint to test if admin authority is performed properly after admin change.
+ if tc.msgMint != nil {
+ _, err := suite.msgServer.Mint(sdk.WrapSDKContext(suite.Ctx), tc.msgMint(testDenom))
+ if tc.expectedMintPass {
+ suite.Require().NoError(err)
+ } else {
+ suite.Require().Error(err)
+ }
+ }
+ })
+ }
+}
+
+func (suite *KeeperTestSuite) TestSetDenomMetaData() {
+ // setup test
+ suite.SetupTest()
+ suite.CreateDefaultDenom()
+
+ for _, tc := range []struct {
+ desc string
+ msgSetDenomMetadata types.MsgSetDenomMetadata
+ expectedPass bool
+ }{
+ {
+ desc: "successful set denom metadata",
+ msgSetDenomMetadata: *types.NewMsgSetDenomMetadata(suite.TestAccs[0].String(), banktypes.Metadata{
+ Description: "yeehaw",
+ DenomUnits: []*banktypes.DenomUnit{
+ {
+ Denom: suite.defaultDenom,
+ Exponent: 0,
+ },
+ {
+ Denom: "uosmo",
+ Exponent: 6,
+ },
+ },
+ Base: suite.defaultDenom,
+ Display: "uosmo",
+ Name: "OSMO",
+ Symbol: "OSMO",
+ }),
+ expectedPass: true,
+ },
+ {
+ desc: "non existent factory denom name",
+ msgSetDenomMetadata: *types.NewMsgSetDenomMetadata(suite.TestAccs[0].String(), banktypes.Metadata{
+ Description: "yeehaw",
+ DenomUnits: []*banktypes.DenomUnit{
+ {
+ Denom: fmt.Sprintf("factory/%s/litecoin", suite.TestAccs[0].String()),
+ Exponent: 0,
+ },
+ {
+ Denom: "uosmo",
+ Exponent: 6,
+ },
+ },
+ Base: fmt.Sprintf("factory/%s/litecoin", suite.TestAccs[0].String()),
+ Display: "uosmo",
+ Name: "OSMO",
+ Symbol: "OSMO",
+ }),
+ expectedPass: false,
+ },
+ {
+ desc: "non-factory denom",
+ msgSetDenomMetadata: *types.NewMsgSetDenomMetadata(suite.TestAccs[0].String(), banktypes.Metadata{
+ Description: "yeehaw",
+ DenomUnits: []*banktypes.DenomUnit{
+ {
+ Denom: "uosmo",
+ Exponent: 0,
+ },
+ {
+ Denom: "uosmoo",
+ Exponent: 6,
+ },
+ },
+ Base: "uosmo",
+ Display: "uosmoo",
+ Name: "OSMO",
+ Symbol: "OSMO",
+ }),
+ expectedPass: false,
+ },
+ {
+ desc: "wrong admin",
+ msgSetDenomMetadata: *types.NewMsgSetDenomMetadata(suite.TestAccs[1].String(), banktypes.Metadata{
+ Description: "yeehaw",
+ DenomUnits: []*banktypes.DenomUnit{
+ {
+ Denom: suite.defaultDenom,
+ Exponent: 0,
+ },
+ {
+ Denom: "uosmo",
+ Exponent: 6,
+ },
+ },
+ Base: suite.defaultDenom,
+ Display: "uosmo",
+ Name: "OSMO",
+ Symbol: "OSMO",
+ }),
+ expectedPass: false,
+ },
+ {
+ desc: "invalid metadata (missing display denom unit)",
+ msgSetDenomMetadata: *types.NewMsgSetDenomMetadata(suite.TestAccs[0].String(), banktypes.Metadata{
+ Description: "yeehaw",
+ DenomUnits: []*banktypes.DenomUnit{
+ {
+ Denom: suite.defaultDenom,
+ Exponent: 0,
+ },
+ },
+ Base: suite.defaultDenom,
+ Display: "uosmo",
+ Name: "OSMO",
+ Symbol: "OSMO",
+ }),
+ expectedPass: false,
+ },
+ } {
+ suite.Run(fmt.Sprintf("Case %s", tc.desc), func() {
+ bankKeeper := suite.App.BankKeeper
+ res, err := suite.msgServer.SetDenomMetadata(sdk.WrapSDKContext(suite.Ctx), &tc.msgSetDenomMetadata)
+ if tc.expectedPass {
+ suite.Require().NoError(err)
+ suite.Require().NotNil(res)
+
+ md, found := bankKeeper.GetDenomMetaData(suite.Ctx, suite.defaultDenom)
+ suite.Require().True(found)
+ suite.Require().Equal(tc.msgSetDenomMetadata.Metadata.Name, md.Name)
+ } else {
+ suite.Require().Error(err)
+ }
+ })
+ }
+}
diff --git a/x/tokenfactory/keeper/bankactions.go b/x/tokenfactory/keeper/bankactions.go
new file mode 100644
index 0000000000..553640299f
--- /dev/null
+++ b/x/tokenfactory/keeper/bankactions.go
@@ -0,0 +1,52 @@
+package keeper
+
+import (
+ sdk "github.com/cosmos/cosmos-sdk/types"
+
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+)
+
+func (k Keeper) mintTo(ctx sdk.Context, amount sdk.Coin, mintTo string) error {
+ // verify that denom is an x/tokenfactory denom
+ _, _, err := types.DeconstructDenom(amount.Denom)
+ if err != nil {
+ return err
+ }
+
+ err = k.bankKeeper.MintCoins(ctx, types.ModuleName, sdk.NewCoins(amount))
+ if err != nil {
+ return err
+ }
+
+ addr, err := sdk.AccAddressFromBech32(mintTo)
+ if err != nil {
+ return err
+ }
+
+ return k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName,
+ addr,
+ sdk.NewCoins(amount))
+}
+
+func (k Keeper) burnFrom(ctx sdk.Context, amount sdk.Coin, burnFrom string) error {
+ // verify that denom is an x/tokenfactory denom
+ _, _, err := types.DeconstructDenom(amount.Denom)
+ if err != nil {
+ return err
+ }
+
+ addr, err := sdk.AccAddressFromBech32(burnFrom)
+ if err != nil {
+ return err
+ }
+
+ err = k.bankKeeper.SendCoinsFromAccountToModule(ctx,
+ addr,
+ types.ModuleName,
+ sdk.NewCoins(amount))
+ if err != nil {
+ return err
+ }
+
+ return k.bankKeeper.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(amount))
+}
diff --git a/x/tokenfactory/keeper/createdenom.go b/x/tokenfactory/keeper/createdenom.go
new file mode 100644
index 0000000000..753c907a8b
--- /dev/null
+++ b/x/tokenfactory/keeper/createdenom.go
@@ -0,0 +1,86 @@
+package keeper
+
+import (
+ "fmt"
+
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
+
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+)
+
+// ConvertToBaseToken converts a fee amount in a whitelisted fee token to the base fee token amount
+func (k Keeper) CreateDenom(ctx sdk.Context, creatorAddr string, subdenom string) (newTokenDenom string, err error) {
+ denom, err := k.validateCreateDenom(ctx, creatorAddr, subdenom)
+ if err != nil {
+ return "", err
+ }
+
+ err = k.chargeForCreateDenom(ctx, creatorAddr, subdenom)
+ if err != nil {
+ return "", err
+ }
+
+ err = k.createDenomAfterValidation(ctx, creatorAddr, denom)
+ return denom, err
+}
+
+// Runs CreateDenom logic after the charge and all denom validation has been handled.
+// Made into a second function for genesis initialization.
+func (k Keeper) createDenomAfterValidation(ctx sdk.Context, creatorAddr string, denom string) (err error) {
+ denomMetaData := banktypes.Metadata{
+ DenomUnits: []*banktypes.DenomUnit{{
+ Denom: denom,
+ Exponent: 0,
+ }},
+ Base: denom,
+ }
+
+ k.bankKeeper.SetDenomMetaData(ctx, denomMetaData)
+
+ authorityMetadata := types.DenomAuthorityMetadata{
+ Admin: creatorAddr,
+ }
+ err = k.setAuthorityMetadata(ctx, denom, authorityMetadata)
+ if err != nil {
+ return err
+ }
+
+ k.addDenomFromCreator(ctx, creatorAddr, denom)
+ return nil
+}
+
+func (k Keeper) validateCreateDenom(ctx sdk.Context, creatorAddr string, subdenom string) (newTokenDenom string, err error) {
+ // Temporary check until IBC bug is sorted out
+ if k.bankKeeper.HasSupply(ctx, subdenom) {
+ return "", fmt.Errorf("temporary error until IBC bug is sorted out, " +
+ "can't create subdenoms that are the same as a native denom")
+ }
+
+ denom, err := types.GetTokenDenom(creatorAddr, subdenom)
+ if err != nil {
+ return "", err
+ }
+
+ _, found := k.bankKeeper.GetDenomMetaData(ctx, denom)
+ if found {
+ return "", types.ErrDenomExists
+ }
+
+ return denom, nil
+}
+
+func (k Keeper) chargeForCreateDenom(ctx sdk.Context, creatorAddr string, subdenom string) (err error) { //nolint:unparam
+ // Send creation fee to community pool
+ creationFee := k.GetParams(ctx).DenomCreationFee
+ accAddr, err := sdk.AccAddressFromBech32(creatorAddr)
+ if err != nil {
+ return err
+ }
+ if creationFee != nil {
+ if err := k.communityPoolKeeper.FundCommunityPool(ctx, creationFee, accAddr); err != nil {
+ return err
+ }
+ }
+ return nil
+}
diff --git a/x/tokenfactory/keeper/createdenom_test.go b/x/tokenfactory/keeper/createdenom_test.go
new file mode 100644
index 0000000000..12f5b66c55
--- /dev/null
+++ b/x/tokenfactory/keeper/createdenom_test.go
@@ -0,0 +1,163 @@
+package keeper_test
+
+import (
+ "fmt"
+
+ sdk "github.com/cosmos/cosmos-sdk/types"
+
+ "github.com/CosmWasm/wasmd/x/tokenfactory/testhelpers"
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+)
+
+func (suite *KeeperTestSuite) TestMsgCreateDenom() {
+ var (
+ tokenFactoryKeeper = suite.App.TokenFactoryKeeper
+ bankKeeper = suite.App.BankKeeper
+ denomCreationFee = tokenFactoryKeeper.GetParams(suite.Ctx).DenomCreationFee
+ )
+
+ // Get balance of acc 0 before creating a denom
+ preCreateBalance := bankKeeper.GetBalance(suite.Ctx, suite.TestAccs[0], denomCreationFee[0].Denom)
+
+ // Creating a denom should work
+ res, err := suite.msgServer.CreateDenom(sdk.WrapSDKContext(suite.Ctx), types.NewMsgCreateDenom(suite.TestAccs[0].String(), "bitcoin"))
+ suite.Require().NoError(err)
+ suite.Require().NotEmpty(res.GetNewTokenDenom())
+
+ // Make sure that the admin is set correctly
+ queryRes, err := suite.queryClient.DenomAuthorityMetadata(suite.Ctx.Context(), &types.QueryDenomAuthorityMetadataRequest{
+ Denom: res.GetNewTokenDenom(),
+ })
+ suite.Require().NoError(err)
+ suite.Require().Equal(suite.TestAccs[0].String(), queryRes.AuthorityMetadata.Admin)
+
+ // Make sure that creation fee was deducted
+ postCreateBalance := bankKeeper.GetBalance(suite.Ctx, suite.TestAccs[0], tokenFactoryKeeper.GetParams(suite.Ctx).DenomCreationFee[0].Denom)
+ suite.Require().True(preCreateBalance.Sub(postCreateBalance).IsEqual(denomCreationFee[0]))
+
+ // Make sure that a second version of the same denom can't be recreated
+ _, err = suite.msgServer.CreateDenom(sdk.WrapSDKContext(suite.Ctx), types.NewMsgCreateDenom(suite.TestAccs[0].String(), "bitcoin"))
+ suite.Require().Error(err)
+
+ // Creating a second denom should work
+ res, err = suite.msgServer.CreateDenom(sdk.WrapSDKContext(suite.Ctx), types.NewMsgCreateDenom(suite.TestAccs[0].String(), "litecoin"))
+ suite.Require().NoError(err)
+ suite.Require().NotEmpty(res.GetNewTokenDenom())
+
+ // Try querying all the denoms created by suite.TestAccs[0]
+ queryRes2, err := suite.queryClient.DenomsFromCreator(suite.Ctx.Context(), &types.QueryDenomsFromCreatorRequest{
+ Creator: suite.TestAccs[0].String(),
+ })
+ suite.Require().NoError(err)
+ suite.Require().Len(queryRes2.Denoms, 2)
+
+ // Make sure that a second account can create a denom with the same subdenom
+ res, err = suite.msgServer.CreateDenom(sdk.WrapSDKContext(suite.Ctx), types.NewMsgCreateDenom(suite.TestAccs[1].String(), "bitcoin"))
+ suite.Require().NoError(err)
+ suite.Require().NotEmpty(res.GetNewTokenDenom())
+
+ // Make sure that an address with a "/" in it can't create denoms
+ _, err = suite.msgServer.CreateDenom(sdk.WrapSDKContext(suite.Ctx), types.NewMsgCreateDenom("osmosis.eth/creator", "bitcoin"))
+ suite.Require().Error(err)
+}
+
+func (suite *KeeperTestSuite) TestCreateDenom() {
+ var (
+ primaryDenom = types.DefaultParams().DenomCreationFee[0].Denom
+ secondaryDenom = testhelpers.SecondaryDenom
+ defaultDenomCreationFee = types.Params{DenomCreationFee: sdk.NewCoins(sdk.NewCoin(primaryDenom, sdk.NewInt(50000000)))}
+ twoDenomCreationFee = types.Params{DenomCreationFee: sdk.NewCoins(sdk.NewCoin(primaryDenom, sdk.NewInt(50000000)), sdk.NewCoin(secondaryDenom, sdk.NewInt(50000000)))}
+ nilCreationFee = types.Params{DenomCreationFee: nil}
+ largeCreationFee = types.Params{DenomCreationFee: sdk.NewCoins(sdk.NewCoin(primaryDenom, sdk.NewInt(5000000000)))}
+ )
+
+ for _, tc := range []struct {
+ desc string
+ denomCreationFee types.Params
+ setup func()
+ subdenom string
+ valid bool
+ }{
+ {
+ desc: "subdenom too long",
+ denomCreationFee: defaultDenomCreationFee,
+ subdenom: "assadsadsadasdasdsadsadsadsadsadsadsklkadaskkkdasdasedskhanhassyeunganassfnlksdflksafjlkasd",
+ valid: false,
+ },
+ {
+ desc: "subdenom and creator pair already exists",
+ denomCreationFee: defaultDenomCreationFee,
+ setup: func() {
+ _, err := suite.msgServer.CreateDenom(sdk.WrapSDKContext(suite.Ctx), types.NewMsgCreateDenom(suite.TestAccs[0].String(), "bitcoin"))
+ suite.Require().NoError(err)
+ },
+ subdenom: "bitcoin",
+ valid: false,
+ },
+ {
+ desc: "success case: defaultDenomCreationFee",
+ denomCreationFee: defaultDenomCreationFee,
+ subdenom: "evmos",
+ valid: true,
+ },
+ {
+ desc: "success case: twoDenomCreationFee",
+ denomCreationFee: twoDenomCreationFee,
+ subdenom: "catcoin",
+ valid: true,
+ },
+ {
+ desc: "success case: nilCreationFee",
+ denomCreationFee: nilCreationFee,
+ subdenom: "czcoin",
+ valid: true,
+ },
+ {
+ desc: "account doesn't have enough to pay for denom creation fee",
+ denomCreationFee: largeCreationFee,
+ subdenom: "tooexpensive",
+ valid: false,
+ },
+ {
+ desc: "subdenom having invalid characters",
+ denomCreationFee: defaultDenomCreationFee,
+ subdenom: "bit/***///&&&/coin",
+ valid: false,
+ },
+ } {
+ suite.SetupTest()
+ suite.Run(fmt.Sprintf("Case %s", tc.desc), func() {
+ if tc.setup != nil {
+ tc.setup()
+ }
+ tokenFactoryKeeper := suite.App.TokenFactoryKeeper
+ bankKeeper := suite.App.BankKeeper
+ // Set denom creation fee in params
+ tokenFactoryKeeper.SetParams(suite.Ctx, tc.denomCreationFee)
+ denomCreationFee := tokenFactoryKeeper.GetParams(suite.Ctx).DenomCreationFee
+ suite.Require().Equal(tc.denomCreationFee.DenomCreationFee, denomCreationFee)
+
+ // note balance, create a tokenfactory denom, then note balance again
+ preCreateBalance := bankKeeper.GetAllBalances(suite.Ctx, suite.TestAccs[0])
+ res, err := suite.msgServer.CreateDenom(sdk.WrapSDKContext(suite.Ctx), types.NewMsgCreateDenom(suite.TestAccs[0].String(), tc.subdenom))
+ postCreateBalance := bankKeeper.GetAllBalances(suite.Ctx, suite.TestAccs[0])
+ if tc.valid {
+ suite.Require().NoError(err)
+ suite.Require().True(preCreateBalance.Sub(postCreateBalance...).IsEqual(denomCreationFee))
+
+ // Make sure that the admin is set correctly
+ queryRes, err := suite.queryClient.DenomAuthorityMetadata(suite.Ctx.Context(), &types.QueryDenomAuthorityMetadataRequest{
+ Denom: res.GetNewTokenDenom(),
+ })
+
+ suite.Require().NoError(err)
+ suite.Require().Equal(suite.TestAccs[0].String(), queryRes.AuthorityMetadata.Admin)
+
+ } else {
+ suite.Require().Error(err)
+ // Ensure we don't charge if we expect an error
+ suite.Require().True(preCreateBalance.IsEqual(postCreateBalance))
+ }
+ })
+ }
+}
diff --git a/x/tokenfactory/keeper/creators.go b/x/tokenfactory/keeper/creators.go
new file mode 100644
index 0000000000..570d54b9fc
--- /dev/null
+++ b/x/tokenfactory/keeper/creators.go
@@ -0,0 +1,27 @@
+package keeper
+
+import (
+ sdk "github.com/cosmos/cosmos-sdk/types"
+)
+
+func (k Keeper) addDenomFromCreator(ctx sdk.Context, creator, denom string) {
+ store := k.GetCreatorPrefixStore(ctx, creator)
+ store.Set([]byte(denom), []byte(denom))
+}
+
+func (k Keeper) GetDenomsFromCreator(ctx sdk.Context, creator string) []string {
+ store := k.GetCreatorPrefixStore(ctx, creator)
+
+ iterator := store.Iterator(nil, nil)
+ defer iterator.Close()
+
+ denoms := []string{}
+ for ; iterator.Valid(); iterator.Next() {
+ denoms = append(denoms, string(iterator.Key()))
+ }
+ return denoms
+}
+
+func (k Keeper) GetAllDenomsIterator(ctx sdk.Context) sdk.Iterator {
+ return k.GetCreatorsPrefixStore(ctx).Iterator(nil, nil)
+}
diff --git a/x/tokenfactory/keeper/genesis.go b/x/tokenfactory/keeper/genesis.go
new file mode 100644
index 0000000000..62b4363ea4
--- /dev/null
+++ b/x/tokenfactory/keeper/genesis.go
@@ -0,0 +1,58 @@
+package keeper
+
+import (
+ sdk "github.com/cosmos/cosmos-sdk/types"
+
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+)
+
+// InitGenesis initializes the tokenfactory module's state from a provided genesis
+// state.
+func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState) {
+ k.CreateModuleAccount(ctx)
+
+ if genState.Params.DenomCreationFee == nil {
+ genState.Params.DenomCreationFee = sdk.NewCoins()
+ }
+ k.SetParams(ctx, genState.Params)
+
+ for _, genDenom := range genState.GetFactoryDenoms() {
+ creator, _, err := types.DeconstructDenom(genDenom.GetDenom())
+ if err != nil {
+ panic(err)
+ }
+ err = k.createDenomAfterValidation(ctx, creator, genDenom.GetDenom())
+ if err != nil {
+ panic(err)
+ }
+ err = k.setAuthorityMetadata(ctx, genDenom.GetDenom(), genDenom.GetAuthorityMetadata())
+ if err != nil {
+ panic(err)
+ }
+ }
+}
+
+// ExportGenesis returns the tokenfactory module's exported genesis.
+func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState {
+ genDenoms := []types.GenesisDenom{}
+ iterator := k.GetAllDenomsIterator(ctx)
+ defer iterator.Close()
+ for ; iterator.Valid(); iterator.Next() {
+ denom := string(iterator.Value())
+
+ authorityMetadata, err := k.GetAuthorityMetadata(ctx, denom)
+ if err != nil {
+ panic(err)
+ }
+
+ genDenoms = append(genDenoms, types.GenesisDenom{
+ Denom: denom,
+ AuthorityMetadata: authorityMetadata,
+ })
+ }
+
+ return &types.GenesisState{
+ FactoryDenoms: genDenoms,
+ Params: k.GetParams(ctx),
+ }
+}
diff --git a/x/tokenfactory/keeper/genesis_test.go b/x/tokenfactory/keeper/genesis_test.go
new file mode 100644
index 0000000000..d729de7216
--- /dev/null
+++ b/x/tokenfactory/keeper/genesis_test.go
@@ -0,0 +1,59 @@
+package keeper_test
+
+import (
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
+
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+)
+
+func (suite *KeeperTestSuite) TestGenesis() {
+ genesisState := types.GenesisState{
+ FactoryDenoms: []types.GenesisDenom{
+ {
+ Denom: "factory/cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8/bitcoin",
+ AuthorityMetadata: types.DenomAuthorityMetadata{
+ Admin: "cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8",
+ },
+ },
+ {
+ Denom: "factory/cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8/diff-admin",
+ AuthorityMetadata: types.DenomAuthorityMetadata{
+ Admin: "cosmos15czt5nhlnvayqq37xun9s9yus0d6y26dx74r5p",
+ },
+ },
+ {
+ Denom: "factory/cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8/litecoin",
+ AuthorityMetadata: types.DenomAuthorityMetadata{
+ Admin: "cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8",
+ },
+ },
+ },
+ }
+
+ suite.SetupTestForInitGenesis()
+ app := suite.App
+
+ // Test both with bank denom metadata set, and not set.
+ for i, denom := range genesisState.FactoryDenoms {
+ // hacky, sets bank metadata to exist if i != 0, to cover both cases.
+ if i != 0 {
+ app.BankKeeper.SetDenomMetaData(suite.Ctx, banktypes.Metadata{Base: denom.GetDenom()})
+ }
+ }
+
+ // check before initGenesis that the module account is nil
+ tokenfactoryModuleAccount := app.AccountKeeper.GetAccount(suite.Ctx, app.AccountKeeper.GetModuleAddress(types.ModuleName))
+ suite.Require().Nil(tokenfactoryModuleAccount)
+
+ app.TokenFactoryKeeper.SetParams(suite.Ctx, types.Params{DenomCreationFee: sdk.Coins{sdk.NewInt64Coin("uosmo", 100)}})
+ app.TokenFactoryKeeper.InitGenesis(suite.Ctx, genesisState)
+
+ // check that the module account is now initialized
+ tokenfactoryModuleAccount = app.AccountKeeper.GetAccount(suite.Ctx, app.AccountKeeper.GetModuleAddress(types.ModuleName))
+ suite.Require().NotNil(tokenfactoryModuleAccount)
+
+ exportedGenesis := app.TokenFactoryKeeper.ExportGenesis(suite.Ctx)
+ suite.Require().NotNil(exportedGenesis)
+ suite.Require().Equal(genesisState, *exportedGenesis)
+}
diff --git a/x/tokenfactory/keeper/grpc_query.go b/x/tokenfactory/keeper/grpc_query.go
new file mode 100644
index 0000000000..8057bd0d4d
--- /dev/null
+++ b/x/tokenfactory/keeper/grpc_query.go
@@ -0,0 +1,35 @@
+package keeper
+
+import (
+ "context"
+
+ sdk "github.com/cosmos/cosmos-sdk/types"
+
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+)
+
+var _ types.QueryServer = Keeper{}
+
+func (k Keeper) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) {
+ sdkCtx := sdk.UnwrapSDKContext(ctx)
+ params := k.GetParams(sdkCtx)
+
+ return &types.QueryParamsResponse{Params: params}, nil
+}
+
+func (k Keeper) DenomAuthorityMetadata(ctx context.Context, req *types.QueryDenomAuthorityMetadataRequest) (*types.QueryDenomAuthorityMetadataResponse, error) {
+ sdkCtx := sdk.UnwrapSDKContext(ctx)
+
+ authorityMetadata, err := k.GetAuthorityMetadata(sdkCtx, req.GetDenom())
+ if err != nil {
+ return nil, err
+ }
+
+ return &types.QueryDenomAuthorityMetadataResponse{AuthorityMetadata: authorityMetadata}, nil
+}
+
+func (k Keeper) DenomsFromCreator(ctx context.Context, req *types.QueryDenomsFromCreatorRequest) (*types.QueryDenomsFromCreatorResponse, error) {
+ sdkCtx := sdk.UnwrapSDKContext(ctx)
+ denoms := k.GetDenomsFromCreator(sdkCtx, req.GetCreator())
+ return &types.QueryDenomsFromCreatorResponse{Denoms: denoms}, nil
+}
diff --git a/x/tokenfactory/keeper/keeper.go b/x/tokenfactory/keeper/keeper.go
new file mode 100644
index 0000000000..42c2484628
--- /dev/null
+++ b/x/tokenfactory/keeper/keeper.go
@@ -0,0 +1,82 @@
+package keeper
+
+import (
+ "fmt"
+
+ "github.com/cometbft/cometbft/libs/log"
+
+ "github.com/cosmos/cosmos-sdk/store/prefix"
+ storetypes "github.com/cosmos/cosmos-sdk/store/types"
+ sdk "github.com/cosmos/cosmos-sdk/types"
+
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+
+ authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
+ paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
+)
+
+type (
+ Keeper struct {
+ storeKey storetypes.StoreKey
+
+ paramSpace paramtypes.Subspace
+
+ accountKeeper types.AccountKeeper
+ bankKeeper types.BankKeeper
+ communityPoolKeeper types.CommunityPoolKeeper
+ }
+)
+
+// NewKeeper returns a new instance of the x/tokenfactory keeper
+func NewKeeper(
+ storeKey storetypes.StoreKey,
+ paramSpace paramtypes.Subspace,
+ accountKeeper types.AccountKeeper,
+ bankKeeper types.BankKeeper,
+ communityPoolKeeper types.CommunityPoolKeeper,
+) Keeper {
+ if !paramSpace.HasKeyTable() {
+ paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable())
+ }
+
+ return Keeper{
+ storeKey: storeKey,
+ paramSpace: paramSpace,
+
+ accountKeeper: accountKeeper,
+ bankKeeper: bankKeeper,
+ communityPoolKeeper: communityPoolKeeper,
+ }
+}
+
+// Logger returns a logger for the x/tokenfactory module
+func (k Keeper) Logger(ctx sdk.Context) log.Logger {
+ return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName))
+}
+
+// GetDenomPrefixStore returns the substore for a specific denom
+func (k Keeper) GetDenomPrefixStore(ctx sdk.Context, denom string) sdk.KVStore {
+ store := ctx.KVStore(k.storeKey)
+ return prefix.NewStore(store, types.GetDenomPrefixStore(denom))
+}
+
+// GetCreatorPrefixStore returns the substore for a specific creator address
+func (k Keeper) GetCreatorPrefixStore(ctx sdk.Context, creator string) sdk.KVStore {
+ store := ctx.KVStore(k.storeKey)
+ return prefix.NewStore(store, types.GetCreatorPrefix(creator))
+}
+
+// GetCreatorsPrefixStore returns the substore that contains a list of creators
+func (k Keeper) GetCreatorsPrefixStore(ctx sdk.Context) sdk.KVStore {
+ store := ctx.KVStore(k.storeKey)
+ return prefix.NewStore(store, types.GetCreatorsPrefix())
+}
+
+// CreateModuleAccount creates a module account with minting and burning capabilities
+// This account isn't intended to store any coins,
+// it purely mints and burns them on behalf of the admin of respective denoms,
+// and sends to the relevant address.
+func (k Keeper) CreateModuleAccount(ctx sdk.Context) {
+ moduleAcc := authtypes.NewEmptyModuleAccount(types.ModuleName, authtypes.Minter, authtypes.Burner)
+ k.accountKeeper.SetModuleAccount(ctx, moduleAcc)
+}
diff --git a/x/tokenfactory/keeper/keeper_test.go b/x/tokenfactory/keeper/keeper_test.go
new file mode 100644
index 0000000000..4f9de8f71c
--- /dev/null
+++ b/x/tokenfactory/keeper/keeper_test.go
@@ -0,0 +1,64 @@
+package keeper_test
+
+import (
+ "testing"
+
+ tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ "github.com/stretchr/testify/suite"
+
+ "github.com/CosmWasm/wasmd/app/apptesting"
+ "github.com/CosmWasm/wasmd/x/tokenfactory/keeper"
+ "github.com/CosmWasm/wasmd/x/tokenfactory/testhelpers"
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+)
+
+type KeeperTestSuite struct {
+ apptesting.KeeperTestHelper
+
+ queryClient types.QueryClient
+ msgServer types.MsgServer
+ // defaultDenom is on the suite, as it depends on the creator test address.
+ defaultDenom string
+}
+
+func TestKeeperTestSuite(t *testing.T) {
+ suite.Run(t, new(KeeperTestSuite))
+}
+
+func (suite *KeeperTestSuite) SetupTest() {
+ suite.Setup()
+ // Fund every TestAcc with two denoms, one of which is the denom creation fee
+ fundAccsAmount := sdk.NewCoins(sdk.NewCoin(types.DefaultParams().DenomCreationFee[0].Denom, types.DefaultParams().DenomCreationFee[0].Amount.MulRaw(100)), sdk.NewCoin(testhelpers.SecondaryDenom, testhelpers.SecondaryAmount))
+ for _, acc := range suite.TestAccs {
+ suite.FundAcc(acc, fundAccsAmount)
+ }
+
+ suite.queryClient = types.NewQueryClient(suite.QueryHelper)
+ suite.msgServer = keeper.NewMsgServerImpl(suite.App.TokenFactoryKeeper)
+}
+
+func (suite *KeeperTestSuite) CreateDefaultDenom() {
+ res, _ := suite.msgServer.CreateDenom(sdk.WrapSDKContext(suite.Ctx), types.NewMsgCreateDenom(suite.TestAccs[0].String(), "bitcoin"))
+ suite.defaultDenom = res.GetNewTokenDenom()
+}
+
+func (suite *KeeperTestSuite) TestCreateModuleAccount() {
+ app := suite.App
+
+ // remove module account
+ tokenfactoryModuleAccount := app.AccountKeeper.GetAccount(suite.Ctx, app.AccountKeeper.GetModuleAddress(types.ModuleName))
+ app.AccountKeeper.RemoveAccount(suite.Ctx, tokenfactoryModuleAccount)
+
+ // ensure module account was removed
+ suite.Ctx = app.BaseApp.NewContext(false, tmproto.Header{})
+ tokenfactoryModuleAccount = app.AccountKeeper.GetAccount(suite.Ctx, app.AccountKeeper.GetModuleAddress(types.ModuleName))
+ suite.Require().Nil(tokenfactoryModuleAccount)
+
+ // create module account
+ app.TokenFactoryKeeper.CreateModuleAccount(suite.Ctx)
+
+ // check that the module account is now initialized
+ tokenfactoryModuleAccount = app.AccountKeeper.GetAccount(suite.Ctx, app.AccountKeeper.GetModuleAddress(types.ModuleName))
+ suite.Require().NotNil(tokenfactoryModuleAccount)
+}
diff --git a/x/tokenfactory/keeper/msg_server.go b/x/tokenfactory/keeper/msg_server.go
new file mode 100644
index 0000000000..101aacab82
--- /dev/null
+++ b/x/tokenfactory/keeper/msg_server.go
@@ -0,0 +1,191 @@
+package keeper
+
+import (
+ "context"
+
+ sdk "github.com/cosmos/cosmos-sdk/types"
+
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+)
+
+type msgServer struct {
+ Keeper
+}
+
+// NewMsgServerImpl returns an implementation of the MsgServer interface
+// for the provided Keeper.
+func NewMsgServerImpl(keeper Keeper) types.MsgServer {
+ return &msgServer{Keeper: keeper}
+}
+
+var _ types.MsgServer = msgServer{}
+
+func (server msgServer) CreateDenom(goCtx context.Context, msg *types.MsgCreateDenom) (*types.MsgCreateDenomResponse, error) {
+ ctx := sdk.UnwrapSDKContext(goCtx)
+
+ denom, err := server.Keeper.CreateDenom(ctx, msg.Sender, msg.Subdenom)
+ if err != nil {
+ return nil, err
+ }
+
+ ctx.EventManager().EmitEvents(sdk.Events{
+ sdk.NewEvent(
+ types.TypeMsgCreateDenom,
+ sdk.NewAttribute(types.AttributeCreator, msg.Sender),
+ sdk.NewAttribute(types.AttributeNewTokenDenom, denom),
+ ),
+ })
+
+ return &types.MsgCreateDenomResponse{
+ NewTokenDenom: denom,
+ }, nil
+}
+
+func (server msgServer) Mint(goCtx context.Context, msg *types.MsgMint) (*types.MsgMintResponse, error) {
+ ctx := sdk.UnwrapSDKContext(goCtx)
+
+ // pay some extra gas cost to give a better error here.
+ _, denomExists := server.bankKeeper.GetDenomMetaData(ctx, msg.Amount.Denom)
+ if !denomExists {
+ return nil, types.ErrDenomDoesNotExist.Wrapf("denom: %s", msg.Amount.Denom)
+ }
+
+ authorityMetadata, err := server.Keeper.GetAuthorityMetadata(ctx, msg.Amount.GetDenom())
+ if err != nil {
+ return nil, err
+ }
+
+ if msg.Sender != authorityMetadata.GetAdmin() {
+ return nil, types.ErrUnauthorized
+ }
+
+ err = server.Keeper.mintTo(ctx, msg.Amount, msg.Sender)
+ if err != nil {
+ return nil, err
+ }
+
+ ctx.EventManager().EmitEvents(sdk.Events{
+ sdk.NewEvent(
+ types.TypeMsgMint,
+ sdk.NewAttribute(types.AttributeMintToAddress, msg.Sender),
+ sdk.NewAttribute(types.AttributeAmount, msg.Amount.String()),
+ ),
+ })
+
+ return &types.MsgMintResponse{}, nil
+}
+
+func (server msgServer) Burn(goCtx context.Context, msg *types.MsgBurn) (*types.MsgBurnResponse, error) {
+ ctx := sdk.UnwrapSDKContext(goCtx)
+
+ authorityMetadata, err := server.Keeper.GetAuthorityMetadata(ctx, msg.Amount.GetDenom())
+ if err != nil {
+ return nil, err
+ }
+
+ if msg.Sender != authorityMetadata.GetAdmin() {
+ return nil, types.ErrUnauthorized
+ }
+
+ err = server.Keeper.burnFrom(ctx, msg.Amount, msg.Sender)
+ if err != nil {
+ return nil, err
+ }
+
+ ctx.EventManager().EmitEvents(sdk.Events{
+ sdk.NewEvent(
+ types.TypeMsgBurn,
+ sdk.NewAttribute(types.AttributeBurnFromAddress, msg.Sender),
+ sdk.NewAttribute(types.AttributeAmount, msg.Amount.String()),
+ ),
+ })
+
+ return &types.MsgBurnResponse{}, nil
+}
+
+// func (server msgServer) ForceTransfer(goCtx context.Context, msg *types.MsgForceTransfer) (*types.MsgForceTransferResponse, error) {
+// ctx := sdk.UnwrapSDKContext(goCtx)
+
+// authorityMetadata, err := server.Keeper.GetAuthorityMetadata(ctx, msg.Amount.GetDenom())
+// if err != nil {
+// return nil, err
+// }
+
+// if msg.Sender != authorityMetadata.GetAdmin() {
+// return nil, types.ErrUnauthorized
+// }
+
+// err = server.Keeper.forceTransfer(ctx, msg.Amount, msg.TransferFromAddress, msg.TransferToAddress)
+// if err != nil {
+// return nil, err
+// }
+
+// ctx.EventManager().EmitEvents(sdk.Events{
+// sdk.NewEvent(
+// types.TypeMsgForceTransfer,
+// sdk.NewAttribute(types.AttributeTransferFromAddress, msg.TransferFromAddress),
+// sdk.NewAttribute(types.AttributeTransferToAddress, msg.TransferToAddress),
+// sdk.NewAttribute(types.AttributeAmount, msg.Amount.String()),
+// ),
+// })
+
+// return &types.MsgForceTransferResponse{}, nil
+// }
+
+func (server msgServer) ChangeAdmin(goCtx context.Context, msg *types.MsgChangeAdmin) (*types.MsgChangeAdminResponse, error) {
+ ctx := sdk.UnwrapSDKContext(goCtx)
+
+ authorityMetadata, err := server.Keeper.GetAuthorityMetadata(ctx, msg.Denom)
+ if err != nil {
+ return nil, err
+ }
+
+ if msg.Sender != authorityMetadata.GetAdmin() {
+ return nil, types.ErrUnauthorized
+ }
+
+ err = server.Keeper.setAdmin(ctx, msg.Denom, msg.NewAdmin)
+ if err != nil {
+ return nil, err
+ }
+ ctx.EventManager().EmitEvents(sdk.Events{
+ sdk.NewEvent(
+ types.TypeMsgChangeAdmin,
+ sdk.NewAttribute(types.AttributeDenom, msg.GetDenom()),
+ sdk.NewAttribute(types.AttributeNewAdmin, msg.NewAdmin),
+ ),
+ })
+
+ return &types.MsgChangeAdminResponse{}, nil
+}
+
+func (server msgServer) SetDenomMetadata(goCtx context.Context, msg *types.MsgSetDenomMetadata) (*types.MsgSetDenomMetadataResponse, error) {
+ ctx := sdk.UnwrapSDKContext(goCtx)
+
+ // Defense in depth validation of metadata
+ err := msg.Metadata.Validate()
+ if err != nil {
+ return nil, err
+ }
+
+ authorityMetadata, err := server.Keeper.GetAuthorityMetadata(ctx, msg.Metadata.Base)
+ if err != nil {
+ return nil, err
+ }
+
+ if msg.Sender != authorityMetadata.GetAdmin() {
+ return nil, types.ErrUnauthorized
+ }
+
+ server.Keeper.bankKeeper.SetDenomMetaData(ctx, msg.Metadata)
+
+ ctx.EventManager().EmitEvents(sdk.Events{
+ sdk.NewEvent(
+ types.TypeMsgSetDenomMetadata,
+ sdk.NewAttribute(types.AttributeDenom, msg.Metadata.Base),
+ sdk.NewAttribute(types.AttributeDenomMetadata, msg.Metadata.String()),
+ ),
+ })
+
+ return &types.MsgSetDenomMetadataResponse{}, nil
+}
diff --git a/x/tokenfactory/keeper/msg_server_test.go b/x/tokenfactory/keeper/msg_server_test.go
new file mode 100644
index 0000000000..38064d2107
--- /dev/null
+++ b/x/tokenfactory/keeper/msg_server_test.go
@@ -0,0 +1,247 @@
+package keeper_test
+
+import (
+ "fmt"
+
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
+)
+
+// TestMintDenomMsg tests TypeMsgMint message is emitted on a successful mint
+func (suite *KeeperTestSuite) TestMintDenomMsg() {
+ // Create a denom
+ suite.CreateDefaultDenom()
+
+ for _, tc := range []struct {
+ desc string
+ amount int64
+ mintDenom string
+ admin string
+ valid bool
+ expectedMessageEvents int
+ }{
+ {
+ desc: "denom does not exist",
+ amount: 10,
+ mintDenom: "factory/osmo1t7egva48prqmzl59x5ngv4zx0dtrwewc9m7z44/evmos",
+ admin: suite.TestAccs[0].String(),
+ valid: false,
+ },
+ {
+ desc: "success case",
+ amount: 10,
+ mintDenom: suite.defaultDenom,
+ admin: suite.TestAccs[0].String(),
+ valid: true,
+ expectedMessageEvents: 1,
+ },
+ } {
+ suite.Run(fmt.Sprintf("Case %s", tc.desc), func() {
+ ctx := suite.Ctx.WithEventManager(sdk.NewEventManager())
+ suite.Require().Equal(0, len(ctx.EventManager().Events()))
+ // Test mint message
+ suite.msgServer.Mint(sdk.WrapSDKContext(ctx), types.NewMsgMint(tc.admin, sdk.NewInt64Coin(tc.mintDenom, 10))) //nolint:errcheck
+ // Ensure current number and type of event is emitted
+ suite.AssertEventEmitted(ctx, types.TypeMsgMint, tc.expectedMessageEvents)
+ })
+ }
+}
+
+// TestBurnDenomMsg tests TypeMsgBurn message is emitted on a successful burn
+func (suite *KeeperTestSuite) TestBurnDenomMsg() {
+ // Create a denom.
+ suite.CreateDefaultDenom()
+ // mint 10 default token for testAcc[0]
+ suite.msgServer.Mint(sdk.WrapSDKContext(suite.Ctx), types.NewMsgMint(suite.TestAccs[0].String(), sdk.NewInt64Coin(suite.defaultDenom, 10))) //nolint:errcheck
+
+ for _, tc := range []struct {
+ desc string
+ amount int64
+ burnDenom string
+ admin string
+ valid bool
+ expectedMessageEvents int
+ }{
+ {
+ desc: "denom does not exist",
+ burnDenom: "factory/osmo1t7egva48prqmzl59x5ngv4zx0dtrwewc9m7z44/evmos",
+ admin: suite.TestAccs[0].String(),
+ valid: false,
+ },
+ {
+ desc: "success case",
+ burnDenom: suite.defaultDenom,
+ admin: suite.TestAccs[0].String(),
+ valid: true,
+ expectedMessageEvents: 1,
+ },
+ } {
+ suite.Run(fmt.Sprintf("Case %s", tc.desc), func() {
+ ctx := suite.Ctx.WithEventManager(sdk.NewEventManager())
+ suite.Require().Equal(0, len(ctx.EventManager().Events()))
+ // Test burn message
+ suite.msgServer.Burn(sdk.WrapSDKContext(ctx), types.NewMsgBurn(tc.admin, sdk.NewInt64Coin(tc.burnDenom, 10))) //nolint:errcheck
+ // Ensure current number and type of event is emitted
+ suite.AssertEventEmitted(ctx, types.TypeMsgBurn, tc.expectedMessageEvents)
+ })
+ }
+}
+
+// TestCreateDenomMsg tests TypeMsgCreateDenom message is emitted on a successful denom creation
+func (suite *KeeperTestSuite) TestCreateDenomMsg() {
+ defaultDenomCreationFee := types.Params{DenomCreationFee: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(50000000)))}
+ for _, tc := range []struct {
+ desc string
+ denomCreationFee types.Params
+ subdenom string
+ valid bool
+ expectedMessageEvents int
+ }{
+ {
+ desc: "subdenom too long",
+ denomCreationFee: defaultDenomCreationFee,
+ subdenom: "assadsadsadasdasdsadsadsadsadsadsadsklkadaskkkdasdasedskhanhassyeunganassfnlksdflksafjlkasd",
+ valid: false,
+ },
+ {
+ desc: "success case: defaultDenomCreationFee",
+ denomCreationFee: defaultDenomCreationFee,
+ subdenom: "evmos",
+ valid: true,
+ expectedMessageEvents: 1,
+ },
+ } {
+ suite.SetupTest()
+ suite.Run(fmt.Sprintf("Case %s", tc.desc), func() {
+ tokenFactoryKeeper := suite.App.TokenFactoryKeeper
+ ctx := suite.Ctx.WithEventManager(sdk.NewEventManager())
+ suite.Require().Equal(0, len(ctx.EventManager().Events()))
+ // Set denom creation fee in params
+ tokenFactoryKeeper.SetParams(suite.Ctx, tc.denomCreationFee)
+ // Test create denom message
+ suite.msgServer.CreateDenom(sdk.WrapSDKContext(ctx), types.NewMsgCreateDenom(suite.TestAccs[0].String(), tc.subdenom)) //nolint:errcheck
+ // Ensure current number and type of event is emitted
+ suite.AssertEventEmitted(ctx, types.TypeMsgCreateDenom, tc.expectedMessageEvents)
+ })
+ }
+}
+
+// TestChangeAdminDenomMsg tests TypeMsgChangeAdmin message is emitted on a successful admin change
+func (suite *KeeperTestSuite) TestChangeAdminDenomMsg() {
+ for _, tc := range []struct {
+ desc string
+ msgChangeAdmin func(denom string) *types.MsgChangeAdmin
+ expectedChangeAdminPass bool
+ expectedAdminIndex int
+ msgMint func(denom string) *types.MsgMint
+ expectedMintPass bool
+ expectedMessageEvents int
+ }{
+ {
+ desc: "non-admins can't change the existing admin",
+ msgChangeAdmin: func(denom string) *types.MsgChangeAdmin {
+ return types.NewMsgChangeAdmin(suite.TestAccs[1].String(), denom, suite.TestAccs[2].String())
+ },
+ expectedChangeAdminPass: false,
+ expectedAdminIndex: 0,
+ },
+ {
+ desc: "success change admin",
+ msgChangeAdmin: func(denom string) *types.MsgChangeAdmin {
+ return types.NewMsgChangeAdmin(suite.TestAccs[0].String(), denom, suite.TestAccs[1].String())
+ },
+ expectedAdminIndex: 1,
+ expectedChangeAdminPass: true,
+ expectedMessageEvents: 1,
+ msgMint: func(denom string) *types.MsgMint {
+ return types.NewMsgMint(suite.TestAccs[1].String(), sdk.NewInt64Coin(denom, 5))
+ },
+ expectedMintPass: true,
+ },
+ } {
+ suite.Run(fmt.Sprintf("Case %s", tc.desc), func() {
+ // setup test
+ suite.SetupTest()
+ ctx := suite.Ctx.WithEventManager(sdk.NewEventManager())
+ suite.Require().Equal(0, len(ctx.EventManager().Events()))
+ // Create a denom and mint
+ res, err := suite.msgServer.CreateDenom(sdk.WrapSDKContext(ctx), types.NewMsgCreateDenom(suite.TestAccs[0].String(), "bitcoin"))
+ suite.Require().NoError(err)
+ testDenom := res.GetNewTokenDenom()
+ suite.msgServer.Mint(sdk.WrapSDKContext(ctx), types.NewMsgMint(suite.TestAccs[0].String(), sdk.NewInt64Coin(testDenom, 10))) //nolint:errcheck
+ // Test change admin message
+ suite.msgServer.ChangeAdmin(sdk.WrapSDKContext(ctx), tc.msgChangeAdmin(testDenom)) //nolint:errcheck
+ // Ensure current number and type of event is emitted
+ suite.AssertEventEmitted(ctx, types.TypeMsgChangeAdmin, tc.expectedMessageEvents)
+ })
+ }
+}
+
+// TestSetDenomMetaDataMsg tests TypeMsgSetDenomMetadata message is emitted on a successful denom metadata change
+func (suite *KeeperTestSuite) TestSetDenomMetaDataMsg() {
+ // setup test
+ suite.SetupTest()
+ suite.CreateDefaultDenom()
+
+ for _, tc := range []struct {
+ desc string
+ msgSetDenomMetadata types.MsgSetDenomMetadata
+ expectedPass bool
+ expectedMessageEvents int
+ }{
+ {
+ desc: "successful set denom metadata",
+ msgSetDenomMetadata: *types.NewMsgSetDenomMetadata(suite.TestAccs[0].String(), banktypes.Metadata{
+ Description: "yeehaw",
+ DenomUnits: []*banktypes.DenomUnit{
+ {
+ Denom: suite.defaultDenom,
+ Exponent: 0,
+ },
+ {
+ Denom: "uosmo",
+ Exponent: 6,
+ },
+ },
+ Base: suite.defaultDenom,
+ Display: "uosmo",
+ Name: "OSMO",
+ Symbol: "OSMO",
+ }),
+ expectedPass: true,
+ expectedMessageEvents: 1,
+ },
+ {
+ desc: "non existent factory denom name",
+ msgSetDenomMetadata: *types.NewMsgSetDenomMetadata(suite.TestAccs[0].String(), banktypes.Metadata{
+ Description: "yeehaw",
+ DenomUnits: []*banktypes.DenomUnit{
+ {
+ Denom: fmt.Sprintf("factory/%s/litecoin", suite.TestAccs[0].String()),
+ Exponent: 0,
+ },
+ {
+ Denom: "uosmo",
+ Exponent: 6,
+ },
+ },
+ Base: fmt.Sprintf("factory/%s/litecoin", suite.TestAccs[0].String()),
+ Display: "uosmo",
+ Name: "OSMO",
+ Symbol: "OSMO",
+ }),
+ expectedPass: false,
+ },
+ } {
+ suite.Run(fmt.Sprintf("Case %s", tc.desc), func() {
+ ctx := suite.Ctx.WithEventManager(sdk.NewEventManager())
+ suite.Require().Equal(0, len(ctx.EventManager().Events()))
+ // Test set denom metadata message
+ suite.msgServer.SetDenomMetadata(sdk.WrapSDKContext(ctx), &tc.msgSetDenomMetadata) //nolint:errcheck
+ // Ensure current number and type of event is emitted
+ suite.AssertEventEmitted(ctx, types.TypeMsgSetDenomMetadata, tc.expectedMessageEvents)
+ })
+ }
+}
diff --git a/x/tokenfactory/keeper/params.go b/x/tokenfactory/keeper/params.go
new file mode 100644
index 0000000000..c316d1fda6
--- /dev/null
+++ b/x/tokenfactory/keeper/params.go
@@ -0,0 +1,18 @@
+package keeper
+
+import (
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+
+ sdk "github.com/cosmos/cosmos-sdk/types"
+)
+
+// GetParams returns the total set params.
+func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) {
+ k.paramSpace.GetParamSet(ctx, ¶ms)
+ return params
+}
+
+// SetParams sets the total set of params.
+func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
+ k.paramSpace.SetParamSet(ctx, ¶ms)
+}
diff --git a/x/tokenfactory/module.go b/x/tokenfactory/module.go
new file mode 100644
index 0000000000..7c4ebed74b
--- /dev/null
+++ b/x/tokenfactory/module.go
@@ -0,0 +1,219 @@
+/*
+The tokenfactory module allows any account to create a new token with
+the name `factory/{creator address}/{subdenom}`.
+
+- Mint and burn user denom to and form any account
+- Create a transfer of their denom between any two accounts
+- Change the admin. In the future, more admin capabilities may be added.
+*/
+package tokenfactory
+
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+ "math/rand"
+
+ abci "github.com/cometbft/cometbft/abci/types"
+ "github.com/cosmos/cosmos-sdk/client"
+ "github.com/cosmos/cosmos-sdk/codec"
+ cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ "github.com/cosmos/cosmos-sdk/types/module"
+ "github.com/gorilla/mux"
+ "github.com/grpc-ecosystem/grpc-gateway/runtime"
+ "github.com/spf13/cobra"
+
+ simulation "github.com/CosmWasm/wasmd/x/tokenfactory/simulation"
+ simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
+
+ "github.com/CosmWasm/wasmd/x/tokenfactory/client/cli"
+ "github.com/CosmWasm/wasmd/x/tokenfactory/keeper"
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+)
+
+var (
+ _ module.AppModule = AppModule{}
+ _ module.AppModuleBasic = AppModuleBasic{}
+)
+
+// ----------------------------------------------------------------------------
+// AppModuleBasic
+// ----------------------------------------------------------------------------
+
+// AppModuleBasic implements the AppModuleBasic interface for the capability module.
+type AppModuleBasic struct{}
+
+func NewAppModuleBasic() AppModuleBasic {
+ return AppModuleBasic{}
+}
+
+// Name returns the x/tokenfactory module's name.
+func (AppModuleBasic) Name() string {
+ return types.ModuleName
+}
+
+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 x/tokenfactory 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 x/tokenfactory 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) {
+ types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) //nolint:errcheck
+}
+
+// GetTxCmd returns the x/tokenfactory module's root tx command.
+func (a AppModuleBasic) GetTxCmd() *cobra.Command {
+ return cli.GetTxCmd()
+}
+
+// GetQueryCmd returns the x/tokenfactory module's root query command.
+func (AppModuleBasic) GetQueryCmd() *cobra.Command {
+ return cli.GetQueryCmd()
+}
+
+// ----------------------------------------------------------------------------
+// AppModule
+// ----------------------------------------------------------------------------
+
+// AppModule implements the AppModule interface for the capability module.
+type AppModule struct {
+ AppModuleBasic
+
+ keeper keeper.Keeper
+ accountKeeper types.AccountKeeper
+ bankKeeper types.BankKeeper
+}
+
+func NewAppModule(
+ keeper keeper.Keeper,
+ accountKeeper types.AccountKeeper,
+ bankKeeper types.BankKeeper,
+) AppModule {
+ return AppModule{
+ AppModuleBasic: NewAppModuleBasic(),
+ keeper: keeper,
+ accountKeeper: accountKeeper,
+ bankKeeper: bankKeeper,
+ }
+}
+
+// Name returns the x/tokenfactory module's name.
+func (am AppModule) Name() string {
+ return am.AppModuleBasic.Name()
+}
+
+// QuerierRoute returns the x/tokenfactory module's query routing key.
+func (AppModule) QuerierRoute() string { return types.QuerierRoute }
+
+// RegisterServices registers a GRPC query service to respond to the
+// module-specific GRPC queries.
+func (am AppModule) RegisterServices(cfg module.Configurator) {
+ types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper))
+ types.RegisterQueryServer(cfg.QueryServer(), am.keeper)
+}
+
+// RegisterInvariants registers the x/tokenfactory module's invariants.
+func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {}
+
+// InitGenesis performs the x/tokenfactory module's genesis initialization. It
+// returns no validator updates.
+func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate {
+ var genState types.GenesisState
+ cdc.MustUnmarshalJSON(gs, &genState)
+
+ am.keeper.InitGenesis(ctx, genState)
+
+ return []abci.ValidatorUpdate{}
+}
+
+// ExportGenesis returns the x/tokenfactory module's exported genesis state as raw
+// JSON bytes.
+func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage {
+ genState := am.keeper.ExportGenesis(ctx)
+ return cdc.MustMarshalJSON(genState)
+}
+
+// ConsensusVersion implements ConsensusVersion.
+func (AppModule) ConsensusVersion() uint64 { return 1 }
+
+// BeginBlock executes all ABCI BeginBlock logic respective to the tokenfactory module.
+func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {}
+
+// EndBlock executes all ABCI EndBlock logic respective to the tokenfactory module. It
+// returns no validator updates.
+func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate {
+ return []abci.ValidatorUpdate{}
+}
+
+// ___________________________________________________________________________
+
+// AppModuleSimulationV2 functions
+
+// // GenerateGenesisState creates a randomized GenState of the tokenfactory module.
+// func (am AppModule) SimulatorGenesisState(simState *module.SimulationState, s *simtypes.SimCtx) {
+// tfDefaultGen := types.DefaultGenesis()
+// tfDefaultGen.Params.DenomCreationFee = sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(10000000)))
+// tfDefaultGenJson := simState.Cdc.MustMarshalJSON(tfDefaultGen)
+// simState.GenState[types.ModuleName] = tfDefaultGenJson
+// }
+
+// // WeightedOperations returns the all the lockup module operations with their respective weights.
+// func (am AppModule) Actions() []simtypes.Action {
+// return []simtypes.Action{
+// simtypes.NewMsgBasedAction("create token factory token", am.keeper, simulation.RandomMsgCreateDenom),
+// simtypes.NewMsgBasedAction("mint token factory token", am.keeper, simulation.RandomMsgMintDenom),
+// simtypes.NewMsgBasedAction("burn token factory token", am.keeper, simulation.RandomMsgBurnDenom),
+// simtypes.NewMsgBasedAction("change admin token factory token", am.keeper, simulation.RandomMsgChangeAdmin),
+// }
+// }
+
+// ____________________________________________________________________________
+
+// AppModuleSimulation functions
+func (AppModule) GenerateGenesisState(simState *module.SimulationState) {
+ simulation.RandomizedGenState(simState)
+}
+
+// GenerateGenesisState creates a randomized GenState of the bank module.
+func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent {
+ return nil
+}
+
+// RandomizedParams creates randomized bank param changes for the simulator.
+func (am AppModule) RandomizedParams(r *rand.Rand) []simtypes.LegacyParamChange {
+ return simulation.ParamChanges(r)
+}
+
+// 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 simulation.WeightedOperations(&simState, am.keeper, am.accountKeeper, am.bankKeeper)
+}
diff --git a/x/tokenfactory/simulation/genesis.go b/x/tokenfactory/simulation/genesis.go
new file mode 100644
index 0000000000..5c31a705d7
--- /dev/null
+++ b/x/tokenfactory/simulation/genesis.go
@@ -0,0 +1,25 @@
+package simulation
+
+import (
+ "math/rand"
+
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ "github.com/cosmos/cosmos-sdk/types/module"
+)
+
+func RandDenomCreationFeeParam(r *rand.Rand) sdk.Coins {
+ amount := r.Int63n(10_000_000)
+ return sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(amount)))
+}
+
+func RandomizedGenState(simstate *module.SimulationState) {
+ tfGenesis := types.DefaultGenesis()
+
+ _, err := simstate.Cdc.MarshalJSON(tfGenesis)
+ if err != nil {
+ panic(err)
+ }
+
+ simstate.GenState[types.ModuleName] = simstate.Cdc.MustMarshalJSON(tfGenesis)
+}
diff --git a/x/tokenfactory/simulation/operations.go b/x/tokenfactory/simulation/operations.go
new file mode 100644
index 0000000000..47da60b7d5
--- /dev/null
+++ b/x/tokenfactory/simulation/operations.go
@@ -0,0 +1,403 @@
+package simulation
+
+import (
+ "math/rand"
+
+ appparams "github.com/CosmWasm/wasmd/app/params"
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+ "github.com/cosmos/cosmos-sdk/baseapp"
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ "github.com/cosmos/cosmos-sdk/types/module"
+ simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
+ banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
+ "github.com/cosmos/cosmos-sdk/x/simulation"
+)
+
+// Simulation operation weights constants
+//
+//nolint:gosec
+const (
+ OpWeightMsgCreateDenom = "op_weight_msg_create_denom"
+ OpWeightMsgMint = "op_weight_msg_mint"
+ OpWeightMsgBurn = "op_weight_msg_burn"
+ OpWeightMsgChangeAdmin = "op_weight_msg_change_admin"
+ OpWeightMsgSetDenomMetadata = "op_weight_msg_set_denom_metadata"
+)
+
+type TokenfactoryKeeper interface {
+ GetParams(ctx sdk.Context) (params types.Params)
+ GetAuthorityMetadata(ctx sdk.Context, denom string) (types.DenomAuthorityMetadata, error)
+ GetAllDenomsIterator(ctx sdk.Context) sdk.Iterator
+ GetDenomsFromCreator(ctx sdk.Context, creator string) []string
+}
+
+type BankKeeper interface {
+ simulation.BankKeeper
+ GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
+ GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin
+}
+
+func WeightedOperations(
+ simstate *module.SimulationState,
+ tfKeeper TokenfactoryKeeper,
+ ak types.AccountKeeper,
+ bk BankKeeper,
+) simulation.WeightedOperations {
+ var (
+ weightMsgCreateDenom int
+ weightMsgMint int
+ weightMsgBurn int
+ weightMsgChangeAdmin int
+ weightMsgSetDenomMetadata int
+ )
+
+ simstate.AppParams.GetOrGenerate(simstate.Cdc, OpWeightMsgCreateDenom, &weightMsgCreateDenom, nil,
+ func(_ *rand.Rand) {
+ weightMsgCreateDenom = appparams.DefaultWeightMsgCreateDenom
+ },
+ )
+ simstate.AppParams.GetOrGenerate(simstate.Cdc, OpWeightMsgMint, &weightMsgMint, nil,
+ func(_ *rand.Rand) {
+ weightMsgMint = appparams.DefaultWeightMsgMint
+ },
+ )
+ simstate.AppParams.GetOrGenerate(simstate.Cdc, OpWeightMsgBurn, &weightMsgBurn, nil,
+ func(_ *rand.Rand) {
+ weightMsgBurn = appparams.DefaultWeightMsgBurn
+ },
+ )
+ simstate.AppParams.GetOrGenerate(simstate.Cdc, OpWeightMsgChangeAdmin, &weightMsgChangeAdmin, nil,
+ func(_ *rand.Rand) {
+ weightMsgChangeAdmin = appparams.DefaultWeightMsgChangeAdmin
+ },
+ )
+ simstate.AppParams.GetOrGenerate(simstate.Cdc, OpWeightMsgSetDenomMetadata, &weightMsgSetDenomMetadata, nil,
+ func(_ *rand.Rand) {
+ weightMsgSetDenomMetadata = appparams.DefaultWeightMsgSetDenomMetadata
+ },
+ )
+
+ return simulation.WeightedOperations{
+ simulation.NewWeightedOperation(
+ weightMsgCreateDenom,
+ SimulateMsgCreateDenom(
+ tfKeeper,
+ ak,
+ bk,
+ ),
+ ),
+ simulation.NewWeightedOperation(
+ weightMsgMint,
+ SimulateMsgMint(
+ tfKeeper,
+ ak,
+ bk,
+ DefaultSimulationDenomSelector,
+ ),
+ ),
+ simulation.NewWeightedOperation(
+ weightMsgBurn,
+ SimulateMsgBurn(
+ tfKeeper,
+ ak,
+ bk,
+ DefaultSimulationDenomSelector,
+ ),
+ ),
+ simulation.NewWeightedOperation(
+ weightMsgChangeAdmin,
+ SimulateMsgChangeAdmin(
+ tfKeeper,
+ ak,
+ bk,
+ DefaultSimulationDenomSelector,
+ ),
+ ),
+ simulation.NewWeightedOperation(
+ weightMsgSetDenomMetadata,
+ SimulateMsgSetDenomMetadata(
+ tfKeeper,
+ ak,
+ bk,
+ DefaultSimulationDenomSelector,
+ ),
+ ),
+ }
+}
+
+type DenomSelector = func(*rand.Rand, sdk.Context, TokenfactoryKeeper, string) (string, bool)
+
+func DefaultSimulationDenomSelector(r *rand.Rand, ctx sdk.Context, tfKeeper TokenfactoryKeeper, creator string) (string, bool) {
+ denoms := tfKeeper.GetDenomsFromCreator(ctx, creator)
+ if len(denoms) == 0 {
+ return "", false
+ }
+ randPos := r.Intn(len(denoms))
+
+ return denoms[randPos], true
+}
+
+func SimulateMsgSetDenomMetadata(
+ tfKeeper TokenfactoryKeeper,
+ ak types.AccountKeeper,
+ bk BankKeeper,
+ denomSelector DenomSelector,
+) simtypes.Operation {
+ return func(
+ r *rand.Rand,
+ app *baseapp.BaseApp,
+ ctx sdk.Context,
+ accs []simtypes.Account,
+ chainID string,
+ ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
+ // Get create denom account
+ createdDenomAccount, _ := simtypes.RandomAcc(r, accs)
+
+ // Get demon
+ denom, hasDenom := denomSelector(r, ctx, tfKeeper, createdDenomAccount.Address.String())
+ if !hasDenom {
+ return simtypes.NoOpMsg(types.ModuleName, types.MsgSetDenomMetadata{}.Type(), "sim account have no denom created"), nil, nil
+ }
+
+ // Get admin of the denom
+ authData, err := tfKeeper.GetAuthorityMetadata(ctx, denom)
+ if err != nil {
+ return simtypes.NoOpMsg(types.ModuleName, types.MsgSetDenomMetadata{}.Type(), "err authority metadata"), nil, err
+ }
+ adminAccount, found := simtypes.FindAccount(accs, sdk.MustAccAddressFromBech32(authData.Admin))
+ if !found {
+ return simtypes.NoOpMsg(types.ModuleName, types.MsgSetDenomMetadata{}.Type(), "admin account not found"), nil, nil
+ }
+
+ metadata := banktypes.Metadata{
+ Description: simtypes.RandStringOfLength(r, 10),
+ DenomUnits: []*banktypes.DenomUnit{{
+ Denom: denom,
+ Exponent: 0,
+ }},
+ Base: denom,
+ Display: denom,
+ Name: simtypes.RandStringOfLength(r, 10),
+ Symbol: simtypes.RandStringOfLength(r, 10),
+ }
+
+ msg := types.MsgSetDenomMetadata{
+ Sender: adminAccount.Address.String(),
+ Metadata: metadata,
+ }
+
+ txCtx := BuildOperationInput(r, app, ctx, &msg, adminAccount, ak, bk, nil)
+ return simulation.GenAndDeliverTxWithRandFees(txCtx)
+ }
+}
+
+func SimulateMsgChangeAdmin(
+ tfKeeper TokenfactoryKeeper,
+ ak types.AccountKeeper,
+ bk BankKeeper,
+ denomSelector DenomSelector,
+) simtypes.Operation {
+ return func(
+ r *rand.Rand,
+ app *baseapp.BaseApp,
+ ctx sdk.Context,
+ accs []simtypes.Account,
+ chainID string,
+ ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
+ // Get create denom account
+ createdDenomAccount, _ := simtypes.RandomAcc(r, accs)
+
+ // Get demon
+ denom, hasDenom := denomSelector(r, ctx, tfKeeper, createdDenomAccount.Address.String())
+ if !hasDenom {
+ return simtypes.NoOpMsg(types.ModuleName, types.MsgChangeAdmin{}.Type(), "sim account have no denom created"), nil, nil
+ }
+
+ // Get admin of the denom
+ authData, err := tfKeeper.GetAuthorityMetadata(ctx, denom)
+ if err != nil {
+ return simtypes.NoOpMsg(types.ModuleName, types.MsgChangeAdmin{}.Type(), "err authority metadata"), nil, err
+ }
+ curAdminAccount, found := simtypes.FindAccount(accs, sdk.MustAccAddressFromBech32(authData.Admin))
+ if !found {
+ return simtypes.NoOpMsg(types.ModuleName, types.MsgChangeAdmin{}.Type(), "admin account not found"), nil, nil
+ }
+
+ // Rand new admin account
+ newAdmin, _ := simtypes.RandomAcc(r, accs)
+ if newAdmin.Address.String() == curAdminAccount.Address.String() {
+ return simtypes.NoOpMsg(types.ModuleName, types.MsgChangeAdmin{}.Type(), "new admin cannot be the same as current admin"), nil, nil
+ }
+
+ // Create msg
+ msg := types.MsgChangeAdmin{
+ Sender: curAdminAccount.Address.String(),
+ Denom: denom,
+ NewAdmin: newAdmin.Address.String(),
+ }
+
+ txCtx := BuildOperationInput(r, app, ctx, &msg, curAdminAccount, ak, bk, nil)
+ return simulation.GenAndDeliverTxWithRandFees(txCtx)
+ }
+}
+
+func SimulateMsgBurn(
+ tfKeeper TokenfactoryKeeper,
+ ak types.AccountKeeper,
+ bk BankKeeper,
+ denomSelector DenomSelector,
+) simtypes.Operation {
+ return func(
+ r *rand.Rand,
+ app *baseapp.BaseApp,
+ ctx sdk.Context,
+ accs []simtypes.Account,
+ chainID string,
+ ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
+ // Get create denom account
+ createdDenomAccount, _ := simtypes.RandomAcc(r, accs)
+
+ // Get demon
+ denom, hasDenom := denomSelector(r, ctx, tfKeeper, createdDenomAccount.Address.String())
+ if !hasDenom {
+ return simtypes.NoOpMsg(types.ModuleName, types.MsgBurn{}.Type(), "sim account have no denom created"), nil, nil
+ }
+
+ // Get admin of the denom
+ authData, err := tfKeeper.GetAuthorityMetadata(ctx, denom)
+ if err != nil {
+ return simtypes.NoOpMsg(types.ModuleName, types.MsgBurn{}.Type(), "err authority metadata"), nil, err
+ }
+ adminAccount, found := simtypes.FindAccount(accs, sdk.MustAccAddressFromBech32(authData.Admin))
+ if !found {
+ return simtypes.NoOpMsg(types.ModuleName, types.MsgBurn{}.Type(), "admin account not found"), nil, nil
+ }
+
+ // Check if admin account balance = 0
+ accountBalance := bk.GetBalance(ctx, adminAccount.Address, denom)
+ if accountBalance.Amount.LTE(sdk.ZeroInt()) {
+ return simtypes.NoOpMsg(types.ModuleName, types.MsgBurn{}.Type(), "sim account have no balance"), nil, nil
+ }
+
+ // Rand burn amount
+ amount, _ := simtypes.RandPositiveInt(r, accountBalance.Amount)
+ burnAmount := sdk.NewCoin(denom, amount)
+
+ // Create msg
+ msg := types.MsgBurn{
+ Sender: adminAccount.Address.String(),
+ Amount: burnAmount,
+ }
+
+ txCtx := BuildOperationInput(r, app, ctx, &msg, adminAccount, ak, bk, sdk.NewCoins(burnAmount))
+ return simulation.GenAndDeliverTxWithRandFees(txCtx)
+ }
+}
+
+// Simulate msg mint denom
+func SimulateMsgMint(
+ tfKeeper TokenfactoryKeeper,
+ ak types.AccountKeeper,
+ bk BankKeeper,
+ denomSelector DenomSelector,
+) simtypes.Operation {
+ return func(
+ r *rand.Rand,
+ app *baseapp.BaseApp,
+ ctx sdk.Context,
+ accs []simtypes.Account,
+ chainID string,
+ ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
+ // Get create denom account
+ createdDenomAccount, _ := simtypes.RandomAcc(r, accs)
+
+ // Get demon
+ denom, hasDenom := denomSelector(r, ctx, tfKeeper, createdDenomAccount.Address.String())
+ if !hasDenom {
+ return simtypes.NoOpMsg(types.ModuleName, types.MsgMint{}.Type(), "sim account have no denom created"), nil, nil
+ }
+
+ // Get admin of the denom
+ authData, err := tfKeeper.GetAuthorityMetadata(ctx, denom)
+ if err != nil {
+ return simtypes.NoOpMsg(types.ModuleName, types.MsgMint{}.Type(), "err authority metadata"), nil, err
+ }
+ adminAccount, found := simtypes.FindAccount(accs, sdk.MustAccAddressFromBech32(authData.Admin))
+ if !found {
+ return simtypes.NoOpMsg(types.ModuleName, types.MsgMint{}.Type(), "admin account not found"), nil, nil
+ }
+
+ // Rand mint amount
+ mintAmount, _ := simtypes.RandPositiveInt(r, sdk.NewIntFromUint64(100_000_000))
+
+ // Create msg mint
+ msg := types.MsgMint{
+ Sender: adminAccount.Address.String(),
+ Amount: sdk.NewCoin(denom, mintAmount),
+ }
+
+ txCtx := BuildOperationInput(r, app, ctx, &msg, adminAccount, ak, bk, nil)
+ return simulation.GenAndDeliverTxWithRandFees(txCtx)
+ }
+}
+
+// Simulate msg create denom
+func SimulateMsgCreateDenom(tfKeeper TokenfactoryKeeper, ak types.AccountKeeper, bk BankKeeper) simtypes.Operation {
+ return func(
+ r *rand.Rand,
+ app *baseapp.BaseApp,
+ ctx sdk.Context,
+ accs []simtypes.Account,
+ chainID string,
+ ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
+ // Get sims account
+ simAccount, _ := simtypes.RandomAcc(r, accs)
+
+ // Check if sims account enough create fee
+ createFee := tfKeeper.GetParams(ctx).DenomCreationFee
+ balances := bk.GetAllBalances(ctx, simAccount.Address)
+ _, hasNeg := balances.SafeSub(createFee...)
+ if hasNeg {
+ return simtypes.NoOpMsg(types.ModuleName, types.MsgCreateDenom{}.Type(), "Creator not enough creation fee"), nil, nil
+ }
+
+ // Create msg create denom
+ msg := types.MsgCreateDenom{
+ Sender: simAccount.Address.String(),
+ Subdenom: simtypes.RandStringOfLength(r, 10),
+ }
+
+ txCtx := BuildOperationInput(r, app, ctx, &msg, simAccount, ak, bk, createFee)
+ return simulation.GenAndDeliverTxWithRandFees(txCtx)
+ }
+}
+
+// BuildOperationInput helper to build object
+func BuildOperationInput(
+ r *rand.Rand,
+ app *baseapp.BaseApp,
+ ctx sdk.Context,
+ msg interface {
+ sdk.Msg
+ Type() string
+ },
+ simAccount simtypes.Account,
+ ak types.AccountKeeper,
+ bk BankKeeper,
+ deposit sdk.Coins,
+) simulation.OperationInput {
+ return simulation.OperationInput{
+ R: r,
+ App: app,
+ TxGen: appparams.MakeEncodingConfig().TxConfig,
+ Cdc: nil,
+ Msg: msg,
+ MsgType: msg.Type(),
+ Context: ctx,
+ SimAccount: simAccount,
+ AccountKeeper: ak,
+ Bankkeeper: bk,
+ ModuleName: types.ModuleName,
+ CoinsSpentInMsg: deposit,
+ }
+}
diff --git a/x/tokenfactory/simulation/params.go b/x/tokenfactory/simulation/params.go
new file mode 100644
index 0000000000..f5173093d3
--- /dev/null
+++ b/x/tokenfactory/simulation/params.go
@@ -0,0 +1,23 @@
+package simulation
+
+import (
+ "fmt"
+ "math/rand"
+
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+ simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
+ "github.com/cosmos/cosmos-sdk/x/simulation"
+)
+
+func ParamChanges(r *rand.Rand) []simtypes.LegacyParamChange {
+ return []simtypes.LegacyParamChange{
+ simulation.NewSimLegacyParamChange(
+ types.ModuleName,
+ string(types.KeyDenomCreationFee),
+ func(r *rand.Rand) string {
+ amount := RandDenomCreationFeeParam(r)
+ return fmt.Sprintf("[{\"denom\":\"%v\",\"amount\":\"%v\"}]", amount[0].Denom, amount[0].Amount)
+ },
+ ),
+ }
+}
diff --git a/x/tokenfactory/testhelpers/consts.go b/x/tokenfactory/testhelpers/consts.go
new file mode 100644
index 0000000000..d7804a3726
--- /dev/null
+++ b/x/tokenfactory/testhelpers/consts.go
@@ -0,0 +1,8 @@
+package testhelpers
+
+import sdk "github.com/cosmos/cosmos-sdk/types"
+
+var (
+ SecondaryDenom = "uion"
+ SecondaryAmount = sdk.NewInt(100000000)
+)
diff --git a/x/tokenfactory/testhelpers/suite.go b/x/tokenfactory/testhelpers/suite.go
new file mode 100644
index 0000000000..b509a524dc
--- /dev/null
+++ b/x/tokenfactory/testhelpers/suite.go
@@ -0,0 +1,66 @@
+package testhelpers
+
+import (
+ "encoding/json"
+ "testing"
+ "time"
+
+ "github.com/cosmos/cosmos-sdk/x/authz"
+ "github.com/stretchr/testify/require"
+
+ "github.com/cosmos/cosmos-sdk/codec"
+ cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
+ cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
+ sdk "github.com/cosmos/cosmos-sdk/types"
+)
+
+var (
+ Amino = codec.NewLegacyAmino()
+ AuthzModuleCdc = codec.NewAminoCodec(Amino)
+)
+
+func init() {
+ cryptocodec.RegisterCrypto(Amino)
+ codec.RegisterEvidences(Amino)
+ sdk.RegisterLegacyAminoCodec(Amino)
+}
+
+func TestMessageAuthzSerialization(t *testing.T, msg sdk.Msg) {
+ someDate := time.Date(1, 1, 1, 1, 1, 1, 1, time.UTC)
+ const (
+ mockGranter string = "cosmos1abc"
+ mockGrantee string = "cosmos1xyz"
+ )
+
+ var (
+ mockMsgGrant authz.MsgGrant
+ mockMsgRevoke authz.MsgRevoke
+ mockMsgExec authz.MsgExec
+ )
+
+ // Authz: Grant Msg
+ typeURL := sdk.MsgTypeURL(msg)
+ later := someDate.Add(time.Hour)
+ grant, err := authz.NewGrant(someDate, authz.NewGenericAuthorization(typeURL), &later)
+ require.NoError(t, err)
+
+ msgGrant := authz.MsgGrant{Granter: mockGranter, Grantee: mockGrantee, Grant: grant}
+ msgGrantBytes := json.RawMessage(sdk.MustSortJSON(AuthzModuleCdc.MustMarshalJSON(&msgGrant)))
+ err = AuthzModuleCdc.UnmarshalJSON(msgGrantBytes, &mockMsgGrant)
+ require.NoError(t, err)
+
+ // Authz: Revoke Msg
+ msgRevoke := authz.MsgRevoke{Granter: mockGranter, Grantee: mockGrantee, MsgTypeUrl: typeURL}
+ msgRevokeByte := json.RawMessage(sdk.MustSortJSON(AuthzModuleCdc.MustMarshalJSON(&msgRevoke)))
+ err = AuthzModuleCdc.UnmarshalJSON(msgRevokeByte, &mockMsgRevoke)
+ require.NoError(t, err)
+
+ // Authz: Exec Msg
+ msgAny, err := cdctypes.NewAnyWithValue(msg)
+ require.NoError(t, err)
+ msgExec := authz.MsgExec{Grantee: mockGrantee, Msgs: []*cdctypes.Any{msgAny}}
+ execMsgByte := json.RawMessage(sdk.MustSortJSON(AuthzModuleCdc.MustMarshalJSON(&msgExec)))
+ err = AuthzModuleCdc.UnmarshalJSON(execMsgByte, &mockMsgExec)
+ require.NoError(t, err)
+ require.Equal(t, msgExec.Msgs[0].Value, mockMsgExec.Msgs[0].Value)
+}
diff --git a/x/tokenfactory/types/authorityMetadata.go b/x/tokenfactory/types/authorityMetadata.go
new file mode 100644
index 0000000000..b45bffcab5
--- /dev/null
+++ b/x/tokenfactory/types/authorityMetadata.go
@@ -0,0 +1,15 @@
+package types
+
+import (
+ sdk "github.com/cosmos/cosmos-sdk/types"
+)
+
+func (metadata DenomAuthorityMetadata) Validate() error {
+ if metadata.Admin != "" {
+ _, err := sdk.AccAddressFromBech32(metadata.Admin)
+ if err != nil {
+ return err
+ }
+ }
+ return nil
+}
diff --git a/x/tokenfactory/types/authorityMetadata.pb.go b/x/tokenfactory/types/authorityMetadata.pb.go
new file mode 100644
index 0000000000..ab86d6a0aa
--- /dev/null
+++ b/x/tokenfactory/types/authorityMetadata.pb.go
@@ -0,0 +1,351 @@
+// Code generated by protoc-gen-gogo. DO NOT EDIT.
+// source: cosmwasm/tokenfactory/v1beta1/authorityMetadata.proto
+
+package types
+
+import (
+ fmt "fmt"
+ _ "github.com/cosmos/cosmos-sdk/types"
+ _ "github.com/cosmos/gogoproto/gogoproto"
+ proto "github.com/cosmos/gogoproto/proto"
+ io "io"
+ math "math"
+ math_bits "math/bits"
+)
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
+
+// DenomAuthorityMetadata specifies metadata for addresses that have specific
+// capabilities over a token factory denom. Right now there is only one Admin
+// permission, but is planned to be extended to the future.
+type DenomAuthorityMetadata struct {
+ // Can be empty for no admin, or a valid osmosis address
+ Admin string `protobuf:"bytes,1,opt,name=admin,proto3" json:"admin,omitempty" yaml:"admin"`
+}
+
+func (m *DenomAuthorityMetadata) Reset() { *m = DenomAuthorityMetadata{} }
+func (m *DenomAuthorityMetadata) String() string { return proto.CompactTextString(m) }
+func (*DenomAuthorityMetadata) ProtoMessage() {}
+func (*DenomAuthorityMetadata) Descriptor() ([]byte, []int) {
+ return fileDescriptor_52db82570ee68a0a, []int{0}
+}
+func (m *DenomAuthorityMetadata) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *DenomAuthorityMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_DenomAuthorityMetadata.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *DenomAuthorityMetadata) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_DenomAuthorityMetadata.Merge(m, src)
+}
+func (m *DenomAuthorityMetadata) XXX_Size() int {
+ return m.Size()
+}
+func (m *DenomAuthorityMetadata) XXX_DiscardUnknown() {
+ xxx_messageInfo_DenomAuthorityMetadata.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_DenomAuthorityMetadata proto.InternalMessageInfo
+
+func (m *DenomAuthorityMetadata) GetAdmin() string {
+ if m != nil {
+ return m.Admin
+ }
+ return ""
+}
+
+func init() {
+ proto.RegisterType((*DenomAuthorityMetadata)(nil), "cosmwasm.tokenfactory.v1beta1.DenomAuthorityMetadata")
+}
+
+func init() {
+ proto.RegisterFile("cosmwasm/tokenfactory/v1beta1/authorityMetadata.proto", fileDescriptor_52db82570ee68a0a)
+}
+
+var fileDescriptor_52db82570ee68a0a = []byte{
+ // 238 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x4d, 0xce, 0x2f, 0xce,
+ 0x2d, 0x4f, 0x2c, 0xce, 0xd5, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f,
+ 0xaa, 0xd4, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x2c, 0x2d, 0xc9, 0xc8, 0x2f,
+ 0xca, 0x2c, 0xa9, 0xf4, 0x4d, 0x2d, 0x49, 0x4c, 0x49, 0x2c, 0x49, 0xd4, 0x2b, 0x28, 0xca, 0x2f,
+ 0xc9, 0x17, 0x92, 0x85, 0x69, 0xd3, 0x43, 0xd6, 0xa6, 0x07, 0xd5, 0x26, 0x25, 0x92, 0x9e, 0x9f,
+ 0x9e, 0x0f, 0x56, 0xa9, 0x0f, 0x62, 0x41, 0x34, 0x49, 0xc9, 0x81, 0x34, 0xe5, 0x17, 0xeb, 0x27,
+ 0x25, 0x16, 0xa7, 0xc2, 0x6d, 0x48, 0xce, 0xcf, 0xcc, 0x83, 0xc8, 0x2b, 0xb9, 0x71, 0x89, 0xb9,
+ 0xa4, 0xe6, 0xe5, 0xe7, 0x3a, 0xa2, 0x5b, 0x2a, 0xa4, 0xc6, 0xc5, 0x9a, 0x98, 0x92, 0x9b, 0x99,
+ 0x27, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0xe9, 0x24, 0xf0, 0xe9, 0x9e, 0x3c, 0x4f, 0x65, 0x62, 0x6e,
+ 0x8e, 0x95, 0x12, 0x58, 0x58, 0x29, 0x08, 0x22, 0x6d, 0xc5, 0xf2, 0x62, 0x81, 0x3c, 0xa3, 0x93,
+ 0xc7, 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, 0xe9, 0xa5, 0x67, 0x96, 0x64,
+ 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x3b, 0xe7, 0x17, 0xe7, 0x86, 0x83, 0x3c, 0x0e, 0xf2,
+ 0x46, 0x8a, 0x7e, 0x05, 0x6a, 0x00, 0x94, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x1d, 0x66,
+ 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x5e, 0xaf, 0x20, 0x19, 0x26, 0x01, 0x00, 0x00,
+}
+
+func (this *DenomAuthorityMetadata) Equal(that interface{}) bool {
+ if that == nil {
+ return this == nil
+ }
+
+ that1, ok := that.(*DenomAuthorityMetadata)
+ if !ok {
+ that2, ok := that.(DenomAuthorityMetadata)
+ if ok {
+ that1 = &that2
+ } else {
+ return false
+ }
+ }
+ if that1 == nil {
+ return this == nil
+ } else if this == nil {
+ return false
+ }
+ if this.Admin != that1.Admin {
+ return false
+ }
+ return true
+}
+func (m *DenomAuthorityMetadata) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *DenomAuthorityMetadata) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *DenomAuthorityMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Admin) > 0 {
+ i -= len(m.Admin)
+ copy(dAtA[i:], m.Admin)
+ i = encodeVarintAuthorityMetadata(dAtA, i, uint64(len(m.Admin)))
+ i--
+ dAtA[i] = 0xa
+ }
+ return len(dAtA) - i, nil
+}
+
+func encodeVarintAuthorityMetadata(dAtA []byte, offset int, v uint64) int {
+ offset -= sovAuthorityMetadata(v)
+ base := offset
+ for v >= 1<<7 {
+ dAtA[offset] = uint8(v&0x7f | 0x80)
+ v >>= 7
+ offset++
+ }
+ dAtA[offset] = uint8(v)
+ return base
+}
+func (m *DenomAuthorityMetadata) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Admin)
+ if l > 0 {
+ n += 1 + l + sovAuthorityMetadata(uint64(l))
+ }
+ return n
+}
+
+func sovAuthorityMetadata(x uint64) (n int) {
+ return (math_bits.Len64(x|1) + 6) / 7
+}
+func sozAuthorityMetadata(x uint64) (n int) {
+ return sovAuthorityMetadata(uint64((x << 1) ^ uint64((int64(x) >> 63))))
+}
+func (m *DenomAuthorityMetadata) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowAuthorityMetadata
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: DenomAuthorityMetadata: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: DenomAuthorityMetadata: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Admin", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowAuthorityMetadata
+ }
+ 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 ErrInvalidLengthAuthorityMetadata
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthAuthorityMetadata
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Admin = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipAuthorityMetadata(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthAuthorityMetadata
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func skipAuthorityMetadata(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, ErrIntOverflowAuthorityMetadata
+ }
+ 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, ErrIntOverflowAuthorityMetadata
+ }
+ 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, ErrIntOverflowAuthorityMetadata
+ }
+ 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, ErrInvalidLengthAuthorityMetadata
+ }
+ iNdEx += length
+ case 3:
+ depth++
+ case 4:
+ if depth == 0 {
+ return 0, ErrUnexpectedEndOfGroupAuthorityMetadata
+ }
+ depth--
+ case 5:
+ iNdEx += 4
+ default:
+ return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
+ }
+ if iNdEx < 0 {
+ return 0, ErrInvalidLengthAuthorityMetadata
+ }
+ if depth == 0 {
+ return iNdEx, nil
+ }
+ }
+ return 0, io.ErrUnexpectedEOF
+}
+
+var (
+ ErrInvalidLengthAuthorityMetadata = fmt.Errorf("proto: negative length found during unmarshaling")
+ ErrIntOverflowAuthorityMetadata = fmt.Errorf("proto: integer overflow")
+ ErrUnexpectedEndOfGroupAuthorityMetadata = fmt.Errorf("proto: unexpected end of group")
+)
diff --git a/x/tokenfactory/types/authzcodec/codec.go b/x/tokenfactory/types/authzcodec/codec.go
new file mode 100644
index 0000000000..366e337a1c
--- /dev/null
+++ b/x/tokenfactory/types/authzcodec/codec.go
@@ -0,0 +1,24 @@
+package authzcodec
+
+// Note: this file is a copy from authz/codec in 0.46 so we can be compatible with 0.45
+
+import (
+ "github.com/cosmos/cosmos-sdk/codec"
+ cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
+ sdk "github.com/cosmos/cosmos-sdk/types"
+)
+
+var (
+ Amino = codec.NewLegacyAmino()
+ ModuleCdc = codec.NewAminoCodec(Amino)
+)
+
+func init() {
+ // Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be
+ // used to properly serialize MsgGrant and MsgExec instances
+ sdk.RegisterLegacyAminoCodec(Amino)
+ cryptocodec.RegisterCrypto(Amino)
+ codec.RegisterEvidences(Amino)
+
+ Amino.Seal()
+}
diff --git a/x/tokenfactory/types/codec.go b/x/tokenfactory/types/codec.go
new file mode 100644
index 0000000000..cb76899ed6
--- /dev/null
+++ b/x/tokenfactory/types/codec.go
@@ -0,0 +1,48 @@
+package types
+
+import (
+ "github.com/cosmos/cosmos-sdk/codec"
+ cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
+ cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
+ sdk "github.com/cosmos/cosmos-sdk/types"
+
+ // this line is used by starport scaffolding # 1
+ "github.com/cosmos/cosmos-sdk/types/msgservice"
+)
+
+func RegisterCodec(cdc *codec.LegacyAmino) {
+ cdc.RegisterConcrete(&MsgCreateDenom{}, "osmosis/tokenfactory/create-denom", nil)
+ cdc.RegisterConcrete(&MsgMint{}, "osmosis/tokenfactory/mint", nil)
+ cdc.RegisterConcrete(&MsgBurn{}, "osmosis/tokenfactory/burn", nil)
+ // cdc.RegisterConcrete(&MsgForceTransfer{}, "osmosis/tokenfactory/force-transfer", nil)
+ cdc.RegisterConcrete(&MsgChangeAdmin{}, "osmosis/tokenfactory/change-admin", nil)
+}
+
+func RegisterInterfaces(registry cdctypes.InterfaceRegistry) {
+ registry.RegisterImplementations(
+ (*sdk.Msg)(nil),
+ &MsgCreateDenom{},
+ &MsgMint{},
+ &MsgBurn{},
+ // &MsgForceTransfer{},
+ &MsgChangeAdmin{},
+ )
+ msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
+}
+
+var (
+ amino = codec.NewLegacyAmino()
+ ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry())
+)
+
+func init() {
+ RegisterCodec(amino)
+ // Register all Amino interfaces and concrete types on the authz Amino codec so that this can later be
+ // used to properly serialize MsgGrant and MsgExec instances
+ // Note: these 3 are inlines from authz/codec in 0.46 so we can be compatible with 0.45
+ sdk.RegisterLegacyAminoCodec(amino)
+ cryptocodec.RegisterCrypto(amino)
+ codec.RegisterEvidences(amino)
+
+ amino.Seal()
+}
diff --git a/x/tokenfactory/types/denoms.go b/x/tokenfactory/types/denoms.go
new file mode 100644
index 0000000000..7a9f2f9e99
--- /dev/null
+++ b/x/tokenfactory/types/denoms.go
@@ -0,0 +1,68 @@
+package types
+
+import (
+ "strings"
+
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
+)
+
+const (
+ ModuleDenomPrefix = "factory"
+ // See the TokenFactory readme for a derivation of these.
+ // TL;DR, MaxSubdenomLength + MaxHrpLength = 60 comes from SDK max denom length = 128
+ // and the structure of tokenfactory denoms.
+ MaxSubdenomLength = 44
+ MaxHrpLength = 16
+ // MaxCreatorLength = 59 + MaxHrpLength
+ MaxCreatorLength = 59 + MaxHrpLength
+)
+
+// GetTokenDenom constructs a denom string for tokens created by tokenfactory
+// based on an input creator address and a subdenom
+// The denom constructed is factory/{creator}/{subdenom}
+func GetTokenDenom(creator, subdenom string) (string, error) {
+ if len(subdenom) > MaxSubdenomLength {
+ return "", ErrSubdenomTooLong
+ }
+ if len(creator) > MaxCreatorLength {
+ return "", ErrCreatorTooLong
+ }
+ if strings.Contains(creator, "/") {
+ return "", ErrInvalidCreator
+ }
+ denom := strings.Join([]string{ModuleDenomPrefix, creator, subdenom}, "/")
+ return denom, sdk.ValidateDenom(denom)
+}
+
+// DeconstructDenom takes a token denom string and verifies that it is a valid
+// denom of the tokenfactory module, and is of the form `factory/{creator}/{subdenom}`
+// If valid, it returns the creator address and subdenom
+func DeconstructDenom(denom string) (creator string, subdenom string, err error) {
+ err = sdk.ValidateDenom(denom)
+ if err != nil {
+ return "", "", err
+ }
+
+ strParts := strings.Split(denom, "/")
+ if len(strParts) < 3 {
+ return "", "", sdkerrors.Wrapf(ErrInvalidDenom, "not enough parts of denom %s", denom)
+ }
+
+ if strParts[0] != ModuleDenomPrefix {
+ return "", "", sdkerrors.Wrapf(ErrInvalidDenom, "denom prefix is incorrect. Is: %s. Should be: %s", strParts[0], ModuleDenomPrefix)
+ }
+
+ creator = strParts[1]
+ creatorAddr, err := sdk.AccAddressFromBech32(creator)
+ if err != nil {
+ return "", "", sdkerrors.Wrapf(ErrInvalidDenom, "Invalid creator address (%s)", err)
+ }
+
+ // Handle the case where a denom has a slash in its subdenom. For example,
+ // when we did the split, we'd turn factory/accaddr/atomderivative/sikka into ["factory", "accaddr", "atomderivative", "sikka"]
+ // So we have to join [2:] with a "/" as the delimiter to get back the correct subdenom which should be "atomderivative/sikka"
+ subdenom = strings.Join(strParts[2:], "/")
+
+ return creatorAddr.String(), subdenom, nil
+}
diff --git a/x/tokenfactory/types/denoms_test.go b/x/tokenfactory/types/denoms_test.go
new file mode 100644
index 0000000000..6a2d4d5e93
--- /dev/null
+++ b/x/tokenfactory/types/denoms_test.go
@@ -0,0 +1,132 @@
+package types_test
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+)
+
+func TestDeconstructDenom(t *testing.T) {
+ // Note: this seems to be used in osmosis to add some more checks (only 20 or 32 byte addresses),
+ // which is good, but not required for these tests as they make code less reuable
+ // appparams.SetAddressPrefixes()
+
+ for _, tc := range []struct {
+ desc string
+ denom string
+ expectedSubdenom string
+ err error
+ }{
+ {
+ desc: "empty is invalid",
+ denom: "",
+ err: types.ErrInvalidDenom,
+ },
+ {
+ desc: "normal",
+ denom: "factory/cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8/bitcoin",
+ expectedSubdenom: "bitcoin",
+ },
+ {
+ desc: "multiple slashes in subdenom",
+ denom: "factory/cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8/bitcoin/1",
+ expectedSubdenom: "bitcoin/1",
+ },
+ {
+ desc: "no subdenom",
+ denom: "factory/cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8/",
+ expectedSubdenom: "",
+ },
+ {
+ desc: "incorrect prefix",
+ denom: "ibc/cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8/bitcoin",
+ err: types.ErrInvalidDenom,
+ },
+ {
+ desc: "subdenom of only slashes",
+ denom: "factory/cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8/////",
+ expectedSubdenom: "////",
+ },
+ {
+ desc: "too long name",
+ denom: "factory/cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8/adsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsf",
+ err: types.ErrInvalidDenom,
+ },
+ } {
+ t.Run(tc.desc, func(t *testing.T) {
+ expectedCreator := "cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8"
+ creator, subdenom, err := types.DeconstructDenom(tc.denom)
+ if tc.err != nil {
+ require.ErrorContains(t, err, tc.err.Error())
+ } else {
+ require.NoError(t, err)
+ require.Equal(t, expectedCreator, creator)
+ require.Equal(t, tc.expectedSubdenom, subdenom)
+ }
+ })
+ }
+}
+
+func TestGetTokenDenom(t *testing.T) {
+ // appparams.SetAddressPrefixes()
+ for _, tc := range []struct {
+ desc string
+ creator string
+ subdenom string
+ valid bool
+ }{
+ {
+ desc: "normal",
+ creator: "cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8",
+ subdenom: "bitcoin",
+ valid: true,
+ },
+ {
+ desc: "multiple slashes in subdenom",
+ creator: "cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8",
+ subdenom: "bitcoin/1",
+ valid: true,
+ },
+ {
+ desc: "no subdenom",
+ creator: "cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8",
+ subdenom: "",
+ valid: true,
+ },
+ {
+ desc: "subdenom of only slashes",
+ creator: "cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8",
+ subdenom: "/////",
+ valid: true,
+ },
+ {
+ desc: "too long name",
+ creator: "cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8",
+ subdenom: "adsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsfadsf",
+ valid: false,
+ },
+ {
+ desc: "subdenom is exactly max length",
+ creator: "cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8",
+ subdenom: "bitcoinfsadfsdfeadfsafwefsefsefsdfsdafasefsf",
+ valid: true,
+ },
+ {
+ desc: "creator is exactly max length",
+ creator: "cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8jhgjhgkhjklhkjhkjhgjhgjgjghelu",
+ subdenom: "bitcoin",
+ valid: true,
+ },
+ } {
+ t.Run(tc.desc, func(t *testing.T) {
+ _, err := types.GetTokenDenom(tc.creator, tc.subdenom)
+ if tc.valid {
+ require.NoError(t, err)
+ } else {
+ require.Error(t, err)
+ }
+ })
+ }
+}
diff --git a/x/tokenfactory/types/errors.go b/x/tokenfactory/types/errors.go
new file mode 100644
index 0000000000..06991f19b9
--- /dev/null
+++ b/x/tokenfactory/types/errors.go
@@ -0,0 +1,22 @@
+package types
+
+// DONTCOVER
+
+import (
+ fmt "fmt"
+
+ sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
+)
+
+// x/tokenfactory module sentinel errors
+var (
+ ErrDenomExists = sdkerrors.Register(ModuleName, 2, "attempting to create a denom that already exists (has bank metadata)")
+ ErrUnauthorized = sdkerrors.Register(ModuleName, 3, "unauthorized account")
+ ErrInvalidDenom = sdkerrors.Register(ModuleName, 4, "invalid denom")
+ ErrInvalidCreator = sdkerrors.Register(ModuleName, 5, "invalid creator")
+ ErrInvalidAuthorityMetadata = sdkerrors.Register(ModuleName, 6, "invalid authority metadata")
+ ErrInvalidGenesis = sdkerrors.Register(ModuleName, 7, "invalid genesis")
+ ErrSubdenomTooLong = sdkerrors.Register(ModuleName, 8, fmt.Sprintf("subdenom too long, max length is %d bytes", MaxSubdenomLength))
+ ErrCreatorTooLong = sdkerrors.Register(ModuleName, 9, fmt.Sprintf("creator too long, max length is %d bytes", MaxCreatorLength))
+ ErrDenomDoesNotExist = sdkerrors.Register(ModuleName, 10, "denom does not exist")
+)
diff --git a/x/tokenfactory/types/events.go b/x/tokenfactory/types/events.go
new file mode 100644
index 0000000000..48038e052b
--- /dev/null
+++ b/x/tokenfactory/types/events.go
@@ -0,0 +1,18 @@
+package types
+
+// event types
+//
+//nolint:gosec // these are not hard-coded credentials
+const (
+ AttributeAmount = "amount"
+ AttributeCreator = "creator"
+ AttributeSubdenom = "subdenom"
+ AttributeNewTokenDenom = "new_token_denom"
+ AttributeMintToAddress = "mint_to_address"
+ AttributeBurnFromAddress = "burn_from_address"
+ AttributeTransferFromAddress = "transfer_from_address"
+ AttributeTransferToAddress = "transfer_to_address"
+ AttributeDenom = "denom"
+ AttributeNewAdmin = "new_admin"
+ AttributeDenomMetadata = "denom_metadata"
+)
diff --git a/x/tokenfactory/types/expected_keepers.go b/x/tokenfactory/types/expected_keepers.go
new file mode 100644
index 0000000000..15f377e631
--- /dev/null
+++ b/x/tokenfactory/types/expected_keepers.go
@@ -0,0 +1,36 @@
+package types
+
+import (
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
+ banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
+)
+
+type BankKeeper interface {
+ // Methods imported from bank should be defined here
+ GetDenomMetaData(ctx sdk.Context, denom string) (banktypes.Metadata, bool)
+ SetDenomMetaData(ctx sdk.Context, denomMetaData banktypes.Metadata)
+
+ HasSupply(ctx sdk.Context, denom string) bool
+
+ SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
+ SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
+ MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
+ BurnCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) error
+
+ SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error
+ HasBalance(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coin) bool
+ GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
+ SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
+ GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin
+}
+
+type AccountKeeper interface {
+ SetModuleAccount(ctx sdk.Context, macc authtypes.ModuleAccountI)
+ GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI
+}
+
+// CommunityPoolKeeper defines the contract needed to be fulfilled for community pool interactions.
+type CommunityPoolKeeper interface {
+ FundCommunityPool(ctx sdk.Context, amount sdk.Coins, sender sdk.AccAddress) error
+}
diff --git a/x/tokenfactory/types/genesis.go b/x/tokenfactory/types/genesis.go
new file mode 100644
index 0000000000..b1ba181fab
--- /dev/null
+++ b/x/tokenfactory/types/genesis.go
@@ -0,0 +1,51 @@
+package types
+
+import (
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
+)
+
+// this line is used by starport scaffolding # genesis/types/import
+
+// DefaultIndex is the default capability global index
+const DefaultIndex uint64 = 1
+
+// DefaultGenesis returns the default Capability genesis state
+func DefaultGenesis() *GenesisState {
+ return &GenesisState{
+ Params: DefaultParams(),
+ FactoryDenoms: []GenesisDenom{},
+ }
+}
+
+// Validate performs basic genesis state validation returning an error upon any
+// failure.
+func (gs GenesisState) Validate() error {
+ err := gs.Params.Validate()
+ if err != nil {
+ return err
+ }
+
+ seenDenoms := map[string]bool{}
+
+ for _, denom := range gs.GetFactoryDenoms() {
+ if seenDenoms[denom.GetDenom()] {
+ return sdkerrors.Wrapf(ErrInvalidGenesis, "duplicate denom: %s", denom.GetDenom())
+ }
+ seenDenoms[denom.GetDenom()] = true
+
+ _, _, err := DeconstructDenom(denom.GetDenom())
+ if err != nil {
+ return err
+ }
+
+ if denom.AuthorityMetadata.Admin != "" {
+ _, err = sdk.AccAddressFromBech32(denom.AuthorityMetadata.Admin)
+ if err != nil {
+ return sdkerrors.Wrapf(ErrInvalidAuthorityMetadata, "Invalid admin address (%s)", err)
+ }
+ }
+ }
+
+ return nil
+}
diff --git a/x/tokenfactory/types/genesis.pb.go b/x/tokenfactory/types/genesis.pb.go
new file mode 100644
index 0000000000..5f83a23571
--- /dev/null
+++ b/x/tokenfactory/types/genesis.pb.go
@@ -0,0 +1,649 @@
+// Code generated by protoc-gen-gogo. DO NOT EDIT.
+// source: cosmwasm/tokenfactory/v1beta1/genesis.proto
+
+package types
+
+import (
+ fmt "fmt"
+ _ "github.com/cosmos/gogoproto/gogoproto"
+ proto "github.com/cosmos/gogoproto/proto"
+ io "io"
+ math "math"
+ math_bits "math/bits"
+)
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
+
+// GenesisState defines the tokenfactory module's genesis state.
+type GenesisState struct {
+ // params defines the paramaters of the module.
+ Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
+ FactoryDenoms []GenesisDenom `protobuf:"bytes,2,rep,name=factory_denoms,json=factoryDenoms,proto3" json:"factory_denoms" yaml:"factory_denoms"`
+}
+
+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_b333539769138b3e, []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 (m *GenesisState) GetFactoryDenoms() []GenesisDenom {
+ if m != nil {
+ return m.FactoryDenoms
+ }
+ return nil
+}
+
+// GenesisDenom defines a tokenfactory denom that is defined within genesis
+// state. The structure contains DenomAuthorityMetadata which defines the
+// denom's admin.
+type GenesisDenom struct {
+ Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"`
+ AuthorityMetadata DenomAuthorityMetadata `protobuf:"bytes,2,opt,name=authority_metadata,json=authorityMetadata,proto3" json:"authority_metadata" yaml:"authority_metadata"`
+}
+
+func (m *GenesisDenom) Reset() { *m = GenesisDenom{} }
+func (m *GenesisDenom) String() string { return proto.CompactTextString(m) }
+func (*GenesisDenom) ProtoMessage() {}
+func (*GenesisDenom) Descriptor() ([]byte, []int) {
+ return fileDescriptor_b333539769138b3e, []int{1}
+}
+func (m *GenesisDenom) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *GenesisDenom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_GenesisDenom.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *GenesisDenom) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_GenesisDenom.Merge(m, src)
+}
+func (m *GenesisDenom) XXX_Size() int {
+ return m.Size()
+}
+func (m *GenesisDenom) XXX_DiscardUnknown() {
+ xxx_messageInfo_GenesisDenom.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_GenesisDenom proto.InternalMessageInfo
+
+func (m *GenesisDenom) GetDenom() string {
+ if m != nil {
+ return m.Denom
+ }
+ return ""
+}
+
+func (m *GenesisDenom) GetAuthorityMetadata() DenomAuthorityMetadata {
+ if m != nil {
+ return m.AuthorityMetadata
+ }
+ return DenomAuthorityMetadata{}
+}
+
+func init() {
+ proto.RegisterType((*GenesisState)(nil), "cosmwasm.tokenfactory.v1beta1.GenesisState")
+ proto.RegisterType((*GenesisDenom)(nil), "cosmwasm.tokenfactory.v1beta1.GenesisDenom")
+}
+
+func init() {
+ proto.RegisterFile("cosmwasm/tokenfactory/v1beta1/genesis.proto", fileDescriptor_b333539769138b3e)
+}
+
+var fileDescriptor_b333539769138b3e = []byte{
+ // 363 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4e, 0xce, 0x2f, 0xce,
+ 0x2d, 0x4f, 0x2c, 0xce, 0xd5, 0x2f, 0xc9, 0xcf, 0x4e, 0xcd, 0x4b, 0x4b, 0x4c, 0x2e, 0xc9, 0x2f,
+ 0xaa, 0xd4, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, 0x49, 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce,
+ 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x85, 0x29, 0xd6, 0x43, 0x56, 0xac, 0x07,
+ 0x55, 0x2c, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x56, 0xa9, 0x0f, 0x62, 0x41, 0x34, 0x49, 0x99,
+ 0xe2, 0xb7, 0x21, 0xb1, 0xb4, 0x24, 0x23, 0xbf, 0x28, 0xb3, 0xa4, 0xd2, 0x37, 0xb5, 0x24, 0x31,
+ 0x25, 0xb1, 0x24, 0x11, 0xaa, 0x4d, 0x0b, 0xbf, 0xb6, 0x82, 0xc4, 0xa2, 0xc4, 0x5c, 0xa8, 0xbb,
+ 0x94, 0x8e, 0x31, 0x72, 0xf1, 0xb8, 0x43, 0x5c, 0x1a, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0xe4, 0xcc,
+ 0xc5, 0x06, 0x51, 0x20, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0xa4, 0xaa, 0x87, 0xd7, 0xe5, 0x7a,
+ 0x01, 0x60, 0xc5, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0xb5, 0x0a, 0x15, 0x72, 0xf1,
+ 0x41, 0xd5, 0xc5, 0xa7, 0xa4, 0xe6, 0xe5, 0xe7, 0x16, 0x4b, 0x30, 0x29, 0x30, 0x6b, 0x70, 0x1b,
+ 0x69, 0x13, 0x30, 0x0c, 0xea, 0x12, 0x17, 0x90, 0x1e, 0x27, 0x59, 0x90, 0x91, 0x9f, 0xee, 0xc9,
+ 0x8b, 0x56, 0x26, 0xe6, 0xe6, 0x58, 0x29, 0xa1, 0x1a, 0xa8, 0x14, 0xc4, 0x0b, 0x15, 0x70, 0x81,
+ 0xf0, 0x91, 0x3c, 0x02, 0x16, 0x11, 0x52, 0xe3, 0x62, 0x05, 0x2b, 0x05, 0xfb, 0x83, 0xd3, 0x49,
+ 0xe0, 0xd3, 0x3d, 0x79, 0x1e, 0x88, 0x49, 0x60, 0x61, 0xa5, 0x20, 0x88, 0xb4, 0x50, 0x3b, 0x23,
+ 0x97, 0x10, 0x3c, 0x24, 0xe3, 0x73, 0xa1, 0x41, 0x29, 0xc1, 0x04, 0xf6, 0xbd, 0x29, 0x01, 0x07,
+ 0x83, 0xad, 0x72, 0x44, 0x8f, 0x07, 0x27, 0x45, 0xa8, 0xd3, 0x25, 0x21, 0x16, 0x62, 0x1a, 0xaf,
+ 0x14, 0x24, 0x88, 0x11, 0x7b, 0x56, 0x2c, 0x2f, 0x16, 0xc8, 0x33, 0x3a, 0x79, 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, 0x5e, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e,
+ 0x72, 0x7e, 0xae, 0xbe, 0x73, 0x7e, 0x71, 0x6e, 0x38, 0x28, 0x8a, 0x41, 0x6e, 0x4b, 0xd1, 0xaf,
+ 0x40, 0x8d, 0xea, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0x14, 0x1b, 0x03, 0x02, 0x00,
+ 0x00, 0xff, 0xff, 0x38, 0xec, 0xbf, 0xde, 0xa9, 0x02, 0x00, 0x00,
+}
+
+func (this *GenesisDenom) Equal(that interface{}) bool {
+ if that == nil {
+ return this == nil
+ }
+
+ that1, ok := that.(*GenesisDenom)
+ if !ok {
+ that2, ok := that.(GenesisDenom)
+ if ok {
+ that1 = &that2
+ } else {
+ return false
+ }
+ }
+ if that1 == nil {
+ return this == nil
+ } else if this == nil {
+ return false
+ }
+ if this.Denom != that1.Denom {
+ return false
+ }
+ if !this.AuthorityMetadata.Equal(&that1.AuthorityMetadata) {
+ return false
+ }
+ return true
+}
+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.FactoryDenoms) > 0 {
+ for iNdEx := len(m.FactoryDenoms) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.FactoryDenoms[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenesis(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ }
+ }
+ {
+ 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 *GenesisDenom) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *GenesisDenom) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *GenesisDenom) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ {
+ size, err := m.AuthorityMetadata.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintGenesis(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0x12
+ if len(m.Denom) > 0 {
+ i -= len(m.Denom)
+ copy(dAtA[i:], m.Denom)
+ i = encodeVarintGenesis(dAtA, i, uint64(len(m.Denom)))
+ 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))
+ if len(m.FactoryDenoms) > 0 {
+ for _, e := range m.FactoryDenoms {
+ l = e.Size()
+ n += 1 + l + sovGenesis(uint64(l))
+ }
+ }
+ return n
+}
+
+func (m *GenesisDenom) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Denom)
+ if l > 0 {
+ n += 1 + l + sovGenesis(uint64(l))
+ }
+ l = m.AuthorityMetadata.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 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field FactoryDenoms", 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.FactoryDenoms = append(m.FactoryDenoms, GenesisDenom{})
+ if err := m.FactoryDenoms[len(m.FactoryDenoms)-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 (m *GenesisDenom) Unmarshal(dAtA []byte) 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: GenesisDenom: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: GenesisDenom: 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 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.Denom = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field AuthorityMetadata", 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.AuthorityMetadata.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/tokenfactory/types/genesis_test.go b/x/tokenfactory/types/genesis_test.go
new file mode 100644
index 0000000000..a7f494c8b1
--- /dev/null
+++ b/x/tokenfactory/types/genesis_test.go
@@ -0,0 +1,139 @@
+package types_test
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/require"
+
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+)
+
+func TestGenesisState_Validate(t *testing.T) {
+ for _, tc := range []struct {
+ desc string
+ genState *types.GenesisState
+ valid bool
+ }{
+ {
+ desc: "default is valid",
+ genState: types.DefaultGenesis(),
+ valid: true,
+ },
+ {
+ desc: "valid genesis state",
+ genState: &types.GenesisState{
+ FactoryDenoms: []types.GenesisDenom{
+ {
+ Denom: "factory/cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8/bitcoin",
+ AuthorityMetadata: types.DenomAuthorityMetadata{
+ Admin: "cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8",
+ },
+ },
+ },
+ },
+ valid: true,
+ },
+ {
+ desc: "different admin from creator",
+ genState: &types.GenesisState{
+ FactoryDenoms: []types.GenesisDenom{
+ {
+ Denom: "factory/cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8/bitcoin",
+ AuthorityMetadata: types.DenomAuthorityMetadata{
+ Admin: "cosmos1ft6e5esdtdegnvcr3djd3ftk4kwpcr6jta8eyh",
+ },
+ },
+ },
+ },
+ valid: true,
+ },
+ {
+ desc: "empty admin",
+ genState: &types.GenesisState{
+ FactoryDenoms: []types.GenesisDenom{
+ {
+ Denom: "factory/cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8/bitcoin",
+ AuthorityMetadata: types.DenomAuthorityMetadata{
+ Admin: "",
+ },
+ },
+ },
+ },
+ valid: true,
+ },
+ {
+ desc: "no admin",
+ genState: &types.GenesisState{
+ FactoryDenoms: []types.GenesisDenom{
+ {
+ Denom: "factory/cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8/bitcoin",
+ },
+ },
+ },
+ valid: true,
+ },
+ {
+ desc: "invalid admin",
+ genState: &types.GenesisState{
+ FactoryDenoms: []types.GenesisDenom{
+ {
+ Denom: "factory/cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8/bitcoin",
+ AuthorityMetadata: types.DenomAuthorityMetadata{
+ Admin: "moose",
+ },
+ },
+ },
+ },
+ valid: false,
+ },
+ {
+ desc: "multiple denoms",
+ genState: &types.GenesisState{
+ FactoryDenoms: []types.GenesisDenom{
+ {
+ Denom: "factory/cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8/bitcoin",
+ AuthorityMetadata: types.DenomAuthorityMetadata{
+ Admin: "",
+ },
+ },
+ {
+ Denom: "factory/cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8/litecoin",
+ AuthorityMetadata: types.DenomAuthorityMetadata{
+ Admin: "",
+ },
+ },
+ },
+ },
+ valid: true,
+ },
+ {
+ desc: "duplicate denoms",
+ genState: &types.GenesisState{
+ FactoryDenoms: []types.GenesisDenom{
+ {
+ Denom: "factory/cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8/bitcoin",
+ AuthorityMetadata: types.DenomAuthorityMetadata{
+ Admin: "",
+ },
+ },
+ {
+ Denom: "factory/cosmos1t7egva48prqmzl59x5ngv4zx0dtrwewcdqdjr8/bitcoin",
+ AuthorityMetadata: types.DenomAuthorityMetadata{
+ Admin: "",
+ },
+ },
+ },
+ },
+ valid: false,
+ },
+ } {
+ t.Run(tc.desc, func(t *testing.T) {
+ err := tc.genState.Validate()
+ if tc.valid {
+ require.NoError(t, err)
+ } else {
+ require.Error(t, err)
+ }
+ })
+ }
+}
diff --git a/x/tokenfactory/types/keys.go b/x/tokenfactory/types/keys.go
new file mode 100644
index 0000000000..fac4a6e39c
--- /dev/null
+++ b/x/tokenfactory/types/keys.go
@@ -0,0 +1,49 @@
+package types
+
+import (
+ "strings"
+)
+
+const (
+ // ModuleName defines the module name
+ ModuleName = "tokenfactory"
+
+ // 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_tokenfactory"
+)
+
+// KeySeparator is used to combine parts of the keys in the store
+const KeySeparator = "|"
+
+var (
+ DenomAuthorityMetadataKey = "authoritymetadata"
+ DenomsPrefixKey = "denoms"
+ CreatorPrefixKey = "creator"
+ AdminPrefixKey = "admin"
+)
+
+// GetDenomPrefixStore returns the store prefix where all the data associated with a specific denom
+// is stored
+func GetDenomPrefixStore(denom string) []byte {
+ return []byte(strings.Join([]string{DenomsPrefixKey, denom, ""}, KeySeparator))
+}
+
+// GetCreatorsPrefix returns the store prefix where the list of the denoms created by a specific
+// creator are stored
+func GetCreatorPrefix(creator string) []byte {
+ return []byte(strings.Join([]string{CreatorPrefixKey, creator, ""}, KeySeparator))
+}
+
+// GetCreatorsPrefix returns the store prefix where a list of all creator addresses are stored
+func GetCreatorsPrefix() []byte {
+ return []byte(strings.Join([]string{CreatorPrefixKey, ""}, KeySeparator))
+}
diff --git a/x/tokenfactory/types/msgs.go b/x/tokenfactory/types/msgs.go
new file mode 100644
index 0000000000..9c78328e13
--- /dev/null
+++ b/x/tokenfactory/types/msgs.go
@@ -0,0 +1,246 @@
+package types
+
+import (
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
+ banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
+)
+
+// constants
+const (
+ TypeMsgCreateDenom = "create_denom"
+ TypeMsgMint = "tf_mint"
+ TypeMsgBurn = "tf_burn"
+ TypeMsgForceTransfer = "force_transfer"
+ TypeMsgChangeAdmin = "change_admin"
+ TypeMsgSetDenomMetadata = "set_denom_metadata"
+)
+
+var _ sdk.Msg = &MsgCreateDenom{}
+
+// NewMsgCreateDenom creates a msg to create a new denom
+func NewMsgCreateDenom(sender, subdenom string) *MsgCreateDenom {
+ return &MsgCreateDenom{
+ Sender: sender,
+ Subdenom: subdenom,
+ }
+}
+
+func (m MsgCreateDenom) Route() string { return RouterKey }
+func (m MsgCreateDenom) Type() string { return TypeMsgCreateDenom }
+func (m MsgCreateDenom) ValidateBasic() error {
+ _, err := sdk.AccAddressFromBech32(m.Sender)
+ if err != nil {
+ return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err)
+ }
+
+ _, err = GetTokenDenom(m.Sender, m.Subdenom)
+ if err != nil {
+ return sdkerrors.Wrap(ErrInvalidDenom, err.Error())
+ }
+
+ return nil
+}
+
+func (m MsgCreateDenom) GetSignBytes() []byte {
+ return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m))
+}
+
+func (m MsgCreateDenom) GetSigners() []sdk.AccAddress {
+ sender, _ := sdk.AccAddressFromBech32(m.Sender)
+ return []sdk.AccAddress{sender}
+}
+
+var _ sdk.Msg = &MsgMint{}
+
+// NewMsgMint creates a message to mint tokens
+func NewMsgMint(sender string, amount sdk.Coin) *MsgMint {
+ return &MsgMint{
+ Sender: sender,
+ Amount: amount,
+ }
+}
+
+func (m MsgMint) Route() string { return RouterKey }
+func (m MsgMint) Type() string { return TypeMsgMint }
+func (m MsgMint) ValidateBasic() error {
+ _, err := sdk.AccAddressFromBech32(m.Sender)
+ if err != nil {
+ return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err)
+ }
+
+ if !m.Amount.IsValid() || m.Amount.Amount.Equal(sdk.ZeroInt()) {
+ return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String())
+ }
+
+ return nil
+}
+
+func (m MsgMint) GetSignBytes() []byte {
+ return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m))
+}
+
+func (m MsgMint) GetSigners() []sdk.AccAddress {
+ sender, _ := sdk.AccAddressFromBech32(m.Sender)
+ return []sdk.AccAddress{sender}
+}
+
+var _ sdk.Msg = &MsgBurn{}
+
+// NewMsgBurn creates a message to burn tokens
+func NewMsgBurn(sender string, amount sdk.Coin) *MsgBurn {
+ return &MsgBurn{
+ Sender: sender,
+ Amount: amount,
+ }
+}
+
+func (m MsgBurn) Route() string { return RouterKey }
+func (m MsgBurn) Type() string { return TypeMsgBurn }
+func (m MsgBurn) ValidateBasic() error {
+ _, err := sdk.AccAddressFromBech32(m.Sender)
+ if err != nil {
+ return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err)
+ }
+
+ if !m.Amount.IsValid() || m.Amount.Amount.Equal(sdk.ZeroInt()) {
+ return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String())
+ }
+
+ return nil
+}
+
+func (m MsgBurn) GetSignBytes() []byte {
+ return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m))
+}
+
+func (m MsgBurn) GetSigners() []sdk.AccAddress {
+ sender, _ := sdk.AccAddressFromBech32(m.Sender)
+ return []sdk.AccAddress{sender}
+}
+
+// var _ sdk.Msg = &MsgForceTransfer{}
+
+// // NewMsgForceTransfer creates a transfer funds from one account to another
+// func NewMsgForceTransfer(sender string, amount sdk.Coin, fromAddr, toAddr string) *MsgForceTransfer {
+// return &MsgForceTransfer{
+// Sender: sender,
+// Amount: amount,
+// TransferFromAddress: fromAddr,
+// TransferToAddress: toAddr,
+// }
+// }
+
+// func (m MsgForceTransfer) Route() string { return RouterKey }
+// func (m MsgForceTransfer) Type() string { return TypeMsgForceTransfer }
+// func (m MsgForceTransfer) ValidateBasic() error {
+// _, err := sdk.AccAddressFromBech32(m.Sender)
+// if err != nil {
+// return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err)
+// }
+
+// _, err = sdk.AccAddressFromBech32(m.TransferFromAddress)
+// if err != nil {
+// return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid address (%s)", err)
+// }
+// _, err = sdk.AccAddressFromBech32(m.TransferToAddress)
+// if err != nil {
+// return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid address (%s)", err)
+// }
+
+// if !m.Amount.IsValid() {
+// return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, m.Amount.String())
+// }
+
+// return nil
+// }
+
+// func (m MsgForceTransfer) GetSignBytes() []byte {
+// return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m))
+// }
+
+// func (m MsgForceTransfer) GetSigners() []sdk.AccAddress {
+// sender, _ := sdk.AccAddressFromBech32(m.Sender)
+// return []sdk.AccAddress{sender}
+// }
+
+var _ sdk.Msg = &MsgChangeAdmin{}
+
+// NewMsgChangeAdmin creates a message to burn tokens
+func NewMsgChangeAdmin(sender, denom, newAdmin string) *MsgChangeAdmin {
+ return &MsgChangeAdmin{
+ Sender: sender,
+ Denom: denom,
+ NewAdmin: newAdmin,
+ }
+}
+
+func (m MsgChangeAdmin) Route() string { return RouterKey }
+func (m MsgChangeAdmin) Type() string { return TypeMsgChangeAdmin }
+func (m MsgChangeAdmin) ValidateBasic() error {
+ _, err := sdk.AccAddressFromBech32(m.Sender)
+ if err != nil {
+ return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err)
+ }
+
+ _, err = sdk.AccAddressFromBech32(m.NewAdmin)
+ if err != nil {
+ return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid address (%s)", err)
+ }
+
+ _, _, err = DeconstructDenom(m.Denom)
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m MsgChangeAdmin) GetSignBytes() []byte {
+ return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m))
+}
+
+func (m MsgChangeAdmin) GetSigners() []sdk.AccAddress {
+ sender, _ := sdk.AccAddressFromBech32(m.Sender)
+ return []sdk.AccAddress{sender}
+}
+
+var _ sdk.Msg = &MsgSetDenomMetadata{}
+
+// NewMsgChangeAdmin creates a message to burn tokens
+func NewMsgSetDenomMetadata(sender string, metadata banktypes.Metadata) *MsgSetDenomMetadata {
+ return &MsgSetDenomMetadata{
+ Sender: sender,
+ Metadata: metadata,
+ }
+}
+
+func (m MsgSetDenomMetadata) Route() string { return RouterKey }
+func (m MsgSetDenomMetadata) Type() string { return TypeMsgSetDenomMetadata }
+func (m MsgSetDenomMetadata) ValidateBasic() error {
+ _, err := sdk.AccAddressFromBech32(m.Sender)
+ if err != nil {
+ return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "Invalid sender address (%s)", err)
+ }
+
+ err = m.Metadata.Validate()
+ if err != nil {
+ return err
+ }
+
+ _, _, err = DeconstructDenom(m.Metadata.Base)
+ if err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m MsgSetDenomMetadata) GetSignBytes() []byte {
+ return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m))
+}
+
+func (m MsgSetDenomMetadata) GetSigners() []sdk.AccAddress {
+ sender, _ := sdk.AccAddressFromBech32(m.Sender)
+ return []sdk.AccAddress{sender}
+}
diff --git a/x/tokenfactory/types/msgs_test.go b/x/tokenfactory/types/msgs_test.go
new file mode 100644
index 0000000000..87168aadc8
--- /dev/null
+++ b/x/tokenfactory/types/msgs_test.go
@@ -0,0 +1,451 @@
+package types_test
+
+import (
+ fmt "fmt"
+ "testing"
+
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ "github.com/stretchr/testify/require"
+
+ "github.com/CosmWasm/wasmd/x/tokenfactory/testhelpers"
+ "github.com/CosmWasm/wasmd/x/tokenfactory/types"
+
+ "github.com/cometbft/cometbft/crypto/ed25519"
+ banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
+)
+
+// // Test authz serialize and de-serializes for tokenfactory msg.
+func TestAuthzMsg(t *testing.T) {
+ t.Skip("TODO: figure out how to register authz interfaces for tests")
+ pk1 := ed25519.GenPrivKey().PubKey()
+ addr1 := sdk.AccAddress(pk1.Address()).String()
+ coin := sdk.NewCoin("denom", sdk.NewInt(1))
+
+ testCases := []struct {
+ name string
+ msg sdk.Msg
+ }{
+ {
+ name: "MsgCreateDenom",
+ msg: &types.MsgCreateDenom{
+ Sender: addr1,
+ Subdenom: "valoper1xyz",
+ },
+ },
+ {
+ name: "MsgBurn",
+ msg: &types.MsgBurn{
+ Sender: addr1,
+ Amount: coin,
+ },
+ },
+ {
+ name: "MsgMint",
+ msg: &types.MsgMint{
+ Sender: addr1,
+ Amount: coin,
+ },
+ },
+ {
+ name: "MsgChangeAdmin",
+ msg: &types.MsgChangeAdmin{
+ Sender: addr1,
+ Denom: "denom",
+ NewAdmin: "osmo1q8tq5qhrhw6t970egemuuwywhlhpnmdmts6xnu",
+ },
+ },
+ }
+ for _, tc := range testCases {
+ t.Run(tc.name, func(t *testing.T) {
+ testhelpers.TestMessageAuthzSerialization(t, tc.msg)
+ })
+ }
+}
+
+// TestMsgCreateDenom tests if valid/invalid create denom messages are properly validated/invalidated
+func TestMsgCreateDenom(t *testing.T) {
+ // generate a private/public key pair and get the respective address
+ pk1 := ed25519.GenPrivKey().PubKey()
+ addr1 := sdk.AccAddress(pk1.Address())
+
+ // make a proper createDenom message
+ createMsg := func(after func(msg types.MsgCreateDenom) types.MsgCreateDenom) types.MsgCreateDenom {
+ properMsg := *types.NewMsgCreateDenom(
+ addr1.String(),
+ "bitcoin",
+ )
+
+ return after(properMsg)
+ }
+
+ // validate createDenom message was created as intended
+ msg := createMsg(func(msg types.MsgCreateDenom) types.MsgCreateDenom {
+ return msg
+ })
+ require.Equal(t, msg.Route(), types.RouterKey)
+ require.Equal(t, msg.Type(), "create_denom")
+ signers := msg.GetSigners()
+ require.Equal(t, len(signers), 1)
+ require.Equal(t, signers[0].String(), addr1.String())
+
+ tests := []struct {
+ name string
+ msg types.MsgCreateDenom
+ expectPass bool
+ }{
+ {
+ name: "proper msg",
+ msg: createMsg(func(msg types.MsgCreateDenom) types.MsgCreateDenom {
+ return msg
+ }),
+ expectPass: true,
+ },
+ {
+ name: "empty sender",
+ msg: createMsg(func(msg types.MsgCreateDenom) types.MsgCreateDenom {
+ msg.Sender = ""
+ return msg
+ }),
+ expectPass: false,
+ },
+ {
+ name: "invalid subdenom",
+ msg: createMsg(func(msg types.MsgCreateDenom) types.MsgCreateDenom {
+ msg.Subdenom = "thissubdenomismuchtoolongasdkfjaasdfdsafsdlkfnmlksadmflksmdlfmlsakmfdsafasdfasdf"
+ return msg
+ }),
+ expectPass: false,
+ },
+ }
+
+ for _, test := range tests {
+ if test.expectPass {
+ require.NoError(t, test.msg.ValidateBasic(), "test: %v", test.name)
+ } else {
+ require.Error(t, test.msg.ValidateBasic(), "test: %v", test.name)
+ }
+ }
+}
+
+// TestMsgMint tests if valid/invalid create denom messages are properly validated/invalidated
+func TestMsgMint(t *testing.T) {
+ // generate a private/public key pair and get the respective address
+ pk1 := ed25519.GenPrivKey().PubKey()
+ addr1 := sdk.AccAddress(pk1.Address())
+
+ // make a proper mint message
+ createMsg := func(after func(msg types.MsgMint) types.MsgMint) types.MsgMint {
+ properMsg := *types.NewMsgMint(
+ addr1.String(),
+ sdk.NewCoin("bitcoin", sdk.NewInt(500000000)),
+ )
+
+ return after(properMsg)
+ }
+
+ // validate mint message was created as intended
+ msg := createMsg(func(msg types.MsgMint) types.MsgMint {
+ return msg
+ })
+ require.Equal(t, msg.Route(), types.RouterKey)
+ require.Equal(t, msg.Type(), "tf_mint")
+ signers := msg.GetSigners()
+ require.Equal(t, len(signers), 1)
+ require.Equal(t, signers[0].String(), addr1.String())
+
+ tests := []struct {
+ name string
+ msg types.MsgMint
+ expectPass bool
+ }{
+ {
+ name: "proper msg",
+ msg: createMsg(func(msg types.MsgMint) types.MsgMint {
+ return msg
+ }),
+ expectPass: true,
+ },
+ {
+ name: "empty sender",
+ msg: createMsg(func(msg types.MsgMint) types.MsgMint {
+ msg.Sender = ""
+ return msg
+ }),
+ expectPass: false,
+ },
+ {
+ name: "zero amount",
+ msg: createMsg(func(msg types.MsgMint) types.MsgMint {
+ msg.Amount = sdk.NewCoin("bitcoin", sdk.ZeroInt())
+ return msg
+ }),
+ expectPass: false,
+ },
+ {
+ name: "negative amount",
+ msg: createMsg(func(msg types.MsgMint) types.MsgMint {
+ msg.Amount.Amount = sdk.NewInt(-10000000)
+ return msg
+ }),
+ expectPass: false,
+ },
+ }
+
+ for _, test := range tests {
+ if test.expectPass {
+ require.NoError(t, test.msg.ValidateBasic(), "test: %v", test.name)
+ } else {
+ require.Error(t, test.msg.ValidateBasic(), "test: %v", test.name)
+ }
+ }
+}
+
+// TestMsgBurn tests if valid/invalid create denom messages are properly validated/invalidated
+func TestMsgBurn(t *testing.T) {
+ // generate a private/public key pair and get the respective address
+ pk1 := ed25519.GenPrivKey().PubKey()
+ addr1 := sdk.AccAddress(pk1.Address())
+
+ // make a proper burn message
+ baseMsg := types.NewMsgBurn(
+ addr1.String(),
+ sdk.NewCoin("bitcoin", sdk.NewInt(500000000)),
+ )
+
+ // validate burn message was created as intended
+ require.Equal(t, baseMsg.Route(), types.RouterKey)
+ require.Equal(t, baseMsg.Type(), "tf_burn")
+ signers := baseMsg.GetSigners()
+ require.Equal(t, len(signers), 1)
+ require.Equal(t, signers[0].String(), addr1.String())
+
+ tests := []struct {
+ name string
+ msg func() *types.MsgBurn
+ expectPass bool
+ }{
+ {
+ name: "proper msg",
+ msg: func() *types.MsgBurn {
+ msg := baseMsg
+ return msg
+ },
+ expectPass: true,
+ },
+ {
+ name: "empty sender",
+ msg: func() *types.MsgBurn {
+ msg := baseMsg
+ msg.Sender = ""
+ return msg
+ },
+ expectPass: false,
+ },
+ {
+ name: "zero amount",
+ msg: func() *types.MsgBurn {
+ msg := baseMsg
+ msg.Amount.Amount = sdk.ZeroInt()
+ return msg
+ },
+ expectPass: false,
+ },
+ {
+ name: "negative amount",
+ msg: func() *types.MsgBurn {
+ msg := baseMsg
+ msg.Amount.Amount = sdk.NewInt(-10000000)
+ return msg
+ },
+ expectPass: false,
+ },
+ }
+
+ for _, test := range tests {
+ if test.expectPass {
+ require.NoError(t, test.msg().ValidateBasic(), "test: %v", test.name)
+ } else {
+ require.Error(t, test.msg().ValidateBasic(), "test: %v", test.name)
+ }
+ }
+}
+
+// TestMsgChangeAdmin tests if valid/invalid create denom messages are properly validated/invalidated
+func TestMsgChangeAdmin(t *testing.T) {
+ // generate a private/public key pair and get the respective address
+ pk1 := ed25519.GenPrivKey().PubKey()
+ addr1 := sdk.AccAddress(pk1.Address())
+ pk2 := ed25519.GenPrivKey().PubKey()
+ addr2 := sdk.AccAddress(pk2.Address())
+ tokenFactoryDenom := fmt.Sprintf("factory/%s/bitcoin", addr1.String())
+
+ // make a proper changeAdmin message
+ baseMsg := types.NewMsgChangeAdmin(
+ addr1.String(),
+ tokenFactoryDenom,
+ addr2.String(),
+ )
+
+ // validate changeAdmin message was created as intended
+ require.Equal(t, baseMsg.Route(), types.RouterKey)
+ require.Equal(t, baseMsg.Type(), "change_admin")
+ signers := baseMsg.GetSigners()
+ require.Equal(t, len(signers), 1)
+ require.Equal(t, signers[0].String(), addr1.String())
+
+ tests := []struct {
+ name string
+ msg func() *types.MsgChangeAdmin
+ expectPass bool
+ }{
+ {
+ name: "proper msg",
+ msg: func() *types.MsgChangeAdmin {
+ msg := baseMsg
+ return msg
+ },
+ expectPass: true,
+ },
+ {
+ name: "empty sender",
+ msg: func() *types.MsgChangeAdmin {
+ msg := baseMsg
+ msg.Sender = ""
+ return msg
+ },
+ expectPass: false,
+ },
+ {
+ name: "empty newAdmin",
+ msg: func() *types.MsgChangeAdmin {
+ msg := baseMsg
+ msg.NewAdmin = ""
+ return msg
+ },
+ expectPass: false,
+ },
+ {
+ name: "invalid denom",
+ msg: func() *types.MsgChangeAdmin {
+ msg := baseMsg
+ msg.Denom = "bitcoin"
+ return msg
+ },
+ expectPass: false,
+ },
+ }
+
+ for _, test := range tests {
+ if test.expectPass {
+ require.NoError(t, test.msg().ValidateBasic(), "test: %v", test.name)
+ } else {
+ require.Error(t, test.msg().ValidateBasic(), "test: %v", test.name)
+ }
+ }
+}
+
+// TestMsgSetDenomMetadata tests if valid/invalid create denom messages are properly validated/invalidated
+func TestMsgSetDenomMetadata(t *testing.T) {
+ // generate a private/public key pair and get the respective address
+ pk1 := ed25519.GenPrivKey().PubKey()
+ addr1 := sdk.AccAddress(pk1.Address())
+ tokenFactoryDenom := fmt.Sprintf("factory/%s/bitcoin", addr1.String())
+ denomMetadata := banktypes.Metadata{
+ Description: "nakamoto",
+ DenomUnits: []*banktypes.DenomUnit{
+ {
+ Denom: tokenFactoryDenom,
+ Exponent: 0,
+ },
+ {
+ Denom: "sats",
+ Exponent: 6,
+ },
+ },
+ Display: "sats",
+ Base: tokenFactoryDenom,
+ Name: "bitcoin",
+ Symbol: "BTC",
+ }
+ invalidDenomMetadata := banktypes.Metadata{
+ Description: "nakamoto",
+ DenomUnits: []*banktypes.DenomUnit{
+ {
+ Denom: "bitcoin",
+ Exponent: 0,
+ },
+ {
+ Denom: "sats",
+ Exponent: 6,
+ },
+ },
+ Display: "sats",
+ Base: "bitcoin",
+ Name: "bitcoin",
+ Symbol: "BTC",
+ }
+
+ // make a proper setDenomMetadata message
+ baseMsg := types.NewMsgSetDenomMetadata(
+ addr1.String(),
+ denomMetadata,
+ )
+
+ // validate setDenomMetadata message was created as intended
+ require.Equal(t, baseMsg.Route(), types.RouterKey)
+ require.Equal(t, baseMsg.Type(), "set_denom_metadata")
+ signers := baseMsg.GetSigners()
+ require.Equal(t, len(signers), 1)
+ require.Equal(t, signers[0].String(), addr1.String())
+
+ tests := []struct {
+ name string
+ msg func() *types.MsgSetDenomMetadata
+ expectPass bool
+ }{
+ {
+ name: "proper msg",
+ msg: func() *types.MsgSetDenomMetadata {
+ msg := baseMsg
+ return msg
+ },
+ expectPass: true,
+ },
+ {
+ name: "empty sender",
+ msg: func() *types.MsgSetDenomMetadata {
+ msg := baseMsg
+ msg.Sender = ""
+ return msg
+ },
+ expectPass: false,
+ },
+ {
+ name: "invalid metadata",
+ msg: func() *types.MsgSetDenomMetadata {
+ msg := baseMsg
+ msg.Metadata.Name = ""
+ return msg
+ },
+
+ expectPass: false,
+ },
+ {
+ name: "invalid base",
+ msg: func() *types.MsgSetDenomMetadata {
+ msg := baseMsg
+ msg.Metadata = invalidDenomMetadata
+ return msg
+ },
+ expectPass: false,
+ },
+ }
+
+ for _, test := range tests {
+ if test.expectPass {
+ require.NoError(t, test.msg().ValidateBasic(), "test: %v", test.name)
+ } else {
+ require.Error(t, test.msg().ValidateBasic(), "test: %v", test.name)
+ }
+ }
+}
diff --git a/x/tokenfactory/types/params.go b/x/tokenfactory/types/params.go
new file mode 100644
index 0000000000..a4830789eb
--- /dev/null
+++ b/x/tokenfactory/types/params.go
@@ -0,0 +1,62 @@
+package types
+
+import (
+ "fmt"
+
+ sdk "github.com/cosmos/cosmos-sdk/types"
+ paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
+)
+
+// Parameter store keys.
+var (
+ KeyDenomCreationFee = []byte("DenomCreationFee")
+)
+
+// ParamTable for gamm module.
+func ParamKeyTable() paramtypes.KeyTable {
+ return paramtypes.NewKeyTable().RegisterParamSet(&Params{})
+}
+
+func NewParams(denomCreationFee sdk.Coins) Params {
+ return Params{
+ DenomCreationFee: denomCreationFee,
+ }
+}
+
+// default gamm module parameters.
+func DefaultParams() Params {
+ return Params{
+ // this was from osmosis
+ // DenomCreationFee: sdk.NewCoins(sdk.NewInt64Coin(appparams.BaseCoinUnit, 10_000_000)), // 10 OSMO
+ DenomCreationFee: sdk.NewCoins(sdk.NewInt64Coin(sdk.DefaultBondDenom, 10_000_000)), // 10 OSMO
+ }
+}
+
+// validate params.
+func (p Params) Validate() error {
+ if err := validateDenomCreationFee(p.DenomCreationFee); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// Implements params.ParamSet.
+func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs {
+ return paramtypes.ParamSetPairs{
+ paramtypes.NewParamSetPair(KeyDenomCreationFee, &p.DenomCreationFee, validateDenomCreationFee),
+ }
+}
+
+func validateDenomCreationFee(i interface{}) error {
+ v, ok := i.(sdk.Coins)
+ if !ok {
+ return fmt.Errorf("invalid parameter type: %T", i)
+ }
+
+ if v.Validate() != nil {
+ return fmt.Errorf("invalid denom creation fee: %+v", i)
+ }
+
+ return nil
+}
diff --git a/x/tokenfactory/types/params.pb.go b/x/tokenfactory/types/params.pb.go
new file mode 100644
index 0000000000..0342cb1545
--- /dev/null
+++ b/x/tokenfactory/types/params.pb.go
@@ -0,0 +1,342 @@
+// Code generated by protoc-gen-gogo. DO NOT EDIT.
+// source: cosmwasm/tokenfactory/v1beta1/params.proto
+
+package types
+
+import (
+ fmt "fmt"
+ _ "github.com/cosmos/cosmos-proto"
+ github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
+ types "github.com/cosmos/cosmos-sdk/types"
+ _ "github.com/cosmos/gogoproto/gogoproto"
+ proto "github.com/cosmos/gogoproto/proto"
+ 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 tokenfactory module.
+type Params struct {
+ DenomCreationFee github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=denom_creation_fee,json=denomCreationFee,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"denom_creation_fee" yaml:"denom_creation_fee"`
+}
+
+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_c2e403a2e90cdef7, []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) GetDenomCreationFee() github_com_cosmos_cosmos_sdk_types.Coins {
+ if m != nil {
+ return m.DenomCreationFee
+ }
+ return nil
+}
+
+func init() {
+ proto.RegisterType((*Params)(nil), "cosmwasm.tokenfactory.v1beta1.Params")
+}
+
+func init() {
+ proto.RegisterFile("cosmwasm/tokenfactory/v1beta1/params.proto", fileDescriptor_c2e403a2e90cdef7)
+}
+
+var fileDescriptor_c2e403a2e90cdef7 = []byte{
+ // 309 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x90, 0x31, 0x4b, 0xc3, 0x40,
+ 0x14, 0xc7, 0x73, 0x08, 0x1d, 0xea, 0x22, 0xc5, 0xc1, 0x16, 0xbc, 0x48, 0xa6, 0x22, 0x78, 0x47,
+ 0x15, 0x17, 0xc7, 0x06, 0xc4, 0xa5, 0x20, 0x2e, 0x82, 0x4b, 0x78, 0x49, 0xae, 0x69, 0xa8, 0x97,
+ 0x17, 0x72, 0x57, 0x35, 0xdf, 0xc2, 0xc9, 0xdd, 0xd5, 0x4f, 0xd2, 0xb1, 0xa3, 0x53, 0x95, 0xe4,
+ 0x1b, 0xf8, 0x09, 0x24, 0x97, 0xab, 0x54, 0x04, 0xa7, 0xbb, 0xc7, 0xfb, 0xff, 0x7f, 0xef, 0xbd,
+ 0x7f, 0xf7, 0x38, 0x42, 0x25, 0x1f, 0x41, 0x49, 0xae, 0x71, 0x2e, 0xb2, 0x29, 0x44, 0x1a, 0x8b,
+ 0x92, 0x3f, 0x8c, 0x42, 0xa1, 0x61, 0xc4, 0x73, 0x28, 0x40, 0x2a, 0x96, 0x17, 0xa8, 0xb1, 0x77,
+ 0xb8, 0xd1, 0xb2, 0x6d, 0x2d, 0xb3, 0xda, 0xc1, 0x7e, 0x82, 0x09, 0x1a, 0x25, 0x6f, 0x7e, 0xad,
+ 0x69, 0x70, 0xfe, 0xff, 0x00, 0x58, 0xe8, 0x19, 0x16, 0xa9, 0x2e, 0x27, 0x42, 0x43, 0x0c, 0x1a,
+ 0xac, 0xad, 0xdf, 0xd8, 0x50, 0x05, 0x2d, 0xaf, 0x2d, 0x6c, 0x8b, 0xb6, 0x15, 0x0f, 0x41, 0x89,
+ 0x1f, 0x4e, 0x84, 0x69, 0xd6, 0xf6, 0xbd, 0x57, 0xd2, 0xed, 0x5c, 0x9b, 0xbd, 0x7b, 0x2f, 0xa4,
+ 0xdb, 0x8b, 0x45, 0x86, 0x32, 0x88, 0x0a, 0x01, 0x3a, 0xc5, 0x2c, 0x98, 0x0a, 0x71, 0x40, 0x8e,
+ 0x76, 0x86, 0xbb, 0xa7, 0x7d, 0x66, 0xb1, 0x0d, 0x68, 0x73, 0x05, 0xf3, 0x31, 0xcd, 0xc6, 0x93,
+ 0xe5, 0xda, 0x75, 0xbe, 0xd6, 0x6e, 0xbf, 0x04, 0x79, 0x7f, 0xe1, 0xfd, 0x45, 0x78, 0x6f, 0x1f,
+ 0xee, 0x30, 0x49, 0xf5, 0x6c, 0x11, 0xb2, 0x08, 0xa5, 0x5d, 0xd0, 0x3e, 0x27, 0x2a, 0x9e, 0x73,
+ 0x5d, 0xe6, 0x42, 0x19, 0x9a, 0xba, 0xd9, 0x33, 0x00, 0xdf, 0xfa, 0x2f, 0x85, 0x18, 0x5f, 0x2d,
+ 0x2b, 0x4a, 0x56, 0x15, 0x25, 0x9f, 0x15, 0x25, 0xcf, 0x35, 0x75, 0x56, 0x35, 0x75, 0xde, 0x6b,
+ 0xea, 0xdc, 0xb1, 0x2d, 0xaa, 0x8f, 0x4a, 0xde, 0x36, 0xd1, 0x35, 0xf9, 0xc5, 0xfc, 0xe9, 0x77,
+ 0x84, 0x66, 0x42, 0xd8, 0x31, 0x47, 0x9f, 0x7d, 0x07, 0x00, 0x00, 0xff, 0xff, 0xad, 0xc5, 0x5a,
+ 0xa9, 0xc9, 0x01, 0x00, 0x00,
+}
+
+func (m *Params) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *Params) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.DenomCreationFee) > 0 {
+ for iNdEx := len(m.DenomCreationFee) - 1; iNdEx >= 0; iNdEx-- {
+ {
+ size, err := m.DenomCreationFee[iNdEx].MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = encodeVarintParams(dAtA, i, uint64(size))
+ }
+ i--
+ dAtA[i] = 0xa
+ }
+ }
+ return len(dAtA) - i, nil
+}
+
+func encodeVarintParams(dAtA []byte, offset int, v uint64) int {
+ offset -= sovParams(v)
+ base := offset
+ for v >= 1<<7 {
+ dAtA[offset] = uint8(v&0x7f | 0x80)
+ v >>= 7
+ offset++
+ }
+ dAtA[offset] = uint8(v)
+ return base
+}
+func (m *Params) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if len(m.DenomCreationFee) > 0 {
+ for _, e := range m.DenomCreationFee {
+ l = e.Size()
+ n += 1 + l + sovParams(uint64(l))
+ }
+ }
+ return n
+}
+
+func sovParams(x uint64) (n int) {
+ return (math_bits.Len64(x|1) + 6) / 7
+}
+func sozParams(x uint64) (n int) {
+ return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63))))
+}
+func (m *Params) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowParams
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: Params: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field DenomCreationFee", 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
+ }
+ m.DenomCreationFee = append(m.DenomCreationFee, types.Coin{})
+ if err := m.DenomCreationFee[len(m.DenomCreationFee)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipParams(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthParams
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func skipParams(dAtA []byte) (n int, err error) {
+ l := len(dAtA)
+ iNdEx := 0
+ depth := 0
+ for iNdEx < l {
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowParams
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ wireType := int(wire & 0x7)
+ switch wireType {
+ case 0:
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowParams
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ iNdEx++
+ if dAtA[iNdEx-1] < 0x80 {
+ break
+ }
+ }
+ case 1:
+ iNdEx += 8
+ case 2:
+ var length int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowParams
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ length |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if length < 0 {
+ return 0, ErrInvalidLengthParams
+ }
+ iNdEx += length
+ case 3:
+ depth++
+ case 4:
+ if depth == 0 {
+ return 0, ErrUnexpectedEndOfGroupParams
+ }
+ depth--
+ case 5:
+ iNdEx += 4
+ default:
+ return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
+ }
+ if iNdEx < 0 {
+ return 0, ErrInvalidLengthParams
+ }
+ if depth == 0 {
+ return iNdEx, nil
+ }
+ }
+ return 0, io.ErrUnexpectedEOF
+}
+
+var (
+ ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling")
+ ErrIntOverflowParams = fmt.Errorf("proto: integer overflow")
+ ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group")
+)
diff --git a/x/tokenfactory/types/query.pb.go b/x/tokenfactory/types/query.pb.go
new file mode 100644
index 0000000000..4dafc96842
--- /dev/null
+++ b/x/tokenfactory/types/query.pb.go
@@ -0,0 +1,1333 @@
+// Code generated by protoc-gen-gogo. DO NOT EDIT.
+// source: cosmwasm/tokenfactory/v1beta1/query.proto
+
+package types
+
+import (
+ context "context"
+ fmt "fmt"
+ _ "github.com/cosmos/cosmos-sdk/types/query"
+ _ "github.com/cosmos/gogoproto/gogoproto"
+ grpc1 "github.com/cosmos/gogoproto/grpc"
+ proto "github.com/cosmos/gogoproto/proto"
+ _ "google.golang.org/genproto/googleapis/api/annotations"
+ grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
+ io "io"
+ math "math"
+ math_bits "math/bits"
+)
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
+
+// 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_d8606ce711f56ea6, []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_d8606ce711f56ea6, []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{}
+}
+
+// QueryDenomAuthorityMetadataRequest defines the request structure for the
+// DenomAuthorityMetadata gRPC query.
+type QueryDenomAuthorityMetadataRequest struct {
+ Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"`
+}
+
+func (m *QueryDenomAuthorityMetadataRequest) Reset() { *m = QueryDenomAuthorityMetadataRequest{} }
+func (m *QueryDenomAuthorityMetadataRequest) String() string { return proto.CompactTextString(m) }
+func (*QueryDenomAuthorityMetadataRequest) ProtoMessage() {}
+func (*QueryDenomAuthorityMetadataRequest) Descriptor() ([]byte, []int) {
+ return fileDescriptor_d8606ce711f56ea6, []int{2}
+}
+func (m *QueryDenomAuthorityMetadataRequest) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *QueryDenomAuthorityMetadataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_QueryDenomAuthorityMetadataRequest.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *QueryDenomAuthorityMetadataRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_QueryDenomAuthorityMetadataRequest.Merge(m, src)
+}
+func (m *QueryDenomAuthorityMetadataRequest) XXX_Size() int {
+ return m.Size()
+}
+func (m *QueryDenomAuthorityMetadataRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_QueryDenomAuthorityMetadataRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_QueryDenomAuthorityMetadataRequest proto.InternalMessageInfo
+
+func (m *QueryDenomAuthorityMetadataRequest) GetDenom() string {
+ if m != nil {
+ return m.Denom
+ }
+ return ""
+}
+
+// QueryDenomAuthorityMetadataResponse defines the response structure for the
+// DenomAuthorityMetadata gRPC query.
+type QueryDenomAuthorityMetadataResponse struct {
+ AuthorityMetadata DenomAuthorityMetadata `protobuf:"bytes,1,opt,name=authority_metadata,json=authorityMetadata,proto3" json:"authority_metadata" yaml:"authority_metadata"`
+}
+
+func (m *QueryDenomAuthorityMetadataResponse) Reset() { *m = QueryDenomAuthorityMetadataResponse{} }
+func (m *QueryDenomAuthorityMetadataResponse) String() string { return proto.CompactTextString(m) }
+func (*QueryDenomAuthorityMetadataResponse) ProtoMessage() {}
+func (*QueryDenomAuthorityMetadataResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_d8606ce711f56ea6, []int{3}
+}
+func (m *QueryDenomAuthorityMetadataResponse) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *QueryDenomAuthorityMetadataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_QueryDenomAuthorityMetadataResponse.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *QueryDenomAuthorityMetadataResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_QueryDenomAuthorityMetadataResponse.Merge(m, src)
+}
+func (m *QueryDenomAuthorityMetadataResponse) XXX_Size() int {
+ return m.Size()
+}
+func (m *QueryDenomAuthorityMetadataResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_QueryDenomAuthorityMetadataResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_QueryDenomAuthorityMetadataResponse proto.InternalMessageInfo
+
+func (m *QueryDenomAuthorityMetadataResponse) GetAuthorityMetadata() DenomAuthorityMetadata {
+ if m != nil {
+ return m.AuthorityMetadata
+ }
+ return DenomAuthorityMetadata{}
+}
+
+// QueryDenomsFromCreatorRequest defines the request structure for the
+// DenomsFromCreator gRPC query.
+type QueryDenomsFromCreatorRequest struct {
+ Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty" yaml:"creator"`
+}
+
+func (m *QueryDenomsFromCreatorRequest) Reset() { *m = QueryDenomsFromCreatorRequest{} }
+func (m *QueryDenomsFromCreatorRequest) String() string { return proto.CompactTextString(m) }
+func (*QueryDenomsFromCreatorRequest) ProtoMessage() {}
+func (*QueryDenomsFromCreatorRequest) Descriptor() ([]byte, []int) {
+ return fileDescriptor_d8606ce711f56ea6, []int{4}
+}
+func (m *QueryDenomsFromCreatorRequest) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *QueryDenomsFromCreatorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_QueryDenomsFromCreatorRequest.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *QueryDenomsFromCreatorRequest) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_QueryDenomsFromCreatorRequest.Merge(m, src)
+}
+func (m *QueryDenomsFromCreatorRequest) XXX_Size() int {
+ return m.Size()
+}
+func (m *QueryDenomsFromCreatorRequest) XXX_DiscardUnknown() {
+ xxx_messageInfo_QueryDenomsFromCreatorRequest.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_QueryDenomsFromCreatorRequest proto.InternalMessageInfo
+
+func (m *QueryDenomsFromCreatorRequest) GetCreator() string {
+ if m != nil {
+ return m.Creator
+ }
+ return ""
+}
+
+// QueryDenomsFromCreatorRequest defines the response structure for the
+// DenomsFromCreator gRPC query.
+type QueryDenomsFromCreatorResponse struct {
+ Denoms []string `protobuf:"bytes,1,rep,name=denoms,proto3" json:"denoms,omitempty" yaml:"denoms"`
+}
+
+func (m *QueryDenomsFromCreatorResponse) Reset() { *m = QueryDenomsFromCreatorResponse{} }
+func (m *QueryDenomsFromCreatorResponse) String() string { return proto.CompactTextString(m) }
+func (*QueryDenomsFromCreatorResponse) ProtoMessage() {}
+func (*QueryDenomsFromCreatorResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_d8606ce711f56ea6, []int{5}
+}
+func (m *QueryDenomsFromCreatorResponse) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *QueryDenomsFromCreatorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_QueryDenomsFromCreatorResponse.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *QueryDenomsFromCreatorResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_QueryDenomsFromCreatorResponse.Merge(m, src)
+}
+func (m *QueryDenomsFromCreatorResponse) XXX_Size() int {
+ return m.Size()
+}
+func (m *QueryDenomsFromCreatorResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_QueryDenomsFromCreatorResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_QueryDenomsFromCreatorResponse proto.InternalMessageInfo
+
+func (m *QueryDenomsFromCreatorResponse) GetDenoms() []string {
+ if m != nil {
+ return m.Denoms
+ }
+ return nil
+}
+
+func init() {
+ proto.RegisterType((*QueryParamsRequest)(nil), "cosmwasm.tokenfactory.v1beta1.QueryParamsRequest")
+ proto.RegisterType((*QueryParamsResponse)(nil), "cosmwasm.tokenfactory.v1beta1.QueryParamsResponse")
+ proto.RegisterType((*QueryDenomAuthorityMetadataRequest)(nil), "cosmwasm.tokenfactory.v1beta1.QueryDenomAuthorityMetadataRequest")
+ proto.RegisterType((*QueryDenomAuthorityMetadataResponse)(nil), "cosmwasm.tokenfactory.v1beta1.QueryDenomAuthorityMetadataResponse")
+ proto.RegisterType((*QueryDenomsFromCreatorRequest)(nil), "cosmwasm.tokenfactory.v1beta1.QueryDenomsFromCreatorRequest")
+ proto.RegisterType((*QueryDenomsFromCreatorResponse)(nil), "cosmwasm.tokenfactory.v1beta1.QueryDenomsFromCreatorResponse")
+}
+
+func init() {
+ proto.RegisterFile("cosmwasm/tokenfactory/v1beta1/query.proto", fileDescriptor_d8606ce711f56ea6)
+}
+
+var fileDescriptor_d8606ce711f56ea6 = []byte{
+ // 580 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0xcf, 0x6b, 0x13, 0x41,
+ 0x14, 0xce, 0x6a, 0x1b, 0xe9, 0xf8, 0x03, 0x3b, 0x16, 0xd1, 0x60, 0x37, 0x3a, 0x6a, 0x69, 0xa5,
+ 0xec, 0x90, 0x48, 0x2f, 0x6a, 0x91, 0x6c, 0x44, 0x05, 0x2d, 0xe8, 0x5e, 0x84, 0x5e, 0xc2, 0x24,
+ 0x99, 0x6e, 0x17, 0xbb, 0xfb, 0xb6, 0x3b, 0x13, 0x35, 0x94, 0x5e, 0xbc, 0x78, 0x15, 0x3c, 0xfb,
+ 0x37, 0xf8, 0x6f, 0xf4, 0x58, 0x10, 0xc1, 0x53, 0x90, 0xc4, 0x83, 0x78, 0xcc, 0x5f, 0x20, 0x3b,
+ 0x33, 0xa9, 0xa9, 0x49, 0xb7, 0x51, 0x4f, 0x59, 0xde, 0xfb, 0xde, 0xf7, 0xbe, 0xef, 0xbd, 0x97,
+ 0x41, 0x4b, 0x0d, 0x10, 0xe1, 0x6b, 0x26, 0x42, 0x2a, 0xe1, 0x25, 0x8f, 0x36, 0x58, 0x43, 0x42,
+ 0xd2, 0xa6, 0xaf, 0x4a, 0x75, 0x2e, 0x59, 0x89, 0x6e, 0xb7, 0x78, 0xd2, 0x76, 0xe2, 0x04, 0x24,
+ 0xe0, 0xf9, 0x01, 0xd4, 0x19, 0x86, 0x3a, 0x06, 0x5a, 0x98, 0xf3, 0xc1, 0x07, 0x85, 0xa4, 0xe9,
+ 0x97, 0x2e, 0x2a, 0x5c, 0xf1, 0x01, 0xfc, 0x2d, 0x4e, 0x59, 0x1c, 0x50, 0x16, 0x45, 0x20, 0x99,
+ 0x0c, 0x20, 0x12, 0x26, 0x7b, 0x2b, 0xa5, 0x04, 0x41, 0xeb, 0x4c, 0x70, 0xdd, 0xeb, 0xa0, 0x73,
+ 0xcc, 0xfc, 0x20, 0x52, 0x60, 0x83, 0x5d, 0xc9, 0x56, 0xca, 0x5a, 0x72, 0x13, 0x92, 0x40, 0xb6,
+ 0xd7, 0xb8, 0x64, 0x4d, 0x26, 0xd9, 0x70, 0x8b, 0xa3, 0xcb, 0x62, 0x96, 0xb0, 0xd0, 0xc8, 0x21,
+ 0x73, 0x08, 0x3f, 0x4f, 0x45, 0x3c, 0x53, 0x41, 0x8f, 0x6f, 0xb7, 0xb8, 0x90, 0x64, 0x1d, 0x5d,
+ 0x38, 0x14, 0x15, 0x31, 0x44, 0x82, 0xe3, 0x2a, 0xca, 0xeb, 0xe2, 0x4b, 0xd6, 0x55, 0x6b, 0xf1,
+ 0x74, 0xf9, 0xa6, 0x93, 0x39, 0x1f, 0x47, 0x97, 0xbb, 0x53, 0x7b, 0x9d, 0x62, 0xce, 0x33, 0xa5,
+ 0xe4, 0x29, 0x22, 0x8a, 0xfb, 0x01, 0x8f, 0x20, 0xac, 0xfc, 0x69, 0xc1, 0x28, 0xc0, 0x0b, 0x68,
+ 0xba, 0x99, 0x02, 0x54, 0xa7, 0x19, 0xf7, 0x7c, 0xbf, 0x53, 0x3c, 0xd3, 0x66, 0xe1, 0xd6, 0x1d,
+ 0xa2, 0xc2, 0xc4, 0xd3, 0x69, 0xf2, 0xc9, 0x42, 0xd7, 0x33, 0xe9, 0x8c, 0xf4, 0x77, 0x16, 0xc2,
+ 0x07, 0xf3, 0xaa, 0x85, 0x26, 0x6d, 0x7c, 0xac, 0x1c, 0xe3, 0x63, 0x3c, 0xb7, 0x7b, 0x2d, 0xf5,
+ 0xd5, 0xef, 0x14, 0x2f, 0x6b, 0x61, 0xa3, 0xf4, 0xc4, 0x9b, 0x1d, 0xd9, 0x11, 0x59, 0x43, 0xf3,
+ 0xbf, 0x05, 0x8b, 0x87, 0x09, 0x84, 0xd5, 0x84, 0x33, 0x09, 0xc9, 0xc0, 0xfa, 0x32, 0x3a, 0xd5,
+ 0xd0, 0x11, 0x63, 0x1e, 0xf7, 0x3b, 0xc5, 0x73, 0xba, 0x87, 0x49, 0x10, 0x6f, 0x00, 0x21, 0x4f,
+ 0x90, 0x7d, 0x14, 0x9d, 0xb1, 0xbe, 0x84, 0xf2, 0x6a, 0x56, 0xe9, 0xd6, 0x4e, 0x2e, 0xce, 0xb8,
+ 0xb3, 0xfd, 0x4e, 0xf1, 0xec, 0xd0, 0x2c, 0x05, 0xf1, 0x0c, 0xa0, 0xfc, 0x73, 0x0a, 0x4d, 0x2b,
+ 0x36, 0xfc, 0xd1, 0x42, 0x79, 0xbd, 0x3e, 0x5c, 0x3a, 0x66, 0x3a, 0xa3, 0xf7, 0x53, 0x28, 0xff,
+ 0x4d, 0x89, 0x96, 0x49, 0x96, 0xdf, 0x7e, 0xfe, 0xfe, 0xe1, 0xc4, 0x02, 0xbe, 0x41, 0xd5, 0x1f,
+ 0x24, 0x10, 0x59, 0xd7, 0x8b, 0x7f, 0x58, 0xe8, 0xe2, 0xf8, 0xb5, 0xe0, 0xca, 0x24, 0xcd, 0x33,
+ 0xaf, 0xaf, 0xe0, 0xfe, 0x0f, 0x85, 0xf1, 0xf3, 0x48, 0xf9, 0xa9, 0xe0, 0xfb, 0xd9, 0x7e, 0xf4,
+ 0xe4, 0xe9, 0x8e, 0xfa, 0xdd, 0xa5, 0xa3, 0x47, 0x84, 0xbf, 0x58, 0x68, 0x76, 0x64, 0xbb, 0xf8,
+ 0xde, 0xc4, 0x12, 0xc7, 0xdc, 0x58, 0x61, 0xf5, 0x1f, 0xab, 0x8d, 0xb7, 0xaa, 0xf2, 0xb6, 0x8a,
+ 0xef, 0x4e, 0xe2, 0xad, 0xb6, 0x91, 0x40, 0x58, 0x33, 0xf7, 0x4a, 0x77, 0xcc, 0xc7, 0xae, 0xfb,
+ 0x78, 0xaf, 0x6b, 0x5b, 0xfb, 0x5d, 0xdb, 0xfa, 0xd6, 0xb5, 0xad, 0xf7, 0x3d, 0x3b, 0xb7, 0xdf,
+ 0xb3, 0x73, 0x5f, 0x7b, 0x76, 0x6e, 0xdd, 0xf1, 0x03, 0xb9, 0xd9, 0xaa, 0x3b, 0x0d, 0x08, 0x69,
+ 0x15, 0x44, 0xf8, 0x22, 0x7d, 0xcb, 0x52, 0xb1, 0x4d, 0xfa, 0xe6, 0x70, 0x27, 0xd9, 0x8e, 0xb9,
+ 0xa8, 0xe7, 0xd5, 0x5b, 0x76, 0xfb, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa5, 0xea, 0x8e, 0xf0,
+ 0xda, 0x05, 0x00, 0x00,
+}
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ context.Context
+var _ grpc.ClientConn
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+const _ = grpc.SupportPackageIsVersion4
+
+// QueryClient is the client API for Query service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
+type QueryClient interface {
+ // Params defines a gRPC query method that returns the tokenfactory module's
+ // parameters.
+ Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
+ // DenomAuthorityMetadata defines a gRPC query method for fetching
+ // DenomAuthorityMetadata for a particular denom.
+ DenomAuthorityMetadata(ctx context.Context, in *QueryDenomAuthorityMetadataRequest, opts ...grpc.CallOption) (*QueryDenomAuthorityMetadataResponse, error)
+ // DenomsFromCreator defines a gRPC query method for fetching all
+ // denominations created by a specific admin/creator.
+ DenomsFromCreator(ctx context.Context, in *QueryDenomsFromCreatorRequest, opts ...grpc.CallOption) (*QueryDenomsFromCreatorResponse, error)
+}
+
+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, "/cosmwasm.tokenfactory.v1beta1.Query/Params", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *queryClient) DenomAuthorityMetadata(ctx context.Context, in *QueryDenomAuthorityMetadataRequest, opts ...grpc.CallOption) (*QueryDenomAuthorityMetadataResponse, error) {
+ out := new(QueryDenomAuthorityMetadataResponse)
+ err := c.cc.Invoke(ctx, "/cosmwasm.tokenfactory.v1beta1.Query/DenomAuthorityMetadata", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *queryClient) DenomsFromCreator(ctx context.Context, in *QueryDenomsFromCreatorRequest, opts ...grpc.CallOption) (*QueryDenomsFromCreatorResponse, error) {
+ out := new(QueryDenomsFromCreatorResponse)
+ err := c.cc.Invoke(ctx, "/cosmwasm.tokenfactory.v1beta1.Query/DenomsFromCreator", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+// QueryServer is the server API for Query service.
+type QueryServer interface {
+ // Params defines a gRPC query method that returns the tokenfactory module's
+ // parameters.
+ Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
+ // DenomAuthorityMetadata defines a gRPC query method for fetching
+ // DenomAuthorityMetadata for a particular denom.
+ DenomAuthorityMetadata(context.Context, *QueryDenomAuthorityMetadataRequest) (*QueryDenomAuthorityMetadataResponse, error)
+ // DenomsFromCreator defines a gRPC query method for fetching all
+ // denominations created by a specific admin/creator.
+ DenomsFromCreator(context.Context, *QueryDenomsFromCreatorRequest) (*QueryDenomsFromCreatorResponse, 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) DenomAuthorityMetadata(ctx context.Context, req *QueryDenomAuthorityMetadataRequest) (*QueryDenomAuthorityMetadataResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method DenomAuthorityMetadata not implemented")
+}
+func (*UnimplementedQueryServer) DenomsFromCreator(ctx context.Context, req *QueryDenomsFromCreatorRequest) (*QueryDenomsFromCreatorResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method DenomsFromCreator 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: "/cosmwasm.tokenfactory.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_DenomAuthorityMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(QueryDenomAuthorityMetadataRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(QueryServer).DenomAuthorityMetadata(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/cosmwasm.tokenfactory.v1beta1.Query/DenomAuthorityMetadata",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(QueryServer).DenomAuthorityMetadata(ctx, req.(*QueryDenomAuthorityMetadataRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _Query_DenomsFromCreator_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(QueryDenomsFromCreatorRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(QueryServer).DenomsFromCreator(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/cosmwasm.tokenfactory.v1beta1.Query/DenomsFromCreator",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(QueryServer).DenomsFromCreator(ctx, req.(*QueryDenomsFromCreatorRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+var _Query_serviceDesc = grpc.ServiceDesc{
+ ServiceName: "cosmwasm.tokenfactory.v1beta1.Query",
+ HandlerType: (*QueryServer)(nil),
+ Methods: []grpc.MethodDesc{
+ {
+ MethodName: "Params",
+ Handler: _Query_Params_Handler,
+ },
+ {
+ MethodName: "DenomAuthorityMetadata",
+ Handler: _Query_DenomAuthorityMetadata_Handler,
+ },
+ {
+ MethodName: "DenomsFromCreator",
+ Handler: _Query_DenomsFromCreator_Handler,
+ },
+ },
+ Streams: []grpc.StreamDesc{},
+ Metadata: "cosmwasm/tokenfactory/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 *QueryDenomAuthorityMetadataRequest) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *QueryDenomAuthorityMetadataRequest) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *QueryDenomAuthorityMetadataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Denom) > 0 {
+ i -= len(m.Denom)
+ copy(dAtA[i:], m.Denom)
+ i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom)))
+ i--
+ dAtA[i] = 0xa
+ }
+ return len(dAtA) - i, nil
+}
+
+func (m *QueryDenomAuthorityMetadataResponse) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *QueryDenomAuthorityMetadataResponse) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *QueryDenomAuthorityMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ {
+ size, err := m.AuthorityMetadata.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 *QueryDenomsFromCreatorRequest) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *QueryDenomsFromCreatorRequest) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *QueryDenomsFromCreatorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Creator) > 0 {
+ i -= len(m.Creator)
+ copy(dAtA[i:], m.Creator)
+ i = encodeVarintQuery(dAtA, i, uint64(len(m.Creator)))
+ i--
+ dAtA[i] = 0xa
+ }
+ return len(dAtA) - i, nil
+}
+
+func (m *QueryDenomsFromCreatorResponse) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *QueryDenomsFromCreatorResponse) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *QueryDenomsFromCreatorResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Denoms) > 0 {
+ for iNdEx := len(m.Denoms) - 1; iNdEx >= 0; iNdEx-- {
+ i -= len(m.Denoms[iNdEx])
+ copy(dAtA[i:], m.Denoms[iNdEx])
+ i = encodeVarintQuery(dAtA, i, uint64(len(m.Denoms[iNdEx])))
+ i--
+ dAtA[i] = 0xa
+ }
+ }
+ return len(dAtA) - i, nil
+}
+
+func encodeVarintQuery(dAtA []byte, offset int, v uint64) int {
+ offset -= sovQuery(v)
+ base := offset
+ 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 *QueryDenomAuthorityMetadataRequest) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Denom)
+ if l > 0 {
+ n += 1 + l + sovQuery(uint64(l))
+ }
+ return n
+}
+
+func (m *QueryDenomAuthorityMetadataResponse) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = m.AuthorityMetadata.Size()
+ n += 1 + l + sovQuery(uint64(l))
+ return n
+}
+
+func (m *QueryDenomsFromCreatorRequest) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Creator)
+ if l > 0 {
+ n += 1 + l + sovQuery(uint64(l))
+ }
+ return n
+}
+
+func (m *QueryDenomsFromCreatorResponse) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ if len(m.Denoms) > 0 {
+ for _, s := range m.Denoms {
+ l = len(s)
+ n += 1 + l + sovQuery(uint64(l))
+ }
+ }
+ 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 *QueryDenomAuthorityMetadataRequest) Unmarshal(dAtA []byte) 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: QueryDenomAuthorityMetadataRequest: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: QueryDenomAuthorityMetadataRequest: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthQuery
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Denom = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipQuery(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *QueryDenomAuthorityMetadataResponse) Unmarshal(dAtA []byte) 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: QueryDenomAuthorityMetadataResponse: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: QueryDenomAuthorityMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field AuthorityMetadata", 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.AuthorityMetadata.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 *QueryDenomsFromCreatorRequest) Unmarshal(dAtA []byte) 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: QueryDenomsFromCreatorRequest: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: QueryDenomsFromCreatorRequest: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthQuery
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Creator = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ 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 *QueryDenomsFromCreatorResponse) Unmarshal(dAtA []byte) 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: QueryDenomsFromCreatorResponse: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: QueryDenomsFromCreatorResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Denoms", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowQuery
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthQuery
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthQuery
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Denoms = append(m.Denoms, string(dAtA[iNdEx:postIndex]))
+ iNdEx = postIndex
+ 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/tokenfactory/types/query.pb.gw.go b/x/tokenfactory/types/query.pb.gw.go
new file mode 100644
index 0000000000..13d4fdeaf2
--- /dev/null
+++ b/x/tokenfactory/types/query.pb.gw.go
@@ -0,0 +1,355 @@
+// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
+// source: cosmwasm/tokenfactory/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_DenomAuthorityMetadata_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryDenomAuthorityMetadataRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["denom"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom")
+ }
+
+ protoReq.Denom, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err)
+ }
+
+ msg, err := client.DenomAuthorityMetadata(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_Query_DenomAuthorityMetadata_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryDenomAuthorityMetadataRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["denom"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "denom")
+ }
+
+ protoReq.Denom, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "denom", err)
+ }
+
+ msg, err := server.DenomAuthorityMetadata(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+func request_Query_DenomsFromCreator_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryDenomsFromCreatorRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["creator"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "creator")
+ }
+
+ protoReq.Creator, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "creator", err)
+ }
+
+ msg, err := client.DenomsFromCreator(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_Query_DenomsFromCreator_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq QueryDenomsFromCreatorRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["creator"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "creator")
+ }
+
+ protoReq.Creator, err = runtime.String(val)
+
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "creator", err)
+ }
+
+ msg, err := server.DenomsFromCreator(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+// 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_DenomAuthorityMetadata_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_DenomAuthorityMetadata_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_DenomAuthorityMetadata_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_Query_DenomsFromCreator_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_Query_DenomsFromCreator_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_DenomsFromCreator_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_DenomAuthorityMetadata_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_DenomAuthorityMetadata_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_DenomAuthorityMetadata_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_Query_DenomsFromCreator_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ rctx, err := runtime.AnnotateContext(ctx, mux, req)
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_Query_DenomsFromCreator_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_DenomsFromCreator_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", "tokenfactory", "v1beta1", "params"}, "", runtime.AssumeColonVerbOpt(false)))
+
+ pattern_Query_DenomAuthorityMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"osmosis", "tokenfactory", "v1beta1", "denoms", "denom", "authority_metadata"}, "", runtime.AssumeColonVerbOpt(false)))
+
+ pattern_Query_DenomsFromCreator_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"osmosis", "tokenfactory", "v1beta1", "denoms_from_creator", "creator"}, "", runtime.AssumeColonVerbOpt(false)))
+)
+
+var (
+ forward_Query_Params_0 = runtime.ForwardResponseMessage
+
+ forward_Query_DenomAuthorityMetadata_0 = runtime.ForwardResponseMessage
+
+ forward_Query_DenomsFromCreator_0 = runtime.ForwardResponseMessage
+)
diff --git a/x/tokenfactory/types/tx.pb.go b/x/tokenfactory/types/tx.pb.go
new file mode 100644
index 0000000000..785b06424c
--- /dev/null
+++ b/x/tokenfactory/types/tx.pb.go
@@ -0,0 +1,2237 @@
+// Code generated by protoc-gen-gogo. DO NOT EDIT.
+// source: cosmwasm/tokenfactory/v1beta1/tx.proto
+
+package types
+
+import (
+ context "context"
+ fmt "fmt"
+ types "github.com/cosmos/cosmos-sdk/types"
+ types1 "github.com/cosmos/cosmos-sdk/x/bank/types"
+ _ "github.com/cosmos/gogoproto/gogoproto"
+ grpc1 "github.com/cosmos/gogoproto/grpc"
+ proto "github.com/cosmos/gogoproto/proto"
+ grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
+ io "io"
+ math "math"
+ math_bits "math/bits"
+)
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
+
+// MsgCreateDenom defines the message structure for the CreateDenom gRPC service
+// method. It allows an account to create a new denom. It requires a sender
+// address and a sub denomination. The (sender_address, sub_denomination) tuple
+// must be unique and cannot be re-used.
+//
+// The resulting denom created is defined as
+// . The resulting denom's admin is
+// originally set to be the creator, but this can be changed later. The token
+// denom does not indicate the current admin.
+type MsgCreateDenom struct {
+ Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"`
+ // subdenom can be up to 44 "alphanumeric" characters long.
+ Subdenom string `protobuf:"bytes,2,opt,name=subdenom,proto3" json:"subdenom,omitempty" yaml:"subdenom"`
+}
+
+func (m *MsgCreateDenom) Reset() { *m = MsgCreateDenom{} }
+func (m *MsgCreateDenom) String() string { return proto.CompactTextString(m) }
+func (*MsgCreateDenom) ProtoMessage() {}
+func (*MsgCreateDenom) Descriptor() ([]byte, []int) {
+ return fileDescriptor_345508fcea0bfc02, []int{0}
+}
+func (m *MsgCreateDenom) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *MsgCreateDenom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_MsgCreateDenom.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *MsgCreateDenom) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_MsgCreateDenom.Merge(m, src)
+}
+func (m *MsgCreateDenom) XXX_Size() int {
+ return m.Size()
+}
+func (m *MsgCreateDenom) XXX_DiscardUnknown() {
+ xxx_messageInfo_MsgCreateDenom.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_MsgCreateDenom proto.InternalMessageInfo
+
+func (m *MsgCreateDenom) GetSender() string {
+ if m != nil {
+ return m.Sender
+ }
+ return ""
+}
+
+func (m *MsgCreateDenom) GetSubdenom() string {
+ if m != nil {
+ return m.Subdenom
+ }
+ return ""
+}
+
+// MsgCreateDenomResponse is the return value of MsgCreateDenom
+// It returns the full string of the newly created denom
+type MsgCreateDenomResponse struct {
+ NewTokenDenom string `protobuf:"bytes,1,opt,name=new_token_denom,json=newTokenDenom,proto3" json:"new_token_denom,omitempty" yaml:"new_token_denom"`
+}
+
+func (m *MsgCreateDenomResponse) Reset() { *m = MsgCreateDenomResponse{} }
+func (m *MsgCreateDenomResponse) String() string { return proto.CompactTextString(m) }
+func (*MsgCreateDenomResponse) ProtoMessage() {}
+func (*MsgCreateDenomResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_345508fcea0bfc02, []int{1}
+}
+func (m *MsgCreateDenomResponse) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *MsgCreateDenomResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_MsgCreateDenomResponse.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *MsgCreateDenomResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_MsgCreateDenomResponse.Merge(m, src)
+}
+func (m *MsgCreateDenomResponse) XXX_Size() int {
+ return m.Size()
+}
+func (m *MsgCreateDenomResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_MsgCreateDenomResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_MsgCreateDenomResponse proto.InternalMessageInfo
+
+func (m *MsgCreateDenomResponse) GetNewTokenDenom() string {
+ if m != nil {
+ return m.NewTokenDenom
+ }
+ return ""
+}
+
+// MsgMint is the sdk.Msg type for allowing an admin account to mint
+// more of a token. For now, we only support minting to the sender account
+type MsgMint struct {
+ Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"`
+ Amount types.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount" yaml:"amount"`
+}
+
+func (m *MsgMint) Reset() { *m = MsgMint{} }
+func (m *MsgMint) String() string { return proto.CompactTextString(m) }
+func (*MsgMint) ProtoMessage() {}
+func (*MsgMint) Descriptor() ([]byte, []int) {
+ return fileDescriptor_345508fcea0bfc02, []int{2}
+}
+func (m *MsgMint) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *MsgMint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_MsgMint.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *MsgMint) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_MsgMint.Merge(m, src)
+}
+func (m *MsgMint) XXX_Size() int {
+ return m.Size()
+}
+func (m *MsgMint) XXX_DiscardUnknown() {
+ xxx_messageInfo_MsgMint.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_MsgMint proto.InternalMessageInfo
+
+func (m *MsgMint) GetSender() string {
+ if m != nil {
+ return m.Sender
+ }
+ return ""
+}
+
+func (m *MsgMint) GetAmount() types.Coin {
+ if m != nil {
+ return m.Amount
+ }
+ return types.Coin{}
+}
+
+type MsgMintResponse struct {
+}
+
+func (m *MsgMintResponse) Reset() { *m = MsgMintResponse{} }
+func (m *MsgMintResponse) String() string { return proto.CompactTextString(m) }
+func (*MsgMintResponse) ProtoMessage() {}
+func (*MsgMintResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_345508fcea0bfc02, []int{3}
+}
+func (m *MsgMintResponse) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *MsgMintResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_MsgMintResponse.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *MsgMintResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_MsgMintResponse.Merge(m, src)
+}
+func (m *MsgMintResponse) XXX_Size() int {
+ return m.Size()
+}
+func (m *MsgMintResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_MsgMintResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_MsgMintResponse proto.InternalMessageInfo
+
+// MsgBurn is the sdk.Msg type for allowing an admin account to burn
+// a token. For now, we only support burning from the sender account.
+type MsgBurn struct {
+ Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"`
+ Amount types.Coin `protobuf:"bytes,2,opt,name=amount,proto3" json:"amount" yaml:"amount"`
+}
+
+func (m *MsgBurn) Reset() { *m = MsgBurn{} }
+func (m *MsgBurn) String() string { return proto.CompactTextString(m) }
+func (*MsgBurn) ProtoMessage() {}
+func (*MsgBurn) Descriptor() ([]byte, []int) {
+ return fileDescriptor_345508fcea0bfc02, []int{4}
+}
+func (m *MsgBurn) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *MsgBurn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_MsgBurn.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *MsgBurn) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_MsgBurn.Merge(m, src)
+}
+func (m *MsgBurn) XXX_Size() int {
+ return m.Size()
+}
+func (m *MsgBurn) XXX_DiscardUnknown() {
+ xxx_messageInfo_MsgBurn.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_MsgBurn proto.InternalMessageInfo
+
+func (m *MsgBurn) GetSender() string {
+ if m != nil {
+ return m.Sender
+ }
+ return ""
+}
+
+func (m *MsgBurn) GetAmount() types.Coin {
+ if m != nil {
+ return m.Amount
+ }
+ return types.Coin{}
+}
+
+type MsgBurnResponse struct {
+}
+
+func (m *MsgBurnResponse) Reset() { *m = MsgBurnResponse{} }
+func (m *MsgBurnResponse) String() string { return proto.CompactTextString(m) }
+func (*MsgBurnResponse) ProtoMessage() {}
+func (*MsgBurnResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_345508fcea0bfc02, []int{5}
+}
+func (m *MsgBurnResponse) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *MsgBurnResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_MsgBurnResponse.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *MsgBurnResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_MsgBurnResponse.Merge(m, src)
+}
+func (m *MsgBurnResponse) XXX_Size() int {
+ return m.Size()
+}
+func (m *MsgBurnResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_MsgBurnResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_MsgBurnResponse proto.InternalMessageInfo
+
+// MsgChangeAdmin is the sdk.Msg type for allowing an admin account to reassign
+// adminship of a denom to a new account
+type MsgChangeAdmin struct {
+ Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"`
+ Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"`
+ NewAdmin string `protobuf:"bytes,3,opt,name=new_admin,json=newAdmin,proto3" json:"new_admin,omitempty" yaml:"new_admin"`
+}
+
+func (m *MsgChangeAdmin) Reset() { *m = MsgChangeAdmin{} }
+func (m *MsgChangeAdmin) String() string { return proto.CompactTextString(m) }
+func (*MsgChangeAdmin) ProtoMessage() {}
+func (*MsgChangeAdmin) Descriptor() ([]byte, []int) {
+ return fileDescriptor_345508fcea0bfc02, []int{6}
+}
+func (m *MsgChangeAdmin) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *MsgChangeAdmin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_MsgChangeAdmin.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *MsgChangeAdmin) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_MsgChangeAdmin.Merge(m, src)
+}
+func (m *MsgChangeAdmin) XXX_Size() int {
+ return m.Size()
+}
+func (m *MsgChangeAdmin) XXX_DiscardUnknown() {
+ xxx_messageInfo_MsgChangeAdmin.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_MsgChangeAdmin proto.InternalMessageInfo
+
+func (m *MsgChangeAdmin) GetSender() string {
+ if m != nil {
+ return m.Sender
+ }
+ return ""
+}
+
+func (m *MsgChangeAdmin) GetDenom() string {
+ if m != nil {
+ return m.Denom
+ }
+ return ""
+}
+
+func (m *MsgChangeAdmin) GetNewAdmin() string {
+ if m != nil {
+ return m.NewAdmin
+ }
+ return ""
+}
+
+// MsgChangeAdminResponse defines the response structure for an executed
+// MsgChangeAdmin message.
+type MsgChangeAdminResponse struct {
+}
+
+func (m *MsgChangeAdminResponse) Reset() { *m = MsgChangeAdminResponse{} }
+func (m *MsgChangeAdminResponse) String() string { return proto.CompactTextString(m) }
+func (*MsgChangeAdminResponse) ProtoMessage() {}
+func (*MsgChangeAdminResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_345508fcea0bfc02, []int{7}
+}
+func (m *MsgChangeAdminResponse) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *MsgChangeAdminResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_MsgChangeAdminResponse.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *MsgChangeAdminResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_MsgChangeAdminResponse.Merge(m, src)
+}
+func (m *MsgChangeAdminResponse) XXX_Size() int {
+ return m.Size()
+}
+func (m *MsgChangeAdminResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_MsgChangeAdminResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_MsgChangeAdminResponse proto.InternalMessageInfo
+
+// MsgSetDenomMetadata is the sdk.Msg type for allowing an admin account to set
+// the denom's bank metadata
+type MsgSetDenomMetadata struct {
+ Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"`
+ Metadata types1.Metadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata" yaml:"metadata"`
+}
+
+func (m *MsgSetDenomMetadata) Reset() { *m = MsgSetDenomMetadata{} }
+func (m *MsgSetDenomMetadata) String() string { return proto.CompactTextString(m) }
+func (*MsgSetDenomMetadata) ProtoMessage() {}
+func (*MsgSetDenomMetadata) Descriptor() ([]byte, []int) {
+ return fileDescriptor_345508fcea0bfc02, []int{8}
+}
+func (m *MsgSetDenomMetadata) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *MsgSetDenomMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_MsgSetDenomMetadata.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *MsgSetDenomMetadata) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_MsgSetDenomMetadata.Merge(m, src)
+}
+func (m *MsgSetDenomMetadata) XXX_Size() int {
+ return m.Size()
+}
+func (m *MsgSetDenomMetadata) XXX_DiscardUnknown() {
+ xxx_messageInfo_MsgSetDenomMetadata.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_MsgSetDenomMetadata proto.InternalMessageInfo
+
+func (m *MsgSetDenomMetadata) GetSender() string {
+ if m != nil {
+ return m.Sender
+ }
+ return ""
+}
+
+func (m *MsgSetDenomMetadata) GetMetadata() types1.Metadata {
+ if m != nil {
+ return m.Metadata
+ }
+ return types1.Metadata{}
+}
+
+// MsgSetDenomMetadataResponse defines the response structure for an executed
+// MsgSetDenomMetadata message.
+type MsgSetDenomMetadataResponse struct {
+}
+
+func (m *MsgSetDenomMetadataResponse) Reset() { *m = MsgSetDenomMetadataResponse{} }
+func (m *MsgSetDenomMetadataResponse) String() string { return proto.CompactTextString(m) }
+func (*MsgSetDenomMetadataResponse) ProtoMessage() {}
+func (*MsgSetDenomMetadataResponse) Descriptor() ([]byte, []int) {
+ return fileDescriptor_345508fcea0bfc02, []int{9}
+}
+func (m *MsgSetDenomMetadataResponse) XXX_Unmarshal(b []byte) error {
+ return m.Unmarshal(b)
+}
+func (m *MsgSetDenomMetadataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+ if deterministic {
+ return xxx_messageInfo_MsgSetDenomMetadataResponse.Marshal(b, m, deterministic)
+ } else {
+ b = b[:cap(b)]
+ n, err := m.MarshalToSizedBuffer(b)
+ if err != nil {
+ return nil, err
+ }
+ return b[:n], nil
+ }
+}
+func (m *MsgSetDenomMetadataResponse) XXX_Merge(src proto.Message) {
+ xxx_messageInfo_MsgSetDenomMetadataResponse.Merge(m, src)
+}
+func (m *MsgSetDenomMetadataResponse) XXX_Size() int {
+ return m.Size()
+}
+func (m *MsgSetDenomMetadataResponse) XXX_DiscardUnknown() {
+ xxx_messageInfo_MsgSetDenomMetadataResponse.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_MsgSetDenomMetadataResponse proto.InternalMessageInfo
+
+func init() {
+ proto.RegisterType((*MsgCreateDenom)(nil), "cosmwasm.tokenfactory.v1beta1.MsgCreateDenom")
+ proto.RegisterType((*MsgCreateDenomResponse)(nil), "cosmwasm.tokenfactory.v1beta1.MsgCreateDenomResponse")
+ proto.RegisterType((*MsgMint)(nil), "cosmwasm.tokenfactory.v1beta1.MsgMint")
+ proto.RegisterType((*MsgMintResponse)(nil), "cosmwasm.tokenfactory.v1beta1.MsgMintResponse")
+ proto.RegisterType((*MsgBurn)(nil), "cosmwasm.tokenfactory.v1beta1.MsgBurn")
+ proto.RegisterType((*MsgBurnResponse)(nil), "cosmwasm.tokenfactory.v1beta1.MsgBurnResponse")
+ proto.RegisterType((*MsgChangeAdmin)(nil), "cosmwasm.tokenfactory.v1beta1.MsgChangeAdmin")
+ proto.RegisterType((*MsgChangeAdminResponse)(nil), "cosmwasm.tokenfactory.v1beta1.MsgChangeAdminResponse")
+ proto.RegisterType((*MsgSetDenomMetadata)(nil), "cosmwasm.tokenfactory.v1beta1.MsgSetDenomMetadata")
+ proto.RegisterType((*MsgSetDenomMetadataResponse)(nil), "cosmwasm.tokenfactory.v1beta1.MsgSetDenomMetadataResponse")
+}
+
+func init() {
+ proto.RegisterFile("cosmwasm/tokenfactory/v1beta1/tx.proto", fileDescriptor_345508fcea0bfc02)
+}
+
+var fileDescriptor_345508fcea0bfc02 = []byte{
+ // 592 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0xbf, 0x6e, 0xd3, 0x40,
+ 0x1c, 0x8e, 0x69, 0x09, 0xe9, 0x95, 0x92, 0xd4, 0x2d, 0x25, 0x18, 0xc5, 0x46, 0x37, 0x44, 0x30,
+ 0x60, 0x2b, 0x41, 0x2c, 0xdd, 0x70, 0x18, 0xba, 0x78, 0x31, 0x48, 0x48, 0x08, 0x51, 0x5d, 0x92,
+ 0xc3, 0x8d, 0x52, 0xdf, 0x45, 0xb9, 0x0b, 0x69, 0x16, 0x06, 0x9e, 0x80, 0x01, 0xf1, 0x24, 0x3c,
+ 0x44, 0xc7, 0x8e, 0x4c, 0x16, 0x4a, 0xde, 0x20, 0x4f, 0x80, 0xee, 0x8f, 0x1d, 0xa7, 0x41, 0x34,
+ 0x99, 0xba, 0x25, 0xfe, 0x7d, 0xdf, 0x77, 0xdf, 0x7d, 0xbf, 0xdf, 0xcf, 0x06, 0xf5, 0x0e, 0x65,
+ 0xf1, 0x18, 0xb1, 0xd8, 0xe3, 0xb4, 0x8f, 0xc9, 0x67, 0xd4, 0xe1, 0x74, 0x38, 0xf1, 0xbe, 0x34,
+ 0xda, 0x98, 0xa3, 0x86, 0xc7, 0x2f, 0xdc, 0xc1, 0x90, 0x72, 0x6a, 0xd6, 0x52, 0x9c, 0x9b, 0xc7,
+ 0xb9, 0x1a, 0x67, 0x1d, 0x46, 0x34, 0xa2, 0x12, 0xe9, 0x89, 0x5f, 0x8a, 0x64, 0xd9, 0x82, 0x44,
+ 0x99, 0xd7, 0x46, 0x0c, 0x67, 0x92, 0x1d, 0xda, 0x23, 0x2b, 0x75, 0xd2, 0xcf, 0xea, 0xe2, 0x8f,
+ 0xaa, 0xc3, 0x73, 0xf0, 0x20, 0x60, 0x51, 0x6b, 0x88, 0x11, 0xc7, 0x6f, 0x30, 0xa1, 0xb1, 0xf9,
+ 0x1c, 0x14, 0x19, 0x26, 0x5d, 0x3c, 0xac, 0x1a, 0x4f, 0x8d, 0x67, 0x3b, 0xfe, 0xfe, 0x3c, 0x71,
+ 0xf6, 0x26, 0x28, 0x3e, 0x3f, 0x86, 0xea, 0x39, 0x0c, 0x35, 0xc0, 0xf4, 0x40, 0x89, 0x8d, 0xda,
+ 0x5d, 0x41, 0xab, 0xde, 0x91, 0xe0, 0x83, 0x79, 0xe2, 0x94, 0x35, 0x58, 0x57, 0x60, 0x98, 0x81,
+ 0xe0, 0x47, 0x70, 0xb4, 0x7c, 0x5a, 0x88, 0xd9, 0x80, 0x12, 0x86, 0x4d, 0x1f, 0x94, 0x09, 0x1e,
+ 0x9f, 0xca, 0x9b, 0x9f, 0x2a, 0x45, 0x75, 0xbc, 0x35, 0x4f, 0x9c, 0x23, 0xa5, 0x78, 0x0d, 0x00,
+ 0xc3, 0x3d, 0x82, 0xc7, 0xef, 0xc4, 0x03, 0xa9, 0x05, 0xbf, 0x82, 0x7b, 0x01, 0x8b, 0x82, 0x1e,
+ 0xe1, 0x9b, 0x5c, 0xe2, 0x04, 0x14, 0x51, 0x4c, 0x47, 0x84, 0xcb, 0x2b, 0xec, 0x36, 0x1f, 0xbb,
+ 0x2a, 0x32, 0x57, 0x44, 0x9a, 0xa6, 0xef, 0xb6, 0x68, 0x8f, 0xf8, 0x0f, 0x2f, 0x13, 0xa7, 0xb0,
+ 0x50, 0x52, 0x34, 0x18, 0x6a, 0x3e, 0xdc, 0x07, 0x65, 0x7d, 0x7e, 0x7a, 0x2d, 0x6d, 0xc9, 0x1f,
+ 0x0d, 0xc9, 0x6d, 0x5a, 0x12, 0xe7, 0x67, 0x96, 0x7e, 0x1a, 0xaa, 0xe5, 0x67, 0x88, 0x44, 0xf8,
+ 0x75, 0x37, 0xee, 0x6d, 0x64, 0xad, 0x0e, 0xee, 0xe6, 0xfb, 0x5d, 0x99, 0x27, 0xce, 0x7d, 0x85,
+ 0xd4, 0x3d, 0x51, 0x65, 0xb3, 0x01, 0x76, 0x44, 0xbb, 0x90, 0xd0, 0xaf, 0x6e, 0x49, 0xec, 0xe1,
+ 0x3c, 0x71, 0x2a, 0x8b, 0x4e, 0xca, 0x12, 0x0c, 0x4b, 0x04, 0x8f, 0xa5, 0x0b, 0x58, 0x55, 0xc3,
+ 0xb1, 0xf0, 0x95, 0x59, 0xfe, 0x61, 0x80, 0x83, 0x80, 0x45, 0x6f, 0x31, 0x97, 0x8d, 0x0e, 0x30,
+ 0x47, 0x5d, 0xc4, 0xd1, 0x26, 0xbe, 0x43, 0x50, 0x8a, 0x35, 0x4d, 0x87, 0x5a, 0x5b, 0x84, 0x4a,
+ 0xfa, 0x59, 0xa8, 0xa9, 0xb6, 0xff, 0x48, 0x07, 0xab, 0xa7, 0x39, 0x25, 0xc3, 0x30, 0xd3, 0x81,
+ 0x35, 0xf0, 0xe4, 0x1f, 0xae, 0x52, 0xd7, 0xcd, 0x5f, 0xdb, 0x60, 0x2b, 0x60, 0x91, 0xc9, 0xc0,
+ 0x6e, 0x7e, 0xbf, 0x5e, 0xb8, 0xff, 0xdd, 0x73, 0x77, 0x79, 0x41, 0xac, 0x57, 0x1b, 0xc1, 0xb3,
+ 0x7d, 0xfa, 0x04, 0xb6, 0xe5, 0x22, 0xd4, 0x6f, 0xa6, 0x0b, 0x9c, 0xe5, 0xae, 0x87, 0xcb, 0xeb,
+ 0xcb, 0xa9, 0x5e, 0x43, 0x5f, 0xe0, 0xd6, 0xd1, 0xcf, 0x4f, 0xa9, 0x0c, 0x2d, 0x37, 0xa1, 0xeb,
+ 0x84, 0xb6, 0x80, 0xaf, 0x15, 0xda, 0xea, 0x9c, 0x99, 0xdf, 0x0c, 0x50, 0x59, 0x19, 0xb2, 0xe6,
+ 0xcd, 0x5a, 0xd7, 0x39, 0xd6, 0xf1, 0xe6, 0x9c, 0xd4, 0x84, 0x7f, 0x72, 0x39, 0xb5, 0x8d, 0xab,
+ 0xa9, 0x6d, 0xfc, 0x99, 0xda, 0xc6, 0xf7, 0x99, 0x5d, 0xb8, 0x9a, 0xd9, 0x85, 0xdf, 0x33, 0xbb,
+ 0xf0, 0xc1, 0x8d, 0x7a, 0xfc, 0x6c, 0xd4, 0x76, 0x3b, 0x34, 0xf6, 0x5a, 0x94, 0xc5, 0xef, 0xc5,
+ 0x37, 0x45, 0x1c, 0xd2, 0xf5, 0x2e, 0x96, 0xbf, 0x2d, 0x7c, 0x32, 0xc0, 0xac, 0x5d, 0x94, 0xaf,
+ 0xf8, 0x97, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xf8, 0x7f, 0x91, 0x62, 0x81, 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 {
+ CreateDenom(ctx context.Context, in *MsgCreateDenom, opts ...grpc.CallOption) (*MsgCreateDenomResponse, error)
+ Mint(ctx context.Context, in *MsgMint, opts ...grpc.CallOption) (*MsgMintResponse, error)
+ Burn(ctx context.Context, in *MsgBurn, opts ...grpc.CallOption) (*MsgBurnResponse, error)
+ ChangeAdmin(ctx context.Context, in *MsgChangeAdmin, opts ...grpc.CallOption) (*MsgChangeAdminResponse, error)
+ SetDenomMetadata(ctx context.Context, in *MsgSetDenomMetadata, opts ...grpc.CallOption) (*MsgSetDenomMetadataResponse, error)
+}
+
+type msgClient struct {
+ cc grpc1.ClientConn
+}
+
+func NewMsgClient(cc grpc1.ClientConn) MsgClient {
+ return &msgClient{cc}
+}
+
+func (c *msgClient) CreateDenom(ctx context.Context, in *MsgCreateDenom, opts ...grpc.CallOption) (*MsgCreateDenomResponse, error) {
+ out := new(MsgCreateDenomResponse)
+ err := c.cc.Invoke(ctx, "/cosmwasm.tokenfactory.v1beta1.Msg/CreateDenom", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *msgClient) Mint(ctx context.Context, in *MsgMint, opts ...grpc.CallOption) (*MsgMintResponse, error) {
+ out := new(MsgMintResponse)
+ err := c.cc.Invoke(ctx, "/cosmwasm.tokenfactory.v1beta1.Msg/Mint", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *msgClient) Burn(ctx context.Context, in *MsgBurn, opts ...grpc.CallOption) (*MsgBurnResponse, error) {
+ out := new(MsgBurnResponse)
+ err := c.cc.Invoke(ctx, "/cosmwasm.tokenfactory.v1beta1.Msg/Burn", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *msgClient) ChangeAdmin(ctx context.Context, in *MsgChangeAdmin, opts ...grpc.CallOption) (*MsgChangeAdminResponse, error) {
+ out := new(MsgChangeAdminResponse)
+ err := c.cc.Invoke(ctx, "/cosmwasm.tokenfactory.v1beta1.Msg/ChangeAdmin", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *msgClient) SetDenomMetadata(ctx context.Context, in *MsgSetDenomMetadata, opts ...grpc.CallOption) (*MsgSetDenomMetadataResponse, error) {
+ out := new(MsgSetDenomMetadataResponse)
+ err := c.cc.Invoke(ctx, "/cosmwasm.tokenfactory.v1beta1.Msg/SetDenomMetadata", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+// MsgServer is the server API for Msg service.
+type MsgServer interface {
+ CreateDenom(context.Context, *MsgCreateDenom) (*MsgCreateDenomResponse, error)
+ Mint(context.Context, *MsgMint) (*MsgMintResponse, error)
+ Burn(context.Context, *MsgBurn) (*MsgBurnResponse, error)
+ ChangeAdmin(context.Context, *MsgChangeAdmin) (*MsgChangeAdminResponse, error)
+ SetDenomMetadata(context.Context, *MsgSetDenomMetadata) (*MsgSetDenomMetadataResponse, error)
+}
+
+// UnimplementedMsgServer can be embedded to have forward compatible implementations.
+type UnimplementedMsgServer struct {
+}
+
+func (*UnimplementedMsgServer) CreateDenom(ctx context.Context, req *MsgCreateDenom) (*MsgCreateDenomResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method CreateDenom not implemented")
+}
+func (*UnimplementedMsgServer) Mint(ctx context.Context, req *MsgMint) (*MsgMintResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method Mint not implemented")
+}
+func (*UnimplementedMsgServer) Burn(ctx context.Context, req *MsgBurn) (*MsgBurnResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method Burn not implemented")
+}
+func (*UnimplementedMsgServer) ChangeAdmin(ctx context.Context, req *MsgChangeAdmin) (*MsgChangeAdminResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method ChangeAdmin not implemented")
+}
+func (*UnimplementedMsgServer) SetDenomMetadata(ctx context.Context, req *MsgSetDenomMetadata) (*MsgSetDenomMetadataResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method SetDenomMetadata not implemented")
+}
+
+func RegisterMsgServer(s grpc1.Server, srv MsgServer) {
+ s.RegisterService(&_Msg_serviceDesc, srv)
+}
+
+func _Msg_CreateDenom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(MsgCreateDenom)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(MsgServer).CreateDenom(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/cosmwasm.tokenfactory.v1beta1.Msg/CreateDenom",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(MsgServer).CreateDenom(ctx, req.(*MsgCreateDenom))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _Msg_Mint_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(MsgMint)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(MsgServer).Mint(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/cosmwasm.tokenfactory.v1beta1.Msg/Mint",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(MsgServer).Mint(ctx, req.(*MsgMint))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _Msg_Burn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(MsgBurn)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(MsgServer).Burn(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/cosmwasm.tokenfactory.v1beta1.Msg/Burn",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(MsgServer).Burn(ctx, req.(*MsgBurn))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _Msg_ChangeAdmin_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(MsgChangeAdmin)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(MsgServer).ChangeAdmin(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/cosmwasm.tokenfactory.v1beta1.Msg/ChangeAdmin",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(MsgServer).ChangeAdmin(ctx, req.(*MsgChangeAdmin))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _Msg_SetDenomMetadata_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(MsgSetDenomMetadata)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(MsgServer).SetDenomMetadata(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/cosmwasm.tokenfactory.v1beta1.Msg/SetDenomMetadata",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(MsgServer).SetDenomMetadata(ctx, req.(*MsgSetDenomMetadata))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+var _Msg_serviceDesc = grpc.ServiceDesc{
+ ServiceName: "cosmwasm.tokenfactory.v1beta1.Msg",
+ HandlerType: (*MsgServer)(nil),
+ Methods: []grpc.MethodDesc{
+ {
+ MethodName: "CreateDenom",
+ Handler: _Msg_CreateDenom_Handler,
+ },
+ {
+ MethodName: "Mint",
+ Handler: _Msg_Mint_Handler,
+ },
+ {
+ MethodName: "Burn",
+ Handler: _Msg_Burn_Handler,
+ },
+ {
+ MethodName: "ChangeAdmin",
+ Handler: _Msg_ChangeAdmin_Handler,
+ },
+ {
+ MethodName: "SetDenomMetadata",
+ Handler: _Msg_SetDenomMetadata_Handler,
+ },
+ },
+ Streams: []grpc.StreamDesc{},
+ Metadata: "cosmwasm/tokenfactory/v1beta1/tx.proto",
+}
+
+func (m *MsgCreateDenom) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MsgCreateDenom) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *MsgCreateDenom) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.Subdenom) > 0 {
+ i -= len(m.Subdenom)
+ copy(dAtA[i:], m.Subdenom)
+ i = encodeVarintTx(dAtA, i, uint64(len(m.Subdenom)))
+ 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 *MsgCreateDenomResponse) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MsgCreateDenomResponse) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *MsgCreateDenomResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.NewTokenDenom) > 0 {
+ i -= len(m.NewTokenDenom)
+ copy(dAtA[i:], m.NewTokenDenom)
+ i = encodeVarintTx(dAtA, i, uint64(len(m.NewTokenDenom)))
+ i--
+ dAtA[i] = 0xa
+ }
+ return len(dAtA) - i, nil
+}
+
+func (m *MsgMint) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MsgMint) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *MsgMint) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ {
+ size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = 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 *MsgMintResponse) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MsgMintResponse) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *MsgMintResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ return len(dAtA) - i, nil
+}
+
+func (m *MsgBurn) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MsgBurn) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *MsgBurn) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ {
+ size, err := m.Amount.MarshalToSizedBuffer(dAtA[:i])
+ if err != nil {
+ return 0, err
+ }
+ i -= size
+ i = 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 *MsgBurnResponse) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MsgBurnResponse) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *MsgBurnResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ return len(dAtA) - i, nil
+}
+
+func (m *MsgChangeAdmin) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MsgChangeAdmin) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *MsgChangeAdmin) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ if len(m.NewAdmin) > 0 {
+ i -= len(m.NewAdmin)
+ copy(dAtA[i:], m.NewAdmin)
+ i = encodeVarintTx(dAtA, i, uint64(len(m.NewAdmin)))
+ i--
+ dAtA[i] = 0x1a
+ }
+ if len(m.Denom) > 0 {
+ i -= len(m.Denom)
+ copy(dAtA[i:], m.Denom)
+ i = encodeVarintTx(dAtA, i, uint64(len(m.Denom)))
+ i--
+ dAtA[i] = 0x12
+ }
+ if len(m.Sender) > 0 {
+ i -= len(m.Sender)
+ copy(dAtA[i:], m.Sender)
+ i = encodeVarintTx(dAtA, i, uint64(len(m.Sender)))
+ i--
+ dAtA[i] = 0xa
+ }
+ return len(dAtA) - i, nil
+}
+
+func (m *MsgChangeAdminResponse) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MsgChangeAdminResponse) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *MsgChangeAdminResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ return len(dAtA) - i, nil
+}
+
+func (m *MsgSetDenomMetadata) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MsgSetDenomMetadata) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *MsgSetDenomMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ {
+ size, err := m.Metadata.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 *MsgSetDenomMetadataResponse) Marshal() (dAtA []byte, err error) {
+ size := m.Size()
+ dAtA = make([]byte, size)
+ n, err := m.MarshalToSizedBuffer(dAtA[:size])
+ if err != nil {
+ return nil, err
+ }
+ return dAtA[:n], nil
+}
+
+func (m *MsgSetDenomMetadataResponse) MarshalTo(dAtA []byte) (int, error) {
+ size := m.Size()
+ return m.MarshalToSizedBuffer(dAtA[:size])
+}
+
+func (m *MsgSetDenomMetadataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
+ i := len(dAtA)
+ _ = i
+ var l int
+ _ = l
+ return len(dAtA) - i, nil
+}
+
+func encodeVarintTx(dAtA []byte, offset int, v uint64) int {
+ offset -= sovTx(v)
+ base := offset
+ for v >= 1<<7 {
+ dAtA[offset] = uint8(v&0x7f | 0x80)
+ v >>= 7
+ offset++
+ }
+ dAtA[offset] = uint8(v)
+ return base
+}
+func (m *MsgCreateDenom) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Sender)
+ if l > 0 {
+ n += 1 + l + sovTx(uint64(l))
+ }
+ l = len(m.Subdenom)
+ if l > 0 {
+ n += 1 + l + sovTx(uint64(l))
+ }
+ return n
+}
+
+func (m *MsgCreateDenomResponse) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.NewTokenDenom)
+ if l > 0 {
+ n += 1 + l + sovTx(uint64(l))
+ }
+ return n
+}
+
+func (m *MsgMint) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Sender)
+ if l > 0 {
+ n += 1 + l + sovTx(uint64(l))
+ }
+ l = m.Amount.Size()
+ n += 1 + l + sovTx(uint64(l))
+ return n
+}
+
+func (m *MsgMintResponse) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ return n
+}
+
+func (m *MsgBurn) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Sender)
+ if l > 0 {
+ n += 1 + l + sovTx(uint64(l))
+ }
+ l = m.Amount.Size()
+ n += 1 + l + sovTx(uint64(l))
+ return n
+}
+
+func (m *MsgBurnResponse) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ return n
+}
+
+func (m *MsgChangeAdmin) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Sender)
+ if l > 0 {
+ n += 1 + l + sovTx(uint64(l))
+ }
+ l = len(m.Denom)
+ if l > 0 {
+ n += 1 + l + sovTx(uint64(l))
+ }
+ l = len(m.NewAdmin)
+ if l > 0 {
+ n += 1 + l + sovTx(uint64(l))
+ }
+ return n
+}
+
+func (m *MsgChangeAdminResponse) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ return n
+}
+
+func (m *MsgSetDenomMetadata) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ l = len(m.Sender)
+ if l > 0 {
+ n += 1 + l + sovTx(uint64(l))
+ }
+ l = m.Metadata.Size()
+ n += 1 + l + sovTx(uint64(l))
+ return n
+}
+
+func (m *MsgSetDenomMetadataResponse) Size() (n int) {
+ if m == nil {
+ return 0
+ }
+ var l int
+ _ = l
+ return n
+}
+
+func sovTx(x uint64) (n int) {
+ return (math_bits.Len64(x|1) + 6) / 7
+}
+func sozTx(x uint64) (n int) {
+ return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63))))
+}
+func (m *MsgCreateDenom) Unmarshal(dAtA []byte) 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: MsgCreateDenom: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MsgCreateDenom: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthTx
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthTx
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Sender = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Subdenom", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthTx
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthTx
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Subdenom = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipTx(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthTx
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *MsgCreateDenomResponse) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: MsgCreateDenomResponse: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MsgCreateDenomResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field NewTokenDenom", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthTx
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthTx
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.NewTokenDenom = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipTx(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthTx
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *MsgMint) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: MsgMint: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MsgMint: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthTx
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthTx
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Sender = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthTx
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthTx
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ default:
+ iNdEx = preIndex
+ skippy, err := skipTx(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthTx
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *MsgMintResponse) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: MsgMintResponse: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MsgMintResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ default:
+ iNdEx = preIndex
+ skippy, err := skipTx(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthTx
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *MsgBurn) Unmarshal(dAtA []byte) error {
+ l := len(dAtA)
+ iNdEx := 0
+ for iNdEx < l {
+ preIndex := iNdEx
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ fieldNum := int32(wire >> 3)
+ wireType := int(wire & 0x7)
+ if wireType == 4 {
+ return fmt.Errorf("proto: MsgBurn: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MsgBurn: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ case 1:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthTx
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthTx
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.Sender = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 2:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType)
+ }
+ var msglen int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ msglen |= int(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if msglen < 0 {
+ return ErrInvalidLengthTx
+ }
+ postIndex := iNdEx + msglen
+ if postIndex < 0 {
+ return ErrInvalidLengthTx
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ if err := m.Amount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+ return err
+ }
+ iNdEx = postIndex
+ 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 *MsgBurnResponse) Unmarshal(dAtA []byte) 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: MsgBurnResponse: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MsgBurnResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ default:
+ iNdEx = preIndex
+ skippy, err := skipTx(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthTx
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *MsgChangeAdmin) Unmarshal(dAtA []byte) 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: MsgChangeAdmin: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MsgChangeAdmin: 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 Denom", 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.Denom = string(dAtA[iNdEx:postIndex])
+ iNdEx = postIndex
+ case 3:
+ if wireType != 2 {
+ return fmt.Errorf("proto: wrong wireType = %d for field NewAdmin", wireType)
+ }
+ var stringLen uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ stringLen |= uint64(b&0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ intStringLen := int(stringLen)
+ if intStringLen < 0 {
+ return ErrInvalidLengthTx
+ }
+ postIndex := iNdEx + intStringLen
+ if postIndex < 0 {
+ return ErrInvalidLengthTx
+ }
+ if postIndex > l {
+ return io.ErrUnexpectedEOF
+ }
+ m.NewAdmin = 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 *MsgChangeAdminResponse) Unmarshal(dAtA []byte) 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: MsgChangeAdminResponse: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MsgChangeAdminResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ default:
+ iNdEx = preIndex
+ skippy, err := skipTx(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthTx
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func (m *MsgSetDenomMetadata) Unmarshal(dAtA []byte) 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: MsgSetDenomMetadata: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MsgSetDenomMetadata: 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 Metadata", 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.Metadata.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 *MsgSetDenomMetadataResponse) Unmarshal(dAtA []byte) 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: MsgSetDenomMetadataResponse: wiretype end group for non-group")
+ }
+ if fieldNum <= 0 {
+ return fmt.Errorf("proto: MsgSetDenomMetadataResponse: illegal tag %d (wire type %d)", fieldNum, wire)
+ }
+ switch fieldNum {
+ default:
+ iNdEx = preIndex
+ skippy, err := skipTx(dAtA[iNdEx:])
+ if err != nil {
+ return err
+ }
+ if (skippy < 0) || (iNdEx+skippy) < 0 {
+ return ErrInvalidLengthTx
+ }
+ if (iNdEx + skippy) > l {
+ return io.ErrUnexpectedEOF
+ }
+ iNdEx += skippy
+ }
+ }
+
+ if iNdEx > l {
+ return io.ErrUnexpectedEOF
+ }
+ return nil
+}
+func skipTx(dAtA []byte) (n int, err error) {
+ l := len(dAtA)
+ iNdEx := 0
+ depth := 0
+ for iNdEx < l {
+ var wire uint64
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ wire |= (uint64(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ wireType := int(wire & 0x7)
+ switch wireType {
+ case 0:
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ iNdEx++
+ if dAtA[iNdEx-1] < 0x80 {
+ break
+ }
+ }
+ case 1:
+ iNdEx += 8
+ case 2:
+ var length int
+ for shift := uint(0); ; shift += 7 {
+ if shift >= 64 {
+ return 0, ErrIntOverflowTx
+ }
+ if iNdEx >= l {
+ return 0, io.ErrUnexpectedEOF
+ }
+ b := dAtA[iNdEx]
+ iNdEx++
+ length |= (int(b) & 0x7F) << shift
+ if b < 0x80 {
+ break
+ }
+ }
+ if length < 0 {
+ return 0, ErrInvalidLengthTx
+ }
+ iNdEx += length
+ case 3:
+ depth++
+ case 4:
+ if depth == 0 {
+ return 0, ErrUnexpectedEndOfGroupTx
+ }
+ depth--
+ case 5:
+ iNdEx += 4
+ default:
+ return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
+ }
+ if iNdEx < 0 {
+ return 0, ErrInvalidLengthTx
+ }
+ if depth == 0 {
+ return iNdEx, nil
+ }
+ }
+ return 0, io.ErrUnexpectedEOF
+}
+
+var (
+ ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling")
+ ErrIntOverflowTx = fmt.Errorf("proto: integer overflow")
+ ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
+)
diff --git a/x/wasm/alias.go b/x/wasm/alias.go
index e47a657c97..762e021a4f 100644
--- a/x/wasm/alias.go
+++ b/x/wasm/alias.go
@@ -1,4 +1,4 @@
-// nolint
+//nolint
// autogenerated code using github.com/rigelrozanski/multitool
// aliases generated for the following subdirectories:
// ALIASGEN: github.com/Cosmwasm/wasmd/x/wasm/types
@@ -24,14 +24,6 @@ const (
ProposalTypeMigrateContract = types.ProposalTypeMigrateContract
ProposalTypeUpdateAdmin = types.ProposalTypeUpdateAdmin
ProposalTypeClearAdmin = types.ProposalTypeClearAdmin
- QueryListContractByCode = keeper.QueryListContractByCode
- QueryGetContract = keeper.QueryGetContract
- QueryGetContractState = keeper.QueryGetContractState
- QueryGetCode = keeper.QueryGetCode
- QueryListCode = keeper.QueryListCode
- QueryMethodContractStateSmart = keeper.QueryMethodContractStateSmart
- QueryMethodContractStateAll = keeper.QueryMethodContractStateAll
- QueryMethodContractStateRaw = keeper.QueryMethodContractStateRaw
)
var (
diff --git a/x/wasm/client/cli/gov_tx.go b/x/wasm/client/cli/gov_tx.go
index 36ba6c334f..59d333c1ae 100644
--- a/x/wasm/client/cli/gov_tx.go
+++ b/x/wasm/client/cli/gov_tx.go
@@ -9,14 +9,13 @@ import (
"strconv"
"strings"
- "github.com/docker/distribution/reference"
-
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/tx"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/version"
"github.com/cosmos/cosmos-sdk/x/gov/client/cli"
- govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
+ "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
+ "github.com/docker/distribution/reference"
"github.com/pkg/errors"
"github.com/spf13/cobra"
flag "github.com/spf13/pflag"
@@ -68,7 +67,7 @@ func ProposalStoreCodeCmd() *cobra.Command {
CodeHash: codeHash,
}
- msg, err := govtypes.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress())
+ msg, err := v1beta1.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress())
if err != nil {
return err
}
@@ -89,9 +88,7 @@ func ProposalStoreCodeCmd() *cobra.Command {
addInstantiatePermissionFlags(cmd)
// proposal flags
- cmd.Flags().String(cli.FlagTitle, "", "Title of proposal")
- cmd.Flags().String(cli.FlagDescription, "", "Description of proposal")
- cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal")
+ addCommonProposalFlags(cmd)
return cmd
}
@@ -172,7 +169,7 @@ func ProposalInstantiateContractCmd() *cobra.Command {
Funds: src.Funds,
}
- msg, err := govtypes.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress())
+ msg, err := v1beta1.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress())
if err != nil {
return err
}
@@ -191,9 +188,7 @@ func ProposalInstantiateContractCmd() *cobra.Command {
cmd.Flags().Bool(flagNoAdmin, false, "You must set this explicitly if you don't want an admin")
// proposal flags
- cmd.Flags().String(cli.FlagTitle, "", "Title of proposal")
- cmd.Flags().String(cli.FlagDescription, "", "Description of proposal")
- cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal")
+ addCommonProposalFlags(cmd)
return cmd
}
@@ -234,7 +229,7 @@ func ProposalInstantiateContract2Cmd() *cobra.Command {
content := types.NewInstantiateContract2Proposal(proposalTitle, proposalDescr, runAs, src.Admin, src.CodeID, src.Label, src.Msg, src.Funds, salt, fixMsg)
- msg, err := govtypes.NewMsgSubmitProposal(content, deposit, clientCtx.GetFromAddress())
+ msg, err := v1beta1.NewMsgSubmitProposal(content, deposit, clientCtx.GetFromAddress())
if err != nil {
return err
}
@@ -256,9 +251,7 @@ func ProposalInstantiateContract2Cmd() *cobra.Command {
decoder.RegisterFlags(cmd.PersistentFlags(), "salt")
// proposal flags
- cmd.Flags().String(cli.FlagTitle, "", "Title of proposal")
- cmd.Flags().String(cli.FlagDescription, "", "Description of proposal")
- cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal")
+ addCommonProposalFlags(cmd)
return cmd
}
@@ -335,7 +328,11 @@ func ProposalStoreAndInstantiateContractCmd() *cobra.Command {
if err != nil {
return fmt.Errorf("admin %s", err)
}
- adminStr = info.GetAddress().String()
+ admin, err := info.GetAddress()
+ if err != nil {
+ return err
+ }
+ adminStr = admin.String()
} else {
adminStr = addr.String()
}
@@ -357,7 +354,7 @@ func ProposalStoreAndInstantiateContractCmd() *cobra.Command {
Funds: amount,
}
- msg, err := govtypes.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress())
+ msg, err := v1beta1.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress())
if err != nil {
return err
}
@@ -381,9 +378,7 @@ func ProposalStoreAndInstantiateContractCmd() *cobra.Command {
cmd.Flags().Bool(flagNoAdmin, false, "You must set this explicitly if you don't want an admin")
addInstantiatePermissionFlags(cmd)
// proposal flags
- cmd.Flags().String(cli.FlagTitle, "", "Title of proposal")
- cmd.Flags().String(cli.FlagDescription, "", "Description of proposal")
- cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal")
+ addCommonProposalFlags(cmd)
return cmd
}
@@ -411,7 +406,7 @@ func ProposalMigrateContractCmd() *cobra.Command {
Msg: src.Msg,
}
- msg, err := govtypes.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress())
+ msg, err := v1beta1.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress())
if err != nil {
return err
}
@@ -425,9 +420,7 @@ func ProposalMigrateContractCmd() *cobra.Command {
}
// proposal flags
- cmd.Flags().String(cli.FlagTitle, "", "Title of proposal")
- cmd.Flags().String(cli.FlagDescription, "", "Description of proposal")
- cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal")
+ addCommonProposalFlags(cmd)
return cmd
}
@@ -470,7 +463,7 @@ func ProposalExecuteContractCmd() *cobra.Command {
Funds: funds,
}
- msg, err := govtypes.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress())
+ msg, err := v1beta1.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress())
if err != nil {
return err
}
@@ -486,9 +479,7 @@ func ProposalExecuteContractCmd() *cobra.Command {
cmd.Flags().String(flagAmount, "", "Coins to send to the contract during instantiation")
// proposal flags
- cmd.Flags().String(cli.FlagTitle, "", "Title of proposal")
- cmd.Flags().String(cli.FlagDescription, "", "Description of proposal")
- cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal")
+ addCommonProposalFlags(cmd)
return cmd
}
@@ -513,7 +504,7 @@ func ProposalSudoContractCmd() *cobra.Command {
Msg: sudoMsg,
}
- msg, err := govtypes.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress())
+ msg, err := v1beta1.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress())
if err != nil {
return err
}
@@ -527,9 +518,7 @@ func ProposalSudoContractCmd() *cobra.Command {
}
// proposal flagsExecute
- cmd.Flags().String(cli.FlagTitle, "", "Title of proposal")
- cmd.Flags().String(cli.FlagDescription, "", "Description of proposal")
- cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal")
+ addCommonProposalFlags(cmd)
return cmd
}
@@ -556,7 +545,7 @@ func ProposalUpdateContractAdminCmd() *cobra.Command {
NewAdmin: src.NewAdmin,
}
- msg, err := govtypes.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress())
+ msg, err := v1beta1.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress())
if err != nil {
return err
}
@@ -569,9 +558,7 @@ func ProposalUpdateContractAdminCmd() *cobra.Command {
SilenceUsage: true,
}
// proposal flags
- cmd.Flags().String(cli.FlagTitle, "", "Title of proposal")
- cmd.Flags().String(cli.FlagDescription, "", "Description of proposal")
- cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal")
+ addCommonProposalFlags(cmd)
return cmd
}
@@ -592,7 +579,7 @@ func ProposalClearContractAdminCmd() *cobra.Command {
Contract: args[0],
}
- msg, err := govtypes.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress())
+ msg, err := v1beta1.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress())
if err != nil {
return err
}
@@ -605,9 +592,7 @@ func ProposalClearContractAdminCmd() *cobra.Command {
SilenceUsage: true,
}
// proposal flags
- cmd.Flags().String(cli.FlagTitle, "", "Title of proposal")
- cmd.Flags().String(cli.FlagDescription, "", "Description of proposal")
- cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal")
+ addCommonProposalFlags(cmd)
return cmd
}
@@ -633,7 +618,7 @@ func ProposalPinCodesCmd() *cobra.Command {
CodeIDs: codeIds,
}
- msg, err := govtypes.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress())
+ msg, err := v1beta1.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress())
if err != nil {
return err
}
@@ -646,9 +631,7 @@ func ProposalPinCodesCmd() *cobra.Command {
SilenceUsage: true,
}
// proposal flags
- cmd.Flags().String(cli.FlagTitle, "", "Title of proposal")
- cmd.Flags().String(cli.FlagDescription, "", "Description of proposal")
- cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal")
+ addCommonProposalFlags(cmd)
return cmd
}
@@ -686,7 +669,7 @@ func ProposalUnpinCodesCmd() *cobra.Command {
CodeIDs: codeIds,
}
- msg, err := govtypes.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress())
+ msg, err := v1beta1.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress())
if err != nil {
return err
}
@@ -699,9 +682,7 @@ func ProposalUnpinCodesCmd() *cobra.Command {
SilenceUsage: true,
}
// proposal flags
- cmd.Flags().String(cli.FlagTitle, "", "Title of proposal")
- cmd.Flags().String(cli.FlagDescription, "", "Description of proposal")
- cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal")
+ addCommonProposalFlags(cmd)
return cmd
}
@@ -785,7 +766,7 @@ $ %s tx gov submit-proposal update-instantiate-config 1:nobody 2:everybody 3:%s1
Description: proposalDescr,
AccessConfigUpdates: updates,
}
- msg, err := govtypes.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress())
+ msg, err := v1beta1.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress())
if err != nil {
return err
}
@@ -798,24 +779,28 @@ $ %s tx gov submit-proposal update-instantiate-config 1:nobody 2:everybody 3:%s1
SilenceUsage: true,
}
// proposal flags
- cmd.Flags().String(cli.FlagTitle, "", "Title of proposal")
- cmd.Flags().String(cli.FlagDescription, "", "Description of proposal")
- cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal")
+ addCommonProposalFlags(cmd)
return cmd
}
+func addCommonProposalFlags(cmd *cobra.Command) {
+ cmd.Flags().String(cli.FlagTitle, "", "Title of proposal") //nolint:staticcheck
+ cmd.Flags().String(cli.FlagDescription, "", "Description of proposal") //nolint:staticcheck
+ cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal")
+}
+
func getProposalInfo(cmd *cobra.Command) (client.Context, string, string, sdk.Coins, error) {
clientCtx, err := client.GetClientTxContext(cmd)
if err != nil {
return client.Context{}, "", "", nil, err
}
- proposalTitle, err := cmd.Flags().GetString(cli.FlagTitle)
+ proposalTitle, err := cmd.Flags().GetString(cli.FlagTitle) //nolint:staticcheck
if err != nil {
return clientCtx, proposalTitle, "", nil, err
}
- proposalDescr, err := cmd.Flags().GetString(cli.FlagDescription)
+ proposalDescr, err := cmd.Flags().GetString(cli.FlagDescription) //nolint:staticcheck
if err != nil {
return client.Context{}, proposalTitle, proposalDescr, nil, err
}
diff --git a/x/wasm/client/cli/new_tx.go b/x/wasm/client/cli/new_tx.go
index d7e477a9fe..caf182d9fb 100644
--- a/x/wasm/client/cli/new_tx.go
+++ b/x/wasm/client/cli/new_tx.go
@@ -86,7 +86,7 @@ func UpdateContractAdminCmd() *cobra.Command {
return cmd
}
-func parseUpdateContractAdminArgs(args []string, cliCtx client.Context) (types.MsgUpdateAdmin, error) {
+func parseUpdateContractAdminArgs(args []string, cliCtx client.Context) (types.MsgUpdateAdmin, error) { //nolint:unparam
msg := types.MsgUpdateAdmin{
Sender: cliCtx.GetFromAddress().String(),
Contract: args[0],
diff --git a/x/wasm/client/cli/query.go b/x/wasm/client/cli/query.go
index ab346bcfe1..3053737274 100644
--- a/x/wasm/client/cli/query.go
+++ b/x/wasm/client/cli/query.go
@@ -580,6 +580,7 @@ func GetCmdListContractsByCreator() *cobra.Command {
SilenceUsage: true,
}
flags.AddQueryFlagsToCmd(cmd)
+ flags.AddPaginationFlagsToCmd(cmd, "list contracts by creator")
return cmd
}
diff --git a/x/wasm/client/cli/tx.go b/x/wasm/client/cli/tx.go
index 479081bcf3..b488545382 100644
--- a/x/wasm/client/cli/tx.go
+++ b/x/wasm/client/cli/tx.go
@@ -338,7 +338,11 @@ func parseInstantiateArgs(rawCodeID, initMsg string, kr keyring.Keyring, sender
if err != nil {
return nil, fmt.Errorf("admin %s", err)
}
- adminStr = info.GetAddress().String()
+ admin, err := info.GetAddress()
+ if err != nil {
+ return nil, err
+ }
+ adminStr = admin.String()
} else {
adminStr = addr.String()
}
@@ -525,7 +529,12 @@ $ %s tx grant execution --allow-all-messages --ma
return fmt.Errorf("%s authorization type not supported", args[1])
}
- grantMsg, err := authz.NewMsgGrant(clientCtx.GetFromAddress(), grantee, authorization, time.Unix(0, exp))
+ expire, err := getExpireTime(cmd)
+ if err != nil {
+ return err
+ }
+
+ grantMsg, err := authz.NewMsgGrant(clientCtx.GetFromAddress(), grantee, authorization, expire)
if err != nil {
return err
}
@@ -542,3 +551,15 @@ $ %s tx grant execution --allow-all-messages --ma
cmd.Flags().Bool(flagNoTokenTransfer, false, "Don't allow token transfer")
return cmd
}
+
+func getExpireTime(cmd *cobra.Command) (*time.Time, error) {
+ exp, err := cmd.Flags().GetInt64(flagExpiration)
+ if err != nil {
+ return nil, err
+ }
+ if exp == 0 {
+ return nil, nil
+ }
+ e := time.Unix(exp, 0)
+ return &e, nil
+}
diff --git a/x/wasm/client/proposal_handler.go b/x/wasm/client/proposal_handler.go
index 286d37d197..deba8070ca 100644
--- a/x/wasm/client/proposal_handler.go
+++ b/x/wasm/client/proposal_handler.go
@@ -4,22 +4,20 @@ import (
govclient "github.com/cosmos/cosmos-sdk/x/gov/client"
"github.com/CosmWasm/wasmd/x/wasm/client/cli"
- "github.com/CosmWasm/wasmd/x/wasm/client/rest" //nolint:staticcheck
)
// ProposalHandlers define the wasm cli proposal types and rest handler.
-// Deprecated: the rest package will be removed. You can use the GRPC gateway instead
var ProposalHandlers = []govclient.ProposalHandler{
- govclient.NewProposalHandler(cli.ProposalStoreCodeCmd, rest.StoreCodeProposalHandler),
- govclient.NewProposalHandler(cli.ProposalInstantiateContractCmd, rest.InstantiateProposalHandler),
- govclient.NewProposalHandler(cli.ProposalMigrateContractCmd, rest.MigrateProposalHandler),
- govclient.NewProposalHandler(cli.ProposalExecuteContractCmd, rest.ExecuteProposalHandler),
- govclient.NewProposalHandler(cli.ProposalSudoContractCmd, rest.SudoProposalHandler),
- govclient.NewProposalHandler(cli.ProposalUpdateContractAdminCmd, rest.UpdateContractAdminProposalHandler),
- govclient.NewProposalHandler(cli.ProposalClearContractAdminCmd, rest.ClearContractAdminProposalHandler),
- govclient.NewProposalHandler(cli.ProposalPinCodesCmd, rest.PinCodeProposalHandler),
- govclient.NewProposalHandler(cli.ProposalUnpinCodesCmd, rest.UnpinCodeProposalHandler),
- govclient.NewProposalHandler(cli.ProposalUpdateInstantiateConfigCmd, rest.UpdateInstantiateConfigProposalHandler),
- govclient.NewProposalHandler(cli.ProposalStoreAndInstantiateContractCmd, rest.EmptyRestHandler),
- govclient.NewProposalHandler(cli.ProposalInstantiateContract2Cmd, rest.EmptyRestHandler),
+ govclient.NewProposalHandler(cli.ProposalStoreCodeCmd),
+ govclient.NewProposalHandler(cli.ProposalInstantiateContractCmd),
+ govclient.NewProposalHandler(cli.ProposalMigrateContractCmd),
+ govclient.NewProposalHandler(cli.ProposalExecuteContractCmd),
+ govclient.NewProposalHandler(cli.ProposalSudoContractCmd),
+ govclient.NewProposalHandler(cli.ProposalUpdateContractAdminCmd),
+ govclient.NewProposalHandler(cli.ProposalClearContractAdminCmd),
+ govclient.NewProposalHandler(cli.ProposalPinCodesCmd),
+ govclient.NewProposalHandler(cli.ProposalUnpinCodesCmd),
+ govclient.NewProposalHandler(cli.ProposalUpdateInstantiateConfigCmd),
+ govclient.NewProposalHandler(cli.ProposalStoreAndInstantiateContractCmd),
+ govclient.NewProposalHandler(cli.ProposalInstantiateContract2Cmd),
}
diff --git a/x/wasm/client/proposal_handler_test.go b/x/wasm/client/proposal_handler_test.go
deleted file mode 100644
index 086e3cb3ae..0000000000
--- a/x/wasm/client/proposal_handler_test.go
+++ /dev/null
@@ -1,381 +0,0 @@
-package client
-
-import (
- "bytes"
- "encoding/json"
- "fmt"
- "net/http"
- "net/http/httptest"
- "os"
- "testing"
-
- "github.com/cosmos/cosmos-sdk/client"
- "github.com/cosmos/cosmos-sdk/client/flags"
- authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
- "github.com/gorilla/mux"
- "github.com/stretchr/testify/require"
-
- "github.com/CosmWasm/wasmd/x/wasm/keeper"
-)
-
-func TestGovRestHandlers(t *testing.T) {
- type dict map[string]interface{}
- var (
- anyAddress = "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz"
- aBaseReq = dict{
- "from": anyAddress,
- "memo": "rest test",
- "chain_id": "testing",
- "account_number": "1",
- "sequence": "1",
- "fees": []dict{{"denom": "ustake", "amount": "1000000"}},
- }
- )
- encodingConfig := keeper.MakeEncodingConfig(t)
- clientCtx := client.Context{}.
- WithCodec(encodingConfig.Marshaler).
- WithTxConfig(encodingConfig.TxConfig).
- WithLegacyAmino(encodingConfig.Amino).
- WithInput(os.Stdin).
- WithAccountRetriever(authtypes.AccountRetriever{}).
- WithBroadcastMode(flags.BroadcastBlock).
- WithChainID("testing")
-
- // router setup as in gov/client/rest/tx.go
- propSubRtr := mux.NewRouter().PathPrefix("/gov/proposals").Subrouter()
- for _, ph := range ProposalHandlers {
- r := ph.RESTHandler(clientCtx)
- propSubRtr.HandleFunc(fmt.Sprintf("/%s", r.SubRoute), r.Handler).Methods("POST")
- }
-
- specs := map[string]struct {
- srcBody dict
- srcPath string
- expCode int
- }{
- "store-code": {
- srcPath: "/gov/proposals/wasm_store_code",
- srcBody: dict{
- "title": "Test Proposal",
- "description": "My proposal",
- "type": "store-code",
- "run_as": "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz",
- "wasm_byte_code": []byte("valid wasm byte code"),
- "source": "https://example.com/",
- "builder": "cosmwasm/workspace-optimizer:v0.12.9",
- "code_hash": "79F174F09BFE3F83398BF7C147929D5F735161BD46D645E85216BB13BF91D42D",
- "instantiate_permission": dict{
- "permission": "OnlyAddress",
- "address": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- },
- "deposit": []dict{{"denom": "ustake", "amount": "10"}},
- "proposer": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- "base_req": aBaseReq,
- },
- expCode: http.StatusOK,
- },
- "store-code without verification info": {
- srcPath: "/gov/proposals/wasm_store_code",
- srcBody: dict{
- "title": "Test Proposal",
- "description": "My proposal",
- "type": "store-code",
- "run_as": "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz",
- "wasm_byte_code": []byte("valid wasm byte code"),
- "instantiate_permission": dict{
- "permission": "OnlyAddress",
- "address": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- },
- "deposit": []dict{{"denom": "ustake", "amount": "10"}},
- "proposer": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- "base_req": aBaseReq,
- },
- expCode: http.StatusOK,
- },
- "store-code without permission": {
- srcPath: "/gov/proposals/wasm_store_code",
- srcBody: dict{
- "title": "Test Proposal",
- "description": "My proposal",
- "type": "store-code",
- "run_as": "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz",
- "wasm_byte_code": []byte("valid wasm byte code"),
- "source": "https://example.com/",
- "builder": "cosmwasm/workspace-optimizer:v0.12.9",
- "code_hash": "79F174F09BFE3F83398BF7C147929D5F735161BD46D645E85216BB13BF91D42D",
- "deposit": []dict{{"denom": "ustake", "amount": "10"}},
- "proposer": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- "base_req": aBaseReq,
- },
- expCode: http.StatusOK,
- },
- "store-code invalid permission": {
- srcPath: "/gov/proposals/wasm_store_code",
- srcBody: dict{
- "title": "Test Proposal",
- "description": "My proposal",
- "type": "store-code",
- "run_as": "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz",
- "wasm_byte_code": []byte("valid wasm byte code"),
- "source": "https://example.com/",
- "builder": "cosmwasm/workspace-optimizer:v0.12.9",
- "code_hash": "79F174F09BFE3F83398BF7C147929D5F735161BD46D645E85216BB13BF91D42D",
- "instantiate_permission": dict{
- "permission": "Nobody",
- "address": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- },
- "deposit": []dict{{"denom": "ustake", "amount": "10"}},
- "proposer": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- "base_req": aBaseReq,
- },
- expCode: http.StatusBadRequest,
- },
- "store-code with incomplete proposal data: blank title": {
- srcPath: "/gov/proposals/wasm_store_code",
- srcBody: dict{
- "title": "",
- "description": "My proposal",
- "type": "store-code",
- "run_as": "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz",
- "wasm_byte_code": []byte("valid wasm byte code"),
- "source": "https://example.com/",
- "code_hash": "79F174F09BFE3F83398BF7C147929D5F735161BD46D645E85216BB13BF91D42D",
- "builder": "cosmwasm/workspace-optimizer:v0.12.9",
- "instantiate_permission": dict{
- "permission": "OnlyAddress",
- "address": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- },
- "deposit": []dict{{"denom": "ustake", "amount": "10"}},
- "proposer": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- "base_req": aBaseReq,
- },
- expCode: http.StatusBadRequest,
- },
- "store-code with incomplete content data: no wasm_byte_code": {
- srcPath: "/gov/proposals/wasm_store_code",
- srcBody: dict{
- "title": "Test Proposal",
- "description": "My proposal",
- "type": "store-code",
- "run_as": "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz",
- "wasm_byte_code": "",
- "builder": "cosmwasm/workspace-optimizer:v0.12.9",
- "source": "https://example.com/",
- "code_hash": "79F174F09BFE3F83398BF7C147929D5F735161BD46D645E85216BB13BF91D42D",
- "instantiate_permission": dict{
- "permission": "OnlyAddress",
- "address": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- },
- "deposit": []dict{{"denom": "ustake", "amount": "10"}},
- "proposer": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- "base_req": aBaseReq,
- },
- expCode: http.StatusBadRequest,
- },
- "store-code with incomplete content data: no builder": {
- srcPath: "/gov/proposals/wasm_store_code",
- srcBody: dict{
- "title": "Test Proposal",
- "description": "My proposal",
- "type": "store-code",
- "run_as": "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz",
- "wasm_byte_code": "",
- "source": "https://example.com/",
- "code_hash": "79F174F09BFE3F83398BF7C147929D5F735161BD46D645E85216BB13BF91D42D",
- "instantiate_permission": dict{
- "permission": "OnlyAddress",
- "address": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- },
- "deposit": []dict{{"denom": "ustake", "amount": "10"}},
- "proposer": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- "base_req": aBaseReq,
- },
- expCode: http.StatusBadRequest,
- },
- "store-code with incomplete content data: no code hash": {
- srcPath: "/gov/proposals/wasm_store_code",
- srcBody: dict{
- "title": "Test Proposal",
- "description": "My proposal",
- "type": "store-code",
- "run_as": "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz",
- "wasm_byte_code": "",
- "builder": "cosmwasm/workspace-optimizer:v0.12.9",
- "source": "https://example.com/",
- "instantiate_permission": dict{
- "permission": "OnlyAddress",
- "address": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- },
- "deposit": []dict{{"denom": "ustake", "amount": "10"}},
- "proposer": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- "base_req": aBaseReq,
- },
- expCode: http.StatusBadRequest,
- },
- "store-code with incomplete content data: no source": {
- srcPath: "/gov/proposals/wasm_store_code",
- srcBody: dict{
- "title": "Test Proposal",
- "description": "My proposal",
- "type": "store-code",
- "run_as": "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz",
- "wasm_byte_code": "",
- "builder": "cosmwasm/workspace-optimizer:v0.12.9",
- "code_hash": "79F174F09BFE3F83398BF7C147929D5F735161BD46D645E85216BB13BF91D42D",
- "instantiate_permission": dict{
- "permission": "OnlyAddress",
- "address": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- },
- "deposit": []dict{{"denom": "ustake", "amount": "10"}},
- "proposer": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- "base_req": aBaseReq,
- },
- expCode: http.StatusBadRequest,
- },
- "instantiate contract": {
- srcPath: "/gov/proposals/wasm_instantiate",
- srcBody: dict{
- "title": "Test Proposal",
- "description": "My proposal",
- "type": "instantiate",
- "run_as": "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz",
- "admin": "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz",
- "code_id": "1",
- "label": "https://example.com/",
- "msg": dict{"recipient": "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz"},
- "funds": []dict{{"denom": "ustake", "amount": "100"}},
- "deposit": []dict{{"denom": "ustake", "amount": "10"}},
- "proposer": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- "base_req": aBaseReq,
- },
- expCode: http.StatusOK,
- },
- "migrate contract": {
- srcPath: "/gov/proposals/wasm_migrate",
- srcBody: dict{
- "title": "Test Proposal",
- "description": "My proposal",
- "type": "migrate",
- "contract": "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr",
- "code_id": "1",
- "msg": dict{"foo": "bar"},
- "run_as": "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz",
- "deposit": []dict{{"denom": "ustake", "amount": "10"}},
- "proposer": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- "base_req": aBaseReq,
- },
- expCode: http.StatusOK,
- },
- "execute contract": {
- srcPath: "/gov/proposals/wasm_execute",
- srcBody: dict{
- "title": "Test Proposal",
- "description": "My proposal",
- "type": "migrate",
- "contract": "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr",
- "msg": dict{"foo": "bar"},
- "run_as": "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz",
- "deposit": []dict{{"denom": "ustake", "amount": "10"}},
- "proposer": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- "base_req": aBaseReq,
- },
- expCode: http.StatusOK,
- },
- "execute contract fails with no run_as": {
- srcPath: "/gov/proposals/wasm_execute",
- srcBody: dict{
- "title": "Test Proposal",
- "description": "My proposal",
- "type": "migrate",
- "contract": "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr",
- "msg": dict{"foo": "bar"},
- "deposit": []dict{{"denom": "ustake", "amount": "10"}},
- "proposer": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- "base_req": aBaseReq,
- },
- expCode: http.StatusBadRequest,
- },
- "execute contract fails with no message": {
- srcPath: "/gov/proposals/wasm_execute",
- srcBody: dict{
- "title": "Test Proposal",
- "description": "My proposal",
- "type": "migrate",
- "contract": "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr",
- "run_as": "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz",
- "deposit": []dict{{"denom": "ustake", "amount": "10"}},
- "proposer": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- "base_req": aBaseReq,
- },
- expCode: http.StatusBadRequest,
- },
- "sudo contract": {
- srcPath: "/gov/proposals/wasm_sudo",
- srcBody: dict{
- "title": "Test Proposal",
- "description": "My proposal",
- "type": "migrate",
- "contract": "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr",
- "msg": dict{"foo": "bar"},
- "deposit": []dict{{"denom": "ustake", "amount": "10"}},
- "proposer": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- "base_req": aBaseReq,
- },
- expCode: http.StatusOK,
- },
- "sudo contract fails with no message": {
- srcPath: "/gov/proposals/wasm_sudo",
- srcBody: dict{
- "title": "Test Proposal",
- "description": "My proposal",
- "type": "migrate",
- "contract": "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr",
- "deposit": []dict{{"denom": "ustake", "amount": "10"}},
- "proposer": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- "base_req": aBaseReq,
- },
- expCode: http.StatusBadRequest,
- },
- "update contract admin": {
- srcPath: "/gov/proposals/wasm_update_admin",
- srcBody: dict{
- "title": "Test Proposal",
- "description": "My proposal",
- "type": "migrate",
- "contract": "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr",
- "new_admin": "cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz",
- "deposit": []dict{{"denom": "ustake", "amount": "10"}},
- "proposer": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- "base_req": aBaseReq,
- },
- expCode: http.StatusOK,
- },
- "clear contract admin": {
- srcPath: "/gov/proposals/wasm_clear_admin",
- srcBody: dict{
- "title": "Test Proposal",
- "description": "My proposal",
- "type": "migrate",
- "contract": "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr",
- "deposit": []dict{{"denom": "ustake", "amount": "10"}},
- "proposer": "cosmos1ve557a5g9yw2g2z57js3pdmcvd5my6g8ze20np",
- "base_req": aBaseReq,
- },
- expCode: http.StatusOK,
- },
- }
- for msg, spec := range specs {
- t.Run(msg, func(t *testing.T) {
- src, err := json.Marshal(spec.srcBody)
- require.NoError(t, err)
-
- // when
- r := httptest.NewRequest("POST", spec.srcPath, bytes.NewReader(src))
- w := httptest.NewRecorder()
- propSubRtr.ServeHTTP(w, r)
-
- // then
- require.Equal(t, spec.expCode, w.Code, w.Body.String())
- })
- }
-}
diff --git a/x/wasm/client/rest/gov.go b/x/wasm/client/rest/gov.go
deleted file mode 100644
index c57e3a9ac5..0000000000
--- a/x/wasm/client/rest/gov.go
+++ /dev/null
@@ -1,547 +0,0 @@
-package rest
-
-import (
- "encoding/json"
- "net/http"
-
- "github.com/cosmos/cosmos-sdk/client"
- "github.com/cosmos/cosmos-sdk/client/tx"
- sdk "github.com/cosmos/cosmos-sdk/types"
- "github.com/cosmos/cosmos-sdk/types/rest"
- govrest "github.com/cosmos/cosmos-sdk/x/gov/client/rest"
- govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
-
- "github.com/CosmWasm/wasmd/x/wasm/types"
-)
-
-type StoreCodeProposalJSONReq struct {
- BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`
-
- Title string `json:"title" yaml:"title"`
- Description string `json:"description" yaml:"description"`
- Proposer string `json:"proposer" yaml:"proposer"`
- Deposit sdk.Coins `json:"deposit" yaml:"deposit"`
-
- RunAs string `json:"run_as" yaml:"run_as"`
- // WASMByteCode can be raw or gzip compressed
- WASMByteCode []byte `json:"wasm_byte_code" yaml:"wasm_byte_code"`
- // InstantiatePermission to apply on contract creation, optional
- InstantiatePermission *types.AccessConfig `json:"instantiate_permission" yaml:"instantiate_permission"`
-
- // UnpinCode indicates if the code should not be pinned as part of the proposal.
- UnpinCode bool `json:"unpin_code" yaml:"unpin_code"`
-
- // Source is the URL where the code is hosted
- Source string `json:"source" yaml:"source"`
- // Builder is the docker image used to build the code deterministically, used for smart
- // contract verification
- Builder string `json:"builder" yaml:"builder"`
- // CodeHash is the SHA256 sum of the code outputted by optimizer, used for smart contract verification
- CodeHash []byte `json:"code_hash" yaml:"code_hash"`
-}
-
-func (s StoreCodeProposalJSONReq) Content() govtypes.Content {
- return &types.StoreCodeProposal{
- Title: s.Title,
- Description: s.Description,
- RunAs: s.RunAs,
- WASMByteCode: s.WASMByteCode,
- InstantiatePermission: s.InstantiatePermission,
- UnpinCode: s.UnpinCode,
- Source: s.Source,
- Builder: s.Builder,
- CodeHash: s.CodeHash,
- }
-}
-
-func (s StoreCodeProposalJSONReq) GetProposer() string {
- return s.Proposer
-}
-
-func (s StoreCodeProposalJSONReq) GetDeposit() sdk.Coins {
- return s.Deposit
-}
-
-func (s StoreCodeProposalJSONReq) GetBaseReq() rest.BaseReq {
- return s.BaseReq
-}
-
-func StoreCodeProposalHandler(cliCtx client.Context) govrest.ProposalRESTHandler {
- return govrest.ProposalRESTHandler{
- SubRoute: "wasm_store_code",
- Handler: func(w http.ResponseWriter, r *http.Request) {
- var req StoreCodeProposalJSONReq
- if !rest.ReadRESTReq(w, r, cliCtx.LegacyAmino, &req) {
- return
- }
- toStdTxResponse(cliCtx, w, req)
- },
- }
-}
-
-type InstantiateProposalJSONReq struct {
- BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`
-
- Title string `json:"title" yaml:"title"`
- Description string `json:"description" yaml:"description"`
-
- Proposer string `json:"proposer" yaml:"proposer"`
- Deposit sdk.Coins `json:"deposit" yaml:"deposit"`
-
- RunAs string `json:"run_as" yaml:"run_as"`
- // Admin is an optional address that can execute migrations
- Admin string `json:"admin,omitempty" yaml:"admin"`
- Code uint64 `json:"code_id" yaml:"code_id"`
- Label string `json:"label" yaml:"label"`
- Msg json.RawMessage `json:"msg" yaml:"msg"`
- Funds sdk.Coins `json:"funds" yaml:"funds"`
-}
-
-func (s InstantiateProposalJSONReq) Content() govtypes.Content {
- return &types.InstantiateContractProposal{
- Title: s.Title,
- Description: s.Description,
- RunAs: s.RunAs,
- Admin: s.Admin,
- CodeID: s.Code,
- Label: s.Label,
- Msg: types.RawContractMessage(s.Msg),
- Funds: s.Funds,
- }
-}
-
-func (s InstantiateProposalJSONReq) GetProposer() string {
- return s.Proposer
-}
-
-func (s InstantiateProposalJSONReq) GetDeposit() sdk.Coins {
- return s.Deposit
-}
-
-func (s InstantiateProposalJSONReq) GetBaseReq() rest.BaseReq {
- return s.BaseReq
-}
-
-func InstantiateProposalHandler(cliCtx client.Context) govrest.ProposalRESTHandler {
- return govrest.ProposalRESTHandler{
- SubRoute: "wasm_instantiate",
- Handler: func(w http.ResponseWriter, r *http.Request) {
- var req InstantiateProposalJSONReq
- if !rest.ReadRESTReq(w, r, cliCtx.LegacyAmino, &req) {
- return
- }
- toStdTxResponse(cliCtx, w, req)
- },
- }
-}
-
-type MigrateProposalJSONReq struct {
- BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`
-
- Title string `json:"title" yaml:"title"`
- Description string `json:"description" yaml:"description"`
-
- Proposer string `json:"proposer" yaml:"proposer"`
- Deposit sdk.Coins `json:"deposit" yaml:"deposit"`
-
- Contract string `json:"contract" yaml:"contract"`
- Code uint64 `json:"code_id" yaml:"code_id"`
- Msg json.RawMessage `json:"msg" yaml:"msg"`
-}
-
-func (s MigrateProposalJSONReq) Content() govtypes.Content {
- return &types.MigrateContractProposal{
- Title: s.Title,
- Description: s.Description,
- Contract: s.Contract,
- CodeID: s.Code,
- Msg: types.RawContractMessage(s.Msg),
- }
-}
-
-func (s MigrateProposalJSONReq) GetProposer() string {
- return s.Proposer
-}
-
-func (s MigrateProposalJSONReq) GetDeposit() sdk.Coins {
- return s.Deposit
-}
-
-func (s MigrateProposalJSONReq) GetBaseReq() rest.BaseReq {
- return s.BaseReq
-}
-
-func MigrateProposalHandler(cliCtx client.Context) govrest.ProposalRESTHandler {
- return govrest.ProposalRESTHandler{
- SubRoute: "wasm_migrate",
- Handler: func(w http.ResponseWriter, r *http.Request) {
- var req MigrateProposalJSONReq
- if !rest.ReadRESTReq(w, r, cliCtx.LegacyAmino, &req) {
- return
- }
- toStdTxResponse(cliCtx, w, req)
- },
- }
-}
-
-type ExecuteProposalJSONReq struct {
- BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`
-
- Title string `json:"title" yaml:"title"`
- Description string `json:"description" yaml:"description"`
-
- Proposer string `json:"proposer" yaml:"proposer"`
- Deposit sdk.Coins `json:"deposit" yaml:"deposit"`
-
- Contract string `json:"contract" yaml:"contract"`
- Msg json.RawMessage `json:"msg" yaml:"msg"`
- // RunAs is the role that is passed to the contract's environment
- RunAs string `json:"run_as" yaml:"run_as"`
- Funds sdk.Coins `json:"funds" yaml:"funds"`
-}
-
-func (s ExecuteProposalJSONReq) Content() govtypes.Content {
- return &types.ExecuteContractProposal{
- Title: s.Title,
- Description: s.Description,
- Contract: s.Contract,
- Msg: types.RawContractMessage(s.Msg),
- RunAs: s.RunAs,
- Funds: s.Funds,
- }
-}
-
-func (s ExecuteProposalJSONReq) GetProposer() string {
- return s.Proposer
-}
-
-func (s ExecuteProposalJSONReq) GetDeposit() sdk.Coins {
- return s.Deposit
-}
-
-func (s ExecuteProposalJSONReq) GetBaseReq() rest.BaseReq {
- return s.BaseReq
-}
-
-func ExecuteProposalHandler(cliCtx client.Context) govrest.ProposalRESTHandler {
- return govrest.ProposalRESTHandler{
- SubRoute: "wasm_execute",
- Handler: func(w http.ResponseWriter, r *http.Request) {
- var req ExecuteProposalJSONReq
- if !rest.ReadRESTReq(w, r, cliCtx.LegacyAmino, &req) {
- return
- }
- toStdTxResponse(cliCtx, w, req)
- },
- }
-}
-
-type SudoProposalJSONReq struct {
- BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`
-
- Title string `json:"title" yaml:"title"`
- Description string `json:"description" yaml:"description"`
-
- Proposer string `json:"proposer" yaml:"proposer"`
- Deposit sdk.Coins `json:"deposit" yaml:"deposit"`
-
- Contract string `json:"contract" yaml:"contract"`
- Msg json.RawMessage `json:"msg" yaml:"msg"`
-}
-
-func (s SudoProposalJSONReq) Content() govtypes.Content {
- return &types.SudoContractProposal{
- Title: s.Title,
- Description: s.Description,
- Contract: s.Contract,
- Msg: types.RawContractMessage(s.Msg),
- }
-}
-
-func (s SudoProposalJSONReq) GetProposer() string {
- return s.Proposer
-}
-
-func (s SudoProposalJSONReq) GetDeposit() sdk.Coins {
- return s.Deposit
-}
-
-func (s SudoProposalJSONReq) GetBaseReq() rest.BaseReq {
- return s.BaseReq
-}
-
-func SudoProposalHandler(cliCtx client.Context) govrest.ProposalRESTHandler {
- return govrest.ProposalRESTHandler{
- SubRoute: "wasm_sudo",
- Handler: func(w http.ResponseWriter, r *http.Request) {
- var req SudoProposalJSONReq
- if !rest.ReadRESTReq(w, r, cliCtx.LegacyAmino, &req) {
- return
- }
- toStdTxResponse(cliCtx, w, req)
- },
- }
-}
-
-type UpdateAdminJSONReq struct {
- BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`
-
- Title string `json:"title" yaml:"title"`
- Description string `json:"description" yaml:"description"`
-
- Proposer string `json:"proposer" yaml:"proposer"`
- Deposit sdk.Coins `json:"deposit" yaml:"deposit"`
-
- NewAdmin string `json:"new_admin" yaml:"new_admin"`
- Contract string `json:"contract" yaml:"contract"`
-}
-
-func (s UpdateAdminJSONReq) Content() govtypes.Content {
- return &types.UpdateAdminProposal{
- Title: s.Title,
- Description: s.Description,
- Contract: s.Contract,
- NewAdmin: s.NewAdmin,
- }
-}
-
-func (s UpdateAdminJSONReq) GetProposer() string {
- return s.Proposer
-}
-
-func (s UpdateAdminJSONReq) GetDeposit() sdk.Coins {
- return s.Deposit
-}
-
-func (s UpdateAdminJSONReq) GetBaseReq() rest.BaseReq {
- return s.BaseReq
-}
-
-func UpdateContractAdminProposalHandler(cliCtx client.Context) govrest.ProposalRESTHandler {
- return govrest.ProposalRESTHandler{
- SubRoute: "wasm_update_admin",
- Handler: func(w http.ResponseWriter, r *http.Request) {
- var req UpdateAdminJSONReq
- if !rest.ReadRESTReq(w, r, cliCtx.LegacyAmino, &req) {
- return
- }
- toStdTxResponse(cliCtx, w, req)
- },
- }
-}
-
-type ClearAdminJSONReq struct {
- BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`
-
- Title string `json:"title" yaml:"title"`
- Description string `json:"description" yaml:"description"`
-
- Proposer string `json:"proposer" yaml:"proposer"`
- Deposit sdk.Coins `json:"deposit" yaml:"deposit"`
-
- Contract string `json:"contract" yaml:"contract"`
-}
-
-func (s ClearAdminJSONReq) Content() govtypes.Content {
- return &types.ClearAdminProposal{
- Title: s.Title,
- Description: s.Description,
- Contract: s.Contract,
- }
-}
-
-func (s ClearAdminJSONReq) GetProposer() string {
- return s.Proposer
-}
-
-func (s ClearAdminJSONReq) GetDeposit() sdk.Coins {
- return s.Deposit
-}
-
-func (s ClearAdminJSONReq) GetBaseReq() rest.BaseReq {
- return s.BaseReq
-}
-
-func ClearContractAdminProposalHandler(cliCtx client.Context) govrest.ProposalRESTHandler {
- return govrest.ProposalRESTHandler{
- SubRoute: "wasm_clear_admin",
- Handler: func(w http.ResponseWriter, r *http.Request) {
- var req ClearAdminJSONReq
- if !rest.ReadRESTReq(w, r, cliCtx.LegacyAmino, &req) {
- return
- }
- toStdTxResponse(cliCtx, w, req)
- },
- }
-}
-
-type PinCodeJSONReq struct {
- BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`
-
- Title string `json:"title" yaml:"title"`
- Description string `json:"description" yaml:"description"`
-
- Proposer string `json:"proposer" yaml:"proposer"`
- Deposit sdk.Coins `json:"deposit" yaml:"deposit"`
-
- CodeIDs []uint64 `json:"code_ids" yaml:"code_ids"`
-}
-
-func (s PinCodeJSONReq) Content() govtypes.Content {
- return &types.PinCodesProposal{
- Title: s.Title,
- Description: s.Description,
- CodeIDs: s.CodeIDs,
- }
-}
-
-func (s PinCodeJSONReq) GetProposer() string {
- return s.Proposer
-}
-
-func (s PinCodeJSONReq) GetDeposit() sdk.Coins {
- return s.Deposit
-}
-
-func (s PinCodeJSONReq) GetBaseReq() rest.BaseReq {
- return s.BaseReq
-}
-
-func PinCodeProposalHandler(cliCtx client.Context) govrest.ProposalRESTHandler {
- return govrest.ProposalRESTHandler{
- SubRoute: "pin_code",
- Handler: func(w http.ResponseWriter, r *http.Request) {
- var req PinCodeJSONReq
- if !rest.ReadRESTReq(w, r, cliCtx.LegacyAmino, &req) {
- return
- }
- toStdTxResponse(cliCtx, w, req)
- },
- }
-}
-
-type UnpinCodeJSONReq struct {
- BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`
-
- Title string `json:"title" yaml:"title"`
- Description string `json:"description" yaml:"description"`
-
- Proposer string `json:"proposer" yaml:"proposer"`
- Deposit sdk.Coins `json:"deposit" yaml:"deposit"`
-
- CodeIDs []uint64 `json:"code_ids" yaml:"code_ids"`
-}
-
-func (s UnpinCodeJSONReq) Content() govtypes.Content {
- return &types.UnpinCodesProposal{
- Title: s.Title,
- Description: s.Description,
- CodeIDs: s.CodeIDs,
- }
-}
-
-func (s UnpinCodeJSONReq) GetProposer() string {
- return s.Proposer
-}
-
-func (s UnpinCodeJSONReq) GetDeposit() sdk.Coins {
- return s.Deposit
-}
-
-func (s UnpinCodeJSONReq) GetBaseReq() rest.BaseReq {
- return s.BaseReq
-}
-
-func UnpinCodeProposalHandler(cliCtx client.Context) govrest.ProposalRESTHandler {
- return govrest.ProposalRESTHandler{
- SubRoute: "unpin_code",
- Handler: func(w http.ResponseWriter, r *http.Request) {
- var req UnpinCodeJSONReq
- if !rest.ReadRESTReq(w, r, cliCtx.LegacyAmino, &req) {
- return
- }
- toStdTxResponse(cliCtx, w, req)
- },
- }
-}
-
-type UpdateInstantiateConfigProposalJSONReq struct {
- BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`
-
- Title string `json:"title" yaml:"title"`
- Description string `json:"description" yaml:"description"`
- Proposer string `json:"proposer" yaml:"proposer"`
- Deposit sdk.Coins `json:"deposit" yaml:"deposit"`
- AccessConfigUpdates []types.AccessConfigUpdate `json:"access_config_updates" yaml:"access_config_updates"`
-}
-
-func (s UpdateInstantiateConfigProposalJSONReq) Content() govtypes.Content {
- return &types.UpdateInstantiateConfigProposal{
- Title: s.Title,
- Description: s.Description,
- AccessConfigUpdates: s.AccessConfigUpdates,
- }
-}
-
-func (s UpdateInstantiateConfigProposalJSONReq) GetProposer() string {
- return s.Proposer
-}
-
-func (s UpdateInstantiateConfigProposalJSONReq) GetDeposit() sdk.Coins {
- return s.Deposit
-}
-
-func (s UpdateInstantiateConfigProposalJSONReq) GetBaseReq() rest.BaseReq {
- return s.BaseReq
-}
-
-func UpdateInstantiateConfigProposalHandler(cliCtx client.Context) govrest.ProposalRESTHandler {
- return govrest.ProposalRESTHandler{
- SubRoute: "update_instantiate_config",
- Handler: func(w http.ResponseWriter, r *http.Request) {
- var req UpdateInstantiateConfigProposalJSONReq
- if !rest.ReadRESTReq(w, r, cliCtx.LegacyAmino, &req) {
- return
- }
- toStdTxResponse(cliCtx, w, req)
- },
- }
-}
-
-type wasmProposalData interface {
- Content() govtypes.Content
- GetProposer() string
- GetDeposit() sdk.Coins
- GetBaseReq() rest.BaseReq
-}
-
-func toStdTxResponse(cliCtx client.Context, w http.ResponseWriter, data wasmProposalData) {
- proposerAddr, err := sdk.AccAddressFromBech32(data.GetProposer())
- if err != nil {
- rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error())
- return
- }
- msg, err := govtypes.NewMsgSubmitProposal(data.Content(), data.GetDeposit(), proposerAddr)
- if err != nil {
- rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error())
- return
- }
- if err := msg.ValidateBasic(); err != nil {
- rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error())
- return
- }
- baseReq := data.GetBaseReq().Sanitize()
- if !baseReq.ValidateBasic(w) {
- return
- }
- tx.WriteGeneratedTxResponse(cliCtx, w, baseReq, msg)
-}
-
-func EmptyRestHandler(cliCtx client.Context) govrest.ProposalRESTHandler {
- return govrest.ProposalRESTHandler{
- SubRoute: "unsupported",
- Handler: func(w http.ResponseWriter, r *http.Request) {
- rest.WriteErrorResponse(w, http.StatusBadRequest, "Legacy REST Routes are not supported for gov proposals")
- },
- }
-}
diff --git a/x/wasm/client/rest/new_tx.go b/x/wasm/client/rest/new_tx.go
deleted file mode 100644
index b261fd7fb7..0000000000
--- a/x/wasm/client/rest/new_tx.go
+++ /dev/null
@@ -1,86 +0,0 @@
-package rest
-
-import (
- "net/http"
-
- "github.com/cosmos/cosmos-sdk/client"
- "github.com/cosmos/cosmos-sdk/client/tx"
- "github.com/cosmos/cosmos-sdk/types/rest"
- "github.com/gorilla/mux"
-
- "github.com/CosmWasm/wasmd/x/wasm/types"
-)
-
-func registerNewTxRoutes(cliCtx client.Context, r *mux.Router) {
- r.HandleFunc("/wasm/contract/{contractAddr}/admin", setContractAdminHandlerFn(cliCtx)).Methods("PUT")
- r.HandleFunc("/wasm/contract/{contractAddr}/code", migrateContractHandlerFn(cliCtx)).Methods("PUT")
-}
-
-type migrateContractReq struct {
- BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`
- Admin string `json:"admin,omitempty" yaml:"admin"`
- CodeID uint64 `json:"code_id" yaml:"code_id"`
- Msg []byte `json:"msg,omitempty" yaml:"msg"`
-}
-
-type updateContractAdministrateReq struct {
- BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`
- Admin string `json:"admin,omitempty" yaml:"admin"`
-}
-
-func setContractAdminHandlerFn(cliCtx client.Context) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- var req updateContractAdministrateReq
- if !rest.ReadRESTReq(w, r, cliCtx.LegacyAmino, &req) {
- return
- }
- vars := mux.Vars(r)
- contractAddr := vars["contractAddr"]
-
- req.BaseReq = req.BaseReq.Sanitize()
- if !req.BaseReq.ValidateBasic(w) {
- return
- }
-
- msg := &types.MsgUpdateAdmin{
- Sender: req.BaseReq.From,
- NewAdmin: req.Admin,
- Contract: contractAddr,
- }
- if err := msg.ValidateBasic(); err != nil {
- rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error())
- return
- }
-
- tx.WriteGeneratedTxResponse(cliCtx, w, req.BaseReq, msg)
- }
-}
-
-func migrateContractHandlerFn(cliCtx client.Context) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- var req migrateContractReq
- if !rest.ReadRESTReq(w, r, cliCtx.LegacyAmino, &req) {
- return
- }
- vars := mux.Vars(r)
- contractAddr := vars["contractAddr"]
-
- req.BaseReq = req.BaseReq.Sanitize()
- if !req.BaseReq.ValidateBasic(w) {
- return
- }
-
- msg := &types.MsgMigrateContract{
- Sender: req.BaseReq.From,
- Contract: contractAddr,
- CodeID: req.CodeID,
- Msg: req.Msg,
- }
- if err := msg.ValidateBasic(); err != nil {
- rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error())
- return
- }
-
- tx.WriteGeneratedTxResponse(cliCtx, w, req.BaseReq, msg)
- }
-}
diff --git a/x/wasm/client/rest/query.go b/x/wasm/client/rest/query.go
deleted file mode 100644
index d497d23900..0000000000
--- a/x/wasm/client/rest/query.go
+++ /dev/null
@@ -1,270 +0,0 @@
-package rest
-
-import (
- "encoding/base64"
- "encoding/hex"
- "encoding/json"
- "fmt"
- "net/http"
- "strconv"
-
- "github.com/cosmos/cosmos-sdk/client"
- sdk "github.com/cosmos/cosmos-sdk/types"
- "github.com/cosmos/cosmos-sdk/types/rest"
- "github.com/gorilla/mux"
-
- "github.com/CosmWasm/wasmd/x/wasm/keeper"
- "github.com/CosmWasm/wasmd/x/wasm/types"
-)
-
-func registerQueryRoutes(cliCtx client.Context, r *mux.Router) {
- r.HandleFunc("/wasm/code", listCodesHandlerFn(cliCtx)).Methods("GET")
- r.HandleFunc("/wasm/code/{codeID}", queryCodeHandlerFn(cliCtx)).Methods("GET")
- r.HandleFunc("/wasm/code/{codeID}/contracts", listContractsByCodeHandlerFn(cliCtx)).Methods("GET")
- r.HandleFunc("/wasm/contract/{contractAddr}", queryContractHandlerFn(cliCtx)).Methods("GET")
- r.HandleFunc("/wasm/contract/{contractAddr}/state", queryContractStateAllHandlerFn(cliCtx)).Methods("GET")
- r.HandleFunc("/wasm/contract/{contractAddr}/history", queryContractHistoryFn(cliCtx)).Methods("GET")
- r.HandleFunc("/wasm/contract/{contractAddr}/smart/{query}", queryContractStateSmartHandlerFn(cliCtx)).Queries("encoding", "{encoding}").Methods("GET")
- r.HandleFunc("/wasm/contract/{contractAddr}/raw/{key}", queryContractStateRawHandlerFn(cliCtx)).Queries("encoding", "{encoding}").Methods("GET")
-}
-
-func listCodesHandlerFn(cliCtx client.Context) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r)
- if !ok {
- return
- }
-
- route := fmt.Sprintf("custom/%s/%s", types.QuerierRoute, keeper.QueryListCode)
- res, height, err := cliCtx.Query(route)
- if err != nil {
- rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
- return
- }
- cliCtx = cliCtx.WithHeight(height)
- rest.PostProcessResponse(w, cliCtx, json.RawMessage(res))
- }
-}
-
-func queryCodeHandlerFn(cliCtx client.Context) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- codeID, err := strconv.ParseUint(mux.Vars(r)["codeID"], 10, 64)
- if err != nil {
- rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
- return
- }
-
- cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r)
- if !ok {
- return
- }
-
- route := fmt.Sprintf("custom/%s/%s/%d", types.QuerierRoute, keeper.QueryGetCode, codeID)
- res, height, err := cliCtx.Query(route)
- if err != nil {
- rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
- return
- }
- if len(res) == 0 {
- rest.WriteErrorResponse(w, http.StatusNotFound, "contract not found")
- return
- }
-
- cliCtx = cliCtx.WithHeight(height)
- rest.PostProcessResponse(w, cliCtx, json.RawMessage(res))
- }
-}
-
-func listContractsByCodeHandlerFn(cliCtx client.Context) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- codeID, err := strconv.ParseUint(mux.Vars(r)["codeID"], 10, 64)
- if err != nil {
- rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
- return
- }
- cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r)
- if !ok {
- return
- }
-
- route := fmt.Sprintf("custom/%s/%s/%d", types.QuerierRoute, keeper.QueryListContractByCode, codeID)
- res, height, err := cliCtx.Query(route)
- if err != nil {
- rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
- return
- }
-
- cliCtx = cliCtx.WithHeight(height)
- rest.PostProcessResponse(w, cliCtx, json.RawMessage(res))
- }
-}
-
-func queryContractHandlerFn(cliCtx client.Context) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- addr, err := sdk.AccAddressFromBech32(mux.Vars(r)["contractAddr"])
- if err != nil {
- rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
- return
- }
- cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r)
- if !ok {
- return
- }
-
- route := fmt.Sprintf("custom/%s/%s/%s", types.QuerierRoute, keeper.QueryGetContract, addr.String())
- res, height, err := cliCtx.Query(route)
- if err != nil {
- rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
- return
- }
-
- cliCtx = cliCtx.WithHeight(height)
- rest.PostProcessResponse(w, cliCtx, json.RawMessage(res))
- }
-}
-
-func queryContractStateAllHandlerFn(cliCtx client.Context) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- addr, err := sdk.AccAddressFromBech32(mux.Vars(r)["contractAddr"])
- if err != nil {
- rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
- return
- }
- cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r)
- if !ok {
- return
- }
-
- route := fmt.Sprintf("custom/%s/%s/%s/%s", types.QuerierRoute, keeper.QueryGetContractState, addr.String(), keeper.QueryMethodContractStateAll)
- res, height, err := cliCtx.Query(route)
- if err != nil {
- rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
- return
- }
-
- // parse res
- var resultData []types.Model
- err = json.Unmarshal(res, &resultData)
- if err != nil {
- rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
- return
- }
-
- cliCtx = cliCtx.WithHeight(height)
- rest.PostProcessResponse(w, cliCtx, resultData)
- }
-}
-
-func queryContractStateRawHandlerFn(cliCtx client.Context) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- decoder := newArgDecoder(hex.DecodeString)
- addr, err := sdk.AccAddressFromBech32(mux.Vars(r)["contractAddr"])
- if err != nil {
- rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
- return
- }
- decoder.encoding = mux.Vars(r)["encoding"]
- queryData, err := decoder.DecodeString(mux.Vars(r)["key"])
- if err != nil {
- rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
- return
- }
- cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r)
- if !ok {
- return
- }
-
- route := fmt.Sprintf("custom/%s/%s/%s/%s", types.QuerierRoute, keeper.QueryGetContractState, addr.String(), keeper.QueryMethodContractStateRaw)
- res, height, err := cliCtx.QueryWithData(route, queryData)
- if err != nil {
- rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
- return
- }
- cliCtx = cliCtx.WithHeight(height)
- // ensure this is base64 encoded
- encoded := base64.StdEncoding.EncodeToString(res)
- rest.PostProcessResponse(w, cliCtx, encoded)
- }
-}
-
-type smartResponse struct {
- Smart []byte `json:"smart"`
-}
-
-func queryContractStateSmartHandlerFn(cliCtx client.Context) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- decoder := newArgDecoder(hex.DecodeString)
- addr, err := sdk.AccAddressFromBech32(mux.Vars(r)["contractAddr"])
- if err != nil {
- rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
- return
- }
- decoder.encoding = mux.Vars(r)["encoding"]
- cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r)
- if !ok {
- return
- }
-
- route := fmt.Sprintf("custom/%s/%s/%s/%s", types.QuerierRoute, keeper.QueryGetContractState, addr.String(), keeper.QueryMethodContractStateSmart)
-
- queryData, err := decoder.DecodeString(mux.Vars(r)["query"])
- if err != nil {
- rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
- return
- }
- res, height, err := cliCtx.QueryWithData(route, queryData)
- if err != nil {
- rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
- return
- }
- // return as raw bytes (to be base64-encoded)
- responseData := smartResponse{Smart: res}
-
- cliCtx = cliCtx.WithHeight(height)
- rest.PostProcessResponse(w, cliCtx, responseData)
- }
-}
-
-func queryContractHistoryFn(cliCtx client.Context) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- addr, err := sdk.AccAddressFromBech32(mux.Vars(r)["contractAddr"])
- if err != nil {
- rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
- return
- }
- cliCtx, ok := rest.ParseQueryHeightOrReturnBadRequest(w, cliCtx, r)
- if !ok {
- return
- }
-
- route := fmt.Sprintf("custom/%s/%s/%s", types.QuerierRoute, keeper.QueryContractHistory, addr.String())
- res, height, err := cliCtx.Query(route)
- if err != nil {
- rest.WriteErrorResponse(w, http.StatusInternalServerError, err.Error())
- return
- }
- cliCtx = cliCtx.WithHeight(height)
- rest.PostProcessResponse(w, cliCtx, json.RawMessage(res))
- }
-}
-
-type argumentDecoder struct {
- // dec is the default decoder
- dec func(string) ([]byte, error)
- encoding string
-}
-
-func newArgDecoder(def func(string) ([]byte, error)) *argumentDecoder {
- return &argumentDecoder{dec: def}
-}
-
-func (a *argumentDecoder) DecodeString(s string) ([]byte, error) {
- switch a.encoding {
- case "hex":
- return hex.DecodeString(s)
- case "base64":
- return base64.StdEncoding.DecodeString(s)
- default:
- return a.dec(s)
- }
-}
diff --git a/x/wasm/client/rest/rest.go b/x/wasm/client/rest/rest.go
deleted file mode 100644
index 95339d3aa0..0000000000
--- a/x/wasm/client/rest/rest.go
+++ /dev/null
@@ -1,15 +0,0 @@
-// Deprecated: the rest package will be removed. You can use the GRPC gateway instead
-package rest
-
-import (
- "github.com/cosmos/cosmos-sdk/client"
- "github.com/gorilla/mux"
-)
-
-// RegisterRoutes registers staking-related REST handlers to a router
-// Deprecated: the rest package will be removed. You can use the GRPC gateway instead
-func RegisterRoutes(cliCtx client.Context, r *mux.Router) {
- registerQueryRoutes(cliCtx, r)
- registerTxRoutes(cliCtx, r)
- registerNewTxRoutes(cliCtx, r)
-}
diff --git a/x/wasm/client/rest/tx.go b/x/wasm/client/rest/tx.go
deleted file mode 100644
index 17407c4b6a..0000000000
--- a/x/wasm/client/rest/tx.go
+++ /dev/null
@@ -1,149 +0,0 @@
-package rest
-
-import (
- "net/http"
- "strconv"
-
- "github.com/cosmos/cosmos-sdk/client"
- "github.com/cosmos/cosmos-sdk/client/tx"
- sdk "github.com/cosmos/cosmos-sdk/types"
- "github.com/cosmos/cosmos-sdk/types/rest"
- "github.com/gorilla/mux"
-
- "github.com/CosmWasm/wasmd/x/wasm/ioutils"
- "github.com/CosmWasm/wasmd/x/wasm/types"
-)
-
-func registerTxRoutes(cliCtx client.Context, r *mux.Router) {
- r.HandleFunc("/wasm/code", storeCodeHandlerFn(cliCtx)).Methods("POST")
- r.HandleFunc("/wasm/code/{codeId}", instantiateContractHandlerFn(cliCtx)).Methods("POST")
- r.HandleFunc("/wasm/contract/{contractAddr}", executeContractHandlerFn(cliCtx)).Methods("POST")
-}
-
-type storeCodeReq struct {
- BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`
- WasmBytes []byte `json:"wasm_bytes"`
-}
-
-type instantiateContractReq struct {
- BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`
- Label string `json:"label" yaml:"label"`
- Deposit sdk.Coins `json:"deposit" yaml:"deposit"`
- Admin string `json:"admin,omitempty" yaml:"admin"`
- Msg []byte `json:"msg" yaml:"msg"`
-}
-
-type executeContractReq struct {
- BaseReq rest.BaseReq `json:"base_req" yaml:"base_req"`
- ExecMsg []byte `json:"exec_msg" yaml:"exec_msg"`
- Amount sdk.Coins `json:"coins" yaml:"coins"`
-}
-
-func storeCodeHandlerFn(cliCtx client.Context) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- var req storeCodeReq
- if !rest.ReadRESTReq(w, r, cliCtx.LegacyAmino, &req) {
- return
- }
-
- req.BaseReq = req.BaseReq.Sanitize()
- if !req.BaseReq.ValidateBasic(w) {
- return
- }
-
- var err error
- wasm := req.WasmBytes
-
- // gzip the wasm file
- if ioutils.IsWasm(wasm) {
- wasm, err = ioutils.GzipIt(wasm)
- if err != nil {
- rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error())
- return
- }
- } else if !ioutils.IsGzip(wasm) {
- rest.WriteErrorResponse(w, http.StatusBadRequest, "Invalid input file, use wasm binary or zip")
- return
- }
-
- // build and sign the transaction, then broadcast to Tendermint
- msg := types.MsgStoreCode{
- Sender: req.BaseReq.From,
- WASMByteCode: wasm,
- }
-
- if err := msg.ValidateBasic(); err != nil {
- rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error())
- return
- }
-
- tx.WriteGeneratedTxResponse(cliCtx, w, req.BaseReq, &msg)
- }
-}
-
-func instantiateContractHandlerFn(cliCtx client.Context) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- var req instantiateContractReq
- if !rest.ReadRESTReq(w, r, cliCtx.LegacyAmino, &req) {
- return
- }
- vars := mux.Vars(r)
-
- req.BaseReq = req.BaseReq.Sanitize()
- if !req.BaseReq.ValidateBasic(w) {
- return
- }
-
- // get the id of the code to instantiate
- codeID, err := strconv.ParseUint(vars["codeId"], 10, 64)
- if err != nil {
- return
- }
-
- msg := types.MsgInstantiateContract{
- Sender: req.BaseReq.From,
- CodeID: codeID,
- Label: req.Label,
- Funds: req.Deposit,
- Msg: req.Msg,
- Admin: req.Admin,
- }
-
- if err := msg.ValidateBasic(); err != nil {
- rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error())
- return
- }
-
- tx.WriteGeneratedTxResponse(cliCtx, w, req.BaseReq, &msg)
- }
-}
-
-func executeContractHandlerFn(cliCtx client.Context) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- var req executeContractReq
- if !rest.ReadRESTReq(w, r, cliCtx.LegacyAmino, &req) {
- return
- }
- vars := mux.Vars(r)
- contractAddr := vars["contractAddr"]
-
- req.BaseReq = req.BaseReq.Sanitize()
- if !req.BaseReq.ValidateBasic(w) {
- return
- }
-
- msg := types.MsgExecuteContract{
- Sender: req.BaseReq.From,
- Contract: contractAddr,
- Msg: req.ExecMsg,
- Funds: req.Amount,
- }
-
- if err := msg.ValidateBasic(); err != nil {
- rest.WriteErrorResponse(w, http.StatusBadRequest, err.Error())
- return
- }
-
- tx.WriteGeneratedTxResponse(cliCtx, w, req.BaseReq, &msg)
- }
-}
diff --git a/x/wasm/genesis_test.go b/x/wasm/genesis_test.go
index 9d968f87a9..45afedaad9 100644
--- a/x/wasm/genesis_test.go
+++ b/x/wasm/genesis_test.go
@@ -16,13 +16,13 @@ func TestInitGenesis(t *testing.T) {
creator := data.faucet.NewFundedRandomAccount(data.ctx, deposit.Add(deposit...)...)
fred := data.faucet.NewFundedRandomAccount(data.ctx, topUp...)
- h := data.module.Route().Handler()
- q := data.module.LegacyQuerierHandler(nil)
-
msg := MsgStoreCode{
Sender: creator.String(),
WASMByteCode: testContract,
}
+ h := data.msgServiceRouter.Handler(&msg)
+ q := data.grpcQueryRouter
+
err := msg.ValidateBasic()
require.NoError(t, err)
@@ -38,59 +38,62 @@ func TestInitGenesis(t *testing.T) {
initMsgBz, err := json.Marshal(initMsg)
require.NoError(t, err)
- initCmd := MsgInstantiateContract{
+ instMsg := MsgInstantiateContract{
Sender: creator.String(),
CodeID: firstCodeID,
Msg: initMsgBz,
Funds: deposit,
Label: "testing",
}
- res, err = h(data.ctx, &initCmd)
+ h = data.msgServiceRouter.Handler(&instMsg)
+ res, err = h(data.ctx, &instMsg)
require.NoError(t, err)
contractBech32Addr := parseInitResponse(t, res.Data)
- execCmd := MsgExecuteContract{
+ execMsg := MsgExecuteContract{
Sender: fred.String(),
Contract: contractBech32Addr,
Msg: []byte(`{"release":{}}`),
Funds: topUp,
}
- res, err = h(data.ctx, &execCmd)
+ h = data.msgServiceRouter.Handler(&execMsg)
+ res, err = h(data.ctx, &execMsg)
require.NoError(t, err)
// from https://github.com/CosmWasm/cosmwasm/blob/master/contracts/hackatom/src/contract.rs#L167
assertExecuteResponse(t, res.Data, []byte{0xf0, 0x0b, 0xaa})
// ensure all contract state is as after init
- assertCodeList(t, q, data.ctx, 1)
- assertCodeBytes(t, q, data.ctx, 1, testContract)
+ assertCodeList(t, q, data.ctx, 1, data.encConf.Marshaler)
+ assertCodeBytes(t, q, data.ctx, 1, testContract, data.encConf.Marshaler)
- assertContractList(t, q, data.ctx, 1, []string{contractBech32Addr})
- assertContractInfo(t, q, data.ctx, contractBech32Addr, 1, creator)
+ assertContractList(t, q, data.ctx, 1, []string{contractBech32Addr}, data.encConf.Marshaler)
+ assertContractInfo(t, q, data.ctx, contractBech32Addr, 1, creator, data.encConf.Marshaler)
assertContractState(t, q, data.ctx, contractBech32Addr, state{
Verifier: fred.String(),
Beneficiary: bob.String(),
Funder: creator.String(),
- })
+ }, data.encConf.Marshaler)
// export into genstate
genState := ExportGenesis(data.ctx, &data.keeper)
// create new app to import genstate into
newData := setupTest(t)
- q2 := newData.module.LegacyQuerierHandler(nil)
+ q2 := newData.grpcQueryRouter
// initialize new app with genstate
- InitGenesis(newData.ctx, &newData.keeper, *genState)
+ _, err = InitGenesis(newData.ctx, &newData.keeper, *genState)
+ require.NoError(t, err)
// run same checks again on newdata, to make sure it was reinitialized correctly
- assertCodeList(t, q2, newData.ctx, 1)
- assertCodeBytes(t, q2, newData.ctx, 1, testContract)
+ assertCodeList(t, q2, newData.ctx, 1, data.encConf.Marshaler)
+ assertCodeBytes(t, q2, newData.ctx, 1, testContract, data.encConf.Marshaler)
- assertContractList(t, q2, newData.ctx, 1, []string{contractBech32Addr})
- assertContractInfo(t, q2, newData.ctx, contractBech32Addr, 1, creator)
+ assertContractList(t, q2, newData.ctx, 1, []string{contractBech32Addr}, data.encConf.Marshaler)
+ assertContractInfo(t, q2, newData.ctx, contractBech32Addr, 1, creator, data.encConf.Marshaler)
assertContractState(t, q2, newData.ctx, contractBech32Addr, state{
Verifier: fred.String(),
Beneficiary: bob.String(),
Funder: creator.String(),
- })
+ }, data.encConf.Marshaler)
}
diff --git a/x/wasm/handler.go b/x/wasm/handler.go
deleted file mode 100644
index b350e7d37c..0000000000
--- a/x/wasm/handler.go
+++ /dev/null
@@ -1,77 +0,0 @@
-package wasm
-
-import (
- "fmt"
-
- "github.com/gogo/protobuf/proto"
- abci "github.com/tendermint/tendermint/abci/types"
-
- "github.com/CosmWasm/wasmd/x/wasm/keeper"
- "github.com/CosmWasm/wasmd/x/wasm/types"
-
- sdk "github.com/cosmos/cosmos-sdk/types"
- sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
-)
-
-// NewHandler returns a handler for "wasm" type messages.
-func NewHandler(k types.ContractOpsKeeper) sdk.Handler {
- msgServer := keeper.NewMsgServerImpl(k)
-
- return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {
- ctx = ctx.WithEventManager(sdk.NewEventManager())
-
- var (
- res proto.Message
- err error
- )
- switch msg := msg.(type) {
- case *MsgStoreCode: //nolint:typecheck
- res, err = msgServer.StoreCode(sdk.WrapSDKContext(ctx), msg)
- case *MsgInstantiateContract:
- res, err = msgServer.InstantiateContract(sdk.WrapSDKContext(ctx), msg)
- case *MsgInstantiateContract2:
- res, err = msgServer.InstantiateContract2(sdk.WrapSDKContext(ctx), msg)
- case *MsgExecuteContract:
- res, err = msgServer.ExecuteContract(sdk.WrapSDKContext(ctx), msg)
- case *MsgMigrateContract:
- res, err = msgServer.MigrateContract(sdk.WrapSDKContext(ctx), msg)
- case *MsgUpdateAdmin:
- res, err = msgServer.UpdateAdmin(sdk.WrapSDKContext(ctx), msg)
- case *MsgClearAdmin:
- res, err = msgServer.ClearAdmin(sdk.WrapSDKContext(ctx), msg)
- case *types.MsgUpdateInstantiateConfig:
- res, err = msgServer.UpdateInstantiateConfig(sdk.WrapSDKContext(ctx), msg)
- default:
- errMsg := fmt.Sprintf("unrecognized wasm message type: %T", msg)
- return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg)
- }
-
- ctx = ctx.WithEventManager(filterMessageEvents(ctx))
- return sdk.WrapServiceResult(ctx, res, err)
- }
-}
-
-// filterMessageEvents returns the same events with all of type == EventTypeMessage removed except
-// for wasm message types.
-// this is so only our top-level message event comes through
-func filterMessageEvents(ctx sdk.Context) *sdk.EventManager {
- m := sdk.NewEventManager()
- for _, e := range ctx.EventManager().Events() {
- if e.Type == sdk.EventTypeMessage &&
- !hasWasmModuleAttribute(e.Attributes) {
- continue
- }
- m.EmitEvent(e)
- }
- return m
-}
-
-func hasWasmModuleAttribute(attrs []abci.EventAttribute) bool {
- for _, a := range attrs {
- if sdk.AttributeKeyModule == string(a.Key) &&
- types.ModuleName == string(a.Value) {
- return true
- }
- }
- return false
-}
diff --git a/x/wasm/ibc.go b/x/wasm/ibc.go
index c0f2fda6b0..01e3703c86 100644
--- a/x/wasm/ibc.go
+++ b/x/wasm/ibc.go
@@ -7,10 +7,10 @@ import (
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"
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
+ porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types"
+ host "github.com/cosmos/ibc-go/v7/modules/core/24-host"
+ ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
"github.com/CosmWasm/wasmd/x/wasm/types"
)
@@ -71,7 +71,7 @@ func (i IBCHandler) OnChanOpenInit(
if err != nil {
return "", err
}
- if acceptedVersion == "" {
+ if acceptedVersion == "" { // accept incoming version when nothing returned by contract
acceptedVersion = version
}
diff --git a/x/wasm/ibc_integration_test.go b/x/wasm/ibc_integration_test.go
index 3df273b206..739ab15a45 100644
--- a/x/wasm/ibc_integration_test.go
+++ b/x/wasm/ibc_integration_test.go
@@ -5,9 +5,9 @@ import (
wasmvm "github.com/CosmWasm/wasmvm"
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
- ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
- channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"
- ibctesting "github.com/cosmos/ibc-go/v4/testing"
+ ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
+ ibctesting "github.com/cosmos/ibc-go/v7/testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -47,10 +47,10 @@ func TestOnChanOpenInitVersion(t *testing.T) {
wasmtesting.NewIBCContractMockWasmer(myContract)),
}
coordinator = wasmibctesting.NewCoordinator(t, 2, chainAOpts)
- chainA = coordinator.GetChain(wasmibctesting.GetChainID(0))
- chainB = coordinator.GetChain(wasmibctesting.GetChainID(1))
+ chainA = coordinator.GetChain(wasmibctesting.GetChainID(1))
+ chainB = coordinator.GetChain(wasmibctesting.GetChainID(2))
myContractAddr = chainA.SeedNewContractInstance()
- contractInfo = chainA.App.WasmKeeper.GetContractInfo(chainA.GetContext(), myContractAddr)
+ contractInfo = chainA.App.WasmKeeper.GetContractInfo(chainA.App.NewUncachedContext(false, chainA.CurrentHeader), myContractAddr)
)
path := wasmibctesting.NewPath(chainA, chainB)
@@ -98,8 +98,8 @@ func TestOnChanOpenTryVersion(t *testing.T) {
wasmtesting.NewIBCContractMockWasmer(myContract)),
}
coordinator = wasmibctesting.NewCoordinator(t, 2, chainAOpts)
- chainA = coordinator.GetChain(wasmibctesting.GetChainID(0))
- chainB = coordinator.GetChain(wasmibctesting.GetChainID(1))
+ chainA = coordinator.GetChain(wasmibctesting.GetChainID(1))
+ chainB = coordinator.GetChain(wasmibctesting.GetChainID(2))
myContractAddr = chainA.SeedNewContractInstance()
contractInfo = chainA.ContractInfo(myContractAddr)
)
diff --git a/x/wasm/ibc_reflect_test.go b/x/wasm/ibc_reflect_test.go
index 2103878147..efb47e7e6a 100644
--- a/x/wasm/ibc_reflect_test.go
+++ b/x/wasm/ibc_reflect_test.go
@@ -5,8 +5,8 @@ import (
"github.com/stretchr/testify/assert"
- channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"
- ibctesting "github.com/cosmos/ibc-go/v4/testing"
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
+ ibctesting "github.com/cosmos/ibc-go/v7/testing"
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
"github.com/stretchr/testify/require"
@@ -25,8 +25,8 @@ func TestIBCReflectContract(t *testing.T) {
var (
coordinator = wasmibctesting.NewCoordinator(t, 2)
- chainA = coordinator.GetChain(wasmibctesting.GetChainID(0))
- chainB = coordinator.GetChain(wasmibctesting.GetChainID(1))
+ chainA = coordinator.GetChain(wasmibctesting.GetChainID(1))
+ chainB = coordinator.GetChain(wasmibctesting.GetChainID(2))
)
coordinator.CommitBlock(chainA, chainB)
diff --git a/x/wasm/ibc_test.go b/x/wasm/ibc_test.go
index ee63c7fb02..a92d451453 100644
--- a/x/wasm/ibc_test.go
+++ b/x/wasm/ibc_test.go
@@ -4,8 +4,8 @@ import (
"testing"
wasmvmtypes "github.com/CosmWasm/wasmvm/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"
+ clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
"github.com/stretchr/testify/assert"
)
diff --git a/x/wasm/ibctesting/chain.go b/x/wasm/ibctesting/chain.go
index abb6607bfa..b318f4f42f 100644
--- a/x/wasm/ibctesting/chain.go
+++ b/x/wasm/ibctesting/chain.go
@@ -9,34 +9,35 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
+
+ "github.com/CosmWasm/wasmd/app"
+ "github.com/CosmWasm/wasmd/x/wasm"
+
+ // simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
+ abci "github.com/cometbft/cometbft/abci/types"
+ "github.com/cometbft/cometbft/crypto/tmhash"
+ tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
+ tmprotoversion "github.com/cometbft/cometbft/proto/tendermint/version"
+ tmtypes "github.com/cometbft/cometbft/types"
+ tmversion "github.com/cometbft/cometbft/version"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
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"
- "github.com/cosmos/cosmos-sdk/x/staking/teststaking"
+ "github.com/cosmos/cosmos-sdk/x/staking/testutil"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/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"
- commitmenttypes "github.com/cosmos/ibc-go/v4/modules/core/23-commitment/types"
- host "github.com/cosmos/ibc-go/v4/modules/core/24-host"
- "github.com/cosmos/ibc-go/v4/modules/core/exported"
- "github.com/cosmos/ibc-go/v4/modules/core/types"
- ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types"
- ibctesting "github.com/cosmos/ibc-go/v4/testing"
- "github.com/cosmos/ibc-go/v4/testing/mock"
+ clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
+ commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types"
+ host "github.com/cosmos/ibc-go/v7/modules/core/24-host"
+ "github.com/cosmos/ibc-go/v7/modules/core/exported"
+ "github.com/cosmos/ibc-go/v7/modules/core/types"
+ ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"
+ ibctesting "github.com/cosmos/ibc-go/v7/testing"
+ "github.com/cosmos/ibc-go/v7/testing/mock"
"github.com/stretchr/testify/require"
- abci "github.com/tendermint/tendermint/abci/types"
- "github.com/tendermint/tendermint/crypto/tmhash"
- tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
- tmprotoversion "github.com/tendermint/tendermint/proto/tendermint/version"
- tmtypes "github.com/tendermint/tendermint/types"
- tmversion "github.com/tendermint/tendermint/version"
-
- "github.com/CosmWasm/wasmd/app"
- "github.com/CosmWasm/wasmd/app/params"
- "github.com/CosmWasm/wasmd/x/wasm"
)
var MaxAccounts = 10
@@ -57,8 +58,8 @@ type TestChain struct {
Coordinator *Coordinator
App *app.WasmApp
ChainID string
- LastHeader *ibctmtypes.Header // header for last block height committed
- CurrentHeader tmproto.Header // header for current block height
+ LastHeader *ibctm.Header // header for last block height committed
+ CurrentHeader tmproto.Header // header for current block height
QueryServer types.QueryServer
TxConfig client.TxConfig
Codec codec.BinaryCodec
@@ -165,7 +166,7 @@ func NewTestChainWithValSet(t *testing.T, coord *Coordinator, chainID string, va
Time: coord.CurrentTime.UTC(),
}
- txConfig := params.MakeEncodingConfig().TxConfig
+ txConfig := wasmApp.TxConfig()
// create an account to send transactions from
chain := &TestChain{
@@ -202,10 +203,17 @@ func (chain *TestChain) QueryProof(key []byte) ([]byte, clienttypes.Height) {
}
// QueryProofAtHeight performs an abci query with the given key and returns the proto encoded merkle proof
-// for the query and the height at which the proof will succeed on a tendermint verifier.
+// for the query and the height at which the proof will succeed on a tendermint verifier. Only the IBC
+// store is supported
func (chain *TestChain) QueryProofAtHeight(key []byte, height int64) ([]byte, clienttypes.Height) {
+ return chain.QueryProofForStore(exported.StoreKey, key, height)
+}
+
+// QueryProofForStore performs an abci query with the given key and returns the proto encoded merkle proof
+// for the query and the height at which the proof will succeed on a tendermint verifier.
+func (chain *TestChain) QueryProofForStore(storeKey string, key []byte, height int64) ([]byte, clienttypes.Height) {
res := chain.App.Query(abci.RequestQuery{
- Path: fmt.Sprintf("store/%s/key", host.StoreKey),
+ Path: fmt.Sprintf("store/%s/key", storeKey),
Height: height - 1,
Data: key,
Prove: true,
@@ -291,6 +299,7 @@ func (chain *TestChain) NextBlock() {
Time: chain.CurrentHeader.Time,
ValidatorsHash: chain.Vals.Hash(),
NextValidatorsHash: chain.NextVals.Hash(),
+ ProposerAddress: chain.CurrentHeader.ProposerAddress,
}
chain.App.BeginBlock(abci.RequestBeginBlock{Header: chain.CurrentHeader})
@@ -309,7 +318,7 @@ func (chain *TestChain) SendMsgs(msgs ...sdk.Msg) (*sdk.Result, error) {
// ensure the chain has the latest time
chain.Coordinator.UpdateTimeForChain(chain)
- _, r, err := app.SignAndDeliver(
+ _, r, err := app.SignAndDeliverWithoutCommit(
chain.t,
chain.TxConfig,
chain.App.BaseApp,
@@ -320,12 +329,12 @@ func (chain *TestChain) SendMsgs(msgs ...sdk.Msg) (*sdk.Result, error) {
[]uint64{chain.SenderAccount.GetSequence()},
chain.SenderPrivKey,
)
+ if err != nil {
+ return nil, err
+ }
// NextBlock calls app.Commit()
chain.NextBlock()
- if err != nil {
- return r, err
- }
// increment sequence for successful transaction execution
err = chain.SenderAccount.SetSequence(chain.SenderAccount.GetSequence() + 1)
@@ -373,7 +382,7 @@ func (chain *TestChain) GetValsAtHeight(height int64) (*tmtypes.ValidatorSet, bo
valSet := stakingtypes.Validators(histInfo.Valset)
- tmValidators, err := teststaking.ToTmValidators(valSet, sdk.DefaultPowerReduction)
+ tmValidators, err := testutil.ToTmValidators(valSet, sdk.DefaultPowerReduction)
if err != nil {
panic(err)
}
@@ -396,13 +405,13 @@ func (chain *TestChain) GetPrefix() commitmenttypes.MerklePrefix {
// ConstructUpdateTMClientHeader will construct a valid 07-tendermint Header to update the
// light client on the source chain.
-func (chain *TestChain) ConstructUpdateTMClientHeader(counterparty *TestChain, clientID string) (*ibctmtypes.Header, error) {
+func (chain *TestChain) ConstructUpdateTMClientHeader(counterparty *TestChain, clientID string) (*ibctm.Header, error) {
return chain.ConstructUpdateTMClientHeaderWithTrustedHeight(counterparty, clientID, clienttypes.ZeroHeight())
}
// ConstructUpdateTMClientHeader will construct a valid 07-tendermint Header to update the
// light client on the source chain.
-func (chain *TestChain) ConstructUpdateTMClientHeaderWithTrustedHeight(counterparty *TestChain, clientID string, trustedHeight clienttypes.Height) (*ibctmtypes.Header, error) {
+func (chain *TestChain) ConstructUpdateTMClientHeaderWithTrustedHeight(counterparty *TestChain, clientID string, trustedHeight clienttypes.Height) (*ibctm.Header, error) {
header := counterparty.LastHeader
// Relayer must query for LatestHeight on client to get TrustedHeight if the trusted height is not set
if trustedHeight.IsZero() {
@@ -424,7 +433,7 @@ func (chain *TestChain) ConstructUpdateTMClientHeaderWithTrustedHeight(counterpa
// NextValidatorsHash
tmTrustedVals, ok = counterparty.GetValsAtHeight(int64(trustedHeight.RevisionHeight + 1))
if !ok {
- return nil, sdkerrors.Wrapf(ibctmtypes.ErrInvalidHeaderHeight, "could not retrieve trusted validators at trustedHeight: %d", trustedHeight)
+ return nil, sdkerrors.Wrapf(ibctm.ErrInvalidHeaderHeight, "could not retrieve trusted validators at trustedHeight: %d", trustedHeight)
}
}
// inject trusted fields into last header
@@ -448,13 +457,13 @@ func (chain *TestChain) ExpireClient(amount time.Duration) {
// CurrentTMClientHeader creates a TM header using the current header parameters
// on the chain. The trusted fields in the header are set to nil.
-func (chain *TestChain) CurrentTMClientHeader() *ibctmtypes.Header {
+func (chain *TestChain) CurrentTMClientHeader() *ibctm.Header {
return chain.CreateTMClientHeader(chain.ChainID, chain.CurrentHeader.Height, clienttypes.Height{}, chain.CurrentHeader.Time, chain.Vals, chain.NextVals, nil, chain.Signers)
}
// CreateTMClientHeader creates a TM header to update the TM client. Args are passed in to allow
// caller flexibility to use params that differ from the chain.
-func (chain *TestChain) CreateTMClientHeader(chainID string, blockHeight int64, trustedHeight clienttypes.Height, timestamp time.Time, tmValSet, nextVals, tmTrustedVals *tmtypes.ValidatorSet, signers map[string]tmtypes.PrivValidator) *ibctmtypes.Header {
+func (chain *TestChain) CreateTMClientHeader(chainID string, blockHeight int64, trustedHeight clienttypes.Height, timestamp time.Time, tmValSet, nextVals, tmTrustedVals *tmtypes.ValidatorSet, signers map[string]tmtypes.PrivValidator) *ibctm.Header {
var (
valSet *tmproto.ValidatorSet
trustedVals *tmproto.ValidatorSet
@@ -484,12 +493,11 @@ func (chain *TestChain) CreateTMClientHeader(chainID string, blockHeight int64,
hhash := tmHeader.Hash()
blockID := MakeBlockID(hhash, 3, tmhash.Sum([]byte("part_set")))
voteSet := tmtypes.NewVoteSet(chainID, blockHeight, 1, tmproto.PrecommitType, tmValSet)
-
// MakeCommit expects a signer array in the same order as the validator array.
// Thus we iterate over the ordered validator set and construct a signer array
// from the signer map in the same order.
- signerArr := make([]tmtypes.PrivValidator, len(tmValSet.Validators))
- for i, v := range tmValSet.Validators {
+ signerArr := make([]tmtypes.PrivValidator, len(tmValSet.Validators)) //nolint:staticcheck
+ for i, v := range tmValSet.Validators { //nolint:staticcheck
signerArr[i] = signers[v.Address.String()]
}
@@ -501,8 +509,10 @@ func (chain *TestChain) CreateTMClientHeader(chainID string, blockHeight int64,
Commit: commit.ToProto(),
}
- valSet, err = tmValSet.ToProto()
- require.NoError(chain.t, err)
+ if tmValSet != nil { //nolint:staticcheck
+ valSet, err = tmValSet.ToProto()
+ require.NoError(chain.t, err)
+ }
if tmTrustedVals != nil {
trustedVals, err = tmTrustedVals.ToProto()
@@ -511,7 +521,7 @@ func (chain *TestChain) CreateTMClientHeader(chainID string, blockHeight int64,
// The trusted fields may be nil. They may be filled before relaying messages to a client.
// The relayer is responsible for querying client and injecting appropriate trusted fields.
- return &ibctmtypes.Header{
+ return &ibctm.Header{
SignedHeader: signedHeader,
ValidatorSet: valSet,
TrustedHeight: trustedHeight,
@@ -585,6 +595,12 @@ func (chain *TestChain) GetChannelCapability(portID, channelID string) *capabili
return cap
}
+// GetTimeoutHeight is a convenience function which returns a IBC packet timeout height
+// to be used for testing. It returns the current IBC height + 100 blocks
+func (chain *TestChain) GetTimeoutHeight() clienttypes.Height {
+ return clienttypes.NewHeight(clienttypes.ParseChainID(chain.ChainID), uint64(chain.GetContext().BlockHeight())+100)
+}
+
func (chain *TestChain) Balance(acc sdk.AccAddress, denom string) sdk.Coin {
return chain.App.BankKeeper.GetBalance(chain.GetContext(), acc, denom)
}
diff --git a/x/wasm/ibctesting/coordinator.go b/x/wasm/ibctesting/coordinator.go
index 9ceadc0a76..afdb933bf0 100644
--- a/x/wasm/ibctesting/coordinator.go
+++ b/x/wasm/ibctesting/coordinator.go
@@ -2,24 +2,21 @@ package ibctesting
import (
"fmt"
- "strconv"
"testing"
"time"
- channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"
- host "github.com/cosmos/ibc-go/v4/modules/core/24-host"
- ibctesting "github.com/cosmos/ibc-go/v4/testing"
+ abci "github.com/cometbft/cometbft/abci/types"
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
+ host "github.com/cosmos/ibc-go/v7/modules/core/24-host"
+ ibctesting "github.com/cosmos/ibc-go/v7/testing"
"github.com/stretchr/testify/require"
- abci "github.com/tendermint/tendermint/abci/types"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
)
-const ChainIDPrefix = "testchain"
-
var (
- globalStartTime = time.Date(2020, 12, 4, 10, 30, 0, 0, time.UTC)
TimeIncrement = time.Second * 5
+ globalStartTime = time.Date(2020, 1, 2, 0, 0, 0, 0, time.UTC)
)
// Coordinator is a testing struct which contains N TestChain's. It handles keeping all chains
@@ -39,11 +36,11 @@ func NewCoordinator(t *testing.T, n int, opts ...[]wasmkeeper.Option) *Coordinat
CurrentTime: globalStartTime,
}
- for i := 0; i < n; i++ {
+ for i := 1; i <= n; i++ {
chainID := GetChainID(i)
var x []wasmkeeper.Option
- if len(opts) > i {
- x = opts[i]
+ if len(opts) > (i - 1) {
+ x = opts[i-1]
}
chains[chainID] = NewTestChain(t, coord, chainID, x...)
}
@@ -183,7 +180,7 @@ func (coord *Coordinator) GetChain(chainID string) *TestChain {
// GetChainID returns the chainID used for the provided index.
func GetChainID(index int) string {
- return ChainIDPrefix + strconv.Itoa(index)
+ return ibctesting.GetChainID(index)
}
// CommitBlock commits a block on the provided indexes and then increments the global time.
diff --git a/x/wasm/ibctesting/endpoint.go b/x/wasm/ibctesting/endpoint.go
index e56c5d06ef..48a6e05bd3 100644
--- a/x/wasm/ibctesting/endpoint.go
+++ b/x/wasm/ibctesting/endpoint.go
@@ -2,16 +2,17 @@ package ibctesting
import (
"fmt"
+ "strings"
sdk "github.com/cosmos/cosmos-sdk/types"
- clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"
- connectiontypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types"
- channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"
- commitmenttypes "github.com/cosmos/ibc-go/v4/modules/core/23-commitment/types"
- host "github.com/cosmos/ibc-go/v4/modules/core/24-host"
- "github.com/cosmos/ibc-go/v4/modules/core/exported"
- ibctmtypes "github.com/cosmos/ibc-go/v4/modules/light-clients/07-tendermint/types"
- ibctesting "github.com/cosmos/ibc-go/v4/testing"
+ clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
+ connectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types"
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
+ commitmenttypes "github.com/cosmos/ibc-go/v7/modules/core/23-commitment/types"
+ host "github.com/cosmos/ibc-go/v7/modules/core/24-host"
+ "github.com/cosmos/ibc-go/v7/modules/core/exported"
+ ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"
+ ibctesting "github.com/cosmos/ibc-go/v7/testing"
"github.com/stretchr/testify/require"
)
@@ -91,10 +92,9 @@ func (endpoint *Endpoint) CreateClient() (err error) {
require.True(endpoint.Chain.t, ok)
height := endpoint.Counterparty.Chain.LastHeader.GetHeight().(clienttypes.Height)
- clientState = ibctmtypes.NewClientState(
+ clientState = ibctm.NewClientState(
endpoint.Counterparty.Chain.ChainID, tmConfig.TrustLevel, tmConfig.TrustingPeriod, tmConfig.UnbondingPeriod, tmConfig.MaxClockDrift,
- height, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, tmConfig.AllowUpdateAfterExpiry, tmConfig.AllowUpdateAfterMisbehaviour,
- )
+ height, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath)
consensusState = endpoint.Counterparty.Chain.LastHeader.ConsensusState()
case exported.Solomachine:
// TODO
@@ -131,7 +131,7 @@ func (endpoint *Endpoint) UpdateClient() (err error) {
// ensure counterparty has committed state
endpoint.Chain.Coordinator.CommitBlock(endpoint.Counterparty.Chain)
- var header exported.Header
+ var header exported.ClientMessage
switch endpoint.ClientConfig.GetClientType() {
case exported.Tendermint:
@@ -154,6 +154,59 @@ func (endpoint *Endpoint) UpdateClient() (err error) {
return endpoint.Chain.sendMsgs(msg)
}
+// UpgradeChain will upgrade a chain's chainID to the next revision number.
+// It will also update the counterparty client.
+// TODO: implement actual upgrade chain functionality via scheduling an upgrade
+// and upgrading the client via MsgUpgradeClient
+// see reference https://github.com/cosmos/ibc-go/pull/1169
+func (endpoint *Endpoint) UpgradeChain() error {
+ if strings.TrimSpace(endpoint.Counterparty.ClientID) == "" {
+ return fmt.Errorf("cannot upgrade chain if there is no counterparty client")
+ }
+
+ clientState := endpoint.Counterparty.GetClientState().(*ibctm.ClientState)
+
+ // increment revision number in chainID
+
+ oldChainID := clientState.ChainId
+ if !clienttypes.IsRevisionFormat(oldChainID) {
+ return fmt.Errorf("cannot upgrade chain which is not of revision format: %s", oldChainID)
+ }
+
+ revisionNumber := clienttypes.ParseChainID(oldChainID)
+ newChainID, err := clienttypes.SetRevisionNumber(oldChainID, revisionNumber+1)
+ if err != nil {
+ return err
+ }
+
+ // update chain
+ endpoint.Chain.ChainID = newChainID
+ endpoint.Chain.CurrentHeader.ChainID = newChainID
+ endpoint.Chain.NextBlock() // commit changes
+
+ // update counterparty client manually
+ clientState.ChainId = newChainID
+ clientState.LatestHeight = clienttypes.NewHeight(revisionNumber+1, clientState.LatestHeight.GetRevisionHeight()+1)
+ endpoint.Counterparty.SetClientState(clientState)
+
+ consensusState := &ibctm.ConsensusState{
+ Timestamp: endpoint.Chain.LastHeader.GetTime(),
+ Root: commitmenttypes.NewMerkleRoot(endpoint.Chain.LastHeader.Header.GetAppHash()),
+ NextValidatorsHash: endpoint.Chain.LastHeader.Header.NextValidatorsHash,
+ }
+ endpoint.Counterparty.SetConsensusState(consensusState, clientState.GetLatestHeight())
+
+ // ensure the next update isn't identical to the one set in state
+ endpoint.Chain.Coordinator.IncrementTime()
+ endpoint.Chain.NextBlock()
+
+ if err = endpoint.Counterparty.UpdateClient(); err != nil {
+ return err
+ }
+
+ return nil
+}
+
// ConnOpenInit will construct and execute a MsgConnectionOpenInit on the associated endpoint.
func (endpoint *Endpoint) ConnOpenInit() error {
msg := connectiontypes.NewMsgConnectionOpenInit(
@@ -175,9 +228,8 @@ func (endpoint *Endpoint) ConnOpenInit() error {
// ConnOpenTry will construct and execute a MsgConnectionOpenTry on the associated endpoint.
func (endpoint *Endpoint) ConnOpenTry() error {
- if err := endpoint.UpdateClient(); err != nil {
- return err
- }
+ err := endpoint.UpdateClient()
+ require.NoError(endpoint.Chain.t, err)
counterpartyClient, proofClient, proofConsensus, consensusHeight, proofInit, proofHeight := endpoint.QueryConnectionHandshakeProof()
@@ -203,9 +255,8 @@ func (endpoint *Endpoint) ConnOpenTry() error {
// ConnOpenAck will construct and execute a MsgConnectionOpenAck on the associated endpoint.
func (endpoint *Endpoint) ConnOpenAck() error {
- if err := endpoint.UpdateClient(); err != nil {
- return err
- }
+ err := endpoint.UpdateClient()
+ require.NoError(endpoint.Chain.t, err)
counterpartyClient, proofClient, proofConsensus, consensusHeight, proofTry, proofHeight := endpoint.QueryConnectionHandshakeProof()
@@ -221,9 +272,8 @@ func (endpoint *Endpoint) ConnOpenAck() error {
// ConnOpenConfirm will construct and execute a MsgConnectionOpenConfirm on the associated endpoint.
func (endpoint *Endpoint) ConnOpenConfirm() error {
- if err := endpoint.UpdateClient(); err != nil {
- return err
- }
+ err := endpoint.UpdateClient()
+ require.NoError(endpoint.Chain.t, err)
connectionKey := host.ConnectionKey(endpoint.Counterparty.ConnectionID)
proof, height := endpoint.Counterparty.Chain.QueryProof(connectionKey)
@@ -290,9 +340,8 @@ func (endpoint *Endpoint) ChanOpenInit() error {
// ChanOpenTry will construct and execute a MsgChannelOpenTry on the associated endpoint.
func (endpoint *Endpoint) ChanOpenTry() error {
- if err := endpoint.UpdateClient(); err != nil {
- return err
- }
+ err := endpoint.UpdateClient()
+ require.NoError(endpoint.Chain.t, err)
channelKey := host.ChannelKey(endpoint.Counterparty.ChannelConfig.PortID, endpoint.Counterparty.ChannelID)
proof, height := endpoint.Counterparty.Chain.QueryProof(channelKey)
@@ -323,9 +372,8 @@ func (endpoint *Endpoint) ChanOpenTry() error {
// ChanOpenAck will construct and execute a MsgChannelOpenAck on the associated endpoint.
func (endpoint *Endpoint) ChanOpenAck() error {
- if err := endpoint.UpdateClient(); err != nil {
- return err
- }
+ err := endpoint.UpdateClient()
+ require.NoError(endpoint.Chain.t, err)
channelKey := host.ChannelKey(endpoint.Counterparty.ChannelConfig.PortID, endpoint.Counterparty.ChannelID)
proof, height := endpoint.Counterparty.Chain.QueryProof(channelKey)
@@ -346,9 +394,8 @@ func (endpoint *Endpoint) ChanOpenAck() error {
// ChanOpenConfirm will construct and execute a MsgChannelOpenConfirm on the associated endpoint.
func (endpoint *Endpoint) ChanOpenConfirm() error {
- if err := endpoint.UpdateClient(); err != nil {
- return err
- }
+ err := endpoint.UpdateClient()
+ require.NoError(endpoint.Chain.t, err)
channelKey := host.ChannelKey(endpoint.Counterparty.ChannelConfig.PortID, endpoint.Counterparty.ChannelID)
proof, height := endpoint.Counterparty.Chain.QueryProof(channelKey)
@@ -387,19 +434,30 @@ func (endpoint *Endpoint) ChanCloseConfirm() error {
// SendPacket sends a packet through the channel keeper using the associated endpoint
// The counterparty client is updated so proofs can be sent to the counterparty chain.
-func (endpoint *Endpoint) SendPacket(packet exported.PacketI) error {
- channelCap := endpoint.Chain.GetChannelCapability(packet.GetSourcePort(), packet.GetSourceChannel())
+// The packet sequence generated for the packet to be sent is returned. An error
+// is returned if one occurs.
+func (endpoint *Endpoint) SendPacket(
+ timeoutHeight clienttypes.Height,
+ timeoutTimestamp uint64,
+ data []byte,
+) (uint64, error) {
+ channelCap := endpoint.Chain.GetChannelCapability(endpoint.ChannelConfig.PortID, endpoint.ChannelID)
// no need to send message, acting as a module
- err := endpoint.Chain.App.IBCKeeper.ChannelKeeper.SendPacket(endpoint.Chain.GetContext(), channelCap, packet)
+ sequence, err := endpoint.Chain.App.IBCKeeper.ChannelKeeper.SendPacket(endpoint.Chain.GetContext(), channelCap, endpoint.ChannelConfig.PortID, endpoint.ChannelID, timeoutHeight, timeoutTimestamp, data)
if err != nil {
- return err
+ return 0, err
}
// commit changes since no message was sent
endpoint.Chain.Coordinator.CommitBlock(endpoint.Chain)
- return endpoint.Counterparty.UpdateClient()
+ err = endpoint.Counterparty.UpdateClient()
+ if err != nil {
+ return 0, err
+ }
+
+ return sequence, nil
}
// RecvPacket receives a packet on the associated endpoint.
diff --git a/x/wasm/ibctesting/event_utils.go b/x/wasm/ibctesting/event_utils.go
index 0933dadd3f..a3769014e8 100644
--- a/x/wasm/ibctesting/event_utils.go
+++ b/x/wasm/ibctesting/event_utils.go
@@ -8,9 +8,9 @@ import (
sdk "github.com/cosmos/cosmos-sdk/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"
- abci "github.com/tendermint/tendermint/abci/types"
+ abci "github.com/cometbft/cometbft/abci/types"
+ clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
)
func getSendPackets(evts []abci.Event) []channeltypes.Packet {
@@ -60,8 +60,8 @@ func getHexField(evt abci.Event, key string) []byte {
// return the value for the attribute with the given name
func getField(evt abci.Event, key string) string {
for _, attr := range evt.Attributes {
- if string(attr.Key) == key {
- return string(attr.Value)
+ if attr.Key == key {
+ return attr.Value
}
}
return ""
@@ -95,8 +95,8 @@ func ParsePortIDFromEvents(events sdk.Events) (string, error) {
for _, ev := range events {
if ev.Type == channeltypes.EventTypeChannelOpenInit || ev.Type == channeltypes.EventTypeChannelOpenTry {
for _, attr := range ev.Attributes {
- if string(attr.Key) == channeltypes.AttributeKeyPortID {
- return string(attr.Value), nil
+ if attr.Key == channeltypes.AttributeKeyPortID {
+ return attr.Value, nil
}
}
}
@@ -108,8 +108,8 @@ func ParseChannelVersionFromEvents(events sdk.Events) (string, error) {
for _, ev := range events {
if ev.Type == channeltypes.EventTypeChannelOpenInit || ev.Type == channeltypes.EventTypeChannelOpenTry {
for _, attr := range ev.Attributes {
- if string(attr.Key) == channeltypes.AttributeVersion {
- return string(attr.Value), nil
+ if attr.Key == channeltypes.AttributeVersion {
+ return attr.Value, nil
}
}
}
diff --git a/x/wasm/ibctesting/faucet.go b/x/wasm/ibctesting/faucet.go
index d5098c34c8..24e81d47c6 100644
--- a/x/wasm/ibctesting/faucet.go
+++ b/x/wasm/ibctesting/faucet.go
@@ -1,6 +1,7 @@
package ibctesting
import (
+ "cosmossdk.io/math"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
sdk "github.com/cosmos/cosmos-sdk/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
@@ -10,7 +11,7 @@ import (
)
// Fund an address with the given amount in default denom
-func (chain *TestChain) Fund(addr sdk.AccAddress, amount sdk.Int) {
+func (chain *TestChain) Fund(addr sdk.AccAddress, amount math.Int) {
require.NoError(chain.t, chain.sendMsgs(&banktypes.MsgSend{
FromAddress: chain.SenderAccount.GetAddress().String(),
ToAddress: addr.String(),
@@ -29,7 +30,7 @@ func (chain *TestChain) SendNonDefaultSenderMsgs(senderPrivKey cryptotypes.PrivK
addr := sdk.AccAddress(senderPrivKey.PubKey().Address().Bytes())
account := chain.App.AccountKeeper.GetAccount(chain.GetContext(), addr)
require.NotNil(chain.t, account)
- _, r, err := app.SignAndDeliver(
+ _, r, err := app.SignAndDeliverWithoutCommit(
chain.t,
chain.TxConfig,
chain.App.BaseApp,
@@ -41,7 +42,7 @@ func (chain *TestChain) SendNonDefaultSenderMsgs(senderPrivKey cryptotypes.PrivK
senderPrivKey,
)
- // SignAndDeliver calls app.Commit()
+ // SignAndDeliverWithoutCommit calls app.Commit()
chain.NextBlock()
chain.Coordinator.IncrementTime()
if err != nil {
diff --git a/x/wasm/ibctesting/path.go b/x/wasm/ibctesting/path.go
index 5e861325f0..30d46778b2 100644
--- a/x/wasm/ibctesting/path.go
+++ b/x/wasm/ibctesting/path.go
@@ -5,8 +5,8 @@ import (
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
- channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"
- ibctesting "github.com/cosmos/ibc-go/v4/testing"
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
+ ibctesting "github.com/cosmos/ibc-go/v7/testing"
)
// Path contains two endpoints representing two chains connected over IBC
diff --git a/x/wasm/ibctesting/wasm.go b/x/wasm/ibctesting/wasm.go
index 0546f477eb..1eba869574 100644
--- a/x/wasm/ibctesting/wasm.go
+++ b/x/wasm/ibctesting/wasm.go
@@ -8,13 +8,13 @@ import (
"os"
"strings"
- ibctesting "github.com/cosmos/ibc-go/v4/testing"
+ ibctesting "github.com/cosmos/ibc-go/v7/testing"
+ abci "github.com/cometbft/cometbft/abci/types"
+ "github.com/cometbft/cometbft/libs/rand"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/golang/protobuf/proto" //nolint
"github.com/stretchr/testify/require"
- abci "github.com/tendermint/tendermint/abci/types"
- "github.com/tendermint/tendermint/libs/rand"
"github.com/CosmWasm/wasmd/x/wasm/types"
)
@@ -56,14 +56,13 @@ func (chain *TestChain) StoreCode(byteCode []byte) types.MsgStoreCodeResponse {
}
r, err := chain.SendMsgs(storeMsg)
require.NoError(chain.t, err)
- protoResult := chain.parseSDKResultData(r)
- require.Len(chain.t, protoResult.Data, 1)
// unmarshal protobuf response from data
- var pInstResp types.MsgStoreCodeResponse
- require.NoError(chain.t, pInstResp.Unmarshal(protoResult.Data[0].Data))
+ require.Len(chain.t, r.MsgResponses, 1)
+ require.NotEmpty(chain.t, r.MsgResponses[0].GetCachedValue())
+ pInstResp := r.MsgResponses[0].GetCachedValue().(*types.MsgStoreCodeResponse)
require.NotEmpty(chain.t, pInstResp.CodeID)
require.NotEmpty(chain.t, pInstResp.Checksum)
- return pInstResp
+ return *pInstResp
}
func (chain *TestChain) InstantiateContract(codeID uint64, initMsg []byte) sdk.AccAddress {
@@ -78,11 +77,9 @@ func (chain *TestChain) InstantiateContract(codeID uint64, initMsg []byte) sdk.A
r, err := chain.SendMsgs(instantiateMsg)
require.NoError(chain.t, err)
- protoResult := chain.parseSDKResultData(r)
- require.Len(chain.t, protoResult.Data, 1)
-
- var pExecResp types.MsgInstantiateContractResponse
- require.NoError(chain.t, pExecResp.Unmarshal(protoResult.Data[0].Data))
+ require.Len(chain.t, r.MsgResponses, 1)
+ require.NotEmpty(chain.t, r.MsgResponses[0].GetCachedValue())
+ pExecResp := r.MsgResponses[0].GetCachedValue().(*types.MsgInstantiateContractResponse)
a, err := sdk.AccAddressFromBech32(pExecResp.Address)
require.NoError(chain.t, err)
return a
@@ -126,12 +123,6 @@ func (chain *TestChain) SmartQuery(contractAddr string, queryMsg interface{}, re
return json.Unmarshal(resp.Data, response)
}
-func (chain *TestChain) parseSDKResultData(r *sdk.Result) sdk.TxMsgData {
- var protoResult sdk.TxMsgData
- require.NoError(chain.t, proto.Unmarshal(r.Data, &protoResult))
- return protoResult
-}
-
// ContractInfo is a helper function to returns the ContractInfo for the given contract address
func (chain *TestChain) ContractInfo(contractAddr sdk.AccAddress) *types.ContractInfo {
return chain.App.WasmKeeper.GetContractInfo(chain.GetContext(), contractAddr)
diff --git a/x/wasm/keeper/addresses_test.go b/x/wasm/keeper/addresses_test.go
index fbcc607fc5..399c3e7b2d 100644
--- a/x/wasm/keeper/addresses_test.go
+++ b/x/wasm/keeper/addresses_test.go
@@ -5,9 +5,9 @@ import (
"fmt"
"testing"
+ tmbytes "github.com/cometbft/cometbft/libs/bytes"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/require"
- tmbytes "github.com/tendermint/tendermint/libs/bytes"
)
func TestBuildContractAddress(t *testing.T) {
diff --git a/x/wasm/keeper/ante.go b/x/wasm/keeper/ante.go
index 1ffd34befd..08dfdf64b4 100644
--- a/x/wasm/keeper/ante.go
+++ b/x/wasm/keeper/ante.go
@@ -3,6 +3,7 @@ package keeper
import (
"encoding/binary"
+ storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/CosmWasm/wasmd/x/wasm/types"
@@ -10,11 +11,11 @@ import (
// CountTXDecorator ante handler to count the tx position in a block.
type CountTXDecorator struct {
- storeKey sdk.StoreKey
+ storeKey storetypes.StoreKey
}
// NewCountTXDecorator constructor
-func NewCountTXDecorator(storeKey sdk.StoreKey) *CountTXDecorator {
+func NewCountTXDecorator(storeKey storetypes.StoreKey) *CountTXDecorator {
return &CountTXDecorator{storeKey: storeKey}
}
diff --git a/x/wasm/keeper/ante_test.go b/x/wasm/keeper/ante_test.go
index fa64b62fe3..5d51b7ce48 100644
--- a/x/wasm/keeper/ante_test.go
+++ b/x/wasm/keeper/ante_test.go
@@ -4,18 +4,16 @@ import (
"testing"
"time"
- abci "github.com/tendermint/tendermint/abci/types"
-
- "github.com/CosmWasm/wasmd/x/wasm/keeper"
-
+ dbm "github.com/cometbft/cometbft-db"
+ "github.com/cometbft/cometbft/libs/log"
+ tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/store"
+ storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- "github.com/tendermint/tendermint/libs/log"
- tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
- dbm "github.com/tendermint/tm-db"
+ "github.com/CosmWasm/wasmd/x/wasm/keeper"
"github.com/CosmWasm/wasmd/x/wasm/types"
)
@@ -23,7 +21,7 @@ func TestCountTxDecorator(t *testing.T) {
keyWasm := sdk.NewKVStoreKey(types.StoreKey)
db := dbm.NewMemDB()
ms := store.NewCommitMultiStore(db)
- ms.MountStoreWithDB(keyWasm, sdk.StoreTypeIAVL, db)
+ ms.MountStoreWithDB(keyWasm, storetypes.StoreTypeIAVL, db)
require.NoError(t, ms.LoadLatestVersion())
const myCurrentBlockHeight = 100
@@ -115,7 +113,7 @@ func TestCountTxDecorator(t *testing.T) {
func TestLimitSimulationGasDecorator(t *testing.T) {
var (
hundred sdk.Gas = 100
- zero sdk.Gas = 0
+ zero sdk.Gas
)
specs := map[string]struct {
customLimit *sdk.Gas
@@ -164,19 +162,19 @@ func TestLimitSimulationGasDecorator(t *testing.T) {
nextAnte := consumeGasAnteHandler(spec.consumeGas)
ctx := sdk.Context{}.
WithGasMeter(sdk.NewInfiniteGasMeter()).
- WithConsensusParams(&abci.ConsensusParams{
- Block: &abci.BlockParams{MaxGas: spec.maxBlockGas},
+ WithConsensusParams(&tmproto.ConsensusParams{
+ Block: &tmproto.BlockParams{MaxGas: spec.maxBlockGas},
})
// when
if spec.expErr != nil {
require.PanicsWithValue(t, spec.expErr, func() {
ante := keeper.NewLimitSimulationGasDecorator(spec.customLimit)
- ante.AnteHandle(ctx, nil, spec.simulation, nextAnte)
+ ante.AnteHandle(ctx, nil, spec.simulation, nextAnte) //nolint:errcheck
})
return
}
ante := keeper.NewLimitSimulationGasDecorator(spec.customLimit)
- ante.AnteHandle(ctx, nil, spec.simulation, nextAnte)
+ ante.AnteHandle(ctx, nil, spec.simulation, nextAnte) //nolint:errcheck
})
}
}
diff --git a/x/wasm/keeper/bench_test.go b/x/wasm/keeper/bench_test.go
index f32b39a0cb..ff0240afaf 100644
--- a/x/wasm/keeper/bench_test.go
+++ b/x/wasm/keeper/bench_test.go
@@ -4,9 +4,9 @@ import (
"os"
"testing"
+ dbm "github.com/cometbft/cometbft-db"
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
"github.com/stretchr/testify/require"
- dbm "github.com/tendermint/tm-db"
"github.com/CosmWasm/wasmd/x/wasm/types"
)
diff --git a/x/wasm/keeper/contract_keeper_test.go b/x/wasm/keeper/contract_keeper_test.go
index 0a8bd1e224..46ec4f6576 100644
--- a/x/wasm/keeper/contract_keeper_test.go
+++ b/x/wasm/keeper/contract_keeper_test.go
@@ -18,6 +18,8 @@ import (
func TestInstantiate2(t *testing.T) {
parentCtx, keepers := CreateTestInput(t, false, AvailableCapabilities)
+ parentCtx = parentCtx.WithGasMeter(sdk.NewInfiniteGasMeter())
+
example := StoreHackatomExampleContract(t, parentCtx, keepers)
otherExample := StoreReflectContract(t, parentCtx, keepers)
mock := &wasmtesting.MockWasmer{}
@@ -27,7 +29,6 @@ func TestInstantiate2(t *testing.T) {
verifierAddr := RandomAccountAddress(t)
beneficiaryAddr := RandomAccountAddress(t)
initMsg := mustMarshal(t, HackatomExampleInitMsg{Verifier: verifierAddr, Beneficiary: beneficiaryAddr})
-
otherAddr := keepers.Faucet.NewFundedRandomAccount(parentCtx, sdk.NewInt64Coin("denom", 1_000_000_000))
const (
diff --git a/x/wasm/keeper/events_test.go b/x/wasm/keeper/events_test.go
index d35c88ecf0..b305df4204 100644
--- a/x/wasm/keeper/events_test.go
+++ b/x/wasm/keeper/events_test.go
@@ -280,7 +280,7 @@ func hasWasmModuleEvent(ctx sdk.Context, contractAddr sdk.AccAddress) bool {
for _, e := range ctx.EventManager().Events() {
if e.Type == types.WasmModuleEventType {
for _, a := range e.Attributes {
- if string(a.Key) == types.AttributeKeyContractAddr && string(a.Value) == contractAddr.String() {
+ if a.Key == types.AttributeKeyContractAddr && a.Value == contractAddr.String() {
return true
}
}
diff --git a/x/wasm/keeper/gas_register_test.go b/x/wasm/keeper/gas_register_test.go
index 03f6cdd863..bf8dcd773d 100644
--- a/x/wasm/keeper/gas_register_test.go
+++ b/x/wasm/keeper/gas_register_test.go
@@ -84,12 +84,12 @@ func TestNewContractInstanceCosts(t *testing.T) {
"big msg - unpinned": {
srcLen: math.MaxUint32,
srcConfig: DefaultGasRegisterConfig(),
- exp: sdk.Gas(DefaultContractMessageDataCost*math.MaxUint32 + DefaultInstanceCost),
+ exp: DefaultContractMessageDataCost*math.MaxUint32 + DefaultInstanceCost,
},
"empty msg - unpinned": {
srcLen: 0,
srcConfig: DefaultGasRegisterConfig(),
- exp: sdk.Gas(DefaultInstanceCost),
+ exp: DefaultInstanceCost,
},
"negative len": {
@@ -131,7 +131,7 @@ func TestContractInstanceCosts(t *testing.T) {
srcLen: math.MaxUint32,
srcConfig: DefaultGasRegisterConfig(),
pinned: true,
- exp: sdk.Gas(DefaultContractMessageDataCost * math.MaxUint32),
+ exp: DefaultContractMessageDataCost * math.MaxUint32,
},
"empty msg - pinned": {
srcLen: 0,
@@ -147,12 +147,12 @@ func TestContractInstanceCosts(t *testing.T) {
"big msg - unpinned": {
srcLen: math.MaxUint32,
srcConfig: DefaultGasRegisterConfig(),
- exp: sdk.Gas(DefaultContractMessageDataCost*math.MaxUint32 + DefaultInstanceCost),
+ exp: DefaultContractMessageDataCost*math.MaxUint32 + DefaultInstanceCost,
},
"empty msg - unpinned": {
srcLen: 0,
srcConfig: DefaultGasRegisterConfig(),
- exp: sdk.Gas(DefaultInstanceCost),
+ exp: DefaultInstanceCost,
},
"negative len": {
@@ -196,7 +196,7 @@ func TestReplyCost(t *testing.T) {
},
srcConfig: DefaultGasRegisterConfig(),
pinned: true,
- exp: sdk.Gas(3*DefaultEventAttributeDataCost + DefaultPerAttributeCost + DefaultContractMessageDataCost), // 3 == len("foo")
+ exp: 3*DefaultEventAttributeDataCost + DefaultPerAttributeCost + DefaultContractMessageDataCost, // 3 == len("foo")
},
"subcall response with events - pinned": {
src: wasmvmtypes.Reply{
@@ -210,7 +210,7 @@ func TestReplyCost(t *testing.T) {
},
srcConfig: DefaultGasRegisterConfig(),
pinned: true,
- exp: sdk.Gas(3*DefaultEventAttributeDataCost + DefaultPerAttributeCost), // 3 == len("foo")
+ exp: 3*DefaultEventAttributeDataCost + DefaultPerAttributeCost, // 3 == len("foo")
},
"subcall response with events exceeds free tier- pinned": {
src: wasmvmtypes.Reply{
@@ -224,7 +224,7 @@ func TestReplyCost(t *testing.T) {
},
srcConfig: DefaultGasRegisterConfig(),
pinned: true,
- exp: sdk.Gas((3+6)*DefaultEventAttributeDataCost + DefaultPerAttributeCost), // 3 == len("foo"), 6 == len("myData")
+ exp: (3+6)*DefaultEventAttributeDataCost + DefaultPerAttributeCost, // 3 == len("foo"), 6 == len("myData")
},
"subcall response error - pinned": {
src: wasmvmtypes.Reply{
@@ -248,7 +248,7 @@ func TestReplyCost(t *testing.T) {
},
},
srcConfig: DefaultGasRegisterConfig(),
- exp: sdk.Gas(DefaultInstanceCost + 3*DefaultEventAttributeDataCost + DefaultPerAttributeCost + DefaultContractMessageDataCost),
+ exp: DefaultInstanceCost + 3*DefaultEventAttributeDataCost + DefaultPerAttributeCost + DefaultContractMessageDataCost,
},
"subcall response with events - unpinned": {
src: wasmvmtypes.Reply{
@@ -261,7 +261,7 @@ func TestReplyCost(t *testing.T) {
},
},
srcConfig: DefaultGasRegisterConfig(),
- exp: sdk.Gas(DefaultInstanceCost + 3*DefaultEventAttributeDataCost + DefaultPerAttributeCost),
+ exp: DefaultInstanceCost + 3*DefaultEventAttributeDataCost + DefaultPerAttributeCost,
},
"subcall response with events exceeds free tier- unpinned": {
src: wasmvmtypes.Reply{
@@ -274,7 +274,7 @@ func TestReplyCost(t *testing.T) {
},
},
srcConfig: DefaultGasRegisterConfig(),
- exp: sdk.Gas(DefaultInstanceCost + (3+6)*DefaultEventAttributeDataCost + DefaultPerAttributeCost), // 3 == len("foo"), 6 == len("myData")
+ exp: DefaultInstanceCost + (3+6)*DefaultEventAttributeDataCost + DefaultPerAttributeCost, // 3 == len("foo"), 6 == len("myData")
},
"subcall response error - unpinned": {
src: wasmvmtypes.Reply{
@@ -283,7 +283,7 @@ func TestReplyCost(t *testing.T) {
},
},
srcConfig: DefaultGasRegisterConfig(),
- exp: sdk.Gas(DefaultInstanceCost + 3*DefaultContractMessageDataCost),
+ exp: DefaultInstanceCost + 3*DefaultContractMessageDataCost,
},
"subcall response with empty events": {
src: wasmvmtypes.Reply{
diff --git a/x/wasm/keeper/genesis.go b/x/wasm/keeper/genesis.go
index 183c6f48ba..d40c8671ec 100644
--- a/x/wasm/keeper/genesis.go
+++ b/x/wasm/keeper/genesis.go
@@ -1,9 +1,9 @@
package keeper
import (
+ abci "github.com/cometbft/cometbft/abci/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
- abci "github.com/tendermint/tendermint/abci/types"
"github.com/CosmWasm/wasmd/x/wasm/types"
)
diff --git a/x/wasm/keeper/genesis_test.go b/x/wasm/keeper/genesis_test.go
index 063b2adc50..797a3a9277 100644
--- a/x/wasm/keeper/genesis_test.go
+++ b/x/wasm/keeper/genesis_test.go
@@ -9,24 +9,28 @@ import (
"testing"
"time"
+ abci "github.com/cometbft/cometbft/abci/types"
+
+ "github.com/cosmos/cosmos-sdk/baseapp"
+ storetypes "github.com/cosmos/cosmos-sdk/store/types"
+ "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
+
+ dbm "github.com/cometbft/cometbft-db"
+ "github.com/cometbft/cometbft/libs/log"
+ tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/store"
sdk "github.com/cosmos/cosmos-sdk/types"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
- distributionkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
- govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
fuzz "github.com/google/gofuzz"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- "github.com/tendermint/tendermint/libs/log"
- tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
- dbm "github.com/tendermint/tm-db"
+ "golang.org/x/exp/slices"
"github.com/CosmWasm/wasmd/x/wasm/types"
- wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types"
)
const firstCodeID = 1
@@ -34,6 +38,8 @@ const firstCodeID = 1
func TestGenesisExportImport(t *testing.T) {
wasmKeeper, srcCtx, srcStoreKeys := setupKeeper(t)
contractKeeper := NewGovPermissionKeeper(wasmKeeper)
+ var keysModel []string
+ var isValidFuzz bool
wasmCode, err := os.ReadFile("./testdata/hackatom.wasm")
require.NoError(t, err)
@@ -52,9 +58,14 @@ func TestGenesisExportImport(t *testing.T) {
pinned bool
contractExtension bool
)
+ f.Fuzz(&stateModels)
+ keysModel, isValidFuzz = isValidFuzzStateModels(t, keysModel, stateModels)
+ if !isValidFuzz {
+ continue
+ }
+
f.Fuzz(&codeInfo)
f.Fuzz(&contract)
- f.Fuzz(&stateModels)
f.NilChance(0).Fuzz(&history)
f.Fuzz(&pinned)
f.Fuzz(&contractExtension)
@@ -64,22 +75,26 @@ func TestGenesisExportImport(t *testing.T) {
codeID, _, err := contractKeeper.Create(srcCtx, creatorAddr, wasmCode, &codeInfo.InstantiateConfig)
require.NoError(t, err)
if pinned {
- contractKeeper.PinCode(srcCtx, codeID)
+ err = contractKeeper.PinCode(srcCtx, codeID)
+ require.NoError(t, err)
+
}
if contractExtension {
anyTime := time.Now().UTC()
- var nestedType govtypes.TextProposal
+ var nestedType v1beta1.TextProposal
f.NilChance(0).Fuzz(&nestedType)
- myExtension, err := govtypes.NewProposal(&nestedType, 1, anyTime, anyTime)
+ myExtension, err := v1beta1.NewProposal(&nestedType, 1, anyTime, anyTime)
+ require.NoError(t, err)
+ err = contract.SetExtension(&myExtension)
require.NoError(t, err)
- contract.SetExtension(&myExtension)
}
contract.CodeID = codeID
contractAddr := wasmKeeper.ClassicAddressGenerator()(srcCtx, codeID, nil)
wasmKeeper.storeContractInfo(srcCtx, contractAddr, &contract)
wasmKeeper.appendToContractHistory(srcCtx, contractAddr, history...)
- wasmKeeper.importContractState(srcCtx, contractAddr, stateModels)
+ err = wasmKeeper.importContractState(srcCtx, contractAddr, stateModels)
+ require.NoError(t, err)
}
var wasmParams types.Params
f.NilChance(0).Fuzz(&wasmParams)
@@ -104,7 +119,7 @@ func TestGenesisExportImport(t *testing.T) {
dstKeeper, dstCtx, dstStoreKeys := setupKeeper(t)
// reset contract code index in source DB for comparison with dest DB
- wasmKeeper.IterateContractInfo(srcCtx, func(address sdk.AccAddress, info wasmTypes.ContractInfo) bool {
+ wasmKeeper.IterateContractInfo(srcCtx, func(address sdk.AccAddress, info types.ContractInfo) bool {
creatorAddress := sdk.MustAccAddressFromBech32(info.Creator)
history := wasmKeeper.GetContractHistory(srcCtx, address)
@@ -114,10 +129,11 @@ func TestGenesisExportImport(t *testing.T) {
})
// re-import
- var importState wasmTypes.GenesisState
+ var importState types.GenesisState
err = dstKeeper.cdc.UnmarshalJSON(exportedGenesis, &importState)
require.NoError(t, err)
- InitGenesis(dstCtx, dstKeeper, importState)
+ _, err = InitGenesis(dstCtx, dstKeeper, importState)
+ require.NoError(t, err)
// compare whole DB
for j := range srcStoreKeys {
@@ -143,7 +159,7 @@ func TestGenesisInit(t *testing.T) {
wasmCode, err := os.ReadFile("./testdata/hackatom.wasm")
require.NoError(t, err)
- myCodeInfo := wasmTypes.CodeInfoFixture(wasmTypes.WithSHA256CodeHash(wasmCode))
+ myCodeInfo := types.CodeInfoFixture(types.WithSHA256CodeHash(wasmCode))
specs := map[string]struct {
src types.GenesisState
expSuccess bool
@@ -205,7 +221,7 @@ func TestGenesisInit(t *testing.T) {
"prevent code hash mismatch": {src: types.GenesisState{
Codes: []types.Code{{
CodeID: firstCodeID,
- CodeInfo: wasmTypes.CodeInfoFixture(func(i *wasmTypes.CodeInfo) { i.CodeHash = make([]byte, sha256.Size) }),
+ CodeInfo: types.CodeInfoFixture(func(i *types.CodeInfo) { i.CodeHash = make([]byte, sha256.Size) }),
CodeBytes: wasmCode,
}},
Params: types.DefaultParams(),
@@ -254,7 +270,7 @@ func TestGenesisInit(t *testing.T) {
Contracts: []types.Contract{
{
ContractAddress: BuildContractAddressClassic(1, 1).String(),
- ContractInfo: types.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, types.RandCreatedFields),
+ ContractInfo: types.ContractInfoFixture(func(c *types.ContractInfo) { c.CodeID = 1 }, types.RandCreatedFields),
ContractCodeHistory: []types.ContractCodeHistoryEntry{
{
Operation: types.ContractCodeHistoryOperationTypeMigrate,
@@ -283,7 +299,7 @@ func TestGenesisInit(t *testing.T) {
Contracts: []types.Contract{
{
ContractAddress: BuildContractAddressClassic(1, 1).String(),
- ContractInfo: types.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, types.RandCreatedFields),
+ ContractInfo: types.ContractInfoFixture(func(c *types.ContractInfo) { c.CodeID = 1 }, types.RandCreatedFields),
ContractCodeHistory: []types.ContractCodeHistoryEntry{
{
Operation: types.ContractCodeHistoryOperationTypeMigrate,
@@ -294,7 +310,7 @@ func TestGenesisInit(t *testing.T) {
},
}, {
ContractAddress: BuildContractAddressClassic(1, 2).String(),
- ContractInfo: types.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, types.RandCreatedFields),
+ ContractInfo: types.ContractInfoFixture(func(c *types.ContractInfo) { c.CodeID = 1 }, types.RandCreatedFields),
ContractCodeHistory: []types.ContractCodeHistoryEntry{
{
Operation: types.ContractCodeHistoryOperationTypeMigrate,
@@ -318,7 +334,7 @@ func TestGenesisInit(t *testing.T) {
Contracts: []types.Contract{
{
ContractAddress: BuildContractAddressClassic(1, 1).String(),
- ContractInfo: types.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, types.RandCreatedFields),
+ ContractInfo: types.ContractInfoFixture(func(c *types.ContractInfo) { c.CodeID = 1 }, types.RandCreatedFields),
ContractCodeHistory: []types.ContractCodeHistoryEntry{
{
Operation: types.ContractCodeHistoryOperationTypeMigrate,
@@ -342,7 +358,7 @@ func TestGenesisInit(t *testing.T) {
Contracts: []types.Contract{
{
ContractAddress: BuildContractAddressClassic(1, 1).String(),
- ContractInfo: types.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, types.RandCreatedFields),
+ ContractInfo: types.ContractInfoFixture(func(c *types.ContractInfo) { c.CodeID = 1 }, types.RandCreatedFields),
ContractCodeHistory: []types.ContractCodeHistoryEntry{
{
Operation: types.ContractCodeHistoryOperationTypeMigrate,
@@ -353,7 +369,7 @@ func TestGenesisInit(t *testing.T) {
},
}, {
ContractAddress: BuildContractAddressClassic(1, 1).String(),
- ContractInfo: types.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, types.RandCreatedFields),
+ ContractInfo: types.ContractInfoFixture(func(c *types.ContractInfo) { c.CodeID = 1 }, types.RandCreatedFields),
ContractCodeHistory: []types.ContractCodeHistoryEntry{
{
Operation: types.ContractCodeHistoryOperationTypeMigrate,
@@ -377,7 +393,7 @@ func TestGenesisInit(t *testing.T) {
Contracts: []types.Contract{
{
ContractAddress: BuildContractAddressClassic(1, 1).String(),
- ContractInfo: types.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, types.RandCreatedFields),
+ ContractInfo: types.ContractInfoFixture(func(c *types.ContractInfo) { c.CodeID = 1 }, types.RandCreatedFields),
ContractState: []types.Model{
{
Key: []byte{0x1},
@@ -433,7 +449,7 @@ func TestGenesisInit(t *testing.T) {
Contracts: []types.Contract{
{
ContractAddress: BuildContractAddressClassic(1, 1).String(),
- ContractInfo: types.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, types.RandCreatedFields),
+ ContractInfo: types.ContractInfoFixture(func(c *types.ContractInfo) { c.CodeID = 1 }, types.RandCreatedFields),
ContractCodeHistory: []types.ContractCodeHistoryEntry{
{
Operation: types.ContractCodeHistoryOperationTypeMigrate,
@@ -543,7 +559,7 @@ func TestImportContractWithCodeHistoryPreserved(t *testing.T) {
enc64 := base64.StdEncoding.EncodeToString
genesisStr := fmt.Sprintf(genesisTemplate, enc64(wasmCodeHash[:]), enc64(wasmCode))
- var importState wasmTypes.GenesisState
+ var importState types.GenesisState
err = keeper.cdc.UnmarshalJSON([]byte(genesisStr), &importState)
require.NoError(t, err)
require.NoError(t, importState.ValidateBasic(), genesisStr)
@@ -566,7 +582,7 @@ func TestImportContractWithCodeHistoryPreserved(t *testing.T) {
expCodeInfo := types.CodeInfo{
CodeHash: wasmCodeHash[:],
Creator: codeCreatorAddr,
- InstantiateConfig: wasmTypes.AccessConfig{
+ InstantiateConfig: types.AccessConfig{
Permission: types.AccessTypeOnlyAddress,
Address: codeCreatorAddr,
},
@@ -614,7 +630,7 @@ func TestImportContractWithCodeHistoryPreserved(t *testing.T) {
assert.Equal(t, uint64(3), keeper.PeekAutoIncrementID(ctx, types.KeyLastInstanceID))
}
-func setupKeeper(t *testing.T) (*Keeper, sdk.Context, []sdk.StoreKey) {
+func setupKeeper(t *testing.T) (*Keeper, sdk.Context, []storetypes.StoreKey) {
t.Helper()
tempDir, err := os.MkdirTemp("", "wasm")
require.NoError(t, err)
@@ -622,14 +638,14 @@ func setupKeeper(t *testing.T) (*Keeper, sdk.Context, []sdk.StoreKey) {
var (
keyParams = sdk.NewKVStoreKey(paramtypes.StoreKey)
tkeyParams = sdk.NewTransientStoreKey(paramtypes.TStoreKey)
- keyWasm = sdk.NewKVStoreKey(wasmTypes.StoreKey)
+ keyWasm = sdk.NewKVStoreKey(types.StoreKey)
)
db := dbm.NewMemDB()
ms := store.NewCommitMultiStore(db)
- ms.MountStoreWithDB(keyWasm, sdk.StoreTypeIAVL, db)
- ms.MountStoreWithDB(keyParams, sdk.StoreTypeIAVL, db)
- ms.MountStoreWithDB(tkeyParams, sdk.StoreTypeTransient, db)
+ ms.MountStoreWithDB(keyWasm, storetypes.StoreTypeIAVL, db)
+ ms.MountStoreWithDB(keyParams, storetypes.StoreTypeIAVL, db)
+ ms.MountStoreWithDB(tkeyParams, storetypes.StoreTypeTransient, db)
require.NoError(t, ms.LoadLatestVersion())
ctx := sdk.NewContext(ms, tmproto.Header{
@@ -641,22 +657,22 @@ func setupKeeper(t *testing.T) (*Keeper, sdk.Context, []sdk.StoreKey) {
// register an example extension. must be protobuf
encodingConfig.InterfaceRegistry.RegisterImplementations(
(*types.ContractInfoExtension)(nil),
- &govtypes.Proposal{},
+ &v1beta1.Proposal{},
)
// also registering gov interfaces for nested Any type
- govtypes.RegisterInterfaces(encodingConfig.InterfaceRegistry)
+ v1beta1.RegisterInterfaces(encodingConfig.InterfaceRegistry)
- wasmConfig := wasmTypes.DefaultWasmConfig()
+ wasmConfig := types.DefaultWasmConfig()
pk := paramskeeper.NewKeeper(encodingConfig.Marshaler, encodingConfig.Amino, keyParams, tkeyParams)
srcKeeper := NewKeeper(
encodingConfig.Marshaler,
keyWasm,
- pk.Subspace(wasmTypes.ModuleName),
+ pk.Subspace(types.ModuleName),
authkeeper.AccountKeeper{},
&bankkeeper.BaseKeeper{},
stakingkeeper.Keeper{},
- distributionkeeper.Keeper{},
+ nil,
nil,
nil,
nil,
@@ -667,5 +683,56 @@ func setupKeeper(t *testing.T) (*Keeper, sdk.Context, []sdk.StoreKey) {
wasmConfig,
AvailableCapabilities,
)
- return &srcKeeper, ctx, []sdk.StoreKey{keyWasm, keyParams}
+ return &srcKeeper, ctx, []storetypes.StoreKey{keyWasm, keyParams}
+}
+
+// isValidFuzzStateModels: check if the keysModel is contain the key of model
+func isValidFuzzStateModels(t *testing.T, keysModel []string, stateModels []types.Model) ([]string, bool) { //nolint:unparam
+ tmpKeysModel := keysModel
+ isContainKey := false
+ for _, model := range stateModels {
+ if slices.Contains(keysModel, model.Key.String()) {
+ isContainKey = true
+ break
+ } else {
+ keysModel = append(keysModel, model.Key.String())
+ }
+ }
+ if isContainKey {
+ return tmpKeysModel, false
+ }
+ return keysModel, true
+}
+
+type StakingKeeperMock struct {
+ err error
+ validatorUpdate []abci.ValidatorUpdate
+ expCalls int //nolint:unused
+ gotCalls int
+}
+
+func (s *StakingKeeperMock) ApplyAndReturnValidatorSetUpdates(_ sdk.Context) ([]abci.ValidatorUpdate, error) {
+ s.gotCalls++
+ return s.validatorUpdate, s.err
+}
+
+var _ MessageRouter = &MockMsgHandler{}
+
+type MockMsgHandler struct {
+ result *sdk.Result
+ err error
+ expCalls int //nolint:unused
+ gotCalls int
+ expMsg sdk.Msg //nolint:unused
+ gotMsg sdk.Msg
+}
+
+func (m *MockMsgHandler) Handler(msg sdk.Msg) baseapp.MsgServiceHandler {
+ return m.Handle
+}
+
+func (m *MockMsgHandler) Handle(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {
+ m.gotCalls++
+ m.gotMsg = msg
+ return m.result, m.err
}
diff --git a/x/wasm/keeper/handler_plugin.go b/x/wasm/keeper/handler_plugin.go
index 82c9dbdf47..cd0fa58067 100644
--- a/x/wasm/keeper/handler_plugin.go
+++ b/x/wasm/keeper/handler_plugin.go
@@ -9,8 +9,8 @@ import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
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"
- host "github.com/cosmos/ibc-go/v4/modules/core/24-host"
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
+ host "github.com/cosmos/ibc-go/v7/modules/core/24-host"
"github.com/CosmWasm/wasmd/x/wasm/types"
)
@@ -163,32 +163,13 @@ func (h IBCRawPacketHandler) DispatchMsg(ctx sdk.Context, _ sdk.AccAddress, cont
return nil, nil, sdkerrors.Wrapf(types.ErrEmpty, "ibc channel")
}
- sequence, found := h.channelKeeper.GetNextSequenceSend(ctx, contractIBCPortID, contractIBCChannelID)
- if !found {
- return nil, nil, sdkerrors.Wrapf(channeltypes.ErrSequenceSendNotFound,
- "source port: %s, source channel: %s", contractIBCPortID, contractIBCChannelID,
- )
- }
-
- channelInfo, ok := h.channelKeeper.GetChannel(ctx, contractIBCPortID, contractIBCChannelID)
- if !ok {
- return nil, nil, sdkerrors.Wrap(channeltypes.ErrInvalidChannel, "not found")
- }
channelCap, ok := h.capabilityKeeper.GetCapability(ctx, host.ChannelCapabilityPath(contractIBCPortID, contractIBCChannelID))
if !ok {
return nil, nil, sdkerrors.Wrap(channeltypes.ErrChannelCapabilityNotFound, "module does not own channel capability")
}
- packet := channeltypes.NewPacket(
- msg.IBC.SendPacket.Data,
- sequence,
- contractIBCPortID,
- contractIBCChannelID,
- channelInfo.Counterparty.PortId,
- channelInfo.Counterparty.ChannelId,
- ConvertWasmIBCTimeoutHeightToCosmosHeight(msg.IBC.SendPacket.Timeout.Block),
- msg.IBC.SendPacket.Timeout.Timestamp,
- )
- return nil, nil, h.channelKeeper.SendPacket(ctx, channelCap, packet)
+ seq, err := h.channelKeeper.SendPacket(ctx, channelCap, contractIBCPortID, contractIBCChannelID, ConvertWasmIBCTimeoutHeightToCosmosHeight(msg.IBC.SendPacket.Timeout.Block), msg.IBC.SendPacket.Timeout.Timestamp, msg.IBC.SendPacket.Data)
+ moduleLogger(ctx).Debug("ibc packet set", "seq", seq)
+ return nil, nil, err
}
var _ Messenger = MessageHandlerFunc(nil)
diff --git a/x/wasm/keeper/handler_plugin_encoders.go b/x/wasm/keeper/handler_plugin_encoders.go
index d41d8f1012..f18b988b53 100644
--- a/x/wasm/keeper/handler_plugin_encoders.go
+++ b/x/wasm/keeper/handler_plugin_encoders.go
@@ -4,17 +4,18 @@ import (
"encoding/json"
"fmt"
+ v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
+
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
- govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
- ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
- ibcclienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"
- channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"
+ ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
+ ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
"github.com/CosmWasm/wasmd/x/wasm/types"
)
@@ -318,10 +319,10 @@ func EncodeGovMsg(sender sdk.AccAddress, msg *wasmvmtypes.GovMsg) ([]sdk.Msg, er
if err != nil {
return nil, sdkerrors.Wrap(err, "vote option")
}
- m := govtypes.NewMsgVote(sender, msg.Vote.ProposalId, voteOption)
+ m := v1.NewMsgVote(sender, msg.Vote.ProposalId, voteOption, "")
return []sdk.Msg{m}, nil
case msg.VoteWeighted != nil:
- opts := make([]govtypes.WeightedVoteOption, len(msg.VoteWeighted.Options))
+ opts := make([]*v1.WeightedVoteOption, len(msg.VoteWeighted.Options))
for i, v := range msg.VoteWeighted.Options {
weight, err := sdk.NewDecFromStr(v.Weight)
if err != nil {
@@ -331,9 +332,9 @@ func EncodeGovMsg(sender sdk.AccAddress, msg *wasmvmtypes.GovMsg) ([]sdk.Msg, er
if err != nil {
return nil, sdkerrors.Wrap(err, "vote option")
}
- opts[i] = govtypes.WeightedVoteOption{Option: voteOption, Weight: weight}
+ opts[i] = &v1.WeightedVoteOption{Option: voteOption, Weight: weight.String()}
}
- m := govtypes.NewMsgVoteWeighted(sender, msg.VoteWeighted.ProposalId, opts)
+ m := v1.NewMsgVoteWeighted(sender, msg.VoteWeighted.ProposalId, opts, "")
return []sdk.Msg{m}, nil
default:
@@ -341,19 +342,19 @@ func EncodeGovMsg(sender sdk.AccAddress, msg *wasmvmtypes.GovMsg) ([]sdk.Msg, er
}
}
-func convertVoteOption(s interface{}) (govtypes.VoteOption, error) {
- var option govtypes.VoteOption
+func convertVoteOption(s interface{}) (v1.VoteOption, error) {
+ var option v1.VoteOption
switch s {
case wasmvmtypes.Yes:
- option = govtypes.OptionYes
+ option = v1.OptionYes
case wasmvmtypes.No:
- option = govtypes.OptionNo
+ option = v1.OptionNo
case wasmvmtypes.NoWithVeto:
- option = govtypes.OptionNoWithVeto
+ option = v1.OptionNoWithVeto
case wasmvmtypes.Abstain:
- option = govtypes.OptionAbstain
+ option = v1.OptionAbstain
default:
- return govtypes.OptionEmpty, types.ErrInvalid
+ return v1.OptionEmpty, types.ErrInvalid
}
return option, nil
}
diff --git a/x/wasm/keeper/handler_plugin_encoders_test.go b/x/wasm/keeper/handler_plugin_encoders_test.go
index 60b66fbc0d..abbec25540 100644
--- a/x/wasm/keeper/handler_plugin_encoders_test.go
+++ b/x/wasm/keeper/handler_plugin_encoders_test.go
@@ -3,19 +3,19 @@ package keeper
import (
"testing"
- codectypes "github.com/cosmos/cosmos-sdk/codec/types"
- govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
- ibctransfertypes "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"
- "github.com/golang/protobuf/proto"
- "github.com/stretchr/testify/assert"
-
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
+ codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
+ v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
+ "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
+ ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
+ clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
+ "github.com/golang/protobuf/proto" //nolint:staticcheck // SA1019: proto is deprecated
+ "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/CosmWasm/wasmd/x/wasm/keeper/wasmtesting"
@@ -50,7 +50,7 @@ func TestEncoding(t *testing.T) {
content, err := codectypes.NewAnyWithValue(types.StoreCodeProposalFixture())
require.NoError(t, err)
- proposalMsg := &govtypes.MsgSubmitProposal{
+ proposalMsg := &v1beta1.MsgSubmitProposal{
Proposer: addr1.String(),
InitialDeposit: sdk.NewCoins(sdk.NewInt64Coin("uatom", 12345)),
Content: content,
@@ -303,7 +303,8 @@ func TestEncoding(t *testing.T) {
},
},
},
- expError: false, // fails in the handler
+ expError: false, // fails in the handler
+ expInvalid: true,
output: []sdk.Msg{
&stakingtypes.MsgDelegate{
DelegatorAddress: addr1.String(),
@@ -542,10 +543,10 @@ func TestEncoding(t *testing.T) {
if tc.expError {
assert.Error(t, err)
return
- } else {
- require.NoError(t, err)
- assert.Equal(t, tc.output, res)
}
+ require.NoError(t, err)
+ assert.Equal(t, tc.output, res)
+
// and valid sdk message
for _, v := range res {
gotErr := v.ValidateBasic()
@@ -581,10 +582,10 @@ func TestEncodeGovMsg(t *testing.T) {
},
},
output: []sdk.Msg{
- &govtypes.MsgVote{
+ &v1.MsgVote{
ProposalId: 1,
Voter: myAddr.String(),
- Option: govtypes.OptionYes,
+ Option: v1.OptionYes,
},
},
},
@@ -596,10 +597,10 @@ func TestEncodeGovMsg(t *testing.T) {
},
},
output: []sdk.Msg{
- &govtypes.MsgVote{
+ &v1.MsgVote{
ProposalId: 1,
Voter: myAddr.String(),
- Option: govtypes.OptionNo,
+ Option: v1.OptionNo,
},
},
},
@@ -611,10 +612,10 @@ func TestEncodeGovMsg(t *testing.T) {
},
},
output: []sdk.Msg{
- &govtypes.MsgVote{
+ &v1.MsgVote{
ProposalId: 10,
Voter: myAddr.String(),
- Option: govtypes.OptionAbstain,
+ Option: v1.OptionAbstain,
},
},
},
@@ -626,10 +627,10 @@ func TestEncodeGovMsg(t *testing.T) {
},
},
output: []sdk.Msg{
- &govtypes.MsgVote{
+ &v1.MsgVote{
ProposalId: 1,
Voter: myAddr.String(),
- Option: govtypes.OptionNoWithVeto,
+ Option: v1.OptionNoWithVeto,
},
},
},
@@ -655,11 +656,11 @@ func TestEncodeGovMsg(t *testing.T) {
},
},
output: []sdk.Msg{
- &govtypes.MsgVoteWeighted{
+ &v1.MsgVoteWeighted{
ProposalId: 1,
Voter: myAddr.String(),
- Options: []govtypes.WeightedVoteOption{
- {Option: govtypes.OptionYes, Weight: sdk.NewDec(1)},
+ Options: []*v1.WeightedVoteOption{
+ {Option: v1.OptionYes, Weight: sdk.NewDec(1).String()},
},
},
},
@@ -680,14 +681,14 @@ func TestEncodeGovMsg(t *testing.T) {
},
},
output: []sdk.Msg{
- &govtypes.MsgVoteWeighted{
+ &v1.MsgVoteWeighted{
ProposalId: 1,
Voter: myAddr.String(),
- Options: []govtypes.WeightedVoteOption{
- {Option: govtypes.OptionYes, Weight: sdk.NewDecWithPrec(23, 2)},
- {Option: govtypes.OptionNo, Weight: sdk.NewDecWithPrec(24, 2)},
- {Option: govtypes.OptionAbstain, Weight: sdk.NewDecWithPrec(26, 2)},
- {Option: govtypes.OptionNoWithVeto, Weight: sdk.NewDecWithPrec(27, 2)},
+ Options: []*v1.WeightedVoteOption{
+ {Option: v1.OptionYes, Weight: sdk.NewDecWithPrec(23, 2).String()},
+ {Option: v1.OptionNo, Weight: sdk.NewDecWithPrec(24, 2).String()},
+ {Option: v1.OptionAbstain, Weight: sdk.NewDecWithPrec(26, 2).String()},
+ {Option: v1.OptionNoWithVeto, Weight: sdk.NewDecWithPrec(27, 2).String()},
},
},
},
@@ -706,12 +707,12 @@ func TestEncodeGovMsg(t *testing.T) {
},
},
output: []sdk.Msg{
- &govtypes.MsgVoteWeighted{
+ &v1.MsgVoteWeighted{
ProposalId: 1,
Voter: myAddr.String(),
- Options: []govtypes.WeightedVoteOption{
- {Option: govtypes.OptionYes, Weight: sdk.NewDecWithPrec(5, 1)},
- {Option: govtypes.OptionYes, Weight: sdk.NewDecWithPrec(5, 1)},
+ Options: []*v1.WeightedVoteOption{
+ {Option: v1.OptionYes, Weight: sdk.NewDecWithPrec(5, 1).String()},
+ {Option: v1.OptionYes, Weight: sdk.NewDecWithPrec(5, 1).String()},
},
},
},
@@ -731,12 +732,12 @@ func TestEncodeGovMsg(t *testing.T) {
},
},
output: []sdk.Msg{
- &govtypes.MsgVoteWeighted{
+ &v1.MsgVoteWeighted{
ProposalId: 1,
Voter: myAddr.String(),
- Options: []govtypes.WeightedVoteOption{
- {Option: govtypes.OptionYes, Weight: sdk.NewDecWithPrec(51, 2)},
- {Option: govtypes.OptionNo, Weight: sdk.NewDecWithPrec(5, 1)},
+ Options: []*v1.WeightedVoteOption{
+ {Option: v1.OptionYes, Weight: sdk.NewDecWithPrec(51, 2).String()},
+ {Option: v1.OptionNo, Weight: sdk.NewDecWithPrec(5, 1).String()},
},
},
},
@@ -756,12 +757,12 @@ func TestEncodeGovMsg(t *testing.T) {
},
},
output: []sdk.Msg{
- &govtypes.MsgVoteWeighted{
+ &v1.MsgVoteWeighted{
ProposalId: 1,
Voter: myAddr.String(),
- Options: []govtypes.WeightedVoteOption{
- {Option: govtypes.OptionYes, Weight: sdk.NewDecWithPrec(49, 2)},
- {Option: govtypes.OptionNo, Weight: sdk.NewDecWithPrec(5, 1)},
+ Options: []*v1.WeightedVoteOption{
+ {Option: v1.OptionYes, Weight: sdk.NewDecWithPrec(49, 2).String()},
+ {Option: v1.OptionNo, Weight: sdk.NewDecWithPrec(5, 1).String()},
},
},
},
@@ -777,9 +778,18 @@ func TestEncodeGovMsg(t *testing.T) {
if tc.expError {
assert.Error(t, gotEncErr)
return
- } else {
- require.NoError(t, gotEncErr)
- assert.Equal(t, tc.output, res)
+ }
+ require.NoError(t, gotEncErr)
+ assert.Equal(t, tc.output, res)
+
+ // and valid sdk message
+ for _, v := range res {
+ gotErr := v.ValidateBasic()
+ if tc.expInvalid {
+ assert.Error(t, gotErr)
+ } else {
+ assert.NoError(t, gotErr)
+ }
}
// and valid sdk message
for _, v := range res {
diff --git a/x/wasm/keeper/handler_plugin_test.go b/x/wasm/keeper/handler_plugin_test.go
index 2a41d8a997..ebf5ea9b4b 100644
--- a/x/wasm/keeper/handler_plugin_test.go
+++ b/x/wasm/keeper/handler_plugin_test.go
@@ -4,6 +4,8 @@ import (
"encoding/json"
"testing"
+ "github.com/cometbft/cometbft/libs/log"
+
wasmvm "github.com/CosmWasm/wasmvm"
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
"github.com/cosmos/cosmos-sdk/baseapp"
@@ -11,9 +13,8 @@ import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/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"
- ibcexported "github.com/cosmos/ibc-go/v4/modules/core/exported"
+ clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -223,14 +224,18 @@ func TestSDKMessageHandlerDispatch(t *testing.T) {
func TestIBCRawPacketHandler(t *testing.T) {
ibcPort := "contractsIBCPort"
- var ctx sdk.Context
+ ctx := sdk.Context{}.WithLogger(log.TestingLogger())
- var capturedPacket ibcexported.PacketI
+ type CapturedPacket struct {
+ sourcePort string
+ sourceChannel string
+ timeoutHeight clienttypes.Height
+ timeoutTimestamp uint64
+ data []byte
+ }
+ var capturedPacket *CapturedPacket
chanKeeper := &wasmtesting.MockChannelKeeper{
- GetNextSequenceSendFn: func(ctx sdk.Context, portID, channelID string) (uint64, bool) {
- return 1, true
- },
GetChannelFn: func(ctx sdk.Context, srcPort, srcChan string) (channeltypes.Channel, bool) {
return channeltypes.Channel{
Counterparty: channeltypes.NewCounterparty(
@@ -239,9 +244,15 @@ func TestIBCRawPacketHandler(t *testing.T) {
),
}, true
},
- SendPacketFn: func(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet ibcexported.PacketI) error {
- capturedPacket = packet
- return nil
+ SendPacketFn: func(ctx sdk.Context, channelCap *capabilitytypes.Capability, sourcePort string, sourceChannel string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, data []byte) (uint64, error) {
+ capturedPacket = &CapturedPacket{
+ sourcePort: sourcePort,
+ sourceChannel: sourceChannel,
+ timeoutHeight: timeoutHeight,
+ timeoutTimestamp: timeoutTimestamp,
+ data: data,
+ }
+ return 1, nil
},
}
capKeeper := &wasmtesting.MockCapabilityKeeper{
@@ -254,7 +265,7 @@ func TestIBCRawPacketHandler(t *testing.T) {
srcMsg wasmvmtypes.SendPacketMsg
chanKeeper types.ChannelKeeper
capKeeper types.CapabilityKeeper
- expPacketSent channeltypes.Packet
+ expPacketSent *CapturedPacket
expErr *sdkerrors.Error
}{
"all good": {
@@ -265,28 +276,12 @@ func TestIBCRawPacketHandler(t *testing.T) {
},
chanKeeper: chanKeeper,
capKeeper: capKeeper,
- expPacketSent: channeltypes.Packet{
- Sequence: 1,
- SourcePort: ibcPort,
- SourceChannel: "channel-1",
- DestinationPort: "other-port",
- DestinationChannel: "other-channel-1",
- Data: []byte("myData"),
- TimeoutHeight: clienttypes.Height{RevisionNumber: 1, RevisionHeight: 2},
- },
- },
- "sequence not found returns error": {
- srcMsg: wasmvmtypes.SendPacketMsg{
- ChannelID: "channel-1",
- Data: []byte("myData"),
- Timeout: wasmvmtypes.IBCTimeout{Block: &wasmvmtypes.IBCTimeoutBlock{Revision: 1, Height: 2}},
- },
- chanKeeper: &wasmtesting.MockChannelKeeper{
- GetNextSequenceSendFn: func(ctx sdk.Context, portID, channelID string) (uint64, bool) {
- return 0, false
- },
+ expPacketSent: &CapturedPacket{
+ sourcePort: ibcPort,
+ sourceChannel: "channel-1",
+ timeoutHeight: clienttypes.Height{RevisionNumber: 1, RevisionHeight: 2},
+ data: []byte("myData"),
},
- expErr: channeltypes.ErrSequenceSendNotFound,
},
"capability not found returns error": {
srcMsg: wasmvmtypes.SendPacketMsg{
@@ -400,7 +395,7 @@ func TestBurnCoinMessageHandlerIntegration(t *testing.T) {
// and total supply reduced by burned amount
after, err := keepers.BankKeeper.TotalSupply(sdk.WrapSDKContext(ctx), &banktypes.QueryTotalSupplyRequest{})
require.NoError(t, err)
- diff := before.Supply.Sub(after.Supply)
+ diff := before.Supply.Sub(after.Supply...)
assert.Equal(t, sdk.NewCoins(sdk.NewCoin("denom", sdk.NewInt(100))), diff)
})
}
diff --git a/x/wasm/keeper/ibc.go b/x/wasm/keeper/ibc.go
index 3857b5f272..a102b98053 100644
--- a/x/wasm/keeper/ibc.go
+++ b/x/wasm/keeper/ibc.go
@@ -6,7 +6,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
- host "github.com/cosmos/ibc-go/v4/modules/core/24-host"
+ host "github.com/cosmos/ibc-go/v7/modules/core/24-host"
"github.com/CosmWasm/wasmd/x/wasm/types"
)
diff --git a/x/wasm/keeper/keeper.go b/x/wasm/keeper/keeper.go
index 5615dd9f38..7e6eace837 100644
--- a/x/wasm/keeper/keeper.go
+++ b/x/wasm/keeper/keeper.go
@@ -12,8 +12,11 @@ import (
"strings"
"time"
+ storetypes "github.com/cosmos/cosmos-sdk/store/types"
+
wasmvm "github.com/CosmWasm/wasmvm"
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
+ "github.com/cometbft/cometbft/libs/log"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/store/prefix"
"github.com/cosmos/cosmos-sdk/telemetry"
@@ -22,7 +25,6 @@ import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
vestingexported "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
- "github.com/tendermint/tendermint/libs/log"
"github.com/CosmWasm/wasmd/x/wasm/ioutils"
"github.com/CosmWasm/wasmd/x/wasm/types"
@@ -84,7 +86,7 @@ var defaultAcceptedAccountTypes = map[reflect.Type]struct{}{
// Keeper will have a reference to Wasmer with it's own data directory.
type Keeper struct {
- storeKey sdk.StoreKey
+ storeKey storetypes.StoreKey
cdc codec.Codec
accountKeeper types.AccountKeeper
bank CoinTransferrer
@@ -974,7 +976,7 @@ func (k Keeper) runtimeGasForContract(ctx sdk.Context) uint64 {
if meter.IsOutOfGas() {
return 0
}
- if meter.Limit() == 0 { // infinite gas meter with limit=0 and not out of gas
+ if meter.Limit() == math.MaxUint64 { // infinite gas meter and not out of gas
return math.MaxUint64
}
return k.gasRegister.ToWasmVMGas(meter.Limit() - meter.GasConsumedToLimit())
@@ -1012,13 +1014,13 @@ func (k Keeper) PeekAutoIncrementID(ctx sdk.Context, lastIDKey []byte) uint64 {
return id
}
-func (k Keeper) importAutoIncrementID(ctx sdk.Context, lastIDKey []byte, val uint64) error {
+func (k Keeper) importAutoIncrementID(ctx sdk.Context, IDKey []byte, val uint64) error {
store := ctx.KVStore(k.storeKey)
- if store.Has(lastIDKey) {
- return sdkerrors.Wrapf(types.ErrDuplicate, "autoincrement id: %s", string(lastIDKey))
+ if store.Has(IDKey) {
+ return sdkerrors.Wrapf(types.ErrDuplicate, "autoincrement id: %s", string(IDKey))
}
bz := sdk.Uint64ToBigEndian(val)
- store.Set(lastIDKey, bz)
+ store.Set(IDKey, bz)
return nil
}
diff --git a/x/wasm/keeper/keeper_cgo.go b/x/wasm/keeper/keeper_cgo.go
index 06a0ccabe6..40a9830a05 100644
--- a/x/wasm/keeper/keeper_cgo.go
+++ b/x/wasm/keeper/keeper_cgo.go
@@ -5,9 +5,10 @@ package keeper
import (
"path/filepath"
+ storetypes "github.com/cosmos/cosmos-sdk/store/types"
+
wasmvm "github.com/CosmWasm/wasmvm"
"github.com/cosmos/cosmos-sdk/codec"
- sdk "github.com/cosmos/cosmos-sdk/types"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
"github.com/CosmWasm/wasmd/x/wasm/types"
@@ -17,7 +18,7 @@ import (
// If customEncoders is non-nil, we can use this to override some of the message handler, especially custom
func NewKeeper(
cdc codec.Codec,
- storeKey sdk.StoreKey,
+ storeKey storetypes.StoreKey,
paramSpace paramtypes.Subspace,
accountKeeper types.AccountKeeper,
bankKeeper types.BankKeeper,
diff --git a/x/wasm/keeper/keeper_no_cgo.go b/x/wasm/keeper/keeper_no_cgo.go
index 196b9ee1ee..1a8e658e5b 100644
--- a/x/wasm/keeper/keeper_no_cgo.go
+++ b/x/wasm/keeper/keeper_no_cgo.go
@@ -4,7 +4,7 @@ package keeper
import (
"github.com/cosmos/cosmos-sdk/codec"
- sdk "github.com/cosmos/cosmos-sdk/types"
+ storetypes "github.com/cosmos/cosmos-sdk/store/types"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
"github.com/CosmWasm/wasmd/x/wasm/types"
@@ -14,7 +14,7 @@ import (
// If customEncoders is non-nil, we can use this to override some of the message handler, especially custom
func NewKeeper(
cdc codec.Codec,
- storeKey sdk.StoreKey,
+ storeKey storetypes.StoreKey,
paramSpace paramtypes.Subspace,
accountKeeper types.AccountKeeper,
bankKeeper types.BankKeeper,
diff --git a/x/wasm/keeper/keeper_test.go b/x/wasm/keeper/keeper_test.go
index bee350b3c1..282a2b3b56 100644
--- a/x/wasm/keeper/keeper_test.go
+++ b/x/wasm/keeper/keeper_test.go
@@ -11,10 +11,12 @@ import (
"testing"
"time"
- abci "github.com/tendermint/tendermint/abci/types"
+ abci "github.com/cometbft/cometbft/abci/types"
wasmvm "github.com/CosmWasm/wasmvm"
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
+ "github.com/cometbft/cometbft/libs/rand"
+ tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
stypes "github.com/cosmos/cosmos-sdk/store/types"
@@ -29,8 +31,6 @@ import (
fuzz "github.com/google/gofuzz"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- "github.com/tendermint/tendermint/libs/rand"
- tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"github.com/CosmWasm/wasmd/x/wasm/keeper/wasmtesting"
"github.com/CosmWasm/wasmd/x/wasm/types"
@@ -412,7 +412,7 @@ func TestInstantiate(t *testing.T) {
gasAfter := ctx.GasMeter().GasConsumed()
if types.EnableGasVerification {
- require.Equal(t, uint64(0x1a7b6), gasAfter-gasBefore)
+ require.Equal(t, uint64(0x1b5bc), gasAfter-gasBefore)
}
// ensure it is stored properly
@@ -838,7 +838,7 @@ func TestExecute(t *testing.T) {
// unauthorized - trialCtx so we don't change state
trialCtx := ctx.WithMultiStore(ctx.MultiStore().CacheWrap().(sdk.MultiStore))
- res, err := keepers.ContractKeeper.Execute(trialCtx, addr, creator, []byte(`{"release":{}}`), nil)
+ _, err = keepers.ContractKeeper.Execute(trialCtx, addr, creator, []byte(`{"release":{}}`), nil)
require.Error(t, err)
require.True(t, errors.Is(err, types.ErrExecuteFailed))
require.Equal(t, "Unauthorized: execute wasm contract failed", err.Error())
@@ -848,15 +848,15 @@ func TestExecute(t *testing.T) {
gasBefore := ctx.GasMeter().GasConsumed()
em := sdk.NewEventManager()
// when
- res, err = keepers.ContractKeeper.Execute(ctx.WithEventManager(em), addr, fred, []byte(`{"release":{}}`), topUp)
- diff := time.Now().Sub(start)
+ res, err := keepers.ContractKeeper.Execute(ctx.WithEventManager(em), addr, fred, []byte(`{"release":{}}`), topUp)
+ diff := time.Since(start)
require.NoError(t, err)
require.NotNil(t, res)
// make sure gas is properly deducted from ctx
gasAfter := ctx.GasMeter().GasConsumed()
if types.EnableGasVerification {
- require.Equal(t, uint64(0x17d7f), gasAfter-gasBefore)
+ require.Equal(t, uint64(0x1a154), gasAfter-gasBefore)
}
// ensure bob now exists and got both payments released
bobAcct = accKeeper.GetAccount(ctx, bob)
@@ -938,7 +938,8 @@ func TestExecuteWithDeposit(t *testing.T) {
ctx, keepers := CreateTestInput(t, false, AvailableCapabilities)
accKeeper, bankKeeper, keeper := keepers.AccountKeeper, keepers.BankKeeper, keepers.ContractKeeper
if spec.newBankParams != nil {
- bankKeeper.SetParams(ctx, *spec.newBankParams)
+ err := bankKeeper.SetParams(ctx, *spec.newBankParams)
+ require.NoError(t, err)
}
if spec.fundAddr {
fundAccounts(t, ctx, accKeeper, bankKeeper, spec.srcActor, sdk.NewCoins(sdk.NewInt64Coin("denom", 200)))
@@ -1053,6 +1054,7 @@ func TestExecuteWithCpuLoop(t *testing.T) {
// this should throw out of gas exception (panic)
_, err = keepers.ContractKeeper.Execute(ctx, addr, fred, []byte(`{"cpu_loop":{}}`), nil)
+ require.Error(t, err)
require.True(t, false, "We must panic before this line")
}
@@ -1095,6 +1097,7 @@ func TestExecuteWithStorageLoop(t *testing.T) {
// this should throw out of gas exception (panic)
_, err = keepers.ContractKeeper.Execute(ctx, addr, fred, []byte(`{"storage_loop":{}}`), nil)
+ require.Error(t, err)
require.True(t, false, "We must panic before this line")
}
@@ -1572,7 +1575,7 @@ func prettyEvents(t *testing.T, events sdk.Events) string {
for i, e := range events {
attr := make([]map[string]string, len(e.Attributes))
for j, a := range e.Attributes {
- attr[j] = map[string]string{string(a.Key): string(a.Value)}
+ attr[j] = map[string]string{a.Key: a.Value}
}
r[i] = prettyEvent{Type: e.Type, Attr: attr}
}
@@ -2277,8 +2280,9 @@ func TestIteratorContractByCreator(t *testing.T) {
mockAddress3 := keepers.Faucet.NewFundedRandomAccount(parentCtx, topUp...)
contract1ID, _, err := keeper.Create(parentCtx, creator, hackatomWasm, nil)
- contract2ID, _, err := keeper.Create(parentCtx, creator, hackatomWasm, nil)
+ require.NoError(t, err)
+ contract2ID, _, err := keeper.Create(parentCtx, creator, hackatomWasm, nil)
require.NoError(t, err)
initMsgBz := HackatomExampleInitMsg{
@@ -2404,7 +2408,7 @@ func TestSetContractAdmin(t *testing.T) {
func attrsToStringMap(attrs []abci.EventAttribute) map[string]string {
r := make(map[string]string, len(attrs))
for _, v := range attrs {
- r[string(v.Key)] = string(v.Value)
+ r[v.Key] = v.Value
}
return r
}
diff --git a/x/wasm/keeper/legacy_querier.go b/x/wasm/keeper/legacy_querier.go
deleted file mode 100644
index 8ff72e1f81..0000000000
--- a/x/wasm/keeper/legacy_querier.go
+++ /dev/null
@@ -1,154 +0,0 @@
-package keeper
-
-import (
- "encoding/json"
- "reflect"
- "strconv"
-
- sdk "github.com/cosmos/cosmos-sdk/types"
- sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
- abci "github.com/tendermint/tendermint/abci/types"
-
- "github.com/CosmWasm/wasmd/x/wasm/types"
-)
-
-const (
- QueryListContractByCode = "list-contracts-by-code"
- QueryGetContract = "contract-info"
- QueryGetContractState = "contract-state"
- QueryGetCode = "code"
- QueryListCode = "list-code"
- QueryContractHistory = "contract-history"
-)
-
-const (
- QueryMethodContractStateSmart = "smart"
- QueryMethodContractStateAll = "all"
- QueryMethodContractStateRaw = "raw"
-)
-
-// NewLegacyQuerier creates a new querier
-// Deprecated: the rest support will be removed. You can use the GRPC gateway instead
-func NewLegacyQuerier(keeper types.ViewKeeper, gasLimit sdk.Gas) sdk.Querier {
- return func(ctx sdk.Context, path []string, req abci.RequestQuery) ([]byte, error) {
- var (
- rsp interface{}
- err error
- )
- switch path[0] {
- case QueryGetContract:
- addr, addrErr := sdk.AccAddressFromBech32(path[1])
- if addrErr != nil {
- return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, addrErr.Error())
- }
- rsp, err = queryContractInfo(ctx, addr, keeper)
- case QueryListContractByCode:
- codeID, parseErr := strconv.ParseUint(path[1], 10, 64)
- if parseErr != nil {
- return nil, sdkerrors.Wrapf(types.ErrInvalid, "code id: %s", parseErr.Error())
- }
- rsp = queryContractListByCode(ctx, codeID, keeper)
- case QueryGetContractState:
- if len(path) < 3 {
- return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "unknown data query endpoint")
- }
- return queryContractState(ctx, path[1], path[2], req.Data, gasLimit, keeper)
- case QueryGetCode:
- codeID, parseErr := strconv.ParseUint(path[1], 10, 64)
- if parseErr != nil {
- return nil, sdkerrors.Wrapf(types.ErrInvalid, "code id: %s", parseErr.Error())
- }
- rsp, err = queryCode(ctx, codeID, keeper)
- case QueryListCode:
- rsp, err = queryCodeList(ctx, keeper)
- case QueryContractHistory:
- contractAddr, addrErr := sdk.AccAddressFromBech32(path[1])
- if addrErr != nil {
- return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, addrErr.Error())
- }
- rsp, err = queryContractHistory(ctx, contractAddr, keeper)
- default:
- return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "unknown data query endpoint")
- }
- if err != nil {
- return nil, err
- }
- if rsp == nil || reflect.ValueOf(rsp).IsNil() {
- return nil, nil
- }
- bz, err := json.MarshalIndent(rsp, "", " ")
- if err != nil {
- return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())
- }
- return bz, nil
- }
-}
-
-func queryContractState(ctx sdk.Context, bech, queryMethod string, data []byte, gasLimit sdk.Gas, keeper types.ViewKeeper) (json.RawMessage, error) {
- contractAddr, err := sdk.AccAddressFromBech32(bech)
- if err != nil {
- return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, bech)
- }
-
- switch queryMethod {
- case QueryMethodContractStateAll:
- resultData := make([]types.Model, 0)
- // this returns a serialized json object (which internally encoded binary fields properly)
- keeper.IterateContractState(ctx, contractAddr, func(key, value []byte) bool {
- resultData = append(resultData, types.Model{Key: key, Value: value})
- return false
- })
- bz, err := json.Marshal(resultData)
- if err != nil {
- return nil, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())
- }
- return bz, nil
- case QueryMethodContractStateRaw:
- // this returns the raw data from the state, base64-encoded
- return keeper.QueryRaw(ctx, contractAddr, data), nil
- case QueryMethodContractStateSmart:
- // we enforce a subjective gas limit on all queries to avoid infinite loops
- ctx = ctx.WithGasMeter(sdk.NewGasMeter(gasLimit))
- msg := types.RawContractMessage(data)
- if err := msg.ValidateBasic(); err != nil {
- return nil, sdkerrors.Wrap(err, "json msg")
- }
- // this returns raw bytes (must be base64-encoded)
- bz, err := keeper.QuerySmart(ctx, contractAddr, msg)
- return bz, err
- default:
- return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, queryMethod)
- }
-}
-
-func queryCodeList(ctx sdk.Context, keeper types.ViewKeeper) ([]types.CodeInfoResponse, error) {
- var info []types.CodeInfoResponse
- keeper.IterateCodeInfos(ctx, func(i uint64, res types.CodeInfo) bool {
- info = append(info, types.CodeInfoResponse{
- CodeID: i,
- Creator: res.Creator,
- DataHash: res.CodeHash,
- InstantiatePermission: res.InstantiateConfig,
- })
- return false
- })
- return info, nil
-}
-
-func queryContractHistory(ctx sdk.Context, contractAddr sdk.AccAddress, keeper types.ViewKeeper) ([]types.ContractCodeHistoryEntry, error) {
- history := keeper.GetContractHistory(ctx, contractAddr)
- // redact response
- for i := range history {
- history[i].Updated = nil
- }
- return history, nil
-}
-
-func queryContractListByCode(ctx sdk.Context, codeID uint64, keeper types.ViewKeeper) []string {
- var contracts []string
- keeper.IterateContractsByCode(ctx, codeID, func(addr sdk.AccAddress) bool {
- contracts = append(contracts, addr.String())
- return false
- })
- return contracts
-}
diff --git a/x/wasm/keeper/legacy_querier_test.go b/x/wasm/keeper/legacy_querier_test.go
deleted file mode 100644
index 1b6006fa30..0000000000
--- a/x/wasm/keeper/legacy_querier_test.go
+++ /dev/null
@@ -1,364 +0,0 @@
-package keeper
-
-import (
- "bytes"
- "encoding/json"
- "errors"
- "fmt"
- "os"
- "testing"
-
- sdk "github.com/cosmos/cosmos-sdk/types"
- "github.com/stretchr/testify/assert"
- "github.com/stretchr/testify/require"
- abci "github.com/tendermint/tendermint/abci/types"
-
- "github.com/CosmWasm/wasmd/x/wasm/types"
-)
-
-func TestLegacyQueryContractState(t *testing.T) {
- ctx, keepers := CreateTestInput(t, false, AvailableCapabilities)
- keeper := keepers.WasmKeeper
-
- deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000))
- creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit.Add(deposit...)...)
- anyAddr := keepers.Faucet.NewFundedRandomAccount(ctx, sdk.NewInt64Coin("denom", 5000))
-
- wasmCode, err := os.ReadFile("./testdata/hackatom.wasm")
- require.NoError(t, err)
-
- contractID, _, err := keepers.ContractKeeper.Create(ctx, creator, wasmCode, nil)
- require.NoError(t, err)
-
- _, _, bob := keyPubAddr()
- initMsg := HackatomExampleInitMsg{
- Verifier: anyAddr,
- Beneficiary: bob,
- }
- initMsgBz, err := json.Marshal(initMsg)
- require.NoError(t, err)
-
- addr, _, err := keepers.ContractKeeper.Instantiate(ctx, contractID, creator, nil, initMsgBz, "demo contract to query", deposit)
- require.NoError(t, err)
-
- contractModel := []types.Model{
- {Key: []byte("foo"), Value: []byte(`"bar"`)},
- {Key: []byte{0x0, 0x1}, Value: []byte(`{"count":8}`)},
- }
- keeper.importContractState(ctx, addr, contractModel)
-
- // this gets us full error, not redacted sdk.Error
- var defaultQueryGasLimit sdk.Gas = 3000000
- q := NewLegacyQuerier(keeper, defaultQueryGasLimit)
-
- specs := map[string]struct {
- srcPath []string
- srcReq abci.RequestQuery
- // smart and raw queries (not all queries) return raw bytes from contract not []types.Model
- // if this is set, then we just compare - (should be json encoded string)
- expRes []byte
- // if success and expSmartRes is not set, we parse into []types.Model and compare (all state)
- expModelLen int
- expModelContains []types.Model
- expErr error
- }{
- "query all": {
- srcPath: []string{QueryGetContractState, addr.String(), QueryMethodContractStateAll},
- expModelLen: 3,
- expModelContains: []types.Model{
- {Key: []byte("foo"), Value: []byte(`"bar"`)},
- {Key: []byte{0x0, 0x1}, Value: []byte(`{"count":8}`)},
- },
- },
- "query raw key": {
- srcPath: []string{QueryGetContractState, addr.String(), QueryMethodContractStateRaw},
- srcReq: abci.RequestQuery{Data: []byte("foo")},
- expRes: []byte(`"bar"`),
- },
- "query raw binary key": {
- srcPath: []string{QueryGetContractState, addr.String(), QueryMethodContractStateRaw},
- srcReq: abci.RequestQuery{Data: []byte{0x0, 0x1}},
- expRes: []byte(`{"count":8}`),
- },
- "query smart": {
- srcPath: []string{QueryGetContractState, addr.String(), QueryMethodContractStateSmart},
- srcReq: abci.RequestQuery{Data: []byte(`{"verifier":{}}`)},
- expRes: []byte(fmt.Sprintf(`{"verifier":"%s"}`, anyAddr.String())),
- },
- "query smart invalid request": {
- srcPath: []string{QueryGetContractState, addr.String(), QueryMethodContractStateSmart},
- srcReq: abci.RequestQuery{Data: []byte(`{"raw":{"key":"config"}}`)},
- expErr: types.ErrQueryFailed,
- },
- "query smart with invalid json": {
- srcPath: []string{QueryGetContractState, addr.String(), QueryMethodContractStateSmart},
- srcReq: abci.RequestQuery{Data: []byte(`not a json string`)},
- expErr: types.ErrInvalid,
- },
- "query non-existent raw key": {
- srcPath: []string{QueryGetContractState, addr.String(), QueryMethodContractStateRaw},
- srcReq: abci.RequestQuery{Data: []byte("i do not exist")},
- expRes: nil,
- },
- "query empty raw key": {
- srcPath: []string{QueryGetContractState, addr.String(), QueryMethodContractStateRaw},
- srcReq: abci.RequestQuery{Data: []byte("")},
- expRes: nil,
- },
- "query nil raw key": {
- srcPath: []string{QueryGetContractState, addr.String(), QueryMethodContractStateRaw},
- srcReq: abci.RequestQuery{Data: nil},
- expRes: nil,
- },
- "query raw with unknown address": {
- srcPath: []string{QueryGetContractState, anyAddr.String(), QueryMethodContractStateRaw},
- expRes: nil,
- },
- "query all with unknown address": {
- srcPath: []string{QueryGetContractState, anyAddr.String(), QueryMethodContractStateAll},
- expModelLen: 0,
- },
- "query smart with unknown address": {
- srcPath: []string{QueryGetContractState, anyAddr.String(), QueryMethodContractStateSmart},
- srcReq: abci.RequestQuery{Data: []byte(`{}`)},
- expModelLen: 0,
- expErr: types.ErrNotFound,
- },
- }
-
- for msg, spec := range specs {
- t.Run(msg, func(t *testing.T) {
- binResult, err := q(ctx, spec.srcPath, spec.srcReq)
- // require.True(t, spec.expErr.Is(err), "unexpected error")
- require.True(t, errors.Is(err, spec.expErr), err)
-
- // if smart query, check custom response
- if spec.srcPath[2] != QueryMethodContractStateAll {
- require.Equal(t, spec.expRes, binResult)
- return
- }
-
- // otherwise, check returned models
- var r []types.Model
- if spec.expErr == nil {
- require.NoError(t, json.Unmarshal(binResult, &r))
- require.NotNil(t, r)
- }
- require.Len(t, r, spec.expModelLen)
- // and in result set
- for _, v := range spec.expModelContains {
- assert.Contains(t, r, v)
- }
- })
- }
-}
-
-func TestLegacyQueryContractListByCodeOrdering(t *testing.T) {
- ctx, keepers := CreateTestInput(t, false, AvailableCapabilities)
- keeper := keepers.WasmKeeper
-
- deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 1000000))
- topUp := sdk.NewCoins(sdk.NewInt64Coin("denom", 500))
- creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit.Add(deposit...)...)
- anyAddr := keepers.Faucet.NewFundedRandomAccount(ctx, topUp...)
-
- wasmCode, err := os.ReadFile("./testdata/hackatom.wasm")
- require.NoError(t, err)
-
- codeID, _, err := keepers.ContractKeeper.Create(ctx, creator, wasmCode, nil)
- require.NoError(t, err)
-
- _, _, bob := keyPubAddr()
- initMsg := HackatomExampleInitMsg{
- Verifier: anyAddr,
- Beneficiary: bob,
- }
- initMsgBz, err := json.Marshal(initMsg)
- require.NoError(t, err)
-
- // manage some realistic block settings
- var h int64 = 10
- setBlock := func(ctx sdk.Context, height int64) sdk.Context {
- ctx = ctx.WithBlockHeight(height)
- meter := sdk.NewGasMeter(1000000)
- ctx = ctx.WithGasMeter(meter)
- ctx = ctx.WithBlockGasMeter(meter)
- return ctx
- }
-
- // create 10 contracts with real block/gas setup
- for i := range [10]int{} {
- // 3 tx per block, so we ensure both comparisons work
- if i%3 == 0 {
- ctx = setBlock(ctx, h)
- h++
- }
- _, _, err = keepers.ContractKeeper.Instantiate(ctx, codeID, creator, nil, initMsgBz, fmt.Sprintf("contract %d", i), topUp)
- require.NoError(t, err)
- }
-
- // query and check the results are properly sorted
- var defaultQueryGasLimit sdk.Gas = 3000000
- q := NewLegacyQuerier(keeper, defaultQueryGasLimit)
-
- query := []string{QueryListContractByCode, fmt.Sprintf("%d", codeID)}
- data := abci.RequestQuery{}
- res, err := q(ctx, query, data)
- require.NoError(t, err)
-
- var contracts []string
- err = json.Unmarshal(res, &contracts)
- require.NoError(t, err)
-
- require.Equal(t, 10, len(contracts))
-
- for _, contract := range contracts {
- assert.NotEmpty(t, contract)
- }
-}
-
-func TestLegacyQueryContractHistory(t *testing.T) {
- ctx, keepers := CreateTestInput(t, false, AvailableCapabilities)
- keeper := keepers.WasmKeeper
-
- var otherAddr sdk.AccAddress = bytes.Repeat([]byte{0x2}, types.ContractAddrLen)
-
- specs := map[string]struct {
- srcQueryAddr sdk.AccAddress
- srcHistory []types.ContractCodeHistoryEntry
- expContent []types.ContractCodeHistoryEntry
- }{
- "response with internal fields cleared": {
- srcHistory: []types.ContractCodeHistoryEntry{{
- Operation: types.ContractCodeHistoryOperationTypeGenesis,
- CodeID: firstCodeID,
- Updated: types.NewAbsoluteTxPosition(ctx),
- Msg: []byte(`"init message"`),
- }},
- expContent: []types.ContractCodeHistoryEntry{{
- Operation: types.ContractCodeHistoryOperationTypeGenesis,
- CodeID: firstCodeID,
- Msg: []byte(`"init message"`),
- }},
- },
- "response with multiple entries": {
- srcHistory: []types.ContractCodeHistoryEntry{{
- Operation: types.ContractCodeHistoryOperationTypeInit,
- CodeID: firstCodeID,
- Updated: types.NewAbsoluteTxPosition(ctx),
- Msg: []byte(`"init message"`),
- }, {
- Operation: types.ContractCodeHistoryOperationTypeMigrate,
- CodeID: 2,
- Updated: types.NewAbsoluteTxPosition(ctx),
- Msg: []byte(`"migrate message 1"`),
- }, {
- Operation: types.ContractCodeHistoryOperationTypeMigrate,
- CodeID: 3,
- Updated: types.NewAbsoluteTxPosition(ctx),
- Msg: []byte(`"migrate message 2"`),
- }},
- expContent: []types.ContractCodeHistoryEntry{{
- Operation: types.ContractCodeHistoryOperationTypeInit,
- CodeID: firstCodeID,
- Msg: []byte(`"init message"`),
- }, {
- Operation: types.ContractCodeHistoryOperationTypeMigrate,
- CodeID: 2,
- Msg: []byte(`"migrate message 1"`),
- }, {
- Operation: types.ContractCodeHistoryOperationTypeMigrate,
- CodeID: 3,
- Msg: []byte(`"migrate message 2"`),
- }},
- },
- "unknown contract address": {
- srcQueryAddr: otherAddr,
- srcHistory: []types.ContractCodeHistoryEntry{{
- Operation: types.ContractCodeHistoryOperationTypeGenesis,
- CodeID: firstCodeID,
- Updated: types.NewAbsoluteTxPosition(ctx),
- Msg: []byte(`"init message"`),
- }},
- expContent: []types.ContractCodeHistoryEntry{},
- },
- }
- for msg, spec := range specs {
- t.Run(msg, func(t *testing.T) {
- _, _, myContractAddr := keyPubAddr()
- keeper.appendToContractHistory(ctx, myContractAddr, spec.srcHistory...)
-
- var defaultQueryGasLimit sdk.Gas = 3000000
- q := NewLegacyQuerier(keeper, defaultQueryGasLimit)
- queryContractAddr := spec.srcQueryAddr
- if queryContractAddr == nil {
- queryContractAddr = myContractAddr
- }
-
- // when
- query := []string{QueryContractHistory, queryContractAddr.String()}
- data := abci.RequestQuery{}
- resData, err := q(ctx, query, data)
-
- // then
- require.NoError(t, err)
- var got []types.ContractCodeHistoryEntry
- err = json.Unmarshal(resData, &got)
- require.NoError(t, err)
-
- assert.Equal(t, spec.expContent, got)
- })
- }
-}
-
-func TestLegacyQueryCodeList(t *testing.T) {
- wasmCode, err := os.ReadFile("./testdata/hackatom.wasm")
- require.NoError(t, err)
-
- specs := map[string]struct {
- codeIDs []uint64
- }{
- "none": {},
- "no gaps": {
- codeIDs: []uint64{1, 2, 3},
- },
- "with gaps": {
- codeIDs: []uint64{2, 4, 6},
- },
- }
-
- for msg, spec := range specs {
- t.Run(msg, func(t *testing.T) {
- ctx, keepers := CreateTestInput(t, false, AvailableCapabilities)
- keeper := keepers.WasmKeeper
-
- for _, codeID := range spec.codeIDs {
- require.NoError(t, keeper.importCode(ctx, codeID,
- types.CodeInfoFixture(types.WithSHA256CodeHash(wasmCode)),
- wasmCode),
- )
- }
- var defaultQueryGasLimit sdk.Gas = 3000000
- q := NewLegacyQuerier(keeper, defaultQueryGasLimit)
- // when
- query := []string{QueryListCode}
- data := abci.RequestQuery{}
- resData, err := q(ctx, query, data)
-
- // then
- require.NoError(t, err)
- if len(spec.codeIDs) == 0 {
- require.Nil(t, resData)
- return
- }
-
- var got []map[string]interface{}
- err = json.Unmarshal(resData, &got)
- require.NoError(t, err)
- require.Len(t, got, len(spec.codeIDs))
- for i, exp := range spec.codeIDs {
- assert.EqualValues(t, exp, got[i]["id"])
- }
- })
- }
-}
diff --git a/x/wasm/keeper/migrate_test.go b/x/wasm/keeper/migrate_test.go
index 3b762c49d0..3d856771e5 100644
--- a/x/wasm/keeper/migrate_test.go
+++ b/x/wasm/keeper/migrate_test.go
@@ -32,10 +32,15 @@ func TestMigrate1To2(t *testing.T) {
// create with no balance is also legal
gotContractAddr1, _, err := keepers.ContractKeeper.Instantiate(ctx.WithEventManager(em), example.CodeID, creator, nil, initMsgBz, "demo contract 1", nil)
+ require.NoError(t, err)
+
ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1)
gotContractAddr2, _, err := keepers.ContractKeeper.Instantiate(ctx.WithEventManager(em), example.CodeID, creator, nil, initMsgBz, "demo contract 1", nil)
+ require.NoError(t, err)
+
ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1)
gotContractAddr3, _, err := keepers.ContractKeeper.Instantiate(ctx.WithEventManager(em), example.CodeID, creator, nil, initMsgBz, "demo contract 1", nil)
+ require.NoError(t, err)
info1 := wasmKeeper.GetContractInfo(ctx, gotContractAddr1)
info2 := wasmKeeper.GetContractInfo(ctx, gotContractAddr2)
@@ -48,7 +53,8 @@ func TestMigrate1To2(t *testing.T) {
// migrator
migrator := NewMigrator(*wasmKeeper)
- migrator.Migrate1to2(ctx)
+ err = migrator.Migrate1to2(ctx)
+ require.NoError(t, err)
// check new store
var allContract []string
diff --git a/x/wasm/keeper/msg_dispatcher.go b/x/wasm/keeper/msg_dispatcher.go
index 59a836fa5f..10fa0f6709 100644
--- a/x/wasm/keeper/msg_dispatcher.go
+++ b/x/wasm/keeper/msg_dispatcher.go
@@ -1,14 +1,14 @@
package keeper
import (
- "bytes"
"fmt"
"sort"
+ "strings"
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
+ abci "github.com/cometbft/cometbft/abci/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
- abci "github.com/tendermint/tendermint/abci/types"
"github.com/CosmWasm/wasmd/x/wasm/types"
)
@@ -115,7 +115,7 @@ func (d MessageDispatcher) DispatchSubmessages(ctx sdk.Context, contractAddr sdk
for _, e := range filteredEvents {
attributes := e.Attributes
sort.SliceStable(attributes, func(i, j int) bool {
- return bytes.Compare(attributes[i].Key, attributes[j].Key) < 0
+ return strings.Compare(attributes[i].Key, attributes[j].Key) < 0
})
}
}
@@ -214,8 +214,8 @@ func sdkAttributesToWasmVMAttributes(attrs []abci.EventAttribute) []wasmvmtypes.
res := make([]wasmvmtypes.EventAttribute, len(attrs))
for i, attr := range attrs {
res[i] = wasmvmtypes.EventAttribute{
- Key: string(attr.Key),
- Value: string(attr.Value),
+ Key: attr.Key,
+ Value: attr.Value,
}
}
return res
diff --git a/x/wasm/keeper/msg_dispatcher_test.go b/x/wasm/keeper/msg_dispatcher_test.go
index e514ae4119..d62dab20cd 100644
--- a/x/wasm/keeper/msg_dispatcher_test.go
+++ b/x/wasm/keeper/msg_dispatcher_test.go
@@ -5,13 +5,12 @@ import (
"fmt"
"testing"
- "github.com/tendermint/tendermint/libs/log"
-
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
+ abci "github.com/cometbft/cometbft/abci/types"
+ "github.com/cometbft/cometbft/libs/log"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- abci "github.com/tendermint/tendermint/abci/types"
"github.com/CosmWasm/wasmd/x/wasm/keeper/wasmtesting"
)
@@ -95,7 +94,7 @@ func TestDispatchSubmessages(t *testing.T) {
},
msgHandler: &wasmtesting.MockMessageHandler{
DispatchMsgFn: func(ctx sdk.Context, contractAddr sdk.AccAddress, contractIBCPortID string, msg wasmvmtypes.CosmosMsg) (events []sdk.Event, data [][]byte, err error) {
- myEvents := []sdk.Event{{Type: "myEvent", Attributes: []abci.EventAttribute{{Key: []byte("foo"), Value: []byte("bar")}}}}
+ myEvents := []sdk.Event{{Type: "myEvent", Attributes: []abci.EventAttribute{{Key: "foo", Value: "bar"}}}}
return myEvents, [][]byte{[]byte("myData")}, nil
},
},
@@ -104,7 +103,7 @@ func TestDispatchSubmessages(t *testing.T) {
expEvents: []sdk.Event{
{
Type: "myEvent",
- Attributes: []abci.EventAttribute{{Key: []byte("foo"), Value: []byte("bar")}},
+ Attributes: []abci.EventAttribute{{Key: "foo", Value: "bar"}},
},
sdk.NewEvent("wasm-reply"),
},
@@ -116,7 +115,7 @@ func TestDispatchSubmessages(t *testing.T) {
replyer: &mockReplyer{},
msgHandler: &wasmtesting.MockMessageHandler{
DispatchMsgFn: func(ctx sdk.Context, contractAddr sdk.AccAddress, contractIBCPortID string, msg wasmvmtypes.CosmosMsg) (events []sdk.Event, data [][]byte, err error) {
- myEvents := []sdk.Event{{Type: "myEvent", Attributes: []abci.EventAttribute{{Key: []byte("foo"), Value: []byte("bar")}}}}
+ myEvents := []sdk.Event{{Type: "myEvent", Attributes: []abci.EventAttribute{{Key: "foo", Value: "bar"}}}}
ctx.EventManager().EmitEvents(myEvents)
return nil, nil, nil
},
@@ -124,7 +123,7 @@ func TestDispatchSubmessages(t *testing.T) {
expCommits: []bool{true},
expEvents: []sdk.Event{{
Type: "myEvent",
- Attributes: []abci.EventAttribute{{Key: []byte("foo"), Value: []byte("bar")}},
+ Attributes: []abci.EventAttribute{{Key: "foo", Value: "bar"}},
}},
},
"with context events - discarded on failure": {
@@ -134,7 +133,7 @@ func TestDispatchSubmessages(t *testing.T) {
replyer: &mockReplyer{},
msgHandler: &wasmtesting.MockMessageHandler{
DispatchMsgFn: func(ctx sdk.Context, contractAddr sdk.AccAddress, contractIBCPortID string, msg wasmvmtypes.CosmosMsg) (events []sdk.Event, data [][]byte, err error) {
- myEvents := []sdk.Event{{Type: "myEvent", Attributes: []abci.EventAttribute{{Key: []byte("foo"), Value: []byte("bar")}}}}
+ myEvents := []sdk.Event{{Type: "myEvent", Attributes: []abci.EventAttribute{{Key: "foo", Value: "bar"}}}}
ctx.EventManager().EmitEvents(myEvents)
return nil, nil, errors.New("testing")
},
@@ -400,10 +399,10 @@ func TestDispatchSubmessages(t *testing.T) {
require.Error(t, gotErr)
assert.Empty(t, em.Events())
return
- } else {
- require.NoError(t, gotErr)
- assert.Equal(t, spec.expData, gotData)
}
+ require.NoError(t, gotErr)
+ assert.Equal(t, spec.expData, gotData)
+
assert.Equal(t, spec.expCommits, mockStore.Committed)
if len(spec.expEvents) == 0 {
assert.Empty(t, em.Events())
diff --git a/x/wasm/keeper/msg_server_integration_test.go b/x/wasm/keeper/msg_server_integration_test.go
index dde8ae7744..7c21bb3f8e 100644
--- a/x/wasm/keeper/msg_server_integration_test.go
+++ b/x/wasm/keeper/msg_server_integration_test.go
@@ -7,9 +7,9 @@ import (
"github.com/cosmos/cosmos-sdk/testutil/testdata"
+ tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"github.com/CosmWasm/wasmd/app"
"github.com/CosmWasm/wasmd/x/wasm/types"
@@ -19,7 +19,7 @@ import (
var wasmContract []byte
func TestStoreCode(t *testing.T) {
- wasmApp := app.Setup(false)
+ wasmApp := app.Setup(t)
ctx := wasmApp.BaseApp.NewContext(false, tmproto.Header{})
_, _, sender := testdata.KeyTestPubAddr()
msg := types.MsgStoreCodeFixture(func(m *types.MsgStoreCode) {
diff --git a/x/wasm/keeper/options_test.go b/x/wasm/keeper/options_test.go
index 29d2f9bd26..26547d32c5 100644
--- a/x/wasm/keeper/options_test.go
+++ b/x/wasm/keeper/options_test.go
@@ -8,7 +8,6 @@ import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
- distributionkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
"github.com/stretchr/testify/assert"
@@ -74,7 +73,7 @@ func TestConstructorOptions(t *testing.T) {
"api costs": {
srcOpt: WithAPICosts(1, 2),
verify: func(t *testing.T, k Keeper) {
- t.Cleanup(setApiDefaults)
+ t.Cleanup(setAPIDefaults)
assert.Equal(t, uint64(1), costHumanize)
assert.Equal(t, uint64(2), costCanonical)
},
@@ -104,13 +103,13 @@ func TestConstructorOptions(t *testing.T) {
}
for name, spec := range specs {
t.Run(name, func(t *testing.T) {
- k := NewKeeper(nil, nil, paramtypes.NewSubspace(nil, nil, nil, nil, ""), authkeeper.AccountKeeper{}, &bankkeeper.BaseKeeper{}, stakingkeeper.Keeper{}, distributionkeeper.Keeper{}, nil, nil, nil, nil, nil, nil, "tempDir", types.DefaultWasmConfig(), AvailableCapabilities, spec.srcOpt)
+ k := NewKeeper(nil, nil, paramtypes.NewSubspace(nil, nil, nil, nil, ""), authkeeper.AccountKeeper{}, &bankkeeper.BaseKeeper{}, stakingkeeper.Keeper{}, nil, nil, nil, nil, nil, nil, nil, "tempDir", types.DefaultWasmConfig(), AvailableCapabilities, spec.srcOpt)
spec.verify(t, k)
})
}
}
-func setApiDefaults() {
+func setAPIDefaults() {
costHumanize = DefaultGasCostHumanAddress * DefaultGasMultiplier
costCanonical = DefaultGasCostCanonicalAddress * DefaultGasMultiplier
}
diff --git a/x/wasm/keeper/proposal_handler.go b/x/wasm/keeper/proposal_handler.go
index efcf49c481..bf99a4fad7 100644
--- a/x/wasm/keeper/proposal_handler.go
+++ b/x/wasm/keeper/proposal_handler.go
@@ -7,23 +7,23 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
- govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
+ "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
"github.com/CosmWasm/wasmd/x/wasm/types"
)
// NewWasmProposalHandler creates a new governance Handler for wasm proposals
-func NewWasmProposalHandler(k decoratedKeeper, enabledProposalTypes []types.ProposalType) govtypes.Handler {
+func NewWasmProposalHandler(k decoratedKeeper, enabledProposalTypes []types.ProposalType) v1beta1.Handler {
return NewWasmProposalHandlerX(NewGovPermissionKeeper(k), enabledProposalTypes)
}
// NewWasmProposalHandlerX creates a new governance Handler for wasm proposals
-func NewWasmProposalHandlerX(k types.ContractOpsKeeper, enabledProposalTypes []types.ProposalType) govtypes.Handler {
+func NewWasmProposalHandlerX(k types.ContractOpsKeeper, enabledProposalTypes []types.ProposalType) v1beta1.Handler {
enabledTypes := make(map[string]struct{}, len(enabledProposalTypes))
for i := range enabledProposalTypes {
enabledTypes[string(enabledProposalTypes[i])] = struct{}{}
}
- return func(ctx sdk.Context, content govtypes.Content) error {
+ return func(ctx sdk.Context, content v1beta1.Content) error {
if content == nil {
return sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "content must not be empty")
}
diff --git a/x/wasm/keeper/proposal_integration_test.go b/x/wasm/keeper/proposal_integration_test.go
index ff784f76d5..8b1a51ab65 100644
--- a/x/wasm/keeper/proposal_integration_test.go
+++ b/x/wasm/keeper/proposal_integration_test.go
@@ -10,7 +10,10 @@ import (
wasmvm "github.com/CosmWasm/wasmvm"
sdk "github.com/cosmos/cosmos-sdk/types"
+ govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
+ v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
+ "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
"github.com/cosmos/cosmos-sdk/x/params/client/utils"
"github.com/cosmos/cosmos-sdk/x/params/types/proposal"
"github.com/stretchr/testify/assert"
@@ -22,7 +25,7 @@ import (
func TestStoreCodeProposal(t *testing.T) {
parentCtx, keepers := CreateTestInput(t, false, "staking")
- govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper
+ wasmKeeper := keepers.WasmKeeper
wasmKeeper.SetParams(parentCtx, types.Params{
CodeUploadAccess: types.AllowNobody,
InstantiateDefaultPermission: types.AccessTypeNobody,
@@ -56,14 +59,8 @@ func TestStoreCodeProposal(t *testing.T) {
p.CodeHash = checksum
})
- // when stored
- storedProposal, err := govKeeper.SubmitProposal(ctx, src)
- require.NoError(t, err)
-
- // and proposal execute
- handler := govKeeper.Router().GetRoute(storedProposal.ProposalRoute())
- err = handler(ctx, storedProposal.GetContent())
- require.NoError(t, err)
+ // when
+ mustSubmitAndExecuteLegacyProposal(t, ctx, src, myActorAddress, keepers)
// then
cInfo := wasmKeeper.GetCodeInfo(ctx, 1)
@@ -78,9 +75,42 @@ func TestStoreCodeProposal(t *testing.T) {
}
}
+func mustSubmitAndExecuteLegacyProposal(t *testing.T, ctx sdk.Context, content v1beta1.Content, myActorAddress string, keepers TestKeepers) {
+ t.Helper()
+ govAuthority := keepers.AccountKeeper.GetModuleAddress(govtypes.ModuleName).String()
+ msgServer := govkeeper.NewMsgServerImpl(keepers.GovKeeper)
+ // ignore all submit events
+ contentMsg, err := submitLegacyProposal(t, ctx.WithEventManager(sdk.NewEventManager()), content, myActorAddress, govAuthority, msgServer)
+ require.NoError(t, err)
+
+ _, err = msgServer.ExecLegacyContent(sdk.WrapSDKContext(ctx), v1.NewMsgExecLegacyContent(contentMsg.Content, govAuthority))
+ require.NoError(t, err)
+}
+
+// does not fail on submit proposal
+func submitLegacyProposal(t *testing.T, ctx sdk.Context, content v1beta1.Content, myActorAddress string, govAuthority string, msgServer v1.MsgServer) (*v1.MsgExecLegacyContent, error) {
+ t.Helper()
+ contentMsg, err := v1.NewLegacyContent(content, govAuthority)
+ require.NoError(t, err)
+
+ proposal, err := v1.NewMsgSubmitProposal(
+ []sdk.Msg{contentMsg},
+ sdk.Coins{},
+ myActorAddress,
+ "",
+ "my title",
+ "my description",
+ )
+ require.NoError(t, err)
+
+ // when stored
+ _, err = msgServer.SubmitProposal(sdk.WrapSDKContext(ctx), proposal)
+ return contentMsg, err
+}
+
func TestInstantiateProposal(t *testing.T) {
ctx, keepers := CreateTestInput(t, false, "staking")
- govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper
+ wasmKeeper := keepers.WasmKeeper
wasmKeeper.SetParams(ctx, types.Params{
CodeUploadAccess: types.AllowNobody,
InstantiateDefaultPermission: types.AccessTypeNobody,
@@ -102,18 +132,12 @@ func TestInstantiateProposal(t *testing.T) {
p.CodeID = firstCodeID
p.RunAs = oneAddress.String()
p.Admin = otherAddress.String()
- p.Label = "testing"
+ p.Label = "testing" //nolint:goconst
})
em := sdk.NewEventManager()
- // when stored
- storedProposal, err := govKeeper.SubmitProposal(ctx, src)
- require.NoError(t, err)
-
- // and proposal execute
- handler := govKeeper.Router().GetRoute(storedProposal.ProposalRoute())
- err = handler(ctx.WithEventManager(em), storedProposal.GetContent())
- require.NoError(t, err)
+ // when
+ mustSubmitAndExecuteLegacyProposal(t, ctx.WithEventManager(em), src, oneAddress.String(), keepers)
// then
contractAddr, err := sdk.AccAddressFromBech32("cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr")
@@ -143,7 +167,7 @@ func TestInstantiateProposal(t *testing.T) {
func TestInstantiate2Proposal(t *testing.T) {
ctx, keepers := CreateTestInput(t, false, "staking")
- govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper
+ wasmKeeper := keepers.WasmKeeper
wasmKeeper.SetParams(ctx, types.Params{
CodeUploadAccess: types.AllowNobody,
InstantiateDefaultPermission: types.AccessTypeNobody,
@@ -159,8 +183,8 @@ func TestInstantiate2Proposal(t *testing.T) {
var (
oneAddress sdk.AccAddress = bytes.Repeat([]byte{0x1}, types.ContractAddrLen)
otherAddress sdk.AccAddress = bytes.Repeat([]byte{0x2}, types.ContractAddrLen)
- label string = "label"
- salt []byte = []byte("mySalt")
+ label = "label"
+ salt = []byte("mySalt")
)
src := types.InstantiateContract2ProposalFixture(func(p *types.InstantiateContract2Proposal) {
p.CodeID = firstCodeID
@@ -173,14 +197,8 @@ func TestInstantiate2Proposal(t *testing.T) {
em := sdk.NewEventManager()
- // when stored
- storedProposal, err := govKeeper.SubmitProposal(ctx, src)
- require.NoError(t, err)
-
- // and proposal execute
- handler := govKeeper.Router().GetRoute(storedProposal.ProposalRoute())
- err = handler(ctx.WithEventManager(em), storedProposal.GetContent())
- require.NoError(t, err)
+ // when
+ mustSubmitAndExecuteLegacyProposal(t, ctx.WithEventManager(em), src, oneAddress.String(), keepers)
cInfo := wasmKeeper.GetContractInfo(ctx, contractAddress)
require.NotNil(t, cInfo)
@@ -197,7 +215,7 @@ func TestInstantiate2Proposal(t *testing.T) {
}}
assert.Equal(t, expHistory, wasmKeeper.GetContractHistory(ctx, contractAddress))
// and event
- require.Len(t, em.Events(), 3, "%#v", em.Events())
+ require.Len(t, em.Events(), 3, prettyEvents(t, em.Events()))
require.Equal(t, types.EventTypeInstantiate, em.Events()[0].Type)
require.Equal(t, types.WasmModuleEventType, em.Events()[1].Type)
require.Equal(t, types.EventTypeGovContractResult, em.Events()[2].Type)
@@ -207,7 +225,7 @@ func TestInstantiate2Proposal(t *testing.T) {
func TestInstantiateProposal_NoAdmin(t *testing.T) {
ctx, keepers := CreateTestInput(t, false, "staking")
- govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper
+ wasmKeeper := keepers.WasmKeeper
wasmKeeper.SetParams(ctx, types.Params{
CodeUploadAccess: types.AllowNobody,
InstantiateDefaultPermission: types.AccessTypeNobody,
@@ -223,63 +241,71 @@ func TestInstantiateProposal_NoAdmin(t *testing.T) {
var oneAddress sdk.AccAddress = bytes.Repeat([]byte{0x1}, types.ContractAddrLen)
- // test invalid admin address
- src := types.InstantiateContractProposalFixture(func(p *types.InstantiateContractProposal) {
- p.CodeID = firstCodeID
- p.RunAs = oneAddress.String()
- p.Admin = "invalid"
- p.Label = "testing"
- })
- _, err = govKeeper.SubmitProposal(ctx, src)
- require.Error(t, err)
-
- // test with no admin
- src = types.InstantiateContractProposalFixture(func(p *types.InstantiateContractProposal) {
- p.CodeID = firstCodeID
- p.RunAs = oneAddress.String()
- p.Admin = ""
- p.Label = "testing"
- })
- em := sdk.NewEventManager()
-
- // when stored
- storedProposal, err := govKeeper.SubmitProposal(ctx, src)
- require.NoError(t, err)
-
- // and proposal execute
- handler := govKeeper.Router().GetRoute(storedProposal.ProposalRoute())
- err = handler(ctx.WithEventManager(em), storedProposal.GetContent())
- require.NoError(t, err)
-
- // then
- contractAddr, err := sdk.AccAddressFromBech32("cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr")
- require.NoError(t, err)
+ specs := map[string]struct {
+ srcAdmin string
+ expErr bool
+ }{
+ "empty admin": {
+ srcAdmin: "",
+ },
+ "invalid admin": {
+ srcAdmin: "invalid",
+ expErr: true,
+ },
+ }
+ for name, spec := range specs {
+ t.Run(name, func(t *testing.T) {
+ src := types.InstantiateContractProposalFixture(func(p *types.InstantiateContractProposal) {
+ p.CodeID = firstCodeID
+ p.RunAs = oneAddress.String()
+ p.Admin = spec.srcAdmin
+ p.Label = "testing"
+ })
+ govAuthority := keepers.AccountKeeper.GetModuleAddress(govtypes.ModuleName).String()
+ msgServer := govkeeper.NewMsgServerImpl(keepers.GovKeeper)
+ // when
+ contentMsg, gotErr := submitLegacyProposal(t, ctx, src, oneAddress.String(), govAuthority, msgServer)
+ // then
+ if spec.expErr {
+ require.Error(t, gotErr)
+ return
+ }
+ require.NoError(t, gotErr)
+ // and when
+ em := sdk.NewEventManager()
+ _, err = msgServer.ExecLegacyContent(sdk.WrapSDKContext(ctx.WithEventManager(em)), v1.NewMsgExecLegacyContent(contentMsg.Content, govAuthority))
+ // then
+ require.NoError(t, err)
+ contractAddr, err := sdk.AccAddressFromBech32("cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr")
+ require.NoError(t, err)
- cInfo := wasmKeeper.GetContractInfo(ctx, contractAddr)
- require.NotNil(t, cInfo)
- assert.Equal(t, uint64(1), cInfo.CodeID)
- assert.Equal(t, oneAddress.String(), cInfo.Creator)
- assert.Equal(t, "", cInfo.Admin)
- assert.Equal(t, "testing", cInfo.Label)
- expHistory := []types.ContractCodeHistoryEntry{{
- Operation: types.ContractCodeHistoryOperationTypeInit,
- CodeID: src.CodeID,
- Updated: types.NewAbsoluteTxPosition(ctx),
- Msg: src.Msg,
- }}
- assert.Equal(t, expHistory, wasmKeeper.GetContractHistory(ctx, contractAddr))
- // and event
- require.Len(t, em.Events(), 3, "%#v", em.Events())
- require.Equal(t, types.EventTypeInstantiate, em.Events()[0].Type)
- require.Equal(t, types.WasmModuleEventType, em.Events()[1].Type)
- require.Equal(t, types.EventTypeGovContractResult, em.Events()[2].Type)
- require.Len(t, em.Events()[2].Attributes, 1)
- require.NotEmpty(t, em.Events()[2].Attributes[0])
+ cInfo := wasmKeeper.GetContractInfo(ctx, contractAddr)
+ require.NotNil(t, cInfo)
+ assert.Equal(t, uint64(1), cInfo.CodeID)
+ assert.Equal(t, oneAddress.String(), cInfo.Creator)
+ assert.Equal(t, "", cInfo.Admin)
+ assert.Equal(t, "testing", cInfo.Label)
+ expHistory := []types.ContractCodeHistoryEntry{{
+ Operation: types.ContractCodeHistoryOperationTypeInit,
+ CodeID: src.CodeID,
+ Updated: types.NewAbsoluteTxPosition(ctx),
+ Msg: src.Msg,
+ }}
+ assert.Equal(t, expHistory, wasmKeeper.GetContractHistory(ctx, contractAddr))
+ // and event
+ require.Len(t, em.Events(), 3, "%#v", em.Events())
+ require.Equal(t, types.EventTypeInstantiate, em.Events()[0].Type)
+ require.Equal(t, types.WasmModuleEventType, em.Events()[1].Type)
+ require.Equal(t, types.EventTypeGovContractResult, em.Events()[2].Type)
+ require.Len(t, em.Events()[2].Attributes, 1)
+ require.NotEmpty(t, em.Events()[2].Attributes[0])
+ })
+ }
}
func TestStoreAndInstantiateContractProposal(t *testing.T) {
ctx, keepers := CreateTestInput(t, false, "staking")
- govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper
+ wasmKeeper := keepers.WasmKeeper
wasmKeeper.SetParams(ctx, types.Params{
CodeUploadAccess: types.AllowNobody,
InstantiateDefaultPermission: types.AccessTypeNobody,
@@ -305,14 +331,8 @@ func TestStoreAndInstantiateContractProposal(t *testing.T) {
})
em := sdk.NewEventManager()
- // when stored
- storedProposal, err := govKeeper.SubmitProposal(ctx, src)
- require.NoError(t, err)
-
- // and proposal execute
- handler := govKeeper.Router().GetRoute(storedProposal.ProposalRoute())
- err = handler(ctx.WithEventManager(em), storedProposal.GetContent())
- require.NoError(t, err)
+ // when
+ mustSubmitAndExecuteLegacyProposal(t, ctx.WithEventManager(em), src, oneAddress.String(), keepers)
// then
contractAddr, err := sdk.AccAddressFromBech32("cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr")
@@ -343,7 +363,7 @@ func TestStoreAndInstantiateContractProposal(t *testing.T) {
func TestMigrateProposal(t *testing.T) {
ctx, keepers := CreateTestInput(t, false, "staking")
- govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper
+ wasmKeeper := keepers.WasmKeeper
wasmKeeper.SetParams(ctx, types.Params{
CodeUploadAccess: types.AllowNobody,
InstantiateDefaultPermission: types.AccessTypeNobody,
@@ -381,7 +401,7 @@ func TestMigrateProposal(t *testing.T) {
migMsgBz, err := json.Marshal(migMsg)
require.NoError(t, err)
- src := types.MigrateContractProposal{
+ src := &types.MigrateContractProposal{
Title: "Foo",
Description: "Bar",
CodeID: 2,
@@ -391,14 +411,8 @@ func TestMigrateProposal(t *testing.T) {
em := sdk.NewEventManager()
- // when stored
- storedProposal, err := govKeeper.SubmitProposal(ctx, &src)
- require.NoError(t, err)
-
- // and proposal execute
- handler := govKeeper.Router().GetRoute(storedProposal.ProposalRoute())
- err = handler(ctx.WithEventManager(em), storedProposal.GetContent())
- require.NoError(t, err)
+ // when
+ mustSubmitAndExecuteLegacyProposal(t, ctx.WithEventManager(em), src, anyAddress.String(), keepers)
// then
require.NoError(t, err)
@@ -423,12 +437,12 @@ func TestMigrateProposal(t *testing.T) {
assert.Equal(t, types.EventTypeMigrate, em.Events()[0].Type)
require.Equal(t, types.EventTypeGovContractResult, em.Events()[1].Type)
require.Len(t, em.Events()[1].Attributes, 1)
- assert.Equal(t, types.AttributeKeyResultDataHex, string(em.Events()[1].Attributes[0].Key))
+ assert.Equal(t, types.AttributeKeyResultDataHex, em.Events()[1].Attributes[0].Key)
}
func TestExecuteProposal(t *testing.T) {
ctx, keepers := CreateTestInput(t, false, "staking")
- govKeeper, bankKeeper := keepers.GovKeeper, keepers.BankKeeper
+ bankKeeper := keepers.BankKeeper
exampleContract := InstantiateHackatomExampleContract(t, ctx, keepers)
contractAddr := exampleContract.Contract
@@ -444,7 +458,7 @@ func TestExecuteProposal(t *testing.T) {
require.NoError(t, err)
// try with runAs that doesn't have pemission
- badSrc := types.ExecuteContractProposal{
+ badSrc := &types.ExecuteContractProposal{
Title: "First",
Description: "Beneficiary has no permission to run",
Contract: contractAddr.String(),
@@ -452,17 +466,17 @@ func TestExecuteProposal(t *testing.T) {
RunAs: exampleContract.BeneficiaryAddr.String(),
}
- em := sdk.NewEventManager()
-
// fails on store - this doesn't have permission
- storedProposal, err := govKeeper.SubmitProposal(ctx, &badSrc)
+ govAuthority := keepers.AccountKeeper.GetModuleAddress(govtypes.ModuleName).String()
+ msgServer := govkeeper.NewMsgServerImpl(keepers.GovKeeper)
+ _, err = submitLegacyProposal(t, ctx, badSrc, exampleContract.BeneficiaryAddr.String(), govAuthority, msgServer)
require.Error(t, err)
// balance should not change
bal = bankKeeper.GetBalance(ctx, contractAddr, "denom")
require.Equal(t, bal.Amount, sdk.NewInt(100))
// try again with the proper run-as
- src := types.ExecuteContractProposal{
+ src := &types.ExecuteContractProposal{
Title: "Second",
Description: "Verifier can execute",
Contract: contractAddr.String(),
@@ -470,16 +484,10 @@ func TestExecuteProposal(t *testing.T) {
RunAs: exampleContract.VerifierAddr.String(),
}
- em = sdk.NewEventManager()
-
- // when stored
- storedProposal, err = govKeeper.SubmitProposal(ctx, &src)
- require.NoError(t, err)
+ em := sdk.NewEventManager()
- // and proposal execute
- handler := govKeeper.Router().GetRoute(storedProposal.ProposalRoute())
- err = handler(ctx.WithEventManager(em), storedProposal.GetContent())
- require.NoError(t, err)
+ // when
+ mustSubmitAndExecuteLegacyProposal(t, ctx.WithEventManager(em), src, exampleContract.BeneficiaryAddr.String(), keepers)
// balance should be empty (proper release)
bal = bankKeeper.GetBalance(ctx, contractAddr, "denom")
@@ -488,7 +496,7 @@ func TestExecuteProposal(t *testing.T) {
func TestSudoProposal(t *testing.T) {
ctx, keepers := CreateTestInput(t, false, "staking")
- govKeeper, bankKeeper := keepers.GovKeeper, keepers.BankKeeper
+ bankKeeper := keepers.BankKeeper
exampleContract := InstantiateHackatomExampleContract(t, ctx, keepers)
contractAddr := exampleContract.Contract
@@ -514,7 +522,7 @@ func TestSudoProposal(t *testing.T) {
require.NoError(t, err)
// sudo can do anything
- src := types.SudoContractProposal{
+ src := &types.SudoContractProposal{
Title: "Sudo",
Description: "Steal funds for the verifier",
Contract: contractAddr.String(),
@@ -523,14 +531,8 @@ func TestSudoProposal(t *testing.T) {
em := sdk.NewEventManager()
- // when stored
- storedProposal, err := govKeeper.SubmitProposal(ctx, &src)
- require.NoError(t, err)
-
- // and proposal execute
- handler := govKeeper.Router().GetRoute(storedProposal.ProposalRoute())
- err = handler(ctx.WithEventManager(em), storedProposal.GetContent())
- require.NoError(t, err)
+ // when
+ mustSubmitAndExecuteLegacyProposal(t, ctx.WithEventManager(em), src, exampleContract.BeneficiaryAddr.String(), keepers)
// balance should be empty (and verifier richer)
bal = bankKeeper.GetBalance(ctx, contractAddr, "denom")
@@ -549,7 +551,7 @@ func TestAdminProposals(t *testing.T) {
specs := map[string]struct {
state types.ContractInfo
- srcProposal govtypes.Content
+ srcProposal v1beta1.Content
expAdmin sdk.AccAddress
}{
"update with different admin": {
@@ -598,7 +600,7 @@ func TestAdminProposals(t *testing.T) {
for msg, spec := range specs {
t.Run(msg, func(t *testing.T) {
ctx, keepers := CreateTestInput(t, false, "staking")
- govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper
+ wasmKeeper := keepers.WasmKeeper
wasmKeeper.SetParams(ctx, types.Params{
CodeUploadAccess: types.AllowNobody,
InstantiateDefaultPermission: types.AccessTypeNobody,
@@ -616,14 +618,9 @@ func TestAdminProposals(t *testing.T) {
}
require.NoError(t, wasmKeeper.importContract(ctx, contractAddr, &spec.state, []types.Model{}, entries))
- // when stored
- storedProposal, err := govKeeper.SubmitProposal(ctx, spec.srcProposal)
- require.NoError(t, err)
- // and execute proposal
- handler := govKeeper.Router().GetRoute(storedProposal.ProposalRoute())
- err = handler(ctx, storedProposal.GetContent())
- require.NoError(t, err)
+ // when
+ mustSubmitAndExecuteLegacyProposal(t, ctx, spec.srcProposal, otherAddress.String(), keepers)
// then
cInfo := wasmKeeper.GetContractInfo(ctx, contractAddr)
@@ -635,7 +632,7 @@ func TestAdminProposals(t *testing.T) {
func TestUpdateParamsProposal(t *testing.T) {
ctx, keepers := CreateTestInput(t, false, "staking")
- govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper
+ wasmKeeper := keepers.WasmKeeper
var (
legacyAmino = keepers.EncodingConfig.Amino
@@ -708,19 +705,14 @@ func TestUpdateParamsProposal(t *testing.T) {
var jsonProposal utils.ParamChangeProposalJSON
require.NoError(t, legacyAmino.UnmarshalJSON(bz, &jsonProposal))
- proposal := proposal.ParameterChangeProposal{
+ src := &proposal.ParameterChangeProposal{
Title: jsonProposal.Title,
Description: jsonProposal.Description,
Changes: jsonProposal.Changes.ToParamChanges(),
}
- // when stored
- storedProposal, err := govKeeper.SubmitProposal(ctx, &proposal)
- require.NoError(t, err)
- // and proposal execute
- handler := govKeeper.Router().GetRoute(storedProposal.ProposalRoute())
- err = handler(ctx, storedProposal.GetContent())
- require.NoError(t, err)
+ // when
+ mustSubmitAndExecuteLegacyProposal(t, ctx, src, myAddress.String(), keepers)
// then
assert.True(t, spec.expUploadConfig.Equals(wasmKeeper.getUploadAccessConfig(ctx)),
@@ -732,7 +724,7 @@ func TestUpdateParamsProposal(t *testing.T) {
func TestPinCodesProposal(t *testing.T) {
ctx, keepers := CreateTestInput(t, false, "staking")
- govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper
+ wasmKeeper := keepers.WasmKeeper
mock := wasmtesting.MockWasmer{
CreateFn: wasmtesting.NoOpCreateFn,
@@ -787,17 +779,21 @@ func TestPinCodesProposal(t *testing.T) {
parentCtx := ctx
for msg, spec := range specs {
t.Run(msg, func(t *testing.T) {
+ myActorAddress := RandomBech32AccountAddress(t)
gotPinnedChecksums = nil
ctx, _ := parentCtx.CacheContext()
mock.PinFn = spec.mockFn
- proposal := types.PinCodesProposal{
+ proposal := &types.PinCodesProposal{
Title: "Foo",
Description: "Bar",
CodeIDs: spec.srcCodeIDs,
}
- // when stored
- storedProposal, gotErr := govKeeper.SubmitProposal(ctx, &proposal)
+ govAuthority := keepers.AccountKeeper.GetModuleAddress(govtypes.ModuleName).String()
+ msgServer := govkeeper.NewMsgServerImpl(keepers.GovKeeper)
+
+ // when
+ contentMsg, gotErr := submitLegacyProposal(t, ctx, proposal, myActorAddress, govAuthority, msgServer)
if spec.expErr {
require.Error(t, gotErr)
return
@@ -805,9 +801,8 @@ func TestPinCodesProposal(t *testing.T) {
require.NoError(t, gotErr)
// and proposal execute
- handler := govKeeper.Router().GetRoute(storedProposal.ProposalRoute())
- gotErr = handler(ctx, storedProposal.GetContent())
- require.NoError(t, gotErr)
+ _, err := msgServer.ExecLegacyContent(sdk.WrapSDKContext(ctx), v1.NewMsgExecLegacyContent(contentMsg.Content, govAuthority))
+ require.NoError(t, err)
// then
for i := range spec.srcCodeIDs {
@@ -820,7 +815,7 @@ func TestPinCodesProposal(t *testing.T) {
func TestUnpinCodesProposal(t *testing.T) {
ctx, keepers := CreateTestInput(t, false, "staking")
- govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper
+ wasmKeeper := keepers.WasmKeeper
mock := wasmtesting.MockWasmer{
CreateFn: wasmtesting.NoOpCreateFn,
@@ -878,14 +873,17 @@ func TestUnpinCodesProposal(t *testing.T) {
gotUnpinnedChecksums = nil
ctx, _ := parentCtx.CacheContext()
mock.UnpinFn = spec.mockFn
- proposal := types.UnpinCodesProposal{
+ proposal := &types.UnpinCodesProposal{
Title: "Foo",
Description: "Bar",
CodeIDs: spec.srcCodeIDs,
}
- // when stored
- storedProposal, gotErr := govKeeper.SubmitProposal(ctx, &proposal)
+ govAuthority := keepers.AccountKeeper.GetModuleAddress(govtypes.ModuleName).String()
+ msgServer := govkeeper.NewMsgServerImpl(keepers.GovKeeper)
+
+ // when
+ contentMsg, gotErr := submitLegacyProposal(t, ctx, proposal, RandomBech32AccountAddress(t), govAuthority, msgServer)
if spec.expErr {
require.Error(t, gotErr)
return
@@ -893,9 +891,8 @@ func TestUnpinCodesProposal(t *testing.T) {
require.NoError(t, gotErr)
// and proposal execute
- handler := govKeeper.Router().GetRoute(storedProposal.ProposalRoute())
- gotErr = handler(ctx, storedProposal.GetContent())
- require.NoError(t, gotErr)
+ _, err := msgServer.ExecLegacyContent(sdk.WrapSDKContext(ctx), v1.NewMsgExecLegacyContent(contentMsg.Content, govAuthority))
+ require.NoError(t, err)
// then
for i := range spec.srcCodeIDs {
@@ -908,7 +905,7 @@ func TestUnpinCodesProposal(t *testing.T) {
func TestUpdateInstantiateConfigProposal(t *testing.T) {
ctx, keepers := CreateTestInput(t, false, "staking")
- govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper
+ wasmKeeper := keepers.WasmKeeper
mock := wasmtesting.MockWasmer{
CreateFn: wasmtesting.NoOpCreateFn,
@@ -972,14 +969,16 @@ func TestUpdateInstantiateConfigProposal(t *testing.T) {
})
}
- proposal := types.UpdateInstantiateConfigProposal{
+ govAuthority := keepers.AccountKeeper.GetModuleAddress(govtypes.ModuleName).String()
+ msgServer := govkeeper.NewMsgServerImpl(keepers.GovKeeper)
+ proposal := &types.UpdateInstantiateConfigProposal{
Title: "Foo",
Description: "Bar",
AccessConfigUpdates: updates,
}
- // when stored
- storedProposal, gotErr := govKeeper.SubmitProposal(ctx, &proposal)
+ // when
+ contentMsg, gotErr := submitLegacyProposal(t, ctx, proposal, RandomBech32AccountAddress(t), govAuthority, msgServer)
if spec.expErr {
require.Error(t, gotErr)
return
@@ -987,9 +986,8 @@ func TestUpdateInstantiateConfigProposal(t *testing.T) {
require.NoError(t, gotErr)
// and proposal execute
- handler := govKeeper.Router().GetRoute(storedProposal.ProposalRoute())
- gotErr = handler(ctx, storedProposal.GetContent())
- require.NoError(t, gotErr)
+ _, err := msgServer.ExecLegacyContent(sdk.WrapSDKContext(ctx), v1.NewMsgExecLegacyContent(contentMsg.Content, govAuthority))
+ require.NoError(t, err)
// then
for i := range spec.accessConfigUpdates {
diff --git a/x/wasm/keeper/querier.go b/x/wasm/keeper/querier.go
index cd573ab5a3..fb33b4ca00 100644
--- a/x/wasm/keeper/querier.go
+++ b/x/wasm/keeper/querier.go
@@ -6,13 +6,13 @@ import (
"runtime/debug"
"github.com/cosmos/cosmos-sdk/codec"
- "google.golang.org/grpc/codes"
- "google.golang.org/grpc/status"
-
"github.com/cosmos/cosmos-sdk/store/prefix"
+ storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/types/query"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/status"
"github.com/CosmWasm/wasmd/x/wasm/types"
)
@@ -21,13 +21,13 @@ var _ types.QueryServer = &grpcQuerier{}
type grpcQuerier struct {
cdc codec.Codec
- storeKey sdk.StoreKey
+ storeKey storetypes.StoreKey
keeper types.ViewKeeper
queryGasLimit sdk.Gas
}
// NewGrpcQuerier constructor
-func NewGrpcQuerier(cdc codec.Codec, storeKey sdk.StoreKey, keeper types.ViewKeeper, queryGasLimit sdk.Gas) *grpcQuerier { //nolint:revive
+func NewGrpcQuerier(cdc codec.Codec, storeKey storetypes.StoreKey, keeper types.ViewKeeper, queryGasLimit sdk.Gas) *grpcQuerier { //nolint:revive
return &grpcQuerier{cdc: cdc, storeKey: storeKey, keeper: keeper, queryGasLimit: queryGasLimit}
}
diff --git a/x/wasm/keeper/querier_test.go b/x/wasm/keeper/querier_test.go
index 9568ad97d5..fa0971cbf9 100644
--- a/x/wasm/keeper/querier_test.go
+++ b/x/wasm/keeper/querier_test.go
@@ -9,18 +9,17 @@ import (
"testing"
"time"
- "google.golang.org/grpc/codes"
- "google.golang.org/grpc/status"
-
wasmvm "github.com/CosmWasm/wasmvm"
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
+ "github.com/cometbft/cometbft/libs/log"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkErrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/types/query"
- govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
+ govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- "github.com/tendermint/tendermint/libs/log"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/status"
"github.com/CosmWasm/wasmd/x/wasm/keeper/wasmtesting"
"github.com/CosmWasm/wasmd/x/wasm/types"
@@ -543,18 +542,19 @@ func TestQueryContractInfo(t *testing.T) {
// register an example extension. must be protobuf
keepers.EncodingConfig.InterfaceRegistry.RegisterImplementations(
(*types.ContractInfoExtension)(nil),
- &govtypes.Proposal{},
+ &govv1beta1.Proposal{},
)
- govtypes.RegisterInterfaces(keepers.EncodingConfig.InterfaceRegistry)
+ govv1beta1.RegisterInterfaces(keepers.EncodingConfig.InterfaceRegistry)
k := keepers.WasmKeeper
querier := NewGrpcQuerier(k.cdc, k.storeKey, k, k.queryGasLimit)
myExtension := func(info *types.ContractInfo) {
// abuse gov proposal as a random protobuf extension with an Any type
- myExt, err := govtypes.NewProposal(&govtypes.TextProposal{Title: "foo", Description: "bar"}, 1, anyDate, anyDate)
+ myExt, err := govv1beta1.NewProposal(&govv1beta1.TextProposal{Title: "foo", Description: "bar"}, 1, anyDate, anyDate)
require.NoError(t, err)
myExt.TotalDeposit = nil
- info.SetExtension(&myExt)
+ err = info.SetExtension(&myExt)
+ require.NoError(t, err)
}
specs := map[string]struct {
src *types.QueryContractInfoRequest
@@ -695,19 +695,19 @@ func TestQueryCodeInfo(t *testing.T) {
anyAddress, err := sdk.AccAddressFromBech32("cosmos100dejzacpanrldpjjwksjm62shqhyss44jf5xz")
require.NoError(t, err)
specs := map[string]struct {
- codeId uint64
+ codeID uint64
accessConfig types.AccessConfig
}{
"everybody": {
- codeId: 1,
+ codeID: 1,
accessConfig: types.AllowEverybody,
},
"nobody": {
- codeId: 10,
+ codeID: 10,
accessConfig: types.AllowNobody,
},
"with_address": {
- codeId: 20,
+ codeID: 20,
accessConfig: types.AccessTypeOnlyAddress.With(anyAddress),
},
}
@@ -715,19 +715,19 @@ func TestQueryCodeInfo(t *testing.T) {
t.Run(msg, func(t *testing.T) {
codeInfo := types.CodeInfoFixture(types.WithSHA256CodeHash(wasmCode))
codeInfo.InstantiateConfig = spec.accessConfig
- require.NoError(t, keeper.importCode(ctx, spec.codeId,
+ require.NoError(t, keeper.importCode(ctx, spec.codeID,
codeInfo,
wasmCode),
)
q := Querier(keeper)
got, err := q.Code(sdk.WrapSDKContext(ctx), &types.QueryCodeRequest{
- CodeId: spec.codeId,
+ CodeId: spec.codeID,
})
require.NoError(t, err)
expectedResponse := &types.QueryCodeResponse{
CodeInfoResponse: &types.CodeInfoResponse{
- CodeID: spec.codeId,
+ CodeID: spec.codeID,
Creator: codeInfo.Creator,
DataHash: codeInfo.CodeHash,
InstantiatePermission: spec.accessConfig,
@@ -757,22 +757,22 @@ func TestQueryCodeInfoList(t *testing.T) {
codes := []struct {
name string
- codeId uint64
+ codeID uint64
codeInfo types.CodeInfo
}{
{
name: "everybody",
- codeId: 1,
+ codeID: 1,
codeInfo: codeInfoWithConfig(types.AllowEverybody),
},
{
- codeId: 10,
+ codeID: 10,
name: "nobody",
codeInfo: codeInfoWithConfig(types.AllowNobody),
},
{
name: "with_address",
- codeId: 20,
+ codeID: 20,
codeInfo: codeInfoWithConfig(types.AccessTypeOnlyAddress.With(anyAddress)),
},
}
@@ -780,14 +780,14 @@ func TestQueryCodeInfoList(t *testing.T) {
allCodesResponse := make([]types.CodeInfoResponse, 0)
for _, code := range codes {
t.Run(fmt.Sprintf("import_%s", code.name), func(t *testing.T) {
- require.NoError(t, keeper.importCode(ctx, code.codeId,
+ require.NoError(t, keeper.importCode(ctx, code.codeID,
code.codeInfo,
wasmCode),
)
})
allCodesResponse = append(allCodesResponse, types.CodeInfoResponse{
- CodeID: code.codeId,
+ CodeID: code.codeID,
Creator: code.codeInfo.Creator,
DataHash: code.codeInfo.CodeHash,
InstantiatePermission: code.codeInfo.InstantiateConfig,
diff --git a/x/wasm/keeper/query_plugins.go b/x/wasm/keeper/query_plugins.go
index 91abcf5dc6..fa694f1a40 100644
--- a/x/wasm/keeper/query_plugins.go
+++ b/x/wasm/keeper/query_plugins.go
@@ -5,19 +5,17 @@ import (
"errors"
"fmt"
+ wasmvmtypes "github.com/CosmWasm/wasmvm/types"
+ abci "github.com/cometbft/cometbft/abci/types"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/codec"
- abci "github.com/tendermint/tendermint/abci/types"
-
- channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"
-
- "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"
distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
+
+ "github.com/CosmWasm/wasmd/x/wasm/types"
)
type QueryHandler struct {
@@ -600,6 +598,7 @@ func ConvertProtoToJSONMarshal(cdc codec.Codec, protoResponse codec.ProtoMarshal
return nil, sdkerrors.Wrap(err, "to json")
}
+ protoResponse.Reset()
return bz, nil
}
diff --git a/x/wasm/keeper/query_plugins_test.go b/x/wasm/keeper/query_plugins_test.go
index c28a4462a3..071552540f 100644
--- a/x/wasm/keeper/query_plugins_test.go
+++ b/x/wasm/keeper/query_plugins_test.go
@@ -8,6 +8,8 @@ import (
"time"
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
+ dbm "github.com/cometbft/cometbft-db"
+ tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
@@ -18,12 +20,10 @@ import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
- channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"
- "github.com/gogo/protobuf/proto"
+ "github.com/cosmos/gogoproto/proto"
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
- dbm "github.com/tendermint/tm-db"
"github.com/CosmWasm/wasmd/app"
"github.com/CosmWasm/wasmd/x/wasm/keeper"
@@ -89,7 +89,7 @@ func TestIBCQuerier(t *testing.T) {
srcQuery *wasmvmtypes.IBCQuery
wasmKeeper *mockWasmQueryKeeper
channelKeeper *wasmtesting.MockChannelKeeper
- expJsonResult string
+ expJSONResult string
expErr *sdkerrors.Error
}{
"query port id": {
@@ -102,7 +102,7 @@ func TestIBCQuerier(t *testing.T) {
},
},
channelKeeper: &wasmtesting.MockChannelKeeper{},
- expJsonResult: `{"port_id":"myIBCPortID"}`,
+ expJSONResult: `{"port_id":"myIBCPortID"}`,
},
"query list channels - all": {
srcQuery: &wasmvmtypes.IBCQuery{
@@ -111,7 +111,7 @@ func TestIBCQuerier(t *testing.T) {
channelKeeper: &wasmtesting.MockChannelKeeper{
IterateChannelsFn: wasmtesting.MockChannelKeeperIterator(myExampleChannels),
},
- expJsonResult: `{
+ expJSONResult: `{
"channels": [
{
"endpoint": {
@@ -151,7 +151,7 @@ func TestIBCQuerier(t *testing.T) {
channelKeeper: &wasmtesting.MockChannelKeeper{
IterateChannelsFn: wasmtesting.MockChannelKeeperIterator(myExampleChannels),
},
- expJsonResult: `{
+ expJSONResult: `{
"channels": [
{
"endpoint": {
@@ -178,7 +178,7 @@ func TestIBCQuerier(t *testing.T) {
channelKeeper: &wasmtesting.MockChannelKeeper{
IterateChannelsFn: wasmtesting.MockChannelKeeperIterator(myExampleChannels),
},
- expJsonResult: `{"channels": []}`,
+ expJSONResult: `{"channels": []}`,
},
"query channel": {
srcQuery: &wasmvmtypes.IBCQuery{
@@ -201,7 +201,7 @@ func TestIBCQuerier(t *testing.T) {
}, true
},
},
- expJsonResult: `{
+ expJSONResult: `{
"channel": {
"endpoint": {
"port_id": "myQueryPortID",
@@ -242,7 +242,7 @@ func TestIBCQuerier(t *testing.T) {
}, true
},
},
- expJsonResult: `{
+ expJSONResult: `{
"channel": {
"endpoint": {
"port_id": "myLoadedPortID",
@@ -278,7 +278,7 @@ func TestIBCQuerier(t *testing.T) {
}, true
},
},
- expJsonResult: "{}",
+ expJSONResult: "{}",
},
"query channel in closed state": {
srcQuery: &wasmvmtypes.IBCQuery{
@@ -301,7 +301,7 @@ func TestIBCQuerier(t *testing.T) {
}, true
},
},
- expJsonResult: "{}",
+ expJSONResult: "{}",
},
"query channel - empty result": {
srcQuery: &wasmvmtypes.IBCQuery{
@@ -315,7 +315,7 @@ func TestIBCQuerier(t *testing.T) {
return channeltypes.Channel{}, false
},
},
- expJsonResult: "{}",
+ expJSONResult: "{}",
},
}
for name, spec := range specs {
@@ -326,7 +326,7 @@ func TestIBCQuerier(t *testing.T) {
if spec.expErr != nil {
return
}
- assert.JSONEq(t, spec.expJsonResult, string(gotResult), string(gotResult))
+ assert.JSONEq(t, spec.expJSONResult, string(gotResult), string(gotResult))
})
}
}
@@ -566,9 +566,10 @@ func TestQueryErrors(t *testing.T) {
func TestAcceptListStargateQuerier(t *testing.T) {
wasmApp := app.SetupWithEmptyStore(t)
ctx := wasmApp.NewUncachedContext(false, tmproto.Header{ChainID: "foo", Height: 1, Time: time.Now()})
- wasmApp.StakingKeeper.SetParams(ctx, stakingtypes.DefaultParams())
+ err := wasmApp.StakingKeeper.SetParams(ctx, stakingtypes.DefaultParams())
+ require.NoError(t, err)
- addrs := app.AddTestAddrs(wasmApp, ctx, 2, sdk.NewInt(1_000_000))
+ addrs := app.AddTestAddrsIncremental(wasmApp, ctx, 2, sdk.NewInt(1_000_000))
accepted := keeper.AcceptedStargateQueries{
"/cosmos.auth.v1beta1.Query/Account": &authtypes.QueryAccountResponse{},
"/no/route/to/this": &authtypes.QueryAccountResponse{},
@@ -749,6 +750,31 @@ func TestConvertProtoToJSONMarshal(t *testing.T) {
}
}
+func TestResetProtoMarshalerAfterJsonMarshal(t *testing.T) {
+ appCodec := app.MakeEncodingConfig().Marshaler
+
+ protoMarshaler := &banktypes.QueryAllBalancesResponse{}
+ expected := appCodec.MustMarshalJSON(&banktypes.QueryAllBalancesResponse{
+ Balances: sdk.NewCoins(sdk.NewCoin("bar", sdk.NewInt(30))),
+ Pagination: &query.PageResponse{
+ NextKey: []byte("foo"),
+ },
+ })
+
+ bz, err := hex.DecodeString("0a090a036261721202333012050a03666f6f")
+ require.NoError(t, err)
+
+ // first marshal
+ response, err := keeper.ConvertProtoToJSONMarshal(appCodec, protoMarshaler, bz)
+ require.NoError(t, err)
+ require.Equal(t, expected, response)
+
+ // second marshal
+ response, err = keeper.ConvertProtoToJSONMarshal(appCodec, protoMarshaler, bz)
+ require.NoError(t, err)
+ require.Equal(t, expected, response)
+}
+
// TestDeterministicJsonMarshal tests that we get deterministic JSON marshalled response upon
// proto struct update in the state machine.
func TestDeterministicJsonMarshal(t *testing.T) {
diff --git a/x/wasm/keeper/recurse_test.go b/x/wasm/keeper/recurse_test.go
index 5bfb20bdec..73647df5fe 100644
--- a/x/wasm/keeper/recurse_test.go
+++ b/x/wasm/keeper/recurse_test.go
@@ -38,7 +38,7 @@ type recurseResponse struct {
// number os wasm queries called from a contract
var totalWasmQueryCounter int
-func initRecurseContract(t *testing.T) (contract sdk.AccAddress, creator sdk.AccAddress, ctx sdk.Context, keeper *Keeper) {
+func initRecurseContract(t *testing.T) (contract sdk.AccAddress, creator sdk.AccAddress, ctx sdk.Context, keeper *Keeper) { //nolint:unparam
countingQuerierDec := func(realWasmQuerier WasmVMQueryHandler) WasmVMQueryHandler {
return WasmVMQueryHandlerFn(func(ctx sdk.Context, caller sdk.AccAddress, request wasmvmtypes.QueryRequest) ([]byte, error) {
totalWasmQueryCounter++
diff --git a/x/wasm/keeper/reflect_test.go b/x/wasm/keeper/reflect_test.go
index 1336be7fee..d441b67685 100644
--- a/x/wasm/keeper/reflect_test.go
+++ b/x/wasm/keeper/reflect_test.go
@@ -14,7 +14,7 @@ import (
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
- "github.com/golang/protobuf/proto"
+ "github.com/golang/protobuf/proto" //nolint:staticcheck // SA1019: proto is deprecated
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -262,7 +262,7 @@ func TestReflectStargateQuery(t *testing.T) {
funds := sdk.NewCoins(sdk.NewInt64Coin("denom", 320000))
contractStart := sdk.NewCoins(sdk.NewInt64Coin("denom", 40000))
- expectedBalance := funds.Sub(contractStart)
+ expectedBalance := funds.Sub(contractStart...)
creator := keepers.Faucet.NewFundedRandomAccount(ctx, funds...)
// upload code
@@ -331,7 +331,7 @@ func TestReflectTotalSupplyQuery(t *testing.T) {
Chain: &testdata.ChainQuery{
Request: &wasmvmtypes.QueryRequest{
Bank: &wasmvmtypes.BankQuery{
- Supply: &wasmvmtypes.SupplyQuery{spec.denom},
+ Supply: &wasmvmtypes.SupplyQuery{Denom: spec.denom},
},
},
},
@@ -373,6 +373,7 @@ func TestReflectInvalidStargateQuery(t *testing.T) {
Address: creator.String(),
}
protoQueryBin, err := proto.Marshal(&protoQuery)
+ require.NoError(t, err)
protoRequest := wasmvmtypes.QueryRequest{
Stargate: &wasmvmtypes.StargateQuery{
Path: "/cosmos.bank.v1beta1.Query/AllBalances",
@@ -575,7 +576,7 @@ func toReflectRawMsg(cdc codec.Codec, msg sdk.Msg) (wasmvmtypes.CosmosMsg, error
if err != nil {
return wasmvmtypes.CosmosMsg{}, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())
}
- customMsg, err := json.Marshal(reflectCustomMsg{
+ customMsg, _ := json.Marshal(reflectCustomMsg{
Raw: rawBz,
})
res := wasmvmtypes.CosmosMsg{
@@ -628,19 +629,10 @@ type customQueryResponse struct {
Msg string `json:"msg"`
}
-// these are the return values from contract -> go depending on type of query
-type ownerResponse struct {
- Owner string `json:"owner"`
-}
-
type capitalizedResponse struct {
Text string `json:"text"`
}
-type chainResponse struct {
- Data []byte `json:"data"`
-}
-
// reflectPlugins needs to be registered in test setup to handle custom query callbacks
func reflectPlugins() *QueryPlugins {
return &QueryPlugins{
diff --git a/x/wasm/keeper/snapshotter.go b/x/wasm/keeper/snapshotter.go
index fcece63714..1565e96a86 100644
--- a/x/wasm/keeper/snapshotter.go
+++ b/x/wasm/keeper/snapshotter.go
@@ -4,12 +4,11 @@ import (
"encoding/hex"
"io"
+ "github.com/cometbft/cometbft/libs/log"
+ tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
snapshot "github.com/cosmos/cosmos-sdk/snapshots/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
- protoio "github.com/gogo/protobuf/io"
- "github.com/tendermint/tendermint/libs/log"
- tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"github.com/CosmWasm/wasmd/x/wasm/ioutils"
"github.com/CosmWasm/wasmd/x/wasm/types"
@@ -45,7 +44,7 @@ func (ws *WasmSnapshotter) SupportedFormats() []uint32 {
return []uint32{SnapshotFormat}
}
-func (ws *WasmSnapshotter) Snapshot(height uint64, protoWriter protoio.Writer) error {
+func (ws *WasmSnapshotter) SnapshotExtension(height uint64, payloadWriter snapshot.ExtensionPayloadWriter) error {
cacheMS, err := ws.cms.CacheMultiStoreWithVersion(int64(height))
if err != nil {
return err
@@ -77,7 +76,7 @@ func (ws *WasmSnapshotter) Snapshot(height uint64, protoWriter protoio.Writer) e
return true
}
- err = snapshot.WriteExtensionItem(protoWriter, compressedWasm)
+ err = payloadWriter(compressedWasm)
if err != nil {
rerr = err
return true
@@ -89,13 +88,11 @@ func (ws *WasmSnapshotter) Snapshot(height uint64, protoWriter protoio.Writer) e
return rerr
}
-func (ws *WasmSnapshotter) Restore(
- height uint64, format uint32, protoReader protoio.Reader,
-) (snapshot.SnapshotItem, error) {
+func (ws *WasmSnapshotter) RestoreExtension(height uint64, format uint32, payloadReader snapshot.ExtensionPayloadReader) error {
if format == SnapshotFormat {
- return ws.processAllItems(height, protoReader, restoreV1, finalizeV1)
+ return ws.processAllItems(height, payloadReader, restoreV1, finalizeV1)
}
- return snapshot.SnapshotItem{}, snapshot.ErrUnknownFormat
+ return snapshot.ErrUnknownFormat
}
func restoreV1(ctx sdk.Context, k *Keeper, compressedCode []byte) error {
@@ -122,35 +119,23 @@ func finalizeV1(ctx sdk.Context, k *Keeper) error {
func (ws *WasmSnapshotter) processAllItems(
height uint64,
- protoReader protoio.Reader,
+ payloadReader snapshot.ExtensionPayloadReader,
cb func(sdk.Context, *Keeper, []byte) error,
finalize func(sdk.Context, *Keeper) error,
-) (snapshot.SnapshotItem, error) {
+) error {
ctx := sdk.NewContext(ws.cms, tmproto.Header{Height: int64(height)}, false, log.NewNopLogger())
-
- // keep the last item here... if we break, it will either be empty (if we hit io.EOF)
- // or contain the last item (if we hit payload == nil)
- var item snapshot.SnapshotItem
for {
- item = snapshot.SnapshotItem{}
- err := protoReader.ReadMsg(&item)
+ payload, err := payloadReader()
if err == io.EOF {
break
} else if err != nil {
- return snapshot.SnapshotItem{}, sdkerrors.Wrap(err, "invalid protobuf message")
- }
-
- // if it is not another ExtensionPayload message, then it is not for us.
- // we should return it an let the manager handle this one
- payload := item.GetExtensionPayload()
- if payload == nil {
- break
+ return err
}
- if err := cb(ctx, ws.wasm, payload.Payload); err != nil {
- return snapshot.SnapshotItem{}, sdkerrors.Wrap(err, "processing snapshot item")
+ if err := cb(ctx, ws.wasm, payload); err != nil {
+ return sdkerrors.Wrap(err, "processing snapshot item")
}
}
- return item, finalize(ctx, ws.wasm)
+ return finalize(ctx, ws.wasm)
}
diff --git a/x/wasm/keeper/snapshotter_integration_test.go b/x/wasm/keeper/snapshotter_integration_test.go
index 432d56c79d..2e4fe6c2a1 100644
--- a/x/wasm/keeper/snapshotter_integration_test.go
+++ b/x/wasm/keeper/snapshotter_integration_test.go
@@ -10,14 +10,14 @@ import (
"github.com/stretchr/testify/assert"
+ tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
+ tmtypes "github.com/cometbft/cometbft/types"
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec"
"github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/stretchr/testify/require"
- tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
- tmtypes "github.com/tendermint/tendermint/types"
"github.com/CosmWasm/wasmd/app"
"github.com/CosmWasm/wasmd/x/wasm/keeper"
@@ -48,7 +48,7 @@ func TestSnapshotter(t *testing.T) {
Height: srcWasmApp.LastBlockHeight() + 1,
Time: time.Now(),
})
- wasmKeeper := app.NewTestSupport(t, srcWasmApp).WasmKeeper()
+ wasmKeeper := srcWasmApp.WasmKeeper
contractKeeper := keeper.NewDefaultPermissionKeeper(&wasmKeeper)
srcCodeIDToChecksum := make(map[uint64][]byte, len(spec.wasmFiles))
@@ -81,7 +81,7 @@ func TestSnapshotter(t *testing.T) {
}
// then all wasm contracts are imported
- wasmKeeper = app.NewTestSupport(t, destWasmApp).WasmKeeper()
+ wasmKeeper = destWasmApp.WasmKeeper
ctx = destWasmApp.NewUncachedContext(false, tmproto.Header{
ChainID: "foo",
Height: destWasmApp.LastBlockHeight() + 1,
diff --git a/x/wasm/keeper/staking_test.go b/x/wasm/keeper/staking_test.go
index 23ca71819b..86f9cadc02 100644
--- a/x/wasm/keeper/staking_test.go
+++ b/x/wasm/keeper/staking_test.go
@@ -12,10 +12,8 @@ import (
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
distributionkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
- distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
"github.com/cosmos/cosmos-sdk/x/staking"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
- "github.com/cosmos/cosmos-sdk/x/staking/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -30,7 +28,7 @@ type StakingInitMsg struct {
Decimals uint8 `json:"decimals"`
Validator sdk.ValAddress `json:"validator"`
ExitTax sdk.Dec `json:"exit_tax"`
- // MinWithdrawal is uint128 encoded as a string (use sdk.Int?)
+ // MinWithdrawal is uint128 encoded as a string (use math.Int?)
MinWithdrawl string `json:"min_withdrawal"`
}
@@ -88,7 +86,7 @@ type InvestmentResponse struct {
Owner sdk.AccAddress `json:"owner"`
Validator sdk.ValAddress `json:"validator"`
ExitTax sdk.Dec `json:"exit_tax"`
- // MinWithdrawl is uint128 encoded as a string (use sdk.Int?)
+ // MinWithdrawl is uint128 encoded as a string (use math.Int?)
MinWithdrawl string `json:"min_withdrawal"`
}
@@ -159,7 +157,7 @@ type initInfo struct {
ctx sdk.Context
accKeeper authkeeper.AccountKeeper
- stakingKeeper stakingkeeper.Keeper
+ stakingKeeper *stakingkeeper.Keeper
distKeeper distributionkeeper.Keeper
wasmKeeper Keeper
contractKeeper wasmtypes.ContractOpsKeeper
@@ -174,12 +172,6 @@ func initializeStaking(t *testing.T) initInfo {
valAddr := addValidator(t, ctx, stakingKeeper, k.Faucet, sdk.NewInt64Coin("stake", 1000000))
ctx = nextBlock(ctx, stakingKeeper)
- // set some baseline - this seems to be needed
- k.DistKeeper.SetValidatorHistoricalRewards(ctx, valAddr, 0, distributiontypes.ValidatorHistoricalRewards{
- CumulativeRewardRatio: sdk.DecCoins{},
- ReferenceCount: 1,
- })
-
v, found := stakingKeeper.GetValidator(ctx, valAddr)
assert.True(t, found)
assert.Equal(t, v.GetDelegatorShares(), sdk.NewDec(1000000))
@@ -482,7 +474,7 @@ func TestQueryStakingInfo(t *testing.T) {
mustParse(t, res, &reflectRes)
var allValidatorsRes wasmvmtypes.AllValidatorsResponse
mustParse(t, reflectRes.Data, &allValidatorsRes)
- require.Len(t, allValidatorsRes.Validators, 1)
+ require.Len(t, allValidatorsRes.Validators, 1, string(res))
valInfo := allValidatorsRes.Validators[0]
// Note: this ValAddress not AccAddress, may change with #264
require.Equal(t, valAddr.String(), valInfo.Address)
@@ -550,7 +542,7 @@ func TestQueryStakingInfo(t *testing.T) {
require.Equal(t, funds[0].Denom, delInfo.Amount.Denom)
require.Equal(t, funds[0].Amount.String(), delInfo.Amount.Amount)
- // test to get one delegations
+ // test to get one delegation
reflectDelegationQuery := testdata.ReflectQueryMsg{Chain: &testdata.ChainQuery{Request: &wasmvmtypes.QueryRequest{Staking: &wasmvmtypes.StakingQuery{
Delegation: &wasmvmtypes.DelegationQuery{
Validator: valAddr.String(),
@@ -562,6 +554,7 @@ func TestQueryStakingInfo(t *testing.T) {
require.NoError(t, err)
// first we pull out the data from chain response, before parsing the original response
mustParse(t, res, &reflectRes)
+
var delegationRes wasmvmtypes.DelegationResponse
mustParse(t, reflectRes.Data, &delegationRes)
assert.NotEmpty(t, delegationRes.Delegation)
@@ -626,7 +619,7 @@ func TestQueryStakingPlugin(t *testing.T) {
Validator: valAddr.String(),
},
}
- raw, err := StakingQuerier(stakingKeeper, distKeeper)(ctx, &query)
+ raw, err := StakingQuerier(stakingKeeper, distributionkeeper.NewQuerier(distKeeper))(ctx, &query)
require.NoError(t, err)
var res wasmvmtypes.DelegationResponse
mustParse(t, raw, &res)
@@ -651,7 +644,7 @@ func TestQueryStakingPlugin(t *testing.T) {
}
// adds a few validators and returns a list of validators that are registered
-func addValidator(t *testing.T, ctx sdk.Context, stakingKeeper stakingkeeper.Keeper, faucet *TestFaucet, value sdk.Coin) sdk.ValAddress {
+func addValidator(t *testing.T, ctx sdk.Context, stakingKeeper *stakingkeeper.Keeper, faucet *TestFaucet, value sdk.Coin) sdk.ValAddress {
owner := faucet.NewFundedRandomAccount(ctx, value)
privKey := secp256k1.GenPrivKey()
@@ -660,11 +653,11 @@ func addValidator(t *testing.T, ctx sdk.Context, stakingKeeper stakingkeeper.Kee
pkAny, err := codectypes.NewAnyWithValue(pubKey)
require.NoError(t, err)
- msg := stakingtypes.MsgCreateValidator{
- Description: types.Description{
+ msg := &stakingtypes.MsgCreateValidator{
+ Description: stakingtypes.Description{
Moniker: "Validator power",
},
- Commission: types.CommissionRates{
+ Commission: stakingtypes.CommissionRates{
Rate: sdk.MustNewDecFromStr("0.1"),
MaxRate: sdk.MustNewDecFromStr("0.2"),
MaxChangeRate: sdk.MustNewDecFromStr("0.01"),
@@ -675,23 +668,21 @@ func addValidator(t *testing.T, ctx sdk.Context, stakingKeeper stakingkeeper.Kee
Pubkey: pkAny,
Value: value,
}
-
- h := staking.NewHandler(stakingKeeper)
- _, err = h(ctx, &msg)
+ _, err = stakingkeeper.NewMsgServerImpl(stakingKeeper).CreateValidator(sdk.WrapSDKContext(ctx), msg)
require.NoError(t, err)
return addr
}
// this will commit the current set, update the block height and set historic info
// basically, letting two blocks pass
-func nextBlock(ctx sdk.Context, stakingKeeper stakingkeeper.Keeper) sdk.Context {
+func nextBlock(ctx sdk.Context, stakingKeeper *stakingkeeper.Keeper) sdk.Context {
staking.EndBlocker(ctx, stakingKeeper)
ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1)
staking.BeginBlocker(ctx, stakingKeeper)
return ctx
}
-func setValidatorRewards(ctx sdk.Context, stakingKeeper stakingkeeper.Keeper, distKeeper distributionkeeper.Keeper, valAddr sdk.ValAddress, reward string) {
+func setValidatorRewards(ctx sdk.Context, stakingKeeper *stakingkeeper.Keeper, distKeeper distributionkeeper.Keeper, valAddr sdk.ValAddress, reward string) {
// allocate some rewards
vali := stakingKeeper.Validator(ctx, valAddr)
amount, err := sdk.NewDecFromStr(reward)
diff --git a/x/wasm/keeper/submsg_test.go b/x/wasm/keeper/submsg_test.go
index cd2555fef7..f2c9d7d9c2 100644
--- a/x/wasm/keeper/submsg_test.go
+++ b/x/wasm/keeper/submsg_test.go
@@ -27,7 +27,7 @@ func TestDispatchSubMsgSuccessCase(t *testing.T) {
contractStart := sdk.NewCoins(sdk.NewInt64Coin("denom", 40000))
creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...)
- creatorBalance := deposit.Sub(contractStart)
+ creatorBalance := deposit.Sub(contractStart...)
_, _, fred := keyPubAddr()
// upload code
@@ -236,7 +236,7 @@ func TestDispatchSubMsgErrorHandling(t *testing.T) {
"send tokens": {
submsgID: 5,
msg: validBankSend,
- resultAssertions: []assertion{assertReturnedEvents(0), assertGasUsed(95000, 96000)},
+ resultAssertions: []assertion{assertReturnedEvents(0), assertGasUsed(102000, 103000)},
},
"not enough tokens": {
submsgID: 6,
@@ -256,7 +256,7 @@ func TestDispatchSubMsgErrorHandling(t *testing.T) {
msg: validBankSend,
gasLimit: &subGasLimit,
// uses same gas as call without limit (note we do not charge the 40k on reply)
- resultAssertions: []assertion{assertReturnedEvents(0), assertGasUsed(95000, 96000)},
+ resultAssertions: []assertion{assertReturnedEvents(0), assertGasUsed(102000, 103000)},
},
"not enough tokens with limit": {
submsgID: 16,
@@ -264,7 +264,7 @@ func TestDispatchSubMsgErrorHandling(t *testing.T) {
subMsgError: true,
gasLimit: &subGasLimit,
// uses same gas as call without limit (note we do not charge the 40k on reply)
- resultAssertions: []assertion{assertGasUsed(77800, 77900), assertErrorString("codespace: sdk, code: 5")},
+ resultAssertions: []assertion{assertGasUsed(77700, 77800), assertErrorString("codespace: sdk, code: 5")},
},
"out of gas caught with gas limit": {
submsgID: 17,
@@ -501,7 +501,7 @@ func TestDispatchSubMsgConditionalReplyOn(t *testing.T) {
},
}
- var id uint64 = 0
+ var id uint64
for name, tc := range cases {
id++
t.Run(name, func(t *testing.T) {
diff --git a/x/wasm/keeper/test_common.go b/x/wasm/keeper/test_common.go
index b84e0025a3..8c62af71c1 100644
--- a/x/wasm/keeper/test_common.go
+++ b/x/wasm/keeper/test_common.go
@@ -9,10 +9,17 @@ import (
"testing"
"time"
+ dbm "github.com/cometbft/cometbft-db"
+ "github.com/cometbft/cometbft/crypto"
+ "github.com/cometbft/cometbft/crypto/ed25519"
+ "github.com/cometbft/cometbft/libs/log"
+ "github.com/cometbft/cometbft/libs/rand"
+ tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/std"
"github.com/cosmos/cosmos-sdk/store"
+ storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/address"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
@@ -31,15 +38,17 @@ import (
"github.com/cosmos/cosmos-sdk/x/crisis"
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
"github.com/cosmos/cosmos-sdk/x/distribution"
- distrclient "github.com/cosmos/cosmos-sdk/x/distribution/client"
distributionkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
distributiontypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
"github.com/cosmos/cosmos-sdk/x/evidence"
evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types"
"github.com/cosmos/cosmos-sdk/x/feegrant"
"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"
+ govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
+ govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
"github.com/cosmos/cosmos-sdk/x/mint"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
"github.com/cosmos/cosmos-sdk/x/params"
@@ -56,18 +65,12 @@ import (
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"
- "github.com/cosmos/ibc-go/v4/modules/apps/transfer"
- ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
- ibc "github.com/cosmos/ibc-go/v4/modules/core"
- ibchost "github.com/cosmos/ibc-go/v4/modules/core/24-host"
- ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper"
+ "github.com/cosmos/ibc-go/v7/modules/apps/transfer"
+ ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
+ ibc "github.com/cosmos/ibc-go/v7/modules/core"
+ ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
+ ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
"github.com/stretchr/testify/require"
- "github.com/tendermint/tendermint/crypto"
- "github.com/tendermint/tendermint/crypto/ed25519"
- "github.com/tendermint/tendermint/libs/log"
- "github.com/tendermint/tendermint/libs/rand"
- tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
- dbm "github.com/tendermint/tm-db"
wasmappparams "github.com/CosmWasm/wasmd/app/params"
"github.com/CosmWasm/wasmd/x/wasm/keeper/wasmtesting"
@@ -81,9 +84,11 @@ var moduleBasics = module.NewBasicManager(
staking.AppModuleBasic{},
mint.AppModuleBasic{},
distribution.AppModuleBasic{},
- gov.NewAppModuleBasic(
- paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.ProposalHandler,
- ),
+ gov.NewAppModuleBasic([]govclient.ProposalHandler{
+ paramsclient.ProposalHandler,
+ upgradeclient.LegacyProposalHandler,
+ upgradeclient.LegacyCancelProposalHandler,
+ }),
params.AppModuleBasic{},
crisis.AppModuleBasic{},
slashing.AppModuleBasic{},
@@ -121,6 +126,7 @@ var TestingStakeParams = stakingtypes.Params{
MaxEntries: 10,
HistoricalEntries: 10,
BondDenom: "stake",
+ MinCommissionRate: stakingtypes.DefaultMinCommissionRate,
}
type TestFaucet struct {
@@ -160,7 +166,7 @@ func (f *TestFaucet) Fund(parentCtx sdk.Context, receiver sdk.AccAddress, amount
ctx := parentCtx.WithEventManager(sdk.NewEventManager()) // discard all faucet related events
err := f.bankKeeper.SendCoins(ctx, f.sender, receiver, amounts)
require.NoError(f.t, err)
- f.balance = f.balance.Sub(amounts)
+ f.balance = f.balance.Sub(amounts...)
}
func (f *TestFaucet) NewFundedRandomAccount(ctx sdk.Context, amounts ...sdk.Coin) sdk.AccAddress {
@@ -171,14 +177,14 @@ func (f *TestFaucet) NewFundedRandomAccount(ctx sdk.Context, amounts ...sdk.Coin
type TestKeepers struct {
AccountKeeper authkeeper.AccountKeeper
- StakingKeeper stakingkeeper.Keeper
+ StakingKeeper *stakingkeeper.Keeper
DistKeeper distributionkeeper.Keeper
BankKeeper bankkeeper.Keeper
- GovKeeper govkeeper.Keeper
+ GovKeeper *govkeeper.Keeper
ContractKeeper types.ContractOpsKeeper
WasmKeeper *Keeper
IBCKeeper *ibckeeper.Keeper
- Router *baseapp.Router
+ Router MessageRouter
EncodingConfig wasmappparams.EncodingConfig
Faucet *TestFaucet
MultiStore sdk.CommitMultiStore
@@ -210,23 +216,23 @@ func createTestInput(
keys := sdk.NewKVStoreKeys(
authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey,
minttypes.StoreKey, distributiontypes.StoreKey, slashingtypes.StoreKey,
- govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey,
+ govtypes.StoreKey, paramstypes.StoreKey, ibcexported.StoreKey, upgradetypes.StoreKey,
evidencetypes.StoreKey, ibctransfertypes.StoreKey,
capabilitytypes.StoreKey, feegrant.StoreKey, authzkeeper.StoreKey,
types.StoreKey,
)
ms := store.NewCommitMultiStore(db)
for _, v := range keys {
- ms.MountStoreWithDB(v, sdk.StoreTypeIAVL, db)
+ ms.MountStoreWithDB(v, storetypes.StoreTypeIAVL, db)
}
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
for _, v := range tkeys {
- ms.MountStoreWithDB(v, sdk.StoreTypeTransient, db)
+ ms.MountStoreWithDB(v, storetypes.StoreTypeTransient, db)
}
memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)
for _, v := range memKeys {
- ms.MountStoreWithDB(v, sdk.StoreTypeMemory, db)
+ ms.MountStoreWithDB(v, storetypes.StoreTypeMemory, db)
}
require.NoError(t, ms.LoadLatestVersion())
@@ -256,7 +262,7 @@ func createTestInput(
crisistypes.ModuleName,
ibctransfertypes.ModuleName,
capabilitytypes.ModuleName,
- ibchost.ModuleName,
+ ibcexported.ModuleName,
govtypes.ModuleName,
types.ModuleName,
} {
@@ -279,45 +285,48 @@ func createTestInput(
}
accountKeeper := authkeeper.NewAccountKeeper(
appCodec,
- keys[authtypes.StoreKey], // target store
- subspace(authtypes.ModuleName),
+ keys[authtypes.StoreKey], // target store
authtypes.ProtoBaseAccount, // prototype
maccPerms,
+ sdk.Bech32MainPrefix,
+ authtypes.NewModuleAddress(authtypes.ModuleName).String(),
)
blockedAddrs := make(map[string]bool)
for acc := range maccPerms {
blockedAddrs[authtypes.NewModuleAddress(acc).String()] = true
}
+ require.NoError(t, accountKeeper.SetParams(ctx, authtypes.DefaultParams()))
+
bankKeeper := bankkeeper.NewBaseKeeper(
appCodec,
keys[banktypes.StoreKey],
accountKeeper,
- subspace(banktypes.ModuleName),
blockedAddrs,
+ authtypes.NewModuleAddress(banktypes.ModuleName).String(),
)
- bankKeeper.SetParams(ctx, banktypes.DefaultParams())
+ require.NoError(t, bankKeeper.SetParams(ctx, banktypes.DefaultParams()))
stakingKeeper := stakingkeeper.NewKeeper(
appCodec,
keys[stakingtypes.StoreKey],
accountKeeper,
bankKeeper,
- subspace(stakingtypes.ModuleName),
+ authtypes.NewModuleAddress(stakingtypes.ModuleName).String(),
)
- stakingKeeper.SetParams(ctx, TestingStakeParams)
+ stakingtypes.DefaultParams()
+ require.NoError(t, stakingKeeper.SetParams(ctx, TestingStakeParams))
distKeeper := distributionkeeper.NewKeeper(
appCodec,
keys[distributiontypes.StoreKey],
- subspace(distributiontypes.ModuleName),
accountKeeper,
bankKeeper,
stakingKeeper,
authtypes.FeeCollectorName,
- nil,
+ authtypes.NewModuleAddress(distributiontypes.ModuleName).String(),
)
- distKeeper.SetParams(ctx, distributiontypes.DefaultParams())
+ require.NoError(t, distKeeper.SetParams(ctx, distributiontypes.DefaultParams()))
stakingKeeper.SetHooks(distKeeper.Hooks())
// set genesis items required for distribution
@@ -329,6 +338,7 @@ func createTestInput(
appCodec,
tempDir,
nil,
+ authtypes.NewModuleAddress(upgradetypes.ModuleName).String(),
)
faucet := NewTestFaucet(t, ctx, bankKeeper, minttypes.ModuleName, sdk.NewCoin("stake", sdk.NewInt(100_000_000_000)))
@@ -344,26 +354,18 @@ func createTestInput(
keys[capabilitytypes.StoreKey],
memKeys[capabilitytypes.MemStoreKey],
)
- scopedIBCKeeper := capabilityKeeper.ScopeToModule(ibchost.ModuleName)
+ scopedIBCKeeper := capabilityKeeper.ScopeToModule(ibcexported.ModuleName)
scopedWasmKeeper := capabilityKeeper.ScopeToModule(types.ModuleName)
ibcKeeper := ibckeeper.NewKeeper(
appCodec,
- keys[ibchost.StoreKey],
- subspace(ibchost.ModuleName),
+ keys[ibcexported.StoreKey],
+ subspace(ibcexported.ModuleName),
stakingKeeper,
upgradeKeeper,
scopedIBCKeeper,
)
- router := baseapp.NewRouter()
- bh := bank.NewHandler(bankKeeper)
- router.AddRoute(sdk.NewRoute(banktypes.RouterKey, bh))
- sh := staking.NewHandler(stakingKeeper)
- router.AddRoute(sdk.NewRoute(stakingtypes.RouterKey, sh))
- dh := distribution.NewHandler(distKeeper)
- router.AddRoute(sdk.NewRoute(distributiontypes.RouterKey, dh))
-
querier := baseapp.NewGRPCQueryRouter()
querier.SetInterfaceRegistry(encodingConfig.InterfaceRegistry)
msgRouter := baseapp.NewMsgServiceRouter()
@@ -379,7 +381,7 @@ func createTestInput(
accountKeeper,
bankKeeper,
stakingKeeper,
- distKeeper,
+ distributionkeeper.NewQuerier(distKeeper),
ibcKeeper.ChannelKeeper,
&ibcKeeper.PortKeeper,
scopedWasmKeeper,
@@ -394,37 +396,35 @@ func createTestInput(
keeper.SetParams(ctx, types.DefaultParams())
// add wasm handler so we can loop-back (contracts calling contracts)
contractKeeper := NewDefaultPermissionKeeper(&keeper)
- router.AddRoute(sdk.NewRoute(types.RouterKey, TestHandler(contractKeeper)))
-
- am := module.NewManager( // minimal module set that we use for message/ query tests
- bank.NewAppModule(appCodec, bankKeeper, accountKeeper),
- staking.NewAppModule(appCodec, stakingKeeper, accountKeeper, bankKeeper),
- distribution.NewAppModule(appCodec, distKeeper, accountKeeper, bankKeeper, stakingKeeper),
- )
- am.RegisterServices(module.NewConfigurator(appCodec, msgRouter, querier))
- types.RegisterMsgServer(msgRouter, NewMsgServerImpl(NewDefaultPermissionKeeper(keeper)))
- types.RegisterQueryServer(querier, NewGrpcQuerier(appCodec, keys[types.ModuleName], keeper, keeper.queryGasLimit))
- govRouter := govtypes.NewRouter().
- AddRoute(govtypes.RouterKey, govtypes.ProposalHandler).
+ govRouter := govv1beta1.NewRouter().
+ AddRoute(govtypes.RouterKey, govv1beta1.ProposalHandler).
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(paramsKeeper)).
- AddRoute(distributiontypes.RouterKey, distribution.NewCommunityPoolSpendProposalHandler(distKeeper)).
AddRoute(types.RouterKey, NewWasmProposalHandler(&keeper, types.EnableAllProposals))
govKeeper := govkeeper.NewKeeper(
appCodec,
keys[govtypes.StoreKey],
- subspace(govtypes.ModuleName).WithKeyTable(govtypes.ParamKeyTable()),
accountKeeper,
bankKeeper,
stakingKeeper,
- govRouter,
+ msgRouter,
+ govtypes.DefaultConfig(),
+ authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
+ require.NoError(t, govKeeper.SetParams(ctx, govv1.DefaultParams()))
+ govKeeper.SetLegacyRouter(govRouter)
+ govKeeper.SetProposalID(ctx, 1)
- govKeeper.SetProposalID(ctx, govtypes.DefaultStartingProposalID)
- govKeeper.SetDepositParams(ctx, govtypes.DefaultDepositParams())
- govKeeper.SetVotingParams(ctx, govtypes.DefaultVotingParams())
- govKeeper.SetTallyParams(ctx, govtypes.DefaultTallyParams())
+ am := module.NewManager( // minimal module set that we use for message/ query tests
+ bank.NewAppModule(appCodec, bankKeeper, accountKeeper, subspace(banktypes.ModuleName)),
+ staking.NewAppModule(appCodec, stakingKeeper, accountKeeper, bankKeeper, subspace(stakingtypes.ModuleName)),
+ distribution.NewAppModule(appCodec, distKeeper, accountKeeper, bankKeeper, stakingKeeper, subspace(distributiontypes.ModuleName)),
+ gov.NewAppModule(appCodec, govKeeper, accountKeeper, bankKeeper, subspace(govtypes.ModuleName)),
+ )
+ am.RegisterServices(module.NewConfigurator(appCodec, msgRouter, querier))
+ types.RegisterMsgServer(msgRouter, NewMsgServerImpl(NewDefaultPermissionKeeper(keeper)))
+ types.RegisterQueryServer(querier, NewGrpcQuerier(appCodec, keys[types.ModuleName], keeper, keeper.queryGasLimit))
keepers := TestKeepers{
AccountKeeper: accountKeeper,
@@ -435,7 +435,7 @@ func createTestInput(
BankKeeper: bankKeeper,
GovKeeper: govKeeper,
IBCKeeper: ibcKeeper,
- Router: router,
+ Router: msgRouter,
EncodingConfig: encodingConfig,
Faucet: faucet,
MultiStore: ms,
@@ -445,8 +445,8 @@ func createTestInput(
}
// TestHandler returns a wasm handler for tests (to avoid circular imports)
-func TestHandler(k types.ContractOpsKeeper) sdk.Handler {
- return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {
+func TestHandler(k types.ContractOpsKeeper) MessageRouter {
+ return MessageRouterFunc(func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) {
ctx = ctx.WithEventManager(sdk.NewEventManager())
switch msg := msg.(type) {
case *types.MsgStoreCode:
@@ -459,7 +459,15 @@ func TestHandler(k types.ContractOpsKeeper) sdk.Handler {
errMsg := fmt.Sprintf("unrecognized wasm message type: %T", msg)
return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg)
}
- }
+ })
+}
+
+var _ MessageRouter = MessageRouterFunc(nil)
+
+type MessageRouterFunc func(ctx sdk.Context, req sdk.Msg) (*sdk.Result, error)
+
+func (m MessageRouterFunc) Handler(msg sdk.Msg) baseapp.MsgServiceHandler {
+ return m
}
func handleStoreCode(ctx sdk.Context, k types.ContractOpsKeeper, msg *types.MsgStoreCode) (*sdk.Result, error) {
@@ -747,7 +755,7 @@ var keyCounter uint64
// we need to make this deterministic (same every test run), as encoded address size and thus gas cost,
// depends on the actual bytes (due to ugly CanonicalAddress encoding)
-func keyPubAddr() (crypto.PrivKey, crypto.PubKey, sdk.AccAddress) {
+func keyPubAddr() (crypto.PrivKey, crypto.PubKey, sdk.AccAddress) { //nolint:unparam
keyCounter++
seed := make([]byte, 8)
binary.BigEndian.PutUint64(seed, keyCounter)
diff --git a/x/wasm/keeper/test_fuzz.go b/x/wasm/keeper/test_fuzz.go
index d6a2ce870d..c70cec6aca 100644
--- a/x/wasm/keeper/test_fuzz.go
+++ b/x/wasm/keeper/test_fuzz.go
@@ -3,9 +3,9 @@ package keeper
import (
"encoding/json"
+ tmBytes "github.com/cometbft/cometbft/libs/bytes"
sdk "github.com/cosmos/cosmos-sdk/types"
fuzz "github.com/google/gofuzz"
- tmBytes "github.com/tendermint/tendermint/libs/bytes"
"github.com/CosmWasm/wasmd/x/wasm/types"
)
diff --git a/x/wasm/keeper/wasmtesting/mock_engine.go b/x/wasm/keeper/wasmtesting/mock_engine.go
index 10c7fdfed2..eb094b3659 100644
--- a/x/wasm/keeper/wasmtesting/mock_engine.go
+++ b/x/wasm/keeper/wasmtesting/mock_engine.go
@@ -6,8 +6,8 @@ import (
wasmvm "github.com/CosmWasm/wasmvm"
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
+ "github.com/cometbft/cometbft/libs/rand"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
- "github.com/tendermint/tendermint/libs/rand"
"github.com/CosmWasm/wasmd/x/wasm/types"
)
diff --git a/x/wasm/keeper/wasmtesting/mock_keepers.go b/x/wasm/keeper/wasmtesting/mock_keepers.go
index 5977db1c80..edf9df0999 100644
--- a/x/wasm/keeper/wasmtesting/mock_keepers.go
+++ b/x/wasm/keeper/wasmtesting/mock_keepers.go
@@ -3,20 +3,19 @@ package wasmtesting
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"
+ clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
"github.com/CosmWasm/wasmd/x/wasm/types"
)
type MockChannelKeeper struct {
- GetChannelFn func(ctx sdk.Context, srcPort, srcChan string) (channel channeltypes.Channel, found bool)
- GetNextSequenceSendFn func(ctx sdk.Context, portID, channelID string) (uint64, bool)
- SendPacketFn func(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet ibcexported.PacketI) error
- ChanCloseInitFn func(ctx sdk.Context, portID, channelID string, chanCap *capabilitytypes.Capability) error
- GetAllChannelsFn func(ctx sdk.Context) []channeltypes.IdentifiedChannel
- IterateChannelsFn func(ctx sdk.Context, cb func(channeltypes.IdentifiedChannel) bool)
- SetChannelFn func(ctx sdk.Context, portID, channelID string, channel channeltypes.Channel)
+ GetChannelFn func(ctx sdk.Context, srcPort, srcChan string) (channel channeltypes.Channel, found bool)
+ SendPacketFn func(ctx sdk.Context, channelCap *capabilitytypes.Capability, sourcePort string, sourceChannel string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, data []byte) (uint64, error)
+ ChanCloseInitFn func(ctx sdk.Context, portID, channelID string, chanCap *capabilitytypes.Capability) error
+ GetAllChannelsFn func(ctx sdk.Context) []channeltypes.IdentifiedChannel
+ IterateChannelsFn func(ctx sdk.Context, cb func(channeltypes.IdentifiedChannel) bool)
+ SetChannelFn func(ctx sdk.Context, portID, channelID string, channel channeltypes.Channel)
}
func (m *MockChannelKeeper) GetChannel(ctx sdk.Context, srcPort, srcChan string) (channel channeltypes.Channel, found bool) {
@@ -33,18 +32,11 @@ func (m *MockChannelKeeper) GetAllChannels(ctx sdk.Context) []channeltypes.Ident
return m.GetAllChannelsFn(ctx)
}
-func (m *MockChannelKeeper) GetNextSequenceSend(ctx sdk.Context, portID, channelID string) (uint64, bool) {
- if m.GetNextSequenceSendFn == nil {
- panic("not supposed to be called!")
- }
- return m.GetNextSequenceSendFn(ctx, portID, channelID)
-}
-
-func (m *MockChannelKeeper) SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet ibcexported.PacketI) error {
+func (m *MockChannelKeeper) SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, sourcePort string, sourceChannel string, timeoutHeight clienttypes.Height, timeoutTimestamp uint64, data []byte) (uint64, error) {
if m.SendPacketFn == nil {
panic("not supposed to be called!")
}
- return m.SendPacketFn(ctx, channelCap, packet)
+ return m.SendPacketFn(ctx, channelCap, sourcePort, sourceChannel, timeoutHeight, timeoutTimestamp, data)
}
func (m *MockChannelKeeper) ChanCloseInit(ctx sdk.Context, portID, channelID string, chanCap *capabilitytypes.Capability) error {
diff --git a/x/wasm/module.go b/x/wasm/module.go
index cc83cf831f..9d22216199 100644
--- a/x/wasm/module.go
+++ b/x/wasm/module.go
@@ -8,7 +8,12 @@ import (
"runtime/debug"
"strings"
+ "cosmossdk.io/core/appmodule"
+
+ "github.com/cosmos/cosmos-sdk/baseapp"
+
wasmvm "github.com/CosmWasm/wasmvm"
+ abci "github.com/cometbft/cometbft/abci/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec"
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
@@ -17,22 +22,19 @@ import (
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/cast"
"github.com/spf13/cobra"
- abci "github.com/tendermint/tendermint/abci/types"
"github.com/CosmWasm/wasmd/x/wasm/client/cli"
- "github.com/CosmWasm/wasmd/x/wasm/client/rest" //nolint:staticcheck
"github.com/CosmWasm/wasmd/x/wasm/keeper"
"github.com/CosmWasm/wasmd/x/wasm/simulation"
"github.com/CosmWasm/wasmd/x/wasm/types"
)
var (
- _ module.AppModule = AppModule{}
- _ module.AppModuleBasic = AppModuleBasic{}
+ _ module.AppModuleBasic = AppModuleBasic{}
+ _ module.AppModuleSimulation = AppModule{}
)
// Module init related flags
@@ -45,7 +47,7 @@ const (
// AppModuleBasic defines the basic application module used by the wasm module.
type AppModuleBasic struct{}
-func (b AppModuleBasic) RegisterLegacyAminoCodec(amino *codec.LegacyAmino) { //nolint:staticcheck
+func (b AppModuleBasic) RegisterLegacyAminoCodec(amino *codec.LegacyAmino) {
RegisterCodec(amino)
}
@@ -79,11 +81,6 @@ func (b AppModuleBasic) ValidateGenesis(marshaler codec.JSONCodec, config client
return ValidateGenesis(data)
}
-// RegisterRESTRoutes registers the REST routes for the wasm module.
-func (AppModuleBasic) RegisterRESTRoutes(cliCtx client.Context, rtr *mux.Router) {
- rest.RegisterRoutes(cliCtx, rtr)
-}
-
// GetTxCmd returns the root tx command for the wasm module.
func (b AppModuleBasic) GetTxCmd() *cobra.Command {
return cli.GetTxCmd()
@@ -100,6 +97,7 @@ func (b AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry)
}
// ____________________________________________________________________________
+var _ appmodule.AppModule = AppModule{}
// AppModule implements an application module for the wasm module.
type AppModule struct {
@@ -109,14 +107,9 @@ type AppModule struct {
validatorSetSource keeper.ValidatorSetSource
accountKeeper types.AccountKeeper // for simulation
bankKeeper simulation.BankKeeper
+ router keeper.MessageRouter
}
-// ConsensusVersion is a sequence number for state-breaking change of the
-// module. It should be incremented on each consensus-breaking change
-// introduced by the module. To avoid wrong/empty versions, the initial version
-// should be set to 1.
-func (AppModule) ConsensusVersion() uint64 { return 2 }
-
// NewAppModule creates a new AppModule object
func NewAppModule(
cdc codec.Codec,
@@ -124,6 +117,7 @@ func NewAppModule(
validatorSetSource keeper.ValidatorSetSource,
ak types.AccountKeeper,
bk simulation.BankKeeper,
+ router *baseapp.MsgServiceRouter,
) AppModule {
return AppModule{
AppModuleBasic: AppModuleBasic{},
@@ -132,9 +126,24 @@ func NewAppModule(
validatorSetSource: validatorSetSource,
accountKeeper: ak,
bankKeeper: bk,
+ router: router,
}
}
+// IsOnePerModuleType implements the depinject.OnePerModuleType interface.
+func (am AppModule) IsOnePerModuleType() { // marker
+}
+
+// IsAppModule implements the appmodule.AppModule interface.
+func (am AppModule) IsAppModule() { // marker
+}
+
+// ConsensusVersion is a sequence number for state-breaking change of the
+// module. It should be incremented on each consensus-breaking change
+// introduced by the module. To avoid wrong/empty versions, the initial version
+// should be set to 1.
+func (AppModule) ConsensusVersion() uint64 { return 2 }
+
func (am AppModule) RegisterServices(cfg module.Configurator) {
types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(keeper.NewDefaultPermissionKeeper(am.keeper)))
types.RegisterQueryServer(cfg.QueryServer(), NewQuerier(am.keeper))
@@ -146,18 +155,9 @@ func (am AppModule) RegisterServices(cfg module.Configurator) {
}
}
-func (am AppModule) LegacyQuerierHandler(amino *codec.LegacyAmino) sdk.Querier { //nolint:staticcheck
- return keeper.NewLegacyQuerier(am.keeper, am.keeper.QueryGasLimit())
-}
-
// RegisterInvariants registers the wasm module invariants.
func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {}
-// Route returns the message routing key for the wasm module.
-func (am AppModule) Route() sdk.Route {
- return sdk.NewRoute(RouterKey, NewHandler(keeper.NewDefaultPermissionKeeper(am.keeper)))
-}
-
// QuerierRoute returns the wasm module's querier route name.
func (AppModule) QuerierRoute() string {
return QuerierRoute
@@ -206,7 +206,7 @@ func (am AppModule) ProposalContents(simState module.SimulationState) []simtypes
}
// RandomizedParams creates randomized bank param changes for the simulator.
-func (am AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange {
+func (am AppModule) RandomizedParams(r *rand.Rand) []simtypes.LegacyParamChange {
return simulation.ParamChanges(r, am.cdc)
}
@@ -246,7 +246,7 @@ func ReadWasmConfig(opts servertypes.AppOptions) (types.WasmConfig, error) {
}
}
if v := opts.Get(flagWasmSimulationGasLimit); v != nil {
- if raw, ok := v.(string); ok && raw != "" {
+ if raw, ok := v.(string); !ok || raw != "" {
limit, err := cast.ToUint64E(v) // non empty string set
if err != nil {
return cfg, err
diff --git a/x/wasm/module_integration_test.go b/x/wasm/module_integration_test.go
index bdce6cf34f..e3aaf0d3d7 100644
--- a/x/wasm/module_integration_test.go
+++ b/x/wasm/module_integration_test.go
@@ -3,28 +3,28 @@ package wasm_test
import (
"testing"
+ tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
"github.com/CosmWasm/wasmd/app"
"github.com/CosmWasm/wasmd/x/wasm"
)
func TestModuleMigrations(t *testing.T) {
- wasmApp := app.Setup(false)
+ wasmApp := app.Setup(t)
ctx := wasmApp.BaseApp.NewContext(false, tmproto.Header{})
- upgradeHandler := func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
- return wasmApp.ModuleManager().RunMigrations(ctx, wasmApp.ModuleConfigurator(), fromVM)
+ upgradeHandler := func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { //nolint:unparam
+ return wasmApp.ModuleManager.RunMigrations(ctx, wasmApp.Configurator(), fromVM)
}
fromVM := wasmApp.UpgradeKeeper.GetModuleVersionMap(ctx)
- fromVM[wasm.ModuleName] = 1 // start with initial version
- upgradeHandler(ctx, upgradetypes.Plan{Name: "testing"}, fromVM)
+ fromVM[wasm.ModuleName] = 1 // start with initial version
+ upgradeHandler(ctx, upgradetypes.Plan{Name: "testing"}, fromVM) //nolint:errcheck
// when
- gotVM, err := wasmApp.ModuleManager().RunMigrations(ctx, wasmApp.ModuleConfigurator(), fromVM)
+ gotVM, err := wasmApp.ModuleManager.RunMigrations(ctx, wasmApp.Configurator(), fromVM)
// then
require.NoError(t, err)
assert.Equal(t, uint64(2), gotVM[wasm.ModuleName])
diff --git a/x/wasm/module_test.go b/x/wasm/module_test.go
index 5ca0a88178..64d453bfcf 100644
--- a/x/wasm/module_test.go
+++ b/x/wasm/module_test.go
@@ -3,54 +3,70 @@ package wasm
import (
"bytes"
"encoding/json"
- "fmt"
"os"
+ "strings"
"testing"
+ servertypes "github.com/cosmos/cosmos-sdk/server/types"
+ "github.com/spf13/viper"
+
+ abci "github.com/cometbft/cometbft/abci/types"
+ "github.com/cometbft/cometbft/crypto"
+ "github.com/cometbft/cometbft/crypto/ed25519"
+ "github.com/cosmos/cosmos-sdk/baseapp"
+ "github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/address"
"github.com/cosmos/cosmos-sdk/types/module"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
- "github.com/dvsekhvalnov/jose2go/base64url"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- abci "github.com/tendermint/tendermint/abci/types"
- "github.com/tendermint/tendermint/crypto"
- "github.com/tendermint/tendermint/crypto/ed25519"
+ "github.com/CosmWasm/wasmd/app/params"
"github.com/CosmWasm/wasmd/x/wasm/keeper"
"github.com/CosmWasm/wasmd/x/wasm/keeper/testdata"
"github.com/CosmWasm/wasmd/x/wasm/types"
)
type testData struct {
- module module.AppModule
- ctx sdk.Context
- acctKeeper authkeeper.AccountKeeper
- keeper Keeper
- bankKeeper bankkeeper.Keeper
- stakingKeeper stakingkeeper.Keeper
- faucet *keeper.TestFaucet
+ module AppModule
+ ctx sdk.Context
+ acctKeeper authkeeper.AccountKeeper
+ keeper Keeper
+ bankKeeper bankkeeper.Keeper
+ stakingKeeper *stakingkeeper.Keeper
+ faucet *keeper.TestFaucet
+ grpcQueryRouter *baseapp.GRPCQueryRouter
+ msgServiceRouter *baseapp.MsgServiceRouter
+ encConf params.EncodingConfig
}
func setupTest(t *testing.T) testData {
ctx, keepers := CreateTestInput(t, false, "iterator,staking,stargate,cosmwasm_1_1")
- cdc := keeper.MakeTestCodec(t)
+ encConf := keeper.MakeEncodingConfig(t)
+ queryRouter := baseapp.NewGRPCQueryRouter()
+ serviceRouter := baseapp.NewMsgServiceRouter()
+ queryRouter.SetInterfaceRegistry(encConf.InterfaceRegistry)
+ serviceRouter.SetInterfaceRegistry(encConf.InterfaceRegistry)
data := testData{
- module: NewAppModule(cdc, keepers.WasmKeeper, keepers.StakingKeeper, keepers.AccountKeeper, keepers.BankKeeper),
- ctx: ctx,
- acctKeeper: keepers.AccountKeeper,
- keeper: *keepers.WasmKeeper,
- bankKeeper: keepers.BankKeeper,
- stakingKeeper: keepers.StakingKeeper,
- faucet: keepers.Faucet,
+ module: NewAppModule(encConf.Marshaler, keepers.WasmKeeper, keepers.StakingKeeper, keepers.AccountKeeper, keepers.BankKeeper, nil),
+ ctx: ctx,
+ acctKeeper: keepers.AccountKeeper,
+ keeper: *keepers.WasmKeeper,
+ bankKeeper: keepers.BankKeeper,
+ stakingKeeper: keepers.StakingKeeper,
+ faucet: keepers.Faucet,
+ grpcQueryRouter: queryRouter,
+ msgServiceRouter: serviceRouter,
+ encConf: encConf,
}
+ data.module.RegisterServices(module.NewConfigurator(encConf.Marshaler, serviceRouter, queryRouter))
return data
}
-func keyPubAddr() (crypto.PrivKey, crypto.PubKey, sdk.AccAddress) {
+func keyPubAddr() (crypto.PrivKey, crypto.PubKey, sdk.AccAddress) { //nolint:unparam
key := ed25519.GenPrivKey()
pub := key.PubKey()
addr := sdk.AccAddress(pub.Address())
@@ -117,18 +133,19 @@ func TestHandleCreate(t *testing.T) {
t.Run(name, func(t *testing.T) {
data := setupTest(t)
- h := data.module.Route().Handler()
- q := data.module.LegacyQuerierHandler(nil)
+ h := data.msgServiceRouter.Handler(tc.msg)
+ // q := data.grpcQueryRouter.Route(sdk.MsgTypeURL(tc.msg))
+ q := data.grpcQueryRouter
res, err := h(data.ctx, tc.msg)
if !tc.isValid {
require.Error(t, err, "%#v", res)
- assertCodeList(t, q, data.ctx, 0)
- assertCodeBytes(t, q, data.ctx, 1, nil)
+ assertCodeList(t, q, data.ctx, 0, data.encConf.Marshaler)
+ assertCodeBytes(t, q, data.ctx, 1, nil, data.encConf.Marshaler)
return
}
require.NoError(t, err)
- assertCodeList(t, q, data.ctx, 1)
+ assertCodeList(t, q, data.ctx, 1, data.encConf.Marshaler)
})
}
}
@@ -148,13 +165,14 @@ func TestHandleInstantiate(t *testing.T) {
data := setupTest(t)
creator := data.faucet.NewFundedRandomAccount(data.ctx, sdk.NewInt64Coin("denom", 100000))
- h := data.module.Route().Handler()
- q := data.module.LegacyQuerierHandler(nil)
-
msg := &MsgStoreCode{
Sender: creator.String(),
WASMByteCode: testContract,
}
+
+ h := data.msgServiceRouter.Handler(msg)
+ q := data.grpcQueryRouter
+
res, err := h(data.ctx, msg)
require.NoError(t, err)
assertStoreCodeResponse(t, res.Data, 1)
@@ -162,22 +180,23 @@ func TestHandleInstantiate(t *testing.T) {
_, _, bob := keyPubAddr()
_, _, fred := keyPubAddr()
- initMsg := initMsg{
+ initPayload := initMsg{
Verifier: fred,
Beneficiary: bob,
}
- initMsgBz, err := json.Marshal(initMsg)
+ initMsgBz, err := json.Marshal(initPayload)
require.NoError(t, err)
// create with no balance is also legal
- initCmd := MsgInstantiateContract{
+ initMsg := &MsgInstantiateContract{
Sender: creator.String(),
CodeID: firstCodeID,
Msg: initMsgBz,
Funds: nil,
Label: "testing",
}
- res, err = h(data.ctx, &initCmd)
+ h = data.msgServiceRouter.Handler(initMsg)
+ res, err = h(data.ctx, initMsg)
require.NoError(t, err)
contractBech32Addr := parseInitResponse(t, res.Data)
@@ -190,16 +209,16 @@ func TestHandleInstantiate(t *testing.T) {
require.Equal(t, "wasm", res.Events[2].Type)
assertAttribute(t, "_contract_address", contractBech32Addr, res.Events[2].Attributes[0])
- assertCodeList(t, q, data.ctx, 1)
- assertCodeBytes(t, q, data.ctx, 1, testContract)
+ assertCodeList(t, q, data.ctx, 1, data.encConf.Marshaler)
+ assertCodeBytes(t, q, data.ctx, 1, testContract, data.encConf.Marshaler)
- assertContractList(t, q, data.ctx, 1, []string{contractBech32Addr})
- assertContractInfo(t, q, data.ctx, contractBech32Addr, 1, creator)
+ assertContractList(t, q, data.ctx, 1, []string{contractBech32Addr}, data.encConf.Marshaler)
+ assertContractInfo(t, q, data.ctx, contractBech32Addr, 1, creator, data.encConf.Marshaler)
assertContractState(t, q, data.ctx, contractBech32Addr, state{
Verifier: fred.String(),
Beneficiary: bob.String(),
Funder: creator.String(),
- })
+ }, data.encConf.Marshaler)
}
func TestHandleExecute(t *testing.T) {
@@ -211,13 +230,12 @@ func TestHandleExecute(t *testing.T) {
creator := data.faucet.NewFundedRandomAccount(data.ctx, deposit.Add(deposit...)...)
fred := data.faucet.NewFundedRandomAccount(data.ctx, topUp...)
- h := data.module.Route().Handler()
- q := data.module.LegacyQuerierHandler(nil)
-
msg := &MsgStoreCode{
Sender: creator.String(),
WASMByteCode: testContract,
}
+ h := data.msgServiceRouter.Handler(msg)
+ q := data.grpcQueryRouter
res, err := h(data.ctx, msg)
require.NoError(t, err)
assertStoreCodeResponse(t, res.Data, 1)
@@ -230,14 +248,15 @@ func TestHandleExecute(t *testing.T) {
initMsgBz, err := json.Marshal(initMsg)
require.NoError(t, err)
- initCmd := MsgInstantiateContract{
+ initCmd := &MsgInstantiateContract{
Sender: creator.String(),
CodeID: firstCodeID,
Msg: initMsgBz,
Funds: deposit,
Label: "testing",
}
- res, err = h(data.ctx, &initCmd)
+ h = data.msgServiceRouter.Handler(initCmd)
+ res, err = h(data.ctx, initCmd)
require.NoError(t, err)
contractBech32Addr := parseInitResponse(t, res.Data)
@@ -269,13 +288,14 @@ func TestHandleExecute(t *testing.T) {
require.NotNil(t, contractAcct)
assert.Equal(t, deposit, data.bankKeeper.GetAllBalances(data.ctx, contractAcct.GetAddress()))
- execCmd := MsgExecuteContract{
+ execCmd := &MsgExecuteContract{
Sender: fred.String(),
Contract: contractBech32Addr,
Msg: []byte(`{"release":{}}`),
Funds: topUp,
}
- res, err = h(data.ctx, &execCmd)
+ h = data.msgServiceRouter.Handler(execCmd)
+ res, err = h(data.ctx, execCmd)
require.NoError(t, err)
// from https://github.com/CosmWasm/cosmwasm/blob/master/contracts/hackatom/src/contract.rs#L167
assertExecuteResponse(t, res.Data, []byte{0xf0, 0x0b, 0xaa})
@@ -327,16 +347,16 @@ func TestHandleExecute(t *testing.T) {
assert.Equal(t, sdk.Coins{}, data.bankKeeper.GetAllBalances(data.ctx, contractAcct.GetAddress()))
// ensure all contract state is as after init
- assertCodeList(t, q, data.ctx, 1)
- assertCodeBytes(t, q, data.ctx, 1, testContract)
+ assertCodeList(t, q, data.ctx, 1, data.encConf.Marshaler)
+ assertCodeBytes(t, q, data.ctx, 1, testContract, data.encConf.Marshaler)
- assertContractList(t, q, data.ctx, 1, []string{contractBech32Addr})
- assertContractInfo(t, q, data.ctx, contractBech32Addr, 1, creator)
+ assertContractList(t, q, data.ctx, 1, []string{contractBech32Addr}, data.encConf.Marshaler)
+ assertContractInfo(t, q, data.ctx, contractBech32Addr, 1, creator, data.encConf.Marshaler)
assertContractState(t, q, data.ctx, contractBech32Addr, state{
Verifier: fred.String(),
Beneficiary: bob.String(),
Funder: creator.String(),
- })
+ }, data.encConf.Marshaler)
}
func TestHandleExecuteEscrow(t *testing.T) {
@@ -348,13 +368,13 @@ func TestHandleExecuteEscrow(t *testing.T) {
data.faucet.Fund(data.ctx, creator, sdk.NewInt64Coin("denom", 100000))
fred := data.faucet.NewFundedRandomAccount(data.ctx, topUp...)
- h := data.module.Route().Handler()
-
msg := &MsgStoreCode{
Sender: creator.String(),
WASMByteCode: testContract,
}
- res, err := h(data.ctx, msg)
+
+ h := data.msgServiceRouter.Handler(msg)
+ _, err := h(data.ctx, msg)
require.NoError(t, err)
_, _, bob := keyPubAddr()
@@ -372,7 +392,8 @@ func TestHandleExecuteEscrow(t *testing.T) {
Funds: deposit,
Label: "testing",
}
- res, err = h(data.ctx, &initCmd)
+ h = data.msgServiceRouter.Handler(&initCmd)
+ res, err := h(data.ctx, &initCmd)
require.NoError(t, err)
contractBech32Addr := parseInitResponse(t, res.Data)
require.Equal(t, "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr", contractBech32Addr)
@@ -389,6 +410,7 @@ func TestHandleExecuteEscrow(t *testing.T) {
Msg: handleMsgBz,
Funds: topUp,
}
+ h = data.msgServiceRouter.Handler(&execCmd)
res, err = h(data.ctx, &execCmd)
require.NoError(t, err)
// from https://github.com/CosmWasm/cosmwasm/blob/master/contracts/hackatom/src/contract.rs#L167
@@ -408,9 +430,17 @@ func TestHandleExecuteEscrow(t *testing.T) {
}
func TestReadWasmConfig(t *testing.T) {
+ withViper := func(s string) *viper.Viper {
+ v := viper.New()
+ v.SetConfigType("toml")
+ require.NoError(t, v.ReadConfig(strings.NewReader(s)))
+ return v
+ }
+ var one uint64 = 1
defaults := DefaultWasmConfig()
+
specs := map[string]struct {
- src AppOptionsMock
+ src servertypes.AppOptions
exp types.WasmConfig
}{
"set query gas limit via opts": {
@@ -442,8 +472,26 @@ func TestReadWasmConfig(t *testing.T) {
},
},
"all defaults when no options set": {
+ src: AppOptionsMock{},
exp: defaults,
},
+ "default config template values": {
+ src: withViper(types.DefaultConfigTemplate()),
+ exp: defaults,
+ },
+ "custom config template values": {
+ src: withViper(types.ConfigTemplate(types.WasmConfig{
+ SimulationGasLimit: &one,
+ SmartQueryGasLimit: 2,
+ MemoryCacheSize: 3,
+ })),
+ exp: types.WasmConfig{
+ SimulationGasLimit: &one,
+ SmartQueryGasLimit: 2,
+ MemoryCacheSize: 3,
+ ContractDebugMode: false,
+ },
+ },
}
for msg, spec := range specs {
t.Run(msg, func(t *testing.T) {
@@ -489,99 +537,110 @@ func prettyAttrs(attrs []abci.EventAttribute) []sdk.Attribute {
}
func prettyAttr(attr abci.EventAttribute) sdk.Attribute {
- return sdk.NewAttribute(string(attr.Key), string(attr.Value))
+ return sdk.NewAttribute(attr.Key, attr.Value)
}
func assertAttribute(t *testing.T, key string, value string, attr abci.EventAttribute) {
t.Helper()
- assert.Equal(t, key, string(attr.Key), prettyAttr(attr))
- assert.Equal(t, value, string(attr.Value), prettyAttr(attr))
+ assert.Equal(t, key, attr.Key, prettyAttr(attr))
+ assert.Equal(t, value, attr.Value, prettyAttr(attr))
}
-func assertCodeList(t *testing.T, q sdk.Querier, ctx sdk.Context, expectedNum int) {
- bz, sdkerr := q(ctx, []string{QueryListCode}, abci.RequestQuery{})
+func assertCodeList(t *testing.T, q *baseapp.GRPCQueryRouter, ctx sdk.Context, expectedNum int, marshaler codec.Codec) {
+ t.Helper()
+ path := "/cosmwasm.wasm.v1.Query/Codes"
+ resp, sdkerr := q.Route(path)(ctx, abci.RequestQuery{Path: path})
require.NoError(t, sdkerr)
+ require.True(t, resp.IsOK())
+ bz := resp.Value
if len(bz) == 0 {
require.Equal(t, expectedNum, 0)
return
}
- var res []CodeInfo
- err := json.Unmarshal(bz, &res)
- require.NoError(t, err)
-
- assert.Equal(t, expectedNum, len(res))
+ var res types.QueryCodesResponse
+ require.NoError(t, marshaler.Unmarshal(bz, &res))
+ assert.Equal(t, expectedNum, len(res.CodeInfos))
}
-func assertCodeBytes(t *testing.T, q sdk.Querier, ctx sdk.Context, codeID uint64, expectedBytes []byte) {
- path := []string{QueryGetCode, fmt.Sprintf("%d", codeID)}
- bz, sdkerr := q(ctx, path, abci.RequestQuery{})
- require.NoError(t, sdkerr)
+func assertCodeBytes(t *testing.T, q *baseapp.GRPCQueryRouter, ctx sdk.Context, codeID uint64, expectedBytes []byte, marshaler codec.Codec) { //nolint:unparam
+ t.Helper()
+ bz, err := marshaler.Marshal(&types.QueryCodeRequest{CodeId: codeID})
+ require.NoError(t, err)
+ path := "/cosmwasm.wasm.v1.Query/Code"
+ resp, err := q.Route(path)(ctx, abci.RequestQuery{Path: path, Data: bz})
if len(expectedBytes) == 0 {
- require.Equal(t, len(bz), 0, "%q", string(bz))
+ assert.ErrorIs(t, err, types.ErrNotFound)
return
}
- var res map[string]interface{}
- err := json.Unmarshal(bz, &res)
require.NoError(t, err)
+ require.True(t, resp.IsOK())
+ bz = resp.Value
- require.Contains(t, res, "data")
- b, err := base64url.Decode(res["data"].(string))
- require.NoError(t, err)
- assert.Equal(t, expectedBytes, b)
- assert.EqualValues(t, codeID, res["id"])
+ var rsp types.QueryCodeResponse
+ require.NoError(t, marshaler.Unmarshal(bz, &rsp))
+ assert.Equal(t, expectedBytes, rsp.Data)
}
-func assertContractList(t *testing.T, q sdk.Querier, ctx sdk.Context, codeID uint64, expContractAddrs []string) {
- bz, sdkerr := q(ctx, []string{QueryListContractByCode, fmt.Sprintf("%d", codeID)}, abci.RequestQuery{})
- require.NoError(t, sdkerr)
+func assertContractList(t *testing.T, q *baseapp.GRPCQueryRouter, ctx sdk.Context, codeID uint64, expContractAddrs []string, marshaler codec.Codec) { //nolint:unparam
+ t.Helper()
+ bz, err := marshaler.Marshal(&types.QueryContractsByCodeRequest{CodeId: codeID})
+ require.NoError(t, err)
- if len(bz) == 0 {
- require.Equal(t, len(expContractAddrs), 0)
+ path := "/cosmwasm.wasm.v1.Query/ContractsByCode"
+ resp, sdkerr := q.Route(path)(ctx, abci.RequestQuery{Path: path, Data: bz})
+ if len(expContractAddrs) == 0 {
+ assert.ErrorIs(t, err, types.ErrNotFound)
return
}
+ require.NoError(t, sdkerr)
+ require.True(t, resp.IsOK())
+ bz = resp.Value
- var res []string
- err := json.Unmarshal(bz, &res)
- require.NoError(t, err)
+ var rsp types.QueryContractsByCodeResponse
+ require.NoError(t, marshaler.Unmarshal(bz, &rsp))
- hasAddrs := make([]string, len(res))
- for i, r := range res {
+ hasAddrs := make([]string, len(rsp.Contracts))
+ for i, r := range rsp.Contracts { //nolint:gosimple
hasAddrs[i] = r
}
-
assert.Equal(t, expContractAddrs, hasAddrs)
}
-func assertContractState(t *testing.T, q sdk.Querier, ctx sdk.Context, contractBech32Addr string, expected state) {
+func assertContractState(t *testing.T, q *baseapp.GRPCQueryRouter, ctx sdk.Context, contractBech32Addr string, expected state, marshaler codec.Codec) {
t.Helper()
- path := []string{QueryGetContractState, contractBech32Addr, keeper.QueryMethodContractStateAll}
- bz, sdkerr := q(ctx, path, abci.RequestQuery{})
- require.NoError(t, sdkerr)
-
- var res []Model
- err := json.Unmarshal(bz, &res)
+ bz, err := marshaler.Marshal(&types.QueryRawContractStateRequest{Address: contractBech32Addr, QueryData: []byte("config")})
require.NoError(t, err)
- require.Equal(t, 1, len(res), "#v", res)
- require.Equal(t, []byte("config"), []byte(res[0].Key))
+ path := "/cosmwasm.wasm.v1.Query/RawContractState"
+ resp, sdkerr := q.Route(path)(ctx, abci.RequestQuery{Path: path, Data: bz})
+ require.NoError(t, sdkerr)
+ require.True(t, resp.IsOK())
+ bz = resp.Value
+
+ var rsp types.QueryRawContractStateResponse
+ require.NoError(t, marshaler.Unmarshal(bz, &rsp))
expectedBz, err := json.Marshal(expected)
require.NoError(t, err)
- assert.Equal(t, expectedBz, res[0].Value)
+ assert.Equal(t, expectedBz, rsp.Data)
}
-func assertContractInfo(t *testing.T, q sdk.Querier, ctx sdk.Context, contractBech32Addr string, codeID uint64, creator sdk.AccAddress) {
+func assertContractInfo(t *testing.T, q *baseapp.GRPCQueryRouter, ctx sdk.Context, contractBech32Addr string, codeID uint64, creator sdk.AccAddress, marshaler codec.Codec) { //nolint:unparam
t.Helper()
- path := []string{QueryGetContract, contractBech32Addr}
- bz, sdkerr := q(ctx, path, abci.RequestQuery{})
+ bz, err := marshaler.Marshal(&types.QueryContractInfoRequest{Address: contractBech32Addr})
+ require.NoError(t, err)
+
+ path := "/cosmwasm.wasm.v1.Query/ContractInfo"
+ resp, sdkerr := q.Route(path)(ctx, abci.RequestQuery{Path: path, Data: bz})
require.NoError(t, sdkerr)
+ require.True(t, resp.IsOK())
+ bz = resp.Value
- var res ContractInfo
- err := json.Unmarshal(bz, &res)
- require.NoError(t, err)
+ var rsp types.QueryContractInfoResponse
+ require.NoError(t, marshaler.Unmarshal(bz, &rsp))
- assert.Equal(t, codeID, res.CodeID)
- assert.Equal(t, creator.String(), res.Creator)
+ assert.Equal(t, codeID, rsp.CodeID)
+ assert.Equal(t, creator.String(), rsp.Creator)
}
diff --git a/x/wasm/relay_pingpong_test.go b/x/wasm/relay_pingpong_test.go
index a36cdce6ab..c3d95abdb3 100644
--- a/x/wasm/relay_pingpong_test.go
+++ b/x/wasm/relay_pingpong_test.go
@@ -5,15 +5,14 @@ import (
"fmt"
"testing"
- ibctransfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
- ibctesting "github.com/cosmos/ibc-go/v4/testing"
+ ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
+ ibctesting "github.com/cosmos/ibc-go/v7/testing"
wasmvm "github.com/CosmWasm/wasmvm"
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
- "github.com/cosmos/cosmos-sdk/store/prefix"
sdk "github.com/cosmos/cosmos-sdk/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"
+ clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -49,8 +48,8 @@ func TestPinPong(t *testing.T) {
wasmtesting.NewIBCContractMockWasmer(pongContract),
)}
coordinator = wasmibctesting.NewCoordinator(t, 2, chainAOpts, chainBOpts)
- chainA = coordinator.GetChain(wasmibctesting.GetChainID(0))
- chainB = coordinator.GetChain(wasmibctesting.GetChainID(1))
+ chainA = coordinator.GetChain(wasmibctesting.GetChainID(1))
+ chainB = coordinator.GetChain(wasmibctesting.GetChainID(2))
)
_ = chainB.SeedNewContractInstance() // skip 1 instance so that addresses are not the same
var (
@@ -199,20 +198,6 @@ var ( // store keys
maxValueKey = []byte("max-value")
)
-func (p player) loadEndpoints(store prefix.Store, channelID string) *connectedChannelsModel {
- var counterparties []connectedChannelsModel
- if bz := store.Get(ibcEndpointsKey); bz != nil {
- require.NoError(p.t, json.Unmarshal(bz, &counterparties))
- }
- for _, v := range counterparties {
- if v.Our.ChannelID == channelID {
- return &v
- }
- }
- p.t.Fatalf("no counterparty found for channel %q", channelID)
- return nil
-}
-
func (p player) storeEndpoint(store wasmvm.KVStore, channel wasmvmtypes.IBCChannel) {
var counterparties []connectedChannelsModel
if b := store.Get(ibcEndpointsKey); b != nil {
@@ -240,11 +225,11 @@ var ( // store keys
func (p player) IBCPacketReceive(codeID wasmvm.Checksum, env wasmvmtypes.Env, msg wasmvmtypes.IBCPacketReceiveMsg, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.IBCReceiveResult, uint64, error) {
// parse received data and store
packet := msg.Packet
- var receivedBall hit
+ var receivedBall Hit
if err := json.Unmarshal(packet.Data, &receivedBall); err != nil {
return &wasmvmtypes.IBCReceiveResult{
Ok: &wasmvmtypes.IBCReceiveResponse{
- Acknowledgement: hitAcknowledgement{Error: err.Error()}.GetBytes(),
+ Acknowledgement: HitAcknowledgement{Error: err.Error()}.GetBytes(),
},
// no hit msg, we stop the game
}, 0, nil
@@ -285,12 +270,12 @@ func (p player) IBCPacketReceive(codeID wasmvm.Checksum, env wasmvmtypes.Env, ms
// OnIBCPacketAcknowledgement handles the packet acknowledgment frame. Stops the game on an any error
func (p player) IBCPacketAck(codeID wasmvm.Checksum, env wasmvmtypes.Env, msg wasmvmtypes.IBCPacketAckMsg, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.IBCBasicResponse, uint64, error) {
// parse received data and store
- var sentBall hit
+ var sentBall Hit
if err := json.Unmarshal(msg.OriginalPacket.Data, &sentBall); err != nil {
return nil, 0, err
}
- var ack hitAcknowledgement
+ var ack HitAcknowledgement
if err := json.Unmarshal(msg.Acknowledgement.Data, &ack); err != nil {
return nil, 0, err
}
@@ -337,15 +322,15 @@ func counterParty(s string) string {
}
// hit is ibc packet payload
-type hit map[string]uint64
+type Hit map[string]uint64
-func NewHit(player string, count uint64) hit {
+func NewHit(player string, count uint64) Hit {
return map[string]uint64{
player: count,
}
}
-func (h hit) GetBytes() []byte {
+func (h Hit) GetBytes() []byte {
b, err := json.Marshal(h)
if err != nil {
panic(err)
@@ -353,25 +338,25 @@ func (h hit) GetBytes() []byte {
return b
}
-func (h hit) String() string {
+func (h Hit) String() string {
return fmt.Sprintf("Ball %s", string(h.GetBytes()))
}
-func (h hit) BuildAck() hitAcknowledgement {
- return hitAcknowledgement{Success: &h}
+func (h Hit) BuildAck() HitAcknowledgement {
+ return HitAcknowledgement{Success: &h}
}
-func (h hit) BuildError(errMsg string) hitAcknowledgement {
- return hitAcknowledgement{Error: errMsg}
+func (h Hit) BuildError(errMsg string) HitAcknowledgement {
+ return HitAcknowledgement{Error: errMsg}
}
// hitAcknowledgement is ibc acknowledgment payload
-type hitAcknowledgement struct {
+type HitAcknowledgement struct {
Error string `json:"error,omitempty"`
- Success *hit `json:"success,omitempty"`
+ Success *Hit `json:"success,omitempty"`
}
-func (a hitAcknowledgement) GetBytes() []byte {
+func (a HitAcknowledgement) GetBytes() []byte {
b, err := json.Marshal(a)
if err != nil {
panic(err)
diff --git a/x/wasm/relay_test.go b/x/wasm/relay_test.go
index df34534fbc..b453e38a49 100644
--- a/x/wasm/relay_test.go
+++ b/x/wasm/relay_test.go
@@ -6,14 +6,15 @@ import (
"testing"
"time"
+ "cosmossdk.io/math"
wasmvm "github.com/CosmWasm/wasmvm"
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
- ibctransfertypes "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"
+ ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
+ clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
+ ibctesting "github.com/cosmos/ibc-go/v7/testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -33,8 +34,8 @@ func TestFromIBCTransferToContract(t *testing.T) {
specs := map[string]struct {
contract wasmtesting.IBCContractCallbacks
setupContract func(t *testing.T, contract wasmtesting.IBCContractCallbacks, chain *wasmibctesting.TestChain)
- expChainABalanceDiff sdk.Int
- expChainBBalanceDiff sdk.Int
+ expChainABalanceDiff math.Int
+ expChainBBalanceDiff math.Int
}{
"ack": {
contract: &ackReceiverContract{},
@@ -72,8 +73,8 @@ func TestFromIBCTransferToContract(t *testing.T) {
wasmtesting.NewIBCContractMockWasmer(spec.contract),
)}
coordinator = wasmibctesting.NewCoordinator(t, 2, []wasmkeeper.Option{}, chainAOpts)
- chainA = coordinator.GetChain(wasmibctesting.GetChainID(0))
- chainB = coordinator.GetChain(wasmibctesting.GetChainID(1))
+ chainA = coordinator.GetChain(wasmibctesting.GetChainID(1))
+ chainB = coordinator.GetChain(wasmibctesting.GetChainID(2))
)
coordinator.CommitBlock(chainA, chainB)
myContractAddr := chainB.SeedNewContractInstance()
@@ -100,7 +101,7 @@ func TestFromIBCTransferToContract(t *testing.T) {
// when transfer via sdk transfer from A (module) -> B (contract)
coinToSendToB := sdk.NewCoin(sdk.DefaultBondDenom, transferAmount)
timeoutHeight := clienttypes.NewHeight(1, 110)
- msg := ibctransfertypes.NewMsgTransfer(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, coinToSendToB, chainA.SenderAccount.GetAddress().String(), chainB.SenderAccount.GetAddress().String(), timeoutHeight, 0)
+ msg := ibctransfertypes.NewMsgTransfer(path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, coinToSendToB, chainA.SenderAccount.GetAddress().String(), chainB.SenderAccount.GetAddress().String(), timeoutHeight, 0, "")
_, err := chainA.SendMsgs(msg)
require.NoError(t, err)
require.NoError(t, path.EndpointB.UpdateClient())
@@ -143,8 +144,8 @@ func TestContractCanInitiateIBCTransferMsg(t *testing.T) {
wasmtesting.NewIBCContractMockWasmer(myContract)),
}
coordinator = wasmibctesting.NewCoordinator(t, 2, chainAOpts)
- chainA = coordinator.GetChain(wasmibctesting.GetChainID(0))
- chainB = coordinator.GetChain(wasmibctesting.GetChainID(1))
+ chainA = coordinator.GetChain(wasmibctesting.GetChainID(1))
+ chainB = coordinator.GetChain(wasmibctesting.GetChainID(2))
)
myContractAddr := chainA.SeedNewContractInstance()
coordinator.CommitBlock(chainA, chainB)
@@ -177,6 +178,7 @@ func TestContractCanInitiateIBCTransferMsg(t *testing.T) {
ReceiverAddr: receiverAddress.String(),
}.GetBytes(),
}
+ // trigger contract to start the transfer
_, err := chainA.SendMsgs(startMsg)
require.NoError(t, err)
@@ -214,8 +216,8 @@ func TestContractCanEmulateIBCTransferMessage(t *testing.T) {
}
coordinator = wasmibctesting.NewCoordinator(t, 2, chainAOpts)
- chainA = coordinator.GetChain(wasmibctesting.GetChainID(0))
- chainB = coordinator.GetChain(wasmibctesting.GetChainID(1))
+ chainA = coordinator.GetChain(wasmibctesting.GetChainID(1))
+ chainB = coordinator.GetChain(wasmibctesting.GetChainID(2))
)
myContractAddr := chainA.SeedNewContractInstance()
myContract.contractAddr = myContractAddr.String()
@@ -289,8 +291,8 @@ func TestContractCanEmulateIBCTransferMessageWithTimeout(t *testing.T) {
}
coordinator = wasmibctesting.NewCoordinator(t, 2, chainAOpts)
- chainA = coordinator.GetChain(wasmibctesting.GetChainID(0))
- chainB = coordinator.GetChain(wasmibctesting.GetChainID(1))
+ chainA = coordinator.GetChain(wasmibctesting.GetChainID(1))
+ chainB = coordinator.GetChain(wasmibctesting.GetChainID(2))
)
coordinator.CommitBlock(chainA, chainB)
myContractAddr := chainA.SeedNewContractInstance()
@@ -375,8 +377,8 @@ func TestContractEmulateIBCTransferMessageOnDiffContractIBCChannel(t *testing.T)
coordinator = wasmibctesting.NewCoordinator(t, 2, chainAOpts)
- chainA = coordinator.GetChain(wasmibctesting.GetChainID(0))
- chainB = coordinator.GetChain(wasmibctesting.GetChainID(1))
+ chainA = coordinator.GetChain(wasmibctesting.GetChainID(1))
+ chainB = coordinator.GetChain(wasmibctesting.GetChainID(2))
)
coordinator.CommitBlock(chainA, chainB)
@@ -437,8 +439,8 @@ func TestContractHandlesChannelClose(t *testing.T) {
}
coordinator = wasmibctesting.NewCoordinator(t, 2, chainAOpts, chainBOpts)
- chainA = coordinator.GetChain(wasmibctesting.GetChainID(0))
- chainB = coordinator.GetChain(wasmibctesting.GetChainID(1))
+ chainA = coordinator.GetChain(wasmibctesting.GetChainID(1))
+ chainB = coordinator.GetChain(wasmibctesting.GetChainID(2))
)
coordinator.CommitBlock(chainA, chainB)
@@ -485,8 +487,8 @@ func TestContractHandlesChannelCloseNotOwned(t *testing.T) {
}
coordinator = wasmibctesting.NewCoordinator(t, 2, chainAOpts, chainBOpts)
- chainA = coordinator.GetChain(wasmibctesting.GetChainID(0))
- chainB = coordinator.GetChain(wasmibctesting.GetChainID(1))
+ chainA = coordinator.GetChain(wasmibctesting.GetChainID(1))
+ chainB = coordinator.GetChain(wasmibctesting.GetChainID(2))
)
coordinator.CommitBlock(chainA, chainB)
@@ -555,7 +557,7 @@ func (s *sendViaIBCTransferContract) Execute(code wasmvm.Checksum, env wasmvmtyp
Amount: wasmvmtypes.NewCoin(in.CoinsToSend.Amount.Uint64(), in.CoinsToSend.Denom),
ChannelID: in.ChannelID,
Timeout: wasmvmtypes.IBCTimeout{Block: &wasmvmtypes.IBCTimeoutBlock{
- Revision: 0,
+ Revision: 1,
Height: 110,
}},
},
@@ -583,7 +585,7 @@ func (s *sendEmulatedIBCTransferContract) Execute(code wasmvm.Checksum, env wasm
require.Equal(s.t, in.CoinsToSend.Amount.String(), info.Funds[0].Amount)
require.Equal(s.t, in.CoinsToSend.Denom, info.Funds[0].Denom)
dataPacket := ibctransfertypes.NewFungibleTokenPacketData(
- in.CoinsToSend.Denom, in.CoinsToSend.Amount.String(), info.Sender, in.ReceiverAddr,
+ in.CoinsToSend.Denom, in.CoinsToSend.Amount.String(), info.Sender, in.ReceiverAddr, "memo",
)
if err := dataPacket.ValidateBasic(); err != nil {
return nil, 0, err
@@ -599,7 +601,7 @@ func (s *sendEmulatedIBCTransferContract) Execute(code wasmvm.Checksum, env wasm
return &wasmvmtypes.Response{Messages: []wasmvmtypes.SubMsg{{ReplyOn: wasmvmtypes.ReplyNever, Msg: wasmvmtypes.CosmosMsg{IBC: ibcMsg}}}}, 0, nil
}
-func (c *sendEmulatedIBCTransferContract) IBCPacketTimeout(codeID wasmvm.Checksum, env wasmvmtypes.Env, msg wasmvmtypes.IBCPacketTimeoutMsg, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.IBCBasicResponse, uint64, error) {
+func (c *sendEmulatedIBCTransferContract) IBCPacketTimeout(codeID wasmvm.Checksum, env wasmvmtypes.Env, msg wasmvmtypes.IBCPacketTimeoutMsg, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.IBCBasicResponse, uint64, error) { //nolint:revive
packet := msg.Packet
var data ibctransfertypes.FungibleTokenPacketData
@@ -625,14 +627,14 @@ var _ wasmtesting.IBCContractCallbacks = &closeChannelContract{}
type closeChannelContract struct {
contractStub
- t *testing.T
+ t *testing.T //nolint:unused
}
func (c *closeChannelContract) IBCChannelClose(codeID wasmvm.Checksum, env wasmvmtypes.Env, msg wasmvmtypes.IBCChannelCloseMsg, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.IBCBasicResponse, uint64, error) {
return &wasmvmtypes.IBCBasicResponse{}, 1, nil
}
-func (s *closeChannelContract) Execute(code wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, executeMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.Response, uint64, error) {
+func (s *closeChannelContract) Execute(code wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, executeMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.Response, uint64, error) { //nolint:revive
var in closeIBCChannel
if err := json.Unmarshal(executeMsg, &in); err != nil {
return nil, 0, err
diff --git a/x/wasm/simulation/operations.go b/x/wasm/simulation/operations.go
index 34e7ef35d5..4e402290ce 100644
--- a/x/wasm/simulation/operations.go
+++ b/x/wasm/simulation/operations.go
@@ -7,11 +7,13 @@ import (
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
"github.com/cosmos/cosmos-sdk/baseapp"
- simappparams "github.com/cosmos/cosmos-sdk/simapp/params"
+ "github.com/cosmos/cosmos-sdk/codec"
+ codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/types/module"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
+ "github.com/cosmos/cosmos-sdk/x/auth/tx"
"github.com/cosmos/cosmos-sdk/x/simulation"
"github.com/CosmWasm/wasmd/app/params"
@@ -109,11 +111,10 @@ func WeightedOperations(
panic(err)
}
}
-
return simulation.WeightedOperations{
simulation.NewWeightedOperation(
weightMsgStoreCode,
- SimulateMsgStoreCode(ak, bk, wasmKeeper, wasmBz, 5_000_000),
+ SimulateMsgStoreCode(ak, bk, wasmKeeper, wasmBz),
),
simulation.NewWeightedOperation(
weightMsgInstantiateContract,
@@ -322,7 +323,12 @@ func SimulateMsgUpdateAmin(
}
// SimulateMsgStoreCode generates a MsgStoreCode with random values
-func SimulateMsgStoreCode(ak types.AccountKeeper, bk BankKeeper, wasmKeeper WasmKeeper, wasmBz []byte, gas uint64) simtypes.Operation {
+func SimulateMsgStoreCode(
+ ak types.AccountKeeper,
+ bk BankKeeper,
+ wasmKeeper WasmKeeper,
+ wasmBz []byte,
+) simtypes.Operation {
return func(
r *rand.Rand,
app *baseapp.BaseApp,
@@ -345,7 +351,7 @@ func SimulateMsgStoreCode(ak types.AccountKeeper, bk BankKeeper, wasmKeeper Wasm
InstantiatePermission: &config,
}
txCtx := BuildOperationInput(r, app, ctx, &msg, simAccount, ak, bk, nil)
- return GenAndDeliverTxWithRandFees(txCtx, gas)
+ return simulation.GenAndDeliverTxWithRandFees(txCtx)
}
}
@@ -366,7 +372,12 @@ func DefaultSimulationCodeIDSelector(ctx sdk.Context, wasmKeeper WasmKeeper) uin
}
// SimulateMsgInstantiateContract generates a MsgInstantiateContract with random values
-func SimulateMsgInstantiateContract(ak types.AccountKeeper, bk BankKeeper, wasmKeeper WasmKeeper, codeSelector CodeIDSelector) simtypes.Operation {
+func SimulateMsgInstantiateContract(
+ ak types.AccountKeeper,
+ bk BankKeeper,
+ wasmKeeper WasmKeeper,
+ codeSelector CodeIDSelector,
+) simtypes.Operation {
return func(
r *rand.Rand,
app *baseapp.BaseApp,
@@ -475,10 +486,12 @@ func BuildOperationInput(
bk BankKeeper,
deposit sdk.Coins,
) simulation.OperationInput {
+ interfaceRegistry := codectypes.NewInterfaceRegistry()
+ txConfig := tx.NewTxConfig(codec.NewProtoCodec(interfaceRegistry), tx.DefaultSignModes)
return simulation.OperationInput{
R: r,
App: app,
- TxGen: simappparams.MakeTestEncodingConfig().TxConfig,
+ TxGen: txConfig,
Cdc: nil,
Msg: msg,
MsgType: msg.Type(),
diff --git a/x/wasm/simulation/params.go b/x/wasm/simulation/params.go
index a6d55b1541..c0228b8485 100644
--- a/x/wasm/simulation/params.go
+++ b/x/wasm/simulation/params.go
@@ -11,10 +11,10 @@ import (
"github.com/CosmWasm/wasmd/x/wasm/types"
)
-func ParamChanges(r *rand.Rand, cdc codec.Codec) []simtypes.ParamChange {
+func ParamChanges(r *rand.Rand, cdc codec.Codec) []simtypes.LegacyParamChange {
params := types.DefaultParams()
- return []simtypes.ParamChange{
- simulation.NewSimParamChange(types.ModuleName, string(types.ParamStoreKeyUploadAccess),
+ return []simtypes.LegacyParamChange{
+ simulation.NewSimLegacyParamChange(types.ModuleName, string(types.ParamStoreKeyUploadAccess),
func(r *rand.Rand) string {
jsonBz, err := cdc.MarshalJSON(¶ms.CodeUploadAccess)
if err != nil {
@@ -23,7 +23,7 @@ func ParamChanges(r *rand.Rand, cdc codec.Codec) []simtypes.ParamChange {
return string(jsonBz)
},
),
- simulation.NewSimParamChange(types.ModuleName, string(types.ParamStoreKeyInstantiateAccess),
+ simulation.NewSimLegacyParamChange(types.ModuleName, string(types.ParamStoreKeyInstantiateAccess),
func(r *rand.Rand) string {
return fmt.Sprintf("%q", params.CodeUploadAccess.Permission.String())
},
diff --git a/x/wasm/simulation/sim_utils.go b/x/wasm/simulation/sim_utils.go
deleted file mode 100644
index 4f9a00b0bf..0000000000
--- a/x/wasm/simulation/sim_utils.go
+++ /dev/null
@@ -1,53 +0,0 @@
-package simulation
-
-import (
- "github.com/cosmos/cosmos-sdk/simapp/helpers"
- sdk "github.com/cosmos/cosmos-sdk/types"
- simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
- "github.com/cosmos/cosmos-sdk/x/simulation"
-)
-
-// GenAndDeliverTxWithRandFees generates a transaction with a random fee and delivers it.
-func GenAndDeliverTxWithRandFees(txCtx simulation.OperationInput, gas uint64) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
- account := txCtx.AccountKeeper.GetAccount(txCtx.Context, txCtx.SimAccount.Address)
- spendable := txCtx.Bankkeeper.SpendableCoins(txCtx.Context, account.GetAddress())
-
- var fees sdk.Coins
- var err error
-
- coins, hasNeg := spendable.SafeSub(txCtx.CoinsSpentInMsg)
- if hasNeg {
- return simtypes.NoOpMsg(txCtx.ModuleName, txCtx.MsgType, "message doesn't leave room for fees"), nil, err
- }
-
- fees, err = simtypes.RandomFees(txCtx.R, txCtx.Context, coins)
- if err != nil {
- return simtypes.NoOpMsg(txCtx.ModuleName, txCtx.MsgType, "unable to generate fees"), nil, err
- }
- return GenAndDeliverTx(txCtx, fees, gas)
-}
-
-// GenAndDeliverTx generates a transactions and delivers it.
-func GenAndDeliverTx(txCtx simulation.OperationInput, fees sdk.Coins, gas uint64) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
- account := txCtx.AccountKeeper.GetAccount(txCtx.Context, txCtx.SimAccount.Address)
- tx, err := helpers.GenTx(
- txCtx.TxGen,
- []sdk.Msg{txCtx.Msg},
- fees,
- gas,
- txCtx.Context.ChainID(),
- []uint64{account.GetAccountNumber()},
- []uint64{account.GetSequence()},
- txCtx.SimAccount.PrivKey,
- )
- if err != nil {
- return simtypes.NoOpMsg(txCtx.ModuleName, txCtx.MsgType, "unable to generate mock tx"), nil, err
- }
-
- _, _, err = txCtx.App.Deliver(txCtx.TxGen.TxEncoder(), tx)
- if err != nil {
- return simtypes.NoOpMsg(txCtx.ModuleName, txCtx.MsgType, "unable to deliver tx"), nil, err
- }
-
- return simtypes.NewOperationMsg(txCtx.Msg, true, "", txCtx.Cdc), nil, nil
-}
diff --git a/x/wasm/types/authz.go b/x/wasm/types/authz.go
index 10dd2606c9..1bc0fb8dda 100644
--- a/x/wasm/types/authz.go
+++ b/x/wasm/types/authz.go
@@ -3,7 +3,7 @@ package types
import (
"strings"
- "github.com/gogo/protobuf/proto"
+ "github.com/cosmos/gogoproto/proto"
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
@@ -472,7 +472,7 @@ func (m MaxFundsLimit) Accept(_ sdk.Context, msg AuthzableWasmMsg) (*ContractAut
if !msg.GetFunds().IsAllLTE(m.Amounts) {
return &ContractAuthzLimitAcceptResult{Accepted: false}, nil
}
- newAmounts := m.Amounts.Sub(msg.GetFunds())
+ newAmounts := m.Amounts.Sub(msg.GetFunds()...)
if newAmounts.IsZero() {
return &ContractAuthzLimitAcceptResult{Accepted: true, DeleteLimit: true}, nil
}
@@ -508,7 +508,7 @@ func (l CombinedLimit) Accept(_ sdk.Context, msg AuthzableWasmMsg) (*ContractAut
case 1:
return &ContractAuthzLimitAcceptResult{Accepted: true, DeleteLimit: true}, nil
default:
- remainingAmounts := l.Amounts.Sub(transferFunds)
+ remainingAmounts := l.Amounts.Sub(transferFunds...)
if remainingAmounts.IsZero() {
return &ContractAuthzLimitAcceptResult{Accepted: true, DeleteLimit: true}, nil
}
diff --git a/x/wasm/types/authz.pb.go b/x/wasm/types/authz.pb.go
index 2564a91a6d..82e266a49b 100644
--- a/x/wasm/types/authz.pb.go
+++ b/x/wasm/types/authz.pb.go
@@ -5,24 +5,21 @@ package types
import (
fmt "fmt"
- io "io"
- math "math"
- math_bits "math/bits"
-
_ "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"
_ "github.com/cosmos/gogoproto/gogoproto"
- proto "github.com/gogo/protobuf/proto"
+ proto "github.com/cosmos/gogoproto/proto"
+ io "io"
+ math "math"
+ math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
-var (
- _ = proto.Marshal
- _ = fmt.Errorf
- _ = math.Inf
-)
+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.
@@ -43,11 +40,9 @@ func (*ContractExecutionAuthorization) ProtoMessage() {}
func (*ContractExecutionAuthorization) Descriptor() ([]byte, []int) {
return fileDescriptor_36ff3a20cf32b258, []int{0}
}
-
func (m *ContractExecutionAuthorization) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *ContractExecutionAuthorization) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ContractExecutionAuthorization.Marshal(b, m, deterministic)
@@ -60,15 +55,12 @@ func (m *ContractExecutionAuthorization) XXX_Marshal(b []byte, deterministic boo
return b[:n], nil
}
}
-
func (m *ContractExecutionAuthorization) XXX_Merge(src proto.Message) {
xxx_messageInfo_ContractExecutionAuthorization.Merge(m, src)
}
-
func (m *ContractExecutionAuthorization) XXX_Size() int {
return m.Size()
}
-
func (m *ContractExecutionAuthorization) XXX_DiscardUnknown() {
xxx_messageInfo_ContractExecutionAuthorization.DiscardUnknown(m)
}
@@ -88,11 +80,9 @@ func (*ContractMigrationAuthorization) ProtoMessage() {}
func (*ContractMigrationAuthorization) Descriptor() ([]byte, []int) {
return fileDescriptor_36ff3a20cf32b258, []int{1}
}
-
func (m *ContractMigrationAuthorization) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *ContractMigrationAuthorization) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ContractMigrationAuthorization.Marshal(b, m, deterministic)
@@ -105,15 +95,12 @@ func (m *ContractMigrationAuthorization) XXX_Marshal(b []byte, deterministic boo
return b[:n], nil
}
}
-
func (m *ContractMigrationAuthorization) XXX_Merge(src proto.Message) {
xxx_messageInfo_ContractMigrationAuthorization.Merge(m, src)
}
-
func (m *ContractMigrationAuthorization) XXX_Size() int {
return m.Size()
}
-
func (m *ContractMigrationAuthorization) XXX_DiscardUnknown() {
xxx_messageInfo_ContractMigrationAuthorization.DiscardUnknown(m)
}
@@ -140,11 +127,9 @@ func (*ContractGrant) ProtoMessage() {}
func (*ContractGrant) Descriptor() ([]byte, []int) {
return fileDescriptor_36ff3a20cf32b258, []int{2}
}
-
func (m *ContractGrant) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *ContractGrant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ContractGrant.Marshal(b, m, deterministic)
@@ -157,15 +142,12 @@ func (m *ContractGrant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error
return b[:n], nil
}
}
-
func (m *ContractGrant) XXX_Merge(src proto.Message) {
xxx_messageInfo_ContractGrant.Merge(m, src)
}
-
func (m *ContractGrant) XXX_Size() int {
return m.Size()
}
-
func (m *ContractGrant) XXX_DiscardUnknown() {
xxx_messageInfo_ContractGrant.DiscardUnknown(m)
}
@@ -185,11 +167,9 @@ func (*MaxCallsLimit) ProtoMessage() {}
func (*MaxCallsLimit) Descriptor() ([]byte, []int) {
return fileDescriptor_36ff3a20cf32b258, []int{3}
}
-
func (m *MaxCallsLimit) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *MaxCallsLimit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MaxCallsLimit.Marshal(b, m, deterministic)
@@ -202,15 +182,12 @@ func (m *MaxCallsLimit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error
return b[:n], nil
}
}
-
func (m *MaxCallsLimit) XXX_Merge(src proto.Message) {
xxx_messageInfo_MaxCallsLimit.Merge(m, src)
}
-
func (m *MaxCallsLimit) XXX_Size() int {
return m.Size()
}
-
func (m *MaxCallsLimit) XXX_DiscardUnknown() {
xxx_messageInfo_MaxCallsLimit.DiscardUnknown(m)
}
@@ -230,11 +207,9 @@ func (*MaxFundsLimit) ProtoMessage() {}
func (*MaxFundsLimit) Descriptor() ([]byte, []int) {
return fileDescriptor_36ff3a20cf32b258, []int{4}
}
-
func (m *MaxFundsLimit) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *MaxFundsLimit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MaxFundsLimit.Marshal(b, m, deterministic)
@@ -247,15 +222,12 @@ func (m *MaxFundsLimit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error
return b[:n], nil
}
}
-
func (m *MaxFundsLimit) XXX_Merge(src proto.Message) {
xxx_messageInfo_MaxFundsLimit.Merge(m, src)
}
-
func (m *MaxFundsLimit) XXX_Size() int {
return m.Size()
}
-
func (m *MaxFundsLimit) XXX_DiscardUnknown() {
xxx_messageInfo_MaxFundsLimit.DiscardUnknown(m)
}
@@ -278,11 +250,9 @@ func (*CombinedLimit) ProtoMessage() {}
func (*CombinedLimit) Descriptor() ([]byte, []int) {
return fileDescriptor_36ff3a20cf32b258, []int{5}
}
-
func (m *CombinedLimit) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *CombinedLimit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_CombinedLimit.Marshal(b, m, deterministic)
@@ -295,15 +265,12 @@ func (m *CombinedLimit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error
return b[:n], nil
}
}
-
func (m *CombinedLimit) XXX_Merge(src proto.Message) {
xxx_messageInfo_CombinedLimit.Merge(m, src)
}
-
func (m *CombinedLimit) XXX_Size() int {
return m.Size()
}
-
func (m *CombinedLimit) XXX_DiscardUnknown() {
xxx_messageInfo_CombinedLimit.DiscardUnknown(m)
}
@@ -313,7 +280,8 @@ var xxx_messageInfo_CombinedLimit proto.InternalMessageInfo
// AllowAllMessagesFilter is a wildcard to allow any type of contract payload
// message.
// Since: wasmd 0.30
-type AllowAllMessagesFilter struct{}
+type AllowAllMessagesFilter struct {
+}
func (m *AllowAllMessagesFilter) Reset() { *m = AllowAllMessagesFilter{} }
func (m *AllowAllMessagesFilter) String() string { return proto.CompactTextString(m) }
@@ -321,11 +289,9 @@ func (*AllowAllMessagesFilter) ProtoMessage() {}
func (*AllowAllMessagesFilter) Descriptor() ([]byte, []int) {
return fileDescriptor_36ff3a20cf32b258, []int{6}
}
-
func (m *AllowAllMessagesFilter) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *AllowAllMessagesFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_AllowAllMessagesFilter.Marshal(b, m, deterministic)
@@ -338,15 +304,12 @@ func (m *AllowAllMessagesFilter) XXX_Marshal(b []byte, deterministic bool) ([]by
return b[:n], nil
}
}
-
func (m *AllowAllMessagesFilter) XXX_Merge(src proto.Message) {
xxx_messageInfo_AllowAllMessagesFilter.Merge(m, src)
}
-
func (m *AllowAllMessagesFilter) XXX_Size() int {
return m.Size()
}
-
func (m *AllowAllMessagesFilter) XXX_DiscardUnknown() {
xxx_messageInfo_AllowAllMessagesFilter.DiscardUnknown(m)
}
@@ -367,11 +330,9 @@ func (*AcceptedMessageKeysFilter) ProtoMessage() {}
func (*AcceptedMessageKeysFilter) Descriptor() ([]byte, []int) {
return fileDescriptor_36ff3a20cf32b258, []int{7}
}
-
func (m *AcceptedMessageKeysFilter) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *AcceptedMessageKeysFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_AcceptedMessageKeysFilter.Marshal(b, m, deterministic)
@@ -384,15 +345,12 @@ func (m *AcceptedMessageKeysFilter) XXX_Marshal(b []byte, deterministic bool) ([
return b[:n], nil
}
}
-
func (m *AcceptedMessageKeysFilter) XXX_Merge(src proto.Message) {
xxx_messageInfo_AcceptedMessageKeysFilter.Merge(m, src)
}
-
func (m *AcceptedMessageKeysFilter) XXX_Size() int {
return m.Size()
}
-
func (m *AcceptedMessageKeysFilter) XXX_DiscardUnknown() {
xxx_messageInfo_AcceptedMessageKeysFilter.DiscardUnknown(m)
}
@@ -413,11 +371,9 @@ func (*AcceptedMessagesFilter) ProtoMessage() {}
func (*AcceptedMessagesFilter) Descriptor() ([]byte, []int) {
return fileDescriptor_36ff3a20cf32b258, []int{8}
}
-
func (m *AcceptedMessagesFilter) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *AcceptedMessagesFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_AcceptedMessagesFilter.Marshal(b, m, deterministic)
@@ -430,15 +386,12 @@ func (m *AcceptedMessagesFilter) XXX_Marshal(b []byte, deterministic bool) ([]by
return b[:n], nil
}
}
-
func (m *AcceptedMessagesFilter) XXX_Merge(src proto.Message) {
xxx_messageInfo_AcceptedMessagesFilter.Merge(m, src)
}
-
func (m *AcceptedMessagesFilter) XXX_Size() int {
return m.Size()
}
-
func (m *AcceptedMessagesFilter) XXX_DiscardUnknown() {
xxx_messageInfo_AcceptedMessagesFilter.DiscardUnknown(m)
}
@@ -834,7 +787,6 @@ func encodeVarintAuthz(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
return base
}
-
func (m *ContractExecutionAuthorization) Size() (n int) {
if m == nil {
return 0
@@ -973,11 +925,9 @@ func (m *AcceptedMessagesFilter) Size() (n int) {
func sovAuthz(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
-
func sozAuthz(x uint64) (n int) {
return sovAuthz(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
-
func (m *ContractExecutionAuthorization) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -1062,7 +1012,6 @@ func (m *ContractExecutionAuthorization) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *ContractMigrationAuthorization) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -1147,7 +1096,6 @@ func (m *ContractMigrationAuthorization) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *ContractGrant) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -1302,7 +1250,6 @@ func (m *ContractGrant) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *MaxCallsLimit) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -1372,7 +1319,6 @@ func (m *MaxCallsLimit) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *MaxFundsLimit) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -1457,7 +1403,6 @@ func (m *MaxFundsLimit) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *CombinedLimit) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -1561,7 +1506,6 @@ func (m *CombinedLimit) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *AllowAllMessagesFilter) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -1612,7 +1556,6 @@ func (m *AllowAllMessagesFilter) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *AcceptedMessageKeysFilter) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -1695,7 +1638,6 @@ func (m *AcceptedMessageKeysFilter) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *AcceptedMessagesFilter) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -1778,7 +1720,6 @@ func (m *AcceptedMessagesFilter) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func skipAuthz(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
diff --git a/x/wasm/types/codec.go b/x/wasm/types/codec.go
index 7d8ebcbe46..076b0cb490 100644
--- a/x/wasm/types/codec.go
+++ b/x/wasm/types/codec.go
@@ -7,11 +7,14 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/msgservice"
"github.com/cosmos/cosmos-sdk/x/authz"
- govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
+ authzcodec "github.com/cosmos/cosmos-sdk/x/authz/codec"
+ govcodec "github.com/cosmos/cosmos-sdk/x/gov/codec"
+ "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
+ groupcodec "github.com/cosmos/cosmos-sdk/x/group/codec"
)
// RegisterLegacyAminoCodec registers the account types and interface
-func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { //nolint:staticcheck
+func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
cdc.RegisterConcrete(&MsgStoreCode{}, "wasm/MsgStoreCode", nil)
cdc.RegisterConcrete(&MsgInstantiateContract{}, "wasm/MsgInstantiateContract", nil)
cdc.RegisterConcrete(&MsgInstantiateContract2{}, "wasm/MsgInstantiateContract2", nil)
@@ -65,7 +68,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
&MsgUpdateInstantiateConfig{},
)
registry.RegisterImplementations(
- (*govtypes.Content)(nil),
+ (*v1beta1.Content)(nil),
&StoreCodeProposal{},
&InstantiateContractProposal{},
&InstantiateContract2Proposal{},
@@ -80,9 +83,9 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
&StoreAndInstantiateContractProposal{},
)
- registry.RegisterInterface("ContractInfoExtension", (*ContractInfoExtension)(nil))
+ registry.RegisterInterface("cosmwasm.wasm.v1.ContractInfoExtension", (*ContractInfoExtension)(nil))
- registry.RegisterInterface("ContractAuthzFilterX", (*ContractAuthzFilterX)(nil))
+ registry.RegisterInterface("cosmwasm.wasm.v1.ContractAuthzFilterX", (*ContractAuthzFilterX)(nil))
registry.RegisterImplementations(
(*ContractAuthzFilterX)(nil),
&AllowAllMessagesFilter{},
@@ -90,7 +93,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
&AcceptedMessagesFilter{},
)
- registry.RegisterInterface("ContractAuthzLimitX", (*ContractAuthzLimitX)(nil))
+ registry.RegisterInterface("cosmwasm.wasm.v1.ContractAuthzLimitX", (*ContractAuthzLimitX)(nil))
registry.RegisterImplementations(
(*ContractAuthzLimitX)(nil),
&MaxCallsLimit{},
@@ -119,4 +122,10 @@ func init() {
RegisterLegacyAminoCodec(amino)
cryptocodec.RegisterCrypto(amino)
amino.Seal()
+
+ // Register all Amino interfaces and concrete types on the authz and gov Amino codec so that this can later be
+ // used to properly serialize MsgGrant, MsgExec and MsgSubmitProposal instances
+ RegisterLegacyAminoCodec(authzcodec.Amino)
+ RegisterLegacyAminoCodec(govcodec.Amino)
+ RegisterLegacyAminoCodec(groupcodec.Amino)
}
diff --git a/x/wasm/types/errors.go b/x/wasm/types/errors.go
index 297f34d530..70b854cf90 100644
--- a/x/wasm/types/errors.go
+++ b/x/wasm/types/errors.go
@@ -1,8 +1,8 @@
package types
import (
+ sdkErrors "cosmossdk.io/errors"
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
- sdkErrors "github.com/cosmos/cosmos-sdk/types/errors"
)
// Codes for wasm contract errors
diff --git a/x/wasm/types/expected_keepers.go b/x/wasm/types/expected_keepers.go
index 57cc4073f5..e9b52273ad 100644
--- a/x/wasm/types/expected_keepers.go
+++ b/x/wasm/types/expected_keepers.go
@@ -6,11 +6,12 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
- "github.com/cosmos/cosmos-sdk/x/distribution/types"
+ distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
- connectiontypes "github.com/cosmos/ibc-go/v4/modules/core/03-connection/types"
- channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"
- ibcexported "github.com/cosmos/ibc-go/v4/modules/core/exported"
+ clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
+ connectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types"
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
+ ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
)
// BankViewKeeper defines a subset of methods implemented by the cosmos-sdk bank keeper
@@ -47,7 +48,7 @@ type AccountKeeper interface {
// DistributionKeeper defines a subset of methods implemented by the cosmos-sdk distribution keeper
type DistributionKeeper interface {
- DelegationRewards(c context.Context, req *types.QueryDelegationRewardsRequest) (*types.QueryDelegationRewardsResponse, error)
+ DelegationRewards(c context.Context, req *distrtypes.QueryDelegationRewardsRequest) (*distrtypes.QueryDelegationRewardsResponse, error)
}
// StakingKeeper defines a subset of methods implemented by the cosmos-sdk staking keeper
@@ -71,8 +72,19 @@ type StakingKeeper interface {
// 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)
- SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet ibcexported.PacketI) error
+
+ // SendPacket is called by a module in order to send an IBC packet on a channel.
+ // The packet sequence generated for the packet to be sent is returned. An error
+ // is returned if one occurs.
+ SendPacket(
+ ctx sdk.Context,
+ channelCap *capabilitytypes.Capability,
+ sourcePort string,
+ sourceChannel string,
+ timeoutHeight clienttypes.Height,
+ timeoutTimestamp uint64,
+ data []byte,
+ ) (uint64, error)
ChanCloseInit(ctx sdk.Context, portID, channelID string, chanCap *capabilitytypes.Capability) error
GetAllChannels(ctx sdk.Context) (channels []channeltypes.IdentifiedChannel)
IterateChannels(ctx sdk.Context, cb func(channeltypes.IdentifiedChannel) bool)
diff --git a/x/wasm/types/genesis.pb.go b/x/wasm/types/genesis.pb.go
index b753dc1a83..af6ab46d1d 100644
--- a/x/wasm/types/genesis.pb.go
+++ b/x/wasm/types/genesis.pb.go
@@ -5,20 +5,17 @@ package types
import (
fmt "fmt"
+ _ "github.com/cosmos/gogoproto/gogoproto"
+ proto "github.com/cosmos/gogoproto/proto"
io "io"
math "math"
math_bits "math/bits"
-
- _ "github.com/cosmos/gogoproto/gogoproto"
- proto "github.com/gogo/protobuf/proto"
)
// Reference imports to suppress errors if they are not otherwise used.
-var (
- _ = proto.Marshal
- _ = fmt.Errorf
- _ = math.Inf
-)
+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.
@@ -40,11 +37,9 @@ func (*GenesisState) ProtoMessage() {}
func (*GenesisState) Descriptor() ([]byte, []int) {
return fileDescriptor_2ab3f539b23472a6, []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)
@@ -57,15 +52,12 @@ func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
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)
}
@@ -115,11 +107,9 @@ func (*Code) ProtoMessage() {}
func (*Code) Descriptor() ([]byte, []int) {
return fileDescriptor_2ab3f539b23472a6, []int{1}
}
-
func (m *Code) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *Code) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Code.Marshal(b, m, deterministic)
@@ -132,15 +122,12 @@ func (m *Code) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return b[:n], nil
}
}
-
func (m *Code) XXX_Merge(src proto.Message) {
xxx_messageInfo_Code.Merge(m, src)
}
-
func (m *Code) XXX_Size() int {
return m.Size()
}
-
func (m *Code) XXX_DiscardUnknown() {
xxx_messageInfo_Code.DiscardUnknown(m)
}
@@ -189,11 +176,9 @@ func (*Contract) ProtoMessage() {}
func (*Contract) Descriptor() ([]byte, []int) {
return fileDescriptor_2ab3f539b23472a6, []int{2}
}
-
func (m *Contract) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *Contract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Contract.Marshal(b, m, deterministic)
@@ -206,15 +191,12 @@ func (m *Contract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return b[:n], nil
}
}
-
func (m *Contract) XXX_Merge(src proto.Message) {
xxx_messageInfo_Contract.Merge(m, src)
}
-
func (m *Contract) XXX_Size() int {
return m.Size()
}
-
func (m *Contract) XXX_DiscardUnknown() {
xxx_messageInfo_Contract.DiscardUnknown(m)
}
@@ -261,11 +243,9 @@ func (*Sequence) ProtoMessage() {}
func (*Sequence) Descriptor() ([]byte, []int) {
return fileDescriptor_2ab3f539b23472a6, []int{3}
}
-
func (m *Sequence) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *Sequence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Sequence.Marshal(b, m, deterministic)
@@ -278,15 +258,12 @@ func (m *Sequence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return b[:n], nil
}
}
-
func (m *Sequence) XXX_Merge(src proto.Message) {
xxx_messageInfo_Sequence.Merge(m, src)
}
-
func (m *Sequence) XXX_Size() int {
return m.Size()
}
-
func (m *Sequence) XXX_DiscardUnknown() {
xxx_messageInfo_Sequence.DiscardUnknown(m)
}
@@ -599,7 +576,6 @@ func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
return base
}
-
func (m *GenesisState) Size() (n int) {
if m == nil {
return 0
@@ -696,11 +672,9 @@ func (m *Sequence) Size() (n int) {
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
@@ -886,7 +860,6 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *Code) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -1043,7 +1016,6 @@ func (m *Code) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *Contract) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -1227,7 +1199,6 @@ func (m *Contract) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *Sequence) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -1331,7 +1302,6 @@ func (m *Sequence) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func skipGenesis(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
diff --git a/x/wasm/types/genesis_test.go b/x/wasm/types/genesis_test.go
index 51c95e4d16..b34eda82cf 100644
--- a/x/wasm/types/genesis_test.go
+++ b/x/wasm/types/genesis_test.go
@@ -5,16 +5,17 @@ import (
"testing"
"time"
+ "github.com/cometbft/cometbft/libs/rand"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
- govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
+ "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
"github.com/stretchr/testify/assert"
- "github.com/tendermint/tendermint/libs/rand"
-
"github.com/stretchr/testify/require"
)
+const invalid = "invalid"
+
func TestValidateGenesisState(t *testing.T) {
specs := map[string]struct {
srcMutator func(*GenesisState)
@@ -37,7 +38,7 @@ func TestValidateGenesisState(t *testing.T) {
},
"contract invalid": {
srcMutator: func(s *GenesisState) {
- s.Contracts[0].ContractAddress = "invalid"
+ s.Contracts[0].ContractAddress = invalid
},
expError: true,
},
@@ -119,13 +120,13 @@ func TestContractValidateBasic(t *testing.T) {
"all good": {srcMutator: func(_ *Contract) {}},
"contract address invalid": {
srcMutator: func(c *Contract) {
- c.ContractAddress = "invalid"
+ c.ContractAddress = invalid
},
expError: true,
},
"contract info invalid": {
srcMutator: func(c *Contract) {
- c.ContractInfo.Creator = "invalid"
+ c.ContractInfo.Creator = invalid
},
expError: true,
},
@@ -168,7 +169,7 @@ func TestGenesisContractInfoMarshalUnmarshal(t *testing.T) {
anyTime := time.Now().UTC()
// using gov proposal here as a random protobuf types as it contains an Any type inside for nested unpacking
- myExtension, err := govtypes.NewProposal(&govtypes.TextProposal{Title: "bar"}, 1, anyTime, anyTime)
+ myExtension, err := v1beta1.NewProposal(&v1beta1.TextProposal{Title: "bar"}, 1, anyTime, anyTime)
require.NoError(t, err)
myExtension.TotalDeposit = nil
@@ -182,10 +183,10 @@ func TestGenesisContractInfoMarshalUnmarshal(t *testing.T) {
// register proposal as extension type
interfaceRegistry.RegisterImplementations(
(*ContractInfoExtension)(nil),
- &govtypes.Proposal{},
+ &v1beta1.Proposal{},
)
// register gov types for nested Anys
- govtypes.RegisterInterfaces(interfaceRegistry)
+ v1beta1.RegisterInterfaces(interfaceRegistry)
// when encode
gs := GenesisState{
@@ -205,7 +206,7 @@ func TestGenesisContractInfoMarshalUnmarshal(t *testing.T) {
dest := destGs.Contracts[0].ContractInfo
assert.Equal(t, src, dest)
// and sanity check nested any
- var destExt govtypes.Proposal
+ var destExt v1beta1.Proposal
require.NoError(t, dest.ReadExtension(&destExt))
assert.Equal(t, destExt.GetTitle(), "bar")
}
diff --git a/x/wasm/types/iavl_range_test.go b/x/wasm/types/iavl_range_test.go
index 85a4a18c95..fd3297b467 100644
--- a/x/wasm/types/iavl_range_test.go
+++ b/x/wasm/types/iavl_range_test.go
@@ -3,11 +3,11 @@ package types
import (
"testing"
+ dbm "github.com/cometbft/cometbft-db"
"github.com/cosmos/cosmos-sdk/store"
"github.com/cosmos/cosmos-sdk/store/iavl"
iavl2 "github.com/cosmos/iavl"
"github.com/stretchr/testify/require"
- dbm "github.com/tendermint/tm-db"
)
// This is modeled close to
diff --git a/x/wasm/types/ibc.pb.go b/x/wasm/types/ibc.pb.go
index 370b4aef85..37463d89c6 100644
--- a/x/wasm/types/ibc.pb.go
+++ b/x/wasm/types/ibc.pb.go
@@ -5,20 +5,17 @@ package types
import (
fmt "fmt"
+ _ "github.com/cosmos/gogoproto/gogoproto"
+ proto "github.com/cosmos/gogoproto/proto"
io "io"
math "math"
math_bits "math/bits"
-
- _ "github.com/cosmos/gogoproto/gogoproto"
- proto "github.com/gogo/protobuf/proto"
)
// Reference imports to suppress errors if they are not otherwise used.
-var (
- _ = proto.Marshal
- _ = fmt.Errorf
- _ = math.Inf
-)
+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.
@@ -47,11 +44,9 @@ func (*MsgIBCSend) ProtoMessage() {}
func (*MsgIBCSend) Descriptor() ([]byte, []int) {
return fileDescriptor_af0d1c43ea53c4b9, []int{0}
}
-
func (m *MsgIBCSend) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *MsgIBCSend) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MsgIBCSend.Marshal(b, m, deterministic)
@@ -64,15 +59,12 @@ func (m *MsgIBCSend) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return b[:n], nil
}
}
-
func (m *MsgIBCSend) XXX_Merge(src proto.Message) {
xxx_messageInfo_MsgIBCSend.Merge(m, src)
}
-
func (m *MsgIBCSend) XXX_Size() int {
return m.Size()
}
-
func (m *MsgIBCSend) XXX_DiscardUnknown() {
xxx_messageInfo_MsgIBCSend.DiscardUnknown(m)
}
@@ -90,11 +82,9 @@ func (*MsgIBCCloseChannel) ProtoMessage() {}
func (*MsgIBCCloseChannel) Descriptor() ([]byte, []int) {
return fileDescriptor_af0d1c43ea53c4b9, []int{1}
}
-
func (m *MsgIBCCloseChannel) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *MsgIBCCloseChannel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MsgIBCCloseChannel.Marshal(b, m, deterministic)
@@ -107,15 +97,12 @@ func (m *MsgIBCCloseChannel) XXX_Marshal(b []byte, deterministic bool) ([]byte,
return b[:n], nil
}
}
-
func (m *MsgIBCCloseChannel) XXX_Merge(src proto.Message) {
xxx_messageInfo_MsgIBCCloseChannel.Merge(m, src)
}
-
func (m *MsgIBCCloseChannel) XXX_Size() int {
return m.Size()
}
-
func (m *MsgIBCCloseChannel) XXX_DiscardUnknown() {
xxx_messageInfo_MsgIBCCloseChannel.DiscardUnknown(m)
}
@@ -240,7 +227,6 @@ func encodeVarintIbc(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
return base
}
-
func (m *MsgIBCSend) Size() (n int) {
if m == nil {
return 0
@@ -280,11 +266,9 @@ func (m *MsgIBCCloseChannel) Size() (n int) {
func sovIbc(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
-
func sozIbc(x uint64) (n int) {
return sovIbc(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
-
func (m *MsgIBCSend) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -439,7 +423,6 @@ func (m *MsgIBCSend) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *MsgIBCCloseChannel) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -522,7 +505,6 @@ func (m *MsgIBCCloseChannel) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func skipIbc(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
diff --git a/x/wasm/types/json_matching_test.go b/x/wasm/types/json_matching_test.go
index 01d2d3efd3..286fde3969 100644
--- a/x/wasm/types/json_matching_test.go
+++ b/x/wasm/types/json_matching_test.go
@@ -81,11 +81,11 @@ func TestIsJSONObjectWithTopLevelKey(t *testing.T) {
expResult: false,
},
// not supported: https://github.com/golang/go/issues/24415
- //"errors for duplicate key": {
+ // "errors for duplicate key": {
// src: []byte(`{"claim": "foo", "claim":"bar"}`),
// allowedKeys: []string{"claim"},
// expErr: ErrNotAJSONObject,
- //},
+ // },
// Not one top-level key
"false for no top-level key": {
diff --git a/x/wasm/types/keys.go b/x/wasm/types/keys.go
index 95078e1445..b2d4a94c9f 100644
--- a/x/wasm/types/keys.go
+++ b/x/wasm/types/keys.go
@@ -22,7 +22,6 @@ const (
RouterKey = ModuleName
)
-// nolint
var (
CodeKeyPrefix = []byte{0x01}
ContractKeyPrefix = []byte{0x02}
diff --git a/x/wasm/types/keys_test.go b/x/wasm/types/keys_test.go
index 3db6bbadfe..a75ddb9c5e 100644
--- a/x/wasm/types/keys_test.go
+++ b/x/wasm/types/keys_test.go
@@ -108,22 +108,6 @@ func TestGetContractByCreatorSecondaryIndexKey(t *testing.T) {
}
assert.Equal(t, exp, got)
- // test that contract addresses of 32 length are still supported
- contractAddr = bytes.Repeat([]byte{4}, 32)
- got = GetContractByCreatorSecondaryIndexKey(creatorAddr, e.Updated.Bytes(), contractAddr)
- exp = []byte{
- 9, // prefix
- 20, // creator address length
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // creator address with fixed length prefix
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 1, 0, 0, 0, 0, 0, 0, 2, // height
- 1, 0, 0, 0, 0, 0, 0, 3, // index
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // address 32 bytes
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4,
- }
-
// test that creator is contract addresses of 32 length
contractAddr = bytes.Repeat([]byte{4}, 32)
creatorAddr = bytes.Repeat([]byte{8}, 32)
diff --git a/x/wasm/types/params.go b/x/wasm/types/params.go
index 0ee7dcb619..c5be18826a 100644
--- a/x/wasm/types/params.go
+++ b/x/wasm/types/params.go
@@ -7,7 +7,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
- "github.com/gogo/protobuf/jsonpb"
+ "github.com/cosmos/gogoproto/jsonpb"
"github.com/pkg/errors"
"gopkg.in/yaml.v2"
)
diff --git a/x/wasm/types/proposal.go b/x/wasm/types/proposal.go
index 96e2c9b510..2556c588fc 100644
--- a/x/wasm/types/proposal.go
+++ b/x/wasm/types/proposal.go
@@ -9,6 +9,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
+ "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
)
type ProposalType string
@@ -66,30 +67,18 @@ func ConvertToProposals(keys []string) ([]ProposalType, error) {
}
func init() { // register new content types with the sdk
- govtypes.RegisterProposalType(string(ProposalTypeStoreCode))
- govtypes.RegisterProposalType(string(ProposalTypeInstantiateContract))
- govtypes.RegisterProposalType(string(ProposalTypeInstantiateContract2))
- govtypes.RegisterProposalType(string(ProposalTypeMigrateContract))
- govtypes.RegisterProposalType(string(ProposalTypeSudoContract))
- govtypes.RegisterProposalType(string(ProposalTypeExecuteContract))
- govtypes.RegisterProposalType(string(ProposalTypeUpdateAdmin))
- govtypes.RegisterProposalType(string(ProposalTypeClearAdmin))
- govtypes.RegisterProposalType(string(ProposalTypePinCodes))
- govtypes.RegisterProposalType(string(ProposalTypeUnpinCodes))
- govtypes.RegisterProposalType(string(ProposalTypeUpdateInstantiateConfig))
- govtypes.RegisterProposalType(string(ProposalTypeStoreAndInstantiateContractProposal))
- govtypes.RegisterProposalTypeCodec(&StoreCodeProposal{}, "wasm/StoreCodeProposal")
- govtypes.RegisterProposalTypeCodec(&InstantiateContractProposal{}, "wasm/InstantiateContractProposal")
- govtypes.RegisterProposalTypeCodec(&InstantiateContract2Proposal{}, "wasm/InstantiateContract2Proposal")
- govtypes.RegisterProposalTypeCodec(&MigrateContractProposal{}, "wasm/MigrateContractProposal")
- govtypes.RegisterProposalTypeCodec(&SudoContractProposal{}, "wasm/SudoContractProposal")
- govtypes.RegisterProposalTypeCodec(&ExecuteContractProposal{}, "wasm/ExecuteContractProposal")
- govtypes.RegisterProposalTypeCodec(&UpdateAdminProposal{}, "wasm/UpdateAdminProposal")
- govtypes.RegisterProposalTypeCodec(&ClearAdminProposal{}, "wasm/ClearAdminProposal")
- govtypes.RegisterProposalTypeCodec(&PinCodesProposal{}, "wasm/PinCodesProposal")
- govtypes.RegisterProposalTypeCodec(&UnpinCodesProposal{}, "wasm/UnpinCodesProposal")
- govtypes.RegisterProposalTypeCodec(&UpdateInstantiateConfigProposal{}, "wasm/UpdateInstantiateConfigProposal")
- govtypes.RegisterProposalTypeCodec(&StoreAndInstantiateContractProposal{}, "wasm/StoreAndInstantiateContractProposal")
+ v1beta1.RegisterProposalType(string(ProposalTypeStoreCode))
+ v1beta1.RegisterProposalType(string(ProposalTypeInstantiateContract))
+ v1beta1.RegisterProposalType(string(ProposalTypeInstantiateContract2))
+ v1beta1.RegisterProposalType(string(ProposalTypeMigrateContract))
+ v1beta1.RegisterProposalType(string(ProposalTypeSudoContract))
+ v1beta1.RegisterProposalType(string(ProposalTypeExecuteContract))
+ v1beta1.RegisterProposalType(string(ProposalTypeUpdateAdmin))
+ v1beta1.RegisterProposalType(string(ProposalTypeClearAdmin))
+ v1beta1.RegisterProposalType(string(ProposalTypePinCodes))
+ v1beta1.RegisterProposalType(string(ProposalTypeUnpinCodes))
+ v1beta1.RegisterProposalType(string(ProposalTypeUpdateInstantiateConfig))
+ v1beta1.RegisterProposalType(string(ProposalTypeStoreAndInstantiateContractProposal))
}
func NewStoreCodeProposal(
@@ -915,8 +904,8 @@ func validateProposalCommons(title, description string) error {
if len(title) == 0 {
return sdkerrors.Wrap(govtypes.ErrInvalidProposalContent, "proposal title cannot be blank")
}
- if len(title) > govtypes.MaxTitleLength {
- return sdkerrors.Wrapf(govtypes.ErrInvalidProposalContent, "proposal title is longer than max length of %d", govtypes.MaxTitleLength)
+ if len(title) > v1beta1.MaxTitleLength {
+ return sdkerrors.Wrapf(govtypes.ErrInvalidProposalContent, "proposal title is longer than max length of %d", v1beta1.MaxTitleLength)
}
if strings.TrimSpace(description) != description {
return sdkerrors.Wrap(govtypes.ErrInvalidProposalContent, "proposal description must not start/end with white spaces")
@@ -924,8 +913,8 @@ func validateProposalCommons(title, description string) error {
if len(description) == 0 {
return sdkerrors.Wrap(govtypes.ErrInvalidProposalContent, "proposal description cannot be blank")
}
- if len(description) > govtypes.MaxDescriptionLength {
- return sdkerrors.Wrapf(govtypes.ErrInvalidProposalContent, "proposal description is longer than max length of %d", govtypes.MaxDescriptionLength)
+ if len(description) > v1beta1.MaxDescriptionLength {
+ return sdkerrors.Wrapf(govtypes.ErrInvalidProposalContent, "proposal description is longer than max length of %d", v1beta1.MaxDescriptionLength)
}
return nil
}
diff --git a/x/wasm/types/proposal.pb.go b/x/wasm/types/proposal.pb.go
index 39f23e303c..d560e49974 100644
--- a/x/wasm/types/proposal.pb.go
+++ b/x/wasm/types/proposal.pb.go
@@ -6,23 +6,20 @@ package types
import (
bytes "bytes"
fmt "fmt"
- io "io"
- math "math"
- math_bits "math/bits"
-
_ "github.com/cosmos/cosmos-proto"
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
types "github.com/cosmos/cosmos-sdk/types"
_ "github.com/cosmos/gogoproto/gogoproto"
- proto "github.com/gogo/protobuf/proto"
+ proto "github.com/cosmos/gogoproto/proto"
+ io "io"
+ math "math"
+ math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
-var (
- _ = proto.Marshal
- _ = fmt.Errorf
- _ = math.Inf
-)
+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.
@@ -59,11 +56,9 @@ func (*StoreCodeProposal) ProtoMessage() {}
func (*StoreCodeProposal) Descriptor() ([]byte, []int) {
return fileDescriptor_be6422d717c730cb, []int{0}
}
-
func (m *StoreCodeProposal) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *StoreCodeProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_StoreCodeProposal.Marshal(b, m, deterministic)
@@ -76,15 +71,12 @@ func (m *StoreCodeProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, e
return b[:n], nil
}
}
-
func (m *StoreCodeProposal) XXX_Merge(src proto.Message) {
xxx_messageInfo_StoreCodeProposal.Merge(m, src)
}
-
func (m *StoreCodeProposal) XXX_Size() int {
return m.Size()
}
-
func (m *StoreCodeProposal) XXX_DiscardUnknown() {
xxx_messageInfo_StoreCodeProposal.DiscardUnknown(m)
}
@@ -117,11 +109,9 @@ func (*InstantiateContractProposal) ProtoMessage() {}
func (*InstantiateContractProposal) Descriptor() ([]byte, []int) {
return fileDescriptor_be6422d717c730cb, []int{1}
}
-
func (m *InstantiateContractProposal) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *InstantiateContractProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_InstantiateContractProposal.Marshal(b, m, deterministic)
@@ -134,15 +124,12 @@ func (m *InstantiateContractProposal) XXX_Marshal(b []byte, deterministic bool)
return b[:n], nil
}
}
-
func (m *InstantiateContractProposal) XXX_Merge(src proto.Message) {
xxx_messageInfo_InstantiateContractProposal.Merge(m, src)
}
-
func (m *InstantiateContractProposal) XXX_Size() int {
return m.Size()
}
-
func (m *InstantiateContractProposal) XXX_DiscardUnknown() {
xxx_messageInfo_InstantiateContractProposal.DiscardUnknown(m)
}
@@ -156,7 +143,7 @@ type InstantiateContract2Proposal struct {
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
// Description is a human readable text
Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
- // RunAs is the address that is passed to the contract's environment as sender
+ // RunAs is the address that is passed to the contract's enviroment as sender
RunAs string `protobuf:"bytes,3,opt,name=run_as,json=runAs,proto3" json:"run_as,omitempty"`
// Admin is an optional address that can execute migrations
Admin string `protobuf:"bytes,4,opt,name=admin,proto3" json:"admin,omitempty"`
@@ -180,11 +167,9 @@ func (*InstantiateContract2Proposal) ProtoMessage() {}
func (*InstantiateContract2Proposal) Descriptor() ([]byte, []int) {
return fileDescriptor_be6422d717c730cb, []int{2}
}
-
func (m *InstantiateContract2Proposal) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *InstantiateContract2Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_InstantiateContract2Proposal.Marshal(b, m, deterministic)
@@ -197,15 +182,12 @@ func (m *InstantiateContract2Proposal) XXX_Marshal(b []byte, deterministic bool)
return b[:n], nil
}
}
-
func (m *InstantiateContract2Proposal) XXX_Merge(src proto.Message) {
xxx_messageInfo_InstantiateContract2Proposal.Merge(m, src)
}
-
func (m *InstantiateContract2Proposal) XXX_Size() int {
return m.Size()
}
-
func (m *InstantiateContract2Proposal) XXX_DiscardUnknown() {
xxx_messageInfo_InstantiateContract2Proposal.DiscardUnknown(m)
}
@@ -231,11 +213,9 @@ func (*MigrateContractProposal) ProtoMessage() {}
func (*MigrateContractProposal) Descriptor() ([]byte, []int) {
return fileDescriptor_be6422d717c730cb, []int{3}
}
-
func (m *MigrateContractProposal) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *MigrateContractProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MigrateContractProposal.Marshal(b, m, deterministic)
@@ -248,15 +228,12 @@ func (m *MigrateContractProposal) XXX_Marshal(b []byte, deterministic bool) ([]b
return b[:n], nil
}
}
-
func (m *MigrateContractProposal) XXX_Merge(src proto.Message) {
xxx_messageInfo_MigrateContractProposal.Merge(m, src)
}
-
func (m *MigrateContractProposal) XXX_Size() int {
return m.Size()
}
-
func (m *MigrateContractProposal) XXX_DiscardUnknown() {
xxx_messageInfo_MigrateContractProposal.DiscardUnknown(m)
}
@@ -280,11 +257,9 @@ func (*SudoContractProposal) ProtoMessage() {}
func (*SudoContractProposal) Descriptor() ([]byte, []int) {
return fileDescriptor_be6422d717c730cb, []int{4}
}
-
func (m *SudoContractProposal) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *SudoContractProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_SudoContractProposal.Marshal(b, m, deterministic)
@@ -297,15 +272,12 @@ func (m *SudoContractProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte
return b[:n], nil
}
}
-
func (m *SudoContractProposal) XXX_Merge(src proto.Message) {
xxx_messageInfo_SudoContractProposal.Merge(m, src)
}
-
func (m *SudoContractProposal) XXX_Size() int {
return m.Size()
}
-
func (m *SudoContractProposal) XXX_DiscardUnknown() {
xxx_messageInfo_SudoContractProposal.DiscardUnknown(m)
}
@@ -334,11 +306,9 @@ func (*ExecuteContractProposal) ProtoMessage() {}
func (*ExecuteContractProposal) Descriptor() ([]byte, []int) {
return fileDescriptor_be6422d717c730cb, []int{5}
}
-
func (m *ExecuteContractProposal) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *ExecuteContractProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ExecuteContractProposal.Marshal(b, m, deterministic)
@@ -351,15 +321,12 @@ func (m *ExecuteContractProposal) XXX_Marshal(b []byte, deterministic bool) ([]b
return b[:n], nil
}
}
-
func (m *ExecuteContractProposal) XXX_Merge(src proto.Message) {
xxx_messageInfo_ExecuteContractProposal.Merge(m, src)
}
-
func (m *ExecuteContractProposal) XXX_Size() int {
return m.Size()
}
-
func (m *ExecuteContractProposal) XXX_DiscardUnknown() {
xxx_messageInfo_ExecuteContractProposal.DiscardUnknown(m)
}
@@ -383,11 +350,9 @@ func (*UpdateAdminProposal) ProtoMessage() {}
func (*UpdateAdminProposal) Descriptor() ([]byte, []int) {
return fileDescriptor_be6422d717c730cb, []int{6}
}
-
func (m *UpdateAdminProposal) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *UpdateAdminProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_UpdateAdminProposal.Marshal(b, m, deterministic)
@@ -400,15 +365,12 @@ func (m *UpdateAdminProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte,
return b[:n], nil
}
}
-
func (m *UpdateAdminProposal) XXX_Merge(src proto.Message) {
xxx_messageInfo_UpdateAdminProposal.Merge(m, src)
}
-
func (m *UpdateAdminProposal) XXX_Size() int {
return m.Size()
}
-
func (m *UpdateAdminProposal) XXX_DiscardUnknown() {
xxx_messageInfo_UpdateAdminProposal.DiscardUnknown(m)
}
@@ -431,11 +393,9 @@ func (*ClearAdminProposal) ProtoMessage() {}
func (*ClearAdminProposal) Descriptor() ([]byte, []int) {
return fileDescriptor_be6422d717c730cb, []int{7}
}
-
func (m *ClearAdminProposal) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *ClearAdminProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ClearAdminProposal.Marshal(b, m, deterministic)
@@ -448,15 +408,12 @@ func (m *ClearAdminProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte,
return b[:n], nil
}
}
-
func (m *ClearAdminProposal) XXX_Merge(src proto.Message) {
xxx_messageInfo_ClearAdminProposal.Merge(m, src)
}
-
func (m *ClearAdminProposal) XXX_Size() int {
return m.Size()
}
-
func (m *ClearAdminProposal) XXX_DiscardUnknown() {
xxx_messageInfo_ClearAdminProposal.DiscardUnknown(m)
}
@@ -479,11 +436,9 @@ func (*PinCodesProposal) ProtoMessage() {}
func (*PinCodesProposal) Descriptor() ([]byte, []int) {
return fileDescriptor_be6422d717c730cb, []int{8}
}
-
func (m *PinCodesProposal) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *PinCodesProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_PinCodesProposal.Marshal(b, m, deterministic)
@@ -496,15 +451,12 @@ func (m *PinCodesProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, er
return b[:n], nil
}
}
-
func (m *PinCodesProposal) XXX_Merge(src proto.Message) {
xxx_messageInfo_PinCodesProposal.Merge(m, src)
}
-
func (m *PinCodesProposal) XXX_Size() int {
return m.Size()
}
-
func (m *PinCodesProposal) XXX_DiscardUnknown() {
xxx_messageInfo_PinCodesProposal.DiscardUnknown(m)
}
@@ -527,11 +479,9 @@ func (*UnpinCodesProposal) ProtoMessage() {}
func (*UnpinCodesProposal) Descriptor() ([]byte, []int) {
return fileDescriptor_be6422d717c730cb, []int{9}
}
-
func (m *UnpinCodesProposal) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *UnpinCodesProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_UnpinCodesProposal.Marshal(b, m, deterministic)
@@ -544,15 +494,12 @@ func (m *UnpinCodesProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte,
return b[:n], nil
}
}
-
func (m *UnpinCodesProposal) XXX_Merge(src proto.Message) {
xxx_messageInfo_UnpinCodesProposal.Merge(m, src)
}
-
func (m *UnpinCodesProposal) XXX_Size() int {
return m.Size()
}
-
func (m *UnpinCodesProposal) XXX_DiscardUnknown() {
xxx_messageInfo_UnpinCodesProposal.DiscardUnknown(m)
}
@@ -573,11 +520,9 @@ func (*AccessConfigUpdate) ProtoMessage() {}
func (*AccessConfigUpdate) Descriptor() ([]byte, []int) {
return fileDescriptor_be6422d717c730cb, []int{10}
}
-
func (m *AccessConfigUpdate) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *AccessConfigUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_AccessConfigUpdate.Marshal(b, m, deterministic)
@@ -590,15 +535,12 @@ func (m *AccessConfigUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte,
return b[:n], nil
}
}
-
func (m *AccessConfigUpdate) XXX_Merge(src proto.Message) {
xxx_messageInfo_AccessConfigUpdate.Merge(m, src)
}
-
func (m *AccessConfigUpdate) XXX_Size() int {
return m.Size()
}
-
func (m *AccessConfigUpdate) XXX_DiscardUnknown() {
xxx_messageInfo_AccessConfigUpdate.DiscardUnknown(m)
}
@@ -622,11 +564,9 @@ func (*UpdateInstantiateConfigProposal) ProtoMessage() {}
func (*UpdateInstantiateConfigProposal) Descriptor() ([]byte, []int) {
return fileDescriptor_be6422d717c730cb, []int{11}
}
-
func (m *UpdateInstantiateConfigProposal) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *UpdateInstantiateConfigProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_UpdateInstantiateConfigProposal.Marshal(b, m, deterministic)
@@ -639,15 +579,12 @@ func (m *UpdateInstantiateConfigProposal) XXX_Marshal(b []byte, deterministic bo
return b[:n], nil
}
}
-
func (m *UpdateInstantiateConfigProposal) XXX_Merge(src proto.Message) {
xxx_messageInfo_UpdateInstantiateConfigProposal.Merge(m, src)
}
-
func (m *UpdateInstantiateConfigProposal) XXX_Size() int {
return m.Size()
}
-
func (m *UpdateInstantiateConfigProposal) XXX_DiscardUnknown() {
xxx_messageInfo_UpdateInstantiateConfigProposal.DiscardUnknown(m)
}
@@ -692,11 +629,9 @@ func (*StoreAndInstantiateContractProposal) ProtoMessage() {}
func (*StoreAndInstantiateContractProposal) Descriptor() ([]byte, []int) {
return fileDescriptor_be6422d717c730cb, []int{12}
}
-
func (m *StoreAndInstantiateContractProposal) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *StoreAndInstantiateContractProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_StoreAndInstantiateContractProposal.Marshal(b, m, deterministic)
@@ -709,15 +644,12 @@ func (m *StoreAndInstantiateContractProposal) XXX_Marshal(b []byte, deterministi
return b[:n], nil
}
}
-
func (m *StoreAndInstantiateContractProposal) XXX_Merge(src proto.Message) {
xxx_messageInfo_StoreAndInstantiateContractProposal.Merge(m, src)
}
-
func (m *StoreAndInstantiateContractProposal) XXX_Size() int {
return m.Size()
}
-
func (m *StoreAndInstantiateContractProposal) XXX_DiscardUnknown() {
xxx_messageInfo_StoreAndInstantiateContractProposal.DiscardUnknown(m)
}
@@ -859,7 +791,6 @@ func (this *StoreCodeProposal) Equal(that interface{}) bool {
}
return true
}
-
func (this *InstantiateContractProposal) Equal(that interface{}) bool {
if that == nil {
return this == nil
@@ -910,7 +841,6 @@ func (this *InstantiateContractProposal) Equal(that interface{}) bool {
}
return true
}
-
func (this *InstantiateContract2Proposal) Equal(that interface{}) bool {
if that == nil {
return this == nil
@@ -967,7 +897,6 @@ func (this *InstantiateContract2Proposal) Equal(that interface{}) bool {
}
return true
}
-
func (this *MigrateContractProposal) Equal(that interface{}) bool {
if that == nil {
return this == nil
@@ -1004,7 +933,6 @@ func (this *MigrateContractProposal) Equal(that interface{}) bool {
}
return true
}
-
func (this *SudoContractProposal) Equal(that interface{}) bool {
if that == nil {
return this == nil
@@ -1038,7 +966,6 @@ func (this *SudoContractProposal) Equal(that interface{}) bool {
}
return true
}
-
func (this *ExecuteContractProposal) Equal(that interface{}) bool {
if that == nil {
return this == nil
@@ -1083,7 +1010,6 @@ func (this *ExecuteContractProposal) Equal(that interface{}) bool {
}
return true
}
-
func (this *UpdateAdminProposal) Equal(that interface{}) bool {
if that == nil {
return this == nil
@@ -1117,7 +1043,6 @@ func (this *UpdateAdminProposal) Equal(that interface{}) bool {
}
return true
}
-
func (this *ClearAdminProposal) Equal(that interface{}) bool {
if that == nil {
return this == nil
@@ -1148,7 +1073,6 @@ func (this *ClearAdminProposal) Equal(that interface{}) bool {
}
return true
}
-
func (this *PinCodesProposal) Equal(that interface{}) bool {
if that == nil {
return this == nil
@@ -1184,7 +1108,6 @@ func (this *PinCodesProposal) Equal(that interface{}) bool {
}
return true
}
-
func (this *UnpinCodesProposal) Equal(that interface{}) bool {
if that == nil {
return this == nil
@@ -1220,7 +1143,6 @@ func (this *UnpinCodesProposal) Equal(that interface{}) bool {
}
return true
}
-
func (this *AccessConfigUpdate) Equal(that interface{}) bool {
if that == nil {
return this == nil
@@ -1248,7 +1170,6 @@ func (this *AccessConfigUpdate) Equal(that interface{}) bool {
}
return true
}
-
func (this *UpdateInstantiateConfigProposal) Equal(that interface{}) bool {
if that == nil {
return this == nil
@@ -1284,7 +1205,6 @@ func (this *UpdateInstantiateConfigProposal) Equal(that interface{}) bool {
}
return true
}
-
func (this *StoreAndInstantiateContractProposal) Equal(that interface{}) bool {
if that == nil {
return this == nil
@@ -1350,7 +1270,6 @@ func (this *StoreAndInstantiateContractProposal) Equal(that interface{}) bool {
}
return true
}
-
func (m *StoreCodeProposal) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -2243,7 +2162,6 @@ func encodeVarintProposal(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
return base
}
-
func (m *StoreCodeProposal) Size() (n int) {
if m == nil {
return 0
@@ -2663,11 +2581,9 @@ func (m *StoreAndInstantiateContractProposal) Size() (n int) {
func sovProposal(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
-
func sozProposal(x uint64) (n int) {
return sovProposal(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
-
func (m *StoreCodeProposal) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -3002,7 +2918,6 @@ func (m *StoreCodeProposal) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *InstantiateContractProposal) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -3300,7 +3215,6 @@ func (m *InstantiateContractProposal) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *InstantiateContract2Proposal) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -3652,7 +3566,6 @@ func (m *InstantiateContract2Proposal) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *MigrateContractProposal) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -3852,7 +3765,6 @@ func (m *MigrateContractProposal) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *SudoContractProposal) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -4033,7 +3945,6 @@ func (m *SudoContractProposal) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *ExecuteContractProposal) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -4280,7 +4191,6 @@ func (m *ExecuteContractProposal) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *UpdateAdminProposal) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -4459,7 +4369,6 @@ func (m *UpdateAdminProposal) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *ClearAdminProposal) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -4606,7 +4515,6 @@ func (m *ClearAdminProposal) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *PinCodesProposal) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -4797,7 +4705,6 @@ func (m *PinCodesProposal) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *UnpinCodesProposal) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -4988,7 +4895,6 @@ func (m *UnpinCodesProposal) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *AccessConfigUpdate) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -5091,7 +4997,6 @@ func (m *AccessConfigUpdate) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *UpdateInstantiateConfigProposal) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -5240,7 +5145,6 @@ func (m *UpdateInstantiateConfigProposal) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *StoreAndInstantiateContractProposal) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -5707,7 +5611,6 @@ func (m *StoreAndInstantiateContractProposal) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func skipProposal(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
diff --git a/x/wasm/types/proposal_test.go b/x/wasm/types/proposal_test.go
index a558744f8b..a82f49fa5a 100644
--- a/x/wasm/types/proposal_test.go
+++ b/x/wasm/types/proposal_test.go
@@ -7,12 +7,14 @@ import (
"testing"
sdk "github.com/cosmos/cosmos-sdk/types"
- govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
+ "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v2"
)
+const invalidAddress = "invalid address"
+
func TestValidateProposalCommons(t *testing.T) {
type commonProposal struct {
Title, Description string
@@ -48,7 +50,7 @@ func TestValidateProposalCommons(t *testing.T) {
},
"prevent title exceeds max length ": {
src: commonProposal{
- Title: strings.Repeat("a", govtypes.MaxTitleLength+1),
+ Title: strings.Repeat("a", v1beta1.MaxTitleLength+1),
Description: "Bar",
},
expErr: true,
@@ -76,7 +78,7 @@ func TestValidateProposalCommons(t *testing.T) {
"prevent descr exceeds max length ": {
src: commonProposal{
Title: "Foo",
- Description: strings.Repeat("a", govtypes.MaxDescriptionLength+1),
+ Description: strings.Repeat("a", v1beta1.MaxDescriptionLength+1),
},
expErr: true,
},
@@ -187,8 +189,6 @@ func TestValidateStoreCodeProposal(t *testing.T) {
}
func TestValidateInstantiateContractProposal(t *testing.T) {
- invalidAddress := "invalid address"
-
specs := map[string]struct {
src *InstantiateContractProposal
expErr bool
@@ -280,8 +280,6 @@ func TestValidateInstantiateContractProposal(t *testing.T) {
}
func TestValidateInstantiateContract2Proposal(t *testing.T) {
- invalidAddress := "invalid address"
-
specs := map[string]struct {
src *InstantiateContract2Proposal
expErr bool
@@ -577,8 +575,6 @@ func TestValidateMigrateContractProposal(t *testing.T) {
}
func TestValidateSudoContractProposal(t *testing.T) {
- invalidAddress := "invalid address"
-
specs := map[string]struct {
src *SudoContractProposal
expErr bool
@@ -630,8 +626,6 @@ func TestValidateSudoContractProposal(t *testing.T) {
}
func TestValidateExecuteContractProposal(t *testing.T) {
- invalidAddress := "invalid address"
-
specs := map[string]struct {
src *ExecuteContractProposal
expErr bool
@@ -689,8 +683,6 @@ func TestValidateExecuteContractProposal(t *testing.T) {
}
func TestValidateUpdateAdminProposal(t *testing.T) {
- invalidAddress := "invalid address"
-
specs := map[string]struct {
src *UpdateAdminProposal
expErr bool
@@ -742,8 +734,6 @@ func TestValidateUpdateAdminProposal(t *testing.T) {
}
func TestValidateClearAdminProposal(t *testing.T) {
- invalidAddress := "invalid address"
-
specs := map[string]struct {
src *ClearAdminProposal
expErr bool
@@ -784,7 +774,7 @@ func TestValidateClearAdminProposal(t *testing.T) {
func TestProposalStrings(t *testing.T) {
specs := map[string]struct {
- src govtypes.Content
+ src v1beta1.Content
exp string
}{
"store code": {
@@ -903,7 +893,7 @@ func TestProposalStrings(t *testing.T) {
func TestProposalYaml(t *testing.T) {
specs := map[string]struct {
- src govtypes.Content
+ src v1beta1.Content
exp string
}{
"store code": {
@@ -1051,8 +1041,8 @@ func TestConvertToProposals(t *testing.T) {
func TestUnmarshalContentFromJson(t *testing.T) {
specs := map[string]struct {
src string
- got govtypes.Content
- exp govtypes.Content
+ got v1beta1.Content
+ exp v1beta1.Content
}{
"instantiate ": {
src: `
@@ -1109,7 +1099,7 @@ func TestUnmarshalContentFromJson(t *testing.T) {
func TestProposalJsonSignBytes(t *testing.T) {
const myInnerMsg = `{"foo":"bar"}`
specs := map[string]struct {
- src govtypes.Content
+ src v1beta1.Content
exp string
}{
"instantiate contract": {
@@ -1131,11 +1121,11 @@ func TestProposalJsonSignBytes(t *testing.T) {
}
for name, spec := range specs {
t.Run(name, func(t *testing.T) {
- msg, err := govtypes.NewMsgSubmitProposal(spec.src, sdk.NewCoins(), []byte{})
+ msg, err := v1beta1.NewMsgSubmitProposal(spec.src, sdk.NewCoins(), []byte{})
require.NoError(t, err)
bz := msg.GetSignBytes()
- assert.JSONEq(t, spec.exp, string(bz), "raw: %s", string(bz))
+ assert.JSONEq(t, spec.exp, string(bz), "exp %s\n got: %s\n", spec.exp, string(bz))
})
}
}
diff --git a/x/wasm/types/query.pb.go b/x/wasm/types/query.pb.go
index 95175f2ae6..741744fc43 100644
--- a/x/wasm/types/query.pb.go
+++ b/x/wasm/types/query.pb.go
@@ -7,27 +7,24 @@ import (
bytes "bytes"
context "context"
fmt "fmt"
- io "io"
- math "math"
- math_bits "math/bits"
-
+ github_com_cometbft_cometbft_libs_bytes "github.com/cometbft/cometbft/libs/bytes"
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_tendermint_tendermint_libs_bytes "github.com/tendermint/tendermint/libs/bytes"
+ grpc1 "github.com/cosmos/gogoproto/grpc"
+ proto "github.com/cosmos/gogoproto/proto"
_ "google.golang.org/genproto/googleapis/api/annotations"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
+ io "io"
+ math "math"
+ math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
-var (
- _ = proto.Marshal
- _ = fmt.Errorf
- _ = math.Inf
-)
+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.
@@ -48,11 +45,9 @@ func (*QueryContractInfoRequest) ProtoMessage() {}
func (*QueryContractInfoRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_9677c207036b9f2b, []int{0}
}
-
func (m *QueryContractInfoRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *QueryContractInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryContractInfoRequest.Marshal(b, m, deterministic)
@@ -65,15 +60,12 @@ func (m *QueryContractInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]
return b[:n], nil
}
}
-
func (m *QueryContractInfoRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryContractInfoRequest.Merge(m, src)
}
-
func (m *QueryContractInfoRequest) XXX_Size() int {
return m.Size()
}
-
func (m *QueryContractInfoRequest) XXX_DiscardUnknown() {
xxx_messageInfo_QueryContractInfoRequest.DiscardUnknown(m)
}
@@ -94,11 +86,9 @@ func (*QueryContractInfoResponse) ProtoMessage() {}
func (*QueryContractInfoResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_9677c207036b9f2b, []int{1}
}
-
func (m *QueryContractInfoResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *QueryContractInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryContractInfoResponse.Marshal(b, m, deterministic)
@@ -111,15 +101,12 @@ func (m *QueryContractInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([
return b[:n], nil
}
}
-
func (m *QueryContractInfoResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryContractInfoResponse.Merge(m, src)
}
-
func (m *QueryContractInfoResponse) XXX_Size() int {
return m.Size()
}
-
func (m *QueryContractInfoResponse) XXX_DiscardUnknown() {
xxx_messageInfo_QueryContractInfoResponse.DiscardUnknown(m)
}
@@ -141,11 +128,9 @@ func (*QueryContractHistoryRequest) ProtoMessage() {}
func (*QueryContractHistoryRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_9677c207036b9f2b, []int{2}
}
-
func (m *QueryContractHistoryRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *QueryContractHistoryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryContractHistoryRequest.Marshal(b, m, deterministic)
@@ -158,15 +143,12 @@ func (m *QueryContractHistoryRequest) XXX_Marshal(b []byte, deterministic bool)
return b[:n], nil
}
}
-
func (m *QueryContractHistoryRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryContractHistoryRequest.Merge(m, src)
}
-
func (m *QueryContractHistoryRequest) XXX_Size() int {
return m.Size()
}
-
func (m *QueryContractHistoryRequest) XXX_DiscardUnknown() {
xxx_messageInfo_QueryContractHistoryRequest.DiscardUnknown(m)
}
@@ -187,11 +169,9 @@ func (*QueryContractHistoryResponse) ProtoMessage() {}
func (*QueryContractHistoryResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_9677c207036b9f2b, []int{3}
}
-
func (m *QueryContractHistoryResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *QueryContractHistoryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryContractHistoryResponse.Marshal(b, m, deterministic)
@@ -204,15 +184,12 @@ func (m *QueryContractHistoryResponse) XXX_Marshal(b []byte, deterministic bool)
return b[:n], nil
}
}
-
func (m *QueryContractHistoryResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryContractHistoryResponse.Merge(m, src)
}
-
func (m *QueryContractHistoryResponse) XXX_Size() int {
return m.Size()
}
-
func (m *QueryContractHistoryResponse) XXX_DiscardUnknown() {
xxx_messageInfo_QueryContractHistoryResponse.DiscardUnknown(m)
}
@@ -233,11 +210,9 @@ func (*QueryContractsByCodeRequest) ProtoMessage() {}
func (*QueryContractsByCodeRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_9677c207036b9f2b, []int{4}
}
-
func (m *QueryContractsByCodeRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *QueryContractsByCodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryContractsByCodeRequest.Marshal(b, m, deterministic)
@@ -250,15 +225,12 @@ func (m *QueryContractsByCodeRequest) XXX_Marshal(b []byte, deterministic bool)
return b[:n], nil
}
}
-
func (m *QueryContractsByCodeRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryContractsByCodeRequest.Merge(m, src)
}
-
func (m *QueryContractsByCodeRequest) XXX_Size() int {
return m.Size()
}
-
func (m *QueryContractsByCodeRequest) XXX_DiscardUnknown() {
xxx_messageInfo_QueryContractsByCodeRequest.DiscardUnknown(m)
}
@@ -280,11 +252,9 @@ func (*QueryContractsByCodeResponse) ProtoMessage() {}
func (*QueryContractsByCodeResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_9677c207036b9f2b, []int{5}
}
-
func (m *QueryContractsByCodeResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *QueryContractsByCodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryContractsByCodeResponse.Marshal(b, m, deterministic)
@@ -297,15 +267,12 @@ func (m *QueryContractsByCodeResponse) XXX_Marshal(b []byte, deterministic bool)
return b[:n], nil
}
}
-
func (m *QueryContractsByCodeResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryContractsByCodeResponse.Merge(m, src)
}
-
func (m *QueryContractsByCodeResponse) XXX_Size() int {
return m.Size()
}
-
func (m *QueryContractsByCodeResponse) XXX_DiscardUnknown() {
xxx_messageInfo_QueryContractsByCodeResponse.DiscardUnknown(m)
}
@@ -327,11 +294,9 @@ func (*QueryAllContractStateRequest) ProtoMessage() {}
func (*QueryAllContractStateRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_9677c207036b9f2b, []int{6}
}
-
func (m *QueryAllContractStateRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *QueryAllContractStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryAllContractStateRequest.Marshal(b, m, deterministic)
@@ -344,15 +309,12 @@ func (m *QueryAllContractStateRequest) XXX_Marshal(b []byte, deterministic bool)
return b[:n], nil
}
}
-
func (m *QueryAllContractStateRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryAllContractStateRequest.Merge(m, src)
}
-
func (m *QueryAllContractStateRequest) XXX_Size() int {
return m.Size()
}
-
func (m *QueryAllContractStateRequest) XXX_DiscardUnknown() {
xxx_messageInfo_QueryAllContractStateRequest.DiscardUnknown(m)
}
@@ -373,11 +335,9 @@ func (*QueryAllContractStateResponse) ProtoMessage() {}
func (*QueryAllContractStateResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_9677c207036b9f2b, []int{7}
}
-
func (m *QueryAllContractStateResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *QueryAllContractStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryAllContractStateResponse.Marshal(b, m, deterministic)
@@ -390,15 +350,12 @@ func (m *QueryAllContractStateResponse) XXX_Marshal(b []byte, deterministic bool
return b[:n], nil
}
}
-
func (m *QueryAllContractStateResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryAllContractStateResponse.Merge(m, src)
}
-
func (m *QueryAllContractStateResponse) XXX_Size() int {
return m.Size()
}
-
func (m *QueryAllContractStateResponse) XXX_DiscardUnknown() {
xxx_messageInfo_QueryAllContractStateResponse.DiscardUnknown(m)
}
@@ -419,11 +376,9 @@ func (*QueryRawContractStateRequest) ProtoMessage() {}
func (*QueryRawContractStateRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_9677c207036b9f2b, []int{8}
}
-
func (m *QueryRawContractStateRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *QueryRawContractStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryRawContractStateRequest.Marshal(b, m, deterministic)
@@ -436,15 +391,12 @@ func (m *QueryRawContractStateRequest) XXX_Marshal(b []byte, deterministic bool)
return b[:n], nil
}
}
-
func (m *QueryRawContractStateRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryRawContractStateRequest.Merge(m, src)
}
-
func (m *QueryRawContractStateRequest) XXX_Size() int {
return m.Size()
}
-
func (m *QueryRawContractStateRequest) XXX_DiscardUnknown() {
xxx_messageInfo_QueryRawContractStateRequest.DiscardUnknown(m)
}
@@ -464,11 +416,9 @@ func (*QueryRawContractStateResponse) ProtoMessage() {}
func (*QueryRawContractStateResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_9677c207036b9f2b, []int{9}
}
-
func (m *QueryRawContractStateResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *QueryRawContractStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryRawContractStateResponse.Marshal(b, m, deterministic)
@@ -481,15 +431,12 @@ func (m *QueryRawContractStateResponse) XXX_Marshal(b []byte, deterministic bool
return b[:n], nil
}
}
-
func (m *QueryRawContractStateResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryRawContractStateResponse.Merge(m, src)
}
-
func (m *QueryRawContractStateResponse) XXX_Size() int {
return m.Size()
}
-
func (m *QueryRawContractStateResponse) XXX_DiscardUnknown() {
xxx_messageInfo_QueryRawContractStateResponse.DiscardUnknown(m)
}
@@ -511,11 +458,9 @@ func (*QuerySmartContractStateRequest) ProtoMessage() {}
func (*QuerySmartContractStateRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_9677c207036b9f2b, []int{10}
}
-
func (m *QuerySmartContractStateRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *QuerySmartContractStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QuerySmartContractStateRequest.Marshal(b, m, deterministic)
@@ -528,15 +473,12 @@ func (m *QuerySmartContractStateRequest) XXX_Marshal(b []byte, deterministic boo
return b[:n], nil
}
}
-
func (m *QuerySmartContractStateRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_QuerySmartContractStateRequest.Merge(m, src)
}
-
func (m *QuerySmartContractStateRequest) XXX_Size() int {
return m.Size()
}
-
func (m *QuerySmartContractStateRequest) XXX_DiscardUnknown() {
xxx_messageInfo_QuerySmartContractStateRequest.DiscardUnknown(m)
}
@@ -556,11 +498,9 @@ func (*QuerySmartContractStateResponse) ProtoMessage() {}
func (*QuerySmartContractStateResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_9677c207036b9f2b, []int{11}
}
-
func (m *QuerySmartContractStateResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *QuerySmartContractStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QuerySmartContractStateResponse.Marshal(b, m, deterministic)
@@ -573,15 +513,12 @@ func (m *QuerySmartContractStateResponse) XXX_Marshal(b []byte, deterministic bo
return b[:n], nil
}
}
-
func (m *QuerySmartContractStateResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_QuerySmartContractStateResponse.Merge(m, src)
}
-
func (m *QuerySmartContractStateResponse) XXX_Size() int {
return m.Size()
}
-
func (m *QuerySmartContractStateResponse) XXX_DiscardUnknown() {
xxx_messageInfo_QuerySmartContractStateResponse.DiscardUnknown(m)
}
@@ -599,11 +536,9 @@ func (*QueryCodeRequest) ProtoMessage() {}
func (*QueryCodeRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_9677c207036b9f2b, []int{12}
}
-
func (m *QueryCodeRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *QueryCodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryCodeRequest.Marshal(b, m, deterministic)
@@ -616,15 +551,12 @@ func (m *QueryCodeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er
return b[:n], nil
}
}
-
func (m *QueryCodeRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryCodeRequest.Merge(m, src)
}
-
func (m *QueryCodeRequest) XXX_Size() int {
return m.Size()
}
-
func (m *QueryCodeRequest) XXX_DiscardUnknown() {
xxx_messageInfo_QueryCodeRequest.DiscardUnknown(m)
}
@@ -633,10 +565,10 @@ var xxx_messageInfo_QueryCodeRequest proto.InternalMessageInfo
// CodeInfoResponse contains code meta data from CodeInfo
type CodeInfoResponse struct {
- CodeID uint64 `protobuf:"varint,1,opt,name=code_id,json=codeId,proto3" json:"id"`
- Creator string `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty"`
- DataHash github_com_tendermint_tendermint_libs_bytes.HexBytes `protobuf:"bytes,3,opt,name=data_hash,json=dataHash,proto3,casttype=github.com/tendermint/tendermint/libs/bytes.HexBytes" json:"data_hash,omitempty"`
- InstantiatePermission AccessConfig `protobuf:"bytes,6,opt,name=instantiate_permission,json=instantiatePermission,proto3" json:"instantiate_permission"`
+ CodeID uint64 `protobuf:"varint,1,opt,name=code_id,json=codeId,proto3" json:"id"`
+ Creator string `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty"`
+ DataHash github_com_cometbft_cometbft_libs_bytes.HexBytes `protobuf:"bytes,3,opt,name=data_hash,json=dataHash,proto3,casttype=github.com/cometbft/cometbft/libs/bytes.HexBytes" json:"data_hash,omitempty"`
+ InstantiatePermission AccessConfig `protobuf:"bytes,6,opt,name=instantiate_permission,json=instantiatePermission,proto3" json:"instantiate_permission"`
}
func (m *CodeInfoResponse) Reset() { *m = CodeInfoResponse{} }
@@ -645,11 +577,9 @@ func (*CodeInfoResponse) ProtoMessage() {}
func (*CodeInfoResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_9677c207036b9f2b, []int{13}
}
-
func (m *CodeInfoResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *CodeInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_CodeInfoResponse.Marshal(b, m, deterministic)
@@ -662,15 +592,12 @@ func (m *CodeInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, er
return b[:n], nil
}
}
-
func (m *CodeInfoResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_CodeInfoResponse.Merge(m, src)
}
-
func (m *CodeInfoResponse) XXX_Size() int {
return m.Size()
}
-
func (m *CodeInfoResponse) XXX_DiscardUnknown() {
xxx_messageInfo_CodeInfoResponse.DiscardUnknown(m)
}
@@ -689,11 +616,9 @@ func (*QueryCodeResponse) ProtoMessage() {}
func (*QueryCodeResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_9677c207036b9f2b, []int{14}
}
-
func (m *QueryCodeResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *QueryCodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryCodeResponse.Marshal(b, m, deterministic)
@@ -706,15 +631,12 @@ func (m *QueryCodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e
return b[:n], nil
}
}
-
func (m *QueryCodeResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryCodeResponse.Merge(m, src)
}
-
func (m *QueryCodeResponse) XXX_Size() int {
return m.Size()
}
-
func (m *QueryCodeResponse) XXX_DiscardUnknown() {
xxx_messageInfo_QueryCodeResponse.DiscardUnknown(m)
}
@@ -733,11 +655,9 @@ func (*QueryCodesRequest) ProtoMessage() {}
func (*QueryCodesRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_9677c207036b9f2b, []int{15}
}
-
func (m *QueryCodesRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *QueryCodesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryCodesRequest.Marshal(b, m, deterministic)
@@ -750,15 +670,12 @@ func (m *QueryCodesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e
return b[:n], nil
}
}
-
func (m *QueryCodesRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryCodesRequest.Merge(m, src)
}
-
func (m *QueryCodesRequest) XXX_Size() int {
return m.Size()
}
-
func (m *QueryCodesRequest) XXX_DiscardUnknown() {
xxx_messageInfo_QueryCodesRequest.DiscardUnknown(m)
}
@@ -778,11 +695,9 @@ func (*QueryCodesResponse) ProtoMessage() {}
func (*QueryCodesResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_9677c207036b9f2b, []int{16}
}
-
func (m *QueryCodesResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *QueryCodesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryCodesResponse.Marshal(b, m, deterministic)
@@ -795,15 +710,12 @@ func (m *QueryCodesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte,
return b[:n], nil
}
}
-
func (m *QueryCodesResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryCodesResponse.Merge(m, src)
}
-
func (m *QueryCodesResponse) XXX_Size() int {
return m.Size()
}
-
func (m *QueryCodesResponse) XXX_DiscardUnknown() {
xxx_messageInfo_QueryCodesResponse.DiscardUnknown(m)
}
@@ -823,11 +735,9 @@ func (*QueryPinnedCodesRequest) ProtoMessage() {}
func (*QueryPinnedCodesRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_9677c207036b9f2b, []int{17}
}
-
func (m *QueryPinnedCodesRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *QueryPinnedCodesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryPinnedCodesRequest.Marshal(b, m, deterministic)
@@ -840,15 +750,12 @@ func (m *QueryPinnedCodesRequest) XXX_Marshal(b []byte, deterministic bool) ([]b
return b[:n], nil
}
}
-
func (m *QueryPinnedCodesRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryPinnedCodesRequest.Merge(m, src)
}
-
func (m *QueryPinnedCodesRequest) XXX_Size() int {
return m.Size()
}
-
func (m *QueryPinnedCodesRequest) XXX_DiscardUnknown() {
xxx_messageInfo_QueryPinnedCodesRequest.DiscardUnknown(m)
}
@@ -869,11 +776,9 @@ func (*QueryPinnedCodesResponse) ProtoMessage() {}
func (*QueryPinnedCodesResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_9677c207036b9f2b, []int{18}
}
-
func (m *QueryPinnedCodesResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *QueryPinnedCodesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryPinnedCodesResponse.Marshal(b, m, deterministic)
@@ -886,15 +791,12 @@ func (m *QueryPinnedCodesResponse) XXX_Marshal(b []byte, deterministic bool) ([]
return b[:n], nil
}
}
-
func (m *QueryPinnedCodesResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryPinnedCodesResponse.Merge(m, src)
}
-
func (m *QueryPinnedCodesResponse) XXX_Size() int {
return m.Size()
}
-
func (m *QueryPinnedCodesResponse) XXX_DiscardUnknown() {
xxx_messageInfo_QueryPinnedCodesResponse.DiscardUnknown(m)
}
@@ -902,7 +804,8 @@ func (m *QueryPinnedCodesResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_QueryPinnedCodesResponse proto.InternalMessageInfo
// QueryParamsRequest is the request type for the Query/Params RPC method.
-type QueryParamsRequest struct{}
+type QueryParamsRequest struct {
+}
func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} }
func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) }
@@ -910,11 +813,9 @@ func (*QueryParamsRequest) ProtoMessage() {}
func (*QueryParamsRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_9677c207036b9f2b, []int{19}
}
-
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)
@@ -927,15 +828,12 @@ func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte,
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)
}
@@ -954,11 +852,9 @@ func (*QueryParamsResponse) ProtoMessage() {}
func (*QueryParamsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_9677c207036b9f2b, []int{20}
}
-
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)
@@ -971,15 +867,12 @@ func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte,
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)
}
@@ -1001,11 +894,9 @@ func (*QueryContractsByCreatorRequest) ProtoMessage() {}
func (*QueryContractsByCreatorRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_9677c207036b9f2b, []int{21}
}
-
func (m *QueryContractsByCreatorRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *QueryContractsByCreatorRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryContractsByCreatorRequest.Marshal(b, m, deterministic)
@@ -1018,15 +909,12 @@ func (m *QueryContractsByCreatorRequest) XXX_Marshal(b []byte, deterministic boo
return b[:n], nil
}
}
-
func (m *QueryContractsByCreatorRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryContractsByCreatorRequest.Merge(m, src)
}
-
func (m *QueryContractsByCreatorRequest) XXX_Size() int {
return m.Size()
}
-
func (m *QueryContractsByCreatorRequest) XXX_DiscardUnknown() {
xxx_messageInfo_QueryContractsByCreatorRequest.DiscardUnknown(m)
}
@@ -1048,11 +936,9 @@ func (*QueryContractsByCreatorResponse) ProtoMessage() {}
func (*QueryContractsByCreatorResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_9677c207036b9f2b, []int{22}
}
-
func (m *QueryContractsByCreatorResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *QueryContractsByCreatorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_QueryContractsByCreatorResponse.Marshal(b, m, deterministic)
@@ -1065,15 +951,12 @@ func (m *QueryContractsByCreatorResponse) XXX_Marshal(b []byte, deterministic bo
return b[:n], nil
}
}
-
func (m *QueryContractsByCreatorResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_QueryContractsByCreatorResponse.Merge(m, src)
}
-
func (m *QueryContractsByCreatorResponse) XXX_Size() int {
return m.Size()
}
-
func (m *QueryContractsByCreatorResponse) XXX_DiscardUnknown() {
xxx_messageInfo_QueryContractsByCreatorResponse.DiscardUnknown(m)
}
@@ -1109,91 +992,90 @@ func init() {
func init() { proto.RegisterFile("cosmwasm/wasm/v1/query.proto", fileDescriptor_9677c207036b9f2b) }
var fileDescriptor_9677c207036b9f2b = []byte{
- // 1331 bytes of a gzipped FileDescriptorProto
- 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x98, 0xcd, 0x6f, 0x1b, 0xc5,
- 0x1b, 0xc7, 0x3d, 0xa9, 0xe3, 0x97, 0x69, 0xfa, 0xab, 0x3b, 0xbf, 0xd2, 0x18, 0x93, 0xae, 0xa3,
- 0xa5, 0xa4, 0x69, 0x9a, 0xee, 0x92, 0x34, 0xa1, 0x80, 0x84, 0x50, 0x9c, 0x42, 0x93, 0x48, 0x91,
- 0xd2, 0xad, 0x50, 0x25, 0x7a, 0xb0, 0xc6, 0xde, 0x89, 0xb3, 0x52, 0xbc, 0xeb, 0xec, 0x4c, 0x92,
- 0x5a, 0x51, 0x00, 0x55, 0xe2, 0x86, 0x78, 0x11, 0xe2, 0xc0, 0x01, 0xc1, 0x01, 0x15, 0xce, 0x70,
- 0x41, 0x5c, 0xb9, 0xe4, 0x18, 0x89, 0x0b, 0x27, 0x0b, 0x1c, 0x0e, 0x28, 0x7f, 0x42, 0x4f, 0x68,
- 0x67, 0x67, 0x9c, 0x5d, 0xdb, 0x1b, 0x3b, 0x95, 0xc5, 0xc5, 0xda, 0xdd, 0x79, 0x66, 0x9e, 0xcf,
- 0xf3, 0x9d, 0x67, 0xe6, 0x79, 0x64, 0x38, 0x56, 0x76, 0x68, 0x75, 0x17, 0xd3, 0xaa, 0xce, 0x7f,
- 0x76, 0x66, 0xf4, 0xad, 0x6d, 0xe2, 0xd6, 0xb5, 0x9a, 0xeb, 0x30, 0x07, 0x65, 0xe4, 0xa8, 0xc6,
- 0x7f, 0x76, 0x66, 0x72, 0x97, 0x2b, 0x4e, 0xc5, 0xe1, 0x83, 0xba, 0xf7, 0xe4, 0xdb, 0xe5, 0x3a,
- 0x57, 0x61, 0xf5, 0x1a, 0xa1, 0x72, 0xb4, 0xe2, 0x38, 0x95, 0x4d, 0xa2, 0xe3, 0x9a, 0xa5, 0x63,
- 0xdb, 0x76, 0x18, 0x66, 0x96, 0x63, 0xcb, 0xd1, 0x29, 0x6f, 0xae, 0x43, 0xf5, 0x12, 0xa6, 0xc4,
- 0x77, 0xae, 0xef, 0xcc, 0x94, 0x08, 0xc3, 0x33, 0x7a, 0x0d, 0x57, 0x2c, 0x9b, 0x1b, 0xfb, 0xb6,
- 0xea, 0x1c, 0xcc, 0xde, 0xf7, 0x2c, 0x16, 0x1d, 0x9b, 0xb9, 0xb8, 0xcc, 0x96, 0xed, 0x75, 0xc7,
- 0x20, 0x5b, 0xdb, 0x84, 0x32, 0x94, 0x85, 0x49, 0x6c, 0x9a, 0x2e, 0xa1, 0x34, 0x0b, 0xc6, 0xc1,
- 0x64, 0xda, 0x90, 0xaf, 0xea, 0xa7, 0x00, 0xbe, 0xd8, 0x65, 0x1a, 0xad, 0x39, 0x36, 0x25, 0xd1,
- 0xf3, 0xd0, 0x7d, 0x78, 0xa1, 0x2c, 0x66, 0x14, 0x2d, 0x7b, 0xdd, 0xc9, 0x0e, 0x8d, 0x83, 0xc9,
- 0xf3, 0xb3, 0x8a, 0xd6, 0xae, 0x8a, 0x16, 0x5c, 0xb8, 0x30, 0x72, 0xd0, 0xc8, 0xc7, 0x0e, 0x1b,
- 0x79, 0x70, 0xdc, 0xc8, 0xc7, 0x8c, 0x91, 0x72, 0x60, 0xec, 0xcd, 0xf8, 0x3f, 0xdf, 0xe5, 0x81,
- 0xfa, 0x21, 0x7c, 0x29, 0xc4, 0xb3, 0x64, 0x51, 0xe6, 0xb8, 0xf5, 0x9e, 0x91, 0xa0, 0x77, 0x21,
- 0x3c, 0xd1, 0x44, 0xe0, 0x4c, 0x68, 0xbe, 0x80, 0x9a, 0x27, 0xa0, 0xe6, 0xef, 0x9e, 0x10, 0x50,
- 0x5b, 0xc3, 0x15, 0x22, 0x56, 0x35, 0x02, 0x33, 0xd5, 0x9f, 0x01, 0x1c, 0xeb, 0x4e, 0x20, 0x44,
- 0x59, 0x81, 0x49, 0x62, 0x33, 0xd7, 0x22, 0x1e, 0xc2, 0xb9, 0xc9, 0xf3, 0xb3, 0x53, 0xd1, 0x41,
- 0x2f, 0x3a, 0x26, 0x11, 0xf3, 0xdf, 0xb1, 0x99, 0x5b, 0x2f, 0xc4, 0x3d, 0x01, 0x0c, 0xb9, 0x00,
- 0xba, 0xd7, 0x05, 0xfa, 0x7a, 0x4f, 0x68, 0x1f, 0x24, 0x44, 0xfd, 0x41, 0x9b, 0x6c, 0xb4, 0x50,
- 0xf7, 0x7c, 0x4b, 0xd9, 0x46, 0x61, 0xb2, 0xec, 0x98, 0xa4, 0x68, 0x99, 0x5c, 0xb6, 0xb8, 0x91,
- 0xf0, 0x5e, 0x97, 0xcd, 0x81, 0xa9, 0xf6, 0x71, 0xbb, 0x6a, 0x2d, 0x00, 0xa1, 0xda, 0x18, 0x4c,
- 0xcb, 0xdd, 0xf6, 0x75, 0x4b, 0x1b, 0x27, 0x1f, 0x06, 0xa7, 0xc3, 0x47, 0x92, 0x63, 0x61, 0x73,
- 0x53, 0xa2, 0x3c, 0x60, 0x98, 0x91, 0xff, 0x2e, 0x81, 0xbe, 0x05, 0xf0, 0x6a, 0x04, 0x82, 0xd0,
- 0x62, 0x1e, 0x26, 0xaa, 0x8e, 0x49, 0x36, 0x65, 0x02, 0x8d, 0x76, 0x26, 0xd0, 0xaa, 0x37, 0x2e,
- 0xb2, 0x45, 0x18, 0x0f, 0x4e, 0xa4, 0x87, 0x42, 0x23, 0x03, 0xef, 0x9e, 0x51, 0xa3, 0xab, 0x10,
- 0x72, 0x1f, 0x45, 0x13, 0x33, 0xcc, 0x11, 0x46, 0x8c, 0x34, 0xff, 0x72, 0x17, 0x33, 0xac, 0xde,
- 0x16, 0x91, 0x77, 0x2e, 0x2c, 0x22, 0x47, 0x30, 0xce, 0x67, 0x02, 0x3e, 0x93, 0x3f, 0xab, 0x5b,
- 0x50, 0xe1, 0x93, 0x1e, 0x54, 0xb1, 0xcb, 0xce, 0xc8, 0x33, 0xdf, 0xc9, 0x53, 0xb8, 0xf2, 0xac,
- 0x91, 0x47, 0x01, 0x82, 0x55, 0x42, 0xa9, 0xa7, 0x44, 0x80, 0x73, 0x15, 0xe6, 0x23, 0x5d, 0x0a,
- 0xd2, 0xa9, 0x20, 0x69, 0xe4, 0x9a, 0x7e, 0x04, 0x37, 0x61, 0x46, 0xe4, 0x7e, 0xef, 0x13, 0xa7,
- 0x7e, 0x33, 0x04, 0x33, 0x9e, 0x61, 0xe8, 0xa2, 0xbd, 0xd1, 0x66, 0x5d, 0xc8, 0x34, 0x1b, 0xf9,
- 0x04, 0x37, 0xbb, 0x7b, 0xdc, 0xc8, 0x0f, 0x59, 0x66, 0xeb, 0xc4, 0x66, 0x61, 0xb2, 0xec, 0x12,
- 0xcc, 0x1c, 0x97, 0xc7, 0x9b, 0x36, 0xe4, 0x2b, 0x7a, 0x0f, 0xa6, 0x3d, 0x9c, 0xe2, 0x06, 0xa6,
- 0x1b, 0xd9, 0x73, 0x9c, 0xfb, 0xf5, 0x67, 0x8d, 0xfc, 0x5c, 0xc5, 0x62, 0x1b, 0xdb, 0x25, 0xad,
- 0xec, 0x54, 0x75, 0x46, 0x6c, 0x93, 0xb8, 0x55, 0xcb, 0x66, 0xc1, 0xc7, 0x4d, 0xab, 0x44, 0xf5,
- 0x52, 0x9d, 0x11, 0xaa, 0x2d, 0x91, 0xc7, 0x05, 0xef, 0xc1, 0x48, 0x79, 0x4b, 0x2d, 0x61, 0xba,
- 0x81, 0x1e, 0xc1, 0x2b, 0x96, 0x4d, 0x19, 0xb6, 0x99, 0x85, 0x19, 0x29, 0xd6, 0xbc, 0x49, 0x94,
- 0x7a, 0x29, 0x98, 0x88, 0xba, 0xf3, 0x17, 0xca, 0x65, 0x42, 0xe9, 0xa2, 0x63, 0xaf, 0x5b, 0x15,
- 0x91, 0xc4, 0x2f, 0x04, 0xd6, 0x58, 0x6b, 0x2d, 0xe1, 0x5f, 0xfa, 0x2b, 0xf1, 0x54, 0x3c, 0x33,
- 0xbc, 0x12, 0x4f, 0x0d, 0x67, 0x12, 0xea, 0x13, 0x00, 0x2f, 0x05, 0xd4, 0x14, 0x02, 0x2d, 0x7b,
- 0xd7, 0x87, 0x27, 0x90, 0x57, 0x6b, 0x00, 0xf7, 0xab, 0x76, 0xbb, 0x76, 0xc3, 0xba, 0x16, 0x52,
- 0xad, 0x5a, 0x93, 0x2a, 0x8b, 0x31, 0x34, 0x26, 0x76, 0xd6, 0xcf, 0x96, 0xd4, 0x71, 0x23, 0xcf,
- 0xdf, 0xfd, 0xbd, 0x14, 0x55, 0xe8, 0x51, 0x80, 0x81, 0xca, 0x2d, 0x0d, 0x5f, 0x10, 0xe0, 0xb9,
- 0x2f, 0x88, 0xa7, 0x00, 0xa2, 0xe0, 0xea, 0x22, 0xc4, 0x7b, 0x10, 0xb6, 0x42, 0x94, 0x37, 0x43,
- 0x3f, 0x31, 0xfa, 0xfa, 0xa6, 0x65, 0x7c, 0x03, 0xbc, 0x27, 0x30, 0x1c, 0xe5, 0x9c, 0x6b, 0x96,
- 0x6d, 0x13, 0xf3, 0x14, 0x2d, 0x9e, 0xff, 0xb2, 0xfc, 0x0c, 0x88, 0xb6, 0x25, 0xe4, 0xa3, 0x75,
- 0x06, 0x53, 0xe2, 0x54, 0xf8, 0x7a, 0xc4, 0x0b, 0x17, 0xbd, 0x58, 0x9b, 0x8d, 0x7c, 0xd2, 0x3f,
- 0x1a, 0xd4, 0x48, 0xfa, 0xa7, 0x62, 0x80, 0x41, 0x5f, 0x16, 0x9b, 0xb3, 0x86, 0x5d, 0x5c, 0x95,
- 0xf1, 0xaa, 0xab, 0xf0, 0xff, 0xa1, 0xaf, 0x82, 0xf0, 0x35, 0x98, 0xa8, 0xf1, 0x2f, 0x22, 0x1d,
- 0xb2, 0x9d, 0xfb, 0xe5, 0xcf, 0x90, 0x57, 0xb9, 0x6f, 0xad, 0x7e, 0x01, 0xc4, 0xa5, 0x17, 0x2c,
- 0x97, 0xfe, 0x31, 0x96, 0x0a, 0x5f, 0x87, 0x17, 0xc5, 0xc1, 0x2e, 0x86, 0x2f, 0xbf, 0xff, 0x89,
- 0xcf, 0x0b, 0x03, 0xae, 0x5b, 0x5f, 0x03, 0x71, 0x2b, 0x76, 0x63, 0x12, 0xf1, 0xde, 0x82, 0xa8,
- 0xd5, 0xf6, 0x09, 0x2a, 0x22, 0xcb, 0xf9, 0x25, 0x39, 0xb2, 0x20, 0x07, 0x06, 0xb6, 0x29, 0xb3,
- 0xbf, 0x5d, 0x80, 0xc3, 0x9c, 0x0d, 0x7d, 0x05, 0xe0, 0x48, 0xb0, 0xa5, 0x44, 0x5d, 0xba, 0xaf,
- 0xa8, 0x3e, 0x38, 0x77, 0xb3, 0x2f, 0x5b, 0xdf, 0xbf, 0x3a, 0xfd, 0xe4, 0xf7, 0xbf, 0xbf, 0x1c,
- 0x9a, 0x40, 0xd7, 0xf4, 0x8e, 0x0e, 0x5e, 0x46, 0xaa, 0xef, 0x09, 0x11, 0xf6, 0xd1, 0x53, 0x00,
- 0x2f, 0xb6, 0x75, 0x8c, 0xe8, 0x56, 0x0f, 0x77, 0xe1, 0xde, 0x36, 0xa7, 0xf5, 0x6b, 0x2e, 0x00,
- 0xe7, 0x38, 0xa0, 0x86, 0xa6, 0xfb, 0x01, 0xd4, 0x37, 0x04, 0xd4, 0xf7, 0x01, 0x50, 0xd1, 0xa4,
- 0xf5, 0x04, 0x0d, 0x77, 0x93, 0x3d, 0x41, 0xdb, 0x7a, 0x3f, 0x75, 0x96, 0x83, 0x4e, 0xa3, 0xa9,
- 0x6e, 0xa0, 0x26, 0xd1, 0xf7, 0xc4, 0x29, 0xdf, 0xd7, 0x4f, 0x3a, 0xc2, 0x1f, 0x00, 0xcc, 0xb4,
- 0x37, 0x50, 0x28, 0xca, 0x71, 0x44, 0xb3, 0x97, 0xd3, 0xfb, 0xb6, 0xef, 0x87, 0xb4, 0x43, 0x52,
- 0xca, 0xa1, 0x7e, 0x02, 0x30, 0xd3, 0xde, 0xf0, 0x44, 0x92, 0x46, 0xb4, 0x5c, 0x91, 0xa4, 0x51,
- 0x9d, 0x94, 0xfa, 0x16, 0x27, 0xbd, 0x83, 0xe6, 0xfb, 0x22, 0x75, 0xf1, 0xae, 0xbe, 0x77, 0xd2,
- 0x29, 0xed, 0xa3, 0x5f, 0x01, 0x44, 0x9d, 0xdd, 0x0f, 0x7a, 0x35, 0x02, 0x23, 0xb2, 0x37, 0xcb,
- 0xcd, 0x9c, 0x61, 0x86, 0x40, 0x7f, 0x9b, 0xa3, 0xbf, 0x81, 0xee, 0xf4, 0x27, 0xb2, 0xb7, 0x50,
- 0x18, 0xbe, 0x0e, 0xe3, 0x3c, 0x6d, 0xd5, 0xc8, 0x3c, 0x3c, 0xc9, 0xd5, 0x97, 0x4f, 0xb5, 0x11,
- 0x44, 0x93, 0x9c, 0x48, 0x45, 0xe3, 0xbd, 0x12, 0x14, 0xb9, 0x70, 0x98, 0xd7, 0x28, 0x74, 0xda,
- 0xba, 0xb2, 0x6a, 0xe4, 0xae, 0x9d, 0x6e, 0x24, 0xbc, 0x2b, 0xdc, 0x7b, 0x16, 0x5d, 0xe9, 0xee,
- 0x1d, 0x7d, 0x02, 0xe0, 0xf9, 0x40, 0x79, 0x44, 0x37, 0x22, 0x56, 0xed, 0x2c, 0xd3, 0xb9, 0xa9,
- 0x7e, 0x4c, 0x05, 0xc6, 0x04, 0xc7, 0x18, 0x47, 0x4a, 0x77, 0x0c, 0xaa, 0xd7, 0xf8, 0x24, 0xb4,
- 0x0f, 0x13, 0x7e, 0x4d, 0x43, 0x51, 0xe1, 0x85, 0x4a, 0x67, 0xee, 0x95, 0x1e, 0x56, 0x7d, 0xbb,
- 0xf7, 0x9d, 0xfe, 0x02, 0x20, 0xea, 0xac, 0x50, 0x91, 0x99, 0x1b, 0x59, 0x60, 0x23, 0x33, 0x37,
- 0xba, 0xfc, 0xf5, 0x73, 0xe8, 0xa8, 0x2e, 0xca, 0xb3, 0xbe, 0xd7, 0x56, 0xbe, 0xf7, 0x0b, 0x4b,
- 0x07, 0x7f, 0x29, 0xb1, 0x1f, 0x9b, 0x4a, 0xec, 0xa0, 0xa9, 0x80, 0xc3, 0xa6, 0x02, 0xfe, 0x6c,
- 0x2a, 0xe0, 0xf3, 0x23, 0x25, 0x76, 0x78, 0xa4, 0xc4, 0xfe, 0x38, 0x52, 0x62, 0xef, 0x4f, 0x04,
- 0x7a, 0xf5, 0x45, 0x87, 0x56, 0x1f, 0x4a, 0x17, 0xa6, 0xfe, 0xd8, 0x77, 0xc5, 0xff, 0x3c, 0x2a,
- 0x25, 0xf8, 0x7f, 0x3e, 0xb7, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x78, 0x46, 0xe1, 0xa8, 0xa3,
- 0x12, 0x00, 0x00,
+ // 1327 bytes of a gzipped FileDescriptorProto
+ 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x98, 0xcf, 0x6f, 0x1b, 0x45,
+ 0x14, 0xc7, 0x3d, 0xa9, 0xe3, 0x1f, 0x93, 0x94, 0xba, 0x43, 0x69, 0x8d, 0x49, 0xd7, 0xd1, 0x52,
+ 0xd2, 0x34, 0x6d, 0x77, 0x9b, 0xb4, 0xa5, 0x02, 0x09, 0xa1, 0x38, 0x85, 0x26, 0x91, 0x22, 0x25,
+ 0xdb, 0x43, 0x25, 0x7a, 0xb0, 0xc6, 0xde, 0x89, 0xb3, 0x52, 0xbc, 0xeb, 0xec, 0x4c, 0x92, 0x5a,
+ 0x51, 0x00, 0x55, 0xe2, 0x04, 0x42, 0x20, 0xc4, 0xa1, 0x27, 0x38, 0xa0, 0xc2, 0x19, 0x2e, 0x88,
+ 0x2b, 0x97, 0x1c, 0x23, 0x71, 0xe1, 0x64, 0x81, 0xc3, 0x01, 0xe5, 0x4f, 0xe8, 0x09, 0xed, 0xec,
+ 0x8c, 0xbd, 0x6b, 0x7b, 0x63, 0xa7, 0xb2, 0xb8, 0x58, 0xbb, 0x3b, 0x6f, 0xe6, 0x7d, 0xde, 0x77,
+ 0xde, 0xcc, 0x7b, 0x32, 0x9c, 0x28, 0x3b, 0xb4, 0xba, 0x8b, 0x69, 0x55, 0xe7, 0x3f, 0x3b, 0xb3,
+ 0xfa, 0xd6, 0x36, 0x71, 0xeb, 0x5a, 0xcd, 0x75, 0x98, 0x83, 0x32, 0x72, 0x54, 0xe3, 0x3f, 0x3b,
+ 0xb3, 0xb9, 0x0b, 0x15, 0xa7, 0xe2, 0xf0, 0x41, 0xdd, 0x7b, 0xf2, 0xed, 0x72, 0xdd, 0xab, 0xb0,
+ 0x7a, 0x8d, 0x50, 0x39, 0x5a, 0x71, 0x9c, 0xca, 0x26, 0xd1, 0x71, 0xcd, 0xd2, 0xb1, 0x6d, 0x3b,
+ 0x0c, 0x33, 0xcb, 0xb1, 0xe5, 0xe8, 0x8c, 0x37, 0xd7, 0xa1, 0x7a, 0x09, 0x53, 0xe2, 0x3b, 0xd7,
+ 0x77, 0x66, 0x4b, 0x84, 0xe1, 0x59, 0xbd, 0x86, 0x2b, 0x96, 0xcd, 0x8d, 0x7d, 0x5b, 0xf5, 0x0e,
+ 0xcc, 0xae, 0x79, 0x16, 0x0b, 0x8e, 0xcd, 0x5c, 0x5c, 0x66, 0x4b, 0xf6, 0xba, 0x63, 0x90, 0xad,
+ 0x6d, 0x42, 0x19, 0xca, 0xc2, 0x24, 0x36, 0x4d, 0x97, 0x50, 0x9a, 0x05, 0x93, 0x60, 0x3a, 0x6d,
+ 0xc8, 0x57, 0xf5, 0x4b, 0x00, 0x5f, 0xef, 0x31, 0x8d, 0xd6, 0x1c, 0x9b, 0x92, 0xe8, 0x79, 0x68,
+ 0x0d, 0x9e, 0x2d, 0x8b, 0x19, 0x45, 0xcb, 0x5e, 0x77, 0xb2, 0x23, 0x93, 0x60, 0x7a, 0x6c, 0x4e,
+ 0xd1, 0x3a, 0x55, 0xd1, 0x82, 0x0b, 0x17, 0xc6, 0x0f, 0x1a, 0xf9, 0xd8, 0x61, 0x23, 0x0f, 0x8e,
+ 0x1b, 0xf9, 0x98, 0x31, 0x5e, 0x0e, 0x8c, 0xbd, 0x1b, 0xff, 0xf7, 0xfb, 0x3c, 0x50, 0x3f, 0x81,
+ 0x6f, 0x84, 0x78, 0x16, 0x2d, 0xca, 0x1c, 0xb7, 0xde, 0x37, 0x12, 0xf4, 0x21, 0x84, 0x6d, 0x4d,
+ 0x04, 0xce, 0x94, 0xe6, 0x0b, 0xa8, 0x79, 0x02, 0x6a, 0xfe, 0xee, 0x09, 0x01, 0xb5, 0x55, 0x5c,
+ 0x21, 0x62, 0x55, 0x23, 0x30, 0x53, 0xfd, 0x05, 0xc0, 0x89, 0xde, 0x04, 0x42, 0x94, 0x65, 0x98,
+ 0x24, 0x36, 0x73, 0x2d, 0xe2, 0x21, 0x9c, 0x99, 0x1e, 0x9b, 0x9b, 0x89, 0x0e, 0x7a, 0xc1, 0x31,
+ 0x89, 0x98, 0xff, 0x81, 0xcd, 0xdc, 0x7a, 0x21, 0xee, 0x09, 0x60, 0xc8, 0x05, 0xd0, 0x83, 0x1e,
+ 0xd0, 0x57, 0xfb, 0x42, 0xfb, 0x20, 0x21, 0xea, 0x8f, 0x3b, 0x64, 0xa3, 0x85, 0xba, 0xe7, 0x5b,
+ 0xca, 0x76, 0x09, 0x26, 0xcb, 0x8e, 0x49, 0x8a, 0x96, 0xc9, 0x65, 0x8b, 0x1b, 0x09, 0xef, 0x75,
+ 0xc9, 0x1c, 0x9a, 0x6a, 0x9f, 0x75, 0xaa, 0xd6, 0x02, 0x10, 0xaa, 0x4d, 0xc0, 0xb4, 0xdc, 0x6d,
+ 0x5f, 0xb7, 0xb4, 0xd1, 0xfe, 0x30, 0x3c, 0x1d, 0x3e, 0x95, 0x1c, 0xf3, 0x9b, 0x9b, 0x12, 0xe5,
+ 0x21, 0xc3, 0x8c, 0xfc, 0x7f, 0x09, 0xf4, 0x1d, 0x80, 0x97, 0x23, 0x10, 0x84, 0x16, 0x77, 0x61,
+ 0xa2, 0xea, 0x98, 0x64, 0x53, 0x26, 0xd0, 0xa5, 0xee, 0x04, 0x5a, 0xf1, 0xc6, 0x45, 0xb6, 0x08,
+ 0xe3, 0xe1, 0x89, 0xf4, 0x48, 0x68, 0x64, 0xe0, 0xdd, 0x53, 0x6a, 0x74, 0x19, 0x42, 0xee, 0xa3,
+ 0x68, 0x62, 0x86, 0x39, 0xc2, 0xb8, 0x91, 0xe6, 0x5f, 0xee, 0x63, 0x86, 0xd5, 0xdb, 0x22, 0xf2,
+ 0xee, 0x85, 0x45, 0xe4, 0x08, 0xc6, 0xf9, 0x4c, 0xc0, 0x67, 0xf2, 0x67, 0x75, 0x0b, 0x2a, 0x7c,
+ 0xd2, 0xc3, 0x2a, 0x76, 0xd9, 0x29, 0x79, 0xee, 0x76, 0xf3, 0x14, 0x2e, 0xbe, 0x68, 0xe4, 0x51,
+ 0x80, 0x60, 0x85, 0x50, 0xea, 0x29, 0x11, 0xe0, 0x5c, 0x81, 0xf9, 0x48, 0x97, 0x82, 0x74, 0x26,
+ 0x48, 0x1a, 0xb9, 0xa6, 0x1f, 0xc1, 0x75, 0x98, 0x11, 0xb9, 0xdf, 0xff, 0xc4, 0xa9, 0xcf, 0x46,
+ 0x60, 0xc6, 0x33, 0x0c, 0x5d, 0xb4, 0xd7, 0x3a, 0xac, 0x0b, 0x99, 0x66, 0x23, 0x9f, 0xe0, 0x66,
+ 0xf7, 0x8f, 0x1b, 0xf9, 0x11, 0xcb, 0x6c, 0x9d, 0xd8, 0x2c, 0x4c, 0x96, 0x5d, 0x82, 0x99, 0xe3,
+ 0xf2, 0x78, 0xd3, 0x86, 0x7c, 0x45, 0x6b, 0x30, 0xed, 0xe1, 0x14, 0x37, 0x30, 0xdd, 0xc8, 0x9e,
+ 0xe1, 0xdc, 0x77, 0x5e, 0x34, 0xf2, 0xb7, 0x2a, 0x16, 0xdb, 0xd8, 0x2e, 0x69, 0x65, 0xa7, 0xaa,
+ 0x97, 0x9d, 0x2a, 0x61, 0xa5, 0x75, 0xd6, 0x7e, 0xd8, 0xb4, 0x4a, 0x54, 0x2f, 0xd5, 0x19, 0xa1,
+ 0xda, 0x22, 0x79, 0x52, 0xf0, 0x1e, 0x8c, 0x94, 0xb7, 0xcc, 0x22, 0xa6, 0x1b, 0xe8, 0x31, 0xbc,
+ 0x68, 0xd9, 0x94, 0x61, 0x9b, 0x59, 0x98, 0x91, 0x62, 0x8d, 0xb8, 0x55, 0x8b, 0x52, 0x2f, 0xfd,
+ 0x12, 0x51, 0xf7, 0xfd, 0x7c, 0xb9, 0x4c, 0x28, 0x5d, 0x70, 0xec, 0x75, 0xab, 0x22, 0x12, 0xf8,
+ 0xb5, 0xc0, 0x1a, 0xab, 0xad, 0x25, 0xfc, 0x0b, 0x7f, 0x39, 0x9e, 0x8a, 0x67, 0x46, 0x97, 0xe3,
+ 0xa9, 0xd1, 0x4c, 0x42, 0x7d, 0x0a, 0xe0, 0xf9, 0x80, 0x92, 0x42, 0x9c, 0x25, 0xef, 0xea, 0xf0,
+ 0xc4, 0xf1, 0xea, 0x0c, 0xe0, 0x7e, 0xd5, 0x5e, 0x57, 0x6e, 0x58, 0xd3, 0x42, 0xaa, 0x55, 0x67,
+ 0x52, 0x65, 0x31, 0x86, 0x26, 0xc4, 0xae, 0xfa, 0x99, 0x92, 0x3a, 0x6e, 0xe4, 0xf9, 0xbb, 0xbf,
+ 0x8f, 0xa2, 0x02, 0x3d, 0x0e, 0x30, 0x50, 0xb9, 0x9d, 0xe1, 0xcb, 0x01, 0xbc, 0xf4, 0xe5, 0xf0,
+ 0x1c, 0x40, 0x14, 0x5c, 0x5d, 0x84, 0xf8, 0x00, 0xc2, 0x56, 0x88, 0xf2, 0x56, 0x18, 0x24, 0x46,
+ 0x5f, 0xdf, 0xb4, 0x8c, 0x6f, 0x88, 0x77, 0x04, 0x86, 0x97, 0x38, 0xe7, 0xaa, 0x65, 0xdb, 0xc4,
+ 0x3c, 0x41, 0x8b, 0x97, 0xbf, 0x28, 0x3f, 0x07, 0xa2, 0x65, 0x09, 0xf9, 0x10, 0x8a, 0x4c, 0xc1,
+ 0x94, 0x38, 0x11, 0xbe, 0x1e, 0xf1, 0xc2, 0x58, 0xb3, 0x91, 0x4f, 0xfa, 0x47, 0x82, 0x1a, 0x49,
+ 0xff, 0x34, 0x0c, 0x31, 0xe0, 0x0b, 0x62, 0x63, 0x56, 0xb1, 0x8b, 0xab, 0x32, 0x56, 0x75, 0x05,
+ 0xbe, 0x1a, 0xfa, 0x2a, 0xe8, 0xde, 0x86, 0x89, 0x1a, 0xff, 0x22, 0x52, 0x21, 0xdb, 0xbd, 0x57,
+ 0xfe, 0x0c, 0x79, 0x85, 0xfb, 0xd6, 0xea, 0xd7, 0x40, 0x5c, 0x76, 0xc1, 0x32, 0xe9, 0x1f, 0x5f,
+ 0xa9, 0xee, 0x55, 0x78, 0x4e, 0x1c, 0xe8, 0x62, 0xf8, 0xd2, 0x7b, 0x45, 0x7c, 0x9e, 0x1f, 0x72,
+ 0xbd, 0x7a, 0x06, 0xc4, 0x6d, 0xd8, 0x8b, 0x49, 0xc4, 0x7b, 0x13, 0xa2, 0x56, 0xbb, 0x27, 0xa8,
+ 0x88, 0x2c, 0xe3, 0xe7, 0xe5, 0xc8, 0xbc, 0x1c, 0x18, 0xda, 0xa6, 0xcc, 0xfd, 0x7e, 0x16, 0x8e,
+ 0x72, 0x36, 0xf4, 0x2d, 0x80, 0xe3, 0xc1, 0x56, 0x12, 0xf5, 0xe8, 0xba, 0xa2, 0xfa, 0xdf, 0xdc,
+ 0xf5, 0x81, 0x6c, 0x7d, 0xff, 0xea, 0x8d, 0xa7, 0x7f, 0xfc, 0xf3, 0xcd, 0xc8, 0x14, 0xba, 0xa2,
+ 0x77, 0x75, 0xee, 0x32, 0x52, 0x7d, 0x4f, 0x88, 0xb0, 0x8f, 0x9e, 0x03, 0x78, 0xae, 0xa3, 0x53,
+ 0x44, 0x37, 0xfb, 0xb8, 0x0b, 0xf7, 0xb4, 0x39, 0x6d, 0x50, 0x73, 0x01, 0x78, 0x87, 0x03, 0x6a,
+ 0xe8, 0xc6, 0x20, 0x80, 0xfa, 0x86, 0x80, 0xfa, 0x21, 0x00, 0x2a, 0x9a, 0xb3, 0xbe, 0xa0, 0xe1,
+ 0x2e, 0xb2, 0x2f, 0x68, 0x47, 0xcf, 0xa7, 0xce, 0x71, 0xd0, 0x1b, 0x68, 0xa6, 0x17, 0xa8, 0x49,
+ 0xf4, 0x3d, 0x71, 0xc2, 0xf7, 0xf5, 0x76, 0x27, 0xf8, 0x23, 0x80, 0x99, 0xce, 0xc6, 0x09, 0x45,
+ 0x39, 0x8e, 0x68, 0xf2, 0x72, 0xfa, 0xc0, 0xf6, 0x83, 0x90, 0x76, 0x49, 0x4a, 0x39, 0xd4, 0xcf,
+ 0x00, 0x66, 0x3a, 0x1b, 0x9d, 0x48, 0xd2, 0x88, 0x56, 0x2b, 0x92, 0x34, 0xaa, 0x83, 0x52, 0xdf,
+ 0xe3, 0xa4, 0xf7, 0xd0, 0xdd, 0x81, 0x48, 0x5d, 0xbc, 0xab, 0xef, 0xb5, 0x3b, 0xa4, 0x7d, 0xf4,
+ 0x1b, 0x80, 0xa8, 0xbb, 0xeb, 0x41, 0xb7, 0x22, 0x30, 0x22, 0x7b, 0xb2, 0xdc, 0xec, 0x29, 0x66,
+ 0x08, 0xf4, 0xf7, 0x39, 0xfa, 0x3b, 0xe8, 0xde, 0x60, 0x22, 0x7b, 0x0b, 0x85, 0xe1, 0xeb, 0x30,
+ 0xce, 0xd3, 0x56, 0x8d, 0xcc, 0xc3, 0x76, 0xae, 0xbe, 0x79, 0xa2, 0x8d, 0x20, 0x9a, 0xe6, 0x44,
+ 0x2a, 0x9a, 0xec, 0x97, 0xa0, 0xc8, 0x85, 0xa3, 0xbc, 0x3e, 0xa1, 0x93, 0xd6, 0x95, 0x55, 0x23,
+ 0x77, 0xe5, 0x64, 0x23, 0xe1, 0x5d, 0xe1, 0xde, 0xb3, 0xe8, 0x62, 0x6f, 0xef, 0xe8, 0x0b, 0x00,
+ 0xc7, 0x02, 0xa5, 0x11, 0x5d, 0x8b, 0x58, 0xb5, 0xbb, 0x44, 0xe7, 0x66, 0x06, 0x31, 0x15, 0x18,
+ 0x53, 0x1c, 0x63, 0x12, 0x29, 0xbd, 0x31, 0xa8, 0x5e, 0xe3, 0x93, 0xd0, 0x3e, 0x4c, 0xf8, 0x35,
+ 0x0d, 0x45, 0x85, 0x17, 0x2a, 0x9d, 0xb9, 0xb7, 0xfa, 0x58, 0x0d, 0xec, 0xde, 0x77, 0xfa, 0x2b,
+ 0x80, 0xa8, 0xbb, 0x42, 0x45, 0x66, 0x6e, 0x64, 0x81, 0x8d, 0xcc, 0xdc, 0xe8, 0xf2, 0x37, 0xc8,
+ 0xa1, 0xa3, 0xba, 0x28, 0xcf, 0xfa, 0x5e, 0x47, 0xf9, 0xde, 0x2f, 0x2c, 0x1e, 0xfc, 0xad, 0xc4,
+ 0x7e, 0x6a, 0x2a, 0xb1, 0x83, 0xa6, 0x02, 0x0e, 0x9b, 0x0a, 0xf8, 0xab, 0xa9, 0x80, 0xaf, 0x8e,
+ 0x94, 0xd8, 0xe1, 0x91, 0x12, 0xfb, 0xf3, 0x48, 0x89, 0x7d, 0x34, 0x15, 0xe8, 0xd1, 0x17, 0x1c,
+ 0x5a, 0x7d, 0x24, 0x5d, 0x98, 0xfa, 0x13, 0xdf, 0x15, 0xff, 0xd3, 0xa8, 0x94, 0xe0, 0xff, 0xf5,
+ 0xdc, 0xfe, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xd3, 0x6d, 0x1b, 0x9d, 0x9b, 0x12, 0x00, 0x00,
}
func (this *QueryContractInfoResponse) Equal(that interface{}) bool {
@@ -1223,7 +1105,6 @@ func (this *QueryContractInfoResponse) Equal(that interface{}) bool {
}
return true
}
-
func (this *CodeInfoResponse) Equal(that interface{}) bool {
if that == nil {
return this == nil
@@ -1257,7 +1138,6 @@ func (this *CodeInfoResponse) Equal(that interface{}) bool {
}
return true
}
-
func (this *QueryCodeResponse) Equal(that interface{}) bool {
if that == nil {
return this == nil
@@ -1287,10 +1167,8 @@ func (this *QueryCodeResponse) Equal(that interface{}) bool {
}
// Reference imports to suppress errors if they are not otherwise used.
-var (
- _ context.Context
- _ grpc.ClientConn
-)
+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.
@@ -1458,48 +1336,39 @@ type QueryServer interface {
}
// UnimplementedQueryServer can be embedded to have forward compatible implementations.
-type UnimplementedQueryServer struct{}
+type UnimplementedQueryServer struct {
+}
func (*UnimplementedQueryServer) ContractInfo(ctx context.Context, req *QueryContractInfoRequest) (*QueryContractInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ContractInfo not implemented")
}
-
func (*UnimplementedQueryServer) ContractHistory(ctx context.Context, req *QueryContractHistoryRequest) (*QueryContractHistoryResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ContractHistory not implemented")
}
-
func (*UnimplementedQueryServer) ContractsByCode(ctx context.Context, req *QueryContractsByCodeRequest) (*QueryContractsByCodeResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ContractsByCode not implemented")
}
-
func (*UnimplementedQueryServer) AllContractState(ctx context.Context, req *QueryAllContractStateRequest) (*QueryAllContractStateResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AllContractState not implemented")
}
-
func (*UnimplementedQueryServer) RawContractState(ctx context.Context, req *QueryRawContractStateRequest) (*QueryRawContractStateResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RawContractState not implemented")
}
-
func (*UnimplementedQueryServer) SmartContractState(ctx context.Context, req *QuerySmartContractStateRequest) (*QuerySmartContractStateResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SmartContractState not implemented")
}
-
func (*UnimplementedQueryServer) Code(ctx context.Context, req *QueryCodeRequest) (*QueryCodeResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Code not implemented")
}
-
func (*UnimplementedQueryServer) Codes(ctx context.Context, req *QueryCodesRequest) (*QueryCodesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Codes not implemented")
}
-
func (*UnimplementedQueryServer) PinnedCodes(ctx context.Context, req *QueryPinnedCodesRequest) (*QueryPinnedCodesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method PinnedCodes not implemented")
}
-
func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
}
-
func (*UnimplementedQueryServer) ContractsByCreator(ctx context.Context, req *QueryContractsByCreatorRequest) (*QueryContractsByCreatorResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ContractsByCreator not implemented")
}
@@ -2676,7 +2545,6 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
return base
}
-
func (m *QueryContractInfoRequest) Size() (n int) {
if m == nil {
return 0
@@ -3047,11 +2915,9 @@ func (m *QueryContractsByCreatorResponse) Size() (n int) {
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 *QueryContractInfoRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -3134,7 +3000,6 @@ func (m *QueryContractInfoRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *QueryContractInfoResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -3250,7 +3115,6 @@ func (m *QueryContractInfoResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *QueryContractHistoryRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -3369,7 +3233,6 @@ func (m *QueryContractHistoryRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *QueryContractHistoryResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -3490,7 +3353,6 @@ func (m *QueryContractHistoryResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *QueryContractsByCodeRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -3596,7 +3458,6 @@ func (m *QueryContractsByCodeRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *QueryContractsByCodeResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -3715,7 +3576,6 @@ func (m *QueryContractsByCodeResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *QueryAllContractStateRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -3834,7 +3694,6 @@ func (m *QueryAllContractStateRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *QueryAllContractStateResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -3955,7 +3814,6 @@ func (m *QueryAllContractStateResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *QueryRawContractStateRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -4072,7 +3930,6 @@ func (m *QueryRawContractStateRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *QueryRawContractStateResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -4157,7 +4014,6 @@ func (m *QueryRawContractStateResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *QuerySmartContractStateRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -4274,7 +4130,6 @@ func (m *QuerySmartContractStateRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *QuerySmartContractStateResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -4359,7 +4214,6 @@ func (m *QuerySmartContractStateResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *QueryCodeRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -4429,7 +4283,6 @@ func (m *QueryCodeRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *CodeInfoResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -4598,7 +4451,6 @@ func (m *CodeInfoResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *QueryCodeResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -4719,7 +4571,6 @@ func (m *QueryCodeResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *QueryCodesRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -4806,7 +4657,6 @@ func (m *QueryCodesRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *QueryCodesResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -4927,7 +4777,6 @@ func (m *QueryCodesResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *QueryPinnedCodesRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -5014,7 +4863,6 @@ func (m *QueryPinnedCodesRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *QueryPinnedCodesResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -5177,7 +5025,6 @@ func (m *QueryPinnedCodesResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -5228,7 +5075,6 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -5312,7 +5158,6 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *QueryContractsByCreatorRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -5431,7 +5276,6 @@ func (m *QueryContractsByCreatorRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *QueryContractsByCreatorResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -5550,7 +5394,6 @@ func (m *QueryContractsByCreatorResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func skipQuery(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
diff --git a/x/wasm/types/query.pb.gw.go b/x/wasm/types/query.pb.gw.go
index 32f3fd25cd..696252ab02 100644
--- a/x/wasm/types/query.pb.gw.go
+++ b/x/wasm/types/query.pb.gw.go
@@ -25,15 +25,13 @@ import (
)
// Suppress "imported and not used" errors
-var (
- _ codes.Code
- _ io.Reader
- _ status.Status
- _ = runtime.String
- _ = utilities.NewDoubleArray
- _ = descriptor.ForMessage
- _ = metadata.Join
-)
+var _ codes.Code
+var _ io.Reader
+var _ status.Status
+var _ = runtime.String
+var _ = utilities.NewDoubleArray
+var _ = descriptor.ForMessage
+var _ = metadata.Join
func request_Query_ContractInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryContractInfoRequest
@@ -59,6 +57,7 @@ func request_Query_ContractInfo_0(ctx context.Context, marshaler runtime.Marshal
msg, err := client.ContractInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
+
}
func local_request_Query_ContractInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
@@ -85,9 +84,12 @@ func local_request_Query_ContractInfo_0(ctx context.Context, marshaler runtime.M
msg, err := server.ContractInfo(ctx, &protoReq)
return msg, metadata, err
+
}
-var filter_Query_ContractHistory_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
+var (
+ filter_Query_ContractHistory_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
+)
func request_Query_ContractHistory_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryContractHistoryRequest
@@ -120,6 +122,7 @@ func request_Query_ContractHistory_0(ctx context.Context, marshaler runtime.Mars
msg, err := client.ContractHistory(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
+
}
func local_request_Query_ContractHistory_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
@@ -153,9 +156,12 @@ func local_request_Query_ContractHistory_0(ctx context.Context, marshaler runtim
msg, err := server.ContractHistory(ctx, &protoReq)
return msg, metadata, err
+
}
-var filter_Query_ContractsByCode_0 = &utilities.DoubleArray{Encoding: map[string]int{"code_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
+var (
+ filter_Query_ContractsByCode_0 = &utilities.DoubleArray{Encoding: map[string]int{"code_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
+)
func request_Query_ContractsByCode_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryContractsByCodeRequest
@@ -188,6 +194,7 @@ func request_Query_ContractsByCode_0(ctx context.Context, marshaler runtime.Mars
msg, err := client.ContractsByCode(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
+
}
func local_request_Query_ContractsByCode_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
@@ -221,9 +228,12 @@ func local_request_Query_ContractsByCode_0(ctx context.Context, marshaler runtim
msg, err := server.ContractsByCode(ctx, &protoReq)
return msg, metadata, err
+
}
-var filter_Query_AllContractState_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
+var (
+ filter_Query_AllContractState_0 = &utilities.DoubleArray{Encoding: map[string]int{"address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
+)
func request_Query_AllContractState_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryAllContractStateRequest
@@ -256,6 +266,7 @@ func request_Query_AllContractState_0(ctx context.Context, marshaler runtime.Mar
msg, err := client.AllContractState(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
+
}
func local_request_Query_AllContractState_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
@@ -289,6 +300,7 @@ func local_request_Query_AllContractState_0(ctx context.Context, marshaler runti
msg, err := server.AllContractState(ctx, &protoReq)
return msg, metadata, err
+
}
func request_Query_RawContractState_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
@@ -326,6 +338,7 @@ func request_Query_RawContractState_0(ctx context.Context, marshaler runtime.Mar
msg, err := client.RawContractState(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
+
}
func local_request_Query_RawContractState_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
@@ -363,6 +376,7 @@ func local_request_Query_RawContractState_0(ctx context.Context, marshaler runti
msg, err := server.RawContractState(ctx, &protoReq)
return msg, metadata, err
+
}
func request_Query_SmartContractState_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
@@ -400,6 +414,7 @@ func request_Query_SmartContractState_0(ctx context.Context, marshaler runtime.M
msg, err := client.SmartContractState(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
+
}
func local_request_Query_SmartContractState_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
@@ -437,6 +452,7 @@ func local_request_Query_SmartContractState_0(ctx context.Context, marshaler run
msg, err := server.SmartContractState(ctx, &protoReq)
return msg, metadata, err
+
}
func request_Query_Code_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
@@ -463,6 +479,7 @@ func request_Query_Code_0(ctx context.Context, marshaler runtime.Marshaler, clie
msg, err := client.Code(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
+
}
func local_request_Query_Code_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
@@ -489,9 +506,12 @@ func local_request_Query_Code_0(ctx context.Context, marshaler runtime.Marshaler
msg, err := server.Code(ctx, &protoReq)
return msg, metadata, err
+
}
-var filter_Query_Codes_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
+var (
+ filter_Query_Codes_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
+)
func request_Query_Codes_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryCodesRequest
@@ -506,6 +526,7 @@ func request_Query_Codes_0(ctx context.Context, marshaler runtime.Marshaler, cli
msg, err := client.Codes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
+
}
func local_request_Query_Codes_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
@@ -521,9 +542,12 @@ func local_request_Query_Codes_0(ctx context.Context, marshaler runtime.Marshale
msg, err := server.Codes(ctx, &protoReq)
return msg, metadata, err
+
}
-var filter_Query_PinnedCodes_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
+var (
+ filter_Query_PinnedCodes_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
+)
func request_Query_PinnedCodes_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryPinnedCodesRequest
@@ -538,6 +562,7 @@ func request_Query_PinnedCodes_0(ctx context.Context, marshaler runtime.Marshale
msg, err := client.PinnedCodes(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
+
}
func local_request_Query_PinnedCodes_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
@@ -553,6 +578,7 @@ func local_request_Query_PinnedCodes_0(ctx context.Context, marshaler runtime.Ma
msg, err := server.PinnedCodes(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) {
@@ -561,6 +587,7 @@ func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, cl
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) {
@@ -569,9 +596,12 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal
msg, err := server.Params(ctx, &protoReq)
return msg, metadata, err
+
}
-var filter_Query_ContractsByCreator_0 = &utilities.DoubleArray{Encoding: map[string]int{"creator_address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
+var (
+ filter_Query_ContractsByCreator_0 = &utilities.DoubleArray{Encoding: map[string]int{"creator_address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
+)
func request_Query_ContractsByCreator_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryContractsByCreatorRequest
@@ -604,6 +634,7 @@ func request_Query_ContractsByCreator_0(ctx context.Context, marshaler runtime.M
msg, err := client.ContractsByCreator(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
+
}
func local_request_Query_ContractsByCreator_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
@@ -637,6 +668,7 @@ func local_request_Query_ContractsByCreator_0(ctx context.Context, marshaler run
msg, err := server.ContractsByCreator(ctx, &protoReq)
return msg, metadata, err
+
}
// RegisterQueryHandlerServer registers the http handlers for service Query to "mux".
@@ -644,6 +676,7 @@ func local_request_Query_ContractsByCreator_0(ctx context.Context, marshaler run
// 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_ContractInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -664,6 +697,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
}
forward_Query_ContractInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
})
mux.Handle("GET", pattern_Query_ContractHistory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
@@ -686,6 +720,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
}
forward_Query_ContractHistory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
})
mux.Handle("GET", pattern_Query_ContractsByCode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
@@ -708,6 +743,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
}
forward_Query_ContractsByCode_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
})
mux.Handle("GET", pattern_Query_AllContractState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
@@ -730,6 +766,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
}
forward_Query_AllContractState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
})
mux.Handle("GET", pattern_Query_RawContractState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
@@ -752,6 +789,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
}
forward_Query_RawContractState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
})
mux.Handle("GET", pattern_Query_SmartContractState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
@@ -774,6 +812,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
}
forward_Query_SmartContractState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
})
mux.Handle("GET", pattern_Query_Code_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
@@ -796,6 +835,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
}
forward_Query_Code_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
})
mux.Handle("GET", pattern_Query_Codes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
@@ -818,6 +858,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
}
forward_Query_Codes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
})
mux.Handle("GET", pattern_Query_PinnedCodes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
@@ -840,6 +881,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
}
forward_Query_PinnedCodes_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) {
@@ -862,6 +904,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
}
forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
})
mux.Handle("GET", pattern_Query_ContractsByCreator_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
@@ -884,6 +927,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
}
forward_Query_ContractsByCreator_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
})
return nil
@@ -926,6 +970,7 @@ func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc
// 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_ContractInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -943,6 +988,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
}
forward_Query_ContractInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
})
mux.Handle("GET", pattern_Query_ContractHistory_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
@@ -962,6 +1008,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
}
forward_Query_ContractHistory_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
})
mux.Handle("GET", pattern_Query_ContractsByCode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
@@ -981,6 +1028,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
}
forward_Query_ContractsByCode_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
})
mux.Handle("GET", pattern_Query_AllContractState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
@@ -1000,6 +1048,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
}
forward_Query_AllContractState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
})
mux.Handle("GET", pattern_Query_RawContractState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
@@ -1019,6 +1068,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
}
forward_Query_RawContractState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
})
mux.Handle("GET", pattern_Query_SmartContractState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
@@ -1038,6 +1088,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
}
forward_Query_SmartContractState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
})
mux.Handle("GET", pattern_Query_Code_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
@@ -1057,6 +1108,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
}
forward_Query_Code_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
})
mux.Handle("GET", pattern_Query_Codes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
@@ -1076,6 +1128,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
}
forward_Query_Codes_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
})
mux.Handle("GET", pattern_Query_PinnedCodes_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
@@ -1095,6 +1148,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
}
forward_Query_PinnedCodes_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) {
@@ -1114,6 +1168,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
}
forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
})
mux.Handle("GET", pattern_Query_ContractsByCreator_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
@@ -1133,6 +1188,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
}
forward_Query_ContractsByCreator_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
})
return nil
diff --git a/x/wasm/types/test_fixtures.go b/x/wasm/types/test_fixtures.go
index e84b61fd7d..fb93367f79 100644
--- a/x/wasm/types/test_fixtures.go
+++ b/x/wasm/types/test_fixtures.go
@@ -45,7 +45,7 @@ func GenesisFixture(mutators ...func(*GenesisState)) GenesisState {
func randBytes(n int) []byte {
r := make([]byte, n)
- rand.Read(r)
+ rand.Read(r) //nolint:staticcheck
return r
}
diff --git a/x/wasm/types/tx.pb.go b/x/wasm/types/tx.pb.go
index ed9d4add68..68072c57a3 100644
--- a/x/wasm/types/tx.pb.go
+++ b/x/wasm/types/tx.pb.go
@@ -6,26 +6,24 @@ package types
import (
context "context"
fmt "fmt"
- io "io"
- math "math"
- math_bits "math/bits"
-
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
types "github.com/cosmos/cosmos-sdk/types"
+ _ "github.com/cosmos/cosmos-sdk/types/msgservice"
_ "github.com/cosmos/gogoproto/gogoproto"
- grpc1 "github.com/gogo/protobuf/grpc"
- proto "github.com/gogo/protobuf/proto"
+ grpc1 "github.com/cosmos/gogoproto/grpc"
+ proto "github.com/cosmos/gogoproto/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
+ io "io"
+ math "math"
+ math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
-var (
- _ = proto.Marshal
- _ = fmt.Errorf
- _ = math.Inf
-)
+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.
@@ -35,7 +33,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// MsgStoreCode submit Wasm code to the system
type MsgStoreCode struct {
- // Sender is the that actor that signed the messages
+ // Sender is the actor that signed the messages
Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
// WASMByteCode can be raw or gzip compressed
WASMByteCode []byte `protobuf:"bytes,2,opt,name=wasm_byte_code,json=wasmByteCode,proto3" json:"wasm_byte_code,omitempty"`
@@ -50,11 +48,9 @@ func (*MsgStoreCode) ProtoMessage() {}
func (*MsgStoreCode) Descriptor() ([]byte, []int) {
return fileDescriptor_4f74d82755520264, []int{0}
}
-
func (m *MsgStoreCode) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *MsgStoreCode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MsgStoreCode.Marshal(b, m, deterministic)
@@ -67,15 +63,12 @@ func (m *MsgStoreCode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
return b[:n], nil
}
}
-
func (m *MsgStoreCode) XXX_Merge(src proto.Message) {
xxx_messageInfo_MsgStoreCode.Merge(m, src)
}
-
func (m *MsgStoreCode) XXX_Size() int {
return m.Size()
}
-
func (m *MsgStoreCode) XXX_DiscardUnknown() {
xxx_messageInfo_MsgStoreCode.DiscardUnknown(m)
}
@@ -96,11 +89,9 @@ func (*MsgStoreCodeResponse) ProtoMessage() {}
func (*MsgStoreCodeResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_4f74d82755520264, []int{1}
}
-
func (m *MsgStoreCodeResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *MsgStoreCodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MsgStoreCodeResponse.Marshal(b, m, deterministic)
@@ -113,15 +104,12 @@ func (m *MsgStoreCodeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte
return b[:n], nil
}
}
-
func (m *MsgStoreCodeResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_MsgStoreCodeResponse.Merge(m, src)
}
-
func (m *MsgStoreCodeResponse) XXX_Size() int {
return m.Size()
}
-
func (m *MsgStoreCodeResponse) XXX_DiscardUnknown() {
xxx_messageInfo_MsgStoreCodeResponse.DiscardUnknown(m)
}
@@ -151,11 +139,9 @@ func (*MsgInstantiateContract) ProtoMessage() {}
func (*MsgInstantiateContract) Descriptor() ([]byte, []int) {
return fileDescriptor_4f74d82755520264, []int{2}
}
-
func (m *MsgInstantiateContract) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *MsgInstantiateContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MsgInstantiateContract.Marshal(b, m, deterministic)
@@ -168,15 +154,12 @@ func (m *MsgInstantiateContract) XXX_Marshal(b []byte, deterministic bool) ([]by
return b[:n], nil
}
}
-
func (m *MsgInstantiateContract) XXX_Merge(src proto.Message) {
xxx_messageInfo_MsgInstantiateContract.Merge(m, src)
}
-
func (m *MsgInstantiateContract) XXX_Size() int {
return m.Size()
}
-
func (m *MsgInstantiateContract) XXX_DiscardUnknown() {
xxx_messageInfo_MsgInstantiateContract.DiscardUnknown(m)
}
@@ -211,11 +194,9 @@ func (*MsgInstantiateContract2) ProtoMessage() {}
func (*MsgInstantiateContract2) Descriptor() ([]byte, []int) {
return fileDescriptor_4f74d82755520264, []int{3}
}
-
func (m *MsgInstantiateContract2) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *MsgInstantiateContract2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MsgInstantiateContract2.Marshal(b, m, deterministic)
@@ -228,15 +209,12 @@ func (m *MsgInstantiateContract2) XXX_Marshal(b []byte, deterministic bool) ([]b
return b[:n], nil
}
}
-
func (m *MsgInstantiateContract2) XXX_Merge(src proto.Message) {
xxx_messageInfo_MsgInstantiateContract2.Merge(m, src)
}
-
func (m *MsgInstantiateContract2) XXX_Size() int {
return m.Size()
}
-
func (m *MsgInstantiateContract2) XXX_DiscardUnknown() {
xxx_messageInfo_MsgInstantiateContract2.DiscardUnknown(m)
}
@@ -257,11 +235,9 @@ func (*MsgInstantiateContractResponse) ProtoMessage() {}
func (*MsgInstantiateContractResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_4f74d82755520264, []int{4}
}
-
func (m *MsgInstantiateContractResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *MsgInstantiateContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MsgInstantiateContractResponse.Marshal(b, m, deterministic)
@@ -274,15 +250,12 @@ func (m *MsgInstantiateContractResponse) XXX_Marshal(b []byte, deterministic boo
return b[:n], nil
}
}
-
func (m *MsgInstantiateContractResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_MsgInstantiateContractResponse.Merge(m, src)
}
-
func (m *MsgInstantiateContractResponse) XXX_Size() int {
return m.Size()
}
-
func (m *MsgInstantiateContractResponse) XXX_DiscardUnknown() {
xxx_messageInfo_MsgInstantiateContractResponse.DiscardUnknown(m)
}
@@ -303,11 +276,9 @@ func (*MsgInstantiateContract2Response) ProtoMessage() {}
func (*MsgInstantiateContract2Response) Descriptor() ([]byte, []int) {
return fileDescriptor_4f74d82755520264, []int{5}
}
-
func (m *MsgInstantiateContract2Response) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *MsgInstantiateContract2Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MsgInstantiateContract2Response.Marshal(b, m, deterministic)
@@ -320,15 +291,12 @@ func (m *MsgInstantiateContract2Response) XXX_Marshal(b []byte, deterministic bo
return b[:n], nil
}
}
-
func (m *MsgInstantiateContract2Response) XXX_Merge(src proto.Message) {
xxx_messageInfo_MsgInstantiateContract2Response.Merge(m, src)
}
-
func (m *MsgInstantiateContract2Response) XXX_Size() int {
return m.Size()
}
-
func (m *MsgInstantiateContract2Response) XXX_DiscardUnknown() {
xxx_messageInfo_MsgInstantiateContract2Response.DiscardUnknown(m)
}
@@ -353,11 +321,9 @@ func (*MsgExecuteContract) ProtoMessage() {}
func (*MsgExecuteContract) Descriptor() ([]byte, []int) {
return fileDescriptor_4f74d82755520264, []int{6}
}
-
func (m *MsgExecuteContract) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *MsgExecuteContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MsgExecuteContract.Marshal(b, m, deterministic)
@@ -370,15 +336,12 @@ func (m *MsgExecuteContract) XXX_Marshal(b []byte, deterministic bool) ([]byte,
return b[:n], nil
}
}
-
func (m *MsgExecuteContract) XXX_Merge(src proto.Message) {
xxx_messageInfo_MsgExecuteContract.Merge(m, src)
}
-
func (m *MsgExecuteContract) XXX_Size() int {
return m.Size()
}
-
func (m *MsgExecuteContract) XXX_DiscardUnknown() {
xxx_messageInfo_MsgExecuteContract.DiscardUnknown(m)
}
@@ -397,11 +360,9 @@ func (*MsgExecuteContractResponse) ProtoMessage() {}
func (*MsgExecuteContractResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_4f74d82755520264, []int{7}
}
-
func (m *MsgExecuteContractResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *MsgExecuteContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MsgExecuteContractResponse.Marshal(b, m, deterministic)
@@ -414,15 +375,12 @@ func (m *MsgExecuteContractResponse) XXX_Marshal(b []byte, deterministic bool) (
return b[:n], nil
}
}
-
func (m *MsgExecuteContractResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_MsgExecuteContractResponse.Merge(m, src)
}
-
func (m *MsgExecuteContractResponse) XXX_Size() int {
return m.Size()
}
-
func (m *MsgExecuteContractResponse) XXX_DiscardUnknown() {
xxx_messageInfo_MsgExecuteContractResponse.DiscardUnknown(m)
}
@@ -447,11 +405,9 @@ func (*MsgMigrateContract) ProtoMessage() {}
func (*MsgMigrateContract) Descriptor() ([]byte, []int) {
return fileDescriptor_4f74d82755520264, []int{8}
}
-
func (m *MsgMigrateContract) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *MsgMigrateContract) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MsgMigrateContract.Marshal(b, m, deterministic)
@@ -464,15 +420,12 @@ func (m *MsgMigrateContract) XXX_Marshal(b []byte, deterministic bool) ([]byte,
return b[:n], nil
}
}
-
func (m *MsgMigrateContract) XXX_Merge(src proto.Message) {
xxx_messageInfo_MsgMigrateContract.Merge(m, src)
}
-
func (m *MsgMigrateContract) XXX_Size() int {
return m.Size()
}
-
func (m *MsgMigrateContract) XXX_DiscardUnknown() {
xxx_messageInfo_MsgMigrateContract.DiscardUnknown(m)
}
@@ -492,11 +445,9 @@ func (*MsgMigrateContractResponse) ProtoMessage() {}
func (*MsgMigrateContractResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_4f74d82755520264, []int{9}
}
-
func (m *MsgMigrateContractResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *MsgMigrateContractResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MsgMigrateContractResponse.Marshal(b, m, deterministic)
@@ -509,15 +460,12 @@ func (m *MsgMigrateContractResponse) XXX_Marshal(b []byte, deterministic bool) (
return b[:n], nil
}
}
-
func (m *MsgMigrateContractResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_MsgMigrateContractResponse.Merge(m, src)
}
-
func (m *MsgMigrateContractResponse) XXX_Size() int {
return m.Size()
}
-
func (m *MsgMigrateContractResponse) XXX_DiscardUnknown() {
xxx_messageInfo_MsgMigrateContractResponse.DiscardUnknown(m)
}
@@ -540,11 +488,9 @@ func (*MsgUpdateAdmin) ProtoMessage() {}
func (*MsgUpdateAdmin) Descriptor() ([]byte, []int) {
return fileDescriptor_4f74d82755520264, []int{10}
}
-
func (m *MsgUpdateAdmin) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *MsgUpdateAdmin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MsgUpdateAdmin.Marshal(b, m, deterministic)
@@ -557,15 +503,12 @@ func (m *MsgUpdateAdmin) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro
return b[:n], nil
}
}
-
func (m *MsgUpdateAdmin) XXX_Merge(src proto.Message) {
xxx_messageInfo_MsgUpdateAdmin.Merge(m, src)
}
-
func (m *MsgUpdateAdmin) XXX_Size() int {
return m.Size()
}
-
func (m *MsgUpdateAdmin) XXX_DiscardUnknown() {
xxx_messageInfo_MsgUpdateAdmin.DiscardUnknown(m)
}
@@ -573,7 +516,8 @@ func (m *MsgUpdateAdmin) XXX_DiscardUnknown() {
var xxx_messageInfo_MsgUpdateAdmin proto.InternalMessageInfo
// MsgUpdateAdminResponse returns empty data
-type MsgUpdateAdminResponse struct{}
+type MsgUpdateAdminResponse struct {
+}
func (m *MsgUpdateAdminResponse) Reset() { *m = MsgUpdateAdminResponse{} }
func (m *MsgUpdateAdminResponse) String() string { return proto.CompactTextString(m) }
@@ -581,11 +525,9 @@ func (*MsgUpdateAdminResponse) ProtoMessage() {}
func (*MsgUpdateAdminResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_4f74d82755520264, []int{11}
}
-
func (m *MsgUpdateAdminResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *MsgUpdateAdminResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MsgUpdateAdminResponse.Marshal(b, m, deterministic)
@@ -598,15 +540,12 @@ func (m *MsgUpdateAdminResponse) XXX_Marshal(b []byte, deterministic bool) ([]by
return b[:n], nil
}
}
-
func (m *MsgUpdateAdminResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_MsgUpdateAdminResponse.Merge(m, src)
}
-
func (m *MsgUpdateAdminResponse) XXX_Size() int {
return m.Size()
}
-
func (m *MsgUpdateAdminResponse) XXX_DiscardUnknown() {
xxx_messageInfo_MsgUpdateAdminResponse.DiscardUnknown(m)
}
@@ -627,11 +566,9 @@ func (*MsgClearAdmin) ProtoMessage() {}
func (*MsgClearAdmin) Descriptor() ([]byte, []int) {
return fileDescriptor_4f74d82755520264, []int{12}
}
-
func (m *MsgClearAdmin) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *MsgClearAdmin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MsgClearAdmin.Marshal(b, m, deterministic)
@@ -644,15 +581,12 @@ func (m *MsgClearAdmin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error
return b[:n], nil
}
}
-
func (m *MsgClearAdmin) XXX_Merge(src proto.Message) {
xxx_messageInfo_MsgClearAdmin.Merge(m, src)
}
-
func (m *MsgClearAdmin) XXX_Size() int {
return m.Size()
}
-
func (m *MsgClearAdmin) XXX_DiscardUnknown() {
xxx_messageInfo_MsgClearAdmin.DiscardUnknown(m)
}
@@ -660,7 +594,8 @@ func (m *MsgClearAdmin) XXX_DiscardUnknown() {
var xxx_messageInfo_MsgClearAdmin proto.InternalMessageInfo
// MsgClearAdminResponse returns empty data
-type MsgClearAdminResponse struct{}
+type MsgClearAdminResponse struct {
+}
func (m *MsgClearAdminResponse) Reset() { *m = MsgClearAdminResponse{} }
func (m *MsgClearAdminResponse) String() string { return proto.CompactTextString(m) }
@@ -668,11 +603,9 @@ func (*MsgClearAdminResponse) ProtoMessage() {}
func (*MsgClearAdminResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_4f74d82755520264, []int{13}
}
-
func (m *MsgClearAdminResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *MsgClearAdminResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MsgClearAdminResponse.Marshal(b, m, deterministic)
@@ -685,15 +618,12 @@ func (m *MsgClearAdminResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt
return b[:n], nil
}
}
-
func (m *MsgClearAdminResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_MsgClearAdminResponse.Merge(m, src)
}
-
func (m *MsgClearAdminResponse) XXX_Size() int {
return m.Size()
}
-
func (m *MsgClearAdminResponse) XXX_DiscardUnknown() {
xxx_messageInfo_MsgClearAdminResponse.DiscardUnknown(m)
}
@@ -716,11 +646,9 @@ func (*MsgUpdateInstantiateConfig) ProtoMessage() {}
func (*MsgUpdateInstantiateConfig) Descriptor() ([]byte, []int) {
return fileDescriptor_4f74d82755520264, []int{14}
}
-
func (m *MsgUpdateInstantiateConfig) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *MsgUpdateInstantiateConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MsgUpdateInstantiateConfig.Marshal(b, m, deterministic)
@@ -733,15 +661,12 @@ func (m *MsgUpdateInstantiateConfig) XXX_Marshal(b []byte, deterministic bool) (
return b[:n], nil
}
}
-
func (m *MsgUpdateInstantiateConfig) XXX_Merge(src proto.Message) {
xxx_messageInfo_MsgUpdateInstantiateConfig.Merge(m, src)
}
-
func (m *MsgUpdateInstantiateConfig) XXX_Size() int {
return m.Size()
}
-
func (m *MsgUpdateInstantiateConfig) XXX_DiscardUnknown() {
xxx_messageInfo_MsgUpdateInstantiateConfig.DiscardUnknown(m)
}
@@ -749,7 +674,8 @@ func (m *MsgUpdateInstantiateConfig) XXX_DiscardUnknown() {
var xxx_messageInfo_MsgUpdateInstantiateConfig proto.InternalMessageInfo
// MsgUpdateInstantiateConfigResponse returns empty data
-type MsgUpdateInstantiateConfigResponse struct{}
+type MsgUpdateInstantiateConfigResponse struct {
+}
func (m *MsgUpdateInstantiateConfigResponse) Reset() { *m = MsgUpdateInstantiateConfigResponse{} }
func (m *MsgUpdateInstantiateConfigResponse) String() string { return proto.CompactTextString(m) }
@@ -757,11 +683,9 @@ func (*MsgUpdateInstantiateConfigResponse) ProtoMessage() {}
func (*MsgUpdateInstantiateConfigResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_4f74d82755520264, []int{15}
}
-
func (m *MsgUpdateInstantiateConfigResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *MsgUpdateInstantiateConfigResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_MsgUpdateInstantiateConfigResponse.Marshal(b, m, deterministic)
@@ -774,15 +698,12 @@ func (m *MsgUpdateInstantiateConfigResponse) XXX_Marshal(b []byte, deterministic
return b[:n], nil
}
}
-
func (m *MsgUpdateInstantiateConfigResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_MsgUpdateInstantiateConfigResponse.Merge(m, src)
}
-
func (m *MsgUpdateInstantiateConfigResponse) XXX_Size() int {
return m.Size()
}
-
func (m *MsgUpdateInstantiateConfigResponse) XXX_DiscardUnknown() {
xxx_messageInfo_MsgUpdateInstantiateConfigResponse.DiscardUnknown(m)
}
@@ -811,71 +732,71 @@ func init() {
func init() { proto.RegisterFile("cosmwasm/wasm/v1/tx.proto", fileDescriptor_4f74d82755520264) }
var fileDescriptor_4f74d82755520264 = []byte{
- // 908 bytes of a gzipped FileDescriptorProto
+ // 933 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x56, 0x4f, 0x6f, 0xe3, 0x44,
- 0x14, 0x8f, 0x9b, 0x3f, 0x4d, 0x5f, 0xc3, 0x52, 0x99, 0x6c, 0xeb, 0x35, 0xc8, 0x89, 0xcc, 0x6a,
- 0x31, 0xd2, 0x62, 0x37, 0x01, 0x71, 0x6f, 0xb2, 0x1c, 0xba, 0x92, 0x01, 0xb9, 0x5a, 0x2a, 0x10,
- 0x52, 0x34, 0xb1, 0x27, 0x5e, 0x6b, 0x6b, 0x4f, 0xf0, 0x4c, 0x9b, 0xf4, 0xc0, 0x57, 0x40, 0xdc,
- 0xf8, 0x0e, 0x7c, 0x01, 0x2e, 0x5c, 0x10, 0x97, 0x1e, 0xf7, 0x82, 0xc4, 0xa9, 0x40, 0xfa, 0x2d,
- 0x38, 0x21, 0x8f, 0xff, 0xd4, 0x4d, 0xed, 0x34, 0x0b, 0xe2, 0xb4, 0x97, 0x64, 0xc6, 0xf3, 0x7b,
- 0xef, 0xf7, 0xde, 0x6f, 0xde, 0xf3, 0x33, 0x3c, 0xb0, 0x09, 0xf5, 0x67, 0x88, 0xfa, 0x06, 0xff,
- 0x39, 0xeb, 0x19, 0x6c, 0xae, 0x4f, 0x43, 0xc2, 0x88, 0xb8, 0x93, 0x1e, 0xe9, 0xfc, 0xe7, 0xac,
- 0x27, 0x2b, 0xd1, 0x13, 0x42, 0x8d, 0x31, 0xa2, 0xd8, 0x38, 0xeb, 0x8d, 0x31, 0x43, 0x3d, 0xc3,
- 0x26, 0x5e, 0x10, 0x5b, 0xc8, 0x6d, 0x97, 0xb8, 0x84, 0x2f, 0x8d, 0x68, 0x95, 0x3c, 0x7d, 0xe7,
- 0x36, 0xc5, 0xf9, 0x14, 0xd3, 0xf8, 0x54, 0xfd, 0x45, 0x80, 0x96, 0x49, 0xdd, 0x23, 0x46, 0x42,
- 0x3c, 0x24, 0x0e, 0x16, 0x77, 0xa1, 0x41, 0x71, 0xe0, 0xe0, 0x50, 0x12, 0xba, 0x82, 0xb6, 0x65,
- 0x25, 0x3b, 0xf1, 0x63, 0xb8, 0x17, 0xd9, 0x8f, 0xc6, 0xe7, 0x0c, 0x8f, 0x6c, 0xe2, 0x60, 0x69,
- 0xa3, 0x2b, 0x68, 0xad, 0xc1, 0xce, 0xe2, 0xb2, 0xd3, 0x3a, 0x3e, 0x38, 0x32, 0x07, 0xe7, 0x8c,
- 0x7b, 0xb0, 0x5a, 0x11, 0x2e, 0xdd, 0x89, 0xcf, 0x60, 0xd7, 0x0b, 0x28, 0x43, 0x01, 0xf3, 0x10,
- 0xc3, 0xa3, 0x29, 0x0e, 0x7d, 0x8f, 0x52, 0x8f, 0x04, 0x52, 0xbd, 0x2b, 0x68, 0xdb, 0x7d, 0x45,
- 0x5f, 0xce, 0x53, 0x3f, 0xb0, 0x6d, 0x4c, 0xe9, 0x90, 0x04, 0x13, 0xcf, 0xb5, 0xee, 0xe7, 0xac,
- 0x3f, 0xcf, 0x8c, 0x9f, 0xd6, 0x9a, 0xd5, 0x9d, 0xda, 0xd3, 0x5a, 0xb3, 0xb6, 0x53, 0x57, 0x8f,
- 0xa1, 0x9d, 0x4f, 0xc1, 0xc2, 0x74, 0x4a, 0x02, 0x8a, 0xc5, 0x77, 0x61, 0x33, 0x0a, 0x74, 0xe4,
- 0x39, 0x3c, 0x97, 0xda, 0x00, 0x16, 0x97, 0x9d, 0x46, 0x04, 0x39, 0x7c, 0x62, 0x35, 0xa2, 0xa3,
- 0x43, 0x47, 0x94, 0xa1, 0x69, 0x3f, 0xc7, 0xf6, 0x0b, 0x7a, 0xea, 0xc7, 0x19, 0x59, 0xd9, 0x5e,
- 0xfd, 0x6e, 0x03, 0x76, 0x4d, 0xea, 0x1e, 0x5e, 0x47, 0x30, 0x24, 0x01, 0x0b, 0x91, 0xcd, 0x4a,
- 0x65, 0x6a, 0x43, 0x1d, 0x39, 0xbe, 0x17, 0x70, 0x5f, 0x5b, 0x56, 0xbc, 0xc9, 0x47, 0x52, 0x2d,
- 0x8d, 0xa4, 0x0d, 0xf5, 0x13, 0x34, 0xc6, 0x27, 0x52, 0x2d, 0x36, 0xe5, 0x1b, 0x51, 0x83, 0xaa,
- 0x4f, 0x5d, 0x2e, 0x56, 0x6b, 0xb0, 0xfb, 0xf7, 0x65, 0x47, 0xb4, 0xd0, 0x2c, 0x0d, 0xc3, 0xc4,
- 0x94, 0x22, 0x17, 0x5b, 0x11, 0x44, 0x44, 0x50, 0x9f, 0x9c, 0x06, 0x0e, 0x95, 0x1a, 0xdd, 0xaa,
- 0xb6, 0xdd, 0x7f, 0xa0, 0xc7, 0xe5, 0xa2, 0x47, 0xe5, 0xa2, 0x27, 0xe5, 0xa2, 0x0f, 0x89, 0x17,
- 0x0c, 0xf6, 0x2f, 0x2e, 0x3b, 0x95, 0x1f, 0xff, 0xe8, 0x68, 0xae, 0xc7, 0x9e, 0x9f, 0x8e, 0x75,
- 0x9b, 0xf8, 0x46, 0x52, 0x5b, 0xf1, 0xdf, 0x07, 0xd4, 0x79, 0x91, 0x94, 0x49, 0x64, 0x40, 0xad,
- 0xd8, 0xb3, 0xfa, 0xf3, 0x06, 0xec, 0x15, 0x0b, 0xd2, 0x7f, 0x3d, 0x15, 0x11, 0x45, 0xa8, 0x51,
- 0x74, 0xc2, 0xa4, 0x4d, 0x5e, 0x3a, 0x7c, 0x2d, 0xee, 0xc1, 0xe6, 0xc4, 0x9b, 0x8f, 0xa2, 0x20,
- 0x9b, 0x5d, 0x41, 0x6b, 0x5a, 0x8d, 0x89, 0x37, 0x37, 0xa9, 0xab, 0x7e, 0x0a, 0x4a, 0xb1, 0x7a,
- 0x59, 0xc9, 0x4a, 0xb0, 0x89, 0x1c, 0x27, 0xc4, 0x94, 0x26, 0x2a, 0xa6, 0xdb, 0x88, 0xc8, 0x41,
- 0x0c, 0x25, 0x35, 0xca, 0xd7, 0xea, 0x67, 0xd0, 0x29, 0xb9, 0x8d, 0x7f, 0xe9, 0xf0, 0x37, 0x01,
- 0x44, 0x93, 0xba, 0x9f, 0xcc, 0xb1, 0x7d, 0xba, 0x46, 0xb1, 0x47, 0xbd, 0x93, 0x60, 0x92, 0xdb,
- 0xcd, 0xf6, 0xe9, 0x2d, 0x55, 0x5f, 0xe1, 0x96, 0xea, 0xff, 0x5b, 0xdd, 0xee, 0x83, 0x7c, 0x3b,
- 0xad, 0x4c, 0xa3, 0x54, 0x09, 0x21, 0xa7, 0xc4, 0x0f, 0xb1, 0x12, 0xa6, 0xe7, 0x86, 0xe8, 0x3f,
- 0x2a, 0xb1, 0x56, 0xa9, 0x27, 0x72, 0xd5, 0xee, 0x94, 0x2b, 0xc9, 0x65, 0x29, 0xb0, 0x95, 0xb9,
- 0x20, 0xb8, 0x67, 0x52, 0xf7, 0xd9, 0xd4, 0x41, 0x0c, 0x1f, 0xf0, 0xee, 0x2b, 0x4b, 0xe3, 0x6d,
- 0xd8, 0x0a, 0xf0, 0x6c, 0x94, 0xef, 0xd7, 0x66, 0x80, 0x67, 0xb1, 0x51, 0x3e, 0xc7, 0xea, 0xcd,
- 0x1c, 0x55, 0x89, 0xbf, 0x28, 0x73, 0x14, 0x69, 0x40, 0xea, 0x10, 0xde, 0x30, 0xa9, 0x3b, 0x3c,
- 0xc1, 0x28, 0x5c, 0xcd, 0xbd, 0xca, 0xfd, 0x1e, 0xdc, 0xbf, 0xe1, 0x24, 0xf3, 0xfe, 0x93, 0xc0,
- 0xd5, 0x88, 0x89, 0x6f, 0x36, 0xc2, 0xc4, 0x73, 0x4b, 0xb9, 0x72, 0x57, 0xb2, 0x51, 0x7a, 0x25,
- 0x5f, 0x83, 0x1c, 0x89, 0x51, 0x32, 0xbd, 0xaa, 0x6b, 0x4d, 0x2f, 0x29, 0xc0, 0xb3, 0xc3, 0xa2,
- 0x01, 0xa6, 0x3e, 0x04, 0xb5, 0x3c, 0xf0, 0x34, 0xbf, 0xfe, 0xaf, 0x0d, 0xa8, 0x9a, 0xd4, 0x15,
- 0x8f, 0x60, 0xeb, 0x7a, 0x44, 0x17, 0x90, 0xe6, 0xe7, 0x9f, 0xfc, 0x68, 0xf5, 0x79, 0x56, 0x2b,
- 0xdf, 0xc0, 0x5b, 0x45, 0xa3, 0x4d, 0x2b, 0x34, 0x2f, 0x40, 0xca, 0xfb, 0xeb, 0x22, 0x33, 0x4a,
- 0x06, 0xed, 0xc2, 0xe1, 0xf1, 0xfe, 0xba, 0x9e, 0xfa, 0x72, 0x6f, 0x6d, 0x68, 0xc6, 0x8a, 0xe1,
- 0xcd, 0xe5, 0x57, 0xda, 0xc3, 0x42, 0x2f, 0x4b, 0x28, 0xf9, 0xf1, 0x3a, 0xa8, 0x3c, 0xcd, 0xf2,
- 0xfb, 0xa2, 0x98, 0x66, 0x09, 0x55, 0x42, 0x53, 0xd6, 0xe2, 0x5f, 0xc2, 0x76, 0xbe, 0x97, 0xbb,
- 0x85, 0xc6, 0x39, 0x84, 0xac, 0xdd, 0x85, 0xc8, 0x5c, 0x7f, 0x01, 0x90, 0xeb, 0xd4, 0x4e, 0xa1,
- 0xdd, 0x35, 0x40, 0x7e, 0xef, 0x0e, 0x40, 0xe6, 0xf7, 0x5b, 0xd8, 0x2b, 0x6b, 0xd1, 0xc7, 0x2b,
- 0x82, 0xbb, 0x85, 0x96, 0x3f, 0x7a, 0x15, 0x74, 0x4a, 0x3f, 0x78, 0x72, 0xf1, 0x97, 0x52, 0xb9,
- 0x58, 0x28, 0xc2, 0xcb, 0x85, 0x22, 0xfc, 0xb9, 0x50, 0x84, 0xef, 0xaf, 0x94, 0xca, 0xcb, 0x2b,
- 0xa5, 0xf2, 0xfb, 0x95, 0x52, 0xf9, 0xea, 0x51, 0x6e, 0x9a, 0x0c, 0x09, 0xf5, 0x8f, 0xd3, 0x6f,
- 0x65, 0xc7, 0x98, 0xc7, 0xdf, 0xcc, 0x7c, 0xa2, 0x8c, 0x1b, 0xfc, 0x8b, 0xf9, 0xc3, 0x7f, 0x02,
- 0x00, 0x00, 0xff, 0xff, 0x2a, 0x98, 0x99, 0x8e, 0xb4, 0x0b, 0x00, 0x00,
+ 0x14, 0x8f, 0x9b, 0x3f, 0x4d, 0x5f, 0xc3, 0x52, 0x99, 0x6c, 0xe3, 0x35, 0xc8, 0x89, 0xc2, 0x6a,
+ 0x31, 0x68, 0x71, 0x9a, 0x80, 0x38, 0x70, 0x6b, 0xb2, 0x1c, 0xba, 0x92, 0x61, 0xe5, 0x6a, 0xa9,
+ 0x40, 0x48, 0xd1, 0xc4, 0x9e, 0xcc, 0x5a, 0x5b, 0x7b, 0x42, 0x9e, 0xdb, 0xa4, 0x07, 0x2e, 0x7c,
+ 0x02, 0xee, 0x5c, 0x39, 0x71, 0xe2, 0x2b, 0x20, 0x38, 0x94, 0xdb, 0x1e, 0x39, 0x15, 0x48, 0x0f,
+ 0x7c, 0x07, 0x4e, 0xc8, 0x7f, 0xeb, 0xa4, 0x76, 0x9b, 0x05, 0x89, 0x0b, 0x97, 0x64, 0x9e, 0xe7,
+ 0xf7, 0xfe, 0xfd, 0xe6, 0xbd, 0x79, 0x03, 0xf7, 0x4c, 0x8e, 0xce, 0x8c, 0xa0, 0xd3, 0x09, 0x7e,
+ 0x4e, 0xbb, 0x1d, 0x6f, 0xae, 0x4d, 0xa6, 0xdc, 0xe3, 0xe2, 0x4e, 0xbc, 0xa5, 0x05, 0x3f, 0xa7,
+ 0x5d, 0x59, 0xf1, 0xbf, 0x70, 0xec, 0x8c, 0x08, 0xd2, 0xce, 0x69, 0x77, 0x44, 0x3d, 0xd2, 0xed,
+ 0x98, 0xdc, 0x76, 0x43, 0x0d, 0xb9, 0x11, 0xed, 0x3b, 0xc8, 0x7c, 0x4b, 0x0e, 0xb2, 0x68, 0xa3,
+ 0xce, 0x38, 0xe3, 0xc1, 0xb2, 0xe3, 0xaf, 0xa2, 0xaf, 0x6f, 0x5c, 0xf7, 0x7d, 0x36, 0xa1, 0x18,
+ 0xee, 0xb6, 0x7f, 0x14, 0xa0, 0xa6, 0x23, 0x3b, 0xf4, 0xf8, 0x94, 0x0e, 0xb8, 0x45, 0xc5, 0x5d,
+ 0xa8, 0x20, 0x75, 0x2d, 0x3a, 0x95, 0x84, 0x96, 0xa0, 0x6e, 0x19, 0x91, 0x24, 0x7e, 0x00, 0x77,
+ 0x7c, 0xfd, 0xe1, 0xe8, 0xcc, 0xa3, 0x43, 0x93, 0x5b, 0x54, 0xda, 0x68, 0x09, 0x6a, 0xad, 0xbf,
+ 0xb3, 0xb8, 0x68, 0xd6, 0x8e, 0xf6, 0x0f, 0xf5, 0xfe, 0x99, 0x17, 0x58, 0x30, 0x6a, 0x3e, 0x2e,
+ 0x96, 0xc4, 0xa7, 0xb0, 0x6b, 0xbb, 0xe8, 0x11, 0xd7, 0xb3, 0x89, 0x47, 0x87, 0x13, 0x3a, 0x75,
+ 0x6c, 0x44, 0x9b, 0xbb, 0x52, 0xb9, 0x25, 0xa8, 0xdb, 0x3d, 0x45, 0x5b, 0x25, 0x40, 0xdb, 0x37,
+ 0x4d, 0x8a, 0x38, 0xe0, 0xee, 0xd8, 0x66, 0xc6, 0xdd, 0x94, 0xf6, 0x93, 0x44, 0xf9, 0x71, 0xa9,
+ 0x5a, 0xdc, 0x29, 0x3d, 0x2e, 0x55, 0x4b, 0x3b, 0xe5, 0xf6, 0x11, 0xd4, 0xd3, 0x29, 0x18, 0x14,
+ 0x27, 0xdc, 0x45, 0x2a, 0xbe, 0x09, 0x9b, 0x7e, 0xa0, 0x43, 0xdb, 0x0a, 0x72, 0x29, 0xf5, 0x61,
+ 0x71, 0xd1, 0xac, 0xf8, 0x90, 0x83, 0x47, 0x46, 0xc5, 0xdf, 0x3a, 0xb0, 0x44, 0x19, 0xaa, 0xe6,
+ 0x33, 0x6a, 0x3e, 0xc7, 0x13, 0x27, 0xcc, 0xc8, 0x48, 0xe4, 0xf6, 0xb7, 0x1b, 0xb0, 0xab, 0x23,
+ 0x3b, 0xb8, 0x8a, 0x60, 0xc0, 0x5d, 0x6f, 0x4a, 0x4c, 0x2f, 0x97, 0xa6, 0x3a, 0x94, 0x89, 0xe5,
+ 0xd8, 0x6e, 0x60, 0x6b, 0xcb, 0x08, 0x85, 0x74, 0x24, 0xc5, 0xdc, 0x48, 0xea, 0x50, 0x3e, 0x26,
+ 0x23, 0x7a, 0x2c, 0x95, 0x42, 0xd5, 0x40, 0x10, 0x55, 0x28, 0x3a, 0xc8, 0x02, 0xb2, 0x6a, 0xfd,
+ 0xdd, 0xbf, 0x2e, 0x9a, 0xa2, 0x41, 0x66, 0x71, 0x18, 0x3a, 0x45, 0x24, 0x8c, 0x1a, 0x3e, 0x44,
+ 0x24, 0x50, 0x1e, 0x9f, 0xb8, 0x16, 0x4a, 0x95, 0x56, 0x51, 0xdd, 0xee, 0xdd, 0xd3, 0xc2, 0x3a,
+ 0xd1, 0xfc, 0x3a, 0xd2, 0xa2, 0x3a, 0xd2, 0x06, 0xdc, 0x76, 0xfb, 0x7b, 0xe7, 0x17, 0xcd, 0xc2,
+ 0xf7, 0xbf, 0x35, 0x55, 0x66, 0x7b, 0xcf, 0x4e, 0x46, 0x9a, 0xc9, 0x9d, 0x4e, 0x54, 0x54, 0xe1,
+ 0xdf, 0xbb, 0x68, 0x3d, 0x8f, 0xca, 0xc4, 0x57, 0x40, 0x23, 0xb4, 0xfc, 0xe1, 0xf6, 0xd7, 0x7f,
+ 0xfe, 0xf0, 0x4e, 0x94, 0x6a, 0xfb, 0x97, 0x0d, 0x68, 0x64, 0xb3, 0xd3, 0xfb, 0x7f, 0xd2, 0x23,
+ 0x8a, 0x50, 0x42, 0x72, 0xec, 0x49, 0x9b, 0x41, 0x1d, 0x05, 0x6b, 0xb1, 0x01, 0x9b, 0x63, 0x7b,
+ 0x3e, 0xf4, 0x83, 0xac, 0xb6, 0x04, 0xb5, 0x6a, 0x54, 0xc6, 0xf6, 0x5c, 0x47, 0xb6, 0xcc, 0xe5,
+ 0xc7, 0xa0, 0x64, 0x53, 0x99, 0x14, 0xb3, 0x04, 0x9b, 0xc4, 0xb2, 0xa6, 0x14, 0x31, 0xa2, 0x34,
+ 0x16, 0x7d, 0xaf, 0x16, 0xf1, 0x48, 0x54, 0xbd, 0xc1, 0xba, 0xfd, 0x09, 0x34, 0x73, 0x8e, 0xe6,
+ 0x1f, 0x1a, 0x5c, 0x08, 0x20, 0xea, 0xc8, 0x3e, 0x9a, 0x53, 0xf3, 0x64, 0x8d, 0x36, 0xf0, 0xbb,
+ 0x2a, 0xc2, 0x44, 0x47, 0x9d, 0xc8, 0xf1, 0x91, 0x15, 0x5f, 0xe2, 0xc8, 0xca, 0xff, 0x4d, 0x45,
+ 0xef, 0x81, 0x7c, 0x3d, 0xc7, 0x84, 0xb0, 0x98, 0x16, 0x21, 0x45, 0xcb, 0x77, 0x21, 0x2d, 0xba,
+ 0xcd, 0xa6, 0xe4, 0x5f, 0xd2, 0xb2, 0x56, 0x13, 0x44, 0xdc, 0x95, 0x6e, 0xe5, 0x2e, 0x2b, 0xb1,
+ 0x95, 0x28, 0x6f, 0x4c, 0xcc, 0x85, 0x3b, 0x3a, 0xb2, 0xa7, 0x13, 0x8b, 0x78, 0x74, 0x3f, 0x68,
+ 0xd2, 0xbc, 0x9c, 0x5e, 0x87, 0x2d, 0x97, 0xce, 0x86, 0xe9, 0xb6, 0xae, 0xba, 0x74, 0x16, 0x2a,
+ 0xa5, 0x13, 0x2e, 0x2e, 0x27, 0xbc, 0x1c, 0xa1, 0x14, 0xdc, 0xb4, 0x29, 0x7f, 0x71, 0x74, 0xed,
+ 0x27, 0xf0, 0x8a, 0x8e, 0x6c, 0x70, 0x4c, 0xc9, 0xf4, 0xe6, 0x40, 0xd6, 0xf6, 0xd5, 0x80, 0xbb,
+ 0x4b, 0x16, 0x13, 0x57, 0x3f, 0x0b, 0x01, 0x4f, 0x61, 0x14, 0xcb, 0xcd, 0x33, 0xb6, 0x59, 0xae,
+ 0xe3, 0xd4, 0xc9, 0x6d, 0xe4, 0x9e, 0xdc, 0x17, 0x20, 0xfb, 0x34, 0xe5, 0xcc, 0xc2, 0xe2, 0x5a,
+ 0xb3, 0x50, 0x72, 0xe9, 0xec, 0x20, 0x6b, 0x1c, 0x2e, 0xe7, 0x77, 0x1f, 0xda, 0xf9, 0x59, 0xc4,
+ 0xc9, 0xf6, 0x7e, 0xaa, 0x40, 0x51, 0x47, 0x26, 0x1e, 0xc2, 0xd6, 0xd5, 0xf4, 0xcf, 0x88, 0x20,
+ 0x3d, 0x5a, 0xe5, 0x07, 0x37, 0xef, 0x27, 0x25, 0xf5, 0x25, 0xbc, 0x96, 0x35, 0x35, 0xd5, 0x4c,
+ 0xf5, 0x0c, 0xa4, 0xbc, 0xb7, 0x2e, 0x32, 0x71, 0xe9, 0x41, 0x3d, 0x73, 0x14, 0xbd, 0xbd, 0xae,
+ 0xa5, 0x9e, 0xdc, 0x5d, 0x1b, 0x9a, 0x78, 0xa5, 0xf0, 0xea, 0xea, 0x9d, 0x78, 0x3f, 0xd3, 0xca,
+ 0x0a, 0x4a, 0x7e, 0xb8, 0x0e, 0x2a, 0xed, 0x66, 0xf5, 0x8e, 0xc9, 0x76, 0xb3, 0x82, 0xca, 0x71,
+ 0x93, 0x77, 0x13, 0x7c, 0x06, 0xdb, 0xe9, 0x96, 0x6f, 0x65, 0x2a, 0xa7, 0x10, 0xb2, 0x7a, 0x1b,
+ 0x22, 0x31, 0xfd, 0x29, 0x40, 0xaa, 0x87, 0x9b, 0x99, 0x7a, 0x57, 0x00, 0xf9, 0xad, 0x5b, 0x00,
+ 0x89, 0xdd, 0xaf, 0xa0, 0x91, 0xd7, 0xaf, 0x0f, 0x6f, 0x08, 0xee, 0x1a, 0x5a, 0x7e, 0xff, 0x65,
+ 0xd0, 0xb1, 0xfb, 0xfe, 0xa3, 0xf3, 0x3f, 0x94, 0xc2, 0xf9, 0x42, 0x11, 0x5e, 0x2c, 0x14, 0xe1,
+ 0xf7, 0x85, 0x22, 0x7c, 0x73, 0xa9, 0x14, 0x5e, 0x5c, 0x2a, 0x85, 0x5f, 0x2f, 0x95, 0xc2, 0xe7,
+ 0x0f, 0x52, 0xe3, 0x68, 0xc0, 0xd1, 0x39, 0x8a, 0x9f, 0xe1, 0x56, 0x67, 0x1e, 0x3e, 0xc7, 0x83,
+ 0x91, 0x34, 0xaa, 0x04, 0x8f, 0xf1, 0xf7, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x39, 0xd8, 0x44,
+ 0xd6, 0x28, 0x0c, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
-var (
- _ context.Context
- _ grpc.ClientConn
-)
+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.
@@ -1008,36 +929,30 @@ type MsgServer interface {
}
// UnimplementedMsgServer can be embedded to have forward compatible implementations.
-type UnimplementedMsgServer struct{}
+type UnimplementedMsgServer struct {
+}
func (*UnimplementedMsgServer) StoreCode(ctx context.Context, req *MsgStoreCode) (*MsgStoreCodeResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method StoreCode not implemented")
}
-
func (*UnimplementedMsgServer) InstantiateContract(ctx context.Context, req *MsgInstantiateContract) (*MsgInstantiateContractResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method InstantiateContract not implemented")
}
-
func (*UnimplementedMsgServer) InstantiateContract2(ctx context.Context, req *MsgInstantiateContract2) (*MsgInstantiateContract2Response, error) {
return nil, status.Errorf(codes.Unimplemented, "method InstantiateContract2 not implemented")
}
-
func (*UnimplementedMsgServer) ExecuteContract(ctx context.Context, req *MsgExecuteContract) (*MsgExecuteContractResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ExecuteContract not implemented")
}
-
func (*UnimplementedMsgServer) MigrateContract(ctx context.Context, req *MsgMigrateContract) (*MsgMigrateContractResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method MigrateContract not implemented")
}
-
func (*UnimplementedMsgServer) UpdateAdmin(ctx context.Context, req *MsgUpdateAdmin) (*MsgUpdateAdminResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateAdmin not implemented")
}
-
func (*UnimplementedMsgServer) ClearAdmin(ctx context.Context, req *MsgClearAdmin) (*MsgClearAdminResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ClearAdmin not implemented")
}
-
func (*UnimplementedMsgServer) UpdateInstantiateConfig(ctx context.Context, req *MsgUpdateInstantiateConfig) (*MsgUpdateInstantiateConfigResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateInstantiateConfig not implemented")
}
@@ -1921,7 +1836,6 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
return base
}
-
func (m *MsgStoreCode) Size() (n int) {
if m == nil {
return 0
@@ -2233,11 +2147,9 @@ func (m *MsgUpdateInstantiateConfigResponse) Size() (n int) {
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 *MsgStoreCode) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -2390,7 +2302,6 @@ func (m *MsgStoreCode) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *MsgStoreCodeResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -2494,7 +2405,6 @@ func (m *MsgStoreCodeResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -2728,7 +2638,6 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *MsgInstantiateContract2) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -3016,7 +2925,6 @@ func (m *MsgInstantiateContract2) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *MsgInstantiateContractResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -3133,7 +3041,6 @@ func (m *MsgInstantiateContractResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *MsgInstantiateContract2Response) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -3250,7 +3157,6 @@ func (m *MsgInstantiateContract2Response) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -3433,7 +3339,6 @@ func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *MsgExecuteContractResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -3518,7 +3423,6 @@ func (m *MsgExecuteContractResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *MsgMigrateContract) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -3686,7 +3590,6 @@ func (m *MsgMigrateContract) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *MsgMigrateContractResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -3771,7 +3674,6 @@ func (m *MsgMigrateContractResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *MsgUpdateAdmin) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -3918,7 +3820,6 @@ func (m *MsgUpdateAdmin) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *MsgUpdateAdminResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -3969,7 +3870,6 @@ func (m *MsgUpdateAdminResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *MsgClearAdmin) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -4084,7 +3984,6 @@ func (m *MsgClearAdmin) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *MsgClearAdminResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -4135,7 +4034,6 @@ func (m *MsgClearAdminResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *MsgUpdateInstantiateConfig) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -4273,7 +4171,6 @@ func (m *MsgUpdateInstantiateConfig) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *MsgUpdateInstantiateConfigResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -4324,7 +4221,6 @@ func (m *MsgUpdateInstantiateConfigResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func skipTx(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
diff --git a/x/wasm/types/tx_test.go b/x/wasm/types/tx_test.go
index 57e36a4675..628f259503 100644
--- a/x/wasm/types/tx_test.go
+++ b/x/wasm/types/tx_test.go
@@ -5,9 +5,8 @@ import (
"strings"
"testing"
- "github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx"
-
sdk "github.com/cosmos/cosmos-sdk/types"
+ "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
@@ -15,7 +14,7 @@ import (
const firstCodeID = 1
func TestStoreCodeValidation(t *testing.T) {
- bad, err := sdk.AccAddressFromHex("012345")
+ bad, err := sdk.AccAddressFromHexUnsafe("012345")
require.NoError(t, err)
badAddress := bad.String()
// proper address size
@@ -79,7 +78,7 @@ func TestStoreCodeValidation(t *testing.T) {
}
func TestInstantiateContractValidation(t *testing.T) {
- bad, err := sdk.AccAddressFromHex("012345")
+ bad, err := sdk.AccAddressFromHexUnsafe("012345")
require.NoError(t, err)
badAddress := bad.String()
// proper address size
@@ -187,7 +186,7 @@ func TestInstantiateContractValidation(t *testing.T) {
}
func TestInstantiateContract2Validation(t *testing.T) {
- bad, err := sdk.AccAddressFromHex("012345")
+ bad, err := sdk.AccAddressFromHexUnsafe("012345")
require.NoError(t, err)
badAddress := bad.String()
// proper address size
@@ -323,7 +322,7 @@ func TestInstantiateContract2Validation(t *testing.T) {
}
func TestExecuteContractValidation(t *testing.T) {
- bad, err := sdk.AccAddressFromHex("012345")
+ bad, err := sdk.AccAddressFromHexUnsafe("012345")
require.NoError(t, err)
badAddress := bad.String()
// proper address size
@@ -432,7 +431,7 @@ func TestExecuteContractValidation(t *testing.T) {
}
func TestMsgUpdateAdministrator(t *testing.T) {
- bad, err := sdk.AccAddressFromHex("012345")
+ bad, err := sdk.AccAddressFromHexUnsafe("012345")
require.NoError(t, err)
badAddress := bad.String()
// proper address size
@@ -504,7 +503,7 @@ func TestMsgUpdateAdministrator(t *testing.T) {
}
func TestMsgClearAdministrator(t *testing.T) {
- bad, err := sdk.AccAddressFromHex("012345")
+ bad, err := sdk.AccAddressFromHexUnsafe("012345")
require.NoError(t, err)
badAddress := bad.String()
// proper address size
@@ -555,7 +554,7 @@ func TestMsgClearAdministrator(t *testing.T) {
}
func TestMsgMigrateContract(t *testing.T) {
- bad, err := sdk.AccAddressFromHex("012345")
+ bad, err := sdk.AccAddressFromHexUnsafe("012345")
require.NoError(t, err)
badAddress := bad.String()
// proper address size
@@ -681,7 +680,7 @@ func TestMsgJsonSignBytes(t *testing.T) {
}
func TestMsgUpdateInstantiateConfig(t *testing.T) {
- bad, err := sdk.AccAddressFromHex("012345")
+ bad, err := sdk.AccAddressFromHexUnsafe("012345")
require.NoError(t, err)
badAddress := bad.String()
// proper address size
diff --git a/x/wasm/types/types.go b/x/wasm/types/types.go
index e6afae96f6..f1c95cf54c 100644
--- a/x/wasm/types/types.go
+++ b/x/wasm/types/types.go
@@ -8,7 +8,7 @@ import (
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
- "github.com/gogo/protobuf/proto"
+ "github.com/cosmos/gogoproto/proto"
)
const (
@@ -315,11 +315,11 @@ func NewWasmCoins(cosmosCoins sdk.Coins) (wasmCoins []wasmvmtypes.Coin) {
type WasmConfig struct {
// SimulationGasLimit is the max gas to be used in a tx simulation call.
// When not set the consensus max block gas is used instead
- SimulationGasLimit *uint64
- // SimulationGasLimit is the max gas to be used in a smart query contract call
- SmartQueryGasLimit uint64
+ SimulationGasLimit *uint64 `mapstructure:"simulation_gas_limit"`
+ // SmartQueryGasLimit is the max gas to be used in a smart query contract call
+ SmartQueryGasLimit uint64 `mapstructure:"query_gas_limit"`
// MemoryCacheSize in MiB not bytes
- MemoryCacheSize uint32
+ MemoryCacheSize uint32 `mapstructure:"memory_cache_size"`
// ContractDebugMode log what contract print
ContractDebugMode bool
}
@@ -333,6 +333,33 @@ func DefaultWasmConfig() WasmConfig {
}
}
+// DefaultConfigTemplate toml snippet with default values for app.toml
+func DefaultConfigTemplate() string {
+ return ConfigTemplate(DefaultWasmConfig())
+}
+
+// ConfigTemplate toml snippet for app.toml
+func ConfigTemplate(c WasmConfig) string {
+ simGasLimit := `# simulation_gas_limit =`
+ if c.SimulationGasLimit != nil {
+ simGasLimit = fmt.Sprintf(`simulation_gas_limit = %d`, *c.SimulationGasLimit)
+ }
+
+ return fmt.Sprintf(`
+[wasm]
+# Smart query gas limit is the max gas to be used in a smart query contract call
+query_gas_limit = %d
+
+# in-memory cache for Wasm contracts. Set to 0 to disable.
+# The value is in MiB not bytes
+memory_cache_size = %d
+
+# Simulation gas limit is the max gas to be used in a tx simulation call.
+# When not set the consensus max block gas is used instead
+%s
+`, c.SmartQueryGasLimit, c.MemoryCacheSize, simGasLimit)
+}
+
// VerifyAddressLen ensures that the address matches the expected length
func VerifyAddressLen() func(addr []byte) error {
return func(addr []byte) error {
diff --git a/x/wasm/types/types.pb.go b/x/wasm/types/types.pb.go
index 89351f716f..2f0502b270 100644
--- a/x/wasm/types/types.pb.go
+++ b/x/wasm/types/types.pb.go
@@ -6,23 +6,20 @@ package types
import (
bytes "bytes"
fmt "fmt"
- io "io"
- math "math"
- math_bits "math/bits"
-
+ github_com_cometbft_cometbft_libs_bytes "github.com/cometbft/cometbft/libs/bytes"
_ "github.com/cosmos/cosmos-proto"
types "github.com/cosmos/cosmos-sdk/codec/types"
_ "github.com/cosmos/gogoproto/gogoproto"
- proto "github.com/gogo/protobuf/proto"
- github_com_tendermint_tendermint_libs_bytes "github.com/tendermint/tendermint/libs/bytes"
+ proto "github.com/cosmos/gogoproto/proto"
+ io "io"
+ math "math"
+ math_bits "math/bits"
)
// Reference imports to suppress errors if they are not otherwise used.
-var (
- _ = proto.Marshal
- _ = fmt.Errorf
- _ = math.Inf
-)
+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.
@@ -114,11 +111,9 @@ func (*AccessTypeParam) ProtoMessage() {}
func (*AccessTypeParam) Descriptor() ([]byte, []int) {
return fileDescriptor_e6155d98fa173e02, []int{0}
}
-
func (m *AccessTypeParam) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *AccessTypeParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_AccessTypeParam.Marshal(b, m, deterministic)
@@ -131,15 +126,12 @@ func (m *AccessTypeParam) XXX_Marshal(b []byte, deterministic bool) ([]byte, err
return b[:n], nil
}
}
-
func (m *AccessTypeParam) XXX_Merge(src proto.Message) {
xxx_messageInfo_AccessTypeParam.Merge(m, src)
}
-
func (m *AccessTypeParam) XXX_Size() int {
return m.Size()
}
-
func (m *AccessTypeParam) XXX_DiscardUnknown() {
xxx_messageInfo_AccessTypeParam.DiscardUnknown(m)
}
@@ -161,11 +153,9 @@ func (*AccessConfig) ProtoMessage() {}
func (*AccessConfig) Descriptor() ([]byte, []int) {
return fileDescriptor_e6155d98fa173e02, []int{1}
}
-
func (m *AccessConfig) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *AccessConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_AccessConfig.Marshal(b, m, deterministic)
@@ -178,15 +168,12 @@ func (m *AccessConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
return b[:n], nil
}
}
-
func (m *AccessConfig) XXX_Merge(src proto.Message) {
xxx_messageInfo_AccessConfig.Merge(m, src)
}
-
func (m *AccessConfig) XXX_Size() int {
return m.Size()
}
-
func (m *AccessConfig) XXX_DiscardUnknown() {
xxx_messageInfo_AccessConfig.DiscardUnknown(m)
}
@@ -204,11 +191,9 @@ func (*Params) ProtoMessage() {}
func (*Params) Descriptor() ([]byte, []int) {
return fileDescriptor_e6155d98fa173e02, []int{2}
}
-
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)
@@ -221,15 +206,12 @@ func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
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)
}
@@ -252,11 +234,9 @@ func (*CodeInfo) ProtoMessage() {}
func (*CodeInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_e6155d98fa173e02, []int{3}
}
-
func (m *CodeInfo) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *CodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_CodeInfo.Marshal(b, m, deterministic)
@@ -269,15 +249,12 @@ func (m *CodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return b[:n], nil
}
}
-
func (m *CodeInfo) XXX_Merge(src proto.Message) {
xxx_messageInfo_CodeInfo.Merge(m, src)
}
-
func (m *CodeInfo) XXX_Size() int {
return m.Size()
}
-
func (m *CodeInfo) XXX_DiscardUnknown() {
xxx_messageInfo_CodeInfo.DiscardUnknown(m)
}
@@ -308,11 +285,9 @@ func (*ContractInfo) ProtoMessage() {}
func (*ContractInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_e6155d98fa173e02, []int{4}
}
-
func (m *ContractInfo) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *ContractInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ContractInfo.Marshal(b, m, deterministic)
@@ -325,15 +300,12 @@ func (m *ContractInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
return b[:n], nil
}
}
-
func (m *ContractInfo) XXX_Merge(src proto.Message) {
xxx_messageInfo_ContractInfo.Merge(m, src)
}
-
func (m *ContractInfo) XXX_Size() int {
return m.Size()
}
-
func (m *ContractInfo) XXX_DiscardUnknown() {
xxx_messageInfo_ContractInfo.DiscardUnknown(m)
}
@@ -356,11 +328,9 @@ func (*ContractCodeHistoryEntry) ProtoMessage() {}
func (*ContractCodeHistoryEntry) Descriptor() ([]byte, []int) {
return fileDescriptor_e6155d98fa173e02, []int{5}
}
-
func (m *ContractCodeHistoryEntry) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *ContractCodeHistoryEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ContractCodeHistoryEntry.Marshal(b, m, deterministic)
@@ -373,15 +343,12 @@ func (m *ContractCodeHistoryEntry) XXX_Marshal(b []byte, deterministic bool) ([]
return b[:n], nil
}
}
-
func (m *ContractCodeHistoryEntry) XXX_Merge(src proto.Message) {
xxx_messageInfo_ContractCodeHistoryEntry.Merge(m, src)
}
-
func (m *ContractCodeHistoryEntry) XXX_Size() int {
return m.Size()
}
-
func (m *ContractCodeHistoryEntry) XXX_DiscardUnknown() {
xxx_messageInfo_ContractCodeHistoryEntry.DiscardUnknown(m)
}
@@ -404,11 +371,9 @@ func (*AbsoluteTxPosition) ProtoMessage() {}
func (*AbsoluteTxPosition) Descriptor() ([]byte, []int) {
return fileDescriptor_e6155d98fa173e02, []int{6}
}
-
func (m *AbsoluteTxPosition) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *AbsoluteTxPosition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_AbsoluteTxPosition.Marshal(b, m, deterministic)
@@ -421,15 +386,12 @@ func (m *AbsoluteTxPosition) XXX_Marshal(b []byte, deterministic bool) ([]byte,
return b[:n], nil
}
}
-
func (m *AbsoluteTxPosition) XXX_Merge(src proto.Message) {
xxx_messageInfo_AbsoluteTxPosition.Merge(m, src)
}
-
func (m *AbsoluteTxPosition) XXX_Size() int {
return m.Size()
}
-
func (m *AbsoluteTxPosition) XXX_DiscardUnknown() {
xxx_messageInfo_AbsoluteTxPosition.DiscardUnknown(m)
}
@@ -439,7 +401,7 @@ var xxx_messageInfo_AbsoluteTxPosition proto.InternalMessageInfo
// Model is a struct that holds a KV pair
type Model struct {
// hex-encode key to read it better (this is often ascii)
- Key github_com_tendermint_tendermint_libs_bytes.HexBytes `protobuf:"bytes,1,opt,name=key,proto3,casttype=github.com/tendermint/tendermint/libs/bytes.HexBytes" json:"key,omitempty"`
+ Key github_com_cometbft_cometbft_libs_bytes.HexBytes `protobuf:"bytes,1,opt,name=key,proto3,casttype=github.com/cometbft/cometbft/libs/bytes.HexBytes" json:"key,omitempty"`
// base64-encode raw value
Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}
@@ -450,11 +412,9 @@ func (*Model) ProtoMessage() {}
func (*Model) Descriptor() ([]byte, []int) {
return fileDescriptor_e6155d98fa173e02, []int{7}
}
-
func (m *Model) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
-
func (m *Model) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Model.Marshal(b, m, deterministic)
@@ -467,15 +427,12 @@ func (m *Model) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return b[:n], nil
}
}
-
func (m *Model) XXX_Merge(src proto.Message) {
xxx_messageInfo_Model.Merge(m, src)
}
-
func (m *Model) XXX_Size() int {
return m.Size()
}
-
func (m *Model) XXX_DiscardUnknown() {
xxx_messageInfo_Model.DiscardUnknown(m)
}
@@ -501,78 +458,78 @@ var fileDescriptor_e6155d98fa173e02 = []byte{
// 1182 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0xcf, 0x8f, 0xdb, 0xc4,
0x17, 0x8f, 0x93, 0xec, 0x8f, 0x4c, 0xf7, 0xdb, 0xaf, 0x3b, 0x6c, 0x69, 0x36, 0xac, 0x92, 0xd4,
- 0x94, 0xb2, 0xfd, 0x95, 0xd0, 0x05, 0x01, 0xea, 0xa1, 0x52, 0x7e, 0xb8, 0x5d, 0x57, 0x6c, 0x1c,
- 0x4d, 0x52, 0xaa, 0x45, 0x2a, 0x96, 0x63, 0xcf, 0x66, 0xad, 0x3a, 0x9e, 0xc8, 0x33, 0xd9, 0xc6,
- 0xff, 0x01, 0x8a, 0x84, 0xe0, 0xc8, 0x25, 0x12, 0x02, 0x84, 0xca, 0x9d, 0x3f, 0xa2, 0x02, 0x09,
- 0xf5, 0xc8, 0x29, 0x82, 0xed, 0x85, 0x73, 0x8e, 0xe5, 0x82, 0x3c, 0x13, 0x37, 0xa6, 0xed, 0x76,
- 0xc3, 0xc5, 0x9a, 0x79, 0xef, 0x7d, 0x3e, 0xef, 0xbd, 0xcf, 0xcc, 0x1b, 0x19, 0x6c, 0x5a, 0x84,
- 0xf6, 0x1e, 0x9a, 0xb4, 0x57, 0xe6, 0x9f, 0xc3, 0xeb, 0x65, 0x16, 0xf4, 0x31, 0x2d, 0xf5, 0x7d,
- 0xc2, 0x08, 0x94, 0x23, 0x6f, 0x89, 0x7f, 0x0e, 0xaf, 0xe7, 0x36, 0x42, 0x0b, 0xa1, 0x06, 0xf7,
- 0x97, 0xc5, 0x46, 0x04, 0xe7, 0xd6, 0xbb, 0xa4, 0x4b, 0x84, 0x3d, 0x5c, 0xcd, 0xac, 0x1b, 0x5d,
- 0x42, 0xba, 0x2e, 0x2e, 0xf3, 0x5d, 0x67, 0xb0, 0x5f, 0x36, 0xbd, 0x40, 0xb8, 0x94, 0xfb, 0xe0,
- 0xff, 0x15, 0xcb, 0xc2, 0x94, 0xb6, 0x83, 0x3e, 0x6e, 0x9a, 0xbe, 0xd9, 0x83, 0x75, 0xb0, 0x74,
- 0x68, 0xba, 0x03, 0x9c, 0x95, 0x8a, 0xd2, 0xd6, 0xe9, 0xed, 0xcd, 0xd2, 0x8b, 0x05, 0x94, 0xe6,
- 0x88, 0xaa, 0x3c, 0x9d, 0x14, 0xd6, 0x02, 0xb3, 0xe7, 0xde, 0x50, 0x38, 0x48, 0x41, 0x02, 0x7c,
- 0x23, 0xfd, 0xcd, 0xb7, 0x05, 0x49, 0xf9, 0x55, 0x02, 0x6b, 0x22, 0xba, 0x46, 0xbc, 0x7d, 0xa7,
- 0x0b, 0x5b, 0x00, 0xf4, 0xb1, 0xdf, 0x73, 0x28, 0x75, 0x88, 0xb7, 0x50, 0x86, 0xb3, 0xd3, 0x49,
- 0xe1, 0x8c, 0xc8, 0x30, 0x47, 0x2a, 0x28, 0x46, 0x03, 0xaf, 0x82, 0x15, 0xd3, 0xb6, 0x7d, 0x4c,
- 0x69, 0x36, 0x59, 0x94, 0xb6, 0x32, 0x55, 0x38, 0x9d, 0x14, 0x4e, 0x0b, 0xcc, 0xcc, 0xa1, 0xa0,
- 0x28, 0x04, 0x6e, 0x83, 0xcc, 0x6c, 0x89, 0x69, 0x36, 0x55, 0x4c, 0x6d, 0x65, 0xaa, 0xeb, 0xd3,
- 0x49, 0x41, 0xfe, 0x57, 0x3c, 0xa6, 0x0a, 0x9a, 0x87, 0xcd, 0xba, 0xf9, 0x2a, 0x09, 0x96, 0xb9,
- 0x46, 0x14, 0x12, 0x00, 0x2d, 0x62, 0x63, 0x63, 0xd0, 0x77, 0x89, 0x69, 0x1b, 0x26, 0xaf, 0x97,
- 0xf7, 0x73, 0x6a, 0x3b, 0x7f, 0x5c, 0x3f, 0x42, 0x83, 0xea, 0xf9, 0xc7, 0x93, 0x42, 0x62, 0x3a,
- 0x29, 0x6c, 0x88, 0x8c, 0x2f, 0xf3, 0x28, 0x48, 0x0e, 0x8d, 0x77, 0xb9, 0x4d, 0x40, 0xe1, 0x97,
- 0x12, 0xc8, 0x3b, 0x1e, 0x65, 0xa6, 0xc7, 0x1c, 0x93, 0x61, 0xc3, 0xc6, 0xfb, 0xe6, 0xc0, 0x65,
- 0x46, 0x4c, 0xcd, 0xe4, 0x02, 0x6a, 0x5e, 0x9a, 0x4e, 0x0a, 0xef, 0x88, 0xbc, 0xaf, 0x67, 0x53,
- 0xd0, 0x66, 0x2c, 0xa0, 0x2e, 0xfc, 0xcd, 0xe7, 0x6e, 0xae, 0x48, 0x42, 0xf9, 0x4e, 0x02, 0xab,
- 0x35, 0x62, 0x63, 0xcd, 0xdb, 0x27, 0xf0, 0x2d, 0x90, 0xe1, 0xbd, 0x1c, 0x98, 0xf4, 0x80, 0x4b,
- 0xb1, 0x86, 0x56, 0x43, 0xc3, 0x8e, 0x49, 0x0f, 0x60, 0x16, 0xac, 0x58, 0x3e, 0x36, 0x19, 0xf1,
- 0xc5, 0x19, 0xa1, 0x68, 0x0b, 0x5b, 0x00, 0xc6, 0x4b, 0xb1, 0xb8, 0x48, 0xd9, 0xa5, 0x85, 0xa4,
- 0x4c, 0x87, 0x52, 0xa2, 0x33, 0x31, 0xbc, 0x70, 0xdc, 0x49, 0xaf, 0xa6, 0xe4, 0xf4, 0x9d, 0xf4,
- 0x6a, 0x5a, 0x5e, 0x52, 0x7e, 0x4b, 0x82, 0xb5, 0x1a, 0xf1, 0x98, 0x6f, 0x5a, 0x8c, 0x17, 0xfa,
- 0x36, 0x58, 0xe1, 0x85, 0x3a, 0x36, 0x2f, 0x33, 0x5d, 0x05, 0x47, 0x93, 0xc2, 0x32, 0xef, 0xa3,
- 0x8e, 0x96, 0x43, 0x97, 0x66, 0xbf, 0xa6, 0xe0, 0x75, 0xb0, 0x64, 0xda, 0x3d, 0xc7, 0xcb, 0xa6,
- 0xb8, 0x5d, 0x6c, 0x42, 0xab, 0x6b, 0x76, 0xb0, 0x9b, 0x4d, 0x0b, 0x2b, 0xdf, 0xc0, 0x9b, 0x33,
- 0x16, 0x6c, 0xcf, 0x3a, 0xba, 0xf0, 0x8a, 0x8e, 0x3a, 0x94, 0xb8, 0x03, 0x86, 0xdb, 0xc3, 0x26,
- 0xa1, 0x0e, 0x73, 0x88, 0x87, 0x22, 0x10, 0xbc, 0x06, 0x4e, 0x39, 0x1d, 0xcb, 0xe8, 0x13, 0x9f,
- 0x85, 0xe5, 0x2e, 0xf3, 0xeb, 0xfd, 0xbf, 0xa3, 0x49, 0x21, 0xa3, 0x55, 0x6b, 0x4d, 0xe2, 0x33,
- 0xad, 0x8e, 0x32, 0x4e, 0xc7, 0xe2, 0x4b, 0x1b, 0x7e, 0x0e, 0x32, 0x78, 0xc8, 0xb0, 0xc7, 0xef,
- 0xc3, 0x0a, 0x4f, 0xb8, 0x5e, 0x12, 0xd3, 0x5f, 0x8a, 0xa6, 0xbf, 0x54, 0xf1, 0x82, 0xea, 0xe5,
- 0x5f, 0x7e, 0xbe, 0x76, 0xf1, 0xa5, 0x4a, 0xe2, 0x2a, 0xa9, 0x11, 0x0f, 0x9a, 0x53, 0xde, 0x48,
- 0xff, 0x15, 0xce, 0xc1, 0xdf, 0x12, 0xc8, 0x46, 0xa1, 0xa1, 0x6a, 0x3b, 0x0e, 0x65, 0xc4, 0x0f,
- 0x54, 0x8f, 0xf9, 0x01, 0x6c, 0x82, 0x0c, 0xe9, 0x63, 0xdf, 0x64, 0xf3, 0x01, 0xdf, 0x2e, 0x1d,
- 0x9b, 0x29, 0x06, 0xd7, 0x23, 0x54, 0x78, 0x51, 0xd1, 0x9c, 0x24, 0x7e, 0x5c, 0xc9, 0x63, 0x8f,
- 0xeb, 0x26, 0x58, 0x19, 0xf4, 0x6d, 0x2e, 0x74, 0xea, 0xbf, 0x08, 0x3d, 0x03, 0xc1, 0x2d, 0x90,
- 0xea, 0xd1, 0x2e, 0x3f, 0xbc, 0xb5, 0xea, 0x9b, 0xcf, 0x26, 0x05, 0x88, 0xcc, 0x87, 0x51, 0x95,
- 0xbb, 0x98, 0x52, 0xb3, 0x8b, 0x51, 0x18, 0xa2, 0x20, 0x00, 0x5f, 0x26, 0x82, 0xe7, 0xc1, 0x5a,
- 0xc7, 0x25, 0xd6, 0x03, 0xe3, 0x00, 0x3b, 0xdd, 0x03, 0x26, 0x2e, 0x16, 0x3a, 0xc5, 0x6d, 0x3b,
- 0xdc, 0x04, 0x37, 0xc0, 0x2a, 0x1b, 0x1a, 0x8e, 0x67, 0xe3, 0xa1, 0x68, 0x04, 0xad, 0xb0, 0xa1,
- 0x16, 0x6e, 0x15, 0x07, 0x2c, 0xed, 0x12, 0x1b, 0xbb, 0xf0, 0x0e, 0x48, 0x3d, 0xc0, 0x81, 0x98,
- 0x9e, 0xea, 0xc7, 0xcf, 0x26, 0x85, 0x0f, 0xba, 0x0e, 0x3b, 0x18, 0x74, 0x4a, 0x16, 0xe9, 0x95,
- 0x19, 0xf6, 0xec, 0x70, 0x02, 0x3d, 0x16, 0x5f, 0xba, 0x4e, 0x87, 0x96, 0x3b, 0x01, 0xc3, 0xb4,
- 0xb4, 0x83, 0x87, 0xd5, 0x70, 0x81, 0x42, 0x92, 0xf0, 0x46, 0x8a, 0x87, 0x3c, 0xc9, 0x67, 0x51,
- 0x6c, 0x2e, 0xff, 0x94, 0x04, 0x60, 0xfe, 0x20, 0xc0, 0x0f, 0xc1, 0xb9, 0x4a, 0xad, 0xa6, 0xb6,
- 0x5a, 0x46, 0x7b, 0xaf, 0xa9, 0x1a, 0x77, 0x1b, 0xad, 0xa6, 0x5a, 0xd3, 0x6e, 0x69, 0x6a, 0x5d,
- 0x4e, 0xe4, 0x36, 0x46, 0xe3, 0xe2, 0xd9, 0x79, 0xf0, 0x5d, 0x8f, 0xf6, 0xb1, 0xe5, 0xec, 0x3b,
- 0xd8, 0x86, 0x57, 0x01, 0x8c, 0xe3, 0x1a, 0x7a, 0x55, 0xaf, 0xef, 0xc9, 0x52, 0x6e, 0x7d, 0x34,
- 0x2e, 0xca, 0x73, 0x48, 0x83, 0x74, 0x88, 0x1d, 0xc0, 0x8f, 0x40, 0x36, 0x1e, 0xad, 0x37, 0x3e,
- 0xd9, 0x33, 0x2a, 0xf5, 0x3a, 0x52, 0x5b, 0x2d, 0x39, 0xf9, 0x62, 0x1a, 0xdd, 0x73, 0x83, 0xca,
- 0xf3, 0xc7, 0xfa, 0x6c, 0x1c, 0xa8, 0x7e, 0xaa, 0xa2, 0x3d, 0x9e, 0x29, 0x95, 0x3b, 0x37, 0x1a,
- 0x17, 0xdf, 0x98, 0xa3, 0xd4, 0x43, 0xec, 0x07, 0x3c, 0xd9, 0x4d, 0xb0, 0x19, 0xc7, 0x54, 0x1a,
- 0x7b, 0x86, 0x7e, 0x2b, 0x4a, 0xa7, 0xb6, 0xe4, 0x74, 0x6e, 0x73, 0x34, 0x2e, 0x66, 0xe7, 0xd0,
- 0x8a, 0x17, 0xe8, 0xfb, 0x95, 0xe8, 0xb1, 0xcf, 0xad, 0x7e, 0xf1, 0x7d, 0x3e, 0xf1, 0xe8, 0x87,
- 0x7c, 0xe2, 0xf2, 0x8f, 0x29, 0x50, 0x3c, 0xe9, 0xa6, 0x42, 0x0c, 0xde, 0xab, 0xe9, 0x8d, 0x36,
- 0xaa, 0xd4, 0xda, 0x46, 0x4d, 0xaf, 0xab, 0xc6, 0x8e, 0xd6, 0x6a, 0xeb, 0x68, 0xcf, 0xd0, 0x9b,
- 0x2a, 0xaa, 0xb4, 0x35, 0xbd, 0xf1, 0x2a, 0x69, 0xcb, 0xa3, 0x71, 0xf1, 0xca, 0x49, 0xdc, 0x71,
- 0xc1, 0xef, 0x81, 0x4b, 0x0b, 0xa5, 0xd1, 0x1a, 0x5a, 0x5b, 0x96, 0x72, 0x5b, 0xa3, 0x71, 0xf1,
- 0xc2, 0x49, 0xfc, 0x9a, 0xe7, 0x30, 0x78, 0x1f, 0x5c, 0x5d, 0x88, 0x78, 0x57, 0xbb, 0x8d, 0x2a,
- 0x6d, 0x55, 0x4e, 0xe6, 0xae, 0x8c, 0xc6, 0xc5, 0x77, 0x4f, 0xe2, 0xde, 0x75, 0xba, 0xbe, 0xc9,
- 0xf0, 0xc2, 0xf4, 0xb7, 0xd5, 0x86, 0xda, 0xd2, 0x5a, 0x72, 0x6a, 0x31, 0xfa, 0xdb, 0xd8, 0xc3,
- 0xd4, 0xa1, 0xb9, 0x74, 0x78, 0x58, 0xd5, 0x9d, 0xc7, 0x7f, 0xe6, 0x13, 0x8f, 0x8e, 0xf2, 0xd2,
- 0xe3, 0xa3, 0xbc, 0xf4, 0xe4, 0x28, 0x2f, 0xfd, 0x71, 0x94, 0x97, 0xbe, 0x7e, 0x9a, 0x4f, 0x3c,
- 0x79, 0x9a, 0x4f, 0xfc, 0xfe, 0x34, 0x9f, 0xf8, 0xec, 0x62, 0x6c, 0x8e, 0x6a, 0x84, 0xf6, 0xee,
- 0x45, 0xff, 0x5b, 0x76, 0x79, 0x28, 0xfe, 0xbb, 0xf8, 0x4f, 0x57, 0x67, 0x99, 0x3f, 0x93, 0xef,
- 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0x7b, 0xae, 0x51, 0x21, 0x95, 0x09, 0x00, 0x00,
+ 0x94, 0xb2, 0xfd, 0x95, 0xb4, 0x0b, 0x02, 0xa9, 0x87, 0x4a, 0xf9, 0xe1, 0x76, 0x5d, 0xb1, 0x49,
+ 0x34, 0x49, 0xa9, 0x16, 0xa9, 0x58, 0x8e, 0x3d, 0xc9, 0x5a, 0x75, 0x3c, 0x91, 0x67, 0xb2, 0x8d,
+ 0xff, 0x03, 0x14, 0x09, 0xc1, 0x91, 0x4b, 0x24, 0x04, 0x08, 0x95, 0x3b, 0x7f, 0x44, 0x05, 0x12,
+ 0xea, 0x91, 0x53, 0x04, 0xdb, 0x0b, 0xe7, 0x3d, 0x96, 0x0b, 0xf2, 0x4c, 0x5c, 0x9b, 0xb6, 0xdb,
+ 0x0d, 0x17, 0x6b, 0xe6, 0xbd, 0xf7, 0xf9, 0xbc, 0xf7, 0x3e, 0x33, 0x6f, 0x64, 0xb0, 0x69, 0x12,
+ 0x3a, 0x78, 0x64, 0xd0, 0x41, 0x99, 0x7f, 0x0e, 0x6e, 0x94, 0x99, 0x3f, 0xc4, 0xb4, 0x34, 0xf4,
+ 0x08, 0x23, 0x50, 0x0e, 0xbd, 0x25, 0xfe, 0x39, 0xb8, 0x91, 0xdb, 0x08, 0x2c, 0x84, 0xea, 0xdc,
+ 0x5f, 0x16, 0x1b, 0x11, 0x9c, 0x5b, 0xef, 0x93, 0x3e, 0x11, 0xf6, 0x60, 0x35, 0xb7, 0x6e, 0xf4,
+ 0x09, 0xe9, 0x3b, 0xb8, 0xcc, 0x77, 0xdd, 0x51, 0xaf, 0x6c, 0xb8, 0xbe, 0x70, 0x29, 0x0f, 0xc0,
+ 0xff, 0x2b, 0xa6, 0x89, 0x29, 0xed, 0xf8, 0x43, 0xdc, 0x32, 0x3c, 0x63, 0x00, 0xeb, 0x60, 0xe9,
+ 0xc0, 0x70, 0x46, 0x38, 0x2b, 0x15, 0xa5, 0xad, 0xd3, 0xdb, 0x9b, 0xa5, 0x97, 0x0b, 0x28, 0x45,
+ 0x88, 0xaa, 0x7c, 0x34, 0x2b, 0xac, 0xf9, 0xc6, 0xc0, 0xb9, 0xa9, 0x70, 0x90, 0x82, 0x04, 0xf8,
+ 0x66, 0xfa, 0x9b, 0x6f, 0x0b, 0x92, 0xf2, 0xab, 0x04, 0xd6, 0x44, 0x74, 0x8d, 0xb8, 0x3d, 0xbb,
+ 0x0f, 0xdb, 0x00, 0x0c, 0xb1, 0x37, 0xb0, 0x29, 0xb5, 0x89, 0xbb, 0x50, 0x86, 0xb3, 0x47, 0xb3,
+ 0xc2, 0x19, 0x91, 0x21, 0x42, 0x2a, 0x28, 0x46, 0x03, 0xaf, 0x82, 0x15, 0xc3, 0xb2, 0x3c, 0x4c,
+ 0x69, 0x36, 0x59, 0x94, 0xb6, 0x32, 0x55, 0x78, 0x34, 0x2b, 0x9c, 0x16, 0x98, 0xb9, 0x43, 0x41,
+ 0x61, 0x08, 0xdc, 0x06, 0x99, 0xf9, 0x12, 0xd3, 0x6c, 0xaa, 0x98, 0xda, 0xca, 0x54, 0xd7, 0x8f,
+ 0x66, 0x05, 0xf9, 0x5f, 0xf1, 0x98, 0x2a, 0x28, 0x0a, 0x9b, 0x77, 0xf3, 0x55, 0x12, 0x2c, 0x73,
+ 0x8d, 0x28, 0x24, 0x00, 0x9a, 0xc4, 0xc2, 0xfa, 0x68, 0xe8, 0x10, 0xc3, 0xd2, 0x0d, 0x5e, 0x2f,
+ 0xef, 0xe7, 0xd4, 0x76, 0xfe, 0xb8, 0x7e, 0x84, 0x06, 0xd5, 0xf3, 0x4f, 0x66, 0x85, 0xc4, 0xd1,
+ 0xac, 0xb0, 0x21, 0x32, 0xbe, 0xca, 0xa3, 0x20, 0x39, 0x30, 0xde, 0xe3, 0x36, 0x01, 0x85, 0x5f,
+ 0x4a, 0x20, 0x6f, 0xbb, 0x94, 0x19, 0x2e, 0xb3, 0x0d, 0x86, 0x75, 0x0b, 0xf7, 0x8c, 0x91, 0xc3,
+ 0xf4, 0x98, 0x9a, 0xc9, 0x05, 0xd4, 0xbc, 0x74, 0x34, 0x2b, 0xbc, 0x27, 0xf2, 0xbe, 0x99, 0x4d,
+ 0x41, 0x9b, 0xb1, 0x80, 0xba, 0xf0, 0xb7, 0x5e, 0xb8, 0xb9, 0x22, 0x09, 0xe5, 0x3b, 0x09, 0xac,
+ 0xd6, 0x88, 0x85, 0x35, 0xb7, 0x47, 0xe0, 0x3b, 0x20, 0xc3, 0x7b, 0xd9, 0x37, 0xe8, 0x3e, 0x97,
+ 0x62, 0x0d, 0xad, 0x06, 0x86, 0x1d, 0x83, 0xee, 0xc3, 0x2c, 0x58, 0x31, 0x3d, 0x6c, 0x30, 0xe2,
+ 0x89, 0x33, 0x42, 0xe1, 0x16, 0xb6, 0x01, 0x8c, 0x97, 0x62, 0x72, 0x91, 0xb2, 0x4b, 0x0b, 0x49,
+ 0x99, 0x0e, 0xa4, 0x44, 0x67, 0x62, 0x78, 0xe1, 0xb8, 0x9b, 0x5e, 0x4d, 0xc9, 0xe9, 0xbb, 0xe9,
+ 0xd5, 0xb4, 0xbc, 0xa4, 0xfc, 0x96, 0x04, 0x6b, 0x35, 0xe2, 0x32, 0xcf, 0x30, 0x19, 0x2f, 0xf4,
+ 0x5d, 0xb0, 0xc2, 0x0b, 0xb5, 0x2d, 0x5e, 0x66, 0xba, 0x0a, 0x0e, 0x67, 0x85, 0x65, 0xde, 0x47,
+ 0x1d, 0x2d, 0x07, 0x2e, 0xcd, 0x7a, 0x43, 0xc1, 0xeb, 0x60, 0xc9, 0xb0, 0x06, 0xb6, 0x9b, 0x4d,
+ 0x71, 0xbb, 0xd8, 0x04, 0x56, 0xc7, 0xe8, 0x62, 0x27, 0x9b, 0x16, 0x56, 0xbe, 0x81, 0xb7, 0xe6,
+ 0x2c, 0xd8, 0x9a, 0x77, 0x74, 0xe1, 0x35, 0x1d, 0x75, 0x29, 0x71, 0x46, 0x0c, 0x77, 0xc6, 0x2d,
+ 0x42, 0x6d, 0x66, 0x13, 0x17, 0x85, 0x20, 0x78, 0x0d, 0x9c, 0xb2, 0xbb, 0xa6, 0x3e, 0x24, 0x1e,
+ 0x0b, 0xca, 0x5d, 0xe6, 0xd7, 0xfb, 0x7f, 0x87, 0xb3, 0x42, 0x46, 0xab, 0xd6, 0x5a, 0xc4, 0x63,
+ 0x5a, 0x1d, 0x65, 0xec, 0xae, 0xc9, 0x97, 0x16, 0xfc, 0x1c, 0x64, 0xf0, 0x98, 0x61, 0x97, 0xdf,
+ 0x87, 0x15, 0x9e, 0x70, 0xbd, 0x24, 0xa6, 0xbf, 0x14, 0x4e, 0x7f, 0xa9, 0xe2, 0xfa, 0xd5, 0xcb,
+ 0xbf, 0xfc, 0x7c, 0xed, 0xe2, 0x2b, 0x95, 0xc4, 0x55, 0x52, 0x43, 0x1e, 0x14, 0x51, 0xde, 0x4c,
+ 0xff, 0x15, 0xcc, 0xc1, 0xdf, 0x12, 0xc8, 0x86, 0xa1, 0x81, 0x6a, 0x3b, 0x36, 0x65, 0xc4, 0xf3,
+ 0x55, 0x97, 0x79, 0x3e, 0x6c, 0x81, 0x0c, 0x19, 0x62, 0xcf, 0x60, 0xd1, 0x80, 0x6f, 0x97, 0x8e,
+ 0xcd, 0x14, 0x83, 0x37, 0x43, 0x54, 0x70, 0x51, 0x51, 0x44, 0x12, 0x3f, 0xae, 0xe4, 0xb1, 0xc7,
+ 0x75, 0x0b, 0xac, 0x8c, 0x86, 0x16, 0x17, 0x3a, 0xf5, 0x5f, 0x84, 0x9e, 0x83, 0xe0, 0x16, 0x48,
+ 0x0d, 0x68, 0x9f, 0x1f, 0xde, 0x5a, 0xf5, 0xed, 0xe7, 0xb3, 0x02, 0x44, 0xc6, 0xa3, 0xb0, 0xca,
+ 0x5d, 0x4c, 0xa9, 0xd1, 0xc7, 0x28, 0x08, 0x51, 0x10, 0x80, 0xaf, 0x12, 0xc1, 0xf3, 0x60, 0xad,
+ 0xeb, 0x10, 0xf3, 0xa1, 0xbe, 0x8f, 0xed, 0xfe, 0x3e, 0x13, 0x17, 0x0b, 0x9d, 0xe2, 0xb6, 0x1d,
+ 0x6e, 0x82, 0x1b, 0x60, 0x95, 0x8d, 0x75, 0xdb, 0xb5, 0xf0, 0x58, 0x34, 0x82, 0x56, 0xd8, 0x58,
+ 0x0b, 0xb6, 0x0a, 0x06, 0x4b, 0xbb, 0xc4, 0xc2, 0x0e, 0xbc, 0x0d, 0x52, 0x0f, 0xb1, 0x2f, 0xa6,
+ 0xa7, 0xfa, 0xe1, 0xf3, 0x59, 0xe1, 0x7a, 0xdf, 0x66, 0xfb, 0xa3, 0x6e, 0xc9, 0x24, 0x83, 0xb2,
+ 0x49, 0x06, 0x98, 0x75, 0x7b, 0x2c, 0x5a, 0x38, 0x76, 0x97, 0x96, 0xbb, 0x3e, 0xc3, 0xb4, 0xb4,
+ 0x83, 0xc7, 0xd5, 0x60, 0x81, 0x02, 0x82, 0xe0, 0x36, 0x8a, 0x47, 0x3c, 0xc9, 0xe7, 0x50, 0x6c,
+ 0x2e, 0xff, 0x94, 0x04, 0x20, 0x7a, 0x0c, 0xe0, 0x47, 0xe0, 0x5c, 0xa5, 0x56, 0x53, 0xdb, 0x6d,
+ 0xbd, 0xb3, 0xd7, 0x52, 0xf5, 0x7b, 0x8d, 0x76, 0x4b, 0xad, 0x69, 0xb7, 0x35, 0xb5, 0x2e, 0x27,
+ 0x72, 0x1b, 0x93, 0x69, 0xf1, 0x6c, 0x14, 0x7c, 0xcf, 0xa5, 0x43, 0x6c, 0xda, 0x3d, 0x1b, 0x5b,
+ 0xf0, 0x2a, 0x80, 0x71, 0x5c, 0xa3, 0x59, 0x6d, 0xd6, 0xf7, 0x64, 0x29, 0xb7, 0x3e, 0x99, 0x16,
+ 0xe5, 0x08, 0xd2, 0x20, 0x5d, 0x62, 0xf9, 0xf0, 0x63, 0x90, 0x8d, 0x47, 0x37, 0x1b, 0x9f, 0xec,
+ 0xe9, 0x95, 0x7a, 0x1d, 0xa9, 0xed, 0xb6, 0x9c, 0x7c, 0x39, 0x4d, 0xd3, 0x75, 0xfc, 0xca, 0x8b,
+ 0x87, 0xfa, 0x6c, 0x1c, 0xa8, 0x7e, 0xaa, 0xa2, 0x3d, 0x9e, 0x29, 0x95, 0x3b, 0x37, 0x99, 0x16,
+ 0xdf, 0x8a, 0x50, 0xea, 0x01, 0xf6, 0x7c, 0x9e, 0xec, 0x16, 0xd8, 0x8c, 0x63, 0x2a, 0x8d, 0x3d,
+ 0xbd, 0x79, 0x3b, 0x4c, 0xa7, 0xb6, 0xe5, 0x74, 0x6e, 0x73, 0x32, 0x2d, 0x66, 0x23, 0x68, 0xc5,
+ 0xf5, 0x9b, 0xbd, 0x4a, 0xf8, 0xd0, 0xe7, 0x56, 0xbf, 0xf8, 0x3e, 0x9f, 0x78, 0xfc, 0x43, 0x3e,
+ 0x71, 0xf9, 0xc7, 0x14, 0x28, 0x9e, 0x74, 0x4b, 0x21, 0x06, 0xd7, 0x6b, 0xcd, 0x46, 0x07, 0x55,
+ 0x6a, 0x1d, 0xbd, 0xd6, 0xac, 0xab, 0xfa, 0x8e, 0xd6, 0xee, 0x34, 0xd1, 0x9e, 0xde, 0x6c, 0xa9,
+ 0xa8, 0xd2, 0xd1, 0x9a, 0x8d, 0xd7, 0x49, 0x5b, 0x9e, 0x4c, 0x8b, 0x57, 0x4e, 0xe2, 0x8e, 0x0b,
+ 0x7e, 0x1f, 0x5c, 0x5a, 0x28, 0x8d, 0xd6, 0xd0, 0x3a, 0xb2, 0x94, 0xdb, 0x9a, 0x4c, 0x8b, 0x17,
+ 0x4e, 0xe2, 0xd7, 0x5c, 0x9b, 0xc1, 0x07, 0xe0, 0xea, 0x42, 0xc4, 0xbb, 0xda, 0x1d, 0x54, 0xe9,
+ 0xa8, 0x72, 0x32, 0x77, 0x65, 0x32, 0x2d, 0xbe, 0x7f, 0x12, 0xf7, 0xae, 0xdd, 0xf7, 0x0c, 0x86,
+ 0x17, 0xa6, 0xbf, 0xa3, 0x36, 0xd4, 0xb6, 0xd6, 0x96, 0x53, 0x8b, 0xd1, 0xdf, 0xc1, 0x2e, 0xa6,
+ 0x36, 0xcd, 0xa5, 0x83, 0xc3, 0xaa, 0xee, 0x3c, 0xf9, 0x33, 0x9f, 0x78, 0x7c, 0x98, 0x97, 0x9e,
+ 0x1c, 0xe6, 0xa5, 0xa7, 0x87, 0x79, 0xe9, 0x8f, 0xc3, 0xbc, 0xf4, 0xf5, 0xb3, 0x7c, 0xe2, 0xe9,
+ 0xb3, 0x7c, 0xe2, 0xf7, 0x67, 0xf9, 0xc4, 0x67, 0x17, 0x63, 0x33, 0x54, 0x23, 0x74, 0x70, 0x3f,
+ 0xfc, 0xd7, 0xb2, 0xca, 0x63, 0xf1, 0xcf, 0xc5, 0x7f, 0xb8, 0xba, 0xcb, 0xfc, 0x89, 0xfc, 0xe0,
+ 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x32, 0xe6, 0x7c, 0xdd, 0x91, 0x09, 0x00, 0x00,
}
func (this *AccessTypeParam) Equal(that interface{}) bool {
@@ -599,7 +556,6 @@ func (this *AccessTypeParam) Equal(that interface{}) bool {
}
return true
}
-
func (this *AccessConfig) Equal(that interface{}) bool {
if that == nil {
return this == nil
@@ -635,7 +591,6 @@ func (this *AccessConfig) Equal(that interface{}) bool {
}
return true
}
-
func (this *Params) Equal(that interface{}) bool {
if that == nil {
return this == nil
@@ -663,7 +618,6 @@ func (this *Params) Equal(that interface{}) bool {
}
return true
}
-
func (this *CodeInfo) Equal(that interface{}) bool {
if that == nil {
return this == nil
@@ -694,7 +648,6 @@ func (this *CodeInfo) Equal(that interface{}) bool {
}
return true
}
-
func (this *ContractInfo) Equal(that interface{}) bool {
if that == nil {
return this == nil
@@ -737,7 +690,6 @@ func (this *ContractInfo) Equal(that interface{}) bool {
}
return true
}
-
func (this *ContractCodeHistoryEntry) Equal(that interface{}) bool {
if that == nil {
return this == nil
@@ -771,7 +723,6 @@ func (this *ContractCodeHistoryEntry) Equal(that interface{}) bool {
}
return true
}
-
func (this *AbsoluteTxPosition) Equal(that interface{}) bool {
if that == nil {
return this == nil
@@ -799,7 +750,6 @@ func (this *AbsoluteTxPosition) Equal(that interface{}) bool {
}
return true
}
-
func (this *Model) Equal(that interface{}) bool {
if that == nil {
return this == nil
@@ -827,7 +777,6 @@ func (this *Model) Equal(that interface{}) bool {
}
return true
}
-
func (m *AccessTypeParam) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@@ -1198,7 +1147,6 @@ func encodeVarintTypes(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
return base
}
-
func (m *AccessTypeParam) Size() (n int) {
if m == nil {
return 0
@@ -1360,11 +1308,9 @@ func (m *Model) Size() (n int) {
func sovTypes(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
-
func sozTypes(x uint64) (n int) {
return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
-
func (m *AccessTypeParam) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -1434,7 +1380,6 @@ func (m *AccessTypeParam) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *AccessConfig) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -1568,7 +1513,6 @@ func (m *AccessConfig) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *Params) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -1671,7 +1615,6 @@ func (m *Params) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *CodeInfo) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -1821,7 +1764,6 @@ func (m *CodeInfo) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *ContractInfo) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -2091,7 +2033,6 @@ func (m *ContractInfo) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *ContractCodeHistoryEntry) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -2250,7 +2191,6 @@ func (m *ContractCodeHistoryEntry) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *AbsoluteTxPosition) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -2339,7 +2279,6 @@ func (m *AbsoluteTxPosition) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func (m *Model) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
@@ -2458,7 +2397,6 @@ func (m *Model) Unmarshal(dAtA []byte) error {
}
return nil
}
-
func skipTypes(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
diff --git a/x/wasm/types/types_test.go b/x/wasm/types/types_test.go
index 25df828023..5473e54eef 100644
--- a/x/wasm/types/types_test.go
+++ b/x/wasm/types/types_test.go
@@ -8,14 +8,13 @@ import (
"time"
wasmvmtypes "github.com/CosmWasm/wasmvm/types"
+ "github.com/cometbft/cometbft/libs/rand"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/types"
- codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
- govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
+ "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- "github.com/tendermint/tendermint/libs/rand"
)
func TestContractInfoValidateBasic(t *testing.T) {
@@ -33,7 +32,7 @@ func TestContractInfoValidateBasic(t *testing.T) {
expError: true,
},
"creator not an address": {
- srcMutator: func(c *ContractInfo) { c.Creator = "invalid address" },
+ srcMutator: func(c *ContractInfo) { c.Creator = invalidAddress },
expError: true,
},
"admin empty": {
@@ -41,7 +40,7 @@ func TestContractInfoValidateBasic(t *testing.T) {
expError: false,
},
"admin not an address": {
- srcMutator: func(c *ContractInfo) { c.Admin = "invalid address" },
+ srcMutator: func(c *ContractInfo) { c.Admin = invalidAddress },
expError: true,
},
"label empty": {
@@ -55,7 +54,7 @@ func TestContractInfoValidateBasic(t *testing.T) {
"invalid extension": {
srcMutator: func(c *ContractInfo) {
// any protobuf type with ValidateBasic method
- any, err := codectypes.NewAnyWithValue(&govtypes.TextProposal{})
+ any, err := types.NewAnyWithValue(&v1beta1.TextProposal{})
require.NoError(t, err)
c.Extension = any
},
@@ -64,7 +63,7 @@ func TestContractInfoValidateBasic(t *testing.T) {
"not validatable extension": {
srcMutator: func(c *ContractInfo) {
// any protobuf type with ValidateBasic method
- any, err := codectypes.NewAnyWithValue(&govtypes.Proposal{})
+ any, err := types.NewAnyWithValue(&v1beta1.Proposal{})
require.NoError(t, err)
c.Extension = any
},
@@ -127,7 +126,7 @@ func TestContractInfoSetExtension(t *testing.T) {
anyTime := time.Now().UTC()
aNestedProtobufExt := func() ContractInfoExtension {
// using gov proposal here as a random protobuf types as it contains an Any type inside for nested unpacking
- myExtension, err := govtypes.NewProposal(&govtypes.TextProposal{Title: "bar"}, 1, anyTime, anyTime)
+ myExtension, err := v1beta1.NewProposal(&v1beta1.TextProposal{Title: "bar"}, 1, anyTime, anyTime)
require.NoError(t, err)
myExtension.TotalDeposit = nil
return &myExtension
@@ -146,10 +145,10 @@ func TestContractInfoSetExtension(t *testing.T) {
expNil: true,
},
"validated and accepted": {
- src: &govtypes.TextProposal{Title: "bar", Description: "set"},
+ src: &v1beta1.TextProposal{Title: "bar", Description: "set"},
},
"validated and rejected": {
- src: &govtypes.TextProposal{Title: "bar"},
+ src: &v1beta1.TextProposal{Title: "bar"},
expErr: true,
},
}
@@ -178,7 +177,7 @@ func TestContractInfoMarshalUnmarshal(t *testing.T) {
anyTime := time.Now().UTC()
// using gov proposal here as a random protobuf types as it contains an Any type inside for nested unpacking
- myExtension, err := govtypes.NewProposal(&govtypes.TextProposal{Title: "bar"}, 1, anyTime, anyTime)
+ myExtension, err := v1beta1.NewProposal(&v1beta1.TextProposal{Title: "bar"}, 1, anyTime, anyTime)
require.NoError(t, err)
myExtension.TotalDeposit = nil
@@ -192,10 +191,10 @@ func TestContractInfoMarshalUnmarshal(t *testing.T) {
// register proposal as extension type
interfaceRegistry.RegisterImplementations(
(*ContractInfoExtension)(nil),
- &govtypes.Proposal{},
+ &v1beta1.Proposal{},
)
// register gov types for nested Anys
- govtypes.RegisterInterfaces(interfaceRegistry)
+ v1beta1.RegisterInterfaces(interfaceRegistry)
// when encode
bz, err := marshaler.Marshal(&src)
@@ -207,14 +206,14 @@ func TestContractInfoMarshalUnmarshal(t *testing.T) {
require.NoError(t, err)
assert.Equal(t, src, dest)
// and sanity check nested any
- var destExt govtypes.Proposal
+ var destExt v1beta1.Proposal
require.NoError(t, dest.ReadExtension(&destExt))
assert.Equal(t, destExt.GetTitle(), "bar")
}
func TestContractInfoReadExtension(t *testing.T) {
anyTime := time.Now().UTC()
- myExtension, err := govtypes.NewProposal(&govtypes.TextProposal{Title: "foo"}, 1, anyTime, anyTime)
+ myExtension, err := v1beta1.NewProposal(&v1beta1.TextProposal{Title: "foo"}, 1, anyTime, anyTime)
require.NoError(t, err)
type TestExtensionAsStruct struct {
ContractInfoExtension
@@ -228,10 +227,10 @@ func TestContractInfoReadExtension(t *testing.T) {
}{
"all good": {
setup: func(i *ContractInfo) {
- i.SetExtension(&myExtension)
+ i.SetExtension(&myExtension) //nolint:errcheck
},
param: func() ContractInfoExtension {
- return &govtypes.Proposal{}
+ return &v1beta1.Proposal{}
},
expVal: &myExtension,
},
@@ -239,13 +238,13 @@ func TestContractInfoReadExtension(t *testing.T) {
setup: func(i *ContractInfo) {
},
param: func() ContractInfoExtension {
- return &govtypes.Proposal{}
+ return &v1beta1.Proposal{}
},
- expVal: &govtypes.Proposal{},
+ expVal: &v1beta1.Proposal{},
},
"nil argument value": {
setup: func(i *ContractInfo) {
- i.SetExtension(&myExtension)
+ i.SetExtension(&myExtension) //nolint:errcheck
},
param: func() ContractInfoExtension {
return nil
@@ -254,10 +253,10 @@ func TestContractInfoReadExtension(t *testing.T) {
},
"non matching types": {
setup: func(i *ContractInfo) {
- i.SetExtension(&myExtension)
+ i.SetExtension(&myExtension) //nolint:errcheck
},
param: func() ContractInfoExtension {
- return &govtypes.TextProposal{}
+ return &v1beta1.TextProposal{}
},
expErr: true,
},