diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000000..17f252b30e --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @da1suk8 @dudong2 @loloicci @kokeshiM0chi diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 088cbc66e1..fa0d204637 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,5 +1,10 @@ version: 2 -updates: +updates: +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 - package-ecosystem: gomod directory: "/" schedule: diff --git a/.github/workflows/codeql-analizer.yml b/.github/workflows/codeql-analizer.yml index c1ee968796..67b8a1a44c 100644 --- a/.github/workflows/codeql-analizer.yml +++ b/.github/workflows/codeql-analizer.yml @@ -5,7 +5,7 @@ on: paths: - "**.go" push: - branches: [ master ] + branches: [ main ] paths: - "**.go" @@ -19,7 +19,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2.3.5 + uses: actions/checkout@v3.1.0 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/CHANGELOG.md b/CHANGELOG.md index 88e196c7a0..49bbaee9ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,21 +1,61 @@ # Changelog -## [Unreleased](https://github.com/line/wasmd/tree/HEAD) +## [Unreleased](https://github.com/Finschia/wasmd/compare/v0.1.3...HEAD) + +### Features + +### Improvements +* [\#36](https://github.com/Finschia/wasmd/pull/36) separate `x/wasm` into `x/wasmplus` module of dynamiclink + +### Bug Fixes +* [\#35](https://github.com/Finschia/wasmd/pull/35) stop wrap twice the response of handling non-plus wasm message in plus handler + +### Breaking Changes + +### Build, CI + +### Document Updates + + +## [v0.1.3](https://github.com/Finschia/wasmd/releases/tag/v0.1.3) - 2023.04.19 + ### Breaking Changes * [\#26](https://github.com/Finschia/wasmd/pull/26) implement CallCallablePoint and ValidateDynamicLinkInterface to cosmwasmAPI * [\#29](https://github.com/Finschia/wasmd/pull/29) remove getContractEnv from cosmwasmAPI +### Build, CI +* [\#30](https://github.com/Finschia/wasmd/pull/30) replace line repositories with finschia repositories + + +## [v0.1.2](https://github.com/Finschia/wasmd/releases/tag/v0.1.2) - 2023.04.10 + +### Features +* [\#21](https://github.com/Finschia/wasmd/pull/21) bump up Finschia/ibc-go v3.3.2 + + +## [v0.1.0](https://github.com/Finschia/wasmd/releases/tag/v0.1.0) - 2023.03.28 + +### Features +* [\#9](https://github.com/Finschia/wasmd/pull/9) apply the changes of finschia-sdk and ostracon proto + ### Improvements -* [\#1](https://github.com/line/wasmd/pull/1) apply all changes of `x/wasm` in lbm-sdk until [lbm-sdk@3bdcb6ffe01c81615bedb777ca0e039cc46ef00c](https://github.com/line/lbm-sdk/tree/3bdcb6ffe01c81615bedb777ca0e039cc46ef00c) -* [\#18](https://github.com/line/wasmd/pull/18) apply the wasm module of lbm-sdk(dynamic_link branch) +* [\#1](https://github.com/Finschia/wasmd/pull/1) apply all changes of `x/wasm` in finschia-sdk until [finschia-sdk@3bdcb6ffe01c81615bedb777ca0e039cc46ef00c](https://github.com/Finschia/finschia-sdk/tree/3bdcb6ffe01c81615bedb777ca0e039cc46ef00c) +* [\#5](https://github.com/Finschia/wasmd/pull/5) bump up wasmd v0.29.1 +* [\#7](https://github.com/Finschia/wasmd/pull/7) separate custom features in `x/wasm` into `x/wasmplus` module +* [\#8](https://github.com/Finschia/wasmd/pull/8) Bump Finschia/finschia-sdk to a7557b1d10 +* [\#10](https://github.com/Finschia/wasmd/pull/10) update wasmvm version +* [\#18](https://github.com/Finschia/wasmd/pull/18) apply the wasm module of finschia-sdk(dynamic_link branch) until [finschia-sdk@911e8b47774f142d70d5c696722b0291e39e0c0c](https://github.com/Finschia/finschia-sdk/tree/911e8b47774f142d70d5c696722b0291e39e0c0c) ### Bug Fixes +* [\#12](https://github.com/Finschia/wasmd/pull/12) fix not to register wrong codec in `x/wasmplus` +* [\#14](https://github.com/Finschia/wasmd/pull/14) fix the cmd error that does not recognize wasmvm library version ### Breaking Changes ### Build, CI ### Document Updates +* [\#2](https://github.com/Finschia/wasmd/pull/2) add wasm events description ## [cosmwasm/wasmd v0.27.0](https://github.com/CosmWasm/wasmd/blob/v0.27.0/CHANGELOG.md) (2022-05-19) diff --git a/COSMWASM_CHANGELOG.md b/COSMWASM_CHANGELOG.md index a718846617..51b4f965d8 100644 --- a/COSMWASM_CHANGELOG.md +++ b/COSMWASM_CHANGELOG.md @@ -1,8 +1,59 @@ # Changelog -## [Unreleased](https://github.com/CosmWasm/wasmd/tree/HEAD) +## [v0.29.0](https://github.com/CosmWasm/wasmd/tree/v0.29.0) (2022-10-10) + +[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.28.0...v0.29.0) +- Add dependencies for protobuf and remove third_party forlder [/#1030](https://github.com/CosmWasm/wasmd/pull/1030) +- Check wasmvm version on startup [\#1029](https://github.com/CosmWasm/wasmd/pull/1029/) +- Allow AccessConfig to use a list of addresses instead of just a single address [\#945](https://github.com/CosmWasm/wasmd/issues/945) +- Make contract addresses predictable \("deterministic"\) [\#942](https://github.com/CosmWasm/wasmd/issues/942) +- Add query for the total supply of a coin [\#903](https://github.com/CosmWasm/wasmd/pull/903) ([larry0x](https://github.com/larry0x)) +- Upgrade go to v1.18 [\#866](https://github.com/CosmWasm/wasmd/pull/866/) ([faddat](https://github.com/faddat)) +- Upgrade to ibc-go v3.3.0 REQUIRES [MIGRATION](https://github.com/cosmos/ibc-go/blob/v3.2.3/docs/migrations/support-denoms-with-slashes.md) [\#1016](https://github.com/CosmWasm/wasmd/pull/1016) +- Upgrade to cosmos-sdk v0.45.8 [\#964](https://github.com/CosmWasm/wasmd/pull/964/) ([faddat](https://github.com/faddat)) +- Upgrade wasmvm to v1.1.1 [\#1012](https://github.com/CosmWasm/wasmd/pull/1012), see [wasmvm v1.1.1](https://github.com/CosmWasm/wasmvm/releases/tag/v1.1.1) +- Add documentation how to add x/wasm to a new Cosmos SDK chain [\#876](https://github.com/CosmWasm/wasmd/issues/876) +- Upgrade keyring / go-keychain dependencies (removes deprecate warning) [\#957](https://github.com/CosmWasm/wasmd/issues/957) +- Make contract pinning an optional field in StoreCode proposals [\#972](https://github.com/CosmWasm/wasmd/issues/972) +- Add gRPC query for WASM params [\#889](https://github.com/CosmWasm/wasmd/issues/889) +- Expose Keepers in app.go? [\#881](https://github.com/CosmWasm/wasmd/issues/881) +- Remove unused `flagProposalType` flag in gov proposals [\#849](https://github.com/CosmWasm/wasmd/issues/849) +- Restrict code access config modifications [\#901](https://github.com/CosmWasm/wasmd/pull/901) +- Prevent migration to a restricted code [\#900](https://github.com/CosmWasm/wasmd/pull/900) +- Charge gas to unzip wasm code [\#898](https://github.com/CosmWasm/wasmd/pull/898) + +### Notable changes: +- BaseAccount and pruned vesting account types can be re-used for contracts addresses +- A new [MsgInstantiateContract2](https://github.com/CosmWasm/wasmd/pull/1014/files#diff-bf58b9da4b674719f07dd5421c532c1ead13a15f8896b59c1f724215d2064b73R75) was introduced which is an additional value for `message` type events +- Store event contains a new attribute with the code checksum now +- New `wasmd tx wasm instantiate2` CLI command for predictable addresses on instantiation +- New `cosmwasm_1_1` CosmWasm capability (former "feature") was introduced in [cosmwasm/#1356](https://github.com/CosmWasm/cosmwasm/pull/1356) to support total supply queries +- Protobuf files are published to [buf.build](https://buf.build/cosmwasm/wasmd/docs/main:cosmwasm.wasm.v1) + +### Migration notes: +- See ibc-go [migration notes](https://github.com/cosmos/ibc-go/blob/v3.3.0/docs/migrations/support-denoms-with-slashes.md) + + +## [v0.28.0](https://github.com/CosmWasm/wasmd/tree/v0.28.0) (2022-07-29) + +[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.27.0...v0.28.0) + +**API Breaking** + +No + +**Fixed Bugs** + +- Fix: Make events in reply completely determinisitic by stripping out anything coming from Cosmos SDK (not CosmWasm codebase) [\#917](https://github.com/CosmWasm/wasmd/pull/917) ([assafmo](https://github.com/assafmo)) + +Migration notes: + +* Contracts can no longer parse events from any calls except if they call another contract (or instantiate it, migrate it, etc). + The main issue here is likely "Custom" queries from a blockchain, which want to send info (eg. how many tokens were swapped). + Since those custom bindings are maintained by the chain, they can use the data field to pass any deterministic information + back to the contract. We recommend using JSON encoding there with some documented format the contracts can parse out easily. +* For possible non-determinism issues, we also sort all attributes in events. Better safe than sorry. -[Full Changelog](https://github.com/CosmWasm/wasmd/compare/v0.27.0...HEAD) ## [v0.27.0](https://github.com/CosmWasm/wasmd/tree/v0.27.0) (2022-05-19) diff --git a/INTEGRATION.md b/INTEGRATION.md index 2d7f508919..b01d1e4229 100644 --- a/INTEGRATION.md +++ b/INTEGRATION.md @@ -3,7 +3,10 @@ # Integration If you want to use Wasm in your own app, here is how you can get this working -quickly and easily. First, check to make sure you fit the pre-requisites, +quickly and easily. +First start with This [article](https://medium.com/cosmwasm/cosmwasm-for-ctos-iv-native-integrations-713140bf75fc) +in the "CosmWasm for CTOs" series that gives you a high level view. +Then check to make sure you fit the pre-requisites, then integrate the `x/wasm` module as described below, and finally, you can add custom messages and queries to your custom Go/SDK modules, exposing them to any chain-specific contract. @@ -14,26 +17,18 @@ The pre-requisites of integrating `x/wasm` into your custom app is to be using a compatible version of the Cosmos SDK, and to accept some limits to the hardware it runs on. -| wasmd | Cosmos SDK | -|:------:|:-----------:| -| v0.24 | v0.45.0 | -| v0.23 | v0.45.0 | -| v0.22 | v0.45.0 | -| v0.21 | v0.42.x | -| v0.20 | v0.42.x | -| v0.19 | v0.42.x | -| v0.18 | v0.42.x | -| v0.17 | v0.42.x | -| v0.16 | v0.42.x | -| v0.15 | v0.41.x | -| v0.14 | v0.40.x | -| v0.13 | v0.40.0-rc3 | -| v0.12 | v0.40.0-rc3 | -| v0.11 | v0.39.1 | -| v0.10 | v0.39.1 | -| v0.9 | v0.38.3 | -| v0.8 | v0.38.3 | -| v0.7 | v0.38.3 | +| wasmd | Cosmos SDK | +|:-----:|:----------:| +| v0.29 | v0.45.8 | +| v0.28 | v0.45.5 | +| v0.27 | v0.45.4 | +| v0.26 | v0.45.1 | +| v0.25 | v0.45.1 | +| v0.24 | v0.45.0 | +| v0.23 | v0.45.0 | +| v0.22 | v0.45.0 | +| v0.21 | v0.42.x | + We currently only support Intel/AMD64 CPUs and OSX or Linux. For Linux, the standard build commands work for `glibc` systems (Ubuntu, Debian, CentOS, etc). If you wish to compile @@ -72,9 +67,12 @@ from the Cosmos SDK, and enabled them in `app.go`. If so, you can just look at [`wasmd/app/app.go`](https://github.com/CosmWasm/wasmd/blob/master/app/app.go#) for how to do so (just search there for lines with `wasm`). -`wasmd` also comes with a custom `ante handler` that adds the TX position in the block into the context -and passes it to the contracts. In order to support this feature you would need to add our custom -ante handler into the `ante handler chain` as in: [`app/ante.go`](https://github.com/CosmWasm/wasmd/blob/master/app/ante.go) +`wasmd` also comes with 2 custom `ante handlers`: +* `CountTXDecorator` adds the TX position in the block into the context and passes it to the contracts +* `LimitSimulationGasDecorator` prevents an "infinite gas" query + +In order to support these features you would need to add our custom +ante handlers into the `ante handler chain` as in: [`app/ante.go`](https://github.com/CosmWasm/wasmd/blob/master/app/ante.go) ### Copied into your app @@ -202,5 +200,5 @@ the SDK is implemented properly. Once you have tested this and are happy with the results, you can wire it up in `app.go`. Just edit [the default `NewKeeper` constructor](https://github.com/CosmWasm/wasmd/blob/v0.8.0-rc1/app/app.go#L257-L258) -to have the proper `supportedFeatures` and pass in the `CustomEncoder` and `CustomQuerier` as the last two arguments to `NewKeeper`. +to have the proper `availableCapabilities` and pass in the `CustomEncoder` and `CustomQuerier` as the last two arguments to `NewKeeper`. Now you can compile your chain and upload your custom contracts on it. \ No newline at end of file diff --git a/Makefile b/Makefile index e72fe11a57..469be81c48 100644 --- a/Makefile +++ b/Makefile @@ -82,7 +82,7 @@ build: go.sum ifeq ($(OS),Windows_NT) exit 1 else - go build -mod=readonly $(BUILD_FLAGS) -o build/wasmd ./cmd/wasmd + go build -mod=readonly $(BUILD_FLAGS) -o build/wasmd ./cmd/wasmplusd endif build-contract-tests-hooks: @@ -93,7 +93,8 @@ else endif install: go.sum - go install -mod=readonly $(BUILD_FLAGS) ./cmd/wasmd + go install -mod=readonly $(BUILD_FLAGS) ./cmd/wasmplusd + mv $(BINDIR)/wasmplusd $(BINDIR)/wasmd ######################################## ### Tools & dependencies @@ -108,7 +109,7 @@ go.sum: go.mod draw-deps: @# requires brew install graphviz or apt-get install graphviz - go get github.com/RobotsAndPencils/goviz + go install github.com/RobotsAndPencils/goviz@latest @goviz -i ./cmd/wasmd -d 2 | dot -Tpng -o dependency-graph.png clean: @@ -166,7 +167,7 @@ format: format-tools ### Protobuf ### ############################################################################### PROTO_VERSION=v0.2 -PROTO_BUILDER_IMAGE=tendermintdev/sdk-proto-gen@sha256:372dce7be2f465123e26459973ca798fc489ff2c75aeecd814c0ca8ced24faca +PROTO_BUILDER_IMAGE=tendermintdev/sdk-proto-gen:$(PROTO_VERSION) PROTO_FORMATTER_IMAGE=tendermintdev/docker-build-proto@sha256:aabcfe2fc19c31c0f198d4cd26393f5e5ca9502d7ea3feafbfe972448fee7cae PROTO_GEN_SWAGGER_IMAGE=cosmos-sdk-proto-gen-swagger-$(PROTO_VERSION) diff --git a/README.md b/README.md index d04eecf291..321e978319 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ compatibility list: | line/wasmd | cosmwasm/wasmd | line/wasmvm | cosmwasm/wasmvm | cosmwasm-vm | cosmwasm-std | |------------|----------------|:--------------|-----------------|-------------|--------------| +| | 0.29 | | v1.1.0 | | 1.0-1.1 | +| | 0.28 | | v1.0.0 | | 1.0-1.1 | | 0.1 | 0.27 | v1.0.0-0.10.0 | v1.0.0 | | 1.0 | | | 0.26 | | 1.0.0-beta10 | | 1.0 | | | 0.25 | | 1.0.0-beta10 | | 1.0 | @@ -52,7 +54,7 @@ It will also run contracts compiled with 1.x assuming they don't opt into any ne The 1.x cosmwasm_vm will support all contracts with 1.0 <= version <= 1.x. Note that `cosmwasm-std` version defines which contracts are compatible with this system. The wasm code uploaded must -have been compiled with one of the supported `cosmwasm-std` versions, or will be rejeted upon upload (with some error +have been compiled with one of the supported `cosmwasm-std` versions, or will be rejected upon upload (with some error message about "contract too old?" or "contract too new?"). `cosmwasm-vm` version defines the runtime used. It is a breaking change to switch runtimes (you will need to organize a chain upgrade). As of `cosmwasm-vm 0.13` we are using [wasmer](https://github.com/wasmerio/wasmer/) 1.0, which is significantly more performant than the older versions. @@ -95,9 +97,9 @@ The used cosmos-sdk version is in transition migrating from amino encoding to pr We use standard cosmos-sdk encoding (amino) for all sdk Messages. However, the message body sent to all contracts, as well as the internal state is encoded using JSON. Cosmwasm allows arbitrary bytes with the contract itself -responsible for decodng. For better UX, we often use `json.RawMessage` to contain these bytes, which enforces that it is +responsible for decoding. For better UX, we often use `json.RawMessage` to contain these bytes, which enforces that it is valid json, but also give a much more readable interface. If you want to use another encoding in the contracts, that is -a relatively minor change to wasmd but would currently require a fork. Please open in issue if this is important for +a relatively minor change to wasmd but would currently require a fork. Please open an issue if this is important for your use case. ## Quick Start @@ -109,6 +111,12 @@ make test if you are using a linux without X or headless linux, look at [this article](https://ahelpme.com/linux/dbusexception-could-not-get-owner-of-name-org-freedesktop-secrets-no-such-name) or [#31](https://github.com/CosmWasm/wasmd/issues/31#issuecomment-577058321). ## Protobuf +The protobuf files for this project are published automatically to the [buf repository](https://buf.build/) to make integration easier: + +| wasmd version | buf tag | +|---------------|---------------------------------------------------------------------------------------------------------------------------------------------| +| 0.26.x | [51931206dbe09529c1819a8a2863d291035a2549](https://buf.build/cosmwasm/wasmd/tree/51931206dbe09529c1819a8a2863d291035a2549:cosmwasm/wasm/v1) | + Generate protobuf ```shell script make proto-gen diff --git a/app/ante.go b/app/ante.go index 1750975565..a1e4ff3994 100644 --- a/app/ante.go +++ b/app/ante.go @@ -1,11 +1,11 @@ package app import ( + ibcante "github.com/line/ibc-go/v3/modules/core/ante" + "github.com/line/ibc-go/v3/modules/core/keeper" sdk "github.com/line/lbm-sdk/types" sdkerrors "github.com/line/lbm-sdk/types/errors" "github.com/line/lbm-sdk/x/auth/ante" - ibcante "github.com/line/lbm-sdk/x/ibc/core/ante" - "github.com/line/lbm-sdk/x/ibc/core/keeper" wasmkeeper "github.com/line/wasmd/x/wasm/keeper" wasmTypes "github.com/line/wasmd/x/wasm/types" diff --git a/app/app.go b/app/app.go index 2409eac995..eeeac1f154 100644 --- a/app/app.go +++ b/app/app.go @@ -8,12 +8,32 @@ import ( "path/filepath" "strings" - intertxtypes "github.com/cosmos/interchain-accounts/x/inter-tx/types" "github.com/gorilla/mux" "github.com/rakyll/statik/fs" "github.com/spf13/cast" + abci "github.com/tendermint/tendermint/abci/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" + ica "github.com/line/ibc-go/v3/modules/apps/27-interchain-accounts" + icacontrollerkeeper "github.com/line/ibc-go/v3/modules/apps/27-interchain-accounts/controller/keeper" + icacontrollertypes "github.com/line/ibc-go/v3/modules/apps/27-interchain-accounts/controller/types" + icahost "github.com/line/ibc-go/v3/modules/apps/27-interchain-accounts/host" + icahostkeeper "github.com/line/ibc-go/v3/modules/apps/27-interchain-accounts/host/keeper" + icahosttypes "github.com/line/ibc-go/v3/modules/apps/27-interchain-accounts/host/types" + icatypes "github.com/line/ibc-go/v3/modules/apps/27-interchain-accounts/types" + transfer "github.com/line/ibc-go/v3/modules/apps/transfer" + ibctransferkeeper "github.com/line/ibc-go/v3/modules/apps/transfer/keeper" + ibctransfertypes "github.com/line/ibc-go/v3/modules/apps/transfer/types" + ibc "github.com/line/ibc-go/v3/modules/core" + ibcclient "github.com/line/ibc-go/v3/modules/core/02-client" + ibcclientclient "github.com/line/ibc-go/v3/modules/core/02-client/client" + ibcclienttypes "github.com/line/ibc-go/v3/modules/core/02-client/types" + porttypes "github.com/line/ibc-go/v3/modules/core/05-port/types" + ibchost "github.com/line/ibc-go/v3/modules/core/24-host" + ibckeeper "github.com/line/ibc-go/v3/modules/core/keeper" + ocabci "github.com/line/ostracon/abci/types" + "github.com/line/lbm-sdk/baseapp" "github.com/line/lbm-sdk/client" nodeservice "github.com/line/lbm-sdk/client/grpc/node" @@ -63,25 +83,6 @@ import ( "github.com/line/lbm-sdk/x/gov" govkeeper "github.com/line/lbm-sdk/x/gov/keeper" govtypes "github.com/line/lbm-sdk/x/gov/types" - ica "github.com/line/lbm-sdk/x/ibc/applications/27-interchain-accounts" - icacontroller "github.com/line/lbm-sdk/x/ibc/applications/27-interchain-accounts/controller" - icacontrollerkeeper "github.com/line/lbm-sdk/x/ibc/applications/27-interchain-accounts/controller/keeper" - icacontrollertypes "github.com/line/lbm-sdk/x/ibc/applications/27-interchain-accounts/controller/types" - icahost "github.com/line/lbm-sdk/x/ibc/applications/27-interchain-accounts/host" - icahostkeeper "github.com/line/lbm-sdk/x/ibc/applications/27-interchain-accounts/host/keeper" - icahosttypes "github.com/line/lbm-sdk/x/ibc/applications/27-interchain-accounts/host/types" - icatypes "github.com/line/lbm-sdk/x/ibc/applications/27-interchain-accounts/types" - transfer "github.com/line/lbm-sdk/x/ibc/applications/transfer" - ibctransferkeeper "github.com/line/lbm-sdk/x/ibc/applications/transfer/keeper" - ibctransfertypes "github.com/line/lbm-sdk/x/ibc/applications/transfer/types" - ibc "github.com/line/lbm-sdk/x/ibc/core" - ibcclient "github.com/line/lbm-sdk/x/ibc/core/02-client" - ibcclientclient "github.com/line/lbm-sdk/x/ibc/core/02-client/client" - ibcclienttypes "github.com/line/lbm-sdk/x/ibc/core/02-client/types" - porttypes "github.com/line/lbm-sdk/x/ibc/core/05-port/types" - ibchost "github.com/line/lbm-sdk/x/ibc/core/24-host" - ibckeeper "github.com/line/lbm-sdk/x/ibc/core/keeper" - ibcmock "github.com/line/lbm-sdk/x/ibc/testing/mock" "github.com/line/lbm-sdk/x/mint" mintkeeper "github.com/line/lbm-sdk/x/mint/keeper" minttypes "github.com/line/lbm-sdk/x/mint/types" @@ -100,16 +101,14 @@ import ( upgradeclient "github.com/line/lbm-sdk/x/upgrade/client" upgradekeeper "github.com/line/lbm-sdk/x/upgrade/keeper" upgradetypes "github.com/line/lbm-sdk/x/upgrade/types" - abci "github.com/line/ostracon/abci/types" tmjson "github.com/line/ostracon/libs/json" "github.com/line/ostracon/libs/log" tmos "github.com/line/ostracon/libs/os" - ocproto "github.com/line/ostracon/proto/ostracon/types" - wasmappparams "github.com/line/wasmd/app/params" "github.com/line/wasmd/x/wasm" wasmclient "github.com/line/wasmd/x/wasm/client" wasmkeeper "github.com/line/wasmd/x/wasm/keeper" + wasmpluskeeper "github.com/line/wasmd/x/wasmplus/keeper" // unnamed import of statik for swagger UI support _ "github.com/line/lbm-sdk/client/docs/statik" @@ -204,7 +203,6 @@ var ( vesting.AppModuleBasic{}, wasm.AppModuleBasic{}, ica.AppModuleBasic{}, - // intertx.AppModuleBasic{}, // TODO support later ) // module account permissions @@ -248,37 +246,35 @@ type WasmApp struct { memKeys map[string]*sdk.MemoryStoreKey // keepers - accountKeeper authkeeper.AccountKeeper - bankKeeper bankkeeper.Keeper - capabilityKeeper *capabilitykeeper.Keeper - stakingKeeper stakingkeeper.Keeper - slashingKeeper slashingkeeper.Keeper - mintKeeper mintkeeper.Keeper - distrKeeper distrkeeper.Keeper - govKeeper govkeeper.Keeper - crisisKeeper crisiskeeper.Keeper - upgradeKeeper upgradekeeper.Keeper - paramsKeeper paramskeeper.Keeper - evidenceKeeper evidencekeeper.Keeper - ibcKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly - icaControllerKeeper icacontrollerkeeper.Keeper - icaHostKeeper icahostkeeper.Keeper - // interTxKeeper intertxkeeper.Keeper // TODO support later - transferKeeper ibctransferkeeper.Keeper - feeGrantKeeper feegrantkeeper.Keeper - authzKeeper authzkeeper.Keeper - wasmKeeper wasm.Keeper - - scopedIBCKeeper capabilitykeeper.ScopedKeeper - scopedICAHostKeeper capabilitykeeper.ScopedKeeper - scopedICAControllerKeeper capabilitykeeper.ScopedKeeper - scopedInterTxKeeper capabilitykeeper.ScopedKeeper - scopedTransferKeeper capabilitykeeper.ScopedKeeper - scopedWasmKeeper capabilitykeeper.ScopedKeeper + 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 + IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly + ICAControllerKeeper icacontrollerkeeper.Keeper + ICAHostKeeper icahostkeeper.Keeper + TransferKeeper ibctransferkeeper.Keeper + FeeGrantKeeper feegrantkeeper.Keeper + AuthzKeeper authzkeeper.Keeper + WasmKeeper wasm.Keeper + + ScopedIBCKeeper capabilitykeeper.ScopedKeeper + ScopedICAHostKeeper capabilitykeeper.ScopedKeeper + ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper + ScopedTransferKeeper capabilitykeeper.ScopedKeeper + ScopedWasmKeeper capabilitykeeper.ScopedKeeper // make IBC modules public for test purposes // these modules are never directly routed to by the IBC Router - ICAAuthModule ibcmock.IBCModule + // ICAAuthModule ibcmock.IBCModule // the module manager mm *module.Manager @@ -317,7 +313,7 @@ func NewWasmApp( 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, + feegrant.StoreKey, authzkeeper.StoreKey, wasm.StoreKey, icahosttypes.StoreKey, icacontrollertypes.StoreKey, ) tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) @@ -333,7 +329,7 @@ func NewWasmApp( memKeys: memKeys, } - app.paramsKeeper = initParamsKeeper( + app.ParamsKeeper = initParamsKeeper( appCodec, legacyAmino, keys[paramstypes.StoreKey], @@ -341,90 +337,86 @@ func NewWasmApp( ) // set the BaseApp's parameter store - bApp.SetParamStore(app.paramsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramskeeper.ConsensusParamsKeyTable())) + bApp.SetParamStore(app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramskeeper.ConsensusParamsKeyTable())) // add capability keeper and ScopeToModule for ibc module - app.capabilityKeeper = capabilitykeeper.NewKeeper( + app.CapabilityKeeper = capabilitykeeper.NewKeeper( appCodec, keys[capabilitytypes.StoreKey], memKeys[capabilitytypes.MemStoreKey], ) - scopedIBCKeeper := app.capabilityKeeper.ScopeToModule(ibchost.ModuleName) - scopedICAHostKeeper := app.capabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) - scopedICAControllerKeeper := app.capabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName) - scopedInterTxKeeper := app.capabilityKeeper.ScopeToModule(intertxtypes.ModuleName) - scopedTransferKeeper := app.capabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) - scopedWasmKeeper := app.capabilityKeeper.ScopeToModule(wasm.ModuleName) - // NOTE: the IBC mock keeper and application module is used only for testing core IBC. Do - // note replicate if you do not need to test core IBC or light clients. - scopedIBCMockKeeper := app.capabilityKeeper.ScopeToModule(ibcmock.ModuleName) - scopedICAMockKeeper := app.capabilityKeeper.ScopeToModule(ibcmock.ModuleName + icacontrollertypes.SubModuleName) - app.capabilityKeeper.Seal() + scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibchost.ModuleName) + scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) + scopedICAControllerKeeper := app.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName) + scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) + scopedWasmKeeper := app.CapabilityKeeper.ScopeToModule(wasm.ModuleName) + app.CapabilityKeeper.Seal() // add keepers - app.accountKeeper = authkeeper.NewAccountKeeper( + app.AccountKeeper = authkeeper.NewAccountKeeper( appCodec, keys[authtypes.StoreKey], app.getSubspace(authtypes.ModuleName), authtypes.ProtoBaseAccount, maccPerms, ) - app.bankKeeper = bankpluskeeper.NewBaseKeeper( + app.BankKeeper = bankpluskeeper.NewBaseKeeper( appCodec, keys[banktypes.StoreKey], - app.accountKeeper, + app.AccountKeeper, app.getSubspace(banktypes.ModuleName), app.BlockedAddrs(), + false, ) - app.authzKeeper = authzkeeper.NewKeeper( + app.AuthzKeeper = authzkeeper.NewKeeper( keys[authzkeeper.StoreKey], appCodec, app.BaseApp.MsgServiceRouter(), ) - app.feeGrantKeeper = feegrantkeeper.NewKeeper( + app.FeeGrantKeeper = feegrantkeeper.NewKeeper( appCodec, keys[feegrant.StoreKey], - app.accountKeeper, + app.AccountKeeper, ) stakingKeeper := stakingkeeper.NewKeeper( appCodec, keys[stakingtypes.StoreKey], - app.accountKeeper, - app.bankKeeper, + app.AccountKeeper, + app.BankKeeper, app.getSubspace(stakingtypes.ModuleName), ) - app.mintKeeper = mintkeeper.NewKeeper( + app.MintKeeper = mintkeeper.NewKeeper( appCodec, keys[minttypes.StoreKey], app.getSubspace(minttypes.ModuleName), &stakingKeeper, - app.accountKeeper, - app.bankKeeper, + app.AccountKeeper, + app.BankKeeper, authtypes.FeeCollectorName, ) - app.distrKeeper = distrkeeper.NewKeeper( + app.DistrKeeper = distrkeeper.NewKeeper( appCodec, keys[distrtypes.StoreKey], app.getSubspace(distrtypes.ModuleName), - app.accountKeeper, - app.bankKeeper, + app.AccountKeeper, + app.BankKeeper, &stakingKeeper, authtypes.FeeCollectorName, app.ModuleAccountAddrs(), ) - app.slashingKeeper = slashingkeeper.NewKeeper( + app.SlashingKeeper = slashingkeeper.NewKeeper( appCodec, keys[slashingtypes.StoreKey], &stakingKeeper, app.getSubspace(slashingtypes.ModuleName), ) - app.crisisKeeper = crisiskeeper.NewKeeper( + app.CrisisKeeper = crisiskeeper.NewKeeper( app.getSubspace(crisistypes.ModuleName), invCheckPeriod, - app.bankKeeper, + app.BankKeeper, authtypes.FeeCollectorName, ) - app.upgradeKeeper = upgradekeeper.NewKeeper( + app.UpgradeKeeper = upgradekeeper.NewKeeper( skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, @@ -434,16 +426,16 @@ func NewWasmApp( // 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()), + app.StakingKeeper = *stakingKeeper.SetHooks( + stakingtypes.NewMultiStakingHooks(app.DistrKeeper.Hooks(), app.SlashingKeeper.Hooks()), ) - app.ibcKeeper = ibckeeper.NewKeeper( + app.IBCKeeper = ibckeeper.NewKeeper( appCodec, keys[ibchost.StoreKey], app.getSubspace(ibchost.ModuleName), - app.stakingKeeper, - app.upgradeKeeper, + app.StakingKeeper, + app.UpgradeKeeper, scopedIBCKeeper, ) @@ -451,78 +443,57 @@ func NewWasmApp( govRouter := govtypes.NewRouter() govRouter. AddRoute(govtypes.RouterKey, govtypes.ProposalHandler). - AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.paramsKeeper)). - AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.distrKeeper)). - AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.upgradeKeeper)). - AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.ibcKeeper.ClientKeeper)) + 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)) // Create Transfer Keepers - app.transferKeeper = ibctransferkeeper.NewKeeper( + app.TransferKeeper = ibctransferkeeper.NewKeeper( appCodec, keys[ibctransfertypes.StoreKey], app.getSubspace(ibctransfertypes.ModuleName), - app.ibcKeeper.ChannelKeeper, - app.ibcKeeper.ChannelKeeper, - &app.ibcKeeper.PortKeeper, - app.accountKeeper, - app.bankKeeper, + app.IBCKeeper.ChannelKeeper, + app.IBCKeeper.ChannelKeeper, + &app.IBCKeeper.PortKeeper, + app.AccountKeeper, + app.BankKeeper, scopedTransferKeeper, ) - transferModule := transfer.NewAppModule(app.transferKeeper) - transferIBCModule := transfer.NewIBCModule(app.transferKeeper) + transferModule := transfer.NewAppModule(app.TransferKeeper) + transferIBCModule := transfer.NewIBCModule(app.TransferKeeper) - _ = app.getSubspace(icahosttypes.SubModuleName) - app.icaHostKeeper = icahostkeeper.NewKeeper( + app.ICAHostKeeper = icahostkeeper.NewKeeper( appCodec, keys[icahosttypes.StoreKey], app.getSubspace(icahosttypes.SubModuleName), - app.ibcKeeper.ChannelKeeper, - &app.ibcKeeper.PortKeeper, - app.accountKeeper, + app.IBCKeeper.ChannelKeeper, + &app.IBCKeeper.PortKeeper, + app.AccountKeeper, scopedICAHostKeeper, app.MsgServiceRouter(), ) - app.icaControllerKeeper = icacontrollerkeeper.NewKeeper( + app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper( appCodec, keys[icacontrollertypes.StoreKey], app.getSubspace(icacontrollertypes.SubModuleName), - app.ibcKeeper.ChannelKeeper, // may be replaced with middleware such as ics29 fee - app.ibcKeeper.ChannelKeeper, - &app.ibcKeeper.PortKeeper, + app.IBCKeeper.ChannelKeeper, // may be replaced with middleware such as ics29 fee + app.IBCKeeper.ChannelKeeper, + &app.IBCKeeper.PortKeeper, scopedICAControllerKeeper, app.MsgServiceRouter(), ) - icaModule := ica.NewAppModule(&app.icaControllerKeeper, &app.icaHostKeeper) - icaHostIBCModule := icahost.NewIBCModule(app.icaHostKeeper) - - // NOTE: the IBC mock keeper and application module is used only for testing core IBC. Do - // note replicate if you do not need to test core IBC or light clients. - mockModule := ibcmock.NewAppModule(&app.ibcKeeper.PortKeeper) - mockIBCModule := ibcmock.NewIBCModule(&mockModule, ibcmock.NewMockIBCApp(ibcmock.ModuleName, scopedIBCMockKeeper)) - // initialize ICA module with mock module as the authentication module on the controller side - icaAuthModule := ibcmock.NewIBCModule(&mockModule, ibcmock.NewMockIBCApp("", scopedICAMockKeeper)) - app.ICAAuthModule = icaAuthModule - - // TODO support later - //// 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) - // Note: please do your research before using this in production app, this is a demo and not an officially - // supported IBC team implementation. Do your own research before using it. - // interTxModule := intertx.NewAppModule(appCodec, app.interTxKeeper) - // interTxIBCModule := intertx.NewIBCModule(app.interTxKeeper) - // You will likely want to swap out the second argument with your own reviewed and maintained ica auth module - // icaControllerIBCModule := icacontroller.NewIBCModule(app.icaControllerKeeper, interTxIBCModule) - - icaControllerIBCModule := icacontroller.NewIBCModule(app.icaControllerKeeper, icaAuthModule) + icaModule := ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper) + icaHostIBCModule := icahost.NewIBCModule(app.ICAHostKeeper) // create evidence keeper with router evidenceKeeper := evidencekeeper.NewKeeper( appCodec, keys[evidencetypes.StoreKey], - &app.stakingKeeper, - app.slashingKeeper, + &app.StakingKeeper, + app.SlashingKeeper, ) - app.evidenceKeeper = *evidenceKeeper + app.EvidenceKeeper = *evidenceKeeper wasmDir := filepath.Join(homePath, "wasm") wasmConfig, err := wasm.ReadWasmConfig(appOpts) @@ -532,26 +503,25 @@ func NewWasmApp( // The last arguments can contain custom message handlers, and custom query handlers, // if we want to allow any custom callbacks - supportedFeatures := "iterator,staking,stargate" - app.wasmKeeper = wasm.NewKeeper( + availableCapabilities := "iterator,staking,stargate,cosmwasm_1_1" + app.WasmKeeper = wasm.NewKeeper( appCodec, keys[wasm.StoreKey], app.getSubspace(wasm.ModuleName), - app.accountKeeper, - app.bankKeeper, - app.stakingKeeper, - app.distrKeeper, - app.ibcKeeper.ChannelKeeper, - &app.ibcKeeper.PortKeeper, + app.AccountKeeper, + app.BankKeeper, + app.StakingKeeper, + app.DistrKeeper, + app.IBCKeeper.ChannelKeeper, + &app.IBCKeeper.PortKeeper, scopedWasmKeeper, - app.transferKeeper, + app.TransferKeeper, app.MsgServiceRouter(), app.GRPCQueryRouter(), wasmDir, wasmConfig, - supportedFeatures, - nil, - nil, + availableCapabilities, + &wasmpluskeeper.Keeper{}, wasmOpts..., ) @@ -560,23 +530,22 @@ func NewWasmApp( // The gov proposal types can be individually enabled if len(enabledProposals) != 0 { - govRouter.AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(app.wasmKeeper, enabledProposals)) + govRouter.AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(app.WasmKeeper, enabledProposals)) } ibcRouter. - AddRoute(wasm.ModuleName, wasm.NewIBCHandler(app.wasmKeeper, app.ibcKeeper.ChannelKeeper)). + AddRoute(wasm.ModuleName, wasm.NewIBCHandler(app.WasmKeeper, app.IBCKeeper.ChannelKeeper)). AddRoute(ibctransfertypes.ModuleName, transferIBCModule). - AddRoute(icacontrollertypes.SubModuleName, icaControllerIBCModule). - AddRoute(icahosttypes.SubModuleName, icaHostIBCModule). - // AddRoute(intertxtypes.ModuleName, icaControllerIBCModule). - AddRoute(ibcmock.ModuleName, mockIBCModule) - app.ibcKeeper.SetRouter(ibcRouter) + // AddRoute(icacontrollertypes.SubModuleName, icaControllerIBCModule). + AddRoute(icahosttypes.SubModuleName, icaHostIBCModule) + // AddRoute(intertxtypes.ModuleName, icaControllerIBCModule) + app.IBCKeeper.SetRouter(ibcRouter) - app.govKeeper = govkeeper.NewKeeper( + app.GovKeeper = govkeeper.NewKeeper( appCodec, keys[govtypes.StoreKey], app.getSubspace(govtypes.ModuleName), - app.accountKeeper, - app.bankKeeper, + app.AccountKeeper, + app.BankKeeper, &stakingKeeper, govRouter, ) @@ -590,30 +559,30 @@ func NewWasmApp( // must be passed by reference here. app.mm = module.NewManager( genutil.NewAppModule( - app.accountKeeper, - app.stakingKeeper, + app.AccountKeeper, + app.StakingKeeper, app.BaseApp.DeliverTx, encodingConfig.TxConfig, ), - auth.NewAppModule(appCodec, app.accountKeeper, nil), - vesting.NewAppModule(app.accountKeeper, app.bankKeeper), - bankplus.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), - 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), - authzmodule.NewAppModule(appCodec, app.authzKeeper, app.accountKeeper, app.bankKeeper, app.interfaceRegistry), - ibc.NewAppModule(app.ibcKeeper), - params.NewAppModule(app.paramsKeeper), + auth.NewAppModule(appCodec, app.AccountKeeper, nil), + vesting.NewAppModule(app.AccountKeeper, app.BankKeeper), + bankplus.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), + 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), + authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), + ibc.NewAppModule(app.IBCKeeper), + params.NewAppModule(app.ParamsKeeper), transferModule, icaModule, - 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), // 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 @@ -698,7 +667,6 @@ func NewWasmApp( ibctransfertypes.ModuleName, ibchost.ModuleName, icatypes.ModuleName, - // intertxtypes.ModuleName, // wasm after ibc transfer wasm.ModuleName, ) @@ -706,7 +674,7 @@ func NewWasmApp( // Uncomment if you want to set a custom migration order here. // app.mm.SetOrderMigrations(custom order) - app.mm.RegisterInvariants(&app.crisisKeeper) + app.mm.RegisterInvariants(&app.CrisisKeeper) app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino) app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()) @@ -717,38 +685,39 @@ func NewWasmApp( // 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), - bankplus.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), + auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts), + bankplus.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), transferModule, ) 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, + AccountKeeper: app.AccountKeeper, + BankKeeper: app.BankKeeper, + FeegrantKeeper: app.FeeGrantKeeper, SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), SigGasConsumer: ante.DefaultSigVerificationGasConsumer, }, - IBCKeeper: app.ibcKeeper, + IBCKeeper: app.IBCKeeper, WasmConfig: &wasmConfig, TXCounterStoreKey: keys[wasm.StoreKey], }, @@ -767,32 +736,31 @@ func NewWasmApp( // see cmd/wasmd/root.go: 206 - 214 approx if manager := app.SnapshotManager(); manager != nil { err := manager.RegisterExtensions( - wasmkeeper.NewWasmSnapshotter(app.CommitMultiStore(), &app.wasmKeeper), + wasmkeeper.NewWasmSnapshotter(app.CommitMultiStore(), &app.WasmKeeper), ) if err != nil { panic(fmt.Errorf("failed to register snapshot extension: %s", err)) } } - app.scopedIBCKeeper = scopedIBCKeeper - app.scopedTransferKeeper = scopedTransferKeeper - app.scopedWasmKeeper = scopedWasmKeeper - app.scopedICAHostKeeper = scopedICAHostKeeper - app.scopedICAControllerKeeper = scopedICAControllerKeeper - app.scopedInterTxKeeper = scopedInterTxKeeper + app.ScopedIBCKeeper = scopedIBCKeeper + app.ScopedTransferKeeper = scopedTransferKeeper + app.ScopedWasmKeeper = scopedWasmKeeper + app.ScopedICAHostKeeper = scopedICAHostKeeper + app.ScopedICAControllerKeeper = scopedICAControllerKeeper if loadLatest { if err := app.LoadLatestVersion(); err != nil { tmos.Exit(fmt.Sprintf("failed to load latest version: %s", err)) } - ctx := app.BaseApp.NewUncachedContext(true, ocproto.Header{}) + ctx := app.BaseApp.NewUncachedContext(true, tmproto.Header{}) // Initialize pinned codes in wasmvm as they are not persisted there - if err := app.wasmKeeper.InitializePinnedCodes(ctx); err != nil { + if err := app.WasmKeeper.InitializePinnedCodes(ctx); err != nil { tmos.Exit(fmt.Sprintf("failed initialize pinned codes %s", err)) } // Initialize the keeper of bankkeeper - app.bankKeeper.(bankpluskeeper.Keeper).InitializeBankPlus(ctx) + app.BankKeeper.(bankpluskeeper.Keeper).InitializeBankPlus(ctx) } return app @@ -801,8 +769,18 @@ func NewWasmApp( // Name returns the name of the App func (app *WasmApp) Name() string { return app.BaseApp.Name() } -// application updates every begin block -func (app *WasmApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { +// ModuleManager returns instance +func (app *WasmApp) ModuleManager() module.Manager { + return *app.mm +} + +// ModuleConfigurator returns instance +func (app *WasmApp) ModuleConfigurator() module.Configurator { + return app.configurator +} + +// BeginBlocker application updates every begin block +func (app *WasmApp) BeginBlocker(ctx sdk.Context, req ocabci.RequestBeginBlock) abci.ResponseBeginBlock { return app.mm.BeginBlock(ctx, req) } @@ -818,7 +796,7 @@ func (app *WasmApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci panic(err) } - app.upgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) + app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) return app.mm.InitGenesis(ctx, app.appCodec, genesisState) } @@ -861,7 +839,7 @@ func (app *WasmApp) LegacyAmino() *codec.LegacyAmino { //nolint:staticcheck // // NOTE: This is solely to be used for testing purposes. func (app *WasmApp) getSubspace(moduleName string) paramstypes.Subspace { - subspace, _ := app.paramsKeeper.GetSubspace(moduleName) + subspace, _ := app.ParamsKeeper.GetSubspace(moduleName) return subspace } diff --git a/app/app_test.go b/app/app_test.go index ad08c3ef09..0d46abf4e0 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -7,9 +7,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" db "github.com/tendermint/tm-db" - abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/log" "github.com/line/wasmd/x/wasm" @@ -49,9 +49,9 @@ func TestBlockedAddrs(t *testing.T) { for acc := range maccPerms { //for acc := range gapp.BlockedAddrs() { t.Run(acc, func(t *testing.T) { - addr := gapp.accountKeeper.GetModuleAddress(acc) + addr := gapp.AccountKeeper.GetModuleAddress(acc) if blockedAddrs[addr.String()] { - require.True(t, gapp.bankKeeper.BlockedAddr(addr), + require.True(t, gapp.BankKeeper.BlockedAddr(addr), "ensure that blocked addresses are properly set in bank keeper", ) } diff --git a/app/export.go b/app/export.go index cc9735b711..68cb075707 100644 --- a/app/export.go +++ b/app/export.go @@ -4,12 +4,13 @@ import ( "encoding/json" "log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + servertypes "github.com/line/lbm-sdk/server/types" sdk "github.com/line/lbm-sdk/types" slashingtypes "github.com/line/lbm-sdk/x/slashing/types" "github.com/line/lbm-sdk/x/staking" stakingtypes "github.com/line/lbm-sdk/x/staking/types" - ocproto "github.com/line/ostracon/proto/ostracon/types" ) // ExportAppStateAndValidators exports the state of the application for a genesis @@ -18,7 +19,7 @@ func (app *WasmApp) ExportAppStateAndValidators( forZeroHeight bool, jailAllowedAddrs []string, ) (servertypes.ExportedApp, error) { // as if they could withdraw from the start of the next block - ctx := app.NewContext(true, ocproto.Header{Height: app.LastBlockHeight()}) + ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) // We export at last height + 1, because that's the height at which // Tendermint will start InitChain. @@ -34,7 +35,7 @@ func (app *WasmApp) ExportAppStateAndValidators( return servertypes.ExportedApp{}, err } - validators, err := staking.WriteValidators(ctx, app.stakingKeeper) + validators, err := staking.WriteValidators(ctx, app.StakingKeeper) return servertypes.ExportedApp{ AppState: appState, Validators: validators, @@ -45,7 +46,8 @@ func (app *WasmApp) ExportAppStateAndValidators( // prepare for fresh start at zero height // NOTE zero height genesis is a temporary feature which will be deprecated -// in favour of export at a block height +// +// in favour of export at a block height func (app *WasmApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) { applyAllowedAddrs := false @@ -65,18 +67,18 @@ func (app *WasmApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [ } /* Just to be safe, assert the invariants on current state. */ - app.crisisKeeper.AssertInvariants(ctx) + app.CrisisKeeper.AssertInvariants(ctx) /* Handle fee distribution state. */ // withdraw all validator commission - app.stakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { - _, _ = app.distrKeeper.WithdrawValidatorCommission(ctx, val.GetOperator()) //nolint:errcheck + app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + _, _ = app.DistrKeeper.WithdrawValidatorCommission(ctx, val.GetOperator()) //nolint:errcheck return false }) // withdraw all delegator rewards - dels := app.stakingKeeper.GetAllDelegations(ctx) + dels := app.StakingKeeper.GetAllDelegations(ctx) for _, delegation := range dels { valAddr, err := sdk.ValAddressFromBech32(delegation.ValidatorAddress) if err != nil { @@ -87,28 +89,28 @@ func (app *WasmApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [ if err != nil { panic(err) } - _, _ = app.distrKeeper.WithdrawDelegationRewards(ctx, delAddr, valAddr) //nolint:errcheck + _, _ = app.DistrKeeper.WithdrawDelegationRewards(ctx, delAddr, valAddr) //nolint:errcheck } // clear validator slash events - app.distrKeeper.DeleteAllValidatorSlashEvents(ctx) + app.DistrKeeper.DeleteAllValidatorSlashEvents(ctx) // clear validator historical rewards - app.distrKeeper.DeleteAllValidatorHistoricalRewards(ctx) + app.DistrKeeper.DeleteAllValidatorHistoricalRewards(ctx) // set context height to zero height := ctx.BlockHeight() ctx = ctx.WithBlockHeight(0) // reinitialize all validators - app.stakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { // donate any unwithdrawn outstanding reward fraction tokens to the community pool - scraps := app.distrKeeper.GetValidatorOutstandingRewardsCoins(ctx, val.GetOperator()) - feePool := app.distrKeeper.GetFeePool(ctx) + scraps := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, val.GetOperator()) + feePool := app.DistrKeeper.GetFeePool(ctx) feePool.CommunityPool = feePool.CommunityPool.Add(scraps...) - app.distrKeeper.SetFeePool(ctx, feePool) + app.DistrKeeper.SetFeePool(ctx, feePool) - app.distrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()) + app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()) return false }) @@ -122,8 +124,8 @@ func (app *WasmApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [ if err != nil { panic(err) } - app.distrKeeper.Hooks().BeforeDelegationCreated(ctx, delAddr, valAddr) - app.distrKeeper.Hooks().AfterDelegationModified(ctx, delAddr, valAddr) + app.DistrKeeper.Hooks().BeforeDelegationCreated(ctx, delAddr, valAddr) + app.DistrKeeper.Hooks().AfterDelegationModified(ctx, delAddr, valAddr) } // reset context height @@ -132,20 +134,20 @@ func (app *WasmApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [ /* Handle staking state. */ // iterate through redelegations, reset creation height - app.stakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) { + app.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) { for i := range red.Entries { red.Entries[i].CreationHeight = 0 } - app.stakingKeeper.SetRedelegation(ctx, red) + app.StakingKeeper.SetRedelegation(ctx, red) return false }) // iterate through unbonding delegations, reset creation height - app.stakingKeeper.IterateUnbondingDelegations(ctx, func(_ int64, ubd stakingtypes.UnbondingDelegation) (stop bool) { + app.StakingKeeper.IterateUnbondingDelegations(ctx, func(_ int64, ubd stakingtypes.UnbondingDelegation) (stop bool) { for i := range ubd.Entries { ubd.Entries[i].CreationHeight = 0 } - app.stakingKeeper.SetUnbondingDelegation(ctx, ubd) + app.StakingKeeper.SetUnbondingDelegation(ctx, ubd) return false }) @@ -157,7 +159,7 @@ func (app *WasmApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [ for ; iter.Valid(); iter.Next() { addr := sdk.ValAddress(iter.Key()[1:]) - validator, found := app.stakingKeeper.GetValidator(ctx, addr) + validator, found := app.StakingKeeper.GetValidator(ctx, addr) if !found { panic("expected validator, not found") } @@ -167,13 +169,13 @@ func (app *WasmApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [ validator.Jailed = true } - app.stakingKeeper.SetValidator(ctx, validator) + app.StakingKeeper.SetValidator(ctx, validator) counter++ } iter.Close() - _, err := app.stakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + _, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) if err != nil { log.Fatal(err) } @@ -181,11 +183,11 @@ func (app *WasmApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [ /* Handle slashing state. */ // reset start height on signing infos - app.slashingKeeper.IterateValidatorSigningInfos( + app.SlashingKeeper.IterateValidatorSigningInfos( ctx, func(addr sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) { info.StartHeight = 0 - app.slashingKeeper.SetValidatorSigningInfo(ctx, addr, info) + app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info) return false }, ) diff --git a/app/params/weights.go b/app/params/weights.go index 797996603a..9cb2dd39a4 100644 --- a/app/params/weights.go +++ b/app/params/weights.go @@ -20,6 +20,7 @@ const ( DefaultWeightCommunitySpendProposal int = 5 DefaultWeightTextProposal int = 5 DefaultWeightParamChangeProposal int = 5 - DefaultWeightMsgStoreCode int = 100 + DefaultWeightMsgStoreCode int = 50 DefaultWeightMsgInstantiateContract int = 100 + DefaultWeightMsgExecuteContract int = 100 ) diff --git a/app/sim_test.go b/app/sim_test.go index e9c3f1283b..e1d817b92c 100644 --- a/app/sim_test.go +++ b/app/sim_test.go @@ -6,14 +6,22 @@ import ( "os" "path/filepath" "testing" + "time" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" + ibctransfertypes "github.com/line/ibc-go/v3/modules/apps/transfer/types" + ibchost "github.com/line/ibc-go/v3/modules/core/24-host" "github.com/line/lbm-sdk/baseapp" + "github.com/line/lbm-sdk/codec" "github.com/line/lbm-sdk/simapp" + "github.com/line/lbm-sdk/store" + "github.com/line/lbm-sdk/store/prefix" sdk "github.com/line/lbm-sdk/types" "github.com/line/lbm-sdk/types/kv" + "github.com/line/lbm-sdk/types/module" simtypes "github.com/line/lbm-sdk/types/simulation" authtypes "github.com/line/lbm-sdk/x/auth/types" authzkeeper "github.com/line/lbm-sdk/x/authz/keeper" @@ -23,15 +31,12 @@ import ( evidencetypes "github.com/line/lbm-sdk/x/evidence/types" "github.com/line/lbm-sdk/x/feegrant" govtypes "github.com/line/lbm-sdk/x/gov/types" - ibctransfertypes "github.com/line/lbm-sdk/x/ibc/applications/transfer/types" - ibchost "github.com/line/lbm-sdk/x/ibc/core/24-host" minttypes "github.com/line/lbm-sdk/x/mint/types" paramstypes "github.com/line/lbm-sdk/x/params/types" "github.com/line/lbm-sdk/x/simulation" slashingtypes "github.com/line/lbm-sdk/x/slashing/types" stakingtypes "github.com/line/lbm-sdk/x/staking/types" "github.com/line/ostracon/libs/log" - ocproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/wasmd/x/wasm" wasmtypes "github.com/line/wasmd/x/wasm/types" @@ -119,7 +124,7 @@ func TestAppImportExport(t *testing.T) { t, os.Stdout, app.BaseApp, - simapp.AppStateFn(app.AppCodec(), app.SimulationManager()), + AppStateFn(app.AppCodec(), app.SimulationManager()), simtypes.RandomAccounts, simapp.SimulationOperations(app, app.AppCodec(), config), app.ModuleAccountAddrs(), @@ -157,8 +162,8 @@ func TestAppImportExport(t *testing.T) { err = json.Unmarshal(exported.AppState, &genesisState) require.NoError(t, err) - ctxA := app.NewContext(true, ocproto.Header{Height: app.LastBlockHeight()}) - ctxB := newApp.NewContext(true, ocproto.Header{Height: app.LastBlockHeight()}) + 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.StoreConsensusParams(ctxB, exported.ConsensusParams) @@ -191,6 +196,37 @@ func TestAppImportExport(t *testing.T) { // delete persistent tx counter value ctxA.KVStore(app.keys[wasm.StoreKey]).Delete(wasmtypes.TXCounterPrefix) + // reset contract code index in source DB for comparison with dest DB + dropContractHistory := func(s store.KVStore, keys ...[]byte) { + for _, key := range keys { + prefixStore := prefix.NewStore(s, key) + iter := prefixStore.Iterator(nil, nil) + for ; iter.Valid(); iter.Next() { + prefixStore.Delete(iter.Key()) + } + iter.Close() + } + } + prefixes := [][]byte{wasmtypes.ContractCodeHistoryElementPrefix, wasmtypes.ContractByCodeIDAndCreatedSecondaryIndexPrefix} + dropContractHistory(ctxA.KVStore(app.keys[wasm.StoreKey]), prefixes...) + dropContractHistory(ctxB.KVStore(newApp.keys[wasm.StoreKey]), prefixes...) + + normalizeContractInfo := func(ctx sdk.Context, app *WasmApp) { + var index uint64 + app.WasmKeeper.IterateContractInfo(ctx, func(address sdk.AccAddress, info wasmtypes.ContractInfo) bool { + created := &wasmtypes.AbsoluteTxPosition{ + BlockHeight: uint64(0), + TxIndex: index, + } + info.Created = created + store := ctx.KVStore(app.keys[wasm.StoreKey]) + store.Set(wasmtypes.GetContractAddressKey(address), app.appCodec.MustMarshal(&info)) + index++ + return false + }) + } + normalizeContractInfo(ctxA, app) + normalizeContractInfo(ctxB, newApp) // diff both stores for _, skp := range storeKeysPrefixes { storeA := ctxA.KVStore(skp.A) @@ -216,7 +252,7 @@ func TestFullAppSimulation(t *testing.T) { require.NoError(t, os.RemoveAll(dir)) }() encConf := MakeEncodingConfig() - app := NewWasmApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, simapp.FlagPeriodValue, + 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()) @@ -225,7 +261,7 @@ func TestFullAppSimulation(t *testing.T) { t, os.Stdout, app.BaseApp, - simapp.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(), @@ -242,3 +278,15 @@ func TestFullAppSimulation(t *testing.T) { simapp.PrintStats(db) } } + +// AppStateFn returns the initial application state using a genesis or the simulation parameters. +// It panics if the user provides files for both of them. +// If a file is not given for the genesis or the sim params, it creates a randomized one. +func AppStateFn(codec codec.Codec, manager *module.SimulationManager) simtypes.AppStateFn { + // quick hack to setup app state genesis with our app modules + simapp.ModuleBasics = ModuleBasics + if simapp.FlagGenesisTimeValue == 0 { // always set to have a block time + simapp.FlagGenesisTimeValue = time.Now().Unix() + } + return simapp.AppStateFn(codec, manager) +} diff --git a/app/test_access.go b/app/test_access.go index e8d9ae80dd..c8f252b562 100644 --- a/app/test_access.go +++ b/app/test_access.go @@ -3,19 +3,20 @@ package app import ( "testing" + ibctransferkeeper "github.com/line/ibc-go/v3/modules/apps/transfer/keeper" + ibckeeper "github.com/line/ibc-go/v3/modules/core/keeper" "github.com/line/lbm-sdk/baseapp" "github.com/line/lbm-sdk/client" "github.com/line/lbm-sdk/codec" bankkeeper "github.com/line/lbm-sdk/x/bank/keeper" capabilitykeeper "github.com/line/lbm-sdk/x/capability/keeper" - ibctransferkeeper "github.com/line/lbm-sdk/x/ibc/applications/transfer/keeper" - ibckeeper "github.com/line/lbm-sdk/x/ibc/core/keeper" stakingkeeper "github.com/line/lbm-sdk/x/staking/keeper" "github.com/line/wasmd/app/params" "github.com/line/wasmd/x/wasm" ) +// Deprecated: use public app attributes directly type TestSupport struct { t testing.TB app *WasmApp @@ -26,11 +27,11 @@ func NewTestSupport(t testing.TB, app *WasmApp) *TestSupport { } func (s TestSupport) IBCKeeper() *ibckeeper.Keeper { - return s.app.ibcKeeper + return s.app.IBCKeeper } func (s TestSupport) WasmKeeper() wasm.Keeper { - return s.app.wasmKeeper + return s.app.WasmKeeper } func (s TestSupport) AppCodec() codec.Codec { @@ -38,27 +39,27 @@ func (s TestSupport) AppCodec() codec.Codec { } func (s TestSupport) ScopedWasmIBCKeeper() capabilitykeeper.ScopedKeeper { - return s.app.scopedWasmKeeper + return s.app.ScopedWasmKeeper } func (s TestSupport) ScopeIBCKeeper() capabilitykeeper.ScopedKeeper { - return s.app.scopedIBCKeeper + return s.app.ScopedIBCKeeper } func (s TestSupport) ScopedTransferKeeper() capabilitykeeper.ScopedKeeper { - return s.app.scopedTransferKeeper + return s.app.ScopedTransferKeeper } func (s TestSupport) StakingKeeper() stakingkeeper.Keeper { - return s.app.stakingKeeper + return s.app.StakingKeeper } func (s TestSupport) BankKeeper() bankkeeper.Keeper { - return s.app.bankKeeper + return s.app.BankKeeper } func (s TestSupport) TransferKeeper() ibctransferkeeper.Keeper { - return s.app.transferKeeper + return s.app.TransferKeeper } func (s TestSupport) GetBaseApp() *baseapp.BaseApp { diff --git a/app/test_helpers.go b/app/test_helpers.go index f6af83d792..ca36067e06 100644 --- a/app/test_helpers.go +++ b/app/test_helpers.go @@ -11,6 +11,8 @@ import ( "time" "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" bam "github.com/line/lbm-sdk/baseapp" @@ -28,9 +30,8 @@ import ( banktypes "github.com/line/lbm-sdk/x/bank/types" minttypes "github.com/line/lbm-sdk/x/mint/types" stakingtypes "github.com/line/lbm-sdk/x/staking/types" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/log" - ocproto "github.com/line/ostracon/proto/ostracon/types" tmtypes "github.com/line/ostracon/types" "github.com/line/wasmd/x/wasm" @@ -43,12 +44,12 @@ var DefaultConsensusParams = &abci.ConsensusParams{ MaxBytes: 8000000, MaxGas: 1234000000, }, - Evidence: &ocproto.EvidenceParams{ + Evidence: &tmproto.EvidenceParams{ MaxAgeNumBlocks: 302400, MaxAgeDuration: 504 * time.Hour, // 3 weeks is the max duration MaxBytes: 10000, }, - Validator: &ocproto.ValidatorParams{ + Validator: &tmproto.ValidatorParams{ PubKeyTypes: []string{ tmtypes.ABCIPubKeyTypeEd25519, }, @@ -71,6 +72,29 @@ func setup(t testing.TB, withGenesis bool, invCheckPeriod uint, opts ...wasm.Opt 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) + + if !isCheckTx { + genesisState := NewDefaultGenesisState() + stateBytes, err := json.MarshalIndent(genesisState, "", " ") + if err != nil { + panic(err) + } + + app.InitChain( + abci.RequestInitChain{ + Validators: []abci.ValidatorUpdate{}, + ConsensusParams: 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 @@ -143,7 +167,7 @@ func SetupWithGenesisValSet(t *testing.T, valSet *tmtypes.ValidatorSet, genAccs // commit genesis changes app.Commit() - app.BeginBlock(abci.RequestBeginBlock{Header: ocproto.Header{ + app.BeginBlock(ocabci.RequestBeginBlock{Header: tmproto.Header{ Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash, ValidatorsHash: valSet.Hash(), @@ -202,7 +226,7 @@ func createIncrementalAccounts(accNum int) []sdk.AccAddress { // 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)) + initCoins := sdk.NewCoins(sdk.NewCoin(app.StakingKeeper.BondDenom(ctx), accAmt)) for _, pk := range pubKeys { initAccountWithCoins(app, ctx, sdk.AccAddress(pk.Address()), initCoins) @@ -224,7 +248,7 @@ func AddTestAddrsIncremental(app *WasmApp, ctx sdk.Context, accNum int, accAmt s func addTestAddrs(app *WasmApp, ctx sdk.Context, accNum int, accAmt sdk.Int, strategy GenerateAccountStrategy) []sdk.AccAddress { testAddrs := strategy(accNum) - initCoins := sdk.NewCoins(sdk.NewCoin(app.stakingKeeper.BondDenom(ctx), accAmt)) + 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 { @@ -235,12 +259,12 @@ func addTestAddrs(app *WasmApp, ctx sdk.Context, accNum int, accAmt sdk.Int, str } func initAccountWithCoins(app *WasmApp, ctx sdk.Context, addr sdk.AccAddress, coins sdk.Coins) { - err := app.bankKeeper.MintCoins(ctx, minttypes.ModuleName, coins) + err := app.BankKeeper.MintCoins(ctx, minttypes.ModuleName, coins) if err != nil { panic(err) } - err = app.bankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, addr, coins) + err = app.BankKeeper.SendCoinsFromModuleToAccount(ctx, minttypes.ModuleName, addr, coins) if err != nil { panic(err) } @@ -280,8 +304,8 @@ func TestAddr(addr string, bech string) (sdk.AccAddress, error) { // 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, ocproto.Header{}) - require.True(t, balances.IsEqual(app.bankKeeper.GetAllBalances(ctxCheck, addr))) + ctxCheck := app.BaseApp.NewContext(true, tmproto.Header{}) + require.True(t, balances.IsEqual(app.BankKeeper.GetAllBalances(ctxCheck, addr))) } const DefaultGas = 1200000 @@ -291,14 +315,14 @@ const DefaultGas = 1200000 // the parameter 'expPass' against the result. A corresponding result is // returned. func SignCheckDeliver( - t *testing.T, txCfg client.TxConfig, app *bam.BaseApp, header ocproto.Header, msgs []sdk.Msg, + 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, ) (sdk.GasInfo, *sdk.Result, error) { tx, err := helpers.GenTx( txCfg, msgs, sdk.Coins{sdk.NewInt64Coin(sdk.DefaultBondDenom, 0)}, - 2*DefaultGas, + helpers.DefaultGenTxGas, chainID, accNums, accSeqs, @@ -320,7 +344,7 @@ func SignCheckDeliver( } // Simulate a sending a transaction and committing a block - app.BeginBlock(abci.RequestBeginBlock{Header: header}) + app.BeginBlock(ocabci.RequestBeginBlock{Header: header}) gInfo, res, err := app.Deliver(txCfg.TxEncoder(), tx) if expPass { @@ -340,7 +364,7 @@ func SignCheckDeliver( // 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 ocproto.Header, msgs []sdk.Msg, + 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, ) (sdk.GasInfo, *sdk.Result, error) { tx, err := helpers.GenTx( @@ -356,7 +380,7 @@ func SignAndDeliver( require.NoError(t, err) // Simulate a sending a transaction and committing a block - app.BeginBlock(abci.RequestBeginBlock{Header: header}) + app.BeginBlock(ocabci.RequestBeginBlock{Header: header}) gInfo, res, err := app.Deliver(txCfg.TxEncoder(), tx) if expPass { diff --git a/appplus/app.go b/appplus/app.go new file mode 100644 index 0000000000..8ccdf8f963 --- /dev/null +++ b/appplus/app.go @@ -0,0 +1,923 @@ +package appplus + +import ( + "fmt" + "io" + "net/http" + "os" + "path/filepath" + "strings" + + "github.com/gorilla/mux" + "github.com/rakyll/statik/fs" + "github.com/spf13/cast" + abci "github.com/tendermint/tendermint/abci/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + dbm "github.com/tendermint/tm-db" + + ica "github.com/line/ibc-go/v3/modules/apps/27-interchain-accounts" + icacontrollerkeeper "github.com/line/ibc-go/v3/modules/apps/27-interchain-accounts/controller/keeper" + icacontrollertypes "github.com/line/ibc-go/v3/modules/apps/27-interchain-accounts/controller/types" + icahost "github.com/line/ibc-go/v3/modules/apps/27-interchain-accounts/host" + icahostkeeper "github.com/line/ibc-go/v3/modules/apps/27-interchain-accounts/host/keeper" + icahosttypes "github.com/line/ibc-go/v3/modules/apps/27-interchain-accounts/host/types" + icatypes "github.com/line/ibc-go/v3/modules/apps/27-interchain-accounts/types" + transfer "github.com/line/ibc-go/v3/modules/apps/transfer" + ibctransferkeeper "github.com/line/ibc-go/v3/modules/apps/transfer/keeper" + ibctransfertypes "github.com/line/ibc-go/v3/modules/apps/transfer/types" + ibc "github.com/line/ibc-go/v3/modules/core" + ibcclient "github.com/line/ibc-go/v3/modules/core/02-client" + ibcclientclient "github.com/line/ibc-go/v3/modules/core/02-client/client" + ibcclienttypes "github.com/line/ibc-go/v3/modules/core/02-client/types" + porttypes "github.com/line/ibc-go/v3/modules/core/05-port/types" + ibchost "github.com/line/ibc-go/v3/modules/core/24-host" + ibckeeper "github.com/line/ibc-go/v3/modules/core/keeper" + ibcmock "github.com/line/ibc-go/v3/testing/mock" + "github.com/line/lbm-sdk/baseapp" + "github.com/line/lbm-sdk/client" + nodeservice "github.com/line/lbm-sdk/client/grpc/node" + "github.com/line/lbm-sdk/client/grpc/tmservice" + "github.com/line/lbm-sdk/codec" + "github.com/line/lbm-sdk/codec/types" + "github.com/line/lbm-sdk/server/api" + "github.com/line/lbm-sdk/server/config" + servertypes "github.com/line/lbm-sdk/server/types" + "github.com/line/lbm-sdk/simapp" + sdk "github.com/line/lbm-sdk/types" + "github.com/line/lbm-sdk/types/module" + "github.com/line/lbm-sdk/x/auth" + "github.com/line/lbm-sdk/x/auth/ante" + authkeeper "github.com/line/lbm-sdk/x/auth/keeper" + authsims "github.com/line/lbm-sdk/x/auth/simulation" + authtx "github.com/line/lbm-sdk/x/auth/tx" + authtypes "github.com/line/lbm-sdk/x/auth/types" + "github.com/line/lbm-sdk/x/auth/vesting" + vestingtypes "github.com/line/lbm-sdk/x/auth/vesting/types" + "github.com/line/lbm-sdk/x/authz" + authzkeeper "github.com/line/lbm-sdk/x/authz/keeper" + authzmodule "github.com/line/lbm-sdk/x/authz/module" + "github.com/line/lbm-sdk/x/bank" + bankkeeper "github.com/line/lbm-sdk/x/bank/keeper" + banktypes "github.com/line/lbm-sdk/x/bank/types" + "github.com/line/lbm-sdk/x/bankplus" + bankpluskeeper "github.com/line/lbm-sdk/x/bankplus/keeper" + "github.com/line/lbm-sdk/x/capability" + capabilitykeeper "github.com/line/lbm-sdk/x/capability/keeper" + capabilitytypes "github.com/line/lbm-sdk/x/capability/types" + "github.com/line/lbm-sdk/x/crisis" + crisiskeeper "github.com/line/lbm-sdk/x/crisis/keeper" + crisistypes "github.com/line/lbm-sdk/x/crisis/types" + distr "github.com/line/lbm-sdk/x/distribution" + distrclient "github.com/line/lbm-sdk/x/distribution/client" + distrkeeper "github.com/line/lbm-sdk/x/distribution/keeper" + distrtypes "github.com/line/lbm-sdk/x/distribution/types" + "github.com/line/lbm-sdk/x/evidence" + evidencekeeper "github.com/line/lbm-sdk/x/evidence/keeper" + evidencetypes "github.com/line/lbm-sdk/x/evidence/types" + "github.com/line/lbm-sdk/x/feegrant" + feegrantkeeper "github.com/line/lbm-sdk/x/feegrant/keeper" + feegrantmodule "github.com/line/lbm-sdk/x/feegrant/module" + "github.com/line/lbm-sdk/x/genutil" + genutiltypes "github.com/line/lbm-sdk/x/genutil/types" + "github.com/line/lbm-sdk/x/gov" + govkeeper "github.com/line/lbm-sdk/x/gov/keeper" + govtypes "github.com/line/lbm-sdk/x/gov/types" + "github.com/line/lbm-sdk/x/mint" + mintkeeper "github.com/line/lbm-sdk/x/mint/keeper" + minttypes "github.com/line/lbm-sdk/x/mint/types" + "github.com/line/lbm-sdk/x/params" + paramsclient "github.com/line/lbm-sdk/x/params/client" + paramskeeper "github.com/line/lbm-sdk/x/params/keeper" + paramstypes "github.com/line/lbm-sdk/x/params/types" + paramproposal "github.com/line/lbm-sdk/x/params/types/proposal" + "github.com/line/lbm-sdk/x/slashing" + slashingkeeper "github.com/line/lbm-sdk/x/slashing/keeper" + slashingtypes "github.com/line/lbm-sdk/x/slashing/types" + "github.com/line/lbm-sdk/x/staking" + stakingkeeper "github.com/line/lbm-sdk/x/staking/keeper" + stakingtypes "github.com/line/lbm-sdk/x/staking/types" + "github.com/line/lbm-sdk/x/upgrade" + upgradeclient "github.com/line/lbm-sdk/x/upgrade/client" + upgradekeeper "github.com/line/lbm-sdk/x/upgrade/keeper" + upgradetypes "github.com/line/lbm-sdk/x/upgrade/types" + ocabci "github.com/line/ostracon/abci/types" + tmjson "github.com/line/ostracon/libs/json" + "github.com/line/ostracon/libs/log" + tmos "github.com/line/ostracon/libs/os" + + wasmapp "github.com/line/wasmd/app" + wasmappparams "github.com/line/wasmd/app/params" + "github.com/line/wasmd/x/wasm" + wasmclient "github.com/line/wasmd/x/wasm/client" + wasmkeeper "github.com/line/wasmd/x/wasm/keeper" + wasmtypes "github.com/line/wasmd/x/wasm/types" + "github.com/line/wasmd/x/wasmplus" + wasmpluskeeper "github.com/line/wasmd/x/wasmplus/keeper" + wasmplustypes "github.com/line/wasmd/x/wasmplus/types" +) + +const appName = "WasmPlusApp" + +// We pull these out, so we can set them with LDFLAGS in the Makefile +var ( + NodeDir = ".wasmplusd" + Bech32Prefix = "link" + + ProposalsEnabled = "false" + + EnableSpecificProposals = "" +) + +// GetEnabledProposals parses the ProposalsEnabled / EnableSpecificProposals values to +// produce a list of enabled proposals to pass into wasmd app. +func GetEnabledProposals() []wasmtypes.ProposalType { + if EnableSpecificProposals == "" { + if ProposalsEnabled == "true" { + return wasmplustypes.EnableAllProposals + } + return wasmtypes.DisableAllProposals + } + chunks := strings.Split(EnableSpecificProposals, ",") + proposals, err := wasmtypes.ConvertToProposals(chunks) + if err != nil { + panic(err) + } + return proposals +} + +// These constants are derived from the above variables. +// These are the ones we will want to use in the code, based on +// any overrides above +var ( + // DefaultNodeHome default home directories for wasmd + DefaultNodeHome = os.ExpandEnv("$HOME/") + NodeDir + + // Bech32PrefixAccAddr defines the Bech32 prefix of an account's address + Bech32PrefixAccAddr = Bech32Prefix + // Bech32PrefixAccPub defines the Bech32 prefix of an account's public key + Bech32PrefixAccPub = Bech32Prefix + sdk.PrefixPublic + // Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address + Bech32PrefixValAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator + // Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key + Bech32PrefixValPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator + sdk.PrefixPublic + // Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address + Bech32PrefixConsAddr = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + // Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key + Bech32PrefixConsPub = Bech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic +) + +var ( + // ModuleBasics defines the module BasicManager is in charge of setting up basic, + // non-dependant module elements, such as codec registration + // and genesis verification. + ModuleBasics = module.NewBasicManager( + auth.AppModuleBasic{}, + genutil.AppModuleBasic{}, + bank.AppModuleBasic{}, + capability.AppModuleBasic{}, + staking.AppModuleBasic{}, + mint.AppModuleBasic{}, + distr.AppModuleBasic{}, + gov.NewAppModuleBasic( + append( + wasmclient.ProposalHandlers, + paramsclient.ProposalHandler, + distrclient.ProposalHandler, + upgradeclient.ProposalHandler, + upgradeclient.CancelProposalHandler, + ibcclientclient.UpdateClientProposalHandler, + ibcclientclient.UpgradeProposalHandler, + )..., + ), + params.AppModuleBasic{}, + crisis.AppModuleBasic{}, + slashing.AppModuleBasic{}, + feegrantmodule.AppModuleBasic{}, + authzmodule.AppModuleBasic{}, + ibc.AppModuleBasic{}, + upgrade.AppModuleBasic{}, + evidence.AppModuleBasic{}, + transfer.AppModuleBasic{}, + vesting.AppModuleBasic{}, + wasmplus.AppModuleBasic{}, + ica.AppModuleBasic{}, + ) + + // module account permissions + maccPerms = map[string][]string{ + authtypes.FeeCollectorName: nil, + distrtypes.ModuleName: nil, + minttypes.ModuleName: {authtypes.Minter}, + stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, + stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, + govtypes.ModuleName: {authtypes.Burner}, + ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + icatypes.ModuleName: nil, + wasmplustypes.ModuleName: {authtypes.Burner}, + } +) + +var ( + _ simapp.App = (*WasmPlusApp)(nil) + _ servertypes.Application = (*WasmPlusApp)(nil) +) + +// allowedReceivingModAcc define module accounts that are allowed to receive tokens +func allowedReceivingModAcc() map[string]bool { + return map[string]bool{ + distrtypes.ModuleName: true, + } +} + +// WasmPlusApp extended ABCI application +type WasmPlusApp struct { + *baseapp.BaseApp + legacyAmino *codec.LegacyAmino //nolint:staticcheck + appCodec codec.Codec + interfaceRegistry types.InterfaceRegistry + + invCheckPeriod uint + + // keys to access the substores + keys map[string]*sdk.KVStoreKey + tkeys map[string]*sdk.TransientStoreKey + memKeys map[string]*sdk.MemoryStoreKey + + // keepers + AccountKeeper authkeeper.AccountKeeper + BankKeeper bankkeeper.Keeper + CapabilityKeeper *capabilitykeeper.Keeper + StakingKeeper stakingkeeper.Keeper + SlashingKeeper slashingkeeper.Keeper + MintKeeper mintkeeper.Keeper + DistrKeeper distrkeeper.Keeper + GovKeeper govkeeper.Keeper + CrisisKeeper crisiskeeper.Keeper + UpgradeKeeper upgradekeeper.Keeper + ParamsKeeper paramskeeper.Keeper + EvidenceKeeper evidencekeeper.Keeper + IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly + ICAControllerKeeper icacontrollerkeeper.Keeper + ICAHostKeeper icahostkeeper.Keeper + TransferKeeper ibctransferkeeper.Keeper + FeeGrantKeeper feegrantkeeper.Keeper + AuthzKeeper authzkeeper.Keeper + WasmKeeper wasmpluskeeper.Keeper + + ScopedIBCKeeper capabilitykeeper.ScopedKeeper + ScopedICAHostKeeper capabilitykeeper.ScopedKeeper + ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper + ScopedTransferKeeper capabilitykeeper.ScopedKeeper + ScopedWasmKeeper capabilitykeeper.ScopedKeeper + + // make IBC modules public for test purposes + // these modules are never directly routed to by the IBC Router + ICAAuthModule ibcmock.IBCModule + + // the module manager + mm *module.Manager + + // simulation manager + sm *module.SimulationManager + + // module configurator + configurator module.Configurator +} + +// NewWasmApp returns a reference to an initialized WasmPlusApp. +func NewWasmApp( + logger log.Logger, + db dbm.DB, + traceStore io.Writer, + loadLatest bool, + skipUpgradeHeights map[int64]bool, + homePath string, + invCheckPeriod uint, + encodingConfig wasmappparams.EncodingConfig, + enabledProposals []wasmtypes.ProposalType, + appOpts servertypes.AppOptions, + wasmOpts []wasmkeeper.Option, + baseAppOptions ...func(*baseapp.BaseApp), +) *WasmPlusApp { + appCodec, legacyAmino := encodingConfig.Marshaler, encodingConfig.Amino + interfaceRegistry := encodingConfig.InterfaceRegistry + + bApp := baseapp.NewBaseApp(appName, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...) + bApp.SetCommitMultiStoreTracer(traceStore) + bApp.SetInterfaceRegistry(interfaceRegistry) + + keys := sdk.NewKVStoreKeys( + authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, + minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, + govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, + evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey, + feegrant.StoreKey, authzkeeper.StoreKey, wasmplustypes.StoreKey, icahosttypes.StoreKey, icacontrollertypes.StoreKey, + ) + tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) + memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) + + app := &WasmPlusApp{ + BaseApp: bApp, + legacyAmino: legacyAmino, + appCodec: appCodec, + interfaceRegistry: interfaceRegistry, + invCheckPeriod: invCheckPeriod, + keys: keys, + tkeys: tkeys, + memKeys: memKeys, + } + + app.ParamsKeeper = initParamsKeeper( + appCodec, + legacyAmino, + keys[paramstypes.StoreKey], + tkeys[paramstypes.TStoreKey], + ) + + // set the BaseApp's parameter store + bApp.SetParamStore(app.ParamsKeeper.Subspace(baseapp.Paramspace).WithKeyTable(paramskeeper.ConsensusParamsKeyTable())) + + // add capability keeper and ScopeToModule for ibc module + app.CapabilityKeeper = capabilitykeeper.NewKeeper( + appCodec, + keys[capabilitytypes.StoreKey], + memKeys[capabilitytypes.MemStoreKey], + ) + scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibchost.ModuleName) + scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) + scopedICAControllerKeeper := app.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName) + scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) + scopedWasmKeeper := app.CapabilityKeeper.ScopeToModule(wasmplustypes.ModuleName) + app.CapabilityKeeper.Seal() + + // add keepers + app.AccountKeeper = authkeeper.NewAccountKeeper( + appCodec, + keys[authtypes.StoreKey], + app.getSubspace(authtypes.ModuleName), + authtypes.ProtoBaseAccount, + maccPerms, + ) + app.BankKeeper = bankpluskeeper.NewBaseKeeper( + appCodec, + keys[banktypes.StoreKey], + app.AccountKeeper, + app.getSubspace(banktypes.ModuleName), + app.BlockedAddrs(), + false, + ) + app.AuthzKeeper = authzkeeper.NewKeeper( + keys[authzkeeper.StoreKey], + appCodec, + app.BaseApp.MsgServiceRouter(), + ) + 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.AccountKeeper, + app.BankKeeper, + authtypes.FeeCollectorName, + ) + app.DistrKeeper = distrkeeper.NewKeeper( + appCodec, + keys[distrtypes.StoreKey], + app.getSubspace(distrtypes.ModuleName), + app.AccountKeeper, + app.BankKeeper, + &stakingKeeper, + authtypes.FeeCollectorName, + app.ModuleAccountAddrs(), + ) + app.SlashingKeeper = slashingkeeper.NewKeeper( + appCodec, + keys[slashingtypes.StoreKey], + &stakingKeeper, + app.getSubspace(slashingtypes.ModuleName), + ) + app.CrisisKeeper = crisiskeeper.NewKeeper( + app.getSubspace(crisistypes.ModuleName), + invCheckPeriod, + app.BankKeeper, + authtypes.FeeCollectorName, + ) + app.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()), + ) + + app.IBCKeeper = ibckeeper.NewKeeper( + appCodec, + keys[ibchost.StoreKey], + app.getSubspace(ibchost.ModuleName), + app.StakingKeeper, + app.UpgradeKeeper, + scopedIBCKeeper, + ) + + // register the proposal types + govRouter := govtypes.NewRouter() + govRouter. + AddRoute(govtypes.RouterKey, govtypes.ProposalHandler). + AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)). + AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)). + AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)). + AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)) + + // Create Transfer Keepers + app.TransferKeeper = ibctransferkeeper.NewKeeper( + appCodec, + keys[ibctransfertypes.StoreKey], + app.getSubspace(ibctransfertypes.ModuleName), + app.IBCKeeper.ChannelKeeper, + app.IBCKeeper.ChannelKeeper, + &app.IBCKeeper.PortKeeper, + app.AccountKeeper, + app.BankKeeper, + scopedTransferKeeper, + ) + transferModule := transfer.NewAppModule(app.TransferKeeper) + transferIBCModule := transfer.NewIBCModule(app.TransferKeeper) + + app.ICAHostKeeper = icahostkeeper.NewKeeper( + appCodec, + keys[icahosttypes.StoreKey], + app.getSubspace(icahosttypes.SubModuleName), + app.IBCKeeper.ChannelKeeper, + &app.IBCKeeper.PortKeeper, + app.AccountKeeper, + scopedICAHostKeeper, + app.MsgServiceRouter(), + ) + app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper( + appCodec, + keys[icacontrollertypes.StoreKey], + app.getSubspace(icacontrollertypes.SubModuleName), + app.IBCKeeper.ChannelKeeper, // may be replaced with middleware such as ics29 fee + app.IBCKeeper.ChannelKeeper, + &app.IBCKeeper.PortKeeper, + scopedICAControllerKeeper, + app.MsgServiceRouter(), + ) + icaModule := ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper) + icaHostIBCModule := icahost.NewIBCModule(app.ICAHostKeeper) + + // create evidence keeper with router + evidenceKeeper := evidencekeeper.NewKeeper( + appCodec, + keys[evidencetypes.StoreKey], + &app.StakingKeeper, + app.SlashingKeeper, + ) + app.EvidenceKeeper = *evidenceKeeper + + wasmDir := filepath.Join(homePath, "wasm") + wasmConfig, err := wasm.ReadWasmConfig(appOpts) + if err != nil { + panic(fmt.Sprintf("error while reading wasm config: %s", err)) + } + + // The last arguments can contain custom message handlers, and custom query handlers, + // if we want to allow any custom callbacks + availableCapabilities := "iterator,staking,stargate,cosmwasm_1_1" + app.WasmKeeper = wasmpluskeeper.NewKeeper( + appCodec, + keys[wasmplustypes.StoreKey], + app.getSubspace(wasmplustypes.ModuleName), + app.AccountKeeper, + app.BankKeeper, + app.StakingKeeper, + app.DistrKeeper, + app.IBCKeeper.ChannelKeeper, + &app.IBCKeeper.PortKeeper, + scopedWasmKeeper, + app.TransferKeeper, + app.MsgServiceRouter(), + app.GRPCQueryRouter(), + wasmDir, + wasmConfig, + availableCapabilities, + wasmOpts..., + ) + + // Create static IBC router, add app routes, then set and seal it + ibcRouter := porttypes.NewRouter() + + // The gov proposal types can be individually enabled + if len(enabledProposals) != 0 { + govRouter.AddRoute(wasmplustypes.RouterKey, wasmpluskeeper.NewWasmProposalHandler(&app.WasmKeeper, enabledProposals)) + } + ibcRouter. + AddRoute(wasmplustypes.ModuleName, wasm.NewIBCHandler(app.WasmKeeper, app.IBCKeeper.ChannelKeeper)). + AddRoute(ibctransfertypes.ModuleName, transferIBCModule). + AddRoute(icahosttypes.SubModuleName, icaHostIBCModule) + 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 + // we prefer to be more strict in what arguments the modules expect. + skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants)) + + // NOTE: Any module instantiated in the module manager that is later modified + // must be passed by reference here. + app.mm = module.NewManager( + genutil.NewAppModule( + app.AccountKeeper, + app.StakingKeeper, + app.BaseApp.DeliverTx, + encodingConfig.TxConfig, + ), + auth.NewAppModule(appCodec, app.AccountKeeper, nil), + vesting.NewAppModule(app.AccountKeeper, app.BankKeeper), + bankplus.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), + upgrade.NewAppModule(app.UpgradeKeeper), + wasmplus.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), + authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), + ibc.NewAppModule(app.IBCKeeper), + params.NewAppModule(app.ParamsKeeper), + transferModule, + icaModule, + crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants), // 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, + // additional non simd modules + ibctransfertypes.ModuleName, + ibchost.ModuleName, + icatypes.ModuleName, + wasmplustypes.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, + // additional non simd modules + ibctransfertypes.ModuleName, + ibchost.ModuleName, + icatypes.ModuleName, + wasmplustypes.ModuleName, + ) + + // NOTE: The genutils module must occur after staking so that pools are + // properly initialized with tokens from genesis accounts. + // NOTE: Capability module must occur first so that it can initialize any capabilities + // so that other modules that want to create or claim capabilities afterwards in InitChain + // can do so safely. + // NOTE: wasm module should be at the end as it can call other module functionality direct or via message dispatching during + // genesis phase. For example bank transfer, auth account check, staking, ... + app.mm.SetOrderInitGenesis( + capabilitytypes.ModuleName, + authtypes.ModuleName, + banktypes.ModuleName, + distrtypes.ModuleName, + stakingtypes.ModuleName, + slashingtypes.ModuleName, + govtypes.ModuleName, + minttypes.ModuleName, + crisistypes.ModuleName, + genutiltypes.ModuleName, + evidencetypes.ModuleName, + authz.ModuleName, + feegrant.ModuleName, + paramstypes.ModuleName, + upgradetypes.ModuleName, + vestingtypes.ModuleName, + // additional non simd modules + ibctransfertypes.ModuleName, + ibchost.ModuleName, + icatypes.ModuleName, + // wasm after ibc transfer + wasmplustypes.ModuleName, + ) + + // 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.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()) + app.mm.RegisterServices(app.configurator) + + // 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), + bankplus.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), + wasmplus.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), + ibc.NewAppModule(app.IBCKeeper), + transferModule, + ) + + app.sm.RegisterStoreDecoders() + // initialize stores + app.MountKVStores(keys) + // app.MountTransientStores(tkeys) + app.MountMemoryStores(memKeys) + + anteHandler, err := wasmapp.NewAnteHandler( + wasmapp.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[wasmplustypes.StoreKey], + }, + ) + if err != nil { + panic(fmt.Errorf("failed to create AnteHandler: %s", err)) + } + + app.SetAnteHandler(anteHandler) + app.SetInitChainer(app.InitChainer) + app.SetBeginBlocker(app.BeginBlocker) + app.SetEndBlocker(app.EndBlocker) + + // must be before Loading version + // requires the snapshot store to be created and registered as a BaseAppOption + // see cmd/wasmd/root.go: 206 - 214 approx + if manager := app.SnapshotManager(); manager != nil { + err := manager.RegisterExtensions( + wasmkeeper.NewWasmSnapshotter(app.CommitMultiStore(), &app.WasmKeeper.Keeper), + ) + if err != nil { + panic(fmt.Errorf("failed to register snapshot extension: %s", err)) + } + } + + app.ScopedIBCKeeper = scopedIBCKeeper + app.ScopedTransferKeeper = scopedTransferKeeper + app.ScopedWasmKeeper = scopedWasmKeeper + app.ScopedICAHostKeeper = scopedICAHostKeeper + app.ScopedICAControllerKeeper = scopedICAControllerKeeper + + if loadLatest { + if err := app.LoadLatestVersion(); err != nil { + tmos.Exit(fmt.Sprintf("failed to load latest version: %s", err)) + } + ctx := app.BaseApp.NewUncachedContext(true, tmproto.Header{}) + + // Initialize pinned codes in wasmvm as they are not persisted there + if err := app.WasmKeeper.InitializePinnedCodes(ctx); err != nil { + tmos.Exit(fmt.Sprintf("failed initialize pinned codes %s", err)) + } + // Initialize the keeper of bankkeeper + app.BankKeeper.(bankpluskeeper.Keeper).InitializeBankPlus(ctx) + } + + return app +} + +// Name returns the name of the App +func (app *WasmPlusApp) Name() string { return app.BaseApp.Name() } + +// ModuleManager returns instance +func (app *WasmPlusApp) ModuleManager() module.Manager { + return *app.mm +} + +// ModuleConfigurator returns instance +func (app *WasmPlusApp) ModuleConfigurator() module.Configurator { + return app.configurator +} + +// BeginBlocker application updates every begin block +func (app *WasmPlusApp) BeginBlocker(ctx sdk.Context, req ocabci.RequestBeginBlock) abci.ResponseBeginBlock { + return app.mm.BeginBlock(ctx, req) +} + +// EndBlocker application updates every end block +func (app *WasmPlusApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { + return app.mm.EndBlock(ctx, req) +} + +// InitChainer application update at chain initialization +func (app *WasmPlusApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { + var genesisState wasmapp.GenesisState + if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil { + panic(err) + } + + app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) + + return app.mm.InitGenesis(ctx, app.appCodec, genesisState) +} + +// LoadHeight loads a particular height +func (app *WasmPlusApp) LoadHeight(height int64) error { + return app.LoadVersion(height) +} + +// ModuleAccountAddrs returns all the app's module account addresses. +func (app *WasmPlusApp) ModuleAccountAddrs() map[string]bool { + modAccAddrs := make(map[string]bool) + for acc := range maccPerms { + modAccAddrs[authtypes.NewModuleAddress(acc).String()] = true + } + + return modAccAddrs +} + +// BlockedAddrs returns all the app's module account addresses that are not +// allowed to receive external tokens. +func (app *WasmPlusApp) BlockedAddrs() map[string]bool { + blockedAddrs := make(map[string]bool) + for acc := range maccPerms { + blockedAddrs[authtypes.NewModuleAddress(acc).String()] = !allowedReceivingModAcc()[acc] + } + + return blockedAddrs +} + +// 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 *WasmPlusApp) LegacyAmino() *codec.LegacyAmino { //nolint:staticcheck + return app.legacyAmino +} + +// getSubspace returns a param subspace for a given module name. +// +// NOTE: This is solely to be used for testing purposes. +func (app *WasmPlusApp) getSubspace(moduleName string) paramstypes.Subspace { + subspace, _ := app.ParamsKeeper.GetSubspace(moduleName) + return subspace +} + +// SimulationManager implements the SimulationApp interface +func (app *WasmPlusApp) SimulationManager() *module.SimulationManager { + return app.sm +} + +// RegisterAPIRoutes registers all application module routes with the provided +// API server. +func (app *WasmPlusApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { + clientCtx := apiSvr.ClientCtx + // 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 node gRPC service for grpc-gateway. + nodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + + // Register legacy and grpc-gateway routes for all modules. + // ModuleBasics.RegisterRESTRoutes(clientCtx, apiSvr.Router) + wasmapp.ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) + + // register swagger API from root so that other applications can override easily + if apiConfig.Swagger { + RegisterSwaggerAPI(apiSvr.Router) + } +} + +// RegisterTxService implements the Application.RegisterTxService method. +func (app *WasmPlusApp) RegisterTxService(clientCtx client.Context) { + authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry) +} + +// RegisterTendermintService implements the Application.RegisterTendermintService method. +func (app *WasmPlusApp) RegisterTendermintService(clientCtx client.Context) { + tmservice.RegisterTendermintService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.interfaceRegistry) +} + +func (app *WasmPlusApp) AppCodec() codec.Codec { + return app.appCodec +} + +func (app *WasmPlusApp) RegisterNodeService(clientCtx client.Context) { + nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter()) +} + +// 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)) +} + +// GetMaccPerms returns a copy of the module account permissions +func GetMaccPerms() map[string][]string { + dupMaccPerms := make(map[string][]string) + for k, v := range maccPerms { + dupMaccPerms[k] = v + } + return dupMaccPerms +} + +// initParamsKeeper init params keeper and its subspaces +func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey sdk.StoreKey) paramskeeper.Keeper { + paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey) + + paramsKeeper.Subspace(authtypes.ModuleName) + paramsKeeper.Subspace(banktypes.ModuleName) + paramsKeeper.Subspace(stakingtypes.ModuleName) + paramsKeeper.Subspace(minttypes.ModuleName) + paramsKeeper.Subspace(distrtypes.ModuleName) + paramsKeeper.Subspace(slashingtypes.ModuleName) + paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypes.ParamKeyTable()) + paramsKeeper.Subspace(crisistypes.ModuleName) + paramsKeeper.Subspace(ibctransfertypes.ModuleName) + paramsKeeper.Subspace(ibchost.ModuleName) + paramsKeeper.Subspace(icahosttypes.SubModuleName) + paramsKeeper.Subspace(icacontrollertypes.SubModuleName) + paramsKeeper.Subspace(wasmplustypes.ModuleName) + + return paramsKeeper +} diff --git a/appplus/app_test.go b/appplus/app_test.go new file mode 100644 index 0000000000..3581a0e20d --- /dev/null +++ b/appplus/app_test.go @@ -0,0 +1,158 @@ +package appplus + +import ( + "encoding/json" + "os" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + db "github.com/tendermint/tm-db" + + "github.com/line/lbm-sdk/server" + "github.com/line/ostracon/libs/log" + + wasmapp "github.com/line/wasmd/app" + wasmkeeper "github.com/line/wasmd/x/wasm/keeper" + wasmtypes "github.com/line/wasmd/x/wasm/types" + wasmplustypes "github.com/line/wasmd/x/wasmplus/types" +) + +var emptyWasmOpts []wasmkeeper.Option = nil + +func TestWasmdExport(t *testing.T) { + db := db.NewMemDB() + gapp := NewWasmApp(log.NewOCLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeEncodingConfig(), wasmplustypes.EnableAllProposals, wasmapp.EmptyBaseAppOptions{}, emptyWasmOpts) + require.Equal(t, appName, gapp.Name()) + + genesisState := NewDefaultGenesisState() + stateBytes, err := json.MarshalIndent(genesisState, "", " ") + require.NoError(t, err) + + // Initialize the chain + gapp.InitChain( + abci.RequestInitChain{ + Validators: []abci.ValidatorUpdate{}, + AppStateBytes: stateBytes, + }, + ) + gapp.Commit() + + // Making a new app object with the db, so that initchain hasn't been called + newGapp := NewWasmApp(log.NewOCLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeEncodingConfig(), wasmplustypes.EnableAllProposals, wasmapp.EmptyBaseAppOptions{}, emptyWasmOpts) + _, err = newGapp.ExportAppStateAndValidators(false, []string{}) + 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.NewOCLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeEncodingConfig(), wasmplustypes.EnableAllProposals, wasmapp.EmptyBaseAppOptions{}, emptyWasmOpts) + blockedAddrs := gapp.BlockedAddrs() + + for acc := range maccPerms { + t.Run(acc, func(t *testing.T) { + addr := gapp.AccountKeeper.GetModuleAddress(acc) + if blockedAddrs[addr.String()] { + require.True(t, gapp.BankKeeper.BlockedAddr(addr), + "ensure that blocked addresses are properly set in bank keeper", + ) + } + }) + } +} + +// EmptyBaseAppOptions is a stub implementing AppOptions +type WrongWasmAppOptions struct{} + +// Get implements AppOptions +func (ao WrongWasmAppOptions) Get(o string) interface{} { + if o == server.FlagTrace { + // make fail case. + return "FALse" + } + return nil +} + +func TestWrongWasmAppOptionsNewWasmApp(t *testing.T) { + require.PanicsWithValue(t, + "error while reading wasm config: strconv.ParseBool: parsing \"FALse\": invalid syntax", + func() { + NewWasmApp( + log.NewOCLogger(log.NewSyncWriter(os.Stdout)), + nil, + nil, + true, + map[int64]bool{}, + DefaultNodeHome, + 0, + MakeEncodingConfig(), + wasmplustypes.EnableAllProposals, + WrongWasmAppOptions{}, + emptyWasmOpts, + ) + }) +} + +func TestGetMaccPerms(t *testing.T) { + dup := GetMaccPerms() + require.Equal(t, maccPerms, dup, "duplicated module account permissions differed from actual module account permissions") +} + +func TestGetEnabledProposals(t *testing.T) { + cases := map[string]struct { + proposalsEnabled string + specificEnabled string + expected []wasmtypes.ProposalType + }{ + "all disabled": { + proposalsEnabled: "false", + expected: wasmtypes.DisableAllProposals, + }, + "all enabled": { + proposalsEnabled: "true", + expected: wasmplustypes.EnableAllProposals, + }, + "some enabled": { + proposalsEnabled: "okay", + specificEnabled: "StoreCode,InstantiateContract", + expected: []wasmtypes.ProposalType{wasmtypes.ProposalTypeStoreCode, wasmtypes.ProposalTypeInstantiateContract}, + }, + } + + for name, tc := range cases { + t.Run(name, func(t *testing.T) { + ProposalsEnabled = tc.proposalsEnabled + EnableSpecificProposals = tc.specificEnabled + proposals := GetEnabledProposals() + assert.Equal(t, tc.expected, proposals) + }) + } +} + +func TestGetEnabledProposalsPanic(t *testing.T) { + EnableSpecificProposals = "WrongMsg" + assert.Panics(t, func() { + GetEnabledProposals() + }) +} + +func setGenesis(gapp *WasmPlusApp) 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/appplus/encoding.go b/appplus/encoding.go new file mode 100644 index 0000000000..903d83ac44 --- /dev/null +++ b/appplus/encoding.go @@ -0,0 +1,17 @@ +package appplus + +import ( + "github.com/line/lbm-sdk/std" + + "github.com/line/wasmd/app/params" +) + +// MakeEncodingConfig creates a new EncodingConfig with all modules registered +func MakeEncodingConfig() params.EncodingConfig { + encodingConfig := params.MakeEncodingConfig() + std.RegisterLegacyAminoCodec(encodingConfig.Amino) + std.RegisterInterfaces(encodingConfig.InterfaceRegistry) + ModuleBasics.RegisterLegacyAminoCodec(encodingConfig.Amino) + ModuleBasics.RegisterInterfaces(encodingConfig.InterfaceRegistry) + return encodingConfig +} diff --git a/appplus/export.go b/appplus/export.go new file mode 100644 index 0000000000..d43c6dddbf --- /dev/null +++ b/appplus/export.go @@ -0,0 +1,194 @@ +package appplus + +import ( + "encoding/json" + "log" + + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + servertypes "github.com/line/lbm-sdk/server/types" + sdk "github.com/line/lbm-sdk/types" + slashingtypes "github.com/line/lbm-sdk/x/slashing/types" + "github.com/line/lbm-sdk/x/staking" + stakingtypes "github.com/line/lbm-sdk/x/staking/types" +) + +// ExportAppStateAndValidators exports the state of the application for a genesis +// file. +func (app *WasmPlusApp) ExportAppStateAndValidators( + forZeroHeight bool, jailAllowedAddrs []string, +) (servertypes.ExportedApp, error) { + // as if they could withdraw from the start of the next block + ctx := app.NewContext(true, tmproto.Header{Height: app.LastBlockHeight()}) + + // We export at last height + 1, because that's the height at which + // Tendermint will start InitChain. + height := app.LastBlockHeight() + 1 + if forZeroHeight { + height = 0 + app.prepForZeroHeightGenesis(ctx, jailAllowedAddrs) + } + + genState := app.mm.ExportGenesis(ctx, app.appCodec) + appState, err := json.MarshalIndent(genState, "", " ") + if err != nil { + return servertypes.ExportedApp{}, err + } + + validators, err := staking.WriteValidators(ctx, app.StakingKeeper) + return servertypes.ExportedApp{ + AppState: appState, + Validators: validators, + Height: height, + ConsensusParams: app.BaseApp.GetConsensusParams(ctx), + }, err +} + +// prepare for fresh start at zero height +// NOTE zero height genesis is a temporary feature which will be deprecated +// +// in favour of export at a block height +func (app *WasmPlusApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) { + applyAllowedAddrs := false + + // check if there is a allowed address list + if len(jailAllowedAddrs) > 0 { + applyAllowedAddrs = true + } + + allowedAddrsMap := make(map[string]bool) + + for _, addr := range jailAllowedAddrs { + _, err := sdk.ValAddressFromBech32(addr) + if err != nil { + log.Fatal(err) + } + allowedAddrsMap[addr] = true + } + + /* Just to be safe, assert the invariants on current state. */ + app.CrisisKeeper.AssertInvariants(ctx) + + /* Handle fee distribution state. */ + + // withdraw all validator commission + app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + _, _ = app.DistrKeeper.WithdrawValidatorCommission(ctx, val.GetOperator()) //nolint:errcheck + return false + }) + + // withdraw all delegator rewards + dels := app.StakingKeeper.GetAllDelegations(ctx) + for _, delegation := range dels { + valAddr, err := sdk.ValAddressFromBech32(delegation.ValidatorAddress) + if err != nil { + panic(err) + } + + delAddr, err := sdk.AccAddressFromBech32(delegation.DelegatorAddress) + if err != nil { + panic(err) + } + _, _ = app.DistrKeeper.WithdrawDelegationRewards(ctx, delAddr, valAddr) //nolint:errcheck + } + + // clear validator slash events + app.DistrKeeper.DeleteAllValidatorSlashEvents(ctx) + + // clear validator historical rewards + app.DistrKeeper.DeleteAllValidatorHistoricalRewards(ctx) + + // set context height to zero + height := ctx.BlockHeight() + ctx = ctx.WithBlockHeight(0) + + // reinitialize all validators + app.StakingKeeper.IterateValidators(ctx, func(_ int64, val stakingtypes.ValidatorI) (stop bool) { + // donate any unwithdrawn outstanding reward fraction tokens to the community pool + scraps := app.DistrKeeper.GetValidatorOutstandingRewardsCoins(ctx, val.GetOperator()) + feePool := app.DistrKeeper.GetFeePool(ctx) + feePool.CommunityPool = feePool.CommunityPool.Add(scraps...) + app.DistrKeeper.SetFeePool(ctx, feePool) + + app.DistrKeeper.Hooks().AfterValidatorCreated(ctx, val.GetOperator()) + return false + }) + + // reinitialize all delegations + for _, del := range dels { + valAddr, err := sdk.ValAddressFromBech32(del.ValidatorAddress) + if err != nil { + panic(err) + } + delAddr, err := sdk.AccAddressFromBech32(del.DelegatorAddress) + if err != nil { + panic(err) + } + app.DistrKeeper.Hooks().BeforeDelegationCreated(ctx, delAddr, valAddr) + app.DistrKeeper.Hooks().AfterDelegationModified(ctx, delAddr, valAddr) + } + + // reset context height + ctx = ctx.WithBlockHeight(height) + + /* Handle staking state. */ + + // iterate through redelegations, reset creation height + app.StakingKeeper.IterateRedelegations(ctx, func(_ int64, red stakingtypes.Redelegation) (stop bool) { + for i := range red.Entries { + red.Entries[i].CreationHeight = 0 + } + app.StakingKeeper.SetRedelegation(ctx, red) + return false + }) + + // iterate through unbonding delegations, reset creation height + app.StakingKeeper.IterateUnbondingDelegations(ctx, func(_ int64, ubd stakingtypes.UnbondingDelegation) (stop bool) { + for i := range ubd.Entries { + ubd.Entries[i].CreationHeight = 0 + } + app.StakingKeeper.SetUnbondingDelegation(ctx, ubd) + return false + }) + + // Iterate through validators by power descending, reset bond heights, and + // update bond intra-tx counters. + store := ctx.KVStore(app.keys[stakingtypes.StoreKey]) + iter := sdk.KVStoreReversePrefixIterator(store, stakingtypes.ValidatorsKey) + counter := int16(0) + + for ; iter.Valid(); iter.Next() { + addr := sdk.ValAddress(iter.Key()[1:]) + validator, found := app.StakingKeeper.GetValidator(ctx, addr) + if !found { + panic("expected validator, not found") + } + + validator.UnbondingHeight = 0 + if applyAllowedAddrs && !allowedAddrsMap[addr.String()] { + validator.Jailed = true + } + + app.StakingKeeper.SetValidator(ctx, validator) + counter++ + } + + iter.Close() + + _, err := app.StakingKeeper.ApplyAndReturnValidatorSetUpdates(ctx) + if err != nil { + log.Fatal(err) + } + + /* Handle slashing state. */ + + // reset start height on signing infos + app.SlashingKeeper.IterateValidatorSigningInfos( + ctx, + func(addr sdk.ConsAddress, info slashingtypes.ValidatorSigningInfo) (stop bool) { + info.StartHeight = 0 + app.SlashingKeeper.SetValidatorSigningInfo(ctx, addr, info) + return false + }, + ) +} diff --git a/appplus/export_test.go b/appplus/export_test.go new file mode 100644 index 0000000000..8f94b1f878 --- /dev/null +++ b/appplus/export_test.go @@ -0,0 +1,38 @@ +package appplus + +import ( + "encoding/json" + "os" + "testing" + + "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + db "github.com/tendermint/tm-db" + + "github.com/line/ostracon/libs/log" + + wasmapp "github.com/line/wasmd/app" + wasmplustypes "github.com/line/wasmd/x/wasmplus/types" +) + +func TestZeroHeightGenesis(t *testing.T) { + db := db.NewMemDB() + gapp := NewWasmApp(log.NewOCLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, MakeEncodingConfig(), wasmplustypes.EnableAllProposals, wasmapp.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, + }, + ) + gapp.Commit() + + jailAllowedAddress := []string{"linkvaloper12kr02kew9fl73rqekalavuu0xaxcgwr6pz5vt8"} + _, err = gapp.ExportAppStateAndValidators(true, jailAllowedAddress) + require.NoError(t, err) +} diff --git a/appplus/genesis.go b/appplus/genesis.go new file mode 100644 index 0000000000..a57df9c6d9 --- /dev/null +++ b/appplus/genesis.go @@ -0,0 +1,11 @@ +package appplus + +import ( + wasmapp "github.com/line/wasmd/app" +) + +// NewDefaultGenesisState generates the default state for the application. +func NewDefaultGenesisState() wasmapp.GenesisState { + encodingConfig := wasmapp.MakeEncodingConfig() + return ModuleBasics.DefaultGenesis(encodingConfig.Marshaler) +} diff --git a/appplus/params/params.go b/appplus/params/params.go new file mode 100644 index 0000000000..ab00368c0b --- /dev/null +++ b/appplus/params/params.go @@ -0,0 +1,8 @@ +package params + +// Simulation parameter constants +const ( + GasMultiplier = "gas_multiplier" + InstanceCost = "instance_cost" + CompileCost = "compile_cost" +) diff --git a/appplus/test_helpers.go b/appplus/test_helpers.go new file mode 100644 index 0000000000..57c6a33fdc --- /dev/null +++ b/appplus/test_helpers.go @@ -0,0 +1,44 @@ +package appplus + +import ( + "encoding/json" + + abci "github.com/tendermint/tendermint/abci/types" + dbm "github.com/tendermint/tm-db" + + "github.com/line/ostracon/libs/log" + + wasmapp "github.com/line/wasmd/app" + "github.com/line/wasmd/x/wasm" +) + +// Setup initializes a new WasmApp with DefaultNodeHome for integration tests +func Setup(isCheckTx bool, opts ...wasm.Option) *WasmPlusApp { + db := dbm.NewMemDB() + app := NewWasmApp(log.NewNopLogger(), db, nil, true, map[int64]bool{}, DefaultNodeHome, 5, MakeEncodingConfig(), wasm.EnableAllProposals, EmptyBaseAppOptions{}, opts) + + if !isCheckTx { + genesisState := NewDefaultGenesisState() + stateBytes, err := json.MarshalIndent(genesisState, "", " ") + if err != nil { + panic(err) + } + + app.InitChain( + abci.RequestInitChain{ + Validators: []abci.ValidatorUpdate{}, + ConsensusParams: wasmapp.DefaultConsensusParams, + AppStateBytes: stateBytes, + }, + ) + } + return app +} + +// EmptyBaseAppOptions is a stub implementing AppOptions +type EmptyBaseAppOptions struct{} + +// Get implements AppOptions +func (ao EmptyBaseAppOptions) Get(o string) interface{} { + return nil +} diff --git a/benchmarks/app_test.go b/benchmarks/app_test.go index da19df9252..f9f6776a93 100644 --- a/benchmarks/app_test.go +++ b/benchmarks/app_test.go @@ -2,11 +2,13 @@ package benchmarks import ( "encoding/json" - "io/ioutil" + "os" "testing" "time" "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" "github.com/line/lbm-sdk/client" @@ -15,9 +17,8 @@ import ( sdk "github.com/line/lbm-sdk/types" authtypes "github.com/line/lbm-sdk/x/auth/types" banktypes "github.com/line/lbm-sdk/x/bank/types" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/log" - ocproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/wasmd/app" wasmappparams "github.com/line/wasmd/app/params" @@ -65,7 +66,7 @@ func SetupWithGenesisAccounts(b testing.TB, db dbm.DB, genAccs []authtypes.Genes ) wasmApp.Commit() - wasmApp.BeginBlock(abci.RequestBeginBlock{Header: ocproto.Header{Height: wasmApp.LastBlockHeight() + 1}}) + wasmApp.BeginBlock(ocabci.RequestBeginBlock{Header: tmproto.Header{Height: wasmApp.LastBlockHeight() + 1}}) return wasmApp } @@ -115,10 +116,10 @@ func InitializeWasmApp(b testing.TB, db dbm.DB, numAccounts int) AppInfo { // add wasm contract height := int64(2) txGen := wasmappparams.MakeEncodingConfig().TxConfig - wasmApp.BeginBlock(abci.RequestBeginBlock{Header: ocproto.Header{Height: height, Time: time.Now()}}) + wasmApp.BeginBlock(ocabci.RequestBeginBlock{Header: tmproto.Header{Height: height, Time: time.Now()}}) // upload the code - cw20Code, err := ioutil.ReadFile("./testdata/cw20_base.wasm") + cw20Code, err := os.ReadFile("./testdata/cw20_base.wasm") require.NoError(b, err) storeMsg := wasmtypes.MsgStoreCode{ Sender: addr.String(), diff --git a/benchmarks/bench_test.go b/benchmarks/bench_test.go index 2815c027d7..100f102839 100644 --- a/benchmarks/bench_test.go +++ b/benchmarks/bench_test.go @@ -7,13 +7,14 @@ 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" "github.com/line/lbm-sdk/crypto/keys/secp256k1" sdk "github.com/line/lbm-sdk/types" banktypes "github.com/line/lbm-sdk/x/bank/types" - abci "github.com/line/ostracon/abci/types" - ocproto "github.com/line/ostracon/proto/ostracon/types" + ocabci "github.com/line/ostracon/abci/types" wasmtypes "github.com/line/wasmd/x/wasm/types" ) @@ -102,7 +103,7 @@ func BenchmarkTxSending(b *testing.B) { b.ResetTimer() for i := 0; i < b.N/blockSize; i++ { - appInfo.App.BeginBlock(abci.RequestBeginBlock{Header: ocproto.Header{Height: height, Time: time.Now()}}) + appInfo.App.BeginBlock(ocabci.RequestBeginBlock{Header: tmproto.Header{Height: height, Time: time.Now()}}) for j := 0; j < blockSize; j++ { idx := i*blockSize + j diff --git a/buf.work.yaml b/buf.work.yaml index 98094695ff..1b4a0d95c2 100644 --- a/buf.work.yaml +++ b/buf.work.yaml @@ -6,4 +6,3 @@ version: v1 directories: - proto - - third_party/proto diff --git a/cmd/wasmplusd/genaccounts.go b/cmd/wasmplusd/genaccounts.go new file mode 100644 index 0000000000..990c6aa898 --- /dev/null +++ b/cmd/wasmplusd/genaccounts.go @@ -0,0 +1,192 @@ +package main + +import ( + "bufio" + "encoding/json" + "errors" + "fmt" + + "github.com/spf13/cobra" + + "github.com/line/lbm-sdk/client" + "github.com/line/lbm-sdk/client/flags" + "github.com/line/lbm-sdk/crypto/keyring" + "github.com/line/lbm-sdk/server" + sdk "github.com/line/lbm-sdk/types" + authtypes "github.com/line/lbm-sdk/x/auth/types" + authvesting "github.com/line/lbm-sdk/x/auth/vesting/types" + banktypes "github.com/line/lbm-sdk/x/bank/types" + "github.com/line/lbm-sdk/x/genutil" + genutiltypes "github.com/line/lbm-sdk/x/genutil/types" +) + +const ( + flagVestingStart = "vesting-start-time" + flagVestingEnd = "vesting-end-time" + flagVestingAmt = "vesting-amount" +) + +// AddGenesisAccountCmd returns add-genesis-account cobra Command. +func AddGenesisAccountCmd(defaultNodeHome string) *cobra.Command { + cmd := &cobra.Command{ + Use: "add-genesis-account [address_or_key_name] [coin][,[coin]]", + Short: "Add a genesis account to genesis.json", + Long: `Add a genesis account to genesis.json. The provided account must specify +the account address or key name and a list of initial coins. If a key name is given, +the address will be looked up in the local Keybase. The list of initial tokens must +contain valid denominations. Accounts may optionally be supplied with vesting parameters. +`, + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + serverCtx := server.GetServerContextFromCmd(cmd) + config := serverCtx.Config + + config.SetRoot(clientCtx.HomeDir) + + var kr keyring.Keyring + addr, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + inBuf := bufio.NewReader(cmd.InOrStdin()) + keyringBackend, err := cmd.Flags().GetString(flags.FlagKeyringBackend) + if err != nil { + return fmt.Errorf("failed to parse keyring backend: %w", err) + } + if keyringBackend != "" && clientCtx.Keyring == nil { + var err error + kr, err = keyring.New(sdk.KeyringServiceName(), keyringBackend, clientCtx.HomeDir, inBuf) + if err != nil { + return err + } + } else { + kr = clientCtx.Keyring + } + + info, err := kr.Key(args[0]) + if err != nil { + return fmt.Errorf("failed to get address from Keyring: %w", err) + } + addr = info.GetAddress() + } + + coins, err := sdk.ParseCoinsNormalized(args[1]) + if err != nil { + return fmt.Errorf("failed to parse coins: %w", err) + } + + vestingStart, err := cmd.Flags().GetInt64(flagVestingStart) + if err != nil { + return fmt.Errorf("failed to parse vesting start: %w", err) + } + vestingEnd, err := cmd.Flags().GetInt64(flagVestingEnd) + if err != nil { + return fmt.Errorf("failed to parse vesting end: %w", err) + } + vestingAmtStr, err := cmd.Flags().GetString(flagVestingAmt) + if err != nil { + return fmt.Errorf("failed to parse vesting amount: %w", err) + } + + vestingAmt, err := sdk.ParseCoinsNormalized(vestingAmtStr) + if err != nil { + return fmt.Errorf("failed to parse vesting amount: %w", err) + } + + // create concrete account type based on input parameters + var genAccount authtypes.GenesisAccount + + balances := banktypes.Balance{Address: addr.String(), Coins: coins.Sort()} + baseAccount := authtypes.NewBaseAccount(addr, nil, 0, 0) + + if !vestingAmt.IsZero() { + baseVestingAccount := authvesting.NewBaseVestingAccount(baseAccount, vestingAmt.Sort(), vestingEnd) + + if (balances.Coins.IsZero() && !baseVestingAccount.OriginalVesting.IsZero()) || + baseVestingAccount.OriginalVesting.IsAnyGT(balances.Coins) { + return errors.New("vesting amount cannot be greater than total amount") + } + + switch { + case vestingStart != 0 && vestingEnd != 0: + genAccount = authvesting.NewContinuousVestingAccountRaw(baseVestingAccount, vestingStart) + + case vestingEnd != 0: + genAccount = authvesting.NewDelayedVestingAccountRaw(baseVestingAccount) + + default: + return errors.New("invalid vesting parameters; must supply start and end time or end time") + } + } else { + genAccount = baseAccount + } + + if err := genAccount.Validate(); err != nil { + return fmt.Errorf("failed to validate new genesis account: %w", err) + } + + genFile := config.GenesisFile() + appState, genDoc, err := genutiltypes.GenesisStateFromGenFile(genFile) + if err != nil { + return fmt.Errorf("failed to unmarshal genesis state: %w", err) + } + + authGenState := authtypes.GetGenesisStateFromAppState(clientCtx.Codec, appState) + + accs, err := authtypes.UnpackAccounts(authGenState.Accounts) + if err != nil { + return fmt.Errorf("failed to get accounts from any: %w", err) + } + + if accs.Contains(addr) { + return fmt.Errorf("cannot add account at existing address %s", addr) + } + + // Add the new account to the set of genesis accounts and sanitize the + // accounts afterwards. + accs = append(accs, genAccount) + accs = authtypes.SanitizeGenesisAccounts(accs) + + genAccs, err := authtypes.PackAccounts(accs) + if err != nil { + return fmt.Errorf("failed to convert accounts into any's: %w", err) + } + authGenState.Accounts = genAccs + + authGenStateBz, err := clientCtx.Codec.MarshalJSON(&authGenState) + if err != nil { + return fmt.Errorf("failed to marshal auth genesis state: %w", err) + } + + appState[authtypes.ModuleName] = authGenStateBz + + bankGenState := banktypes.GetGenesisStateFromAppState(clientCtx.Codec, appState) + bankGenState.Balances = append(bankGenState.Balances, balances) + bankGenState.Balances = banktypes.SanitizeGenesisBalances(bankGenState.Balances) + bankGenState.Supply = bankGenState.Supply.Add(balances.Coins...) + + bankGenStateBz, err := clientCtx.Codec.MarshalJSON(bankGenState) + if err != nil { + return fmt.Errorf("failed to marshal bank genesis state: %w", err) + } + + appState[banktypes.ModuleName] = bankGenStateBz + + appStateJSON, err := json.Marshal(appState) + if err != nil { + return fmt.Errorf("failed to marshal application genesis state: %w", err) + } + + genDoc.AppState = appStateJSON + return genutil.ExportGenesisFile(genDoc, genFile) + }, + } + + cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory") + cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|kwallet|pass|test)") + cmd.Flags().String(flagVestingAmt, "", "amount of coins for vesting accounts") + cmd.Flags().Int64(flagVestingStart, 0, "schedule start time (unix epoch) for vesting accounts") + cmd.Flags().Int64(flagVestingEnd, 0, "schedule end time (unix epoch) for vesting accounts") + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/cmd/wasmplusd/genwasm.go b/cmd/wasmplusd/genwasm.go new file mode 100644 index 0000000000..49fec3b3dd --- /dev/null +++ b/cmd/wasmplusd/genwasm.go @@ -0,0 +1,28 @@ +package main + +import ( + "github.com/spf13/cobra" + + "github.com/line/lbm-sdk/client" + + wasmcli "github.com/line/wasmd/x/wasm/client/cli" +) + +func AddGenesisWasmMsgCmd(defaultNodeHome string) *cobra.Command { + txCmd := &cobra.Command{ + Use: "add-wasm-genesis-message", + Short: "Wasm genesis subcommands", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + genesisIO := wasmcli.NewDefaultGenesisIO() + txCmd.AddCommand( + wasmcli.GenesisStoreCodeCmd(defaultNodeHome, genesisIO), + wasmcli.GenesisInstantiateContractCmd(defaultNodeHome, genesisIO), + wasmcli.GenesisExecuteContractCmd(defaultNodeHome, genesisIO), + wasmcli.GenesisListContractsCmd(defaultNodeHome, genesisIO), + wasmcli.GenesisListCodesCmd(defaultNodeHome, genesisIO), + ) + return txCmd +} diff --git a/cmd/wasmplusd/main.go b/cmd/wasmplusd/main.go new file mode 100644 index 0000000000..f27b22f6e0 --- /dev/null +++ b/cmd/wasmplusd/main.go @@ -0,0 +1,24 @@ +package main + +import ( + "os" + + "github.com/line/lbm-sdk/server" + svrcmd "github.com/line/lbm-sdk/server/cmd" + + app "github.com/line/wasmd/appplus" +) + +func main() { + rootCmd, _ := NewRootCmd() + + if err := svrcmd.Execute(rootCmd, app.DefaultNodeHome); err != nil { + switch e := err.(type) { + case server.ErrorCode: + os.Exit(e.Code) + + default: + os.Exit(1) + } + } +} diff --git a/cmd/wasmplusd/root.go b/cmd/wasmplusd/root.go new file mode 100644 index 0000000000..a2ac06df1d --- /dev/null +++ b/cmd/wasmplusd/root.go @@ -0,0 +1,282 @@ +package main + +import ( + "errors" + "io" + "os" + "path/filepath" + + "github.com/prometheus/client_golang/prometheus" + "github.com/spf13/cast" + "github.com/spf13/cobra" + "github.com/spf13/viper" + dbm "github.com/tendermint/tm-db" + + "github.com/line/lbm-sdk/baseapp" + "github.com/line/lbm-sdk/client" + "github.com/line/lbm-sdk/client/config" + "github.com/line/lbm-sdk/client/debug" + "github.com/line/lbm-sdk/client/flags" + "github.com/line/lbm-sdk/client/keys" + "github.com/line/lbm-sdk/client/rpc" + "github.com/line/lbm-sdk/server" + servertypes "github.com/line/lbm-sdk/server/types" + "github.com/line/lbm-sdk/snapshots" + "github.com/line/lbm-sdk/store" + sdk "github.com/line/lbm-sdk/types" + "github.com/line/lbm-sdk/version" + authcmd "github.com/line/lbm-sdk/x/auth/client/cli" + authtypes "github.com/line/lbm-sdk/x/auth/types" + banktypes "github.com/line/lbm-sdk/x/bank/types" + "github.com/line/lbm-sdk/x/crisis" + genutilcli "github.com/line/lbm-sdk/x/genutil/client/cli" + tmcli "github.com/line/ostracon/libs/cli" + "github.com/line/ostracon/libs/log" + + "github.com/line/wasmd/app/params" + "github.com/line/wasmd/appplus" + "github.com/line/wasmd/x/wasm" + wasmkeeper "github.com/line/wasmd/x/wasm/keeper" + wasmtypes "github.com/line/wasmd/x/wasm/types" +) + +// NewRootCmd creates a new root command for wasmd. It is called once in the +// main function. +func NewRootCmd() (*cobra.Command, params.EncodingConfig) { + encodingConfig := appplus.MakeEncodingConfig() + + cfg := sdk.GetConfig() + cfg.SetBech32PrefixForAccount(appplus.Bech32PrefixAccAddr, appplus.Bech32PrefixAccPub) + cfg.SetBech32PrefixForValidator(appplus.Bech32PrefixValAddr, appplus.Bech32PrefixValPub) + cfg.SetBech32PrefixForConsensusNode(appplus.Bech32PrefixConsAddr, appplus.Bech32PrefixConsPub) + cfg.SetAddressVerifier(wasmtypes.VerifyAddressLen()) + cfg.Seal() + + initClientCtx := client.Context{}. + WithCodec(encodingConfig.Marshaler). + WithInterfaceRegistry(encodingConfig.InterfaceRegistry). + WithTxConfig(encodingConfig.TxConfig). + WithLegacyAmino(encodingConfig.Amino). + WithInput(os.Stdin). + WithAccountRetriever(authtypes.AccountRetriever{}). + WithBroadcastMode(flags.BroadcastBlock). + WithHomeDir(appplus.DefaultNodeHome). + WithViper("") + + rootCmd := &cobra.Command{ + Use: version.AppName, + Short: "Wasm Daemon (server)", + PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { + // set the default command outputs + cmd.SetOut(cmd.OutOrStdout()) + cmd.SetErr(cmd.ErrOrStderr()) + + initClientCtx, err := client.ReadPersistentCommandFlags(initClientCtx, cmd.Flags()) + if err != nil { + return err + } + + initClientCtx, err = config.ReadFromClientConfig(initClientCtx) + if err != nil { + return err + } + + if err := client.SetCmdClientContextHandler(initClientCtx, cmd); err != nil { + return err + } + + return server.InterceptConfigsPreRunHandler(cmd, "", nil) + }, + } + + initRootCmd(rootCmd, encodingConfig) + + return rootCmd, encodingConfig +} + +func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { + rootCmd.AddCommand( + genutilcli.InitCmd(appplus.ModuleBasics, appplus.DefaultNodeHome), + genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, appplus.DefaultNodeHome), + genutilcli.GenTxCmd(appplus.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, appplus.DefaultNodeHome), + genutilcli.ValidateGenesisCmd(appplus.ModuleBasics), + AddGenesisAccountCmd(appplus.DefaultNodeHome), + AddGenesisWasmMsgCmd(appplus.DefaultNodeHome), + tmcli.NewCompletionCmd(rootCmd, true), + // testnetCmd(appplus.ModuleBasics, banktypes.GenesisBalancesIterator{}), + debug.Cmd(), + config.Cmd(), + ) + + ac := appCreator{ + encCfg: encodingConfig, + } + server.AddCommands(rootCmd, appplus.DefaultNodeHome, ac.newApp, ac.appExport, addModuleInitFlags) + + // add keybase, auxiliary RPC, query, and tx child commands + rootCmd.AddCommand( + rpc.StatusCommand(), + queryCommand(), + txCommand(), + keys.Commands(appplus.DefaultNodeHome), + ) +} + +func addModuleInitFlags(startCmd *cobra.Command) { + crisis.AddModuleInitFlags(startCmd) + wasm.AddModuleInitFlags(startCmd) +} + +func queryCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "query", + Aliases: []string{"q"}, + Short: "Querying subcommands", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand( + authcmd.GetAccountCmd(), + rpc.ValidatorCommand(), + rpc.BlockCommand(), + authcmd.QueryTxsByEventsCmd(), + authcmd.QueryTxCmd(), + ) + + appplus.ModuleBasics.AddQueryCommands(cmd) + cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") + + return cmd +} + +func txCommand() *cobra.Command { + cmd := &cobra.Command{ + Use: "tx", + Short: "Transactions subcommands", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand( + authcmd.GetSignCommand(), + authcmd.GetSignBatchCommand(), + authcmd.GetMultiSignCommand(), + authcmd.GetMultiSignBatchCmd(), + authcmd.GetValidateSignaturesCommand(), + flags.LineBreak, + authcmd.GetBroadcastCommand(), + authcmd.GetEncodeCommand(), + authcmd.GetDecodeCommand(), + ) + + appplus.ModuleBasics.AddTxCommands(cmd) + cmd.PersistentFlags().String(flags.FlagChainID, "", "The network chain ID") + + return cmd +} + +type appCreator struct { + encCfg params.EncodingConfig +} + +func (ac appCreator) newApp( + logger log.Logger, + db dbm.DB, + traceStore io.Writer, + appOpts servertypes.AppOptions, +) servertypes.Application { + var cache sdk.MultiStorePersistentCache + + ibCacheMetricsProvider := baseapp.MetricsProvider(cast.ToBool(viper.GetBool(server.FlagPrometheus))) + if cast.ToBool(appOpts.Get(server.FlagInterBlockCache)) { + cache = store.NewCommitKVStoreCacheManager( + cast.ToInt(appOpts.Get(server.FlagInterBlockCacheSize)), ibCacheMetricsProvider) + } + + skipUpgradeHeights := make(map[int64]bool) + for _, h := range cast.ToIntSlice(appOpts.Get(server.FlagUnsafeSkipUpgrades)) { + skipUpgradeHeights[int64(h)] = true + } + + pruningOpts, err := server.GetPruningOptionsFromFlags(appOpts) + if err != nil { + panic(err) + } + + snapshotDir := filepath.Join(cast.ToString(appOpts.Get(flags.FlagHome)), "data", "snapshots") + snapshotDB, err := sdk.NewLevelDB("metadata", snapshotDir) + if err != nil { + panic(err) + } + snapshotStore, err := snapshots.NewStore(snapshotDB, snapshotDir) + if err != nil { + panic(err) + } + var wasmOpts []wasm.Option + if cast.ToBool(appOpts.Get("telemetry.enabled")) { + wasmOpts = append(wasmOpts, wasmkeeper.WithVMCacheMetrics(prometheus.DefaultRegisterer)) + } + + return appplus.NewWasmApp(logger, db, traceStore, true, skipUpgradeHeights, + cast.ToString(appOpts.Get(flags.FlagHome)), + cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), + ac.encCfg, + appplus.GetEnabledProposals(), + appOpts, + wasmOpts, + baseapp.SetPruning(pruningOpts), + baseapp.SetMinGasPrices(cast.ToString(appOpts.Get(server.FlagMinGasPrices))), + baseapp.SetHaltHeight(cast.ToUint64(appOpts.Get(server.FlagHaltHeight))), + baseapp.SetHaltTime(cast.ToUint64(appOpts.Get(server.FlagHaltTime))), + baseapp.SetMinRetainBlocks(cast.ToUint64(appOpts.Get(server.FlagMinRetainBlocks))), + 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))), + ) +} + +func (ac appCreator) appExport( + logger log.Logger, + db dbm.DB, + traceStore io.Writer, + height int64, + forZeroHeight bool, + jailAllowedAddrs []string, + appOpts servertypes.AppOptions, +) (servertypes.ExportedApp, error) { + var wasmApp *appplus.WasmPlusApp + homePath, ok := appOpts.Get(flags.FlagHome).(string) + if !ok || homePath == "" { + return servertypes.ExportedApp{}, errors.New("application home is not set") + } + + loadLatest := height == -1 + var emptyWasmOpts []wasm.Option + wasmApp = appplus.NewWasmApp( + logger, + db, + traceStore, + loadLatest, + map[int64]bool{}, + homePath, + cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod)), + ac.encCfg, + appplus.GetEnabledProposals(), + appOpts, + emptyWasmOpts, + ) + + if height != -1 { + if err := wasmApp.LoadHeight(height); err != nil { + return servertypes.ExportedApp{}, err + } + } + + return wasmApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs) +} diff --git a/contrib/devtools/Makefile b/contrib/devtools/Makefile index ac05cc6779..611f0c4d87 100644 --- a/contrib/devtools/Makefile +++ b/contrib/devtools/Makefile @@ -61,7 +61,7 @@ tools-stamp: statik runsim golangci-lint statik: $(STATIK) $(STATIK): @echo "Installing statik..." - @(cd /tmp && go get github.com/rakyll/statik@v0.1.6) + @(cd /tmp && go install github.com/rakyll/statik@v0.1.6) # Install the runsim binary with a temporary workaround of entering an outside # directory as the "go get" command ignores the -mod option and will polute the @@ -71,12 +71,12 @@ $(STATIK): runsim: $(RUNSIM) $(RUNSIM): @echo "Installing runsim..." - @(cd /tmp && go get github.com/cosmos/tools/cmd/runsim@v1.0.0) + @(cd /tmp && go install github.com/cosmos/tools/cmd/runsim@v1.0.0) golangci-lint: $(GOLANGCI_LINT) $(GOLANGCI_LINT): @echo "Installing golangci-lint..." - @(cd /tmp && go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.28.0) + @(cd /tmp && go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.47.0) tools-clean: rm -f $(STATIK) $(GOLANGCI_LINT) $(RUNSIM) diff --git a/contrib/local/02-contracts.sh b/contrib/local/02-contracts.sh index ecbadf31eb..c445d948b6 100755 --- a/contrib/local/02-contracts.sh +++ b/contrib/local/02-contracts.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -o errexit -o nounset -o pipefail +set -o errexit -o nounset -o pipefail -x DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" @@ -9,7 +9,10 @@ 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) 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" +echo "* Code checksum: $CODE_HASH" + echo "* Download code" TMPDIR=$(mktemp -t wasmdXXXXXX) wasmd q wasm code "$CODE_ID" "$TMPDIR" @@ -27,6 +30,17 @@ wasmd tx wasm instantiate "$CODE_ID" "$INIT" --admin="$(wasmd keys show validato 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) \ + --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 + +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 + echo "### Query all" RESP=$(wasmd query wasm contract-state all "$CONTRACT" -o json) echo "$RESP" | jq diff --git a/docker/setup_and_run.sh b/docker/setup_and_run.sh new file mode 100644 index 0000000000..f5bacbf67c --- /dev/null +++ b/docker/setup_and_run.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +./setup_wasmd.sh "$@" +./run_wasmd.sh \ No newline at end of file diff --git a/docs/proto/proto-docs.md b/docs/proto/proto-docs.md index b01be26d6b..8c335e87cc 100644 --- a/docs/proto/proto-docs.md +++ b/docs/proto/proto-docs.md @@ -23,6 +23,8 @@ - [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) @@ -71,6 +73,8 @@ - [QueryContractInfoResponse](#cosmwasm.wasm.v1.QueryContractInfoResponse) - [QueryContractsByCodeRequest](#cosmwasm.wasm.v1.QueryContractsByCodeRequest) - [QueryContractsByCodeResponse](#cosmwasm.wasm.v1.QueryContractsByCodeResponse) + - [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) @@ -84,6 +88,9 @@ - [EventActivateContractProposal](#lbm.wasm.v1.EventActivateContractProposal) - [EventDeactivateContractProposal](#lbm.wasm.v1.EventDeactivateContractProposal) +- [lbm/wasm/v1/genesis.proto](#lbm/wasm/v1/genesis.proto) + - [GenesisState](#lbm.wasm.v1.GenesisState) + - [lbm/wasm/v1/proposal.proto](#lbm/wasm/v1/proposal.proto) - [ActivateContractProposal](#lbm.wasm.v1.ActivateContractProposal) - [DeactivateContractProposal](#lbm.wasm.v1.DeactivateContractProposal) @@ -139,7 +146,8 @@ AccessConfig access control type. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `permission` | [AccessType](#cosmwasm.wasm.v1.AccessType) | | | -| `address` | [string](#string) | | | +| `address` | [string](#string) | | Address Deprecated: replaced by addresses | +| `addresses` | [string](#string) | repeated | | @@ -243,9 +251,6 @@ Params defines the set of wasm parameters. | ----- | ---- | ----- | ----------- | | `code_upload_access` | [AccessConfig](#cosmwasm.wasm.v1.AccessConfig) | | | | `instantiate_default_permission` | [AccessType](#cosmwasm.wasm.v1.AccessType) | | | -| `gas_multiplier` | [uint64](#uint64) | | | -| `instance_cost` | [uint64](#uint64) | | | -| `compile_cost` | [uint64](#uint64) | | | @@ -263,8 +268,9 @@ AccessType permission types | ---- | ------ | ----------- | | ACCESS_TYPE_UNSPECIFIED | 0 | AccessTypeUnspecified placeholder for empty value | | ACCESS_TYPE_NOBODY | 1 | AccessTypeNobody forbidden | -| ACCESS_TYPE_ONLY_ADDRESS | 2 | AccessTypeOnlyAddress restricted to an address | +| 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 | @@ -348,7 +354,7 @@ MsgExecuteContractResponse returns execution result data. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `data` | [bytes](#bytes) | | Data contains base64-encoded bytes to returned from the contract | +| `data` | [bytes](#bytes) | | Data contains bytes to returned from the contract | @@ -376,6 +382,45 @@ code id. + + +### 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 @@ -385,7 +430,7 @@ 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 base64-encoded bytes to returned from the contract | +| `data` | [bytes](#bytes) | | Data contains bytes to returned from the contract | @@ -451,6 +496,7 @@ 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 | @@ -498,7 +544,8 @@ Msg defines the wasm Msg 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) | Instantiate creates a new smart contract instance for the given code id. | | +| `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 | | @@ -563,7 +610,6 @@ GenesisState - genesis state of x/wasm | `contracts` | [Contract](#cosmwasm.wasm.v1.Contract) | repeated | | | `sequences` | [Sequence](#cosmwasm.wasm.v1.Sequence) | repeated | | | `gen_msgs` | [GenesisState.GenMsgs](#cosmwasm.wasm.v1.GenesisState.GenMsgs) | repeated | | -| `inactive_contract_addresses` | [string](#string) | repeated | InactiveContractAddresses is a list of contract address that set inactive | @@ -581,7 +627,7 @@ order. The intention is to have more human readable data that is auditable. | ----- | ---- | ----- | ----------- | | `store_code` | [MsgStoreCode](#cosmwasm.wasm.v1.MsgStoreCode) | | | | `instantiate_contract` | [MsgInstantiateContract](#cosmwasm.wasm.v1.MsgInstantiateContract) | | | -| `execute_contract` | [MsgExecuteContract](#cosmwasm.wasm.v1.MsgExecuteContract) | | | +| `execute_contract` | [MsgExecuteContract](#cosmwasm.wasm.v1.MsgExecuteContract) | | MsgInstantiateContract2 intentionally not supported see https://github.com/CosmWasm/wasmd/issues/987 | @@ -800,6 +846,7 @@ StoreCodeProposal gov proposal content type to submit WASM code to the system | `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 | @@ -1109,6 +1156,31 @@ Query/ContractsByCode RPC method + + +### 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 @@ -1230,6 +1302,7 @@ Query provides defines the gRPC querier service | `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| @@ -1271,6 +1344,42 @@ EventDeactivateContractProposal is the event that is emitted when the contract i + + + + + + + + + + + +

Top

+ +## lbm/wasm/v1/genesis.proto + + + + + +### GenesisState +GenesisState - genesis state of x/wasm + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `params` | [cosmwasm.wasm.v1.Params](#cosmwasm.wasm.v1.Params) | | | +| `codes` | [cosmwasm.wasm.v1.Code](#cosmwasm.wasm.v1.Code) | repeated | | +| `contracts` | [cosmwasm.wasm.v1.Contract](#cosmwasm.wasm.v1.Contract) | repeated | | +| `sequences` | [cosmwasm.wasm.v1.Sequence](#cosmwasm.wasm.v1.Sequence) | repeated | | +| `gen_msgs` | [cosmwasm.wasm.v1.GenesisState.GenMsgs](#cosmwasm.wasm.v1.GenesisState.GenMsgs) | repeated | | +| `inactive_contract_addresses` | [string](#string) | repeated | InactiveContractAddresses is a list of contract address that set inactive | + + + + + @@ -1413,7 +1522,7 @@ Query defines the gRPC querier service. | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | | `InactiveContracts` | [QueryInactiveContractsRequest](#lbm.wasm.v1.QueryInactiveContractsRequest) | [QueryInactiveContractsResponse](#lbm.wasm.v1.QueryInactiveContractsResponse) | InactiveContracts queries all inactive contracts | GET|/lbm/wasm/v1/inactive_contracts| -| `InactiveContract` | [QueryInactiveContractRequest](#lbm.wasm.v1.QueryInactiveContractRequest) | [QueryInactiveContractResponse](#lbm.wasm.v1.QueryInactiveContractResponse) | | GET|/lbm/wasm/v1/inactive_contracts/{address}| +| `InactiveContract` | [QueryInactiveContractRequest](#lbm.wasm.v1.QueryInactiveContractRequest) | [QueryInactiveContractResponse](#lbm.wasm.v1.QueryInactiveContractResponse) | InactiveContract check it the contract is inactive state or not | GET|/lbm/wasm/v1/inactive_contracts/{address}| diff --git a/docs/proto/proto.md b/docs/proto/proto.md deleted file mode 100644 index 6637b9a28f..0000000000 --- a/docs/proto/proto.md +++ /dev/null @@ -1,1121 +0,0 @@ -# Protocol Documentation - - -## Table of Contents - -- [x/wasm/types/genesis.proto](#x/wasm/types/genesis.proto) - - [Code](#cosmwasm.wasm.v1beta1.Code) - - [Contract](#cosmwasm.wasm.v1beta1.Contract) - - [GenesisState](#cosmwasm.wasm.v1beta1.GenesisState) - - [GenesisState.GenMsgs](#cosmwasm.wasm.v1beta1.GenesisState.GenMsgs) - - [Sequence](#cosmwasm.wasm.v1beta1.Sequence) - -- [x/wasm/types/ibc.proto](#x/wasm/types/ibc.proto) - - [MsgIBCCloseChannel](#cosmwasm.wasm.v1beta1.MsgIBCCloseChannel) - - [MsgIBCSend](#cosmwasm.wasm.v1beta1.MsgIBCSend) - -- [x/wasm/types/proposal.proto](#x/wasm/types/proposal.proto) - - [ClearAdminProposal](#cosmwasm.wasm.v1beta1.ClearAdminProposal) - - [InstantiateContractProposal](#cosmwasm.wasm.v1beta1.InstantiateContractProposal) - - [MigrateContractProposal](#cosmwasm.wasm.v1beta1.MigrateContractProposal) - - [PinCodesProposal](#cosmwasm.wasm.v1beta1.PinCodesProposal) - - [StoreCodeProposal](#cosmwasm.wasm.v1beta1.StoreCodeProposal) - - [UnpinCodesProposal](#cosmwasm.wasm.v1beta1.UnpinCodesProposal) - - [UpdateAdminProposal](#cosmwasm.wasm.v1beta1.UpdateAdminProposal) - -- [x/wasm/types/query.proto](#x/wasm/types/query.proto) - - [CodeInfoResponse](#cosmwasm.wasm.v1beta1.CodeInfoResponse) - - [ContractInfoWithAddress](#cosmwasm.wasm.v1beta1.ContractInfoWithAddress) - - [QueryAllContractStateRequest](#cosmwasm.wasm.v1beta1.QueryAllContractStateRequest) - - [QueryAllContractStateResponse](#cosmwasm.wasm.v1beta1.QueryAllContractStateResponse) - - [QueryCodeRequest](#cosmwasm.wasm.v1beta1.QueryCodeRequest) - - [QueryCodeResponse](#cosmwasm.wasm.v1beta1.QueryCodeResponse) - - [QueryCodesRequest](#cosmwasm.wasm.v1beta1.QueryCodesRequest) - - [QueryCodesResponse](#cosmwasm.wasm.v1beta1.QueryCodesResponse) - - [QueryContractHistoryRequest](#cosmwasm.wasm.v1beta1.QueryContractHistoryRequest) - - [QueryContractHistoryResponse](#cosmwasm.wasm.v1beta1.QueryContractHistoryResponse) - - [QueryContractInfoRequest](#cosmwasm.wasm.v1beta1.QueryContractInfoRequest) - - [QueryContractInfoResponse](#cosmwasm.wasm.v1beta1.QueryContractInfoResponse) - - [QueryContractsByCodeRequest](#cosmwasm.wasm.v1beta1.QueryContractsByCodeRequest) - - [QueryContractsByCodeResponse](#cosmwasm.wasm.v1beta1.QueryContractsByCodeResponse) - - [QueryRawContractStateRequest](#cosmwasm.wasm.v1beta1.QueryRawContractStateRequest) - - [QueryRawContractStateResponse](#cosmwasm.wasm.v1beta1.QueryRawContractStateResponse) - - [QuerySmartContractStateRequest](#cosmwasm.wasm.v1beta1.QuerySmartContractStateRequest) - - [QuerySmartContractStateResponse](#cosmwasm.wasm.v1beta1.QuerySmartContractStateResponse) - - - [Query](#cosmwasm.wasm.v1beta1.Query) - -- [x/wasm/types/tx.proto](#x/wasm/types/tx.proto) - - [MsgClearAdmin](#cosmwasm.wasm.v1beta1.MsgClearAdmin) - - [MsgClearAdminResponse](#cosmwasm.wasm.v1beta1.MsgClearAdminResponse) - - [MsgExecuteContract](#cosmwasm.wasm.v1beta1.MsgExecuteContract) - - [MsgExecuteContractResponse](#cosmwasm.wasm.v1beta1.MsgExecuteContractResponse) - - [MsgInstantiateContract](#cosmwasm.wasm.v1beta1.MsgInstantiateContract) - - [MsgInstantiateContractResponse](#cosmwasm.wasm.v1beta1.MsgInstantiateContractResponse) - - [MsgMigrateContract](#cosmwasm.wasm.v1beta1.MsgMigrateContract) - - [MsgMigrateContractResponse](#cosmwasm.wasm.v1beta1.MsgMigrateContractResponse) - - [MsgStoreCode](#cosmwasm.wasm.v1beta1.MsgStoreCode) - - [MsgStoreCodeResponse](#cosmwasm.wasm.v1beta1.MsgStoreCodeResponse) - - [MsgUpdateAdmin](#cosmwasm.wasm.v1beta1.MsgUpdateAdmin) - - [MsgUpdateAdminResponse](#cosmwasm.wasm.v1beta1.MsgUpdateAdminResponse) - - - [Msg](#cosmwasm.wasm.v1beta1.Msg) - -- [x/wasm/types/types.proto](#x/wasm/types/types.proto) - - [AbsoluteTxPosition](#cosmwasm.wasm.v1beta1.AbsoluteTxPosition) - - [AccessConfig](#cosmwasm.wasm.v1beta1.AccessConfig) - - [AccessTypeParam](#cosmwasm.wasm.v1beta1.AccessTypeParam) - - [CodeInfo](#cosmwasm.wasm.v1beta1.CodeInfo) - - [ContractCodeHistoryEntry](#cosmwasm.wasm.v1beta1.ContractCodeHistoryEntry) - - [ContractInfo](#cosmwasm.wasm.v1beta1.ContractInfo) - - [Model](#cosmwasm.wasm.v1beta1.Model) - - [Params](#cosmwasm.wasm.v1beta1.Params) - - - [AccessType](#cosmwasm.wasm.v1beta1.AccessType) - - [ContractCodeHistoryOperationType](#cosmwasm.wasm.v1beta1.ContractCodeHistoryOperationType) - -- [Scalar Value Types](#scalar-value-types) - - - - -

Top

- -## x/wasm/types/genesis.proto - - - - - -### Code -Code struct encompasses CodeInfo and CodeBytes - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| code_id | [uint64](#uint64) | | | -| code_info | [CodeInfo](#cosmwasm.wasm.v1beta1.CodeInfo) | | | -| code_bytes | [bytes](#bytes) | | | -| pinned | [bool](#bool) | | Pinned to wasmvm cache | - - - - - - - - -### Contract -Contract struct encompasses ContractAddress, ContractInfo, and ContractState - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| contract_address | [string](#string) | | | -| contract_info | [ContractInfo](#cosmwasm.wasm.v1beta1.ContractInfo) | | | -| contract_state | [Model](#cosmwasm.wasm.v1beta1.Model) | repeated | | - - - - - - - - -### GenesisState -GenesisState - genesis state of x/wasm - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| params | [Params](#cosmwasm.wasm.v1beta1.Params) | | | -| codes | [Code](#cosmwasm.wasm.v1beta1.Code) | repeated | | -| contracts | [Contract](#cosmwasm.wasm.v1beta1.Contract) | repeated | | -| sequences | [Sequence](#cosmwasm.wasm.v1beta1.Sequence) | repeated | | -| gen_msgs | [GenesisState.GenMsgs](#cosmwasm.wasm.v1beta1.GenesisState.GenMsgs) | repeated | | - - - - - - - - -### GenesisState.GenMsgs -GenMsgs define the messages that can be executed during genesis phase in order. -The intention is to have more human readable data that is auditable. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| store_code | [MsgStoreCode](#cosmwasm.wasm.v1beta1.MsgStoreCode) | | | -| instantiate_contract | [MsgInstantiateContract](#cosmwasm.wasm.v1beta1.MsgInstantiateContract) | | | -| execute_contract | [MsgExecuteContract](#cosmwasm.wasm.v1beta1.MsgExecuteContract) | | | - - - - - - - - -### Sequence -Sequence key and value of an id generation counter - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id_key | [bytes](#bytes) | | | -| value | [uint64](#uint64) | | | - - - - - - - - - - - - - - - - -

Top

- -## x/wasm/types/ibc.proto - - - - - -### MsgIBCCloseChannel -MsgIBCCloseChannel port and channel need to be owned by the contract - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| channel | [string](#string) | | | - - - - - - - - -### MsgIBCSend -MsgIBCSend - - -| 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 | - - - - - - - - - - - - - - - - -

Top

- -## x/wasm/types/proposal.proto - - - - - -### ClearAdminProposal -ClearAdminProposal gov proposal content type to clear the admin of a contract. - - -| 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 | - - - - - - - - -### 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. | -| init_msg | [bytes](#bytes) | | InitMsg 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. - - -| 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 | -| code_id | [uint64](#uint64) | | CodeID references the new WASM code | -| migrate_msg | [bytes](#bytes) | | MigrateMsg json encoded message to be passed to the contract on migration | - - - - - - - - -### PinCodesProposal -PinCodesProposal gov proposal content type to pin a set of code ids in the wasmvm cache. - - -| 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 | - - - - - - - - -### StoreCodeProposal -StoreCodeProposal gov proposal content type to submit WASM code to the system - - -| 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 | -| source | [string](#string) | | Source is a valid absolute HTTPS URI to the contract's source code, optional | -| builder | [string](#string) | | Builder is a valid docker image name with tag, optional | -| instantiate_permission | [AccessConfig](#cosmwasm.wasm.v1beta1.AccessConfig) | | InstantiatePermission to apply on contract creation, optional | - - - - - - - - -### UnpinCodesProposal -UnpinCodesProposal gov proposal content type to unpin a set of code ids in the wasmvm cache. - - -| 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 | - - - - - - - - -### UpdateAdminProposal -UpdateAdminProposal gov proposal content type to set an admin for a contract. - - -| 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 | - - - - - - - - - - - - - - - - -

Top

- -## x/wasm/types/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) | | | -| source | [string](#string) | | | -| builder | [string](#string) | | | - - - - - - - - -### ContractInfoWithAddress -ContractInfoWithAddress adds the address (key) to the ContractInfo representation - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| address | [string](#string) | | | -| contract_info | [ContractInfo](#cosmwasm.wasm.v1beta1.ContractInfo) | | | - - - - - - - - -### 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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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 | -| ----- | ---- | ----- | ----------- | -| contract_infos | [ContractInfoWithAddress](#cosmwasm.wasm.v1beta1.ContractInfoWithAddress) | 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 | -| ----------- | ------------ | ------------- | ------------| -| ContractInfo | [QueryContractInfoRequest](#cosmwasm.wasm.v1beta1.QueryContractInfoRequest) | [QueryContractInfoResponse](#cosmwasm.wasm.v1beta1.QueryContractInfoResponse) | ContractInfo gets the contract meta data | -| ContractHistory | [QueryContractHistoryRequest](#cosmwasm.wasm.v1beta1.QueryContractHistoryRequest) | [QueryContractHistoryResponse](#cosmwasm.wasm.v1beta1.QueryContractHistoryResponse) | ContractHistory gets the contract code history | -| ContractsByCode | [QueryContractsByCodeRequest](#cosmwasm.wasm.v1beta1.QueryContractsByCodeRequest) | [QueryContractsByCodeResponse](#cosmwasm.wasm.v1beta1.QueryContractsByCodeResponse) | ContractsByCode lists all smart contracts for a code id | -| AllContractState | [QueryAllContractStateRequest](#cosmwasm.wasm.v1beta1.QueryAllContractStateRequest) | [QueryAllContractStateResponse](#cosmwasm.wasm.v1beta1.QueryAllContractStateResponse) | AllContractState gets all raw store data for a single contract | -| RawContractState | [QueryRawContractStateRequest](#cosmwasm.wasm.v1beta1.QueryRawContractStateRequest) | [QueryRawContractStateResponse](#cosmwasm.wasm.v1beta1.QueryRawContractStateResponse) | RawContractState gets single key from the raw store data of a contract | -| SmartContractState | [QuerySmartContractStateRequest](#cosmwasm.wasm.v1beta1.QuerySmartContractStateRequest) | [QuerySmartContractStateResponse](#cosmwasm.wasm.v1beta1.QuerySmartContractStateResponse) | SmartContractState get smart query result from the contract | -| Code | [QueryCodeRequest](#cosmwasm.wasm.v1beta1.QueryCodeRequest) | [QueryCodeResponse](#cosmwasm.wasm.v1beta1.QueryCodeResponse) | Code gets the binary code and metadata for a singe wasm code | -| Codes | [QueryCodesRequest](#cosmwasm.wasm.v1beta1.QueryCodesRequest) | [QueryCodesResponse](#cosmwasm.wasm.v1beta1.QueryCodesResponse) | Codes gets the metadata for all stored wasm codes | - - - - - - -

Top

- -## x/wasm/types/tx.proto - - - - - -### MsgClearAdmin -MsgClearAdmin removes any admin stored 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 | - - - - - - - - -### 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 base64-encoded 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. | -| init_msg | [bytes](#bytes) | | InitMsg 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 | - - - - - - - - -### 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 base64-encoded 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 | -| migrate_msg | [bytes](#bytes) | | MigrateMsg 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 | -| source | [string](#string) | | Source is a valid absolute HTTPS URI to the contract's source code, optional | -| builder | [string](#string) | | Builder is a valid docker image name with tag, optional | -| instantiate_permission | [AccessConfig](#cosmwasm.wasm.v1beta1.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 | - - - - - - - - -### 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 | - - - - - - - - -### MsgUpdateAdminResponse -MsgUpdateAdminResponse returns empty data - - - - - - - - - - - - - - -### Msg -Msg defines the wasm Msg service. - -| Method Name | Request Type | Response Type | Description | -| ----------- | ------------ | ------------- | ------------| -| StoreCode | [MsgStoreCode](#cosmwasm.wasm.v1beta1.MsgStoreCode) | [MsgStoreCodeResponse](#cosmwasm.wasm.v1beta1.MsgStoreCodeResponse) | StoreCode to submit Wasm code to the system | -| InstantiateContract | [MsgInstantiateContract](#cosmwasm.wasm.v1beta1.MsgInstantiateContract) | [MsgInstantiateContractResponse](#cosmwasm.wasm.v1beta1.MsgInstantiateContractResponse) | Instantiate creates a new smart contract instance for the given code id. | -| ExecuteContract | [MsgExecuteContract](#cosmwasm.wasm.v1beta1.MsgExecuteContract) | [MsgExecuteContractResponse](#cosmwasm.wasm.v1beta1.MsgExecuteContractResponse) | Execute submits the given message data to a smart contract | -| MigrateContract | [MsgMigrateContract](#cosmwasm.wasm.v1beta1.MsgMigrateContract) | [MsgMigrateContractResponse](#cosmwasm.wasm.v1beta1.MsgMigrateContractResponse) | Migrate runs a code upgrade/ downgrade for a smart contract | -| UpdateAdmin | [MsgUpdateAdmin](#cosmwasm.wasm.v1beta1.MsgUpdateAdmin) | [MsgUpdateAdminResponse](#cosmwasm.wasm.v1beta1.MsgUpdateAdminResponse) | UpdateAdmin sets a new admin for a smart contract | -| ClearAdmin | [MsgClearAdmin](#cosmwasm.wasm.v1beta1.MsgClearAdmin) | [MsgClearAdminResponse](#cosmwasm.wasm.v1beta1.MsgClearAdminResponse) | ClearAdmin removes any admin stored for a smart contract | - - - - - - -

Top

- -## x/wasm/types/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.v1beta1.AccessType) | | | -| address | [string](#string) | | | - - - - - - - - -### AccessTypeParam -AccessTypeParam - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| value | [AccessType](#cosmwasm.wasm.v1beta1.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 | -| source | [string](#string) | | Source is a valid absolute HTTPS URI to the contract's source code, optional | -| builder | [string](#string) | | Builder is a valid docker image name with tag, optional | -| instantiate_config | [AccessConfig](#cosmwasm.wasm.v1beta1.AccessConfig) | | InstantiateConfig access control to apply on contract creation, optional | - - - - - - - - -### ContractCodeHistoryEntry -ContractCodeHistoryEntry metadata to a contract. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| operation | [ContractCodeHistoryOperationType](#cosmwasm.wasm.v1beta1.ContractCodeHistoryOperationType) | | | -| code_id | [uint64](#uint64) | | CodeID is the reference to the stored WASM code | -| updated | [AbsoluteTxPosition](#cosmwasm.wasm.v1beta1.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.v1beta1.AbsoluteTxPosition) | | Created Tx position when the contract was instantiated. This data should kept internal and not be exposed via query results. Just use for sorting | -| ibc_port_id | [string](#string) | | | - - - - - - - - -### 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 | - - - - - - - - -### Params -Params defines the set of wasm parameters. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| code_upload_access | [AccessConfig](#cosmwasm.wasm.v1beta1.AccessConfig) | | | -| instantiate_default_permission | [AccessType](#cosmwasm.wasm.v1beta1.AccessType) | | | -| max_wasm_code_size | [uint64](#uint64) | | | - - - - - - - - - - -### 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 an address | -| ACCESS_TYPE_EVERYBODY | 3 | AccessTypeEverybody unrestricted | - - - - - -### 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 | - - - - - - - - - - -## Scalar Value Types - -| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | -| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | -| double | | double | double | float | float64 | double | float | Float | -| float | | float | float | float | float32 | float | float | Float | -| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | -| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | -| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | -| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | -| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | -| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | -| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | -| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | -| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | -| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | -| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | -| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | -| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | - diff --git a/go.mod b/go.mod index 370ce61071..6ae87b271e 100644 --- a/go.mod +++ b/go.mod @@ -4,16 +4,16 @@ go 1.18 require ( github.com/cosmos/iavl v0.19.4 - github.com/cosmos/interchain-accounts v0.1.0 - github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b + github.com/dvsekhvalnov/jose2go v1.5.0 github.com/go-kit/kit v0.12.0 github.com/gogo/protobuf v1.3.3 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/line/lbm-sdk v0.46.1-0.20230106043757-1ece23d83a0b - github.com/line/ostracon v1.0.7 + github.com/line/ibc-go/v3 v3.3.2 + github.com/line/lbm-sdk v0.46.1-0.20230209105703-b88647308597 + github.com/line/ostracon v1.0.9-0.20230209043112-5aca894db3a6 github.com/line/wasmvm v1.1.1-0.11.1.0.20230417075905-90cc1950b4a1 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.14.0 @@ -23,18 +23,20 @@ require ( github.com/spf13/cast v1.5.0 github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 - github.com/spf13/viper v1.14.0 + 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 + google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef + google.golang.org/grpc v1.52.3 gopkg.in/yaml.v2 v2.4.0 ) require ( filippo.io/edwards25519 v1.0.0-rc.1 // indirect - github.com/99designs/keyring v1.1.6 // 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/VictoriaMetrics/fastcache v1.12.0 // indirect github.com/Workiva/go-datastructures v1.0.53 // indirect @@ -48,13 +50,11 @@ require ( github.com/coinbase/rosetta-sdk-go v0.8.2 // indirect github.com/confio/ics23/go v0.9.0 // indirect github.com/coniks-sys/coniks-go v0.0.0-20180722014011-11acf4819b71 // indirect - github.com/cosmos/btcutil v1.0.4 // indirect - github.com/cosmos/cosmos-sdk v0.45.1 // 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.11.1 // indirect - github.com/cosmos/ledger-go v0.9.2 // indirect - github.com/danieljoos/wincred v1.0.2 // indirect + github.com/cosmos/ledger-cosmos-go v0.12.1 // indirect + github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect @@ -64,12 +64,12 @@ require ( github.com/felixge/httpsnoop v1.0.1 // indirect github.com/fsnotify/fsnotify v1.6.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/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect + github.com/golang/glog v1.0.0 // indirect github.com/golang/snappy v0.0.4 // indirect - github.com/google/btree v1.0.0 // indirect + github.com/google/btree v1.1.2 // indirect github.com/google/orderedcode v0.0.1 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect @@ -81,13 +81,11 @@ require ( github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect - github.com/herumi/bls-eth-go-binary v0.0.0-20220509081320-2d8ab06de53c // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.0.1 // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/josharian/intern v1.0.0 // indirect - github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d // indirect - github.com/klauspost/compress v1.15.1 // indirect + github.com/klauspost/compress v1.15.11 // 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.7 // indirect @@ -95,47 +93,47 @@ require ( github.com/mattn/go-colorable v0.1.13 // 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-20181016162300-f8f6d4d2b643 // indirect + github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mtibben/percent v0.2.1 // indirect - github.com/pelletier/go-toml v1.9.5 // indirect - github.com/pelletier/go-toml/v2 v2.0.5 // indirect + github.com/onsi/ginkgo v1.16.4 // indirect + github.com/pelletier/go-toml/v2 v2.0.6 // indirect github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.39.0 // indirect github.com/prometheus/procfs v0.8.0 // indirect github.com/r2ishiguro/vrf v0.0.0-20180716233122-192de52975eb // indirect - github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect - github.com/rs/cors v1.8.2 // indirect - github.com/rs/zerolog v1.28.0 // indirect + github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect + github.com/rs/cors v1.8.3 // indirect + github.com/rs/zerolog v1.29.0 // 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/stretchr/objx v0.5.0 // indirect - github.com/subosito/gotenv v1.4.1 // indirect + github.com/subosito/gotenv v1.4.2 // indirect github.com/tendermint/btcd v0.1.1 // indirect github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 // indirect github.com/tendermint/go-amino v0.16.0 // indirect - github.com/tendermint/tendermint v0.34.20 // indirect - github.com/zondax/hid v0.9.0 // indirect + github.com/zondax/hid v0.9.1 // indirect + github.com/zondax/ledger-go v0.14.0 // indirect go.etcd.io/bbolt v1.3.6 // indirect - golang.org/x/crypto v0.4.0 // indirect + golang.org/x/crypto v0.5.0 // indirect golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect - golang.org/x/net v0.4.0 // indirect - golang.org/x/sys v0.3.0 // indirect - golang.org/x/term v0.3.0 // indirect - golang.org/x/text v0.5.0 // indirect - google.golang.org/protobuf v1.28.1 // indirect + golang.org/x/net v0.5.0 // indirect + golang.org/x/sys v0.4.0 // indirect + golang.org/x/term v0.4.0 // indirect + golang.org/x/text v0.6.0 // indirect + google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 // indirect gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect ) replace ( - // Use the cosmos-flavored keyring library - github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 + github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 // 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 diff --git a/go.sum b/go.sum index 8dc4bedb9e..fe4a61c3a6 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,3 @@ -4d63.com/gochecknoglobals v0.1.0/go.mod h1:wfdC5ZjKSPr7CybKEcgJhUOgeAQW1+7WcyK8OvUilfo= -bitbucket.org/creachadair/shell v0.0.6/go.mod h1:8Qqi/cYk7vPnsOePHroKXDJYmb5x7ENhtiFtfZq8K+M= 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= @@ -13,397 +11,186 @@ cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6 cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.60.0/go.mod h1:yw2G51M9IfRboUH61Us8GqCeF1PzPblB823Mn2q2eAU= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go 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.98.0/go.mod h1:ua6Ush4NALrHk5QXDWnjvZHN93OuF0HfuEPq9I1X0cM= -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/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/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/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/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= -cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= 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/pubsub v1.5.0/go.mod h1:ZEwJccE3z93Z2HWvstpri00jOg7oO4UZDtKhwDwqF0w= -cloud.google.com/go/spanner v1.7.0/go.mod h1:sd3K2gZ9Fd0vMPLXzeCrF6fq4i63Q7aTLW/lBIfBkIk= 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= -contrib.go.opencensus.io/exporter/stackdriver v0.13.4/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -filippo.io/edwards25519 v1.0.0-beta.2/go.mod h1:X+pm78QAUPtFLi1z9PYIlS/bdDnvbCOGKtZ+ACWEf7o= filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU= filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= -github.com/Antonboom/errname v0.1.6/go.mod h1:7lz79JAnuoMNDAWE9MeeIr1/c/VpSUWatBv2FH9NYpI= -github.com/Antonboom/nilnil v0.1.1/go.mod h1:L1jBqoWM7AOeTD+tSquifKSesRHs4ZdaxvZR+xdJEaI= -github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= -github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.19.0/go.mod h1:h6H6c8enJmmocHUbLiiGY6sx7f9i+X3m1CHdd5c6Rdw= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.11.0/go.mod h1:HcM1YX14R7CJcghJGOYCgdezslRSVzqwLf/q+4Y2r/0= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.7.0/go.mod h1:yqy467j36fJxcRV2TzfVZ1pCb5vxm4BtZPUdYWe/Xo8= -github.com/Azure/azure-storage-blob-go v0.7.0/go.mod h1:f9YQKtsG1nMisotuTPpO0tjNuEjKRYAcJU8/ydDI++4= -github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +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/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= -github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/adal v0.8.0/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= -github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= -github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= -github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= -github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= -github.com/GaijinEntertainment/go-exhaustruct/v2 v2.1.0/go.mod h1:LGOGuvEgCfCQsy3JF2tRmpGDpzA53iZfyGEWSPwQ6/4= -github.com/HdrHistogram/hdrhistogram-go v1.1.0/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= -github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= -github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/sprig v2.15.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= -github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= -github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= -github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= -github.com/Microsoft/go-winio v0.5.2 h1:a9IhgEQBCUEk6QCdml9CiJGhAws+YwffDHEMp1VMrpA= -github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= +github.com/Microsoft/go-winio v0.6.0 h1:slsWYD/zyx7lCXoZVlvQrj0hPTM1HI4+v1sIda2yDvg= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= -github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/OpenPeeDeeP/depguard v1.1.0/go.mod h1:JtAMzWkmFEzDPyAd+W0NHl1lvpQKTvT9jnRVsohBKpc= 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/VictoriaMetrics/fastcache v1.12.0 h1:vnVi/y9yKDcD9akmc4NqAoqgQhJrOwUF+j9LTgn4QDE= github.com/VictoriaMetrics/fastcache v1.12.0/go.mod h1:tjiYeEfYXCqacuvYw/7UoDIeJaNxq6132xHICNP77w8= 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.52/go.mod h1:Z+F2Rca0qCsVYDS8z7bAGm8f3UkzuWYS/oBZz5a7VVA= 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.1.13/go.mod h1:L5Z7tw+7lRK1Fnpi/LT/ooCP1elkXn0krMWBQHUhEDE= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= -github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= -github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= -github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= -github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= -github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/aokoli/goutils v1.0.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ= 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.3.9/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= -github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= 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/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= -github.com/ashanbrown/forbidigo v1.3.0/go.mod h1:vVW7PEdqEFqapJe95xHkTfB1+XvZXBFg8t0sG2FIxmI= -github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI= github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= -github.com/aws/aws-sdk-go v1.23.20/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.25.37/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -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.36.30/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= -github.com/aws/aws-sdk-go v1.40.45/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aws/aws-sdk-go-v2 v1.9.1/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= -github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.8.1/go.mod h1:CM+19rL1+4dFWnOQKwDc7H1KwXTz+h61oUSHyhV0b3o= -github.com/aws/smithy-go v1.8.0/go.mod h1:SObp3lf9smib00L/v3U2eAKG8FyQ7iLrJnQiAmR5n+E= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= -github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= -github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= -github.com/bkielbasa/cyclop v1.2.0/go.mod h1:qOI0yy6A7dYC4Zgsa72Ppm9kONl0RoIlPbzot9mhmeI= -github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= -github.com/bombsimon/wsl/v3 v3.3.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= -github.com/breml/bidichk v0.2.3/go.mod h1:8u2C6DnAy0g2cEq+k/A2+tr9O1s+vHGxWn0LTc70T2A= -github.com/breml/errchkjson v0.3.0/go.mod h1:9Cogkyv9gcT8HREpzi3TiqBxCqDzo8awa92zSDFcofU= -github.com/btcsuite/btcd v0.0.0-20171128150713-2e60448ffcc6/go.mod h1:Dmm/EzmjnCiweXmzRIAiUWCInVmPgjkzgv5k4tVyXiQ= -github.com/btcsuite/btcd v0.0.0-20190115013929-ed77733ec07d/go.mod h1:d3C0AkH6BRcvO8T0UEPu53cnw4IbV63x1bEjildYhO0= -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.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA= github.com/btcsuite/btcd v0.22.1 h1:CnwP9LM/M9xuRrGSCGeMVs9iv09uMqwsVX7EeIpgV2c= github.com/btcsuite/btcd v0.22.1/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y= +github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= -github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= -github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= -github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= -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/btcutil v1.0.3-0.20201208143702-a53e38424cce/go.mod h1:0DVlHczLPewLcPGEIeUEzfOJhqGPQ0mJJRDBtD307+o= -github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= -github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= -github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= -github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= -github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= -github.com/bufbuild/buf v1.4.0/go.mod h1:mwHG7klTHnX+rM/ym8LXGl7vYpVmnwT96xWoRB4H5QI= -github.com/butuzov/ireturn v0.1.1/go.mod h1:Wh6Zl3IMtTpaIKbmwzqi6olnM9ptYQxxVacMsOEFPoc= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= -github.com/casbin/casbin/v2 v2.37.0/go.mod h1:vByNa/Fchek0KZUgG5wEsl7iFsiviAYKRtgrQfcJqHg= 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/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW+s= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/charithe/durationcheck v0.0.9/go.mod h1:SSbRIBVfMjCi/kEB6K65XEA83D6prSM8ap1UCpNKtgg= -github.com/chavacava/garif v0.0.0-20220316182200-5cad0b5181d4/go.mod h1:W8EnPSQ8Nv4fUjc/v1/8tHFqhuOJXnRub0dTfuAQktU= -github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= -github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= -github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= 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/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= -github.com/cloudflare/cloudflare-go v0.10.2-0.20190916151808-a80f83b9add9/go.mod h1:1MxXX1Ux4x6mqPmjkUgTP1CdXIBXKX7T+Jk9Gxrmx+U= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= -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-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= 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/go.mod h1:7nD3oBPIiHqhRprqvMgPoGxe/nyq3yftRmpsy29coWE= github.com/coinbase/rosetta-sdk-go v0.8.2 h1:+sNgMUPpntOsYLy5aRsHqBY6I0MTxZkS4JXV1Un3DKc= github.com/coinbase/rosetta-sdk-go v0.8.2/go.mod h1:tXPR6AIW9ogsH4tYIaFOKOgfJNanCvcyl7JKLd4DToc= -github.com/confio/ics23/go v0.6.6/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg= -github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= -github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= github.com/coniks-sys/coniks-go v0.0.0-20180722014011-11acf4819b71 h1:MFLTqgfJclmtaQ1SRUrWwmDX/1UBok3XWUethkJ2swQ= github.com/coniks-sys/coniks-go v0.0.0-20180722014011-11acf4819b71/go.mod h1:TrHYHH4Wze7v7Hkwu1MH1W+mCPQKM+gs+PicdEV14o8= -github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= -github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= -github.com/containerd/continuity v0.0.0-20190827140505-75bee3e2ccb6/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= -github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-semver v0.3.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 v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20190620071333-e64a0ec8b42a/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= 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/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/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-sdk v0.45.1 h1:PY79YxPea5qlRLExRnzg8/rT1Scc8GGgRs22p7DX99Q= -github.com/cosmos/cosmos-sdk v0.45.1/go.mod h1:XXS/asyCqWNWkx2rW6pSuen+EVcpAFxq6khrhnZgHaQ= +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-sdk/ics23/go v0.8.0 h1:iKclrn3YEOwk4jQHT2ulgzuXyxmzmPczUalMwW4XH9k= +github.com/cosmos/cosmos-sdk/ics23/go v0.8.0/go.mod h1:2a4dBq88TUoqoWAU5eu0lGvpFP3wWDPgdHPargtyw30= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y= github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= -github.com/cosmos/iavl v0.17.3/go.mod h1:prJoErZFABYZGDHka1R6Oay4z9PrNeFFiMKHDAMOi4w= 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/interchain-accounts v0.1.0 h1:QmuwNsf1Hxl3P5GSGt7Z+JeuHPiZw4Z34R/038P5T6s= -github.com/cosmos/interchain-accounts v0.1.0/go.mod h1:Fv6LXDs+0ng4mIDVWwEJMXbAIMxY4kiq+A7Bw1Fb9AY= -github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 h1:DdzS1m6o/pCqeZ8VOAit/gyATedRgjvkVI+UCrLpyuU= -github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76/go.mod h1:0mkLWIoZuQ7uBoospo5Q9zIpqq6rYCPJDSUdeCJvPM8= -github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4= -github.com/cosmos/ledger-cosmos-go v0.11.1/go.mod h1:J8//BsAGTo3OC/vDLjMRFLW6q0WAaXvHnVc7ZmE8iUY= -github.com/cosmos/ledger-go v0.9.2 h1:Nnao/dLwaVTk1Q5U9THldpUMMXU94BOTWPddSmVB6pI= -github.com/cosmos/ledger-go v0.9.2/go.mod h1:oZJ2hHAZROdlHiwTg4t7kP+GKIIkBT+o6c9QWFanOyI= +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/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.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= -github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= -github.com/daixiang0/gci v0.3.3/go.mod h1:1Xr2bxnQbDxCqqulUOv8qpGqkgRw9RSCGGjEC2LjF8o= -github.com/danieljoos/wincred v1.0.2 h1:zf4bhty2iLuwgjgpraD2E9UbvO+fe54XXGJbOwe23fU= -github.com/danieljoos/wincred v1.0.2/go.mod h1:SnuYRW9lp1oJrZX/dXJqr0cPK5gYXqx3EJbmjhLdK9U= -github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= +github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 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/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= -github.com/denis-tingaikin/go-header v0.4.3/go.mod h1:0wOCWuN71D5qIgE2nz9KrKmuYBAC2Mra5RassOIQ2/c= -github.com/denisenkom/go-mssqldb v0.12.0/go.mod h1:iiK0YP1ZeepvmBQk/QpLEhhTNJgfzrpArPY/aFvc9yU= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= 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/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/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= -github.com/docker/cli v20.10.14+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/cli v20.10.17+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.17+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= -github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= -github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/dop251/goja v0.0.0-20200721192441-a695b0cdd498/go.mod h1:Mw6PkjjMXWbTj+nnj4s3QPXq1jaT0s5pC0iFD4+BOAA= +github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= 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/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b h1:HBah4D48ypg3J7Np4N+HY/ZR76fx3HEUGxDU6Uk39oQ= -github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b/go.mod h1:7BvyPhdbLxMXIYTFPLsyJRFMsKmOZnQmzh6Gb+uquuM= -github.com/dvyukov/go-fuzz v0.0.0-20200318091601-be3528f3a813/go.mod h1:11Gm+ccJnvAhCNLlf5+cS9KjtbaD5I5zaZpFMsTHWTw= +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/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.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= -github.com/envoyproxy/protoc-gen-validate v0.0.14/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= -github.com/esimonov/ifshort v1.0.4/go.mod h1:Pe8zjlRrJ80+q2CxHLfEOfTwxCZ4O+MuhcHcfgNWTk0= -github.com/ethereum/go-ethereum v1.9.25/go.mod h1:vMkFiYLHI4tgPw4k2j4MHKoovchFE8plZ0M9VMk4/oM= -github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA9o9VY= -github.com/facebookgo/ensure v0.0.0-20160127193407-b4ab57deab51/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= 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/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= -github.com/facebookgo/subset v0.0.0-20150612182917-8dac2c3c4870/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= 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.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= -github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= -github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/firefart/nonamedreturns v1.0.1/go.mod h1:D3dpIBojGGNh5UfElmwPu73SwDCm+VKhHYqwlNOk2uQ= -github.com/fjl/memsize v0.0.0-20180418122429-ca190fb6ffbc/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= -github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= -github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= -github.com/franela/goblin v0.0.0-20210519012713-85d372ac71e2/go.mod h1:VzmDKDJVZI3aJmnRI9VjAn9nJ8qPPsN1fqzr9dqInIo= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= -github.com/frankban/quicktest v1.14.2/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= -github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= -github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/fullstorydev/grpcurl v1.6.0/go.mod h1:ZQ+ayqbKMJNhzLmbpCiurTVlaK2M/3nqZCxaQ2Ze/sM= -github.com/fzipp/gocyclo v0.5.1/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= -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/go-critic/go-critic v0.6.3/go.mod h1:c6b3ZP1MQ7o6lPR7Rv3lEf7pYQUmAcx8ABHgdZCQt/k= 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= @@ -412,17 +199,13 @@ 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-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +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= @@ -430,25 +213,9 @@ github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD87 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-redis/redis v6.15.8+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= -github.com/go-sourcemap/sourcemap v2.1.2+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4= -github.com/go-toolsmith/astcopy v1.0.0/go.mod h1:vrgyG+5Bxrnz4MZWPF+pI4R8h3qKRjjyvV/DSez4WVQ= -github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= -github.com/go-toolsmith/astequal v1.0.1/go.mod h1:4oGA3EZXTVItV/ipGiOx7NWkY5veFfcsOJVS2YxltLw= -github.com/go-toolsmith/astfmt v1.0.0/go.mod h1:cnWmsOAuq4jJY6Ct5YWlVLmcmLMn1JUPuQIHCY7CJDw= -github.com/go-toolsmith/astp v1.0.0/go.mod h1:RSyrtpVlfTFGDYRbrjyWP1pYu//tSFcvdYrA8meBmLI= -github.com/go-toolsmith/pkgload v1.0.2-0.20220101231613-e814995d17c5/go.mod h1:3NAwwmD4uY/yggRxoEjk/S00MIV3A+H7rrE3i87eYxM= -github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= -github.com/go-toolsmith/typep v1.0.2/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= -github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= -github.com/go-zookeeper/zk v1.0.2/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw= -github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= @@ -458,33 +225,22 @@ github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/E 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/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= 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/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= -github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+wXQnTPR4KqTKDgJukSZ6amVRtWMPEjE6sQoK8= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= -github.com/golang/mock v1.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.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= 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= @@ -501,30 +257,16 @@ 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= -github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= -github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= -github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe/go.mod h1:gjqyPShc/m8pEMpk0a3SeagVb0kaqvhscv+i9jI5ZhQ= -github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU= -github.com/golangci/golangci-lint v1.46.2/go.mod h1:3DkdHnxn9eoTTrpT2gB0TEv8KSziuoqe9FitgQLHvAY= -github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= -github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o= -github.com/golangci/misspell v0.3.5/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA= -github.com/golangci/revgrep v0.0.0-20210930125155-c22e5001d4f2/go.mod h1:LK+zW4MpyytAWQRz0M4xnzEk50lSvqDQKfx304apFkY= -github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/certificate-transparency-go v1.0.21/go.mod h1:QeJfpSbVSfYc7RgB3gJFj9cbuQMMchQxrWXz8Ruopmg= -github.com/google/certificate-transparency-go v1.1.1/go.mod h1:FDKqPvSXawb2ecErVRrD+nfy23RCzyl7eqVCEmlT1Zs= +github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= +github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= @@ -533,22 +275,16 @@ 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/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= 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= @@ -557,38 +293,17 @@ github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200507031123-427632fa3b1c/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/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/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= -github.com/google/trillian v1.3.11/go.mod h1:0tPraVHrSDkA3BO6vKX67zgLXs6SsOAbHEivX+9mPgw= -github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 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/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/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/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/gookit/color v1.5.0/go.mod h1:43aQb+Zerm/BWh2GnrgOQm7ffz7tvQXEKV6BFMl7wAo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gordonklaus/ineffassign v0.0.0-20200309095847-7953dde2c7bf/go.mod h1:cuNKsD1zp2v6XfE/orVX2QE1LC+i254ceGcVeDT3pTU= -github.com/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= -github.com/gorhill/cronexpr v0.0.0-20180427100037-88b0669f7d75/go.mod h1:g2644b03hfBX9Ov0ZBDgXXens4rxSxmqFBbhvKv2yVA= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= @@ -597,36 +312,16 @@ 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.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= -github.com/gostaticanalysis/analysisutil v0.0.3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= -github.com/gostaticanalysis/analysisutil v0.1.0/go.mod h1:dMhHRU9KTiDcuLGdy87/2gTR8WruwYZrKdRq9m1O6uw= -github.com/gostaticanalysis/analysisutil v0.4.1/go.mod h1:18U/DLpRgIUd459wGxVHE0fRgmo1UgHDcbw7F5idXu0= -github.com/gostaticanalysis/analysisutil v0.7.1/go.mod h1:v21E3hY37WKMGSnbsw2S/ojApNWb6C1//mXO48CXbVc= -github.com/gostaticanalysis/comment v1.3.0/go.mod h1:xMicKDx7XRXYdVwY9f9wQpDJVnqWxw9wCauCMKp+IBI= -github.com/gostaticanalysis/comment v1.4.1/go.mod h1:ih6ZxzTHLdadaiSnF5WY3dxUoXfXAlTaRzuaNDlSado= -github.com/gostaticanalysis/comment v1.4.2/go.mod h1:KLUTGDv6HOCotCH8h2erHKmpci2ZoR8VPu34YA2uzdM= -github.com/gostaticanalysis/forcetypeassert v0.1.0/go.mod h1:qZEedyP/sY1lTGV1uJ3VhWZ2mqag3IkWsDHVbplHXak= -github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= -github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= -github.com/gostaticanalysis/testutil v0.4.0/go.mod h1:bLIoPefWXrRi/ssLFWX1dx7Repi5x3CuviD3dgAZaBU= -github.com/gotestyourself/gotestyourself v2.2.0+incompatible/go.mod h1:zZKM6oeNM8k+FRljX1mnzVYeS8wiGgQyvST1/GafPbY= -github.com/graph-gophers/graphql-go v0.0.0-20191115155744-f33e81362277/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLtHm77vfxsvsIN5Vuc= -github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= 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.0/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.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c h1:6rhixN/i8ZofjG1Y75iExal34USq5p+wiN1tpie8IrU= @@ -636,454 +331,213 @@ github.com/gtank/merlin v0.1.1 h1:eQ90iG7K9pOhtereWsmyRJ6RAwcP4tHTDBHXNg+u5is= github.com/gtank/merlin v0.1.1/go.mod h1:T86dnYJhcGOh5BjZFCJWTDeTK7XW8uE+E21Cy/bIQ+s= github.com/gtank/ristretto255 v0.1.2 h1:JEqUCPA1NvLq5DwYtuzigd7ss8fwbYay9fi4/5uMzcc= github.com/gtank/ristretto255 v0.1.2/go.mod h1:Ph5OpO6c7xKUGROZfWVLiJf9icMDwUeIvY4OmlYW69o= -github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= -github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= -github.com/hashicorp/consul/api v1.11.0/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= -github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= -github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= -github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= 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/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v1.0.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-hclog v1.2.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= -github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d h1:dg1dEPuWpEqDnvIw251EVy4zlP8gWbsGj4BsUKCRpYs= github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= -github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= -github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= -github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= -github.com/hashicorp/serf v0.9.7/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= -github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87/go.mod h1:XGsKKeXxeRr95aEOgipvluMPlgjr7dGlk9ZTWOjcUcg= github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 h1:aSVUgRRRtOrZOC1fYmY9gV0e9z/Iu+xNVSASWjsuyGU= github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3/go.mod h1:5PC6ZNPde8bBqU/ewGZig35+UIZtw9Ytxez8/q5ZyFE= -github.com/herumi/bls-eth-go-binary v0.0.0-20220509081320-2d8ab06de53c h1:ppGSVyhAFh8VAGyDuNeLEGMYRJR5iDI92QgDNrMIqK0= -github.com/herumi/bls-eth-go-binary v0.0.0-20220509081320-2d8ab06de53c/go.mod h1:luAnRm3OsMQeokhGzpYmc0ZKwawY7o87PUEP11Z7r7U= -github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= -github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= -github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/hudl/fargo v1.4.0/go.mod h1:9Ai6uvFy5fQNq6VPKtg+Ceq1+eTY4nKUlR2JElEOcDo= -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/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/imdario/mergo v0.3.4/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= -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/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= -github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= -github.com/jdxcode/netrc v0.0.0-20210204082910-926c7f70242a/go.mod h1:Zi/ZFkEqFHTm7qkjyNJjaWH4LQA9LQhGJyF0lTYGpxw= -github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= -github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jgautheron/goconst v1.5.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= -github.com/jhump/gopoet v0.0.0-20190322174617-17282ff210b3/go.mod h1:me9yfT6IJSlOL3FCfrg+L6yzUEZ+5jW6WHt4Sk+UPUI= -github.com/jhump/gopoet v0.1.0/go.mod h1:me9yfT6IJSlOL3FCfrg+L6yzUEZ+5jW6WHt4Sk+UPUI= -github.com/jhump/goprotoc v0.5.0/go.mod h1:VrbvcYrQOrTi3i0Vf+m+oqQWk9l72mjkJCYo7UvLHRQ= -github.com/jhump/protocompile v0.0.0-20220216033700-d705409f108f/go.mod h1:qr2b5kx4HbFS7/g4uYO5qv9ei8303JMsC7ESbYiqr2Q= -github.com/jhump/protoreflect v1.6.1/go.mod h1:RZQ/lnuN+zqeRVpQigTwO6o0AJUkxbnSnpuG7toUTG4= -github.com/jhump/protoreflect v1.9.0/go.mod h1:7GcYQDdMU/O/BBrl/cX6PNHpXh6cenjd8pneu5yW7Tg= -github.com/jhump/protoreflect v1.11.0/go.mod h1:U7aMIjN0NWq9swDP7xDdoMfRHb35uiuTd3Z9nFXJf5E= -github.com/jhump/protoreflect v1.12.1-0.20220417024638-438db461d753/go.mod h1:JytZfP5d0r8pVNLZvai7U/MCuTWITgrI4tTg7puQFKI= github.com/jhump/protoreflect v1.12.1-0.20220721211354-060cc04fc18b h1:izTof8BKh/nE1wrKOrloNA5q4odOarjf+Xpe+4qow98= -github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= -github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= -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/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jonboulle/clockwork v0.2.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/josharian/txtarfs v0.0.0-20210218200122-0702f000015a/go.mod h1:izVPOvVRsHiKkeGCT6tYBNWyDVuzj9wAaBb5R9qamfw= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= -github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= -github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/juju/ratelimit v1.0.1/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSgWNm/qk= -github.com/julienschmidt/httprouter v1.1.1-0.20170430222011-975b5c4c7c21/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= -github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= -github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= -github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= -github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d h1:Z+RDyXzjKE0i2sTjZ/b1uxiGtPhFy34Ou/Tk0qwN0kM= -github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d/go.mod h1:JJNrCn9otv/2QP4D7SMJBgaleKpOf66PnW6F5WGNRIc= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/errcheck v1.6.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/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.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.13.5/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.15.1 h1:y9FcTHGyrebwfP0ZZqFiaxTaiDnUrGkJkI+f583BL1A= -github.com/klauspost/compress v1.15.1/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/pgzip v1.2.5/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= +github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= +github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= 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.2/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.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= -github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kulti/thelper v0.6.2/go.mod h1:DsqKShOvP40epevkFrvIwkCMNYxMeTNjdWL4dqWHZ6I= -github.com/kunwardeep/paralleltest v1.0.3/go.mod h1:vLydzomDFpk7yu5UX02RmP0H8QfRPOV/oFhWN85Mjb4= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/kyoh86/exportloopref v0.1.8/go.mod h1:1tUcJeiioIs7VWe5gcOObrux3lb66+sBqGZrRkMwPgg= -github.com/ldez/gomoddirectives v0.2.3/go.mod h1:cpgBogWITnCfRq2qGoDkKMEVSaarhdBr6g8G04uz6d0= -github.com/ldez/tagliatelle v0.3.1/go.mod h1:8s6WJQwEYHbKZDsp/LjArytKOG8qaMrKQQ3mFukHs88= 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/leonklingele/grouper v1.1.0/go.mod h1:uk3I3uDfi9B6PeUjsCKi6ndcf63Uy7snXgR4yDYQVDY= -github.com/letsencrypt/pkcs11key/v4 v4.0.0/go.mod h1:EFUvBDay26dErnNb70Nd0/VW3tJiIbETBPTl9ATXQag= -github.com/lib/pq v0.0.0-20180327071824-d34b9ff171c2/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.8.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.4/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= 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.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoRZd1Vi32+RXyFM= 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/line/lbm-sdk v0.46.1-0.20230106043757-1ece23d83a0b h1:1+GG69CVRO1tXeywJrY6jGeW4+SPXrmGRwB9ARmYP5w= -github.com/line/lbm-sdk v0.46.1-0.20230106043757-1ece23d83a0b/go.mod h1:rSDmksVcmPZfREb7+fPjxsMYF3WN1PQgSU/ZLbN8szE= -github.com/line/ostracon v1.0.7 h1:8vh/gsM6Sf6z2s38og8YufIhrWN2TwXpm4I3DqKEVyI= -github.com/line/ostracon v1.0.7/go.mod h1:gmEKYdaMaDAl5xJ8sJJo0s6OvzBSZwM01nWRCGA5oDY= -github.com/line/wasmvm v1.1.1-0.11.1.0.20230411020707-2c416761ae1a h1:7h6WnkxPCJCJ1EEIkr/stxsa7q9ZzrcNS+xBibhe71c= -github.com/line/wasmvm v1.1.1-0.11.1.0.20230411020707-2c416761ae1a/go.mod h1:Lq3FVvi/rb+OOlTxqtcqcao2GGESQ4hUpuXMcjdJbco= -github.com/line/wasmvm v1.1.1-0.11.1.0.20230414023914-cd1be91ce504 h1:4e/GalI4ApXzWmSOobb170NCM/f/kkklQkjy6YhsjvQ= -github.com/line/wasmvm v1.1.1-0.11.1.0.20230414023914-cd1be91ce504/go.mod h1:Lq3FVvi/rb+OOlTxqtcqcao2GGESQ4hUpuXMcjdJbco= +github.com/line/ibc-go/v3 v3.3.2 h1:EgQ5NARjzm8oi6jyze6mfLwWQsMoNAUuq9mQh4IhsO0= +github.com/line/ibc-go/v3 v3.3.2/go.mod h1:iIUVJLrKDzW/y1nrNQ3XyVrQ3FjNyd6fjgWTBbldAaQ= +github.com/line/lbm-sdk v0.46.1-0.20230209105703-b88647308597 h1:J0Pr378D5JmHNjifZXVigAIunJXD2JDHJE/lY3tYTQc= +github.com/line/lbm-sdk v0.46.1-0.20230209105703-b88647308597/go.mod h1:Od+QeMi4JO4HB3HEdPTqzI7mAvn1w99PZ9pmKmtNDco= +github.com/line/ostracon v1.0.9-0.20230209043112-5aca894db3a6 h1:nuM0PTB04PCax35+u8LRpTufdmwoPZcBhhKjqbezMYA= +github.com/line/ostracon v1.0.9-0.20230209043112-5aca894db3a6/go.mod h1:iLRth/ryufyNePzJ1ULJ4S8SYGUD/lF+aIFUTRKY9tQ= github.com/line/wasmvm v1.1.1-0.11.1.0.20230417075905-90cc1950b4a1 h1:0hVPU8sFOyP3Clht8FKMLXpXg3C4q8soAlvuOeG1lvY= github.com/line/wasmvm v1.1.1-0.11.1.0.20230417075905-90cc1950b4a1/go.mod h1:Lq3FVvi/rb+OOlTxqtcqcao2GGESQ4hUpuXMcjdJbco= -github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= -github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= -github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= -github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= -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/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/maratori/testpackage v1.0.1/go.mod h1:ddKdw+XG0Phzhx8BFDTKgpWP4i7MpApTE5fXSKAqwDU= -github.com/matoous/godox v0.0.0-20210227103229-6504466cf951/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= -github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.0/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-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.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= -github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/mattn/go-isatty v0.0.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/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mbilski/exhaustivestruct v1.2.0/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc= -github.com/mgechev/dots v0.0.0-20210922191527-e955255bf517/go.mod h1:KQ7+USdGKfpPjXk4Ga+5XxQM4Lm4e3gAogrreFAYpOg= -github.com/mgechev/revive v1.2.1/go.mod h1:+Ro3wqY4vakcYNtkBWdZC7dBg1xSB6sp054wWwmeFm0= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= -github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= -github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= -github.com/miekg/dns v1.1.43/go.mod h1:+evo5L0630/F6ca/Z9+GAqzhjGyn8/c+TBaOyfEl0V4= -github.com/miekg/pkcs11 v1.0.2/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= -github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= -github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643 h1:hLDRPB66XQT/8+wG9WsDpiCvZf1yKO7sz7scAjSlBa0= +github.com/miekg/dns v1.1.50 h1:DQUfb9uc6smULcREF09Uc+/Gd46YWqJd5DbpPE9xkcA= github.com/mimoo/StrobeGo v0.0.0-20181016162300-f8f6d4d2b643/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= -github.com/minio/highwayhash v1.0.1/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= +github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 h1:QRUSJEgZn2Snx0EmT/QLXibWjSUDjKWvXIT19NBVp94= +github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0/go.mod h1:43+3pMjjKimDBf5Kr4ZFNGbLql1zKkbImw+fZbw3geM= github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= -github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-ps v1.0.0/go.mod h1:J4lOc8z8yJs6vUwklHw2XEIiT4z4C40KtWVN3nvg8Pg= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= -github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU= -github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= -github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= -github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= -github.com/moricho/tparallel v0.2.1/go.mod h1:fXEIZxG2vdfl0ZF8b42f5a78EhjjD5mX8qUplsoSU4k= -github.com/mozilla/scribe v0.0.0-20180711195314-fb71baf557c1/go.mod h1:FIczTrinKo8VaLxe6PWTPEXRXDIHz2QAwiaBaP5/4a8= -github.com/mozilla/tls-observatory v0.0.0-20210609171429-7bc42856d2e5/go.mod h1:FUqVoUPHSEdDR0MnFM3Dh8AU0pZHLXUD127SAJGER/s= -github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= github.com/mtibben/percent v0.2.1/go.mod h1:KG9uO+SZkUp+VkRHsCdYQV3XSZrrSpR3O9ibNBTZrns= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mwitkow/go-proto-validators v0.0.0-20180403085117-0950a7990007/go.mod h1:m2XC9Qq0AlmmVksL6FktJCdTYyLk7V3fKyp0sl1yWQo= -github.com/mwitkow/go-proto-validators v0.2.0/go.mod h1:ZfA1hW+UH/2ZHOWvQ3HnQaU0DtnpXu850MZiy+YUgcc= github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76/go.mod h1:x5OoJHDHqxHS801UIuhqGl6QdSAEJvtausosHSdazIo= -github.com/nakabonne/nestif v0.3.1/go.mod h1:9EtoZochLn5iUprVDmDjqGKPofoUEBL8U4Ngq6aY7OE= -github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= -github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= -github.com/nats-io/jwt v1.2.2/go.mod h1:/xX356yQA6LuXI9xWW7mZNpxgF2mBmGecH+Fj34sP5Q= -github.com/nats-io/jwt/v2 v2.0.3/go.mod h1:VRP+deawSXyhNjXmxPCHskrR6Mq50BqpEI5SEcNiGlY= github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= -github.com/nats-io/nats-server/v2 v2.5.0/go.mod h1:Kj86UtrXAL6LwYRA6H4RqzkHhK0Vcv2ZnKD5WbQ1t3g= github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= -github.com/nats-io/nats.go v1.12.1/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= 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/nkeys v0.2.0/go.mod h1:XdZpAbhgyyODYqjTawOnIOI7VlbKSarI9Gfy1tqEu/s= -github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354/go.mod h1:KSVJerMDfblTH7p5MZaTt+8zaT2iEk3AkVb9PQdZuE8= -github.com/neilotoole/errgroup v0.1.5/go.mod h1:Q2nLGf+594h0CLBs/Mbg6qOr7GtqDK7C2S41udRnToE= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nishanths/exhaustive v0.7.11/go.mod h1:gX+MP7DWMKJmNa1HfMozK+u04hQd3na9i0hyqf3/dOI= -github.com/nishanths/predeclared v0.0.0-20190419143655-18a43bb90ffc/go.mod h1:62PewwiQTlm/7Rj+cxVYqZvDIUc+JjZq6GHAC1fsObQ= -github.com/nishanths/predeclared v0.0.0-20200524104333-86fad755b4d3/go.mod h1:nt3d53pc1VYcphSCIaYAJtnPYnr3Zyn8fMq2wvPGPso= -github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/oklog/ulid/v2 v2.0.2/go.mod h1:mtBL0Qe/0HAx6/a4Z30qxVIAL1eQDweXq5lxOEiwQ68= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.2-0.20190409134802-7e037d187b0c/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -github.com/olekukonko/tablewriter v0.0.2/go.mod h1:rSAaSIOAGT9odnlyGlUfAJaoc5w2fSBUmeGDbRWPxyQ= -github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= -github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= -github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= -github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= 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-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= -github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.0.2 h1:9yCKha/T5XdGtO0q9Q9a6T5NUCsTn/DrBg0D7ufOcFM= -github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= -github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= -github.com/opencontainers/runc v1.1.2/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= +github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= -github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= -github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= -github.com/opencontainers/selinux v1.10.0/go.mod h1:2i0OySw99QjzBBQByd1Gr9gSjvuho1lHsJxIJ3gGbJI= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/openzipkin/zipkin-go v0.2.5/go.mod h1:KpXfKdgRDnnhsxw4pNIH9Md5lyFqKUa4YDFlwRYAMyE= github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA= -github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs= -github.com/ory/dockertest/v3 v3.9.1/go.mod h1:42Ir9hmvaAPm0Mgibk6mBPi7SFvTXxEcnztDYOJ//uM= -github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= -github.com/otiai10/copy v1.6.0/go.mod h1:XWfuS3CrI0R6IE0FbgHsEazaXO8G0LpMp9o8tos0x4E= -github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= -github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= -github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= -github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= -github.com/otiai10/mint v1.3.2/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= -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.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= -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.0-beta.8/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pelletier/go-toml/v2 v2.0.0/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pelletier/go-toml/v2 v2.0.1/go.mod h1:r9LEWfGN8R5k0VXJ+0BkIe7MYkRdwZOjgMj2KwnJFUo= -github.com/pelletier/go-toml/v2 v2.0.2/go.mod h1:MovirKjgVRESsAvNZlAjtFwV867yGuwRkXbG66OzopI= -github.com/pelletier/go-toml/v2 v2.0.5 h1:ipoSadvV8oGUjnUbMub59IDPPwfxF694nG/jwbMiyQg= -github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= +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/performancecopilot/speed/v4 v4.0.0/go.mod h1:qxrSyuDGrTOWfV+uKRFhfxw6h/4HXRGUiZiufxo49BM= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/peterh/liner v1.1.1-0.20190123174540-a2c9a5303de7/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw= github.com/philhofer/fwd v1.1.1/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/profile v1.6.0/go.mod h1:qBsxPvzyUincmltOk6iyRVxHYg4adc0OFOv72ZdLa18= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= -github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/polyfloyd/go-errorlint v1.0.0/go.mod h1:KZy4xxPJyy88/gldCe5OdW6OQRtNO3EZE7hXzmnebgA= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= -github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= -github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.8.0/go.mod h1:O9VU6huf47PktckDQfMTX0Y8tY0/7TSWwj+ITvv0TnM= -github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.11.1/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= -github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.12.2/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= @@ -1094,146 +548,74 @@ 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.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.14.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= 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.29.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.34.0/go.mod h1:gB3sOl7P0TvJabZpLY5uQMpUqRCPPCyRLCZYc7JZTNE= github.com/prometheus/common v0.39.0 h1:oOyhkDq05hPZKItWVBkJ6g6AtGxi+fy7F4JvUV8uhsI= github.com/prometheus/common v0.39.0/go.mod h1:6XBZ7lYdLCbkAVhwRsWTZn+IN5AB9F/NXd5w0BbEX0Y= 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.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= 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.2.0/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/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/pseudomuto/protoc-gen-doc v1.3.2/go.mod h1:y5+P6n3iGrbKG+9O04V5ld71in3v/bX88wUwgt+U8EA= -github.com/pseudomuto/protokit v0.2.0/go.mod h1:2PdH30hxVHsup8KpBTOXTBeMVhJZVio3Q8ViKSAXT0Q= -github.com/quasilyte/go-ruleguard v0.3.1-0.20210203134552-1b5a410e1cc8/go.mod h1:KsAh3x0e7Fkpgs+Q9pNLS5XpFSvYCEVl5gP9Pp1xp30= -github.com/quasilyte/go-ruleguard v0.3.16-0.20220213074421-6aa060fab41a/go.mod h1:VMX+OnnSw4LicdiEGtRSD/1X8kW7GuEscjYNr4cOIT4= -github.com/quasilyte/go-ruleguard/dsl v0.3.0/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= -github.com/quasilyte/go-ruleguard/dsl v0.3.16/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= -github.com/quasilyte/go-ruleguard/dsl v0.3.19/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= -github.com/quasilyte/go-ruleguard/rules v0.0.0-20201231183845-9e62ed36efe1/go.mod h1:7JTjp89EGyU1d6XfBiXihJNG37wB2VRkd125Q1u7Plc= -github.com/quasilyte/go-ruleguard/rules v0.0.0-20211022131956-028d6511ab71/go.mod h1:4cgAphtvu7Ftv7vOT2ZOYhC6CvBxZixcasr8qIOTA50= -github.com/quasilyte/gogrep v0.0.0-20220120141003-628d8b3623b5/go.mod h1:wSEyW6O61xRV6zb6My3HxrQ5/8ke7NE2OayqCHa3xRM= -github.com/quasilyte/regex/syntax v0.0.0-20200407221936-30656e2c4a95/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= -github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ= github.com/r2ishiguro/vrf v0.0.0-20180716233122-192de52975eb h1:3kW8n+FfBaUoqlHxCa6e90PXWpGCWWkdyTZ6F7c9m2I= github.com/r2ishiguro/vrf v0.0.0-20180716233122-192de52975eb/go.mod h1:2NzHJUkr/ERaPNQ2IUuNbB2jMTWYp2DxhcraWbzZj00= 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-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= -github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/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/remyoudompheng/go-dbus v0.0.0-20121104212943-b7232d34b1d5/go.mod h1:+u151txRmLpwxBmpYn9z3d1sdJdjRPQpsXuYeY9jNls= -github.com/remyoudompheng/go-liblzma v0.0.0-20190506200333-81bf2d431b96/go.mod h1:90HvCY7+oHHUKkbeMCiHt1WuFR2/hPJ9QrljDG+v6ls= -github.com/remyoudompheng/go-misc v0.0.0-20190427085024-2d6ac652a50e/go.mod h1:80FQABjoFzZ2M5uEa6FUaJYEmqU2UOKojlFVak1UAwI= -github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rs/cors v0.0.0-20160617231935-a62a804a8a00/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rs/cors v1.8.2 h1:KCooALfAYGs415Cwu5ABvv9n9509fSiG5SQJn/AQo4U= -github.com/rs/cors v1.8.2/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/xhandler v0.0.0-20160618193221-ed27b6fd6521/go.mod h1:RvLn4FgxWubrpZHtQLnOf6EwhN2hEMusxZOhcW9H3UQ= -github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= -github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= +github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.23.0/go.mod h1:6c7hFfxPOy7TacJc4Fcdi24/J0NKYGzjG8FWRI916Qo= -github.com/rs/zerolog v1.27.0/go.mod h1:7frBqO0oezxmnO7GF86FY++uy8I0Tk/If5ni1G9Qc0U= -github.com/rs/zerolog v1.28.0 h1:MirSo27VyNi7RJYP3078AA1+Cyzd2GB66qy3aUHvsWY= -github.com/rs/zerolog v1.28.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= +github.com/rs/zerolog v1.29.0 h1:Zes4hju04hjbvkVkOhdl2HpZa+0PmVwigmo8XoORE5w= +github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryancurrah/gomodguard v1.2.3/go.mod h1:rYbA/4Tg5c54mV1sv4sQTP5WOPBcoLtnBZ7/TEhXAbg= -github.com/ryanrolds/sqlclosecheck v0.3.0/go.mod h1:1gREqxyTGR3lVtpngyFo3hZAgk0KCtEdgEkHwDbigdA= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sagikazarmark/crypt v0.3.0/go.mod h1:uD/D+6UF4SrIR1uGEv7bBNkNqLGqUr43MRiaGWX1Nig= -github.com/sagikazarmark/crypt v0.5.0/go.mod h1:l+nzl7KWh51rpzp2h7t4MZWyiEWdhNpOAnclKvg+mdA= -github.com/sagikazarmark/crypt v0.6.0/go.mod h1:U8+INwJo3nBv1m6A/8OBXAq7Jnpspk5AxSgDyEQcea8= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= -github.com/sanposhiho/wastedassign/v2 v2.0.6/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= -github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa/go.mod h1:F73l+cr82YSh10GxyRI6qZiCgK64VaZjwesgfQ1/iLM= 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/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvWlF4P2Ca7zGrPiEpWo= -github.com/seccomp/libseccomp-golang v0.9.2-0.20210429002308-3879420cc921/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= -github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= -github.com/securego/gosec/v2 v2.11.0/go.mod h1:SX8bptShuG8reGC0XS09+a4H2BoWSJi+fscA+Pulbpo= -github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KRMzBtS3oedY= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= -github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shirou/gopsutil/v3 v3.22.4/go.mod h1:D01hZJ4pVHPpCTZ3m3T2+wDF2YAGfd+H4ifUguaQzHM= -github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= -github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= -github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/sivchari/containedctx v1.0.2/go.mod h1:PwZOeqm4/DLoJOqMSIJs3aKqXRX4YO+uXww087KZ7Bw= -github.com/sivchari/tenv v1.5.0/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl018Icvg= +github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa h1:YJfZp12Z3AFhSBeXOlv4BO55RMwPn2NoQeDsrdWnBtY= github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa/go.mod h1:oJyF+mSPHbB5mVY2iO9KV3pTt/QbIkGaO8gQ2WrDbP4= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/sonatard/noctx v0.0.1/go.mod h1:9D2D/EoULe8Yy2joDHJj7bv3sZoq9AaSb8B4lqBjiZI= github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= -github.com/sourcegraph/go-diff v0.6.1/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= -github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= -github.com/spf13/afero v1.9.2 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.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.0 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.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= -github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= -github.com/spf13/cobra v1.3.0/go.mod h1:BrRVncBjOJa/eUcVVm9CE+oC6as8k+VYr4NY7WCi9V4= -github.com/spf13/cobra v1.4.0/go.mod h1:Wo4iy3BUC+X2Fybo0PDqwJIv3dNRiZLHQymsfxlB84g= -github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM= 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= @@ -1244,32 +626,16 @@ 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.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.7.1/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= -github.com/spf13/viper v1.10.0/go.mod h1:SoyBPwAtKDzypXNDFKN5kzH7ppppbGZtls1UpIy5AsM= -github.com/spf13/viper v1.11.0/go.mod h1:djo0X/bA5+tYVoCn+C7cAYJGcVn/qYLFTG8gdUsX7Zk= -github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= -github.com/spf13/viper v1.14.0 h1:Rg7d3Lo706X9tHsJMUjdiwMpHB7W8WnSVOssIY+JElU= -github.com/spf13/viper v1.14.0/go.mod h1:WT//axPky3FdvXHzGw33dNdXXXfFQqmEalje+egj8As= -github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= -github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q= -github.com/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= -github.com/steakknife/bloomfilter v0.0.0-20180922174646-6819c0d2a570/go.mod h1:8OR4w3TdeIHIh1g6EMY5p0gVNOovcWC+1vpc7naMuAw= -github.com/steakknife/hamming v0.0.0-20180906055917-c99c65617cd3/go.mod h1:hpGUWaI9xL8pRQCTXQgocU38Qw1g0Us7n5PxxTwTCYU= +github.com/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/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= -github.com/streadway/handy v0.0.0-20200128134331-0f66f006fb2e/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/testify v0.0.0-20170130113145-4d4bfba8f1d1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.1.4/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -1277,125 +643,49 @@ 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.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/subosito/gotenv v1.3.0/go.mod h1:YzJjq/33h7nrwdY+iHMhEOEEbW0ovIz0tB6t6PwAXzs= -github.com/subosito/gotenv v1.4.0/go.mod h1:mZd6rFysKEcUhUHXJk0C/08wAgyDBFuwEYL7vWWGaGo= -github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= -github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= -github.com/sylvia7788/contextcheck v1.0.4/go.mod h1:vuPKJMQ7MQ91ZTqfdyreNKwZjyUg6KO+IebVyQDedZQ= -github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= -github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= +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.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= -github.com/tdakkota/asciicheck v0.1.1/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= -github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/tendermint/btcd v0.1.1 h1:0VcxPfflS2zZ3RiOAHkBiFUcPvbtRj5O7zHmcJWHV7s= github.com/tendermint/btcd v0.1.1/go.mod h1:DC6/m53jtQzr/NFmMNEu0rxf18/ktVoVtMrnDD5pN+U= github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15 h1:hqAk8riJvK4RMWx1aInLzndwxKalgi5rTqgfXxOxbEI= github.com/tendermint/crypto v0.0.0-20191022145703-50d29ede1e15/go.mod h1:z4YtwM70uOnk8h0pjJYlj3zdYwi9l03By6iAIF5j/Pk= 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/tendermint v0.34.14/go.mod h1:FrwVm3TvsVicI9Z7FlucHV6Znfd5KBc/Lpp69cCwtk0= -github.com/tendermint/tendermint v0.34.20 h1:/pmvJhO3IqOxhbi8iRXudTjA2YKpaMqrLwFNkyxDSzw= -github.com/tendermint/tendermint v0.34.20/go.mod h1:KtOwCLYJcsS1ymtAfnjjAtXfXClbqcqjdqzFt2Em1Ac= -github.com/tendermint/tm-db v0.6.4/go.mod h1:dptYhIpJ2M5kUuenLr+Yyf3zQOv1SgBZcl8/BmWlMBw= -github.com/tendermint/tm-db v0.6.6/go.mod h1:wP8d49A85B7/erz/r4YbKssKw6ylsO/hKtFk7E1aWZI= +github.com/tendermint/tendermint v0.34.24 h1:879MKKJWYYPJEMMKME+DWUTY4V9f/FBpnZDI82ky+4k= +github.com/tendermint/tendermint v0.34.24/go.mod h1:rXVrl4OYzmIa1I91av3iLv2HS0fGSiucyW9J4aMTpKI= github.com/tendermint/tm-db v0.6.7 h1:fE00Cbl0jayAoqlExN6oyQJ7fR/ZtoVOmvPJ//+shu8= github.com/tendermint/tm-db v0.6.7/go.mod h1:byQDzFkZV1syXr/ReXS808NxA2xvyuuVgXOJ/088L6I= -github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= -github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= -github.com/tetafro/godot v1.4.11/go.mod h1:LR3CJpxDVGlYOWn3ZZg1PgNZdTUvzsZWu8xaEohUpn8= -github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= -github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= -github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= -github.com/tidwall/sjson v1.1.4/go.mod h1:wXpKXu8CtDjKAZ+3DrKY5ROCorDFahq8l0tey/Lx1fg= -github.com/timakin/bodyclose v0.0.0-20210704033933-f49887972144/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= github.com/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg= -github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= -github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tmc/grpc-websocket-proxy v0.0.0-20200427203606-3cfed13b9966/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tomarrell/wrapcheck/v2 v2.6.1/go.mod h1:Eo+Opt6pyMW1b6cNllOcDSSoHO0aTJ+iF6BfCUbHltA= -github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce/go.mod h1:o8v6yHRoik09Xen7gje4m9ERNah1d1PPsVq1VEx9vE4= -github.com/tommy-muehle/go-mnd/v2 v2.5.0/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= -github.com/tyler-smith/go-bip39 v1.0.1-0.20181017060643-dbb3b84ba2ef/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= -github.com/tyler-smith/go-bip39 v1.0.2/go.mod h1:sJ5fKU0s6JVwZjjcUEX2zFOnvq0ASQ2K9Zr6cf67kNs= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ultraware/funlen v0.0.3/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= -github.com/ultraware/whitespace v0.0.5/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/uudashr/gocognit v1.0.5/go.mod h1:wgYz0mitoKOTysqxTDMOUXg+Jb5SvtihkfmugIZYpEA= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.30.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= -github.com/valyala/quicktemplate v1.7.0/go.mod h1:sqKJnoaOF88V07vkO+9FL8fb9uZg/VPSJnLYn+LmLk8= -github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= -github.com/vektra/mockery/v2 v2.14.0/go.mod h1:bnD1T8tExSgPD1ripLkDbr60JA9VtQeu12P3wgLZd7M= -github.com/viki-org/dnscache v0.0.0-20130720023526-c70c1f23c5d8/go.mod h1:dniwbG03GafCjFohMDmz6Zc6oCuiqgH6tGNyXTkHzXE= -github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= -github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= -github.com/vmihailenco/msgpack/v5 v5.1.4/go.mod h1:C5gboKD0TJPqWDTVTtrQNfRbiBwHZGo8UTqP/9/XvLI= -github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= -github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208/go.mod h1:IotVbo4F+mw0EzQ08zFqg7pK3FebNXpaMsRy2RT+Ees= -github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= github.com/yahoo/coname v0.0.0-20170609175141-84592ddf8673 h1:PSg2cEFd+9Ae/r5x5iO8cJ3VmTbZNQp6X8tHDmVJAbA= -github.com/ybbus/jsonrpc v2.1.2+incompatible/go.mod h1:XJrh1eMSzdIYFbM08flv0wp5G35eRniyeGut1z+LSiE= -github.com/yeya24/promlinter v0.2.0/go.mod h1:u54lkmBOZrpEbQQ6gox2zWKKLKu2SGe+2KOiextY+IA= -github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg= -github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM= -github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= -github.com/zondax/hid v0.9.0 h1:eiT3P6vNxAEVxXMw66eZUAAnU2zD33JBkfG/EnfAKl8= -github.com/zondax/hid v0.9.0/go.mod h1:l5wttcP0jwtdLjqjMMWFVEE7d1zO0jvSPA9OPZxWpEM= -gitlab.com/bosi/decorder v0.2.1/go.mod h1:6C/nhLSbF6qZbYD8bRmISBwc6vcWdNsiIBkRvjJFrH0= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +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.0 h1:dlMC7aO8Wss1CxBq2I96kZ69Nh1ligzbs8UWOtq/AsA= +github.com/zondax/ledger-go v0.14.0/go.mod h1:fZ3Dqg6qcdXWSOJFKMG8GCTnD7slO/RL2feOQv8K320= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= -go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= -go.etcd.io/etcd v0.0.0-20200513171258-e048e166ab9c/go.mod h1:xCI7ZzBfRuGgBXyXO6yfWfDmlWd35khcWpUa4L0xI/k= -go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= -go.etcd.io/etcd/api/v3 v3.5.2/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= -go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= -go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/pkg/v3 v3.5.2/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= -go.etcd.io/etcd/client/v2 v2.305.1/go.mod h1:pMEacxZW7o8pg4CrFE7pquyCJJzZvkvdD2RibOCCCGs= -go.etcd.io/etcd/client/v2 v2.305.2/go.mod h1:2D7ZejHVMIfog1221iLSYlQRzrtECw3kz4I4VAQm3qI= -go.etcd.io/etcd/client/v2 v2.305.4/go.mod h1:Ud+VUwIi9/uQHOMA+4ekToJ12lTxlv0zB/+DHwTGEbU= -go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lLS/oTh0= -go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= -go.mozilla.org/mozlog v0.0.0-20170222151521-4bb13139d403/go.mod h1:jHoPAGnDrCy6kaI2tAze5Prf0Nr0w/oNkROt2lw3n3o= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -1404,71 +694,32 @@ 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.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.4.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= -go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= -go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI= -go.uber.org/zap v1.21.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= -golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20180501155221-613d6eafa307/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-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190909091759-094676da4a83/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= 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-20200323165209-0ec3e9974c59/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-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= -golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20210915214749-c084706c2272/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.0.0-20220313003712-b769efc7c000/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.4.0 h1:UVQgzMY87xqpKNgb+kDsll2Igd33HszWHFLmpaRMq/8= -golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80= -golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/crypto v0.5.0 h1:U/0M97KRkSFvyD/3FSmdP5W5swImpNgle/EHFhOsQPE= +golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= @@ -1479,8 +730,6 @@ golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMk 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/typeparams v0.0.0-20220218215828-6cf2b201936e/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -1493,28 +742,19 @@ 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.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= -golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1532,8 +772,6 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1551,38 +789,14 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-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-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= -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-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -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-20220520000938-2e3eb7b945c2/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220617184016-355a448f1bc9/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= -golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= +golang.org/x/net v0.5.0 h1:GyT4nK/YDHSqa1c4753ouYCDajOYKTja9Xb/OHtgvSw= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= 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= @@ -1592,31 +806,16 @@ 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-20210402161424-2e8d93401602/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-20211005180243-6b3c2da341f1/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/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1627,28 +826,20 @@ golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1657,7 +848,6 @@ golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7w 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-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1674,145 +864,69 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200824131525-c12d262b63d8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200831180312-196b9ba8737a/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-20201015000850-e3ed0017c211/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-20201204225414-ed752295db88/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-20210303074136-134d130e1a04/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-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/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-20210616045830-e2b7044e8c71/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-20210816183151-1e6c022a8912/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-20210903071746-97244b99971b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/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-20210917161153-d61c044b1678/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-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/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-20211205182925-97ca703d548d/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-20211213223007-03aa0b5f6827/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-20220319134239-a9b59b0215f8/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-20220403020550-483a9cbc67c0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220405052023-b1e9470b6e64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220405210540-1e041c57c461/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220406163625-3f8b81556e12/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-20220422013727-9388b58f7150/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-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-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.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18= +golang.org/x/sys v0.4.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.0.0-20220411215600-e5f449aeb171/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.0.0-20220526004731-065cf7ba2467/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI= -golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA= +golang.org/x/term v0.4.0 h1:O7UWfv5+A2qiuulQk30kVinPoMtoIPeVaKLEgLpVkvg= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= -golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190228203856-589c23e65e65/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190307163923-6a08e3108db3/go.mod h1:25r3+/G6/xytQM8iWZKq3Hn0kr0rgFKPUNVEL/dr3z4= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190321232350-e250d351ecad/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190916130336-e45ffcd953cc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191010075000-0337d82405ff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117012304-6edc0a871e69/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117220505-0cba7a3a9ee9/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1822,78 +936,36 @@ golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200329025819-fd4102a86c65/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200414032229-332987a829c3/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200622203043-20e05c1c8ffa/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200624225443-88f3c62a19ff/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200625211823-6506e20df31f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200626171337-aa94e735be7f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200630154851-b2d8b0336632/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200706234117-b22de6825cf7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200717024301-6ddee64345a6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200724022722-7017fd6b1305/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200812195022-5ae4c3c160a0/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200820010801-b793a1359eac/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200831203904-5a2aa26beb65/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201001104356-43ebab892c4c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201002184944-ecd9fd270d5d/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201023174141-c8cfbd0f21e6/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201028025901-8cd080b735b3/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201230224404-63754364767c/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= -golang.org/x/tools v0.1.1-0.20210205202024-ef80cdb6ec6d/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= -golang.org/x/tools v0.1.1-0.20210302220138-2ac05c832e1a/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= -golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.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.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= -golang.org/x/tools v0.1.8/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= -golang.org/x/tools v0.1.9-0.20211228192929-ee1ca4ffc4da/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= -golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= -golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -golang.org/x/tools v0.1.11-0.20220316014157-77aa08bb151a/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= +golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE= 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= -gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/gonum v0.12.0 h1:xKuo6hzt+gMav00meVPUlXwSdoEJP46BR+wdxQEFK2o= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.10.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= @@ -1909,40 +981,15 @@ 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.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= -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.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= -google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= -google.golang.org/api v0.62.0/go.mod h1:dKmwPCydfsad4qCH08MSdgWjfHOyfpd4VtDGgRFdavw= -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.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= -google.golang.org/api v0.81.0/go.mod h1:FA6Mb/bZxj706H2j+j2d6mHEEaHBmbbWnkfvmorOCko= 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.2/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20181107211654-5fc9ac540362/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1951,7 +998,6 @@ google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dT google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= @@ -1973,69 +1019,21 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200626011028-ee7919e894b5/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200707001353-8e8330bf89df/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-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-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-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-20210917145530-b395a37504d4/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= -google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211129164237-f09f9a12af12/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9/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-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-20220505152158-f39f71e6c8f3/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= -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/genproto v0.0.0-20221227171554-f9683d7f8bef h1:uQ2vjV/sHTsWSqdKeLqmwitzgvjMl7o4IdtHwUDXSJY= +google.golang.org/genproto v0.0.0-20221227171554-f9683d7f8bef/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/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= @@ -2046,39 +1044,27 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/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.27.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -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 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8 h1:KR8+MyP7/qOlV+8Af01LtjL04bu7on42eVsxT4EyBQk= +google.golang.org/protobuf v1.28.2-0.20220831092852-f930b1dc76e8/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/cheggaaa/pb.v1 v1.0.28/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.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.66.4/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.66.6/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/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/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= +gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -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= @@ -2086,19 +1072,14 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.6/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0/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/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= -gotest.tools/v3 v3.2.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A= 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= @@ -2106,17 +1087,10 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.3.1/go.mod h1:vlRD9XErLMGT+mDuofSr0mMMquscM/1nQqtRSsh6m70= -mvdan.cc/gofumpt v0.3.1/go.mod h1:w3ymliuxvzVx8DAutBnVyDqYb1Niy/yCJt/lk821YCE= -mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= -mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= -mvdan.cc/unparam v0.0.0-20211214103731-d0ef000c54e5/go.mod h1:b8RRCBm0eeiWR8cfN88xeq2G5SG3VKGO+5UPWi5FSOY= nhooyr.io/websocket v1.8.6 h1:s+C3xAMLwGmlI31Nyn/eAehUlZPwfYZu2JXM621Q5/k= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/proto/buf.gen.doc.yml b/proto/buf.gen.doc.yml new file mode 100644 index 0000000000..43c1f10f2a --- /dev/null +++ b/proto/buf.gen.doc.yml @@ -0,0 +1,5 @@ +version: v1 +plugins: + - name: doc + out: ../docs/proto + opt: ../docs/proto/protodoc-markdown.tmpl,proto-docs.md \ No newline at end of file diff --git a/proto/buf.gen.gogo.yml b/proto/buf.gen.gogo.yml new file mode 100644 index 0000000000..855ea251ad --- /dev/null +++ b/proto/buf.gen.gogo.yml @@ -0,0 +1,8 @@ +version: v1 +plugins: + - name: gocosmos + out: .. + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types + - name: grpc-gateway + out: .. + opt: logtostderr=true,allow_colon_final_segments=true \ No newline at end of file diff --git a/proto/buf.lock b/proto/buf.lock new file mode 100644 index 0000000000..3d4ba2f161 --- /dev/null +++ b/proto/buf.lock @@ -0,0 +1,19 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: cosmos + repository: cosmos-proto + commit: 1935555c206d4afb9e94615dfd0fad31 + - remote: buf.build + owner: cosmos + repository: cosmos-sdk + commit: 8cb30a2c4de74dc9bd8d260b1e75e176 + - remote: buf.build + owner: cosmos + repository: gogo-proto + commit: 6652e3443c3b4504bb3bf82e73a7e409 + - remote: buf.build + owner: googleapis + repository: googleapis + commit: 8d7204855ec14631a499bd7393ce1970 diff --git a/proto/buf.yaml b/proto/buf.yaml index cf215e6829..9c12bd28b7 100644 --- a/proto/buf.yaml +++ b/proto/buf.yaml @@ -5,6 +5,10 @@ # the previous configuration. version: v1 name: buf.build/cosmwasm/wasmd +deps: + - buf.build/cosmos/cosmos-proto + - buf.build/cosmos/cosmos-sdk:8cb30a2c4de74dc9bd8d260b1e75e176 #v0.46.x + - buf.build/cosmos/gogo-proto breaking: use: - FILE diff --git a/proto/cosmwasm/wasm/v1/genesis.proto b/proto/cosmwasm/wasm/v1/genesis.proto index cd709d0700..9ef1b304ca 100644 --- a/proto/cosmwasm/wasm/v1/genesis.proto +++ b/proto/cosmwasm/wasm/v1/genesis.proto @@ -25,9 +25,6 @@ message GenesisState { (gogoproto.jsontag) = "gen_msgs,omitempty" ]; - // InactiveContractAddresses is a list of contract address that set inactive - repeated string inactive_contract_addresses = 6 [(gogoproto.jsontag) = "inactive_contract_address, omitempty"]; - // GenMsgs define the messages that can be executed during genesis phase in // order. The intention is to have more human readable data that is auditable. message GenMsgs { @@ -36,6 +33,8 @@ message GenesisState { MsgStoreCode store_code = 1; MsgInstantiateContract instantiate_contract = 2; MsgExecuteContract execute_contract = 3; + // MsgInstantiateContract2 intentionally not supported + // see https://github.com/CosmWasm/wasmd/issues/987 } } } diff --git a/proto/cosmwasm/wasm/v1/proposal.proto b/proto/cosmwasm/wasm/v1/proposal.proto index 94a4420d9f..71fa05dff1 100644 --- a/proto/cosmwasm/wasm/v1/proposal.proto +++ b/proto/cosmwasm/wasm/v1/proposal.proto @@ -24,6 +24,8 @@ message StoreCodeProposal { reserved 5, 6; // InstantiatePermission to apply on contract creation, optional AccessConfig instantiate_permission = 7; + // UnpinCode code on upload, optional + bool unpin_code = 8; } // InstantiateContractProposal gov proposal content type to instantiate a diff --git a/proto/cosmwasm/wasm/v1/query.proto b/proto/cosmwasm/wasm/v1/query.proto index 0382d9a599..687386866c 100644 --- a/proto/cosmwasm/wasm/v1/query.proto +++ b/proto/cosmwasm/wasm/v1/query.proto @@ -58,6 +58,11 @@ service Query { rpc PinnedCodes(QueryPinnedCodesRequest) returns (QueryPinnedCodesResponse) { option (google.api.http).get = "/cosmwasm/wasm/v1/codes/pinned"; } + + // Params gets the module params + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/cosmwasm/wasm/v1/codes/params"; + } } // QueryContractInfoRequest is the request type for the Query/ContractInfo RPC @@ -222,3 +227,12 @@ message QueryPinnedCodesResponse { // pagination defines the pagination in the response. cosmos.base.query.v1beta1.PageResponse pagination = 2; } + +// QueryParamsRequest is the request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is the response type for the Query/Params RPC method. +message QueryParamsResponse { + // params defines the parameters of the module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} diff --git a/proto/cosmwasm/wasm/v1/tx.proto b/proto/cosmwasm/wasm/v1/tx.proto index c97086325c..c937697834 100644 --- a/proto/cosmwasm/wasm/v1/tx.proto +++ b/proto/cosmwasm/wasm/v1/tx.proto @@ -12,9 +12,14 @@ option (gogoproto.goproto_getters_all) = false; service Msg { // StoreCode to submit Wasm code to the system rpc StoreCode(MsgStoreCode) returns (MsgStoreCodeResponse); - // Instantiate creates a new smart contract instance for the given code id. + // InstantiateContract creates a new smart contract instance for the given + // code id. rpc InstantiateContract(MsgInstantiateContract) returns (MsgInstantiateContractResponse); + // InstantiateContract2 creates a new smart contract instance for the given + // code id with a predictable address + rpc InstantiateContract2(MsgInstantiateContract2) + returns (MsgInstantiateContract2Response); // Execute submits the given message data to a smart contract rpc ExecuteContract(MsgExecuteContract) returns (MsgExecuteContractResponse); // Migrate runs a code upgrade/ downgrade for a smart contract @@ -41,6 +46,8 @@ message MsgStoreCode { message MsgStoreCodeResponse { // CodeID is the reference to the stored WASM code uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; + // Checksum is the sha256 hash of the stored code + bytes checksum = 2; } // MsgInstantiateContract create a new smart contract instance for the given @@ -62,11 +69,45 @@ message MsgInstantiateContract { (gogoproto.castrepeated) = "github.com/line/lbm-sdk/types.Coins" ]; } + +// MsgInstantiateContract2 create a new smart contract instance for the given +// code id with a predicable address. +message MsgInstantiateContract2 { + // Sender is the that actor that signed the messages + string sender = 1; + // Admin is an optional address that can execute migrations + string admin = 2; + // CodeID is the reference to the stored WASM code + uint64 code_id = 3 [ (gogoproto.customname) = "CodeID" ]; + // Label is optional metadata to be stored with a contract instance. + string label = 4; + // Msg json encoded message to be passed to the contract on instantiation + bytes msg = 5 [ (gogoproto.casttype) = "RawContractMessage" ]; + // Funds coins that are transferred to the contract on instantiation + repeated cosmos.base.v1beta1.Coin funds = 6 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/line/lbm-sdk/types.Coins" + ]; + // Salt is an arbitrary value provided by the sender. Size can be 1 to 64. + bytes salt = 7; + // FixMsg include the msg value into the hash for the predictable address. + // Default is false + bool fix_msg = 8; +} + // MsgInstantiateContractResponse return instantiation result data message MsgInstantiateContractResponse { // Address is the bech32 address of the new contract instance. string address = 1; - // Data contains base64-encoded bytes to returned from the contract + // Data contains bytes to returned from the contract + bytes data = 2; +} + +// MsgInstantiateContract2Response return instantiation result data +message MsgInstantiateContract2Response { + // Address is the bech32 address of the new contract instance. + string address = 1; + // Data contains bytes to returned from the contract bytes data = 2; } @@ -87,7 +128,7 @@ message MsgExecuteContract { // MsgExecuteContractResponse returns execution result data. message MsgExecuteContractResponse { - // Data contains base64-encoded bytes to returned from the contract + // Data contains bytes to returned from the contract bytes data = 1; } diff --git a/proto/cosmwasm/wasm/v1/types.proto b/proto/cosmwasm/wasm/v1/types.proto index 6b4388d8f5..b0db599a7b 100644 --- a/proto/cosmwasm/wasm/v1/types.proto +++ b/proto/cosmwasm/wasm/v1/types.proto @@ -19,12 +19,16 @@ enum AccessType { // AccessTypeNobody forbidden ACCESS_TYPE_NOBODY = 1 [ (gogoproto.enumvalue_customname) = "AccessTypeNobody" ]; - // AccessTypeOnlyAddress restricted to an address + // AccessTypeOnlyAddress restricted to a single address + // Deprecated: use AccessTypeAnyOfAddresses instead ACCESS_TYPE_ONLY_ADDRESS = 2 [ (gogoproto.enumvalue_customname) = "AccessTypeOnlyAddress" ]; // AccessTypeEverybody unrestricted ACCESS_TYPE_EVERYBODY = 3 [ (gogoproto.enumvalue_customname) = "AccessTypeEverybody" ]; + // AccessTypeAnyOfAddresses allow any of the addresses + ACCESS_TYPE_ANY_OF_ADDRESSES = 4 + [ (gogoproto.enumvalue_customname) = "AccessTypeAnyOfAddresses" ]; } // AccessTypeParam @@ -37,7 +41,11 @@ message AccessTypeParam { message AccessConfig { option (gogoproto.goproto_stringer) = true; AccessType permission = 1 [ (gogoproto.moretags) = "yaml:\"permission\"" ]; + + // Address + // Deprecated: replaced by addresses string address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; + repeated string addresses = 3 [ (gogoproto.moretags) = "yaml:\"addresses\"" ]; } // Params defines the set of wasm parameters. @@ -49,9 +57,6 @@ message Params { ]; AccessType instantiate_default_permission = 2 [ (gogoproto.moretags) = "yaml:\"instantiate_default_permission\"" ]; - uint64 gas_multiplier = 3 [(gogoproto.moretags) = "yaml:\"gas_multiplier\""]; - uint64 instance_cost = 4 [(gogoproto.moretags) = "yaml:\"instance_cost\""]; - uint64 compile_cost = 5 [(gogoproto.moretags) = "yaml:\"compile_cost\""]; } // CodeInfo is data for the uploaded contract WASM code diff --git a/proto/lbm/wasm/v1/event.proto b/proto/lbm/wasm/v1/event.proto index 0fcc09dec5..32586f684c 100644 --- a/proto/lbm/wasm/v1/event.proto +++ b/proto/lbm/wasm/v1/event.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package lbm.wasm.v1; -option go_package = "github.com/line/wasmd/x/wasm/lbmtypes"; +option go_package = "github.com/line/wasmd/x/wasmplus/types"; // EventDeactivateContractProposal is the event that is emitted when the contract is deactivate. message EventDeactivateContractProposal { diff --git a/proto/lbm/wasm/v1/genesis.proto b/proto/lbm/wasm/v1/genesis.proto new file mode 100644 index 0000000000..1bf1f31153 --- /dev/null +++ b/proto/lbm/wasm/v1/genesis.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package lbm.wasm.v1; + +import "gogoproto/gogo.proto"; +import "cosmwasm/wasm/v1/types.proto"; +import "cosmwasm/wasm/v1/genesis.proto"; + +option go_package = "github.com/line/wasmd/x/wasmplus/types"; + +// GenesisState - genesis state of x/wasm +message GenesisState { + cosmwasm.wasm.v1.Params params = 1 [ (gogoproto.nullable) = false ]; + repeated cosmwasm.wasm.v1.Code codes = 2 + [ (gogoproto.nullable) = false, (gogoproto.jsontag) = "codes,omitempty" ]; + repeated cosmwasm.wasm.v1.Contract contracts = 3 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "contracts,omitempty" + ]; + repeated cosmwasm.wasm.v1.Sequence sequences = 4 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "sequences,omitempty" + ]; + repeated cosmwasm.wasm.v1.GenesisState.GenMsgs gen_msgs = 5 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "gen_msgs,omitempty" + ]; + + // InactiveContractAddresses is a list of contract address that set inactive + repeated string inactive_contract_addresses = 6 [(gogoproto.jsontag) = "inactive_contract_address,omitempty"]; +} diff --git a/proto/lbm/wasm/v1/proposal.proto b/proto/lbm/wasm/v1/proposal.proto index 59bfd0125c..fecb685ea7 100644 --- a/proto/lbm/wasm/v1/proposal.proto +++ b/proto/lbm/wasm/v1/proposal.proto @@ -3,7 +3,7 @@ package lbm.wasm.v1; import "gogoproto/gogo.proto"; -option go_package = "github.com/line/wasmd/x/wasm/lbmtypes"; +option go_package = "github.com/line/wasmd/x/wasmplus/types"; option (gogoproto.goproto_stringer_all) = false; option (gogoproto.goproto_getters_all) = false; option (gogoproto.equal_all) = true; diff --git a/proto/lbm/wasm/v1/query.proto b/proto/lbm/wasm/v1/query.proto index ebe47a572c..bc5ed2bb9c 100644 --- a/proto/lbm/wasm/v1/query.proto +++ b/proto/lbm/wasm/v1/query.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; -option go_package = "github.com/line/wasmd/x/wasm/lbmtypes"; +option go_package = "github.com/line/wasmd/x/wasmplus/types"; option (gogoproto.goproto_getters_all) = false; option (gogoproto.equal_all) = false; @@ -16,6 +16,7 @@ service Query { option (google.api.http).get = "/lbm/wasm/v1/inactive_contracts"; }; + // InactiveContract check it the contract is inactive state or not rpc InactiveContract(QueryInactiveContractRequest) returns (QueryInactiveContractResponse) { option (google.api.http).get = "/lbm/wasm/v1/inactive_contracts/{address}"; } diff --git a/proto/lbm/wasm/v1/tx.proto b/proto/lbm/wasm/v1/tx.proto index 286ba44887..3ef98b9e15 100644 --- a/proto/lbm/wasm/v1/tx.proto +++ b/proto/lbm/wasm/v1/tx.proto @@ -5,7 +5,7 @@ import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; import "cosmwasm/wasm/v1/types.proto"; -option go_package = "github.com/line/wasmd/x/wasm/lbmtypes"; +option go_package = "github.com/line/wasmd/x/wasmplus/types"; option (gogoproto.goproto_getters_all) = false; // Msg defines the wasm Msg service for lbm-sdk. diff --git a/third_party/proto/buf.yaml b/third_party/proto/buf.yaml deleted file mode 100644 index d0638a2426..0000000000 --- a/third_party/proto/buf.yaml +++ /dev/null @@ -1,40 +0,0 @@ -# Generated by "buf config migrate-v1beta1". Edit as necessary, and -# remove this comment when you're finished. -# -# This module represents the "third_party/proto" root found in -# the previous configuration. -version: v1 -build: - excludes: - - google/protobuf -breaking: - use: - - FILE - ignore: - - confio - - cosmos - - cosmos_proto - - gogoproto - - google - - ibc - - tendermint -lint: - use: - - DEFAULT - - COMMENTS - - FILE_LOWER_SNAKE_CASE - except: - - UNARY_RPC - - COMMENT_FIELD - - SERVICE_SUFFIX - - PACKAGE_VERSION_SUFFIX - - RPC_REQUEST_STANDARD_NAME - - PACKAGE_DIRECTORY_MATCH - ignore: - - confio - - cosmos - - cosmos_proto - - gogoproto - - google - - ibc - - tendermint diff --git a/third_party/proto/confio/proofs.proto b/third_party/proto/confio/proofs.proto deleted file mode 100644 index da43503ecb..0000000000 --- a/third_party/proto/confio/proofs.proto +++ /dev/null @@ -1,234 +0,0 @@ -syntax = "proto3"; - -package ics23; -option go_package = "github.com/confio/ics23/go"; - -enum HashOp { - // NO_HASH is the default if no data passed. Note this is an illegal argument some places. - NO_HASH = 0; - SHA256 = 1; - SHA512 = 2; - KECCAK = 3; - RIPEMD160 = 4; - BITCOIN = 5; // ripemd160(sha256(x)) -} - -/** -LengthOp defines how to process the key and value of the LeafOp -to include length information. After encoding the length with the given -algorithm, the length will be prepended to the key and value bytes. -(Each one with it's own encoded length) -*/ -enum LengthOp { - // NO_PREFIX don't include any length info - NO_PREFIX = 0; - // VAR_PROTO uses protobuf (and go-amino) varint encoding of the length - VAR_PROTO = 1; - // VAR_RLP uses rlp int encoding of the length - VAR_RLP = 2; - // FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer - FIXED32_BIG = 3; - // FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer - FIXED32_LITTLE = 4; - // FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer - FIXED64_BIG = 5; - // FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer - FIXED64_LITTLE = 6; - // REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output) - REQUIRE_32_BYTES = 7; - // REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output) - REQUIRE_64_BYTES = 8; -} - -/** -ExistenceProof takes a key and a value and a set of steps to perform on it. -The result of peforming all these steps will provide a "root hash", which can -be compared to the value in a header. - -Since it is computationally infeasible to produce a hash collission for any of the used -cryptographic hash functions, if someone can provide a series of operations to transform -a given key and value into a root hash that matches some trusted root, these key and values -must be in the referenced merkle tree. - -The only possible issue is maliablity in LeafOp, such as providing extra prefix data, -which should be controlled by a spec. Eg. with lengthOp as NONE, - prefix = FOO, key = BAR, value = CHOICE -and - prefix = F, key = OOBAR, value = CHOICE -would produce the same value. - -With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field -in the ProofSpec is valuable to prevent this mutability. And why all trees should -length-prefix the data before hashing it. -*/ -message ExistenceProof { - bytes key = 1; - bytes value = 2; - LeafOp leaf = 3; - repeated InnerOp path = 4; -} - -/* -NonExistenceProof takes a proof of two neighbors, one left of the desired key, -one right of the desired key. If both proofs are valid AND they are neighbors, -then there is no valid proof for the given key. -*/ -message NonExistenceProof { - bytes key = 1; // TODO: remove this as unnecessary??? we prove a range - ExistenceProof left = 2; - ExistenceProof right = 3; -} - -/* -CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages -*/ -message CommitmentProof { - oneof proof { - ExistenceProof exist = 1; - NonExistenceProof nonexist = 2; - BatchProof batch = 3; - CompressedBatchProof compressed = 4; - } -} - -/** -LeafOp represents the raw key-value data we wish to prove, and -must be flexible to represent the internal transformation from -the original key-value pairs into the basis hash, for many existing -merkle trees. - -key and value are passed in. So that the signature of this operation is: - leafOp(key, value) -> output - -To process this, first prehash the keys and values if needed (ANY means no hash in this case): - hkey = prehashKey(key) - hvalue = prehashValue(value) - -Then combine the bytes, and hash it - output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) -*/ -message LeafOp { - HashOp hash = 1; - HashOp prehash_key = 2; - HashOp prehash_value = 3; - LengthOp length = 4; - // prefix is a fixed bytes that may optionally be included at the beginning to differentiate - // a leaf node from an inner node. - bytes prefix = 5; -} - -/** -InnerOp represents a merkle-proof step that is not a leaf. -It represents concatenating two children and hashing them to provide the next result. - -The result of the previous step is passed in, so the signature of this op is: - innerOp(child) -> output - -The result of applying InnerOp should be: - output = op.hash(op.prefix || child || op.suffix) - - where the || operator is concatenation of binary data, -and child is the result of hashing all the tree below this step. - -Any special data, like prepending child with the length, or prepending the entire operation with -some value to differentiate from leaf nodes, should be included in prefix and suffix. -If either of prefix or suffix is empty, we just treat it as an empty string -*/ -message InnerOp { - HashOp hash = 1; - bytes prefix = 2; - bytes suffix = 3; -} - - -/** -ProofSpec defines what the expected parameters are for a given proof type. -This can be stored in the client and used to validate any incoming proofs. - - verify(ProofSpec, Proof) -> Proof | Error - -As demonstrated in tests, if we don't fix the algorithm used to calculate the -LeafHash for a given tree, there are many possible key-value pairs that can -generate a given hash (by interpretting the preimage differently). -We need this for proper security, requires client knows a priori what -tree format server uses. But not in code, rather a configuration object. -*/ -message ProofSpec { - // any field in the ExistenceProof must be the same as in this spec. - // except Prefix, which is just the first bytes of prefix (spec can be longer) - LeafOp leaf_spec = 1; - InnerSpec inner_spec = 2; - // max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) - int32 max_depth = 3; - // min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) - int32 min_depth = 4; -} - -/* -InnerSpec contains all store-specific structure info to determine if two proofs from a -given store are neighbors. - -This enables: - - isLeftMost(spec: InnerSpec, op: InnerOp) - isRightMost(spec: InnerSpec, op: InnerOp) - isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) -*/ -message InnerSpec { - // Child order is the ordering of the children node, must count from 0 - // iavl tree is [0, 1] (left then right) - // merk is [0, 2, 1] (left, right, here) - repeated int32 child_order = 1; - int32 child_size = 2; - int32 min_prefix_length = 3; - int32 max_prefix_length = 4; - // empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) - bytes empty_child = 5; - // hash is the algorithm that must be used for each InnerOp - HashOp hash = 6; -} - -/* -BatchProof is a group of multiple proof types than can be compressed -*/ -message BatchProof { - repeated BatchEntry entries = 1; -} - -// Use BatchEntry not CommitmentProof, to avoid recursion -message BatchEntry { - oneof proof { - ExistenceProof exist = 1; - NonExistenceProof nonexist = 2; - } -} - - -/****** all items here are compressed forms *******/ - -message CompressedBatchProof { - repeated CompressedBatchEntry entries = 1; - repeated InnerOp lookup_inners = 2; -} - -// Use BatchEntry not CommitmentProof, to avoid recursion -message CompressedBatchEntry { - oneof proof { - CompressedExistenceProof exist = 1; - CompressedNonExistenceProof nonexist = 2; - } -} - -message CompressedExistenceProof { - bytes key = 1; - bytes value = 2; - LeafOp leaf = 3; - // these are indexes into the lookup_inners table in CompressedBatchProof - repeated int32 path = 4; -} - -message CompressedNonExistenceProof { - bytes key = 1; // TODO: remove this as unnecessary??? we prove a range - CompressedExistenceProof left = 2; - CompressedExistenceProof right = 3; -} diff --git a/third_party/proto/cosmos/auth/v1beta1/auth.proto b/third_party/proto/cosmos/auth/v1beta1/auth.proto deleted file mode 100644 index 72e1d9ec28..0000000000 --- a/third_party/proto/cosmos/auth/v1beta1/auth.proto +++ /dev/null @@ -1,50 +0,0 @@ -syntax = "proto3"; -package cosmos.auth.v1beta1; - -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; - -// BaseAccount defines a base account type. It contains all the necessary fields -// for basic account functionality. Any custom account type should extend this -// type for additional functionality (e.g. vesting). -message BaseAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.equal) = false; - - option (cosmos_proto.implements_interface) = "AccountI"; - - string address = 1; - google.protobuf.Any pub_key = 2 - [(gogoproto.jsontag) = "public_key,omitempty", (gogoproto.moretags) = "yaml:\"public_key\""]; - uint64 account_number = 3 [(gogoproto.moretags) = "yaml:\"account_number\""]; - uint64 sequence = 4; -} - -// ModuleAccount defines an account for modules that holds coins on a pool. -message ModuleAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - option (cosmos_proto.implements_interface) = "ModuleAccountI"; - - BaseAccount base_account = 1 [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"base_account\""]; - string name = 2; - repeated string permissions = 3; -} - -// Params defines the parameters for the auth module. -message Params { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - uint64 max_memo_characters = 1 [(gogoproto.moretags) = "yaml:\"max_memo_characters\""]; - uint64 tx_sig_limit = 2 [(gogoproto.moretags) = "yaml:\"tx_sig_limit\""]; - uint64 tx_size_cost_per_byte = 3 [(gogoproto.moretags) = "yaml:\"tx_size_cost_per_byte\""]; - uint64 sig_verify_cost_ed25519 = 4 - [(gogoproto.customname) = "SigVerifyCostED25519", (gogoproto.moretags) = "yaml:\"sig_verify_cost_ed25519\""]; - uint64 sig_verify_cost_secp256k1 = 5 - [(gogoproto.customname) = "SigVerifyCostSecp256k1", (gogoproto.moretags) = "yaml:\"sig_verify_cost_secp256k1\""]; -} diff --git a/third_party/proto/cosmos/auth/v1beta1/genesis.proto b/third_party/proto/cosmos/auth/v1beta1/genesis.proto deleted file mode 100644 index c88b94ee4e..0000000000 --- a/third_party/proto/cosmos/auth/v1beta1/genesis.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; -package cosmos.auth.v1beta1; - -import "google/protobuf/any.proto"; -import "gogoproto/gogo.proto"; -import "cosmos/auth/v1beta1/auth.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; - -// GenesisState defines the auth module's genesis state. -message GenesisState { - // params defines all the paramaters of the module. - Params params = 1 [(gogoproto.nullable) = false]; - - // accounts are the accounts present at genesis. - repeated google.protobuf.Any accounts = 2; -} diff --git a/third_party/proto/cosmos/auth/v1beta1/query.proto b/third_party/proto/cosmos/auth/v1beta1/query.proto deleted file mode 100644 index 4d9759cada..0000000000 --- a/third_party/proto/cosmos/auth/v1beta1/query.proto +++ /dev/null @@ -1,74 +0,0 @@ -syntax = "proto3"; -package cosmos.auth.v1beta1; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "google/api/annotations.proto"; -import "cosmos/auth/v1beta1/auth.proto"; -import "cosmos_proto/cosmos.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/auth/types"; - -// Query defines the gRPC querier service. -service Query { - // Accounts returns all the existing accounts - // - // Since: cosmos-sdk 0.43 - rpc Accounts(QueryAccountsRequest) returns (QueryAccountsResponse) { - option (google.api.http).get = "/cosmos/auth/v1beta1/accounts"; - } - - // Account returns account details based on address. - rpc Account(QueryAccountRequest) returns (QueryAccountResponse) { - option (google.api.http).get = "/cosmos/auth/v1beta1/accounts/{address}"; - } - - // Params queries all parameters. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/auth/v1beta1/params"; - } -} - -// QueryAccountsRequest is the request type for the Query/Accounts RPC method. -// -// Since: cosmos-sdk 0.43 -message QueryAccountsRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryAccountsResponse is the response type for the Query/Accounts RPC method. -// -// Since: cosmos-sdk 0.43 -message QueryAccountsResponse { - // accounts are the existing accounts - repeated google.protobuf.Any accounts = 1 [(cosmos_proto.accepts_interface) = "AccountI"]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryAccountRequest is the request type for the Query/Account RPC method. -message QueryAccountRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // address defines the address to query for. - string address = 1; -} - -// QueryAccountResponse is the response type for the Query/Account RPC method. -message QueryAccountResponse { - // account defines the account of the corresponding address. - google.protobuf.Any account = 1 [(cosmos_proto.accepts_interface) = "AccountI"]; -} - -// 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]; -} diff --git a/third_party/proto/cosmos/authz/v1beta1/authz.proto b/third_party/proto/cosmos/authz/v1beta1/authz.proto deleted file mode 100644 index 2c376905eb..0000000000 --- a/third_party/proto/cosmos/authz/v1beta1/authz.proto +++ /dev/null @@ -1,27 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.authz.v1beta1; - -import "cosmos_proto/cosmos.proto"; -import "google/protobuf/timestamp.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; -option (gogoproto.goproto_getters_all) = false; - -// GenericAuthorization gives the grantee unrestricted permissions to execute -// the provided method on behalf of the granter's account. -message GenericAuthorization { - option (cosmos_proto.implements_interface) = "Authorization"; - - // Msg, identified by it's type URL, to grant unrestricted permissions to execute - string msg = 1; -} - -// Grant gives permissions to execute -// the provide method with expiration time. -message Grant { - google.protobuf.Any authorization = 1 [(cosmos_proto.accepts_interface) = "Authorization"]; - google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/authz/v1beta1/event.proto b/third_party/proto/cosmos/authz/v1beta1/event.proto deleted file mode 100644 index 7a3cf7c8cf..0000000000 --- a/third_party/proto/cosmos/authz/v1beta1/event.proto +++ /dev/null @@ -1,25 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.authz.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; - -// EventGrant is emitted on Msg/Grant -message EventGrant { - // Msg type URL for which an autorization is granted - string msg_type_url = 2; - // Granter account address - string granter = 3; - // Grantee account address - string grantee = 4; -} - -// EventRevoke is emitted on Msg/Revoke -message EventRevoke { - // Msg type URL for which an autorization is revoked - string msg_type_url = 2; - // Granter account address - string granter = 3; - // Grantee account address - string grantee = 4; -} diff --git a/third_party/proto/cosmos/authz/v1beta1/genesis.proto b/third_party/proto/cosmos/authz/v1beta1/genesis.proto deleted file mode 100644 index ea89869445..0000000000 --- a/third_party/proto/cosmos/authz/v1beta1/genesis.proto +++ /dev/null @@ -1,24 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.authz.v1beta1; - -import "google/protobuf/timestamp.proto"; -import "google/protobuf/any.proto"; -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; - -// GenesisState defines the authz module's genesis state. -message GenesisState { - repeated GrantAuthorization authorization = 1 [(gogoproto.nullable) = false]; -} - -// GrantAuthorization defines the GenesisState/GrantAuthorization type. -message GrantAuthorization { - string granter = 1; - string grantee = 2; - - google.protobuf.Any authorization = 3 [(cosmos_proto.accepts_interface) = "Authorization"]; - google.protobuf.Timestamp expiration = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; -} diff --git a/third_party/proto/cosmos/authz/v1beta1/query.proto b/third_party/proto/cosmos/authz/v1beta1/query.proto deleted file mode 100644 index 428210de01..0000000000 --- a/third_party/proto/cosmos/authz/v1beta1/query.proto +++ /dev/null @@ -1,35 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.authz.v1beta1; - -import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "cosmos/authz/v1beta1/authz.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; - -// Query defines the gRPC querier service. -service Query { - // Returns list of `Authorization`, granted to the grantee by the granter. - rpc Grants(QueryGrantsRequest) returns (QueryGrantsResponse) { - option (google.api.http).get = "/cosmos/authz/v1beta1/grants"; - } -} - -// QueryGrantsRequest is the request type for the Query/Grants RPC method. -message QueryGrantsRequest { - string granter = 1; - string grantee = 2; - // Optional, msg_type_url, when set, will query only grants matching given msg type. - string msg_type_url = 3; - // pagination defines an pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 4; -} - -// QueryGrantsResponse is the response type for the Query/Authorizations RPC method. -message QueryGrantsResponse { - // authorizations is a list of grants granted for grantee by granter. - repeated cosmos.authz.v1beta1.Grant grants = 1; - // pagination defines an pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} diff --git a/third_party/proto/cosmos/authz/v1beta1/tx.proto b/third_party/proto/cosmos/authz/v1beta1/tx.proto deleted file mode 100644 index 457f0d662a..0000000000 --- a/third_party/proto/cosmos/authz/v1beta1/tx.proto +++ /dev/null @@ -1,70 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.authz.v1beta1; - -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/any.proto"; -import "cosmos/base/abci/v1beta1/abci.proto"; -import "cosmos/authz/v1beta1/authz.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/authz"; -option (gogoproto.goproto_getters_all) = false; - -// Msg defines the authz Msg service. -service Msg { - // Grant grants the provided authorization to the grantee on the granter's - // account with the provided expiration time. If there is already a grant - // for the given (granter, grantee, Authorization) triple, then the grant - // will be overwritten. - rpc Grant(MsgGrant) returns (MsgGrantResponse); - - // Exec attempts to execute the provided messages using - // authorizations granted to the grantee. Each message should have only - // one signer corresponding to the granter of the authorization. - rpc Exec(MsgExec) returns (MsgExecResponse); - - // Revoke revokes any authorization corresponding to the provided method name on the - // granter's account that has been granted to the grantee. - rpc Revoke(MsgRevoke) returns (MsgRevokeResponse); -} - -// MsgGrant is a request type for Grant method. It declares authorization to the grantee -// on behalf of the granter with the provided expiration time. -message MsgGrant { - string granter = 1; - string grantee = 2; - - cosmos.authz.v1beta1.Grant grant = 3 [(gogoproto.nullable) = false]; -} - -// MsgExecResponse defines the Msg/MsgExecResponse response type. -message MsgExecResponse { - repeated bytes results = 1; -} - -// MsgExec attempts to execute the provided messages using -// authorizations granted to the grantee. Each message should have only -// one signer corresponding to the granter of the authorization. -message MsgExec { - string grantee = 1; - // Authorization Msg requests to execute. Each msg must implement Authorization interface - // The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg)) - // triple and validate it. - repeated google.protobuf.Any msgs = 2 [(cosmos_proto.accepts_interface) = "sdk.Msg, authz.Authorization"]; -} - -// MsgGrantResponse defines the Msg/MsgGrant response type. -message MsgGrantResponse {} - -// MsgRevoke revokes any authorization with the provided sdk.Msg type on the -// granter's account with that has been granted to the grantee. -message MsgRevoke { - string granter = 1; - string grantee = 2; - string msg_type_url = 3; -} - -// MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. -message MsgRevokeResponse {} diff --git a/third_party/proto/cosmos/bank/v1beta1/authz.proto b/third_party/proto/cosmos/bank/v1beta1/authz.proto deleted file mode 100644 index 4f58b15e49..0000000000 --- a/third_party/proto/cosmos/bank/v1beta1/authz.proto +++ /dev/null @@ -1,19 +0,0 @@ -syntax = "proto3"; -package cosmos.bank.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; - -// SendAuthorization allows the grantee to spend up to spend_limit coins from -// the granter's account. -// -// Since: cosmos-sdk 0.43 -message SendAuthorization { - option (cosmos_proto.implements_interface) = "Authorization"; - - repeated cosmos.base.v1beta1.Coin spend_limit = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} diff --git a/third_party/proto/cosmos/bank/v1beta1/bank.proto b/third_party/proto/cosmos/bank/v1beta1/bank.proto deleted file mode 100644 index df91008df6..0000000000 --- a/third_party/proto/cosmos/bank/v1beta1/bank.proto +++ /dev/null @@ -1,96 +0,0 @@ -syntax = "proto3"; -package cosmos.bank.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; - -// Params defines the parameters for the bank module. -message Params { - option (gogoproto.goproto_stringer) = false; - repeated SendEnabled send_enabled = 1 [(gogoproto.moretags) = "yaml:\"send_enabled,omitempty\""]; - bool default_send_enabled = 2 [(gogoproto.moretags) = "yaml:\"default_send_enabled,omitempty\""]; -} - -// SendEnabled maps coin denom to a send_enabled status (whether a denom is -// sendable). -message SendEnabled { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - string denom = 1; - bool enabled = 2; -} - -// Input models transaction input. -message Input { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string address = 1; - repeated cosmos.base.v1beta1.Coin coins = 2 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} - -// Output models transaction outputs. -message Output { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string address = 1; - repeated cosmos.base.v1beta1.Coin coins = 2 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} - -// Supply represents a struct that passively keeps track of the total supply -// amounts in the network. -// This message is deprecated now that supply is indexed by denom. -message Supply { - option deprecated = true; - - option (gogoproto.equal) = true; - option (gogoproto.goproto_getters) = false; - - option (cosmos_proto.implements_interface) = "*github.com/cosmos/cosmos-sdk/x/bank/legacy/v040.SupplyI"; - - repeated cosmos.base.v1beta1.Coin total = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} - -// DenomUnit represents a struct that describes a given -// denomination unit of the basic token. -message DenomUnit { - // denom represents the string name of the given denom unit (e.g uatom). - string denom = 1; - // 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). - uint32 exponent = 2; - // aliases is a list of string aliases for the given denom - repeated string aliases = 3; -} - -// Metadata represents a struct that describes -// a basic token. -message Metadata { - string description = 1; - // denom_units represents the list of DenomUnit's for a given coin - repeated DenomUnit denom_units = 2; - // base represents the base denom (should be the DenomUnit with exponent = 0). - string base = 3; - // display indicates the suggested denom that should be - // displayed in clients. - string display = 4; - // name defines the name of the token (eg: Cosmos Atom) - // - // Since: cosmos-sdk 0.43 - string name = 5; - // symbol is the token symbol usually shown on exchanges (eg: ATOM). This can - // be the same as the display. - // - // Since: cosmos-sdk 0.43 - string symbol = 6; -} diff --git a/third_party/proto/cosmos/bank/v1beta1/genesis.proto b/third_party/proto/cosmos/bank/v1beta1/genesis.proto deleted file mode 100644 index 8fd7329a0a..0000000000 --- a/third_party/proto/cosmos/bank/v1beta1/genesis.proto +++ /dev/null @@ -1,39 +0,0 @@ -syntax = "proto3"; -package cosmos.bank.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/bank/v1beta1/bank.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; - -// GenesisState defines the bank module's genesis state. -message GenesisState { - // params defines all the paramaters of the module. - Params params = 1 [(gogoproto.nullable) = false]; - - // balances is an array containing the balances of all the accounts. - repeated Balance balances = 2 [(gogoproto.nullable) = false]; - - // supply represents the total supply. If it is left empty, then supply will be calculated based on the provided - // balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. - repeated cosmos.base.v1beta1.Coin supply = 3 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; - - // denom_metadata defines the metadata of the differents coins. - repeated Metadata denom_metadata = 4 [(gogoproto.moretags) = "yaml:\"denom_metadata\"", (gogoproto.nullable) = false]; -} - -// Balance defines an account address and balance pair used in the bank module's -// genesis state. -message Balance { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // address is the address of the balance holder. - string address = 1; - - // coins defines the different coins this balance holds. - repeated cosmos.base.v1beta1.Coin coins = 2 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/bank/v1beta1/query.proto b/third_party/proto/cosmos/bank/v1beta1/query.proto deleted file mode 100644 index 520ba06964..0000000000 --- a/third_party/proto/cosmos/bank/v1beta1/query.proto +++ /dev/null @@ -1,163 +0,0 @@ -syntax = "proto3"; -package cosmos.bank.v1beta1; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/bank/v1beta1/bank.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; - -// Query defines the gRPC querier service. -service Query { - // Balance queries the balance of a single coin for a single account. - rpc Balance(QueryBalanceRequest) returns (QueryBalanceResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}/by_denom"; - } - - // AllBalances queries the balance of all coins for a single account. - rpc AllBalances(QueryAllBalancesRequest) returns (QueryAllBalancesResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/balances/{address}"; - } - - // TotalSupply queries the total supply of all coins. - rpc TotalSupply(QueryTotalSupplyRequest) returns (QueryTotalSupplyResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/supply"; - } - - // SupplyOf queries the supply of a single coin. - rpc SupplyOf(QuerySupplyOfRequest) returns (QuerySupplyOfResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/supply/{denom}"; - } - - // Params queries the parameters of x/bank module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/params"; - } - - // DenomsMetadata queries the client metadata of a given coin denomination. - rpc DenomMetadata(QueryDenomMetadataRequest) returns (QueryDenomMetadataResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata/{denom}"; - } - - // DenomsMetadata queries the client metadata for all registered coin denominations. - rpc DenomsMetadata(QueryDenomsMetadataRequest) returns (QueryDenomsMetadataResponse) { - option (google.api.http).get = "/cosmos/bank/v1beta1/denoms_metadata"; - } -} - -// QueryBalanceRequest is the request type for the Query/Balance RPC method. -message QueryBalanceRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // address is the address to query balances for. - string address = 1; - - // denom is the coin denom to query balances for. - string denom = 2; -} - -// QueryBalanceResponse is the response type for the Query/Balance RPC method. -message QueryBalanceResponse { - // balance is the balance of the coin. - cosmos.base.v1beta1.Coin balance = 1; -} - -// QueryBalanceRequest is the request type for the Query/AllBalances RPC method. -message QueryAllBalancesRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // address is the address to query balances for. - string address = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC -// method. -message QueryAllBalancesResponse { - // balances is the balances of all the coins. - repeated cosmos.base.v1beta1.Coin balances = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC -// method. -message QueryTotalSupplyRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // pagination defines an optional pagination for the request. - // - // Since: cosmos-sdk 0.43 - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC -// method -message QueryTotalSupplyResponse { - // supply is the supply of the coins - repeated cosmos.base.v1beta1.Coin supply = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - - // pagination defines the pagination in the response. - // - // Since: cosmos-sdk 0.43 - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. -message QuerySupplyOfRequest { - // denom is the coin denom to query balances for. - string denom = 1; -} - -// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. -message QuerySupplyOfResponse { - // amount is the supply of the coin. - cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false]; -} - -// QueryParamsRequest defines the request type for querying x/bank parameters. -message QueryParamsRequest {} - -// QueryParamsResponse defines the response type for querying x/bank parameters. -message QueryParamsResponse { - Params params = 1 [(gogoproto.nullable) = false]; -} - -// QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. -message QueryDenomsMetadataRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC -// method. -message QueryDenomsMetadataResponse { - // metadata provides the client information for all the registered tokens. - repeated Metadata metadatas = 1 [(gogoproto.nullable) = false]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. -message QueryDenomMetadataRequest { - // denom is the coin denom to query the metadata for. - string denom = 1; -} - -// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC -// method. -message QueryDenomMetadataResponse { - // metadata describes and provides all the client information for the requested token. - Metadata metadata = 1 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/bank/v1beta1/tx.proto b/third_party/proto/cosmos/bank/v1beta1/tx.proto deleted file mode 100644 index 26b2ab41f4..0000000000 --- a/third_party/proto/cosmos/bank/v1beta1/tx.proto +++ /dev/null @@ -1,42 +0,0 @@ -syntax = "proto3"; -package cosmos.bank.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/bank/v1beta1/bank.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/bank/types"; - -// Msg defines the bank Msg service. -service Msg { - // Send defines a method for sending coins from one account to another account. - rpc Send(MsgSend) returns (MsgSendResponse); - - // MultiSend defines a method for sending coins from some accounts to other accounts. - rpc MultiSend(MsgMultiSend) returns (MsgMultiSendResponse); -} - -// MsgSend represents a message to send coins from one account to another. -message MsgSend { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""]; - string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""]; - repeated cosmos.base.v1beta1.Coin amount = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} - -// MsgSendResponse defines the Msg/Send response type. -message MsgSendResponse {} - -// MsgMultiSend represents an arbitrary multi-in, multi-out send message. -message MsgMultiSend { - option (gogoproto.equal) = false; - - repeated Input inputs = 1 [(gogoproto.nullable) = false]; - repeated Output outputs = 2 [(gogoproto.nullable) = false]; -} - -// MsgMultiSendResponse defines the Msg/MultiSend response type. -message MsgMultiSendResponse {} diff --git a/third_party/proto/cosmos/base/abci/v1beta1/abci.proto b/third_party/proto/cosmos/base/abci/v1beta1/abci.proto deleted file mode 100644 index e24ae7bd5e..0000000000 --- a/third_party/proto/cosmos/base/abci/v1beta1/abci.proto +++ /dev/null @@ -1,144 +0,0 @@ -syntax = "proto3"; -package cosmos.base.abci.v1beta1; - -import "gogoproto/gogo.proto"; -import "tendermint/abci/types.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/types"; -option (gogoproto.goproto_stringer_all) = false; - -// TxResponse defines a structure containing relevant tx data and metadata. The -// tags are stringified and the log is JSON decoded. -message TxResponse { - option (gogoproto.goproto_getters) = false; - // The block height - int64 height = 1; - // The transaction hash. - string txhash = 2 [(gogoproto.customname) = "TxHash"]; - // Namespace for the Code - string codespace = 3; - // Response code. - uint32 code = 4; - // Result bytes, if any. - string data = 5; - // The output of the application's logger (raw string). May be - // non-deterministic. - string raw_log = 6; - // The output of the application's logger (typed). May be non-deterministic. - repeated ABCIMessageLog logs = 7 [(gogoproto.castrepeated) = "ABCIMessageLogs", (gogoproto.nullable) = false]; - // Additional information. May be non-deterministic. - string info = 8; - // Amount of gas requested for transaction. - int64 gas_wanted = 9; - // Amount of gas consumed by transaction. - int64 gas_used = 10; - // The request transaction bytes. - google.protobuf.Any tx = 11; - // Time of the previous block. For heights > 1, it's the weighted median of - // the timestamps of the valid votes in the block.LastCommit. For height == 1, - // it's genesis time. - string timestamp = 12; - // Events defines all the events emitted by processing a transaction. Note, - // these events include those emitted by processing all the messages and those - // emitted from the ante handler. Whereas Logs contains the events, with - // additional metadata, emitted only by processing the messages. - // - // Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 - repeated tendermint.abci.Event events = 13 [(gogoproto.nullable) = false]; -} - -// ABCIMessageLog defines a structure containing an indexed tx ABCI message log. -message ABCIMessageLog { - option (gogoproto.stringer) = true; - - uint32 msg_index = 1; - string log = 2; - - // Events contains a slice of Event objects that were emitted during some - // execution. - repeated StringEvent events = 3 [(gogoproto.castrepeated) = "StringEvents", (gogoproto.nullable) = false]; -} - -// StringEvent defines en Event object wrapper where all the attributes -// contain key/value pairs that are strings instead of raw bytes. -message StringEvent { - option (gogoproto.stringer) = true; - - string type = 1; - repeated Attribute attributes = 2 [(gogoproto.nullable) = false]; -} - -// Attribute defines an attribute wrapper where the key and value are -// strings instead of raw bytes. -message Attribute { - string key = 1; - string value = 2; -} - -// GasInfo defines tx execution gas context. -message GasInfo { - // GasWanted is the maximum units of work we allow this tx to perform. - uint64 gas_wanted = 1 [(gogoproto.moretags) = "yaml:\"gas_wanted\""]; - - // GasUsed is the amount of gas actually consumed. - uint64 gas_used = 2 [(gogoproto.moretags) = "yaml:\"gas_used\""]; -} - -// Result is the union of ResponseFormat and ResponseCheckTx. -message Result { - option (gogoproto.goproto_getters) = false; - - // Data is any data returned from message or handler execution. It MUST be - // length prefixed in order to separate data from multiple message executions. - bytes data = 1; - - // Log contains the log information from message or handler execution. - string log = 2; - - // Events contains a slice of Event objects that were emitted during message - // or handler execution. - repeated tendermint.abci.Event events = 3 [(gogoproto.nullable) = false]; -} - -// SimulationResponse defines the response generated when a transaction is -// successfully simulated. -message SimulationResponse { - GasInfo gas_info = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - Result result = 2; -} - -// MsgData defines the data returned in a Result object during message -// execution. -message MsgData { - option (gogoproto.stringer) = true; - - string msg_type = 1; - bytes data = 2; -} - -// TxMsgData defines a list of MsgData. A transaction will have a MsgData object -// for each message. -message TxMsgData { - option (gogoproto.stringer) = true; - - repeated MsgData data = 1; -} - -// SearchTxsResult defines a structure for querying txs pageable -message SearchTxsResult { - option (gogoproto.stringer) = true; - - // Count of all txs - uint64 total_count = 1 [(gogoproto.moretags) = "yaml:\"total_count\"", (gogoproto.jsontag) = "total_count"]; - // Count of txs in current page - uint64 count = 2; - // Index of current page, start from 1 - uint64 page_number = 3 [(gogoproto.moretags) = "yaml:\"page_number\"", (gogoproto.jsontag) = "page_number"]; - // Count of total pages - uint64 page_total = 4 [(gogoproto.moretags) = "yaml:\"page_total\"", (gogoproto.jsontag) = "page_total"]; - // Max count txs per page - uint64 limit = 5; - // List of txs in current page - repeated TxResponse txs = 6; -} diff --git a/third_party/proto/cosmos/base/kv/v1beta1/kv.proto b/third_party/proto/cosmos/base/kv/v1beta1/kv.proto deleted file mode 100644 index 4e9b8d2850..0000000000 --- a/third_party/proto/cosmos/base/kv/v1beta1/kv.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; -package cosmos.base.kv.v1beta1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/types/kv"; - -// Pairs defines a repeated slice of Pair objects. -message Pairs { - repeated Pair pairs = 1 [(gogoproto.nullable) = false]; -} - -// Pair defines a key/value bytes tuple. -message Pair { - bytes key = 1; - bytes value = 2; -} diff --git a/third_party/proto/cosmos/base/reflection/v1beta1/reflection.proto b/third_party/proto/cosmos/base/reflection/v1beta1/reflection.proto deleted file mode 100644 index 22670e72b8..0000000000 --- a/third_party/proto/cosmos/base/reflection/v1beta1/reflection.proto +++ /dev/null @@ -1,44 +0,0 @@ -syntax = "proto3"; -package cosmos.base.reflection.v1beta1; - -import "google/api/annotations.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/reflection"; - -// ReflectionService defines a service for interface reflection. -service ReflectionService { - // ListAllInterfaces lists all the interfaces registered in the interface - // registry. - rpc ListAllInterfaces(ListAllInterfacesRequest) returns (ListAllInterfacesResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/interfaces"; - }; - - // ListImplementations list all the concrete types that implement a given - // interface. - rpc ListImplementations(ListImplementationsRequest) returns (ListImplementationsResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/interfaces/" - "{interface_name}/implementations"; - }; -} - -// ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. -message ListAllInterfacesRequest {} - -// ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. -message ListAllInterfacesResponse { - // interface_names is an array of all the registered interfaces. - repeated string interface_names = 1; -} - -// ListImplementationsRequest is the request type of the ListImplementations -// RPC. -message ListImplementationsRequest { - // interface_name defines the interface to query the implementations for. - string interface_name = 1; -} - -// ListImplementationsResponse is the response type of the ListImplementations -// RPC. -message ListImplementationsResponse { - repeated string implementation_message_names = 1; -} diff --git a/third_party/proto/cosmos/base/reflection/v2alpha1/reflection.proto b/third_party/proto/cosmos/base/reflection/v2alpha1/reflection.proto deleted file mode 100644 index d5b048558f..0000000000 --- a/third_party/proto/cosmos/base/reflection/v2alpha1/reflection.proto +++ /dev/null @@ -1,218 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.base.reflection.v2alpha1; - -import "google/api/annotations.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1"; - -// AppDescriptor describes a cosmos-sdk based application -message AppDescriptor { - // AuthnDescriptor provides information on how to authenticate transactions on the application - // NOTE: experimental and subject to change in future releases. - AuthnDescriptor authn = 1; - // chain provides the chain descriptor - ChainDescriptor chain = 2; - // codec provides metadata information regarding codec related types - CodecDescriptor codec = 3; - // configuration provides metadata information regarding the sdk.Config type - ConfigurationDescriptor configuration = 4; - // query_services provides metadata information regarding the available queriable endpoints - QueryServicesDescriptor query_services = 5; - // tx provides metadata information regarding how to send transactions to the given application - TxDescriptor tx = 6; -} - -// TxDescriptor describes the accepted transaction type -message TxDescriptor { - // fullname is the protobuf fullname of the raw transaction type (for instance the tx.Tx type) - // it is not meant to support polymorphism of transaction types, it is supposed to be used by - // reflection clients to understand if they can handle a specific transaction type in an application. - string fullname = 1; - // msgs lists the accepted application messages (sdk.Msg) - repeated MsgDescriptor msgs = 2; -} - -// AuthnDescriptor provides information on how to sign transactions without relying -// on the online RPCs GetTxMetadata and CombineUnsignedTxAndSignatures -message AuthnDescriptor { - // sign_modes defines the supported signature algorithm - repeated SigningModeDescriptor sign_modes = 1; -} - -// SigningModeDescriptor provides information on a signing flow of the application -// NOTE(fdymylja): here we could go as far as providing an entire flow on how -// to sign a message given a SigningModeDescriptor, but it's better to think about -// this another time -message SigningModeDescriptor { - // name defines the unique name of the signing mode - string name = 1; - // number is the unique int32 identifier for the sign_mode enum - int32 number = 2; - // authn_info_provider_method_fullname defines the fullname of the method to call to get - // the metadata required to authenticate using the provided sign_modes - string authn_info_provider_method_fullname = 3; -} - -// ChainDescriptor describes chain information of the application -message ChainDescriptor { - // id is the chain id - string id = 1; -} - -// CodecDescriptor describes the registered interfaces and provides metadata information on the types -message CodecDescriptor { - // interfaces is a list of the registerted interfaces descriptors - repeated InterfaceDescriptor interfaces = 1; -} - -// InterfaceDescriptor describes the implementation of an interface -message InterfaceDescriptor { - // fullname is the name of the interface - string fullname = 1; - // interface_accepting_messages contains information regarding the proto messages which contain the interface as - // google.protobuf.Any field - repeated InterfaceAcceptingMessageDescriptor interface_accepting_messages = 2; - // interface_implementers is a list of the descriptors of the interface implementers - repeated InterfaceImplementerDescriptor interface_implementers = 3; -} - -// InterfaceImplementerDescriptor describes an interface implementer -message InterfaceImplementerDescriptor { - // fullname is the protobuf queryable name of the interface implementer - string fullname = 1; - // type_url defines the type URL used when marshalling the type as any - // this is required so we can provide type safe google.protobuf.Any marshalling and - // unmarshalling, making sure that we don't accept just 'any' type - // in our interface fields - string type_url = 2; -} - -// InterfaceAcceptingMessageDescriptor describes a protobuf message which contains -// an interface represented as a google.protobuf.Any -message InterfaceAcceptingMessageDescriptor { - // fullname is the protobuf fullname of the type containing the interface - string fullname = 1; - // field_descriptor_names is a list of the protobuf name (not fullname) of the field - // which contains the interface as google.protobuf.Any (the interface is the same, but - // it can be in multiple fields of the same proto message) - repeated string field_descriptor_names = 2; -} - -// ConfigurationDescriptor contains metadata information on the sdk.Config -message ConfigurationDescriptor { - // bech32_account_address_prefix is the account address prefix - string bech32_account_address_prefix = 1; -} - -// MsgDescriptor describes a cosmos-sdk message that can be delivered with a transaction -message MsgDescriptor { - // msg_type_url contains the TypeURL of a sdk.Msg. - string msg_type_url = 1; -} - -// ReflectionService defines a service for application reflection. -service ReflectionService { - // GetAuthnDescriptor returns information on how to authenticate transactions in the application - // NOTE: this RPC is still experimental and might be subject to breaking changes or removal in - // future releases of the cosmos-sdk. - rpc GetAuthnDescriptor(GetAuthnDescriptorRequest) returns (GetAuthnDescriptorResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/authn"; - } - // GetChainDescriptor returns the description of the chain - rpc GetChainDescriptor(GetChainDescriptorRequest) returns (GetChainDescriptorResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/chain"; - }; - // GetCodecDescriptor returns the descriptor of the codec of the application - rpc GetCodecDescriptor(GetCodecDescriptorRequest) returns (GetCodecDescriptorResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/codec"; - } - // GetConfigurationDescriptor returns the descriptor for the sdk.Config of the application - rpc GetConfigurationDescriptor(GetConfigurationDescriptorRequest) returns (GetConfigurationDescriptorResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/configuration"; - } - // GetQueryServicesDescriptor returns the available gRPC queryable services of the application - rpc GetQueryServicesDescriptor(GetQueryServicesDescriptorRequest) returns (GetQueryServicesDescriptorResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/query_services"; - } - // GetTxDescriptor returns information on the used transaction object and available msgs that can be used - rpc GetTxDescriptor(GetTxDescriptorRequest) returns (GetTxDescriptorResponse) { - option (google.api.http).get = "/cosmos/base/reflection/v1beta1/app_descriptor/tx_descriptor"; - } -} - -// GetAuthnDescriptorRequest is the request used for the GetAuthnDescriptor RPC -message GetAuthnDescriptorRequest {} -// GetAuthnDescriptorResponse is the response returned by the GetAuthnDescriptor RPC -message GetAuthnDescriptorResponse { - // authn describes how to authenticate to the application when sending transactions - AuthnDescriptor authn = 1; -} - -// GetChainDescriptorRequest is the request used for the GetChainDescriptor RPC -message GetChainDescriptorRequest {} -// GetChainDescriptorResponse is the response returned by the GetChainDescriptor RPC -message GetChainDescriptorResponse { - // chain describes application chain information - ChainDescriptor chain = 1; -} - -// GetCodecDescriptorRequest is the request used for the GetCodecDescriptor RPC -message GetCodecDescriptorRequest {} -// GetCodecDescriptorResponse is the response returned by the GetCodecDescriptor RPC -message GetCodecDescriptorResponse { - // codec describes the application codec such as registered interfaces and implementations - CodecDescriptor codec = 1; -} - -// GetConfigurationDescriptorRequest is the request used for the GetConfigurationDescriptor RPC -message GetConfigurationDescriptorRequest {} -// GetConfigurationDescriptorResponse is the response returned by the GetConfigurationDescriptor RPC -message GetConfigurationDescriptorResponse { - // config describes the application's sdk.Config - ConfigurationDescriptor config = 1; -} - -// GetQueryServicesDescriptorRequest is the request used for the GetQueryServicesDescriptor RPC -message GetQueryServicesDescriptorRequest {} -// GetQueryServicesDescriptorResponse is the response returned by the GetQueryServicesDescriptor RPC -message GetQueryServicesDescriptorResponse { - // queries provides information on the available queryable services - QueryServicesDescriptor queries = 1; -} - -// GetTxDescriptorRequest is the request used for the GetTxDescriptor RPC -message GetTxDescriptorRequest {} -// GetTxDescriptorResponse is the response returned by the GetTxDescriptor RPC -message GetTxDescriptorResponse { - // tx provides information on msgs that can be forwarded to the application - // alongside the accepted transaction protobuf type - TxDescriptor tx = 1; -} - -// QueryServicesDescriptor contains the list of cosmos-sdk queriable services -message QueryServicesDescriptor { - // query_services is a list of cosmos-sdk QueryServiceDescriptor - repeated QueryServiceDescriptor query_services = 1; -} - -// QueryServiceDescriptor describes a cosmos-sdk queryable service -message QueryServiceDescriptor { - // fullname is the protobuf fullname of the service descriptor - string fullname = 1; - // is_module describes if this service is actually exposed by an application's module - bool is_module = 2; - // methods provides a list of query service methods - repeated QueryMethodDescriptor methods = 3; -} - -// QueryMethodDescriptor describes a queryable method of a query service -// no other info is provided beside method name and tendermint queryable path -// because it would be redundant with the grpc reflection service -message QueryMethodDescriptor { - // name is the protobuf name (not fullname) of the method - string name = 1; - // full_query_path is the path that can be used to query - // this method via tendermint abci.Query - string full_query_path = 2; -} diff --git a/third_party/proto/cosmos/base/snapshots/v1beta1/snapshot.proto b/third_party/proto/cosmos/base/snapshots/v1beta1/snapshot.proto deleted file mode 100644 index 9ac5a7c31b..0000000000 --- a/third_party/proto/cosmos/base/snapshots/v1beta1/snapshot.proto +++ /dev/null @@ -1,20 +0,0 @@ -syntax = "proto3"; -package cosmos.base.snapshots.v1beta1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/snapshots/types"; - -// Snapshot contains Tendermint state sync snapshot info. -message Snapshot { - uint64 height = 1; - uint32 format = 2; - uint32 chunks = 3; - bytes hash = 4; - Metadata metadata = 5 [(gogoproto.nullable) = false]; -} - -// Metadata contains SDK-specific snapshot metadata. -message Metadata { - repeated bytes chunk_hashes = 1; // SHA-256 chunk hashes -} \ No newline at end of file diff --git a/third_party/proto/cosmos/base/store/v1beta1/commit_info.proto b/third_party/proto/cosmos/base/store/v1beta1/commit_info.proto deleted file mode 100644 index 98a33d30e7..0000000000 --- a/third_party/proto/cosmos/base/store/v1beta1/commit_info.proto +++ /dev/null @@ -1,29 +0,0 @@ -syntax = "proto3"; -package cosmos.base.store.v1beta1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/store/types"; - -// CommitInfo defines commit information used by the multi-store when committing -// a version/height. -message CommitInfo { - int64 version = 1; - repeated StoreInfo store_infos = 2 [(gogoproto.nullable) = false]; -} - -// StoreInfo defines store-specific commit information. It contains a reference -// between a store name and the commit ID. -message StoreInfo { - string name = 1; - CommitID commit_id = 2 [(gogoproto.nullable) = false]; -} - -// CommitID defines the committment information when a specific store is -// committed. -message CommitID { - option (gogoproto.goproto_stringer) = false; - - int64 version = 1; - bytes hash = 2; -} diff --git a/third_party/proto/cosmos/base/store/v1beta1/listening.proto b/third_party/proto/cosmos/base/store/v1beta1/listening.proto deleted file mode 100644 index 359997109c..0000000000 --- a/third_party/proto/cosmos/base/store/v1beta1/listening.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; -package cosmos.base.store.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/store/types"; - -// StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) -// It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and -// Deletes -// -// Since: cosmos-sdk 0.43 -message StoreKVPair { - string store_key = 1; // the store key for the KVStore this pair originates from - bool delete = 2; // true indicates a delete operation, false indicates a set operation - bytes key = 3; - bytes value = 4; -} diff --git a/third_party/proto/cosmos/base/store/v1beta1/snapshot.proto b/third_party/proto/cosmos/base/store/v1beta1/snapshot.proto deleted file mode 100644 index 834855093b..0000000000 --- a/third_party/proto/cosmos/base/store/v1beta1/snapshot.proto +++ /dev/null @@ -1,28 +0,0 @@ -syntax = "proto3"; -package cosmos.base.store.v1beta1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/store/types"; - -// SnapshotItem is an item contained in a rootmulti.Store snapshot. -message SnapshotItem { - // item is the specific type of snapshot item. - oneof item { - SnapshotStoreItem store = 1; - SnapshotIAVLItem iavl = 2 [(gogoproto.customname) = "IAVL"]; - } -} - -// SnapshotStoreItem contains metadata about a snapshotted store. -message SnapshotStoreItem { - string name = 1; -} - -// SnapshotIAVLItem is an exported IAVL node. -message SnapshotIAVLItem { - bytes key = 1; - bytes value = 2; - int64 version = 3; - int32 height = 4; -} \ No newline at end of file diff --git a/third_party/proto/cosmos/base/tendermint/v1beta1/query.proto b/third_party/proto/cosmos/base/tendermint/v1beta1/query.proto deleted file mode 100644 index 3c31877aa0..0000000000 --- a/third_party/proto/cosmos/base/tendermint/v1beta1/query.proto +++ /dev/null @@ -1,138 +0,0 @@ -syntax = "proto3"; -package cosmos.base.tendermint.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "google/api/annotations.proto"; -import "tendermint/p2p/types.proto"; -import "tendermint/types/block.proto"; -import "tendermint/types/types.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/client/grpc/tmservice"; - -// Service defines the gRPC querier service for tendermint queries. -service Service { - // GetNodeInfo queries the current node info. - rpc GetNodeInfo(GetNodeInfoRequest) returns (GetNodeInfoResponse) { - option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/node_info"; - } - // GetSyncing queries node syncing. - rpc GetSyncing(GetSyncingRequest) returns (GetSyncingResponse) { - option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/syncing"; - } - // GetLatestBlock returns the latest block. - rpc GetLatestBlock(GetLatestBlockRequest) returns (GetLatestBlockResponse) { - option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/blocks/latest"; - } - // GetBlockByHeight queries block for given height. - rpc GetBlockByHeight(GetBlockByHeightRequest) returns (GetBlockByHeightResponse) { - option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/blocks/{height}"; - } - - // GetLatestValidatorSet queries latest validator-set. - rpc GetLatestValidatorSet(GetLatestValidatorSetRequest) returns (GetLatestValidatorSetResponse) { - option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validatorsets/latest"; - } - // GetValidatorSetByHeight queries validator-set at a given height. - rpc GetValidatorSetByHeight(GetValidatorSetByHeightRequest) returns (GetValidatorSetByHeightResponse) { - option (google.api.http).get = "/cosmos/base/tendermint/v1beta1/validatorsets/{height}"; - } -} - -// GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. -message GetValidatorSetByHeightRequest { - int64 height = 1; - // pagination defines an pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. -message GetValidatorSetByHeightResponse { - int64 block_height = 1; - repeated Validator validators = 2; - // pagination defines an pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 3; -} - -// GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. -message GetLatestValidatorSetRequest { - // pagination defines an pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. -message GetLatestValidatorSetResponse { - int64 block_height = 1; - repeated Validator validators = 2; - // pagination defines an pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 3; -} - -// Validator is the type for the validator-set. -message Validator { - string address = 1; - google.protobuf.Any pub_key = 2; - int64 voting_power = 3; - int64 proposer_priority = 4; -} - -// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. -message GetBlockByHeightRequest { - int64 height = 1; -} - -// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. -message GetBlockByHeightResponse { - .tendermint.types.BlockID block_id = 1; - .tendermint.types.Block block = 2; -} - -// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. -message GetLatestBlockRequest {} - -// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. -message GetLatestBlockResponse { - .tendermint.types.BlockID block_id = 1; - .tendermint.types.Block block = 2; -} - -// GetSyncingRequest is the request type for the Query/GetSyncing RPC method. -message GetSyncingRequest {} - -// GetSyncingResponse is the response type for the Query/GetSyncing RPC method. -message GetSyncingResponse { - bool syncing = 1; -} - -// GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. -message GetNodeInfoRequest {} - -// GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC method. -message GetNodeInfoResponse { - .tendermint.p2p.DefaultNodeInfo default_node_info = 1; - VersionInfo application_version = 2; -} - -// VersionInfo is the type for the GetNodeInfoResponse message. -message VersionInfo { - string name = 1; - string app_name = 2; - string version = 3; - string git_commit = 4; - string build_tags = 5; - string go_version = 6; - repeated Module build_deps = 7; - // Since: cosmos-sdk 0.43 - string cosmos_sdk_version = 8; -} - -// Module is the type for VersionInfo -message Module { - // module path - string path = 1; - // module version - string version = 2; - // checksum - string sum = 3; -} diff --git a/third_party/proto/cosmos/capability/v1beta1/capability.proto b/third_party/proto/cosmos/capability/v1beta1/capability.proto deleted file mode 100644 index 1c8332f341..0000000000 --- a/third_party/proto/cosmos/capability/v1beta1/capability.proto +++ /dev/null @@ -1,30 +0,0 @@ -syntax = "proto3"; -package cosmos.capability.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/capability/types"; - -import "gogoproto/gogo.proto"; - -// Capability defines an implementation of an object capability. The index -// provided to a Capability must be globally unique. -message Capability { - option (gogoproto.goproto_stringer) = false; - - uint64 index = 1 [(gogoproto.moretags) = "yaml:\"index\""]; -} - -// Owner defines a single capability owner. An owner is defined by the name of -// capability and the module name. -message Owner { - option (gogoproto.goproto_stringer) = false; - option (gogoproto.goproto_getters) = false; - - string module = 1 [(gogoproto.moretags) = "yaml:\"module\""]; - string name = 2 [(gogoproto.moretags) = "yaml:\"name\""]; -} - -// CapabilityOwners defines a set of owners of a single Capability. The set of -// owners must be unique. -message CapabilityOwners { - repeated Owner owners = 1 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/capability/v1beta1/genesis.proto b/third_party/proto/cosmos/capability/v1beta1/genesis.proto deleted file mode 100644 index 05bb0afc4a..0000000000 --- a/third_party/proto/cosmos/capability/v1beta1/genesis.proto +++ /dev/null @@ -1,26 +0,0 @@ -syntax = "proto3"; -package cosmos.capability.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/capability/v1beta1/capability.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/capability/types"; - -// GenesisOwners defines the capability owners with their corresponding index. -message GenesisOwners { - // index is the index of the capability owner. - uint64 index = 1; - - // index_owners are the owners at the given index. - CapabilityOwners index_owners = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"index_owners\""]; -} - -// GenesisState defines the capability module's genesis state. -message GenesisState { - // index is the capability global index. - uint64 index = 1; - - // owners represents a map from index to owners of the capability index - // index key is string to allow amino marshalling. - repeated GenesisOwners owners = 2 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/crisis/v1beta1/genesis.proto b/third_party/proto/cosmos/crisis/v1beta1/genesis.proto deleted file mode 100644 index 5b0ff7ec72..0000000000 --- a/third_party/proto/cosmos/crisis/v1beta1/genesis.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; -package cosmos.crisis.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/crisis/types"; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -// GenesisState defines the crisis module's genesis state. -message GenesisState { - // constant_fee is the fee used to verify the invariant in the crisis - // module. - cosmos.base.v1beta1.Coin constant_fee = 3 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"constant_fee\""]; -} diff --git a/third_party/proto/cosmos/crisis/v1beta1/tx.proto b/third_party/proto/cosmos/crisis/v1beta1/tx.proto deleted file mode 100644 index 26457ad6d5..0000000000 --- a/third_party/proto/cosmos/crisis/v1beta1/tx.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; -package cosmos.crisis.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/crisis/types"; - -import "gogoproto/gogo.proto"; - -// Msg defines the bank Msg service. -service Msg { - // VerifyInvariant defines a method to verify a particular invariance. - rpc VerifyInvariant(MsgVerifyInvariant) returns (MsgVerifyInvariantResponse); -} - -// MsgVerifyInvariant represents a message to verify a particular invariance. -message MsgVerifyInvariant { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string sender = 1; - string invariant_module_name = 2 [(gogoproto.moretags) = "yaml:\"invariant_module_name\""]; - string invariant_route = 3 [(gogoproto.moretags) = "yaml:\"invariant_route\""]; -} - -// MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. -message MsgVerifyInvariantResponse {} diff --git a/third_party/proto/cosmos/crypto/ed25519/keys.proto b/third_party/proto/cosmos/crypto/ed25519/keys.proto deleted file mode 100644 index 6ffec34483..0000000000 --- a/third_party/proto/cosmos/crypto/ed25519/keys.proto +++ /dev/null @@ -1,23 +0,0 @@ -syntax = "proto3"; -package cosmos.crypto.ed25519; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519"; - -// PubKey is an ed25519 public key for handling Tendermint keys in SDK. -// It's needed for Any serialization and SDK compatibility. -// It must not be used in a non Tendermint key context because it doesn't implement -// ADR-28. Nevertheless, you will like to use ed25519 in app user level -// then you must create a new proto message and follow ADR-28 for Address construction. -message PubKey { - option (gogoproto.goproto_stringer) = false; - - bytes key = 1 [(gogoproto.casttype) = "crypto/ed25519.PublicKey"]; -} - -// Deprecated: PrivKey defines a ed25519 private key. -// NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. -message PrivKey { - bytes key = 1 [(gogoproto.casttype) = "crypto/ed25519.PrivateKey"]; -} diff --git a/third_party/proto/cosmos/crypto/multisig/keys.proto b/third_party/proto/cosmos/crypto/multisig/keys.proto deleted file mode 100644 index f8398e8052..0000000000 --- a/third_party/proto/cosmos/crypto/multisig/keys.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; -package cosmos.crypto.multisig; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/multisig"; - -// LegacyAminoPubKey specifies a public key type -// which nests multiple public keys and a threshold, -// it uses legacy amino address rules. -message LegacyAminoPubKey { - option (gogoproto.goproto_getters) = false; - - uint32 threshold = 1 [(gogoproto.moretags) = "yaml:\"threshold\""]; - repeated google.protobuf.Any public_keys = 2 - [(gogoproto.customname) = "PubKeys", (gogoproto.moretags) = "yaml:\"pubkeys\""]; -} diff --git a/third_party/proto/cosmos/crypto/multisig/v1beta1/multisig.proto b/third_party/proto/cosmos/crypto/multisig/v1beta1/multisig.proto deleted file mode 100644 index bf671f1711..0000000000 --- a/third_party/proto/cosmos/crypto/multisig/v1beta1/multisig.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; -package cosmos.crypto.multisig.v1beta1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/crypto/types"; - -// MultiSignature wraps the signatures from a multisig.LegacyAminoPubKey. -// See cosmos.tx.v1betata1.ModeInfo.Multi for how to specify which signers -// signed and with which modes. -message MultiSignature { - option (gogoproto.goproto_unrecognized) = true; - repeated bytes signatures = 1; -} - -// CompactBitArray is an implementation of a space efficient bit array. -// This is used to ensure that the encoded data takes up a minimal amount of -// space after proto encoding. -// This is not thread safe, and is not intended for concurrent usage. -message CompactBitArray { - option (gogoproto.goproto_stringer) = false; - - uint32 extra_bits_stored = 1; - bytes elems = 2; -} diff --git a/third_party/proto/cosmos/crypto/secp256k1/keys.proto b/third_party/proto/cosmos/crypto/secp256k1/keys.proto deleted file mode 100644 index a22725713a..0000000000 --- a/third_party/proto/cosmos/crypto/secp256k1/keys.proto +++ /dev/null @@ -1,22 +0,0 @@ -syntax = "proto3"; -package cosmos.crypto.secp256k1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"; - -// PubKey defines a secp256k1 public key -// Key is the compressed form of the pubkey. The first byte depends is a 0x02 byte -// if the y-coordinate is the lexicographically largest of the two associated with -// the x-coordinate. Otherwise the first byte is a 0x03. -// This prefix is followed with the x-coordinate. -message PubKey { - option (gogoproto.goproto_stringer) = false; - - bytes key = 1; -} - -// PrivKey defines a secp256k1 private key. -message PrivKey { - bytes key = 1; -} diff --git a/third_party/proto/cosmos/crypto/secp256r1/keys.proto b/third_party/proto/cosmos/crypto/secp256r1/keys.proto deleted file mode 100644 index 2e96c6e3c6..0000000000 --- a/third_party/proto/cosmos/crypto/secp256r1/keys.proto +++ /dev/null @@ -1,23 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.crypto.secp256r1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1"; -option (gogoproto.messagename_all) = true; -option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.goproto_getters_all) = false; - -// PubKey defines a secp256r1 ECDSA public key. -message PubKey { - // Point on secp256r1 curve in a compressed representation as specified in section - // 4.3.6 of ANSI X9.62: https://webstore.ansi.org/standards/ascx9/ansix9621998 - bytes key = 1 [(gogoproto.customtype) = "ecdsaPK"]; -} - -// PrivKey defines a secp256r1 ECDSA private key. -message PrivKey { - // secret number serialized using big-endian encoding - bytes secret = 1 [(gogoproto.customtype) = "ecdsaSK"]; -} diff --git a/third_party/proto/cosmos/distribution/v1beta1/distribution.proto b/third_party/proto/cosmos/distribution/v1beta1/distribution.proto deleted file mode 100644 index ae98ec0b98..0000000000 --- a/third_party/proto/cosmos/distribution/v1beta1/distribution.proto +++ /dev/null @@ -1,157 +0,0 @@ -syntax = "proto3"; -package cosmos.distribution.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -// Params defines the set of params for the distribution module. -message Params { - option (gogoproto.goproto_stringer) = false; - string community_tax = 1 [ - (gogoproto.moretags) = "yaml:\"community_tax\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - string base_proposer_reward = 2 [ - (gogoproto.moretags) = "yaml:\"base_proposer_reward\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - string bonus_proposer_reward = 3 [ - (gogoproto.moretags) = "yaml:\"bonus_proposer_reward\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - bool withdraw_addr_enabled = 4 [(gogoproto.moretags) = "yaml:\"withdraw_addr_enabled\""]; -} - -// ValidatorHistoricalRewards represents historical rewards for a validator. -// Height is implicit within the store key. -// Cumulative reward ratio is the sum from the zeroeth period -// until this period of rewards / tokens, per the spec. -// The reference count indicates the number of objects -// which might need to reference this historical entry at any point. -// ReferenceCount = -// number of outstanding delegations which ended the associated period (and -// might need to read that record) -// + number of slashes which ended the associated period (and might need to -// read that record) -// + one per validator for the zeroeth period, set on initialization -message ValidatorHistoricalRewards { - repeated cosmos.base.v1beta1.DecCoin cumulative_reward_ratio = 1 [ - (gogoproto.moretags) = "yaml:\"cumulative_reward_ratio\"", - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false - ]; - uint32 reference_count = 2 [(gogoproto.moretags) = "yaml:\"reference_count\""]; -} - -// ValidatorCurrentRewards represents current rewards and current -// period for a validator kept as a running counter and incremented -// each block as long as the validator's tokens remain constant. -message ValidatorCurrentRewards { - repeated cosmos.base.v1beta1.DecCoin rewards = 1 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; - uint64 period = 2; -} - -// ValidatorAccumulatedCommission represents accumulated commission -// for a validator kept as a running counter, can be withdrawn at any time. -message ValidatorAccumulatedCommission { - repeated cosmos.base.v1beta1.DecCoin commission = 1 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; -} - -// ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards -// for a validator inexpensive to track, allows simple sanity checks. -message ValidatorOutstandingRewards { - repeated cosmos.base.v1beta1.DecCoin rewards = 1 [ - (gogoproto.moretags) = "yaml:\"rewards\"", - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false - ]; -} - -// ValidatorSlashEvent represents a validator slash event. -// Height is implicit within the store key. -// This is needed to calculate appropriate amount of staking tokens -// for delegations which are withdrawn after a slash has occurred. -message ValidatorSlashEvent { - uint64 validator_period = 1 [(gogoproto.moretags) = "yaml:\"validator_period\""]; - string fraction = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; -} - -// ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. -message ValidatorSlashEvents { - option (gogoproto.goproto_stringer) = false; - repeated ValidatorSlashEvent validator_slash_events = 1 - [(gogoproto.moretags) = "yaml:\"validator_slash_events\"", (gogoproto.nullable) = false]; -} - -// FeePool is the global fee pool for distribution. -message FeePool { - repeated cosmos.base.v1beta1.DecCoin community_pool = 1 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.moretags) = "yaml:\"community_pool\"" - ]; -} - -// CommunityPoolSpendProposal details a proposal for use of community funds, -// together with how many coins are proposed to be spent, and to which -// recipient account. -message CommunityPoolSpendProposal { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - string title = 1; - string description = 2; - string recipient = 3; - repeated cosmos.base.v1beta1.Coin amount = 4 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} - -// DelegatorStartingInfo represents the starting info for a delegator reward -// period. It tracks the previous validator period, the delegation's amount of -// staking token, and the creation height (to check later on if any slashes have -// occurred). NOTE: Even though validators are slashed to whole staking tokens, -// the delegators within the validator may be left with less than a full token, -// thus sdk.Dec is used. -message DelegatorStartingInfo { - uint64 previous_period = 1 [(gogoproto.moretags) = "yaml:\"previous_period\""]; - string stake = 2 [ - (gogoproto.moretags) = "yaml:\"stake\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - uint64 height = 3 [(gogoproto.moretags) = "yaml:\"creation_height\"", (gogoproto.jsontag) = "creation_height"]; -} - -// DelegationDelegatorReward represents the properties -// of a delegator's delegation reward. -message DelegationDelegatorReward { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = true; - - string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - - repeated cosmos.base.v1beta1.DecCoin reward = 2 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; -} - -// CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal -// with a deposit -message CommunityPoolSpendProposalWithDeposit { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = true; - - string title = 1 [(gogoproto.moretags) = "yaml:\"title\""]; - string description = 2 [(gogoproto.moretags) = "yaml:\"description\""]; - string recipient = 3 [(gogoproto.moretags) = "yaml:\"recipient\""]; - string amount = 4 [(gogoproto.moretags) = "yaml:\"amount\""]; - string deposit = 5 [(gogoproto.moretags) = "yaml:\"deposit\""]; -} diff --git a/third_party/proto/cosmos/distribution/v1beta1/genesis.proto b/third_party/proto/cosmos/distribution/v1beta1/genesis.proto deleted file mode 100644 index c0b17cdf11..0000000000 --- a/third_party/proto/cosmos/distribution/v1beta1/genesis.proto +++ /dev/null @@ -1,155 +0,0 @@ -syntax = "proto3"; -package cosmos.distribution.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/distribution/v1beta1/distribution.proto"; - -// DelegatorWithdrawInfo is the address for where distributions rewards are -// withdrawn to by default this struct is only used at genesis to feed in -// default withdraw addresses. -message DelegatorWithdrawInfo { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_address is the address of the delegator. - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - - // withdraw_address is the address to withdraw the delegation rewards to. - string withdraw_address = 2 [(gogoproto.moretags) = "yaml:\"withdraw_address\""]; -} - -// ValidatorOutstandingRewardsRecord is used for import/export via genesis json. -message ValidatorOutstandingRewardsRecord { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // validator_address is the address of the validator. - string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - - // outstanding_rewards represents the oustanding rewards of a validator. - repeated cosmos.base.v1beta1.DecCoin outstanding_rewards = 2 [ - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"outstanding_rewards\"" - ]; -} - -// ValidatorAccumulatedCommissionRecord is used for import / export via genesis -// json. -message ValidatorAccumulatedCommissionRecord { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // validator_address is the address of the validator. - string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - - // accumulated is the accumulated commission of a validator. - ValidatorAccumulatedCommission accumulated = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"accumulated\""]; -} - -// ValidatorHistoricalRewardsRecord is used for import / export via genesis -// json. -message ValidatorHistoricalRewardsRecord { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // validator_address is the address of the validator. - string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - - // period defines the period the historical rewards apply to. - uint64 period = 2; - - // rewards defines the historical rewards of a validator. - ValidatorHistoricalRewards rewards = 3 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"rewards\""]; -} - -// ValidatorCurrentRewardsRecord is used for import / export via genesis json. -message ValidatorCurrentRewardsRecord { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // validator_address is the address of the validator. - string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - - // rewards defines the current rewards of a validator. - ValidatorCurrentRewards rewards = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"rewards\""]; -} - -// DelegatorStartingInfoRecord used for import / export via genesis json. -message DelegatorStartingInfoRecord { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_address is the address of the delegator. - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - - // validator_address is the address of the validator. - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - - // starting_info defines the starting info of a delegator. - DelegatorStartingInfo starting_info = 3 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"starting_info\""]; -} - -// ValidatorSlashEventRecord is used for import / export via genesis json. -message ValidatorSlashEventRecord { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // validator_address is the address of the validator. - string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - // height defines the block height at which the slash event occured. - uint64 height = 2; - // period is the period of the slash event. - uint64 period = 3; - // validator_slash_event describes the slash event. - ValidatorSlashEvent validator_slash_event = 4 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"event\""]; -} - -// GenesisState defines the distribution module's genesis state. -message GenesisState { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // params defines all the paramaters of the module. - Params params = 1 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"params\""]; - - // fee_pool defines the fee pool at genesis. - FeePool fee_pool = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"fee_pool\""]; - - // fee_pool defines the delegator withdraw infos at genesis. - repeated DelegatorWithdrawInfo delegator_withdraw_infos = 3 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"delegator_withdraw_infos\""]; - - // fee_pool defines the previous proposer at genesis. - string previous_proposer = 4 [(gogoproto.moretags) = "yaml:\"previous_proposer\""]; - - // fee_pool defines the outstanding rewards of all validators at genesis. - repeated ValidatorOutstandingRewardsRecord outstanding_rewards = 5 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"outstanding_rewards\""]; - - // fee_pool defines the accumulated commisions of all validators at genesis. - repeated ValidatorAccumulatedCommissionRecord validator_accumulated_commissions = 6 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"validator_accumulated_commissions\""]; - - // fee_pool defines the historical rewards of all validators at genesis. - repeated ValidatorHistoricalRewardsRecord validator_historical_rewards = 7 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"validator_historical_rewards\""]; - - // fee_pool defines the current rewards of all validators at genesis. - repeated ValidatorCurrentRewardsRecord validator_current_rewards = 8 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"validator_current_rewards\""]; - - // fee_pool defines the delegator starting infos at genesis. - repeated DelegatorStartingInfoRecord delegator_starting_infos = 9 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"delegator_starting_infos\""]; - - // fee_pool defines the validator slash events at genesis. - repeated ValidatorSlashEventRecord validator_slash_events = 10 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"validator_slash_events\""]; -} diff --git a/third_party/proto/cosmos/distribution/v1beta1/query.proto b/third_party/proto/cosmos/distribution/v1beta1/query.proto deleted file mode 100644 index 2991218d80..0000000000 --- a/third_party/proto/cosmos/distribution/v1beta1/query.proto +++ /dev/null @@ -1,218 +0,0 @@ -syntax = "proto3"; -package cosmos.distribution.v1beta1; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/distribution/v1beta1/distribution.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; - -// Query defines the gRPC querier service for distribution module. -service Query { - // Params queries params of the distribution module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/params"; - } - - // ValidatorOutstandingRewards queries rewards of a validator address. - rpc ValidatorOutstandingRewards(QueryValidatorOutstandingRewardsRequest) - returns (QueryValidatorOutstandingRewardsResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/" - "{validator_address}/outstanding_rewards"; - } - - // ValidatorCommission queries accumulated commission for a validator. - rpc ValidatorCommission(QueryValidatorCommissionRequest) returns (QueryValidatorCommissionResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/" - "{validator_address}/commission"; - } - - // ValidatorSlashes queries slash events of a validator. - rpc ValidatorSlashes(QueryValidatorSlashesRequest) returns (QueryValidatorSlashesResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/validators/{validator_address}/slashes"; - } - - // DelegationRewards queries the total rewards accrued by a delegation. - rpc DelegationRewards(QueryDelegationRewardsRequest) returns (QueryDelegationRewardsResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards/" - "{validator_address}"; - } - - // DelegationTotalRewards queries the total rewards accrued by a each - // validator. - rpc DelegationTotalRewards(QueryDelegationTotalRewardsRequest) returns (QueryDelegationTotalRewardsResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/{delegator_address}/rewards"; - } - - // DelegatorValidators queries the validators of a delegator. - rpc DelegatorValidators(QueryDelegatorValidatorsRequest) returns (QueryDelegatorValidatorsResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/" - "{delegator_address}/validators"; - } - - // DelegatorWithdrawAddress queries withdraw address of a delegator. - rpc DelegatorWithdrawAddress(QueryDelegatorWithdrawAddressRequest) returns (QueryDelegatorWithdrawAddressResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/delegators/" - "{delegator_address}/withdraw_address"; - } - - // CommunityPool queries the community pool coins. - rpc CommunityPool(QueryCommunityPoolRequest) returns (QueryCommunityPoolResponse) { - option (google.api.http).get = "/cosmos/distribution/v1beta1/community_pool"; - } -} - -// 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]; -} - -// QueryValidatorOutstandingRewardsRequest is the request type for the -// Query/ValidatorOutstandingRewards RPC method. -message QueryValidatorOutstandingRewardsRequest { - // validator_address defines the validator address to query for. - string validator_address = 1; -} - -// QueryValidatorOutstandingRewardsResponse is the response type for the -// Query/ValidatorOutstandingRewards RPC method. -message QueryValidatorOutstandingRewardsResponse { - ValidatorOutstandingRewards rewards = 1 [(gogoproto.nullable) = false]; -} - -// QueryValidatorCommissionRequest is the request type for the -// Query/ValidatorCommission RPC method -message QueryValidatorCommissionRequest { - // validator_address defines the validator address to query for. - string validator_address = 1; -} - -// QueryValidatorCommissionResponse is the response type for the -// Query/ValidatorCommission RPC method -message QueryValidatorCommissionResponse { - // commission defines the commision the validator received. - ValidatorAccumulatedCommission commission = 1 [(gogoproto.nullable) = false]; -} - -// QueryValidatorSlashesRequest is the request type for the -// Query/ValidatorSlashes RPC method -message QueryValidatorSlashesRequest { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = true; - - // validator_address defines the validator address to query for. - string validator_address = 1; - // starting_height defines the optional starting height to query the slashes. - uint64 starting_height = 2; - // starting_height defines the optional ending height to query the slashes. - uint64 ending_height = 3; - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 4; -} - -// QueryValidatorSlashesResponse is the response type for the -// Query/ValidatorSlashes RPC method. -message QueryValidatorSlashesResponse { - // slashes defines the slashes the validator received. - repeated ValidatorSlashEvent slashes = 1 [(gogoproto.nullable) = false]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryDelegationRewardsRequest is the request type for the -// Query/DelegationRewards RPC method. -message QueryDelegationRewardsRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_address defines the delegator address to query for. - string delegator_address = 1; - // validator_address defines the validator address to query for. - string validator_address = 2; -} - -// QueryDelegationRewardsResponse is the response type for the -// Query/DelegationRewards RPC method. -message QueryDelegationRewardsResponse { - // rewards defines the rewards accrued by a delegation. - repeated cosmos.base.v1beta1.DecCoin rewards = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"]; -} - -// QueryDelegationTotalRewardsRequest is the request type for the -// Query/DelegationTotalRewards RPC method. -message QueryDelegationTotalRewardsRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - // delegator_address defines the delegator address to query for. - string delegator_address = 1; -} - -// QueryDelegationTotalRewardsResponse is the response type for the -// Query/DelegationTotalRewards RPC method. -message QueryDelegationTotalRewardsResponse { - // rewards defines all the rewards accrued by a delegator. - repeated DelegationDelegatorReward rewards = 1 [(gogoproto.nullable) = false]; - // total defines the sum of all the rewards. - repeated cosmos.base.v1beta1.DecCoin total = 2 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins"]; -} - -// QueryDelegatorValidatorsRequest is the request type for the -// Query/DelegatorValidators RPC method. -message QueryDelegatorValidatorsRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_address defines the delegator address to query for. - string delegator_address = 1; -} - -// QueryDelegatorValidatorsResponse is the response type for the -// Query/DelegatorValidators RPC method. -message QueryDelegatorValidatorsResponse { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // validators defines the validators a delegator is delegating for. - repeated string validators = 1; -} - -// QueryDelegatorWithdrawAddressRequest is the request type for the -// Query/DelegatorWithdrawAddress RPC method. -message QueryDelegatorWithdrawAddressRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_address defines the delegator address to query for. - string delegator_address = 1; -} - -// QueryDelegatorWithdrawAddressResponse is the response type for the -// Query/DelegatorWithdrawAddress RPC method. -message QueryDelegatorWithdrawAddressResponse { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // withdraw_address defines the delegator address to query for. - string withdraw_address = 1; -} - -// QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC -// method. -message QueryCommunityPoolRequest {} - -// QueryCommunityPoolResponse is the response type for the Query/CommunityPool -// RPC method. -message QueryCommunityPoolResponse { - // pool defines community pool's coins. - repeated cosmos.base.v1beta1.DecCoin pool = 1 - [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.DecCoins", (gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/distribution/v1beta1/tx.proto b/third_party/proto/cosmos/distribution/v1beta1/tx.proto deleted file mode 100644 index e6ce478bcd..0000000000 --- a/third_party/proto/cosmos/distribution/v1beta1/tx.proto +++ /dev/null @@ -1,79 +0,0 @@ -syntax = "proto3"; -package cosmos.distribution.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/distribution/types"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -// Msg defines the distribution Msg service. -service Msg { - // SetWithdrawAddress defines a method to change the withdraw address - // for a delegator (or validator self-delegation). - rpc SetWithdrawAddress(MsgSetWithdrawAddress) returns (MsgSetWithdrawAddressResponse); - - // WithdrawDelegatorReward defines a method to withdraw rewards of delegator - // from a single validator. - rpc WithdrawDelegatorReward(MsgWithdrawDelegatorReward) returns (MsgWithdrawDelegatorRewardResponse); - - // WithdrawValidatorCommission defines a method to withdraw the - // full commission to the validator address. - rpc WithdrawValidatorCommission(MsgWithdrawValidatorCommission) returns (MsgWithdrawValidatorCommissionResponse); - - // FundCommunityPool defines a method to allow an account to directly - // fund the community pool. - rpc FundCommunityPool(MsgFundCommunityPool) returns (MsgFundCommunityPoolResponse); -} - -// MsgSetWithdrawAddress sets the withdraw address for -// a delegator (or validator self-delegation). -message MsgSetWithdrawAddress { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string withdraw_address = 2 [(gogoproto.moretags) = "yaml:\"withdraw_address\""]; -} - -// MsgSetWithdrawAddressResponse defines the Msg/SetWithdrawAddress response type. -message MsgSetWithdrawAddressResponse {} - -// MsgWithdrawDelegatorReward represents delegation withdrawal to a delegator -// from a single validator. -message MsgWithdrawDelegatorReward { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; -} - -// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. -message MsgWithdrawDelegatorRewardResponse {} - -// MsgWithdrawValidatorCommission withdraws the full commission to the validator -// address. -message MsgWithdrawValidatorCommission { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string validator_address = 1 [(gogoproto.moretags) = "yaml:\"validator_address\""]; -} - -// MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. -message MsgWithdrawValidatorCommissionResponse {} - -// MsgFundCommunityPool allows an account to directly -// fund the community pool. -message MsgFundCommunityPool { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - repeated cosmos.base.v1beta1.Coin amount = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - string depositor = 2; -} - -// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. -message MsgFundCommunityPoolResponse {} diff --git a/third_party/proto/cosmos/evidence/v1beta1/evidence.proto b/third_party/proto/cosmos/evidence/v1beta1/evidence.proto deleted file mode 100644 index 14612c314f..0000000000 --- a/third_party/proto/cosmos/evidence/v1beta1/evidence.proto +++ /dev/null @@ -1,21 +0,0 @@ -syntax = "proto3"; -package cosmos.evidence.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; - -// Equivocation implements the Evidence interface and defines evidence of double -// signing misbehavior. -message Equivocation { - option (gogoproto.goproto_stringer) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.equal) = false; - - int64 height = 1; - google.protobuf.Timestamp time = 2 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - int64 power = 3; - string consensus_address = 4 [(gogoproto.moretags) = "yaml:\"consensus_address\""]; -} \ No newline at end of file diff --git a/third_party/proto/cosmos/evidence/v1beta1/genesis.proto b/third_party/proto/cosmos/evidence/v1beta1/genesis.proto deleted file mode 100644 index 199f446f7e..0000000000 --- a/third_party/proto/cosmos/evidence/v1beta1/genesis.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; -package cosmos.evidence.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; - -import "google/protobuf/any.proto"; - -// GenesisState defines the evidence module's genesis state. -message GenesisState { - // evidence defines all the evidence at genesis. - repeated google.protobuf.Any evidence = 1; -} diff --git a/third_party/proto/cosmos/evidence/v1beta1/query.proto b/third_party/proto/cosmos/evidence/v1beta1/query.proto deleted file mode 100644 index eda00544c7..0000000000 --- a/third_party/proto/cosmos/evidence/v1beta1/query.proto +++ /dev/null @@ -1,51 +0,0 @@ -syntax = "proto3"; -package cosmos.evidence.v1beta1; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "google/api/annotations.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; - -// Query defines the gRPC querier service. -service Query { - // Evidence queries evidence based on evidence hash. - rpc Evidence(QueryEvidenceRequest) returns (QueryEvidenceResponse) { - option (google.api.http).get = "/cosmos/evidence/v1beta1/evidence/{evidence_hash}"; - } - - // AllEvidence queries all evidence. - rpc AllEvidence(QueryAllEvidenceRequest) returns (QueryAllEvidenceResponse) { - option (google.api.http).get = "/cosmos/evidence/v1beta1/evidence"; - } -} - -// QueryEvidenceRequest is the request type for the Query/Evidence RPC method. -message QueryEvidenceRequest { - // evidence_hash defines the hash of the requested evidence. - bytes evidence_hash = 1 [(gogoproto.casttype) = "github.com/tendermint/tendermint/libs/bytes.HexBytes"]; -} - -// QueryEvidenceResponse is the response type for the Query/Evidence RPC method. -message QueryEvidenceResponse { - // evidence returns the requested evidence. - google.protobuf.Any evidence = 1; -} - -// QueryEvidenceRequest is the request type for the Query/AllEvidence RPC -// method. -message QueryAllEvidenceRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC -// method. -message QueryAllEvidenceResponse { - // evidence returns all evidences. - repeated google.protobuf.Any evidence = 1; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} diff --git a/third_party/proto/cosmos/evidence/v1beta1/tx.proto b/third_party/proto/cosmos/evidence/v1beta1/tx.proto deleted file mode 100644 index 38795f25d4..0000000000 --- a/third_party/proto/cosmos/evidence/v1beta1/tx.proto +++ /dev/null @@ -1,32 +0,0 @@ -syntax = "proto3"; -package cosmos.evidence.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/evidence/types"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "cosmos_proto/cosmos.proto"; - -// Msg defines the evidence Msg service. -service Msg { - // SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or - // counterfactual signing. - rpc SubmitEvidence(MsgSubmitEvidence) returns (MsgSubmitEvidenceResponse); -} - -// MsgSubmitEvidence represents a message that supports submitting arbitrary -// Evidence of misbehavior such as equivocation or counterfactual signing. -message MsgSubmitEvidence { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string submitter = 1; - google.protobuf.Any evidence = 2 [(cosmos_proto.accepts_interface) = "Evidence"]; -} - -// MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. -message MsgSubmitEvidenceResponse { - // hash defines the hash of the evidence. - bytes hash = 4; -} diff --git a/third_party/proto/cosmos/feegrant/v1beta1/feegrant.proto b/third_party/proto/cosmos/feegrant/v1beta1/feegrant.proto deleted file mode 100644 index a86691f912..0000000000 --- a/third_party/proto/cosmos/feegrant/v1beta1/feegrant.proto +++ /dev/null @@ -1,78 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.feegrant.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/duration.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; - -// BasicAllowance implements Allowance with a one-time grant of tokens -// that optionally expires. The grantee can use up to SpendLimit to cover fees. -message BasicAllowance { - option (cosmos_proto.implements_interface) = "FeeAllowanceI"; - - // spend_limit specifies the maximum amount of tokens that can be spent - // by this allowance and will be updated as tokens are spent. If it is - // empty, there is no spend limit and any amount of coins can be spent. - repeated cosmos.base.v1beta1.Coin spend_limit = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - - // expiration specifies an optional time when this allowance expires - google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true]; -} - -// PeriodicAllowance extends Allowance to allow for both a maximum cap, -// as well as a limit per time period. -message PeriodicAllowance { - option (cosmos_proto.implements_interface) = "FeeAllowanceI"; - - // basic specifies a struct of `BasicAllowance` - BasicAllowance basic = 1 [(gogoproto.nullable) = false]; - - // period specifies the time duration in which period_spend_limit coins can - // be spent before that allowance is reset - google.protobuf.Duration period = 2 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; - - // period_spend_limit specifies the maximum number of coins that can be spent - // in the period - repeated cosmos.base.v1beta1.Coin period_spend_limit = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - - // period_can_spend is the number of coins left to be spent before the period_reset time - repeated cosmos.base.v1beta1.Coin period_can_spend = 4 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - - // period_reset is the time at which this period resets and a new one begins, - // it is calculated from the start time of the first transaction after the - // last period ended - google.protobuf.Timestamp period_reset = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; -} - -// AllowedMsgAllowance creates allowance only for specified message types. -message AllowedMsgAllowance { - option (gogoproto.goproto_getters) = false; - option (cosmos_proto.implements_interface) = "FeeAllowanceI"; - - // allowance can be any of basic and filtered fee allowance. - google.protobuf.Any allowance = 1 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; - - // allowed_messages are the messages for which the grantee has the access. - repeated string allowed_messages = 2; -} - -// Grant is stored in the KVStore to record a grant with full context -message Grant { - // granter is the address of the user granting an allowance of their funds. - string granter = 1; - - // grantee is the address of the user being granted an allowance of another user's funds. - string grantee = 2; - - // allowance can be any of basic and filtered fee allowance. - google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; -} diff --git a/third_party/proto/cosmos/feegrant/v1beta1/genesis.proto b/third_party/proto/cosmos/feegrant/v1beta1/genesis.proto deleted file mode 100644 index 5b1ac4ca55..0000000000 --- a/third_party/proto/cosmos/feegrant/v1beta1/genesis.proto +++ /dev/null @@ -1,13 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.feegrant.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/feegrant/v1beta1/feegrant.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; - -// GenesisState contains a set of fee allowances, persisted from the store -message GenesisState { - repeated Grant allowances = 1 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/feegrant/v1beta1/query.proto b/third_party/proto/cosmos/feegrant/v1beta1/query.proto deleted file mode 100644 index 9cf2a4987d..0000000000 --- a/third_party/proto/cosmos/feegrant/v1beta1/query.proto +++ /dev/null @@ -1,55 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.feegrant.v1beta1; - -import "cosmos/feegrant/v1beta1/feegrant.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "google/api/annotations.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; - -// Query defines the gRPC querier service. -service Query { - - // Allowance returns fee granted to the grantee by the granter. - rpc Allowance(QueryAllowanceRequest) returns (QueryAllowanceResponse) { - option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}"; - } - - // Allowances returns all the grants for address. - rpc Allowances(QueryAllowancesRequest) returns (QueryAllowancesResponse) { - option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowances/{grantee}"; - } -} - -// QueryAllowanceRequest is the request type for the Query/Allowance RPC method. -message QueryAllowanceRequest { - // granter is the address of the user granting an allowance of their funds. - string granter = 1; - - // grantee is the address of the user being granted an allowance of another user's funds. - string grantee = 2; -} - -// QueryAllowanceResponse is the response type for the Query/Allowance RPC method. -message QueryAllowanceResponse { - // allowance is a allowance granted for grantee by granter. - cosmos.feegrant.v1beta1.Grant allowance = 1; -} - -// QueryAllowancesRequest is the request type for the Query/Allowances RPC method. -message QueryAllowancesRequest { - string grantee = 1; - - // pagination defines an pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryAllowancesResponse is the response type for the Query/Allowances RPC method. -message QueryAllowancesResponse { - // allowances are allowance's granted for grantee by granter. - repeated cosmos.feegrant.v1beta1.Grant allowances = 1; - - // pagination defines an pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} diff --git a/third_party/proto/cosmos/feegrant/v1beta1/tx.proto b/third_party/proto/cosmos/feegrant/v1beta1/tx.proto deleted file mode 100644 index 2d875e9224..0000000000 --- a/third_party/proto/cosmos/feegrant/v1beta1/tx.proto +++ /dev/null @@ -1,49 +0,0 @@ -// Since: cosmos-sdk 0.43 -syntax = "proto3"; -package cosmos.feegrant.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "cosmos_proto/cosmos.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/feegrant"; - -// Msg defines the feegrant msg service. -service Msg { - - // GrantAllowance grants fee allowance to the grantee on the granter's - // account with the provided expiration time. - rpc GrantAllowance(MsgGrantAllowance) returns (MsgGrantAllowanceResponse); - - // RevokeAllowance revokes any fee allowance of granter's account that - // has been granted to the grantee. - rpc RevokeAllowance(MsgRevokeAllowance) returns (MsgRevokeAllowanceResponse); -} - -// MsgGrantAllowance adds permission for Grantee to spend up to Allowance -// of fees from the account of Granter. -message MsgGrantAllowance { - // granter is the address of the user granting an allowance of their funds. - string granter = 1; - - // grantee is the address of the user being granted an allowance of another user's funds. - string grantee = 2; - - // allowance can be any of basic and filtered fee allowance. - google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; -} - -// MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type. -message MsgGrantAllowanceResponse {} - -// MsgRevokeAllowance removes any existing Allowance from Granter to Grantee. -message MsgRevokeAllowance { - // granter is the address of the user granting an allowance of their funds. - string granter = 1; - - // grantee is the address of the user being granted an allowance of another user's funds. - string grantee = 2; -} - -// MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type. -message MsgRevokeAllowanceResponse {} diff --git a/third_party/proto/cosmos/genutil/v1beta1/genesis.proto b/third_party/proto/cosmos/genutil/v1beta1/genesis.proto deleted file mode 100644 index a0207793d9..0000000000 --- a/third_party/proto/cosmos/genutil/v1beta1/genesis.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; -package cosmos.genutil.v1beta1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/genutil/types"; - -// GenesisState defines the raw genesis transaction in JSON. -message GenesisState { - // gen_txs defines the genesis transactions. - repeated bytes gen_txs = 1 [ - (gogoproto.casttype) = "encoding/json.RawMessage", - (gogoproto.jsontag) = "gentxs", - (gogoproto.moretags) = "yaml:\"gentxs\"" - ]; -} diff --git a/third_party/proto/cosmos/gov/v1beta1/genesis.proto b/third_party/proto/cosmos/gov/v1beta1/genesis.proto deleted file mode 100644 index a999500449..0000000000 --- a/third_party/proto/cosmos/gov/v1beta1/genesis.proto +++ /dev/null @@ -1,26 +0,0 @@ -syntax = "proto3"; - -package cosmos.gov.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/gov/v1beta1/gov.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; - -// GenesisState defines the gov module's genesis state. -message GenesisState { - // starting_proposal_id is the ID of the starting proposal. - uint64 starting_proposal_id = 1 [(gogoproto.moretags) = "yaml:\"starting_proposal_id\""]; - // deposits defines all the deposits present at genesis. - repeated Deposit deposits = 2 [(gogoproto.castrepeated) = "Deposits", (gogoproto.nullable) = false]; - // votes defines all the votes present at genesis. - repeated Vote votes = 3 [(gogoproto.castrepeated) = "Votes", (gogoproto.nullable) = false]; - // proposals defines all the proposals present at genesis. - repeated Proposal proposals = 4 [(gogoproto.castrepeated) = "Proposals", (gogoproto.nullable) = false]; - // params defines all the paramaters of related to deposit. - DepositParams deposit_params = 5 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"deposit_params\""]; - // params defines all the paramaters of related to voting. - VotingParams voting_params = 6 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_params\""]; - // params defines all the paramaters of related to tally. - TallyParams tally_params = 7 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"tally_params\""]; -} diff --git a/third_party/proto/cosmos/gov/v1beta1/gov.proto b/third_party/proto/cosmos/gov/v1beta1/gov.proto deleted file mode 100644 index 344b5ada19..0000000000 --- a/third_party/proto/cosmos/gov/v1beta1/gov.proto +++ /dev/null @@ -1,200 +0,0 @@ -syntax = "proto3"; -package cosmos.gov.v1beta1; - -import "cosmos/base/v1beta1/coin.proto"; -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/any.proto"; -import "google/protobuf/duration.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; -option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.stringer_all) = false; -option (gogoproto.goproto_getters_all) = false; - -// VoteOption enumerates the valid vote options for a given governance proposal. -enum VoteOption { - option (gogoproto.goproto_enum_prefix) = false; - - // VOTE_OPTION_UNSPECIFIED defines a no-op vote option. - VOTE_OPTION_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "OptionEmpty"]; - // VOTE_OPTION_YES defines a yes vote option. - VOTE_OPTION_YES = 1 [(gogoproto.enumvalue_customname) = "OptionYes"]; - // VOTE_OPTION_ABSTAIN defines an abstain vote option. - VOTE_OPTION_ABSTAIN = 2 [(gogoproto.enumvalue_customname) = "OptionAbstain"]; - // VOTE_OPTION_NO defines a no vote option. - VOTE_OPTION_NO = 3 [(gogoproto.enumvalue_customname) = "OptionNo"]; - // VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. - VOTE_OPTION_NO_WITH_VETO = 4 [(gogoproto.enumvalue_customname) = "OptionNoWithVeto"]; -} - -// WeightedVoteOption defines a unit of vote for vote split. -// -// Since: cosmos-sdk 0.43 -message WeightedVoteOption { - VoteOption option = 1; - string weight = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"weight\"" - ]; -} - -// TextProposal defines a standard text proposal whose changes need to be -// manually updated in case of approval. -message TextProposal { - option (cosmos_proto.implements_interface) = "Content"; - - option (gogoproto.equal) = true; - - string title = 1; - string description = 2; -} - -// Deposit defines an amount deposited by an account address to an active -// proposal. -message Deposit { - option (gogoproto.goproto_getters) = false; - option (gogoproto.equal) = false; - - uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; - string depositor = 2; - repeated cosmos.base.v1beta1.Coin amount = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} - -// Proposal defines the core field members of a governance proposal. -message Proposal { - option (gogoproto.equal) = true; - - uint64 proposal_id = 1 [(gogoproto.jsontag) = "id", (gogoproto.moretags) = "yaml:\"id\""]; - google.protobuf.Any content = 2 [(cosmos_proto.accepts_interface) = "Content"]; - ProposalStatus status = 3 [(gogoproto.moretags) = "yaml:\"proposal_status\""]; - TallyResult final_tally_result = 4 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"final_tally_result\""]; - google.protobuf.Timestamp submit_time = 5 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"submit_time\""]; - google.protobuf.Timestamp deposit_end_time = 6 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"deposit_end_time\""]; - repeated cosmos.base.v1beta1.Coin total_deposit = 7 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"total_deposit\"" - ]; - google.protobuf.Timestamp voting_start_time = 8 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_start_time\""]; - google.protobuf.Timestamp voting_end_time = 9 - [(gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"voting_end_time\""]; -} - -// ProposalStatus enumerates the valid statuses of a proposal. -enum ProposalStatus { - option (gogoproto.goproto_enum_prefix) = false; - - // PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. - PROPOSAL_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "StatusNil"]; - // PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit - // period. - PROPOSAL_STATUS_DEPOSIT_PERIOD = 1 [(gogoproto.enumvalue_customname) = "StatusDepositPeriod"]; - // PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting - // period. - PROPOSAL_STATUS_VOTING_PERIOD = 2 [(gogoproto.enumvalue_customname) = "StatusVotingPeriod"]; - // PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has - // passed. - PROPOSAL_STATUS_PASSED = 3 [(gogoproto.enumvalue_customname) = "StatusPassed"]; - // PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has - // been rejected. - PROPOSAL_STATUS_REJECTED = 4 [(gogoproto.enumvalue_customname) = "StatusRejected"]; - // PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has - // failed. - PROPOSAL_STATUS_FAILED = 5 [(gogoproto.enumvalue_customname) = "StatusFailed"]; -} - -// TallyResult defines a standard tally for a governance proposal. -message TallyResult { - option (gogoproto.equal) = true; - - string yes = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; - string abstain = 2 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; - string no = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; - string no_with_veto = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"no_with_veto\"" - ]; -} - -// Vote defines a vote on a governance proposal. -// A Vote consists of a proposal ID, the voter, and the vote option. -message Vote { - option (gogoproto.goproto_stringer) = false; - option (gogoproto.equal) = false; - - uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; - string voter = 2; - // Deprecated: Prefer to use `options` instead. This field is set in queries - // if and only if `len(options) == 1` and that option has weight 1. In all - // other cases, this field will default to VOTE_OPTION_UNSPECIFIED. - VoteOption option = 3 [deprecated = true]; - // Since: cosmos-sdk 0.43 - repeated WeightedVoteOption options = 4 [(gogoproto.nullable) = false]; -} - -// DepositParams defines the params for deposits on governance proposals. -message DepositParams { - // Minimum deposit for a proposal to enter voting period. - repeated cosmos.base.v1beta1.Coin min_deposit = 1 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"min_deposit\"", - (gogoproto.jsontag) = "min_deposit,omitempty" - ]; - - // Maximum period for Atom holders to deposit on a proposal. Initial value: 2 - // months. - google.protobuf.Duration max_deposit_period = 2 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.jsontag) = "max_deposit_period,omitempty", - (gogoproto.moretags) = "yaml:\"max_deposit_period\"" - ]; -} - -// VotingParams defines the params for voting on governance proposals. -message VotingParams { - // Length of the voting period. - google.protobuf.Duration voting_period = 1 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.jsontag) = "voting_period,omitempty", - (gogoproto.moretags) = "yaml:\"voting_period\"" - ]; -} - -// TallyParams defines the params for tallying votes on governance proposals. -message TallyParams { - // Minimum percentage of total stake needed to vote for a result to be - // considered valid. - bytes quorum = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "quorum,omitempty" - ]; - - // Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. - bytes threshold = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "threshold,omitempty" - ]; - - // Minimum value of Veto votes to Total votes ratio for proposal to be - // vetoed. Default value: 1/3. - bytes veto_threshold = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "veto_threshold,omitempty", - (gogoproto.moretags) = "yaml:\"veto_threshold\"" - ]; -} diff --git a/third_party/proto/cosmos/gov/v1beta1/query.proto b/third_party/proto/cosmos/gov/v1beta1/query.proto deleted file mode 100644 index da62bdbad1..0000000000 --- a/third_party/proto/cosmos/gov/v1beta1/query.proto +++ /dev/null @@ -1,190 +0,0 @@ -syntax = "proto3"; -package cosmos.gov.v1beta1; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/gov/v1beta1/gov.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; - -// Query defines the gRPC querier service for gov module -service Query { - // Proposal queries proposal details based on ProposalID. - rpc Proposal(QueryProposalRequest) returns (QueryProposalResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}"; - } - - // Proposals queries all proposals based on given status. - rpc Proposals(QueryProposalsRequest) returns (QueryProposalsResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals"; - } - - // Vote queries voted information based on proposalID, voterAddr. - rpc Vote(QueryVoteRequest) returns (QueryVoteResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}"; - } - - // Votes queries votes of a given proposal. - rpc Votes(QueryVotesRequest) returns (QueryVotesResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/votes"; - } - - // Params queries all parameters of the gov module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/params/{params_type}"; - } - - // Deposit queries single deposit information based proposalID, depositAddr. - rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}"; - } - - // Deposits queries all deposits of a single proposal. - rpc Deposits(QueryDepositsRequest) returns (QueryDepositsResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits"; - } - - // TallyResult queries the tally of a proposal vote. - rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { - option (google.api.http).get = "/cosmos/gov/v1beta1/proposals/{proposal_id}/tally"; - } -} - -// QueryProposalRequest is the request type for the Query/Proposal RPC method. -message QueryProposalRequest { - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; -} - -// QueryProposalResponse is the response type for the Query/Proposal RPC method. -message QueryProposalResponse { - Proposal proposal = 1 [(gogoproto.nullable) = false]; -} - -// QueryProposalsRequest is the request type for the Query/Proposals RPC method. -message QueryProposalsRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // proposal_status defines the status of the proposals. - ProposalStatus proposal_status = 1; - - // voter defines the voter address for the proposals. - string voter = 2; - - // depositor defines the deposit addresses from the proposals. - string depositor = 3; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 4; -} - -// QueryProposalsResponse is the response type for the Query/Proposals RPC -// method. -message QueryProposalsResponse { - repeated Proposal proposals = 1 [(gogoproto.nullable) = false]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryVoteRequest is the request type for the Query/Vote RPC method. -message QueryVoteRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; - - // voter defines the oter address for the proposals. - string voter = 2; -} - -// QueryVoteResponse is the response type for the Query/Vote RPC method. -message QueryVoteResponse { - // vote defined the queried vote. - Vote vote = 1 [(gogoproto.nullable) = false]; -} - -// QueryVotesRequest is the request type for the Query/Votes RPC method. -message QueryVotesRequest { - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryVotesResponse is the response type for the Query/Votes RPC method. -message QueryVotesResponse { - // votes defined the queried votes. - repeated Vote votes = 1 [(gogoproto.nullable) = false]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -message QueryParamsRequest { - // params_type defines which parameters to query for, can be one of "voting", - // "tallying" or "deposit". - string params_type = 1; -} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -message QueryParamsResponse { - // voting_params defines the parameters related to voting. - VotingParams voting_params = 1 [(gogoproto.nullable) = false]; - // deposit_params defines the parameters related to deposit. - DepositParams deposit_params = 2 [(gogoproto.nullable) = false]; - // tally_params defines the parameters related to tally. - TallyParams tally_params = 3 [(gogoproto.nullable) = false]; -} - -// QueryDepositRequest is the request type for the Query/Deposit RPC method. -message QueryDepositRequest { - option (gogoproto.goproto_getters) = false; - option (gogoproto.equal) = false; - - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; - - // depositor defines the deposit addresses from the proposals. - string depositor = 2; -} - -// QueryDepositResponse is the response type for the Query/Deposit RPC method. -message QueryDepositResponse { - // deposit defines the requested deposit. - Deposit deposit = 1 [(gogoproto.nullable) = false]; -} - -// QueryDepositsRequest is the request type for the Query/Deposits RPC method. -message QueryDepositsRequest { - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryDepositsResponse is the response type for the Query/Deposits RPC method. -message QueryDepositsResponse { - repeated Deposit deposits = 1 [(gogoproto.nullable) = false]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryTallyResultRequest is the request type for the Query/Tally RPC method. -message QueryTallyResultRequest { - // proposal_id defines the unique id of the proposal. - uint64 proposal_id = 1; -} - -// QueryTallyResultResponse is the response type for the Query/Tally RPC method. -message QueryTallyResultResponse { - // tally defines the requested tally. - TallyResult tally = 1 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/gov/v1beta1/tx.proto b/third_party/proto/cosmos/gov/v1beta1/tx.proto deleted file mode 100644 index 36c0a95d27..0000000000 --- a/third_party/proto/cosmos/gov/v1beta1/tx.proto +++ /dev/null @@ -1,99 +0,0 @@ -syntax = "proto3"; -package cosmos.gov.v1beta1; - -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/gov/v1beta1/gov.proto"; -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/gov/types"; - -// Msg defines the bank Msg service. -service Msg { - // SubmitProposal defines a method to create new proposal given a content. - rpc SubmitProposal(MsgSubmitProposal) returns (MsgSubmitProposalResponse); - - // Vote defines a method to add a vote on a specific proposal. - rpc Vote(MsgVote) returns (MsgVoteResponse); - - // VoteWeighted defines a method to add a weighted vote on a specific proposal. - // - // Since: cosmos-sdk 0.43 - rpc VoteWeighted(MsgVoteWeighted) returns (MsgVoteWeightedResponse); - - // Deposit defines a method to add deposit on a specific proposal. - rpc Deposit(MsgDeposit) returns (MsgDepositResponse); -} - -// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary -// proposal Content. -message MsgSubmitProposal { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - google.protobuf.Any content = 1 [(cosmos_proto.accepts_interface) = "Content"]; - repeated cosmos.base.v1beta1.Coin initial_deposit = 2 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"initial_deposit\"" - ]; - string proposer = 3; -} - -// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. -message MsgSubmitProposalResponse { - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; -} - -// MsgVote defines a message to cast a vote. -message MsgVote { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; - string voter = 2; - VoteOption option = 3; -} - -// MsgVoteResponse defines the Msg/Vote response type. -message MsgVoteResponse {} - -// MsgVoteWeighted defines a message to cast a vote. -// -// Since: cosmos-sdk 0.43 -message MsgVoteWeighted { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - uint64 proposal_id = 1 [(gogoproto.moretags) = "yaml:\"proposal_id\""]; - string voter = 2; - repeated WeightedVoteOption options = 3 [(gogoproto.nullable) = false]; -} - -// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. -// -// Since: cosmos-sdk 0.43 -message MsgVoteWeightedResponse {} - -// MsgDeposit defines a message to submit a deposit to an existing proposal. -message MsgDeposit { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - uint64 proposal_id = 1 [(gogoproto.jsontag) = "proposal_id", (gogoproto.moretags) = "yaml:\"proposal_id\""]; - string depositor = 2; - repeated cosmos.base.v1beta1.Coin amount = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} - -// MsgDepositResponse defines the Msg/Deposit response type. -message MsgDepositResponse {} diff --git a/third_party/proto/cosmos/mint/v1beta1/genesis.proto b/third_party/proto/cosmos/mint/v1beta1/genesis.proto deleted file mode 100644 index 4e783fb544..0000000000 --- a/third_party/proto/cosmos/mint/v1beta1/genesis.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; -package cosmos.mint.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/mint/v1beta1/mint.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; - -// GenesisState defines the mint module's genesis state. -message GenesisState { - // minter is a space for holding current inflation information. - Minter minter = 1 [(gogoproto.nullable) = false]; - - // params defines all the paramaters of the module. - Params params = 2 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/mint/v1beta1/mint.proto b/third_party/proto/cosmos/mint/v1beta1/mint.proto deleted file mode 100644 index f94d4ae2e8..0000000000 --- a/third_party/proto/cosmos/mint/v1beta1/mint.proto +++ /dev/null @@ -1,53 +0,0 @@ -syntax = "proto3"; -package cosmos.mint.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; - -import "gogoproto/gogo.proto"; - -// Minter represents the minting state. -message Minter { - // current annual inflation rate - string inflation = 1 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; - // current annual expected provisions - string annual_provisions = 2 [ - (gogoproto.moretags) = "yaml:\"annual_provisions\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; -} - -// Params holds parameters for the mint module. -message Params { - option (gogoproto.goproto_stringer) = false; - - // type of coin to mint - string mint_denom = 1; - // maximum annual change in inflation rate - string inflation_rate_change = 2 [ - (gogoproto.moretags) = "yaml:\"inflation_rate_change\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - // maximum inflation rate - string inflation_max = 3 [ - (gogoproto.moretags) = "yaml:\"inflation_max\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - // minimum inflation rate - string inflation_min = 4 [ - (gogoproto.moretags) = "yaml:\"inflation_min\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - // goal of percent bonded atoms - string goal_bonded = 5 [ - (gogoproto.moretags) = "yaml:\"goal_bonded\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - // expected blocks per year - uint64 blocks_per_year = 6 [(gogoproto.moretags) = "yaml:\"blocks_per_year\""]; -} diff --git a/third_party/proto/cosmos/mint/v1beta1/query.proto b/third_party/proto/cosmos/mint/v1beta1/query.proto deleted file mode 100644 index acd341d777..0000000000 --- a/third_party/proto/cosmos/mint/v1beta1/query.proto +++ /dev/null @@ -1,57 +0,0 @@ -syntax = "proto3"; -package cosmos.mint.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/mint/v1beta1/mint.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/mint/types"; - -// Query provides defines the gRPC querier service. -service Query { - // Params returns the total set of minting parameters. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/mint/v1beta1/params"; - } - - // Inflation returns the current minting inflation value. - rpc Inflation(QueryInflationRequest) returns (QueryInflationResponse) { - option (google.api.http).get = "/cosmos/mint/v1beta1/inflation"; - } - - // AnnualProvisions current minting annual provisions value. - rpc AnnualProvisions(QueryAnnualProvisionsRequest) returns (QueryAnnualProvisionsResponse) { - option (google.api.http).get = "/cosmos/mint/v1beta1/annual_provisions"; - } -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -message QueryParamsResponse { - // params defines the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false]; -} - -// QueryInflationRequest is the request type for the Query/Inflation RPC method. -message QueryInflationRequest {} - -// QueryInflationResponse is the response type for the Query/Inflation RPC -// method. -message QueryInflationResponse { - // inflation is the current minting inflation value. - bytes inflation = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; -} - -// QueryAnnualProvisionsRequest is the request type for the -// Query/AnnualProvisions RPC method. -message QueryAnnualProvisionsRequest {} - -// QueryAnnualProvisionsResponse is the response type for the -// Query/AnnualProvisions RPC method. -message QueryAnnualProvisionsResponse { - // annual_provisions is the current minting annual provisions value. - bytes annual_provisions = 1 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/params/v1beta1/params.proto b/third_party/proto/cosmos/params/v1beta1/params.proto deleted file mode 100644 index 5382fd7999..0000000000 --- a/third_party/proto/cosmos/params/v1beta1/params.proto +++ /dev/null @@ -1,27 +0,0 @@ -syntax = "proto3"; -package cosmos.params.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/params/types/proposal"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; - -// ParameterChangeProposal defines a proposal to change one or more parameters. -message ParameterChangeProposal { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - string title = 1; - string description = 2; - repeated ParamChange changes = 3 [(gogoproto.nullable) = false]; -} - -// ParamChange defines an individual parameter change, for use in -// ParameterChangeProposal. -message ParamChange { - option (gogoproto.goproto_stringer) = false; - - string subspace = 1; - string key = 2; - string value = 3; -} diff --git a/third_party/proto/cosmos/params/v1beta1/query.proto b/third_party/proto/cosmos/params/v1beta1/query.proto deleted file mode 100644 index 1078e02ae3..0000000000 --- a/third_party/proto/cosmos/params/v1beta1/query.proto +++ /dev/null @@ -1,32 +0,0 @@ -syntax = "proto3"; -package cosmos.params.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/params/v1beta1/params.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/params/types/proposal"; - -// Query defines the gRPC querier service. -service Query { - // Params queries a specific parameter of a module, given its subspace and - // key. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/params/v1beta1/params"; - } -} - -// QueryParamsRequest is request type for the Query/Params RPC method. -message QueryParamsRequest { - // subspace defines the module to query the parameter for. - string subspace = 1; - - // key defines the key of the parameter in the subspace. - string key = 2; -} - -// QueryParamsResponse is response type for the Query/Params RPC method. -message QueryParamsResponse { - // param defines the queried parameter. - ParamChange param = 1 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/slashing/v1beta1/genesis.proto b/third_party/proto/cosmos/slashing/v1beta1/genesis.proto deleted file mode 100644 index a7aebcfbad..0000000000 --- a/third_party/proto/cosmos/slashing/v1beta1/genesis.proto +++ /dev/null @@ -1,50 +0,0 @@ -syntax = "proto3"; -package cosmos.slashing.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; - -import "gogoproto/gogo.proto"; -import "cosmos/slashing/v1beta1/slashing.proto"; - -// GenesisState defines the slashing module's genesis state. -message GenesisState { - // params defines all the paramaters of related to deposit. - Params params = 1 [(gogoproto.nullable) = false]; - - // signing_infos represents a map between validator addresses and their - // signing infos. - repeated SigningInfo signing_infos = 2 - [(gogoproto.moretags) = "yaml:\"signing_infos\"", (gogoproto.nullable) = false]; - - // missed_blocks represents a map between validator addresses and their - // missed blocks. - repeated ValidatorMissedBlocks missed_blocks = 3 - [(gogoproto.moretags) = "yaml:\"missed_blocks\"", (gogoproto.nullable) = false]; -} - -// SigningInfo stores validator signing info of corresponding address. -message SigningInfo { - // address is the validator address. - string address = 1; - // validator_signing_info represents the signing info of this validator. - ValidatorSigningInfo validator_signing_info = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"validator_signing_info\""]; -} - -// ValidatorMissedBlocks contains array of missed blocks of corresponding -// address. -message ValidatorMissedBlocks { - // address is the validator address. - string address = 1; - // missed_blocks is an array of missed blocks by the validator. - repeated MissedBlock missed_blocks = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"missed_blocks\""]; -} - -// MissedBlock contains height and missed status as boolean. -message MissedBlock { - // index is the height at which the block was missed. - int64 index = 1; - // missed is the missed status. - bool missed = 2; -} diff --git a/third_party/proto/cosmos/slashing/v1beta1/query.proto b/third_party/proto/cosmos/slashing/v1beta1/query.proto deleted file mode 100644 index 869049a0ed..0000000000 --- a/third_party/proto/cosmos/slashing/v1beta1/query.proto +++ /dev/null @@ -1,63 +0,0 @@ -syntax = "proto3"; -package cosmos.slashing.v1beta1; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/slashing/v1beta1/slashing.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; - -// Query provides defines the gRPC querier service -service Query { - // Params queries the parameters of slashing module - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/slashing/v1beta1/params"; - } - - // SigningInfo queries the signing info of given cons address - rpc SigningInfo(QuerySigningInfoRequest) returns (QuerySigningInfoResponse) { - option (google.api.http).get = "/cosmos/slashing/v1beta1/signing_infos/{cons_address}"; - } - - // SigningInfos queries signing info of all validators - rpc SigningInfos(QuerySigningInfosRequest) returns (QuerySigningInfosResponse) { - option (google.api.http).get = "/cosmos/slashing/v1beta1/signing_infos"; - } -} - -// 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 params = 1 [(gogoproto.nullable) = false]; -} - -// QuerySigningInfoRequest is the request type for the Query/SigningInfo RPC -// method -message QuerySigningInfoRequest { - // cons_address is the address to query signing info of - string cons_address = 1; -} - -// QuerySigningInfoResponse is the response type for the Query/SigningInfo RPC -// method -message QuerySigningInfoResponse { - // val_signing_info is the signing info of requested val cons address - ValidatorSigningInfo val_signing_info = 1 [(gogoproto.nullable) = false]; -} - -// QuerySigningInfosRequest is the request type for the Query/SigningInfos RPC -// method -message QuerySigningInfosRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QuerySigningInfosResponse is the response type for the Query/SigningInfos RPC -// method -message QuerySigningInfosResponse { - // info is the signing info of all validators - repeated cosmos.slashing.v1beta1.ValidatorSigningInfo info = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} diff --git a/third_party/proto/cosmos/slashing/v1beta1/slashing.proto b/third_party/proto/cosmos/slashing/v1beta1/slashing.proto deleted file mode 100644 index 882a0fb60c..0000000000 --- a/third_party/proto/cosmos/slashing/v1beta1/slashing.proto +++ /dev/null @@ -1,58 +0,0 @@ -syntax = "proto3"; -package cosmos.slashing.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -// ValidatorSigningInfo defines a validator's signing info for monitoring their -// liveness activity. -message ValidatorSigningInfo { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - string address = 1; - // Height at which validator was first a candidate OR was unjailed - int64 start_height = 2 [(gogoproto.moretags) = "yaml:\"start_height\""]; - // Index which is incremented each time the validator was a bonded - // in a block and may have signed a precommit or not. This in conjunction with the - // `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. - int64 index_offset = 3 [(gogoproto.moretags) = "yaml:\"index_offset\""]; - // Timestamp until which the validator is jailed due to liveness downtime. - google.protobuf.Timestamp jailed_until = 4 - [(gogoproto.moretags) = "yaml:\"jailed_until\"", (gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - // Whether or not a validator has been tombstoned (killed out of validator set). It is set - // once the validator commits an equivocation or for any other configured misbehiavor. - bool tombstoned = 5; - // A counter kept to avoid unnecessary array reads. - // Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. - int64 missed_blocks_counter = 6 [(gogoproto.moretags) = "yaml:\"missed_blocks_counter\""]; -} - -// Params represents the parameters used for by the slashing module. -message Params { - int64 signed_blocks_window = 1 [(gogoproto.moretags) = "yaml:\"signed_blocks_window\""]; - bytes min_signed_per_window = 2 [ - (gogoproto.moretags) = "yaml:\"min_signed_per_window\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - google.protobuf.Duration downtime_jail_duration = 3 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.moretags) = "yaml:\"downtime_jail_duration\"" - ]; - bytes slash_fraction_double_sign = 4 [ - (gogoproto.moretags) = "yaml:\"slash_fraction_double_sign\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - bytes slash_fraction_downtime = 5 [ - (gogoproto.moretags) = "yaml:\"slash_fraction_downtime\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; -} diff --git a/third_party/proto/cosmos/slashing/v1beta1/tx.proto b/third_party/proto/cosmos/slashing/v1beta1/tx.proto deleted file mode 100644 index 4d63370ecc..0000000000 --- a/third_party/proto/cosmos/slashing/v1beta1/tx.proto +++ /dev/null @@ -1,26 +0,0 @@ -syntax = "proto3"; -package cosmos.slashing.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/slashing/types"; -option (gogoproto.equal_all) = true; - -import "gogoproto/gogo.proto"; - -// Msg defines the slashing Msg service. -service Msg { - // Unjail defines a method for unjailing a jailed validator, thus returning - // them into the bonded validator set, so they can begin receiving provisions - // and rewards again. - rpc Unjail(MsgUnjail) returns (MsgUnjailResponse); -} - -// MsgUnjail defines the Msg/Unjail request type -message MsgUnjail { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = true; - - string validator_addr = 1 [(gogoproto.moretags) = "yaml:\"address\"", (gogoproto.jsontag) = "address"]; -} - -// MsgUnjailResponse defines the Msg/Unjail response type -message MsgUnjailResponse {} \ No newline at end of file diff --git a/third_party/proto/cosmos/staking/v1beta1/authz.proto b/third_party/proto/cosmos/staking/v1beta1/authz.proto deleted file mode 100644 index d50c329c91..0000000000 --- a/third_party/proto/cosmos/staking/v1beta1/authz.proto +++ /dev/null @@ -1,47 +0,0 @@ -syntax = "proto3"; -package cosmos.staking.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; - -// StakeAuthorization defines authorization for delegate/undelegate/redelegate. -// -// Since: cosmos-sdk 0.43 -message StakeAuthorization { - option (cosmos_proto.implements_interface) = "Authorization"; - - // max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is - // empty, there is no spend limit and any amount of coins can be delegated. - cosmos.base.v1beta1.Coin max_tokens = 1 [(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"]; - // validators is the oneof that represents either allow_list or deny_list - oneof validators { - // allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's - // account. - Validators allow_list = 2; - // deny_list specifies list of validator addresses to whom grantee can not delegate tokens. - Validators deny_list = 3; - } - // Validators defines list of validator addresses. - message Validators { - repeated string address = 1; - } - // authorization_type defines one of AuthorizationType. - AuthorizationType authorization_type = 4; -} - -// AuthorizationType defines the type of staking module authorization type -// -// Since: cosmos-sdk 0.43 -enum AuthorizationType { - // AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type - AUTHORIZATION_TYPE_UNSPECIFIED = 0; - // AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate - AUTHORIZATION_TYPE_DELEGATE = 1; - // AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate - AUTHORIZATION_TYPE_UNDELEGATE = 2; - // AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate - AUTHORIZATION_TYPE_REDELEGATE = 3; -} diff --git a/third_party/proto/cosmos/staking/v1beta1/genesis.proto b/third_party/proto/cosmos/staking/v1beta1/genesis.proto deleted file mode 100644 index d1563dbc54..0000000000 --- a/third_party/proto/cosmos/staking/v1beta1/genesis.proto +++ /dev/null @@ -1,53 +0,0 @@ -syntax = "proto3"; -package cosmos.staking.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; - -import "gogoproto/gogo.proto"; -import "cosmos/staking/v1beta1/staking.proto"; - -// GenesisState defines the staking module's genesis state. -message GenesisState { - // params defines all the paramaters of related to deposit. - Params params = 1 [(gogoproto.nullable) = false]; - - // last_total_power tracks the total amounts of bonded tokens recorded during - // the previous end block. - bytes last_total_power = 2 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"last_total_power\"", - (gogoproto.nullable) = false - ]; - - // last_validator_powers is a special index that provides a historical list - // of the last-block's bonded validators. - repeated LastValidatorPower last_validator_powers = 3 - [(gogoproto.moretags) = "yaml:\"last_validator_powers\"", (gogoproto.nullable) = false]; - - // delegations defines the validator set at genesis. - repeated Validator validators = 4 [(gogoproto.nullable) = false]; - - // delegations defines the delegations active at genesis. - repeated Delegation delegations = 5 [(gogoproto.nullable) = false]; - - // unbonding_delegations defines the unbonding delegations active at genesis. - repeated UnbondingDelegation unbonding_delegations = 6 - [(gogoproto.moretags) = "yaml:\"unbonding_delegations\"", (gogoproto.nullable) = false]; - - // redelegations defines the redelegations active at genesis. - repeated Redelegation redelegations = 7 [(gogoproto.nullable) = false]; - - bool exported = 8; -} - -// LastValidatorPower required for validator set update logic. -message LastValidatorPower { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // address is the address of the validator. - string address = 1; - - // power defines the power of the validator. - int64 power = 2; -} diff --git a/third_party/proto/cosmos/staking/v1beta1/query.proto b/third_party/proto/cosmos/staking/v1beta1/query.proto deleted file mode 100644 index 4852c53535..0000000000 --- a/third_party/proto/cosmos/staking/v1beta1/query.proto +++ /dev/null @@ -1,348 +0,0 @@ -syntax = "proto3"; -package cosmos.staking.v1beta1; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/staking/v1beta1/staking.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; - -// Query defines the gRPC querier service. -service Query { - // Validators queries all validators that match the given status. - rpc Validators(QueryValidatorsRequest) returns (QueryValidatorsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/validators"; - } - - // Validator queries validator info for given validator address. - rpc Validator(QueryValidatorRequest) returns (QueryValidatorResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}"; - } - - // ValidatorDelegations queries delegate info for given validator. - rpc ValidatorDelegations(QueryValidatorDelegationsRequest) returns (QueryValidatorDelegationsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations"; - } - - // ValidatorUnbondingDelegations queries unbonding delegations of a validator. - rpc ValidatorUnbondingDelegations(QueryValidatorUnbondingDelegationsRequest) - returns (QueryValidatorUnbondingDelegationsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/validators/" - "{validator_addr}/unbonding_delegations"; - } - - // Delegation queries delegate info for given validator delegator pair. - rpc Delegation(QueryDelegationRequest) returns (QueryDelegationResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/" - "{delegator_addr}"; - } - - // UnbondingDelegation queries unbonding info for given validator delegator - // pair. - rpc UnbondingDelegation(QueryUnbondingDelegationRequest) returns (QueryUnbondingDelegationResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/validators/{validator_addr}/delegations/" - "{delegator_addr}/unbonding_delegation"; - } - - // DelegatorDelegations queries all delegations of a given delegator address. - rpc DelegatorDelegations(QueryDelegatorDelegationsRequest) returns (QueryDelegatorDelegationsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/delegations/{delegator_addr}"; - } - - // DelegatorUnbondingDelegations queries all unbonding delegations of a given - // delegator address. - rpc DelegatorUnbondingDelegations(QueryDelegatorUnbondingDelegationsRequest) - returns (QueryDelegatorUnbondingDelegationsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/" - "{delegator_addr}/unbonding_delegations"; - } - - // Redelegations queries redelegations of given address. - rpc Redelegations(QueryRedelegationsRequest) returns (QueryRedelegationsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/redelegations"; - } - - // DelegatorValidators queries all validators info for given delegator - // address. - rpc DelegatorValidators(QueryDelegatorValidatorsRequest) returns (QueryDelegatorValidatorsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators"; - } - - // DelegatorValidator queries validator info for given delegator validator - // pair. - rpc DelegatorValidator(QueryDelegatorValidatorRequest) returns (QueryDelegatorValidatorResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/delegators/{delegator_addr}/validators/" - "{validator_addr}"; - } - - // HistoricalInfo queries the historical info for given height. - rpc HistoricalInfo(QueryHistoricalInfoRequest) returns (QueryHistoricalInfoResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/historical_info/{height}"; - } - - // Pool queries the pool info. - rpc Pool(QueryPoolRequest) returns (QueryPoolResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/pool"; - } - - // Parameters queries the staking parameters. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/cosmos/staking/v1beta1/params"; - } -} - -// QueryValidatorsRequest is request type for Query/Validators RPC method. -message QueryValidatorsRequest { - // status enables to query for validators matching a given status. - string status = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryValidatorsResponse is response type for the Query/Validators RPC method -message QueryValidatorsResponse { - // validators contains all the queried validators. - repeated Validator validators = 1 [(gogoproto.nullable) = false]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryValidatorRequest is response type for the Query/Validator RPC method -message QueryValidatorRequest { - // validator_addr defines the validator address to query for. - string validator_addr = 1; -} - -// QueryValidatorResponse is response type for the Query/Validator RPC method -message QueryValidatorResponse { - // validator defines the the validator info. - Validator validator = 1 [(gogoproto.nullable) = false]; -} - -// QueryValidatorDelegationsRequest is request type for the -// Query/ValidatorDelegations RPC method -message QueryValidatorDelegationsRequest { - // validator_addr defines the validator address to query for. - string validator_addr = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryValidatorDelegationsResponse is response type for the -// Query/ValidatorDelegations RPC method -message QueryValidatorDelegationsResponse { - repeated DelegationResponse delegation_responses = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "DelegationResponses"]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryValidatorUnbondingDelegationsRequest is required type for the -// Query/ValidatorUnbondingDelegations RPC method -message QueryValidatorUnbondingDelegationsRequest { - // validator_addr defines the validator address to query for. - string validator_addr = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryValidatorUnbondingDelegationsResponse is response type for the -// Query/ValidatorUnbondingDelegations RPC method. -message QueryValidatorUnbondingDelegationsResponse { - repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryDelegationRequest is request type for the Query/Delegation RPC method. -message QueryDelegationRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_addr defines the delegator address to query for. - string delegator_addr = 1; - - // validator_addr defines the validator address to query for. - string validator_addr = 2; -} - -// QueryDelegationResponse is response type for the Query/Delegation RPC method. -message QueryDelegationResponse { - // delegation_responses defines the delegation info of a delegation. - DelegationResponse delegation_response = 1; -} - -// QueryUnbondingDelegationRequest is request type for the -// Query/UnbondingDelegation RPC method. -message QueryUnbondingDelegationRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_addr defines the delegator address to query for. - string delegator_addr = 1; - - // validator_addr defines the validator address to query for. - string validator_addr = 2; -} - -// QueryDelegationResponse is response type for the Query/UnbondingDelegation -// RPC method. -message QueryUnbondingDelegationResponse { - // unbond defines the unbonding information of a delegation. - UnbondingDelegation unbond = 1 [(gogoproto.nullable) = false]; -} - -// QueryDelegatorDelegationsRequest is request type for the -// Query/DelegatorDelegations RPC method. -message QueryDelegatorDelegationsRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_addr defines the delegator address to query for. - string delegator_addr = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryDelegatorDelegationsResponse is response type for the -// Query/DelegatorDelegations RPC method. -message QueryDelegatorDelegationsResponse { - // delegation_responses defines all the delegations' info of a delegator. - repeated DelegationResponse delegation_responses = 1 [(gogoproto.nullable) = false]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryDelegatorUnbondingDelegationsRequest is request type for the -// Query/DelegatorUnbondingDelegations RPC method. -message QueryDelegatorUnbondingDelegationsRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_addr defines the delegator address to query for. - string delegator_addr = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryUnbondingDelegatorDelegationsResponse is response type for the -// Query/UnbondingDelegatorDelegations RPC method. -message QueryDelegatorUnbondingDelegationsResponse { - repeated UnbondingDelegation unbonding_responses = 1 [(gogoproto.nullable) = false]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryRedelegationsRequest is request type for the Query/Redelegations RPC -// method. -message QueryRedelegationsRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_addr defines the delegator address to query for. - string delegator_addr = 1; - - // src_validator_addr defines the validator address to redelegate from. - string src_validator_addr = 2; - - // dst_validator_addr defines the validator address to redelegate to. - string dst_validator_addr = 3; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 4; -} - -// QueryRedelegationsResponse is response type for the Query/Redelegations RPC -// method. -message QueryRedelegationsResponse { - repeated RedelegationResponse redelegation_responses = 1 [(gogoproto.nullable) = false]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryDelegatorValidatorsRequest is request type for the -// Query/DelegatorValidators RPC method. -message QueryDelegatorValidatorsRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_addr defines the delegator address to query for. - string delegator_addr = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryDelegatorValidatorsResponse is response type for the -// Query/DelegatorValidators RPC method. -message QueryDelegatorValidatorsResponse { - // validators defines the the validators' info of a delegator. - repeated Validator validators = 1 [(gogoproto.nullable) = false]; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryDelegatorValidatorRequest is request type for the -// Query/DelegatorValidator RPC method. -message QueryDelegatorValidatorRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // delegator_addr defines the delegator address to query for. - string delegator_addr = 1; - - // validator_addr defines the validator address to query for. - string validator_addr = 2; -} - -// QueryDelegatorValidatorResponse response type for the -// Query/DelegatorValidator RPC method. -message QueryDelegatorValidatorResponse { - // validator defines the the validator info. - Validator validator = 1 [(gogoproto.nullable) = false]; -} - -// QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC -// method. -message QueryHistoricalInfoRequest { - // height defines at which height to query the historical info. - int64 height = 1; -} - -// QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC -// method. -message QueryHistoricalInfoResponse { - // hist defines the historical info at the given height. - HistoricalInfo hist = 1; -} - -// QueryPoolRequest is request type for the Query/Pool RPC method. -message QueryPoolRequest {} - -// QueryPoolResponse is response type for the Query/Pool RPC method. -message QueryPoolResponse { - // pool defines the pool info. - Pool pool = 1 [(gogoproto.nullable) = false]; -} - -// QueryParamsRequest is request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is response type for the Query/Params RPC method. -message QueryParamsResponse { - // params holds all the parameters of this module. - Params params = 1 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/cosmos/staking/v1beta1/staking.proto b/third_party/proto/cosmos/staking/v1beta1/staking.proto deleted file mode 100644 index 76e9599e2d..0000000000 --- a/third_party/proto/cosmos/staking/v1beta1/staking.proto +++ /dev/null @@ -1,334 +0,0 @@ -syntax = "proto3"; -package cosmos.staking.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "tendermint/types/types.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; - -// HistoricalInfo contains header and validator information for a given block. -// It is stored as part of staking module's state, which persists the `n` most -// recent HistoricalInfo -// (`n` is set by the staking module's `historical_entries` parameter). -message HistoricalInfo { - tendermint.types.Header header = 1 [(gogoproto.nullable) = false]; - repeated Validator valset = 2 [(gogoproto.nullable) = false]; -} - -// CommissionRates defines the initial commission rates to be used for creating -// a validator. -message CommissionRates { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // rate is the commission rate charged to delegators, as a fraction. - string rate = 1 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; - // max_rate defines the maximum commission rate which validator can ever charge, as a fraction. - string max_rate = 2 [ - (gogoproto.moretags) = "yaml:\"max_rate\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - // max_change_rate defines the maximum daily increase of the validator commission, as a fraction. - string max_change_rate = 3 [ - (gogoproto.moretags) = "yaml:\"max_change_rate\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; -} - -// Commission defines commission parameters for a given validator. -message Commission { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // commission_rates defines the initial commission rates to be used for creating a validator. - CommissionRates commission_rates = 1 [(gogoproto.embed) = true, (gogoproto.nullable) = false]; - // update_time is the last time the commission rate was changed. - google.protobuf.Timestamp update_time = 2 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"update_time\""]; -} - -// Description defines a validator description. -message Description { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // moniker defines a human-readable name for the validator. - string moniker = 1; - // identity defines an optional identity signature (ex. UPort or Keybase). - string identity = 2; - // website defines an optional website link. - string website = 3; - // security_contact defines an optional email for security contact. - string security_contact = 4 [(gogoproto.moretags) = "yaml:\"security_contact\""]; - // details define other optional details. - string details = 5; -} - -// Validator defines a validator, together with the total amount of the -// Validator's bond shares and their exchange rate to coins. Slashing results in -// a decrease in the exchange rate, allowing correct calculation of future -// undelegations without iterating over delegators. When coins are delegated to -// this validator, the validator is credited with a delegation whose number of -// bond shares is based on the amount of coins delegated divided by the current -// exchange rate. Voting power can be calculated as total bonded shares -// multiplied by exchange rate. -message Validator { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.goproto_getters) = false; - - // operator_address defines the address of the validator's operator; bech encoded in JSON. - string operator_address = 1 [(gogoproto.moretags) = "yaml:\"operator_address\""]; - // consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. - google.protobuf.Any consensus_pubkey = 2 - [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey", (gogoproto.moretags) = "yaml:\"consensus_pubkey\""]; - // jailed defined whether the validator has been jailed from bonded status or not. - bool jailed = 3; - // status is the validator status (bonded/unbonding/unbonded). - BondStatus status = 4; - // tokens define the delegated tokens (incl. self-delegation). - string tokens = 5 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; - // delegator_shares defines total shares issued to a validator's delegators. - string delegator_shares = 6 [ - (gogoproto.moretags) = "yaml:\"delegator_shares\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.nullable) = false - ]; - // description defines the description terms for the validator. - Description description = 7 [(gogoproto.nullable) = false]; - // unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. - int64 unbonding_height = 8 [(gogoproto.moretags) = "yaml:\"unbonding_height\""]; - // unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. - google.protobuf.Timestamp unbonding_time = 9 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"unbonding_time\""]; - // commission defines the commission parameters. - Commission commission = 10 [(gogoproto.nullable) = false]; - // min_self_delegation is the validator's self declared minimum self delegation. - string min_self_delegation = 11 [ - (gogoproto.moretags) = "yaml:\"min_self_delegation\"", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false - ]; -} - -// BondStatus is the status of a validator. -enum BondStatus { - option (gogoproto.goproto_enum_prefix) = false; - - // UNSPECIFIED defines an invalid validator status. - BOND_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "Unspecified"]; - // UNBONDED defines a validator that is not bonded. - BOND_STATUS_UNBONDED = 1 [(gogoproto.enumvalue_customname) = "Unbonded"]; - // UNBONDING defines a validator that is unbonding. - BOND_STATUS_UNBONDING = 2 [(gogoproto.enumvalue_customname) = "Unbonding"]; - // BONDED defines a validator that is bonded. - BOND_STATUS_BONDED = 3 [(gogoproto.enumvalue_customname) = "Bonded"]; -} - -// ValAddresses defines a repeated set of validator addresses. -message ValAddresses { - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = true; - - repeated string addresses = 1; -} - -// DVPair is struct that just has a delegator-validator pair with no other data. -// It is intended to be used as a marshalable pointer. For example, a DVPair can -// be used to construct the key to getting an UnbondingDelegation from state. -message DVPair { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; -} - -// DVPairs defines an array of DVPair objects. -message DVPairs { - repeated DVPair pairs = 1 [(gogoproto.nullable) = false]; -} - -// DVVTriplet is struct that just has a delegator-validator-validator triplet -// with no other data. It is intended to be used as a marshalable pointer. For -// example, a DVVTriplet can be used to construct the key to getting a -// Redelegation from state. -message DVVTriplet { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string validator_src_address = 2 [(gogoproto.moretags) = "yaml:\"validator_src_address\""]; - string validator_dst_address = 3 [(gogoproto.moretags) = "yaml:\"validator_dst_address\""]; -} - -// DVVTriplets defines an array of DVVTriplet objects. -message DVVTriplets { - repeated DVVTriplet triplets = 1 [(gogoproto.nullable) = false]; -} - -// Delegation represents the bond with tokens held by an account. It is -// owned by one delegator, and is associated with the voting power of one -// validator. -message Delegation { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - // delegator_address is the bech32-encoded address of the delegator. - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - // validator_address is the bech32-encoded address of the validator. - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - // shares define the delegation shares received. - string shares = 3 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; -} - -// UnbondingDelegation stores all of a single delegator's unbonding bonds -// for a single validator in an time-ordered list. -message UnbondingDelegation { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - // delegator_address is the bech32-encoded address of the delegator. - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - // validator_address is the bech32-encoded address of the validator. - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - // entries are the unbonding delegation entries. - repeated UnbondingDelegationEntry entries = 3 [(gogoproto.nullable) = false]; // unbonding delegation entries -} - -// UnbondingDelegationEntry defines an unbonding object with relevant metadata. -message UnbondingDelegationEntry { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // creation_height is the height which the unbonding took place. - int64 creation_height = 1 [(gogoproto.moretags) = "yaml:\"creation_height\""]; - // completion_time is the unix time for unbonding completion. - google.protobuf.Timestamp completion_time = 2 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"completion_time\""]; - // initial_balance defines the tokens initially scheduled to receive at completion. - string initial_balance = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"initial_balance\"" - ]; - // balance defines the tokens to receive at completion. - string balance = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; -} - -// RedelegationEntry defines a redelegation object with relevant metadata. -message RedelegationEntry { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // creation_height defines the height which the redelegation took place. - int64 creation_height = 1 [(gogoproto.moretags) = "yaml:\"creation_height\""]; - // completion_time defines the unix time for redelegation completion. - google.protobuf.Timestamp completion_time = 2 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"completion_time\""]; - // initial_balance defines the initial balance when redelegation started. - string initial_balance = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"initial_balance\"" - ]; - // shares_dst is the amount of destination-validator shares created by redelegation. - string shares_dst = 4 - [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; -} - -// Redelegation contains the list of a particular delegator's redelegating bonds -// from a particular source validator to a particular destination validator. -message Redelegation { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - // delegator_address is the bech32-encoded address of the delegator. - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - // validator_src_address is the validator redelegation source operator address. - string validator_src_address = 2 [(gogoproto.moretags) = "yaml:\"validator_src_address\""]; - // validator_dst_address is the validator redelegation destination operator address. - string validator_dst_address = 3 [(gogoproto.moretags) = "yaml:\"validator_dst_address\""]; - // entries are the redelegation entries. - repeated RedelegationEntry entries = 4 [(gogoproto.nullable) = false]; // redelegation entries -} - -// Params defines the parameters for the staking module. -message Params { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // unbonding_time is the time duration of unbonding. - google.protobuf.Duration unbonding_time = 1 - [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.moretags) = "yaml:\"unbonding_time\""]; - // max_validators is the maximum number of validators. - uint32 max_validators = 2 [(gogoproto.moretags) = "yaml:\"max_validators\""]; - // max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). - uint32 max_entries = 3 [(gogoproto.moretags) = "yaml:\"max_entries\""]; - // historical_entries is the number of historical entries to persist. - uint32 historical_entries = 4 [(gogoproto.moretags) = "yaml:\"historical_entries\""]; - // bond_denom defines the bondable coin denomination. - string bond_denom = 5 [(gogoproto.moretags) = "yaml:\"bond_denom\""]; -} - -// DelegationResponse is equivalent to Delegation except that it contains a -// balance in addition to shares which is more suitable for client responses. -message DelegationResponse { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - - Delegation delegation = 1 [(gogoproto.nullable) = false]; - - cosmos.base.v1beta1.Coin balance = 2 [(gogoproto.nullable) = false]; -} - -// RedelegationEntryResponse is equivalent to a RedelegationEntry except that it -// contains a balance in addition to shares which is more suitable for client -// responses. -message RedelegationEntryResponse { - option (gogoproto.equal) = true; - - RedelegationEntry redelegation_entry = 1 [(gogoproto.nullable) = false]; - string balance = 4 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; -} - -// RedelegationResponse is equivalent to a Redelegation except that its entries -// contain a balance in addition to shares which is more suitable for client -// responses. -message RedelegationResponse { - option (gogoproto.equal) = false; - - Redelegation redelegation = 1 [(gogoproto.nullable) = false]; - repeated RedelegationEntryResponse entries = 2 [(gogoproto.nullable) = false]; -} - -// Pool is used for tracking bonded and not-bonded token supply of the bond -// denomination. -message Pool { - option (gogoproto.description) = true; - option (gogoproto.equal) = true; - string not_bonded_tokens = 1 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.jsontag) = "not_bonded_tokens", - (gogoproto.nullable) = false - ]; - string bonded_tokens = 2 [ - (gogoproto.jsontag) = "bonded_tokens", - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"bonded_tokens\"" - ]; -} diff --git a/third_party/proto/cosmos/staking/v1beta1/tx.proto b/third_party/proto/cosmos/staking/v1beta1/tx.proto deleted file mode 100644 index 7b05d89eea..0000000000 --- a/third_party/proto/cosmos/staking/v1beta1/tx.proto +++ /dev/null @@ -1,126 +0,0 @@ -syntax = "proto3"; -package cosmos.staking.v1beta1; - -import "google/protobuf/any.proto"; -import "google/protobuf/timestamp.proto"; -import "gogoproto/gogo.proto"; - -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/staking/v1beta1/staking.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/staking/types"; - -// Msg defines the staking Msg service. -service Msg { - // CreateValidator defines a method for creating a new validator. - rpc CreateValidator(MsgCreateValidator) returns (MsgCreateValidatorResponse); - - // EditValidator defines a method for editing an existing validator. - rpc EditValidator(MsgEditValidator) returns (MsgEditValidatorResponse); - - // Delegate defines a method for performing a delegation of coins - // from a delegator to a validator. - rpc Delegate(MsgDelegate) returns (MsgDelegateResponse); - - // BeginRedelegate defines a method for performing a redelegation - // of coins from a delegator and source validator to a destination validator. - rpc BeginRedelegate(MsgBeginRedelegate) returns (MsgBeginRedelegateResponse); - - // Undelegate defines a method for performing an undelegation from a - // delegate and a validator. - rpc Undelegate(MsgUndelegate) returns (MsgUndelegateResponse); -} - -// MsgCreateValidator defines a SDK message for creating a new validator. -message MsgCreateValidator { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - Description description = 1 [(gogoproto.nullable) = false]; - CommissionRates commission = 2 [(gogoproto.nullable) = false]; - string min_self_delegation = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"min_self_delegation\"", - (gogoproto.nullable) = false - ]; - string delegator_address = 4 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string validator_address = 5 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - google.protobuf.Any pubkey = 6 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; - cosmos.base.v1beta1.Coin value = 7 [(gogoproto.nullable) = false]; -} - -// MsgCreateValidatorResponse defines the Msg/CreateValidator response type. -message MsgCreateValidatorResponse {} - -// MsgEditValidator defines a SDK message for editing an existing validator. -message MsgEditValidator { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - Description description = 1 [(gogoproto.nullable) = false]; - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"address\""]; - - // We pass a reference to the new commission rate and min self delegation as - // it's not mandatory to update. If not updated, the deserialized rate will be - // zero with no way to distinguish if an update was intended. - // REF: #2373 - string commission_rate = 3 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", - (gogoproto.moretags) = "yaml:\"commission_rate\"" - ]; - string min_self_delegation = 4 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.moretags) = "yaml:\"min_self_delegation\"" - ]; -} - -// MsgEditValidatorResponse defines the Msg/EditValidator response type. -message MsgEditValidatorResponse {} - -// MsgDelegate defines a SDK message for performing a delegation of coins -// from a delegator to a validator. -message MsgDelegate { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; -} - -// MsgDelegateResponse defines the Msg/Delegate response type. -message MsgDelegateResponse {} - -// MsgBeginRedelegate defines a SDK message for performing a redelegation -// of coins from a delegator and source validator to a destination validator. -message MsgBeginRedelegate { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string validator_src_address = 2 [(gogoproto.moretags) = "yaml:\"validator_src_address\""]; - string validator_dst_address = 3 [(gogoproto.moretags) = "yaml:\"validator_dst_address\""]; - cosmos.base.v1beta1.Coin amount = 4 [(gogoproto.nullable) = false]; -} - -// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. -message MsgBeginRedelegateResponse { - google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; -} - -// MsgUndelegate defines a SDK message for performing an undelegation from a -// delegate and a validator. -message MsgUndelegate { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string delegator_address = 1 [(gogoproto.moretags) = "yaml:\"delegator_address\""]; - string validator_address = 2 [(gogoproto.moretags) = "yaml:\"validator_address\""]; - cosmos.base.v1beta1.Coin amount = 3 [(gogoproto.nullable) = false]; -} - -// MsgUndelegateResponse defines the Msg/Undelegate response type. -message MsgUndelegateResponse { - google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; -} diff --git a/third_party/proto/cosmos/tx/signing/v1beta1/signing.proto b/third_party/proto/cosmos/tx/signing/v1beta1/signing.proto deleted file mode 100644 index 4c1be40594..0000000000 --- a/third_party/proto/cosmos/tx/signing/v1beta1/signing.proto +++ /dev/null @@ -1,79 +0,0 @@ -syntax = "proto3"; -package cosmos.tx.signing.v1beta1; - -import "cosmos/crypto/multisig/v1beta1/multisig.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/types/tx/signing"; - -// SignMode represents a signing mode with its own security guarantees. -enum SignMode { - // SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be - // rejected - SIGN_MODE_UNSPECIFIED = 0; - - // SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is - // verified with raw bytes from Tx - SIGN_MODE_DIRECT = 1; - - // SIGN_MODE_TEXTUAL is a future signing mode that will verify some - // human-readable textual representation on top of the binary representation - // from SIGN_MODE_DIRECT - SIGN_MODE_TEXTUAL = 2; - - // SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses - // Amino JSON and will be removed in the future - SIGN_MODE_LEGACY_AMINO_JSON = 127; -} - -// SignatureDescriptors wraps multiple SignatureDescriptor's. -message SignatureDescriptors { - // signatures are the signature descriptors - repeated SignatureDescriptor signatures = 1; -} - -// SignatureDescriptor is a convenience type which represents the full data for -// a signature including the public key of the signer, signing modes and the -// signature itself. It is primarily used for coordinating signatures between -// clients. -message SignatureDescriptor { - // public_key is the public key of the signer - google.protobuf.Any public_key = 1; - - Data data = 2; - - // sequence is the sequence of the account, which describes the - // number of committed transactions signed by a given address. It is used to prevent - // replay attacks. - uint64 sequence = 3; - - // Data represents signature data - message Data { - // sum is the oneof that specifies whether this represents single or multi-signature data - oneof sum { - // single represents a single signer - Single single = 1; - - // multi represents a multisig signer - Multi multi = 2; - } - - // Single is the signature data for a single signer - message Single { - // mode is the signing mode of the single signer - SignMode mode = 1; - - // signature is the raw signature bytes - bytes signature = 2; - } - - // Multi is the signature data for a multisig public key - message Multi { - // bitarray specifies which keys within the multisig are signing - cosmos.crypto.multisig.v1beta1.CompactBitArray bitarray = 1; - - // signatures is the signatures of the multi-signature - repeated Data signatures = 2; - } - } -} diff --git a/third_party/proto/cosmos/tx/v1beta1/service.proto b/third_party/proto/cosmos/tx/v1beta1/service.proto deleted file mode 100644 index acfbf15b36..0000000000 --- a/third_party/proto/cosmos/tx/v1beta1/service.proto +++ /dev/null @@ -1,134 +0,0 @@ -syntax = "proto3"; -package cosmos.tx.v1beta1; - -import "google/api/annotations.proto"; -import "cosmos/base/abci/v1beta1/abci.proto"; -import "cosmos/tx/v1beta1/tx.proto"; -import "gogoproto/gogo.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; - -option (gogoproto.goproto_registration) = true; -option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; - -// Service defines a gRPC service for interacting with transactions. -service Service { - // Simulate simulates executing a transaction for estimating gas usage. - rpc Simulate(SimulateRequest) returns (SimulateResponse) { - option (google.api.http) = { - post: "/cosmos/tx/v1beta1/simulate" - body: "*" - }; - } - // GetTx fetches a tx by hash. - rpc GetTx(GetTxRequest) returns (GetTxResponse) { - option (google.api.http).get = "/cosmos/tx/v1beta1/txs/{hash}"; - } - // BroadcastTx broadcast transaction. - rpc BroadcastTx(BroadcastTxRequest) returns (BroadcastTxResponse) { - option (google.api.http) = { - post: "/cosmos/tx/v1beta1/txs" - body: "*" - }; - } - // GetTxsEvent fetches txs by event. - rpc GetTxsEvent(GetTxsEventRequest) returns (GetTxsEventResponse) { - option (google.api.http).get = "/cosmos/tx/v1beta1/txs"; - } -} - -// GetTxsEventRequest is the request type for the Service.TxsByEvents -// RPC method. -message GetTxsEventRequest { - // events is the list of transaction event type. - repeated string events = 1; - // pagination defines an pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; - OrderBy order_by = 3; -} - -// OrderBy defines the sorting order -enum OrderBy { - // ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. - ORDER_BY_UNSPECIFIED = 0; - // ORDER_BY_ASC defines ascending order - ORDER_BY_ASC = 1; - // ORDER_BY_DESC defines descending order - ORDER_BY_DESC = 2; -} - -// GetTxsEventResponse is the response type for the Service.TxsByEvents -// RPC method. -message GetTxsEventResponse { - // txs is the list of queried transactions. - repeated cosmos.tx.v1beta1.Tx txs = 1; - // tx_responses is the list of queried TxResponses. - repeated cosmos.base.abci.v1beta1.TxResponse tx_responses = 2; - // pagination defines an pagination for the response. - cosmos.base.query.v1beta1.PageResponse pagination = 3; -} - -// BroadcastTxRequest is the request type for the Service.BroadcastTxRequest -// RPC method. -message BroadcastTxRequest { - // tx_bytes is the raw transaction. - bytes tx_bytes = 1; - BroadcastMode mode = 2; -} - -// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. -enum BroadcastMode { - // zero-value for mode ordering - BROADCAST_MODE_UNSPECIFIED = 0; - // BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for - // the tx to be committed in a block. - BROADCAST_MODE_BLOCK = 1; - // BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for - // a CheckTx execution response only. - BROADCAST_MODE_SYNC = 2; - // BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns - // immediately. - BROADCAST_MODE_ASYNC = 3; -} - -// BroadcastTxResponse is the response type for the -// Service.BroadcastTx method. -message BroadcastTxResponse { - // tx_response is the queried TxResponses. - cosmos.base.abci.v1beta1.TxResponse tx_response = 1; -} - -// SimulateRequest is the request type for the Service.Simulate -// RPC method. -message SimulateRequest { - // tx is the transaction to simulate. - // Deprecated. Send raw tx bytes instead. - cosmos.tx.v1beta1.Tx tx = 1 [deprecated = true]; - // tx_bytes is the raw transaction. - // - // Since: cosmos-sdk 0.43 - bytes tx_bytes = 2; -} - -// SimulateResponse is the response type for the -// Service.SimulateRPC method. -message SimulateResponse { - // gas_info is the information about gas used in the simulation. - cosmos.base.abci.v1beta1.GasInfo gas_info = 1; - // result is the result of the simulation. - cosmos.base.abci.v1beta1.Result result = 2; -} - -// GetTxRequest is the request type for the Service.GetTx -// RPC method. -message GetTxRequest { - // hash is the tx hash to query, encoded as a hex string. - string hash = 1; -} - -// GetTxResponse is the response type for the Service.GetTx method. -message GetTxResponse { - // tx is the queried transaction. - cosmos.tx.v1beta1.Tx tx = 1; - // tx_response is the queried TxResponses. - cosmos.base.abci.v1beta1.TxResponse tx_response = 2; -} \ No newline at end of file diff --git a/third_party/proto/cosmos/tx/v1beta1/tx.proto b/third_party/proto/cosmos/tx/v1beta1/tx.proto deleted file mode 100644 index 6d5caf12c7..0000000000 --- a/third_party/proto/cosmos/tx/v1beta1/tx.proto +++ /dev/null @@ -1,183 +0,0 @@ -syntax = "proto3"; -package cosmos.tx.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/crypto/multisig/v1beta1/multisig.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/tx/signing/v1beta1/signing.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; - -// Tx is the standard type used for broadcasting transactions. -message Tx { - // body is the processable content of the transaction - TxBody body = 1; - - // auth_info is the authorization related content of the transaction, - // specifically signers, signer modes and fee - AuthInfo auth_info = 2; - - // signatures is a list of signatures that matches the length and order of - // AuthInfo's signer_infos to allow connecting signature meta information like - // public key and signing mode by position. - repeated bytes signatures = 3; -} - -// TxRaw is a variant of Tx that pins the signer's exact binary representation -// of body and auth_info. This is used for signing, broadcasting and -// verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and -// the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used -// as the transaction ID. -message TxRaw { - // body_bytes is a protobuf serialization of a TxBody that matches the - // representation in SignDoc. - bytes body_bytes = 1; - - // auth_info_bytes is a protobuf serialization of an AuthInfo that matches the - // representation in SignDoc. - bytes auth_info_bytes = 2; - - // signatures is a list of signatures that matches the length and order of - // AuthInfo's signer_infos to allow connecting signature meta information like - // public key and signing mode by position. - repeated bytes signatures = 3; -} - -// SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. -message SignDoc { - // body_bytes is protobuf serialization of a TxBody that matches the - // representation in TxRaw. - bytes body_bytes = 1; - - // auth_info_bytes is a protobuf serialization of an AuthInfo that matches the - // representation in TxRaw. - bytes auth_info_bytes = 2; - - // chain_id is the unique identifier of the chain this transaction targets. - // It prevents signed transactions from being used on another chain by an - // attacker - string chain_id = 3; - - // account_number is the account number of the account in state - uint64 account_number = 4; -} - -// TxBody is the body of a transaction that all signers sign over. -message TxBody { - // messages is a list of messages to be executed. The required signers of - // those messages define the number and order of elements in AuthInfo's - // signer_infos and Tx's signatures. Each required signer address is added to - // the list only the first time it occurs. - // By convention, the first required signer (usually from the first message) - // is referred to as the primary signer and pays the fee for the whole - // transaction. - repeated google.protobuf.Any messages = 1; - - // memo is any arbitrary note/comment to be added to the transaction. - // WARNING: in clients, any publicly exposed text should not be called memo, - // but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). - string memo = 2; - - // timeout is the block height after which this transaction will not - // be processed by the chain - uint64 timeout_height = 3; - - // extension_options are arbitrary options that can be added by chains - // when the default options are not sufficient. If any of these are present - // and can't be handled, the transaction will be rejected - repeated google.protobuf.Any extension_options = 1023; - - // extension_options are arbitrary options that can be added by chains - // when the default options are not sufficient. If any of these are present - // and can't be handled, they will be ignored - repeated google.protobuf.Any non_critical_extension_options = 2047; -} - -// AuthInfo describes the fee and signer modes that are used to sign a -// transaction. -message AuthInfo { - // signer_infos defines the signing modes for the required signers. The number - // and order of elements must match the required signers from TxBody's - // messages. The first element is the primary signer and the one which pays - // the fee. - repeated SignerInfo signer_infos = 1; - - // Fee is the fee and gas limit for the transaction. The first signer is the - // primary signer and the one which pays the fee. The fee can be calculated - // based on the cost of evaluating the body and doing signature verification - // of the signers. This can be estimated via simulation. - Fee fee = 2; -} - -// SignerInfo describes the public key and signing mode of a single top-level -// signer. -message SignerInfo { - // public_key is the public key of the signer. It is optional for accounts - // that already exist in state. If unset, the verifier can use the required \ - // signer address for this position and lookup the public key. - google.protobuf.Any public_key = 1; - - // mode_info describes the signing mode of the signer and is a nested - // structure to support nested multisig pubkey's - ModeInfo mode_info = 2; - - // sequence is the sequence of the account, which describes the - // number of committed transactions signed by a given address. It is used to - // prevent replay attacks. - uint64 sequence = 3; -} - -// ModeInfo describes the signing mode of a single or nested multisig signer. -message ModeInfo { - // sum is the oneof that specifies whether this represents a single or nested - // multisig signer - oneof sum { - // single represents a single signer - Single single = 1; - - // multi represents a nested multisig signer - Multi multi = 2; - } - - // Single is the mode info for a single signer. It is structured as a message - // to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the - // future - message Single { - // mode is the signing mode of the single signer - cosmos.tx.signing.v1beta1.SignMode mode = 1; - } - - // Multi is the mode info for a multisig public key - message Multi { - // bitarray specifies which keys within the multisig are signing - cosmos.crypto.multisig.v1beta1.CompactBitArray bitarray = 1; - - // mode_infos is the corresponding modes of the signers of the multisig - // which could include nested multisig public keys - repeated ModeInfo mode_infos = 2; - } -} - -// Fee includes the amount of coins paid in fees and the maximum -// gas to be used by the transaction. The ratio yields an effective "gasprice", -// which must be above some miminum to be accepted into the mempool. -message Fee { - // amount is the amount of coins to be paid as a fee - repeated cosmos.base.v1beta1.Coin amount = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - - // gas_limit is the maximum gas that can be used in transaction processing - // before an out of gas error occurs - uint64 gas_limit = 2; - - // if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. - // the payer must be a tx signer (and thus have signed this field in AuthInfo). - // setting this field does *not* change the ordering of required signers for the transaction. - string payer = 3; - - // if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used - // to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does - // not support fee grants, this will fail - string granter = 4; -} diff --git a/third_party/proto/cosmos/upgrade/v1beta1/query.proto b/third_party/proto/cosmos/upgrade/v1beta1/query.proto deleted file mode 100644 index dd14ba6401..0000000000 --- a/third_party/proto/cosmos/upgrade/v1beta1/query.proto +++ /dev/null @@ -1,104 +0,0 @@ -syntax = "proto3"; -package cosmos.upgrade.v1beta1; - -import "google/protobuf/any.proto"; -import "google/api/annotations.proto"; -import "cosmos/upgrade/v1beta1/upgrade.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; - -// Query defines the gRPC upgrade querier service. -service Query { - // CurrentPlan queries the current upgrade plan. - rpc CurrentPlan(QueryCurrentPlanRequest) returns (QueryCurrentPlanResponse) { - option (google.api.http).get = "/cosmos/upgrade/v1beta1/current_plan"; - } - - // AppliedPlan queries a previously applied upgrade plan by its name. - rpc AppliedPlan(QueryAppliedPlanRequest) returns (QueryAppliedPlanResponse) { - option (google.api.http).get = "/cosmos/upgrade/v1beta1/applied_plan/{name}"; - } - - // UpgradedConsensusState queries the consensus state that will serve - // as a trusted kernel for the next version of this chain. It will only be - // stored at the last height of this chain. - // UpgradedConsensusState RPC not supported with legacy querier - // This rpc is deprecated now that IBC has its own replacement - // (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) - rpc UpgradedConsensusState(QueryUpgradedConsensusStateRequest) returns (QueryUpgradedConsensusStateResponse) { - option deprecated = true; - option (google.api.http).get = "/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}"; - } - - // ModuleVersions queries the list of module versions from state. - // - // Since: cosmos-sdk 0.43 - rpc ModuleVersions(QueryModuleVersionsRequest) returns (QueryModuleVersionsResponse) { - option (google.api.http).get = "/cosmos/upgrade/v1beta1/module_versions"; - } -} - -// QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC -// method. -message QueryCurrentPlanRequest {} - -// QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC -// method. -message QueryCurrentPlanResponse { - // plan is the current upgrade plan. - Plan plan = 1; -} - -// QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC -// method. -message QueryAppliedPlanRequest { - // name is the name of the applied plan to query for. - string name = 1; -} - -// QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC -// method. -message QueryAppliedPlanResponse { - // height is the block height at which the plan was applied. - int64 height = 1; -} - -// QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState -// RPC method. -message QueryUpgradedConsensusStateRequest { - option deprecated = true; - - // last height of the current chain must be sent in request - // as this is the height under which next consensus state is stored - int64 last_height = 1; -} - -// QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState -// RPC method. -message QueryUpgradedConsensusStateResponse { - option deprecated = true; - reserved 1; - - // Since: cosmos-sdk 0.43 - bytes upgraded_consensus_state = 2; -} - -// QueryModuleVersionsRequest is the request type for the Query/ModuleVersions -// RPC method. -// -// Since: cosmos-sdk 0.43 -message QueryModuleVersionsRequest { - // module_name is a field to query a specific module - // consensus version from state. Leaving this empty will - // fetch the full list of module versions from state - string module_name = 1; -} - -// QueryModuleVersionsResponse is the response type for the Query/ModuleVersions -// RPC method. -// -// Since: cosmos-sdk 0.43 -message QueryModuleVersionsResponse { - // module_versions is a list of module names with their consensus versions. - repeated ModuleVersion module_versions = 1; -} diff --git a/third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto b/third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto deleted file mode 100644 index e888b393d6..0000000000 --- a/third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto +++ /dev/null @@ -1,78 +0,0 @@ -syntax = "proto3"; -package cosmos.upgrade.v1beta1; - -import "google/protobuf/any.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/upgrade/types"; -option (gogoproto.goproto_getters_all) = false; - -// Plan specifies information about a planned upgrade and when it should occur. -message Plan { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - // Sets the name for the upgrade. This name will be used by the upgraded - // version of the software to apply any special "on-upgrade" commands during - // the first BeginBlock method after the upgrade is applied. It is also used - // to detect whether a software version can handle a given upgrade. If no - // upgrade handler with this name has been set in the software, it will be - // assumed that the software is out-of-date when the upgrade Time or Height is - // reached and the software will exit. - string name = 1; - - // Deprecated: Time based upgrades have been deprecated. Time based upgrade logic - // has been removed from the SDK. - // If this field is not empty, an error will be thrown. - google.protobuf.Timestamp time = 2 [deprecated = true, (gogoproto.stdtime) = true, (gogoproto.nullable) = false]; - - // The height at which the upgrade must be performed. - // Only used if Time is not set. - int64 height = 3; - - // Any application specific upgrade info to be included on-chain - // such as a git commit that validators could automatically upgrade to - string info = 4; - - // Deprecated: UpgradedClientState field has been deprecated. IBC upgrade logic has been - // moved to the IBC module in the sub module 02-client. - // If this field is not empty, an error will be thrown. - google.protobuf.Any upgraded_client_state = 5 - [deprecated = true, (gogoproto.moretags) = "yaml:\"upgraded_client_state\""]; -} - -// SoftwareUpgradeProposal is a gov Content type for initiating a software -// upgrade. -message SoftwareUpgradeProposal { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - string title = 1; - string description = 2; - Plan plan = 3 [(gogoproto.nullable) = false]; -} - -// CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software -// upgrade. -message CancelSoftwareUpgradeProposal { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - string title = 1; - string description = 2; -} - -// ModuleVersion specifies a module and its consensus version. -// -// Since: cosmos-sdk 0.43 -message ModuleVersion { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = true; - - // name of the app module - string name = 1; - - // consensus version of the app module - uint64 version = 2; -} diff --git a/third_party/proto/cosmos/vesting/v1beta1/tx.proto b/third_party/proto/cosmos/vesting/v1beta1/tx.proto deleted file mode 100644 index c49be802a7..0000000000 --- a/third_party/proto/cosmos/vesting/v1beta1/tx.proto +++ /dev/null @@ -1,31 +0,0 @@ -syntax = "proto3"; -package cosmos.vesting.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"; - -// Msg defines the bank Msg service. -service Msg { - // CreateVestingAccount defines a method that enables creating a vesting - // account. - rpc CreateVestingAccount(MsgCreateVestingAccount) returns (MsgCreateVestingAccountResponse); -} - -// MsgCreateVestingAccount defines a message that enables creating a vesting -// account. -message MsgCreateVestingAccount { - option (gogoproto.equal) = true; - - string from_address = 1 [(gogoproto.moretags) = "yaml:\"from_address\""]; - string to_address = 2 [(gogoproto.moretags) = "yaml:\"to_address\""]; - repeated cosmos.base.v1beta1.Coin amount = 3 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - - int64 end_time = 4 [(gogoproto.moretags) = "yaml:\"end_time\""]; - bool delayed = 5; -} - -// MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. -message MsgCreateVestingAccountResponse {} \ No newline at end of file diff --git a/third_party/proto/cosmos/vesting/v1beta1/vesting.proto b/third_party/proto/cosmos/vesting/v1beta1/vesting.proto deleted file mode 100644 index e9f661f93c..0000000000 --- a/third_party/proto/cosmos/vesting/v1beta1/vesting.proto +++ /dev/null @@ -1,85 +0,0 @@ -syntax = "proto3"; -package cosmos.vesting.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/auth/v1beta1/auth.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"; - -// BaseVestingAccount implements the VestingAccount interface. It contains all -// the necessary fields needed for any vesting account implementation. -message BaseVestingAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - cosmos.auth.v1beta1.BaseAccount base_account = 1 [(gogoproto.embed) = true]; - repeated cosmos.base.v1beta1.Coin original_vesting = 2 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"original_vesting\"" - ]; - repeated cosmos.base.v1beta1.Coin delegated_free = 3 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"delegated_free\"" - ]; - repeated cosmos.base.v1beta1.Coin delegated_vesting = 4 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", - (gogoproto.moretags) = "yaml:\"delegated_vesting\"" - ]; - int64 end_time = 5 [(gogoproto.moretags) = "yaml:\"end_time\""]; -} - -// ContinuousVestingAccount implements the VestingAccount interface. It -// continuously vests by unlocking coins linearly with respect to time. -message ContinuousVestingAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; - int64 start_time = 2 [(gogoproto.moretags) = "yaml:\"start_time\""]; -} - -// DelayedVestingAccount implements the VestingAccount interface. It vests all -// coins after a specific time, but non prior. In other words, it keeps them -// locked until a specified time. -message DelayedVestingAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; -} - -// Period defines a length of time and amount of coins that will vest. -message Period { - option (gogoproto.goproto_stringer) = false; - - int64 length = 1; - repeated cosmos.base.v1beta1.Coin amount = 2 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} - -// PeriodicVestingAccount implements the VestingAccount interface. It -// periodically vests by unlocking coins during each specified period. -message PeriodicVestingAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; - int64 start_time = 2 [(gogoproto.moretags) = "yaml:\"start_time\""]; - repeated Period vesting_periods = 3 [(gogoproto.moretags) = "yaml:\"vesting_periods\"", (gogoproto.nullable) = false]; -} - -// PermanentLockedAccount implements the VestingAccount interface. It does -// not ever release coins, locking them indefinitely. Coins in this account can -// still be used for delegating and for governance votes even while locked. -// -// Since: cosmos-sdk 0.43 -message PermanentLockedAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - BaseVestingAccount base_vesting_account = 1 [(gogoproto.embed) = true]; -} diff --git a/third_party/proto/google/api/httpbody.proto b/third_party/proto/google/api/httpbody.proto deleted file mode 100644 index 4428515c12..0000000000 --- a/third_party/proto/google/api/httpbody.proto +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2018 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.api; - -import "google/protobuf/any.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody"; -option java_multiple_files = true; -option java_outer_classname = "HttpBodyProto"; -option java_package = "com.google.api"; -option objc_class_prefix = "GAPI"; - -// Message that represents an arbitrary HTTP body. It should only be used for -// payload formats that can't be represented as JSON, such as raw binary or -// an HTML page. -// -// -// This message can be used both in streaming and non-streaming API methods in -// the request as well as the response. -// -// It can be used as a top-level request field, which is convenient if one -// wants to extract parameters from either the URL or HTTP template into the -// request fields and also want access to the raw HTTP body. -// -// Example: -// -// message GetResourceRequest { -// // A unique request id. -// string request_id = 1; -// -// // The raw HTTP body is bound to this field. -// google.api.HttpBody http_body = 2; -// } -// -// service ResourceService { -// rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); -// rpc UpdateResource(google.api.HttpBody) returns -// (google.protobuf.Empty); -// } -// -// Example with streaming methods: -// -// service CaldavService { -// rpc GetCalendar(stream google.api.HttpBody) -// returns (stream google.api.HttpBody); -// rpc UpdateCalendar(stream google.api.HttpBody) -// returns (stream google.api.HttpBody); -// } -// -// Use of this type only changes how the request and response bodies are -// handled, all other features will continue to work unchanged. -message HttpBody { - // The HTTP Content-Type header value specifying the content type of the body. - string content_type = 1; - - // The HTTP request/response body as raw binary. - bytes data = 2; - - // Application specific response metadata. Must be set in the first response - // for streaming APIs. - repeated google.protobuf.Any extensions = 3; -} \ No newline at end of file diff --git a/third_party/proto/google/protobuf/any.proto b/third_party/proto/google/protobuf/any.proto deleted file mode 100644 index 58b511583a..0000000000 --- a/third_party/proto/google/protobuf/any.proto +++ /dev/null @@ -1,164 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -import "gogoproto/gogo.proto"; - -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option go_package = "types"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "AnyProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; - -// `Any` contains an arbitrary serialized protocol buffer message along with a -// URL that describes the type of the serialized message. -// -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := ptypes.MarshalAny(foo) -// ... -// foo := &pb.Foo{} -// if err := ptypes.UnmarshalAny(any, foo); err != nil { -// ... -// } -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// -// JSON -// ==== -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } -// -message Any { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - // - string type_url = 1; - - // Must be a valid serialized protocol buffer of the above specified type. - bytes value = 2; - - option (gogoproto.typedecl) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.gostring) = false; - option (gogoproto.stringer) = false; -} - -option (gogoproto.goproto_registration) = false; diff --git a/third_party/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto b/third_party/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto deleted file mode 100644 index 291f3e4fd9..0000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/controller/v1/controller.proto +++ /dev/null @@ -1,14 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.controller.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/controller/types"; - -import "gogoproto/gogo.proto"; - -// Params defines the set of on-chain interchain accounts parameters. -// The following parameters may be used to disable the controller submodule. -message Params { - // controller_enabled enables or disables the controller submodule. - bool controller_enabled = 1 [(gogoproto.moretags) = "yaml:\"controller_enabled\""]; -} diff --git a/third_party/proto/ibc/applications/interchain_accounts/controller/v1/query.proto b/third_party/proto/ibc/applications/interchain_accounts/controller/v1/query.proto deleted file mode 100644 index d3960e9d14..0000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/controller/v1/query.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.controller.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/controller/types"; - -import "ibc/applications/interchain_accounts/controller/v1/controller.proto"; -import "google/api/annotations.proto"; - -// Query provides defines the gRPC querier service. -service Query { - // Params queries all parameters of the ICA controller submodule. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/ibc/apps/interchain_accounts/controller/v1/params"; - } -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -message QueryParamsResponse { - // params defines the parameters of the module. - Params params = 1; -} diff --git a/third_party/proto/ibc/applications/interchain_accounts/host/v1/host.proto b/third_party/proto/ibc/applications/interchain_accounts/host/v1/host.proto deleted file mode 100644 index a9d951cef8..0000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/host/v1/host.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.host.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/types"; - -import "gogoproto/gogo.proto"; - -// Params defines the set of on-chain interchain accounts parameters. -// The following parameters may be used to disable the host submodule. -message Params { - // host_enabled enables or disables the host submodule. - bool host_enabled = 1 [(gogoproto.moretags) = "yaml:\"host_enabled\""]; - // allow_messages defines a list of sdk message typeURLs allowed to be executed on a host chain. - repeated string allow_messages = 2 [(gogoproto.moretags) = "yaml:\"allow_messages\""]; -} diff --git a/third_party/proto/ibc/applications/interchain_accounts/host/v1/query.proto b/third_party/proto/ibc/applications/interchain_accounts/host/v1/query.proto deleted file mode 100644 index 5512d7b4fa..0000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/host/v1/query.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.host.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/host/types"; - -import "google/api/annotations.proto"; -import "ibc/applications/interchain_accounts/host/v1/host.proto"; - -// Query provides defines the gRPC querier service. -service Query { - // Params queries all parameters of the ICA host submodule. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/ibc/apps/interchain_accounts/host/v1/params"; - } -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -message QueryParamsResponse { - // params defines the parameters of the module. - Params params = 1; -} diff --git a/third_party/proto/ibc/applications/interchain_accounts/v1/account.proto b/third_party/proto/ibc/applications/interchain_accounts/v1/account.proto deleted file mode 100644 index 75d2fbd89e..0000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/v1/account.proto +++ /dev/null @@ -1,20 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/types"; - -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "cosmos/auth/v1beta1/auth.proto"; - -// An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain -message InterchainAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - option (cosmos_proto.implements_interface) = "InterchainAccountI"; - - cosmos.auth.v1beta1.BaseAccount base_account = 1 - [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"base_account\""]; - string account_owner = 2 [(gogoproto.moretags) = "yaml:\"account_owner\""]; -} diff --git a/third_party/proto/ibc/applications/interchain_accounts/v1/genesis.proto b/third_party/proto/ibc/applications/interchain_accounts/v1/genesis.proto deleted file mode 100644 index 3902f89070..0000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/v1/genesis.proto +++ /dev/null @@ -1,51 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/types"; - -import "gogoproto/gogo.proto"; -import "ibc/applications/interchain_accounts/controller/v1/controller.proto"; -import "ibc/applications/interchain_accounts/host/v1/host.proto"; - -// GenesisState defines the interchain accounts genesis state -message GenesisState { - ControllerGenesisState controller_genesis_state = 1 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"controller_genesis_state\""]; - HostGenesisState host_genesis_state = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"host_genesis_state\""]; -} - -// ControllerGenesisState defines the interchain accounts controller genesis state -message ControllerGenesisState { - repeated ActiveChannel active_channels = 1 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"active_channels\""]; - repeated RegisteredInterchainAccount interchain_accounts = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"interchain_accounts\""]; - repeated string ports = 3; - ibc.applications.interchain_accounts.controller.v1.Params params = 4 [(gogoproto.nullable) = false]; -} - -// HostGenesisState defines the interchain accounts host genesis state -message HostGenesisState { - repeated ActiveChannel active_channels = 1 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"active_channels\""]; - repeated RegisteredInterchainAccount interchain_accounts = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"interchain_accounts\""]; - string port = 3; - ibc.applications.interchain_accounts.host.v1.Params params = 4 [(gogoproto.nullable) = false]; -} - -// ActiveChannel contains a connection ID, port ID and associated active channel ID -message ActiveChannel { - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - string port_id = 2 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 3 [(gogoproto.moretags) = "yaml:\"channel_id\""]; -} - -// RegisteredInterchainAccount contains a connection ID, port ID and associated interchain account address -message RegisteredInterchainAccount { - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - string port_id = 2 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string account_address = 3 [(gogoproto.moretags) = "yaml:\"account_address\""]; -} \ No newline at end of file diff --git a/third_party/proto/ibc/applications/interchain_accounts/v1/metadata.proto b/third_party/proto/ibc/applications/interchain_accounts/v1/metadata.proto deleted file mode 100644 index 3eab1d04a6..0000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/v1/metadata.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/types"; - -import "gogoproto/gogo.proto"; - -// Metadata defines a set of protocol specific data encoded into the ICS27 channel version bytestring -// See ICS004: https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#Versioning -message Metadata { - // version defines the ICS27 protocol version - string version = 1; - // controller_connection_id is the connection identifier associated with the controller chain - string controller_connection_id = 2 [(gogoproto.moretags) = "yaml:\"controller_connection_id\""]; - // host_connection_id is the connection identifier associated with the host chain - string host_connection_id = 3 [(gogoproto.moretags) = "yaml:\"host_connection_id\""]; - // address defines the interchain account address to be fulfilled upon the OnChanOpenTry handshake step - // NOTE: the address field is empty on the OnChanOpenInit handshake step - string address = 4; - // encoding defines the supported codec format - string encoding = 5; - // tx_type defines the type of transactions the interchain account can execute - string tx_type = 6; -} diff --git a/third_party/proto/ibc/applications/interchain_accounts/v1/packet.proto b/third_party/proto/ibc/applications/interchain_accounts/v1/packet.proto deleted file mode 100644 index 51ff4279ae..0000000000 --- a/third_party/proto/ibc/applications/interchain_accounts/v1/packet.proto +++ /dev/null @@ -1,31 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.interchain_accounts.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/apps/27-interchain-accounts/types"; - -import "google/protobuf/any.proto"; -import "gogoproto/gogo.proto"; - -// Type defines a classification of message issued from a controller chain to its associated interchain accounts -// host -enum Type { - option (gogoproto.goproto_enum_prefix) = false; - - // Default zero value enumeration - TYPE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNSPECIFIED"]; - // Execute a transaction on an interchain accounts host chain - TYPE_EXECUTE_TX = 1 [(gogoproto.enumvalue_customname) = "EXECUTE_TX"]; -} - -// InterchainAccountPacketData is comprised of a raw transaction, type of transaction and optional memo field. -message InterchainAccountPacketData { - Type type = 1; - bytes data = 2; - string memo = 3; -} - -// CosmosTx contains a list of sdk.Msg's. It should be used when sending transactions to an SDK host chain. -message CosmosTx { - repeated google.protobuf.Any messages = 1; -} diff --git a/third_party/proto/ibc/applications/transfer/v1/genesis.proto b/third_party/proto/ibc/applications/transfer/v1/genesis.proto deleted file mode 100644 index 0b5c0e0d12..0000000000 --- a/third_party/proto/ibc/applications/transfer/v1/genesis.proto +++ /dev/null @@ -1,19 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.transfer.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"; - -import "ibc/applications/transfer/v1/transfer.proto"; -import "gogoproto/gogo.proto"; - -// GenesisState defines the ibc-transfer genesis state -message GenesisState { - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - repeated DenomTrace denom_traces = 2 [ - (gogoproto.castrepeated) = "Traces", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"denom_traces\"" - ]; - Params params = 3 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/ibc/applications/transfer/v1/query.proto b/third_party/proto/ibc/applications/transfer/v1/query.proto deleted file mode 100644 index 2ed28049fd..0000000000 --- a/third_party/proto/ibc/applications/transfer/v1/query.proto +++ /dev/null @@ -1,86 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.transfer.v1; - -import "gogoproto/gogo.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "ibc/applications/transfer/v1/transfer.proto"; -import "google/api/annotations.proto"; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"; - -// Query provides defines the gRPC querier service. -service Query { - // DenomTrace queries a denomination trace information. - rpc DenomTrace(QueryDenomTraceRequest) returns (QueryDenomTraceResponse) { - option (google.api.http).get = "/ibc/apps/transfer/v1/denom_traces/{hash}"; - } - - // DenomTraces queries all denomination traces. - rpc DenomTraces(QueryDenomTracesRequest) returns (QueryDenomTracesResponse) { - option (google.api.http).get = "/ibc/apps/transfer/v1/denom_traces"; - } - - // Params queries all parameters of the ibc-transfer module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/ibc/apps/transfer/v1/params"; - } - - // DenomHash queries a denomination hash information. - rpc DenomHash(QueryDenomHashRequest) returns (QueryDenomHashResponse) { - option (google.api.http).get = "/ibc/apps/transfer/v1/denom_hashes/{trace}"; - } -} - -// QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC -// method -message QueryDenomTraceRequest { - // hash (in hex format) of the denomination trace information. - string hash = 1; -} - -// QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC -// method. -message QueryDenomTraceResponse { - // denom_trace returns the requested denomination trace information. - DenomTrace denom_trace = 1; -} - -// QueryConnectionsRequest is the request type for the Query/DenomTraces RPC -// method -message QueryDenomTracesRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryConnectionsResponse is the response type for the Query/DenomTraces RPC -// method. -message QueryDenomTracesResponse { - // denom_traces returns all denominations trace information. - repeated DenomTrace denom_traces = 1 [(gogoproto.castrepeated) = "Traces", (gogoproto.nullable) = false]; - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryParamsRequest is the request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is the response type for the Query/Params RPC method. -message QueryParamsResponse { - // params defines the parameters of the module. - Params params = 1; -} - -// QueryDenomHashRequest is the request type for the Query/DenomHash RPC -// method -message QueryDenomHashRequest { - // The denomination trace ([port_id]/[channel_id])+/[denom] - string trace = 1; -} - -// QueryDenomHashResponse is the response type for the Query/DenomHash RPC -// method. -message QueryDenomHashResponse { - // hash (in hex format) of the denomination trace information. - string hash = 1; -} diff --git a/third_party/proto/ibc/applications/transfer/v1/transfer.proto b/third_party/proto/ibc/applications/transfer/v1/transfer.proto deleted file mode 100644 index 7a99485c58..0000000000 --- a/third_party/proto/ibc/applications/transfer/v1/transfer.proto +++ /dev/null @@ -1,30 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.transfer.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"; - -import "gogoproto/gogo.proto"; - -// DenomTrace contains the base denomination for ICS20 fungible tokens and the -// source tracing information path. -message DenomTrace { - // path defines the chain of port/channel identifiers used for tracing the - // source of the fungible token. - string path = 1; - // base denomination of the relayed fungible token. - string base_denom = 2; -} - -// Params defines the set of IBC transfer parameters. -// NOTE: To prevent a single token from being transferred, set the -// TransfersEnabled parameter to true and then set the bank module's SendEnabled -// parameter for the denomination to false. -message Params { - // send_enabled enables or disables all cross-chain token transfers from this - // chain. - bool send_enabled = 1 [(gogoproto.moretags) = "yaml:\"send_enabled\""]; - // receive_enabled enables or disables all cross-chain token transfers to this - // chain. - bool receive_enabled = 2 [(gogoproto.moretags) = "yaml:\"receive_enabled\""]; -} diff --git a/third_party/proto/ibc/applications/transfer/v1/tx.proto b/third_party/proto/ibc/applications/transfer/v1/tx.proto deleted file mode 100644 index 8f1392b0cf..0000000000 --- a/third_party/proto/ibc/applications/transfer/v1/tx.proto +++ /dev/null @@ -1,44 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.transfer.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "ibc/core/client/v1/client.proto"; - -// Msg defines the ibc/transfer Msg service. -service Msg { - // Transfer defines a rpc handler method for MsgTransfer. - rpc Transfer(MsgTransfer) returns (MsgTransferResponse); -} - -// MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between -// ICS20 enabled chains. See ICS Spec here: -// https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures -message MsgTransfer { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // the port on which the packet will be sent - string source_port = 1 [(gogoproto.moretags) = "yaml:\"source_port\""]; - // the channel by which the packet will be sent - string source_channel = 2 [(gogoproto.moretags) = "yaml:\"source_channel\""]; - // the tokens to be transferred - cosmos.base.v1beta1.Coin token = 3 [(gogoproto.nullable) = false]; - // the sender address - string sender = 4; - // the recipient address on the destination chain - string receiver = 5; - // Timeout height relative to the current block height. - // The timeout is disabled when set to 0. - ibc.core.client.v1.Height timeout_height = 6 - [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; - // Timeout timestamp in absolute nanoseconds since unix epoch. - // The timeout is disabled when set to 0. - uint64 timeout_timestamp = 7 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; -} - -// MsgTransferResponse defines the Msg/Transfer response type. -message MsgTransferResponse {} diff --git a/third_party/proto/ibc/applications/transfer/v2/packet.proto b/third_party/proto/ibc/applications/transfer/v2/packet.proto deleted file mode 100644 index 850320df34..0000000000 --- a/third_party/proto/ibc/applications/transfer/v2/packet.proto +++ /dev/null @@ -1,19 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.transfer.v2; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types"; - -// FungibleTokenPacketData defines a struct for the packet payload -// See FungibleTokenPacketData spec: -// https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#data-structures -message FungibleTokenPacketData { - // the token denomination to be transferred - string denom = 1; - // the token amount to be transferred - string amount = 2; - // the sender address - string sender = 3; - // the recipient address on the destination chain - string receiver = 4; -} diff --git a/third_party/proto/ibc/core/channel/v1/channel.proto b/third_party/proto/ibc/core/channel/v1/channel.proto deleted file mode 100644 index 68c6ec17b1..0000000000 --- a/third_party/proto/ibc/core/channel/v1/channel.proto +++ /dev/null @@ -1,148 +0,0 @@ -syntax = "proto3"; - -package ibc.core.channel.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types"; - -import "gogoproto/gogo.proto"; -import "ibc/core/client/v1/client.proto"; - -// Channel defines pipeline for exactly-once packet delivery between specific -// modules on separate blockchains, which has at least one end capable of -// sending packets and one end capable of receiving packets. -message Channel { - option (gogoproto.goproto_getters) = false; - - // current state of the channel end - State state = 1; - // whether the channel is ordered or unordered - Order ordering = 2; - // counterparty channel end - Counterparty counterparty = 3 [(gogoproto.nullable) = false]; - // list of connection identifiers, in order, along which packets sent on - // this channel will travel - repeated string connection_hops = 4 [(gogoproto.moretags) = "yaml:\"connection_hops\""]; - // opaque channel version, which is agreed upon during the handshake - string version = 5; -} - -// IdentifiedChannel defines a channel with additional port and channel -// identifier fields. -message IdentifiedChannel { - option (gogoproto.goproto_getters) = false; - - // current state of the channel end - State state = 1; - // whether the channel is ordered or unordered - Order ordering = 2; - // counterparty channel end - Counterparty counterparty = 3 [(gogoproto.nullable) = false]; - // list of connection identifiers, in order, along which packets sent on - // this channel will travel - repeated string connection_hops = 4 [(gogoproto.moretags) = "yaml:\"connection_hops\""]; - // opaque channel version, which is agreed upon during the handshake - string version = 5; - // port identifier - string port_id = 6; - // channel identifier - string channel_id = 7; -} - -// State defines if a channel is in one of the following states: -// CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. -enum State { - option (gogoproto.goproto_enum_prefix) = false; - - // Default State - STATE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNINITIALIZED"]; - // A channel has just started the opening handshake. - STATE_INIT = 1 [(gogoproto.enumvalue_customname) = "INIT"]; - // A channel has acknowledged the handshake step on the counterparty chain. - STATE_TRYOPEN = 2 [(gogoproto.enumvalue_customname) = "TRYOPEN"]; - // A channel has completed the handshake. Open channels are - // ready to send and receive packets. - STATE_OPEN = 3 [(gogoproto.enumvalue_customname) = "OPEN"]; - // A channel has been closed and can no longer be used to send or receive - // packets. - STATE_CLOSED = 4 [(gogoproto.enumvalue_customname) = "CLOSED"]; -} - -// Order defines if a channel is ORDERED or UNORDERED -enum Order { - option (gogoproto.goproto_enum_prefix) = false; - - // zero-value for channel ordering - ORDER_NONE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "NONE"]; - // packets can be delivered in any order, which may differ from the order in - // which they were sent. - ORDER_UNORDERED = 1 [(gogoproto.enumvalue_customname) = "UNORDERED"]; - // packets are delivered exactly in the order which they were sent - ORDER_ORDERED = 2 [(gogoproto.enumvalue_customname) = "ORDERED"]; -} - -// Counterparty defines a channel end counterparty -message Counterparty { - option (gogoproto.goproto_getters) = false; - - // port on the counterparty chain which owns the other end of the channel. - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - // channel end on the counterparty chain - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; -} - -// Packet defines a type that carries data across different chains through IBC -message Packet { - option (gogoproto.goproto_getters) = false; - - // number corresponds to the order of sends and receives, where a Packet - // with an earlier sequence number must be sent and received before a Packet - // with a later sequence number. - uint64 sequence = 1; - // identifies the port on the sending chain. - string source_port = 2 [(gogoproto.moretags) = "yaml:\"source_port\""]; - // identifies the channel end on the sending chain. - string source_channel = 3 [(gogoproto.moretags) = "yaml:\"source_channel\""]; - // identifies the port on the receiving chain. - string destination_port = 4 [(gogoproto.moretags) = "yaml:\"destination_port\""]; - // identifies the channel end on the receiving chain. - string destination_channel = 5 [(gogoproto.moretags) = "yaml:\"destination_channel\""]; - // actual opaque bytes transferred directly to the application module - bytes data = 6; - // block height after which the packet times out - ibc.core.client.v1.Height timeout_height = 7 - [(gogoproto.moretags) = "yaml:\"timeout_height\"", (gogoproto.nullable) = false]; - // block timestamp (in nanoseconds) after which the packet times out - uint64 timeout_timestamp = 8 [(gogoproto.moretags) = "yaml:\"timeout_timestamp\""]; -} - -// PacketState defines the generic type necessary to retrieve and store -// packet commitments, acknowledgements, and receipts. -// Caller is responsible for knowing the context necessary to interpret this -// state as a commitment, acknowledgement, or a receipt. -message PacketState { - option (gogoproto.goproto_getters) = false; - - // channel port identifier. - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - // channel unique identifier. - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - // packet sequence. - uint64 sequence = 3; - // embedded data that represents packet state. - bytes data = 4; -} - -// Acknowledgement is the recommended acknowledgement format to be used by -// app-specific protocols. -// NOTE: The field numbers 21 and 22 were explicitly chosen to avoid accidental -// conflicts with other protobuf message formats used for acknowledgements. -// The first byte of any message with this format will be the non-ASCII values -// `0xaa` (result) or `0xb2` (error). Implemented as defined by ICS: -// https://github.com/cosmos/ibc/tree/master/spec/core/ics-004-channel-and-packet-semantics#acknowledgement-envelope -message Acknowledgement { - // response contains either a result or an error and must be non-empty - oneof response { - bytes result = 21; - string error = 22; - } -} diff --git a/third_party/proto/ibc/core/channel/v1/genesis.proto b/third_party/proto/ibc/core/channel/v1/genesis.proto deleted file mode 100644 index d95c891b6c..0000000000 --- a/third_party/proto/ibc/core/channel/v1/genesis.proto +++ /dev/null @@ -1,32 +0,0 @@ -syntax = "proto3"; - -package ibc.core.channel.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types"; - -import "gogoproto/gogo.proto"; -import "ibc/core/channel/v1/channel.proto"; - -// GenesisState defines the ibc channel submodule's genesis state. -message GenesisState { - repeated IdentifiedChannel channels = 1 [(gogoproto.casttype) = "IdentifiedChannel", (gogoproto.nullable) = false]; - repeated PacketState acknowledgements = 2 [(gogoproto.nullable) = false]; - repeated PacketState commitments = 3 [(gogoproto.nullable) = false]; - repeated PacketState receipts = 4 [(gogoproto.nullable) = false]; - repeated PacketSequence send_sequences = 5 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"send_sequences\""]; - repeated PacketSequence recv_sequences = 6 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"recv_sequences\""]; - repeated PacketSequence ack_sequences = 7 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"ack_sequences\""]; - // the sequence for the next generated channel identifier - uint64 next_channel_sequence = 8 [(gogoproto.moretags) = "yaml:\"next_channel_sequence\""]; -} - -// PacketSequence defines the genesis type necessary to retrieve and store -// next send and receive sequences. -message PacketSequence { - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - uint64 sequence = 3; -} diff --git a/third_party/proto/ibc/core/channel/v1/query.proto b/third_party/proto/ibc/core/channel/v1/query.proto deleted file mode 100644 index ceb13d0009..0000000000 --- a/third_party/proto/ibc/core/channel/v1/query.proto +++ /dev/null @@ -1,376 +0,0 @@ -syntax = "proto3"; - -package ibc.core.channel.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types"; - -import "ibc/core/client/v1/client.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "ibc/core/channel/v1/channel.proto"; -import "google/api/annotations.proto"; -import "google/protobuf/any.proto"; -import "gogoproto/gogo.proto"; - -// Query provides defines the gRPC querier service -service Query { - // Channel queries an IBC Channel. - rpc Channel(QueryChannelRequest) returns (QueryChannelResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}"; - } - - // Channels queries all the IBC channels of a chain. - rpc Channels(QueryChannelsRequest) returns (QueryChannelsResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels"; - } - - // ConnectionChannels queries all the channels associated with a connection - // end. - rpc ConnectionChannels(QueryConnectionChannelsRequest) returns (QueryConnectionChannelsResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/connections/{connection}/channels"; - } - - // ChannelClientState queries for the client state for the channel associated - // with the provided channel identifiers. - rpc ChannelClientState(QueryChannelClientStateRequest) returns (QueryChannelClientStateResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" - "ports/{port_id}/client_state"; - } - - // ChannelConsensusState queries for the consensus state for the channel - // associated with the provided channel identifiers. - rpc ChannelConsensusState(QueryChannelConsensusStateRequest) returns (QueryChannelConsensusStateResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" - "ports/{port_id}/consensus_state/revision/" - "{revision_number}/height/{revision_height}"; - } - - // PacketCommitment queries a stored packet commitment hash. - rpc PacketCommitment(QueryPacketCommitmentRequest) returns (QueryPacketCommitmentResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/" - "packet_commitments/{sequence}"; - } - - // PacketCommitments returns all the packet commitments hashes associated - // with a channel. - rpc PacketCommitments(QueryPacketCommitmentsRequest) returns (QueryPacketCommitmentsResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" - "ports/{port_id}/packet_commitments"; - } - - // PacketReceipt queries if a given packet sequence has been received on the - // queried chain - rpc PacketReceipt(QueryPacketReceiptRequest) returns (QueryPacketReceiptResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" - "ports/{port_id}/packet_receipts/{sequence}"; - } - - // PacketAcknowledgement queries a stored packet acknowledgement hash. - rpc PacketAcknowledgement(QueryPacketAcknowledgementRequest) returns (QueryPacketAcknowledgementResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" - "ports/{port_id}/packet_acks/{sequence}"; - } - - // PacketAcknowledgements returns all the packet acknowledgements associated - // with a channel. - rpc PacketAcknowledgements(QueryPacketAcknowledgementsRequest) returns (QueryPacketAcknowledgementsResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" - "ports/{port_id}/packet_acknowledgements"; - } - - // UnreceivedPackets returns all the unreceived IBC packets associated with a - // channel and sequences. - rpc UnreceivedPackets(QueryUnreceivedPacketsRequest) returns (QueryUnreceivedPacketsResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/ports/{port_id}/" - "packet_commitments/" - "{packet_commitment_sequences}/unreceived_packets"; - } - - // UnreceivedAcks returns all the unreceived IBC acknowledgements associated - // with a channel and sequences. - rpc UnreceivedAcks(QueryUnreceivedAcksRequest) returns (QueryUnreceivedAcksResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" - "ports/{port_id}/packet_commitments/" - "{packet_ack_sequences}/unreceived_acks"; - } - - // NextSequenceReceive returns the next receive sequence for a given channel. - rpc NextSequenceReceive(QueryNextSequenceReceiveRequest) returns (QueryNextSequenceReceiveResponse) { - option (google.api.http).get = "/ibc/core/channel/v1/channels/{channel_id}/" - "ports/{port_id}/next_sequence"; - } -} - -// QueryChannelRequest is the request type for the Query/Channel RPC method -message QueryChannelRequest { - // port unique identifier - string port_id = 1; - // channel unique identifier - string channel_id = 2; -} - -// QueryChannelResponse is the response type for the Query/Channel RPC method. -// Besides the Channel end, it includes a proof and the height from which the -// proof was retrieved. -message QueryChannelResponse { - // channel associated with the request identifiers - ibc.core.channel.v1.Channel channel = 1; - // merkle proof of existence - bytes proof = 2; - // height at which the proof was retrieved - ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; -} - -// QueryChannelsRequest is the request type for the Query/Channels RPC method -message QueryChannelsRequest { - // pagination request - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryChannelsResponse is the response type for the Query/Channels RPC method. -message QueryChannelsResponse { - // list of stored channels of the chain. - repeated ibc.core.channel.v1.IdentifiedChannel channels = 1; - // pagination response - cosmos.base.query.v1beta1.PageResponse pagination = 2; - // query block height - ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false]; -} - -// QueryConnectionChannelsRequest is the request type for the -// Query/QueryConnectionChannels RPC method -message QueryConnectionChannelsRequest { - // connection unique identifier - string connection = 1; - // pagination request - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryConnectionChannelsResponse is the Response type for the -// Query/QueryConnectionChannels RPC method -message QueryConnectionChannelsResponse { - // list of channels associated with a connection. - repeated ibc.core.channel.v1.IdentifiedChannel channels = 1; - // pagination response - cosmos.base.query.v1beta1.PageResponse pagination = 2; - // query block height - ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false]; -} - -// QueryChannelClientStateRequest is the request type for the Query/ClientState -// RPC method -message QueryChannelClientStateRequest { - // port unique identifier - string port_id = 1; - // channel unique identifier - string channel_id = 2; -} - -// QueryChannelClientStateResponse is the Response type for the -// Query/QueryChannelClientState RPC method -message QueryChannelClientStateResponse { - // client state associated with the channel - ibc.core.client.v1.IdentifiedClientState identified_client_state = 1; - // merkle proof of existence - bytes proof = 2; - // height at which the proof was retrieved - ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; -} - -// QueryChannelConsensusStateRequest is the request type for the -// Query/ConsensusState RPC method -message QueryChannelConsensusStateRequest { - // port unique identifier - string port_id = 1; - // channel unique identifier - string channel_id = 2; - // revision number of the consensus state - uint64 revision_number = 3; - // revision height of the consensus state - uint64 revision_height = 4; -} - -// QueryChannelClientStateResponse is the Response type for the -// Query/QueryChannelClientState RPC method -message QueryChannelConsensusStateResponse { - // consensus state associated with the channel - google.protobuf.Any consensus_state = 1; - // client ID associated with the consensus state - string client_id = 2; - // merkle proof of existence - bytes proof = 3; - // height at which the proof was retrieved - ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; -} - -// QueryPacketCommitmentRequest is the request type for the -// Query/PacketCommitment RPC method -message QueryPacketCommitmentRequest { - // port unique identifier - string port_id = 1; - // channel unique identifier - string channel_id = 2; - // packet sequence - uint64 sequence = 3; -} - -// QueryPacketCommitmentResponse defines the client query response for a packet -// which also includes a proof and the height from which the proof was -// retrieved -message QueryPacketCommitmentResponse { - // packet associated with the request fields - bytes commitment = 1; - // merkle proof of existence - bytes proof = 2; - // height at which the proof was retrieved - ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; -} - -// QueryPacketCommitmentsRequest is the request type for the -// Query/QueryPacketCommitments RPC method -message QueryPacketCommitmentsRequest { - // port unique identifier - string port_id = 1; - // channel unique identifier - string channel_id = 2; - // pagination request - cosmos.base.query.v1beta1.PageRequest pagination = 3; -} - -// QueryPacketCommitmentsResponse is the request type for the -// Query/QueryPacketCommitments RPC method -message QueryPacketCommitmentsResponse { - repeated ibc.core.channel.v1.PacketState commitments = 1; - // pagination response - cosmos.base.query.v1beta1.PageResponse pagination = 2; - // query block height - ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false]; -} - -// QueryPacketReceiptRequest is the request type for the -// Query/PacketReceipt RPC method -message QueryPacketReceiptRequest { - // port unique identifier - string port_id = 1; - // channel unique identifier - string channel_id = 2; - // packet sequence - uint64 sequence = 3; -} - -// QueryPacketReceiptResponse defines the client query response for a packet -// receipt which also includes a proof, and the height from which the proof was -// retrieved -message QueryPacketReceiptResponse { - // success flag for if receipt exists - bool received = 2; - // merkle proof of existence - bytes proof = 3; - // height at which the proof was retrieved - ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; -} - -// QueryPacketAcknowledgementRequest is the request type for the -// Query/PacketAcknowledgement RPC method -message QueryPacketAcknowledgementRequest { - // port unique identifier - string port_id = 1; - // channel unique identifier - string channel_id = 2; - // packet sequence - uint64 sequence = 3; -} - -// QueryPacketAcknowledgementResponse defines the client query response for a -// packet which also includes a proof and the height from which the -// proof was retrieved -message QueryPacketAcknowledgementResponse { - // packet associated with the request fields - bytes acknowledgement = 1; - // merkle proof of existence - bytes proof = 2; - // height at which the proof was retrieved - ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; -} - -// QueryPacketAcknowledgementsRequest is the request type for the -// Query/QueryPacketCommitments RPC method -message QueryPacketAcknowledgementsRequest { - // port unique identifier - string port_id = 1; - // channel unique identifier - string channel_id = 2; - // pagination request - cosmos.base.query.v1beta1.PageRequest pagination = 3; - // list of packet sequences - repeated uint64 packet_commitment_sequences = 4; -} - -// QueryPacketAcknowledgemetsResponse is the request type for the -// Query/QueryPacketAcknowledgements RPC method -message QueryPacketAcknowledgementsResponse { - repeated ibc.core.channel.v1.PacketState acknowledgements = 1; - // pagination response - cosmos.base.query.v1beta1.PageResponse pagination = 2; - // query block height - ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false]; -} - -// QueryUnreceivedPacketsRequest is the request type for the -// Query/UnreceivedPackets RPC method -message QueryUnreceivedPacketsRequest { - // port unique identifier - string port_id = 1; - // channel unique identifier - string channel_id = 2; - // list of packet sequences - repeated uint64 packet_commitment_sequences = 3; -} - -// QueryUnreceivedPacketsResponse is the response type for the -// Query/UnreceivedPacketCommitments RPC method -message QueryUnreceivedPacketsResponse { - // list of unreceived packet sequences - repeated uint64 sequences = 1; - // query block height - ibc.core.client.v1.Height height = 2 [(gogoproto.nullable) = false]; -} - -// QueryUnreceivedAcks is the request type for the -// Query/UnreceivedAcks RPC method -message QueryUnreceivedAcksRequest { - // port unique identifier - string port_id = 1; - // channel unique identifier - string channel_id = 2; - // list of acknowledgement sequences - repeated uint64 packet_ack_sequences = 3; -} - -// QueryUnreceivedAcksResponse is the response type for the -// Query/UnreceivedAcks RPC method -message QueryUnreceivedAcksResponse { - // list of unreceived acknowledgement sequences - repeated uint64 sequences = 1; - // query block height - ibc.core.client.v1.Height height = 2 [(gogoproto.nullable) = false]; -} - -// QueryNextSequenceReceiveRequest is the request type for the -// Query/QueryNextSequenceReceiveRequest RPC method -message QueryNextSequenceReceiveRequest { - // port unique identifier - string port_id = 1; - // channel unique identifier - string channel_id = 2; -} - -// QuerySequenceResponse is the request type for the -// Query/QueryNextSequenceReceiveResponse RPC method -message QueryNextSequenceReceiveResponse { - // next sequence receive number - uint64 next_sequence_receive = 1; - // merkle proof of existence - bytes proof = 2; - // height at which the proof was retrieved - ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/ibc/core/channel/v1/tx.proto b/third_party/proto/ibc/core/channel/v1/tx.proto deleted file mode 100644 index d4d6df1d5e..0000000000 --- a/third_party/proto/ibc/core/channel/v1/tx.proto +++ /dev/null @@ -1,243 +0,0 @@ -syntax = "proto3"; - -package ibc.core.channel.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/04-channel/types"; - -import "gogoproto/gogo.proto"; -import "ibc/core/client/v1/client.proto"; -import "ibc/core/channel/v1/channel.proto"; - -// Msg defines the ibc/channel Msg service. -service Msg { - // ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. - rpc ChannelOpenInit(MsgChannelOpenInit) returns (MsgChannelOpenInitResponse); - - // ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. - rpc ChannelOpenTry(MsgChannelOpenTry) returns (MsgChannelOpenTryResponse); - - // ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. - rpc ChannelOpenAck(MsgChannelOpenAck) returns (MsgChannelOpenAckResponse); - - // ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. - rpc ChannelOpenConfirm(MsgChannelOpenConfirm) returns (MsgChannelOpenConfirmResponse); - - // ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. - rpc ChannelCloseInit(MsgChannelCloseInit) returns (MsgChannelCloseInitResponse); - - // ChannelCloseConfirm defines a rpc handler method for - // MsgChannelCloseConfirm. - rpc ChannelCloseConfirm(MsgChannelCloseConfirm) returns (MsgChannelCloseConfirmResponse); - - // RecvPacket defines a rpc handler method for MsgRecvPacket. - rpc RecvPacket(MsgRecvPacket) returns (MsgRecvPacketResponse); - - // Timeout defines a rpc handler method for MsgTimeout. - rpc Timeout(MsgTimeout) returns (MsgTimeoutResponse); - - // TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. - rpc TimeoutOnClose(MsgTimeoutOnClose) returns (MsgTimeoutOnCloseResponse); - - // Acknowledgement defines a rpc handler method for MsgAcknowledgement. - rpc Acknowledgement(MsgAcknowledgement) returns (MsgAcknowledgementResponse); -} - -// ResponseResultType defines the possible outcomes of the execution of a message -enum ResponseResultType { - option (gogoproto.goproto_enum_prefix) = false; - - // Default zero value enumeration - RESPONSE_RESULT_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNSPECIFIED"]; - // The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) - RESPONSE_RESULT_NOOP = 1 [(gogoproto.enumvalue_customname) = "NOOP"]; - // The message was executed successfully - RESPONSE_RESULT_SUCCESS = 2 [(gogoproto.enumvalue_customname) = "SUCCESS"]; -} - -// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It -// is called by a relayer on Chain A. -message MsgChannelOpenInit { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - Channel channel = 2 [(gogoproto.nullable) = false]; - string signer = 3; -} - -// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. -message MsgChannelOpenInitResponse { - string channel_id = 1 [(gogoproto.moretags) = "yaml:\"channel_id\""]; -} - -// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel -// on Chain B. The version field within the Channel field has been deprecated. Its -// value will be ignored by core IBC. -message MsgChannelOpenTry { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - // in the case of crossing hello's, when both chains call OpenInit, we need - // the channel identifier of the previous channel in state INIT - string previous_channel_id = 2 [(gogoproto.moretags) = "yaml:\"previous_channel_id\""]; - // NOTE: the version field within the channel has been deprecated. Its value will be ignored by core IBC. - Channel channel = 3 [(gogoproto.nullable) = false]; - string counterparty_version = 4 [(gogoproto.moretags) = "yaml:\"counterparty_version\""]; - bytes proof_init = 5 [(gogoproto.moretags) = "yaml:\"proof_init\""]; - ibc.core.client.v1.Height proof_height = 6 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 7; -} - -// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. -message MsgChannelOpenTryResponse {} - -// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge -// the change of channel state to TRYOPEN on Chain B. -message MsgChannelOpenAck { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - string counterparty_channel_id = 3 [(gogoproto.moretags) = "yaml:\"counterparty_channel_id\""]; - string counterparty_version = 4 [(gogoproto.moretags) = "yaml:\"counterparty_version\""]; - bytes proof_try = 5 [(gogoproto.moretags) = "yaml:\"proof_try\""]; - ibc.core.client.v1.Height proof_height = 6 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 7; -} - -// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. -message MsgChannelOpenAckResponse {} - -// MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to -// acknowledge the change of channel state to OPEN on Chain A. -message MsgChannelOpenConfirm { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - bytes proof_ack = 3 [(gogoproto.moretags) = "yaml:\"proof_ack\""]; - ibc.core.client.v1.Height proof_height = 4 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 5; -} - -// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response -// type. -message MsgChannelOpenConfirmResponse {} - -// MsgChannelCloseInit defines a msg sent by a Relayer to Chain A -// to close a channel with Chain B. -message MsgChannelCloseInit { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - string signer = 3; -} - -// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. -message MsgChannelCloseInitResponse {} - -// MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B -// to acknowledge the change of channel state to CLOSED on Chain A. -message MsgChannelCloseConfirm { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; - string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; - bytes proof_init = 3 [(gogoproto.moretags) = "yaml:\"proof_init\""]; - ibc.core.client.v1.Height proof_height = 4 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 5; -} - -// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response -// type. -message MsgChannelCloseConfirmResponse {} - -// MsgRecvPacket receives incoming IBC packet -message MsgRecvPacket { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - Packet packet = 1 [(gogoproto.nullable) = false]; - bytes proof_commitment = 2 [(gogoproto.moretags) = "yaml:\"proof_commitment\""]; - ibc.core.client.v1.Height proof_height = 3 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 4; -} - -// MsgRecvPacketResponse defines the Msg/RecvPacket response type. -message MsgRecvPacketResponse { - option (gogoproto.goproto_getters) = false; - - ResponseResultType result = 1; -} - -// MsgTimeout receives timed-out packet -message MsgTimeout { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - Packet packet = 1 [(gogoproto.nullable) = false]; - bytes proof_unreceived = 2 [(gogoproto.moretags) = "yaml:\"proof_unreceived\""]; - ibc.core.client.v1.Height proof_height = 3 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - uint64 next_sequence_recv = 4 [(gogoproto.moretags) = "yaml:\"next_sequence_recv\""]; - string signer = 5; -} - -// MsgTimeoutResponse defines the Msg/Timeout response type. -message MsgTimeoutResponse { - option (gogoproto.goproto_getters) = false; - - ResponseResultType result = 1; -} - -// MsgTimeoutOnClose timed-out packet upon counterparty channel closure. -message MsgTimeoutOnClose { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - Packet packet = 1 [(gogoproto.nullable) = false]; - bytes proof_unreceived = 2 [(gogoproto.moretags) = "yaml:\"proof_unreceived\""]; - bytes proof_close = 3 [(gogoproto.moretags) = "yaml:\"proof_close\""]; - ibc.core.client.v1.Height proof_height = 4 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - uint64 next_sequence_recv = 5 [(gogoproto.moretags) = "yaml:\"next_sequence_recv\""]; - string signer = 6; -} - -// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. -message MsgTimeoutOnCloseResponse { - option (gogoproto.goproto_getters) = false; - - ResponseResultType result = 1; -} - -// MsgAcknowledgement receives incoming IBC acknowledgement -message MsgAcknowledgement { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - Packet packet = 1 [(gogoproto.nullable) = false]; - bytes acknowledgement = 2; - bytes proof_acked = 3 [(gogoproto.moretags) = "yaml:\"proof_acked\""]; - ibc.core.client.v1.Height proof_height = 4 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 5; -} - -// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. -message MsgAcknowledgementResponse { - option (gogoproto.goproto_getters) = false; - - ResponseResultType result = 1; -} diff --git a/third_party/proto/ibc/core/client/v1/client.proto b/third_party/proto/ibc/core/client/v1/client.proto deleted file mode 100644 index 657d99ed20..0000000000 --- a/third_party/proto/ibc/core/client/v1/client.proto +++ /dev/null @@ -1,100 +0,0 @@ -syntax = "proto3"; - -package ibc.core.client.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "cosmos/upgrade/v1beta1/upgrade.proto"; - -// IdentifiedClientState defines a client state with an additional client -// identifier field. -message IdentifiedClientState { - // client identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // client state - google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; -} - -// ConsensusStateWithHeight defines a consensus state with an additional height -// field. -message ConsensusStateWithHeight { - // consensus state height - Height height = 1 [(gogoproto.nullable) = false]; - // consensus state - google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; -} - -// ClientConsensusStates defines all the stored consensus states for a given -// client. -message ClientConsensusStates { - // client identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // consensus states and their heights associated with the client - repeated ConsensusStateWithHeight consensus_states = 2 - [(gogoproto.moretags) = "yaml:\"consensus_states\"", (gogoproto.nullable) = false]; -} - -// ClientUpdateProposal is a governance proposal. If it passes, the substitute -// client's latest consensus state is copied over to the subject client. The proposal -// handler may fail if the subject and the substitute do not match in client and -// chain parameters (with exception to latest height, frozen height, and chain-id). -message ClientUpdateProposal { - option (gogoproto.goproto_getters) = false; - // the title of the update proposal - string title = 1; - // the description of the proposal - string description = 2; - // the client identifier for the client to be updated if the proposal passes - string subject_client_id = 3 [(gogoproto.moretags) = "yaml:\"subject_client_id\""]; - // the substitute client identifier for the client standing in for the subject - // client - string substitute_client_id = 4 [(gogoproto.moretags) = "yaml:\"substitute_client_id\""]; -} - -// UpgradeProposal is a gov Content type for initiating an IBC breaking -// upgrade. -message UpgradeProposal { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.equal) = true; - - string title = 1; - string description = 2; - cosmos.upgrade.v1beta1.Plan plan = 3 [(gogoproto.nullable) = false]; - - // An UpgradedClientState must be provided to perform an IBC breaking upgrade. - // This will make the chain commit to the correct upgraded (self) client state - // before the upgrade occurs, so that connecting chains can verify that the - // new upgraded client is valid by verifying a proof on the previous version - // of the chain. This will allow IBC connections to persist smoothly across - // planned chain upgrades - google.protobuf.Any upgraded_client_state = 4 [(gogoproto.moretags) = "yaml:\"upgraded_client_state\""]; -} - -// Height is a monotonically increasing data type -// that can be compared against another Height for the purposes of updating and -// freezing clients -// -// Normally the RevisionHeight is incremented at each height while keeping -// RevisionNumber the same. However some consensus algorithms may choose to -// reset the height in certain conditions e.g. hard forks, state-machine -// breaking changes In these cases, the RevisionNumber is incremented so that -// height continues to be monitonically increasing even as the RevisionHeight -// gets reset -message Height { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - // the revision that the client is currently on - uint64 revision_number = 1 [(gogoproto.moretags) = "yaml:\"revision_number\""]; - // the height within the given revision - uint64 revision_height = 2 [(gogoproto.moretags) = "yaml:\"revision_height\""]; -} - -// Params defines the set of IBC light client parameters. -message Params { - // allowed_clients defines the list of allowed client state types. - repeated string allowed_clients = 1 [(gogoproto.moretags) = "yaml:\"allowed_clients\""]; -} diff --git a/third_party/proto/ibc/core/client/v1/genesis.proto b/third_party/proto/ibc/core/client/v1/genesis.proto deleted file mode 100644 index 0ca29d224b..0000000000 --- a/third_party/proto/ibc/core/client/v1/genesis.proto +++ /dev/null @@ -1,48 +0,0 @@ -syntax = "proto3"; - -package ibc.core.client.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"; - -import "ibc/core/client/v1/client.proto"; -import "gogoproto/gogo.proto"; - -// GenesisState defines the ibc client submodule's genesis state. -message GenesisState { - // client states with their corresponding identifiers - repeated IdentifiedClientState clients = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "IdentifiedClientStates"]; - // consensus states from each client - repeated ClientConsensusStates clients_consensus = 2 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "ClientsConsensusStates", - (gogoproto.moretags) = "yaml:\"clients_consensus\"" - ]; - // metadata from each client - repeated IdentifiedGenesisMetadata clients_metadata = 3 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"clients_metadata\""]; - Params params = 4 [(gogoproto.nullable) = false]; - // create localhost on initialization - bool create_localhost = 5 [(gogoproto.moretags) = "yaml:\"create_localhost\""]; - // the sequence for the next generated client identifier - uint64 next_client_sequence = 6 [(gogoproto.moretags) = "yaml:\"next_client_sequence\""]; -} - -// GenesisMetadata defines the genesis type for metadata that clients may return -// with ExportMetadata -message GenesisMetadata { - option (gogoproto.goproto_getters) = false; - - // store key of metadata without clientID-prefix - bytes key = 1; - // metadata value - bytes value = 2; -} - -// IdentifiedGenesisMetadata has the client metadata with the corresponding -// client id. -message IdentifiedGenesisMetadata { - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - repeated GenesisMetadata client_metadata = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"client_metadata\""]; -} diff --git a/third_party/proto/ibc/core/client/v1/query.proto b/third_party/proto/ibc/core/client/v1/query.proto deleted file mode 100644 index 91a906fe54..0000000000 --- a/third_party/proto/ibc/core/client/v1/query.proto +++ /dev/null @@ -1,184 +0,0 @@ -syntax = "proto3"; - -package ibc.core.client.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "ibc/core/client/v1/client.proto"; -import "google/protobuf/any.proto"; -import "google/api/annotations.proto"; -import "gogoproto/gogo.proto"; - -// Query provides defines the gRPC querier service -service Query { - // ClientState queries an IBC light client. - rpc ClientState(QueryClientStateRequest) returns (QueryClientStateResponse) { - option (google.api.http).get = "/ibc/core/client/v1/client_states/{client_id}"; - } - - // ClientStates queries all the IBC light clients of a chain. - rpc ClientStates(QueryClientStatesRequest) returns (QueryClientStatesResponse) { - option (google.api.http).get = "/ibc/core/client/v1/client_states"; - } - - // ConsensusState queries a consensus state associated with a client state at - // a given height. - rpc ConsensusState(QueryConsensusStateRequest) returns (QueryConsensusStateResponse) { - option (google.api.http).get = "/ibc/core/client/v1/consensus_states/" - "{client_id}/revision/{revision_number}/" - "height/{revision_height}"; - } - - // ConsensusStates queries all the consensus state associated with a given - // client. - rpc ConsensusStates(QueryConsensusStatesRequest) returns (QueryConsensusStatesResponse) { - option (google.api.http).get = "/ibc/core/client/v1/consensus_states/{client_id}"; - } - - // Status queries the status of an IBC client. - rpc ClientStatus(QueryClientStatusRequest) returns (QueryClientStatusResponse) { - option (google.api.http).get = "/ibc/core/client/v1/client_status/{client_id}"; - } - - // ClientParams queries all parameters of the ibc client. - rpc ClientParams(QueryClientParamsRequest) returns (QueryClientParamsResponse) { - option (google.api.http).get = "/ibc/client/v1/params"; - } - - // UpgradedClientState queries an Upgraded IBC light client. - rpc UpgradedClientState(QueryUpgradedClientStateRequest) returns (QueryUpgradedClientStateResponse) { - option (google.api.http).get = "/ibc/core/client/v1/upgraded_client_states"; - } - - // UpgradedConsensusState queries an Upgraded IBC consensus state. - rpc UpgradedConsensusState(QueryUpgradedConsensusStateRequest) returns (QueryUpgradedConsensusStateResponse) { - option (google.api.http).get = "/ibc/core/client/v1/upgraded_consensus_states"; - } -} - -// QueryClientStateRequest is the request type for the Query/ClientState RPC -// method -message QueryClientStateRequest { - // client state unique identifier - string client_id = 1; -} - -// QueryClientStateResponse is the response type for the Query/ClientState RPC -// method. Besides the client state, it includes a proof and the height from -// which the proof was retrieved. -message QueryClientStateResponse { - // client state associated with the request identifier - google.protobuf.Any client_state = 1; - // merkle proof of existence - bytes proof = 2; - // height at which the proof was retrieved - ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; -} - -// QueryClientStatesRequest is the request type for the Query/ClientStates RPC -// method -message QueryClientStatesRequest { - // pagination request - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryClientStatesResponse is the response type for the Query/ClientStates RPC -// method. -message QueryClientStatesResponse { - // list of stored ClientStates of the chain. - repeated IdentifiedClientState client_states = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "IdentifiedClientStates"]; - // pagination response - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryConsensusStateRequest is the request type for the Query/ConsensusState -// RPC method. Besides the consensus state, it includes a proof and the height -// from which the proof was retrieved. -message QueryConsensusStateRequest { - // client identifier - string client_id = 1; - // consensus state revision number - uint64 revision_number = 2; - // consensus state revision height - uint64 revision_height = 3; - // latest_height overrrides the height field and queries the latest stored - // ConsensusState - bool latest_height = 4; -} - -// QueryConsensusStateResponse is the response type for the Query/ConsensusState -// RPC method -message QueryConsensusStateResponse { - // consensus state associated with the client identifier at the given height - google.protobuf.Any consensus_state = 1; - // merkle proof of existence - bytes proof = 2; - // height at which the proof was retrieved - ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; -} - -// QueryConsensusStatesRequest is the request type for the Query/ConsensusStates -// RPC method. -message QueryConsensusStatesRequest { - // client identifier - string client_id = 1; - // pagination request - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryConsensusStatesResponse is the response type for the -// Query/ConsensusStates RPC method -message QueryConsensusStatesResponse { - // consensus states associated with the identifier - repeated ConsensusStateWithHeight consensus_states = 1 [(gogoproto.nullable) = false]; - // pagination response - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryClientStatusRequest is the request type for the Query/ClientStatus RPC -// method -message QueryClientStatusRequest { - // client unique identifier - string client_id = 1; -} - -// QueryClientStatusResponse is the response type for the Query/ClientStatus RPC -// method. It returns the current status of the IBC client. -message QueryClientStatusResponse { - string status = 1; -} - -// QueryClientParamsRequest is the request type for the Query/ClientParams RPC -// method. -message QueryClientParamsRequest {} - -// QueryClientParamsResponse is the response type for the Query/ClientParams RPC -// method. -message QueryClientParamsResponse { - // params defines the parameters of the module. - Params params = 1; -} - -// QueryUpgradedClientStateRequest is the request type for the -// Query/UpgradedClientState RPC method -message QueryUpgradedClientStateRequest {} - -// QueryUpgradedClientStateResponse is the response type for the -// Query/UpgradedClientState RPC method. -message QueryUpgradedClientStateResponse { - // client state associated with the request identifier - google.protobuf.Any upgraded_client_state = 1; -} - -// QueryUpgradedConsensusStateRequest is the request type for the -// Query/UpgradedConsensusState RPC method -message QueryUpgradedConsensusStateRequest {} - -// QueryUpgradedConsensusStateResponse is the response type for the -// Query/UpgradedConsensusState RPC method. -message QueryUpgradedConsensusStateResponse { - // Consensus state associated with the request identifier - google.protobuf.Any upgraded_consensus_state = 1; -} diff --git a/third_party/proto/ibc/core/client/v1/tx.proto b/third_party/proto/ibc/core/client/v1/tx.proto deleted file mode 100644 index 06dbfbd0df..0000000000 --- a/third_party/proto/ibc/core/client/v1/tx.proto +++ /dev/null @@ -1,99 +0,0 @@ -syntax = "proto3"; - -package ibc.core.client.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/02-client/types"; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; - -// Msg defines the ibc/client Msg service. -service Msg { - // CreateClient defines a rpc handler method for MsgCreateClient. - rpc CreateClient(MsgCreateClient) returns (MsgCreateClientResponse); - - // UpdateClient defines a rpc handler method for MsgUpdateClient. - rpc UpdateClient(MsgUpdateClient) returns (MsgUpdateClientResponse); - - // UpgradeClient defines a rpc handler method for MsgUpgradeClient. - rpc UpgradeClient(MsgUpgradeClient) returns (MsgUpgradeClientResponse); - - // SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. - rpc SubmitMisbehaviour(MsgSubmitMisbehaviour) returns (MsgSubmitMisbehaviourResponse); -} - -// MsgCreateClient defines a message to create an IBC client -message MsgCreateClient { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // light client state - google.protobuf.Any client_state = 1 [(gogoproto.moretags) = "yaml:\"client_state\""]; - // consensus state associated with the client that corresponds to a given - // height. - google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; - // signer address - string signer = 3; -} - -// MsgCreateClientResponse defines the Msg/CreateClient response type. -message MsgCreateClientResponse {} - -// MsgUpdateClient defines an sdk.Msg to update a IBC client state using -// the given header. -message MsgUpdateClient { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // client unique identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // header to update the light client - google.protobuf.Any header = 2; - // signer address - string signer = 3; -} - -// MsgUpdateClientResponse defines the Msg/UpdateClient response type. -message MsgUpdateClientResponse {} - -// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client -// state -message MsgUpgradeClient { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // client unique identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // upgraded client state - google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; - // upgraded consensus state, only contains enough information to serve as a - // basis of trust in update logic - google.protobuf.Any consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; - // proof that old chain committed to new client - bytes proof_upgrade_client = 4 [(gogoproto.moretags) = "yaml:\"proof_upgrade_client\""]; - // proof that old chain committed to new consensus state - bytes proof_upgrade_consensus_state = 5 [(gogoproto.moretags) = "yaml:\"proof_upgrade_consensus_state\""]; - // signer address - string signer = 6; -} - -// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. -message MsgUpgradeClientResponse {} - -// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for -// light client misbehaviour. -message MsgSubmitMisbehaviour { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // client unique identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // misbehaviour used for freezing the light client - google.protobuf.Any misbehaviour = 2; - // signer address - string signer = 3; -} - -// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response -// type. -message MsgSubmitMisbehaviourResponse {} diff --git a/third_party/proto/ibc/core/commitment/v1/commitment.proto b/third_party/proto/ibc/core/commitment/v1/commitment.proto deleted file mode 100644 index f0118b7165..0000000000 --- a/third_party/proto/ibc/core/commitment/v1/commitment.proto +++ /dev/null @@ -1,41 +0,0 @@ -syntax = "proto3"; - -package ibc.core.commitment.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/23-commitment/types"; - -import "gogoproto/gogo.proto"; -import "confio/proofs.proto"; - -// MerkleRoot defines a merkle root hash. -// In the Cosmos SDK, the AppHash of a block header becomes the root. -message MerkleRoot { - option (gogoproto.goproto_getters) = false; - - bytes hash = 1; -} - -// MerklePrefix is merkle path prefixed to the key. -// The constructed key from the Path and the key will be append(Path.KeyPath, -// append(Path.KeyPrefix, key...)) -message MerklePrefix { - bytes key_prefix = 1 [(gogoproto.moretags) = "yaml:\"key_prefix\""]; -} - -// MerklePath is the path used to verify commitment proofs, which can be an -// arbitrary structured object (defined by a commitment type). -// MerklePath is represented from root-to-leaf -message MerklePath { - option (gogoproto.goproto_stringer) = false; - - repeated string key_path = 1 [(gogoproto.moretags) = "yaml:\"key_path\""]; -} - -// MerkleProof is a wrapper type over a chain of CommitmentProofs. -// It demonstrates membership or non-membership for an element or set of -// elements, verifiable in conjunction with a known commitment root. Proofs -// should be succinct. -// MerkleProofs are ordered from leaf-to-root -message MerkleProof { - repeated ics23.CommitmentProof proofs = 1; -} diff --git a/third_party/proto/ibc/core/connection/v1/connection.proto b/third_party/proto/ibc/core/connection/v1/connection.proto deleted file mode 100644 index 7fd2a6909a..0000000000 --- a/third_party/proto/ibc/core/connection/v1/connection.proto +++ /dev/null @@ -1,114 +0,0 @@ -syntax = "proto3"; - -package ibc.core.connection.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types"; - -import "gogoproto/gogo.proto"; -import "ibc/core/commitment/v1/commitment.proto"; - -// ICS03 - Connection Data Structures as defined in -// https://github.com/cosmos/ibc/blob/master/spec/core/ics-003-connection-semantics#data-structures - -// ConnectionEnd defines a stateful object on a chain connected to another -// separate one. -// NOTE: there must only be 2 defined ConnectionEnds to establish -// a connection between two chains. -message ConnectionEnd { - option (gogoproto.goproto_getters) = false; - // client associated with this connection. - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // IBC version which can be utilised to determine encodings or protocols for - // channels or packets utilising this connection. - repeated Version versions = 2; - // current state of the connection end. - State state = 3; - // counterparty chain associated with this connection. - Counterparty counterparty = 4 [(gogoproto.nullable) = false]; - // delay period that must pass before a consensus state can be used for - // packet-verification NOTE: delay period logic is only implemented by some - // clients. - uint64 delay_period = 5 [(gogoproto.moretags) = "yaml:\"delay_period\""]; -} - -// IdentifiedConnection defines a connection with additional connection -// identifier field. -message IdentifiedConnection { - option (gogoproto.goproto_getters) = false; - // connection identifier. - string id = 1 [(gogoproto.moretags) = "yaml:\"id\""]; - // client associated with this connection. - string client_id = 2 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // IBC version which can be utilised to determine encodings or protocols for - // channels or packets utilising this connection - repeated Version versions = 3; - // current state of the connection end. - State state = 4; - // counterparty chain associated with this connection. - Counterparty counterparty = 5 [(gogoproto.nullable) = false]; - // delay period associated with this connection. - uint64 delay_period = 6 [(gogoproto.moretags) = "yaml:\"delay_period\""]; -} - -// State defines if a connection is in one of the following states: -// INIT, TRYOPEN, OPEN or UNINITIALIZED. -enum State { - option (gogoproto.goproto_enum_prefix) = false; - - // Default State - STATE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNINITIALIZED"]; - // A connection end has just started the opening handshake. - STATE_INIT = 1 [(gogoproto.enumvalue_customname) = "INIT"]; - // A connection end has acknowledged the handshake step on the counterparty - // chain. - STATE_TRYOPEN = 2 [(gogoproto.enumvalue_customname) = "TRYOPEN"]; - // A connection end has completed the handshake. - STATE_OPEN = 3 [(gogoproto.enumvalue_customname) = "OPEN"]; -} - -// Counterparty defines the counterparty chain associated with a connection end. -message Counterparty { - option (gogoproto.goproto_getters) = false; - - // identifies the client on the counterparty chain associated with a given - // connection. - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // identifies the connection end on the counterparty chain associated with a - // given connection. - string connection_id = 2 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - // commitment merkle prefix of the counterparty chain. - ibc.core.commitment.v1.MerklePrefix prefix = 3 [(gogoproto.nullable) = false]; -} - -// ClientPaths define all the connection paths for a client state. -message ClientPaths { - // list of connection paths - repeated string paths = 1; -} - -// ConnectionPaths define all the connection paths for a given client state. -message ConnectionPaths { - // client state unique identifier - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // list of connection paths - repeated string paths = 2; -} - -// Version defines the versioning scheme used to negotiate the IBC verison in -// the connection handshake. -message Version { - option (gogoproto.goproto_getters) = false; - - // unique version identifier - string identifier = 1; - // list of features compatible with the specified identifier - repeated string features = 2; -} - -// Params defines the set of Connection parameters. -message Params { - // maximum expected time per block (in nanoseconds), used to enforce block delay. This parameter should reflect the - // largest amount of time that the chain might reasonably take to produce the next block under normal operating - // conditions. A safe choice is 3-5x the expected time per block. - uint64 max_expected_time_per_block = 1 [(gogoproto.moretags) = "yaml:\"max_expected_time_per_block\""]; -} diff --git a/third_party/proto/ibc/core/connection/v1/genesis.proto b/third_party/proto/ibc/core/connection/v1/genesis.proto deleted file mode 100644 index 1a53422c94..0000000000 --- a/third_party/proto/ibc/core/connection/v1/genesis.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; - -package ibc.core.connection.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types"; - -import "gogoproto/gogo.proto"; -import "ibc/core/connection/v1/connection.proto"; - -// GenesisState defines the ibc connection submodule's genesis state. -message GenesisState { - repeated IdentifiedConnection connections = 1 [(gogoproto.nullable) = false]; - repeated ConnectionPaths client_connection_paths = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"client_connection_paths\""]; - // the sequence for the next generated connection identifier - uint64 next_connection_sequence = 3 [(gogoproto.moretags) = "yaml:\"next_connection_sequence\""]; - Params params = 4 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/ibc/core/connection/v1/query.proto b/third_party/proto/ibc/core/connection/v1/query.proto deleted file mode 100644 index f28578f5fc..0000000000 --- a/third_party/proto/ibc/core/connection/v1/query.proto +++ /dev/null @@ -1,138 +0,0 @@ -syntax = "proto3"; - -package ibc.core.connection.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types"; - -import "gogoproto/gogo.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "ibc/core/client/v1/client.proto"; -import "ibc/core/connection/v1/connection.proto"; -import "google/api/annotations.proto"; -import "google/protobuf/any.proto"; - -// Query provides defines the gRPC querier service -service Query { - // Connection queries an IBC connection end. - rpc Connection(QueryConnectionRequest) returns (QueryConnectionResponse) { - option (google.api.http).get = "/ibc/core/connection/v1/connections/{connection_id}"; - } - - // Connections queries all the IBC connections of a chain. - rpc Connections(QueryConnectionsRequest) returns (QueryConnectionsResponse) { - option (google.api.http).get = "/ibc/core/connection/v1/connections"; - } - - // ClientConnections queries the connection paths associated with a client - // state. - rpc ClientConnections(QueryClientConnectionsRequest) returns (QueryClientConnectionsResponse) { - option (google.api.http).get = "/ibc/core/connection/v1/client_connections/{client_id}"; - } - - // ConnectionClientState queries the client state associated with the - // connection. - rpc ConnectionClientState(QueryConnectionClientStateRequest) returns (QueryConnectionClientStateResponse) { - option (google.api.http).get = "/ibc/core/connection/v1/connections/{connection_id}/client_state"; - } - - // ConnectionConsensusState queries the consensus state associated with the - // connection. - rpc ConnectionConsensusState(QueryConnectionConsensusStateRequest) returns (QueryConnectionConsensusStateResponse) { - option (google.api.http).get = "/ibc/core/connection/v1/connections/{connection_id}/consensus_state/" - "revision/{revision_number}/height/{revision_height}"; - } -} - -// QueryConnectionRequest is the request type for the Query/Connection RPC -// method -message QueryConnectionRequest { - // connection unique identifier - string connection_id = 1; -} - -// QueryConnectionResponse is the response type for the Query/Connection RPC -// method. Besides the connection end, it includes a proof and the height from -// which the proof was retrieved. -message QueryConnectionResponse { - // connection associated with the request identifier - ibc.core.connection.v1.ConnectionEnd connection = 1; - // merkle proof of existence - bytes proof = 2; - // height at which the proof was retrieved - ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; -} - -// QueryConnectionsRequest is the request type for the Query/Connections RPC -// method -message QueryConnectionsRequest { - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryConnectionsResponse is the response type for the Query/Connections RPC -// method. -message QueryConnectionsResponse { - // list of stored connections of the chain. - repeated ibc.core.connection.v1.IdentifiedConnection connections = 1; - // pagination response - cosmos.base.query.v1beta1.PageResponse pagination = 2; - // query block height - ibc.core.client.v1.Height height = 3 [(gogoproto.nullable) = false]; -} - -// QueryClientConnectionsRequest is the request type for the -// Query/ClientConnections RPC method -message QueryClientConnectionsRequest { - // client identifier associated with a connection - string client_id = 1; -} - -// QueryClientConnectionsResponse is the response type for the -// Query/ClientConnections RPC method -message QueryClientConnectionsResponse { - // slice of all the connection paths associated with a client. - repeated string connection_paths = 1; - // merkle proof of existence - bytes proof = 2; - // height at which the proof was generated - ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; -} - -// QueryConnectionClientStateRequest is the request type for the -// Query/ConnectionClientState RPC method -message QueryConnectionClientStateRequest { - // connection identifier - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; -} - -// QueryConnectionClientStateResponse is the response type for the -// Query/ConnectionClientState RPC method -message QueryConnectionClientStateResponse { - // client state associated with the channel - ibc.core.client.v1.IdentifiedClientState identified_client_state = 1; - // merkle proof of existence - bytes proof = 2; - // height at which the proof was retrieved - ibc.core.client.v1.Height proof_height = 3 [(gogoproto.nullable) = false]; -} - -// QueryConnectionConsensusStateRequest is the request type for the -// Query/ConnectionConsensusState RPC method -message QueryConnectionConsensusStateRequest { - // connection identifier - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - uint64 revision_number = 2; - uint64 revision_height = 3; -} - -// QueryConnectionConsensusStateResponse is the response type for the -// Query/ConnectionConsensusState RPC method -message QueryConnectionConsensusStateResponse { - // consensus state associated with the channel - google.protobuf.Any consensus_state = 1; - // client ID associated with the consensus state - string client_id = 2; - // merkle proof of existence - bytes proof = 3; - // height at which the proof was retrieved - ibc.core.client.v1.Height proof_height = 4 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/ibc/core/connection/v1/tx.proto b/third_party/proto/ibc/core/connection/v1/tx.proto deleted file mode 100644 index e7e09c84cf..0000000000 --- a/third_party/proto/ibc/core/connection/v1/tx.proto +++ /dev/null @@ -1,119 +0,0 @@ -syntax = "proto3"; - -package ibc.core.connection.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/03-connection/types"; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "ibc/core/client/v1/client.proto"; -import "ibc/core/connection/v1/connection.proto"; - -// Msg defines the ibc/connection Msg service. -service Msg { - // ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. - rpc ConnectionOpenInit(MsgConnectionOpenInit) returns (MsgConnectionOpenInitResponse); - - // ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. - rpc ConnectionOpenTry(MsgConnectionOpenTry) returns (MsgConnectionOpenTryResponse); - - // ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. - rpc ConnectionOpenAck(MsgConnectionOpenAck) returns (MsgConnectionOpenAckResponse); - - // ConnectionOpenConfirm defines a rpc handler method for - // MsgConnectionOpenConfirm. - rpc ConnectionOpenConfirm(MsgConnectionOpenConfirm) returns (MsgConnectionOpenConfirmResponse); -} - -// MsgConnectionOpenInit defines the msg sent by an account on Chain A to -// initialize a connection with Chain B. -message MsgConnectionOpenInit { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - Counterparty counterparty = 2 [(gogoproto.nullable) = false]; - Version version = 3; - uint64 delay_period = 4 [(gogoproto.moretags) = "yaml:\"delay_period\""]; - string signer = 5; -} - -// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response -// type. -message MsgConnectionOpenInitResponse {} - -// MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a -// connection on Chain B. -message MsgConnectionOpenTry { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - // in the case of crossing hello's, when both chains call OpenInit, we need - // the connection identifier of the previous connection in state INIT - string previous_connection_id = 2 [(gogoproto.moretags) = "yaml:\"previous_connection_id\""]; - google.protobuf.Any client_state = 3 [(gogoproto.moretags) = "yaml:\"client_state\""]; - Counterparty counterparty = 4 [(gogoproto.nullable) = false]; - uint64 delay_period = 5 [(gogoproto.moretags) = "yaml:\"delay_period\""]; - repeated Version counterparty_versions = 6 [(gogoproto.moretags) = "yaml:\"counterparty_versions\""]; - ibc.core.client.v1.Height proof_height = 7 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - // proof of the initialization the connection on Chain A: `UNITIALIZED -> - // INIT` - bytes proof_init = 8 [(gogoproto.moretags) = "yaml:\"proof_init\""]; - // proof of client state included in message - bytes proof_client = 9 [(gogoproto.moretags) = "yaml:\"proof_client\""]; - // proof of client consensus state - bytes proof_consensus = 10 [(gogoproto.moretags) = "yaml:\"proof_consensus\""]; - ibc.core.client.v1.Height consensus_height = 11 - [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; - string signer = 12; -} - -// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. -message MsgConnectionOpenTryResponse {} - -// MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to -// acknowledge the change of connection state to TRYOPEN on Chain B. -message MsgConnectionOpenAck { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - string counterparty_connection_id = 2 [(gogoproto.moretags) = "yaml:\"counterparty_connection_id\""]; - Version version = 3; - google.protobuf.Any client_state = 4 [(gogoproto.moretags) = "yaml:\"client_state\""]; - ibc.core.client.v1.Height proof_height = 5 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - // proof of the initialization the connection on Chain B: `UNITIALIZED -> - // TRYOPEN` - bytes proof_try = 6 [(gogoproto.moretags) = "yaml:\"proof_try\""]; - // proof of client state included in message - bytes proof_client = 7 [(gogoproto.moretags) = "yaml:\"proof_client\""]; - // proof of client consensus state - bytes proof_consensus = 8 [(gogoproto.moretags) = "yaml:\"proof_consensus\""]; - ibc.core.client.v1.Height consensus_height = 9 - [(gogoproto.moretags) = "yaml:\"consensus_height\"", (gogoproto.nullable) = false]; - string signer = 10; -} - -// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. -message MsgConnectionOpenAckResponse {} - -// MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to -// acknowledge the change of connection state to OPEN on Chain A. -message MsgConnectionOpenConfirm { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - string connection_id = 1 [(gogoproto.moretags) = "yaml:\"connection_id\""]; - // proof for the change of the connection state on Chain A: `INIT -> OPEN` - bytes proof_ack = 2 [(gogoproto.moretags) = "yaml:\"proof_ack\""]; - ibc.core.client.v1.Height proof_height = 3 - [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; - string signer = 4; -} - -// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm -// response type. -message MsgConnectionOpenConfirmResponse {} diff --git a/third_party/proto/ibc/core/types/v1/genesis.proto b/third_party/proto/ibc/core/types/v1/genesis.proto deleted file mode 100644 index fbddbf3035..0000000000 --- a/third_party/proto/ibc/core/types/v1/genesis.proto +++ /dev/null @@ -1,23 +0,0 @@ -syntax = "proto3"; - -package ibc.core.types.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/types"; - -import "gogoproto/gogo.proto"; -import "ibc/core/client/v1/genesis.proto"; -import "ibc/core/connection/v1/genesis.proto"; -import "ibc/core/channel/v1/genesis.proto"; - -// GenesisState defines the ibc module's genesis state. -message GenesisState { - // ICS002 - Clients genesis state - ibc.core.client.v1.GenesisState client_genesis = 1 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"client_genesis\""]; - // ICS003 - Connections genesis state - ibc.core.connection.v1.GenesisState connection_genesis = 2 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"connection_genesis\""]; - // ICS004 - Channel genesis state - ibc.core.channel.v1.GenesisState channel_genesis = 3 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"channel_genesis\""]; -} diff --git a/third_party/proto/ibc/lightclients/localhost/v1/localhost.proto b/third_party/proto/ibc/lightclients/localhost/v1/localhost.proto deleted file mode 100644 index 4305680154..0000000000 --- a/third_party/proto/ibc/lightclients/localhost/v1/localhost.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; - -package ibc.lightclients.localhost.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/light-clients/09-localhost/types"; - -import "gogoproto/gogo.proto"; -import "ibc/core/client/v1/client.proto"; - -// ClientState defines a loopback (localhost) client. It requires (read-only) -// access to keys outside the client prefix. -message ClientState { - option (gogoproto.goproto_getters) = false; - // self chain ID - string chain_id = 1 [(gogoproto.moretags) = "yaml:\"chain_id\""]; - // self latest block height - ibc.core.client.v1.Height height = 2 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/ibc/lightclients/solomachine/v1/solomachine.proto b/third_party/proto/ibc/lightclients/solomachine/v1/solomachine.proto deleted file mode 100644 index c279f5e728..0000000000 --- a/third_party/proto/ibc/lightclients/solomachine/v1/solomachine.proto +++ /dev/null @@ -1,189 +0,0 @@ -syntax = "proto3"; - -package ibc.lightclients.solomachine.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/core/02-client/legacy/v100"; - -import "ibc/core/connection/v1/connection.proto"; -import "ibc/core/channel/v1/channel.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; - -// ClientState defines a solo machine client that tracks the current consensus -// state and if the client is frozen. -message ClientState { - option (gogoproto.goproto_getters) = false; - // latest sequence of the client state - uint64 sequence = 1; - // frozen sequence of the solo machine - uint64 frozen_sequence = 2 [(gogoproto.moretags) = "yaml:\"frozen_sequence\""]; - ConsensusState consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; - // when set to true, will allow governance to update a solo machine client. - // The client will be unfrozen if it is frozen. - bool allow_update_after_proposal = 4 [(gogoproto.moretags) = "yaml:\"allow_update_after_proposal\""]; -} - -// ConsensusState defines a solo machine consensus state. The sequence of a -// consensus state is contained in the "height" key used in storing the -// consensus state. -message ConsensusState { - option (gogoproto.goproto_getters) = false; - // public key of the solo machine - google.protobuf.Any public_key = 1 [(gogoproto.moretags) = "yaml:\"public_key\""]; - // diversifier allows the same public key to be re-used across different solo - // machine clients (potentially on different chains) without being considered - // misbehaviour. - string diversifier = 2; - uint64 timestamp = 3; -} - -// Header defines a solo machine consensus header -message Header { - option (gogoproto.goproto_getters) = false; - // sequence to update solo machine public key at - uint64 sequence = 1; - uint64 timestamp = 2; - bytes signature = 3; - google.protobuf.Any new_public_key = 4 [(gogoproto.moretags) = "yaml:\"new_public_key\""]; - string new_diversifier = 5 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; -} - -// Misbehaviour defines misbehaviour for a solo machine which consists -// of a sequence and two signatures over different messages at that sequence. -message Misbehaviour { - option (gogoproto.goproto_getters) = false; - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - uint64 sequence = 2; - SignatureAndData signature_one = 3 [(gogoproto.moretags) = "yaml:\"signature_one\""]; - SignatureAndData signature_two = 4 [(gogoproto.moretags) = "yaml:\"signature_two\""]; -} - -// SignatureAndData contains a signature and the data signed over to create that -// signature. -message SignatureAndData { - option (gogoproto.goproto_getters) = false; - bytes signature = 1; - DataType data_type = 2 [(gogoproto.moretags) = "yaml:\"data_type\""]; - bytes data = 3; - uint64 timestamp = 4; -} - -// TimestampedSignatureData contains the signature data and the timestamp of the -// signature. -message TimestampedSignatureData { - option (gogoproto.goproto_getters) = false; - bytes signature_data = 1 [(gogoproto.moretags) = "yaml:\"signature_data\""]; - uint64 timestamp = 2; -} - -// SignBytes defines the signed bytes used for signature verification. -message SignBytes { - option (gogoproto.goproto_getters) = false; - - uint64 sequence = 1; - uint64 timestamp = 2; - string diversifier = 3; - // type of the data used - DataType data_type = 4 [(gogoproto.moretags) = "yaml:\"data_type\""]; - // marshaled data - bytes data = 5; -} - -// DataType defines the type of solo machine proof being created. This is done -// to preserve uniqueness of different data sign byte encodings. -enum DataType { - option (gogoproto.goproto_enum_prefix) = false; - - // Default State - DATA_TYPE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNSPECIFIED"]; - // Data type for client state verification - DATA_TYPE_CLIENT_STATE = 1 [(gogoproto.enumvalue_customname) = "CLIENT"]; - // Data type for consensus state verification - DATA_TYPE_CONSENSUS_STATE = 2 [(gogoproto.enumvalue_customname) = "CONSENSUS"]; - // Data type for connection state verification - DATA_TYPE_CONNECTION_STATE = 3 [(gogoproto.enumvalue_customname) = "CONNECTION"]; - // Data type for channel state verification - DATA_TYPE_CHANNEL_STATE = 4 [(gogoproto.enumvalue_customname) = "CHANNEL"]; - // Data type for packet commitment verification - DATA_TYPE_PACKET_COMMITMENT = 5 [(gogoproto.enumvalue_customname) = "PACKETCOMMITMENT"]; - // Data type for packet acknowledgement verification - DATA_TYPE_PACKET_ACKNOWLEDGEMENT = 6 [(gogoproto.enumvalue_customname) = "PACKETACKNOWLEDGEMENT"]; - // Data type for packet receipt absence verification - DATA_TYPE_PACKET_RECEIPT_ABSENCE = 7 [(gogoproto.enumvalue_customname) = "PACKETRECEIPTABSENCE"]; - // Data type for next sequence recv verification - DATA_TYPE_NEXT_SEQUENCE_RECV = 8 [(gogoproto.enumvalue_customname) = "NEXTSEQUENCERECV"]; - // Data type for header verification - DATA_TYPE_HEADER = 9 [(gogoproto.enumvalue_customname) = "HEADER"]; -} - -// HeaderData returns the SignBytes data for update verification. -message HeaderData { - option (gogoproto.goproto_getters) = false; - - // header public key - google.protobuf.Any new_pub_key = 1 [(gogoproto.moretags) = "yaml:\"new_pub_key\""]; - // header diversifier - string new_diversifier = 2 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; -} - -// ClientStateData returns the SignBytes data for client state verification. -message ClientStateData { - option (gogoproto.goproto_getters) = false; - - bytes path = 1; - google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; -} - -// ConsensusStateData returns the SignBytes data for consensus state -// verification. -message ConsensusStateData { - option (gogoproto.goproto_getters) = false; - - bytes path = 1; - google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; -} - -// ConnectionStateData returns the SignBytes data for connection state -// verification. -message ConnectionStateData { - option (gogoproto.goproto_getters) = false; - - bytes path = 1; - ibc.core.connection.v1.ConnectionEnd connection = 2; -} - -// ChannelStateData returns the SignBytes data for channel state -// verification. -message ChannelStateData { - option (gogoproto.goproto_getters) = false; - - bytes path = 1; - ibc.core.channel.v1.Channel channel = 2; -} - -// PacketCommitmentData returns the SignBytes data for packet commitment -// verification. -message PacketCommitmentData { - bytes path = 1; - bytes commitment = 2; -} - -// PacketAcknowledgementData returns the SignBytes data for acknowledgement -// verification. -message PacketAcknowledgementData { - bytes path = 1; - bytes acknowledgement = 2; -} - -// PacketReceiptAbsenceData returns the SignBytes data for -// packet receipt absence verification. -message PacketReceiptAbsenceData { - bytes path = 1; -} - -// NextSequenceRecvData returns the SignBytes data for verification of the next -// sequence to be received. -message NextSequenceRecvData { - bytes path = 1; - uint64 next_seq_recv = 2 [(gogoproto.moretags) = "yaml:\"next_seq_recv\""]; -} diff --git a/third_party/proto/ibc/lightclients/solomachine/v2/solomachine.proto b/third_party/proto/ibc/lightclients/solomachine/v2/solomachine.proto deleted file mode 100644 index e626c18ac6..0000000000 --- a/third_party/proto/ibc/lightclients/solomachine/v2/solomachine.proto +++ /dev/null @@ -1,189 +0,0 @@ -syntax = "proto3"; - -package ibc.lightclients.solomachine.v2; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/light-clients/06-solomachine/types"; - -import "ibc/core/connection/v1/connection.proto"; -import "ibc/core/channel/v1/channel.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; - -// ClientState defines a solo machine client that tracks the current consensus -// state and if the client is frozen. -message ClientState { - option (gogoproto.goproto_getters) = false; - // latest sequence of the client state - uint64 sequence = 1; - // frozen sequence of the solo machine - bool is_frozen = 2 [(gogoproto.moretags) = "yaml:\"is_frozen\""]; - ConsensusState consensus_state = 3 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; - // when set to true, will allow governance to update a solo machine client. - // The client will be unfrozen if it is frozen. - bool allow_update_after_proposal = 4 [(gogoproto.moretags) = "yaml:\"allow_update_after_proposal\""]; -} - -// ConsensusState defines a solo machine consensus state. The sequence of a -// consensus state is contained in the "height" key used in storing the -// consensus state. -message ConsensusState { - option (gogoproto.goproto_getters) = false; - // public key of the solo machine - google.protobuf.Any public_key = 1 [(gogoproto.moretags) = "yaml:\"public_key\""]; - // diversifier allows the same public key to be re-used across different solo - // machine clients (potentially on different chains) without being considered - // misbehaviour. - string diversifier = 2; - uint64 timestamp = 3; -} - -// Header defines a solo machine consensus header -message Header { - option (gogoproto.goproto_getters) = false; - // sequence to update solo machine public key at - uint64 sequence = 1; - uint64 timestamp = 2; - bytes signature = 3; - google.protobuf.Any new_public_key = 4 [(gogoproto.moretags) = "yaml:\"new_public_key\""]; - string new_diversifier = 5 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; -} - -// Misbehaviour defines misbehaviour for a solo machine which consists -// of a sequence and two signatures over different messages at that sequence. -message Misbehaviour { - option (gogoproto.goproto_getters) = false; - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - uint64 sequence = 2; - SignatureAndData signature_one = 3 [(gogoproto.moretags) = "yaml:\"signature_one\""]; - SignatureAndData signature_two = 4 [(gogoproto.moretags) = "yaml:\"signature_two\""]; -} - -// SignatureAndData contains a signature and the data signed over to create that -// signature. -message SignatureAndData { - option (gogoproto.goproto_getters) = false; - bytes signature = 1; - DataType data_type = 2 [(gogoproto.moretags) = "yaml:\"data_type\""]; - bytes data = 3; - uint64 timestamp = 4; -} - -// TimestampedSignatureData contains the signature data and the timestamp of the -// signature. -message TimestampedSignatureData { - option (gogoproto.goproto_getters) = false; - bytes signature_data = 1 [(gogoproto.moretags) = "yaml:\"signature_data\""]; - uint64 timestamp = 2; -} - -// SignBytes defines the signed bytes used for signature verification. -message SignBytes { - option (gogoproto.goproto_getters) = false; - - uint64 sequence = 1; - uint64 timestamp = 2; - string diversifier = 3; - // type of the data used - DataType data_type = 4 [(gogoproto.moretags) = "yaml:\"data_type\""]; - // marshaled data - bytes data = 5; -} - -// DataType defines the type of solo machine proof being created. This is done -// to preserve uniqueness of different data sign byte encodings. -enum DataType { - option (gogoproto.goproto_enum_prefix) = false; - - // Default State - DATA_TYPE_UNINITIALIZED_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "UNSPECIFIED"]; - // Data type for client state verification - DATA_TYPE_CLIENT_STATE = 1 [(gogoproto.enumvalue_customname) = "CLIENT"]; - // Data type for consensus state verification - DATA_TYPE_CONSENSUS_STATE = 2 [(gogoproto.enumvalue_customname) = "CONSENSUS"]; - // Data type for connection state verification - DATA_TYPE_CONNECTION_STATE = 3 [(gogoproto.enumvalue_customname) = "CONNECTION"]; - // Data type for channel state verification - DATA_TYPE_CHANNEL_STATE = 4 [(gogoproto.enumvalue_customname) = "CHANNEL"]; - // Data type for packet commitment verification - DATA_TYPE_PACKET_COMMITMENT = 5 [(gogoproto.enumvalue_customname) = "PACKETCOMMITMENT"]; - // Data type for packet acknowledgement verification - DATA_TYPE_PACKET_ACKNOWLEDGEMENT = 6 [(gogoproto.enumvalue_customname) = "PACKETACKNOWLEDGEMENT"]; - // Data type for packet receipt absence verification - DATA_TYPE_PACKET_RECEIPT_ABSENCE = 7 [(gogoproto.enumvalue_customname) = "PACKETRECEIPTABSENCE"]; - // Data type for next sequence recv verification - DATA_TYPE_NEXT_SEQUENCE_RECV = 8 [(gogoproto.enumvalue_customname) = "NEXTSEQUENCERECV"]; - // Data type for header verification - DATA_TYPE_HEADER = 9 [(gogoproto.enumvalue_customname) = "HEADER"]; -} - -// HeaderData returns the SignBytes data for update verification. -message HeaderData { - option (gogoproto.goproto_getters) = false; - - // header public key - google.protobuf.Any new_pub_key = 1 [(gogoproto.moretags) = "yaml:\"new_pub_key\""]; - // header diversifier - string new_diversifier = 2 [(gogoproto.moretags) = "yaml:\"new_diversifier\""]; -} - -// ClientStateData returns the SignBytes data for client state verification. -message ClientStateData { - option (gogoproto.goproto_getters) = false; - - bytes path = 1; - google.protobuf.Any client_state = 2 [(gogoproto.moretags) = "yaml:\"client_state\""]; -} - -// ConsensusStateData returns the SignBytes data for consensus state -// verification. -message ConsensusStateData { - option (gogoproto.goproto_getters) = false; - - bytes path = 1; - google.protobuf.Any consensus_state = 2 [(gogoproto.moretags) = "yaml:\"consensus_state\""]; -} - -// ConnectionStateData returns the SignBytes data for connection state -// verification. -message ConnectionStateData { - option (gogoproto.goproto_getters) = false; - - bytes path = 1; - ibc.core.connection.v1.ConnectionEnd connection = 2; -} - -// ChannelStateData returns the SignBytes data for channel state -// verification. -message ChannelStateData { - option (gogoproto.goproto_getters) = false; - - bytes path = 1; - ibc.core.channel.v1.Channel channel = 2; -} - -// PacketCommitmentData returns the SignBytes data for packet commitment -// verification. -message PacketCommitmentData { - bytes path = 1; - bytes commitment = 2; -} - -// PacketAcknowledgementData returns the SignBytes data for acknowledgement -// verification. -message PacketAcknowledgementData { - bytes path = 1; - bytes acknowledgement = 2; -} - -// PacketReceiptAbsenceData returns the SignBytes data for -// packet receipt absence verification. -message PacketReceiptAbsenceData { - bytes path = 1; -} - -// NextSequenceRecvData returns the SignBytes data for verification of the next -// sequence to be received. -message NextSequenceRecvData { - bytes path = 1; - uint64 next_seq_recv = 2 [(gogoproto.moretags) = "yaml:\"next_seq_recv\""]; -} diff --git a/third_party/proto/ibc/lightclients/tendermint/v1/tendermint.proto b/third_party/proto/ibc/lightclients/tendermint/v1/tendermint.proto deleted file mode 100644 index ac39341dbf..0000000000 --- a/third_party/proto/ibc/lightclients/tendermint/v1/tendermint.proto +++ /dev/null @@ -1,115 +0,0 @@ -syntax = "proto3"; - -package ibc.lightclients.tendermint.v1; - -option go_package = "github.com/cosmos/ibc-go/v3/modules/light-clients/07-tendermint/types"; - -import "tendermint/types/validator.proto"; -import "tendermint/types/types.proto"; -import "confio/proofs.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "ibc/core/client/v1/client.proto"; -import "ibc/core/commitment/v1/commitment.proto"; -import "gogoproto/gogo.proto"; - -// ClientState from Tendermint tracks the current validator set, latest height, -// and a possible frozen height. -message ClientState { - option (gogoproto.goproto_getters) = false; - - string chain_id = 1; - Fraction trust_level = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"trust_level\""]; - // duration of the period since the LastestTimestamp during which the - // submitted headers are valid for upgrade - google.protobuf.Duration trusting_period = 3 - [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.moretags) = "yaml:\"trusting_period\""]; - // duration of the staking unbonding period - google.protobuf.Duration unbonding_period = 4 [ - (gogoproto.nullable) = false, - (gogoproto.stdduration) = true, - (gogoproto.moretags) = "yaml:\"unbonding_period\"" - ]; - // defines how much new (untrusted) header's Time can drift into the future. - google.protobuf.Duration max_clock_drift = 5 - [(gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.moretags) = "yaml:\"max_clock_drift\""]; - // Block height when the client was frozen due to a misbehaviour - ibc.core.client.v1.Height frozen_height = 6 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"frozen_height\""]; - // Latest height the client was updated to - ibc.core.client.v1.Height latest_height = 7 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"latest_height\""]; - - // Proof specifications used in verifying counterparty state - repeated ics23.ProofSpec proof_specs = 8 [(gogoproto.moretags) = "yaml:\"proof_specs\""]; - - // Path at which next upgraded client will be committed. - // Each element corresponds to the key for a single CommitmentProof in the - // chained proof. NOTE: ClientState must stored under - // `{upgradePath}/{upgradeHeight}/clientState` ConsensusState must be stored - // under `{upgradepath}/{upgradeHeight}/consensusState` For SDK chains using - // the default upgrade module, upgrade_path should be []string{"upgrade", - // "upgradedIBCState"}` - repeated string upgrade_path = 9 [(gogoproto.moretags) = "yaml:\"upgrade_path\""]; - - // This flag, when set to true, will allow governance to recover a client - // which has expired - bool allow_update_after_expiry = 10 [(gogoproto.moretags) = "yaml:\"allow_update_after_expiry\""]; - // This flag, when set to true, will allow governance to unfreeze a client - // whose chain has experienced a misbehaviour event - bool allow_update_after_misbehaviour = 11 [(gogoproto.moretags) = "yaml:\"allow_update_after_misbehaviour\""]; -} - -// ConsensusState defines the consensus state from Tendermint. -message ConsensusState { - option (gogoproto.goproto_getters) = false; - - // timestamp that corresponds to the block height in which the ConsensusState - // was stored. - google.protobuf.Timestamp timestamp = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - // commitment root (i.e app hash) - ibc.core.commitment.v1.MerkleRoot root = 2 [(gogoproto.nullable) = false]; - bytes next_validators_hash = 3 [ - (gogoproto.casttype) = "github.com/tendermint/tendermint/libs/bytes.HexBytes", - (gogoproto.moretags) = "yaml:\"next_validators_hash\"" - ]; -} - -// Misbehaviour is a wrapper over two conflicting Headers -// that implements Misbehaviour interface expected by ICS-02 -message Misbehaviour { - option (gogoproto.goproto_getters) = false; - - string client_id = 1 [(gogoproto.moretags) = "yaml:\"client_id\""]; - Header header_1 = 2 [(gogoproto.customname) = "Header1", (gogoproto.moretags) = "yaml:\"header_1\""]; - Header header_2 = 3 [(gogoproto.customname) = "Header2", (gogoproto.moretags) = "yaml:\"header_2\""]; -} - -// Header defines the Tendermint client consensus Header. -// It encapsulates all the information necessary to update from a trusted -// Tendermint ConsensusState. The inclusion of TrustedHeight and -// TrustedValidators allows this update to process correctly, so long as the -// ConsensusState for the TrustedHeight exists, this removes race conditions -// among relayers The SignedHeader and ValidatorSet are the new untrusted update -// fields for the client. The TrustedHeight is the height of a stored -// ConsensusState on the client that will be used to verify the new untrusted -// header. The Trusted ConsensusState must be within the unbonding period of -// current time in order to correctly verify, and the TrustedValidators must -// hash to TrustedConsensusState.NextValidatorsHash since that is the last -// trusted validator set at the TrustedHeight. -message Header { - .tendermint.types.SignedHeader signed_header = 1 - [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"signed_header\""]; - - .tendermint.types.ValidatorSet validator_set = 2 [(gogoproto.moretags) = "yaml:\"validator_set\""]; - ibc.core.client.v1.Height trusted_height = 3 - [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"trusted_height\""]; - .tendermint.types.ValidatorSet trusted_validators = 4 [(gogoproto.moretags) = "yaml:\"trusted_validators\""]; -} - -// Fraction defines the protobuf message type for tmmath.Fraction that only -// supports positive values. -message Fraction { - uint64 numerator = 1; - uint64 denominator = 2; -} diff --git a/third_party/proto/ostracon/abci/types.proto b/third_party/proto/ostracon/abci/types.proto index 44e815a0a6..2410ca340c 100644 --- a/third_party/proto/ostracon/abci/types.proto +++ b/third_party/proto/ostracon/abci/types.proto @@ -5,14 +5,16 @@ option go_package = "github.com/line/ostracon/abci/types"; // For more information on gogo.proto, see: // https://github.com/gogo/protobuf/blob/master/extensions.md -import "ostracon/crypto/proof.proto"; +import "tendermint/crypto/proof.proto"; +import "tendermint/types/params.proto"; +import "tendermint/abci/types.proto"; +import "tendermint/types/types.proto"; import "ostracon/types/types.proto"; -import "ostracon/crypto/keys.proto"; -import "ostracon/types/params.proto"; +import "tendermint/crypto/keys.proto"; import "google/protobuf/timestamp.proto"; import "gogoproto/gogo.proto"; -// This file is copied from http://github.com/ostracon/abci +// This file is copied from http://github.com/tendermint/abci // NOTE: When using custom types, mind the warnings. // https://github.com/gogo/protobuf/blob/master/custom_types.md#warnings-and-issues @@ -21,390 +23,115 @@ import "gogoproto/gogo.proto"; message Request { oneof value { - RequestEcho echo = 1; - RequestFlush flush = 2; - RequestInfo info = 3; - RequestSetOption set_option = 4; - RequestInitChain init_chain = 5; - RequestQuery query = 6; - RequestBeginBlock begin_block = 7; - RequestCheckTx check_tx = 8; - RequestDeliverTx deliver_tx = 9; - RequestEndBlock end_block = 10; - RequestCommit commit = 11; - RequestListSnapshots list_snapshots = 12; - RequestOfferSnapshot offer_snapshot = 13; - RequestLoadSnapshotChunk load_snapshot_chunk = 14; - RequestApplySnapshotChunk apply_snapshot_chunk = 15; + tendermint.abci.RequestEcho echo = 1; + tendermint.abci.RequestFlush flush = 2; + tendermint.abci.RequestInfo info = 3; + tendermint.abci.RequestSetOption set_option = 4; + tendermint.abci.RequestInitChain init_chain = 5; + tendermint.abci.RequestQuery query = 6; + RequestBeginBlock begin_block = 7; + tendermint.abci.RequestCheckTx check_tx = 8; + tendermint.abci.RequestDeliverTx deliver_tx = 9; + tendermint.abci.RequestEndBlock end_block = 10; + tendermint.abci.RequestCommit commit = 11; + tendermint.abci.RequestListSnapshots list_snapshots = 12; + tendermint.abci.RequestOfferSnapshot offer_snapshot = 13; + tendermint.abci.RequestLoadSnapshotChunk load_snapshot_chunk = 14; + tendermint.abci.RequestApplySnapshotChunk apply_snapshot_chunk = 15; + RequestBeginRecheckTx begin_recheck_tx = 1000; // 16~99 are reserved for merging original tendermint + RequestEndRecheckTx end_recheck_tx = 1001; } } -message RequestEcho { - string message = 1; -} - -message RequestFlush {} - -message RequestInfo { - string version = 1; - uint64 block_version = 2; - uint64 p2p_version = 3; -} - -// nondeterministic -message RequestSetOption { - string key = 1; - string value = 2; -} - -message RequestInitChain { - google.protobuf.Timestamp time = 1 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - string chain_id = 2; - ConsensusParams consensus_params = 3; - repeated ValidatorUpdate validators = 4 [(gogoproto.nullable) = false]; - bytes app_state_bytes = 5; - int64 initial_height = 6; -} - -message RequestQuery { - bytes data = 1; - string path = 2; - int64 height = 3; - bool prove = 4; -} - message RequestBeginBlock { - bytes hash = 1; - ostracon.types.Header header = 2 [(gogoproto.nullable) = false]; - LastCommitInfo last_commit_info = 3 [(gogoproto.nullable) = false]; - repeated Evidence byzantine_validators = 4 [(gogoproto.nullable) = false]; -} + bytes hash = 1; + tendermint.types.Header header = 2 [(gogoproto.nullable) = false]; + tendermint.abci.LastCommitInfo last_commit_info = 3 [(gogoproto.nullable) = false]; + repeated tendermint.abci.Evidence byzantine_validators = 4 [(gogoproto.nullable) = false]; -enum CheckTxType { - NEW = 0 [(gogoproto.enumvalue_customname) = "New"]; - RECHECK = 1 [(gogoproto.enumvalue_customname) = "Recheck"]; -} - -message RequestCheckTx { - bytes tx = 1; - CheckTxType type = 2; + // *** Ostracon Extended Fields *** + ostracon.types.Entropy entropy = 1000 [(gogoproto.nullable) = false]; } -message RequestDeliverTx { - bytes tx = 1; +message RequestBeginRecheckTx { + tendermint.types.Header header = 1 [(gogoproto.nullable) = false]; } -message RequestEndBlock { +message RequestEndRecheckTx { int64 height = 1; } -message RequestCommit {} - -// lists available snapshots -message RequestListSnapshots { -} - -// offers a snapshot to the application -message RequestOfferSnapshot { - Snapshot snapshot = 1; // snapshot offered by peers - bytes app_hash = 2; // light client-verified app hash for snapshot height -} - -// loads a snapshot chunk -message RequestLoadSnapshotChunk { - uint64 height = 1; - uint32 format = 2; - uint32 chunk = 3; -} - -// Applies a snapshot chunk -message RequestApplySnapshotChunk { - uint32 index = 1; - bytes chunk = 2; - string sender = 3; -} - //---------------------------------------- // Response types message Response { oneof value { - ResponseException exception = 1; - ResponseEcho echo = 2; - ResponseFlush flush = 3; - ResponseInfo info = 4; - ResponseSetOption set_option = 5; - ResponseInitChain init_chain = 6; - ResponseQuery query = 7; - ResponseBeginBlock begin_block = 8; - ResponseCheckTx check_tx = 9; - ResponseDeliverTx deliver_tx = 10; - ResponseEndBlock end_block = 11; - ResponseCommit commit = 12; - ResponseListSnapshots list_snapshots = 13; - ResponseOfferSnapshot offer_snapshot = 14; - ResponseLoadSnapshotChunk load_snapshot_chunk = 15; - ResponseApplySnapshotChunk apply_snapshot_chunk = 16; + tendermint.abci.ResponseException exception = 1; + tendermint.abci.ResponseEcho echo = 2; + tendermint.abci.ResponseFlush flush = 3; + tendermint.abci.ResponseInfo info = 4; + tendermint.abci.ResponseSetOption set_option = 5; + tendermint.abci.ResponseInitChain init_chain = 6; + tendermint.abci.ResponseQuery query = 7; + tendermint.abci.ResponseBeginBlock begin_block = 8; + ResponseCheckTx check_tx = 9; + tendermint.abci.ResponseDeliverTx deliver_tx = 10; + tendermint.abci.ResponseEndBlock end_block = 11; + tendermint.abci.ResponseCommit commit = 12; + tendermint.abci.ResponseListSnapshots list_snapshots = 13; + tendermint.abci.ResponseOfferSnapshot offer_snapshot = 14; + tendermint.abci.ResponseLoadSnapshotChunk load_snapshot_chunk = 15; + tendermint.abci.ResponseApplySnapshotChunk apply_snapshot_chunk = 16; + ResponseBeginRecheckTx begin_recheck_tx = 1000; // 17~99 are reserved for merging original tendermint + ResponseEndRecheckTx end_recheck_tx = 1001; } } -// nondeterministic -message ResponseException { - string error = 1; -} - -message ResponseEcho { - string message = 1; -} - -message ResponseFlush {} - -message ResponseInfo { - string data = 1; - - string version = 2; - uint64 app_version = 3; - - int64 last_block_height = 4; - bytes last_block_app_hash = 5; -} - -// nondeterministic -message ResponseSetOption { - uint32 code = 1; - // bytes data = 2; - string log = 3; - string info = 4; -} - -message ResponseInitChain { - ConsensusParams consensus_params = 1; - repeated ValidatorUpdate validators = 2 [(gogoproto.nullable) = false]; - bytes app_hash = 3; -} - -message ResponseQuery { - uint32 code = 1; - // bytes data = 2; // use "value" instead. - string log = 3; // nondeterministic - string info = 4; // nondeterministic - int64 index = 5; - bytes key = 6; - bytes value = 7; - ostracon.crypto.ProofOps proof_ops = 8; - int64 height = 9; - string codespace = 10; -} - -message ResponseBeginBlock { - repeated Event events = 1 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; -} - message ResponseCheckTx { - uint32 code = 1; - bytes data = 2; - string log = 3; // nondeterministic - string info = 4; // nondeterministic - int64 gas_wanted = 5 [json_name = "gas_wanted"]; - int64 gas_used = 6 [json_name = "gas_used"]; - repeated Event events = 7 + uint32 code = 1; + bytes data = 2; + string log = 3; // nondeterministic + string info = 4; // nondeterministic + int64 gas_wanted = 5 [json_name = "gas_wanted"]; + int64 gas_used = 6 [json_name = "gas_used"]; + repeated tendermint.abci.Event events = 7 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; string codespace = 8; -} + string sender = 9; // MEMO: not used, just reservation to implement https://github.com/tendermint/tendermint/pull/6740 first + int64 priority = 10; // MEMO: not used, just reservation to implement https://github.com/tendermint/tendermint/pull/6740 first -message ResponseDeliverTx { - uint32 code = 1; - bytes data = 2; - string log = 3; // nondeterministic - string info = 4; // nondeterministic - int64 gas_wanted = 5 [json_name = "gas_wanted"]; - int64 gas_used = 6 [json_name = "gas_used"]; - repeated Event events = 7 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; - string codespace = 8; + // mempool_error is set by Ostracon. + // ABCI applictions creating a ResponseCheckTX should not set mempool_error. + string mempool_error = 11; } -message ResponseEndBlock { - repeated ValidatorUpdate validator_updates = 1 - [(gogoproto.nullable) = false]; - ConsensusParams consensus_param_updates = 2; - repeated Event events = 3 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; -} - -message ResponseCommit { - // reserve 1 - bytes data = 2; - int64 retain_height = 3; -} - -message ResponseListSnapshots { - repeated Snapshot snapshots = 1; -} - -message ResponseOfferSnapshot { - Result result = 1; - - enum Result { - UNKNOWN = 0; // Unknown result, abort all snapshot restoration - ACCEPT = 1; // Snapshot accepted, apply chunks - ABORT = 2; // Abort all snapshot restoration - REJECT = 3; // Reject this specific snapshot, try others - REJECT_FORMAT = 4; // Reject all snapshots of this format, try others - REJECT_SENDER = 5; // Reject all snapshots from the sender(s), try others - } -} - -message ResponseLoadSnapshotChunk { - bytes chunk = 1; -} - -message ResponseApplySnapshotChunk { - Result result = 1; - repeated uint32 refetch_chunks = 2; // Chunks to refetch and reapply - repeated string reject_senders = 3; // Chunk senders to reject and ban - - enum Result { - UNKNOWN = 0; // Unknown result, abort all snapshot restoration - ACCEPT = 1; // Chunk successfully accepted - ABORT = 2; // Abort all snapshot restoration - RETRY = 3; // Retry chunk (combine with refetch and reject) - RETRY_SNAPSHOT = 4; // Retry snapshot (combine with refetch and reject) - REJECT_SNAPSHOT = 5; // Reject this snapshot, try others - } -} - -//---------------------------------------- -// Misc. - -// ConsensusParams contains all consensus-relevant parameters -// that can be adjusted by the abci app -message ConsensusParams { - BlockParams block = 1; - ostracon.types.EvidenceParams evidence = 2; - ostracon.types.ValidatorParams validator = 3; - ostracon.types.VersionParams version = 4; -} - -// BlockParams contains limits on the block size. -message BlockParams { - // Note: must be greater than 0 - int64 max_bytes = 1; - // Note: must be greater or equal to -1 - int64 max_gas = 2; -} - -message LastCommitInfo { - int32 round = 1; - repeated VoteInfo votes = 2 [(gogoproto.nullable) = false]; -} - -// Event allows application developers to attach additional information to -// ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. -// Later, transactions may be queried using these events. -message Event { - string type = 1; - repeated EventAttribute attributes = 2 [ - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "attributes,omitempty" - ]; -} - -// EventAttribute is a single key-value pair, associated with an event. -message EventAttribute { - bytes key = 1; - bytes value = 2; - bool index = 3; // nondeterministic -} - -// TxResult contains results of executing the transaction. -// -// One usage is indexing transaction results. -message TxResult { - int64 height = 1; - uint32 index = 2; - bytes tx = 3; - ResponseDeliverTx result = 4 [(gogoproto.nullable) = false]; -} - -//---------------------------------------- -// Blockchain Types - -// Validator -message Validator { - bytes address = 1; // The first 20 bytes of SHA256(public key) - // PubKey pub_key = 2 [(gogoproto.nullable)=false]; - int64 power = 3; // The voting power - - // *** Ostracon Extended Fields *** - int64 voting_weight = 1000; // The voting weight -} - -// ValidatorUpdate -message ValidatorUpdate { - ostracon.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; - int64 power = 2; -} - -// VoteInfo -message VoteInfo { - Validator validator = 1 [(gogoproto.nullable) = false]; - bool signed_last_block = 2; -} - -enum EvidenceType { - UNKNOWN = 0; - DUPLICATE_VOTE = 1; - LIGHT_CLIENT_ATTACK = 2; -} - -message Evidence { - EvidenceType type = 1; - // The offending validator - Validator validator = 2 [(gogoproto.nullable) = false]; - // The height when the offense occurred - int64 height = 3; - // The corresponding time where the offense occurred - google.protobuf.Timestamp time = 4 [ - (gogoproto.nullable) = false, - (gogoproto.stdtime) = true - ]; - // Total voting power of the validator set in case the ABCI application does - // not store historical validators. - // https://github.com/tendermint/tendermint/issues/4581 - int64 total_voting_power = 5; +message ResponseBeginRecheckTx { + uint32 code = 1; } -//---------------------------------------- -// State Sync Types - -message Snapshot { - uint64 height = 1; // The height at which the snapshot was taken - uint32 format = 2; // The application-specific snapshot format - uint32 chunks = 3; // Number of chunks in the snapshot - bytes hash = 4; // Arbitrary snapshot hash, equal only if identical - bytes metadata = 5; // Arbitrary application metadata +message ResponseEndRecheckTx { + uint32 code = 1; } //---------------------------------------- // Service Definition service ABCIApplication { - rpc Echo(RequestEcho) returns (ResponseEcho); - rpc Flush(RequestFlush) returns (ResponseFlush); - rpc Info(RequestInfo) returns (ResponseInfo); - rpc SetOption(RequestSetOption) returns (ResponseSetOption); - rpc DeliverTx(RequestDeliverTx) returns (ResponseDeliverTx); - rpc CheckTx(RequestCheckTx) returns (ResponseCheckTx); - rpc Query(RequestQuery) returns (ResponseQuery); - rpc Commit(RequestCommit) returns (ResponseCommit); - rpc InitChain(RequestInitChain) returns (ResponseInitChain); - rpc BeginBlock(RequestBeginBlock) returns (ResponseBeginBlock); - rpc EndBlock(RequestEndBlock) returns (ResponseEndBlock); - rpc ListSnapshots(RequestListSnapshots) returns (ResponseListSnapshots); - rpc OfferSnapshot(RequestOfferSnapshot) returns (ResponseOfferSnapshot); - rpc LoadSnapshotChunk(RequestLoadSnapshotChunk) returns (ResponseLoadSnapshotChunk); - rpc ApplySnapshotChunk(RequestApplySnapshotChunk) returns (ResponseApplySnapshotChunk); -} \ No newline at end of file + rpc Echo(tendermint.abci.RequestEcho) returns (tendermint.abci.ResponseEcho); + rpc Flush(tendermint.abci.RequestFlush) returns (tendermint.abci.ResponseFlush); + rpc Info(tendermint.abci.RequestInfo) returns (tendermint.abci.ResponseInfo); + rpc SetOption(tendermint.abci.RequestSetOption) returns (tendermint.abci.ResponseSetOption); + rpc DeliverTx(tendermint.abci.RequestDeliverTx) returns (tendermint.abci.ResponseDeliverTx); + rpc CheckTx(tendermint.abci.RequestCheckTx) returns (ResponseCheckTx); + rpc Query(tendermint.abci.RequestQuery) returns (tendermint.abci.ResponseQuery); + rpc Commit(tendermint.abci.RequestCommit) returns (tendermint.abci.ResponseCommit); + rpc InitChain(tendermint.abci.RequestInitChain) returns (tendermint.abci.ResponseInitChain); + rpc BeginBlock(RequestBeginBlock) returns (tendermint.abci.ResponseBeginBlock); + rpc EndBlock(tendermint.abci.RequestEndBlock) returns (tendermint.abci.ResponseEndBlock); + rpc ListSnapshots(tendermint.abci.RequestListSnapshots) returns (tendermint.abci.ResponseListSnapshots); + rpc OfferSnapshot(tendermint.abci.RequestOfferSnapshot) returns (tendermint.abci.ResponseOfferSnapshot); + rpc LoadSnapshotChunk(tendermint.abci.RequestLoadSnapshotChunk) returns (tendermint.abci.ResponseLoadSnapshotChunk); + rpc ApplySnapshotChunk(tendermint.abci.RequestApplySnapshotChunk) returns (tendermint.abci.ResponseApplySnapshotChunk); + rpc BeginRecheckTx(RequestBeginRecheckTx) returns (ResponseBeginRecheckTx); + rpc EndRecheckTx(RequestEndRecheckTx) returns (ResponseEndRecheckTx); +} diff --git a/third_party/proto/ostracon/crypto/keys.proto b/third_party/proto/ostracon/crypto/keys.proto deleted file mode 100644 index c375549cb2..0000000000 --- a/third_party/proto/ostracon/crypto/keys.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; -package ostracon.crypto; - -option go_package = "github.com/line/ostracon/proto/ostracon/crypto"; - -import "gogoproto/gogo.proto"; - -// PublicKey defines the keys available for use with Ostracon Validators -message PublicKey { - option (gogoproto.compare) = true; - option (gogoproto.equal) = true; - - oneof sum { - bytes ed25519 = 1; - bytes secp256k1 = 2; - } -} diff --git a/third_party/proto/ostracon/crypto/proof.proto b/third_party/proto/ostracon/crypto/proof.proto deleted file mode 100644 index 7ea7b277f7..0000000000 --- a/third_party/proto/ostracon/crypto/proof.proto +++ /dev/null @@ -1,41 +0,0 @@ -syntax = "proto3"; -package ostracon.crypto; - -option go_package = "github.com/line/ostracon/proto/ostracon/crypto"; - -import "gogoproto/gogo.proto"; - -message Proof { - int64 total = 1; - int64 index = 2; - bytes leaf_hash = 3; - repeated bytes aunts = 4; -} - -message ValueOp { - // Encoded in ProofOp.Key. - bytes key = 1; - - // To encode in ProofOp.Data - Proof proof = 2; -} - -message DominoOp { - string key = 1; - string input = 2; - string output = 3; -} - -// ProofOp defines an operation used for calculating Merkle root -// The data could be arbitrary format, providing nessecary data -// for example neighbouring node hash -message ProofOp { - string type = 1; - bytes key = 2; - bytes data = 3; -} - -// ProofOps is Merkle proof defined by the list of ProofOps -message ProofOps { - repeated ProofOp ops = 1 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/ostracon/libs/bits/types.proto b/third_party/proto/ostracon/libs/bits/types.proto deleted file mode 100644 index bead2db26f..0000000000 --- a/third_party/proto/ostracon/libs/bits/types.proto +++ /dev/null @@ -1,9 +0,0 @@ -syntax = "proto3"; -package ostracon.libs.bits; - -option go_package = "github.com/line/ostracon/proto/ostracon/libs/bits"; - -message BitArray { - int64 bits = 1; - repeated uint64 elems = 2; -} diff --git a/third_party/proto/ostracon/p2p/types.proto b/third_party/proto/ostracon/p2p/types.proto deleted file mode 100644 index 4db1912637..0000000000 --- a/third_party/proto/ostracon/p2p/types.proto +++ /dev/null @@ -1,34 +0,0 @@ -syntax = "proto3"; -package ostracon.p2p; - -option go_package = "github.com/line/ostracon/proto/ostracon/p2p"; - -import "gogoproto/gogo.proto"; - -message NetAddress { - string id = 1 [(gogoproto.customname) = "ID"]; - string ip = 2 [(gogoproto.customname) = "IP"]; - uint32 port = 3; -} - -message ProtocolVersion { - uint64 p2p = 1 [(gogoproto.customname) = "P2P"]; - uint64 block = 2; - uint64 app = 3; -} - -message DefaultNodeInfo { - ProtocolVersion protocol_version = 1 [(gogoproto.nullable) = false]; - string default_node_id = 2 [(gogoproto.customname) = "DefaultNodeID"]; - string listen_addr = 3; - string network = 4; - string version = 5; - bytes channels = 6; - string moniker = 7; - DefaultNodeInfoOther other = 8 [(gogoproto.nullable) = false]; -} - -message DefaultNodeInfoOther { - string tx_index = 1; - string rpc_address = 2 [(gogoproto.customname) = "RPCAddress"]; -} diff --git a/third_party/proto/ostracon/types/block.proto b/third_party/proto/ostracon/types/block.proto index 96c19fd8b3..525b00e504 100644 --- a/third_party/proto/ostracon/types/block.proto +++ b/third_party/proto/ostracon/types/block.proto @@ -5,11 +5,15 @@ option go_package = "github.com/line/ostracon/proto/ostracon/types"; import "gogoproto/gogo.proto"; import "ostracon/types/types.proto"; -import "ostracon/types/evidence.proto"; +import "tendermint/types/evidence.proto"; +import "tendermint/types/types.proto"; message Block { - Header header = 1 [(gogoproto.nullable) = false]; - Data data = 2 [(gogoproto.nullable) = false]; - ostracon.types.EvidenceList evidence = 3 [(gogoproto.nullable) = false]; - Commit last_commit = 4; + tendermint.types.Header header = 1 [(gogoproto.nullable) = false]; + tendermint.types.Data data = 2 [(gogoproto.nullable) = false]; + tendermint.types.EvidenceList evidence = 3 [(gogoproto.nullable) = false]; + tendermint.types.Commit last_commit = 4; + + // *** Ostracon Extended Fields *** + ostracon.types.Entropy entropy = 1000 [(gogoproto.nullable) = false]; } diff --git a/third_party/proto/ostracon/types/evidence.proto b/third_party/proto/ostracon/types/evidence.proto deleted file mode 100644 index e88f969bfa..0000000000 --- a/third_party/proto/ostracon/types/evidence.proto +++ /dev/null @@ -1,41 +0,0 @@ -syntax = "proto3"; -package ostracon.types; - -option go_package = "github.com/line/ostracon/proto/ostracon/types"; - -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; -import "ostracon/types/types.proto"; -import "ostracon/types/validator.proto"; - -message Evidence { - oneof sum { - DuplicateVoteEvidence duplicate_vote_evidence = 1; - LightClientAttackEvidence light_client_attack_evidence = 2; - } -} - -// DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. -message DuplicateVoteEvidence { - ostracon.types.Vote vote_a = 1; - ostracon.types.Vote vote_b = 2; - int64 total_voting_power = 3; // total voting weight - int64 validator_power = 4; // voting power - google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - - // *** Ostracon Extended Fields *** - int64 voting_weight = 1000; -} - -// LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. -message LightClientAttackEvidence { - ostracon.types.LightBlock conflicting_block = 1; - int64 common_height = 2; - repeated ostracon.types.Validator byzantine_validators = 3; - int64 total_voting_power = 4; // total voting weight - google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; -} - -message EvidenceList { - repeated Evidence evidence = 1 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/ostracon/types/params.proto b/third_party/proto/ostracon/types/params.proto deleted file mode 100644 index 37f39b47b1..0000000000 --- a/third_party/proto/ostracon/types/params.proto +++ /dev/null @@ -1,80 +0,0 @@ -syntax = "proto3"; -package ostracon.types; - -option go_package = "github.com/line/ostracon/proto/ostracon/types"; - -import "gogoproto/gogo.proto"; -import "google/protobuf/duration.proto"; - -option (gogoproto.equal_all) = true; - -// ConsensusParams contains consensus critical parameters that determine the -// validity of blocks. -message ConsensusParams { - BlockParams block = 1 [(gogoproto.nullable) = false]; - EvidenceParams evidence = 2 [(gogoproto.nullable) = false]; - ValidatorParams validator = 3 [(gogoproto.nullable) = false]; - VersionParams version = 4 [(gogoproto.nullable) = false]; -} - -// BlockParams contains limits on the block size. -message BlockParams { - // Max block size, in bytes. - // Note: must be greater than 0 - int64 max_bytes = 1; - // Max gas per block. - // Note: must be greater or equal to -1 - int64 max_gas = 2; - // Minimum time increment between consecutive blocks (in milliseconds) If the - // block header timestamp is ahead of the system clock, decrease this value. - // - // Not exposed to the application. - int64 time_iota_ms = 3; -} - -// EvidenceParams determine how we handle evidence of malfeasance. -message EvidenceParams { - // Max age of evidence, in blocks. - // - // The basic formula for calculating this is: MaxAgeDuration / {average block - // time}. - int64 max_age_num_blocks = 1; - - // Max age of evidence, in time. - // - // It should correspond with an app's "unbonding period" or other similar - // mechanism for handling [Nothing-At-Stake - // attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). - google.protobuf.Duration max_age_duration = 2 - [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; - - // This sets the maximum size of total evidence in bytes that can be committed in a single block. - // and should fall comfortably under the max block bytes. - // Default is 1048576 or 1MB - int64 max_bytes = 3; -} - -// ValidatorParams restrict the public key types validators can use. -// NOTE: uses ABCI pubkey naming, not Amino names. -message ValidatorParams { - option (gogoproto.populate) = true; - option (gogoproto.equal) = true; - - repeated string pub_key_types = 1; -} - -// VersionParams contains the ABCI application version. -message VersionParams { - option (gogoproto.populate) = true; - option (gogoproto.equal) = true; - - uint64 app_version = 1; -} - -// HashedParams is a subset of ConsensusParams. -// -// It is hashed into the Header.ConsensusHash. -message HashedParams { - int64 block_max_bytes = 1; - int64 block_max_gas = 2; -} diff --git a/third_party/proto/ostracon/types/types.proto b/third_party/proto/ostracon/types/types.proto index d3310f66b3..c1452df114 100644 --- a/third_party/proto/ostracon/types/types.proto +++ b/third_party/proto/ostracon/types/types.proto @@ -3,155 +3,12 @@ package ostracon.types; option go_package = "github.com/line/ostracon/proto/ostracon/types"; -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; -import "ostracon/crypto/proof.proto"; -import "ostracon/version/types.proto"; -import "ostracon/types/validator.proto"; - -// BlockIdFlag indicates which BlcokID the signature is for -enum BlockIDFlag { - option (gogoproto.goproto_enum_stringer) = true; - option (gogoproto.goproto_enum_prefix) = false; - - BLOCK_ID_FLAG_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "BlockIDFlagUnknown"]; - BLOCK_ID_FLAG_ABSENT = 1 [(gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"]; - BLOCK_ID_FLAG_COMMIT = 2 [(gogoproto.enumvalue_customname) = "BlockIDFlagCommit"]; - BLOCK_ID_FLAG_NIL = 3 [(gogoproto.enumvalue_customname) = "BlockIDFlagNil"]; -} - -// SignedMsgType is a type of signed message in the consensus. -enum SignedMsgType { - option (gogoproto.goproto_enum_stringer) = true; - option (gogoproto.goproto_enum_prefix) = false; - - SIGNED_MSG_TYPE_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "UnknownType"]; - // Votes - SIGNED_MSG_TYPE_PREVOTE = 1 [(gogoproto.enumvalue_customname) = "PrevoteType"]; - SIGNED_MSG_TYPE_PRECOMMIT = 2 [(gogoproto.enumvalue_customname) = "PrecommitType"]; - - // Proposals - SIGNED_MSG_TYPE_PROPOSAL = 32 [(gogoproto.enumvalue_customname) = "ProposalType"]; -} - -// PartsetHeader -message PartSetHeader { - uint32 total = 1; - bytes hash = 2; -} - -message Part { - uint32 index = 1; - bytes bytes = 2; - ostracon.crypto.Proof proof = 3 [(gogoproto.nullable) = false]; -} - -// BlockID -message BlockID { - bytes hash = 1; - PartSetHeader part_set_header = 2 [(gogoproto.nullable) = false]; -} - // -------------------------------- -// Header defines the structure of a Tendermint block header. -message Header { - // basic block info - ostracon.version.Consensus version = 1 [(gogoproto.nullable) = false]; - string chain_id = 2 [(gogoproto.customname) = "ChainID"]; - int64 height = 3; - google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - - // prev block info - BlockID last_block_id = 5 [(gogoproto.nullable) = false]; - - // hashes of block data - bytes last_commit_hash = 6; // commit from validators from the last block - bytes data_hash = 7; // transactions - - // hashes from the app output from the prev block - bytes validators_hash = 8; // validators for the current block - bytes next_validators_hash = 9; // validators for the next block - bytes consensus_hash = 10; // consensus params for current block - bytes app_hash = 11; // state after txs from the previous block - bytes last_results_hash = 12; // root hash of all results from the txs from the previous block - - // consensus info - bytes evidence_hash = 13; // evidence included in the block - bytes proposer_address = 14; // original proposer of the block -} - -// Data contains the set of transactions included in the block -message Data { - // Txs that will be applied by state @ block.Height+1. - // NOTE: not all txs here are valid. We're just agreeing on the order first. - // This means that block.AppHash does not include these txs. - repeated bytes txs = 1; -} - -// Vote represents a prevote, precommit, or commit vote from validators for -// consensus. -message Vote { - SignedMsgType type = 1; - int64 height = 2; - int32 round = 3; - BlockID block_id = 4 - [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil. - google.protobuf.Timestamp timestamp = 5 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - bytes validator_address = 6; - int32 validator_index = 7; - bytes signature = 8; -} - -// Commit contains the evidence that a block was committed by a set of validators. -message Commit { - int64 height = 1; - int32 round = 2; - BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; - repeated CommitSig signatures = 4 [(gogoproto.nullable) = false]; -} - -// CommitSig is a part of the Vote included in a Commit. -message CommitSig { - BlockIDFlag block_id_flag = 1; - bytes validator_address = 2; - google.protobuf.Timestamp timestamp = 3 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - bytes signature = 4; -} - -message Proposal { - SignedMsgType type = 1; - int64 height = 2; - int32 round = 3; - int32 pol_round = 4; - BlockID block_id = 5 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; - google.protobuf.Timestamp timestamp = 6 - [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; - bytes signature = 7; -} - -message SignedHeader { - Header header = 1; - Commit commit = 2; -} - -message LightBlock { - SignedHeader signed_header = 1; - ostracon.types.ValidatorSet validator_set = 2; -} - -message BlockMeta { - BlockID block_id = 1 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; - int64 block_size = 2; - Header header = 3 [(gogoproto.nullable) = false]; - int64 num_txs = 4; -} - -// TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. -message TxProof { - bytes root_hash = 1; - bytes data = 2; - ostracon.crypto.Proof proof = 3; +// Entropy represents height-specific complexity and used in proposer-election. +// Entropy contains vrf proof and generated round. The relationship of each field is as follows. +// Entropy.proof = VRFProof(last_proof_hash, current_height, Entropy.round) +message Entropy { + int32 round = 1; + bytes proof = 2; } diff --git a/third_party/proto/ostracon/types/validator.proto b/third_party/proto/ostracon/types/validator.proto deleted file mode 100644 index 378bde5ce8..0000000000 --- a/third_party/proto/ostracon/types/validator.proto +++ /dev/null @@ -1,28 +0,0 @@ -syntax = "proto3"; -package ostracon.types; - -option go_package = "github.com/line/ostracon/proto/ostracon/types"; - -import "gogoproto/gogo.proto"; -import "ostracon/crypto/keys.proto"; - -message ValidatorSet { - repeated Validator validators = 1; - Validator proposer = 2; - int64 total_voting_power = 3; -} - -message Validator { - bytes address = 1; - ostracon.crypto.PublicKey pub_key = 2 [(gogoproto.nullable) = false]; - int64 voting_power = 3; - int64 proposer_priority = 4; - - // *** Ostracon Extended Fields *** - int64 voting_weight = 1000; -} - -message SimpleValidator { - ostracon.crypto.PublicKey pub_key = 1; - int64 voting_power = 2; -} diff --git a/third_party/proto/ostracon/types/voter.proto b/third_party/proto/ostracon/types/voter.proto deleted file mode 100644 index 648ceca414..0000000000 --- a/third_party/proto/ostracon/types/voter.proto +++ /dev/null @@ -1,11 +0,0 @@ -syntax = "proto3"; -package ostracon.types; - -option go_package = "github.com/line/ostracon/proto/ostracon/types"; - -import "ostracon/types/validator.proto"; - -message VoterSet { - repeated ostracon.types.Validator voters = 1; - int64 total_voting_weight = 2; -} diff --git a/third_party/proto/tendermint/blockchain/types.pb.go b/third_party/proto/tendermint/blockchain/types.pb.go deleted file mode 100644 index a06ee8a155..0000000000 --- a/third_party/proto/tendermint/blockchain/types.pb.go +++ /dev/null @@ -1,1571 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: tendermint/blockchain/types.proto - -package blockchain - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - proto "github.com/gogo/protobuf/proto" - - types "github.com/line/ostracon/proto/ostracon/types" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal - -var ( - _ = fmt.Errorf - _ = 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 - -// BlockRequest requests a block for a specific height -type BlockRequest struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` -} - -func (m *BlockRequest) Reset() { *m = BlockRequest{} } -func (m *BlockRequest) String() string { return proto.CompactTextString(m) } -func (*BlockRequest) ProtoMessage() {} -func (*BlockRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2927480384e78499, []int{0} -} - -func (m *BlockRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *BlockRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BlockRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *BlockRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockRequest.Merge(m, src) -} - -func (m *BlockRequest) XXX_Size() int { - return m.Size() -} - -func (m *BlockRequest) XXX_DiscardUnknown() { - xxx_messageInfo_BlockRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockRequest proto.InternalMessageInfo - -func (m *BlockRequest) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -// NoBlockResponse informs the node that the peer does not have block at the requested height -type NoBlockResponse struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` -} - -func (m *NoBlockResponse) Reset() { *m = NoBlockResponse{} } -func (m *NoBlockResponse) String() string { return proto.CompactTextString(m) } -func (*NoBlockResponse) ProtoMessage() {} -func (*NoBlockResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2927480384e78499, []int{1} -} - -func (m *NoBlockResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *NoBlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NoBlockResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *NoBlockResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_NoBlockResponse.Merge(m, src) -} - -func (m *NoBlockResponse) XXX_Size() int { - return m.Size() -} - -func (m *NoBlockResponse) XXX_DiscardUnknown() { - xxx_messageInfo_NoBlockResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_NoBlockResponse proto.InternalMessageInfo - -func (m *NoBlockResponse) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -// BlockResponse returns block to the requested -type BlockResponse struct { - Block *types.Block `protobuf:"bytes,1,opt,name=block,proto3" json:"block,omitempty"` -} - -func (m *BlockResponse) Reset() { *m = BlockResponse{} } -func (m *BlockResponse) String() string { return proto.CompactTextString(m) } -func (*BlockResponse) ProtoMessage() {} -func (*BlockResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2927480384e78499, []int{2} -} - -func (m *BlockResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *BlockResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BlockResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *BlockResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockResponse.Merge(m, src) -} - -func (m *BlockResponse) XXX_Size() int { - return m.Size() -} - -func (m *BlockResponse) XXX_DiscardUnknown() { - xxx_messageInfo_BlockResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockResponse proto.InternalMessageInfo - -func (m *BlockResponse) GetBlock() *types.Block { - if m != nil { - return m.Block - } - return nil -} - -// StatusRequest requests the status of a peer. -type StatusRequest struct{} - -func (m *StatusRequest) Reset() { *m = StatusRequest{} } -func (m *StatusRequest) String() string { return proto.CompactTextString(m) } -func (*StatusRequest) ProtoMessage() {} -func (*StatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_2927480384e78499, []int{3} -} - -func (m *StatusRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *StatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StatusRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *StatusRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_StatusRequest.Merge(m, src) -} - -func (m *StatusRequest) XXX_Size() int { - return m.Size() -} - -func (m *StatusRequest) XXX_DiscardUnknown() { - xxx_messageInfo_StatusRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_StatusRequest proto.InternalMessageInfo - -// StatusResponse is a peer response to inform their status. -type StatusResponse struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Base int64 `protobuf:"varint,2,opt,name=base,proto3" json:"base,omitempty"` -} - -func (m *StatusResponse) Reset() { *m = StatusResponse{} } -func (m *StatusResponse) String() string { return proto.CompactTextString(m) } -func (*StatusResponse) ProtoMessage() {} -func (*StatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_2927480384e78499, []int{4} -} - -func (m *StatusResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *StatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_StatusResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *StatusResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_StatusResponse.Merge(m, src) -} - -func (m *StatusResponse) XXX_Size() int { - return m.Size() -} - -func (m *StatusResponse) XXX_DiscardUnknown() { - xxx_messageInfo_StatusResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_StatusResponse proto.InternalMessageInfo - -func (m *StatusResponse) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *StatusResponse) GetBase() int64 { - if m != nil { - return m.Base - } - return 0 -} - -type Message struct { - // Types that are valid to be assigned to Sum: - // *Message_BlockRequest - // *Message_NoBlockResponse - // *Message_BlockResponse - // *Message_StatusRequest - // *Message_StatusResponse - Sum isMessage_Sum `protobuf_oneof:"sum"` -} - -func (m *Message) Reset() { *m = Message{} } -func (m *Message) String() string { return proto.CompactTextString(m) } -func (*Message) ProtoMessage() {} -func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_2927480384e78499, []int{5} -} - -func (m *Message) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Message.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *Message) XXX_Merge(src proto.Message) { - xxx_messageInfo_Message.Merge(m, src) -} - -func (m *Message) XXX_Size() int { - return m.Size() -} - -func (m *Message) XXX_DiscardUnknown() { - xxx_messageInfo_Message.DiscardUnknown(m) -} - -var xxx_messageInfo_Message proto.InternalMessageInfo - -type isMessage_Sum interface { - isMessage_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type Message_BlockRequest struct { - BlockRequest *BlockRequest `protobuf:"bytes,1,opt,name=block_request,json=blockRequest,proto3,oneof" json:"block_request,omitempty"` -} -type Message_NoBlockResponse struct { - NoBlockResponse *NoBlockResponse `protobuf:"bytes,2,opt,name=no_block_response,json=noBlockResponse,proto3,oneof" json:"no_block_response,omitempty"` -} -type Message_BlockResponse struct { - BlockResponse *BlockResponse `protobuf:"bytes,3,opt,name=block_response,json=blockResponse,proto3,oneof" json:"block_response,omitempty"` -} -type Message_StatusRequest struct { - StatusRequest *StatusRequest `protobuf:"bytes,4,opt,name=status_request,json=statusRequest,proto3,oneof" json:"status_request,omitempty"` -} -type Message_StatusResponse struct { - StatusResponse *StatusResponse `protobuf:"bytes,5,opt,name=status_response,json=statusResponse,proto3,oneof" json:"status_response,omitempty"` -} - -func (*Message_BlockRequest) isMessage_Sum() {} -func (*Message_NoBlockResponse) isMessage_Sum() {} -func (*Message_BlockResponse) isMessage_Sum() {} -func (*Message_StatusRequest) isMessage_Sum() {} -func (*Message_StatusResponse) isMessage_Sum() {} - -func (m *Message) GetSum() isMessage_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *Message) GetBlockRequest() *BlockRequest { - if x, ok := m.GetSum().(*Message_BlockRequest); ok { - return x.BlockRequest - } - return nil -} - -func (m *Message) GetNoBlockResponse() *NoBlockResponse { - if x, ok := m.GetSum().(*Message_NoBlockResponse); ok { - return x.NoBlockResponse - } - return nil -} - -func (m *Message) GetBlockResponse() *BlockResponse { - if x, ok := m.GetSum().(*Message_BlockResponse); ok { - return x.BlockResponse - } - return nil -} - -func (m *Message) GetStatusRequest() *StatusRequest { - if x, ok := m.GetSum().(*Message_StatusRequest); ok { - return x.StatusRequest - } - return nil -} - -func (m *Message) GetStatusResponse() *StatusResponse { - if x, ok := m.GetSum().(*Message_StatusResponse); ok { - return x.StatusResponse - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Message) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Message_BlockRequest)(nil), - (*Message_NoBlockResponse)(nil), - (*Message_BlockResponse)(nil), - (*Message_StatusRequest)(nil), - (*Message_StatusResponse)(nil), - } -} - -func init() { - proto.RegisterType((*BlockRequest)(nil), "tendermint.blockchain.BlockRequest") - proto.RegisterType((*NoBlockResponse)(nil), "tendermint.blockchain.NoBlockResponse") - proto.RegisterType((*BlockResponse)(nil), "tendermint.blockchain.BlockResponse") - proto.RegisterType((*StatusRequest)(nil), "tendermint.blockchain.StatusRequest") - proto.RegisterType((*StatusResponse)(nil), "tendermint.blockchain.StatusResponse") - proto.RegisterType((*Message)(nil), "tendermint.blockchain.Message") -} - -func init() { proto.RegisterFile("tendermint/blockchain/types.proto", fileDescriptor_2927480384e78499) } - -var fileDescriptor_2927480384e78499 = []byte{ - // 370 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x93, 0xc1, 0x4e, 0xfa, 0x40, - 0x10, 0xc6, 0xdb, 0x7f, 0x81, 0x7f, 0x32, 0x50, 0x1a, 0x9b, 0xa8, 0xc4, 0x98, 0x46, 0xab, 0x12, - 0x3d, 0xd8, 0x26, 0x78, 0x25, 0x1e, 0x38, 0x11, 0x13, 0x8c, 0xa9, 0xc6, 0x83, 0x17, 0xd2, 0xe2, - 0x86, 0x36, 0x4a, 0x17, 0xd9, 0xed, 0xc1, 0xb7, 0xf0, 0x19, 0x7c, 0x1a, 0x8f, 0x1c, 0x3d, 0x1a, - 0x78, 0x11, 0xc3, 0x6c, 0x29, 0x4b, 0x03, 0xf5, 0xb6, 0x3b, 0xfd, 0xe6, 0x37, 0xdf, 0x7e, 0x99, - 0xc2, 0x31, 0x27, 0xf1, 0x33, 0x99, 0x8c, 0xa2, 0x98, 0xbb, 0xc1, 0x2b, 0x1d, 0xbc, 0x0c, 0x42, - 0x3f, 0x8a, 0x5d, 0xfe, 0x3e, 0x26, 0xcc, 0x19, 0x4f, 0x28, 0xa7, 0xe6,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81, 0x91, 0xe1, 0x52, 0x7b, 0x65, 0xe4, 0x9d, 0xfd, 0xc1, 0xcb, 0xfc, 0xd5, 0xd9, 0x5a, - 0xa5, 0x53, 0x06, 0x8d, 0x25, 0xa3, 0xce, 0xe3, 0xd7, 0xcc, 0x52, 0xa7, 0x33, 0x4b, 0xfd, 0x99, - 0x59, 0xea, 0xc7, 0xdc, 0x52, 0xa6, 0x73, 0x4b, 0xf9, 0x9e, 0x5b, 0xca, 0x53, 0x7b, 0x18, 0xf1, - 0x30, 0x09, 0x9c, 0x01, 0x1d, 0xb9, 0xf2, 0x26, 0xaf, 0x8e, 0xb8, 0xc8, 0xee, 0xc6, 0xff, 0x23, - 0xa8, 0xe0, 0xc7, 0xab, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5e, 0x59, 0x07, 0xbd, 0x3f, 0x03, - 0x00, 0x00, -} - -func (m *BlockRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BlockRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BlockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *NoBlockResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NoBlockResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NoBlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *BlockResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BlockResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Block != nil { - { - size, err := m.Block.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *StatusRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StatusRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *StatusResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *StatusResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Base != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Base)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Message) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Message) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Message_BlockRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_BlockRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.BlockRequest != nil { - { - size, err := m.BlockRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Message_NoBlockResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_NoBlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.NoBlockResponse != nil { - { - size, err := m.NoBlockResponse.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} - -func (m *Message_BlockResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_BlockResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.BlockResponse != nil { - { - size, err := m.BlockResponse.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} - -func (m *Message_StatusRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_StatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.StatusRequest != nil { - { - size, err := m.StatusRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} - -func (m *Message_StatusResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_StatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.StatusResponse != nil { - { - size, err := m.StatusResponse.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func (m *BlockRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - return n -} - -func (m *NoBlockResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - return n -} - -func (m *BlockResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Block != nil { - l = m.Block.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *StatusRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *StatusResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Base != 0 { - n += 1 + sovTypes(uint64(m.Base)) - } - return n -} - -func (m *Message) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *Message_BlockRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BlockRequest != nil { - l = m.BlockRequest.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Message_NoBlockResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NoBlockResponse != nil { - l = m.NoBlockResponse.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Message_BlockResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BlockResponse != nil { - l = m.BlockResponse.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Message_StatusRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.StatusRequest != nil { - l = m.StatusRequest.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Message_StatusResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.StatusResponse != nil { - l = m.StatusResponse.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -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 *BlockRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BlockRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BlockRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *NoBlockResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: NoBlockResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NoBlockResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *BlockResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BlockResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BlockResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Block == nil { - m.Block = &types.Block{} - } - if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *StatusRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StatusRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StatusRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *StatusResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: StatusResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: StatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Base", wireType) - } - m.Base = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Base |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *Message) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Message: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &BlockRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_BlockRequest{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NoBlockResponse", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &NoBlockResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_NoBlockResponse{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockResponse", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &BlockResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_BlockResponse{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StatusRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &StatusRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_StatusRequest{v} - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StatusResponse", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &StatusResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_StatusResponse{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipTypes(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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/proto/tendermint/consensus/types.pb.go b/third_party/proto/tendermint/consensus/types.pb.go deleted file mode 100644 index 6f642c5626..0000000000 --- a/third_party/proto/tendermint/consensus/types.pb.go +++ /dev/null @@ -1,3510 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: tendermint/consensus/types.proto - -package consensus - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - - bits "github.com/line/ostracon/proto/ostracon/libs/bits" - types "github.com/line/ostracon/proto/ostracon/types" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal - -var ( - _ = fmt.Errorf - _ = 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 - -// NewRoundStep is sent for every step taken in the ConsensusState. -// For every height/round/step transition -type NewRoundStep struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` - Step uint32 `protobuf:"varint,3,opt,name=step,proto3" json:"step,omitempty"` - SecondsSinceStartTime int64 `protobuf:"varint,4,opt,name=seconds_since_start_time,json=secondsSinceStartTime,proto3" json:"seconds_since_start_time,omitempty"` - LastCommitRound int32 `protobuf:"varint,5,opt,name=last_commit_round,json=lastCommitRound,proto3" json:"last_commit_round,omitempty"` -} - -func (m *NewRoundStep) Reset() { *m = NewRoundStep{} } -func (m *NewRoundStep) String() string { return proto.CompactTextString(m) } -func (*NewRoundStep) ProtoMessage() {} -func (*NewRoundStep) Descriptor() ([]byte, []int) { - return fileDescriptor_81a22d2efc008981, []int{0} -} - -func (m *NewRoundStep) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *NewRoundStep) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NewRoundStep.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *NewRoundStep) XXX_Merge(src proto.Message) { - xxx_messageInfo_NewRoundStep.Merge(m, src) -} - -func (m *NewRoundStep) XXX_Size() int { - return m.Size() -} - -func (m *NewRoundStep) XXX_DiscardUnknown() { - xxx_messageInfo_NewRoundStep.DiscardUnknown(m) -} - -var xxx_messageInfo_NewRoundStep proto.InternalMessageInfo - -func (m *NewRoundStep) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *NewRoundStep) GetRound() int32 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *NewRoundStep) GetStep() uint32 { - if m != nil { - return m.Step - } - return 0 -} - -func (m *NewRoundStep) GetSecondsSinceStartTime() int64 { - if m != nil { - return m.SecondsSinceStartTime - } - return 0 -} - -func (m *NewRoundStep) GetLastCommitRound() int32 { - if m != nil { - return m.LastCommitRound - } - return 0 -} - -// NewValidBlock is sent when a validator observes a valid block B in some round r, -// i.e., there is a Proposal for block B and 2/3+ prevotes for the block B in the round r. -// In case the block is also committed, then IsCommit flag is set to true. -type NewValidBlock struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` - BlockPartSetHeader types.PartSetHeader `protobuf:"bytes,3,opt,name=block_part_set_header,json=blockPartSetHeader,proto3" json:"block_part_set_header"` - BlockParts *bits.BitArray `protobuf:"bytes,4,opt,name=block_parts,json=blockParts,proto3" json:"block_parts,omitempty"` - IsCommit bool `protobuf:"varint,5,opt,name=is_commit,json=isCommit,proto3" json:"is_commit,omitempty"` -} - -func (m *NewValidBlock) Reset() { *m = NewValidBlock{} } -func (m *NewValidBlock) String() string { return proto.CompactTextString(m) } -func (*NewValidBlock) ProtoMessage() {} -func (*NewValidBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_81a22d2efc008981, []int{1} -} - -func (m *NewValidBlock) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *NewValidBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NewValidBlock.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *NewValidBlock) XXX_Merge(src proto.Message) { - xxx_messageInfo_NewValidBlock.Merge(m, src) -} - -func (m *NewValidBlock) XXX_Size() int { - return m.Size() -} - -func (m *NewValidBlock) XXX_DiscardUnknown() { - xxx_messageInfo_NewValidBlock.DiscardUnknown(m) -} - -var xxx_messageInfo_NewValidBlock proto.InternalMessageInfo - -func (m *NewValidBlock) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *NewValidBlock) GetRound() int32 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *NewValidBlock) GetBlockPartSetHeader() types.PartSetHeader { - if m != nil { - return m.BlockPartSetHeader - } - return types.PartSetHeader{} -} - -func (m *NewValidBlock) GetBlockParts() *bits.BitArray { - if m != nil { - return m.BlockParts - } - return nil -} - -func (m *NewValidBlock) GetIsCommit() bool { - if m != nil { - return m.IsCommit - } - return false -} - -// Proposal is sent when a new block is proposed. -type Proposal struct { - Proposal types.Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal"` -} - -func (m *Proposal) Reset() { *m = Proposal{} } -func (m *Proposal) String() string { return proto.CompactTextString(m) } -func (*Proposal) ProtoMessage() {} -func (*Proposal) Descriptor() ([]byte, []int) { - return fileDescriptor_81a22d2efc008981, []int{2} -} - -func (m *Proposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Proposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *Proposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_Proposal.Merge(m, src) -} - -func (m *Proposal) XXX_Size() int { - return m.Size() -} - -func (m *Proposal) XXX_DiscardUnknown() { - xxx_messageInfo_Proposal.DiscardUnknown(m) -} - -var xxx_messageInfo_Proposal proto.InternalMessageInfo - -func (m *Proposal) GetProposal() types.Proposal { - if m != nil { - return m.Proposal - } - return types.Proposal{} -} - -// ProposalPOL is sent when a previous proposal is re-proposed. -type ProposalPOL struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - ProposalPolRound int32 `protobuf:"varint,2,opt,name=proposal_pol_round,json=proposalPolRound,proto3" json:"proposal_pol_round,omitempty"` - ProposalPol bits.BitArray `protobuf:"bytes,3,opt,name=proposal_pol,json=proposalPol,proto3" json:"proposal_pol"` -} - -func (m *ProposalPOL) Reset() { *m = ProposalPOL{} } -func (m *ProposalPOL) String() string { return proto.CompactTextString(m) } -func (*ProposalPOL) ProtoMessage() {} -func (*ProposalPOL) Descriptor() ([]byte, []int) { - return fileDescriptor_81a22d2efc008981, []int{3} -} - -func (m *ProposalPOL) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *ProposalPOL) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProposalPOL.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *ProposalPOL) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProposalPOL.Merge(m, src) -} - -func (m *ProposalPOL) XXX_Size() int { - return m.Size() -} - -func (m *ProposalPOL) XXX_DiscardUnknown() { - xxx_messageInfo_ProposalPOL.DiscardUnknown(m) -} - -var xxx_messageInfo_ProposalPOL proto.InternalMessageInfo - -func (m *ProposalPOL) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *ProposalPOL) GetProposalPolRound() int32 { - if m != nil { - return m.ProposalPolRound - } - return 0 -} - -func (m *ProposalPOL) GetProposalPol() bits.BitArray { - if m != nil { - return m.ProposalPol - } - return bits.BitArray{} -} - -// BlockPart is sent when gossipping a piece of the proposed block. -type BlockPart struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` - Part types.Part `protobuf:"bytes,3,opt,name=part,proto3" json:"part"` -} - -func (m *BlockPart) Reset() { *m = BlockPart{} } -func (m *BlockPart) String() string { return proto.CompactTextString(m) } -func (*BlockPart) ProtoMessage() {} -func (*BlockPart) Descriptor() ([]byte, []int) { - return fileDescriptor_81a22d2efc008981, []int{4} -} - -func (m *BlockPart) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *BlockPart) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BlockPart.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *BlockPart) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockPart.Merge(m, src) -} - -func (m *BlockPart) XXX_Size() int { - return m.Size() -} - -func (m *BlockPart) XXX_DiscardUnknown() { - xxx_messageInfo_BlockPart.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockPart proto.InternalMessageInfo - -func (m *BlockPart) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *BlockPart) GetRound() int32 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *BlockPart) GetPart() types.Part { - if m != nil { - return m.Part - } - return types.Part{} -} - -// Vote is sent when voting for a proposal (or lack thereof). -type Vote struct { - Vote *types.Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote,omitempty"` -} - -func (m *Vote) Reset() { *m = Vote{} } -func (m *Vote) String() string { return proto.CompactTextString(m) } -func (*Vote) ProtoMessage() {} -func (*Vote) Descriptor() ([]byte, []int) { - return fileDescriptor_81a22d2efc008981, []int{5} -} - -func (m *Vote) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Vote.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *Vote) XXX_Merge(src proto.Message) { - xxx_messageInfo_Vote.Merge(m, src) -} - -func (m *Vote) XXX_Size() int { - return m.Size() -} - -func (m *Vote) XXX_DiscardUnknown() { - xxx_messageInfo_Vote.DiscardUnknown(m) -} - -var xxx_messageInfo_Vote proto.InternalMessageInfo - -func (m *Vote) GetVote() *types.Vote { - if m != nil { - return m.Vote - } - return nil -} - -// HasVote is sent to indicate that a particular vote has been received. -type HasVote struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` - Type types.SignedMsgType `protobuf:"varint,3,opt,name=type,proto3,enum=tendermint.types.SignedMsgType" json:"type,omitempty"` - Index int32 `protobuf:"varint,4,opt,name=index,proto3" json:"index,omitempty"` -} - -func (m *HasVote) Reset() { *m = HasVote{} } -func (m *HasVote) String() string { return proto.CompactTextString(m) } -func (*HasVote) ProtoMessage() {} -func (*HasVote) Descriptor() ([]byte, []int) { - return fileDescriptor_81a22d2efc008981, []int{6} -} - -func (m *HasVote) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *HasVote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HasVote.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *HasVote) XXX_Merge(src proto.Message) { - xxx_messageInfo_HasVote.Merge(m, src) -} - -func (m *HasVote) XXX_Size() int { - return m.Size() -} - -func (m *HasVote) XXX_DiscardUnknown() { - xxx_messageInfo_HasVote.DiscardUnknown(m) -} - -var xxx_messageInfo_HasVote proto.InternalMessageInfo - -func (m *HasVote) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *HasVote) GetRound() int32 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *HasVote) GetType() types.SignedMsgType { - if m != nil { - return m.Type - } - return types.UnknownType -} - -func (m *HasVote) GetIndex() int32 { - if m != nil { - return m.Index - } - return 0 -} - -// VoteSetMaj23 is sent to indicate that a given BlockID has seen +2/3 votes. -type VoteSetMaj23 struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` - Type types.SignedMsgType `protobuf:"varint,3,opt,name=type,proto3,enum=tendermint.types.SignedMsgType" json:"type,omitempty"` - BlockID types.BlockID `protobuf:"bytes,4,opt,name=block_id,json=blockId,proto3" json:"block_id"` -} - -func (m *VoteSetMaj23) Reset() { *m = VoteSetMaj23{} } -func (m *VoteSetMaj23) String() string { return proto.CompactTextString(m) } -func (*VoteSetMaj23) ProtoMessage() {} -func (*VoteSetMaj23) Descriptor() ([]byte, []int) { - return fileDescriptor_81a22d2efc008981, []int{7} -} - -func (m *VoteSetMaj23) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *VoteSetMaj23) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VoteSetMaj23.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *VoteSetMaj23) XXX_Merge(src proto.Message) { - xxx_messageInfo_VoteSetMaj23.Merge(m, src) -} - -func (m *VoteSetMaj23) XXX_Size() int { - return m.Size() -} - -func (m *VoteSetMaj23) XXX_DiscardUnknown() { - xxx_messageInfo_VoteSetMaj23.DiscardUnknown(m) -} - -var xxx_messageInfo_VoteSetMaj23 proto.InternalMessageInfo - -func (m *VoteSetMaj23) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *VoteSetMaj23) GetRound() int32 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *VoteSetMaj23) GetType() types.SignedMsgType { - if m != nil { - return m.Type - } - return types.UnknownType -} - -func (m *VoteSetMaj23) GetBlockID() types.BlockID { - if m != nil { - return m.BlockID - } - return types.BlockID{} -} - -// VoteSetBits is sent to communicate the bit-array of votes seen for the BlockID. -type VoteSetBits struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` - Type types.SignedMsgType `protobuf:"varint,3,opt,name=type,proto3,enum=tendermint.types.SignedMsgType" json:"type,omitempty"` - BlockID types.BlockID `protobuf:"bytes,4,opt,name=block_id,json=blockId,proto3" json:"block_id"` - Votes bits.BitArray `protobuf:"bytes,5,opt,name=votes,proto3" json:"votes"` -} - -func (m *VoteSetBits) Reset() { *m = VoteSetBits{} } -func (m *VoteSetBits) String() string { return proto.CompactTextString(m) } -func (*VoteSetBits) ProtoMessage() {} -func (*VoteSetBits) Descriptor() ([]byte, []int) { - return fileDescriptor_81a22d2efc008981, []int{8} -} - -func (m *VoteSetBits) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *VoteSetBits) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VoteSetBits.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *VoteSetBits) XXX_Merge(src proto.Message) { - xxx_messageInfo_VoteSetBits.Merge(m, src) -} - -func (m *VoteSetBits) XXX_Size() int { - return m.Size() -} - -func (m *VoteSetBits) XXX_DiscardUnknown() { - xxx_messageInfo_VoteSetBits.DiscardUnknown(m) -} - -var xxx_messageInfo_VoteSetBits proto.InternalMessageInfo - -func (m *VoteSetBits) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *VoteSetBits) GetRound() int32 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *VoteSetBits) GetType() types.SignedMsgType { - if m != nil { - return m.Type - } - return types.UnknownType -} - -func (m *VoteSetBits) GetBlockID() types.BlockID { - if m != nil { - return m.BlockID - } - return types.BlockID{} -} - -func (m *VoteSetBits) GetVotes() bits.BitArray { - if m != nil { - return m.Votes - } - return bits.BitArray{} -} - -type Message struct { - // Types that are valid to be assigned to Sum: - // *Message_NewRoundStep - // *Message_NewValidBlock - // *Message_Proposal - // *Message_ProposalPol - // *Message_BlockPart - // *Message_Vote - // *Message_HasVote - // *Message_VoteSetMaj23 - // *Message_VoteSetBits - Sum isMessage_Sum `protobuf_oneof:"sum"` -} - -func (m *Message) Reset() { *m = Message{} } -func (m *Message) String() string { return proto.CompactTextString(m) } -func (*Message) ProtoMessage() {} -func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_81a22d2efc008981, []int{9} -} - -func (m *Message) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Message.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *Message) XXX_Merge(src proto.Message) { - xxx_messageInfo_Message.Merge(m, src) -} - -func (m *Message) XXX_Size() int { - return m.Size() -} - -func (m *Message) XXX_DiscardUnknown() { - xxx_messageInfo_Message.DiscardUnknown(m) -} - -var xxx_messageInfo_Message proto.InternalMessageInfo - -type isMessage_Sum interface { - isMessage_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type Message_NewRoundStep struct { - NewRoundStep *NewRoundStep `protobuf:"bytes,1,opt,name=new_round_step,json=newRoundStep,proto3,oneof" json:"new_round_step,omitempty"` -} -type Message_NewValidBlock struct { - NewValidBlock *NewValidBlock `protobuf:"bytes,2,opt,name=new_valid_block,json=newValidBlock,proto3,oneof" json:"new_valid_block,omitempty"` -} -type Message_Proposal struct { - Proposal *Proposal `protobuf:"bytes,3,opt,name=proposal,proto3,oneof" json:"proposal,omitempty"` -} -type Message_ProposalPol struct { - ProposalPol *ProposalPOL `protobuf:"bytes,4,opt,name=proposal_pol,json=proposalPol,proto3,oneof" json:"proposal_pol,omitempty"` -} -type Message_BlockPart struct { - BlockPart *BlockPart `protobuf:"bytes,5,opt,name=block_part,json=blockPart,proto3,oneof" json:"block_part,omitempty"` -} -type Message_Vote struct { - Vote *Vote `protobuf:"bytes,6,opt,name=vote,proto3,oneof" json:"vote,omitempty"` -} -type Message_HasVote struct { - HasVote *HasVote `protobuf:"bytes,7,opt,name=has_vote,json=hasVote,proto3,oneof" json:"has_vote,omitempty"` -} -type Message_VoteSetMaj23 struct { - VoteSetMaj23 *VoteSetMaj23 `protobuf:"bytes,8,opt,name=vote_set_maj23,json=voteSetMaj23,proto3,oneof" json:"vote_set_maj23,omitempty"` -} -type Message_VoteSetBits struct { - VoteSetBits *VoteSetBits `protobuf:"bytes,9,opt,name=vote_set_bits,json=voteSetBits,proto3,oneof" json:"vote_set_bits,omitempty"` -} - -func (*Message_NewRoundStep) isMessage_Sum() {} -func (*Message_NewValidBlock) isMessage_Sum() {} -func (*Message_Proposal) isMessage_Sum() {} -func (*Message_ProposalPol) isMessage_Sum() {} -func (*Message_BlockPart) isMessage_Sum() {} -func (*Message_Vote) isMessage_Sum() {} -func (*Message_HasVote) isMessage_Sum() {} -func (*Message_VoteSetMaj23) isMessage_Sum() {} -func (*Message_VoteSetBits) isMessage_Sum() {} - -func (m *Message) GetSum() isMessage_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *Message) GetNewRoundStep() *NewRoundStep { - if x, ok := m.GetSum().(*Message_NewRoundStep); ok { - return x.NewRoundStep - } - return nil -} - -func (m *Message) GetNewValidBlock() *NewValidBlock { - if x, ok := m.GetSum().(*Message_NewValidBlock); ok { - return x.NewValidBlock - } - return nil -} - -func (m *Message) GetProposal() *Proposal { - if x, ok := m.GetSum().(*Message_Proposal); ok { - return x.Proposal - } - return nil -} - -func (m *Message) GetProposalPol() *ProposalPOL { - if x, ok := m.GetSum().(*Message_ProposalPol); ok { - return x.ProposalPol - } - return nil -} - -func (m *Message) GetBlockPart() *BlockPart { - if x, ok := m.GetSum().(*Message_BlockPart); ok { - return x.BlockPart - } - return nil -} - -func (m *Message) GetVote() *Vote { - if x, ok := m.GetSum().(*Message_Vote); ok { - return x.Vote - } - return nil -} - -func (m *Message) GetHasVote() *HasVote { - if x, ok := m.GetSum().(*Message_HasVote); ok { - return x.HasVote - } - return nil -} - -func (m *Message) GetVoteSetMaj23() *VoteSetMaj23 { - if x, ok := m.GetSum().(*Message_VoteSetMaj23); ok { - return x.VoteSetMaj23 - } - return nil -} - -func (m *Message) GetVoteSetBits() *VoteSetBits { - if x, ok := m.GetSum().(*Message_VoteSetBits); ok { - return x.VoteSetBits - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Message) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Message_NewRoundStep)(nil), - (*Message_NewValidBlock)(nil), - (*Message_Proposal)(nil), - (*Message_ProposalPol)(nil), - (*Message_BlockPart)(nil), - (*Message_Vote)(nil), - (*Message_HasVote)(nil), - (*Message_VoteSetMaj23)(nil), - (*Message_VoteSetBits)(nil), - } -} - -func init() { - proto.RegisterType((*NewRoundStep)(nil), "tendermint.consensus.NewRoundStep") - proto.RegisterType((*NewValidBlock)(nil), "tendermint.consensus.NewValidBlock") - proto.RegisterType((*Proposal)(nil), "tendermint.consensus.Proposal") - proto.RegisterType((*ProposalPOL)(nil), "tendermint.consensus.ProposalPOL") - proto.RegisterType((*BlockPart)(nil), "tendermint.consensus.BlockPart") - proto.RegisterType((*Vote)(nil), "tendermint.consensus.Vote") - proto.RegisterType((*HasVote)(nil), "tendermint.consensus.HasVote") - proto.RegisterType((*VoteSetMaj23)(nil), "tendermint.consensus.VoteSetMaj23") - proto.RegisterType((*VoteSetBits)(nil), "tendermint.consensus.VoteSetBits") - proto.RegisterType((*Message)(nil), "tendermint.consensus.Message") -} - -func init() { proto.RegisterFile("tendermint/consensus/types.proto", fileDescriptor_81a22d2efc008981) } - -var fileDescriptor_81a22d2efc008981 = []byte{ - // 853 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0x4f, 0x8f, 0xdb, 0x44, - 0x14, 0xb7, 0x59, 0x67, 0x93, 0x7d, 0xde, 0xec, 0xc2, 0x68, 0x5b, 0x85, 0x00, 0x49, 0x30, 0x97, - 0x15, 0x42, 0x0e, 0xca, 0x1e, 0x90, 0x0a, 0x12, 0x60, 0xfe, 0xd4, 0xad, 0x9a, 0x36, 0x72, 0x4a, - 0x85, 0xb8, 0x58, 0x4e, 0x3c, 0x4a, 0x86, 0xc6, 0x1e, 0xcb, 0x33, 0xc9, 0xb2, 0x57, 0x3e, 0x01, - 0x1f, 0x80, 0xaf, 0x81, 0xc4, 0x47, 0xe8, 0xb1, 0x47, 0x4e, 0x15, 0xca, 0x7e, 0x04, 0x04, 0x67, - 0x34, 0xe3, 0x49, 0x3c, 0xa1, 0xde, 0x85, 0xbd, 0x20, 0xf5, 0x36, 0xe3, 0xf7, 0xde, 0x6f, 0xde, - 0xfc, 0xde, 0x7b, 0x3f, 0x0f, 0xf4, 0x38, 0x4e, 0x63, 0x9c, 0x27, 0x24, 0xe5, 0xfd, 0x29, 0x4d, - 0x19, 0x4e, 0xd9, 0x92, 0xf5, 0xf9, 0x45, 0x86, 0x99, 0x9b, 0xe5, 0x94, 0x53, 0x74, 0x52, 0x7a, - 0xb8, 0x5b, 0x8f, 0xf6, 0xc9, 0x8c, 0xce, 0xa8, 0x74, 0xe8, 0x8b, 0x55, 0xe1, 0xdb, 0x7e, 0x5b, - 0x43, 0x93, 0x18, 0x3a, 0x52, 0x5b, 0x3f, 0x6b, 0x41, 0x26, 0xac, 0x3f, 0x21, 0x7c, 0xc7, 0xc3, - 0xf9, 0xc5, 0x84, 0xc3, 0x87, 0xf8,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25, 0x5c, 0x51, 0x09, 0xd7, 0x23, - 0xfc, 0xf3, 0x3c, 0x8f, 0x2e, 0x02, 0xd8, 0x02, 0x31, 0xf4, 0x16, 0x1c, 0x10, 0xa6, 0x48, 0x90, - 0xd7, 0x6f, 0x04, 0x0d, 0xc2, 0x8a, 0xcb, 0x3b, 0x3e, 0x34, 0x46, 0x39, 0xcd, 0x28, 0x8b, 0x16, - 0xe8, 0x13, 0x68, 0x64, 0x6a, 0x2d, 0xef, 0x6c, 0x0f, 0xda, 0x15, 0x69, 0x2b, 0x0f, 0x95, 0xf1, - 0x36, 0xc2, 0xf9, 0xd9, 0x04, 0x7b, 0x63, 0x1c, 0x3d, 0x7a, 0x70, 0x25, 0x7f, 0x1f, 0x00, 0xda, - 0xc4, 0x84, 0x19, 0x5d, 0x84, 0x3a, 0x99, 0xaf, 0x6f, 0x2c, 0x23, 0xba, 0x90, 0x75, 0x41, 0x77, - 0xe1, 0x50, 0xf7, 0x56, 0x74, 0xfe, 0xcb, 0xf5, 0x55, 0x6e, 0xb6, 0x86, 0xe6, 0x3c, 0x85, 0x03, - 0x6f, 0xc3, 0xc9, 0x0d, 0x6b, 0xfb, 0x21, 0x58, 0x82, 0x7b, 0x75, 0xf6, 0xed, 0xea, 0x52, 0xaa, - 0x33, 0xa5, 0xa7, 0x33, 0x00, 0xeb, 0x09, 0xe5, 0xa2, 0x03, 0xad, 0x15, 0xe5, 0x58, 0xb1, 0x59, - 0x11, 0x29, 0xbc, 0x02, 0xe9, 0xe3, 0xfc, 0x68, 0x42, 0xdd, 0x8f, 0x98, 0x8c, 0xbb, 0x59, 0x7e, - 0x67, 0x60, 0x09, 0x34, 0x99, 0xdf, 0x51, 0x55, 0xab, 0x8d, 0xc9, 0x2c, 0xc5, 0xf1, 0x90, 0xcd, - 0x1e, 0x5f, 0x64, 0x38, 0x90, 0xce, 0x02, 0x8a, 0xa4, 0x31, 0xfe, 0x41, 0x36, 0x54, 0x2d, 0x28, - 0x36, 0xce, 0xa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0x3c, 0x96, 0xb1, 0xa2, 0x0b, 0x7d, - 0xa3, 0x18, 0x6b, 0x74, 0x07, 0x1a, 0xf3, 0x88, 0x85, 0x32, 0xaa, 0x2e, 0xa3, 0xde, 0xa9, 0x8e, - 0x52, 0xb3, 0xef, 0x1b, 0x41, 0x7d, 0xae, 0x64, 0xe0, 0x3e, 0x1c, 0x89, 0x38, 0xf9, 0x3b, 0x49, - 0xc4, 0x38, 0xb6, 0x1a, 0xd7, 0x15, 0x54, 0x1f, 0x5c, 0x51, 0xd0, 0x95, 0x3e, 0xc8, 0x77, 0xa1, - 0xb9, 0xc5, 0x12, 0xfd, 0xd4, 0x3a, 0xb8, 0x8e, 0x44, 0x6d, 0x90, 0x04, 0x89, 0xab, 0x72, 0xeb, - 0xd5, 0x60, 0x8f, 0x2d, 0x13, 0xef, 0x9b, 0x67, 0xeb, 0x8e, 0xf9, 0x7c, 0xdd, 0x31, 0x7f, 0x5f, - 0x77, 0xcc, 0x9f, 0x2e, 0x3b, 0xc6, 0xf3, 0xcb, 0x8e, 0xf1, 0xdb, 0x65, 0xc7, 0xf8, 0xee, 0xe3, - 0x19, 0xe1, 0xf3, 0xe5, 0xc4, 0x9d, 0xd2, 0xa4, 0xaf, 0xbf, 0x26, 0xca, 0x65, 0xf1, 0xea, 0xa8, - 0x7a, 0xb7, 0x4c, 0xf6, 0xa5, 0xed, 0xec, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc7, 0x5c, 0x91, - 0x04, 0xd6, 0x08, 0x00, 0x00, -} - -func (m *NewRoundStep) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NewRoundStep) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NewRoundStep) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LastCommitRound != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.LastCommitRound)) - i-- - dAtA[i] = 0x28 - } - if m.SecondsSinceStartTime != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.SecondsSinceStartTime)) - i-- - dAtA[i] = 0x20 - } - if m.Step != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Step)) - i-- - dAtA[i] = 0x18 - } - if m.Round != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *NewValidBlock) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NewValidBlock) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NewValidBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.IsCommit { - i-- - if m.IsCommit { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if m.BlockParts != nil { - { - size, err := m.BlockParts.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - { - size, err := m.BlockPartSetHeader.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.Round != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Proposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Proposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Proposal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ProposalPOL) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProposalPOL) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProposalPOL) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.ProposalPol.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.ProposalPolRound != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.ProposalPolRound)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *BlockPart) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BlockPart) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BlockPart) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Part.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.Round != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Vote) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Vote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Vote != nil { - { - size, err := m.Vote.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *HasVote) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HasVote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HasVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Index != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x20 - } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x18 - } - if m.Round != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *VoteSetMaj23) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VoteSetMaj23) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VoteSetMaj23) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.BlockID.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x18 - } - if m.Round != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *VoteSetBits) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VoteSetBits) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VoteSetBits) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Votes.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - { - size, err := m.BlockID.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x18 - } - if m.Round != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Message) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Message) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Message_NewRoundStep) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_NewRoundStep) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.NewRoundStep != nil { - { - size, err := m.NewRoundStep.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Message_NewValidBlock) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_NewValidBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.NewValidBlock != nil { - { - size, err := m.NewValidBlock.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} - -func (m *Message_Proposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Proposal != nil { - { - size, err := m.Proposal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} - -func (m *Message_ProposalPol) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_ProposalPol) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ProposalPol != nil { - { - size, err := m.ProposalPol.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} - -func (m *Message_BlockPart) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_BlockPart) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.BlockPart != nil { - { - size, err := m.BlockPart.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - return len(dAtA) - i, nil -} - -func (m *Message_Vote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Vote != nil { - { - size, err := m.Vote.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - return len(dAtA) - i, nil -} - -func (m *Message_HasVote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_HasVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.HasVote != nil { - { - size, err := m.HasVote.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - return len(dAtA) - i, nil -} - -func (m *Message_VoteSetMaj23) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_VoteSetMaj23) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.VoteSetMaj23 != nil { - { - size, err := m.VoteSetMaj23.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - return len(dAtA) - i, nil -} - -func (m *Message_VoteSetBits) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_VoteSetBits) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.VoteSetBits != nil { - { - size, err := m.VoteSetBits.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func (m *NewRoundStep) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Round != 0 { - n += 1 + sovTypes(uint64(m.Round)) - } - if m.Step != 0 { - n += 1 + sovTypes(uint64(m.Step)) - } - if m.SecondsSinceStartTime != 0 { - n += 1 + sovTypes(uint64(m.SecondsSinceStartTime)) - } - if m.LastCommitRound != 0 { - n += 1 + sovTypes(uint64(m.LastCommitRound)) - } - return n -} - -func (m *NewValidBlock) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Round != 0 { - n += 1 + sovTypes(uint64(m.Round)) - } - l = m.BlockPartSetHeader.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.BlockParts != nil { - l = m.BlockParts.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.IsCommit { - n += 2 - } - return n -} - -func (m *Proposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Proposal.Size() - n += 1 + l + sovTypes(uint64(l)) - return n -} - -func (m *ProposalPOL) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.ProposalPolRound != 0 { - n += 1 + sovTypes(uint64(m.ProposalPolRound)) - } - l = m.ProposalPol.Size() - n += 1 + l + sovTypes(uint64(l)) - return n -} - -func (m *BlockPart) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Round != 0 { - n += 1 + sovTypes(uint64(m.Round)) - } - l = m.Part.Size() - n += 1 + l + sovTypes(uint64(l)) - return n -} - -func (m *Vote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Vote != nil { - l = m.Vote.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *HasVote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Round != 0 { - n += 1 + sovTypes(uint64(m.Round)) - } - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - if m.Index != 0 { - n += 1 + sovTypes(uint64(m.Index)) - } - return n -} - -func (m *VoteSetMaj23) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Round != 0 { - n += 1 + sovTypes(uint64(m.Round)) - } - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - l = m.BlockID.Size() - n += 1 + l + sovTypes(uint64(l)) - return n -} - -func (m *VoteSetBits) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Round != 0 { - n += 1 + sovTypes(uint64(m.Round)) - } - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - l = m.BlockID.Size() - n += 1 + l + sovTypes(uint64(l)) - l = m.Votes.Size() - n += 1 + l + sovTypes(uint64(l)) - return n -} - -func (m *Message) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *Message_NewRoundStep) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NewRoundStep != nil { - l = m.NewRoundStep.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Message_NewValidBlock) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.NewValidBlock != nil { - l = m.NewValidBlock.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Message_Proposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Proposal != nil { - l = m.Proposal.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Message_ProposalPol) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ProposalPol != nil { - l = m.ProposalPol.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Message_BlockPart) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BlockPart != nil { - l = m.BlockPart.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Message_Vote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Vote != nil { - l = m.Vote.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Message_HasVote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.HasVote != nil { - l = m.HasVote.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Message_VoteSetMaj23) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.VoteSetMaj23 != nil { - l = m.VoteSetMaj23.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Message_VoteSetBits) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.VoteSetBits != nil { - l = m.VoteSetBits.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -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 *NewRoundStep) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: NewRoundStep: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NewRoundStep: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Round |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) - } - m.Step = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Step |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SecondsSinceStartTime", wireType) - } - m.SecondsSinceStartTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SecondsSinceStartTime |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LastCommitRound", wireType) - } - m.LastCommitRound = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LastCommitRound |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *NewValidBlock) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: NewValidBlock: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NewValidBlock: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Round |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockPartSetHeader", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.BlockPartSetHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockParts", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.BlockParts == nil { - m.BlockParts = &bits.BitArray{} - } - if err := m.BlockParts.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IsCommit", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.IsCommit = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *Proposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Proposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Proposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Proposal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *ProposalPOL) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ProposalPOL: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProposalPOL: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalPolRound", wireType) - } - m.ProposalPolRound = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposalPolRound |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalPol", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ProposalPol.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *BlockPart) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BlockPart: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BlockPart: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Round |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Part", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Part.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *Vote) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Vote: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Vote: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Vote == nil { - m.Vote = &types.Vote{} - } - if err := m.Vote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *HasVote) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: HasVote: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HasVote: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Round |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= types.SignedMsgType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *VoteSetMaj23) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: VoteSetMaj23: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VoteSetMaj23: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Round |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= types.SignedMsgType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockID", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.BlockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *VoteSetBits) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: VoteSetBits: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VoteSetBits: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Round |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= types.SignedMsgType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockID", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.BlockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Votes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Votes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *Message) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Message: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewRoundStep", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &NewRoundStep{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_NewRoundStep{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NewValidBlock", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &NewValidBlock{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_NewValidBlock{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Proposal{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_Proposal{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposalPol", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ProposalPOL{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_ProposalPol{v} - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockPart", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &BlockPart{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_BlockPart{v} - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Vote{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_Vote{v} - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HasVote", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &HasVote{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_HasVote{v} - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VoteSetMaj23", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &VoteSetMaj23{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_VoteSetMaj23{v} - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VoteSetBits", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &VoteSetBits{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_VoteSetBits{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipTypes(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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/proto/tendermint/consensus/wal.pb.go b/third_party/proto/tendermint/consensus/wal.pb.go deleted file mode 100644 index cac9b7bdd6..0000000000 --- a/third_party/proto/tendermint/consensus/wal.pb.go +++ /dev/null @@ -1,1586 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: tendermint/consensus/wal.proto - -package consensus - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - time "time" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/duration" - - types "github.com/line/ostracon/proto/ostracon/types" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal - -var ( - _ = fmt.Errorf - _ = math.Inf - _ = time.Kitchen -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// MsgInfo are msgs from the reactor which may update the state -type MsgInfo struct { - Msg Message `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg"` - PeerID string `protobuf:"bytes,2,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"` -} - -func (m *MsgInfo) Reset() { *m = MsgInfo{} } -func (m *MsgInfo) String() string { return proto.CompactTextString(m) } -func (*MsgInfo) ProtoMessage() {} -func (*MsgInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ed0b60c2d348ab09, []int{0} -} - -func (m *MsgInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *MsgInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *MsgInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgInfo.Merge(m, src) -} - -func (m *MsgInfo) XXX_Size() int { - return m.Size() -} - -func (m *MsgInfo) XXX_DiscardUnknown() { - xxx_messageInfo_MsgInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgInfo proto.InternalMessageInfo - -func (m *MsgInfo) GetMsg() Message { - if m != nil { - return m.Msg - } - return Message{} -} - -func (m *MsgInfo) GetPeerID() string { - if m != nil { - return m.PeerID - } - return "" -} - -// TimeoutInfo internally generated messages which may update the state -type TimeoutInfo struct { - Duration time.Duration `protobuf:"bytes,1,opt,name=duration,proto3,stdduration" json:"duration"` - Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` - Round int32 `protobuf:"varint,3,opt,name=round,proto3" json:"round,omitempty"` - Step uint32 `protobuf:"varint,4,opt,name=step,proto3" json:"step,omitempty"` -} - -func (m *TimeoutInfo) Reset() { *m = TimeoutInfo{} } -func (m *TimeoutInfo) String() string { return proto.CompactTextString(m) } -func (*TimeoutInfo) ProtoMessage() {} -func (*TimeoutInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ed0b60c2d348ab09, []int{1} -} - -func (m *TimeoutInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *TimeoutInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TimeoutInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *TimeoutInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_TimeoutInfo.Merge(m, src) -} - -func (m *TimeoutInfo) XXX_Size() int { - return m.Size() -} - -func (m *TimeoutInfo) XXX_DiscardUnknown() { - xxx_messageInfo_TimeoutInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_TimeoutInfo proto.InternalMessageInfo - -func (m *TimeoutInfo) GetDuration() time.Duration { - if m != nil { - return m.Duration - } - return 0 -} - -func (m *TimeoutInfo) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *TimeoutInfo) GetRound() int32 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *TimeoutInfo) GetStep() uint32 { - if m != nil { - return m.Step - } - return 0 -} - -// EndHeight marks the end of the given height inside WAL. -// @internal used by scripts/wal2json util. -type EndHeight struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` -} - -func (m *EndHeight) Reset() { *m = EndHeight{} } -func (m *EndHeight) String() string { return proto.CompactTextString(m) } -func (*EndHeight) ProtoMessage() {} -func (*EndHeight) Descriptor() ([]byte, []int) { - return fileDescriptor_ed0b60c2d348ab09, []int{2} -} - -func (m *EndHeight) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *EndHeight) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EndHeight.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *EndHeight) XXX_Merge(src proto.Message) { - xxx_messageInfo_EndHeight.Merge(m, src) -} - -func (m *EndHeight) XXX_Size() int { - return m.Size() -} - -func (m *EndHeight) XXX_DiscardUnknown() { - xxx_messageInfo_EndHeight.DiscardUnknown(m) -} - -var xxx_messageInfo_EndHeight proto.InternalMessageInfo - -func (m *EndHeight) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -type WALMessage struct { - // Types that are valid to be assigned to Sum: - // *WALMessage_EventDataRoundState - // *WALMessage_MsgInfo - // *WALMessage_TimeoutInfo - // *WALMessage_EndHeight - Sum isWALMessage_Sum `protobuf_oneof:"sum"` -} - -func (m *WALMessage) Reset() { *m = WALMessage{} } -func (m *WALMessage) String() string { return proto.CompactTextString(m) } -func (*WALMessage) ProtoMessage() {} -func (*WALMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_ed0b60c2d348ab09, []int{3} -} - -func (m *WALMessage) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *WALMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_WALMessage.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *WALMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_WALMessage.Merge(m, src) -} - -func (m *WALMessage) XXX_Size() int { - return m.Size() -} - -func (m *WALMessage) XXX_DiscardUnknown() { - xxx_messageInfo_WALMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_WALMessage proto.InternalMessageInfo - -type isWALMessage_Sum interface { - isWALMessage_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type WALMessage_EventDataRoundState struct { - EventDataRoundState *types.EventDataRoundState `protobuf:"bytes,1,opt,name=event_data_round_state,json=eventDataRoundState,proto3,oneof" json:"event_data_round_state,omitempty"` -} -type WALMessage_MsgInfo struct { - MsgInfo *MsgInfo `protobuf:"bytes,2,opt,name=msg_info,json=msgInfo,proto3,oneof" json:"msg_info,omitempty"` -} -type WALMessage_TimeoutInfo struct { - TimeoutInfo *TimeoutInfo `protobuf:"bytes,3,opt,name=timeout_info,json=timeoutInfo,proto3,oneof" json:"timeout_info,omitempty"` -} -type WALMessage_EndHeight struct { - EndHeight *EndHeight `protobuf:"bytes,4,opt,name=end_height,json=endHeight,proto3,oneof" json:"end_height,omitempty"` -} - -func (*WALMessage_EventDataRoundState) isWALMessage_Sum() {} -func (*WALMessage_MsgInfo) isWALMessage_Sum() {} -func (*WALMessage_TimeoutInfo) isWALMessage_Sum() {} -func (*WALMessage_EndHeight) isWALMessage_Sum() {} - -func (m *WALMessage) GetSum() isWALMessage_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *WALMessage) GetEventDataRoundState() *types.EventDataRoundState { - if x, ok := m.GetSum().(*WALMessage_EventDataRoundState); ok { - return x.EventDataRoundState - } - return nil -} - -func (m *WALMessage) GetMsgInfo() *MsgInfo { - if x, ok := m.GetSum().(*WALMessage_MsgInfo); ok { - return x.MsgInfo - } - return nil -} - -func (m *WALMessage) GetTimeoutInfo() *TimeoutInfo { - if x, ok := m.GetSum().(*WALMessage_TimeoutInfo); ok { - return x.TimeoutInfo - } - return nil -} - -func (m *WALMessage) GetEndHeight() *EndHeight { - if x, ok := m.GetSum().(*WALMessage_EndHeight); ok { - return x.EndHeight - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*WALMessage) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*WALMessage_EventDataRoundState)(nil), - (*WALMessage_MsgInfo)(nil), - (*WALMessage_TimeoutInfo)(nil), - (*WALMessage_EndHeight)(nil), - } -} - -// TimedWALMessage wraps WALMessage and adds Time for debugging purposes. -type TimedWALMessage struct { - Time time.Time `protobuf:"bytes,1,opt,name=time,proto3,stdtime" json:"time"` - Msg *WALMessage `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` -} - -func (m *TimedWALMessage) Reset() { *m = TimedWALMessage{} } -func (m *TimedWALMessage) String() string { return proto.CompactTextString(m) } -func (*TimedWALMessage) ProtoMessage() {} -func (*TimedWALMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_ed0b60c2d348ab09, []int{4} -} - -func (m *TimedWALMessage) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *TimedWALMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TimedWALMessage.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *TimedWALMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_TimedWALMessage.Merge(m, src) -} - -func (m *TimedWALMessage) XXX_Size() int { - return m.Size() -} - -func (m *TimedWALMessage) XXX_DiscardUnknown() { - xxx_messageInfo_TimedWALMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_TimedWALMessage proto.InternalMessageInfo - -func (m *TimedWALMessage) GetTime() time.Time { - if m != nil { - return m.Time - } - return time.Time{} -} - -func (m *TimedWALMessage) GetMsg() *WALMessage { - if m != nil { - return m.Msg - } - return nil -} - -func init() { - proto.RegisterType((*MsgInfo)(nil), "tendermint.consensus.MsgInfo") - proto.RegisterType((*TimeoutInfo)(nil), "tendermint.consensus.TimeoutInfo") - proto.RegisterType((*EndHeight)(nil), "tendermint.consensus.EndHeight") - proto.RegisterType((*WALMessage)(nil), "tendermint.consensus.WALMessage") - proto.RegisterType((*TimedWALMessage)(nil), "tendermint.consensus.TimedWALMessage") -} - -func init() { proto.RegisterFile("tendermint/consensus/wal.proto", fileDescriptor_ed0b60c2d348ab09) } - -var fileDescriptor_ed0b60c2d348ab09 = []byte{ - // 539 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x53, 0xdd, 0x8a, 0xd3, 0x40, - 0x14, 0xce, 0x6c, 0xff, 0x4f, 0x15, 0x21, 0x96, 0xa5, 0x16, 0x36, 0x8d, 0x5d, 0x84, 0x5e, 0x25, - 0xb0, 0x22, 0x88, 0x5e, 0xa8, 0xa5, 0x2b, 0x2d, 0xb8, 0x20, 0xe3, 0x8a, 0x20, 0x42, 0x48, 0x37, - 0xa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0x18, 0xf3, 0x1a, 0x00, - 0x59, 0xe0, 0xe5, 0x62, 0x54, 0x55, 0x97, 0x7e, 0x79, 0x97, 0x9d, 0x7a, 0x13, 0x83, 0xb6, 0x70, - 0x1b, 0x8c, 0x6a, 0x50, 0x11, 0x69, 0x3c, 0xf8, 0x01, 0x0f, 0x32, 0x9a, 0xa0, 0xa0, 0xde, 0x73, - 0xa8, 0x66, 0x54, 0xb9, 0x56, 0xbd, 0x5b, 0x86, 0x9f, 0x6f, 0xdf, 0xa6, 0x76, 0x7c, 0x95, 0x39, - 0xae, 0x2a, 0xcc, 0x13, 0xfd, 0x34, 0xb5, 0x28, 0x76, 0xf9, 0x38, 0x7b, 0x22, 0xf5, 0x2e, 0x47, - 0x1f, 0xaf, 0xd6, 0x16, 0xb9, 0x5e, 0x5b, 0xe4, 0xef, 0xda, 0x22, 0xab, 0x8d, 0x65, 0x5c, 0x6f, - 0x2c, 0xe3, 0xf7, 0xc6, 0x32, 0x3e, 0xbf, 0x0c, 0x23, 0xb9, 0x48, 0x67, 0xce, 0x05, 0x8f, 0xdd, - 0xe2, 0xf7, 0xda, 0x1f, 0xf5, 0x47, 0x2d, 0xfb, 0x9c, 0xb3, 0xba, 0xca, 0x3d, 0xfd, 0x17, 0x00, - 0x00, 0xff, 0xff, 0x0b, 0xad, 0x1c, 0x1b, 0x07, 0x04, 0x00, 0x00, -} - -func (m *MsgInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.PeerID) > 0 { - i -= len(m.PeerID) - copy(dAtA[i:], m.PeerID) - i = encodeVarintWal(dAtA, i, uint64(len(m.PeerID))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Msg.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *TimeoutInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TimeoutInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TimeoutInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Step != 0 { - i = encodeVarintWal(dAtA, i, uint64(m.Step)) - i-- - dAtA[i] = 0x20 - } - if m.Round != 0 { - i = encodeVarintWal(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x18 - } - if m.Height != 0 { - i = encodeVarintWal(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x10 - } - n2, err2 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintWal(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *EndHeight) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EndHeight) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EndHeight) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Height != 0 { - i = encodeVarintWal(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *WALMessage) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *WALMessage) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WALMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *WALMessage_EventDataRoundState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WALMessage_EventDataRoundState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.EventDataRoundState != nil { - { - size, err := m.EventDataRoundState.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *WALMessage_MsgInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WALMessage_MsgInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.MsgInfo != nil { - { - size, err := m.MsgInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} - -func (m *WALMessage_TimeoutInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WALMessage_TimeoutInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.TimeoutInfo != nil { - { - size, err := m.TimeoutInfo.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} - -func (m *WALMessage_EndHeight) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *WALMessage_EndHeight) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.EndHeight != nil { - { - size, err := m.EndHeight.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} - -func (m *TimedWALMessage) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TimedWALMessage) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TimedWALMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Msg != nil { - { - size, err := m.Msg.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintWal(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - n8, err8 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):]) - if err8 != nil { - return 0, err8 - } - i -= n8 - i = encodeVarintWal(dAtA, i, uint64(n8)) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintWal(dAtA []byte, offset int, v uint64) int { - offset -= sovWal(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func (m *MsgInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Msg.Size() - n += 1 + l + sovWal(uint64(l)) - l = len(m.PeerID) - if l > 0 { - n += 1 + l + sovWal(uint64(l)) - } - return n -} - -func (m *TimeoutInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration) - n += 1 + l + sovWal(uint64(l)) - if m.Height != 0 { - n += 1 + sovWal(uint64(m.Height)) - } - if m.Round != 0 { - n += 1 + sovWal(uint64(m.Round)) - } - if m.Step != 0 { - n += 1 + sovWal(uint64(m.Step)) - } - return n -} - -func (m *EndHeight) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovWal(uint64(m.Height)) - } - return n -} - -func (m *WALMessage) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *WALMessage_EventDataRoundState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.EventDataRoundState != nil { - l = m.EventDataRoundState.Size() - n += 1 + l + sovWal(uint64(l)) - } - return n -} - -func (m *WALMessage_MsgInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MsgInfo != nil { - l = m.MsgInfo.Size() - n += 1 + l + sovWal(uint64(l)) - } - return n -} - -func (m *WALMessage_TimeoutInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.TimeoutInfo != nil { - l = m.TimeoutInfo.Size() - n += 1 + l + sovWal(uint64(l)) - } - return n -} - -func (m *WALMessage_EndHeight) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.EndHeight != nil { - l = m.EndHeight.Size() - n += 1 + l + sovWal(uint64(l)) - } - return n -} - -func (m *TimedWALMessage) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time) - n += 1 + l + sovWal(uint64(l)) - if m.Msg != nil { - l = m.Msg.Size() - n += 1 + l + sovWal(uint64(l)) - } - return n -} - -func sovWal(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} - -func sozWal(x uint64) (n int) { - return sovWal(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} - -func (m *MsgInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Msg.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PeerID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - 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 ErrInvalidLengthWal - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthWal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PeerID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipWal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *TimeoutInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TimeoutInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TimeoutInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Round |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) - } - m.Step = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Step |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipWal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *EndHeight) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EndHeight: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EndHeight: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipWal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *WALMessage) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: WALMessage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: WALMessage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EventDataRoundState", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types.EventDataRoundState{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &WALMessage_EventDataRoundState{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MsgInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &MsgInfo{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &WALMessage_MsgInfo{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeoutInfo", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &TimeoutInfo{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &WALMessage_TimeoutInfo{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EndHeight", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &EndHeight{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &WALMessage_EndHeight{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipWal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *TimedWALMessage) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TimedWALMessage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TimedWALMessage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowWal - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthWal - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthWal - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Msg == nil { - m.Msg = &WALMessage{} - } - if err := m.Msg.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipWal(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthWal - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipWal(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, ErrIntOverflowWal - } - 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, ErrIntOverflowWal - } - 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, ErrIntOverflowWal - } - 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, ErrInvalidLengthWal - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupWal - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthWal - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthWal = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowWal = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupWal = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/proto/tendermint/crypto/keys.pb.go b/third_party/proto/tendermint/crypto/keys.pb.go deleted file mode 100644 index ad2de6c876..0000000000 --- a/third_party/proto/tendermint/crypto/keys.pb.go +++ /dev/null @@ -1,677 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: tendermint/crypto/keys.proto - -package crypto - -import ( - bytes "bytes" - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal - -var ( - _ = fmt.Errorf - _ = 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 - -// PublicKey defines the keys available for use with Tendermint Validators -type PublicKey struct { - // Types that are valid to be assigned to Sum: - // *PublicKey_Ed25519 - // *PublicKey_Secp256K1 - Sum isPublicKey_Sum `protobuf_oneof:"sum"` -} - -func (m *PublicKey) Reset() { *m = PublicKey{} } -func (m *PublicKey) String() string { return proto.CompactTextString(m) } -func (*PublicKey) ProtoMessage() {} -func (*PublicKey) Descriptor() ([]byte, []int) { - return fileDescriptor_cb048658b234868c, []int{0} -} - -func (m *PublicKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *PublicKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PublicKey.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *PublicKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_PublicKey.Merge(m, src) -} - -func (m *PublicKey) XXX_Size() int { - return m.Size() -} - -func (m *PublicKey) XXX_DiscardUnknown() { - xxx_messageInfo_PublicKey.DiscardUnknown(m) -} - -var xxx_messageInfo_PublicKey proto.InternalMessageInfo - -type isPublicKey_Sum interface { - isPublicKey_Sum() - Equal(interface{}) bool - MarshalTo([]byte) (int, error) - Size() int - Compare(interface{}) int -} - -type PublicKey_Ed25519 struct { - Ed25519 []byte `protobuf:"bytes,1,opt,name=ed25519,proto3,oneof" json:"ed25519,omitempty"` -} -type PublicKey_Secp256K1 struct { - Secp256K1 []byte `protobuf:"bytes,2,opt,name=secp256k1,proto3,oneof" json:"secp256k1,omitempty"` -} - -func (*PublicKey_Ed25519) isPublicKey_Sum() {} -func (*PublicKey_Secp256K1) isPublicKey_Sum() {} - -func (m *PublicKey) GetSum() isPublicKey_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *PublicKey) GetEd25519() []byte { - if x, ok := m.GetSum().(*PublicKey_Ed25519); ok { - return x.Ed25519 - } - return nil -} - -func (m *PublicKey) GetSecp256K1() []byte { - if x, ok := m.GetSum().(*PublicKey_Secp256K1); ok { - return x.Secp256K1 - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*PublicKey) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*PublicKey_Ed25519)(nil), - (*PublicKey_Secp256K1)(nil), - } -} - -func init() { - proto.RegisterType((*PublicKey)(nil), "tendermint.crypto.PublicKey") -} - -func init() { proto.RegisterFile("tendermint/crypto/keys.proto", fileDescriptor_cb048658b234868c) } - -var fileDescriptor_cb048658b234868c = []byte{ - // 199 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x29, 0x49, 0xcd, 0x4b, - 0x49, 0x2d, 0xca, 0xcd, 0xcc, 0x2b, 0xd1, 0x4f, 0x2e, 0xaa, 0x2c, 0x28, 0xc9, 0xd7, 0xcf, 0x4e, - 0xad, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x44, 0xc8, 0xea, 0x41, 0x64, 0xa5, - 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0xb2, 0xfa, 0x20, 0x16, 0x44, 0xa1, 0x52, 0x04, 0x17, 0x67, - 0x40, 0x69, 0x52, 0x4e, 0x66, 0xb2, 0x77, 0x6a, 0xa5, 0x90, 0x14, 0x17, 0x7b, 0x6a, 0x8a, 0x91, - 0xa9, 0xa9, 0xa1, 0xa5, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x8f, 0x07, 0x43, 0x10, 0x4c, 0x40, 0x48, - 0x8e, 0x8b, 0xb3, 0x38, 0x35, 0xb9, 0xc0, 0xc8, 0xd4, 0x2c, 0xdb, 0x50, 0x82, 0x09, 0x2a, 0x8b, - 0x10, 0xb2, 0xe2, 0x78, 0xb1, 0x40, 0x9e, 0xf1, 0xc5, 0x42, 0x79, 0x46, 0x27, 0x56, 0x2e, 0xe6, - 0xe2, 0xd2, 0x5c, 0xa7, 0xa0, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, - 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xb2, - 0x48, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x47, 0xf2, 0x05, 0x12, 0x13, - 0xe2, 0x4c, 0x0c, 0x1f, 0x26, 0xb1, 0x81, 0x25, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe8, - 0x1d, 0x1e, 0xe2, 0xfd, 0x00, 0x00, 0x00, -} - -func (this *PublicKey) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*PublicKey) - if !ok { - that2, ok := that.(PublicKey) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if that1.Sum == nil { - if this.Sum != nil { - return 1 - } - } else if this.Sum == nil { - return -1 - } else { - thisType := -1 - switch this.Sum.(type) { - case *PublicKey_Ed25519: - thisType = 0 - case *PublicKey_Secp256K1: - thisType = 1 - default: - panic(fmt.Sprintf("compare: unexpected type %T in oneof", this.Sum)) - } - that1Type := -1 - switch that1.Sum.(type) { - case *PublicKey_Ed25519: - that1Type = 0 - case *PublicKey_Secp256K1: - that1Type = 1 - default: - panic(fmt.Sprintf("compare: unexpected type %T in oneof", that1.Sum)) - } - if thisType == that1Type { - if c := this.Sum.Compare(that1.Sum); c != 0 { - return c - } - } else if thisType < that1Type { - return -1 - } else if thisType > that1Type { - return 1 - } - } - return 0 -} - -func (this *PublicKey_Ed25519) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*PublicKey_Ed25519) - if !ok { - that2, ok := that.(PublicKey_Ed25519) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if c := bytes.Compare(this.Ed25519, that1.Ed25519); c != 0 { - return c - } - return 0 -} - -func (this *PublicKey_Secp256K1) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*PublicKey_Secp256K1) - if !ok { - that2, ok := that.(PublicKey_Secp256K1) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if c := bytes.Compare(this.Secp256K1, that1.Secp256K1); c != 0 { - return c - } - return 0 -} - -func (this *PublicKey) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*PublicKey) - if !ok { - that2, ok := that.(PublicKey) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if that1.Sum == nil { - if this.Sum != nil { - return false - } - } else if this.Sum == nil { - return false - } else if !this.Sum.Equal(that1.Sum) { - return false - } - return true -} - -func (this *PublicKey_Ed25519) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*PublicKey_Ed25519) - if !ok { - that2, ok := that.(PublicKey_Ed25519) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !bytes.Equal(this.Ed25519, that1.Ed25519) { - return false - } - return true -} - -func (this *PublicKey_Secp256K1) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*PublicKey_Secp256K1) - if !ok { - that2, ok := that.(PublicKey_Secp256K1) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !bytes.Equal(this.Secp256K1, that1.Secp256K1) { - return false - } - return true -} - -func (m *PublicKey) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PublicKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PublicKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *PublicKey_Ed25519) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PublicKey_Ed25519) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Ed25519 != nil { - i -= len(m.Ed25519) - copy(dAtA[i:], m.Ed25519) - i = encodeVarintKeys(dAtA, i, uint64(len(m.Ed25519))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PublicKey_Secp256K1) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PublicKey_Secp256K1) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Secp256K1 != nil { - i -= len(m.Secp256K1) - copy(dAtA[i:], m.Secp256K1) - i = encodeVarintKeys(dAtA, i, uint64(len(m.Secp256K1))) - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} - -func encodeVarintKeys(dAtA []byte, offset int, v uint64) int { - offset -= sovKeys(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func (m *PublicKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *PublicKey_Ed25519) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Ed25519 != nil { - l = len(m.Ed25519) - n += 1 + l + sovKeys(uint64(l)) - } - return n -} - -func (m *PublicKey_Secp256K1) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Secp256K1 != nil { - l = len(m.Secp256K1) - n += 1 + l + sovKeys(uint64(l)) - } - return n -} - -func sovKeys(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} - -func sozKeys(x uint64) (n int) { - return sovKeys(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} - -func (m *PublicKey) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKeys - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PublicKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PublicKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ed25519", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKeys - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthKeys - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthKeys - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := make([]byte, postIndex-iNdEx) - copy(v, dAtA[iNdEx:postIndex]) - m.Sum = &PublicKey_Ed25519{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Secp256K1", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowKeys - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthKeys - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthKeys - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := make([]byte, postIndex-iNdEx) - copy(v, dAtA[iNdEx:postIndex]) - m.Sum = &PublicKey_Secp256K1{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipKeys(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthKeys - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipKeys(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, ErrIntOverflowKeys - } - 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, ErrIntOverflowKeys - } - 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, ErrIntOverflowKeys - } - 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, ErrInvalidLengthKeys - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupKeys - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthKeys - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthKeys = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowKeys = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupKeys = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/proto/tendermint/crypto/proof.pb.go b/third_party/proto/tendermint/crypto/proof.pb.go deleted file mode 100644 index 7437cfafec..0000000000 --- a/third_party/proto/tendermint/crypto/proof.pb.go +++ /dev/null @@ -1,1458 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: tendermint/crypto/proof.proto - -package crypto - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal - -var ( - _ = fmt.Errorf - _ = math.Inf -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Proof struct { - Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` - Index int64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` - LeafHash []byte `protobuf:"bytes,3,opt,name=leaf_hash,json=leafHash,proto3" json:"leaf_hash,omitempty"` - Aunts [][]byte `protobuf:"bytes,4,rep,name=aunts,proto3" json:"aunts,omitempty"` -} - -func (m *Proof) Reset() { *m = Proof{} } -func (m *Proof) String() string { return proto.CompactTextString(m) } -func (*Proof) ProtoMessage() {} -func (*Proof) Descriptor() ([]byte, []int) { - return fileDescriptor_6b60b6ba2ab5b856, []int{0} -} - -func (m *Proof) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *Proof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Proof.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *Proof) XXX_Merge(src proto.Message) { - xxx_messageInfo_Proof.Merge(m, src) -} - -func (m *Proof) XXX_Size() int { - return m.Size() -} - -func (m *Proof) XXX_DiscardUnknown() { - xxx_messageInfo_Proof.DiscardUnknown(m) -} - -var xxx_messageInfo_Proof proto.InternalMessageInfo - -func (m *Proof) GetTotal() int64 { - if m != nil { - return m.Total - } - return 0 -} - -func (m *Proof) GetIndex() int64 { - if m != nil { - return m.Index - } - return 0 -} - -func (m *Proof) GetLeafHash() []byte { - if m != nil { - return m.LeafHash - } - return nil -} - -func (m *Proof) GetAunts() [][]byte { - if m != nil { - return m.Aunts - } - return nil -} - -type ValueOp struct { - // Encoded in ProofOp.Key. - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - // To encode in ProofOp.Data - Proof *Proof `protobuf:"bytes,2,opt,name=proof,proto3" json:"proof,omitempty"` -} - -func (m *ValueOp) Reset() { *m = ValueOp{} } -func (m *ValueOp) String() string { return proto.CompactTextString(m) } -func (*ValueOp) ProtoMessage() {} -func (*ValueOp) Descriptor() ([]byte, []int) { - return fileDescriptor_6b60b6ba2ab5b856, []int{1} -} - -func (m *ValueOp) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *ValueOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValueOp.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *ValueOp) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValueOp.Merge(m, src) -} - -func (m *ValueOp) XXX_Size() int { - return m.Size() -} - -func (m *ValueOp) XXX_DiscardUnknown() { - xxx_messageInfo_ValueOp.DiscardUnknown(m) -} - -var xxx_messageInfo_ValueOp proto.InternalMessageInfo - -func (m *ValueOp) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *ValueOp) GetProof() *Proof { - if m != nil { - return m.Proof - } - return nil -} - -type DominoOp struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Input string `protobuf:"bytes,2,opt,name=input,proto3" json:"input,omitempty"` - Output string `protobuf:"bytes,3,opt,name=output,proto3" json:"output,omitempty"` -} - -func (m *DominoOp) Reset() { *m = DominoOp{} } -func (m *DominoOp) String() string { return proto.CompactTextString(m) } -func (*DominoOp) ProtoMessage() {} -func (*DominoOp) Descriptor() ([]byte, []int) { - return fileDescriptor_6b60b6ba2ab5b856, []int{2} -} - -func (m *DominoOp) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *DominoOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DominoOp.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *DominoOp) XXX_Merge(src proto.Message) { - xxx_messageInfo_DominoOp.Merge(m, src) -} - -func (m *DominoOp) XXX_Size() int { - return m.Size() -} - -func (m *DominoOp) XXX_DiscardUnknown() { - xxx_messageInfo_DominoOp.DiscardUnknown(m) -} - -var xxx_messageInfo_DominoOp proto.InternalMessageInfo - -func (m *DominoOp) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *DominoOp) GetInput() string { - if m != nil { - return m.Input - } - return "" -} - -func (m *DominoOp) GetOutput() string { - if m != nil { - return m.Output - } - return "" -} - -// ProofOp defines an operation used for calculating Merkle root -// The data could be arbitrary format, providing necessary data -// for example neighbouring node hash -type ProofOp struct { - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` -} - -func (m *ProofOp) Reset() { *m = ProofOp{} } -func (m *ProofOp) String() string { return proto.CompactTextString(m) } -func (*ProofOp) ProtoMessage() {} -func (*ProofOp) Descriptor() ([]byte, []int) { - return fileDescriptor_6b60b6ba2ab5b856, []int{3} -} - -func (m *ProofOp) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *ProofOp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProofOp.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *ProofOp) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProofOp.Merge(m, src) -} - -func (m *ProofOp) XXX_Size() int { - return m.Size() -} - -func (m *ProofOp) XXX_DiscardUnknown() { - xxx_messageInfo_ProofOp.DiscardUnknown(m) -} - -var xxx_messageInfo_ProofOp proto.InternalMessageInfo - -func (m *ProofOp) GetType() string { - if m != nil { - return m.Type - } - return "" -} - -func (m *ProofOp) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func (m *ProofOp) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -// ProofOps is Merkle proof defined by the list of ProofOps -type ProofOps struct { - Ops []ProofOp `protobuf:"bytes,1,rep,name=ops,proto3" json:"ops"` -} - -func (m *ProofOps) Reset() { *m = ProofOps{} } -func (m *ProofOps) String() string { return proto.CompactTextString(m) } -func (*ProofOps) ProtoMessage() {} -func (*ProofOps) Descriptor() ([]byte, []int) { - return fileDescriptor_6b60b6ba2ab5b856, []int{4} -} - -func (m *ProofOps) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *ProofOps) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProofOps.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *ProofOps) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProofOps.Merge(m, src) -} - -func (m *ProofOps) XXX_Size() int { - return m.Size() -} - -func (m *ProofOps) XXX_DiscardUnknown() { - xxx_messageInfo_ProofOps.DiscardUnknown(m) -} - -var xxx_messageInfo_ProofOps proto.InternalMessageInfo - -func (m *ProofOps) GetOps() []ProofOp { - if m != nil { - return m.Ops - } - return nil -} - -func init() { - proto.RegisterType((*Proof)(nil), "tendermint.crypto.Proof") - proto.RegisterType((*ValueOp)(nil), "tendermint.crypto.ValueOp") - proto.RegisterType((*DominoOp)(nil), "tendermint.crypto.DominoOp") - proto.RegisterType((*ProofOp)(nil), "tendermint.crypto.ProofOp") - proto.RegisterType((*ProofOps)(nil), "tendermint.crypto.ProofOps") -} - -func init() { proto.RegisterFile("tendermint/crypto/proof.proto", fileDescriptor_6b60b6ba2ab5b856) } - -var fileDescriptor_6b60b6ba2ab5b856 = []byte{ - // 351 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xbb, 0x4e, 0xc3, 0x30, - 0x14, 0x4d, 0xea, 0xf4, 0x75, 0xdb, 0x01, 0xac, 0x0a, 0x45, 0x45, 0x84, 0x28, 0x53, 0xa6, 0x44, - 0x2a, 0x0b, 0x13, 0x43, 0x61, 0x40, 0x30, 0x14, 0x79, 0x60, 0x60, 0x41, 0x6e, 0xeb, 0x36, 0x11, - 0x6d, 0x6c, 0x25, 0x8e, 0x44, 0xff, 0x82, 0xcf, 0xea, 0xd8, 0x91, 0x09, 0xa1, 0xf6, 0x47, 0x90, - 0xed, 0xa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 0xca, 0xd2, 0xf8, 0x37, 0xbe, 0xb6, 0x2f, - 0x8b, 0xc1, 0x99, 0x52, 0x49, 0xab, 0x77, 0x6b, 0x1c, 0xdc, 0x40, 0xab, 0x0a, 0x29, 0xf0, 0x00, - 0x10, 0x17, 0x85, 0x6b, 0xfb, 0x28, 0xec, 0x0c, 0xfa, 0xff, 0x3d, 0x65, 0x24, 0x86, 0xce, 0xfa, - 0xeb, 0xd2, 0x22, 0x6a, 0x78, 0x48, 0xd6, 0x5b, 0xcf, 0xde, 0x6c, 0x3d, 0xfb, 0x7b, 0xeb, 0xd9, - 0x1f, 0x3b, 0xcf, 0xda, 0xec, 0x3c, 0xeb, 0x73, 0xe7, 0x59, 0x2f, 0xd7, 0xf3, 0x54, 0x26, 0xe5, - 0x38, 0x9a, 0xf0, 0x65, 0x7c, 0xb0, 0xf2, 0x03, 0x68, 0x56, 0x7a, 0xf4, 0x1d, 0xc6, 0x0d, 0x6d, - 0x5c, 0xfd, 0x04, 0x00, 0x00, 0xff, 0xff, 0x43, 0x5d, 0xb9, 0x45, 0x2a, 0x02, 0x00, 0x00, -} - -func (m *Proof) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Proof) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Proof) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Aunts) > 0 { - for iNdEx := len(m.Aunts) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Aunts[iNdEx]) - copy(dAtA[i:], m.Aunts[iNdEx]) - i = encodeVarintProof(dAtA, i, uint64(len(m.Aunts[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - if len(m.LeafHash) > 0 { - i -= len(m.LeafHash) - copy(dAtA[i:], m.LeafHash) - i = encodeVarintProof(dAtA, i, uint64(len(m.LeafHash))) - i-- - dAtA[i] = 0x1a - } - if m.Index != 0 { - i = encodeVarintProof(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x10 - } - if m.Total != 0 { - i = encodeVarintProof(dAtA, i, uint64(m.Total)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ValueOp) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ValueOp) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ValueOp) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Proof != nil { - { - size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProof(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintProof(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *DominoOp) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DominoOp) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DominoOp) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Output) > 0 { - i -= len(m.Output) - copy(dAtA[i:], m.Output) - i = encodeVarintProof(dAtA, i, uint64(len(m.Output))) - i-- - dAtA[i] = 0x1a - } - if len(m.Input) > 0 { - i -= len(m.Input) - copy(dAtA[i:], m.Input) - i = encodeVarintProof(dAtA, i, uint64(len(m.Input))) - i-- - dAtA[i] = 0x12 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintProof(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ProofOp) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProofOp) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProofOp) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintProof(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x1a - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintProof(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0x12 - } - if len(m.Type) > 0 { - i -= len(m.Type) - copy(dAtA[i:], m.Type) - i = encodeVarintProof(dAtA, i, uint64(len(m.Type))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ProofOps) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProofOps) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProofOps) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Ops) > 0 { - for iNdEx := len(m.Ops) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Ops[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintProof(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintProof(dAtA []byte, offset int, v uint64) int { - offset -= sovProof(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func (m *Proof) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Total != 0 { - n += 1 + sovProof(uint64(m.Total)) - } - if m.Index != 0 { - n += 1 + sovProof(uint64(m.Index)) - } - l = len(m.LeafHash) - if l > 0 { - n += 1 + l + sovProof(uint64(l)) - } - if len(m.Aunts) > 0 { - for _, b := range m.Aunts { - l = len(b) - n += 1 + l + sovProof(uint64(l)) - } - } - return n -} - -func (m *ValueOp) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovProof(uint64(l)) - } - if m.Proof != nil { - l = m.Proof.Size() - n += 1 + l + sovProof(uint64(l)) - } - return n -} - -func (m *DominoOp) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovProof(uint64(l)) - } - l = len(m.Input) - if l > 0 { - n += 1 + l + sovProof(uint64(l)) - } - l = len(m.Output) - if l > 0 { - n += 1 + l + sovProof(uint64(l)) - } - return n -} - -func (m *ProofOp) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Type) - if l > 0 { - n += 1 + l + sovProof(uint64(l)) - } - l = len(m.Key) - if l > 0 { - n += 1 + l + sovProof(uint64(l)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovProof(uint64(l)) - } - return n -} - -func (m *ProofOps) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Ops) > 0 { - for _, e := range m.Ops { - l = e.Size() - n += 1 + l + sovProof(uint64(l)) - } - } - return n -} - -func sovProof(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} - -func sozProof(x uint64) (n int) { - return sovProof(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} - -func (m *Proof) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Proof: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Proof: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) - } - m.Total = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Total |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LeafHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProof - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProof - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LeafHash = append(m.LeafHash[:0], dAtA[iNdEx:postIndex]...) - if m.LeafHash == nil { - m.LeafHash = []byte{} - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Aunts", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProof - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProof - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Aunts = append(m.Aunts, make([]byte, postIndex-iNdEx)) - copy(m.Aunts[len(m.Aunts)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProof(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProof - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *ValueOp) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ValueOp: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValueOp: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProof - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProof - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProof - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProof - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Proof == nil { - m.Proof = &Proof{} - } - if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProof(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProof - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *DominoOp) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DominoOp: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DominoOp: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - 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 ErrInvalidLengthProof - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProof - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Input", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - 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 ErrInvalidLengthProof - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProof - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Input = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Output", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - 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 ErrInvalidLengthProof - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProof - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Output = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProof(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProof - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *ProofOp) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ProofOp: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProofOp: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - 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 ErrInvalidLengthProof - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthProof - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Type = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProof - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProof - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthProof - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthProof - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProof(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProof - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *ProofOps) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ProofOps: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProofOps: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Ops", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProof - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthProof - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthProof - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Ops = append(m.Ops, ProofOp{}) - if err := m.Ops[len(m.Ops)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipProof(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthProof - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipProof(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, ErrIntOverflowProof - } - 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, ErrIntOverflowProof - } - 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, ErrIntOverflowProof - } - 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, ErrInvalidLengthProof - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupProof - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthProof - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthProof = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowProof = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupProof = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/proto/tendermint/libs/bits/types.pb.go b/third_party/proto/tendermint/libs/bits/types.pb.go deleted file mode 100644 index af529c7936..0000000000 --- a/third_party/proto/tendermint/libs/bits/types.pb.go +++ /dev/null @@ -1,421 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: tendermint/libs/bits/types.proto - -package bits - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - proto "github.com/gogo/protobuf/proto" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal - -var ( - _ = fmt.Errorf - _ = math.Inf -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type BitArray struct { - Bits int64 `protobuf:"varint,1,opt,name=bits,proto3" json:"bits,omitempty"` - Elems []uint64 `protobuf:"varint,2,rep,packed,name=elems,proto3" json:"elems,omitempty"` -} - -func (m *BitArray) Reset() { *m = BitArray{} } -func (m *BitArray) String() string { return proto.CompactTextString(m) } -func (*BitArray) ProtoMessage() {} -func (*BitArray) Descriptor() ([]byte, []int) { - return fileDescriptor_e91ab2672920d7d4, []int{0} -} - -func (m *BitArray) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *BitArray) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BitArray.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *BitArray) XXX_Merge(src proto.Message) { - xxx_messageInfo_BitArray.Merge(m, src) -} - -func (m *BitArray) XXX_Size() int { - return m.Size() -} - -func (m *BitArray) XXX_DiscardUnknown() { - xxx_messageInfo_BitArray.DiscardUnknown(m) -} - -var xxx_messageInfo_BitArray proto.InternalMessageInfo - -func (m *BitArray) GetBits() int64 { - if m != nil { - return m.Bits - } - return 0 -} - -func (m *BitArray) GetElems() []uint64 { - if m != nil { - return m.Elems - } - return nil -} - -func init() { - proto.RegisterType((*BitArray)(nil), "tendermint.libs.bits.BitArray") -} - -func init() { proto.RegisterFile("tendermint/libs/bits/types.proto", fileDescriptor_e91ab2672920d7d4) } - -var fileDescriptor_e91ab2672920d7d4 = []byte{ - // 168 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x28, 0x49, 0xcd, 0x4b, - 0x49, 0x2d, 0xca, 0xcd, 0xcc, 0x2b, 0xd1, 0xcf, 0xc9, 0x4c, 0x2a, 0xd6, 0x4f, 0xca, 0x2c, 0x29, - 0xd6, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x41, 0xa8, - 0xd0, 0x03, 0xa9, 0xd0, 0x03, 0xa9, 0x50, 0x32, 0xe1, 0xe2, 0x70, 0xca, 0x2c, 0x71, 0x2c, 0x2a, - 0x4a, 0xac, 0x14, 0x12, 0xe2, 0x62, 0x01, 0x89, 0x49, 0x30, 0x2a, 0x30, 0x6a, 0x30, 0x07, 0x81, - 0xd9, 0x42, 0x22, 0x5c, 0xac, 0xa9, 0x39, 0xa9, 0xb9, 0xc5, 0x12, 0x4c, 0x0a, 0xcc, 0x1a, 0x2c, - 0x41, 0x10, 0x8e, 0x53, 0xe8, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, - 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x59, - 0xa7, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x23, 0x39, 0x09, 0x89, 0x09, - 0x76, 0x8d, 0x3e, 0x36, 0xe7, 0x26, 0xb1, 0x81, 0xe5, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x5b, 0x0c, 0xe3, 0x3e, 0xcd, 0x00, 0x00, 0x00, -} - -func (m *BitArray) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BitArray) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BitArray) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Elems) > 0 { - dAtA2 := make([]byte, len(m.Elems)*10) - var j1 int - for _, num := range m.Elems { - for num >= 1<<7 { - dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j1++ - } - dAtA2[j1] = uint8(num) - j1++ - } - i -= j1 - copy(dAtA[i:], dAtA2[:j1]) - i = encodeVarintTypes(dAtA, i, uint64(j1)) - i-- - dAtA[i] = 0x12 - } - if m.Bits != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Bits)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func (m *BitArray) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Bits != 0 { - n += 1 + sovTypes(uint64(m.Bits)) - } - if len(m.Elems) > 0 { - l = 0 - for _, e := range m.Elems { - l += sovTypes(uint64(e)) - } - n += 1 + sovTypes(uint64(l)) + l - } - return n -} - -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 *BitArray) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BitArray: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BitArray: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Bits", wireType) - } - m.Bits = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Bits |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Elems = append(m.Elems, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } - } - elementCount = count - if elementCount != 0 && len(m.Elems) == 0 { - m.Elems = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Elems = append(m.Elems, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field Elems", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipTypes(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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/proto/tendermint/mempool/types.pb.go b/third_party/proto/tendermint/mempool/types.pb.go deleted file mode 100644 index 95374d3343..0000000000 --- a/third_party/proto/tendermint/mempool/types.pb.go +++ /dev/null @@ -1,576 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: tendermint/mempool/types.proto - -package mempool - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - proto "github.com/gogo/protobuf/proto" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal - -var ( - _ = fmt.Errorf - _ = math.Inf -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Txs struct { - Txs [][]byte `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` -} - -func (m *Txs) Reset() { *m = Txs{} } -func (m *Txs) String() string { return proto.CompactTextString(m) } -func (*Txs) ProtoMessage() {} -func (*Txs) Descriptor() ([]byte, []int) { - return fileDescriptor_2af51926fdbcbc05, []int{0} -} - -func (m *Txs) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *Txs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Txs.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *Txs) XXX_Merge(src proto.Message) { - xxx_messageInfo_Txs.Merge(m, src) -} - -func (m *Txs) XXX_Size() int { - return m.Size() -} - -func (m *Txs) XXX_DiscardUnknown() { - xxx_messageInfo_Txs.DiscardUnknown(m) -} - -var xxx_messageInfo_Txs proto.InternalMessageInfo - -func (m *Txs) GetTxs() [][]byte { - if m != nil { - return m.Txs - } - return nil -} - -type Message struct { - // Types that are valid to be assigned to Sum: - // *Message_Txs - Sum isMessage_Sum `protobuf_oneof:"sum"` -} - -func (m *Message) Reset() { *m = Message{} } -func (m *Message) String() string { return proto.CompactTextString(m) } -func (*Message) ProtoMessage() {} -func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_2af51926fdbcbc05, []int{1} -} - -func (m *Message) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Message.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *Message) XXX_Merge(src proto.Message) { - xxx_messageInfo_Message.Merge(m, src) -} - -func (m *Message) XXX_Size() int { - return m.Size() -} - -func (m *Message) XXX_DiscardUnknown() { - xxx_messageInfo_Message.DiscardUnknown(m) -} - -var xxx_messageInfo_Message proto.InternalMessageInfo - -type isMessage_Sum interface { - isMessage_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type Message_Txs struct { - Txs *Txs `protobuf:"bytes,1,opt,name=txs,proto3,oneof" json:"txs,omitempty"` -} - -func (*Message_Txs) isMessage_Sum() {} - -func (m *Message) GetSum() isMessage_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *Message) GetTxs() *Txs { - if x, ok := m.GetSum().(*Message_Txs); ok { - return x.Txs - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Message) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Message_Txs)(nil), - } -} - -func init() { - proto.RegisterType((*Txs)(nil), "tendermint.mempool.Txs") - proto.RegisterType((*Message)(nil), "tendermint.mempool.Message") -} - -func init() { proto.RegisterFile("tendermint/mempool/types.proto", fileDescriptor_2af51926fdbcbc05) } - -var fileDescriptor_2af51926fdbcbc05 = []byte{ - // 179 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2b, 0x49, 0xcd, 0x4b, - 0x49, 0x2d, 0xca, 0xcd, 0xcc, 0x2b, 0xd1, 0xcf, 0x4d, 0xcd, 0x2d, 0xc8, 0xcf, 0xcf, 0xd1, 0x2f, - 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x42, 0xc8, 0xeb, 0x41, - 0xe5, 0x95, 0xc4, 0xb9, 0x98, 0x43, 0x2a, 0x8a, 0x85, 0x04, 0xb8, 0x98, 0x4b, 0x2a, 0x8a, 0x25, - 0x18, 0x15, 0x98, 0x35, 0x78, 0x82, 0x40, 0x4c, 0x25, 0x5b, 0x2e, 0x76, 0xdf, 0xd4, 0xe2, 0xe2, - 0xc4, 0xf4, 0x54, 0x21, 0x6d, 0x98, 0x24, 0xa3, 0x06, 0xb7, 0x91, 0xb8, 0x1e, 0xa6, 0x29, 0x7a, - 0x21, 0x15, 0xc5, 0x1e, 0x0c, 0x60, 0x7d, 0x4e, 0xac, 0x5c, 0xcc, 0xc5, 0xa5, 0xb9, 0x4e, 0xc1, - 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, - 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0x65, 0x99, 0x9e, 0x59, 0x92, 0x51, - 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x8f, 0xe4, 0x60, 0x24, 0x26, 0xd8, 0xb5, 0xfa, 0x98, 0x9e, - 0x49, 0x62, 0x03, 0xcb, 0x18, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xca, 0xc3, 0xa0, 0xfc, 0xe9, - 0x00, 0x00, 0x00, -} - -func (m *Txs) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Txs) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Txs) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Txs) > 0 { - for iNdEx := len(m.Txs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Txs[iNdEx]) - copy(dAtA[i:], m.Txs[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Txs[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Message) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Message) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Message_Txs) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_Txs) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.Txs != nil { - { - size, err := m.Txs.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func (m *Txs) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Txs) > 0 { - for _, b := range m.Txs { - l = len(b) - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *Message) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *Message_Txs) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Txs != nil { - l = m.Txs.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -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 *Txs) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Txs: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Txs: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Txs", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Txs = append(m.Txs, make([]byte, postIndex-iNdEx)) - copy(m.Txs[len(m.Txs)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *Message) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Message: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Txs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &Txs{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_Txs{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipTypes(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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/proto/tendermint/p2p/conn.pb.go b/third_party/proto/tendermint/p2p/conn.pb.go deleted file mode 100644 index f6149d821a..0000000000 --- a/third_party/proto/tendermint/p2p/conn.pb.go +++ /dev/null @@ -1,1311 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: tendermint/p2p/conn.proto - -package p2p - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - - crypto "github.com/line/ostracon/proto/ostracon/crypto" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal - -var ( - _ = fmt.Errorf - _ = math.Inf -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type PacketPing struct{} - -func (m *PacketPing) Reset() { *m = PacketPing{} } -func (m *PacketPing) String() string { return proto.CompactTextString(m) } -func (*PacketPing) ProtoMessage() {} -func (*PacketPing) Descriptor() ([]byte, []int) { - return fileDescriptor_22474b5527c8fa9f, []int{0} -} - -func (m *PacketPing) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *PacketPing) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PacketPing.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *PacketPing) XXX_Merge(src proto.Message) { - xxx_messageInfo_PacketPing.Merge(m, src) -} - -func (m *PacketPing) XXX_Size() int { - return m.Size() -} - -func (m *PacketPing) XXX_DiscardUnknown() { - xxx_messageInfo_PacketPing.DiscardUnknown(m) -} - -var xxx_messageInfo_PacketPing proto.InternalMessageInfo - -type PacketPong struct{} - -func (m *PacketPong) Reset() { *m = PacketPong{} } -func (m *PacketPong) String() string { return proto.CompactTextString(m) } -func (*PacketPong) ProtoMessage() {} -func (*PacketPong) Descriptor() ([]byte, []int) { - return fileDescriptor_22474b5527c8fa9f, []int{1} -} - -func (m *PacketPong) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *PacketPong) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PacketPong.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *PacketPong) XXX_Merge(src proto.Message) { - xxx_messageInfo_PacketPong.Merge(m, src) -} - -func (m *PacketPong) XXX_Size() int { - return m.Size() -} - -func (m *PacketPong) XXX_DiscardUnknown() { - xxx_messageInfo_PacketPong.DiscardUnknown(m) -} - -var xxx_messageInfo_PacketPong proto.InternalMessageInfo - -type PacketMsg struct { - ChannelID int32 `protobuf:"varint,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` - EOF bool `protobuf:"varint,2,opt,name=eof,proto3" json:"eof,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` -} - -func (m *PacketMsg) Reset() { *m = PacketMsg{} } -func (m *PacketMsg) String() string { return proto.CompactTextString(m) } -func (*PacketMsg) ProtoMessage() {} -func (*PacketMsg) Descriptor() ([]byte, []int) { - return fileDescriptor_22474b5527c8fa9f, []int{2} -} - -func (m *PacketMsg) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *PacketMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PacketMsg.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *PacketMsg) XXX_Merge(src proto.Message) { - xxx_messageInfo_PacketMsg.Merge(m, src) -} - -func (m *PacketMsg) XXX_Size() int { - return m.Size() -} - -func (m *PacketMsg) XXX_DiscardUnknown() { - xxx_messageInfo_PacketMsg.DiscardUnknown(m) -} - -var xxx_messageInfo_PacketMsg proto.InternalMessageInfo - -func (m *PacketMsg) GetChannelID() int32 { - if m != nil { - return m.ChannelID - } - return 0 -} - -func (m *PacketMsg) GetEOF() bool { - if m != nil { - return m.EOF - } - return false -} - -func (m *PacketMsg) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -type Packet struct { - // Types that are valid to be assigned to Sum: - // *Packet_PacketPing - // *Packet_PacketPong - // *Packet_PacketMsg - Sum isPacket_Sum `protobuf_oneof:"sum"` -} - -func (m *Packet) Reset() { *m = Packet{} } -func (m *Packet) String() string { return proto.CompactTextString(m) } -func (*Packet) ProtoMessage() {} -func (*Packet) Descriptor() ([]byte, []int) { - return fileDescriptor_22474b5527c8fa9f, []int{3} -} - -func (m *Packet) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *Packet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Packet.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *Packet) XXX_Merge(src proto.Message) { - xxx_messageInfo_Packet.Merge(m, src) -} - -func (m *Packet) XXX_Size() int { - return m.Size() -} - -func (m *Packet) XXX_DiscardUnknown() { - xxx_messageInfo_Packet.DiscardUnknown(m) -} - -var xxx_messageInfo_Packet proto.InternalMessageInfo - -type isPacket_Sum interface { - isPacket_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type Packet_PacketPing struct { - PacketPing *PacketPing `protobuf:"bytes,1,opt,name=packet_ping,json=packetPing,proto3,oneof" json:"packet_ping,omitempty"` -} -type Packet_PacketPong struct { - PacketPong *PacketPong `protobuf:"bytes,2,opt,name=packet_pong,json=packetPong,proto3,oneof" json:"packet_pong,omitempty"` -} -type Packet_PacketMsg struct { - PacketMsg *PacketMsg `protobuf:"bytes,3,opt,name=packet_msg,json=packetMsg,proto3,oneof" json:"packet_msg,omitempty"` -} - -func (*Packet_PacketPing) isPacket_Sum() {} -func (*Packet_PacketPong) isPacket_Sum() {} -func (*Packet_PacketMsg) isPacket_Sum() {} - -func (m *Packet) GetSum() isPacket_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *Packet) GetPacketPing() *PacketPing { - if x, ok := m.GetSum().(*Packet_PacketPing); ok { - return x.PacketPing - } - return nil -} - -func (m *Packet) GetPacketPong() *PacketPong { - if x, ok := m.GetSum().(*Packet_PacketPong); ok { - return x.PacketPong - } - return nil -} - -func (m *Packet) GetPacketMsg() *PacketMsg { - if x, ok := m.GetSum().(*Packet_PacketMsg); ok { - return x.PacketMsg - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Packet) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Packet_PacketPing)(nil), - (*Packet_PacketPong)(nil), - (*Packet_PacketMsg)(nil), - } -} - -type AuthSigMessage struct { - PubKey crypto.PublicKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key"` - Sig []byte `protobuf:"bytes,2,opt,name=sig,proto3" json:"sig,omitempty"` -} - -func (m *AuthSigMessage) Reset() { *m = AuthSigMessage{} } -func (m *AuthSigMessage) String() string { return proto.CompactTextString(m) } -func (*AuthSigMessage) ProtoMessage() {} -func (*AuthSigMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_22474b5527c8fa9f, []int{4} -} - -func (m *AuthSigMessage) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *AuthSigMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AuthSigMessage.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *AuthSigMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_AuthSigMessage.Merge(m, src) -} - -func (m *AuthSigMessage) XXX_Size() int { - return m.Size() -} - -func (m *AuthSigMessage) XXX_DiscardUnknown() { - xxx_messageInfo_AuthSigMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_AuthSigMessage proto.InternalMessageInfo - -func (m *AuthSigMessage) GetPubKey() crypto.PublicKey { - if m != nil { - return m.PubKey - } - return crypto.PublicKey{} -} - -func (m *AuthSigMessage) GetSig() []byte { - if m != nil { - return m.Sig - } - return nil -} - -func init() { - proto.RegisterType((*PacketPing)(nil), "tendermint.p2p.PacketPing") - proto.RegisterType((*PacketPong)(nil), "tendermint.p2p.PacketPong") - proto.RegisterType((*PacketMsg)(nil), "tendermint.p2p.PacketMsg") - proto.RegisterType((*Packet)(nil), "tendermint.p2p.Packet") - proto.RegisterType((*AuthSigMessage)(nil), "tendermint.p2p.AuthSigMessage") -} - -func init() { proto.RegisterFile("tendermint/p2p/conn.proto", fileDescriptor_22474b5527c8fa9f) } - -var fileDescriptor_22474b5527c8fa9f = []byte{ - // 395 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0x3d, 0x8f, 0xd3, 0x40, - 0x10, 0xf5, 0xe2, 0xbb, 0x1c, 0x99, 0x84, 0x13, 0x5a, 0x51, 0x24, 0xd1, 0xc9, 0x89, 0x5c, 0xa5, - 0x40, 0xb6, 0x64, 0x44, 0x03, 0xa2, 0xc0, 0x7c, 0x88, 0xd3, 0x29, 0xba, 0xc8, 0x74, 0x34, 0x96, - 0x3f, 0x96, 0xf5, 0x2a, 0xe7, 0xdd, 0x55, 0x76, 0x5d, 0xf8, 0x5f, 0xf0, 0xb3, 0x8e, 0xee, 0x4a, - 0xaa, 0x08, 0x39, 0x7f, 0x04, 0x79, 0x1d, 0x88, 0x23, 0x71, 0xdd, 0x7b, 0x33, 0xf3, 0xe6, 0x43, - 0xf3, 0x60, 0xaa, 0x09, 0xcf, 0xc9, 0xb6, 0x64, 0x5c, 0xfb, 0x32, 0x90, 0x7e, 0x26, 0x38, 0xf7, - 0xe4, 0x56, 0x68, 0x81, 0x2f, 0x8f, 0x29, 0x4f, 0x06, 0x72, 0xf6, 0x82, 0x0a, 0x2a, 0x4c, 0xca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 0x5b, 0xb8, 0x90, 0x55, 0x1a, 0x6f, 0x48, 0x7d, 0x38, 0xe7, 0xaa, - 0xdf, 0xb1, 0xfb, 0x89, 0xb7, 0xae, 0xd2, 0x3b, 0x96, 0xdd, 0x90, 0x3a, 0x3c, 0xbb, 0xdf, 0xcd, - 0xad, 0x68, 0x20, 0xab, 0xf4, 0x86, 0xd4, 0xf8, 0x39, 0xd8, 0x8a, 0x75, 0x87, 0x8c, 0xa3, 0x16, - 0x86, 0xb7, 0xf7, 0x8d, 0x83, 0x1e, 0x1a, 0x07, 0xfd, 0x6e, 0x1c, 0xf4, 0x63, 0xef, 0x58, 0x0f, - 0x7b, 0xc7, 0xfa, 0xb5, 0x77, 0xac, 0x6f, 0xaf, 0x29, 0xd3, 0x45, 0x95, 0x7a, 0x99, 0x28, 0xfd, - 0xde, 0xd7, 0xfb, 0x0e, 0x32, 0xee, 0x38, 0xb5, 0x54, 0x3a, 0x30, 0xd1, 0x57, 0x7f, 0x02, 0x00, - 0x00, 0xff, 0xff, 0x30, 0xfd, 0xb2, 0x8d, 0x6b, 0x02, 0x00, 0x00, -} - -func (m *PacketPing) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PacketPing) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PacketPing) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *PacketPong) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PacketPong) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PacketPong) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *PacketMsg) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PacketMsg) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PacketMsg) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintConn(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x1a - } - if m.EOF { - i-- - if m.EOF { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x10 - } - if m.ChannelID != 0 { - i = encodeVarintConn(dAtA, i, uint64(m.ChannelID)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Packet) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Packet) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Packet) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Packet_PacketPing) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Packet_PacketPing) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.PacketPing != nil { - { - size, err := m.PacketPing.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintConn(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Packet_PacketPong) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Packet_PacketPong) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.PacketPong != nil { - { - size, err := m.PacketPong.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintConn(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} - -func (m *Packet_PacketMsg) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Packet_PacketMsg) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.PacketMsg != nil { - { - size, err := m.PacketMsg.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintConn(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} - -func (m *AuthSigMessage) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *AuthSigMessage) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AuthSigMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Sig) > 0 { - i -= len(m.Sig) - copy(dAtA[i:], m.Sig) - i = encodeVarintConn(dAtA, i, uint64(len(m.Sig))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintConn(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintConn(dAtA []byte, offset int, v uint64) int { - offset -= sovConn(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func (m *PacketPing) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *PacketPong) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *PacketMsg) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ChannelID != 0 { - n += 1 + sovConn(uint64(m.ChannelID)) - } - if m.EOF { - n += 2 - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovConn(uint64(l)) - } - return n -} - -func (m *Packet) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *Packet_PacketPing) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PacketPing != nil { - l = m.PacketPing.Size() - n += 1 + l + sovConn(uint64(l)) - } - return n -} - -func (m *Packet_PacketPong) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PacketPong != nil { - l = m.PacketPong.Size() - n += 1 + l + sovConn(uint64(l)) - } - return n -} - -func (m *Packet_PacketMsg) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PacketMsg != nil { - l = m.PacketMsg.Size() - n += 1 + l + sovConn(uint64(l)) - } - return n -} - -func (m *AuthSigMessage) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.PubKey.Size() - n += 1 + l + sovConn(uint64(l)) - l = len(m.Sig) - if l > 0 { - n += 1 + l + sovConn(uint64(l)) - } - return n -} - -func sovConn(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} - -func sozConn(x uint64) (n int) { - return sovConn(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} - -func (m *PacketPing) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PacketPing: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PacketPing: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipConn(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthConn - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *PacketPong) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PacketPong: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PacketPong: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipConn(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthConn - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *PacketMsg) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PacketMsg: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PacketMsg: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ChannelID", wireType) - } - m.ChannelID = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ChannelID |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EOF", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.EOF = bool(v != 0) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthConn - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthConn - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipConn(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthConn - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *Packet) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Packet: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Packet: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PacketPing", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthConn - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthConn - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &PacketPing{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Packet_PacketPing{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PacketPong", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthConn - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthConn - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &PacketPong{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Packet_PacketPong{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PacketMsg", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthConn - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthConn - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &PacketMsg{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Packet_PacketMsg{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipConn(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthConn - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *AuthSigMessage) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: AuthSigMessage: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AuthSigMessage: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthConn - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthConn - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sig", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowConn - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthConn - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthConn - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sig = append(m.Sig[:0], dAtA[iNdEx:postIndex]...) - if m.Sig == nil { - m.Sig = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipConn(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthConn - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipConn(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, ErrIntOverflowConn - } - 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, ErrIntOverflowConn - } - 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, ErrIntOverflowConn - } - 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, ErrInvalidLengthConn - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupConn - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthConn - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthConn = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowConn = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupConn = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/proto/tendermint/p2p/conn.proto b/third_party/proto/tendermint/p2p/conn.proto deleted file mode 100644 index b12de6c827..0000000000 --- a/third_party/proto/tendermint/p2p/conn.proto +++ /dev/null @@ -1,30 +0,0 @@ -syntax = "proto3"; -package tendermint.p2p; - -option go_package = "github.com/tendermint/tendermint/proto/tendermint/p2p"; - -import "gogoproto/gogo.proto"; -import "tendermint/crypto/keys.proto"; - -message PacketPing {} - -message PacketPong {} - -message PacketMsg { - int32 channel_id = 1 [(gogoproto.customname) = "ChannelID"]; - bool eof = 2 [(gogoproto.customname) = "EOF"]; - bytes data = 3; -} - -message Packet { - oneof sum { - PacketPing packet_ping = 1; - PacketPong packet_pong = 2; - PacketMsg packet_msg = 3; - } -} - -message AuthSigMessage { - tendermint.crypto.PublicKey pub_key = 1 [(gogoproto.nullable) = false]; - bytes sig = 2; -} diff --git a/third_party/proto/tendermint/p2p/pex.pb.go b/third_party/proto/tendermint/p2p/pex.pb.go deleted file mode 100644 index 3252f41a29..0000000000 --- a/third_party/proto/tendermint/p2p/pex.pb.go +++ /dev/null @@ -1,796 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: tendermint/p2p/pex.proto - -package p2p - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal - -var ( - _ = fmt.Errorf - _ = math.Inf -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type PexRequest struct{} - -func (m *PexRequest) Reset() { *m = PexRequest{} } -func (m *PexRequest) String() string { return proto.CompactTextString(m) } -func (*PexRequest) ProtoMessage() {} -func (*PexRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_81c2f011fd13be57, []int{0} -} - -func (m *PexRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *PexRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PexRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *PexRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_PexRequest.Merge(m, src) -} - -func (m *PexRequest) XXX_Size() int { - return m.Size() -} - -func (m *PexRequest) XXX_DiscardUnknown() { - xxx_messageInfo_PexRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_PexRequest proto.InternalMessageInfo - -type PexAddrs struct { - Addrs []NetAddress `protobuf:"bytes,1,rep,name=addrs,proto3" json:"addrs"` -} - -func (m *PexAddrs) Reset() { *m = PexAddrs{} } -func (m *PexAddrs) String() string { return proto.CompactTextString(m) } -func (*PexAddrs) ProtoMessage() {} -func (*PexAddrs) Descriptor() ([]byte, []int) { - return fileDescriptor_81c2f011fd13be57, []int{1} -} - -func (m *PexAddrs) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *PexAddrs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PexAddrs.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *PexAddrs) XXX_Merge(src proto.Message) { - xxx_messageInfo_PexAddrs.Merge(m, src) -} - -func (m *PexAddrs) XXX_Size() int { - return m.Size() -} - -func (m *PexAddrs) XXX_DiscardUnknown() { - xxx_messageInfo_PexAddrs.DiscardUnknown(m) -} - -var xxx_messageInfo_PexAddrs proto.InternalMessageInfo - -func (m *PexAddrs) GetAddrs() []NetAddress { - if m != nil { - return m.Addrs - } - return nil -} - -type Message struct { - // Types that are valid to be assigned to Sum: - // *Message_PexRequest - // *Message_PexAddrs - Sum isMessage_Sum `protobuf_oneof:"sum"` -} - -func (m *Message) Reset() { *m = Message{} } -func (m *Message) String() string { return proto.CompactTextString(m) } -func (*Message) ProtoMessage() {} -func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_81c2f011fd13be57, []int{2} -} - -func (m *Message) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Message.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *Message) XXX_Merge(src proto.Message) { - xxx_messageInfo_Message.Merge(m, src) -} - -func (m *Message) XXX_Size() int { - return m.Size() -} - -func (m *Message) XXX_DiscardUnknown() { - xxx_messageInfo_Message.DiscardUnknown(m) -} - -var xxx_messageInfo_Message proto.InternalMessageInfo - -type isMessage_Sum interface { - isMessage_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type Message_PexRequest struct { - PexRequest *PexRequest `protobuf:"bytes,1,opt,name=pex_request,json=pexRequest,proto3,oneof" json:"pex_request,omitempty"` -} -type Message_PexAddrs struct { - PexAddrs *PexAddrs `protobuf:"bytes,2,opt,name=pex_addrs,json=pexAddrs,proto3,oneof" json:"pex_addrs,omitempty"` -} - -func (*Message_PexRequest) isMessage_Sum() {} -func (*Message_PexAddrs) isMessage_Sum() {} - -func (m *Message) GetSum() isMessage_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *Message) GetPexRequest() *PexRequest { - if x, ok := m.GetSum().(*Message_PexRequest); ok { - return x.PexRequest - } - return nil -} - -func (m *Message) GetPexAddrs() *PexAddrs { - if x, ok := m.GetSum().(*Message_PexAddrs); ok { - return x.PexAddrs - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Message) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Message_PexRequest)(nil), - (*Message_PexAddrs)(nil), - } -} - -func init() { - proto.RegisterType((*PexRequest)(nil), "tendermint.p2p.PexRequest") - proto.RegisterType((*PexAddrs)(nil), "tendermint.p2p.PexAddrs") - proto.RegisterType((*Message)(nil), "tendermint.p2p.Message") -} - -func init() { proto.RegisterFile("tendermint/p2p/pex.proto", fileDescriptor_81c2f011fd13be57) } - -var fileDescriptor_81c2f011fd13be57 = []byte{ - // 268 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x28, 0x49, 0xcd, 0x4b, - 0x49, 0x2d, 0xca, 0xcd, 0xcc, 0x2b, 0xd1, 0x2f, 0x30, 0x2a, 0xd0, 0x2f, 0x48, 0xad, 0xd0, 0x2b, - 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x43, 0xc8, 0xe8, 0x15, 0x18, 0x15, 0x48, 0x49, 0xa1, 0xa9, - 0x2c, 0xa9, 0x2c, 0x48, 0x2d, 0x86, 0xa8, 0x95, 0x12, 0x49, 0xcf, 0x4f, 0xcf, 0x07, 0x33, 0xf5, - 0x41, 0x2c, 0x88, 0xa8, 0x12, 0x0f, 0x17, 0x57, 0x40, 0x6a, 0x45, 0x50, 0x6a, 0x61, 0x69, 0x6a, - 0x71, 0x89, 0x92, 0x13, 0x17, 0x47, 0x40, 0x6a, 0x85, 0x63, 0x4a, 0x4a, 0x51, 0xb1, 0x90, 0x19, - 0x17, 0x6b, 0x22, 0x88, 0x21, 0xc1, 0xa8, 0xc0, 0xac, 0xc1, 0x6d, 0x24, 0xa5, 0x87, 0x6a, 0x97, - 0x9e, 0x5f, 0x6a, 0x09, 0x48, 0x61, 0x6a, 0x71, 0xb1, 0x13, 0xcb, 0x89, 0x7b, 0xf2, 0x0c, 0x41, - 0x10, 0xe5, 0x4a, 0x1d, 0x8c, 0x5c, 0xec, 0xbe, 0xa9, 0xc5, 0xc5, 0x89, 0xe9, 0xa9, 0x42, 0xb6, - 0x5c, 0xdc, 0x05, 0xa9, 0x15, 0xf1, 0x45, 0x10, 0xe3, 0x25, 0x18, 0x15, 0x18, 0xb1, 0x99, 0x84, - 0x70, 0x80, 0x07, 0x43, 0x10, 0x57, 0x01, 0x9c, 0x27, 0x64, 0xce, 0xc5, 0x09, 0xd2, 0x0e, 0x71, - 0x06, 0x13, 0x58, 0xb3, 0x04, 0x16, 0xcd, 0x60, 0xf7, 0x7a, 0x30, 0x04, 0x71, 0x14, 0x40, 0xd9, - 0x4e, 0xac, 0x5c, 0xcc, 0xc5, 0xa5, 0xb9, 0x4e, 0xfe, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, - 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78, - 0x2c, 0xc7, 0x10, 0x65, 0x9a, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x8f, - 0x14, 0x66, 0xc8, 0xc1, 0x07, 0x0e, 0x29, 0xd4, 0xf0, 0x4c, 0x62, 0x03, 0x8b, 0x1a, 0x03, 0x02, - 0x00, 0x00, 0xff, 0xff, 0x3c, 0x0b, 0xcb, 0x40, 0x92, 0x01, 0x00, 0x00, -} - -func (m *PexRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PexRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PexRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *PexAddrs) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PexAddrs) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PexAddrs) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Addrs) > 0 { - for iNdEx := len(m.Addrs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Addrs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPex(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Message) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Message) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Message_PexRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_PexRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.PexRequest != nil { - { - size, err := m.PexRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPex(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Message_PexAddrs) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_PexAddrs) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.PexAddrs != nil { - { - size, err := m.PexAddrs.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintPex(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} - -func encodeVarintPex(dAtA []byte, offset int, v uint64) int { - offset -= sovPex(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func (m *PexRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *PexAddrs) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Addrs) > 0 { - for _, e := range m.Addrs { - l = e.Size() - n += 1 + l + sovPex(uint64(l)) - } - } - return n -} - -func (m *Message) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *Message_PexRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PexRequest != nil { - l = m.PexRequest.Size() - n += 1 + l + sovPex(uint64(l)) - } - return n -} - -func (m *Message_PexAddrs) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PexAddrs != nil { - l = m.PexAddrs.Size() - n += 1 + l + sovPex(uint64(l)) - } - return n -} - -func sovPex(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} - -func sozPex(x uint64) (n int) { - return sovPex(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} - -func (m *PexRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPex - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PexRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PexRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipPex(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPex - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *PexAddrs) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPex - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PexAddrs: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PexAddrs: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Addrs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPex - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPex - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPex - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Addrs = append(m.Addrs, NetAddress{}) - if err := m.Addrs[len(m.Addrs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipPex(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPex - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *Message) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPex - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Message: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PexRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPex - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPex - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPex - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &PexRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_PexRequest{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PexAddrs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowPex - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthPex - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthPex - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &PexAddrs{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_PexAddrs{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipPex(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthPex - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipPex(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, ErrIntOverflowPex - } - 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, ErrIntOverflowPex - } - 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, ErrIntOverflowPex - } - 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, ErrInvalidLengthPex - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupPex - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthPex - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthPex = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowPex = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupPex = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/proto/tendermint/p2p/types.pb.go b/third_party/proto/tendermint/p2p/types.pb.go deleted file mode 100644 index 8fc8ec4679..0000000000 --- a/third_party/proto/tendermint/p2p/types.pb.go +++ /dev/null @@ -1,1430 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: tendermint/p2p/types.proto - -package p2p - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal - -var ( - _ = fmt.Errorf - _ = math.Inf -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type NetAddress struct { - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - IP string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` - Port uint32 `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"` -} - -func (m *NetAddress) Reset() { *m = NetAddress{} } -func (m *NetAddress) String() string { return proto.CompactTextString(m) } -func (*NetAddress) ProtoMessage() {} -func (*NetAddress) Descriptor() ([]byte, []int) { - return fileDescriptor_c8a29e659aeca578, []int{0} -} - -func (m *NetAddress) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *NetAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_NetAddress.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *NetAddress) XXX_Merge(src proto.Message) { - xxx_messageInfo_NetAddress.Merge(m, src) -} - -func (m *NetAddress) XXX_Size() int { - return m.Size() -} - -func (m *NetAddress) XXX_DiscardUnknown() { - xxx_messageInfo_NetAddress.DiscardUnknown(m) -} - -var xxx_messageInfo_NetAddress proto.InternalMessageInfo - -func (m *NetAddress) GetID() string { - if m != nil { - return m.ID - } - return "" -} - -func (m *NetAddress) GetIP() string { - if m != nil { - return m.IP - } - return "" -} - -func (m *NetAddress) GetPort() uint32 { - if m != nil { - return m.Port - } - return 0 -} - -type ProtocolVersion struct { - P2P uint64 `protobuf:"varint,1,opt,name=p2p,proto3" json:"p2p,omitempty"` - Block uint64 `protobuf:"varint,2,opt,name=block,proto3" json:"block,omitempty"` - App uint64 `protobuf:"varint,3,opt,name=app,proto3" json:"app,omitempty"` -} - -func (m *ProtocolVersion) Reset() { *m = ProtocolVersion{} } -func (m *ProtocolVersion) String() string { return proto.CompactTextString(m) } -func (*ProtocolVersion) ProtoMessage() {} -func (*ProtocolVersion) Descriptor() ([]byte, []int) { - return fileDescriptor_c8a29e659aeca578, []int{1} -} - -func (m *ProtocolVersion) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *ProtocolVersion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ProtocolVersion.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *ProtocolVersion) XXX_Merge(src proto.Message) { - xxx_messageInfo_ProtocolVersion.Merge(m, src) -} - -func (m *ProtocolVersion) XXX_Size() int { - return m.Size() -} - -func (m *ProtocolVersion) XXX_DiscardUnknown() { - xxx_messageInfo_ProtocolVersion.DiscardUnknown(m) -} - -var xxx_messageInfo_ProtocolVersion proto.InternalMessageInfo - -func (m *ProtocolVersion) GetP2P() uint64 { - if m != nil { - return m.P2P - } - return 0 -} - -func (m *ProtocolVersion) GetBlock() uint64 { - if m != nil { - return m.Block - } - return 0 -} - -func (m *ProtocolVersion) GetApp() uint64 { - if m != nil { - return m.App - } - return 0 -} - -type DefaultNodeInfo struct { - ProtocolVersion ProtocolVersion `protobuf:"bytes,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version"` - DefaultNodeID string `protobuf:"bytes,2,opt,name=default_node_id,json=defaultNodeId,proto3" json:"default_node_id,omitempty"` - ListenAddr string `protobuf:"bytes,3,opt,name=listen_addr,json=listenAddr,proto3" json:"listen_addr,omitempty"` - Network string `protobuf:"bytes,4,opt,name=network,proto3" json:"network,omitempty"` - Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"` - Channels []byte `protobuf:"bytes,6,opt,name=channels,proto3" json:"channels,omitempty"` - Moniker string `protobuf:"bytes,7,opt,name=moniker,proto3" json:"moniker,omitempty"` - Other DefaultNodeInfoOther `protobuf:"bytes,8,opt,name=other,proto3" json:"other"` -} - -func (m *DefaultNodeInfo) Reset() { *m = DefaultNodeInfo{} } -func (m *DefaultNodeInfo) String() string { return proto.CompactTextString(m) } -func (*DefaultNodeInfo) ProtoMessage() {} -func (*DefaultNodeInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_c8a29e659aeca578, []int{2} -} - -func (m *DefaultNodeInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *DefaultNodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DefaultNodeInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *DefaultNodeInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_DefaultNodeInfo.Merge(m, src) -} - -func (m *DefaultNodeInfo) XXX_Size() int { - return m.Size() -} - -func (m *DefaultNodeInfo) XXX_DiscardUnknown() { - xxx_messageInfo_DefaultNodeInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_DefaultNodeInfo proto.InternalMessageInfo - -func (m *DefaultNodeInfo) GetProtocolVersion() ProtocolVersion { - if m != nil { - return m.ProtocolVersion - } - return ProtocolVersion{} -} - -func (m *DefaultNodeInfo) GetDefaultNodeID() string { - if m != nil { - return m.DefaultNodeID - } - return "" -} - -func (m *DefaultNodeInfo) GetListenAddr() string { - if m != nil { - return m.ListenAddr - } - return "" -} - -func (m *DefaultNodeInfo) GetNetwork() string { - if m != nil { - return m.Network - } - return "" -} - -func (m *DefaultNodeInfo) GetVersion() string { - if m != nil { - return m.Version - } - return "" -} - -func (m *DefaultNodeInfo) GetChannels() []byte { - if m != nil { - return m.Channels - } - return nil -} - -func (m *DefaultNodeInfo) GetMoniker() string { - if m != nil { - return m.Moniker - } - return "" -} - -func (m *DefaultNodeInfo) GetOther() DefaultNodeInfoOther { - if m != nil { - return m.Other - } - return DefaultNodeInfoOther{} -} - -type DefaultNodeInfoOther struct { - TxIndex string `protobuf:"bytes,1,opt,name=tx_index,json=txIndex,proto3" json:"tx_index,omitempty"` - RPCAddress string `protobuf:"bytes,2,opt,name=rpc_address,json=rpcAddress,proto3" json:"rpc_address,omitempty"` -} - -func (m *DefaultNodeInfoOther) Reset() { *m = DefaultNodeInfoOther{} } -func (m *DefaultNodeInfoOther) String() string { return proto.CompactTextString(m) } -func (*DefaultNodeInfoOther) ProtoMessage() {} -func (*DefaultNodeInfoOther) Descriptor() ([]byte, []int) { - return fileDescriptor_c8a29e659aeca578, []int{3} -} - -func (m *DefaultNodeInfoOther) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *DefaultNodeInfoOther) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DefaultNodeInfoOther.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *DefaultNodeInfoOther) XXX_Merge(src proto.Message) { - xxx_messageInfo_DefaultNodeInfoOther.Merge(m, src) -} - -func (m *DefaultNodeInfoOther) XXX_Size() int { - return m.Size() -} - -func (m *DefaultNodeInfoOther) XXX_DiscardUnknown() { - xxx_messageInfo_DefaultNodeInfoOther.DiscardUnknown(m) -} - -var xxx_messageInfo_DefaultNodeInfoOther proto.InternalMessageInfo - -func (m *DefaultNodeInfoOther) GetTxIndex() string { - if m != nil { - return m.TxIndex - } - return "" -} - -func (m *DefaultNodeInfoOther) GetRPCAddress() string { - if m != nil { - return m.RPCAddress - } - return "" -} - -func init() { - proto.RegisterType((*NetAddress)(nil), "tendermint.p2p.NetAddress") - proto.RegisterType((*ProtocolVersion)(nil), "tendermint.p2p.ProtocolVersion") - proto.RegisterType((*DefaultNodeInfo)(nil), "tendermint.p2p.DefaultNodeInfo") - proto.RegisterType((*DefaultNodeInfoOther)(nil), "tendermint.p2p.DefaultNodeInfoOther") -} - -func init() { proto.RegisterFile("tendermint/p2p/types.proto", fileDescriptor_c8a29e659aeca578) } - -var fileDescriptor_c8a29e659aeca578 = []byte{ - // 479 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0x3d, 0x8f, 0xda, 0x40, - 0x10, 0xc5, 0xc6, 0x7c, 0xdc, 0x10, 0x8e, 0xcb, 0x0a, 0x45, 0x3e, 0x0a, 0x1b, 0xa1, 0x14, 0x54, - 0x20, 0x39, 0x4a, 0x91, 0x2e, 0x21, 0x34, 0x34, 0x77, 0xd6, 0x2a, 0x4a, 0x91, 0xc6, 0x02, 0xef, - 0x1e, 0xac, 0x30, 0xbb, 0xab, 0xf5, 0x5e, 0x42, 0xfe, 0x45, 0x7e, 0xd6, 0x95, 0x57, 0xa6, 0xb2, - 0x22, 0x53, 0xe6, 0x4f, 0x44, 0x5e, 0xfb, 0x12, 0x1f, 0x4a, 0x37, 0x6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, 0xaf, 0xf1, 0xe5, 0xed, 0x96, 0xe9, 0xdd, 0xfd, 0x66, - 0x16, 0x8b, 0xc3, 0xbc, 0x66, 0xf0, 0xba, 0xd7, 0x8d, 0x8d, 0x9f, 0x9b, 0x7f, 0xd3, 0x36, 0xd9, - 0x37, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x6c, 0xb3, 0x68, 0x97, 0x15, 0x03, 0x00, 0x00, -} - -func (m *NetAddress) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *NetAddress) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *NetAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Port != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Port)) - i-- - dAtA[i] = 0x18 - } - if len(m.IP) > 0 { - i -= len(m.IP) - copy(dAtA[i:], m.IP) - i = encodeVarintTypes(dAtA, i, uint64(len(m.IP))) - i-- - dAtA[i] = 0x12 - } - if len(m.ID) > 0 { - i -= len(m.ID) - copy(dAtA[i:], m.ID) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ProtocolVersion) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProtocolVersion) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProtocolVersion) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.App != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.App)) - i-- - dAtA[i] = 0x18 - } - if m.Block != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Block)) - i-- - dAtA[i] = 0x10 - } - if m.P2P != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.P2P)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *DefaultNodeInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DefaultNodeInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DefaultNodeInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Other.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - if len(m.Moniker) > 0 { - i -= len(m.Moniker) - copy(dAtA[i:], m.Moniker) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Moniker))) - i-- - dAtA[i] = 0x3a - } - if len(m.Channels) > 0 { - i -= len(m.Channels) - copy(dAtA[i:], m.Channels) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Channels))) - i-- - dAtA[i] = 0x32 - } - if len(m.Version) > 0 { - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0x2a - } - if len(m.Network) > 0 { - i -= len(m.Network) - copy(dAtA[i:], m.Network) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Network))) - i-- - dAtA[i] = 0x22 - } - if len(m.ListenAddr) > 0 { - i -= len(m.ListenAddr) - copy(dAtA[i:], m.ListenAddr) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ListenAddr))) - i-- - dAtA[i] = 0x1a - } - if len(m.DefaultNodeID) > 0 { - i -= len(m.DefaultNodeID) - copy(dAtA[i:], m.DefaultNodeID) - i = encodeVarintTypes(dAtA, i, uint64(len(m.DefaultNodeID))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.ProtocolVersion.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *DefaultNodeInfoOther) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DefaultNodeInfoOther) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DefaultNodeInfoOther) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.RPCAddress) > 0 { - i -= len(m.RPCAddress) - copy(dAtA[i:], m.RPCAddress) - i = encodeVarintTypes(dAtA, i, uint64(len(m.RPCAddress))) - i-- - dAtA[i] = 0x12 - } - if len(m.TxIndex) > 0 { - i -= len(m.TxIndex) - copy(dAtA[i:], m.TxIndex) - i = encodeVarintTypes(dAtA, i, uint64(len(m.TxIndex))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func (m *NetAddress) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ID) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.IP) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Port != 0 { - n += 1 + sovTypes(uint64(m.Port)) - } - return n -} - -func (m *ProtocolVersion) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.P2P != 0 { - n += 1 + sovTypes(uint64(m.P2P)) - } - if m.Block != 0 { - n += 1 + sovTypes(uint64(m.Block)) - } - if m.App != 0 { - n += 1 + sovTypes(uint64(m.App)) - } - return n -} - -func (m *DefaultNodeInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ProtocolVersion.Size() - n += 1 + l + sovTypes(uint64(l)) - l = len(m.DefaultNodeID) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.ListenAddr) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Network) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Version) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Channels) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Moniker) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = m.Other.Size() - n += 1 + l + sovTypes(uint64(l)) - return n -} - -func (m *DefaultNodeInfoOther) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.TxIndex) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.RPCAddress) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -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 *NetAddress) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: NetAddress: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: NetAddress: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field IP", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.IP = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) - } - m.Port = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Port |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *ProtocolVersion) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ProtocolVersion: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProtocolVersion: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field P2P", wireType) - } - m.P2P = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.P2P |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) - } - m.Block = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Block |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field App", wireType) - } - m.App = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.App |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *DefaultNodeInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DefaultNodeInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DefaultNodeInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProtocolVersion", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ProtocolVersion.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DefaultNodeID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DefaultNodeID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListenAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ListenAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Network = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Channels", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Channels = append(m.Channels[:0], dAtA[iNdEx:postIndex]...) - if m.Channels == nil { - m.Channels = []byte{} - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Moniker = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Other", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Other.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *DefaultNodeInfoOther) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DefaultNodeInfoOther: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DefaultNodeInfoOther: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TxIndex", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TxIndex = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RPCAddress", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RPCAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipTypes(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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/proto/tendermint/privval/types.pb.go b/third_party/proto/tendermint/privval/types.pb.go deleted file mode 100644 index ab7ae8e2e1..0000000000 --- a/third_party/proto/tendermint/privval/types.pb.go +++ /dev/null @@ -1,2883 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: tendermint/privval/types.proto - -package privval - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - - crypto "github.com/line/ostracon/proto/ostracon/crypto" - types "github.com/line/ostracon/proto/ostracon/types" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal - -var ( - _ = fmt.Errorf - _ = math.Inf -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Errors int32 - -const ( - Errors_ERRORS_UNKNOWN Errors = 0 - Errors_ERRORS_UNEXPECTED_RESPONSE Errors = 1 - Errors_ERRORS_NO_CONNECTION Errors = 2 - Errors_ERRORS_CONNECTION_TIMEOUT Errors = 3 - Errors_ERRORS_READ_TIMEOUT Errors = 4 - Errors_ERRORS_WRITE_TIMEOUT Errors = 5 -) - -var Errors_name = map[int32]string{ - 0: "ERRORS_UNKNOWN", - 1: "ERRORS_UNEXPECTED_RESPONSE", - 2: "ERRORS_NO_CONNECTION", - 3: "ERRORS_CONNECTION_TIMEOUT", - 4: "ERRORS_READ_TIMEOUT", - 5: "ERRORS_WRITE_TIMEOUT", -} - -var Errors_value = map[string]int32{ - "ERRORS_UNKNOWN": 0, - "ERRORS_UNEXPECTED_RESPONSE": 1, - "ERRORS_NO_CONNECTION": 2, - "ERRORS_CONNECTION_TIMEOUT": 3, - "ERRORS_READ_TIMEOUT": 4, - "ERRORS_WRITE_TIMEOUT": 5, -} - -func (x Errors) String() string { - return proto.EnumName(Errors_name, int32(x)) -} - -func (Errors) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_cb4e437a5328cf9c, []int{0} -} - -type RemoteSignerError struct { - Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` -} - -func (m *RemoteSignerError) Reset() { *m = RemoteSignerError{} } -func (m *RemoteSignerError) String() string { return proto.CompactTextString(m) } -func (*RemoteSignerError) ProtoMessage() {} -func (*RemoteSignerError) Descriptor() ([]byte, []int) { - return fileDescriptor_cb4e437a5328cf9c, []int{0} -} - -func (m *RemoteSignerError) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *RemoteSignerError) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RemoteSignerError.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *RemoteSignerError) XXX_Merge(src proto.Message) { - xxx_messageInfo_RemoteSignerError.Merge(m, src) -} - -func (m *RemoteSignerError) XXX_Size() int { - return m.Size() -} - -func (m *RemoteSignerError) XXX_DiscardUnknown() { - xxx_messageInfo_RemoteSignerError.DiscardUnknown(m) -} - -var xxx_messageInfo_RemoteSignerError proto.InternalMessageInfo - -func (m *RemoteSignerError) GetCode() int32 { - if m != nil { - return m.Code - } - return 0 -} - -func (m *RemoteSignerError) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -// PubKeyRequest requests the consensus public key from the remote signer. -type PubKeyRequest struct { - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` -} - -func (m *PubKeyRequest) Reset() { *m = PubKeyRequest{} } -func (m *PubKeyRequest) String() string { return proto.CompactTextString(m) } -func (*PubKeyRequest) ProtoMessage() {} -func (*PubKeyRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cb4e437a5328cf9c, []int{1} -} - -func (m *PubKeyRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *PubKeyRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PubKeyRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *PubKeyRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_PubKeyRequest.Merge(m, src) -} - -func (m *PubKeyRequest) XXX_Size() int { - return m.Size() -} - -func (m *PubKeyRequest) XXX_DiscardUnknown() { - xxx_messageInfo_PubKeyRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_PubKeyRequest proto.InternalMessageInfo - -func (m *PubKeyRequest) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - -// PubKeyResponse is a response message containing the public key. -type PubKeyResponse struct { - PubKey crypto.PublicKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key"` - Error *RemoteSignerError `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` -} - -func (m *PubKeyResponse) Reset() { *m = PubKeyResponse{} } -func (m *PubKeyResponse) String() string { return proto.CompactTextString(m) } -func (*PubKeyResponse) ProtoMessage() {} -func (*PubKeyResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cb4e437a5328cf9c, []int{2} -} - -func (m *PubKeyResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *PubKeyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PubKeyResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *PubKeyResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_PubKeyResponse.Merge(m, src) -} - -func (m *PubKeyResponse) XXX_Size() int { - return m.Size() -} - -func (m *PubKeyResponse) XXX_DiscardUnknown() { - xxx_messageInfo_PubKeyResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_PubKeyResponse proto.InternalMessageInfo - -func (m *PubKeyResponse) GetPubKey() crypto.PublicKey { - if m != nil { - return m.PubKey - } - return crypto.PublicKey{} -} - -func (m *PubKeyResponse) GetError() *RemoteSignerError { - if m != nil { - return m.Error - } - return nil -} - -// SignVoteRequest is a request to sign a vote -type SignVoteRequest struct { - Vote *types.Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote,omitempty"` - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` -} - -func (m *SignVoteRequest) Reset() { *m = SignVoteRequest{} } -func (m *SignVoteRequest) String() string { return proto.CompactTextString(m) } -func (*SignVoteRequest) ProtoMessage() {} -func (*SignVoteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cb4e437a5328cf9c, []int{3} -} - -func (m *SignVoteRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *SignVoteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SignVoteRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *SignVoteRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignVoteRequest.Merge(m, src) -} - -func (m *SignVoteRequest) XXX_Size() int { - return m.Size() -} - -func (m *SignVoteRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SignVoteRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SignVoteRequest proto.InternalMessageInfo - -func (m *SignVoteRequest) GetVote() *types.Vote { - if m != nil { - return m.Vote - } - return nil -} - -func (m *SignVoteRequest) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - -// SignedVoteResponse is a response containing a signed vote or an error -type SignedVoteResponse struct { - Vote types.Vote `protobuf:"bytes,1,opt,name=vote,proto3" json:"vote"` - Error *RemoteSignerError `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` -} - -func (m *SignedVoteResponse) Reset() { *m = SignedVoteResponse{} } -func (m *SignedVoteResponse) String() string { return proto.CompactTextString(m) } -func (*SignedVoteResponse) ProtoMessage() {} -func (*SignedVoteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cb4e437a5328cf9c, []int{4} -} - -func (m *SignedVoteResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *SignedVoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SignedVoteResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *SignedVoteResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedVoteResponse.Merge(m, src) -} - -func (m *SignedVoteResponse) XXX_Size() int { - return m.Size() -} - -func (m *SignedVoteResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SignedVoteResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SignedVoteResponse proto.InternalMessageInfo - -func (m *SignedVoteResponse) GetVote() types.Vote { - if m != nil { - return m.Vote - } - return types.Vote{} -} - -func (m *SignedVoteResponse) GetError() *RemoteSignerError { - if m != nil { - return m.Error - } - return nil -} - -// SignProposalRequest is a request to sign a proposal -type SignProposalRequest struct { - Proposal *types.Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal,omitempty"` - ChainId string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` -} - -func (m *SignProposalRequest) Reset() { *m = SignProposalRequest{} } -func (m *SignProposalRequest) String() string { return proto.CompactTextString(m) } -func (*SignProposalRequest) ProtoMessage() {} -func (*SignProposalRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cb4e437a5328cf9c, []int{5} -} - -func (m *SignProposalRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *SignProposalRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SignProposalRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *SignProposalRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignProposalRequest.Merge(m, src) -} - -func (m *SignProposalRequest) XXX_Size() int { - return m.Size() -} - -func (m *SignProposalRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SignProposalRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SignProposalRequest proto.InternalMessageInfo - -func (m *SignProposalRequest) GetProposal() *types.Proposal { - if m != nil { - return m.Proposal - } - return nil -} - -func (m *SignProposalRequest) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - -// SignedProposalResponse is response containing a signed proposal or an error -type SignedProposalResponse struct { - Proposal types.Proposal `protobuf:"bytes,1,opt,name=proposal,proto3" json:"proposal"` - Error *RemoteSignerError `protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"` -} - -func (m *SignedProposalResponse) Reset() { *m = SignedProposalResponse{} } -func (m *SignedProposalResponse) String() string { return proto.CompactTextString(m) } -func (*SignedProposalResponse) ProtoMessage() {} -func (*SignedProposalResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cb4e437a5328cf9c, []int{6} -} - -func (m *SignedProposalResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *SignedProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SignedProposalResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *SignedProposalResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedProposalResponse.Merge(m, src) -} - -func (m *SignedProposalResponse) XXX_Size() int { - return m.Size() -} - -func (m *SignedProposalResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SignedProposalResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SignedProposalResponse proto.InternalMessageInfo - -func (m *SignedProposalResponse) GetProposal() types.Proposal { - if m != nil { - return m.Proposal - } - return types.Proposal{} -} - -func (m *SignedProposalResponse) GetError() *RemoteSignerError { - if m != nil { - return m.Error - } - return nil -} - -// PingRequest is a request to confirm that the connection is alive. -type PingRequest struct{} - -func (m *PingRequest) Reset() { *m = PingRequest{} } -func (m *PingRequest) String() string { return proto.CompactTextString(m) } -func (*PingRequest) ProtoMessage() {} -func (*PingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_cb4e437a5328cf9c, []int{7} -} - -func (m *PingRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *PingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PingRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *PingRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_PingRequest.Merge(m, src) -} - -func (m *PingRequest) XXX_Size() int { - return m.Size() -} - -func (m *PingRequest) XXX_DiscardUnknown() { - xxx_messageInfo_PingRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_PingRequest proto.InternalMessageInfo - -// PingResponse is a response to confirm that the connection is alive. -type PingResponse struct{} - -func (m *PingResponse) Reset() { *m = PingResponse{} } -func (m *PingResponse) String() string { return proto.CompactTextString(m) } -func (*PingResponse) ProtoMessage() {} -func (*PingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_cb4e437a5328cf9c, []int{8} -} - -func (m *PingResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *PingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PingResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *PingResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_PingResponse.Merge(m, src) -} - -func (m *PingResponse) XXX_Size() int { - return m.Size() -} - -func (m *PingResponse) XXX_DiscardUnknown() { - xxx_messageInfo_PingResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_PingResponse proto.InternalMessageInfo - -type Message struct { - // Types that are valid to be assigned to Sum: - // *Message_PubKeyRequest - // *Message_PubKeyResponse - // *Message_SignVoteRequest - // *Message_SignedVoteResponse - // *Message_SignProposalRequest - // *Message_SignedProposalResponse - // *Message_PingRequest - // *Message_PingResponse - Sum isMessage_Sum `protobuf_oneof:"sum"` -} - -func (m *Message) Reset() { *m = Message{} } -func (m *Message) String() string { return proto.CompactTextString(m) } -func (*Message) ProtoMessage() {} -func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_cb4e437a5328cf9c, []int{9} -} - -func (m *Message) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Message.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *Message) XXX_Merge(src proto.Message) { - xxx_messageInfo_Message.Merge(m, src) -} - -func (m *Message) XXX_Size() int { - return m.Size() -} - -func (m *Message) XXX_DiscardUnknown() { - xxx_messageInfo_Message.DiscardUnknown(m) -} - -var xxx_messageInfo_Message proto.InternalMessageInfo - -type isMessage_Sum interface { - isMessage_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type Message_PubKeyRequest struct { - PubKeyRequest *PubKeyRequest `protobuf:"bytes,1,opt,name=pub_key_request,json=pubKeyRequest,proto3,oneof" json:"pub_key_request,omitempty"` -} -type Message_PubKeyResponse struct { - PubKeyResponse *PubKeyResponse `protobuf:"bytes,2,opt,name=pub_key_response,json=pubKeyResponse,proto3,oneof" json:"pub_key_response,omitempty"` -} -type Message_SignVoteRequest struct { - SignVoteRequest *SignVoteRequest `protobuf:"bytes,3,opt,name=sign_vote_request,json=signVoteRequest,proto3,oneof" json:"sign_vote_request,omitempty"` -} -type Message_SignedVoteResponse struct { - SignedVoteResponse *SignedVoteResponse `protobuf:"bytes,4,opt,name=signed_vote_response,json=signedVoteResponse,proto3,oneof" json:"signed_vote_response,omitempty"` -} -type Message_SignProposalRequest struct { - SignProposalRequest *SignProposalRequest `protobuf:"bytes,5,opt,name=sign_proposal_request,json=signProposalRequest,proto3,oneof" json:"sign_proposal_request,omitempty"` -} -type Message_SignedProposalResponse struct { - SignedProposalResponse *SignedProposalResponse `protobuf:"bytes,6,opt,name=signed_proposal_response,json=signedProposalResponse,proto3,oneof" json:"signed_proposal_response,omitempty"` -} -type Message_PingRequest struct { - PingRequest *PingRequest `protobuf:"bytes,7,opt,name=ping_request,json=pingRequest,proto3,oneof" json:"ping_request,omitempty"` -} -type Message_PingResponse struct { - PingResponse *PingResponse `protobuf:"bytes,8,opt,name=ping_response,json=pingResponse,proto3,oneof" json:"ping_response,omitempty"` -} - -func (*Message_PubKeyRequest) isMessage_Sum() {} -func (*Message_PubKeyResponse) isMessage_Sum() {} -func (*Message_SignVoteRequest) isMessage_Sum() {} -func (*Message_SignedVoteResponse) isMessage_Sum() {} -func (*Message_SignProposalRequest) isMessage_Sum() {} -func (*Message_SignedProposalResponse) isMessage_Sum() {} -func (*Message_PingRequest) isMessage_Sum() {} -func (*Message_PingResponse) isMessage_Sum() {} - -func (m *Message) GetSum() isMessage_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *Message) GetPubKeyRequest() *PubKeyRequest { - if x, ok := m.GetSum().(*Message_PubKeyRequest); ok { - return x.PubKeyRequest - } - return nil -} - -func (m *Message) GetPubKeyResponse() *PubKeyResponse { - if x, ok := m.GetSum().(*Message_PubKeyResponse); ok { - return x.PubKeyResponse - } - return nil -} - -func (m *Message) GetSignVoteRequest() *SignVoteRequest { - if x, ok := m.GetSum().(*Message_SignVoteRequest); ok { - return x.SignVoteRequest - } - return nil -} - -func (m *Message) GetSignedVoteResponse() *SignedVoteResponse { - if x, ok := m.GetSum().(*Message_SignedVoteResponse); ok { - return x.SignedVoteResponse - } - return nil -} - -func (m *Message) GetSignProposalRequest() *SignProposalRequest { - if x, ok := m.GetSum().(*Message_SignProposalRequest); ok { - return x.SignProposalRequest - } - return nil -} - -func (m *Message) GetSignedProposalResponse() *SignedProposalResponse { - if x, ok := m.GetSum().(*Message_SignedProposalResponse); ok { - return x.SignedProposalResponse - } - return nil -} - -func (m *Message) GetPingRequest() *PingRequest { - if x, ok := m.GetSum().(*Message_PingRequest); ok { - return x.PingRequest - } - return nil -} - -func (m *Message) GetPingResponse() *PingResponse { - if x, ok := m.GetSum().(*Message_PingResponse); ok { - return x.PingResponse - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Message) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Message_PubKeyRequest)(nil), - (*Message_PubKeyResponse)(nil), - (*Message_SignVoteRequest)(nil), - (*Message_SignedVoteResponse)(nil), - (*Message_SignProposalRequest)(nil), - (*Message_SignedProposalResponse)(nil), - (*Message_PingRequest)(nil), - (*Message_PingResponse)(nil), - } -} - -func init() { - proto.RegisterEnum("tendermint.privval.Errors", Errors_name, Errors_value) - proto.RegisterType((*RemoteSignerError)(nil), "tendermint.privval.RemoteSignerError") - proto.RegisterType((*PubKeyRequest)(nil), "tendermint.privval.PubKeyRequest") - proto.RegisterType((*PubKeyResponse)(nil), "tendermint.privval.PubKeyResponse") - proto.RegisterType((*SignVoteRequest)(nil), "tendermint.privval.SignVoteRequest") - proto.RegisterType((*SignedVoteResponse)(nil), "tendermint.privval.SignedVoteResponse") - proto.RegisterType((*SignProposalRequest)(nil), "tendermint.privval.SignProposalRequest") - proto.RegisterType((*SignedProposalResponse)(nil), "tendermint.privval.SignedProposalResponse") - proto.RegisterType((*PingRequest)(nil), "tendermint.privval.PingRequest") - proto.RegisterType((*PingResponse)(nil), "tendermint.privval.PingResponse") - proto.RegisterType((*Message)(nil), "tendermint.privval.Message") -} - -func init() { proto.RegisterFile("tendermint/privval/types.proto", fileDescriptor_cb4e437a5328cf9c) } - -var fileDescriptor_cb4e437a5328cf9c = []byte{ - // 750 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x4d, 0x4f, 0x13, 0x41, - 0x18, 0xde, 0x85, 0x7e, 0xc0, 0x5b, 0x5a, 0xca, 0x80, 0x58, 0x1a, 0x5c, 0x6a, 0x8d, 0x4a, 0x7a, - 0x68, 0x0d, 0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x86, 0xf1, 0x85, 0x2d, 0xd1, 0xc0, 0x7a, 0x2f, 0x0c, 0xf3, 0xac, 0xdb, - 0xc9, 0xfd, 0x90, 0x21, 0xc2, 0x43, 0xce, 0x10, 0x82, 0x84, 0x8a, 0x71, 0x05, 0xd7, 0xf4, 0x23, - 0xad, 0xac, 0x55, 0x8e, 0xb5, 0xa4, 0x84, 0x14, 0x48, 0xfb, 0x35, 0xf5, 0xa4, 0xaa, 0xee, 0xd7, - 0xd5, 0x03, 0x1d, 0xab, 0xb5, 0x6a, 0x45, 0xab, 0xa9, 0x49, 0x19, 0xa5, 0x60, 0x4d, 0xf4, 0xb5, - 0x8a, 0xbe, 0x5f, 0xd1, 0x34, 0x75, 0xbf, 0x5e, 0xaa, 0x68, 0xc9, 0x39, 0xf4, 0x08, 0x36, 0x44, - 0x67, 0x58, 0xd6, 0xeb, 0xa5, 0x43, 0xb5, 0x72, 0x54, 0x4f, 0xce, 0xa3, 0x87, 0xb0, 0x2a, 0xda, - 0x58, 0x7d, 0x7b, 0xe0, 0x37, 0x42, 0x01, 0xc4, 0x63, 0x5c, 0xaa, 0xab, 0x7e, 0x27, 0xbc, 0x57, - 0xbb, 0xba, 0x51, 0xe4, 0xeb, 0x1b, 0x45, 0xfe, 0x73, 0xa3, 0xc8, 0xdf, 0x6e, 0x15, 0xe9, 0xfa, - 0x56, 0x91, 0x7e, 0xdd, 0x2a, 0xd2, 0xe9, 0x6b, 0xc3, 0x74, 0xcf, 0xba, 0xcd, 0x7c, 0xcb, 0xee, - 0x14, 0x82, 0x6f, 0x57, 0xf0, 0x61, 0xec, 0xbf, 0x57, 0x93, 0x2f, 0x65, 0x33, 0xc2, 0x3b, 0x2f, - 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xa5, 0x2a, 0xe5, 0x4a, 0x46, 0x07, 0x00, 0x00, -} - -func (m *RemoteSignerError) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RemoteSignerError) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RemoteSignerError) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Description) > 0 { - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x12 - } - if m.Code != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Code)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *PubKeyRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PubKeyRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PubKeyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PubKeyResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PubKeyResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PubKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - { - size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *SignVoteRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SignVoteRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SignVoteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0x12 - } - if m.Vote != nil { - { - size, err := m.Vote.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SignedVoteResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SignedVoteResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SignedVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Vote.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *SignProposalRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SignProposalRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SignProposalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0x12 - } - if m.Proposal != nil { - { - size, err := m.Proposal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SignedProposalResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SignedProposalResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SignedProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Error != nil { - { - size, err := m.Error.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Proposal.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *PingRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PingRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *PingResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PingResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *Message) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Message) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Message_PubKeyRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_PubKeyRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.PubKeyRequest != nil { - { - size, err := m.PubKeyRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Message_PubKeyResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_PubKeyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.PubKeyResponse != nil { - { - size, err := m.PubKeyResponse.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} - -func (m *Message_SignVoteRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_SignVoteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.SignVoteRequest != nil { - { - size, err := m.SignVoteRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} - -func (m *Message_SignedVoteResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_SignedVoteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.SignedVoteResponse != nil { - { - size, err := m.SignedVoteResponse.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} - -func (m *Message_SignProposalRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_SignProposalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.SignProposalRequest != nil { - { - size, err := m.SignProposalRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - return len(dAtA) - i, nil -} - -func (m *Message_SignedProposalResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_SignedProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.SignedProposalResponse != nil { - { - size, err := m.SignedProposalResponse.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - return len(dAtA) - i, nil -} - -func (m *Message_PingRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_PingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.PingRequest != nil { - { - size, err := m.PingRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - return len(dAtA) - i, nil -} - -func (m *Message_PingResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_PingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.PingResponse != nil { - { - size, err := m.PingResponse.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func (m *RemoteSignerError) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Code != 0 { - n += 1 + sovTypes(uint64(m.Code)) - } - l = len(m.Description) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *PubKeyRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *PubKeyResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.PubKey.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *SignVoteRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Vote != nil { - l = m.Vote.Size() - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *SignedVoteResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Vote.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *SignProposalRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Proposal != nil { - l = m.Proposal.Size() - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *SignedProposalResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Proposal.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.Error != nil { - l = m.Error.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *PingRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *PingResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *Message) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *Message_PubKeyRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PubKeyRequest != nil { - l = m.PubKeyRequest.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Message_PubKeyResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PubKeyResponse != nil { - l = m.PubKeyResponse.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Message_SignVoteRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SignVoteRequest != nil { - l = m.SignVoteRequest.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Message_SignedVoteResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SignedVoteResponse != nil { - l = m.SignedVoteResponse.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Message_SignProposalRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SignProposalRequest != nil { - l = m.SignProposalRequest.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Message_SignedProposalResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SignedProposalResponse != nil { - l = m.SignedProposalResponse.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Message_PingRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PingRequest != nil { - l = m.PingRequest.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Message_PingResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PingResponse != nil { - l = m.PingResponse.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -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 *RemoteSignerError) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: RemoteSignerError: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RemoteSignerError: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) - } - m.Code = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Code |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *PubKeyRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PubKeyRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PubKeyRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *PubKeyResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PubKeyResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PubKeyResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &RemoteSignerError{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *SignVoteRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SignVoteRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SignVoteRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Vote == nil { - m.Vote = &types.Vote{} - } - if err := m.Vote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *SignedVoteResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SignedVoteResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SignedVoteResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Vote.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &RemoteSignerError{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *SignProposalRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SignProposalRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SignProposalRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Proposal == nil { - m.Proposal = &types.Proposal{} - } - if err := m.Proposal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *SignedProposalResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SignedProposalResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SignedProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposal", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Proposal.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Error == nil { - m.Error = &RemoteSignerError{} - } - if err := m.Error.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *PingRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PingRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PingRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *PingResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PingResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PingResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *Message) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Message: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PubKeyRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &PubKeyRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_PubKeyRequest{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PubKeyResponse", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &PubKeyResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_PubKeyResponse{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SignVoteRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &SignVoteRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_SignVoteRequest{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SignedVoteResponse", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &SignedVoteResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_SignedVoteResponse{v} - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SignProposalRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &SignProposalRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_SignProposalRequest{v} - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SignedProposalResponse", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &SignedProposalResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_SignedProposalResponse{v} - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PingRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &PingRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_PingRequest{v} - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PingResponse", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &PingResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_PingResponse{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipTypes(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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/proto/tendermint/rpc/grpc/types.proto b/third_party/proto/tendermint/rpc/grpc/types.proto deleted file mode 100644 index ee948a4065..0000000000 --- a/third_party/proto/tendermint/rpc/grpc/types.proto +++ /dev/null @@ -1,32 +0,0 @@ -syntax = "proto3"; -package tendermint.rpc.grpc; -option go_package = "github.com/tendermint/tendermint/rpc/grpc;coregrpc"; - -import "tendermint/abci/types.proto"; - -//---------------------------------------- -// Request types - -message RequestPing {} - -message RequestBroadcastTx { - bytes tx = 1; -} - -//---------------------------------------- -// Response types - -message ResponsePing {} - -message ResponseBroadcastTx { - tendermint.abci.ResponseCheckTx check_tx = 1; - tendermint.abci.ResponseDeliverTx deliver_tx = 2; -} - -//---------------------------------------- -// Service Definition - -service BroadcastAPI { - rpc Ping(RequestPing) returns (ResponsePing); - rpc BroadcastTx(RequestBroadcastTx) returns (ResponseBroadcastTx); -} diff --git a/third_party/proto/tendermint/state/types.pb.go b/third_party/proto/tendermint/state/types.pb.go deleted file mode 100644 index fd412ec1dd..0000000000 --- a/third_party/proto/tendermint/state/types.pb.go +++ /dev/null @@ -1,1996 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: tendermint/state/types.proto - -package state - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - time "time" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - - types "github.com/line/ostracon/abci/types" - types1 "github.com/line/ostracon/proto/ostracon/types" - version "github.com/line/ostracon/proto/ostracon/version" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal - -var ( - _ = fmt.Errorf - _ = math.Inf - _ = time.Kitchen -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// ABCIResponses retains the responses -// of the various ABCI calls during block processing. -// It is persisted to disk for each height before calling Commit. -type ABCIResponses struct { - DeliverTxs []*types.ResponseDeliverTx `protobuf:"bytes,1,rep,name=deliver_txs,json=deliverTxs,proto3" json:"deliver_txs,omitempty"` - EndBlock *types.ResponseEndBlock `protobuf:"bytes,2,opt,name=end_block,json=endBlock,proto3" json:"end_block,omitempty"` - BeginBlock *types.ResponseBeginBlock `protobuf:"bytes,3,opt,name=begin_block,json=beginBlock,proto3" json:"begin_block,omitempty"` -} - -func (m *ABCIResponses) Reset() { *m = ABCIResponses{} } -func (m *ABCIResponses) String() string { return proto.CompactTextString(m) } -func (*ABCIResponses) ProtoMessage() {} -func (*ABCIResponses) Descriptor() ([]byte, []int) { - return fileDescriptor_ccfacf933f22bf93, []int{0} -} - -func (m *ABCIResponses) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *ABCIResponses) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ABCIResponses.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *ABCIResponses) XXX_Merge(src proto.Message) { - xxx_messageInfo_ABCIResponses.Merge(m, src) -} - -func (m *ABCIResponses) XXX_Size() int { - return m.Size() -} - -func (m *ABCIResponses) XXX_DiscardUnknown() { - xxx_messageInfo_ABCIResponses.DiscardUnknown(m) -} - -var xxx_messageInfo_ABCIResponses proto.InternalMessageInfo - -func (m *ABCIResponses) GetDeliverTxs() []*types.ResponseDeliverTx { - if m != nil { - return m.DeliverTxs - } - return nil -} - -func (m *ABCIResponses) GetEndBlock() *types.ResponseEndBlock { - if m != nil { - return m.EndBlock - } - return nil -} - -func (m *ABCIResponses) GetBeginBlock() *types.ResponseBeginBlock { - if m != nil { - return m.BeginBlock - } - return nil -} - -// ValidatorsInfo represents the latest validator set, or the last height it changed -type ValidatorsInfo struct { - ValidatorSet *types1.ValidatorSet `protobuf:"bytes,1,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` - LastHeightChanged int64 `protobuf:"varint,2,opt,name=last_height_changed,json=lastHeightChanged,proto3" json:"last_height_changed,omitempty"` -} - -func (m *ValidatorsInfo) Reset() { *m = ValidatorsInfo{} } -func (m *ValidatorsInfo) String() string { return proto.CompactTextString(m) } -func (*ValidatorsInfo) ProtoMessage() {} -func (*ValidatorsInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ccfacf933f22bf93, []int{1} -} - -func (m *ValidatorsInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *ValidatorsInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValidatorsInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *ValidatorsInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorsInfo.Merge(m, src) -} - -func (m *ValidatorsInfo) XXX_Size() int { - return m.Size() -} - -func (m *ValidatorsInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorsInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatorsInfo proto.InternalMessageInfo - -func (m *ValidatorsInfo) GetValidatorSet() *types1.ValidatorSet { - if m != nil { - return m.ValidatorSet - } - return nil -} - -func (m *ValidatorsInfo) GetLastHeightChanged() int64 { - if m != nil { - return m.LastHeightChanged - } - return 0 -} - -// ConsensusParamsInfo represents the latest consensus params, or the last height it changed -type ConsensusParamsInfo struct { - ConsensusParams types1.ConsensusParams `protobuf:"bytes,1,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params"` - LastHeightChanged int64 `protobuf:"varint,2,opt,name=last_height_changed,json=lastHeightChanged,proto3" json:"last_height_changed,omitempty"` -} - -func (m *ConsensusParamsInfo) Reset() { *m = ConsensusParamsInfo{} } -func (m *ConsensusParamsInfo) String() string { return proto.CompactTextString(m) } -func (*ConsensusParamsInfo) ProtoMessage() {} -func (*ConsensusParamsInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_ccfacf933f22bf93, []int{2} -} - -func (m *ConsensusParamsInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *ConsensusParamsInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ConsensusParamsInfo.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *ConsensusParamsInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConsensusParamsInfo.Merge(m, src) -} - -func (m *ConsensusParamsInfo) XXX_Size() int { - return m.Size() -} - -func (m *ConsensusParamsInfo) XXX_DiscardUnknown() { - xxx_messageInfo_ConsensusParamsInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_ConsensusParamsInfo proto.InternalMessageInfo - -func (m *ConsensusParamsInfo) GetConsensusParams() types1.ConsensusParams { - if m != nil { - return m.ConsensusParams - } - return types1.ConsensusParams{} -} - -func (m *ConsensusParamsInfo) GetLastHeightChanged() int64 { - if m != nil { - return m.LastHeightChanged - } - return 0 -} - -type Version struct { - Consensus version.Consensus `protobuf:"bytes,1,opt,name=consensus,proto3" json:"consensus"` - Software string `protobuf:"bytes,2,opt,name=software,proto3" json:"software,omitempty"` -} - -func (m *Version) Reset() { *m = Version{} } -func (m *Version) String() string { return proto.CompactTextString(m) } -func (*Version) ProtoMessage() {} -func (*Version) Descriptor() ([]byte, []int) { - return fileDescriptor_ccfacf933f22bf93, []int{3} -} - -func (m *Version) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *Version) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Version.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *Version) XXX_Merge(src proto.Message) { - xxx_messageInfo_Version.Merge(m, src) -} - -func (m *Version) XXX_Size() int { - return m.Size() -} - -func (m *Version) XXX_DiscardUnknown() { - xxx_messageInfo_Version.DiscardUnknown(m) -} - -var xxx_messageInfo_Version proto.InternalMessageInfo - -func (m *Version) GetConsensus() version.Consensus { - if m != nil { - return m.Consensus - } - return version.Consensus{} -} - -func (m *Version) GetSoftware() string { - if m != nil { - return m.Software - } - return "" -} - -type State struct { - Version Version `protobuf:"bytes,1,opt,name=version,proto3" json:"version"` - // immutable - ChainID string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - InitialHeight int64 `protobuf:"varint,14,opt,name=initial_height,json=initialHeight,proto3" json:"initial_height,omitempty"` - // LastBlockHeight=0 at genesis (ie. block(H=0) does not exist) - LastBlockHeight int64 `protobuf:"varint,3,opt,name=last_block_height,json=lastBlockHeight,proto3" json:"last_block_height,omitempty"` - LastBlockID types1.BlockID `protobuf:"bytes,4,opt,name=last_block_id,json=lastBlockId,proto3" json:"last_block_id"` - LastBlockTime time.Time `protobuf:"bytes,5,opt,name=last_block_time,json=lastBlockTime,proto3,stdtime" json:"last_block_time"` - // LastValidators is used to validate block.LastCommit. - // Validators are persisted to the database separately every time they change, - // so we can query for historical validator sets. - // Note that if s.LastBlockHeight causes a valset change, - // we set s.LastHeightValidatorsChanged = s.LastBlockHeight + 1 + 1 - // Extra +1 due to nextValSet delay. - NextValidators *types1.ValidatorSet `protobuf:"bytes,6,opt,name=next_validators,json=nextValidators,proto3" json:"next_validators,omitempty"` - Validators *types1.ValidatorSet `protobuf:"bytes,7,opt,name=validators,proto3" json:"validators,omitempty"` - LastValidators *types1.ValidatorSet `protobuf:"bytes,8,opt,name=last_validators,json=lastValidators,proto3" json:"last_validators,omitempty"` - LastHeightValidatorsChanged int64 `protobuf:"varint,9,opt,name=last_height_validators_changed,json=lastHeightValidatorsChanged,proto3" json:"last_height_validators_changed,omitempty"` - // Consensus parameters used for validating blocks. - // Changes returned by EndBlock and updated after Commit. - ConsensusParams types1.ConsensusParams `protobuf:"bytes,10,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params"` - LastHeightConsensusParamsChanged int64 `protobuf:"varint,11,opt,name=last_height_consensus_params_changed,json=lastHeightConsensusParamsChanged,proto3" json:"last_height_consensus_params_changed,omitempty"` - // Merkle root of the results from executing prev block - LastResultsHash []byte `protobuf:"bytes,12,opt,name=last_results_hash,json=lastResultsHash,proto3" json:"last_results_hash,omitempty"` - // the latest AppHash we've received from calling abci.Commit() - AppHash []byte `protobuf:"bytes,13,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` -} - -func (m *State) Reset() { *m = State{} } -func (m *State) String() string { return proto.CompactTextString(m) } -func (*State) ProtoMessage() {} -func (*State) Descriptor() ([]byte, []int) { - return fileDescriptor_ccfacf933f22bf93, []int{4} -} - -func (m *State) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *State) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_State.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *State) XXX_Merge(src proto.Message) { - xxx_messageInfo_State.Merge(m, src) -} - -func (m *State) XXX_Size() int { - return m.Size() -} - -func (m *State) XXX_DiscardUnknown() { - xxx_messageInfo_State.DiscardUnknown(m) -} - -var xxx_messageInfo_State proto.InternalMessageInfo - -func (m *State) GetVersion() Version { - if m != nil { - return m.Version - } - return Version{} -} - -func (m *State) GetChainID() string { - if m != nil { - return m.ChainID - } - return "" -} - -func (m *State) GetInitialHeight() int64 { - if m != nil { - return m.InitialHeight - } - return 0 -} - -func (m *State) GetLastBlockHeight() int64 { - if m != nil { - return m.LastBlockHeight - } - return 0 -} - -func (m *State) GetLastBlockID() types1.BlockID { - if m != nil { - return m.LastBlockID - } - return types1.BlockID{} -} - -func (m *State) GetLastBlockTime() time.Time { - if m != nil { - return m.LastBlockTime - } - return time.Time{} -} - -func (m *State) GetNextValidators() *types1.ValidatorSet { - if m != nil { - return m.NextValidators - } - return nil -} - -func (m *State) GetValidators() *types1.ValidatorSet { - if m != nil { - return m.Validators - } - return nil -} - -func (m *State) GetLastValidators() *types1.ValidatorSet { - if m != nil { - return m.LastValidators - } - return nil -} - -func (m *State) GetLastHeightValidatorsChanged() int64 { - if m != nil { - return m.LastHeightValidatorsChanged - } - return 0 -} - -func (m *State) GetConsensusParams() types1.ConsensusParams { - if m != nil { - return m.ConsensusParams - } - return types1.ConsensusParams{} -} - -func (m *State) GetLastHeightConsensusParamsChanged() int64 { - if m != nil { - return m.LastHeightConsensusParamsChanged - } - return 0 -} - -func (m *State) GetLastResultsHash() []byte { - if m != nil { - return m.LastResultsHash - } - return nil -} - -func (m *State) GetAppHash() []byte { - if m != nil { - return m.AppHash - } - return nil -} - -func init() { - proto.RegisterType((*ABCIResponses)(nil), "tendermint.state.ABCIResponses") - proto.RegisterType((*ValidatorsInfo)(nil), "tendermint.state.ValidatorsInfo") - proto.RegisterType((*ConsensusParamsInfo)(nil), "tendermint.state.ConsensusParamsInfo") - proto.RegisterType((*Version)(nil), "tendermint.state.Version") - proto.RegisterType((*State)(nil), "tendermint.state.State") -} - -func init() { proto.RegisterFile("tendermint/state/types.proto", fileDescriptor_ccfacf933f22bf93) } - -var fileDescriptor_ccfacf933f22bf93 = []byte{ - // 763 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xcf, 0x6f, 0xd3, 0x30, - 0x14, 0x6e, 0xe8, 0xb6, 0xb6, 0xce, 0xda, 0x0e, 0x8f, 0x43, 0xd6, 0xb1, 0xb4, 0x2b, 0x3f, 0x34, - 0x71, 0x48, 0xa5, 0x71, 0x40, 0x5c, 0x26, 0x2d, 0x2d, 0x62, 0x95, 0x26, 0x04, 0xd9, 0xb4, 0x03, - 0x97, 0xc8, 0x6d, 0xbc, 0x24, 0xa2, 0x4d, 0xa2, 0xd8, 0x2d, 0xe3, 0x0f, 0xe0, 0xbe, 0x2b, 0xff, - 0xd1, 0x8e, 0x3b, 0x22, 0x0e, 0x03, 0xba, 0x7f, 0x04, 0xd9, 0xce, 0x0f, 0xb7, 0x65, 0xd2, 0x10, - 0x37, 0xfb, 0x7d, 0xdf, 0xfb, 0xfc, 0xf9, 0xf9, 0x3d, 0x19, 0x3c, 0xa6, 0x38, 0x70, 0x70, 0x3c, - 0xf6, 0x03, 0xda, 0x21, 0x14, 0x51, 0xdc, 0xa1, 0x5f, 0x22, 0x4c, 0x8c, 0x28, 0x0e, 0x69, 0x08, - 0x37, 0x72, 0xd4, 0xe0, 0x68, 0xe3, 0x91, 0x1b, 0xba, 0x21, 0x07, 0x3b, 0x6c, 0x25, 0x78, 0x8d, - 0x6d, 0x49, 0x05, 0x0d, 0x86, 0xbe, 0x2c, 0xd2, 0x90, 0x8f, 0xe0, 0xf1, 0x39, 0xb4, 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b7, 0x40, 0x19, 0x45, 0x91, 0xa0, 0x54, 0x39, 0xa5, 0x84, 0xa2, 0x88, 0x41, 0xe6, 0x87, 0xab, - 0x99, 0xae, 0x5c, 0xcf, 0x74, 0xe5, 0xd7, 0x4c, 0x57, 0x2e, 0x6f, 0xf5, 0xc2, 0xf5, 0xad, 0x5e, - 0xf8, 0x7e, 0xab, 0x17, 0x3e, 0xbe, 0x72, 0x7d, 0xea, 0x4d, 0x06, 0xc6, 0x30, 0x1c, 0x77, 0xe4, - 0x3f, 0x25, 0x5f, 0x8a, 0x8f, 0x6d, 0xf1, 0x4b, 0x1c, 0xac, 0xf1, 0xf8, 0xcb, 0x3f, 0x01, 0x00, - 0x00, 0xff, 0xff, 0xa5, 0x17, 0xac, 0x23, 0x2d, 0x07, 0x00, 0x00, -} - -func (m *ABCIResponses) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ABCIResponses) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ABCIResponses) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.BeginBlock != nil { - { - size, err := m.BeginBlock.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.EndBlock != nil { - { - size, err := m.EndBlock.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.DeliverTxs) > 0 { - for iNdEx := len(m.DeliverTxs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DeliverTxs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *ValidatorsInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ValidatorsInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ValidatorsInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LastHeightChanged != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.LastHeightChanged)) - i-- - dAtA[i] = 0x10 - } - if m.ValidatorSet != nil { - { - size, err := m.ValidatorSet.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *ConsensusParamsInfo) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ConsensusParamsInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConsensusParamsInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LastHeightChanged != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.LastHeightChanged)) - i-- - dAtA[i] = 0x10 - } - { - size, err := m.ConsensusParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Version) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Version) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Version) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Software) > 0 { - i -= len(m.Software) - copy(dAtA[i:], m.Software) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Software))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Consensus.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *State) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *State) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *State) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.InitialHeight != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.InitialHeight)) - i-- - dAtA[i] = 0x70 - } - if len(m.AppHash) > 0 { - i -= len(m.AppHash) - copy(dAtA[i:], m.AppHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.AppHash))) - i-- - dAtA[i] = 0x6a - } - if len(m.LastResultsHash) > 0 { - i -= len(m.LastResultsHash) - copy(dAtA[i:], m.LastResultsHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.LastResultsHash))) - i-- - dAtA[i] = 0x62 - } - if m.LastHeightConsensusParamsChanged != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.LastHeightConsensusParamsChanged)) - i-- - dAtA[i] = 0x58 - } - { - size, err := m.ConsensusParams.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - if m.LastHeightValidatorsChanged != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.LastHeightValidatorsChanged)) - i-- - dAtA[i] = 0x48 - } - if m.LastValidators != nil { - { - size, err := m.LastValidators.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - if m.Validators != nil { - { - size, err := m.Validators.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x3a - } - if m.NextValidators != nil { - { - size, err := m.NextValidators.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 - } - n10, err10 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastBlockTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastBlockTime):]) - if err10 != nil { - return 0, err10 - } - i -= n10 - i = encodeVarintTypes(dAtA, i, uint64(n10)) - i-- - dAtA[i] = 0x2a - { - size, err := m.LastBlockID.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if m.LastBlockHeight != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.LastBlockHeight)) - i-- - dAtA[i] = 0x18 - } - if len(m.ChainID) > 0 { - i -= len(m.ChainID) - copy(dAtA[i:], m.ChainID) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ChainID))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Version.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func (m *ABCIResponses) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.DeliverTxs) > 0 { - for _, e := range m.DeliverTxs { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - if m.EndBlock != nil { - l = m.EndBlock.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.BeginBlock != nil { - l = m.BeginBlock.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *ValidatorsInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ValidatorSet != nil { - l = m.ValidatorSet.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.LastHeightChanged != 0 { - n += 1 + sovTypes(uint64(m.LastHeightChanged)) - } - return n -} - -func (m *ConsensusParamsInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ConsensusParams.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.LastHeightChanged != 0 { - n += 1 + sovTypes(uint64(m.LastHeightChanged)) - } - return n -} - -func (m *Version) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Consensus.Size() - n += 1 + l + sovTypes(uint64(l)) - l = len(m.Software) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *State) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Version.Size() - n += 1 + l + sovTypes(uint64(l)) - l = len(m.ChainID) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.LastBlockHeight != 0 { - n += 1 + sovTypes(uint64(m.LastBlockHeight)) - } - l = m.LastBlockID.Size() - n += 1 + l + sovTypes(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.LastBlockTime) - n += 1 + l + sovTypes(uint64(l)) - if m.NextValidators != nil { - l = m.NextValidators.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Validators != nil { - l = m.Validators.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.LastValidators != nil { - l = m.LastValidators.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.LastHeightValidatorsChanged != 0 { - n += 1 + sovTypes(uint64(m.LastHeightValidatorsChanged)) - } - l = m.ConsensusParams.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.LastHeightConsensusParamsChanged != 0 { - n += 1 + sovTypes(uint64(m.LastHeightConsensusParamsChanged)) - } - l = len(m.LastResultsHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.AppHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.InitialHeight != 0 { - n += 1 + sovTypes(uint64(m.InitialHeight)) - } - return n -} - -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 *ABCIResponses) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ABCIResponses: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ABCIResponses: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DeliverTxs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DeliverTxs = append(m.DeliverTxs, &types.ResponseDeliverTx{}) - if err := m.DeliverTxs[len(m.DeliverTxs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EndBlock", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.EndBlock == nil { - m.EndBlock = &types.ResponseEndBlock{} - } - if err := m.EndBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BeginBlock", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.BeginBlock == nil { - m.BeginBlock = &types.ResponseBeginBlock{} - } - if err := m.BeginBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *ValidatorsInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ValidatorsInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorsInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSet", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ValidatorSet == nil { - m.ValidatorSet = &types1.ValidatorSet{} - } - if err := m.ValidatorSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LastHeightChanged", wireType) - } - m.LastHeightChanged = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LastHeightChanged |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *ConsensusParamsInfo) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ConsensusParamsInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConsensusParamsInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ConsensusParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LastHeightChanged", wireType) - } - m.LastHeightChanged = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LastHeightChanged |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *Version) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Version: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Version: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Consensus", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Consensus.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Software", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Software = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *State) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: State: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: State: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Version.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LastBlockHeight", wireType) - } - m.LastBlockHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LastBlockHeight |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastBlockID", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.LastBlockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastBlockTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.LastBlockTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NextValidators", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.NextValidators == nil { - m.NextValidators = &types1.ValidatorSet{} - } - if err := m.NextValidators.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Validators == nil { - m.Validators = &types1.ValidatorSet{} - } - if err := m.Validators.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastValidators", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.LastValidators == nil { - m.LastValidators = &types1.ValidatorSet{} - } - if err := m.LastValidators.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LastHeightValidatorsChanged", wireType) - } - m.LastHeightValidatorsChanged = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LastHeightValidatorsChanged |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusParams", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ConsensusParams.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LastHeightConsensusParamsChanged", wireType) - } - m.LastHeightConsensusParamsChanged = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.LastHeightConsensusParamsChanged |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastResultsHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LastResultsHash = append(m.LastResultsHash[:0], dAtA[iNdEx:postIndex]...) - if m.LastResultsHash == nil { - m.LastResultsHash = []byte{} - } - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AppHash = append(m.AppHash[:0], dAtA[iNdEx:postIndex]...) - if m.AppHash == nil { - m.AppHash = []byte{} - } - iNdEx = postIndex - case 14: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field InitialHeight", wireType) - } - m.InitialHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.InitialHeight |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipTypes(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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/proto/tendermint/statesync/types.pb.go b/third_party/proto/tendermint/statesync/types.pb.go deleted file mode 100644 index ba43116ba8..0000000000 --- a/third_party/proto/tendermint/statesync/types.pb.go +++ /dev/null @@ -1,1672 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: tendermint/statesync/types.proto - -package statesync - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - proto "github.com/gogo/protobuf/proto" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal - -var ( - _ = fmt.Errorf - _ = math.Inf -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Message struct { - // Types that are valid to be assigned to Sum: - // *Message_SnapshotsRequest - // *Message_SnapshotsResponse - // *Message_ChunkRequest - // *Message_ChunkResponse - Sum isMessage_Sum `protobuf_oneof:"sum"` -} - -func (m *Message) Reset() { *m = Message{} } -func (m *Message) String() string { return proto.CompactTextString(m) } -func (*Message) ProtoMessage() {} -func (*Message) Descriptor() ([]byte, []int) { - return fileDescriptor_a1c2869546ca7914, []int{0} -} - -func (m *Message) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Message.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *Message) XXX_Merge(src proto.Message) { - xxx_messageInfo_Message.Merge(m, src) -} - -func (m *Message) XXX_Size() int { - return m.Size() -} - -func (m *Message) XXX_DiscardUnknown() { - xxx_messageInfo_Message.DiscardUnknown(m) -} - -var xxx_messageInfo_Message proto.InternalMessageInfo - -type isMessage_Sum interface { - isMessage_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type Message_SnapshotsRequest struct { - SnapshotsRequest *SnapshotsRequest `protobuf:"bytes,1,opt,name=snapshots_request,json=snapshotsRequest,proto3,oneof" json:"snapshots_request,omitempty"` -} -type Message_SnapshotsResponse struct { - SnapshotsResponse *SnapshotsResponse `protobuf:"bytes,2,opt,name=snapshots_response,json=snapshotsResponse,proto3,oneof" json:"snapshots_response,omitempty"` -} -type Message_ChunkRequest struct { - ChunkRequest *ChunkRequest `protobuf:"bytes,3,opt,name=chunk_request,json=chunkRequest,proto3,oneof" json:"chunk_request,omitempty"` -} -type Message_ChunkResponse struct { - ChunkResponse *ChunkResponse `protobuf:"bytes,4,opt,name=chunk_response,json=chunkResponse,proto3,oneof" json:"chunk_response,omitempty"` -} - -func (*Message_SnapshotsRequest) isMessage_Sum() {} -func (*Message_SnapshotsResponse) isMessage_Sum() {} -func (*Message_ChunkRequest) isMessage_Sum() {} -func (*Message_ChunkResponse) isMessage_Sum() {} - -func (m *Message) GetSum() isMessage_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *Message) GetSnapshotsRequest() *SnapshotsRequest { - if x, ok := m.GetSum().(*Message_SnapshotsRequest); ok { - return x.SnapshotsRequest - } - return nil -} - -func (m *Message) GetSnapshotsResponse() *SnapshotsResponse { - if x, ok := m.GetSum().(*Message_SnapshotsResponse); ok { - return x.SnapshotsResponse - } - return nil -} - -func (m *Message) GetChunkRequest() *ChunkRequest { - if x, ok := m.GetSum().(*Message_ChunkRequest); ok { - return x.ChunkRequest - } - return nil -} - -func (m *Message) GetChunkResponse() *ChunkResponse { - if x, ok := m.GetSum().(*Message_ChunkResponse); ok { - return x.ChunkResponse - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Message) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Message_SnapshotsRequest)(nil), - (*Message_SnapshotsResponse)(nil), - (*Message_ChunkRequest)(nil), - (*Message_ChunkResponse)(nil), - } -} - -type SnapshotsRequest struct{} - -func (m *SnapshotsRequest) Reset() { *m = SnapshotsRequest{} } -func (m *SnapshotsRequest) String() string { return proto.CompactTextString(m) } -func (*SnapshotsRequest) ProtoMessage() {} -func (*SnapshotsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a1c2869546ca7914, []int{1} -} - -func (m *SnapshotsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *SnapshotsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SnapshotsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *SnapshotsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_SnapshotsRequest.Merge(m, src) -} - -func (m *SnapshotsRequest) XXX_Size() int { - return m.Size() -} - -func (m *SnapshotsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_SnapshotsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_SnapshotsRequest proto.InternalMessageInfo - -type SnapshotsResponse struct { - Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"` - Chunks uint32 `protobuf:"varint,3,opt,name=chunks,proto3" json:"chunks,omitempty"` - Hash []byte `protobuf:"bytes,4,opt,name=hash,proto3" json:"hash,omitempty"` - Metadata []byte `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` -} - -func (m *SnapshotsResponse) Reset() { *m = SnapshotsResponse{} } -func (m *SnapshotsResponse) String() string { return proto.CompactTextString(m) } -func (*SnapshotsResponse) ProtoMessage() {} -func (*SnapshotsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a1c2869546ca7914, []int{2} -} - -func (m *SnapshotsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *SnapshotsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SnapshotsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *SnapshotsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_SnapshotsResponse.Merge(m, src) -} - -func (m *SnapshotsResponse) XXX_Size() int { - return m.Size() -} - -func (m *SnapshotsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_SnapshotsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_SnapshotsResponse proto.InternalMessageInfo - -func (m *SnapshotsResponse) GetHeight() uint64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *SnapshotsResponse) GetFormat() uint32 { - if m != nil { - return m.Format - } - return 0 -} - -func (m *SnapshotsResponse) GetChunks() uint32 { - if m != nil { - return m.Chunks - } - return 0 -} - -func (m *SnapshotsResponse) GetHash() []byte { - if m != nil { - return m.Hash - } - return nil -} - -func (m *SnapshotsResponse) GetMetadata() []byte { - if m != nil { - return m.Metadata - } - return nil -} - -type ChunkRequest struct { - Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"` - Index uint32 `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"` -} - -func (m *ChunkRequest) Reset() { *m = ChunkRequest{} } -func (m *ChunkRequest) String() string { return proto.CompactTextString(m) } -func (*ChunkRequest) ProtoMessage() {} -func (*ChunkRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a1c2869546ca7914, []int{3} -} - -func (m *ChunkRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *ChunkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChunkRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *ChunkRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChunkRequest.Merge(m, src) -} - -func (m *ChunkRequest) XXX_Size() int { - return m.Size() -} - -func (m *ChunkRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ChunkRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ChunkRequest proto.InternalMessageInfo - -func (m *ChunkRequest) GetHeight() uint64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *ChunkRequest) GetFormat() uint32 { - if m != nil { - return m.Format - } - return 0 -} - -func (m *ChunkRequest) GetIndex() uint32 { - if m != nil { - return m.Index - } - return 0 -} - -type ChunkResponse struct { - Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Format uint32 `protobuf:"varint,2,opt,name=format,proto3" json:"format,omitempty"` - Index uint32 `protobuf:"varint,3,opt,name=index,proto3" json:"index,omitempty"` - Chunk []byte `protobuf:"bytes,4,opt,name=chunk,proto3" json:"chunk,omitempty"` - Missing bool `protobuf:"varint,5,opt,name=missing,proto3" json:"missing,omitempty"` -} - -func (m *ChunkResponse) Reset() { *m = ChunkResponse{} } -func (m *ChunkResponse) String() string { return proto.CompactTextString(m) } -func (*ChunkResponse) ProtoMessage() {} -func (*ChunkResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a1c2869546ca7914, []int{4} -} - -func (m *ChunkResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *ChunkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ChunkResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *ChunkResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ChunkResponse.Merge(m, src) -} - -func (m *ChunkResponse) XXX_Size() int { - return m.Size() -} - -func (m *ChunkResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ChunkResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ChunkResponse proto.InternalMessageInfo - -func (m *ChunkResponse) GetHeight() uint64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *ChunkResponse) GetFormat() uint32 { - if m != nil { - return m.Format - } - return 0 -} - -func (m *ChunkResponse) GetIndex() uint32 { - if m != nil { - return m.Index - } - return 0 -} - -func (m *ChunkResponse) GetChunk() []byte { - if m != nil { - return m.Chunk - } - return nil -} - -func (m *ChunkResponse) GetMissing() bool { - if m != nil { - return m.Missing - } - return false -} - -func init() { - proto.RegisterType((*Message)(nil), "tendermint.statesync.Message") - proto.RegisterType((*SnapshotsRequest)(nil), "tendermint.statesync.SnapshotsRequest") - proto.RegisterType((*SnapshotsResponse)(nil), "tendermint.statesync.SnapshotsResponse") - proto.RegisterType((*ChunkRequest)(nil), "tendermint.statesync.ChunkRequest") - proto.RegisterType((*ChunkResponse)(nil), "tendermint.statesync.ChunkResponse") -} - -func init() { proto.RegisterFile("tendermint/statesync/types.proto", fileDescriptor_a1c2869546ca7914) } - -var fileDescriptor_a1c2869546ca7914 = []byte{ - // 393 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0xcd, 0x6a, 0xdb, 0x40, - 0x18, 0x94,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x00, 0xff, - 0xff, 0xcc, 0x16, 0xc2, 0x8b, 0x74, 0x03, 0x00, 0x00, -} - -func (m *Message) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Message) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Message_SnapshotsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_SnapshotsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.SnapshotsRequest != nil { - { - size, err := m.SnapshotsRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Message_SnapshotsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_SnapshotsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.SnapshotsResponse != nil { - { - size, err := m.SnapshotsResponse.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} - -func (m *Message_ChunkRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_ChunkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ChunkRequest != nil { - { - size, err := m.ChunkRequest.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - return len(dAtA) - i, nil -} - -func (m *Message_ChunkResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Message_ChunkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ChunkResponse != nil { - { - size, err := m.ChunkResponse.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - return len(dAtA) - i, nil -} - -func (m *SnapshotsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SnapshotsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SnapshotsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *SnapshotsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SnapshotsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SnapshotsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Metadata) > 0 { - i -= len(m.Metadata) - copy(dAtA[i:], m.Metadata) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Metadata))) - i-- - dAtA[i] = 0x2a - } - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0x22 - } - if m.Chunks != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Chunks)) - i-- - dAtA[i] = 0x18 - } - if m.Format != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Format)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ChunkRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ChunkRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChunkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Index != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x18 - } - if m.Format != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Format)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ChunkResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ChunkResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ChunkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Missing { - i-- - if m.Missing { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x28 - } - if len(m.Chunk) > 0 { - i -= len(m.Chunk) - copy(dAtA[i:], m.Chunk) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Chunk))) - i-- - dAtA[i] = 0x22 - } - if m.Index != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x18 - } - if m.Format != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Format)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func (m *Message) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *Message_SnapshotsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SnapshotsRequest != nil { - l = m.SnapshotsRequest.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Message_SnapshotsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SnapshotsResponse != nil { - l = m.SnapshotsResponse.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Message_ChunkRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ChunkRequest != nil { - l = m.ChunkRequest.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Message_ChunkResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ChunkResponse != nil { - l = m.ChunkResponse.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *SnapshotsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *SnapshotsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Format != 0 { - n += 1 + sovTypes(uint64(m.Format)) - } - if m.Chunks != 0 { - n += 1 + sovTypes(uint64(m.Chunks)) - } - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Metadata) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *ChunkRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Format != 0 { - n += 1 + sovTypes(uint64(m.Format)) - } - if m.Index != 0 { - n += 1 + sovTypes(uint64(m.Index)) - } - return n -} - -func (m *ChunkResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Format != 0 { - n += 1 + sovTypes(uint64(m.Format)) - } - if m.Index != 0 { - n += 1 + sovTypes(uint64(m.Index)) - } - l = len(m.Chunk) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Missing { - n += 2 - } - return n -} - -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 *Message) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Message: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SnapshotsRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &SnapshotsRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_SnapshotsRequest{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SnapshotsResponse", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &SnapshotsResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_SnapshotsResponse{v} - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChunkRequest", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ChunkRequest{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_ChunkRequest{v} - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChunkResponse", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &ChunkResponse{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Message_ChunkResponse{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *SnapshotsRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SnapshotsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SnapshotsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *SnapshotsResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SnapshotsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SnapshotsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) - } - m.Format = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Format |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) - } - m.Chunks = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Chunks |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) - if m.Hash == nil { - m.Hash = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Metadata = append(m.Metadata[:0], dAtA[iNdEx:postIndex]...) - if m.Metadata == nil { - m.Metadata = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *ChunkRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ChunkRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChunkRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) - } - m.Format = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Format |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *ChunkResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ChunkResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ChunkResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Format", wireType) - } - m.Format = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Format |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Chunk", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Chunk = append(m.Chunk[:0], dAtA[iNdEx:postIndex]...) - if m.Chunk == nil { - m.Chunk = []byte{} - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Missing", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Missing = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipTypes(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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/proto/tendermint/store/types.pb.go b/third_party/proto/tendermint/store/types.pb.go deleted file mode 100644 index 108bb24a8c..0000000000 --- a/third_party/proto/tendermint/store/types.pb.go +++ /dev/null @@ -1,347 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: tendermint/store/types.proto - -package store - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - proto "github.com/gogo/protobuf/proto" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal - -var ( - _ = fmt.Errorf - _ = math.Inf -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type BlockStoreState struct { - Base int64 `protobuf:"varint,1,opt,name=base,proto3" json:"base,omitempty"` - Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` -} - -func (m *BlockStoreState) Reset() { *m = BlockStoreState{} } -func (m *BlockStoreState) String() string { return proto.CompactTextString(m) } -func (*BlockStoreState) ProtoMessage() {} -func (*BlockStoreState) Descriptor() ([]byte, []int) { - return fileDescriptor_ff9e53a0a74267f7, []int{0} -} - -func (m *BlockStoreState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *BlockStoreState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BlockStoreState.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *BlockStoreState) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockStoreState.Merge(m, src) -} - -func (m *BlockStoreState) XXX_Size() int { - return m.Size() -} - -func (m *BlockStoreState) XXX_DiscardUnknown() { - xxx_messageInfo_BlockStoreState.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockStoreState proto.InternalMessageInfo - -func (m *BlockStoreState) GetBase() int64 { - if m != nil { - return m.Base - } - return 0 -} - -func (m *BlockStoreState) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func init() { - proto.RegisterType((*BlockStoreState)(nil), "tendermint.store.BlockStoreState") -} - -func init() { proto.RegisterFile("tendermint/store/types.proto", fileDescriptor_ff9e53a0a74267f7) } - -var fileDescriptor_ff9e53a0a74267f7 = []byte{ - // 165 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x29, 0x49, 0xcd, 0x4b, - 0x49, 0x2d, 0xca, 0xcd, 0xcc, 0x2b, 0xd1, 0x2f, 0x2e, 0xc9, 0x2f, 0x4a, 0xd5, 0x2f, 0xa9, 0x2c, - 0x48, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x40, 0xc8, 0xea, 0x81, 0x65, 0x95, - 0x6c, 0xb9, 0xf8, 0x9d, 0x72, 0xf2, 0x93, 0xb3, 0x83, 0x41, 0xbc, 0xe0, 0x92, 0xc4, 0x92, 0x54, - 0x21, 0x21, 0x2e, 0x96, 0xa4, 0xc4, 0xe2, 0x54, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xe6, 0x20, 0x30, - 0x5b, 0x48, 0x8c, 0x8b, 0x2d, 0x23, 0x35, 0x33, 0x3d, 0xa3, 0x44, 0x82, 0x09, 0x2c, 0x0a, 0xe5, - 0x39, 0x05, 0x9e, 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, 0x79, 0x7a, 0x66, - 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, 0x3e, 0x92, 0x9b, 0x90, 0x98, 0x60, 0x27, 0xe9, - 0xa3, 0xbb, 0x37, 0x89, 0x0d, 0x2c, 0x6e, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xef, 0xa6, 0x30, - 0x63, 0xca, 0x00, 0x00, 0x00, -} - -func (m *BlockStoreState) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BlockStoreState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BlockStoreState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x10 - } - if m.Base != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Base)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func (m *BlockStoreState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Base != 0 { - n += 1 + sovTypes(uint64(m.Base)) - } - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - return n -} - -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 *BlockStoreState) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BlockStoreState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BlockStoreState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Base", wireType) - } - m.Base = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Base |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipTypes(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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/proto/tendermint/types/block.pb.go b/third_party/proto/tendermint/types/block.pb.go deleted file mode 100644 index 2b4ace2d93..0000000000 --- a/third_party/proto/tendermint/types/block.pb.go +++ /dev/null @@ -1,503 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: tendermint/types/block.proto - -package types - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal - -var ( - _ = fmt.Errorf - _ = math.Inf -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Block struct { - Header Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header"` - Data Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data"` - Evidence EvidenceList `protobuf:"bytes,3,opt,name=evidence,proto3" json:"evidence"` - LastCommit *Commit `protobuf:"bytes,4,opt,name=last_commit,json=lastCommit,proto3" json:"last_commit,omitempty"` -} - -func (m *Block) Reset() { *m = Block{} } -func (m *Block) String() string { return proto.CompactTextString(m) } -func (*Block) ProtoMessage() {} -func (*Block) Descriptor() ([]byte, []int) { - return fileDescriptor_70840e82f4357ab1, []int{0} -} - -func (m *Block) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Block.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *Block) XXX_Merge(src proto.Message) { - xxx_messageInfo_Block.Merge(m, src) -} - -func (m *Block) XXX_Size() int { - return m.Size() -} - -func (m *Block) XXX_DiscardUnknown() { - xxx_messageInfo_Block.DiscardUnknown(m) -} - -var xxx_messageInfo_Block proto.InternalMessageInfo - -func (m *Block) GetHeader() Header { - if m != nil { - return m.Header - } - return Header{} -} - -func (m *Block) GetData() Data { - if m != nil { - return m.Data - } - return Data{} -} - -func (m *Block) GetEvidence() EvidenceList { - if m != nil { - return m.Evidence - } - return EvidenceList{} -} - -func (m *Block) GetLastCommit() *Commit { - if m != nil { - return m.LastCommit - } - return nil -} - -func init() { - proto.RegisterType((*Block)(nil), "tendermint.types.Block") -} - -func init() { proto.RegisterFile("tendermint/types/block.proto", fileDescriptor_70840e82f4357ab1) } - -var fileDescriptor_70840e82f4357ab1 = []byte{ - // 266 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x29, 0x49, 0xcd, 0x4b, - 0x49, 0x2d, 0xca, 0xcd, 0xcc, 0x2b, 0xd1, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x4f, 0xca, 0xc9, - 0x4f, 0xce, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x40, 0xc8, 0xea, 0x81, 0x65, 0xa5, - 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x92, 0xfa, 0x20, 0x16, 0x44, 0x9d, 0x14, 0xa6, 0x29, 0x60, - 0x12, 0x2a, 0x2b, 0x8f, 0x21, 0x9b, 0x5a, 0x96, 0x99, 0x92, 0x9a, 0x97, 0x9c, 0x0a, 0x51, 0xa0, - 0xf4, 0x8e, 0x91, 0x8b, 0xd5, 0x09, 0x64, 0xad, 0x90, 0x19, 0x17, 0x5b, 0x46, 0x6a, 0x62, 0x4a, - 0x6a, 0x91, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x84, 0x1e, 0xba, 0x0b, 0xf4, 0x3c, 0xc0, - 0xf2, 0x4e, 0x2c, 0x27, 0xee, 0xc9, 0x33, 0x04, 0x41, 0x55, 0x0b, 0x19, 0x70, 0xb1, 0xa4, 0x24, - 0x96, 0x24, 0x4a, 0x30, 0x81, 0x75, 0x89, 0x61, 0xea, 0x72, 0x49, 0x2c, 0x49, 0x84, 0xea, 0x01, - 0xab, 0x14, 0x72, 0xe0, 0xe2, 0x80, 0xb9, 0x42, 0x82, 0x19, 0xac, 0x4b, 0x0e, 0x53, 0x97, 0x2b, - 0x54, 0x85, 0x4f, 0x66, 0x71, 0x09, 0x54, 0x37, 0x5c, 0x97, 0x90, 0x25, 0x17, 0x77, 0x4e, 0x62, - 0x71, 0x49, 0x7c, 0x72, 0x7e, 0x6e, 0x6e, 0x66, 0x89, 0x04, 0x0b, 0x2e, 0x07, 0x3b, 0x83, 0xe5, - 0x83, 0xb8, 0x40, 0x8a, 0x21, 0x6c, 0xa7, 0xc0, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, - 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, - 0x63, 0x88, 0x32, 0x4f, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x47, 0x0e, - 0x36, 0x04, 0x13, 0x12, 0xf8, 0xe8, 0x41, 0x9a, 0xc4, 0x06, 0x16, 0x37, 0x06, 0x04, 0x00, 0x00, - 0xff, 0xff, 0x79, 0x8c, 0xb5, 0x43, 0xd1, 0x01, 0x00, 0x00, -} - -func (m *Block) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Block) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Block) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LastCommit != nil { - { - size, err := m.LastCommit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBlock(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - { - size, err := m.Evidence.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBlock(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBlock(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintBlock(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintBlock(dAtA []byte, offset int, v uint64) int { - offset -= sovBlock(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func (m *Block) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Header.Size() - n += 1 + l + sovBlock(uint64(l)) - l = m.Data.Size() - n += 1 + l + sovBlock(uint64(l)) - l = m.Evidence.Size() - n += 1 + l + sovBlock(uint64(l)) - if m.LastCommit != nil { - l = m.LastCommit.Size() - n += 1 + l + sovBlock(uint64(l)) - } - return n -} - -func sovBlock(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} - -func sozBlock(x uint64) (n int) { - return sovBlock(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} - -func (m *Block) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBlock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Block: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Block: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBlock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBlock - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBlock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBlock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBlock - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBlock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBlock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBlock - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBlock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastCommit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowBlock - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthBlock - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthBlock - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.LastCommit == nil { - m.LastCommit = &Commit{} - } - if err := m.LastCommit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipBlock(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthBlock - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipBlock(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, ErrIntOverflowBlock - } - 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, ErrIntOverflowBlock - } - 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, ErrIntOverflowBlock - } - 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, ErrInvalidLengthBlock - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupBlock - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthBlock - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthBlock = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowBlock = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupBlock = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/proto/tendermint/types/canonical.pb.go b/third_party/proto/tendermint/types/canonical.pb.go deleted file mode 100644 index 27c593e585..0000000000 --- a/third_party/proto/tendermint/types/canonical.pb.go +++ /dev/null @@ -1,1409 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: tendermint/types/canonical.proto - -package types - -import ( - encoding_binary "encoding/binary" - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - time "time" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal - -var ( - _ = fmt.Errorf - _ = math.Inf - _ = time.Kitchen -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type CanonicalBlockID struct { - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - PartSetHeader CanonicalPartSetHeader `protobuf:"bytes,2,opt,name=part_set_header,json=partSetHeader,proto3" json:"part_set_header"` -} - -func (m *CanonicalBlockID) Reset() { *m = CanonicalBlockID{} } -func (m *CanonicalBlockID) String() string { return proto.CompactTextString(m) } -func (*CanonicalBlockID) ProtoMessage() {} -func (*CanonicalBlockID) Descriptor() ([]byte, []int) { - return fileDescriptor_8d1a1a84ff7267ed, []int{0} -} - -func (m *CanonicalBlockID) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *CanonicalBlockID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CanonicalBlockID.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *CanonicalBlockID) XXX_Merge(src proto.Message) { - xxx_messageInfo_CanonicalBlockID.Merge(m, src) -} - -func (m *CanonicalBlockID) XXX_Size() int { - return m.Size() -} - -func (m *CanonicalBlockID) XXX_DiscardUnknown() { - xxx_messageInfo_CanonicalBlockID.DiscardUnknown(m) -} - -var xxx_messageInfo_CanonicalBlockID proto.InternalMessageInfo - -func (m *CanonicalBlockID) GetHash() []byte { - if m != nil { - return m.Hash - } - return nil -} - -func (m *CanonicalBlockID) GetPartSetHeader() CanonicalPartSetHeader { - if m != nil { - return m.PartSetHeader - } - return CanonicalPartSetHeader{} -} - -type CanonicalPartSetHeader struct { - Total uint32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` - Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` -} - -func (m *CanonicalPartSetHeader) Reset() { *m = CanonicalPartSetHeader{} } -func (m *CanonicalPartSetHeader) String() string { return proto.CompactTextString(m) } -func (*CanonicalPartSetHeader) ProtoMessage() {} -func (*CanonicalPartSetHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_8d1a1a84ff7267ed, []int{1} -} - -func (m *CanonicalPartSetHeader) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *CanonicalPartSetHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CanonicalPartSetHeader.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *CanonicalPartSetHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_CanonicalPartSetHeader.Merge(m, src) -} - -func (m *CanonicalPartSetHeader) XXX_Size() int { - return m.Size() -} - -func (m *CanonicalPartSetHeader) XXX_DiscardUnknown() { - xxx_messageInfo_CanonicalPartSetHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_CanonicalPartSetHeader proto.InternalMessageInfo - -func (m *CanonicalPartSetHeader) GetTotal() uint32 { - if m != nil { - return m.Total - } - return 0 -} - -func (m *CanonicalPartSetHeader) GetHash() []byte { - if m != nil { - return m.Hash - } - return nil -} - -type CanonicalProposal struct { - Type SignedMsgType `protobuf:"varint,1,opt,name=type,proto3,enum=tendermint.types.SignedMsgType" json:"type,omitempty"` - Height int64 `protobuf:"fixed64,2,opt,name=height,proto3" json:"height,omitempty"` - Round int64 `protobuf:"fixed64,3,opt,name=round,proto3" json:"round,omitempty"` - POLRound int64 `protobuf:"varint,4,opt,name=pol_round,json=polRound,proto3" json:"pol_round,omitempty"` - BlockID *CanonicalBlockID `protobuf:"bytes,5,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` - Timestamp time.Time `protobuf:"bytes,6,opt,name=timestamp,proto3,stdtime" json:"timestamp"` - ChainID string `protobuf:"bytes,7,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` -} - -func (m *CanonicalProposal) Reset() { *m = CanonicalProposal{} } -func (m *CanonicalProposal) String() string { return proto.CompactTextString(m) } -func (*CanonicalProposal) ProtoMessage() {} -func (*CanonicalProposal) Descriptor() ([]byte, []int) { - return fileDescriptor_8d1a1a84ff7267ed, []int{2} -} - -func (m *CanonicalProposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *CanonicalProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CanonicalProposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *CanonicalProposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_CanonicalProposal.Merge(m, src) -} - -func (m *CanonicalProposal) XXX_Size() int { - return m.Size() -} - -func (m *CanonicalProposal) XXX_DiscardUnknown() { - xxx_messageInfo_CanonicalProposal.DiscardUnknown(m) -} - -var xxx_messageInfo_CanonicalProposal proto.InternalMessageInfo - -func (m *CanonicalProposal) GetType() SignedMsgType { - if m != nil { - return m.Type - } - return UnknownType -} - -func (m *CanonicalProposal) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *CanonicalProposal) GetRound() int64 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *CanonicalProposal) GetPOLRound() int64 { - if m != nil { - return m.POLRound - } - return 0 -} - -func (m *CanonicalProposal) GetBlockID() *CanonicalBlockID { - if m != nil { - return m.BlockID - } - return nil -} - -func (m *CanonicalProposal) GetTimestamp() time.Time { - if m != nil { - return m.Timestamp - } - return time.Time{} -} - -func (m *CanonicalProposal) GetChainID() string { - if m != nil { - return m.ChainID - } - return "" -} - -type CanonicalVote struct { - Type SignedMsgType `protobuf:"varint,1,opt,name=type,proto3,enum=tendermint.types.SignedMsgType" json:"type,omitempty"` - Height int64 `protobuf:"fixed64,2,opt,name=height,proto3" json:"height,omitempty"` - Round int64 `protobuf:"fixed64,3,opt,name=round,proto3" json:"round,omitempty"` - BlockID *CanonicalBlockID `protobuf:"bytes,4,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` - Timestamp time.Time `protobuf:"bytes,5,opt,name=timestamp,proto3,stdtime" json:"timestamp"` - ChainID string `protobuf:"bytes,6,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` -} - -func (m *CanonicalVote) Reset() { *m = CanonicalVote{} } -func (m *CanonicalVote) String() string { return proto.CompactTextString(m) } -func (*CanonicalVote) ProtoMessage() {} -func (*CanonicalVote) Descriptor() ([]byte, []int) { - return fileDescriptor_8d1a1a84ff7267ed, []int{3} -} - -func (m *CanonicalVote) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *CanonicalVote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CanonicalVote.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *CanonicalVote) XXX_Merge(src proto.Message) { - xxx_messageInfo_CanonicalVote.Merge(m, src) -} - -func (m *CanonicalVote) XXX_Size() int { - return m.Size() -} - -func (m *CanonicalVote) XXX_DiscardUnknown() { - xxx_messageInfo_CanonicalVote.DiscardUnknown(m) -} - -var xxx_messageInfo_CanonicalVote proto.InternalMessageInfo - -func (m *CanonicalVote) GetType() SignedMsgType { - if m != nil { - return m.Type - } - return UnknownType -} - -func (m *CanonicalVote) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *CanonicalVote) GetRound() int64 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *CanonicalVote) GetBlockID() *CanonicalBlockID { - if m != nil { - return m.BlockID - } - return nil -} - -func (m *CanonicalVote) GetTimestamp() time.Time { - if m != nil { - return m.Timestamp - } - return time.Time{} -} - -func (m *CanonicalVote) GetChainID() string { - if m != nil { - return m.ChainID - } - return "" -} - -func init() { - proto.RegisterType((*CanonicalBlockID)(nil), "tendermint.types.CanonicalBlockID") - proto.RegisterType((*CanonicalPartSetHeader)(nil), "tendermint.types.CanonicalPartSetHeader") - proto.RegisterType((*CanonicalProposal)(nil), "tendermint.types.CanonicalProposal") - proto.RegisterType((*CanonicalVote)(nil), "tendermint.types.CanonicalVote") -} - -func init() { proto.RegisterFile("tendermint/types/canonical.proto", fileDescriptor_8d1a1a84ff7267ed) } - -var fileDescriptor_8d1a1a84ff7267ed = []byte{ - // 487 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x53, 0x3d, 0x6f, 0xd3, 0x40, - 0x18, 0xce, 0xa5, 0x4e, 0xe2, 0x5c, 0x1b, 0x08, 0xa7, 0xaa, 0xb2, 0x22, 0x64, 0x5b, 0x1e, 0x90, - 0x59, 0x6c, 0xa9, 0x1d, 0xd8, 0x5d, 0x06, 0x82, 0x40, 0x94, 0x6b, 0xd5, 0x81, 0x25, 0xba, 0xd8, - 0x87, 0x6d, 0xe1, 0xf8, 0x4e, 0xf6, 0x65, 0xe8, 0xc2, 0x6f, 0xe8, 0xef, 0xe0, 0x97, 0x74, 0xec, - 0x08, 0x4b, 0x40, 0xce, 0x1f, 0x41, 0x77, 0x4e, 0xec, 0xa8, 0x01, 0x16, 0x10, 0xcb, 0xe9, 0xfd, - 0x78, 0xee, 0x79, 0x1f, 0x3d, 0xaf, 0x5e, 0x68, 0x0b, 0x9a, 0x47, 0xb4, 0x58, 0xa4, 0xb9, 0xf0, - 0xc5, 0x0d, 0xa7, 0xa5, 0x1f, 0x92, 0x9c, 0xe5, 0x69, 0x48, 0x32,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cc, 0xf3, 0xbe, 0xaa, 0x9f, 0xfd, 0x0c, 0x00, 0x00, 0xff, 0xff, 0x6d, - 0xdd, 0x12, 0x5d, 0x31, 0x04, 0x00, 0x00, -} - -func (m *CanonicalBlockID) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CanonicalBlockID) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CanonicalBlockID) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.PartSetHeader.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCanonical(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintCanonical(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *CanonicalPartSetHeader) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CanonicalPartSetHeader) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CanonicalPartSetHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintCanonical(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0x12 - } - if m.Total != 0 { - i = encodeVarintCanonical(dAtA, i, uint64(m.Total)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *CanonicalProposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CanonicalProposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CanonicalProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ChainID) > 0 { - i -= len(m.ChainID) - copy(dAtA[i:], m.ChainID) - i = encodeVarintCanonical(dAtA, i, uint64(len(m.ChainID))) - i-- - dAtA[i] = 0x3a - } - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintCanonical(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x32 - if m.BlockID != nil { - { - size, err := m.BlockID.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCanonical(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - if m.POLRound != 0 { - i = encodeVarintCanonical(dAtA, i, uint64(m.POLRound)) - i-- - dAtA[i] = 0x20 - } - if m.Round != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Round)) - i-- - dAtA[i] = 0x19 - } - if m.Height != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Height)) - i-- - dAtA[i] = 0x11 - } - if m.Type != 0 { - i = encodeVarintCanonical(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *CanonicalVote) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CanonicalVote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CanonicalVote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ChainID) > 0 { - i -= len(m.ChainID) - copy(dAtA[i:], m.ChainID) - i = encodeVarintCanonical(dAtA, i, uint64(len(m.ChainID))) - i-- - dAtA[i] = 0x32 - } - n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) - if err4 != nil { - return 0, err4 - } - i -= n4 - i = encodeVarintCanonical(dAtA, i, uint64(n4)) - i-- - dAtA[i] = 0x2a - if m.BlockID != nil { - { - size, err := m.BlockID.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCanonical(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.Round != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Round)) - i-- - dAtA[i] = 0x19 - } - if m.Height != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Height)) - i-- - dAtA[i] = 0x11 - } - if m.Type != 0 { - i = encodeVarintCanonical(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintCanonical(dAtA []byte, offset int, v uint64) int { - offset -= sovCanonical(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func (m *CanonicalBlockID) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovCanonical(uint64(l)) - } - l = m.PartSetHeader.Size() - n += 1 + l + sovCanonical(uint64(l)) - return n -} - -func (m *CanonicalPartSetHeader) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Total != 0 { - n += 1 + sovCanonical(uint64(m.Total)) - } - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovCanonical(uint64(l)) - } - return n -} - -func (m *CanonicalProposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovCanonical(uint64(m.Type)) - } - if m.Height != 0 { - n += 9 - } - if m.Round != 0 { - n += 9 - } - if m.POLRound != 0 { - n += 1 + sovCanonical(uint64(m.POLRound)) - } - if m.BlockID != nil { - l = m.BlockID.Size() - n += 1 + l + sovCanonical(uint64(l)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp) - n += 1 + l + sovCanonical(uint64(l)) - l = len(m.ChainID) - if l > 0 { - n += 1 + l + sovCanonical(uint64(l)) - } - return n -} - -func (m *CanonicalVote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovCanonical(uint64(m.Type)) - } - if m.Height != 0 { - n += 9 - } - if m.Round != 0 { - n += 9 - } - if m.BlockID != nil { - l = m.BlockID.Size() - n += 1 + l + sovCanonical(uint64(l)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp) - n += 1 + l + sovCanonical(uint64(l)) - l = len(m.ChainID) - if l > 0 { - n += 1 + l + sovCanonical(uint64(l)) - } - return n -} - -func sovCanonical(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} - -func sozCanonical(x uint64) (n int) { - return sovCanonical(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} - -func (m *CanonicalBlockID) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CanonicalBlockID: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CanonicalBlockID: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthCanonical - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthCanonical - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) - if m.Hash == nil { - m.Hash = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PartSetHeader", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCanonical - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCanonical - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PartSetHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCanonical(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCanonical - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *CanonicalPartSetHeader) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CanonicalPartSetHeader: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CanonicalPartSetHeader: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) - } - m.Total = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Total |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthCanonical - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthCanonical - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) - if m.Hash == nil { - m.Hash = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCanonical(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCanonical - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *CanonicalProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CanonicalProposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CanonicalProposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= SignedMsgType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - m.Height = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - case 3: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - m.Round = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field POLRound", wireType) - } - m.POLRound = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.POLRound |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockID", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCanonical - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCanonical - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.BlockID == nil { - m.BlockID = &CanonicalBlockID{} - } - if err := m.BlockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCanonical - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCanonical - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - 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 ErrInvalidLengthCanonical - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCanonical - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCanonical(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCanonical - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *CanonicalVote) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CanonicalVote: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CanonicalVote: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= SignedMsgType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - m.Height = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - case 3: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - m.Round = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockID", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCanonical - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCanonical - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.BlockID == nil { - m.BlockID = &CanonicalBlockID{} - } - if err := m.BlockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthCanonical - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthCanonical - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowCanonical - } - 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 ErrInvalidLengthCanonical - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthCanonical - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipCanonical(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCanonical - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipCanonical(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, ErrIntOverflowCanonical - } - 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, ErrIntOverflowCanonical - } - 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, ErrIntOverflowCanonical - } - 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, ErrInvalidLengthCanonical - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupCanonical - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthCanonical - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthCanonical = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowCanonical = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupCanonical = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/proto/tendermint/types/events.pb.go b/third_party/proto/tendermint/types/events.pb.go deleted file mode 100644 index 8200a4d45a..0000000000 --- a/third_party/proto/tendermint/types/events.pb.go +++ /dev/null @@ -1,399 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: tendermint/types/events.proto - -package types - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - proto "github.com/gogo/protobuf/proto" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal - -var ( - _ = fmt.Errorf - _ = math.Inf -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type EventDataRoundState struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` - Step string `protobuf:"bytes,3,opt,name=step,proto3" json:"step,omitempty"` -} - -func (m *EventDataRoundState) Reset() { *m = EventDataRoundState{} } -func (m *EventDataRoundState) String() string { return proto.CompactTextString(m) } -func (*EventDataRoundState) ProtoMessage() {} -func (*EventDataRoundState) Descriptor() ([]byte, []int) { - return fileDescriptor_72cfafd446dedf7c, []int{0} -} - -func (m *EventDataRoundState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *EventDataRoundState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventDataRoundState.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *EventDataRoundState) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventDataRoundState.Merge(m, src) -} - -func (m *EventDataRoundState) XXX_Size() int { - return m.Size() -} - -func (m *EventDataRoundState) XXX_DiscardUnknown() { - xxx_messageInfo_EventDataRoundState.DiscardUnknown(m) -} - -var xxx_messageInfo_EventDataRoundState proto.InternalMessageInfo - -func (m *EventDataRoundState) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *EventDataRoundState) GetRound() int32 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *EventDataRoundState) GetStep() string { - if m != nil { - return m.Step - } - return "" -} - -func init() { - proto.RegisterType((*EventDataRoundState)(nil), "tendermint.types.EventDataRoundState") -} - -func init() { proto.RegisterFile("tendermint/types/events.proto", fileDescriptor_72cfafd446dedf7c) } - -var fileDescriptor_72cfafd446dedf7c = []byte{ - // 189 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2d, 0x49, 0xcd, 0x4b, - 0x49, 0x2d, 0xca, 0xcd, 0xcc, 0x2b, 0xd1, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x4f, 0x2d, 0x4b, - 0xcd, 0x2b, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x40, 0x48, 0xeb, 0x81, 0xa5, - 0x95, 0xc2, 0xb9, 0x84, 0x5d, 0x41, 0x2a, 0x5c, 0x12, 0x4b, 0x12, 0x83, 0xf2, 0x4b, 0xf3, 0x52, - 0x82, 0x4b, 0x12, 0x4b, 0x52, 0x85, 0xc4, 0xb8, 0xd8, 0x32, 0x52, 0x33, 0xd3, 0x33, 0x4a, 0x24, - 0x18, 0x15, 0x18, 0x35, 0x98, 0x83, 0xa0, 0x3c, 0x21, 0x11, 0x2e, 0xd6, 0x22, 0x90, 0x2a, 0x09, - 0x26, 0x05, 0x46, 0x0d, 0xd6, 0x20, 0x08, 0x47, 0x48, 0x88, 0x8b, 0xa5, 0xb8, 0x24, 0xb5, 0x40, - 0x82, 0x59, 0x81, 0x51, 0x83, 0x33, 0x08, 0xcc, 0x76, 0x0a, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, - 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, - 0xc6, 0x63, 0x39, 0x86, 0x28, 0xf3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, - 0x7d, 0x64, 0xe7, 0x22, 0x98, 0x60, 0xc7, 0xea, 0xa3, 0x7b, 0x25, 0x89, 0x0d, 0x2c, 0x6e, 0x0c, - 0x08, 0x00, 0x00, 0xff, 0xff, 0xc3, 0xe9, 0x14, 0x02, 0xe5, 0x00, 0x00, 0x00, -} - -func (m *EventDataRoundState) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EventDataRoundState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventDataRoundState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Step) > 0 { - i -= len(m.Step) - copy(dAtA[i:], m.Step) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Step))) - i-- - dAtA[i] = 0x1a - } - if m.Round != 0 { - i = encodeVarintEvents(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintEvents(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { - offset -= sovEvents(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func (m *EventDataRoundState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovEvents(uint64(m.Height)) - } - if m.Round != 0 { - n += 1 + sovEvents(uint64(m.Round)) - } - l = len(m.Step) - if l > 0 { - n += 1 + l + sovEvents(uint64(l)) - } - return n -} - -func sovEvents(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} - -func sozEvents(x uint64) (n int) { - return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} - -func (m *EventDataRoundState) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EventDataRoundState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventDataRoundState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Round |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - 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 ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Step = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipEvents(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, ErrIntOverflowEvents - } - 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, ErrIntOverflowEvents - } - 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, ErrIntOverflowEvents - } - 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, ErrInvalidLengthEvents - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEvents - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEvents - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/proto/tendermint/types/evidence.pb.go b/third_party/proto/tendermint/types/evidence.pb.go deleted file mode 100644 index af134db418..0000000000 --- a/third_party/proto/tendermint/types/evidence.pb.go +++ /dev/null @@ -1,1429 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: tendermint/types/evidence.proto - -package types - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - time "time" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal - -var ( - _ = fmt.Errorf - _ = math.Inf - _ = time.Kitchen -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type Evidence struct { - // Types that are valid to be assigned to Sum: - // *Evidence_DuplicateVoteEvidence - // *Evidence_LightClientAttackEvidence - Sum isEvidence_Sum `protobuf_oneof:"sum"` -} - -func (m *Evidence) Reset() { *m = Evidence{} } -func (m *Evidence) String() string { return proto.CompactTextString(m) } -func (*Evidence) ProtoMessage() {} -func (*Evidence) Descriptor() ([]byte, []int) { - return fileDescriptor_6825fabc78e0a168, []int{0} -} - -func (m *Evidence) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *Evidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Evidence.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *Evidence) XXX_Merge(src proto.Message) { - xxx_messageInfo_Evidence.Merge(m, src) -} - -func (m *Evidence) XXX_Size() int { - return m.Size() -} - -func (m *Evidence) XXX_DiscardUnknown() { - xxx_messageInfo_Evidence.DiscardUnknown(m) -} - -var xxx_messageInfo_Evidence proto.InternalMessageInfo - -type isEvidence_Sum interface { - isEvidence_Sum() - MarshalTo([]byte) (int, error) - Size() int -} - -type Evidence_DuplicateVoteEvidence struct { - DuplicateVoteEvidence *DuplicateVoteEvidence `protobuf:"bytes,1,opt,name=duplicate_vote_evidence,json=duplicateVoteEvidence,proto3,oneof" json:"duplicate_vote_evidence,omitempty"` -} -type Evidence_LightClientAttackEvidence struct { - LightClientAttackEvidence *LightClientAttackEvidence `protobuf:"bytes,2,opt,name=light_client_attack_evidence,json=lightClientAttackEvidence,proto3,oneof" json:"light_client_attack_evidence,omitempty"` -} - -func (*Evidence_DuplicateVoteEvidence) isEvidence_Sum() {} -func (*Evidence_LightClientAttackEvidence) isEvidence_Sum() {} - -func (m *Evidence) GetSum() isEvidence_Sum { - if m != nil { - return m.Sum - } - return nil -} - -func (m *Evidence) GetDuplicateVoteEvidence() *DuplicateVoteEvidence { - if x, ok := m.GetSum().(*Evidence_DuplicateVoteEvidence); ok { - return x.DuplicateVoteEvidence - } - return nil -} - -func (m *Evidence) GetLightClientAttackEvidence() *LightClientAttackEvidence { - if x, ok := m.GetSum().(*Evidence_LightClientAttackEvidence); ok { - return x.LightClientAttackEvidence - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*Evidence) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*Evidence_DuplicateVoteEvidence)(nil), - (*Evidence_LightClientAttackEvidence)(nil), - } -} - -// DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes. -type DuplicateVoteEvidence struct { - VoteA *Vote `protobuf:"bytes,1,opt,name=vote_a,json=voteA,proto3" json:"vote_a,omitempty"` - VoteB *Vote `protobuf:"bytes,2,opt,name=vote_b,json=voteB,proto3" json:"vote_b,omitempty"` - TotalVotingPower int64 `protobuf:"varint,3,opt,name=total_voting_power,json=totalVotingPower,proto3" json:"total_voting_power,omitempty"` - ValidatorPower int64 `protobuf:"varint,4,opt,name=validator_power,json=validatorPower,proto3" json:"validator_power,omitempty"` - Timestamp time.Time `protobuf:"bytes,5,opt,name=timestamp,proto3,stdtime" json:"timestamp"` -} - -func (m *DuplicateVoteEvidence) Reset() { *m = DuplicateVoteEvidence{} } -func (m *DuplicateVoteEvidence) String() string { return proto.CompactTextString(m) } -func (*DuplicateVoteEvidence) ProtoMessage() {} -func (*DuplicateVoteEvidence) Descriptor() ([]byte, []int) { - return fileDescriptor_6825fabc78e0a168, []int{1} -} - -func (m *DuplicateVoteEvidence) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *DuplicateVoteEvidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DuplicateVoteEvidence.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *DuplicateVoteEvidence) XXX_Merge(src proto.Message) { - xxx_messageInfo_DuplicateVoteEvidence.Merge(m, src) -} - -func (m *DuplicateVoteEvidence) XXX_Size() int { - return m.Size() -} - -func (m *DuplicateVoteEvidence) XXX_DiscardUnknown() { - xxx_messageInfo_DuplicateVoteEvidence.DiscardUnknown(m) -} - -var xxx_messageInfo_DuplicateVoteEvidence proto.InternalMessageInfo - -func (m *DuplicateVoteEvidence) GetVoteA() *Vote { - if m != nil { - return m.VoteA - } - return nil -} - -func (m *DuplicateVoteEvidence) GetVoteB() *Vote { - if m != nil { - return m.VoteB - } - return nil -} - -func (m *DuplicateVoteEvidence) GetTotalVotingPower() int64 { - if m != nil { - return m.TotalVotingPower - } - return 0 -} - -func (m *DuplicateVoteEvidence) GetValidatorPower() int64 { - if m != nil { - return m.ValidatorPower - } - return 0 -} - -func (m *DuplicateVoteEvidence) GetTimestamp() time.Time { - if m != nil { - return m.Timestamp - } - return time.Time{} -} - -// LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. -type LightClientAttackEvidence struct { - ConflictingBlock *LightBlock `protobuf:"bytes,1,opt,name=conflicting_block,json=conflictingBlock,proto3" json:"conflicting_block,omitempty"` - CommonHeight int64 `protobuf:"varint,2,opt,name=common_height,json=commonHeight,proto3" json:"common_height,omitempty"` - ByzantineValidators []*Validator `protobuf:"bytes,3,rep,name=byzantine_validators,json=byzantineValidators,proto3" json:"byzantine_validators,omitempty"` - TotalVotingPower int64 `protobuf:"varint,4,opt,name=total_voting_power,json=totalVotingPower,proto3" json:"total_voting_power,omitempty"` - Timestamp time.Time `protobuf:"bytes,5,opt,name=timestamp,proto3,stdtime" json:"timestamp"` -} - -func (m *LightClientAttackEvidence) Reset() { *m = LightClientAttackEvidence{} } -func (m *LightClientAttackEvidence) String() string { return proto.CompactTextString(m) } -func (*LightClientAttackEvidence) ProtoMessage() {} -func (*LightClientAttackEvidence) Descriptor() ([]byte, []int) { - return fileDescriptor_6825fabc78e0a168, []int{2} -} - -func (m *LightClientAttackEvidence) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *LightClientAttackEvidence) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LightClientAttackEvidence.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *LightClientAttackEvidence) XXX_Merge(src proto.Message) { - xxx_messageInfo_LightClientAttackEvidence.Merge(m, src) -} - -func (m *LightClientAttackEvidence) XXX_Size() int { - return m.Size() -} - -func (m *LightClientAttackEvidence) XXX_DiscardUnknown() { - xxx_messageInfo_LightClientAttackEvidence.DiscardUnknown(m) -} - -var xxx_messageInfo_LightClientAttackEvidence proto.InternalMessageInfo - -func (m *LightClientAttackEvidence) GetConflictingBlock() *LightBlock { - if m != nil { - return m.ConflictingBlock - } - return nil -} - -func (m *LightClientAttackEvidence) GetCommonHeight() int64 { - if m != nil { - return m.CommonHeight - } - return 0 -} - -func (m *LightClientAttackEvidence) GetByzantineValidators() []*Validator { - if m != nil { - return m.ByzantineValidators - } - return nil -} - -func (m *LightClientAttackEvidence) GetTotalVotingPower() int64 { - if m != nil { - return m.TotalVotingPower - } - return 0 -} - -func (m *LightClientAttackEvidence) GetTimestamp() time.Time { - if m != nil { - return m.Timestamp - } - return time.Time{} -} - -type EvidenceList struct { - Evidence []Evidence `protobuf:"bytes,1,rep,name=evidence,proto3" json:"evidence"` -} - -func (m *EvidenceList) Reset() { *m = EvidenceList{} } -func (m *EvidenceList) String() string { return proto.CompactTextString(m) } -func (*EvidenceList) ProtoMessage() {} -func (*EvidenceList) Descriptor() ([]byte, []int) { - return fileDescriptor_6825fabc78e0a168, []int{3} -} - -func (m *EvidenceList) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *EvidenceList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EvidenceList.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *EvidenceList) XXX_Merge(src proto.Message) { - xxx_messageInfo_EvidenceList.Merge(m, src) -} - -func (m *EvidenceList) XXX_Size() int { - return m.Size() -} - -func (m *EvidenceList) XXX_DiscardUnknown() { - xxx_messageInfo_EvidenceList.DiscardUnknown(m) -} - -var xxx_messageInfo_EvidenceList proto.InternalMessageInfo - -func (m *EvidenceList) GetEvidence() []Evidence { - if m != nil { - return m.Evidence - } - return nil -} - -func init() { - proto.RegisterType((*Evidence)(nil), "tendermint.types.Evidence") - proto.RegisterType((*DuplicateVoteEvidence)(nil), "tendermint.types.DuplicateVoteEvidence") - proto.RegisterType((*LightClientAttackEvidence)(nil), "tendermint.types.LightClientAttackEvidence") - proto.RegisterType((*EvidenceList)(nil), "tendermint.types.EvidenceList") -} - -func init() { proto.RegisterFile("tendermint/types/evidence.proto", fileDescriptor_6825fabc78e0a168) } - -var fileDescriptor_6825fabc78e0a168 = []byte{ - // 532 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0xcf, 0x6e, 0xd3, 0x40, - 0x10, 0xc6, 0xed, 0x3a, 0xa9, 0xc2, 0xb6, 0x40, 0x58, 0x5a, 0x48, 0x43, 0xe4, 0x44, 0xe1, 0xd0, - 0x48, 0x80, 0x2d, 0x95, 0x03, 0x17, 0x2e, 0x35, 0x20, 0x15, 0x29, 0x42, 0x60, 0xa1, 0x1e, 0xb8, - 0x58, 0x6b, 0x7b, 0xeb, 0xac, 0x6a, 0xef, 0x5a, 0xf1, 0x24, 0xa8, 0x3c, 0x45, 0x1e, 0xab, 0x17, - 0xa4, 0x1e, 0x39, 0x01, 0x4a, 0x78, 0x10, 0xe4, 0xf5, 0x9f, 0x44, 0x75, 0xcc, 0x89, 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0xe1, 0xe7, 0x18, 0xed, - 0x17, 0xee, 0x8d, 0x59, 0x02, 0xf8, 0x35, 0x6a, 0x6d, 0xdc, 0x1e, 0x4d, 0x1e, 0x59, 0x99, 0xa2, - 0xdc, 0xd3, 0x46, 0x7a, 0xa4, 0x5d, 0x2a, 0xac, 0x4f, 0xd7, 0x4b, 0x5d, 0xbd, 0x59, 0xea, 0xea, - 0xef, 0xa5, 0xae, 0x2e, 0x56, 0xba, 0x72, 0xb3, 0xd2, 0x95, 0x1f, 0x2b, 0x5d, 0xf9, 0xf2, 0x2a, - 0x60, 0x30, 0x99, 0xb9, 0x86, 0x27, 0x22, 0x73, 0xf3, 0x7a, 0xaf, 0x1f, 0xb3, 0xaf, 0xc8, 0xed, - 0xab, 0xef, 0xee, 0xca, 0xf8, 0xcb, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xa6, 0x21, 0x16, 0x68, - 0x9d, 0x04, 0x00, 0x00, -} - -func (m *Evidence) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Evidence) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Evidence) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Sum != nil { - { - size := m.Sum.Size() - i -= size - if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *Evidence_DuplicateVoteEvidence) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Evidence_DuplicateVoteEvidence) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.DuplicateVoteEvidence != nil { - { - size, err := m.DuplicateVoteEvidence.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvidence(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Evidence_LightClientAttackEvidence) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Evidence_LightClientAttackEvidence) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.LightClientAttackEvidence != nil { - { - size, err := m.LightClientAttackEvidence.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvidence(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} - -func (m *DuplicateVoteEvidence) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DuplicateVoteEvidence) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DuplicateVoteEvidence) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) - if err3 != nil { - return 0, err3 - } - i -= n3 - i = encodeVarintEvidence(dAtA, i, uint64(n3)) - i-- - dAtA[i] = 0x2a - if m.ValidatorPower != 0 { - i = encodeVarintEvidence(dAtA, i, uint64(m.ValidatorPower)) - i-- - dAtA[i] = 0x20 - } - if m.TotalVotingPower != 0 { - i = encodeVarintEvidence(dAtA, i, uint64(m.TotalVotingPower)) - i-- - dAtA[i] = 0x18 - } - if m.VoteB != nil { - { - size, err := m.VoteB.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvidence(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.VoteA != nil { - { - size, err := m.VoteA.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvidence(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *LightClientAttackEvidence) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LightClientAttackEvidence) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LightClientAttackEvidence) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) - if err6 != nil { - return 0, err6 - } - i -= n6 - i = encodeVarintEvidence(dAtA, i, uint64(n6)) - i-- - dAtA[i] = 0x2a - if m.TotalVotingPower != 0 { - i = encodeVarintEvidence(dAtA, i, uint64(m.TotalVotingPower)) - i-- - dAtA[i] = 0x20 - } - if len(m.ByzantineValidators) > 0 { - for iNdEx := len(m.ByzantineValidators) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ByzantineValidators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvidence(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.CommonHeight != 0 { - i = encodeVarintEvidence(dAtA, i, uint64(m.CommonHeight)) - i-- - dAtA[i] = 0x10 - } - if m.ConflictingBlock != nil { - { - size, err := m.ConflictingBlock.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvidence(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *EvidenceList) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EvidenceList) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EvidenceList) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Evidence) > 0 { - for iNdEx := len(m.Evidence) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Evidence[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvidence(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintEvidence(dAtA []byte, offset int, v uint64) int { - offset -= sovEvidence(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func (m *Evidence) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Sum != nil { - n += m.Sum.Size() - } - return n -} - -func (m *Evidence_DuplicateVoteEvidence) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.DuplicateVoteEvidence != nil { - l = m.DuplicateVoteEvidence.Size() - n += 1 + l + sovEvidence(uint64(l)) - } - return n -} - -func (m *Evidence_LightClientAttackEvidence) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.LightClientAttackEvidence != nil { - l = m.LightClientAttackEvidence.Size() - n += 1 + l + sovEvidence(uint64(l)) - } - return n -} - -func (m *DuplicateVoteEvidence) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.VoteA != nil { - l = m.VoteA.Size() - n += 1 + l + sovEvidence(uint64(l)) - } - if m.VoteB != nil { - l = m.VoteB.Size() - n += 1 + l + sovEvidence(uint64(l)) - } - if m.TotalVotingPower != 0 { - n += 1 + sovEvidence(uint64(m.TotalVotingPower)) - } - if m.ValidatorPower != 0 { - n += 1 + sovEvidence(uint64(m.ValidatorPower)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp) - n += 1 + l + sovEvidence(uint64(l)) - return n -} - -func (m *LightClientAttackEvidence) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.ConflictingBlock != nil { - l = m.ConflictingBlock.Size() - n += 1 + l + sovEvidence(uint64(l)) - } - if m.CommonHeight != 0 { - n += 1 + sovEvidence(uint64(m.CommonHeight)) - } - if len(m.ByzantineValidators) > 0 { - for _, e := range m.ByzantineValidators { - l = e.Size() - n += 1 + l + sovEvidence(uint64(l)) - } - } - if m.TotalVotingPower != 0 { - n += 1 + sovEvidence(uint64(m.TotalVotingPower)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp) - n += 1 + l + sovEvidence(uint64(l)) - return n -} - -func (m *EvidenceList) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Evidence) > 0 { - for _, e := range m.Evidence { - l = e.Size() - n += 1 + l + sovEvidence(uint64(l)) - } - } - return n -} - -func sovEvidence(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} - -func sozEvidence(x uint64) (n int) { - return sovEvidence(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} - -func (m *Evidence) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvidence - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Evidence: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Evidence: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DuplicateVoteEvidence", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvidence - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvidence - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvidence - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &DuplicateVoteEvidence{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Evidence_DuplicateVoteEvidence{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LightClientAttackEvidence", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvidence - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvidence - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvidence - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &LightClientAttackEvidence{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Sum = &Evidence_LightClientAttackEvidence{v} - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvidence(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvidence - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *DuplicateVoteEvidence) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvidence - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: DuplicateVoteEvidence: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DuplicateVoteEvidence: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VoteA", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvidence - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvidence - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvidence - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.VoteA == nil { - m.VoteA = &Vote{} - } - if err := m.VoteA.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VoteB", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvidence - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvidence - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvidence - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.VoteB == nil { - m.VoteB = &Vote{} - } - if err := m.VoteB.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalVotingPower", wireType) - } - m.TotalVotingPower = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvidence - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalVotingPower |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorPower", wireType) - } - m.ValidatorPower = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvidence - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ValidatorPower |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvidence - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvidence - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvidence - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvidence(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvidence - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *LightClientAttackEvidence) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvidence - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LightClientAttackEvidence: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LightClientAttackEvidence: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConflictingBlock", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvidence - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvidence - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvidence - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ConflictingBlock == nil { - m.ConflictingBlock = &LightBlock{} - } - if err := m.ConflictingBlock.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CommonHeight", wireType) - } - m.CommonHeight = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvidence - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CommonHeight |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ByzantineValidators", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvidence - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvidence - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvidence - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ByzantineValidators = append(m.ByzantineValidators, &Validator{}) - if err := m.ByzantineValidators[len(m.ByzantineValidators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalVotingPower", wireType) - } - m.TotalVotingPower = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvidence - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalVotingPower |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvidence - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvidence - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvidence - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvidence(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvidence - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *EvidenceList) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvidence - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EvidenceList: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EvidenceList: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvidence - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvidence - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvidence - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Evidence = append(m.Evidence, Evidence{}) - if err := m.Evidence[len(m.Evidence)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvidence(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvidence - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipEvidence(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, ErrIntOverflowEvidence - } - 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, ErrIntOverflowEvidence - } - 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, ErrIntOverflowEvidence - } - 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, ErrInvalidLengthEvidence - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEvidence - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEvidence - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEvidence = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEvidence = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEvidence = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/proto/tendermint/types/params.pb.go b/third_party/proto/tendermint/types/params.pb.go deleted file mode 100644 index 49bd916f1e..0000000000 --- a/third_party/proto/tendermint/types/params.pb.go +++ /dev/null @@ -1,1834 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: tendermint/types/params.proto - -package types - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - time "time" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - _ "github.com/golang/protobuf/ptypes/duration" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal - -var ( - _ = fmt.Errorf - _ = math.Inf - _ = time.Kitchen -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// ConsensusParams contains consensus critical parameters that determine the -// validity of blocks. -type ConsensusParams struct { - Block BlockParams `protobuf:"bytes,1,opt,name=block,proto3" json:"block"` - Evidence EvidenceParams `protobuf:"bytes,2,opt,name=evidence,proto3" json:"evidence"` - Validator ValidatorParams `protobuf:"bytes,3,opt,name=validator,proto3" json:"validator"` - Version VersionParams `protobuf:"bytes,4,opt,name=version,proto3" json:"version"` -} - -func (m *ConsensusParams) Reset() { *m = ConsensusParams{} } -func (m *ConsensusParams) String() string { return proto.CompactTextString(m) } -func (*ConsensusParams) ProtoMessage() {} -func (*ConsensusParams) Descriptor() ([]byte, []int) { - return fileDescriptor_e12598271a686f57, []int{0} -} - -func (m *ConsensusParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *ConsensusParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ConsensusParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *ConsensusParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_ConsensusParams.Merge(m, src) -} - -func (m *ConsensusParams) XXX_Size() int { - return m.Size() -} - -func (m *ConsensusParams) XXX_DiscardUnknown() { - xxx_messageInfo_ConsensusParams.DiscardUnknown(m) -} - -var xxx_messageInfo_ConsensusParams proto.InternalMessageInfo - -func (m *ConsensusParams) GetBlock() BlockParams { - if m != nil { - return m.Block - } - return BlockParams{} -} - -func (m *ConsensusParams) GetEvidence() EvidenceParams { - if m != nil { - return m.Evidence - } - return EvidenceParams{} -} - -func (m *ConsensusParams) GetValidator() ValidatorParams { - if m != nil { - return m.Validator - } - return ValidatorParams{} -} - -func (m *ConsensusParams) GetVersion() VersionParams { - if m != nil { - return m.Version - } - return VersionParams{} -} - -// BlockParams contains limits on the block size. -type BlockParams struct { - // Max block size, in bytes. - // Note: must be greater than 0 - MaxBytes int64 `protobuf:"varint,1,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"` - // Max gas per block. - // Note: must be greater or equal to -1 - MaxGas int64 `protobuf:"varint,2,opt,name=max_gas,json=maxGas,proto3" json:"max_gas,omitempty"` - // Minimum time increment between consecutive blocks (in milliseconds) If the - // block header timestamp is ahead of the system clock, decrease this value. - // - // Not exposed to the application. - TimeIotaMs int64 `protobuf:"varint,3,opt,name=time_iota_ms,json=timeIotaMs,proto3" json:"time_iota_ms,omitempty"` -} - -func (m *BlockParams) Reset() { *m = BlockParams{} } -func (m *BlockParams) String() string { return proto.CompactTextString(m) } -func (*BlockParams) ProtoMessage() {} -func (*BlockParams) Descriptor() ([]byte, []int) { - return fileDescriptor_e12598271a686f57, []int{1} -} - -func (m *BlockParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *BlockParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BlockParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *BlockParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockParams.Merge(m, src) -} - -func (m *BlockParams) XXX_Size() int { - return m.Size() -} - -func (m *BlockParams) XXX_DiscardUnknown() { - xxx_messageInfo_BlockParams.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockParams proto.InternalMessageInfo - -func (m *BlockParams) GetMaxBytes() int64 { - if m != nil { - return m.MaxBytes - } - return 0 -} - -func (m *BlockParams) GetMaxGas() int64 { - if m != nil { - return m.MaxGas - } - return 0 -} - -func (m *BlockParams) GetTimeIotaMs() int64 { - if m != nil { - return m.TimeIotaMs - } - return 0 -} - -// EvidenceParams determine how we handle evidence of malfeasance. -type EvidenceParams struct { - // Max age of evidence, in blocks. - // - // The basic formula for calculating this is: MaxAgeDuration / {average block - // time}. - MaxAgeNumBlocks int64 `protobuf:"varint,1,opt,name=max_age_num_blocks,json=maxAgeNumBlocks,proto3" json:"max_age_num_blocks,omitempty"` - // Max age of evidence, in time. - // - // It should correspond with an app's "unbonding period" or other similar - // mechanism for handling [Nothing-At-Stake - // attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed). - MaxAgeDuration time.Duration `protobuf:"bytes,2,opt,name=max_age_duration,json=maxAgeDuration,proto3,stdduration" json:"max_age_duration"` - // This sets the maximum size of total evidence in bytes that can be committed in a single block. - // and should fall comfortably under the max block bytes. - // Default is 1048576 or 1MB - MaxBytes int64 `protobuf:"varint,3,opt,name=max_bytes,json=maxBytes,proto3" json:"max_bytes,omitempty"` -} - -func (m *EvidenceParams) Reset() { *m = EvidenceParams{} } -func (m *EvidenceParams) String() string { return proto.CompactTextString(m) } -func (*EvidenceParams) ProtoMessage() {} -func (*EvidenceParams) Descriptor() ([]byte, []int) { - return fileDescriptor_e12598271a686f57, []int{2} -} - -func (m *EvidenceParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *EvidenceParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EvidenceParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *EvidenceParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_EvidenceParams.Merge(m, src) -} - -func (m *EvidenceParams) XXX_Size() int { - return m.Size() -} - -func (m *EvidenceParams) XXX_DiscardUnknown() { - xxx_messageInfo_EvidenceParams.DiscardUnknown(m) -} - -var xxx_messageInfo_EvidenceParams proto.InternalMessageInfo - -func (m *EvidenceParams) GetMaxAgeNumBlocks() int64 { - if m != nil { - return m.MaxAgeNumBlocks - } - return 0 -} - -func (m *EvidenceParams) GetMaxAgeDuration() time.Duration { - if m != nil { - return m.MaxAgeDuration - } - return 0 -} - -func (m *EvidenceParams) GetMaxBytes() int64 { - if m != nil { - return m.MaxBytes - } - return 0 -} - -// ValidatorParams restrict the public key types validators can use. -// NOTE: uses ABCI pubkey naming, not Amino names. -type ValidatorParams struct { - PubKeyTypes []string `protobuf:"bytes,1,rep,name=pub_key_types,json=pubKeyTypes,proto3" json:"pub_key_types,omitempty"` -} - -func (m *ValidatorParams) Reset() { *m = ValidatorParams{} } -func (m *ValidatorParams) String() string { return proto.CompactTextString(m) } -func (*ValidatorParams) ProtoMessage() {} -func (*ValidatorParams) Descriptor() ([]byte, []int) { - return fileDescriptor_e12598271a686f57, []int{3} -} - -func (m *ValidatorParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *ValidatorParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValidatorParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *ValidatorParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorParams.Merge(m, src) -} - -func (m *ValidatorParams) XXX_Size() int { - return m.Size() -} - -func (m *ValidatorParams) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorParams.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatorParams proto.InternalMessageInfo - -func (m *ValidatorParams) GetPubKeyTypes() []string { - if m != nil { - return m.PubKeyTypes - } - return nil -} - -// VersionParams contains the ABCI application version. -type VersionParams struct { - AppVersion uint64 `protobuf:"varint,1,opt,name=app_version,json=appVersion,proto3" json:"app_version,omitempty"` -} - -func (m *VersionParams) Reset() { *m = VersionParams{} } -func (m *VersionParams) String() string { return proto.CompactTextString(m) } -func (*VersionParams) ProtoMessage() {} -func (*VersionParams) Descriptor() ([]byte, []int) { - return fileDescriptor_e12598271a686f57, []int{4} -} - -func (m *VersionParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *VersionParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_VersionParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *VersionParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_VersionParams.Merge(m, src) -} - -func (m *VersionParams) XXX_Size() int { - return m.Size() -} - -func (m *VersionParams) XXX_DiscardUnknown() { - xxx_messageInfo_VersionParams.DiscardUnknown(m) -} - -var xxx_messageInfo_VersionParams proto.InternalMessageInfo - -func (m *VersionParams) GetAppVersion() uint64 { - if m != nil { - return m.AppVersion - } - return 0 -} - -// HashedParams is a subset of ConsensusParams. -// -// It is hashed into the Header.ConsensusHash. -type HashedParams struct { - BlockMaxBytes int64 `protobuf:"varint,1,opt,name=block_max_bytes,json=blockMaxBytes,proto3" json:"block_max_bytes,omitempty"` - BlockMaxGas int64 `protobuf:"varint,2,opt,name=block_max_gas,json=blockMaxGas,proto3" json:"block_max_gas,omitempty"` -} - -func (m *HashedParams) Reset() { *m = HashedParams{} } -func (m *HashedParams) String() string { return proto.CompactTextString(m) } -func (*HashedParams) ProtoMessage() {} -func (*HashedParams) Descriptor() ([]byte, []int) { - return fileDescriptor_e12598271a686f57, []int{5} -} - -func (m *HashedParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *HashedParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HashedParams.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *HashedParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_HashedParams.Merge(m, src) -} - -func (m *HashedParams) XXX_Size() int { - return m.Size() -} - -func (m *HashedParams) XXX_DiscardUnknown() { - xxx_messageInfo_HashedParams.DiscardUnknown(m) -} - -var xxx_messageInfo_HashedParams proto.InternalMessageInfo - -func (m *HashedParams) GetBlockMaxBytes() int64 { - if m != nil { - return m.BlockMaxBytes - } - return 0 -} - -func (m *HashedParams) GetBlockMaxGas() int64 { - if m != nil { - return m.BlockMaxGas - } - return 0 -} - -func init() { - proto.RegisterType((*ConsensusParams)(nil), "tendermint.types.ConsensusParams") - proto.RegisterType((*BlockParams)(nil), "tendermint.types.BlockParams") - proto.RegisterType((*EvidenceParams)(nil), "tendermint.types.EvidenceParams") - proto.RegisterType((*ValidatorParams)(nil), "tendermint.types.ValidatorParams") - proto.RegisterType((*VersionParams)(nil), "tendermint.types.VersionParams") - proto.RegisterType((*HashedParams)(nil), "tendermint.types.HashedParams") -} - -func init() { proto.RegisterFile("tendermint/types/params.proto", fileDescriptor_e12598271a686f57) } - -var fileDescriptor_e12598271a686f57 = []byte{ - // 537 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x53, 0x31, 0x6f, 0xd3, 0x40, - 0x18, 0xcd, 0xd5, 0xa5, 0x4d, 0xbe, 0x34, 0x4d, 0x75, 0x42, 0x22, 0x14, 0xd5, 0x0e, 0x1e, 0x50, - 0x25, 0x24, 0x5b, 0x82, 0x01, 0xd1, 0xa5, 0xc2, 0x50, 0x15, 0x84, 0x82, 0x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0xfc, 0x7e, 0x65, 0xa1, 0x3f, - 0x57, 0x16, 0xb2, 0x8f, 0xa0, 0x53, 0xcb, 0x1c, 0x5b, 0xd0, 0x26, 0x69, 0x1a, 0xe8, 0xa6, 0x0a, - 0x8f, 0x9b, 0x3e, 0x90, 0x34, 0x5d, 0xc2, 0x56, 0xb8, 0x67, 0xb0, 0xf3, 0x9a, 0x88, 0x73, 0x3a, - 0x5a, 0x52, 0x1f, 0x41, 0x57, 0x25, 0x13, 0xac, 0xd7, 0xd2, 0x51, 0xe3, 0x81, 0xee, 0xc6, 0x86, - 0x4e, 0x85, 0xab, 0x1a, 0x6a, 0x6b, 0xd4, 0x29, 0x11, 0xde, 0xc7, 0xaf, 0x73, 0x13, 0x5d, 0xcf, - 0x4d, 0x74, 0x33, 0x37, 0xd1, 0xef, 0xb9, 0x89, 0xbe, 0x2c, 0xcc, 0xc6, 0xcd, 0xc2, 0x6c, 0xfc, - 0x58, 0x98, 0x8d, 0xb3, 0x67, 0x51, 0x2c, 0xcf, 0xf3, 0xd0, 0x19, 0x72, 0xe6, 0xae, 0x3e, 0xcb, - 0xea, 0xb3, 0x7c, 0x77, 0xeb, 0x4f, 0x36, 0xdc, 0x52, 0xf3, 0xa7, 0x7f, 0x03, 0x00, 0x00, 0xff, - 0xff, 0xfe, 0xe0, 0x3d, 0x9c, 0xcd, 0x03, 0x00, 0x00, -} - -func (this *ConsensusParams) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ConsensusParams) - if !ok { - that2, ok := that.(ConsensusParams) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !this.Block.Equal(&that1.Block) { - return false - } - if !this.Evidence.Equal(&that1.Evidence) { - return false - } - if !this.Validator.Equal(&that1.Validator) { - return false - } - if !this.Version.Equal(&that1.Version) { - return false - } - return true -} - -func (this *BlockParams) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*BlockParams) - if !ok { - that2, ok := that.(BlockParams) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.MaxBytes != that1.MaxBytes { - return false - } - if this.MaxGas != that1.MaxGas { - return false - } - if this.TimeIotaMs != that1.TimeIotaMs { - return false - } - return true -} - -func (this *EvidenceParams) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*EvidenceParams) - if !ok { - that2, ok := that.(EvidenceParams) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.MaxAgeNumBlocks != that1.MaxAgeNumBlocks { - return false - } - if this.MaxAgeDuration != that1.MaxAgeDuration { - return false - } - if this.MaxBytes != that1.MaxBytes { - return false - } - return true -} - -func (this *ValidatorParams) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*ValidatorParams) - if !ok { - that2, ok := that.(ValidatorParams) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if len(this.PubKeyTypes) != len(that1.PubKeyTypes) { - return false - } - for i := range this.PubKeyTypes { - if this.PubKeyTypes[i] != that1.PubKeyTypes[i] { - return false - } - } - return true -} - -func (this *VersionParams) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*VersionParams) - if !ok { - that2, ok := that.(VersionParams) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.AppVersion != that1.AppVersion { - return false - } - return true -} - -func (this *HashedParams) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*HashedParams) - if !ok { - that2, ok := that.(HashedParams) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.BlockMaxBytes != that1.BlockMaxBytes { - return false - } - if this.BlockMaxGas != that1.BlockMaxGas { - return false - } - return true -} - -func (m *ConsensusParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ConsensusParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ConsensusParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Version.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - { - size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - { - size, err := m.Evidence.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintParams(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.Block.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 (m *BlockParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BlockParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BlockParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TimeIotaMs != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.TimeIotaMs)) - i-- - dAtA[i] = 0x18 - } - if m.MaxGas != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.MaxGas)) - i-- - dAtA[i] = 0x10 - } - if m.MaxBytes != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.MaxBytes)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *EvidenceParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EvidenceParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EvidenceParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.MaxBytes != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.MaxBytes)) - i-- - dAtA[i] = 0x18 - } - n5, err5 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.MaxAgeDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxAgeDuration):]) - if err5 != nil { - return 0, err5 - } - i -= n5 - i = encodeVarintParams(dAtA, i, uint64(n5)) - i-- - dAtA[i] = 0x12 - if m.MaxAgeNumBlocks != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.MaxAgeNumBlocks)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *ValidatorParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ValidatorParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ValidatorParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.PubKeyTypes) > 0 { - for iNdEx := len(m.PubKeyTypes) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.PubKeyTypes[iNdEx]) - copy(dAtA[i:], m.PubKeyTypes[iNdEx]) - i = encodeVarintParams(dAtA, i, uint64(len(m.PubKeyTypes[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *VersionParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *VersionParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *VersionParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.AppVersion != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.AppVersion)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *HashedParams) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *HashedParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HashedParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.BlockMaxGas != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.BlockMaxGas)) - i-- - dAtA[i] = 0x10 - } - if m.BlockMaxBytes != 0 { - i = encodeVarintParams(dAtA, i, uint64(m.BlockMaxBytes)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintParams(dAtA []byte, offset int, v uint64) int { - offset -= sovParams(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func NewPopulatedValidatorParams(r randyParams, easy bool) *ValidatorParams { - this := &ValidatorParams{} - v1 := r.Intn(10) - this.PubKeyTypes = make([]string, v1) - for i := 0; i < v1; i++ { - this.PubKeyTypes[i] = string(randStringParams(r)) - } - if !easy && r.Intn(10) != 0 { - } - return this -} - -func NewPopulatedVersionParams(r randyParams, easy bool) *VersionParams { - this := &VersionParams{} - this.AppVersion = uint64(uint64(r.Uint32())) - if !easy && r.Intn(10) != 0 { - } - return this -} - -type randyParams interface { - Float32() float32 - Float64() float64 - Int63() int64 - Int31() int32 - Uint32() uint32 - Intn(n int) int -} - -func randUTF8RuneParams(r randyParams) rune { - ru := r.Intn(62) - if ru < 10 { - return rune(ru + 48) - } else if ru < 36 { - return rune(ru + 55) - } - return rune(ru + 61) -} - -func randStringParams(r randyParams) string { - v2 := r.Intn(100) - tmps := make([]rune, v2) - for i := 0; i < v2; i++ { - tmps[i] = randUTF8RuneParams(r) - } - return string(tmps) -} - -func randUnrecognizedParams(r randyParams, maxFieldNumber int) (dAtA []byte) { - l := r.Intn(5) - for i := 0; i < l; i++ { - wire := r.Intn(4) - if wire == 3 { - wire = 5 - } - fieldNumber := maxFieldNumber + r.Intn(100) - dAtA = randFieldParams(dAtA, r, fieldNumber, wire) - } - return dAtA -} - -func randFieldParams(dAtA []byte, r randyParams, fieldNumber int, wire int) []byte { - key := uint32(fieldNumber)<<3 | uint32(wire) - switch wire { - case 0: - dAtA = encodeVarintPopulateParams(dAtA, uint64(key)) - v3 := r.Int63() - if r.Intn(2) == 0 { - v3 *= -1 - } - dAtA = encodeVarintPopulateParams(dAtA, uint64(v3)) - case 1: - dAtA = encodeVarintPopulateParams(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - case 2: - dAtA = encodeVarintPopulateParams(dAtA, uint64(key)) - ll := r.Intn(100) - dAtA = encodeVarintPopulateParams(dAtA, uint64(ll)) - for j := 0; j < ll; j++ { - dAtA = append(dAtA, byte(r.Intn(256))) - } - default: - dAtA = encodeVarintPopulateParams(dAtA, uint64(key)) - dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256))) - } - return dAtA -} - -func encodeVarintPopulateParams(dAtA []byte, v uint64) []byte { - for v >= 1<<7 { - dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80)) - v >>= 7 - } - dAtA = append(dAtA, uint8(v)) - return dAtA -} - -func (m *ConsensusParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Block.Size() - n += 1 + l + sovParams(uint64(l)) - l = m.Evidence.Size() - n += 1 + l + sovParams(uint64(l)) - l = m.Validator.Size() - n += 1 + l + sovParams(uint64(l)) - l = m.Version.Size() - n += 1 + l + sovParams(uint64(l)) - return n -} - -func (m *BlockParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MaxBytes != 0 { - n += 1 + sovParams(uint64(m.MaxBytes)) - } - if m.MaxGas != 0 { - n += 1 + sovParams(uint64(m.MaxGas)) - } - if m.TimeIotaMs != 0 { - n += 1 + sovParams(uint64(m.TimeIotaMs)) - } - return n -} - -func (m *EvidenceParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MaxAgeNumBlocks != 0 { - n += 1 + sovParams(uint64(m.MaxAgeNumBlocks)) - } - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.MaxAgeDuration) - n += 1 + l + sovParams(uint64(l)) - if m.MaxBytes != 0 { - n += 1 + sovParams(uint64(m.MaxBytes)) - } - return n -} - -func (m *ValidatorParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.PubKeyTypes) > 0 { - for _, s := range m.PubKeyTypes { - l = len(s) - n += 1 + l + sovParams(uint64(l)) - } - } - return n -} - -func (m *VersionParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.AppVersion != 0 { - n += 1 + sovParams(uint64(m.AppVersion)) - } - return n -} - -func (m *HashedParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BlockMaxBytes != 0 { - n += 1 + sovParams(uint64(m.BlockMaxBytes)) - } - if m.BlockMaxGas != 0 { - n += 1 + sovParams(uint64(m.BlockMaxGas)) - } - 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 *ConsensusParams) Unmarshal(dAtA []byte) 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: ConsensusParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ConsensusParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Block.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Evidence", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Evidence.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validator", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Validator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Version.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 (m *BlockParams) Unmarshal(dAtA []byte) 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: BlockParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BlockParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxBytes", wireType) - } - m.MaxBytes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxBytes |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxGas", wireType) - } - m.MaxGas = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxGas |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeIotaMs", wireType) - } - m.TimeIotaMs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TimeIotaMs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *EvidenceParams) Unmarshal(dAtA []byte) 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: EvidenceParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EvidenceParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxAgeNumBlocks", wireType) - } - m.MaxAgeNumBlocks = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxAgeNumBlocks |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxAgeDuration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.MaxAgeDuration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxBytes", wireType) - } - m.MaxBytes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxBytes |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *ValidatorParams) Unmarshal(dAtA []byte) 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: ValidatorParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PubKeyTypes", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthParams - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthParams - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PubKeyTypes = append(m.PubKeyTypes, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *VersionParams) Unmarshal(dAtA []byte) 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: VersionParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: VersionParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field AppVersion", wireType) - } - m.AppVersion = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.AppVersion |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *HashedParams) Unmarshal(dAtA []byte) 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: HashedParams: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: HashedParams: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockMaxBytes", wireType) - } - m.BlockMaxBytes = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockMaxBytes |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockMaxGas", wireType) - } - m.BlockMaxGas = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockMaxGas |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipParams(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthParams - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupParams - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthParams - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/proto/tendermint/types/types.pb.go b/third_party/proto/tendermint/types/types.pb.go deleted file mode 100644 index 2754dabab6..0000000000 --- a/third_party/proto/tendermint/types/types.pb.go +++ /dev/null @@ -1,4658 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: tendermint/types/types.proto - -package types - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - time "time" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" - github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - - crypto "github.com/line/ostracon/proto/ostracon/crypto" - version "github.com/line/ostracon/proto/ostracon/version" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal - -var ( - _ = fmt.Errorf - _ = math.Inf - _ = time.Kitchen -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// BlockIdFlag indicates which BlcokID the signature is for -type BlockIDFlag int32 - -const ( - BlockIDFlagUnknown BlockIDFlag = 0 - BlockIDFlagAbsent BlockIDFlag = 1 - BlockIDFlagCommit BlockIDFlag = 2 - BlockIDFlagNil BlockIDFlag = 3 -) - -var BlockIDFlag_name = map[int32]string{ - 0: "BLOCK_ID_FLAG_UNKNOWN", - 1: "BLOCK_ID_FLAG_ABSENT", - 2: "BLOCK_ID_FLAG_COMMIT", - 3: "BLOCK_ID_FLAG_NIL", -} - -var BlockIDFlag_value = map[string]int32{ - "BLOCK_ID_FLAG_UNKNOWN": 0, - "BLOCK_ID_FLAG_ABSENT": 1, - "BLOCK_ID_FLAG_COMMIT": 2, - "BLOCK_ID_FLAG_NIL": 3, -} - -func (x BlockIDFlag) String() string { - return proto.EnumName(BlockIDFlag_name, int32(x)) -} - -func (BlockIDFlag) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_d3a6e55e2345de56, []int{0} -} - -// SignedMsgType is a type of signed message in the consensus. -type SignedMsgType int32 - -const ( - UnknownType SignedMsgType = 0 - // Votes - PrevoteType SignedMsgType = 1 - PrecommitType SignedMsgType = 2 - // Proposals - ProposalType SignedMsgType = 32 -) - -var SignedMsgType_name = map[int32]string{ - 0: "SIGNED_MSG_TYPE_UNKNOWN", - 1: "SIGNED_MSG_TYPE_PREVOTE", - 2: "SIGNED_MSG_TYPE_PRECOMMIT", - 32: "SIGNED_MSG_TYPE_PROPOSAL", -} - -var SignedMsgType_value = map[string]int32{ - "SIGNED_MSG_TYPE_UNKNOWN": 0, - "SIGNED_MSG_TYPE_PREVOTE": 1, - "SIGNED_MSG_TYPE_PRECOMMIT": 2, - "SIGNED_MSG_TYPE_PROPOSAL": 32, -} - -func (x SignedMsgType) String() string { - return proto.EnumName(SignedMsgType_name, int32(x)) -} - -func (SignedMsgType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_d3a6e55e2345de56, []int{1} -} - -// PartsetHeader -type PartSetHeader struct { - Total uint32 `protobuf:"varint,1,opt,name=total,proto3" json:"total,omitempty"` - Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"` -} - -func (m *PartSetHeader) Reset() { *m = PartSetHeader{} } -func (m *PartSetHeader) String() string { return proto.CompactTextString(m) } -func (*PartSetHeader) ProtoMessage() {} -func (*PartSetHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_d3a6e55e2345de56, []int{0} -} - -func (m *PartSetHeader) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *PartSetHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_PartSetHeader.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *PartSetHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_PartSetHeader.Merge(m, src) -} - -func (m *PartSetHeader) XXX_Size() int { - return m.Size() -} - -func (m *PartSetHeader) XXX_DiscardUnknown() { - xxx_messageInfo_PartSetHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_PartSetHeader proto.InternalMessageInfo - -func (m *PartSetHeader) GetTotal() uint32 { - if m != nil { - return m.Total - } - return 0 -} - -func (m *PartSetHeader) GetHash() []byte { - if m != nil { - return m.Hash - } - return nil -} - -type Part struct { - Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` - Bytes []byte `protobuf:"bytes,2,opt,name=bytes,proto3" json:"bytes,omitempty"` - Proof crypto.Proof `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof"` -} - -func (m *Part) Reset() { *m = Part{} } -func (m *Part) String() string { return proto.CompactTextString(m) } -func (*Part) ProtoMessage() {} -func (*Part) Descriptor() ([]byte, []int) { - return fileDescriptor_d3a6e55e2345de56, []int{1} -} - -func (m *Part) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *Part) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Part.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *Part) XXX_Merge(src proto.Message) { - xxx_messageInfo_Part.Merge(m, src) -} - -func (m *Part) XXX_Size() int { - return m.Size() -} - -func (m *Part) XXX_DiscardUnknown() { - xxx_messageInfo_Part.DiscardUnknown(m) -} - -var xxx_messageInfo_Part proto.InternalMessageInfo - -func (m *Part) GetIndex() uint32 { - if m != nil { - return m.Index - } - return 0 -} - -func (m *Part) GetBytes() []byte { - if m != nil { - return m.Bytes - } - return nil -} - -func (m *Part) GetProof() crypto.Proof { - if m != nil { - return m.Proof - } - return crypto.Proof{} -} - -// BlockID -type BlockID struct { - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - PartSetHeader PartSetHeader `protobuf:"bytes,2,opt,name=part_set_header,json=partSetHeader,proto3" json:"part_set_header"` -} - -func (m *BlockID) Reset() { *m = BlockID{} } -func (m *BlockID) String() string { return proto.CompactTextString(m) } -func (*BlockID) ProtoMessage() {} -func (*BlockID) Descriptor() ([]byte, []int) { - return fileDescriptor_d3a6e55e2345de56, []int{2} -} - -func (m *BlockID) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *BlockID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BlockID.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *BlockID) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockID.Merge(m, src) -} - -func (m *BlockID) XXX_Size() int { - return m.Size() -} - -func (m *BlockID) XXX_DiscardUnknown() { - xxx_messageInfo_BlockID.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockID proto.InternalMessageInfo - -func (m *BlockID) GetHash() []byte { - if m != nil { - return m.Hash - } - return nil -} - -func (m *BlockID) GetPartSetHeader() PartSetHeader { - if m != nil { - return m.PartSetHeader - } - return PartSetHeader{} -} - -// Header defines the structure of a Tendermint block header. -type Header struct { - // basic block info - Version version.Consensus `protobuf:"bytes,1,opt,name=version,proto3" json:"version"` - ChainID string `protobuf:"bytes,2,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - Height int64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` - Time time.Time `protobuf:"bytes,4,opt,name=time,proto3,stdtime" json:"time"` - // prev block info - LastBlockId BlockID `protobuf:"bytes,5,opt,name=last_block_id,json=lastBlockId,proto3" json:"last_block_id"` - // hashes of block data - LastCommitHash []byte `protobuf:"bytes,6,opt,name=last_commit_hash,json=lastCommitHash,proto3" json:"last_commit_hash,omitempty"` - DataHash []byte `protobuf:"bytes,7,opt,name=data_hash,json=dataHash,proto3" json:"data_hash,omitempty"` - // hashes from the app output from the prev block - ValidatorsHash []byte `protobuf:"bytes,8,opt,name=validators_hash,json=validatorsHash,proto3" json:"validators_hash,omitempty"` - NextValidatorsHash []byte `protobuf:"bytes,9,opt,name=next_validators_hash,json=nextValidatorsHash,proto3" json:"next_validators_hash,omitempty"` - ConsensusHash []byte `protobuf:"bytes,10,opt,name=consensus_hash,json=consensusHash,proto3" json:"consensus_hash,omitempty"` - AppHash []byte `protobuf:"bytes,11,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` - LastResultsHash []byte `protobuf:"bytes,12,opt,name=last_results_hash,json=lastResultsHash,proto3" json:"last_results_hash,omitempty"` - // consensus info - EvidenceHash []byte `protobuf:"bytes,13,opt,name=evidence_hash,json=evidenceHash,proto3" json:"evidence_hash,omitempty"` - ProposerAddress []byte `protobuf:"bytes,14,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` -} - -func (m *Header) Reset() { *m = Header{} } -func (m *Header) String() string { return proto.CompactTextString(m) } -func (*Header) ProtoMessage() {} -func (*Header) Descriptor() ([]byte, []int) { - return fileDescriptor_d3a6e55e2345de56, []int{3} -} - -func (m *Header) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *Header) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Header.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *Header) XXX_Merge(src proto.Message) { - xxx_messageInfo_Header.Merge(m, src) -} - -func (m *Header) XXX_Size() int { - return m.Size() -} - -func (m *Header) XXX_DiscardUnknown() { - xxx_messageInfo_Header.DiscardUnknown(m) -} - -var xxx_messageInfo_Header proto.InternalMessageInfo - -func (m *Header) GetVersion() version.Consensus { - if m != nil { - return m.Version - } - return version.Consensus{} -} - -func (m *Header) GetChainID() string { - if m != nil { - return m.ChainID - } - return "" -} - -func (m *Header) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *Header) GetTime() time.Time { - if m != nil { - return m.Time - } - return time.Time{} -} - -func (m *Header) GetLastBlockId() BlockID { - if m != nil { - return m.LastBlockId - } - return BlockID{} -} - -func (m *Header) GetLastCommitHash() []byte { - if m != nil { - return m.LastCommitHash - } - return nil -} - -func (m *Header) GetDataHash() []byte { - if m != nil { - return m.DataHash - } - return nil -} - -func (m *Header) GetValidatorsHash() []byte { - if m != nil { - return m.ValidatorsHash - } - return nil -} - -func (m *Header) GetNextValidatorsHash() []byte { - if m != nil { - return m.NextValidatorsHash - } - return nil -} - -func (m *Header) GetConsensusHash() []byte { - if m != nil { - return m.ConsensusHash - } - return nil -} - -func (m *Header) GetAppHash() []byte { - if m != nil { - return m.AppHash - } - return nil -} - -func (m *Header) GetLastResultsHash() []byte { - if m != nil { - return m.LastResultsHash - } - return nil -} - -func (m *Header) GetEvidenceHash() []byte { - if m != nil { - return m.EvidenceHash - } - return nil -} - -func (m *Header) GetProposerAddress() []byte { - if m != nil { - return m.ProposerAddress - } - return nil -} - -// Data contains the set of transactions included in the block -type Data struct { - // Txs that will be applied by state @ block.Height+1. - // NOTE: not all txs here are valid. We're just agreeing on the order first. - // This means that block.AppHash does not include these txs. - Txs [][]byte `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` -} - -func (m *Data) Reset() { *m = Data{} } -func (m *Data) String() string { return proto.CompactTextString(m) } -func (*Data) ProtoMessage() {} -func (*Data) Descriptor() ([]byte, []int) { - return fileDescriptor_d3a6e55e2345de56, []int{4} -} - -func (m *Data) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Data.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *Data) XXX_Merge(src proto.Message) { - xxx_messageInfo_Data.Merge(m, src) -} - -func (m *Data) XXX_Size() int { - return m.Size() -} - -func (m *Data) XXX_DiscardUnknown() { - xxx_messageInfo_Data.DiscardUnknown(m) -} - -var xxx_messageInfo_Data proto.InternalMessageInfo - -func (m *Data) GetTxs() [][]byte { - if m != nil { - return m.Txs - } - return nil -} - -// Vote represents a prevote, precommit, or commit vote from validators for -// consensus. -type Vote struct { - Type SignedMsgType `protobuf:"varint,1,opt,name=type,proto3,enum=tendermint.types.SignedMsgType" json:"type,omitempty"` - Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` - Round int32 `protobuf:"varint,3,opt,name=round,proto3" json:"round,omitempty"` - BlockID BlockID `protobuf:"bytes,4,opt,name=block_id,json=blockId,proto3" json:"block_id"` - Timestamp time.Time `protobuf:"bytes,5,opt,name=timestamp,proto3,stdtime" json:"timestamp"` - ValidatorAddress []byte `protobuf:"bytes,6,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - ValidatorIndex int32 `protobuf:"varint,7,opt,name=validator_index,json=validatorIndex,proto3" json:"validator_index,omitempty"` - Signature []byte `protobuf:"bytes,8,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (m *Vote) Reset() { *m = Vote{} } -func (m *Vote) String() string { return proto.CompactTextString(m) } -func (*Vote) ProtoMessage() {} -func (*Vote) Descriptor() ([]byte, []int) { - return fileDescriptor_d3a6e55e2345de56, []int{5} -} - -func (m *Vote) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Vote.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *Vote) XXX_Merge(src proto.Message) { - xxx_messageInfo_Vote.Merge(m, src) -} - -func (m *Vote) XXX_Size() int { - return m.Size() -} - -func (m *Vote) XXX_DiscardUnknown() { - xxx_messageInfo_Vote.DiscardUnknown(m) -} - -var xxx_messageInfo_Vote proto.InternalMessageInfo - -func (m *Vote) GetType() SignedMsgType { - if m != nil { - return m.Type - } - return UnknownType -} - -func (m *Vote) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *Vote) GetRound() int32 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *Vote) GetBlockID() BlockID { - if m != nil { - return m.BlockID - } - return BlockID{} -} - -func (m *Vote) GetTimestamp() time.Time { - if m != nil { - return m.Timestamp - } - return time.Time{} -} - -func (m *Vote) GetValidatorAddress() []byte { - if m != nil { - return m.ValidatorAddress - } - return nil -} - -func (m *Vote) GetValidatorIndex() int32 { - if m != nil { - return m.ValidatorIndex - } - return 0 -} - -func (m *Vote) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -// Commit contains the evidence that a block was committed by a set of validators. -type Commit struct { - Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` - Round int32 `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"` - BlockID BlockID `protobuf:"bytes,3,opt,name=block_id,json=blockId,proto3" json:"block_id"` - Signatures []CommitSig `protobuf:"bytes,4,rep,name=signatures,proto3" json:"signatures"` -} - -func (m *Commit) Reset() { *m = Commit{} } -func (m *Commit) String() string { return proto.CompactTextString(m) } -func (*Commit) ProtoMessage() {} -func (*Commit) Descriptor() ([]byte, []int) { - return fileDescriptor_d3a6e55e2345de56, []int{6} -} - -func (m *Commit) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *Commit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Commit.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *Commit) XXX_Merge(src proto.Message) { - xxx_messageInfo_Commit.Merge(m, src) -} - -func (m *Commit) XXX_Size() int { - return m.Size() -} - -func (m *Commit) XXX_DiscardUnknown() { - xxx_messageInfo_Commit.DiscardUnknown(m) -} - -var xxx_messageInfo_Commit proto.InternalMessageInfo - -func (m *Commit) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *Commit) GetRound() int32 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *Commit) GetBlockID() BlockID { - if m != nil { - return m.BlockID - } - return BlockID{} -} - -func (m *Commit) GetSignatures() []CommitSig { - if m != nil { - return m.Signatures - } - return nil -} - -// CommitSig is a part of the Vote included in a Commit. -type CommitSig struct { - BlockIdFlag BlockIDFlag `protobuf:"varint,1,opt,name=block_id_flag,json=blockIdFlag,proto3,enum=tendermint.types.BlockIDFlag" json:"block_id_flag,omitempty"` - ValidatorAddress []byte `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` - Timestamp time.Time `protobuf:"bytes,3,opt,name=timestamp,proto3,stdtime" json:"timestamp"` - Signature []byte `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (m *CommitSig) Reset() { *m = CommitSig{} } -func (m *CommitSig) String() string { return proto.CompactTextString(m) } -func (*CommitSig) ProtoMessage() {} -func (*CommitSig) Descriptor() ([]byte, []int) { - return fileDescriptor_d3a6e55e2345de56, []int{7} -} - -func (m *CommitSig) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *CommitSig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_CommitSig.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *CommitSig) XXX_Merge(src proto.Message) { - xxx_messageInfo_CommitSig.Merge(m, src) -} - -func (m *CommitSig) XXX_Size() int { - return m.Size() -} - -func (m *CommitSig) XXX_DiscardUnknown() { - xxx_messageInfo_CommitSig.DiscardUnknown(m) -} - -var xxx_messageInfo_CommitSig proto.InternalMessageInfo - -func (m *CommitSig) GetBlockIdFlag() BlockIDFlag { - if m != nil { - return m.BlockIdFlag - } - return BlockIDFlagUnknown -} - -func (m *CommitSig) GetValidatorAddress() []byte { - if m != nil { - return m.ValidatorAddress - } - return nil -} - -func (m *CommitSig) GetTimestamp() time.Time { - if m != nil { - return m.Timestamp - } - return time.Time{} -} - -func (m *CommitSig) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -type Proposal struct { - Type SignedMsgType `protobuf:"varint,1,opt,name=type,proto3,enum=tendermint.types.SignedMsgType" json:"type,omitempty"` - Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` - Round int32 `protobuf:"varint,3,opt,name=round,proto3" json:"round,omitempty"` - PolRound int32 `protobuf:"varint,4,opt,name=pol_round,json=polRound,proto3" json:"pol_round,omitempty"` - BlockID BlockID `protobuf:"bytes,5,opt,name=block_id,json=blockId,proto3" json:"block_id"` - Timestamp time.Time `protobuf:"bytes,6,opt,name=timestamp,proto3,stdtime" json:"timestamp"` - Signature []byte `protobuf:"bytes,7,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (m *Proposal) Reset() { *m = Proposal{} } -func (m *Proposal) String() string { return proto.CompactTextString(m) } -func (*Proposal) ProtoMessage() {} -func (*Proposal) Descriptor() ([]byte, []int) { - return fileDescriptor_d3a6e55e2345de56, []int{8} -} - -func (m *Proposal) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Proposal.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *Proposal) XXX_Merge(src proto.Message) { - xxx_messageInfo_Proposal.Merge(m, src) -} - -func (m *Proposal) XXX_Size() int { - return m.Size() -} - -func (m *Proposal) XXX_DiscardUnknown() { - xxx_messageInfo_Proposal.DiscardUnknown(m) -} - -var xxx_messageInfo_Proposal proto.InternalMessageInfo - -func (m *Proposal) GetType() SignedMsgType { - if m != nil { - return m.Type - } - return UnknownType -} - -func (m *Proposal) GetHeight() int64 { - if m != nil { - return m.Height - } - return 0 -} - -func (m *Proposal) GetRound() int32 { - if m != nil { - return m.Round - } - return 0 -} - -func (m *Proposal) GetPolRound() int32 { - if m != nil { - return m.PolRound - } - return 0 -} - -func (m *Proposal) GetBlockID() BlockID { - if m != nil { - return m.BlockID - } - return BlockID{} -} - -func (m *Proposal) GetTimestamp() time.Time { - if m != nil { - return m.Timestamp - } - return time.Time{} -} - -func (m *Proposal) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -type SignedHeader struct { - Header *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` - Commit *Commit `protobuf:"bytes,2,opt,name=commit,proto3" json:"commit,omitempty"` -} - -func (m *SignedHeader) Reset() { *m = SignedHeader{} } -func (m *SignedHeader) String() string { return proto.CompactTextString(m) } -func (*SignedHeader) ProtoMessage() {} -func (*SignedHeader) Descriptor() ([]byte, []int) { - return fileDescriptor_d3a6e55e2345de56, []int{9} -} - -func (m *SignedHeader) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *SignedHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SignedHeader.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *SignedHeader) XXX_Merge(src proto.Message) { - xxx_messageInfo_SignedHeader.Merge(m, src) -} - -func (m *SignedHeader) XXX_Size() int { - return m.Size() -} - -func (m *SignedHeader) XXX_DiscardUnknown() { - xxx_messageInfo_SignedHeader.DiscardUnknown(m) -} - -var xxx_messageInfo_SignedHeader proto.InternalMessageInfo - -func (m *SignedHeader) GetHeader() *Header { - if m != nil { - return m.Header - } - return nil -} - -func (m *SignedHeader) GetCommit() *Commit { - if m != nil { - return m.Commit - } - return nil -} - -type LightBlock struct { - SignedHeader *SignedHeader `protobuf:"bytes,1,opt,name=signed_header,json=signedHeader,proto3" json:"signed_header,omitempty"` - ValidatorSet *ValidatorSet `protobuf:"bytes,2,opt,name=validator_set,json=validatorSet,proto3" json:"validator_set,omitempty"` -} - -func (m *LightBlock) Reset() { *m = LightBlock{} } -func (m *LightBlock) String() string { return proto.CompactTextString(m) } -func (*LightBlock) ProtoMessage() {} -func (*LightBlock) Descriptor() ([]byte, []int) { - return fileDescriptor_d3a6e55e2345de56, []int{10} -} - -func (m *LightBlock) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *LightBlock) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_LightBlock.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *LightBlock) XXX_Merge(src proto.Message) { - xxx_messageInfo_LightBlock.Merge(m, src) -} - -func (m *LightBlock) XXX_Size() int { - return m.Size() -} - -func (m *LightBlock) XXX_DiscardUnknown() { - xxx_messageInfo_LightBlock.DiscardUnknown(m) -} - -var xxx_messageInfo_LightBlock proto.InternalMessageInfo - -func (m *LightBlock) GetSignedHeader() *SignedHeader { - if m != nil { - return m.SignedHeader - } - return nil -} - -func (m *LightBlock) GetValidatorSet() *ValidatorSet { - if m != nil { - return m.ValidatorSet - } - return nil -} - -type BlockMeta struct { - BlockID BlockID `protobuf:"bytes,1,opt,name=block_id,json=blockId,proto3" json:"block_id"` - BlockSize int64 `protobuf:"varint,2,opt,name=block_size,json=blockSize,proto3" json:"block_size,omitempty"` - Header Header `protobuf:"bytes,3,opt,name=header,proto3" json:"header"` - NumTxs int64 `protobuf:"varint,4,opt,name=num_txs,json=numTxs,proto3" json:"num_txs,omitempty"` -} - -func (m *BlockMeta) Reset() { *m = BlockMeta{} } -func (m *BlockMeta) String() string { return proto.CompactTextString(m) } -func (*BlockMeta) ProtoMessage() {} -func (*BlockMeta) Descriptor() ([]byte, []int) { - return fileDescriptor_d3a6e55e2345de56, []int{11} -} - -func (m *BlockMeta) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *BlockMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_BlockMeta.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *BlockMeta) XXX_Merge(src proto.Message) { - xxx_messageInfo_BlockMeta.Merge(m, src) -} - -func (m *BlockMeta) XXX_Size() int { - return m.Size() -} - -func (m *BlockMeta) XXX_DiscardUnknown() { - xxx_messageInfo_BlockMeta.DiscardUnknown(m) -} - -var xxx_messageInfo_BlockMeta proto.InternalMessageInfo - -func (m *BlockMeta) GetBlockID() BlockID { - if m != nil { - return m.BlockID - } - return BlockID{} -} - -func (m *BlockMeta) GetBlockSize() int64 { - if m != nil { - return m.BlockSize - } - return 0 -} - -func (m *BlockMeta) GetHeader() Header { - if m != nil { - return m.Header - } - return Header{} -} - -func (m *BlockMeta) GetNumTxs() int64 { - if m != nil { - return m.NumTxs - } - return 0 -} - -// TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree. -type TxProof struct { - RootHash []byte `protobuf:"bytes,1,opt,name=root_hash,json=rootHash,proto3" json:"root_hash,omitempty"` - Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Proof *crypto.Proof `protobuf:"bytes,3,opt,name=proof,proto3" json:"proof,omitempty"` -} - -func (m *TxProof) Reset() { *m = TxProof{} } -func (m *TxProof) String() string { return proto.CompactTextString(m) } -func (*TxProof) ProtoMessage() {} -func (*TxProof) Descriptor() ([]byte, []int) { - return fileDescriptor_d3a6e55e2345de56, []int{12} -} - -func (m *TxProof) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *TxProof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TxProof.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *TxProof) XXX_Merge(src proto.Message) { - xxx_messageInfo_TxProof.Merge(m, src) -} - -func (m *TxProof) XXX_Size() int { - return m.Size() -} - -func (m *TxProof) XXX_DiscardUnknown() { - xxx_messageInfo_TxProof.DiscardUnknown(m) -} - -var xxx_messageInfo_TxProof proto.InternalMessageInfo - -func (m *TxProof) GetRootHash() []byte { - if m != nil { - return m.RootHash - } - return nil -} - -func (m *TxProof) GetData() []byte { - if m != nil { - return m.Data - } - return nil -} - -func (m *TxProof) GetProof() *crypto.Proof { - if m != nil { - return m.Proof - } - return nil -} - -func init() { - proto.RegisterEnum("tendermint.types.BlockIDFlag", BlockIDFlag_name, BlockIDFlag_value) - proto.RegisterEnum("tendermint.types.SignedMsgType", SignedMsgType_name, SignedMsgType_value) - proto.RegisterType((*PartSetHeader)(nil), "tendermint.types.PartSetHeader") - proto.RegisterType((*Part)(nil), "tendermint.types.Part") - proto.RegisterType((*BlockID)(nil), "tendermint.types.BlockID") - proto.RegisterType((*Header)(nil), "tendermint.types.Header") - proto.RegisterType((*Data)(nil), "tendermint.types.Data") - proto.RegisterType((*Vote)(nil), "tendermint.types.Vote") - proto.RegisterType((*Commit)(nil), "tendermint.types.Commit") - proto.RegisterType((*CommitSig)(nil), "tendermint.types.CommitSig") - proto.RegisterType((*Proposal)(nil), "tendermint.types.Proposal") - proto.RegisterType((*SignedHeader)(nil), "tendermint.types.SignedHeader") - proto.RegisterType((*LightBlock)(nil), "tendermint.types.LightBlock") - proto.RegisterType((*BlockMeta)(nil), "tendermint.types.BlockMeta") - proto.RegisterType((*TxProof)(nil), "tendermint.types.TxProof") -} - -func init() { proto.RegisterFile("tendermint/types/types.proto", fileDescriptor_d3a6e55e2345de56) } - -var fileDescriptor_d3a6e55e2345de56 = []byte{ - // 1314 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0xda, 0x9b, 0xd8, 0x7e, 0xb6, 0x13, 0x67, 0x95, 0xb6, 0xae, 0xdb, 0x38, 0x2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0x91, 0x83, 0x6e, 0x40, 0x21, 0x08, 0x71, 0x80, 0x09, 0x0a, 0x2d, - 0xdb, 0x71, 0x42, 0x44, 0x48, 0x71, 0x59, 0xcc, 0x37, 0xb6, 0x57, 0x85, 0xb9, 0x52, 0x04, 0x75, - 0xc7, 0xa6, 0xb6, 0x56, 0x80, 0x24, 0x3d, 0x22, 0x45, 0x45, 0x4f, 0x6e, 0xe6, 0x4c, 0xf6, 0x59, - 0xf9, 0x3b, 0x01, 0xea, 0x43, 0x4c, 0x91, 0x76, 0x1b, 0x54, 0xd6, 0x26, 0xae, 0xbe, 0xe5, 0x8b, - 0xf4, 0xdc, 0x76, 0xfb, 0x3e, 0x72, 0xf6, 0x49, 0xbf, 0x73, 0x1c, 0x20, 0x93, 0x83, 0x63, 0x72, - 0x4a, 0x4c, 0xc9, 0x69, 0x0d, 0x16, 0x43, 0x3c, 0xf2, 0x1d, 0xae, 0xb2, 0x45, 0x53, 0x0c, 0xb4, - 0x5d, 0x48, 0x47, 0x2a, 0x51, 0xff, 0x4b, 0x25, 0x2b, 0x4c, 0x25, 0x4c, 0xc3, 0xd2, 0x60, 0xa6, - 0xba, 0x52, 0x2c, 0x35, 0xc8, 0x44, 0x87, 0x97, 0x54, 0xdb, 0xab, 0x09, 0x76, 0x12, 0xa6, 0xbd, - 0x07, 0xab, 0x51, 0xef, 0x23, 0xf2, 0x84, 0xe2, 0x0a, 0x91, 0x43, 0xb2, 0x37, 0x25, 0x2b, 0x4b, - 0x1c, 0x40, 0x29, 0x5e, 0xd7, 0x44, 0x56, 0x0d, 0x7e, 0x12, 0x5d, 0x87, 0x0c, 0x71, 0xfb, 0xbe, - 0x4d, 0x47, 0x21, 0x92, 0xca, 0x9b, 0x18, 0x2a, 0x3f, 0x2b, 0xb0, 0x24, 0x94, 0x1c, 0xe3, 0x4d, - 0xb9, 0x98, 0xb7, 0xc4, 0x3c, 0xde, 0x92, 0xaf, 0xcf, 0x5b, 0x15, 0x20, 0x4a, 0x86, 0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, 0x43, 0xdf, 0xef, 0x0c, - 0x00, 0x00, -} - -func (m *PartSetHeader) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PartSetHeader) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PartSetHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0x12 - } - if m.Total != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Total)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Part) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Part) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Part) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if len(m.Bytes) > 0 { - i -= len(m.Bytes) - copy(dAtA[i:], m.Bytes) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Bytes))) - i-- - dAtA[i] = 0x12 - } - if m.Index != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *BlockID) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BlockID) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BlockID) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.PartSetHeader.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Hash) > 0 { - i -= len(m.Hash) - copy(dAtA[i:], m.Hash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Hash))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Header) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Header) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Header) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ProposerAddress) > 0 { - i -= len(m.ProposerAddress) - copy(dAtA[i:], m.ProposerAddress) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ProposerAddress))) - i-- - dAtA[i] = 0x72 - } - if len(m.EvidenceHash) > 0 { - i -= len(m.EvidenceHash) - copy(dAtA[i:], m.EvidenceHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.EvidenceHash))) - i-- - dAtA[i] = 0x6a - } - if len(m.LastResultsHash) > 0 { - i -= len(m.LastResultsHash) - copy(dAtA[i:], m.LastResultsHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.LastResultsHash))) - i-- - dAtA[i] = 0x62 - } - if len(m.AppHash) > 0 { - i -= len(m.AppHash) - copy(dAtA[i:], m.AppHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.AppHash))) - i-- - dAtA[i] = 0x5a - } - if len(m.ConsensusHash) > 0 { - i -= len(m.ConsensusHash) - copy(dAtA[i:], m.ConsensusHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ConsensusHash))) - i-- - dAtA[i] = 0x52 - } - if len(m.NextValidatorsHash) > 0 { - i -= len(m.NextValidatorsHash) - copy(dAtA[i:], m.NextValidatorsHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.NextValidatorsHash))) - i-- - dAtA[i] = 0x4a - } - if len(m.ValidatorsHash) > 0 { - i -= len(m.ValidatorsHash) - copy(dAtA[i:], m.ValidatorsHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ValidatorsHash))) - i-- - dAtA[i] = 0x42 - } - if len(m.DataHash) > 0 { - i -= len(m.DataHash) - copy(dAtA[i:], m.DataHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.DataHash))) - i-- - dAtA[i] = 0x3a - } - if len(m.LastCommitHash) > 0 { - i -= len(m.LastCommitHash) - copy(dAtA[i:], m.LastCommitHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.LastCommitHash))) - i-- - dAtA[i] = 0x32 - } - { - size, err := m.LastBlockId.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Time):]) - if err4 != nil { - return 0, err4 - } - i -= n4 - i = encodeVarintTypes(dAtA, i, uint64(n4)) - i-- - dAtA[i] = 0x22 - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x18 - } - if len(m.ChainID) > 0 { - i -= len(m.ChainID) - copy(dAtA[i:], m.ChainID) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ChainID))) - i-- - dAtA[i] = 0x12 - } - { - size, err := m.Version.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Data) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Data) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Data) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Txs) > 0 { - for iNdEx := len(m.Txs) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Txs[iNdEx]) - copy(dAtA[i:], m.Txs[iNdEx]) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Txs[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Vote) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Vote) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Vote) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signature) > 0 { - i -= len(m.Signature) - copy(dAtA[i:], m.Signature) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Signature))) - i-- - dAtA[i] = 0x42 - } - if m.ValidatorIndex != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.ValidatorIndex)) - i-- - dAtA[i] = 0x38 - } - if len(m.ValidatorAddress) > 0 { - i -= len(m.ValidatorAddress) - copy(dAtA[i:], m.ValidatorAddress) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ValidatorAddress))) - i-- - dAtA[i] = 0x32 - } - n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) - if err6 != nil { - return 0, err6 - } - i -= n6 - i = encodeVarintTypes(dAtA, i, uint64(n6)) - i-- - dAtA[i] = 0x2a - { - size, err := m.BlockID.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - if m.Round != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x18 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x10 - } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Commit) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Commit) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Commit) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signatures) > 0 { - for iNdEx := len(m.Signatures) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Signatures[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - { - size, err := m.BlockID.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.Round != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x10 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *CommitSig) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *CommitSig) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *CommitSig) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signature) > 0 { - i -= len(m.Signature) - copy(dAtA[i:], m.Signature) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Signature))) - i-- - dAtA[i] = 0x22 - } - n9, err9 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) - if err9 != nil { - return 0, err9 - } - i -= n9 - i = encodeVarintTypes(dAtA, i, uint64(n9)) - i-- - dAtA[i] = 0x1a - if len(m.ValidatorAddress) > 0 { - i -= len(m.ValidatorAddress) - copy(dAtA[i:], m.ValidatorAddress) - i = encodeVarintTypes(dAtA, i, uint64(len(m.ValidatorAddress))) - i-- - dAtA[i] = 0x12 - } - if m.BlockIdFlag != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.BlockIdFlag)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Proposal) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Proposal) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signature) > 0 { - i -= len(m.Signature) - copy(dAtA[i:], m.Signature) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Signature))) - i-- - dAtA[i] = 0x3a - } - n10, err10 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) - if err10 != nil { - return 0, err10 - } - i -= n10 - i = encodeVarintTypes(dAtA, i, uint64(n10)) - i-- - dAtA[i] = 0x32 - { - size, err := m.BlockID.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - if m.PolRound != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.PolRound)) - i-- - dAtA[i] = 0x20 - } - if m.Round != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Round)) - i-- - dAtA[i] = 0x18 - } - if m.Height != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Height)) - i-- - dAtA[i] = 0x10 - } - if m.Type != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *SignedHeader) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SignedHeader) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SignedHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Commit != nil { - { - size, err := m.Commit.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Header != nil { - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *LightBlock) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LightBlock) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LightBlock) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ValidatorSet != nil { - { - size, err := m.ValidatorSet.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.SignedHeader != nil { - { - size, err := m.SignedHeader.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *BlockMeta) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *BlockMeta) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *BlockMeta) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.NumTxs != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.NumTxs)) - i-- - dAtA[i] = 0x20 - } - { - size, err := m.Header.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - if m.BlockSize != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.BlockSize)) - i-- - dAtA[i] = 0x10 - } - { - size, err := m.BlockID.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *TxProof) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TxProof) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TxProof) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Proof != nil { - { - size, err := m.Proof.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.Data) > 0 { - i -= len(m.Data) - copy(dAtA[i:], m.Data) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Data))) - i-- - dAtA[i] = 0x12 - } - if len(m.RootHash) > 0 { - i -= len(m.RootHash) - copy(dAtA[i:], m.RootHash) - i = encodeVarintTypes(dAtA, i, uint64(len(m.RootHash))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func (m *PartSetHeader) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Total != 0 { - n += 1 + sovTypes(uint64(m.Total)) - } - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Part) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Index != 0 { - n += 1 + sovTypes(uint64(m.Index)) - } - l = len(m.Bytes) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = m.Proof.Size() - n += 1 + l + sovTypes(uint64(l)) - return n -} - -func (m *BlockID) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Hash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = m.PartSetHeader.Size() - n += 1 + l + sovTypes(uint64(l)) - return n -} - -func (m *Header) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Version.Size() - n += 1 + l + sovTypes(uint64(l)) - l = len(m.ChainID) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Time) - n += 1 + l + sovTypes(uint64(l)) - l = m.LastBlockId.Size() - n += 1 + l + sovTypes(uint64(l)) - l = len(m.LastCommitHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.DataHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.ValidatorsHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.NextValidatorsHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.ConsensusHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.AppHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.LastResultsHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.EvidenceHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.ProposerAddress) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Data) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Txs) > 0 { - for _, b := range m.Txs { - l = len(b) - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *Vote) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Round != 0 { - n += 1 + sovTypes(uint64(m.Round)) - } - l = m.BlockID.Size() - n += 1 + l + sovTypes(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp) - n += 1 + l + sovTypes(uint64(l)) - l = len(m.ValidatorAddress) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.ValidatorIndex != 0 { - n += 1 + sovTypes(uint64(m.ValidatorIndex)) - } - l = len(m.Signature) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Commit) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Round != 0 { - n += 1 + sovTypes(uint64(m.Round)) - } - l = m.BlockID.Size() - n += 1 + l + sovTypes(uint64(l)) - if len(m.Signatures) > 0 { - for _, e := range m.Signatures { - l = e.Size() - n += 1 + l + sovTypes(uint64(l)) - } - } - return n -} - -func (m *CommitSig) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.BlockIdFlag != 0 { - n += 1 + sovTypes(uint64(m.BlockIdFlag)) - } - l = len(m.ValidatorAddress) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp) - n += 1 + l + sovTypes(uint64(l)) - l = len(m.Signature) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Proposal) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Type != 0 { - n += 1 + sovTypes(uint64(m.Type)) - } - if m.Height != 0 { - n += 1 + sovTypes(uint64(m.Height)) - } - if m.Round != 0 { - n += 1 + sovTypes(uint64(m.Round)) - } - if m.PolRound != 0 { - n += 1 + sovTypes(uint64(m.PolRound)) - } - l = m.BlockID.Size() - n += 1 + l + sovTypes(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp) - n += 1 + l + sovTypes(uint64(l)) - l = len(m.Signature) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *SignedHeader) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Header != nil { - l = m.Header.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.Commit != nil { - l = m.Commit.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *LightBlock) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SignedHeader != nil { - l = m.SignedHeader.Size() - n += 1 + l + sovTypes(uint64(l)) - } - if m.ValidatorSet != nil { - l = m.ValidatorSet.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *BlockMeta) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.BlockID.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.BlockSize != 0 { - n += 1 + sovTypes(uint64(m.BlockSize)) - } - l = m.Header.Size() - n += 1 + l + sovTypes(uint64(l)) - if m.NumTxs != 0 { - n += 1 + sovTypes(uint64(m.NumTxs)) - } - return n -} - -func (m *TxProof) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.RootHash) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - l = len(m.Data) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - if m.Proof != nil { - l = m.Proof.Size() - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -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 *PartSetHeader) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: PartSetHeader: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PartSetHeader: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Total", wireType) - } - m.Total = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Total |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) - if m.Hash == nil { - m.Hash = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *Part) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Part: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Part: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bytes", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bytes = append(m.Bytes[:0], dAtA[iNdEx:postIndex]...) - if m.Bytes == nil { - m.Bytes = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *BlockID) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BlockID: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BlockID: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Hash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Hash = append(m.Hash[:0], dAtA[iNdEx:postIndex]...) - if m.Hash == nil { - m.Hash = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PartSetHeader", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PartSetHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *Header) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Header: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Header: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Version.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Time, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastBlockId", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.LastBlockId.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastCommitHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LastCommitHash = append(m.LastCommitHash[:0], dAtA[iNdEx:postIndex]...) - if m.LastCommitHash == nil { - m.LastCommitHash = []byte{} - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DataHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DataHash = append(m.DataHash[:0], dAtA[iNdEx:postIndex]...) - if m.DataHash == nil { - m.DataHash = []byte{} - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorsHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorsHash = append(m.ValidatorsHash[:0], dAtA[iNdEx:postIndex]...) - if m.ValidatorsHash == nil { - m.ValidatorsHash = []byte{} - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NextValidatorsHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.NextValidatorsHash = append(m.NextValidatorsHash[:0], dAtA[iNdEx:postIndex]...) - if m.NextValidatorsHash == nil { - m.NextValidatorsHash = []byte{} - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsensusHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ConsensusHash = append(m.ConsensusHash[:0], dAtA[iNdEx:postIndex]...) - if m.ConsensusHash == nil { - m.ConsensusHash = []byte{} - } - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AppHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.AppHash = append(m.AppHash[:0], dAtA[iNdEx:postIndex]...) - if m.AppHash == nil { - m.AppHash = []byte{} - } - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastResultsHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.LastResultsHash = append(m.LastResultsHash[:0], dAtA[iNdEx:postIndex]...) - if m.LastResultsHash == nil { - m.LastResultsHash = []byte{} - } - iNdEx = postIndex - case 13: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EvidenceHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EvidenceHash = append(m.EvidenceHash[:0], dAtA[iNdEx:postIndex]...) - if m.EvidenceHash == nil { - m.EvidenceHash = []byte{} - } - iNdEx = postIndex - case 14: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddress", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProposerAddress = append(m.ProposerAddress[:0], dAtA[iNdEx:postIndex]...) - if m.ProposerAddress == nil { - m.ProposerAddress = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *Data) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Data: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Data: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Txs", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Txs = append(m.Txs, make([]byte, postIndex-iNdEx)) - copy(m.Txs[len(m.Txs)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *Vote) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Vote: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Vote: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= SignedMsgType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Round |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockID", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.BlockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorAddress = append(m.ValidatorAddress[:0], dAtA[iNdEx:postIndex]...) - if m.ValidatorAddress == nil { - m.ValidatorAddress = []byte{} - } - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorIndex", wireType) - } - m.ValidatorIndex = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ValidatorIndex |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) - if m.Signature == nil { - m.Signature = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *Commit) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Commit: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Commit: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Round |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockID", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.BlockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signatures = append(m.Signatures, CommitSig{}) - if err := m.Signatures[len(m.Signatures)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *CommitSig) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: CommitSig: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: CommitSig: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockIdFlag", wireType) - } - m.BlockIdFlag = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockIdFlag |= BlockIDFlag(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorAddress = append(m.ValidatorAddress[:0], dAtA[iNdEx:postIndex]...) - if m.ValidatorAddress == nil { - m.ValidatorAddress = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) - if m.Signature == nil { - m.Signature = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *Proposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Proposal: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Proposal: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) - } - m.Type = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Type |= SignedMsgType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) - } - m.Height = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Height |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType) - } - m.Round = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Round |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field PolRound", wireType) - } - m.PolRound = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.PolRound |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockID", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.BlockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) - if m.Signature == nil { - m.Signature = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *SignedHeader) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SignedHeader: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SignedHeader: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Header == nil { - m.Header = &Header{} - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Commit == nil { - m.Commit = &Commit{} - } - if err := m.Commit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *LightBlock) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LightBlock: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LightBlock: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SignedHeader", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SignedHeader == nil { - m.SignedHeader = &SignedHeader{} - } - if err := m.SignedHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorSet", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ValidatorSet == nil { - m.ValidatorSet = &ValidatorSet{} - } - if err := m.ValidatorSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *BlockMeta) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: BlockMeta: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: BlockMeta: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockID", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.BlockID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field BlockSize", wireType) - } - m.BlockSize = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.BlockSize |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Header.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NumTxs", wireType) - } - m.NumTxs = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NumTxs |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *TxProof) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: TxProof: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TxProof: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RootHash", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RootHash = append(m.RootHash[:0], dAtA[iNdEx:postIndex]...) - if m.RootHash == nil { - m.RootHash = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) - if m.Data == nil { - m.Data = []byte{} - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proof", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTypes - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Proof == nil { - m.Proof = &crypto.Proof{} - } - if err := m.Proof.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipTypes(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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/proto/tendermint/types/validator.pb.go b/third_party/proto/tendermint/types/validator.pb.go deleted file mode 100644 index 61c38cb831..0000000000 --- a/third_party/proto/tendermint/types/validator.pb.go +++ /dev/null @@ -1,970 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: tendermint/types/validator.proto - -package types - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - - crypto "github.com/line/ostracon/proto/ostracon/crypto" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal - -var ( - _ = fmt.Errorf - _ = math.Inf -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type ValidatorSet struct { - Validators []*Validator `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators,omitempty"` - Proposer *Validator `protobuf:"bytes,2,opt,name=proposer,proto3" json:"proposer,omitempty"` - TotalVotingPower int64 `protobuf:"varint,3,opt,name=total_voting_power,json=totalVotingPower,proto3" json:"total_voting_power,omitempty"` -} - -func (m *ValidatorSet) Reset() { *m = ValidatorSet{} } -func (m *ValidatorSet) String() string { return proto.CompactTextString(m) } -func (*ValidatorSet) ProtoMessage() {} -func (*ValidatorSet) Descriptor() ([]byte, []int) { - return fileDescriptor_4e92274df03d3088, []int{0} -} - -func (m *ValidatorSet) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *ValidatorSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ValidatorSet.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *ValidatorSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_ValidatorSet.Merge(m, src) -} - -func (m *ValidatorSet) XXX_Size() int { - return m.Size() -} - -func (m *ValidatorSet) XXX_DiscardUnknown() { - xxx_messageInfo_ValidatorSet.DiscardUnknown(m) -} - -var xxx_messageInfo_ValidatorSet proto.InternalMessageInfo - -func (m *ValidatorSet) GetValidators() []*Validator { - if m != nil { - return m.Validators - } - return nil -} - -func (m *ValidatorSet) GetProposer() *Validator { - if m != nil { - return m.Proposer - } - return nil -} - -func (m *ValidatorSet) GetTotalVotingPower() int64 { - if m != nil { - return m.TotalVotingPower - } - return 0 -} - -type Validator struct { - Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - PubKey crypto.PublicKey `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key"` - VotingPower int64 `protobuf:"varint,3,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"` - ProposerPriority int64 `protobuf:"varint,4,opt,name=proposer_priority,json=proposerPriority,proto3" json:"proposer_priority,omitempty"` -} - -func (m *Validator) Reset() { *m = Validator{} } -func (m *Validator) String() string { return proto.CompactTextString(m) } -func (*Validator) ProtoMessage() {} -func (*Validator) Descriptor() ([]byte, []int) { - return fileDescriptor_4e92274df03d3088, []int{1} -} - -func (m *Validator) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *Validator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Validator.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *Validator) XXX_Merge(src proto.Message) { - xxx_messageInfo_Validator.Merge(m, src) -} - -func (m *Validator) XXX_Size() int { - return m.Size() -} - -func (m *Validator) XXX_DiscardUnknown() { - xxx_messageInfo_Validator.DiscardUnknown(m) -} - -var xxx_messageInfo_Validator proto.InternalMessageInfo - -func (m *Validator) GetAddress() []byte { - if m != nil { - return m.Address - } - return nil -} - -func (m *Validator) GetPubKey() crypto.PublicKey { - if m != nil { - return m.PubKey - } - return crypto.PublicKey{} -} - -func (m *Validator) GetVotingPower() int64 { - if m != nil { - return m.VotingPower - } - return 0 -} - -func (m *Validator) GetProposerPriority() int64 { - if m != nil { - return m.ProposerPriority - } - return 0 -} - -type SimpleValidator struct { - PubKey *crypto.PublicKey `protobuf:"bytes,1,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` - VotingPower int64 `protobuf:"varint,2,opt,name=voting_power,json=votingPower,proto3" json:"voting_power,omitempty"` -} - -func (m *SimpleValidator) Reset() { *m = SimpleValidator{} } -func (m *SimpleValidator) String() string { return proto.CompactTextString(m) } -func (*SimpleValidator) ProtoMessage() {} -func (*SimpleValidator) Descriptor() ([]byte, []int) { - return fileDescriptor_4e92274df03d3088, []int{2} -} - -func (m *SimpleValidator) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *SimpleValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SimpleValidator.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *SimpleValidator) XXX_Merge(src proto.Message) { - xxx_messageInfo_SimpleValidator.Merge(m, src) -} - -func (m *SimpleValidator) XXX_Size() int { - return m.Size() -} - -func (m *SimpleValidator) XXX_DiscardUnknown() { - xxx_messageInfo_SimpleValidator.DiscardUnknown(m) -} - -var xxx_messageInfo_SimpleValidator proto.InternalMessageInfo - -func (m *SimpleValidator) GetPubKey() *crypto.PublicKey { - if m != nil { - return m.PubKey - } - return nil -} - -func (m *SimpleValidator) GetVotingPower() int64 { - if m != nil { - return m.VotingPower - } - return 0 -} - -func init() { - proto.RegisterType((*ValidatorSet)(nil), "tendermint.types.ValidatorSet") - proto.RegisterType((*Validator)(nil), "tendermint.types.Validator") - proto.RegisterType((*SimpleValidator)(nil), "tendermint.types.SimpleValidator") -} - -func init() { proto.RegisterFile("tendermint/types/validator.proto", fileDescriptor_4e92274df03d3088) } - -var fileDescriptor_4e92274df03d3088 = []byte{ - // 361 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xcf, 0x4e, 0xc2, 0x40, - 0x10, 0xc6, 0xbb, 0x40, 0x40, 0x17, 0x12, 0x71, 0xe3, 0xa1, 0x41, 0x52, 0x2b, 0x27, 0x12, 0x4d, - 0x9b, 0x68, 0x0c, 0x07, 0x6e, 0x5c, 0xb9, 0x60, 0x49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, - 0xb0, 0xc8, 0xb5, 0x17, 0x58, 0x1e, 0x68, 0xba, 0x65, 0x9a, 0xf4, 0x31, 0x8c, 0x49, 0xe4, 0x06, - 0x64, 0x3e, 0xc6, 0x72, 0x54, 0xdb, 0x7c, 0xdd, 0x28, 0x56, 0x9d, 0x45, 0xee, 0x18, 0x4b, 0x74, - 0x0b, 0x5b, 0x7f, 0xc0, 0x34, 0xd7, 0x05, 0x07, 0xba, 0x83, 0x97, 0xd9, 0x1f, 0xd8, 0x8c, 0x13, - 0xca, 0x89, 0x90, 0x6a, 0x2d, 0x85, 0xce, 0x84, 0xc9, 0xa1, 0xdf, 0x5b, 0xc0, 0x8b, 0x29, 0x59, - 0xb2, 0x00, 0x17, 0xe4, 0x4f, 0x05, 0x1f, 0x38, 0xcd, 0xf7, 0x2f, 0x59, 0xe5, 0x17, 0xd9, 0xe8, - 0x79, 0xb3, 0xd3, 0xc0, 0x76, 0xa7, 0x81, 0xef, 0x9d, 0x06, 0xde, 0xf7, 0x9a, 0xb2, 0xdd, 0x6b, - 0xca, 0xe7, 0x5e, 0x53, 0x5e, 0x06, 0x3e, 0x11, 0xaf, 0x91, 0x6b, 0xcc, 0xe9, 0xd2, 0x2c, 0x67, - 0xac, 0x28, 0xd3, 0x04, 0x1d, 0xe7, 0xcf, 0xad, 0x27, 0xfd, 0xc7, 0x9f, 0x00, 0x00, 0x00, 0xff, - 0xff, 0x48, 0xbf, 0x34, 0x35, 0x9a, 0x02, 0x00, 0x00, -} - -func (m *ValidatorSet) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ValidatorSet) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ValidatorSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.TotalVotingPower != 0 { - i = encodeVarintValidator(dAtA, i, uint64(m.TotalVotingPower)) - i-- - dAtA[i] = 0x18 - } - if m.Proposer != nil { - { - size, err := m.Proposer.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintValidator(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Validators) > 0 { - for iNdEx := len(m.Validators) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Validators[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintValidator(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Validator) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Validator) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Validator) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ProposerPriority != 0 { - i = encodeVarintValidator(dAtA, i, uint64(m.ProposerPriority)) - i-- - dAtA[i] = 0x20 - } - if m.VotingPower != 0 { - i = encodeVarintValidator(dAtA, i, uint64(m.VotingPower)) - i-- - dAtA[i] = 0x18 - } - { - size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintValidator(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Address) > 0 { - i -= len(m.Address) - copy(dAtA[i:], m.Address) - i = encodeVarintValidator(dAtA, i, uint64(len(m.Address))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *SimpleValidator) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SimpleValidator) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SimpleValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.VotingPower != 0 { - i = encodeVarintValidator(dAtA, i, uint64(m.VotingPower)) - i-- - dAtA[i] = 0x10 - } - if m.PubKey != nil { - { - size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintValidator(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintValidator(dAtA []byte, offset int, v uint64) int { - offset -= sovValidator(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func (m *ValidatorSet) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Validators) > 0 { - for _, e := range m.Validators { - l = e.Size() - n += 1 + l + sovValidator(uint64(l)) - } - } - if m.Proposer != nil { - l = m.Proposer.Size() - n += 1 + l + sovValidator(uint64(l)) - } - if m.TotalVotingPower != 0 { - n += 1 + sovValidator(uint64(m.TotalVotingPower)) - } - return n -} - -func (m *Validator) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Address) - if l > 0 { - n += 1 + l + sovValidator(uint64(l)) - } - l = m.PubKey.Size() - n += 1 + l + sovValidator(uint64(l)) - if m.VotingPower != 0 { - n += 1 + sovValidator(uint64(m.VotingPower)) - } - if m.ProposerPriority != 0 { - n += 1 + sovValidator(uint64(m.ProposerPriority)) - } - return n -} - -func (m *SimpleValidator) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.PubKey != nil { - l = m.PubKey.Size() - n += 1 + l + sovValidator(uint64(l)) - } - if m.VotingPower != 0 { - n += 1 + sovValidator(uint64(m.VotingPower)) - } - return n -} - -func sovValidator(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} - -func sozValidator(x uint64) (n int) { - return sovValidator(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} - -func (m *ValidatorSet) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ValidatorSet: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ValidatorSet: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthValidator - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthValidator - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Validators = append(m.Validators, &Validator{}) - if err := m.Validators[len(m.Validators)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthValidator - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthValidator - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Proposer == nil { - m.Proposer = &Validator{} - } - if err := m.Proposer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TotalVotingPower", wireType) - } - m.TotalVotingPower = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TotalVotingPower |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipValidator(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthValidator - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *Validator) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Validator: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Validator: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthValidator - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthValidator - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Address = append(m.Address[:0], dAtA[iNdEx:postIndex]...) - if m.Address == nil { - m.Address = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthValidator - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthValidator - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field VotingPower", wireType) - } - m.VotingPower = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.VotingPower |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ProposerPriority", wireType) - } - m.ProposerPriority = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ProposerPriority |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipValidator(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthValidator - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *SimpleValidator) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SimpleValidator: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SimpleValidator: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthValidator - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthValidator - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PubKey == nil { - m.PubKey = &crypto.PublicKey{} - } - if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field VotingPower", wireType) - } - m.VotingPower = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.VotingPower |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipValidator(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthValidator - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipValidator(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, ErrIntOverflowValidator - } - 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, ErrIntOverflowValidator - } - 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, ErrIntOverflowValidator - } - 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, ErrInvalidLengthValidator - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupValidator - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthValidator - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthValidator = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowValidator = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupValidator = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/proto/tendermint/version/types.pb.go b/third_party/proto/tendermint/version/types.pb.go deleted file mode 100644 index 33e74d817a..0000000000 --- a/third_party/proto/tendermint/version/types.pb.go +++ /dev/null @@ -1,596 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: tendermint/version/types.proto - -package version - -import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal - -var ( - _ = fmt.Errorf - _ = 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 - -// App includes the protocol and software version for the application. -// This information is included in ResponseInfo. The App.Protocol can be -// updated in ResponseEndBlock. -type App struct { - Protocol uint64 `protobuf:"varint,1,opt,name=protocol,proto3" json:"protocol,omitempty"` - Software string `protobuf:"bytes,2,opt,name=software,proto3" json:"software,omitempty"` -} - -func (m *App) Reset() { *m = App{} } -func (m *App) String() string { return proto.CompactTextString(m) } -func (*App) ProtoMessage() {} -func (*App) Descriptor() ([]byte, []int) { - return fileDescriptor_f9b42966edc5edad, []int{0} -} - -func (m *App) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *App) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_App.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *App) XXX_Merge(src proto.Message) { - xxx_messageInfo_App.Merge(m, src) -} - -func (m *App) XXX_Size() int { - return m.Size() -} - -func (m *App) XXX_DiscardUnknown() { - xxx_messageInfo_App.DiscardUnknown(m) -} - -var xxx_messageInfo_App proto.InternalMessageInfo - -func (m *App) GetProtocol() uint64 { - if m != nil { - return m.Protocol - } - return 0 -} - -func (m *App) GetSoftware() string { - if m != nil { - return m.Software - } - return "" -} - -// Consensus captures the consensus rules for processing a block in the blockchain, -// including all blockchain data structures and the rules of the application's -// state transition machine. -type Consensus struct { - Block uint64 `protobuf:"varint,1,opt,name=block,proto3" json:"block,omitempty"` - App uint64 `protobuf:"varint,2,opt,name=app,proto3" json:"app,omitempty"` -} - -func (m *Consensus) Reset() { *m = Consensus{} } -func (m *Consensus) String() string { return proto.CompactTextString(m) } -func (*Consensus) ProtoMessage() {} -func (*Consensus) Descriptor() ([]byte, []int) { - return fileDescriptor_f9b42966edc5edad, []int{1} -} - -func (m *Consensus) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *Consensus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Consensus.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} - -func (m *Consensus) XXX_Merge(src proto.Message) { - xxx_messageInfo_Consensus.Merge(m, src) -} - -func (m *Consensus) XXX_Size() int { - return m.Size() -} - -func (m *Consensus) XXX_DiscardUnknown() { - xxx_messageInfo_Consensus.DiscardUnknown(m) -} - -var xxx_messageInfo_Consensus proto.InternalMessageInfo - -func (m *Consensus) GetBlock() uint64 { - if m != nil { - return m.Block - } - return 0 -} - -func (m *Consensus) GetApp() uint64 { - if m != nil { - return m.App - } - return 0 -} - -func init() { - proto.RegisterType((*App)(nil), "tendermint.version.App") - proto.RegisterType((*Consensus)(nil), "tendermint.version.Consensus") -} - -func init() { proto.RegisterFile("tendermint/version/types.proto", fileDescriptor_f9b42966edc5edad) } - -var fileDescriptor_f9b42966edc5edad = []byte{ - // 218 bytes of a gzipped FileDescriptorProto -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0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x23, 0x79, - 0x14, 0x89, 0x09, 0xf1, 0x06, 0x66, 0x20, 0x24, 0xb1, 0x81, 0x65, 0x8c, 0x01, 0x01, 0x00, 0x00, - 0xff, 0xff, 0x42, 0x43, 0x65, 0xc7, 0x21, 0x01, 0x00, 0x00, -} - -func (this *Consensus) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*Consensus) - if !ok { - that2, ok := that.(Consensus) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Block != that1.Block { - return false - } - if this.App != that1.App { - return false - } - return true -} - -func (m *App) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *App) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *App) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Software) > 0 { - i -= len(m.Software) - copy(dAtA[i:], m.Software) - i = encodeVarintTypes(dAtA, i, uint64(len(m.Software))) - i-- - dAtA[i] = 0x12 - } - if m.Protocol != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Protocol)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *Consensus) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Consensus) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Consensus) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.App != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.App)) - i-- - dAtA[i] = 0x10 - } - if m.Block != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.Block)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintTypes(dAtA []byte, offset int, v uint64) int { - offset -= sovTypes(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func (m *App) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Protocol != 0 { - n += 1 + sovTypes(uint64(m.Protocol)) - } - l = len(m.Software) - if l > 0 { - n += 1 + l + sovTypes(uint64(l)) - } - return n -} - -func (m *Consensus) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Block != 0 { - n += 1 + sovTypes(uint64(m.Block)) - } - if m.App != 0 { - n += 1 + sovTypes(uint64(m.App)) - } - return n -} - -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 *App) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: App: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: App: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) - } - m.Protocol = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Protocol |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Software", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - 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 ErrInvalidLengthTypes - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTypes - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Software = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *Consensus) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Consensus: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Consensus: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Block", wireType) - } - m.Block = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Block |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field App", wireType) - } - m.App = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.App |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipTypes(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTypes - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipTypes(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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrIntOverflowTypes - } - 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, ErrInvalidLengthTypes - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTypes - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTypes - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/proto/tendermint/version/types.proto b/third_party/proto/tendermint/version/types.proto deleted file mode 100644 index 6061868bd4..0000000000 --- a/third_party/proto/tendermint/version/types.proto +++ /dev/null @@ -1,24 +0,0 @@ -syntax = "proto3"; -package tendermint.version; - -option go_package = "github.com/tendermint/tendermint/proto/tendermint/version"; - -import "gogoproto/gogo.proto"; - -// App includes the protocol and software version for the application. -// This information is included in ResponseInfo. The App.Protocol can be -// updated in ResponseEndBlock. -message App { - uint64 protocol = 1; - string software = 2; -} - -// Consensus captures the consensus rules for processing a block in the blockchain, -// including all blockchain data structures and the rules of the application's -// state transition machine. -message Consensus { - option (gogoproto.equal) = true; - - uint64 block = 1; - uint64 app = 2; -} diff --git a/x/wasm/README.md b/x/wasm/README.md new file mode 100644 index 0000000000..6b769f5357 --- /dev/null +++ b/x/wasm/README.md @@ -0,0 +1,355 @@ + +* [Wasm Module](#wasm-module) + * [Configuration](#configuration) + * [Events](#events) + * [Overview](#overview) + * [Pulling this all together](#pulling-this-all-together) + * [Message Events](#message-events) + * [MsgStoreCode](#msgstorecode) + * [MsgInstantiateContract](#msginstantiatecontract) + * [MsgStoreCodeAndInstantiateContract](#msgstorecodeandinstantiatecontract) + * [MsgExecuteContract](#msgexecutecontract) + * [MsgMigrateContract](#msgmigratecontract) + * [MsgUpdateAdmin](#msgupdateadmin) + * [MsgClearAdmin](#msgclearadmin) + * [Keeper Events](#keeper-events) + * [Reply](#reply) + * [Sudo](#sudo) + * [PinCode](#pincode) + * [UnpinCode](#unpincode) + * [Proposal Events](#proposal-events) + * [Messages](#messages) + * [CLI](#cli) + * [Rest](#rest) + + +# Wasm Module + +This should be a brief overview of the functionality + +## Configuration + +You can add the following section to `config/app.toml`: + +```toml +[wasm] +# This is the maximum sdk gas (wasm and storage) that we allow for any x/wasm "smart" queries +query_gas_limit = 300000 +# This defines the memory size for Wasm modules that we can keep cached to speed-up instantiation +# The value is in MiB not bytes +memory_cache_size = 300 +``` + +The values can also be set via CLI flags on with the `start` command: +```shell script +--wasm.memory_cache_size uint32 Sets the size in MiB (NOT bytes) of an in-memory cache for wasm modules. Set to 0 to disable. (default 100) +--wasm.query_gas_limit uint Set the max gas that can be spent on executing a query with a Wasm contract (default 3000000) +``` + +## Events + +### Overview +A number of events are returned to allow good indexing of the transactions from smart contracts. + +Every call to Instantiate or Execute will be tagged with the info on the contract that was executed and who executed it. +It should look something like this (with different addresses). The module is always `wasm`, and `code_id` is only present +when Instantiating a contract, so you can subscribe to new instances, it is omitted on Execute. There is also an `action` tag +which is auto-added by the Cosmos SDK and has a value of either `store-code`, `instantiate` or `execute` depending on which message +was sent: + +```json +{ + "Type": "message", + "Attr": [ + { + "key": "module", + "value": "wasm" + }, + { + "key": "action", + "value": "instantiate" + }, + { + "key": "signer", + "value": "cosmos1vx8knpllrj7n963p9ttd80w47kpacrhuts497x" + }, + { + "key": "code_id", + "value": "1" + }, + { + "key": "_contract_address", + "value": "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr" + } + ] +} +``` + +If any funds were transferred to the contract as part of the message, or if the contract released funds as part of it's executions, +it will receive the typical events associated with sending tokens from bank. In this case, we instantiate the contract and +provide a initial balance in the same `MsgInstantiateContract`. We see the following events in addition to the above one: + +```json +[ + { + "Type": "transfer", + "Attr": [ + { + "key": "recipient", + "value": "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr" + }, + { + "key": "sender", + "value": "cosmos1ffnqn02ft2psvyv4dyr56nnv6plllf9pm2kpmv" + }, + { + "key": "amount", + "value": "100000denom" + } + ] + } +] +``` + +Finally, the contract itself can emit a "custom event" on Execute only (not on Init). +There is one event per contract, so if one contract calls a second contract, you may receive +one event for the original contract and one for the re-invoked contract. All attributes from the contract are passed through verbatim, +and we add a `_contract_address` attribute that contains the actual contract that emitted that event. +Here is an example from the escrow contract successfully releasing funds to the destination address: + +```json +{ + "Type": "wasm", + "Attr": [ + { + "key": "_contract_address", + "value": "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr" + }, + { + "key": "action", + "value": "release" + }, + { + "key": "destination", + "value": "cosmos14k7v7ms4jxkk2etmg9gljxjm4ru3qjdugfsflq" + } + ] +} +``` + +#### Pulling this all together + +We will invoke an escrow contract to release to the designated beneficiary. +The escrow was previously loaded with `100000denom` (from the above example). +In this transaction, we send `5000denom` along with the `MsgExecuteContract` +and the contract releases the entire funds (`105000denom`) to the beneficiary. + +We will see all the following events, where you should be able to reconstruct the actions +(remember there are two events for each transfer). We see (1) the initial transfer of funds +to the contract, (2) the contract custom event that it released funds (3) the transfer of funds +from the contract to the beneficiary and (4) the generic x/wasm event stating that the contract +was executed (which always appears, while 2 is optional and has information as reliable as the contract): + +```json +[ + { + "Type": "transfer", + "Attr": [ + { + "key": "recipient", + "value": "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr" + }, + { + "key": "sender", + "value": "cosmos1zm074khx32hqy20hlshlsd423n07pwlu9cpt37" + }, + { + "key": "amount", + "value": "5000denom" + } + ] + }, + { + "Type": "wasm", + "Attr": [ + { + "key": "_contract_address", + "value": "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr" + }, + { + "key": "action", + "value": "release" + }, + { + "key": "destination", + "value": "cosmos14k7v7ms4jxkk2etmg9gljxjm4ru3qjdugfsflq" + } + ] + }, + { + "Type": "transfer", + "Attr": [ + { + "key": "recipient", + "value": "cosmos14k7v7ms4jxkk2etmg9gljxjm4ru3qjdugfsflq" + }, + { + "key": "sender", + "value": "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr" + }, + { + "key": "amount", + "value": "105000denom" + } + ] + }, + { + "Type": "message", + "Attr": [ + { + "key": "module", + "value": "wasm" + }, + { + "key": "action", + "value": "execute" + }, + { + "key": "signer", + "value": "cosmos1zm074khx32hqy20hlshlsd423n07pwlu9cpt37" + }, + { + "key": "_contract_address", + "value": "cosmos14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9s4hmalr" + } + ] + } +] +``` + +A note on this format. This is what we return from our module. However, it seems to me that many events with the same `Type` +get merged together somewhere along the stack, so in this case, you *may* end up with one "transfer" event with the info for +both transfers. Double check when evaluating the event logs, I will document better with more experience, especially when I +find out the entire path for the events. + +### Message Events + +#### MsgStoreCode +| Type | Attribute Key | Attribute Value | Note | +|------------|---------------|-------------------------|------| +| message | module | wasm | | +| message | sender | {senderAddress} | | +| store_code | code_id | {contractCodeID} | | +| store_code | feature | {WasmvmRequiredFeature} | | + +#### MsgInstantiateContract +| Type | Attribute Key | Attribute Value | Note | +|------------------------|------------------------------|--------------------------------|-----------------------------------------------| +| message | module | wasm | | +| message | sender | {senderAddress} | | +| instantiate | code_id | {contractCodeID} | | +| instantiate | _contract_address | {contractAddress} | | +| transfer | recipient | {recipientAddress} | Only when the fund exists | +| transfer | sender | {senderAddress} | Only when the fund exists | +| transfer | amount | {amount} | Only when the fund exists | +| wasm | {customContractAttributeKey} | {customContractAttributeValue} | (optional) Defined by wasm contract developer | +| wasm-{customEventType} | {customContractAttributeKey} | {customContractAttributeKey} | (optional) Defined by wasm contract developer | + +#### MsgStoreCodeAndInstantiateContract +| Type | Attribute Key | Attribute Value | Note | +|------------------------|------------------------------|---------------------------------|-----------------------------------------------| +| message | module | wasm | | +| message | sender | {senderAddress} | | +| store_code | code_id | {contractCodeID} | | +| store_code | feature | {WasmvmRequiredFeature} | | +| instantiate | code_id | {contractCodeID} | | +| instantiate | _contract_address | {contractAddress} | | +| transfer | recipient | {recipientAddress} | Only when the fund exists | +| transfer | sender | {senderAddress} | Only when the fund exists | +| transfer | amount | {amount} | Only when the fund exists | +| wasm | {customContractAttributeKey} | {customContractAttributeValue} | (optional) Defined by wasm contract developer | +| wasm-{customEventType} | {customContractAttributeKey} | {customContractAttributeKey} | (optional) Defined by wasm contract developer | + +#### MsgExecuteContract +| Type | Attribute Key | Attribute Value | Note | +|------------------------|------------------------------|--------------------------------|-----------------------------------------------| +| message | module | wasm | | +| message | sender | {senderAddress} | | +| execute | _contract_address | {contractAddress} | | +| transfer | recipient | {recipientAddress} | Only when the fund exists | +| transfer | sender | {senderAddress} | Only when the fund exists | +| transfer | amount | {amount} | Only when the fund exists | +| wasm | {customContractAttributeKey} | {customContractAttributeValue} | (optional) Defined by wasm contract developer | +| wasm-{customEventType} | {customContractAttributeKey} | {customContractAttributeKey} | (optional) Defined by wasm contract developer | + +#### MsgMigrateContract +| Type | Attribute Key | Attribute Value | Note | +|------------------------|------------------------------|--------------------------------|-----------------------------------------------| +| message | module | wasm | | +| message | sender | {senderAddress} | | +| migrate | code_id | {newCodeID} | | +| migrate | _contract_address | {contractAddress} | | +| wasm | {customContractAttributeKey} | {customContractAttributeValue} | (optional) Defined by wasm contract developer | +| wasm-{customEventType} | {customContractAttributeKey} | {customContractAttributeKey} | (optional) Defined by wasm contract developer | + +#### MsgUpdateAdmin +| Type | Attribute Key | Attribute Value | Note | +|---------|-------------------|-------------------|---------------------------| +| message | module | wasm | | +| message | sender | {senderAddress} | | + +#### MsgClearAdmin +| Type | Attribute Key | Attribute Value | Note | +|---------|-------------------|-------------------|---------------------------| +| message | module | wasm | | +| message | sender | {senderAddress} | | + +### Keeper Events +In addition to message events, the wasm keeper will produce events when the following methods are called (or any method which ends up calling them) + +#### Reply +`reply` is only called from keeper after processing the submessage + +| Type | Attribute Key | Attribute Value | Note | +|-------|-------------------|-------------------|------| +| reply | _contract_address | {contractAddress} | | + +#### Sudo +`Sudo` allows priviledged access to a contract. This can never be called by an external tx, but only by another native Go module directly. + +| Type | Attribute Key | Attribute Value | Note | +|------|-------------------|-------------------|------| +| sudo | _contract_address | {contractAddress} | | + +#### PinCode +`PinCode` pins the wasm contract in wasmvm cache. + +| Type | Attribute Key | Attribute Value | Note | +|----------|---------------|-----------------|------| +| pin_code | code_id | {codeID} | | + +#### UnpinCode + +| Type | Attribute Key | Attribute Value | Note | +|------------|---------------|-----------------|------| +| unpin_code | code_id | {codeID} | | + +### Proposal Events +If you use wasm proposal, it makes common event like below. + +| Type | Attribute Key | Attribute Value | Note | +|---------------------|---------------|--------------------|------| +| gov_contract_result | result | {resultOfProposal} | | + + +## Messages + +TODO + +## CLI + +TODO - working, but not the nicest interface (json + bash = bleh). Use to upload, but I suggest to focus on frontend / js tooling + +## Rest + +TODO - main supported interface, under rapid change diff --git a/x/wasm/alias.go b/x/wasm/alias.go index 01f6a74518..ae64d76d9c 100644 --- a/x/wasm/alias.go +++ b/x/wasm/alias.go @@ -1,14 +1,17 @@ -// nolint +// Package wasm nolint +// autogenerated code using github.com/rigelrozanski/multitool +// aliases generated for the following subdirectories: +// ALIASGEN: github.com/Cosmwasm/wasmd/x/wasm/types +// ALIASGEN: github.com/CosmWasm/wasmd/x/wasm/keeper package wasm import ( "github.com/line/wasmd/x/wasm/keeper" - "github.com/line/wasmd/x/wasm/lbmtypes" "github.com/line/wasmd/x/wasm/types" ) const ( - firstCodeID = 1 + firstCodeID = 1 //nolint:deadcode,varcheck ModuleName = types.ModuleName StoreKey = types.StoreKey TStoreKey = types.TStoreKey @@ -52,12 +55,14 @@ var ( NewMessageHandler = keeper.NewDefaultMessageHandler DefaultEncoders = keeper.DefaultEncoders EncodeBankMsg = keeper.EncodeBankMsg + NoCustomMsg = keeper.NoCustomMsg EncodeStakingMsg = keeper.EncodeStakingMsg EncodeWasmMsg = keeper.EncodeWasmMsg NewKeeper = keeper.NewKeeper NewLegacyQuerier = keeper.NewLegacyQuerier DefaultQueryPlugins = keeper.DefaultQueryPlugins BankQuerier = keeper.BankQuerier + NoCustomQuerier = keeper.NoCustomQuerier StakingQuerier = keeper.StakingQuerier WasmQuerier = keeper.WasmQuerier CreateTestInput = keeper.CreateTestInput @@ -89,41 +94,40 @@ var ( ) type ( - ProposalType = types.ProposalType - GenesisState = types.GenesisState - Code = types.Code - Contract = types.Contract - MsgStoreCode = types.MsgStoreCode - MsgStoreCodeResponse = types.MsgStoreCodeResponse - MsgInstantiateContract = types.MsgInstantiateContract - MsgInstantiateContractResponse = types.MsgInstantiateContractResponse - MsgStoreCodeAndInstantiateContract = lbmtypes.MsgStoreCodeAndInstantiateContract - MsgStoreCodeAndInstantiateContractResponse = lbmtypes.MsgStoreCodeAndInstantiateContractResponse - MsgExecuteContract = types.MsgExecuteContract - MsgExecuteContractResponse = types.MsgExecuteContractResponse - MsgMigrateContract = types.MsgMigrateContract - MsgMigrateContractResponse = types.MsgMigrateContractResponse - MsgUpdateAdmin = types.MsgUpdateAdmin - MsgUpdateAdminResponse = types.MsgUpdateAdminResponse - MsgClearAdmin = types.MsgClearAdmin - MsgWasmIBCCall = types.MsgIBCSend - MsgClearAdminResponse = types.MsgClearAdminResponse - MsgServer = types.MsgServer - Model = types.Model - CodeInfo = types.CodeInfo - ContractInfo = types.ContractInfo - CreatedAt = types.AbsoluteTxPosition - Config = types.WasmConfig - CodeInfoResponse = types.CodeInfoResponse - MessageHandler = keeper.SDKMessageHandler - BankEncoder = keeper.BankEncoder - CustomEncoder = keeper.CustomEncoder - StakingEncoder = keeper.StakingEncoder - WasmEncoder = keeper.WasmEncoder - MessageEncoders = keeper.MessageEncoders - Keeper = keeper.Keeper - QueryHandler = keeper.QueryHandler - CustomQuerier = keeper.CustomQuerier - QueryPlugins = keeper.QueryPlugins - Option = keeper.Option + ProposalType = types.ProposalType + GenesisState = types.GenesisState + Code = types.Code + Contract = types.Contract + MsgStoreCode = types.MsgStoreCode + MsgStoreCodeResponse = types.MsgStoreCodeResponse + MsgInstantiateContract = types.MsgInstantiateContract + MsgInstantiateContract2 = types.MsgInstantiateContract2 + MsgInstantiateContractResponse = types.MsgInstantiateContractResponse + MsgExecuteContract = types.MsgExecuteContract + MsgExecuteContractResponse = types.MsgExecuteContractResponse + MsgMigrateContract = types.MsgMigrateContract + MsgMigrateContractResponse = types.MsgMigrateContractResponse + MsgUpdateAdmin = types.MsgUpdateAdmin + MsgUpdateAdminResponse = types.MsgUpdateAdminResponse + MsgClearAdmin = types.MsgClearAdmin + MsgWasmIBCCall = types.MsgIBCSend + MsgClearAdminResponse = types.MsgClearAdminResponse + MsgServer = types.MsgServer + Model = types.Model + CodeInfo = types.CodeInfo + ContractInfo = types.ContractInfo + CreatedAt = types.AbsoluteTxPosition + Config = types.WasmConfig + CodeInfoResponse = types.CodeInfoResponse + MessageHandler = keeper.SDKMessageHandler + BankEncoder = keeper.BankEncoder + CustomEncoder = keeper.CustomEncoder + StakingEncoder = keeper.StakingEncoder + WasmEncoder = keeper.WasmEncoder //nolint:revive + MessageEncoders = keeper.MessageEncoders + Keeper = keeper.Keeper + QueryHandler = keeper.QueryHandler + CustomQuerier = keeper.CustomQuerier + QueryPlugins = keeper.QueryPlugins + Option = keeper.Option ) diff --git a/x/wasm/client/cli/genesis_msg.go b/x/wasm/client/cli/genesis_msg.go index 3656a22757..01b1d090cc 100644 --- a/x/wasm/client/cli/genesis_msg.go +++ b/x/wasm/client/cli/genesis_msg.go @@ -21,6 +21,7 @@ import ( genutiltypes "github.com/line/lbm-sdk/x/genutil/types" octypes "github.com/line/ostracon/types" + "github.com/line/wasmd/x/wasm/ioutils" "github.com/line/wasmd/x/wasm/keeper" "github.com/line/wasmd/x/wasm/types" ) @@ -73,6 +74,7 @@ func GenesisStoreCodeCmd(defaultNodeHome string, genesisMutator GenesisMutator) cmd.Flags().String(flagInstantiateByEverybody, "", "Everybody can instantiate a contract from the code, optional") cmd.Flags().String(flagInstantiateNobody, "", "Nobody except the governance process can instantiate a contract from the code, optional") cmd.Flags().String(flagInstantiateByAddress, "", "Only this address can instantiate a contract instance from the code, optional") + cmd.Flags().StringSlice(flagInstantiateByAnyOfAddress, []string{}, "Any of the addresses can instantiate a contract from the code, optional") cmd.Flags().String(flags.FlagHome, defaultNodeHome, "The application home directory") cmd.Flags().String(flags.FlagKeyringBackend, flags.DefaultKeyringBackend, "Select keyring's backend (os|file|kwallet|pass|test)") @@ -102,7 +104,7 @@ func GenesisInstantiateContractCmd(defaultNodeHome string, genesisMutator Genesi } return genesisMutator.AlterWasmModuleState(cmd, func(state *types.GenesisState, appState map[string]json.RawMessage) error { - // simple sanity check that sender has some balance although it may be consumed by appState previous message already + // simple sanity check that sender has some balance, although it may be consumed by appState previous message already switch ok, err := hasAccountBalance(cmd, appState, senderAddr, msg.Funds); { case err != nil: return err @@ -111,7 +113,7 @@ func GenesisInstantiateContractCmd(defaultNodeHome string, genesisMutator Genesi } // does code id exists? - codeInfos, err := getAllCodes(state) + codeInfos := GetAllCodes(state) if err != nil { return err } @@ -130,7 +132,7 @@ func GenesisInstantiateContractCmd(defaultNodeHome string, genesisMutator Genesi return fmt.Errorf("permissions were not granted for %s", senderAddr) } state.GenMsgs = append(state.GenMsgs, types.GenesisState_GenMsgs{ - Sum: &types.GenesisState_GenMsgs_InstantiateContract{InstantiateContract: &msg}, + Sum: &types.GenesisState_GenMsgs_InstantiateContract{InstantiateContract: msg}, }) return nil }) @@ -170,7 +172,7 @@ func GenesisExecuteContractCmd(defaultNodeHome string, genesisMutator GenesisMut } return genesisMutator.AlterWasmModuleState(cmd, func(state *types.GenesisState, appState map[string]json.RawMessage) error { - // simple sanity check that sender has some balance although it may be consumed by appState previous message already + // simple sanity check that sender has some balance, although it may be consumed by appState previous message already switch ok, err := hasAccountBalance(cmd, appState, senderAddr, msg.Funds); { case err != nil: return err @@ -210,7 +212,7 @@ func GenesisListCodesCmd(defaultNodeHome string, genReader GenesisReader) *cobra if err != nil { return err } - all, err := getAllCodes(g.WasmModuleState) + all := GetAllCodes(g.WasmModuleState) if err != nil { return err } @@ -235,7 +237,7 @@ func GenesisListContractsCmd(defaultNodeHome string, genReader GenesisReader) *c return err } state := g.WasmModuleState - all := getAllContracts(state) + all := GetAllContracts(state) return printJSONOutput(cmd, all) }, } @@ -244,7 +246,7 @@ func GenesisListContractsCmd(defaultNodeHome string, genReader GenesisReader) *c return cmd } -// clientCtx marshaller works only with proto or bytes so we marshal the output ourself +// clientCtx marshaller works only with proto or bytes, so we marshal the output ourselves func printJSONOutput(cmd *cobra.Command, obj interface{}) error { clientCtx := client.GetClientContextFromCmd(cmd) bz, err := json.MarshalIndent(obj, "", " ") @@ -259,7 +261,7 @@ type CodeMeta struct { Info types.CodeInfo `json:"info"` } -func getAllCodes(state *types.GenesisState) ([]CodeMeta, error) { +func GetAllCodes(state *types.GenesisState) []CodeMeta { all := make([]CodeMeta, len(state.Codes)) for i, c := range state.Codes { all[i] = CodeMeta{ @@ -276,13 +278,18 @@ func getAllCodes(state *types.GenesisState) ([]CodeMeta, error) { accessConfig = *msg.InstantiatePermission } else { // default - creator, err := sdk.AccAddressFromBech32(msg.Sender) + creator := sdk.MustAccAddressFromBech32(msg.Sender) + accessConfig = state.Params.InstantiateDefaultPermission.With(creator) + } + bz := msg.WASMByteCode + if ioutils.IsGzip(msg.WASMByteCode) { + var err error + bz, err = ioutils.Uncompress(msg.WASMByteCode, uint64(types.MaxWasmSize)) if err != nil { - return nil, fmt.Errorf("sender: %s", err) + panic(fmt.Sprintf("failed to unzip wasm binary: %s", err)) } - accessConfig = state.Params.InstantiateDefaultPermission.With(creator) } - hash := sha256.Sum256(msg.WASMByteCode) + hash := sha256.Sum256(bz) all = append(all, CodeMeta{ CodeID: seq, Info: types.CodeInfo{ @@ -294,7 +301,7 @@ func getAllCodes(state *types.GenesisState) ([]CodeMeta, error) { seq++ } } - return all, nil + return all } type ContractMeta struct { @@ -302,7 +309,7 @@ type ContractMeta struct { Info types.ContractInfo `json:"info"` } -func getAllContracts(state *types.GenesisState) []ContractMeta { +func GetAllContracts(state *types.GenesisState) []ContractMeta { all := make([]ContractMeta, len(state.Contracts)) for i, c := range state.Contracts { all[i] = ContractMeta{ @@ -315,7 +322,7 @@ func getAllContracts(state *types.GenesisState) []ContractMeta { for _, m := range state.GenMsgs { if msg := m.GetInstantiateContract(); msg != nil { all = append(all, ContractMeta{ - ContractAddress: keeper.BuildContractAddress(msg.CodeID, seq).String(), + ContractAddress: keeper.BuildContractAddressClassic(msg.CodeID, seq).String(), Info: types.ContractInfo{ CodeID: msg.CodeID, Creator: msg.Sender, @@ -356,7 +363,7 @@ func hasContract(state *types.GenesisState, contractAddr string) bool { seq := contractSeqValue(state) for _, m := range state.GenMsgs { if msg := m.GetInstantiateContract(); msg != nil { - if keeper.BuildContractAddress(msg.CodeID, seq).String() == contractAddr { + if keeper.BuildContractAddressClassic(msg.CodeID, seq).String() == contractAddr { return true } seq++ @@ -404,8 +411,10 @@ func (d DefaultGenesisReader) ReadWasmGenesis(cmd *cobra.Command) (*GenesisData, ), nil } -var _ GenesisReader = DefaultGenesisIO{} -var _ GenesisMutator = DefaultGenesisIO{} +var ( + _ GenesisReader = DefaultGenesisIO{} + _ GenesisMutator = DefaultGenesisIO{} +) // DefaultGenesisIO implements both interfaces to read and modify the genesis state for this module. // This implementation uses the default data structure that is used by the module.go genesis import/ export. diff --git a/x/wasm/client/cli/genesis_msg_test.go b/x/wasm/client/cli/genesis_msg_test.go index 94cd9d2110..b955c00cd4 100644 --- a/x/wasm/client/cli/genesis_msg_test.go +++ b/x/wasm/client/cli/genesis_msg_test.go @@ -3,7 +3,6 @@ package cli import ( "context" "encoding/json" - "fmt" "os" "path" "testing" @@ -23,9 +22,9 @@ import ( sdk "github.com/line/lbm-sdk/types" banktypes "github.com/line/lbm-sdk/x/bank/types" "github.com/line/lbm-sdk/x/genutil" + genutiltest "github.com/line/lbm-sdk/x/genutil/client/testutil" genutiltypes "github.com/line/lbm-sdk/x/genutil/types" stakingtypes "github.com/line/lbm-sdk/x/staking/types" - ostcfg "github.com/line/ostracon/config" "github.com/line/ostracon/libs/log" octypes "github.com/line/ostracon/types" @@ -565,6 +564,7 @@ func TestExecuteContractCmd(t *testing.T) { }) } } + func TestGetAllContracts(t *testing.T) { specs := map[string]struct { src types.GenesisState @@ -603,11 +603,11 @@ func TestGetAllContracts(t *testing.T) { }, exp: []ContractMeta{ { - ContractAddress: keeper.BuildContractAddress(0, 1).String(), + ContractAddress: keeper.BuildContractAddressClassic(0, 1).String(), Info: types.ContractInfo{Label: "first"}, }, { - ContractAddress: keeper.BuildContractAddress(0, 2).String(), + ContractAddress: keeper.BuildContractAddressClassic(0, 2).String(), Info: types.ContractInfo{Label: "second"}, }, }, @@ -623,7 +623,7 @@ func TestGetAllContracts(t *testing.T) { }, exp: []ContractMeta{ { - ContractAddress: keeper.BuildContractAddress(0, 100).String(), + ContractAddress: keeper.BuildContractAddressClassic(0, 100).String(), Info: types.ContractInfo{Label: "hundred"}, }, }, @@ -649,7 +649,7 @@ func TestGetAllContracts(t *testing.T) { Info: types.ContractInfo{Label: "first"}, }, { - ContractAddress: keeper.BuildContractAddress(0, 100).String(), + ContractAddress: keeper.BuildContractAddressClassic(0, 100).String(), Info: types.ContractInfo{Label: "hundred"}, }, }, @@ -657,18 +657,17 @@ func TestGetAllContracts(t *testing.T) { } for msg, spec := range specs { t.Run(msg, func(t *testing.T) { - got := getAllContracts(&spec.src) + got := GetAllContracts(&spec.src) assert.Equal(t, spec.exp, got) }) } - } func setupGenesis(t *testing.T, wasmGenesis types.GenesisState) string { appCodec := keeper.MakeEncodingConfig(t).Marshaler homeDir := t.TempDir() - require.NoError(t, os.Mkdir(path.Join(homeDir, "config"), 0700)) + require.NoError(t, os.Mkdir(path.Join(homeDir, "config"), 0o700)) genFilename := path.Join(homeDir, "config", "genesis.json") appState := make(map[string]json.RawMessage) appState[types.ModuleName] = appCodec.MustMarshalJSON(&wasmGenesis) @@ -694,25 +693,13 @@ func setupGenesis(t *testing.T, wasmGenesis types.GenesisState) string { return homeDir } -func createDefaultOstraconConfig(rootDir string) (*ostcfg.Config, error) { - conf := ostcfg.DefaultConfig() - conf.SetRoot(rootDir) - ostcfg.EnsureRoot(rootDir) - - if err := conf.ValidateBasic(); err != nil { - return nil, fmt.Errorf("error in config file: %v", err) - } - - return conf, nil -} - func executeCmdWithContext(t *testing.T, homeDir string, cmd *cobra.Command) error { logger := log.NewNopLogger() - cfg, err := createDefaultOstraconConfig(homeDir) + cfg, err := genutiltest.CreateDefaultTendermintConfig(homeDir) require.NoError(t, err) appCodec := keeper.MakeEncodingConfig(t).Marshaler serverCtx := server.NewContext(viper.New(), cfg, logger) - clientCtx := client.Context{}.WithJSONCodec(appCodec).WithHomeDir(homeDir) + clientCtx := client.Context{}.WithCodec(appCodec).WithHomeDir(homeDir) ctx := context.Background() ctx = context.WithValue(ctx, client.ClientContextKey, &clientCtx) diff --git a/x/wasm/client/cli/gov_tx.go b/x/wasm/client/cli/gov_tx.go index 43d7990ca9..ad251f536b 100644 --- a/x/wasm/client/cli/gov_tx.go +++ b/x/wasm/client/cli/gov_tx.go @@ -15,7 +15,6 @@ import ( "github.com/line/lbm-sdk/x/gov/client/cli" govtypes "github.com/line/lbm-sdk/x/gov/types" - "github.com/line/wasmd/x/wasm/lbmtypes" "github.com/line/wasmd/x/wasm/types" ) @@ -58,12 +57,18 @@ func ProposalStoreCodeCmd() *cobra.Command { return err } + unpinCode, err := cmd.Flags().GetBool(flagUnpinCode) + if err != nil { + return err + } + content := types.StoreCodeProposal{ Title: proposalTitle, Description: proposalDescr, RunAs: runAs, WASMByteCode: src.WASMByteCode, InstantiatePermission: src.InstantiatePermission, + UnpinCode: unpinCode, } msg, err := govtypes.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress()) @@ -82,14 +87,12 @@ func ProposalStoreCodeCmd() *cobra.Command { cmd.Flags().String(flagInstantiateByEverybody, "", "Everybody can instantiate a contract from the code, optional") cmd.Flags().String(flagInstantiateNobody, "", "Nobody except the governance process can instantiate a contract from the code, optional") cmd.Flags().String(flagInstantiateByAddress, "", "Only this address can instantiate a contract instance from the code, optional") + cmd.Flags().Bool(flagUnpinCode, false, "Unpin code on upload, optional") // 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") - cmd.Flags().String(cli.FlagProposal, "", "Proposal file path (if this path is given, other proposal flags are ignored)") - // type values must match the "ProposalHandler" "routes" in cli - cmd.Flags().String(flagProposalType, "", "Permission of proposal, types: store-code/instantiate/migrate/update-admin/clear-admin/text/parameter_change/software_upgrade") return cmd } @@ -165,9 +168,6 @@ func ProposalInstantiateContractCmd() *cobra.Command { cmd.Flags().String(cli.FlagTitle, "", "Title of proposal") cmd.Flags().String(cli.FlagDescription, "", "Description of proposal") cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal") - cmd.Flags().String(cli.FlagProposal, "", "Proposal file path (if this path is given, other proposal flags are ignored)") - // type values must match the "ProposalHandler" "routes" in cli - cmd.Flags().String(flagProposalType, "", "Permission of proposal, types: store-code/instantiate/migrate/update-admin/clear-admin/text/parameter_change/software_upgrade") return cmd } @@ -228,9 +228,6 @@ func ProposalMigrateContractCmd() *cobra.Command { cmd.Flags().String(cli.FlagTitle, "", "Title of proposal") cmd.Flags().String(cli.FlagDescription, "", "Description of proposal") cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal") - cmd.Flags().String(cli.FlagProposal, "", "Proposal file path (if this path is given, other proposal flags are ignored)") - // type values must match the "ProposalHandler" "routes" in cli - cmd.Flags().String(flagProposalType, "", "Permission of proposal, types: store-code/instantiate/migrate/update-admin/clear-admin/text/parameter_change/software_upgrade") return cmd } @@ -307,9 +304,6 @@ func ProposalExecuteContractCmd() *cobra.Command { cmd.Flags().String(cli.FlagTitle, "", "Title of proposal") cmd.Flags().String(cli.FlagDescription, "", "Description of proposal") cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal") - cmd.Flags().String(cli.FlagProposal, "", "Proposal file path (if this path is given, other proposal flags are ignored)") - // type values must match the "ProposalHandler" "routes" in cli - cmd.Flags().String(flagProposalType, "", "Permission of proposal, types: store-code/instantiate/migrate/update-admin/clear-admin/text/parameter_change/software_upgrade") return cmd } @@ -367,9 +361,6 @@ func ProposalSudoContractCmd() *cobra.Command { cmd.Flags().String(cli.FlagTitle, "", "Title of proposal") cmd.Flags().String(cli.FlagDescription, "", "Description of proposal") cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal") - cmd.Flags().String(cli.FlagProposal, "", "Proposal file path (if this path is given, other proposal flags are ignored)") - // type values must match the "ProposalHandler" "routes" in cli - cmd.Flags().String(flagProposalType, "", "Permission of proposal, types: store-code/instantiate/migrate/update-admin/clear-admin/text/parameter_change/software_upgrade") return cmd } @@ -428,9 +419,6 @@ func ProposalUpdateContractAdminCmd() *cobra.Command { cmd.Flags().String(cli.FlagTitle, "", "Title of proposal") cmd.Flags().String(cli.FlagDescription, "", "Description of proposal") cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal") - cmd.Flags().String(cli.FlagProposal, "", "Proposal file path (if this path is given, other proposal flags are ignored)") - // type values must match the "ProposalHandler" "routes" in cli - cmd.Flags().String(flagProposalType, "", "Permission of proposal, types: store-code/instantiate/migrate/update-admin/clear-admin/text/parameter_change/software_upgrade") return cmd } @@ -483,9 +471,6 @@ func ProposalClearContractAdminCmd() *cobra.Command { cmd.Flags().String(cli.FlagTitle, "", "Title of proposal") cmd.Flags().String(cli.FlagDescription, "", "Description of proposal") cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal") - cmd.Flags().String(cli.FlagProposal, "", "Proposal file path (if this path is given, other proposal flags are ignored)") - // type values must match the "ProposalHandler" "routes" in cli - cmd.Flags().String(flagProposalType, "", "Permission of proposal, types: store-code/instantiate/migrate/update-admin/clear-admin/text/parameter_change/software_upgrade") return cmd } @@ -542,9 +527,6 @@ func ProposalPinCodesCmd() *cobra.Command { cmd.Flags().String(cli.FlagTitle, "", "Title of proposal") cmd.Flags().String(cli.FlagDescription, "", "Description of proposal") cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal") - cmd.Flags().String(cli.FlagProposal, "", "Proposal file path (if this path is given, other proposal flags are ignored)") - // type values must match the "ProposalHandler" "routes" in cli - cmd.Flags().String(flagProposalType, "", "Permission of proposal, types: store-code/instantiate/migrate/update-admin/clear-admin/text/parameter_change/software_upgrade") return cmd } @@ -613,33 +595,41 @@ func ProposalUnpinCodesCmd() *cobra.Command { cmd.Flags().String(cli.FlagTitle, "", "Title of proposal") cmd.Flags().String(cli.FlagDescription, "", "Description of proposal") cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal") - cmd.Flags().String(cli.FlagProposal, "", "Proposal file path (if this path is given, other proposal flags are ignored)") - // type values must match the "ProposalHandler" "routes" in cli - cmd.Flags().String(flagProposalType, "", "Permission of proposal, types: store-code/instantiate/migrate/update-admin/clear-admin/text/parameter_change/software_upgrade") return cmd } -func parseAccessConfig(config string) (types.AccessConfig, error) { - switch config { +func parseAccessConfig(raw string) (c types.AccessConfig, err error) { + switch raw { case "nobody": return types.AllowNobody, nil case "everybody": return types.AllowEverybody, nil default: - address, err := sdk.AccAddressFromBech32(config) - if err != nil { - return types.AccessConfig{}, fmt.Errorf("unable to parse address %s", config) + parts := strings.Split(raw, ",") + addrs := make([]sdk.AccAddress, len(parts)) + for i, v := range parts { + addr, err := sdk.AccAddressFromBech32(v) + if err != nil { + return types.AccessConfig{}, fmt.Errorf("unable to parse address %q: %s", v, err) + } + addrs[i] = addr } - return types.AccessTypeOnlyAddress.With(address), nil + defer func() { // convert panic in ".With" to error for better output + if r := recover(); r != nil { + err = r.(error) + } + }() + cfg := types.AccessTypeAnyOfAddresses.With(addrs...) + return cfg, cfg.ValidateBasic() } } func parseAccessConfigUpdates(args []string) ([]types.AccessConfigUpdate, error) { updates := make([]types.AccessConfigUpdate, len(args)) for i, c := range args { - // format: code_id,access_config - // access_config: nobody|everybody|address - parts := strings.Split(c, ",") + // format: code_id:access_config + // access_config: nobody|everybody|address(es) + parts := strings.Split(c, ":") if len(parts) != 2 { return nil, fmt.Errorf("invalid format") } @@ -664,15 +654,15 @@ func parseAccessConfigUpdates(args []string) ([]types.AccessConfigUpdate, error) func ProposalUpdateInstantiateConfigCmd() *cobra.Command { bech32Prefix := sdk.GetConfig().GetBech32AccountAddrPrefix() cmd := &cobra.Command{ - Use: "update-instantiate-config [code-id,permission]...", + Use: "update-instantiate-config [code-id:permission]...", Short: "Submit an update instantiate config proposal.", Args: cobra.MinimumNArgs(1), Long: strings.TrimSpace( fmt.Sprintf(`Submit an update instantiate config proposal for multiple code ids. Example: -$ %s tx gov submit-proposal update-instantiate-config 1,nobody 2,everybody 3,%s1l2rsakp388kuv9k8qzq6lrm9taddae7fpx59wm -`, version.AppName, bech32Prefix)), +$ %s tx gov submit-proposal update-instantiate-config 1:nobody 2:everybody 3:%s1l2rsakp388kuv9k8qzq6lrm9taddae7fpx59wm,%s1vx8knpllrj7n963p9ttd80w47kpacrhuts497x +`, version.AppName, bech32Prefix, bech32Prefix)), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -720,114 +710,5 @@ $ %s tx gov submit-proposal update-instantiate-config 1,nobody 2,everybody 3,%s1 cmd.Flags().String(cli.FlagTitle, "", "Title of proposal") cmd.Flags().String(cli.FlagDescription, "", "Description of proposal") cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal") - cmd.Flags().String(cli.FlagProposal, "", "Proposal file path (if this path is given, other proposal flags are ignored)") - // type values must match the "ProposalHandler" "routes" in cli - cmd.Flags().String(flagProposalType, "", "Permission of proposal, types: store-code/instantiate/migrate/update-admin/clear-admin/text/parameter_change/software_upgrade") - return cmd -} - -func ProposalDeactivateContractCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "deactivate-contract [contract_addr_bech32]", - Short: "Deactivate the contract. This contract will not be executed after that.", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - proposalTitle, err := cmd.Flags().GetString(cli.FlagTitle) - if err != nil { - return fmt.Errorf("proposal title: %s", err) - } - proposalDescr, err := cmd.Flags().GetString(cli.FlagDescription) - if err != nil { - return fmt.Errorf("proposal description: %s", err) - } - depositArg, err := cmd.Flags().GetString(cli.FlagDeposit) - if err != nil { - return fmt.Errorf("deposit: %s", err) - } - deposit, err := sdk.ParseCoinsNormalized(depositArg) - if err != nil { - return err - } - - content := lbmtypes.DeactivateContractProposal{ - Title: proposalTitle, - Description: proposalDescr, - Contract: args[0], - } - - msg, err := govtypes.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress()) - if err != nil { - return err - } - if err = msg.ValidateBasic(); err != nil { - return err - } - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - cmd.Flags().String(cli.FlagTitle, "", "Title of proposal") - cmd.Flags().String(cli.FlagDescription, "", "Description of proposal") - cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal") - - return cmd -} - -func ProposalActivateContractCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "activate-contract [contract_addr_bech32]", - Short: "Activate the inactive contract. This contract will be executed after that.", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - proposalTitle, err := cmd.Flags().GetString(cli.FlagTitle) - if err != nil { - return fmt.Errorf("proposal title: %s", err) - } - proposalDescr, err := cmd.Flags().GetString(cli.FlagDescription) - if err != nil { - return fmt.Errorf("proposal description: %s", err) - } - depositArg, err := cmd.Flags().GetString(cli.FlagDeposit) - if err != nil { - return fmt.Errorf("deposit: %s", err) - } - deposit, err := sdk.ParseCoinsNormalized(depositArg) - if err != nil { - return err - } - - content := lbmtypes.ActivateContractProposal{ - Title: proposalTitle, - Description: proposalDescr, - Contract: args[0], - } - - msg, err := govtypes.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress()) - if err != nil { - return err - } - if err = msg.ValidateBasic(); err != nil { - return err - } - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - cmd.Flags().String(cli.FlagTitle, "", "Title of proposal") - cmd.Flags().String(cli.FlagDescription, "", "Description of proposal") - cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal") - return cmd } diff --git a/x/wasm/client/cli/gov_tx_test.go b/x/wasm/client/cli/gov_tx_test.go new file mode 100644 index 0000000000..4ce1e5a748 --- /dev/null +++ b/x/wasm/client/cli/gov_tx_test.go @@ -0,0 +1,97 @@ +package cli + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/line/wasmd/x/wasm/types" +) + +func TestParseAccessConfigUpdates(t *testing.T) { + specs := map[string]struct { + src []string + exp []types.AccessConfigUpdate + expErr bool + }{ + "nobody": { + src: []string{"1:nobody"}, + exp: []types.AccessConfigUpdate{{ + CodeID: 1, + InstantiatePermission: types.AccessConfig{Permission: types.AccessTypeNobody}, + }}, + }, + "everybody": { + src: []string{"1:everybody"}, + exp: []types.AccessConfigUpdate{{ + CodeID: 1, + InstantiatePermission: types.AccessConfig{Permission: types.AccessTypeEverybody}, + }}, + }, + "any of addresses - single": { + src: []string{"1:link12kr02kew9fl73rqekalavuu0xaxcgwr6nkk395"}, + exp: []types.AccessConfigUpdate{ + { + CodeID: 1, + InstantiatePermission: types.AccessConfig{ + Permission: types.AccessTypeAnyOfAddresses, + Addresses: []string{"link12kr02kew9fl73rqekalavuu0xaxcgwr6nkk395"}, + }, + }, + }, + }, + "any of addresses - multiple": { + src: []string{"1:link12kr02kew9fl73rqekalavuu0xaxcgwr6nkk395,link1hmayw7vv0p3gzeh3jzwmw9xj8fy8a3kmpqgjrysljdnecqkps02qrq5rvm"}, + exp: []types.AccessConfigUpdate{ + { + CodeID: 1, + InstantiatePermission: types.AccessConfig{ + Permission: types.AccessTypeAnyOfAddresses, + Addresses: []string{"link12kr02kew9fl73rqekalavuu0xaxcgwr6nkk395", "link1hmayw7vv0p3gzeh3jzwmw9xj8fy8a3kmpqgjrysljdnecqkps02qrq5rvm"}, + }, + }, + }, + }, + "multiple code ids with different permissions": { + src: []string{"1:link12kr02kew9fl73rqekalavuu0xaxcgwr6nkk395,link1hmayw7vv0p3gzeh3jzwmw9xj8fy8a3kmpqgjrysljdnecqkps02qrq5rvm", "2:nobody"}, + exp: []types.AccessConfigUpdate{ + { + CodeID: 1, + InstantiatePermission: types.AccessConfig{ + Permission: types.AccessTypeAnyOfAddresses, + Addresses: []string{"link12kr02kew9fl73rqekalavuu0xaxcgwr6nkk395", "link1hmayw7vv0p3gzeh3jzwmw9xj8fy8a3kmpqgjrysljdnecqkps02qrq5rvm"}, + }, + }, { + CodeID: 2, + InstantiatePermission: types.AccessConfig{ + Permission: types.AccessTypeNobody, + }, + }, + }, + }, + "any of addresses - empty list": { + src: []string{"1:"}, + expErr: true, + }, + "any of addresses - invalid address": { + src: []string{"1:foo"}, + expErr: true, + }, + "any of addresses - duplicate address": { + src: []string{"1:link12kr02kew9fl73rqekalavuu0xaxcgwr6nkk395,link12kr02kew9fl73rqekalavuu0xaxcgwr6nkk395"}, + expErr: true, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + got, gotErr := parseAccessConfigUpdates(spec.src) + if spec.expErr { + require.Error(t, gotErr) + return + } + require.NoError(t, gotErr) + assert.Equal(t, spec.exp, got) + }) + } +} diff --git a/x/wasm/client/cli/query.go b/x/wasm/client/cli/query.go index 05ade84a7c..e0d347f809 100644 --- a/x/wasm/client/cli/query.go +++ b/x/wasm/client/cli/query.go @@ -18,7 +18,7 @@ import ( sdk "github.com/line/lbm-sdk/types" wasmvm "github.com/line/wasmvm" - "github.com/line/wasmd/x/wasm/lbmtypes" + "github.com/line/wasmd/x/wasm/keeper" "github.com/line/wasmd/x/wasm/types" ) @@ -40,8 +40,8 @@ func GetQueryCmd() *cobra.Command { GetCmdGetContractState(), GetCmdListPinnedCode(), GetCmdLibVersion(), - GetCmdListInactiveContracts(), - GetCmdIsInactiveContract(), + GetCmdQueryParams(), + GetCmdBuildAddress(), ) return queryCmd } @@ -66,6 +66,47 @@ func GetCmdLibVersion() *cobra.Command { return cmd } +// GetCmdBuildAddress build a contract address +func GetCmdBuildAddress() *cobra.Command { + decoder := newArgDecoder(hex.DecodeString) + cmd := &cobra.Command{ + Use: "build-address [code-hash] [creator-address] [salt-hex-encoded] [json_encoded_init_args (required when set as fixed)]", + Short: "build contract address", + Aliases: []string{"address"}, + Args: cobra.RangeArgs(3, 4), + RunE: func(cmd *cobra.Command, args []string) error { + codeHash, err := hex.DecodeString(args[0]) + if err != nil { + return fmt.Errorf("code-hash: %s", err) + } + creator, err := sdk.AccAddressFromBech32(args[1]) + if err != nil { + return fmt.Errorf("creator: %s", err) + } + salt, err := hex.DecodeString(args[2]) + switch { + case err != nil: + return fmt.Errorf("salt: %s", err) + case len(salt) == 0: + return errors.New("empty salt") + } + + if len(args) == 3 { + cmd.Println(keeper.BuildContractAddressPredictable(codeHash, creator, salt, []byte{}).String()) + return nil + } + msg := types.RawContractMessage(args[3]) + if err := msg.ValidateBasic(); err != nil { + return fmt.Errorf("init message: %s", err) + } + cmd.Println(keeper.BuildContractAddressPredictable(codeHash, creator, salt, msg).String()) + return nil + }, + } + decoder.RegisterFlags(cmd.PersistentFlags(), "salt") + return cmd +} + // GetCmdListCode lists all wasm code uploaded func GetCmdListCode() *cobra.Command { cmd := &cobra.Command{ @@ -120,6 +161,9 @@ func GetCmdListContractByCode() *cobra.Command { if err != nil { return err } + if codeID == 0 { + return errors.New("empty code id") + } pageReq, err := client.ReadPageRequest(withPageKeyDecoded(cmd.Flags())) if err != nil { @@ -498,7 +542,7 @@ func newArgDecoder(def func(string) ([]byte, error)) *argumentDecoder { func (a *argumentDecoder) RegisterFlags(f *flag.FlagSet, argName string) { f.BoolVar(&a.asciiF, "ascii", false, "ascii encoded "+argName) - f.BoolVar(&a.hexF, "hex", false, "hex encoded "+argName) + f.BoolVar(&a.hexF, "hex", false, "hex encoded "+argName) f.BoolVar(&a.b64F, "b64", false, "base64 encoded "+argName) } @@ -539,69 +583,38 @@ func withPageKeyDecoded(flagSet *flag.FlagSet) *flag.FlagSet { if err != nil { panic(err.Error()) } - if err = flagSet.Set(flags.FlagPageKey, string(raw)); err != nil { + err = flagSet.Set(flags.FlagPageKey, string(raw)) + if err != nil { panic(err.Error()) } return flagSet } -func GetCmdListInactiveContracts() *cobra.Command { +// GetCmdQueryParams implements a command to return the current wasm +// parameters. +func GetCmdQueryParams() *cobra.Command { cmd := &cobra.Command{ - Use: "inactive-contracts", - Long: "List all inactive contracts", - Args: cobra.ExactArgs(0), + Use: "params", + Short: "Query the current wasm parameters", + Args: cobra.NoArgs, RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { return err } + queryClient := types.NewQueryClient(clientCtx) - pageReq, err := client.ReadPageRequest(withPageKeyDecoded(cmd.Flags())) - if err != nil { - return err - } - queryClient := lbmtypes.NewQueryClient(clientCtx) - res, err := queryClient.InactiveContracts( - context.Background(), - &lbmtypes.QueryInactiveContractsRequest{ - Pagination: pageReq, - }, - ) - if err != nil { - return err - } - return clientCtx.PrintProto(res) - }, - } - flags.AddQueryFlagsToCmd(cmd) - flags.AddPaginationFlagsToCmd(cmd, "list of inactive contracts") - return cmd -} - -func GetCmdIsInactiveContract() *cobra.Command { - cmd := &cobra.Command{ - Use: "is-inactive [bech32_address]", - Long: "Check if inactive contract or not", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) + params := &types.QueryParamsRequest{} + res, err := queryClient.Params(cmd.Context(), params) if err != nil { return err } - queryClient := lbmtypes.NewQueryClient(clientCtx) - res, err := queryClient.InactiveContract( - context.Background(), - &lbmtypes.QueryInactiveContractRequest{ - Address: args[0], - }, - ) - if err != nil { - return err - } - return clientCtx.PrintProto(res) + return clientCtx.PrintProto(&res.Params) }, } + flags.AddQueryFlagsToCmd(cmd) + return cmd } diff --git a/x/wasm/client/cli/query_test.go b/x/wasm/client/cli/query_test.go index 625c00976d..ac2bd7d1d9 100644 --- a/x/wasm/client/cli/query_test.go +++ b/x/wasm/client/cli/query_test.go @@ -4,7 +4,6 @@ import ( "context" "encoding/hex" "errors" - sdkerrors "github.com/line/lbm-sdk/types/errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "net/url" @@ -12,16 +11,17 @@ import ( "strconv" "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/line/lbm-sdk/client" "github.com/line/lbm-sdk/codec" - ocabcitypes "github.com/line/ostracon/abci/types" + sdkerrors "github.com/line/lbm-sdk/types/errors" ocrpcmocks "github.com/line/ostracon/rpc/client/mocks" ocrpctypes "github.com/line/ostracon/rpc/core/types" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - "github.com/stretchr/testify/require" - "github.com/line/wasmd/x/wasm/lbmtypes" "github.com/line/wasmd/x/wasm/types" ) @@ -376,60 +376,8 @@ func TestGetCmdListPinnedCode(t *testing.T) { } } -func TestGetCmdListInactiveContracts(t *testing.T) { - res := lbmtypes.QueryInactiveContractsResponse{} - bz, err := res.Marshal() - require.NoError(t, err) - ctx := makeContext(bz) - tests := testcase{ - {"execute success", nil, ctx, nil, nil}, - {"bad status", badStatusError, ctx, nil, nil}, - {"invalid request", invalidRequestError, ctx, invalidRequestFlags, nil}, - {"invalid url", invalidControlChar, context.Background(), invalidNodeFlags, nil}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - cmd := GetCmdListInactiveContracts() - err := cmd.ParseFlags(tt.flags) - require.NoError(t, err) - cmd.SetContext(tt.ctx) - actual := cmd.RunE(cmd, tt.args) - if tt.want == nil { - assert.Nilf(t, actual, "GetCmdListInactiveContracts()") - } else { - assert.Equalf(t, tt.want.Error(), actual.Error(), "GetCmdListInactiveContracts()") - } - }) - } -} - -func TestGetCmdIsInactiveContract(t *testing.T) { - res := lbmtypes.QueryInactiveContractResponse{} - bz, err := res.Marshal() - require.NoError(t, err) - ctx := makeContext(bz) - tests := testcase{ - {"execute success", nil, ctx, nil, argsWithAddr}, - {"bad status", badStatusError, ctx, nil, argsWithAddr}, - {"invalid url", invalidControlChar, context.Background(), invalidNodeFlags, argsWithAddr}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - cmd := GetCmdIsInactiveContract() - err := cmd.ParseFlags(tt.flags) - require.NoError(t, err) - cmd.SetContext(tt.ctx) - actual := cmd.RunE(cmd, tt.args) - if tt.want == nil { - assert.Nilf(t, actual, "GetCmdIsInactiveContract()") - } else { - assert.Equalf(t, tt.want.Error(), actual.Error(), "GetCmdIsInactiveContract()") - } - }) - } -} func makeContext(bz []byte) context.Context { - result := ocrpctypes.ResultABCIQuery{Response: ocabcitypes.ResponseQuery{Value: bz}} + result := ocrpctypes.ResultABCIQuery{Response: abci.ResponseQuery{Value: bz}} mockClient := ocrpcmocks.RemoteClient{} { // #1 diff --git a/x/wasm/client/cli/tx.go b/x/wasm/client/cli/tx.go index b2f9eb7f1d..b67ab792ce 100644 --- a/x/wasm/client/cli/tx.go +++ b/x/wasm/client/cli/tx.go @@ -1,6 +1,7 @@ package cli import ( + "encoding/hex" "errors" "fmt" "strconv" @@ -13,23 +14,25 @@ import ( "github.com/line/lbm-sdk/client/tx" sdk "github.com/line/lbm-sdk/types" sdkerrors "github.com/line/lbm-sdk/types/errors" + "github.com/line/lbm-sdk/version" "github.com/line/wasmd/x/wasm/client/cli/os" "github.com/line/wasmd/x/wasm/ioutils" - "github.com/line/wasmd/x/wasm/lbmtypes" "github.com/line/wasmd/x/wasm/types" ) const ( - flagAmount = "amount" - flagLabel = "label" - flagAdmin = "admin" - flagNoAdmin = "no-admin" - flagRunAs = "run-as" - flagInstantiateByEverybody = "instantiate-everybody" - flagInstantiateNobody = "instantiate-nobody" - flagInstantiateByAddress = "instantiate-only-address" - flagProposalType = "type" + flagAmount = "amount" + flagLabel = "label" + flagAdmin = "admin" + flagNoAdmin = "no-admin" + flagFixMsg = "fix-msg" + flagRunAs = "run-as" + flagInstantiateByEverybody = "instantiate-everybody" + flagInstantiateNobody = "instantiate-nobody" + flagInstantiateByAddress = "instantiate-only-address" + flagInstantiateByAnyOfAddress = "instantiate-anyof-addresses" + flagUnpinCode = "unpin-code" ) // GetTxCmd returns the transaction commands for this module @@ -44,7 +47,7 @@ func GetTxCmd() *cobra.Command { txCmd.AddCommand( StoreCodeCmd(), InstantiateContractCmd(), - StoreCodeAndInstantiateContractCmd(), + InstantiateContract2Cmd(), ExecuteContractCmd(), MigrateContractCmd(), UpdateContractAdminCmd(), @@ -78,7 +81,8 @@ func StoreCodeCmd() *cobra.Command { cmd.Flags().String(flagInstantiateByEverybody, "", "Everybody can instantiate a contract from the code, optional") cmd.Flags().String(flagInstantiateNobody, "", "Nobody except the governance process can instantiate a contract from the code, optional") - cmd.Flags().String(flagInstantiateByAddress, "", "Only this address can instantiate a contract instance from the code, optional") + cmd.Flags().String(flagInstantiateByAddress, "", "Deprecated: Only this address can instantiate a contract from the code, optional") + cmd.Flags().StringSlice(flagInstantiateByAnyOfAddress, []string{}, "Any of the addresses can instantiate a contract from the code, optional") flags.AddTxFlagsToCmd(cmd) return cmd } @@ -100,62 +104,89 @@ func parseStoreCodeArgs(file string, sender sdk.AccAddress, flags *flag.FlagSet) return types.MsgStoreCode{}, fmt.Errorf("invalid input file. Use wasm binary or gzip") } - var perm *types.AccessConfig + perm, err := parseAccessConfigFlags(flags) + if err != nil { + return types.MsgStoreCode{}, err + } + + msg := types.MsgStoreCode{ + Sender: sender.String(), + WASMByteCode: wasm, + InstantiatePermission: perm, + } + return msg, nil +} + +func parseAccessConfigFlags(flags *flag.FlagSet) (*types.AccessConfig, error) { + addrs, err := flags.GetStringSlice(flagInstantiateByAnyOfAddress) + if err != nil { + return nil, fmt.Errorf("flag any of: %s", err) + } + if len(addrs) != 0 { + acceptedAddrs := make([]sdk.AccAddress, len(addrs)) + for i, v := range addrs { + acceptedAddrs[i], err = sdk.AccAddressFromBech32(v) + if err != nil { + return nil, fmt.Errorf("parse %q: %w", v, err) + } + } + x := types.AccessTypeAnyOfAddresses.With(acceptedAddrs...) + return &x, nil + } + onlyAddrStr, err := flags.GetString(flagInstantiateByAddress) if err != nil { - return types.MsgStoreCode{}, fmt.Errorf("instantiate by address: %s", err) + return nil, fmt.Errorf("instantiate by address: %s", err) } if onlyAddrStr != "" { allowedAddr, err := sdk.AccAddressFromBech32(onlyAddrStr) if err != nil { - return types.MsgStoreCode{}, sdkerrors.Wrap(err, flagInstantiateByAddress) + return nil, sdkerrors.Wrap(err, flagInstantiateByAddress) } x := types.AccessTypeOnlyAddress.With(allowedAddr) - perm = &x - } else { - everybodyStr, err := flags.GetString(flagInstantiateByEverybody) + return &x, nil + } + everybodyStr, err := flags.GetString(flagInstantiateByEverybody) + if err != nil { + return nil, fmt.Errorf("instantiate by everybody: %s", err) + } + if everybodyStr != "" { + ok, err := strconv.ParseBool(everybodyStr) if err != nil { - return types.MsgStoreCode{}, fmt.Errorf("instantiate by everybody: %s", err) + return nil, fmt.Errorf("boolean value expected for instantiate by everybody: %s", err) } - if everybodyStr != "" { - ok, err := strconv.ParseBool(everybodyStr) - if err != nil { - return types.MsgStoreCode{}, fmt.Errorf("boolean value expected for instantiate by everybody: %s", err) - } - if ok { - perm = &types.AllowEverybody - } + if ok { + return &types.AllowEverybody, nil } + } - nobodyStr, err := flags.GetString(flagInstantiateNobody) + nobodyStr, err := flags.GetString(flagInstantiateNobody) + if err != nil { + return nil, fmt.Errorf("instantiate by nobody: %s", err) + } + if nobodyStr != "" { + ok, err := strconv.ParseBool(nobodyStr) if err != nil { - return types.MsgStoreCode{}, fmt.Errorf("instantiate by nobody: %s", err) + return nil, fmt.Errorf("boolean value expected for instantiate by nobody: %s", err) } - if nobodyStr != "" { - ok, err := strconv.ParseBool(nobodyStr) - if err != nil { - return types.MsgStoreCode{}, fmt.Errorf("boolean value expected for instantiate by nobody: %s", err) - } - if ok { - perm = &types.AllowNobody - } + if ok { + return &types.AllowNobody, nil } - - } - - msg := types.MsgStoreCode{ - Sender: sender.String(), - WASMByteCode: wasm, - InstantiatePermission: perm, } - return msg, nil + return nil, nil } // InstantiateContractCmd will instantiate a contract from previously uploaded code. func InstantiateContractCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "instantiate [code_id_int64] [json_encoded_init_args] --label [text] --admin [address,optional] --amount [coins,optional]", - Short: "Instantiate a wasm contract", + Use: "instantiate [code_id_int64] [json_encoded_init_args] --label [text] --admin [address,optional] --amount [coins,optional] ", + Short: "Instantiate a wasm contract", + Long: fmt.Sprintf(`Creates a new instance of an uploaded wasm code with the given 'constructor' message. +Each contract instance has a unique address assigned. +Example: +$ %s wasmd tx wasm instantiate 1 '{"foo":"bar"}' --admin="$(%s keys show mykey -a)" \ + --from mykey --amount="100ustake" --label "local0.1.0" +`, version.AppName, version.AppName), Aliases: []string{"start", "init", "inst", "i"}, Args: cobra.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { @@ -163,7 +194,6 @@ func InstantiateContractCmd() *cobra.Command { if err != nil { return err } - msg, err := parseInstantiateArgs(args[0], args[1], clientCtx.GetFromAddress(), cmd.Flags()) if err != nil { return err @@ -171,7 +201,7 @@ func InstantiateContractCmd() *cobra.Command { if err := msg.ValidateBasic(); err != nil { return err } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, } @@ -183,163 +213,117 @@ func InstantiateContractCmd() *cobra.Command { return cmd } -func parseInstantiateArgs(rawCodeID, initMsg string, sender sdk.AccAddress, flags *flag.FlagSet) (types.MsgInstantiateContract, error) { - // get the id of the code to instantiate - codeID, err := strconv.ParseUint(rawCodeID, 10, 64) - if err != nil { - return types.MsgInstantiateContract{}, err - } - - amountStr, err := flags.GetString(flagAmount) - if err != nil { - return types.MsgInstantiateContract{}, fmt.Errorf("amount: %s", err) - } - amount, err := sdk.ParseCoinsNormalized(amountStr) - if err != nil { - return types.MsgInstantiateContract{}, fmt.Errorf("amount: %s", err) - } - label, err := flags.GetString(flagLabel) - if err != nil { - return types.MsgInstantiateContract{}, fmt.Errorf("label: %s", err) - } - if label == "" { - return types.MsgInstantiateContract{}, errors.New("label is required on all contracts") - } - adminStr, err := flags.GetString(flagAdmin) - if err != nil { - return types.MsgInstantiateContract{}, fmt.Errorf("admin: %s", err) - } - noAdmin, err := flags.GetBool(flagNoAdmin) - if err != nil { - return types.MsgInstantiateContract{}, fmt.Errorf("no-admin: %s", err) - } - - // ensure sensible admin is set (or explicitly immutable) - if adminStr == "" && !noAdmin { - return types.MsgInstantiateContract{}, fmt.Errorf("you must set an admin or explicitly pass --no-admin to make it immutible (wasmd issue #719)") - } - if adminStr != "" && noAdmin { - return types.MsgInstantiateContract{}, fmt.Errorf("you set an admin and passed --no-admin, those cannot both be true") - } - - // build and sign the transaction, then broadcast to Ostracon - msg := types.MsgInstantiateContract{ - Sender: sender.String(), - CodeID: codeID, - Label: label, - Funds: amount, - Msg: []byte(initMsg), - Admin: adminStr, - } - return msg, nil -} - -// StoreCodeAndInstantiateContractCmd will upload code and instantiate a contract using it -func StoreCodeAndInstantiateContractCmd() *cobra.Command { +// InstantiateContract2Cmd will instantiate a contract from previously uploaded code with predicable address generated +func InstantiateContract2Cmd() *cobra.Command { + decoder := newArgDecoder(hex.DecodeString) cmd := &cobra.Command{ - Use: "store-instantiate [wasm file] [json_encoded_init_args] --label [text] --admin [address,optional] --amount [coins,optional]", - Short: "Upload a wasm binary and instantiate a wasm contract from the code", - Args: cobra.ExactArgs(2), + Use: "instantiate2 [code_id_int64] [json_encoded_init_args] [salt] --label [text] --admin [address,optional] --amount [coins,optional] " + + "--fix-msg [bool,optional]", + Short: "Instantiate a wasm contract with predictable address", + Long: fmt.Sprintf(`Creates a new instance of an uploaded wasm code with the given 'constructor' message. +Each contract instance has a unique address assigned. They are assigned automatically but in order to have predictable addresses +for special use cases, the given 'salt' argument and '--fix-msg' parameters can be used to generate a custom address. + +Predictable address example (also see '%s query wasm build-address -h'): +$ %s wasmd tx wasm instantiate2 1 '{"foo":"bar"}' $(echo -n "testing" | xxd -ps) --admin="$(%s keys show mykey -a)" \ + --from mykey --amount="100ustake" --label "local0.1.0" \ + --fix-msg +`, version.AppName, version.AppName, version.AppName), + Aliases: []string{"start", "init", "inst", "i"}, + Args: cobra.ExactArgs(3), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err } - msg, err := parseStoreCodeAndInstantiateContractArgs(args[0], args[1], clientCtx.GetFromAddress(), cmd.Flags()) + salt, err := decoder.DecodeString(args[2]) + if err != nil { + return fmt.Errorf("salt: %w", err) + } + fixMsg, err := cmd.Flags().GetBool(flagFixMsg) + if err != nil { + return fmt.Errorf("fix msg: %w", err) + } + data, err := parseInstantiateArgs(args[0], args[1], clientCtx.GetFromAddress(), cmd.Flags()) if err != nil { return err } - if err = msg.ValidateBasic(); err != nil { + msg := &types.MsgInstantiateContract2{ + Sender: data.Sender, + Admin: data.Admin, + CodeID: data.CodeID, + Label: data.Label, + Msg: data.Msg, + Funds: data.Funds, + Salt: salt, + FixMsg: fixMsg, + } + if err := msg.ValidateBasic(); err != nil { return err } - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) }, } - cmd.Flags().String(flagInstantiateByEverybody, "", "Everybody can instantiate a contract from the code, optional") - cmd.Flags().String(flagInstantiateByAddress, "", "Only this address can instantiate a contract instance from the code, optional") cmd.Flags().String(flagAmount, "", "Coins to send to the contract during instantiation") cmd.Flags().String(flagLabel, "", "A human-readable name for this contract in lists") cmd.Flags().String(flagAdmin, "", "Address of an admin") + cmd.Flags().Bool(flagNoAdmin, false, "You must set this explicitly if you don't want an admin") + cmd.Flags().Bool(flagFixMsg, false, "An optional flag to include the json_encoded_init_args for the predictable address generation mode") + decoder.RegisterFlags(cmd.PersistentFlags(), "salt") flags.AddTxFlagsToCmd(cmd) return cmd } -func parseStoreCodeAndInstantiateContractArgs(file string, initMsg string, sender sdk.AccAddress, flags *flag.FlagSet) (lbmtypes.MsgStoreCodeAndInstantiateContract, error) { - wasm, err := os.ReadFileWithSizeLimit(file, int64(types.MaxWasmSize)) - if err != nil { - return lbmtypes.MsgStoreCodeAndInstantiateContract{}, err - } - - // gzip the wasm file - if ioutils.IsWasm(wasm) { - wasm, err = ioutils.GzipIt(wasm) - - if err != nil { - return lbmtypes.MsgStoreCodeAndInstantiateContract{}, err - } - } else if !ioutils.IsGzip(wasm) { - return lbmtypes.MsgStoreCodeAndInstantiateContract{}, fmt.Errorf("invalid input file. Use wasm binary or gzip") - } - - var perm *types.AccessConfig - onlyAddrStr, err := flags.GetString(flagInstantiateByAddress) +func parseInstantiateArgs(rawCodeID, initMsg string, sender sdk.AccAddress, flags *flag.FlagSet) (*types.MsgInstantiateContract, error) { + // get the id of the code to instantiate + codeID, err := strconv.ParseUint(rawCodeID, 10, 64) if err != nil { - return lbmtypes.MsgStoreCodeAndInstantiateContract{}, fmt.Errorf("instantiate by address: %s", err) - } - if onlyAddrStr != "" { - addr, err := sdk.AccAddressFromBech32(onlyAddrStr) - if err != nil { - return lbmtypes.MsgStoreCodeAndInstantiateContract{}, sdkerrors.Wrap(err, flagInstantiateByAddress) - } - x := types.AccessTypeOnlyAddress.With(addr) - perm = &x - } else { - everybodyStr, err := flags.GetString(flagInstantiateByEverybody) - if err != nil { - return lbmtypes.MsgStoreCodeAndInstantiateContract{}, fmt.Errorf("instantiate by everybody: %s", err) - } - if everybodyStr != "" { - ok, err := strconv.ParseBool(everybodyStr) - if err != nil { - return lbmtypes.MsgStoreCodeAndInstantiateContract{}, fmt.Errorf("boolean value expected for instantiate by everybody: %s", err) - } - if ok { - perm = &types.AllowEverybody - } - } + return nil, err } amountStr, err := flags.GetString(flagAmount) if err != nil { - return lbmtypes.MsgStoreCodeAndInstantiateContract{}, fmt.Errorf("amount: %s", err) + return nil, fmt.Errorf("amount: %s", err) } amount, err := sdk.ParseCoinsNormalized(amountStr) if err != nil { - return lbmtypes.MsgStoreCodeAndInstantiateContract{}, fmt.Errorf("amount: %s", err) + return nil, fmt.Errorf("amount: %s", err) } label, err := flags.GetString(flagLabel) if err != nil { - return lbmtypes.MsgStoreCodeAndInstantiateContract{}, fmt.Errorf("label: %s", err) + return nil, fmt.Errorf("label: %s", err) } if label == "" { - return lbmtypes.MsgStoreCodeAndInstantiateContract{}, errors.New("label is required on all contracts") + return nil, errors.New("label is required on all contracts") } adminStr, err := flags.GetString(flagAdmin) if err != nil { - return lbmtypes.MsgStoreCodeAndInstantiateContract{}, fmt.Errorf("admin: %s", err) + return nil, fmt.Errorf("admin: %s", err) + } + noAdmin, err := flags.GetBool(flagNoAdmin) + if err != nil { + return nil, fmt.Errorf("no-admin: %s", err) } - msg := lbmtypes.MsgStoreCodeAndInstantiateContract{ - Sender: sender.String(), - WASMByteCode: wasm, - InstantiatePermission: perm, - Label: label, - Funds: amount, - Msg: []byte(initMsg), - Admin: adminStr, + // ensure sensible admin is set (or explicitly immutable) + if adminStr == "" && !noAdmin { + return nil, fmt.Errorf("you must set an admin or explicitly pass --no-admin to make it immutible (wasmd issue #719)") } - return msg, nil + if adminStr != "" && noAdmin { + return nil, fmt.Errorf("you set an admin and passed --no-admin, those cannot both be true") + } + + // build and sign the transaction, then broadcast to Ostracon + msg := types.MsgInstantiateContract{ + Sender: sender.String(), + CodeID: codeID, + Label: label, + Funds: amount, + Msg: []byte(initMsg), + Admin: adminStr, + } + return &msg, nil } // ExecuteContractCmd will instantiate a contract from previously uploaded code. diff --git a/x/wasm/client/cli/tx_test.go b/x/wasm/client/cli/tx_test.go new file mode 100644 index 0000000000..cab2ef92ff --- /dev/null +++ b/x/wasm/client/cli/tx_test.go @@ -0,0 +1,59 @@ +package cli + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/line/wasmd/x/wasm/types" +) + +func TestParseAccessConfigFlags(t *testing.T) { + specs := map[string]struct { + args []string + expCfg *types.AccessConfig + expErr bool + }{ + "nobody": { + args: []string{"--instantiate-nobody=true"}, + expCfg: &types.AccessConfig{Permission: types.AccessTypeNobody}, + }, + "everybody": { + args: []string{"--instantiate-everybody=true"}, + expCfg: &types.AccessConfig{Permission: types.AccessTypeEverybody}, + }, + "only address": { + args: []string{"--instantiate-only-address=link12kr02kew9fl73rqekalavuu0xaxcgwr6nkk395"}, + expCfg: &types.AccessConfig{Permission: types.AccessTypeOnlyAddress, Address: "link12kr02kew9fl73rqekalavuu0xaxcgwr6nkk395"}, + }, + "only address - invalid": { + args: []string{"--instantiate-only-address=foo"}, + expErr: true, + }, + "any of address": { + args: []string{"--instantiate-anyof-addresses=link12kr02kew9fl73rqekalavuu0xaxcgwr6nkk395,link1hmayw7vv0p3gzeh3jzwmw9xj8fy8a3kmpqgjrysljdnecqkps02qrq5rvm"}, + expCfg: &types.AccessConfig{Permission: types.AccessTypeAnyOfAddresses, Addresses: []string{"link12kr02kew9fl73rqekalavuu0xaxcgwr6nkk395", "link1hmayw7vv0p3gzeh3jzwmw9xj8fy8a3kmpqgjrysljdnecqkps02qrq5rvm"}}, + }, + "any of address - invalid": { + args: []string{"--instantiate-anyof-addresses=link12kr02kew9fl73rqekalavuu0xaxcgwr6nkk395,foo"}, + expErr: true, + }, + "not set": { + args: []string{}, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + flags := StoreCodeCmd().Flags() + require.NoError(t, flags.Parse(spec.args)) + gotCfg, gotErr := parseAccessConfigFlags(flags) + if spec.expErr { + require.Error(t, gotErr) + return + } + require.NoError(t, gotErr) + assert.Equal(t, spec.expCfg, gotCfg) + }) + } +} diff --git a/x/wasm/client/proposal_handler.go b/x/wasm/client/proposal_handler.go index db1ad1139a..cc134f70f9 100644 --- a/x/wasm/client/proposal_handler.go +++ b/x/wasm/client/proposal_handler.go @@ -18,6 +18,4 @@ var ProposalHandlers = []govclient.ProposalHandler{ govclient.NewProposalHandler(cli.ProposalPinCodesCmd), govclient.NewProposalHandler(cli.ProposalUnpinCodesCmd), govclient.NewProposalHandler(cli.ProposalUpdateInstantiateConfigCmd), - govclient.NewProposalHandler(cli.ProposalDeactivateContractCmd), - govclient.NewProposalHandler(cli.ProposalActivateContractCmd), } diff --git a/x/wasm/client/testutil/cli_test.go b/x/wasm/client/testutil/cli_test.go index f979202abe..0556a23c63 100644 --- a/x/wasm/client/testutil/cli_test.go +++ b/x/wasm/client/testutil/cli_test.go @@ -4,15 +4,68 @@ package testutil import ( + "fmt" "testing" + "time" "github.com/stretchr/testify/suite" + dbm "github.com/tendermint/tm-db" + "github.com/line/lbm-sdk/crypto/hd" + "github.com/line/lbm-sdk/crypto/keyring" + servertypes "github.com/line/lbm-sdk/server/types" + storetypes "github.com/line/lbm-sdk/store/types" "github.com/line/lbm-sdk/testutil/network" + sdk "github.com/line/lbm-sdk/types" + authtypes "github.com/line/lbm-sdk/x/auth/types" + ostrand "github.com/line/ostracon/libs/rand" + + wasmapp "github.com/line/wasmd/app" + "github.com/line/wasmd/app/params" + "github.com/line/wasmd/x/wasm/types" ) func TestIntegrationTestSuite(t *testing.T) { - cfg := network.DefaultConfig() + cfg := DefaultConfig() cfg.NumValidators = 1 suite.Run(t, NewIntegrationTestSuite(cfg)) } + +func DefaultConfig() network.Config { + encCfg := wasmapp.MakeEncodingConfig() + + return network.Config{ + Codec: encCfg.Marshaler, + LegacyAmino: encCfg.Amino, + InterfaceRegistry: encCfg.InterfaceRegistry, + TxConfig: encCfg.TxConfig, + AccountRetriever: authtypes.AccountRetriever{}, + AppConstructor: NewAppConstructor(encCfg), + GenesisState: wasmapp.ModuleBasics.DefaultGenesis(encCfg.Marshaler), + TimeoutCommit: 1 * time.Second, + ChainID: "chain-" + ostrand.NewRand().Str(6), + NumValidators: 4, + BondDenom: sdk.DefaultBondDenom, + MinGasPrices: fmt.Sprintf("0.000006%s", sdk.DefaultBondDenom), + AccountTokens: sdk.TokensFromConsensusPower(1000, sdk.DefaultPowerReduction), + StakingTokens: sdk.TokensFromConsensusPower(500, sdk.DefaultPowerReduction), + BondedTokens: sdk.TokensFromConsensusPower(100, sdk.DefaultPowerReduction), + PruningStrategy: storetypes.PruningOptionNothing, + CleanupDir: true, + SigningAlgo: string(hd.Secp256k1Type), + KeyringOptions: []keyring.Option{}, + } +} + +func NewAppConstructor(encodingCfg params.EncodingConfig) network.AppConstructor { + return func(val network.Validator) servertypes.Application { + return wasmapp.NewWasmApp( + val.Ctx.Logger, dbm.NewMemDB(), nil, true, + map[int64]bool{}, val.Ctx.Config.RootDir, 0, + encodingCfg, + types.EnableAllProposals, + wasmapp.EmptyBaseAppOptions{}, + nil, + ) + } +} diff --git a/x/wasm/client/testutil/query.go b/x/wasm/client/testutil/query.go index 32190e289b..80f5f51f7c 100644 --- a/x/wasm/client/testutil/query.go +++ b/x/wasm/client/testutil/query.go @@ -11,7 +11,6 @@ import ( "github.com/line/lbm-sdk/types/query" "github.com/line/wasmd/x/wasm/client/cli" - "github.com/line/wasmd/x/wasm/lbmtypes" "github.com/line/wasmd/x/wasm/types" ) @@ -95,10 +94,14 @@ func (s *IntegrationTestSuite) TestGetCmdQueryCodeInfo() { }, true, &types.CodeInfoResponse{ - CodeID: codeID, - Creator: val.Address.String(), - DataHash: expectedDataHash, - InstantiatePermission: types.AllowEverybody, + CodeID: codeID, + Creator: val.Address.String(), + DataHash: expectedDataHash, + InstantiatePermission: types.AccessConfig{ + Permission: types.AccessTypeEverybody, + Address: "", + Addresses: []string{}, + }, }, }, "no codeID": { @@ -467,71 +470,3 @@ func (s *IntegrationTestSuite) TestGetCmdListPinnedCode() { s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &contractInfo), out.String()) s.Require().Equal(expcted, &contractInfo) } - -func (s *IntegrationTestSuite) TestGetCmdListInactiveContracts() { - val := s.network.Validators[0] - - cmd := cli.GetCmdListInactiveContracts() - out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, s.queryCommonArgs()) - s.Require().NoError(err) - - expected := &lbmtypes.QueryInactiveContractsResponse{ - Addresses: []string{s.inactiveContractAddress}, - Pagination: &query.PageResponse{}, - } - var resInfo lbmtypes.QueryInactiveContractsResponse - s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &resInfo), out.String()) - s.Require().Equal(expected, &resInfo) -} - -func (s *IntegrationTestSuite) TestGetCmdIsInactiveContract() { - val := s.network.Validators[0] - - testCases := map[string]struct { - args []string - valid bool - expected proto.Message - }{ - "valid query(inactivate)": { - []string{ - s.inactiveContractAddress, - }, - true, - &lbmtypes.QueryInactiveContractResponse{ - Inactivated: true, - }, - }, - "valid query(activate)": { - []string{ - "link1hmayw7vv0p3gzeh3jzwmw9xj8fy8a3kmpqgjrysljdnecqkps02qrq5rvm", - }, - false, - nil, - }, - "wrong bech32_address": { - []string{ - "xxx", - }, - false, - nil, - }, - } - - for name, tc := range testCases { - tc := tc - - s.Run(name, func() { - cmd := cli.GetCmdIsInactiveContract() - out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, s.queryCommonArgs()...)) - if !tc.valid { - s.Require().Error(err) - return - } - s.Require().NoError(err) - - var resInfo lbmtypes.QueryInactiveContractResponse - s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &resInfo), out.String()) - s.Require().Equal(tc.expected, &resInfo) - }) - } -} diff --git a/x/wasm/client/testutil/suite.go b/x/wasm/client/testutil/suite.go index 596270f844..f5b74aab80 100644 --- a/x/wasm/client/testutil/suite.go +++ b/x/wasm/client/testutil/suite.go @@ -25,10 +25,9 @@ type IntegrationTestSuite struct { setupHeight int64 - codeID string - contractAddress string - nonExistValidAddress string - inactiveContractAddress string + codeID string + contractAddress string + nonExistValidAddress string // for hackatom contract verifier string @@ -52,8 +51,6 @@ func (s *IntegrationTestSuite) SetupSuite() { s.T().Skip("skipping test in unit-tests mode.") } - s.inactiveContractAddress = "link14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sgf2vn8" - // add inactive contract to genesis var wasmData types.GenesisState genesisState := s.cfg.GenesisState @@ -119,7 +116,11 @@ func (s *IntegrationTestSuite) deployContract() string { // parse codeID for _, v := range res.Events { if v.Type == types.EventTypeStoreCode { - return string(v.Attributes[0].Value) + for _, attr := range v.Attributes { + if string(attr.Key) == types.AttributeKeyCodeID { + return string(attr.Value) + } + } } } diff --git a/x/wasm/client/testutil/testdata/wasm_genesis.json b/x/wasm/client/testutil/testdata/wasm_genesis.json index dabc0aa2db..4a4787056b 100644 --- a/x/wasm/client/testutil/testdata/wasm_genesis.json +++ b/x/wasm/client/testutil/testdata/wasm_genesis.json @@ -42,8 +42,6 @@ ], "gen_msgs": [], - "inactive_contract_addresses": - ["link14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sgf2vn8"], "params": { "code_upload_access": @@ -51,9 +49,6 @@ "address": "", "permission": "Everybody" }, - "compile_cost": "3", - "gas_multiplier": "140000000", - "instance_cost": "60000", "instantiate_default_permission": "Everybody" }, "sequences": diff --git a/x/wasm/client/testutil/tx.go b/x/wasm/client/testutil/tx.go index d54599796a..952ebdd799 100644 --- a/x/wasm/client/testutil/tx.go +++ b/x/wasm/client/testutil/tx.go @@ -2,7 +2,6 @@ package testutil import ( "fmt" - "os" "github.com/line/lbm-sdk/client/flags" clitestutil "github.com/line/lbm-sdk/testutil/cli" @@ -166,80 +165,3 @@ func (s *IntegrationTestSuite) TestExecuteContractCmd() { }) } } - -func (s *IntegrationTestSuite) TestStoreCodeAndInstantiateContractCmd() { - val := s.network.Validators[0] - owner := val.Address.String() - - wasmPath := "../../keeper/testdata/hackatom.wasm" - _, err := os.ReadFile(wasmPath) - s.Require().NoError(err) - - params := fmt.Sprintf("{\"verifier\": \"%s\", \"beneficiary\": \"%s\"}", s.network.Validators[0].Address.String(), keeper.RandomAccountAddress(s.T())) - - testCases := map[string]struct { - args []string - valid bool - }{ - "valid storeCodeAndInstantiateContract": { - []string{ - wasmPath, - params, - fmt.Sprintf("--label=%s", "TestContract"), - fmt.Sprintf("--admin=%s", owner), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), - fmt.Sprintf("--%s=%d", flags.FlagGas, 1600000), - }, - true, - }, - "wrong args count": { - []string{"0"}, - false, - }, - "no label error": { - []string{ - wasmPath, - params, - }, - false, - }, - "no sender error": { - []string{ - wasmPath, - params, - fmt.Sprintf("--label=%s", "TestContract"), - fmt.Sprintf("--admin=%s", owner), - }, - false, - }, - "wrong wasm path error": { - []string{ - "../../keeper/testdata/noexist.wasm", - params, - fmt.Sprintf("--label=%s", "TestContract"), - fmt.Sprintf("--admin=%s", owner), - fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), - fmt.Sprintf("--%s=%d", flags.FlagGas, 1600000), - }, - false, - }, - } - - for name, tc := range testCases { - tc := tc - - s.Run(name, func() { - cmd := cli.StoreCodeAndInstantiateContractCmd() - out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) - if !tc.valid { - s.Require().Error(err) - return - } - s.Require().NoError(err) - - var res sdk.TxResponse - s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &res), out.String()) - s.Require().EqualValues(0, res.Code, out.String()) - }) - } -} diff --git a/x/wasm/common_test.go b/x/wasm/common_test.go index 35815dbb96..7edb84c7b5 100644 --- a/x/wasm/common_test.go +++ b/x/wasm/common_test.go @@ -33,17 +33,3 @@ func parseInitResponse(t *testing.T, data []byte) string { require.NoError(t, err) return addr } - -// ensures this returns a valid codeID and bech32 address and returns it -func parseStoreAndInitResponse(t *testing.T, data []byte) (uint64, string) { - var res MsgStoreCodeAndInstantiateContractResponse - require.NoError(t, res.Unmarshal(data)) - require.NotEmpty(t, res.CodeID) - require.NotEmpty(t, res.Address) - addr := res.Address - codeID := res.CodeID - // ensure this is a valid sdk address - _, err := sdk.AccAddressFromBech32(addr) - require.NoError(t, err) - return codeID, addr -} diff --git a/x/wasm/genesis_test.go b/x/wasm/genesis_test.go index 8d71c769fc..42bcdfb336 100644 --- a/x/wasm/genesis_test.go +++ b/x/wasm/genesis_test.go @@ -14,8 +14,8 @@ func TestInitGenesis(t *testing.T) { deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) topUp := sdk.NewCoins(sdk.NewInt64Coin("denom", 5000)) - creator := data.faucet.NewFundedAccount(data.ctx, deposit.Add(deposit...)...) - fred := data.faucet.NewFundedAccount(data.ctx, topUp...) + 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) @@ -44,6 +44,7 @@ func TestInitGenesis(t *testing.T) { CodeID: firstCodeID, Msg: initMsgBz, Funds: deposit, + Label: "testing", } res, err = h(data.ctx, &initCmd) require.NoError(t, err) diff --git a/x/wasm/handler.go b/x/wasm/handler.go index 102233d7d9..184a730262 100644 --- a/x/wasm/handler.go +++ b/x/wasm/handler.go @@ -4,13 +4,12 @@ import ( "fmt" "github.com/gogo/protobuf/proto" + abci "github.com/tendermint/tendermint/abci/types" sdk "github.com/line/lbm-sdk/types" sdkerrors "github.com/line/lbm-sdk/types/errors" - abci "github.com/line/ostracon/abci/types" "github.com/line/wasmd/x/wasm/keeper" - "github.com/line/wasmd/x/wasm/lbmtypes" "github.com/line/wasmd/x/wasm/types" ) @@ -30,13 +29,8 @@ func NewHandler(k types.ContractOpsKeeper) sdk.Handler { res, err = msgServer.StoreCode(sdk.WrapSDKContext(ctx), msg) case *MsgInstantiateContract: res, err = msgServer.InstantiateContract(sdk.WrapSDKContext(ctx), msg) - case *MsgStoreCodeAndInstantiateContract: - lbmMsgServer, ok := msgServer.(lbmtypes.MsgServer) - if !ok { - errMsg := fmt.Sprintf("unrecognized wasm message type: %T", msg) - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) - } - res, err = lbmMsgServer.StoreCodeAndInstantiateContract(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: diff --git a/x/wasm/ibc.go b/x/wasm/ibc.go index 0c5120f407..10d1ed749b 100644 --- a/x/wasm/ibc.go +++ b/x/wasm/ibc.go @@ -3,13 +3,13 @@ package wasm import ( "math" + channeltypes "github.com/line/ibc-go/v3/modules/core/04-channel/types" + porttypes "github.com/line/ibc-go/v3/modules/core/05-port/types" + host "github.com/line/ibc-go/v3/modules/core/24-host" + ibcexported "github.com/line/ibc-go/v3/modules/core/exported" sdk "github.com/line/lbm-sdk/types" sdkerrors "github.com/line/lbm-sdk/types/errors" capabilitytypes "github.com/line/lbm-sdk/x/capability/types" - channeltypes "github.com/line/lbm-sdk/x/ibc/core/04-channel/types" - porttypes "github.com/line/lbm-sdk/x/ibc/core/05-port/types" - host "github.com/line/lbm-sdk/x/ibc/core/24-host" - ibcexported "github.com/line/lbm-sdk/x/ibc/core/exported" wasmvmtypes "github.com/line/wasmvm/types" wasmTypes "github.com/line/wasmd/x/wasm/types" @@ -298,17 +298,6 @@ func (i IBCHandler) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Packet, return nil } -func (i IBCHandler) NegotiateAppVersion( - ctx sdk.Context, - order channeltypes.Order, - connectionID string, - portID string, - counterparty channeltypes.Counterparty, - proposedVersion string, -) (version string, err error) { - return proposedVersion, nil // accept all -} - func newIBCPacket(packet channeltypes.Packet) wasmvmtypes.IBCPacket { timeout := wasmvmtypes.IBCTimeout{ Timestamp: packet.TimeoutTimestamp, diff --git a/x/wasm/ibc_reflect_test.go b/x/wasm/ibc_reflect_test.go index dd7d790a17..fb0e8c28a9 100644 --- a/x/wasm/ibc_reflect_test.go +++ b/x/wasm/ibc_reflect_test.go @@ -6,15 +6,17 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - channeltypes "github.com/line/lbm-sdk/x/ibc/core/04-channel/types" - ibctesting "github.com/line/lbm-sdk/x/ibc/testing" + channeltypes "github.com/line/ibc-go/v3/modules/core/04-channel/types" + ibctesting "github.com/line/ibc-go/v3/testing" wasmvmtypes "github.com/line/wasmvm/types" wasmibctesting "github.com/line/wasmd/x/wasm/ibctesting" wasmkeeper "github.com/line/wasmd/x/wasm/keeper" ) +// todo check after bumping up to v3.3.0+ in line/ibc-go func TestIBCReflectContract(t *testing.T) { + t.Skip("check it later after enable use ibc-go v3.3.0+ in lbm-sdk") // scenario: // chain A: ibc_reflect_send.wasm // chain B: reflect.wasm + ibc_reflect.wasm diff --git a/x/wasm/ibc_test.go b/x/wasm/ibc_test.go index 09a20ebf06..8d583c701d 100644 --- a/x/wasm/ibc_test.go +++ b/x/wasm/ibc_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/assert" - clienttypes "github.com/line/lbm-sdk/x/ibc/core/02-client/types" - channeltypes "github.com/line/lbm-sdk/x/ibc/core/04-channel/types" + clienttypes "github.com/line/ibc-go/v3/modules/core/02-client/types" + channeltypes "github.com/line/ibc-go/v3/modules/core/04-channel/types" wasmvmtypes "github.com/line/wasmvm/types" ) diff --git a/x/wasm/ibctesting/chain.go b/x/wasm/ibctesting/chain.go index cb88428b0f..7ebc996554 100644 --- a/x/wasm/ibctesting/chain.go +++ b/x/wasm/ibctesting/chain.go @@ -7,8 +7,18 @@ import ( "time" "github.com/stretchr/testify/require" - - "github.com/line/lbm-sdk/baseapp" + abci "github.com/tendermint/tendermint/abci/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + protoversion "github.com/tendermint/tendermint/proto/tendermint/version" + + clienttypes "github.com/line/ibc-go/v3/modules/core/02-client/types" + channeltypes "github.com/line/ibc-go/v3/modules/core/04-channel/types" + commitmenttypes "github.com/line/ibc-go/v3/modules/core/23-commitment/types" + host "github.com/line/ibc-go/v3/modules/core/24-host" + "github.com/line/ibc-go/v3/modules/core/exported" + "github.com/line/ibc-go/v3/modules/core/types" + ibctmtypes "github.com/line/ibc-go/v3/modules/light-clients/07-tendermint/types" + "github.com/line/ibc-go/v3/testing/mock" "github.com/line/lbm-sdk/client" "github.com/line/lbm-sdk/codec" "github.com/line/lbm-sdk/crypto/keys/secp256k1" @@ -19,31 +29,19 @@ import ( banktypes "github.com/line/lbm-sdk/x/bank/types" capabilitykeeper "github.com/line/lbm-sdk/x/capability/keeper" capabilitytypes "github.com/line/lbm-sdk/x/capability/types" - clienttypes "github.com/line/lbm-sdk/x/ibc/core/02-client/types" - channeltypes "github.com/line/lbm-sdk/x/ibc/core/04-channel/types" - commitmenttypes "github.com/line/lbm-sdk/x/ibc/core/23-commitment/types" - host "github.com/line/lbm-sdk/x/ibc/core/24-host" - "github.com/line/lbm-sdk/x/ibc/core/exported" - ibckeeper "github.com/line/lbm-sdk/x/ibc/core/keeper" - "github.com/line/lbm-sdk/x/ibc/core/types" - ibcoctypes "github.com/line/lbm-sdk/x/ibc/light-clients/99-ostracon/types" - ibctesting "github.com/line/lbm-sdk/x/ibc/testing" - "github.com/line/lbm-sdk/x/ibc/testing/mock" - stakingkeeper "github.com/line/lbm-sdk/x/staking/keeper" "github.com/line/lbm-sdk/x/staking/teststaking" stakingtypes "github.com/line/lbm-sdk/x/staking/types" - abci "github.com/line/ostracon/abci/types" + ocabci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto/tmhash" - ocproto "github.com/line/ostracon/proto/ostracon/types" - ocprotoversion "github.com/line/ostracon/proto/ostracon/version" octypes "github.com/line/ostracon/types" ocversion "github.com/line/ostracon/version" - wasmd "github.com/line/wasmd/app" + "github.com/line/wasmd/app" + "github.com/line/wasmd/app/params" "github.com/line/wasmd/x/wasm" ) -// TestChain is a testing struct that wraps a simapp with the last OC Header, the current ABCI +// TestChain is a testing struct that wraps a simapp with the last TM Header, the current ABCI // header and the validators of the TestChain. It also contains a field called ChainID. This // is the clientID that *other* chains use to refer to this TestChain. The SenderAccount // is used for delivering transactions through the application state. @@ -52,19 +50,18 @@ type TestChain struct { t *testing.T Coordinator *Coordinator - App ibctesting.TestingApp + App *app.WasmApp ChainID string - LastHeader *ibcoctypes.Header // header for last block height committed - CurrentHeader ocproto.Header // header for current block height + LastHeader *ibctmtypes.Header // header for last block height committed + CurrentHeader tmproto.Header // header for current block height QueryServer types.QueryServer TxConfig client.TxConfig Codec codec.BinaryCodec Vals *octypes.ValidatorSet - Voters *octypes.VoterSet Signers []octypes.PrivValidator - senderPrivKey cryptotypes.PrivKey + SenderPrivKey cryptotypes.PrivKey SenderAccount authtypes.AccountI PendingSendPackets []channeltypes.Packet @@ -91,9 +88,8 @@ func NewTestChain(t *testing.T, coord *Coordinator, chainID string, opts ...wasm require.NoError(t, err) // create validator set with single validator - validator := ibctesting.NewTestValidator(pubKey, 1) + validator := octypes.NewValidator(pubKey, 1) valSet := octypes.NewValidatorSet([]*octypes.Validator{validator}) - voterSet := octypes.WrapValidatorsToVoterSet(valSet.Validators) signers := []octypes.PrivValidator{privVal} // generate genesis account @@ -107,31 +103,30 @@ func NewTestChain(t *testing.T, coord *Coordinator, chainID string, opts ...wasm Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, amount)), } - app := NewTestingAppDecorator(t, wasmd.SetupWithGenesisValSet(t, valSet, []authtypes.GenesisAccount{acc}, opts, balance)) + wasmApp := app.SetupWithGenesisValSet(t, valSet, []authtypes.GenesisAccount{acc}, opts, balance) // create current header and call begin block - header := ocproto.Header{ + header := tmproto.Header{ ChainID: chainID, Height: 1, Time: coord.CurrentTime.UTC(), } - txConfig := app.GetTxConfig() + txConfig := params.MakeEncodingConfig().TxConfig // create an account to send transactions from chain := &TestChain{ t: t, Coordinator: coord, ChainID: chainID, - App: app, + App: wasmApp, CurrentHeader: header, - QueryServer: app.GetIBCKeeper(), + QueryServer: wasmApp.IBCKeeper, TxConfig: txConfig, - Codec: app.AppCodec(), + Codec: wasmApp.AppCodec(), Vals: valSet, - Voters: voterSet, Signers: signers, - senderPrivKey: senderPrivKey, + SenderPrivKey: senderPrivKey, SenderAccount: acc, } @@ -142,7 +137,7 @@ func NewTestChain(t *testing.T, coord *Coordinator, chainID string, opts ...wasm // GetContext returns the current context for the application. func (chain *TestChain) GetContext() sdk.Context { - return chain.App.GetBaseApp().NewContext(false, chain.CurrentHeader) + return chain.App.BaseApp.NewContext(false, chain.CurrentHeader) } // QueryProof performs an abci query with the given key and returns the proto encoded merkle proof @@ -218,10 +213,10 @@ func (chain *TestChain) QueryConsensusStateProof(clientID string) ([]byte, clien func (chain *TestChain) NextBlock() { // set the last header to the current header // use nil trusted fields - chain.LastHeader = chain.CurrentOCClientHeader() + chain.LastHeader = chain.CurrentTMClientHeader() // increment the current header - chain.CurrentHeader = ocproto.Header{ + chain.CurrentHeader = tmproto.Header{ ChainID: chain.ChainID, Height: chain.App.LastBlockHeight() + 1, AppHash: chain.App.LastCommitID().Hash, @@ -232,15 +227,15 @@ func (chain *TestChain) NextBlock() { NextValidatorsHash: chain.Vals.Hash(), } - chain.App.BeginBlock(abci.RequestBeginBlock{Header: chain.CurrentHeader}) + chain.App.BeginBlock(ocabci.RequestBeginBlock{Header: chain.CurrentHeader}) } func (chain *TestChain) CommitBlock() { chain.App.EndBlock(abci.RequestEndBlock{Height: chain.CurrentHeader.Height}) chain.App.Commit() - chain.App.BeginRecheckTx(abci.RequestBeginRecheckTx{Header: chain.CurrentHeader}) - chain.App.EndRecheckTx(abci.RequestEndRecheckTx{Height: chain.CurrentHeader.Height}) + chain.App.BeginRecheckTx(ocabci.RequestBeginRecheckTx{Header: chain.CurrentHeader}) + chain.App.EndRecheckTx(ocabci.RequestEndRecheckTx{Height: chain.CurrentHeader.Height}) } // sendMsgs delivers a transaction through the application without returning the result. @@ -256,16 +251,16 @@ func (chain *TestChain) SendMsgs(msgs ...sdk.Msg) (*sdk.Result, error) { // ensure the chain has the latest time chain.Coordinator.UpdateTimeForChain(chain) - _, r, err := wasmd.SignAndDeliver( + _, r, err := app.SignAndDeliver( chain.t, chain.TxConfig, - chain.App.GetBaseApp(), + chain.App.BaseApp, chain.GetContext().BlockHeader(), msgs, chain.ChainID, []uint64{chain.SenderAccount.GetAccountNumber()}, []uint64{chain.SenderAccount.GetSequence()}, - true, true, chain.senderPrivKey, + true, true, chain.SenderPrivKey, ) if err != nil { return nil, err @@ -303,7 +298,7 @@ func (chain *TestChain) captureIBCEvents(r *sdk.Result) { // GetClientState retrieves the client state for the provided clientID. The client is // expected to exist otherwise testing will fail. func (chain *TestChain) GetClientState(clientID string) exported.ClientState { - clientState, found := chain.App.GetIBCKeeper().ClientKeeper.GetClientState(chain.GetContext(), clientID) + clientState, found := chain.App.IBCKeeper.ClientKeeper.GetClientState(chain.GetContext(), clientID) require.True(chain.t, found) return clientState @@ -312,13 +307,13 @@ func (chain *TestChain) GetClientState(clientID string) exported.ClientState { // GetConsensusState retrieves the consensus state for the provided clientID and height. // It will return a success boolean depending on if consensus state exists or not. func (chain *TestChain) GetConsensusState(clientID string, height exported.Height) (exported.ConsensusState, bool) { - return chain.App.GetIBCKeeper().ClientKeeper.GetClientConsensusState(chain.GetContext(), clientID, height) + return chain.App.IBCKeeper.ClientKeeper.GetClientConsensusState(chain.GetContext(), clientID, height) } // GetValsAtHeight will return the validator set of the chain at a given height. It will return // a success boolean depending on if the validator set exists or not at that height. func (chain *TestChain) GetValsAtHeight(height int64) (*octypes.ValidatorSet, bool) { - histInfo, ok := chain.App.GetStakingKeeper().GetHistoricalInfo(chain.GetContext(), height) + histInfo, ok := chain.App.StakingKeeper.GetHistoricalInfo(chain.GetContext(), height) if !ok { return nil, false } @@ -332,30 +327,10 @@ func (chain *TestChain) GetValsAtHeight(height int64) (*octypes.ValidatorSet, bo return octypes.NewValidatorSet(tmValidators), true } -func (chain *TestChain) GetVotersAtHeight(height int64) (*octypes.VoterSet, bool) { - histInfo, ok := chain.App.GetStakingKeeper().GetHistoricalInfo(chain.GetContext(), height) - if !ok { - return nil, false - } - - // Voters of test chain is always same to validator set - voters := stakingtypes.Validators(histInfo.Valset) - ocVoters, err := teststaking.ToOcValidators(voters, sdk.DefaultPowerReduction) - if err != nil { - panic(err) - } - // Validators saved in HistoricalInfo store have no voting power. - // We set voting weight same as voting power for test. - for i := 0; i < len(ocVoters); i++ { - ocVoters[i].VotingWeight = ocVoters[i].VotingPower - } - return octypes.WrapValidatorsToVoterSet(ocVoters), true -} - // GetAcknowledgement retrieves an acknowledgement for the provided packet. If the // acknowledgement does not exist then testing will fail. func (chain *TestChain) GetAcknowledgement(packet exported.PacketI) []byte { - ack, found := chain.App.GetIBCKeeper().ChannelKeeper.GetPacketAcknowledgement(chain.GetContext(), packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence()) + ack, found := chain.App.IBCKeeper.ChannelKeeper.GetPacketAcknowledgement(chain.GetContext(), packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence()) require.True(chain.t, found) return ack @@ -363,34 +338,32 @@ func (chain *TestChain) GetAcknowledgement(packet exported.PacketI) []byte { // GetPrefix returns the prefix for used by a chain in connection creation func (chain *TestChain) GetPrefix() commitmenttypes.MerklePrefix { - return commitmenttypes.NewMerklePrefix(chain.App.GetIBCKeeper().ConnectionKeeper.GetCommitmentPrefix().Bytes()) + return commitmenttypes.NewMerklePrefix(chain.App.IBCKeeper.ConnectionKeeper.GetCommitmentPrefix().Bytes()) } -// ConstructUpdateOCClientHeader will construct a valid 99-ostracon Header to update the +// ConstructUpdateTMClientHeader will construct a valid 07-tendermint Header to update the // light client on the source chain. -func (chain *TestChain) ConstructUpdateOCClientHeader(counterparty *TestChain, clientID string) (*ibcoctypes.Header, error) { - return chain.ConstructUpdateOCClientHeaderWithTrustedHeight(counterparty, clientID, clienttypes.ZeroHeight()) +func (chain *TestChain) ConstructUpdateTMClientHeader(counterparty *TestChain, clientID string) (*ibctmtypes.Header, error) { + return chain.ConstructUpdateTMClientHeaderWithTrustedHeight(counterparty, clientID, clienttypes.ZeroHeight()) } -// ConstructUpdateOCClientHeader will construct a valid 99-ostracon Header to update the +// ConstructUpdateTMClientHeaderWithTrustedHeight will construct a valid 07-tendermint Header to update the // light client on the source chain. -func (chain *TestChain) ConstructUpdateOCClientHeaderWithTrustedHeight(counterparty *TestChain, clientID string, trustedHeight clienttypes.Height) (*ibcoctypes.Header, error) { +func (chain *TestChain) ConstructUpdateTMClientHeaderWithTrustedHeight(counterparty *TestChain, clientID string, trustedHeight clienttypes.Height) (*ibctmtypes.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() { trustedHeight = chain.GetClientState(clientID).GetLatestHeight().(clienttypes.Height) } var ( - tmTrustedVals *octypes.ValidatorSet - tmTrustedVoters *octypes.VoterSet - ok bool + tmTrustedVals *octypes.ValidatorSet + ok bool ) // Once we get TrustedHeight from client, we must query the validators from the counterparty chain // If the LatestHeight == LastHeader.Height, then TrustedValidators are current validators // If LatestHeight < LastHeader.Height, we can query the historical validator set from HistoricalInfo if trustedHeight == counterparty.LastHeader.GetHeight() { tmTrustedVals = counterparty.Vals - tmTrustedVoters = counterparty.Voters } else { // NOTE: We need to get validators from counterparty at height: trustedHeight+1 // since the last trusted validators for a header at height h @@ -398,12 +371,7 @@ func (chain *TestChain) ConstructUpdateOCClientHeaderWithTrustedHeight(counterpa // NextValidatorsHash tmTrustedVals, ok = counterparty.GetValsAtHeight(int64(trustedHeight.RevisionHeight + 1)) if !ok { - return nil, sdkerrors.Wrapf(ibcoctypes.ErrInvalidHeaderHeight, "could not retrieve trusted validators at trustedHeight: %d", trustedHeight) - } - - tmTrustedVoters, ok = counterparty.GetVotersAtHeight(int64(trustedHeight.RevisionHeight + 1)) - if !ok { - return nil, sdkerrors.Wrapf(ibcoctypes.ErrInvalidHeaderHeight, "could not retrieve trusted voters at trustedHeight: %d", trustedHeight) + return nil, sdkerrors.Wrapf(ibctmtypes.ErrInvalidHeaderHeight, "could not retrieve trusted validators at trustedHeight: %d", trustedHeight) } } // inject trusted fields into last header @@ -414,12 +382,7 @@ func (chain *TestChain) ConstructUpdateOCClientHeaderWithTrustedHeight(counterpa if err != nil { return nil, err } - trustedVoters, err := tmTrustedVoters.ToProto() - if err != nil { - return nil, err - } header.TrustedValidators = trustedVals - header.TrustedVoters = trustedVoters return header, nil } @@ -430,28 +393,25 @@ func (chain *TestChain) ExpireClient(amount time.Duration) { chain.Coordinator.IncrementTimeBy(amount) } -// CurrentOCClientHeader creates a OC header using the current header parameters +// 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) CurrentOCClientHeader() *ibcoctypes.Header { - return chain.CreateOCClientHeader(chain.ChainID, chain.CurrentHeader.Height, clienttypes.Height{}, chain.CurrentHeader.Time, chain.Vals, nil, chain.Voters, nil, chain.Signers) +func (chain *TestChain) CurrentTMClientHeader() *ibctmtypes.Header { + return chain.CreateTMClientHeader(chain.ChainID, chain.CurrentHeader.Height, clienttypes.Height{}, chain.CurrentHeader.Time, chain.Vals, nil, chain.Signers) } -// CreateOCClientHeader creates a OC header to update the OC client. Args are passed in to allow +// 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) CreateOCClientHeader(chainID string, blockHeight int64, trustedHeight clienttypes.Height, timestamp time.Time, tmValSet, tmTrustedVals *octypes.ValidatorSet, tmVoterSet, tmTrustedVoterSet *octypes.VoterSet, signers []octypes.PrivValidator) *ibcoctypes.Header { +func (chain *TestChain) CreateTMClientHeader(chainID string, blockHeight int64, trustedHeight clienttypes.Height, timestamp time.Time, tmValSet, tmTrustedVals *octypes.ValidatorSet, signers []octypes.PrivValidator) *ibctmtypes.Header { var ( - valSet *ocproto.ValidatorSet - trustedVals *ocproto.ValidatorSet - voterSet *ocproto.VoterSet - trustedVoters *ocproto.VoterSet + valSet *tmproto.ValidatorSet + trustedVals *tmproto.ValidatorSet ) require.NotNil(chain.t, tmValSet) - require.NotNil(chain.t, tmVoterSet) vsetHash := tmValSet.Hash() tmHeader := octypes.Header{ - Version: ocprotoversion.Consensus{Block: ocversion.BlockProtocol, App: 2}, + Version: protoversion.Consensus{Block: ocversion.BlockProtocol, App: 2}, ChainID: chainID, Height: blockHeight, Time: timestamp, @@ -459,7 +419,6 @@ func (chain *TestChain) CreateOCClientHeader(chainID string, blockHeight int64, LastCommitHash: chain.App.LastCommitID().Hash, DataHash: tmhash.Sum([]byte("data_hash")), ValidatorsHash: vsetHash, - VotersHash: tmVoterSet.Hash(), NextValidatorsHash: vsetHash, ConsensusHash: tmhash.Sum([]byte("consensus_hash")), AppHash: chain.CurrentHeader.AppHash, @@ -467,15 +426,14 @@ func (chain *TestChain) CreateOCClientHeader(chainID string, blockHeight int64, EvidenceHash: tmhash.Sum([]byte("evidence_hash")), ProposerAddress: tmValSet.SelectProposer([]byte{}, blockHeight, 0).Address, //nolint:staticcheck } - hhash := tmHeader.Hash() blockID := MakeBlockID(hhash, 3, tmhash.Sum([]byte("part_set"))) - voteSet := octypes.NewVoteSet(chainID, blockHeight, 1, ocproto.PrecommitType, tmVoterSet) + voteSet := octypes.NewVoteSet(chainID, blockHeight, 1, tmproto.PrecommitType, tmValSet) commit, err := octypes.MakeCommit(blockID, blockHeight, 1, voteSet, signers, timestamp) require.NoError(chain.t, err) - signedHeader := &ocproto.SignedHeader{ + signedHeader := &tmproto.SignedHeader{ Header: tmHeader.ToProto(), Commit: commit.ToProto(), } @@ -490,25 +448,13 @@ func (chain *TestChain) CreateOCClientHeader(chainID string, blockHeight int64, require.NoError(chain.t, err) } - if tmVoterSet != nil { - voterSet, err = tmVoterSet.ToProto() - require.NoError(chain.t, err) - } - - if tmTrustedVoterSet != nil { - trustedVoters, err = tmTrustedVoterSet.ToProto() - require.NoError(chain.t, err) - } - // 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 &ibcoctypes.Header{ + return &ibctmtypes.Header{ SignedHeader: signedHeader, ValidatorSet: valSet, - VoterSet: voterSet, TrustedHeight: trustedHeight, TrustedValidators: trustedVals, - TrustedVoters: trustedVoters, } } @@ -549,10 +495,10 @@ func CreateSortedSignerArray(altPrivVal, suitePrivVal octypes.PrivValidator, // Other applications must bind to the port in InitGenesis or modify this code. func (chain *TestChain) CreatePortCapability(scopedKeeper capabilitykeeper.ScopedKeeper, portID string) { // check if the portId is already binded, if not bind it - _, ok := chain.App.GetScopedIBCKeeper().GetCapability(chain.GetContext(), host.PortPath(portID)) + _, ok := chain.App.ScopedIBCKeeper.GetCapability(chain.GetContext(), host.PortPath(portID)) if !ok { // create capability using the IBC capability keeper - cap, err := chain.App.GetScopedIBCKeeper().NewCapability(chain.GetContext(), host.PortPath(portID)) + cap, err := chain.App.ScopedIBCKeeper.NewCapability(chain.GetContext(), host.PortPath(portID)) require.NoError(chain.t, err) // claim capability using the scopedKeeper @@ -560,7 +506,7 @@ func (chain *TestChain) CreatePortCapability(scopedKeeper capabilitykeeper.Scope require.NoError(chain.t, err) } - chain.CommitBlock() + chain.App.Commit() chain.NextBlock() } @@ -568,7 +514,7 @@ func (chain *TestChain) CreatePortCapability(scopedKeeper capabilitykeeper.Scope // GetPortCapability returns the port capability for the given portID. The capability must // exist, otherwise testing will fail. func (chain *TestChain) GetPortCapability(portID string) *capabilitytypes.Capability { - cap, ok := chain.App.GetScopedIBCKeeper().GetCapability(chain.GetContext(), host.PortPath(portID)) + cap, ok := chain.App.ScopedIBCKeeper.GetCapability(chain.GetContext(), host.PortPath(portID)) require.True(chain.t, ok) return cap @@ -580,15 +526,15 @@ func (chain *TestChain) GetPortCapability(portID string) *capabilitytypes.Capabi func (chain *TestChain) CreateChannelCapability(scopedKeeper capabilitykeeper.ScopedKeeper, portID, channelID string) { capName := host.ChannelCapabilityPath(portID, channelID) // check if the portId is already binded, if not bind it - _, ok := chain.App.GetScopedIBCKeeper().GetCapability(chain.GetContext(), capName) + _, ok := chain.App.ScopedIBCKeeper.GetCapability(chain.GetContext(), capName) if !ok { - cap, err := chain.App.GetScopedIBCKeeper().NewCapability(chain.GetContext(), capName) + cap, err := chain.App.ScopedIBCKeeper.NewCapability(chain.GetContext(), capName) require.NoError(chain.t, err) err = scopedKeeper.ClaimCapability(chain.GetContext(), cap, capName) require.NoError(chain.t, err) } - chain.CommitBlock() + chain.App.Commit() chain.NextBlock() } @@ -596,55 +542,16 @@ func (chain *TestChain) CreateChannelCapability(scopedKeeper capabilitykeeper.Sc // GetChannelCapability returns the channel capability for the given portID and channelID. // The capability must exist, otherwise testing will fail. func (chain *TestChain) GetChannelCapability(portID, channelID string) *capabilitytypes.Capability { - cap, ok := chain.App.GetScopedIBCKeeper().GetCapability(chain.GetContext(), host.ChannelCapabilityPath(portID, channelID)) + cap, ok := chain.App.ScopedIBCKeeper.GetCapability(chain.GetContext(), host.ChannelCapabilityPath(portID, channelID)) require.True(chain.t, ok) return cap } func (chain *TestChain) Balance(acc sdk.AccAddress, denom string) sdk.Coin { - return chain.GetTestSupport().BankKeeper().GetBalance(chain.GetContext(), acc, denom) + return chain.App.BankKeeper.GetBalance(chain.GetContext(), acc, denom) } func (chain *TestChain) AllBalances(acc sdk.AccAddress) sdk.Coins { - return chain.GetTestSupport().BankKeeper().GetAllBalances(chain.GetContext(), acc) -} - -func (chain TestChain) GetTestSupport() *wasmd.TestSupport { - return chain.App.(*TestingAppDecorator).TestSupport() -} - -var _ ibctesting.TestingApp = TestingAppDecorator{} - -type TestingAppDecorator struct { - *wasmd.WasmApp - t *testing.T -} - -func NewTestingAppDecorator(t *testing.T, simApp *wasmd.WasmApp) *TestingAppDecorator { - return &TestingAppDecorator{WasmApp: simApp, t: t} -} - -func (a TestingAppDecorator) GetBaseApp() *baseapp.BaseApp { - return a.TestSupport().GetBaseApp() -} - -func (a TestingAppDecorator) GetStakingKeeper() stakingkeeper.Keeper { - return a.TestSupport().StakingKeeper() -} - -func (a TestingAppDecorator) GetIBCKeeper() *ibckeeper.Keeper { - return a.TestSupport().IBCKeeper() -} - -func (a TestingAppDecorator) GetScopedIBCKeeper() capabilitykeeper.ScopedKeeper { - return a.TestSupport().ScopeIBCKeeper() -} - -func (a TestingAppDecorator) GetTxConfig() client.TxConfig { - return a.TestSupport().GetTxConfig() -} - -func (a TestingAppDecorator) TestSupport() *wasmd.TestSupport { - return wasmd.NewTestSupport(a.t, a.WasmApp) + return chain.App.BankKeeper.GetAllBalances(chain.GetContext(), acc) } diff --git a/x/wasm/ibctesting/coordinator.go b/x/wasm/ibctesting/coordinator.go index 18bdec6660..6d968d22bd 100644 --- a/x/wasm/ibctesting/coordinator.go +++ b/x/wasm/ibctesting/coordinator.go @@ -8,10 +8,10 @@ import ( "github.com/stretchr/testify/require" - channeltypes "github.com/line/lbm-sdk/x/ibc/core/04-channel/types" - host "github.com/line/lbm-sdk/x/ibc/core/24-host" - ibctesting "github.com/line/lbm-sdk/x/ibc/testing" - abci "github.com/line/ostracon/abci/types" + channeltypes "github.com/line/ibc-go/v3/modules/core/04-channel/types" + host "github.com/line/ibc-go/v3/modules/core/24-host" + ibctesting "github.com/line/ibc-go/v3/testing" + ocabci "github.com/line/ostracon/abci/types" wasmkeeper "github.com/line/wasmd/x/wasm/keeper" ) @@ -78,7 +78,7 @@ func (coord *Coordinator) UpdateTime() { // UpdateTimeForChain updates the clock for a specific chain. func (coord *Coordinator) UpdateTimeForChain(chain *TestChain) { chain.CurrentHeader.Time = coord.CurrentTime.UTC() - chain.App.BeginBlock(abci.RequestBeginBlock{Header: chain.CurrentHeader}) + chain.App.BeginBlock(ocabci.RequestBeginBlock{Header: chain.CurrentHeader}) } // Setup constructs a OC client, connection, and channel on both chains provided. It will @@ -201,7 +201,7 @@ func (coord *Coordinator) CommitBlock(chains ...*TestChain) { // CommitNBlocks commits n blocks to state and updates the block height by 1 for each commit. func (coord *Coordinator) CommitNBlocks(chain *TestChain, n uint64) { for i := uint64(0); i < n; i++ { - chain.App.BeginBlock(abci.RequestBeginBlock{Header: chain.CurrentHeader}) + chain.App.BeginBlock(ocabci.RequestBeginBlock{Header: chain.CurrentHeader}) chain.CommitBlock() chain.NextBlock() coord.IncrementTime() diff --git a/x/wasm/ibctesting/endpoint.go b/x/wasm/ibctesting/endpoint.go index 88a0af3159..47080d4f1f 100644 --- a/x/wasm/ibctesting/endpoint.go +++ b/x/wasm/ibctesting/endpoint.go @@ -5,14 +5,14 @@ import ( "github.com/stretchr/testify/require" - clienttypes "github.com/line/lbm-sdk/x/ibc/core/02-client/types" - connectiontypes "github.com/line/lbm-sdk/x/ibc/core/03-connection/types" - channeltypes "github.com/line/lbm-sdk/x/ibc/core/04-channel/types" - commitmenttypes "github.com/line/lbm-sdk/x/ibc/core/23-commitment/types" - host "github.com/line/lbm-sdk/x/ibc/core/24-host" - "github.com/line/lbm-sdk/x/ibc/core/exported" - ibcoctypes "github.com/line/lbm-sdk/x/ibc/light-clients/99-ostracon/types" - ibctesting "github.com/line/lbm-sdk/x/ibc/testing" + clienttypes "github.com/line/ibc-go/v3/modules/core/02-client/types" + connectiontypes "github.com/line/ibc-go/v3/modules/core/03-connection/types" + channeltypes "github.com/line/ibc-go/v3/modules/core/04-channel/types" + commitmenttypes "github.com/line/ibc-go/v3/modules/core/23-commitment/types" + host "github.com/line/ibc-go/v3/modules/core/24-host" + "github.com/line/ibc-go/v3/modules/core/exported" + ibctmtypes "github.com/line/ibc-go/v3/modules/light-clients/07-tendermint/types" + ibctesting "github.com/line/ibc-go/v3/testing" ) // Endpoint is a which represents a channel endpoint and its associated @@ -86,12 +86,12 @@ func (endpoint *Endpoint) CreateClient() (err error) { ) switch endpoint.ClientConfig.GetClientType() { - case exported.Ostracon: + case exported.Tendermint: tmConfig, ok := endpoint.ClientConfig.(*ibctesting.OstraconConfig) require.True(endpoint.Chain.t, ok) height := endpoint.Counterparty.Chain.LastHeader.GetHeight().(clienttypes.Height) - clientState = ibcoctypes.NewClientState( + clientState = ibctmtypes.NewClientState( endpoint.Counterparty.Chain.ChainID, tmConfig.TrustLevel, tmConfig.TrustingPeriod, tmConfig.UnbondingPeriod, tmConfig.MaxClockDrift, height, commitmenttypes.GetSDKSpecs(), ibctesting.UpgradePath, tmConfig.AllowUpdateAfterExpiry, tmConfig.AllowUpdateAfterMisbehaviour, ) @@ -134,8 +134,8 @@ func (endpoint *Endpoint) UpdateClient() (err error) { var header exported.Header switch endpoint.ClientConfig.GetClientType() { - case exported.Ostracon: - header, err = endpoint.Chain.ConstructUpdateOCClientHeader(endpoint.Counterparty.Chain, endpoint.ClientID) + case exported.Tendermint: + header, err = endpoint.Chain.ConstructUpdateTMClientHeader(endpoint.Counterparty.Chain, endpoint.ClientID) default: err = fmt.Errorf("client type %s is not supported", endpoint.ClientConfig.GetClientType()) @@ -379,7 +379,7 @@ func (endpoint *Endpoint) SendPacket(packet exported.PacketI) error { channelCap := endpoint.Chain.GetChannelCapability(packet.GetSourcePort(), packet.GetSourceChannel()) // no need to send message, acting as a module - err := endpoint.Chain.App.GetIBCKeeper().ChannelKeeper.SendPacket(endpoint.Chain.GetContext(), channelCap, packet) + err := endpoint.Chain.App.IBCKeeper.ChannelKeeper.SendPacket(endpoint.Chain.GetContext(), channelCap, packet) if err != nil { return err } @@ -413,7 +413,7 @@ func (endpoint *Endpoint) WriteAcknowledgement(ack exported.Acknowledgement, pac channelCap := endpoint.Chain.GetChannelCapability(packet.GetDestPort(), packet.GetDestChannel()) // no need to send message, acting as a handler - err := endpoint.Chain.App.GetIBCKeeper().ChannelKeeper.WriteAcknowledgement(endpoint.Chain.GetContext(), channelCap, packet, ack) + err := endpoint.Chain.App.IBCKeeper.ChannelKeeper.WriteAcknowledgement(endpoint.Chain.GetContext(), channelCap, packet, ack) if err != nil { return err } @@ -450,7 +450,7 @@ func (endpoint *Endpoint) TimeoutPacket(packet channeltypes.Packet) error { } proof, proofHeight := endpoint.Counterparty.QueryProof(packetKey) - nextSeqRecv, found := endpoint.Counterparty.Chain.App.GetIBCKeeper().ChannelKeeper.GetNextSequenceRecv(endpoint.Counterparty.Chain.GetContext(), endpoint.ChannelConfig.PortID, endpoint.ChannelID) + nextSeqRecv, found := endpoint.Counterparty.Chain.App.IBCKeeper.ChannelKeeper.GetNextSequenceRecv(endpoint.Counterparty.Chain.GetContext(), endpoint.ChannelConfig.PortID, endpoint.ChannelID) require.True(endpoint.Chain.t, found) timeoutMsg := channeltypes.NewMsgTimeout( @@ -466,7 +466,7 @@ func (endpoint *Endpoint) SetChannelClosed() error { channel := endpoint.GetChannel() channel.State = channeltypes.CLOSED - endpoint.Chain.App.GetIBCKeeper().ChannelKeeper.SetChannel(endpoint.Chain.GetContext(), endpoint.ChannelConfig.PortID, endpoint.ChannelID, channel) + endpoint.Chain.App.IBCKeeper.ChannelKeeper.SetChannel(endpoint.Chain.GetContext(), endpoint.ChannelConfig.PortID, endpoint.ChannelID, channel) endpoint.Chain.Coordinator.CommitBlock(endpoint.Chain) @@ -481,7 +481,7 @@ func (endpoint *Endpoint) GetClientState() exported.ClientState { // SetClientState sets the client state for this endpoint. func (endpoint *Endpoint) SetClientState(clientState exported.ClientState) { - endpoint.Chain.App.GetIBCKeeper().ClientKeeper.SetClientState(endpoint.Chain.GetContext(), endpoint.ClientID, clientState) + endpoint.Chain.App.IBCKeeper.ClientKeeper.SetClientState(endpoint.Chain.GetContext(), endpoint.ClientID, clientState) } // GetConsensusState retrieves the Consensus State for this endpoint at the provided height. @@ -495,13 +495,13 @@ func (endpoint *Endpoint) GetConsensusState(height exported.Height) exported.Con // SetConsensusState sets the consensus state for this endpoint. func (endpoint *Endpoint) SetConsensusState(consensusState exported.ConsensusState, height exported.Height) { - endpoint.Chain.App.GetIBCKeeper().ClientKeeper.SetClientConsensusState(endpoint.Chain.GetContext(), endpoint.ClientID, height, consensusState) + endpoint.Chain.App.IBCKeeper.ClientKeeper.SetClientConsensusState(endpoint.Chain.GetContext(), endpoint.ClientID, height, consensusState) } // GetConnection retrieves an IBC Connection for the endpoint. The // connection is expected to exist otherwise testing will fail. func (endpoint *Endpoint) GetConnection() connectiontypes.ConnectionEnd { - connection, found := endpoint.Chain.App.GetIBCKeeper().ConnectionKeeper.GetConnection(endpoint.Chain.GetContext(), endpoint.ConnectionID) + connection, found := endpoint.Chain.App.IBCKeeper.ConnectionKeeper.GetConnection(endpoint.Chain.GetContext(), endpoint.ConnectionID) require.True(endpoint.Chain.t, found) return connection @@ -509,13 +509,13 @@ func (endpoint *Endpoint) GetConnection() connectiontypes.ConnectionEnd { // SetConnection sets the connection for this endpoint. func (endpoint *Endpoint) SetConnection(connection connectiontypes.ConnectionEnd) { - endpoint.Chain.App.GetIBCKeeper().ConnectionKeeper.SetConnection(endpoint.Chain.GetContext(), endpoint.ConnectionID, connection) + endpoint.Chain.App.IBCKeeper.ConnectionKeeper.SetConnection(endpoint.Chain.GetContext(), endpoint.ConnectionID, connection) } // GetChannel retrieves an IBC Channel for the endpoint. The channel // is expected to exist otherwise testing will fail. func (endpoint *Endpoint) GetChannel() channeltypes.Channel { - channel, found := endpoint.Chain.App.GetIBCKeeper().ChannelKeeper.GetChannel(endpoint.Chain.GetContext(), endpoint.ChannelConfig.PortID, endpoint.ChannelID) + channel, found := endpoint.Chain.App.IBCKeeper.ChannelKeeper.GetChannel(endpoint.Chain.GetContext(), endpoint.ChannelConfig.PortID, endpoint.ChannelID) require.True(endpoint.Chain.t, found) return channel @@ -523,7 +523,7 @@ func (endpoint *Endpoint) GetChannel() channeltypes.Channel { // SetChannel sets the channel for this endpoint. func (endpoint *Endpoint) SetChannel(channel channeltypes.Channel) { - endpoint.Chain.App.GetIBCKeeper().ChannelKeeper.SetChannel(endpoint.Chain.GetContext(), endpoint.ChannelConfig.PortID, endpoint.ChannelID, channel) + endpoint.Chain.App.IBCKeeper.ChannelKeeper.SetChannel(endpoint.Chain.GetContext(), endpoint.ChannelConfig.PortID, endpoint.ChannelID, channel) } // QueryClientStateProof performs and abci query for a client stat associated diff --git a/x/wasm/ibctesting/event_utils.go b/x/wasm/ibctesting/event_utils.go index 029021b3b1..b9553f70fa 100644 --- a/x/wasm/ibctesting/event_utils.go +++ b/x/wasm/ibctesting/event_utils.go @@ -4,9 +4,10 @@ import ( "strconv" "strings" - clienttypes "github.com/line/lbm-sdk/x/ibc/core/02-client/types" - channeltypes "github.com/line/lbm-sdk/x/ibc/core/04-channel/types" - abci "github.com/line/ostracon/abci/types" + abci "github.com/tendermint/tendermint/abci/types" + + clienttypes "github.com/line/ibc-go/v3/modules/core/02-client/types" + channeltypes "github.com/line/ibc-go/v3/modules/core/04-channel/types" ) func getSendPackets(evts []abci.Event) []channeltypes.Packet { diff --git a/x/wasm/ibctesting/path.go b/x/wasm/ibctesting/path.go index 2707cb161b..65fbaeece4 100644 --- a/x/wasm/ibctesting/path.go +++ b/x/wasm/ibctesting/path.go @@ -4,8 +4,8 @@ import ( "bytes" "fmt" + channeltypes "github.com/line/ibc-go/v3/modules/core/04-channel/types" sdk "github.com/line/lbm-sdk/types" - channeltypes "github.com/line/lbm-sdk/x/ibc/core/04-channel/types" ) // Path contains two endpoints representing two chains connected over IBC @@ -40,7 +40,7 @@ func (path *Path) SetChannelOrdered() { // if EndpointA does not contain a packet commitment for that packet. An error is returned // if a relay step fails or the packet commitment does not exist on either endpoint. func (path *Path) RelayPacket(packet channeltypes.Packet, ack []byte) error { - pc := path.EndpointA.Chain.App.GetIBCKeeper().ChannelKeeper.GetPacketCommitment(path.EndpointA.Chain.GetContext(), packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence()) + pc := path.EndpointA.Chain.App.IBCKeeper.ChannelKeeper.GetPacketCommitment(path.EndpointA.Chain.GetContext(), packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence()) if bytes.Equal(pc, channeltypes.CommitPacket(path.EndpointA.Chain.App.AppCodec(), packet)) { // packet found, relay from A to B @@ -59,7 +59,7 @@ func (path *Path) RelayPacket(packet channeltypes.Packet, ack []byte) error { } - pc = path.EndpointB.Chain.App.GetIBCKeeper().ChannelKeeper.GetPacketCommitment(path.EndpointB.Chain.GetContext(), packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence()) + pc = path.EndpointB.Chain.App.IBCKeeper.ChannelKeeper.GetPacketCommitment(path.EndpointB.Chain.GetContext(), packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence()) if bytes.Equal(pc, channeltypes.CommitPacket(path.EndpointB.Chain.App.AppCodec(), packet)) { // packet found, relay B to A diff --git a/x/wasm/ibctesting/wasm.go b/x/wasm/ibctesting/wasm.go index 282097dcab..481d99b479 100644 --- a/x/wasm/ibctesting/wasm.go +++ b/x/wasm/ibctesting/wasm.go @@ -10,13 +10,12 @@ import ( "github.com/golang/protobuf/proto" //nolint "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + ibctesting "github.com/line/ibc-go/v3/testing" sdk "github.com/line/lbm-sdk/types" - ibctesting "github.com/line/lbm-sdk/x/ibc/testing" - abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/rand" - wasmd "github.com/line/wasmd/app" "github.com/line/wasmd/x/wasm/types" ) @@ -63,6 +62,7 @@ func (chain *TestChain) StoreCode(byteCode []byte) types.MsgStoreCodeResponse { var pInstResp types.MsgStoreCodeResponse require.NoError(chain.t, pInstResp.Unmarshal(protoResult.Data[0].Data)) require.NotEmpty(chain.t, pInstResp.CodeID) + require.NotEmpty(chain.t, pInstResp.Checksum) return pInstResp } @@ -134,8 +134,5 @@ func (chain *TestChain) parseSDKResultData(r *sdk.Result) sdk.TxMsgData { // ContractInfo is a helper function to returns the ContractInfo for the given contract address func (chain *TestChain) ContractInfo(contractAddr sdk.AccAddress) *types.ContractInfo { - type testSupporter interface { - TestSupport() *wasmd.TestSupport - } - return chain.App.(testSupporter).TestSupport().WasmKeeper().GetContractInfo(chain.GetContext(), contractAddr) + return chain.App.WasmKeeper.GetContractInfo(chain.GetContext(), contractAddr) } diff --git a/x/wasm/ioutils/ioutil.go b/x/wasm/ioutils/ioutil.go index 42a7015471..154996ca09 100644 --- a/x/wasm/ioutils/ioutil.go +++ b/x/wasm/ioutils/ioutil.go @@ -8,18 +8,12 @@ import ( "github.com/line/wasmd/x/wasm/types" ) -// Uncompress returns gzip uncompressed content if input was gzip, or original src otherwise -func Uncompress(src []byte, limit uint64) ([]byte, error) { - switch n := uint64(len(src)); { - case n < 3: - return src, nil - case n > limit: +// Uncompress expects a valid gzip source to unpack or fails. See IsGzip +func Uncompress(gzipSrc []byte, limit uint64) ([]byte, error) { + if uint64(len(gzipSrc)) > limit { return nil, types.ErrLimit } - if !bytes.Equal(gzipIdent, src[0:3]) { - return src, nil - } - zr, err := gzip.NewReader(bytes.NewReader(src)) + zr, err := gzip.NewReader(bytes.NewReader(gzipSrc)) if err != nil { return nil, err } diff --git a/x/wasm/ioutils/ioutil_test.go b/x/wasm/ioutils/ioutil_test.go index 5f1f9500b5..d3accaae5c 100644 --- a/x/wasm/ioutils/ioutil_test.go +++ b/x/wasm/ioutils/ioutil_test.go @@ -6,7 +6,6 @@ import ( "errors" "io" "os" - "strings" "testing" "github.com/stretchr/testify/assert" @@ -29,30 +28,10 @@ func TestUncompress(t *testing.T) { expError error expResult []byte }{ - "handle wasm uncompressed": { - src: wasmRaw, - expResult: wasmRaw, - }, "handle wasm compressed": { src: wasmGzipped, expResult: wasmRaw, }, - "handle nil slice": { - src: nil, - expResult: nil, - }, - "handle short unidentified": { - src: []byte{0x1, 0x2}, - expResult: []byte{0x1, 0x2}, - }, - "handle input slice exceeding limit": { - src: []byte(strings.Repeat("a", maxSize+1)), - expError: types.ErrLimit, - }, - "handle input slice at limit": { - src: []byte(strings.Repeat("a", maxSize)), - expResult: []byte(strings.Repeat("a", maxSize)), - }, "handle gzip identifier only": { src: gzipIdent, expError: io.ErrUnexpectedEOF, diff --git a/x/wasm/ioutils/utils.go b/x/wasm/ioutils/utils.go index d4b8abf349..197c44c360 100644 --- a/x/wasm/ioutils/utils.go +++ b/x/wasm/ioutils/utils.go @@ -17,7 +17,7 @@ var ( // IsGzip returns checks if the file contents are gzip compressed func IsGzip(input []byte) bool { - return bytes.Equal(input[:3], gzipIdent) + return len(input) >= 3 && bytes.Equal(gzipIdent, input[0:3]) } // IsWasm checks if the file contents are of wasm binary diff --git a/x/wasm/ioutils/utils_test.go b/x/wasm/ioutils/utils_test.go index 6d9fa52bb0..2dea0c5c0f 100644 --- a/x/wasm/ioutils/utils_test.go +++ b/x/wasm/ioutils/utils_test.go @@ -9,7 +9,6 @@ import ( func GetTestData() ([]byte, []byte, []byte, error) { wasmCode, err := os.ReadFile("../keeper/testdata/hackatom.wasm") - if err != nil { return nil, nil, nil, err } @@ -42,13 +41,17 @@ func TestIsGzip(t *testing.T) { require.False(t, IsGzip(wasmCode)) require.False(t, IsGzip(someRandomStr)) + require.False(t, IsGzip(nil)) + require.True(t, IsGzip(gzipData[0:3])) require.True(t, IsGzip(gzipData)) } func TestGzipIt(t *testing.T) { wasmCode, someRandomStr, _, err := GetTestData() - originalGzipData := []byte{31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 202, 72, 205, 201, 201, 87, 40, 207, 47, 202, 73, 1, - 4, 0, 0, 255, 255, 133, 17, 74, 13, 11, 0, 0, 0} + originalGzipData := []byte{ + 31, 139, 8, 0, 0, 0, 0, 0, 0, 255, 202, 72, 205, 201, 201, 87, 40, 207, 47, 202, 73, 1, + 4, 0, 0, 255, 255, 133, 17, 74, 13, 11, 0, 0, 0, + } require.NoError(t, err) diff --git a/x/wasm/keeper/addresses.go b/x/wasm/keeper/addresses.go new file mode 100644 index 0000000000..d51b9a44b1 --- /dev/null +++ b/x/wasm/keeper/addresses.go @@ -0,0 +1,76 @@ +package keeper + +import ( + "encoding/binary" + "fmt" + + sdk "github.com/line/lbm-sdk/types" + "github.com/line/lbm-sdk/types/address" + + "github.com/line/wasmd/x/wasm/types" +) + +// AddressGenerator abstract address generator to be used for a single contract address +type AddressGenerator func(ctx sdk.Context, codeID uint64, checksum []byte) sdk.AccAddress + +// ClassicAddressGenerator generates a contract address using codeID and instanceID sequence +func (k Keeper) ClassicAddressGenerator() AddressGenerator { + return func(ctx sdk.Context, codeID uint64, _ []byte) sdk.AccAddress { + instanceID := k.autoIncrementID(ctx, types.KeyLastInstanceID) + return BuildContractAddressClassic(codeID, instanceID) + } +} + +// PredicableAddressGenerator generates a predictable contract address +func PredicableAddressGenerator(creator sdk.AccAddress, salt []byte, msg []byte, fixMsg bool) AddressGenerator { + return func(ctx sdk.Context, _ uint64, checksum []byte) sdk.AccAddress { + if !fixMsg { // clear msg to not be included in the address generation + msg = []byte{} + } + return BuildContractAddressPredictable(checksum, creator, salt, msg) + } +} + +// BuildContractAddressClassic builds an sdk account address for a contract. +func BuildContractAddressClassic(codeID, instanceID uint64) sdk.AccAddress { + contractID := make([]byte, 16) + binary.BigEndian.PutUint64(contractID[:8], codeID) + binary.BigEndian.PutUint64(contractID[8:], instanceID) + return address.Module(types.ModuleName, contractID)[:types.ContractAddrLen] +} + +// BuildContractAddressPredictable generates a contract address for the wasm module with len = types.ContractAddrLen using the +// Cosmos SDK address.Module function. +// Internally a key is built containing: +// (len(checksum) | checksum | len(sender_address) | sender_address | len(salt) | salt| len(initMsg) | initMsg). +// +// All method parameter values must be valid and not nil. +func BuildContractAddressPredictable(checksum []byte, creator sdk.AccAddress, salt, initMsg types.RawContractMessage) sdk.AccAddress { + if len(checksum) != 32 { + panic("invalid checksum") + } + if err := sdk.VerifyAddressFormat(creator); err != nil { + panic(fmt.Sprintf("creator: %s", err)) + } + if err := types.ValidateSalt(salt); err != nil { + panic(fmt.Sprintf("salt: %s", err)) + } + if err := initMsg.ValidateBasic(); len(initMsg) != 0 && err != nil { + panic(fmt.Sprintf("initMsg: %s", err)) + } + checksum = UInt64LengthPrefix(checksum) + creator = UInt64LengthPrefix(creator) + salt = UInt64LengthPrefix(salt) + initMsg = UInt64LengthPrefix(initMsg) + key := make([]byte, len(checksum)+len(creator)+len(salt)+len(initMsg)) + copy(key[0:], checksum) + copy(key[len(checksum):], creator) + copy(key[len(checksum)+len(creator):], salt) + copy(key[len(checksum)+len(creator)+len(salt):], initMsg) + return address.Module(types.ModuleName, key)[:types.ContractAddrLen] +} + +// UInt64LengthPrefix prepend big endian encoded byte length +func UInt64LengthPrefix(bz []byte) []byte { + return append(sdk.Uint64ToBigEndian(uint64(len(bz))), bz...) +} diff --git a/x/wasm/keeper/addresses_test.go b/x/wasm/keeper/addresses_test.go new file mode 100644 index 0000000000..77c276bd66 --- /dev/null +++ b/x/wasm/keeper/addresses_test.go @@ -0,0 +1,433 @@ +package keeper + +import ( + "encoding/json" + "fmt" + "testing" + + tmbytes "github.com/line/ostracon/libs/bytes" + "github.com/stretchr/testify/require" + + sdk "github.com/line/lbm-sdk/types" +) + +func TestBuildContractAddress(t *testing.T) { + x, y := sdk.GetConfig().GetBech32AccountAddrPrefix(), sdk.GetConfig().GetBech32AccountPubPrefix() + t.Cleanup(func() { + sdk.GetConfig().SetBech32PrefixForAccount(x, y) + }) + sdk.GetConfig().SetBech32PrefixForAccount("purple", "purple") + + // test vectors generated via cosmjs: https://github.com/cosmos/cosmjs/pull/1253/files + type Spec struct { + In struct { + Checksum tmbytes.HexBytes `json:"checksum"` + Creator sdk.AccAddress `json:"creator"` + Salt tmbytes.HexBytes `json:"salt"` + Msg string `json:"msg"` + } `json:"in"` + Out struct { + Address sdk.AccAddress `json:"address"` + } `json:"out"` + } + var specs []Spec + require.NoError(t, json.Unmarshal([]byte(goldenMasterPredictableContractAddr), &specs)) + require.NotEmpty(t, specs) + for i, spec := range specs { + t.Run(fmt.Sprintf("case %d", i), func(t *testing.T) { + // when + gotAddr := BuildContractAddressPredictable(spec.In.Checksum, spec.In.Creator, spec.In.Salt.Bytes(), []byte(spec.In.Msg)) + + require.Equal(t, spec.Out.Address.String(), gotAddr.String()) + require.NoError(t, sdk.VerifyAddressFormat(gotAddr)) + }) + } +} + +const goldenMasterPredictableContractAddr = `[ + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "61", + "msg": null + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc0000000000000001610000000000000000", + "addressData": "5e865d3e45ad3e961f77fd77d46543417ced44d924dc3e079b5415ff6775f847" + }, + "out": { + "address": "purple1t6r960j945lfv8mhl4mage2rg97w63xeynwrupum2s2l7em4lprs9ce5hk" + } + }, + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "61", + "msg": "{}" + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc00000000000000016100000000000000027b7d", + "addressData": "0995499608947a5281e2c7ebd71bdb26a1ad981946dad57f6c4d3ee35de77835" + }, + "out": { + "address": "purple1px25n9sgj3a99q0zcl4awx7my6s6mxqegmdd2lmvf5lwxh080q6suttktr" + } + }, + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "61", + "msg": "{\"some\":123,\"structure\":{\"nested\":[\"ok\",true]}}" + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc000000000000000161000000000000002f7b22736f6d65223a3132332c22737472756374757265223a7b226e6573746564223a5b226f6b222c747275655d7d7d", + "addressData": "83326e554723b15bac664ceabc8a5887e27003abe9fbd992af8c7bcea4745167" + }, + "out": { + "address": "purple1svexu428ywc4htrxfn4tezjcsl38qqata8aany4033auafr529ns4v254c" + } + }, + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": null + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae0000000000000000", + "addressData": "9384c6248c0bb171e306fd7da0993ec1e20eba006452a3a9e078883eb3594564" + }, + "out": { + "address": "purple1jwzvvfyvpwchrccxl476pxf7c83qawsqv3f2820q0zyrav6eg4jqdcq7gc" + } + }, + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": "{}" + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae00000000000000027b7d", + "addressData": "9a8d5f98fb186825401a26206158e7a1213311a9b6a87944469913655af52ffb" + }, + "out": { + "address": "purple1n2x4lx8mrp5z2sq6ycsxzk885ysnxydfk658j3zxnyfk2kh49lasesxf6j" + } + }, + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": "{\"some\":123,\"structure\":{\"nested\":[\"ok\",true]}}" + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae000000000000002f7b22736f6d65223a3132332c22737472756374757265223a7b226e6573746564223a5b226f6b222c747275655d7d7d", + "addressData": "932f07bc53f7d0b0b43cb5a54ac3e245b205e6ae6f7c1d991dc6af4a2ff9ac18" + }, + "out": { + "address": "purple1jvhs00zn7lgtpdpukkj54slzgkeqte4wda7pmxgac6h55tle4svq8cmp60" + } + }, + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "61", + "msg": null + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff0000000000000001610000000000000000", + "addressData": "9725e94f528d8b78d33c25f3dfcd60e6142d8be60ab36f6a5b59036fd51560db" + }, + "out": { + "address": "purple1juj7jn6j3k9h35euyhealntquc2zmzlxp2ek76jmtypkl4g4vrdsfwmwxk" + } + }, + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "61", + "msg": "{}" + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff00000000000000016100000000000000027b7d", + "addressData": "b056e539bbaf447ba18f3f13b792970111fc78933eb6700f4d227b5216d63658" + }, + "out": { + "address": "purple1kptw2wdm4az8hgv08ufm0y5hqyglc7yn86m8qr6dyfa4y9kkxevqmkm9q3" + } + }, + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "61", + "msg": "{\"some\":123,\"structure\":{\"nested\":[\"ok\",true]}}" + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff000000000000000161000000000000002f7b22736f6d65223a3132332c22737472756374757265223a7b226e6573746564223a5b226f6b222c747275655d7d7d", + "addressData": "6c98434180f052294ff89fb6d2dae34f9f4468b0b8e6e7c002b2a44adee39abd" + }, + "out": { + "address": "purple1djvyxsvq7pfzjnlcn7md9khrf705g69shrnw0sqzk2jy4hhrn27sjh2ysy" + } + }, + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": null + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae0000000000000000", + "addressData": "0aaf1c31c5d529d21d898775bc35b3416f47bfd99188c334c6c716102cbd3101" + }, + "out": { + "address": "purple1p2h3cvw9655ay8vfsa6mcddng9h5007ejxyvxdxxcutpqt9axyqsagmmay" + } + }, + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": "{}" + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae00000000000000027b7d", + "addressData": "36fe6ab732187cdfed46290b448b32eb7f4798e7a4968b0537de8a842cbf030e" + }, + "out": { + "address": "purple1xmlx4dejrp7dlm2x9y95fzejadl50x885jtgkpfhm69ggt9lqv8qk3vn4f" + } + }, + { + "in": { + "checksum": "13a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a5", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": "{\"some\":123,\"structure\":{\"nested\":[\"ok\",true]}}" + }, + "intermediate": { + "key": "7761736d00000000000000002013a1fc994cc6d1c81b746ee0c0ff6f90043875e0bf1d9be6b7d779fc978dc2a500000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae000000000000002f7b22736f6d65223a3132332c22737472756374757265223a7b226e6573746564223a5b226f6b222c747275655d7d7d", + "addressData": "a0d0c942adac6f3e5e7c23116c4c42a24e96e0ab75f53690ec2d3de16067c751" + }, + "out": { + "address": "purple15rgvjs4d43hnuhnuyvgkcnzz5f8fdc9twh6ndy8v9577zcr8cags40l9dt" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "61", + "msg": null + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc0000000000000001610000000000000000", + "addressData": "b95c467218d408a0f93046f227b6ece7fe18133ff30113db4d2a7becdfeca141" + }, + "out": { + "address": "purple1h9wyvusc6sy2p7fsgmez0dhvullpsyel7vq38k6d9fa7ehlv59qsvnyh36" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "61", + "msg": "{}" + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc00000000000000016100000000000000027b7d", + "addressData": "23fe45dbbd45dc6cd25244a74b6e99e7a65bf0bac2f2842a05049d37555a3ae6" + }, + "out": { + "address": "purple1y0lytkaaghwxe5jjgjn5km5eu7n9hu96ctegg2s9qjwnw4268tnqxhg60a" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "61", + "msg": "{\"some\":123,\"structure\":{\"nested\":[\"ok\",true]}}" + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc000000000000000161000000000000002f7b22736f6d65223a3132332c22737472756374757265223a7b226e6573746564223a5b226f6b222c747275655d7d7d", + "addressData": "6faea261ed63baa65b05726269e83b217fa6205dc7d9fb74f9667d004a69c082" + }, + "out": { + "address": "purple1d7h2yc0dvwa2vkc9wf3xn6pmy9l6vgzaclvlka8eve7sqjnfczpqqsdnwu" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": null + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae0000000000000000", + "addressData": "67a3ab6384729925fdb144574628ce96836fe098d2c6be4e84ac106b2728d96c" + }, + "out": { + "address": "purple1v736kcuyw2vjtld3g3t5v2xwj6pklcyc6trtun5y4sgxkfegm9kq7vgpnt" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": "{}" + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae00000000000000027b7d", + "addressData": "23a121263bfce05c144f4af86f3d8a9f87dc56f9dc48dbcffc8c5a614da4c661" + }, + "out": { + "address": "purple1ywsjzf3mlns9c9z0ftux70v2n7rac4hem3ydhnlu33dxzndycesssc7x2m" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvhxf2py", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbcccccccccc", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": "{\"some\":123,\"structure\":{\"nested\":[\"ok\",true]}}" + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000149999999999aaaaaaaaaabbbbbbbbbbcccccccccc0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae000000000000002f7b22736f6d65223a3132332c22737472756374757265223a7b226e6573746564223a5b226f6b222c747275655d7d7d", + "addressData": "dd90dba6d6fcd5fb9c9c8f536314eb1bb29cb5aa084b633c5806b926a5636b58" + }, + "out": { + "address": "purple1mkgdhfkkln2lh8yu3afkx98trwefedd2pp9kx0zcq6ujdftrddvq50esay" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "61", + "msg": null + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff0000000000000001610000000000000000", + "addressData": "547a743022f4f1af05b102f57bf1c1c7d7ee81bae427dc20d36b2c4ec57612ae" + }, + "out": { + "address": "purple123a8gvpz7nc67pd3qt6hhuwpclt7aqd6usnacgxndvkya3tkz2hq5hz38f" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "61", + "msg": "{}" + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff00000000000000016100000000000000027b7d", + "addressData": "416e169110e4b411bc53162d7503b2bbf14d6b36b1413a4f4c9af622696e9665" + }, + "out": { + "address": "purple1g9hpdygsuj6pr0znzckh2qajh0c566ekk9qn5n6vntmzy6twjejsrl9alk" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "61", + "msg": "{\"some\":123,\"structure\":{\"nested\":[\"ok\",true]}}" + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff000000000000000161000000000000002f7b22736f6d65223a3132332c22737472756374757265223a7b226e6573746564223a5b226f6b222c747275655d7d7d", + "addressData": "619a0988b92d8796cea91dea63cbb1f1aefa4a6b6ee5c5d1e937007252697220" + }, + "out": { + "address": "purple1vxdqnz9e9kredn4frh4x8ja37xh05jntdmjut50fxuq8y5nfwgsquu9mxh" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": null + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae0000000000000000", + "addressData": "d8af856a6a04852d19b647ad6d4336eb26e077f740aef1a0331db34d299a885a" + }, + "out": { + "address": "purple1mzhc26n2qjzj6xdkg7kk6sekavnwqalhgzh0rgpnrke562v63pdq8grp8q" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": "{}" + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae00000000000000027b7d", + "addressData": "c7fb7bea96daab23e416c4fcf328215303005e1d0d5424257335568e5381e33c" + }, + "out": { + "address": "purple1clahh65km24j8eqkcn70x2pp2vpsqhsap42zgftnx4tgu5upuv7q9ywjws" + } + }, + { + "in": { + "checksum": "1da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b", + "creator": "purple1nxvenxve42424242hwamhwamenxvenxvmhwamhwaamhwamhwlllsatsy6m", + "creatorData": "9999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff", + "salt": "aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae", + "msg": "{\"some\":123,\"structure\":{\"nested\":[\"ok\",true]}}" + }, + "intermediate": { + "key": "7761736d0000000000000000201da6c16de2cbaf7ad8cbb66f0925ba33f5c278cb2491762d04658c1480ea229b00000000000000209999999999aaaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffff0000000000000040aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbccddeeffffeeddbbccddaa66551155aaaabbcc787878789900aabbbbcc221100acadae000000000000002f7b22736f6d65223a3132332c22737472756374757265223a7b226e6573746564223a5b226f6b222c747275655d7d7d", + "addressData": "ccdf9dea141a6c2475870529ab38fae9dec30df28e005894fe6578b66133ab4a" + }, + "out": { + "address": "purple1en0em6s5rfkzgav8q556kw86a80vxr0j3cq93987v4utvcfn4d9q0tql4w" + } + } +] +` diff --git a/x/wasm/keeper/ante_test.go b/x/wasm/keeper/ante_test.go index 8287f8c40b..4eb9a57dfc 100644 --- a/x/wasm/keeper/ante_test.go +++ b/x/wasm/keeper/ante_test.go @@ -6,13 +6,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" "github.com/line/lbm-sdk/store" sdk "github.com/line/lbm-sdk/types" - abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/log" - ocproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/wasmd/x/wasm/keeper" "github.com/line/wasmd/x/wasm/types" @@ -91,7 +91,7 @@ func TestCountTxDecorator(t *testing.T) { } for name, spec := range specs { t.Run(name, func(t *testing.T) { - ctx := sdk.NewContext(ms.CacheMultiStore(), ocproto.Header{ + ctx := sdk.NewContext(ms.CacheMultiStore(), tmproto.Header{ Height: myCurrentBlockHeight, Time: time.Date(2021, time.September, 27, 12, 0, 0, 0, time.UTC), }, false, log.NewNopLogger()) @@ -110,6 +110,7 @@ func TestCountTxDecorator(t *testing.T) { }) } } + func TestLimitSimulationGasDecorator(t *testing.T) { var ( hundred sdk.Gas = 100 @@ -163,7 +164,8 @@ func TestLimitSimulationGasDecorator(t *testing.T) { ctx := sdk.Context{}. WithGasMeter(sdk.NewInfiniteGasMeter()). WithConsensusParams(&abci.ConsensusParams{ - Block: &abci.BlockParams{MaxGas: spec.maxBlockGas}}) + Block: &abci.BlockParams{MaxGas: spec.maxBlockGas}, + }) // when if spec.expErr != nil { require.PanicsWithValue(t, spec.expErr, func() { diff --git a/x/wasm/keeper/api.go b/x/wasm/keeper/api.go index 75ce92f623..9da002b6a7 100644 --- a/x/wasm/keeper/api.go +++ b/x/wasm/keeper/api.go @@ -1,129 +1,43 @@ package keeper import ( - "fmt" - sdk "github.com/line/lbm-sdk/types" wasmvm "github.com/line/wasmvm" wasmvmtypes "github.com/line/wasmvm/types" - - types "github.com/line/wasmd/x/wasm/types" ) -type cosmwasmAPIImpl struct { - keeper *Keeper - ctx *sdk.Context -} - const ( + // DefaultGasCostHumanAddress is how moch SDK gas we charge to convert to a human address format + DefaultGasCostHumanAddress = 5 + // DefaultGasCostCanonicalAddress is how moch SDK gas we charge to convert to a canonical address format + DefaultGasCostCanonicalAddress = 4 + // DefaultDeserializationCostPerByte The formular should be `len(data) * deserializationCostPerByte` DefaultDeserializationCostPerByte = 1 ) var ( + costHumanize = DefaultGasCostHumanAddress * DefaultGasMultiplier + costCanonical = DefaultGasCostCanonicalAddress * DefaultGasMultiplier costJSONDeserialization = wasmvmtypes.UFraction{ - Numerator: DefaultDeserializationCostPerByte * types.DefaultGasMultiplier, + Numerator: DefaultDeserializationCostPerByte * DefaultGasMultiplier, Denominator: 1, } ) -func (a cosmwasmAPIImpl) humanAddress(canon []byte) (string, uint64, error) { - gasMultiplier := a.keeper.getGasMultiplier(*a.ctx) - gas := gasMultiplier.ToWasmVMGas(5) +func humanAddress(canon []byte) (string, uint64, error) { if err := sdk.VerifyAddressFormat(canon); err != nil { - return "", gas, err + return "", costHumanize, err } - - return sdk.AccAddress(canon).String(), gas, nil + return sdk.AccAddress(canon).String(), costHumanize, nil } -func (a cosmwasmAPIImpl) canonicalAddress(human string) ([]byte, uint64, error) { +func canonicalAddress(human string) ([]byte, uint64, error) { bz, err := sdk.AccAddressFromBech32(human) - gasMultiplier := a.keeper.getGasMultiplier(*a.ctx) - return bz, gasMultiplier.ToWasmVMGas(4), err + return bz, costCanonical, err } -// returns result, gas used, error -func (a cosmwasmAPIImpl) callCallablePoint(contractAddrStr string, name []byte, args []byte, isReadonly bool, callstack []byte, gasLimit uint64) ([]byte, uint64, error) { - contractAddr := sdk.MustAccAddressFromBech32(contractAddrStr) - contractInfo, codeInfo, prefixStore, err := a.keeper.contractInstance(*a.ctx, contractAddr) - if err != nil { - return nil, 0, err - } - - if a.keeper.IsInactiveContract(*a.ctx, contractAddr) { - return nil, 0, fmt.Errorf("called contract cannot be executed") - } - - env := types.NewEnv(*a.ctx, contractAddr) - wasmStore := types.NewWasmStore(prefixStore) - gasMultiplier := a.keeper.getGasMultiplier(*a.ctx) - querier := NewQueryHandler(*a.ctx, a.keeper.wasmVMQueryHandler, contractAddr, gasMultiplier) - gasMeter := a.keeper.gasMeter(*a.ctx) - api := a.keeper.cosmwasmAPI(*a.ctx) - - instantiateCost := gasMultiplier.ToWasmVMGas(a.keeper.instantiateContractCosts(a.keeper.gasRegister, *a.ctx, a.keeper.IsPinnedCode(*a.ctx, contractInfo.CodeID), len(args))) - if gasLimit < instantiateCost { - return nil, 0, fmt.Errorf("lack of gas for calling callable point") - } - wasmGasLimit := gasLimit - instantiateCost - - result, events, attrs, gas, err := a.keeper.wasmVM.CallCallablePoint(name, codeInfo.CodeHash, isReadonly, callstack, env, args, wasmStore, api, querier, gasMeter, wasmGasLimit, costJSONDeserialization) - gas += instantiateCost - - if err != nil { - return nil, gas, err - } - - if !isReadonly { - // issue events and attrs - if len(attrs) != 0 { - eventsByAttr, err := newCallablePointEvent(attrs, contractAddr, callstack) - if err != nil { - return nil, gas, err - } - a.ctx.EventManager().EmitEvents(eventsByAttr) - } - - if len(events) != 0 { - customEvents, err := newCustomCallablePointEvents(events, contractAddr, callstack) - if err != nil { - return nil, gas, err - } - a.ctx.EventManager().EmitEvents(customEvents) - } - } - - return result, gas, err -} - -// returns result, gas used, error -func (a cosmwasmAPIImpl) validateInterface(contractAddrStr string, expectedInterface []byte) ([]byte, uint64, error) { - contractAddr := sdk.MustAccAddressFromBech32(contractAddrStr) - - if a.keeper.IsInactiveContract(*a.ctx, contractAddr) { - return nil, 0, fmt.Errorf("try to validate a contract cannot be executed") - } - - _, codeInfo, _, err := a.keeper.contractInstance(*a.ctx, contractAddr) - if err != nil { - return nil, 0, err - } - - result, err := a.keeper.wasmVM.ValidateDynamicLinkInterface(codeInfo.CodeHash, expectedInterface) - - return result, 0, err -} - -func (k Keeper) cosmwasmAPI(ctx sdk.Context) wasmvm.GoAPI { - x := cosmwasmAPIImpl{ - keeper: &k, - ctx: &ctx, - } - return wasmvm.GoAPI{ - HumanAddress: x.humanAddress, - CanonicalAddress: x.canonicalAddress, - CallCallablePoint: x.callCallablePoint, - ValidateInterface: x.validateInterface, - } +var cosmwasmAPI = wasmvm.GoAPI{ // nolint:varcheck,deadcode + HumanAddress: humanAddress, + CanonicalAddress: canonicalAddress, } diff --git a/x/wasm/keeper/authz_policy.go b/x/wasm/keeper/authz_policy.go index 740195b19a..e485dbc827 100644 --- a/x/wasm/keeper/authz_policy.go +++ b/x/wasm/keeper/authz_policy.go @@ -10,10 +10,10 @@ type AuthorizationPolicy interface { CanCreateCode(c types.AccessConfig, creator sdk.AccAddress) bool CanInstantiateContract(c types.AccessConfig, actor sdk.AccAddress) bool CanModifyContract(admin, actor sdk.AccAddress) bool + CanModifyCodeAccessConfig(creator, actor sdk.AccAddress, isSubset bool) bool } -type DefaultAuthorizationPolicy struct { -} +type DefaultAuthorizationPolicy struct{} func (p DefaultAuthorizationPolicy) CanCreateCode(config types.AccessConfig, actor sdk.AccAddress) bool { return config.Allowed(actor) @@ -27,21 +27,24 @@ func (p DefaultAuthorizationPolicy) CanModifyContract(admin, actor sdk.AccAddres return admin != nil && admin.Equals(actor) } -// GovAuthorizationPolicy is for the gov handler(proposal_handler.go) authorities -type GovAuthorizationPolicy struct { +func (p DefaultAuthorizationPolicy) CanModifyCodeAccessConfig(creator, actor sdk.AccAddress, isSubset bool) bool { + return creator != nil && creator.Equals(actor) && isSubset } +type GovAuthorizationPolicy struct{} + func (p GovAuthorizationPolicy) CanCreateCode(types.AccessConfig, sdk.AccAddress) bool { - // The gov handler can create code regardless of the current access config return true } func (p GovAuthorizationPolicy) CanInstantiateContract(types.AccessConfig, sdk.AccAddress) bool { - // The gov handler can instantiate contract regardless of the code access config return true } func (p GovAuthorizationPolicy) CanModifyContract(sdk.AccAddress, sdk.AccAddress) bool { - // The gov handler can migrate contract regardless of the contract admin + return true +} + +func (p GovAuthorizationPolicy) CanModifyCodeAccessConfig(sdk.AccAddress, sdk.AccAddress, bool) bool { return true } diff --git a/x/wasm/keeper/authz_policy_test.go b/x/wasm/keeper/authz_policy_test.go new file mode 100644 index 0000000000..662727ba55 --- /dev/null +++ b/x/wasm/keeper/authz_policy_test.go @@ -0,0 +1,312 @@ +package keeper + +import ( + "testing" + + "github.com/stretchr/testify/assert" + + sdk "github.com/line/lbm-sdk/types" + + "github.com/line/wasmd/x/wasm/types" +) + +func TestDefaultAuthzPolicyCanCreateCode(t *testing.T) { + myActorAddress := RandomAccountAddress(t) + otherAddress := RandomAccountAddress(t) + specs := map[string]struct { + config types.AccessConfig + actor sdk.AccAddress + exp bool + panics bool + }{ + "nobody": { + config: types.AllowNobody, + exp: false, + }, + "everybody": { + config: types.AllowEverybody, + exp: true, + }, + "only address - same": { + config: types.AccessTypeOnlyAddress.With(myActorAddress), + exp: true, + }, + "only address - different": { + config: types.AccessTypeOnlyAddress.With(otherAddress), + exp: false, + }, + "any address - included": { + config: types.AccessTypeAnyOfAddresses.With(otherAddress, myActorAddress), + exp: true, + }, + "any address - not included": { + config: types.AccessTypeAnyOfAddresses.With(otherAddress), + exp: false, + }, + "undefined config - panics": { + config: types.AccessConfig{}, + panics: true, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + policy := DefaultAuthorizationPolicy{} + if !spec.panics { + got := policy.CanCreateCode(spec.config, myActorAddress) + assert.Equal(t, spec.exp, got) + return + } + assert.Panics(t, func() { + policy.CanCreateCode(spec.config, myActorAddress) + }) + }) + } +} + +func TestDefaultAuthzPolicyCanInstantiateContract(t *testing.T) { + myActorAddress := RandomAccountAddress(t) + otherAddress := RandomAccountAddress(t) + specs := map[string]struct { + config types.AccessConfig + actor sdk.AccAddress + exp bool + panics bool + }{ + "nobody": { + config: types.AllowNobody, + exp: false, + }, + "everybody": { + config: types.AllowEverybody, + exp: true, + }, + "only address - same": { + config: types.AccessTypeOnlyAddress.With(myActorAddress), + exp: true, + }, + "only address - different": { + config: types.AccessTypeOnlyAddress.With(otherAddress), + exp: false, + }, + "any address - included": { + config: types.AccessTypeAnyOfAddresses.With(otherAddress, myActorAddress), + exp: true, + }, + "any address - not included": { + config: types.AccessTypeAnyOfAddresses.With(otherAddress), + exp: false, + }, + "undefined config - panics": { + config: types.AccessConfig{}, + panics: true, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + policy := DefaultAuthorizationPolicy{} + if !spec.panics { + got := policy.CanInstantiateContract(spec.config, myActorAddress) + assert.Equal(t, spec.exp, got) + return + } + assert.Panics(t, func() { + policy.CanInstantiateContract(spec.config, myActorAddress) + }) + }) + } +} + +func TestDefaultAuthzPolicyCanModifyContract(t *testing.T) { + myActorAddress := RandomAccountAddress(t) + otherAddress := RandomAccountAddress(t) + + specs := map[string]struct { + admin sdk.AccAddress + exp bool + }{ + "same as actor": { + admin: myActorAddress, + exp: true, + }, + "different admin": { + admin: otherAddress, + exp: false, + }, + "no admin": { + exp: false, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + policy := DefaultAuthorizationPolicy{} + got := policy.CanModifyContract(spec.admin, myActorAddress) + assert.Equal(t, spec.exp, got) + }) + } +} + +func TestDefaultAuthzPolicyCanModifyCodeAccessConfig(t *testing.T) { + myActorAddress := RandomAccountAddress(t) + otherAddress := RandomAccountAddress(t) + + specs := map[string]struct { + admin sdk.AccAddress + subset bool + exp bool + }{ + "same as actor - subset": { + admin: myActorAddress, + subset: true, + exp: true, + }, + "same as actor - not subset": { + admin: myActorAddress, + subset: false, + exp: false, + }, + "different admin": { + admin: otherAddress, + exp: false, + }, + "no admin": { + exp: false, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + policy := DefaultAuthorizationPolicy{} + got := policy.CanModifyCodeAccessConfig(spec.admin, myActorAddress, spec.subset) + assert.Equal(t, spec.exp, got) + }) + } +} + +func TestGovAuthzPolicyCanCreateCode(t *testing.T) { + myActorAddress := RandomAccountAddress(t) + otherAddress := RandomAccountAddress(t) + specs := map[string]struct { + config types.AccessConfig + actor sdk.AccAddress + }{ + "nobody": { + config: types.AllowNobody, + }, + "everybody": { + config: types.AllowEverybody, + }, + "only address - same": { + config: types.AccessTypeOnlyAddress.With(myActorAddress), + }, + "only address - different": { + config: types.AccessTypeOnlyAddress.With(otherAddress), + }, + "any address - included": { + config: types.AccessTypeAnyOfAddresses.With(otherAddress, myActorAddress), + }, + "any address - not included": { + config: types.AccessTypeAnyOfAddresses.With(otherAddress), + }, + "undefined config - panics": { + config: types.AccessConfig{}, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + policy := GovAuthorizationPolicy{} + got := policy.CanCreateCode(spec.config, myActorAddress) + assert.True(t, got) + }) + } +} + +func TestGovAuthzPolicyCanInstantiateContract(t *testing.T) { + myActorAddress := RandomAccountAddress(t) + otherAddress := RandomAccountAddress(t) + specs := map[string]struct { + config types.AccessConfig + actor sdk.AccAddress + }{ + "nobody": { + config: types.AllowNobody, + }, + "everybody": { + config: types.AllowEverybody, + }, + "only address - same": { + config: types.AccessTypeOnlyAddress.With(myActorAddress), + }, + "only address - different": { + config: types.AccessTypeOnlyAddress.With(otherAddress), + }, + "any address - included": { + config: types.AccessTypeAnyOfAddresses.With(otherAddress, myActorAddress), + }, + "any address - not included": { + config: types.AccessTypeAnyOfAddresses.With(otherAddress), + }, + "undefined config - panics": { + config: types.AccessConfig{}, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + policy := GovAuthorizationPolicy{} + got := policy.CanInstantiateContract(spec.config, myActorAddress) + assert.True(t, got) + }) + } +} + +func TestGovAuthzPolicyCanModifyContract(t *testing.T) { + myActorAddress := RandomAccountAddress(t) + otherAddress := RandomAccountAddress(t) + + specs := map[string]struct { + admin sdk.AccAddress + }{ + "same as actor": { + admin: myActorAddress, + }, + "different admin": { + admin: otherAddress, + }, + "no admin": {}, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + policy := GovAuthorizationPolicy{} + got := policy.CanModifyContract(spec.admin, myActorAddress) + assert.True(t, got) + }) + } +} + +func TestGovAuthzPolicyCanModifyCodeAccessConfig(t *testing.T) { + myActorAddress := RandomAccountAddress(t) + otherAddress := RandomAccountAddress(t) + + specs := map[string]struct { + admin sdk.AccAddress + subset bool + }{ + "same as actor - subset": { + admin: myActorAddress, + subset: true, + }, + "same as actor - not subset": { + admin: myActorAddress, + subset: false, + }, + "different admin": { + admin: otherAddress, + }, + "no admin": {}, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + policy := GovAuthorizationPolicy{} + got := policy.CanModifyCodeAccessConfig(spec.admin, myActorAddress, spec.subset) + assert.True(t, got) + }) + } +} diff --git a/x/wasm/keeper/bench_test.go b/x/wasm/keeper/bench_test.go index 440dfac6eb..19528c314a 100644 --- a/x/wasm/keeper/bench_test.go +++ b/x/wasm/keeper/bench_test.go @@ -9,7 +9,6 @@ import ( dbm "github.com/tendermint/tm-db" "github.com/line/lbm-sdk/crypto/keys/secp256k1" - sdk "github.com/line/lbm-sdk/types" "github.com/line/wasmd/x/wasm/types" ) @@ -69,7 +68,7 @@ func BenchmarkInstantiationOverhead(b *testing.B) { for name, spec := range specs { b.Run(name, func(b *testing.B) { wasmConfig := types.WasmConfig{MemoryCacheSize: 0} - ctx, keepers := createTestInput(b, false, SupportedFeatures, nil, nil, wasmConfig, spec.db()) + ctx, keepers := createTestInput(b, false, AvailableCapabilities, wasmConfig, spec.db()) example := InstantiateHackatomExampleContract(b, ctx, keepers) if spec.pinned { require.NoError(b, keepers.ContractKeeper.PinCode(ctx, example.CodeID)) @@ -83,34 +82,6 @@ func BenchmarkInstantiationOverhead(b *testing.B) { } } -func BenchmarkAPI(b *testing.B) { - wasmConfig := types.WasmConfig{MemoryCacheSize: 0} - ctx, keepers := createTestInput(b, false, SupportedFeatures, nil, nil, wasmConfig, dbm.NewMemDB()) - example := InstantiateHackatomExampleContract(b, ctx, keepers) - api := keepers.WasmKeeper.cosmwasmAPI(ctx) - addrStr := example.Contract.String() - addrBytes, err := sdk.AccAddressFromBech32(example.Contract.String()) - require.NoError(b, err) - - b.Run("CanonicalAddress", func(b *testing.B) { - b.ReportAllocs() - b.ResetTimer() - for i := 0; i < b.N; i++ { - _, _, err := api.CanonicalAddress(addrStr) - require.NoError(b, err) - } - }) - - b.Run("HumanAddress", func(b *testing.B) { - b.ReportAllocs() - b.ResetTimer() - for i := 0; i < b.N; i++ { - _, _, err := api.HumanAddress(addrBytes) - require.NoError(b, err) - } - }) -} - // Calculate the time it takes to compile some wasm code the first time. // This will help us adjust pricing for UploadCode func BenchmarkCompilation(b *testing.B) { @@ -119,15 +90,12 @@ func BenchmarkCompilation(b *testing.B) { db func() dbm.DB }{ "hackatom": { - db: func() dbm.DB { return dbm.NewMemDB() }, wasmFile: "./testdata/hackatom.wasm", }, "burner": { - db: func() dbm.DB { return dbm.NewMemDB() }, wasmFile: "./testdata/burner.wasm", }, "ibc_reflect": { - db: func() dbm.DB { return dbm.NewMemDB() }, wasmFile: "./testdata/ibc_reflect.wasm", }, } @@ -135,7 +103,8 @@ func BenchmarkCompilation(b *testing.B) { for name, spec := range specs { b.Run(name, func(b *testing.B) { wasmConfig := types.WasmConfig{MemoryCacheSize: 0} - ctx, keepers := createTestInput(b, false, SupportedFeatures, nil, nil, wasmConfig, spec.db()) + db := dbm.NewMemDB() + ctx, keepers := createTestInput(b, false, AvailableCapabilities, wasmConfig, db) // print out code size for comparisons code, err := os.ReadFile(spec.wasmFile) diff --git a/x/wasm/keeper/contract_keeper.go b/x/wasm/keeper/contract_keeper.go index c8dab777eb..aec25c33a0 100644 --- a/x/wasm/keeper/contract_keeper.go +++ b/x/wasm/keeper/contract_keeper.go @@ -10,8 +10,19 @@ var _ types.ContractOpsKeeper = PermissionedKeeper{} // decoratedKeeper contains a subset of the wasm keeper that are already or can be guarded by an authorization policy in the future type decoratedKeeper interface { - create(ctx sdk.Context, creator sdk.AccAddress, wasmCode []byte, instantiateAccess *types.AccessConfig, authZ AuthorizationPolicy) (codeID uint64, err error) - instantiate(ctx sdk.Context, codeID uint64, creator, admin sdk.AccAddress, initMsg []byte, label string, deposit sdk.Coins, authZ AuthorizationPolicy) (sdk.AccAddress, []byte, error) + create(ctx sdk.Context, creator sdk.AccAddress, wasmCode []byte, instantiateAccess *types.AccessConfig, authZ AuthorizationPolicy) (codeID uint64, checksum []byte, err error) + + instantiate( + ctx sdk.Context, + codeID uint64, + creator, admin sdk.AccAddress, + initMsg []byte, + label string, + deposit sdk.Coins, + addressGenerator AddressGenerator, + authZ AuthorizationPolicy, + ) (sdk.AccAddress, []byte, error) + migrate(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, newCodeID uint64, msg []byte, authZ AuthorizationPolicy) ([]byte, error) setContractAdmin(ctx sdk.Context, contractAddress, caller, newAdmin sdk.AccAddress, authZ AuthorizationPolicy) error pinCode(ctx sdk.Context, codeID uint64) error @@ -19,10 +30,8 @@ type decoratedKeeper interface { execute(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, msg []byte, coins sdk.Coins) ([]byte, error) Sudo(ctx sdk.Context, contractAddress sdk.AccAddress, msg []byte) ([]byte, error) setContractInfoExtension(ctx sdk.Context, contract sdk.AccAddress, extra types.ContractInfoExtension) error - setAccessConfig(ctx sdk.Context, codeID uint64, config types.AccessConfig) error - - activateContract(ctx sdk.Context, contractAddress sdk.AccAddress) error - deactivateContract(ctx sdk.Context, contractAddress sdk.AccAddress) error + setAccessConfig(ctx sdk.Context, codeID uint64, caller sdk.AccAddress, newConfig types.AccessConfig, autz AuthorizationPolicy) error + ClassicAddressGenerator() AddressGenerator } type PermissionedKeeper struct { @@ -42,12 +51,44 @@ func NewDefaultPermissionKeeper(nested decoratedKeeper) *PermissionedKeeper { return NewPermissionedKeeper(nested, DefaultAuthorizationPolicy{}) } -func (p PermissionedKeeper) Create(ctx sdk.Context, creator sdk.AccAddress, wasmCode []byte, instantiateAccess *types.AccessConfig) (codeID uint64, err error) { +func (p PermissionedKeeper) Create(ctx sdk.Context, creator sdk.AccAddress, wasmCode []byte, instantiateAccess *types.AccessConfig) (codeID uint64, checksum []byte, err error) { return p.nested.create(ctx, creator, wasmCode, instantiateAccess, p.authZPolicy) } -func (p PermissionedKeeper) Instantiate(ctx sdk.Context, codeID uint64, creator, admin sdk.AccAddress, initMsg []byte, label string, deposit sdk.Coins) (sdk.AccAddress, []byte, error) { - return p.nested.instantiate(ctx, codeID, creator, admin, initMsg, label, deposit, p.authZPolicy) +// Instantiate creates an instance of a WASM contract using the classic sequence based address generator +func (p PermissionedKeeper) Instantiate( + ctx sdk.Context, + codeID uint64, + creator, admin sdk.AccAddress, + initMsg []byte, + label string, + deposit sdk.Coins, +) (sdk.AccAddress, []byte, error) { + return p.nested.instantiate(ctx, codeID, creator, admin, initMsg, label, deposit, p.nested.ClassicAddressGenerator(), p.authZPolicy) +} + +// Instantiate2 creates an instance of a WASM contract using the predictable address generator +func (p PermissionedKeeper) Instantiate2( + ctx sdk.Context, + codeID uint64, + creator, admin sdk.AccAddress, + initMsg []byte, + label string, + deposit sdk.Coins, + salt []byte, + fixMsg bool, +) (sdk.AccAddress, []byte, error) { + return p.nested.instantiate( + ctx, + codeID, + creator, + admin, + initMsg, + label, + deposit, + PredicableAddressGenerator(creator, salt, initMsg, fixMsg), + p.authZPolicy, + ) } func (p PermissionedKeeper) Execute(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, msg []byte, coins sdk.Coins) ([]byte, error) { @@ -78,20 +119,12 @@ func (p PermissionedKeeper) UnpinCode(ctx sdk.Context, codeID uint64) error { return p.nested.unpinCode(ctx, codeID) } -// SetExtraContractAttributes updates the extra attributes that can be stored with the contract info +// SetContractInfoExtension updates the extra attributes that can be stored with the contract info func (p PermissionedKeeper) SetContractInfoExtension(ctx sdk.Context, contract sdk.AccAddress, extra types.ContractInfoExtension) error { return p.nested.setContractInfoExtension(ctx, contract, extra) } // SetAccessConfig updates the access config of a code id. -func (p PermissionedKeeper) SetAccessConfig(ctx sdk.Context, codeID uint64, config types.AccessConfig) error { - return p.nested.setAccessConfig(ctx, codeID, config) -} - -func (p PermissionedKeeper) DeactivateContract(ctx sdk.Context, contractAddress sdk.AccAddress) error { - return p.nested.deactivateContract(ctx, contractAddress) -} - -func (p PermissionedKeeper) ActivateContract(ctx sdk.Context, contractAddress sdk.AccAddress) error { - return p.nested.activateContract(ctx, contractAddress) +func (p PermissionedKeeper) SetAccessConfig(ctx sdk.Context, codeID uint64, caller sdk.AccAddress, newConfig types.AccessConfig) error { + return p.nested.setAccessConfig(ctx, codeID, caller, newConfig, p.authZPolicy) } diff --git a/x/wasm/keeper/contract_keeper_test.go b/x/wasm/keeper/contract_keeper_test.go new file mode 100644 index 0000000000..a92b030df9 --- /dev/null +++ b/x/wasm/keeper/contract_keeper_test.go @@ -0,0 +1,168 @@ +package keeper + +import ( + "encoding/json" + "fmt" + "math" + "strings" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + sdk "github.com/line/lbm-sdk/types" + + "github.com/line/wasmd/x/wasm/keeper/wasmtesting" + "github.com/line/wasmd/x/wasm/types" +) + +func TestInstantiate2(t *testing.T) { + parentCtx, keepers := CreateTestInput(t, false, AvailableCapabilities) + example := StoreHackatomExampleContract(t, parentCtx, keepers) + otherExample := StoreReflectContract(t, parentCtx, keepers) + mock := &wasmtesting.MockWasmer{} + wasmtesting.MakeInstantiable(mock) + keepers.WasmKeeper.wasmVM = mock // set mock to not fail on contract init message + + 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 ( + mySalt = "my salt" + myLabel = "my label" + ) + // create instances for duplicate checks + exampleContract := func(t *testing.T, ctx sdk.Context, fixMsg bool) { + _, _, err := keepers.ContractKeeper.Instantiate2( + ctx, + example.CodeID, + example.CreatorAddr, + nil, + initMsg, + myLabel, + sdk.NewCoins(sdk.NewInt64Coin("denom", 1)), + []byte(mySalt), + fixMsg, + ) + require.NoError(t, err) + } + exampleWithFixMsg := func(t *testing.T, ctx sdk.Context) { + exampleContract(t, ctx, true) + } + exampleWithoutFixMsg := func(t *testing.T, ctx sdk.Context) { + exampleContract(t, ctx, false) + } + specs := map[string]struct { + setup func(t *testing.T, ctx sdk.Context) + codeID uint64 + sender sdk.AccAddress + salt []byte + initMsg json.RawMessage + fixMsg bool + expErr error + }{ + "fix msg - generates different address than without fixMsg": { + setup: exampleWithoutFixMsg, + codeID: example.CodeID, + sender: example.CreatorAddr, + salt: []byte(mySalt), + initMsg: initMsg, + fixMsg: true, + }, + "fix msg - different sender": { + setup: exampleWithFixMsg, + codeID: example.CodeID, + sender: otherAddr, + salt: []byte(mySalt), + initMsg: initMsg, + fixMsg: true, + }, + "fix msg - different code": { + setup: exampleWithFixMsg, + codeID: otherExample.CodeID, + sender: example.CreatorAddr, + salt: []byte(mySalt), + initMsg: []byte(`{}`), + fixMsg: true, + }, + "fix msg - different salt": { + setup: exampleWithFixMsg, + codeID: example.CodeID, + sender: example.CreatorAddr, + salt: []byte("other salt"), + initMsg: initMsg, + fixMsg: true, + }, + "fix msg - different init msg": { + setup: exampleWithFixMsg, + codeID: example.CodeID, + sender: example.CreatorAddr, + salt: []byte(mySalt), + initMsg: mustMarshal(t, HackatomExampleInitMsg{Verifier: otherAddr, Beneficiary: beneficiaryAddr}), + fixMsg: true, + }, + "different sender": { + setup: exampleWithoutFixMsg, + codeID: example.CodeID, + sender: otherAddr, + salt: []byte(mySalt), + initMsg: initMsg, + }, + "different code": { + setup: exampleWithoutFixMsg, + codeID: otherExample.CodeID, + sender: example.CreatorAddr, + salt: []byte(mySalt), + initMsg: []byte(`{}`), + }, + "different salt": { + setup: exampleWithoutFixMsg, + codeID: example.CodeID, + sender: example.CreatorAddr, + salt: []byte(`other salt`), + initMsg: initMsg, + }, + "different init msg - reject same address": { + setup: exampleWithoutFixMsg, + codeID: example.CodeID, + sender: example.CreatorAddr, + salt: []byte(mySalt), + initMsg: mustMarshal(t, HackatomExampleInitMsg{Verifier: otherAddr, Beneficiary: beneficiaryAddr}), + expErr: types.ErrDuplicate, + }, + "fix msg - long msg": { + setup: exampleWithFixMsg, + codeID: example.CodeID, + sender: otherAddr, + salt: []byte(mySalt), + initMsg: []byte(fmt.Sprintf(`{"foo":%q}`, strings.Repeat("b", math.MaxInt16+1))), // too long kills CI + fixMsg: true, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + ctx, _ := parentCtx.CacheContext() + spec.setup(t, ctx) + gotAddr, _, gotErr := keepers.ContractKeeper.Instantiate2( + ctx, + spec.codeID, + spec.sender, + nil, + spec.initMsg, + myLabel, + sdk.NewCoins(sdk.NewInt64Coin("denom", 2)), + spec.salt, + spec.fixMsg, + ) + if spec.expErr != nil { + assert.ErrorIs(t, gotErr, spec.expErr) + return + } + require.NoError(t, gotErr) + assert.NotEmpty(t, gotAddr) + }) + } +} diff --git a/x/wasm/keeper/events.go b/x/wasm/keeper/events.go index 0dc3077b12..ffb72553a5 100644 --- a/x/wasm/keeper/events.go +++ b/x/wasm/keeper/events.go @@ -42,32 +42,6 @@ func newCustomEvents(evts wasmvmtypes.Events, contractAddr sdk.AccAddress) (sdk. return events, nil } -func newCallablePointEvent(customAttributes []wasmvmtypes.EventAttribute, contractAddr sdk.AccAddress, callstack []byte) (sdk.Events, error) { - attrs, err := callablePointSDKEventAttributes(customAttributes, contractAddr, callstack) - - if err != nil { - return nil, err - } - - return sdk.Events{sdk.NewEvent(types.CallablePointEventType, attrs...)}, nil -} - -func newCustomCallablePointEvents(evts wasmvmtypes.Events, contractAddr sdk.AccAddress, callstack []byte) (sdk.Events, error) { - events := make(sdk.Events, 0, len(evts)) - for _, e := range evts { - typ := strings.TrimSpace(e.Type) - if len(typ) <= eventTypeMinLength { - return nil, sdkerrors.Wrap(types.ErrInvalidEvent, fmt.Sprintf("Event type too short: '%s'", typ)) - } - attributes, err := callablePointSDKEventAttributes(e.Attributes, contractAddr, callstack) - if err != nil { - return nil, err - } - events = append(events, sdk.NewEvent(fmt.Sprintf("%s%s", types.CustomCallablePointEventPrefix, typ), attributes...)) - } - return events, nil -} - // convert and add contract address issuing this event func contractSDKEventAttributes(customAttributes []wasmvmtypes.EventAttribute, contractAddr sdk.AccAddress) ([]sdk.Attribute, error) { attrs := []sdk.Attribute{sdk.NewAttribute(types.AttributeKeyContractAddr, contractAddr.String())} @@ -91,13 +65,3 @@ func contractSDKEventAttributes(customAttributes []wasmvmtypes.EventAttribute, c } return attrs, nil } - -func callablePointSDKEventAttributes(customAttributes []wasmvmtypes.EventAttribute, contractAddr sdk.AccAddress, callstack []byte) ([]sdk.Attribute, error) { - attrs, err := contractSDKEventAttributes(customAttributes, contractAddr) - if err != nil { - return nil, err - } - // attrs[0] is addr - attrs = append([]sdk.Attribute{attrs[0], sdk.NewAttribute(types.AttributeKeyCallstack, string(callstack))}, attrs[1:]...) - return attrs, nil -} diff --git a/x/wasm/keeper/events_test.go b/x/wasm/keeper/events_test.go index 55b3b5a545..59ad98c0b9 100644 --- a/x/wasm/keeper/events_test.go +++ b/x/wasm/keeper/events_test.go @@ -2,11 +2,9 @@ package keeper import ( "context" - "encoding/json" "testing" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" sdk "github.com/line/lbm-sdk/types" wasmvmtypes "github.com/line/wasmvm/types" @@ -74,8 +72,10 @@ func TestNewCustomEvents(t *testing.T) { "multiple attributes": { src: wasmvmtypes.Events{{ Type: "foo", - Attributes: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: "myVal"}, - {Key: "myOtherKey", Value: "myOtherVal"}}, + Attributes: []wasmvmtypes.EventAttribute{ + {Key: "myKey", Value: "myVal"}, + {Key: "myOtherKey", Value: "myOtherVal"}, + }, }}, exp: sdk.Events{sdk.NewEvent("wasm-foo", sdk.NewAttribute("_contract_address", myContract.String()), @@ -124,7 +124,8 @@ func TestNewCustomEvents(t *testing.T) { Type: "wasm", Attributes: []wasmvmtypes.EventAttribute{ {Key: "_reserved", Value: "is skipped"}, - {Key: "normal", Value: "is used"}}, + {Key: "normal", Value: "is used"}, + }, }}, isError: true, }, @@ -221,8 +222,10 @@ func TestNewWasmModuleEvent(t *testing.T) { sdk.NewAttribute("myKey", "myVal"))}, }, "multiple attributes": { - src: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: "myVal"}, - {Key: "myOtherKey", Value: "myOtherVal"}}, + src: []wasmvmtypes.EventAttribute{ + {Key: "myKey", Value: "myVal"}, + {Key: "myOtherKey", Value: "myOtherVal"}, + }, exp: sdk.Events{sdk.NewEvent("wasm", sdk.NewAttribute("_contract_address", myContract.String()), sdk.NewAttribute("myKey", "myVal"), @@ -273,243 +276,6 @@ func TestNewWasmModuleEvent(t *testing.T) { } } -func TestNewCustomCallablePointEvents(t *testing.T) { - myContract := RandomAccountAddress(t) - myCallstack := []sdk.AccAddress{RandomAccountAddress(t), RandomAccountAddress(t)} - myCallstackBinary, err := json.Marshal(myCallstack) - require.NoError(t, err) - specs := map[string]struct { - src wasmvmtypes.Events - exp sdk.Events - isError bool - }{ - "all good": { - src: wasmvmtypes.Events{{ - Type: "foo", - Attributes: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: "myVal"}}, - }}, - exp: sdk.Events{sdk.NewEvent("wasm-callablepoint-foo", - sdk.NewAttribute("_contract_address", myContract.String()), - sdk.NewAttribute("_callstack", string(myCallstackBinary)), - sdk.NewAttribute("myKey", "myVal"))}, - }, - "multiple attributes": { - src: wasmvmtypes.Events{{ - Type: "foo", - Attributes: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: "myVal"}, - {Key: "myOtherKey", Value: "myOtherVal"}}, - }}, - exp: sdk.Events{sdk.NewEvent("wasm-callablepoint-foo", - sdk.NewAttribute("_contract_address", myContract.String()), - sdk.NewAttribute("_callstack", string(myCallstackBinary)), - sdk.NewAttribute("myKey", "myVal"), - sdk.NewAttribute("myOtherKey", "myOtherVal"))}, - }, - "multiple events": { - src: wasmvmtypes.Events{{ - Type: "foo", - Attributes: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: "myVal"}}, - }, { - Type: "bar", - Attributes: []wasmvmtypes.EventAttribute{{Key: "otherKey", Value: "otherVal"}}, - }}, - exp: sdk.Events{ - sdk.NewEvent("wasm-callablepoint-foo", - sdk.NewAttribute("_contract_address", myContract.String()), - sdk.NewAttribute("_callstack", string(myCallstackBinary)), - sdk.NewAttribute("myKey", "myVal")), - sdk.NewEvent("wasm-callablepoint-bar", - sdk.NewAttribute("_contract_address", myContract.String()), - sdk.NewAttribute("_callstack", string(myCallstackBinary)), - sdk.NewAttribute("otherKey", "otherVal")), - }, - }, - "without attributes": { - src: wasmvmtypes.Events{{ - Type: "foo", - }}, - exp: sdk.Events{sdk.NewEvent("wasm-callablepoint-foo", - sdk.NewAttribute("_contract_address", myContract.String()), - sdk.NewAttribute("_callstack", string(myCallstackBinary))), - }, - }, - "error on short event type": { - src: wasmvmtypes.Events{{ - Type: "f", - }}, - isError: true, - }, - "error on _contract_address": { - src: wasmvmtypes.Events{{ - Type: "foo", - Attributes: []wasmvmtypes.EventAttribute{{Key: "_contract_address", Value: RandomBech32AccountAddress(t)}}, - }}, - isError: true, - }, - "error on reserved prefix": { - src: wasmvmtypes.Events{{ - Type: "wasm", - Attributes: []wasmvmtypes.EventAttribute{ - {Key: "_reserved", Value: "is skipped"}, - {Key: "normal", Value: "is used"}}, - }}, - isError: true, - }, - "error on empty value": { - src: wasmvmtypes.Events{{ - Type: "boom", - Attributes: []wasmvmtypes.EventAttribute{ - {Key: "some", Value: "data"}, - {Key: "key", Value: ""}, - }, - }}, - isError: true, - }, - "error on empty key": { - src: wasmvmtypes.Events{{ - Type: "boom", - Attributes: []wasmvmtypes.EventAttribute{ - {Key: "some", Value: "data"}, - {Key: "", Value: "value"}, - }, - }}, - isError: true, - }, - "error on whitespace type": { - src: wasmvmtypes.Events{{ - Type: " f ", - Attributes: []wasmvmtypes.EventAttribute{ - {Key: "some", Value: "data"}, - }, - }}, - isError: true, - }, - "error on only whitespace key": { - src: wasmvmtypes.Events{{ - Type: "boom", - Attributes: []wasmvmtypes.EventAttribute{ - {Key: "some", Value: "data"}, - {Key: "\n\n\n\n", Value: "value"}, - }, - }}, - isError: true, - }, - "error on only whitespace value": { - src: wasmvmtypes.Events{{ - Type: "boom", - Attributes: []wasmvmtypes.EventAttribute{ - {Key: "some", Value: "data"}, - {Key: "myKey", Value: " \t\r\n"}, - }, - }}, - isError: true, - }, - "strip out whitespace": { - src: wasmvmtypes.Events{{ - Type: " food\n", - Attributes: []wasmvmtypes.EventAttribute{{Key: "my Key", Value: "\tmyVal"}}, - }}, - exp: sdk.Events{sdk.NewEvent("wasm-callablepoint-food", - sdk.NewAttribute("_contract_address", myContract.String()), - sdk.NewAttribute("_callstack", string(myCallstackBinary)), - - sdk.NewAttribute("my Key", "myVal"))}, - }, - "empty event elements": { - src: make(wasmvmtypes.Events, 10), - isError: true, - }, - "nil": { - exp: sdk.Events{}, - }, - } - for name, spec := range specs { - t.Run(name, func(t *testing.T) { - gotEvent, err := newCustomCallablePointEvents(spec.src, myContract, myCallstackBinary) - if spec.isError { - assert.Error(t, err) - } else { - assert.NoError(t, err) - assert.Equal(t, spec.exp, gotEvent) - } - }) - } -} - -func TestNewCallablePointEvent(t *testing.T) { - myContract := RandomAccountAddress(t) - myCallstack := []sdk.AccAddress{RandomAccountAddress(t), RandomAccountAddress(t)} - myCallstackBinary, err := json.Marshal(myCallstack) - require.NoError(t, err) - specs := map[string]struct { - src []wasmvmtypes.EventAttribute - exp sdk.Events - isError bool - }{ - "all good": { - src: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: "myVal"}}, - exp: sdk.Events{sdk.NewEvent("wasm-callablepoint", - sdk.NewAttribute("_contract_address", myContract.String()), - sdk.NewAttribute("_callstack", string(myCallstackBinary)), - sdk.NewAttribute("myKey", "myVal"))}, - }, - "multiple attributes": { - src: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: "myVal"}, - {Key: "myOtherKey", Value: "myOtherVal"}}, - exp: sdk.Events{sdk.NewEvent("wasm-callablepoint", - sdk.NewAttribute("_contract_address", myContract.String()), - sdk.NewAttribute("_callstack", string(myCallstackBinary)), - sdk.NewAttribute("myKey", "myVal"), - sdk.NewAttribute("myOtherKey", "myOtherVal"))}, - }, - "without attributes": { - exp: sdk.Events{sdk.NewEvent("wasm-callablepoint", - sdk.NewAttribute("_contract_address", myContract.String()), sdk.NewAttribute("_callstack", string(myCallstackBinary))), - }, - }, - "error on _contract_address": { - src: []wasmvmtypes.EventAttribute{{Key: "_contract_address", Value: RandomBech32AccountAddress(t)}}, - isError: true, - }, - "error on whitespace key": { - src: []wasmvmtypes.EventAttribute{{Key: " ", Value: "value"}}, - isError: true, - }, - "error on whitespace value": { - src: []wasmvmtypes.EventAttribute{{Key: "key", Value: "\n\n\n"}}, - isError: true, - }, - "strip whitespace": { - src: []wasmvmtypes.EventAttribute{{Key: " my-real-key ", Value: "\n\n\nsome-val\t\t\t"}}, - exp: sdk.Events{sdk.NewEvent("wasm-callablepoint", - sdk.NewAttribute("_contract_address", myContract.String()), - sdk.NewAttribute("_callstack", string(myCallstackBinary)), - sdk.NewAttribute("my-real-key", "some-val"))}, - }, - "empty elements": { - src: make([]wasmvmtypes.EventAttribute, 10), - isError: true, - }, - "nil": { - exp: sdk.Events{sdk.NewEvent("wasm-callablepoint", - sdk.NewAttribute("_contract_address", myContract.String()), - sdk.NewAttribute("_callstack", string(myCallstackBinary)), - )}, - }, - } - for name, spec := range specs { - t.Run(name, func(t *testing.T) { - gotEvent, err := newCallablePointEvent(spec.src, myContract, myCallstackBinary) - if spec.isError { - assert.Error(t, err) - } else { - assert.NoError(t, err) - assert.Equal(t, spec.exp, gotEvent) - } - }) - } -} - // returns true when a wasm module event was emitted for this contract already func hasWasmModuleEvent(ctx sdk.Context, contractAddr sdk.AccAddress) bool { for _, e := range ctx.EventManager().Events() { diff --git a/x/wasm/keeper/exported_api.go b/x/wasm/keeper/exported_api.go new file mode 100644 index 0000000000..9ecad5d8c9 --- /dev/null +++ b/x/wasm/keeper/exported_api.go @@ -0,0 +1,9 @@ +package keeper + +var ( + HumanAddress = humanAddress + CanonicalAddress = canonicalAddress + CostHumanize = DefaultGasCostHumanAddress * DefaultGasMultiplier + CostCanonical = DefaultGasCostCanonicalAddress * DefaultGasMultiplier + CostJSONDeserialization = costJSONDeserialization +) diff --git a/x/wasm/keeper/exported_events.go b/x/wasm/keeper/exported_events.go new file mode 100644 index 0000000000..d5515e1540 --- /dev/null +++ b/x/wasm/keeper/exported_events.go @@ -0,0 +1,6 @@ +package keeper + +var ( + ContractSDKEventAttributes = contractSDKEventAttributes + EventTypeMinLength = eventTypeMinLength +) diff --git a/x/wasm/keeper/exported_keeper.go b/x/wasm/keeper/exported_keeper.go new file mode 100644 index 0000000000..1a3ce0539d --- /dev/null +++ b/x/wasm/keeper/exported_keeper.go @@ -0,0 +1,36 @@ +package keeper + +import ( + "github.com/line/lbm-sdk/store/prefix" + sdk "github.com/line/lbm-sdk/types" + "github.com/line/wasmd/x/wasm/types" + wasmvm "github.com/line/wasmvm" +) + +type PlusKeeper interface { + CosmwasmAPI(ctx sdk.Context) wasmvm.GoAPI +} + +func (k Keeper) ContractInstance(ctx sdk.Context, contractAddress sdk.AccAddress) (types.ContractInfo, types.CodeInfo, prefix.Store, error) { + return k.contractInstance(ctx, contractAddress) +} + +func (k Keeper) GasMeter(ctx sdk.Context) MultipliedGasMeter { + return k.gasMeter(ctx) +} + +func (k Keeper) GetGasRegister() GasRegister { + return k.gasRegister +} + +func (k Keeper) GetWasmVM() types.WasmerEngine { + return k.wasmVM +} + +func (k Keeper) GetWasmVMQueryHandler() WasmVMQueryHandler { + return k.wasmVMQueryHandler +} + +func (k Keeper) GetPluskeeper() PlusKeeper { + return k.pluskeeper +} diff --git a/x/wasm/keeper/gas_register.go b/x/wasm/keeper/gas_register.go index 116a549fe3..24c5cea1cc 100644 --- a/x/wasm/keeper/gas_register.go +++ b/x/wasm/keeper/gas_register.go @@ -1,11 +1,42 @@ package keeper import ( + storetypes "github.com/line/lbm-sdk/store/types" sdk "github.com/line/lbm-sdk/types" + sdkerrors "github.com/line/lbm-sdk/types/errors" wasmvmtypes "github.com/line/wasmvm/types" + + "github.com/line/wasmd/x/wasm/types" ) const ( + // DefaultGasMultiplier is how many CosmWasm gas points = 1 Cosmos SDK gas point. + // + // CosmWasm gas strategy is documented in https://github.com/CosmWasm/cosmwasm/blob/v1.0.0-beta/docs/GAS.md. + // Cosmos SDK reference costs can be found here: https://github.com/cosmos/cosmos-sdk/blob/v0.42.10/store/types/gas.go#L198-L209. + // + // The original multiplier of 100 up to CosmWasm 0.16 was based on + // "A write at ~3000 gas and ~200us = 10 gas per us (microsecond) cpu/io + // Rough timing have 88k gas at 90us, which is equal to 1k sdk gas... (one read)" + // as well as manual Wasmer benchmarks from 2019. This was then multiplied by 150_000 + // in the 0.16 -> 1.0 upgrade (https://github.com/CosmWasm/cosmwasm/pull/1120). + // + // The multiplier deserves more reproducible benchmarking and a strategy that allows easy adjustments. + // This is tracked in https://github.com/CosmWasm/wasmd/issues/566 and https://github.com/CosmWasm/wasmd/issues/631. + // Gas adjustments are consensus breaking but may happen in any release marked as consensus breaking. + // Do not make assumptions on how much gas an operation will consume in places that are hard to adjust, + // such as hardcoding them in contracts. + // + // Please note that all gas prices returned to wasmvm should have this multiplied. + // Benchmarks and numbers were discussed in: https://github.com/CosmWasm/wasmd/pull/634#issuecomment-938055852 + DefaultGasMultiplier uint64 = 140_000_000 + // DefaultInstanceCost is how much SDK gas we charge each time we load a WASM instance. + // Creating a new instance is costly, and this helps put a recursion limit to contracts calling contracts. + // Benchmarks and numbers were discussed in: https://github.com/CosmWasm/wasmd/pull/634#issuecomment-938056803 + DefaultInstanceCost uint64 = 60_000 + // DefaultCompileCost is how much SDK gas is charged *per byte* for compiling WASM code. + // Benchmarks and numbers were discussed in: https://github.com/CosmWasm/wasmd/pull/634#issuecomment-938056803 + DefaultCompileCost uint64 = 3 // DefaultEventAttributeDataCost is how much SDK gas is charged *per byte* for attribute data in events. // This is used with len(key) + len(value) DefaultEventAttributeDataCost uint64 = 1 @@ -23,15 +54,49 @@ const ( DefaultEventAttributeDataFreeTier = 100 ) +// default: 0.15 gas. +// see https://github.com/CosmWasm/wasmd/pull/898#discussion_r937727200 +var defaultPerByteUncompressCost = wasmvmtypes.UFraction{ + Numerator: 15, + Denominator: 100, +} + +// DefaultPerByteUncompressCost is how much SDK gas we charge per source byte to unpack +func DefaultPerByteUncompressCost() wasmvmtypes.UFraction { + return defaultPerByteUncompressCost +} + // GasRegister abstract source for gas costs type GasRegister interface { // NewContractInstanceCosts costs to crate a new contract instance from code + NewContractInstanceCosts(pinned bool, msgLen int) sdk.Gas + // CompileCosts costs to persist and "compile" a new wasm contract + CompileCosts(byteLength int) sdk.Gas + // UncompressCosts costs to unpack a new wasm contract + UncompressCosts(byteLength int) sdk.Gas + // InstantiateContractCosts costs when interacting with a wasm contract + InstantiateContractCosts(pinned bool, msgLen int) sdk.Gas + // ReplyCosts costs to handle a message reply + ReplyCosts(pinned bool, reply wasmvmtypes.Reply) sdk.Gas // EventCosts costs to persist an event EventCosts(attrs []wasmvmtypes.EventAttribute, events wasmvmtypes.Events) sdk.Gas + // ToWasmVMGas converts from sdk gas to wasmvm gas + ToWasmVMGas(source sdk.Gas) uint64 + // FromWasmVMGas converts from wasmvm gas to sdk gas + FromWasmVMGas(source uint64) sdk.Gas } // WasmGasRegisterConfig config type type WasmGasRegisterConfig struct { + // InstanceCost costs when interacting with a wasm contract + InstanceCost sdk.Gas + // CompileCosts costs to persist and "compile" a new wasm contract + CompileCost sdk.Gas + // UncompressCost costs per byte to unpack a contract + UncompressCost wasmvmtypes.UFraction + // GasMultiplier is how many cosmwasm gas points = 1 sdk gas point + // SDK reference costs can be found here: https://github.com/cosmos/cosmos-sdk/blob/02c6c9fafd58da88550ab4d7d494724a477c8a68/store/types/gas.go#L153-L164 + GasMultiplier sdk.Gas // EventPerAttributeCost is how much SDK gas is charged *per byte* for attribute data in events. // This is used with len(key) + len(value) EventPerAttributeCost sdk.Gas @@ -50,11 +115,15 @@ type WasmGasRegisterConfig struct { // DefaultGasRegisterConfig default values func DefaultGasRegisterConfig() WasmGasRegisterConfig { return WasmGasRegisterConfig{ + InstanceCost: DefaultInstanceCost, + CompileCost: DefaultCompileCost, + GasMultiplier: DefaultGasMultiplier, EventPerAttributeCost: DefaultPerAttributeCost, CustomEventCost: DefaultPerCustomEventCost, EventAttributeDataCost: DefaultEventAttributeDataCost, EventAttributeDataFreeTier: DefaultEventAttributeDataFreeTier, ContractMessageDataCost: DefaultContractMessageDataCost, + UncompressCost: DefaultPerByteUncompressCost(), } } @@ -70,11 +139,64 @@ func NewDefaultWasmGasRegister() WasmGasRegister { // NewWasmGasRegister constructor func NewWasmGasRegister(c WasmGasRegisterConfig) WasmGasRegister { + if c.GasMultiplier == 0 { + panic(sdkerrors.Wrap(sdkerrors.ErrLogic, "GasMultiplier can not be 0")) + } return WasmGasRegister{ c: c, } } +// NewContractInstanceCosts costs to crate a new contract instance from code +func (g WasmGasRegister) NewContractInstanceCosts(pinned bool, msgLen int) storetypes.Gas { + return g.InstantiateContractCosts(pinned, msgLen) +} + +// CompileCosts costs to persist and "compile" a new wasm contract +func (g WasmGasRegister) CompileCosts(byteLength int) storetypes.Gas { + if byteLength < 0 { + panic(sdkerrors.Wrap(types.ErrInvalid, "negative length")) + } + return g.c.CompileCost * uint64(byteLength) +} + +// UncompressCosts costs to unpack a new wasm contract +func (g WasmGasRegister) UncompressCosts(byteLength int) sdk.Gas { + if byteLength < 0 { + panic(sdkerrors.Wrap(types.ErrInvalid, "negative length")) + } + return g.c.UncompressCost.Mul(uint64(byteLength)).Floor() +} + +// InstantiateContractCosts costs when interacting with a wasm contract +func (g WasmGasRegister) InstantiateContractCosts(pinned bool, msgLen int) sdk.Gas { + if msgLen < 0 { + panic(sdkerrors.Wrap(types.ErrInvalid, "negative length")) + } + dataCosts := sdk.Gas(msgLen) * g.c.ContractMessageDataCost + if pinned { + return dataCosts + } + return g.c.InstanceCost + dataCosts +} + +// ReplyCosts costs to to handle a message reply +func (g WasmGasRegister) ReplyCosts(pinned bool, reply wasmvmtypes.Reply) sdk.Gas { + var eventGas sdk.Gas + msgLen := len(reply.Result.Err) + if reply.Result.Ok != nil { + msgLen += len(reply.Result.Ok.Data) + var attrs []wasmvmtypes.EventAttribute + for _, e := range reply.Result.Ok.Events { + eventGas += sdk.Gas(len(e.Type)) * g.c.EventAttributeDataCost + attrs = append(attrs, e.Attributes...) + } + // apply free tier on the whole set not per event + eventGas += g.EventCosts(attrs, nil) + } + return eventGas + g.InstantiateContractCosts(pinned, msgLen) +} + // EventCosts costs to persist an event func (g WasmGasRegister) EventCosts(attrs []wasmvmtypes.EventAttribute, events wasmvmtypes.Events) sdk.Gas { gas, remainingFreeTier := g.eventAttributeCosts(attrs, g.c.EventAttributeDataFreeTier) @@ -114,3 +236,17 @@ func calcWithFreeTier(storedBytes uint64, freeTier uint64) (uint64, uint64) { storedBytes -= freeTier return storedBytes, 0 } + +// ToWasmVMGas convert to wasmVM contract runtime gas unit +func (g WasmGasRegister) ToWasmVMGas(source storetypes.Gas) uint64 { + x := source * g.c.GasMultiplier + if x < source { + panic(sdk.ErrorOutOfGas{Descriptor: "overflow"}) + } + return x +} + +// FromWasmVMGas converts to SDK gas unit +func (g WasmGasRegister) FromWasmVMGas(source uint64) sdk.Gas { + return source / g.c.GasMultiplier +} diff --git a/x/wasm/keeper/gas_register_test.go b/x/wasm/keeper/gas_register_test.go new file mode 100644 index 0000000000..69df592f13 --- /dev/null +++ b/x/wasm/keeper/gas_register_test.go @@ -0,0 +1,473 @@ +package keeper + +import ( + "math" + "strings" + "testing" + + "github.com/stretchr/testify/assert" + + storetypes "github.com/line/lbm-sdk/store/types" + sdk "github.com/line/lbm-sdk/types" + wasmvmtypes "github.com/line/wasmvm/types" + + "github.com/line/wasmd/x/wasm/types" +) + +func TestCompileCosts(t *testing.T) { + specs := map[string]struct { + srcLen int + srcConfig WasmGasRegisterConfig + exp sdk.Gas + expPanic bool + }{ + "one byte": { + srcLen: 1, + srcConfig: DefaultGasRegisterConfig(), + exp: sdk.Gas(3), // DefaultCompileCost + }, + "zero byte": { + srcLen: 0, + srcConfig: DefaultGasRegisterConfig(), + exp: sdk.Gas(0), + }, + "negative len": { + srcLen: -1, + srcConfig: DefaultGasRegisterConfig(), + expPanic: true, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + if spec.expPanic { + assert.Panics(t, func() { + NewWasmGasRegister(spec.srcConfig).CompileCosts(spec.srcLen) + }) + return + } + gotGas := NewWasmGasRegister(spec.srcConfig).CompileCosts(spec.srcLen) + assert.Equal(t, spec.exp, gotGas) + }) + } +} + +func TestNewContractInstanceCosts(t *testing.T) { + specs := map[string]struct { + srcLen int + srcConfig WasmGasRegisterConfig + pinned bool + exp sdk.Gas + expPanic bool + }{ + "small msg - pinned": { + srcLen: 1, + srcConfig: DefaultGasRegisterConfig(), + pinned: true, + exp: DefaultContractMessageDataCost, + }, + "big msg - pinned": { + srcLen: math.MaxUint32, + srcConfig: DefaultGasRegisterConfig(), + pinned: true, + exp: DefaultContractMessageDataCost * sdk.Gas(math.MaxUint32), + }, + "empty msg - pinned": { + srcLen: 0, + pinned: true, + srcConfig: DefaultGasRegisterConfig(), + exp: sdk.Gas(0), + }, + "small msg - unpinned": { + srcLen: 1, + srcConfig: DefaultGasRegisterConfig(), + exp: DefaultContractMessageDataCost + DefaultInstanceCost, + }, + "big msg - unpinned": { + srcLen: math.MaxUint32, + srcConfig: DefaultGasRegisterConfig(), + exp: sdk.Gas(DefaultContractMessageDataCost*math.MaxUint32 + DefaultInstanceCost), + }, + "empty msg - unpinned": { + srcLen: 0, + srcConfig: DefaultGasRegisterConfig(), + exp: sdk.Gas(DefaultInstanceCost), + }, + + "negative len": { + srcLen: -1, + srcConfig: DefaultGasRegisterConfig(), + expPanic: true, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + if spec.expPanic { + assert.Panics(t, func() { + NewWasmGasRegister(spec.srcConfig).NewContractInstanceCosts(spec.pinned, spec.srcLen) + }) + return + } + gotGas := NewWasmGasRegister(spec.srcConfig).NewContractInstanceCosts(spec.pinned, spec.srcLen) + assert.Equal(t, spec.exp, gotGas) + }) + } +} + +func TestContractInstanceCosts(t *testing.T) { + // same as TestNewContractInstanceCosts currently + specs := map[string]struct { + srcLen int + srcConfig WasmGasRegisterConfig + pinned bool + exp sdk.Gas + expPanic bool + }{ + "small msg - pinned": { + srcLen: 1, + srcConfig: DefaultGasRegisterConfig(), + pinned: true, + exp: DefaultContractMessageDataCost, + }, + "big msg - pinned": { + srcLen: math.MaxUint32, + srcConfig: DefaultGasRegisterConfig(), + pinned: true, + exp: sdk.Gas(DefaultContractMessageDataCost * math.MaxUint32), + }, + "empty msg - pinned": { + srcLen: 0, + pinned: true, + srcConfig: DefaultGasRegisterConfig(), + exp: sdk.Gas(0), + }, + "small msg - unpinned": { + srcLen: 1, + srcConfig: DefaultGasRegisterConfig(), + exp: DefaultContractMessageDataCost + DefaultInstanceCost, + }, + "big msg - unpinned": { + srcLen: math.MaxUint32, + srcConfig: DefaultGasRegisterConfig(), + exp: sdk.Gas(DefaultContractMessageDataCost*math.MaxUint32 + DefaultInstanceCost), + }, + "empty msg - unpinned": { + srcLen: 0, + srcConfig: DefaultGasRegisterConfig(), + exp: sdk.Gas(DefaultInstanceCost), + }, + + "negative len": { + srcLen: -1, + srcConfig: DefaultGasRegisterConfig(), + expPanic: true, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + if spec.expPanic { + assert.Panics(t, func() { + NewWasmGasRegister(spec.srcConfig).InstantiateContractCosts(spec.pinned, spec.srcLen) + }) + return + } + gotGas := NewWasmGasRegister(spec.srcConfig).InstantiateContractCosts(spec.pinned, spec.srcLen) + assert.Equal(t, spec.exp, gotGas) + }) + } +} + +func TestReplyCost(t *testing.T) { + specs := map[string]struct { + src wasmvmtypes.Reply + srcConfig WasmGasRegisterConfig + pinned bool + exp sdk.Gas + expPanic bool + }{ + "subcall response with events and data - pinned": { + src: wasmvmtypes.Reply{ + Result: wasmvmtypes.SubMsgResult{ + Ok: &wasmvmtypes.SubMsgResponse{ + Events: []wasmvmtypes.Event{ + {Type: "foo", Attributes: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: "myData"}}}, + }, + Data: []byte{0x1}, + }, + }, + }, + srcConfig: DefaultGasRegisterConfig(), + pinned: true, + exp: sdk.Gas(3*DefaultEventAttributeDataCost + DefaultPerAttributeCost + DefaultContractMessageDataCost), // 3 == len("foo") + }, + "subcall response with events - pinned": { + src: wasmvmtypes.Reply{ + Result: wasmvmtypes.SubMsgResult{ + Ok: &wasmvmtypes.SubMsgResponse{ + Events: []wasmvmtypes.Event{ + {Type: "foo", Attributes: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: "myData"}}}, + }, + }, + }, + }, + srcConfig: DefaultGasRegisterConfig(), + pinned: true, + exp: sdk.Gas(3*DefaultEventAttributeDataCost + DefaultPerAttributeCost), // 3 == len("foo") + }, + "subcall response with events exceeds free tier- pinned": { + src: wasmvmtypes.Reply{ + Result: wasmvmtypes.SubMsgResult{ + Ok: &wasmvmtypes.SubMsgResponse{ + Events: []wasmvmtypes.Event{ + {Type: "foo", Attributes: []wasmvmtypes.EventAttribute{{Key: strings.Repeat("x", DefaultEventAttributeDataFreeTier), Value: "myData"}}}, + }, + }, + }, + }, + srcConfig: DefaultGasRegisterConfig(), + pinned: true, + exp: sdk.Gas((3+6)*DefaultEventAttributeDataCost + DefaultPerAttributeCost), // 3 == len("foo"), 6 == len("myData") + }, + "subcall response error - pinned": { + src: wasmvmtypes.Reply{ + Result: wasmvmtypes.SubMsgResult{ + Err: "foo", + }, + }, + srcConfig: DefaultGasRegisterConfig(), + pinned: true, + exp: 3 * DefaultContractMessageDataCost, + }, + "subcall response with events and data - unpinned": { + src: wasmvmtypes.Reply{ + Result: wasmvmtypes.SubMsgResult{ + Ok: &wasmvmtypes.SubMsgResponse{ + Events: []wasmvmtypes.Event{ + {Type: "foo", Attributes: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: "myData"}}}, + }, + Data: []byte{0x1}, + }, + }, + }, + srcConfig: DefaultGasRegisterConfig(), + exp: sdk.Gas(DefaultInstanceCost + 3*DefaultEventAttributeDataCost + DefaultPerAttributeCost + DefaultContractMessageDataCost), + }, + "subcall response with events - unpinned": { + src: wasmvmtypes.Reply{ + Result: wasmvmtypes.SubMsgResult{ + Ok: &wasmvmtypes.SubMsgResponse{ + Events: []wasmvmtypes.Event{ + {Type: "foo", Attributes: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: "myData"}}}, + }, + }, + }, + }, + srcConfig: DefaultGasRegisterConfig(), + exp: sdk.Gas(DefaultInstanceCost + 3*DefaultEventAttributeDataCost + DefaultPerAttributeCost), + }, + "subcall response with events exceeds free tier- unpinned": { + src: wasmvmtypes.Reply{ + Result: wasmvmtypes.SubMsgResult{ + Ok: &wasmvmtypes.SubMsgResponse{ + Events: []wasmvmtypes.Event{ + {Type: "foo", Attributes: []wasmvmtypes.EventAttribute{{Key: strings.Repeat("x", DefaultEventAttributeDataFreeTier), Value: "myData"}}}, + }, + }, + }, + }, + srcConfig: DefaultGasRegisterConfig(), + exp: sdk.Gas(DefaultInstanceCost + (3+6)*DefaultEventAttributeDataCost + DefaultPerAttributeCost), // 3 == len("foo"), 6 == len("myData") + }, + "subcall response error - unpinned": { + src: wasmvmtypes.Reply{ + Result: wasmvmtypes.SubMsgResult{ + Err: "foo", + }, + }, + srcConfig: DefaultGasRegisterConfig(), + exp: sdk.Gas(DefaultInstanceCost + 3*DefaultContractMessageDataCost), + }, + "subcall response with empty events": { + src: wasmvmtypes.Reply{ + Result: wasmvmtypes.SubMsgResult{ + Ok: &wasmvmtypes.SubMsgResponse{ + Events: make([]wasmvmtypes.Event, 10), + }, + }, + }, + srcConfig: DefaultGasRegisterConfig(), + exp: DefaultInstanceCost, + }, + "subcall response with events unset": { + src: wasmvmtypes.Reply{ + Result: wasmvmtypes.SubMsgResult{ + Ok: &wasmvmtypes.SubMsgResponse{}, + }, + }, + srcConfig: DefaultGasRegisterConfig(), + exp: DefaultInstanceCost, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + if spec.expPanic { + assert.Panics(t, func() { + NewWasmGasRegister(spec.srcConfig).ReplyCosts(spec.pinned, spec.src) + }) + return + } + gotGas := NewWasmGasRegister(spec.srcConfig).ReplyCosts(spec.pinned, spec.src) + assert.Equal(t, spec.exp, gotGas) + }) + } +} + +func TestEventCosts(t *testing.T) { + // most cases are covered in TestReplyCost already. This ensures some edge cases + specs := map[string]struct { + srcAttrs []wasmvmtypes.EventAttribute + srcEvents wasmvmtypes.Events + expGas sdk.Gas + }{ + "empty events": { + srcEvents: make([]wasmvmtypes.Event, 1), + expGas: DefaultPerCustomEventCost, + }, + "empty attributes": { + srcAttrs: make([]wasmvmtypes.EventAttribute, 1), + expGas: DefaultPerAttributeCost, + }, + "both nil": { + expGas: 0, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + gotGas := NewDefaultWasmGasRegister().EventCosts(spec.srcAttrs, spec.srcEvents) + assert.Equal(t, spec.expGas, gotGas) + }) + } +} + +func TestToWasmVMGasConversion(t *testing.T) { + specs := map[string]struct { + src storetypes.Gas + srcConfig WasmGasRegisterConfig + exp uint64 + expPanic bool + }{ + "0": { + src: 0, + exp: 0, + srcConfig: DefaultGasRegisterConfig(), + }, + "max": { + srcConfig: WasmGasRegisterConfig{ + GasMultiplier: 1, + }, + src: math.MaxUint64, + exp: math.MaxUint64, + }, + "overflow": { + srcConfig: WasmGasRegisterConfig{ + GasMultiplier: 2, + }, + src: math.MaxUint64, + expPanic: true, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + if spec.expPanic { + assert.Panics(t, func() { + r := NewWasmGasRegister(spec.srcConfig) + _ = r.ToWasmVMGas(spec.src) + }) + return + } + r := NewWasmGasRegister(spec.srcConfig) + got := r.ToWasmVMGas(spec.src) + assert.Equal(t, spec.exp, got) + }) + } +} + +func TestFromWasmVMGasConversion(t *testing.T) { + specs := map[string]struct { + src uint64 + exp storetypes.Gas + srcConfig WasmGasRegisterConfig + expPanic bool + }{ + "0": { + src: 0, + exp: 0, + srcConfig: DefaultGasRegisterConfig(), + }, + "max": { + srcConfig: WasmGasRegisterConfig{ + GasMultiplier: 1, + }, + src: math.MaxUint64, + exp: math.MaxUint64, + }, + "missconfigured": { + srcConfig: WasmGasRegisterConfig{ + GasMultiplier: 0, + }, + src: 1, + expPanic: true, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + if spec.expPanic { + assert.Panics(t, func() { + r := NewWasmGasRegister(spec.srcConfig) + _ = r.FromWasmVMGas(spec.src) + }) + return + } + r := NewWasmGasRegister(spec.srcConfig) + got := r.FromWasmVMGas(spec.src) + assert.Equal(t, spec.exp, got) + }) + } +} + +func TestUncompressCosts(t *testing.T) { + specs := map[string]struct { + lenIn int + exp sdk.Gas + expPanic bool + }{ + "0": { + exp: 0, + }, + "even": { + lenIn: 100, + exp: 15, + }, + "round down when uneven": { + lenIn: 19, + exp: 2, + }, + "max len": { + lenIn: types.MaxWasmSize, + exp: 122880, + }, + "invalid len": { + lenIn: -1, + expPanic: true, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + if spec.expPanic { + assert.Panics(t, func() { NewDefaultWasmGasRegister().UncompressCosts(spec.lenIn) }) + return + } + got := NewDefaultWasmGasRegister().UncompressCosts(spec.lenIn) + assert.Equal(t, spec.exp, got) + }) + } +} diff --git a/x/wasm/keeper/genesis.go b/x/wasm/keeper/genesis.go index bdcf99d03f..85c4f0add5 100644 --- a/x/wasm/keeper/genesis.go +++ b/x/wasm/keeper/genesis.go @@ -1,9 +1,10 @@ package keeper import ( + abci "github.com/tendermint/tendermint/abci/types" + sdk "github.com/line/lbm-sdk/types" sdkerrors "github.com/line/lbm-sdk/types/errors" - abci "github.com/line/ostracon/abci/types" "github.com/line/wasmd/x/wasm/types" ) @@ -65,17 +66,6 @@ func InitGenesis(ctx sdk.Context, keeper *Keeper, data types.GenesisState, staki return nil, sdkerrors.Wrapf(types.ErrInvalid, "seq %s with value: %d must be greater than: %d ", string(types.KeyLastInstanceID), seqVal, maxContractID) } - for i, contractAddr := range data.InactiveContractAddresses { - inactiveContractAddr, err := sdk.AccAddressFromBech32(contractAddr) - if err != nil { - return nil, sdkerrors.Wrapf(err, "wrong contract address %s", contractAddr) - } - err = keeper.deactivateContract(ctx, inactiveContractAddr) - if err != nil { - return nil, sdkerrors.Wrapf(err, "contract number %d", i) - } - } - if len(data.GenMsgs) == 0 { return nil, nil } @@ -135,10 +125,5 @@ func ExportGenesis(ctx sdk.Context, keeper *Keeper) *types.GenesisState { }) } - keeper.IterateInactiveContracts(ctx, func(contractAddr sdk.AccAddress) (stop bool) { - genState.InactiveContractAddresses = append(genState.InactiveContractAddresses, contractAddr.String()) - return false - }) - return &genState } diff --git a/x/wasm/keeper/genesis_test.go b/x/wasm/keeper/genesis_test.go index eaad499160..4332e4969e 100644 --- a/x/wasm/keeper/genesis_test.go +++ b/x/wasm/keeper/genesis_test.go @@ -14,6 +14,9 @@ import ( fuzz "github.com/google/gofuzz" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/proto/tendermint/crypto" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" "github.com/line/lbm-sdk/store" @@ -26,13 +29,9 @@ import ( paramskeeper "github.com/line/lbm-sdk/x/params/keeper" paramtypes "github.com/line/lbm-sdk/x/params/types" stakingkeeper "github.com/line/lbm-sdk/x/staking/keeper" - abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/log" - "github.com/line/ostracon/proto/ostracon/crypto" - ocproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/wasmd/x/wasm/types" - wasmTypes "github.com/line/wasmd/x/wasm/types" ) const firstCodeID = 1 @@ -67,7 +66,7 @@ func TestGenesisExportImport(t *testing.T) { creatorAddr, err := sdk.AccAddressFromBech32(codeInfo.Creator) require.NoError(t, err) - codeID, err := contractKeeper.Create(srcCtx, creatorAddr, wasmCode, &codeInfo.InstantiateConfig) + codeID, _, err := contractKeeper.Create(srcCtx, creatorAddr, wasmCode, &codeInfo.InstantiateConfig) require.NoError(t, err) if pinned { contractKeeper.PinCode(srcCtx, codeID) @@ -82,7 +81,7 @@ func TestGenesisExportImport(t *testing.T) { } contract.CodeID = codeID - contractAddr := wasmKeeper.generateContractAddress(srcCtx, codeID) + contractAddr := wasmKeeper.ClassicAddressGenerator()(srcCtx, codeID, nil) wasmKeeper.storeContractInfo(srcCtx, contractAddr, &contract) wasmKeeper.appendToContractHistory(srcCtx, contractAddr, history...) wasmKeeper.importContractState(srcCtx, contractAddr, stateModels) @@ -110,7 +109,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 { wasmKeeper.removeFromContractCodeSecondaryIndex(srcCtx, address, wasmKeeper.getLastContractHistoryEntry(srcCtx, address)) prefixStore := prefix.NewStore(srcCtx.KVStore(wasmKeeper.storeKey), types.GetContractCodeHistoryElementPrefix(address)) iter := prefixStore.Iterator(nil, nil) @@ -157,7 +156,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 stakingMock StakingKeeperMock @@ -221,7 +220,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(), @@ -269,8 +268,8 @@ func TestGenesisInit(t *testing.T) { }}, Contracts: []types.Contract{ { - ContractAddress: BuildContractAddress(1, 1).String(), - ContractInfo: types.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, types.OnlyGenesisFields), + ContractAddress: BuildContractAddressClassic(1, 1).String(), + ContractInfo: types.ContractInfoFixture(func(c *types.ContractInfo) { c.CodeID = 1 }, types.OnlyGenesisFields), }, }, Sequences: []types.Sequence{ @@ -290,11 +289,11 @@ func TestGenesisInit(t *testing.T) { }}, Contracts: []types.Contract{ { - ContractAddress: BuildContractAddress(1, 1).String(), - ContractInfo: types.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, types.OnlyGenesisFields), + ContractAddress: BuildContractAddressClassic(1, 1).String(), + ContractInfo: types.ContractInfoFixture(func(c *types.ContractInfo) { c.CodeID = 1 }, types.OnlyGenesisFields), }, { - ContractAddress: BuildContractAddress(1, 2).String(), - ContractInfo: types.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, types.OnlyGenesisFields), + ContractAddress: BuildContractAddressClassic(1, 2).String(), + ContractInfo: types.ContractInfoFixture(func(c *types.ContractInfo) { c.CodeID = 1 }, types.OnlyGenesisFields), }, }, Sequences: []types.Sequence{ @@ -309,8 +308,8 @@ func TestGenesisInit(t *testing.T) { src: types.GenesisState{ Contracts: []types.Contract{ { - ContractAddress: BuildContractAddress(1, 1).String(), - ContractInfo: types.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, types.OnlyGenesisFields), + ContractAddress: BuildContractAddressClassic(1, 1).String(), + ContractInfo: types.ContractInfoFixture(func(c *types.ContractInfo) { c.CodeID = 1 }, types.OnlyGenesisFields), }, }, Params: types.DefaultParams(), @@ -325,11 +324,11 @@ func TestGenesisInit(t *testing.T) { }}, Contracts: []types.Contract{ { - ContractAddress: BuildContractAddress(1, 1).String(), - ContractInfo: types.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, types.OnlyGenesisFields), + ContractAddress: BuildContractAddressClassic(1, 1).String(), + ContractInfo: types.ContractInfoFixture(func(c *types.ContractInfo) { c.CodeID = 1 }, types.OnlyGenesisFields), }, { - ContractAddress: BuildContractAddress(1, 1).String(), - ContractInfo: types.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, types.OnlyGenesisFields), + ContractAddress: BuildContractAddressClassic(1, 1).String(), + ContractInfo: types.ContractInfoFixture(func(c *types.ContractInfo) { c.CodeID = 1 }, types.OnlyGenesisFields), }, }, Params: types.DefaultParams(), @@ -344,8 +343,8 @@ func TestGenesisInit(t *testing.T) { }}, Contracts: []types.Contract{ { - ContractAddress: BuildContractAddress(1, 1).String(), - ContractInfo: types.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, types.OnlyGenesisFields), + ContractAddress: BuildContractAddressClassic(1, 1).String(), + ContractInfo: types.ContractInfoFixture(func(c *types.ContractInfo) { c.CodeID = 1 }, types.OnlyGenesisFields), ContractState: []types.Model{ { Key: []byte{0x1}, @@ -392,8 +391,8 @@ func TestGenesisInit(t *testing.T) { }}, Contracts: []types.Contract{ { - ContractAddress: BuildContractAddress(1, 1).String(), - ContractInfo: types.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, types.OnlyGenesisFields), + ContractAddress: BuildContractAddressClassic(1, 1).String(), + ContractInfo: types.ContractInfoFixture(func(c *types.ContractInfo) { c.CodeID = 1 }, types.OnlyGenesisFields), }, }, Sequences: []types.Sequence{ @@ -413,8 +412,10 @@ func TestGenesisInit(t *testing.T) { Params: types.DefaultParams(), }, stakingMock: StakingKeeperMock{expCalls: 1, validatorUpdate: []abci.ValidatorUpdate{ - {PubKey: crypto.PublicKey{Sum: &crypto.PublicKey_Ed25519{ - Ed25519: []byte("a valid key")}}, + { + PubKey: crypto.PublicKey{Sum: &crypto.PublicKey_Ed25519{ + Ed25519: []byte("a valid key"), + }}, Power: 100, }, }}, @@ -462,10 +463,7 @@ func TestImportContractWithCodeHistoryReset(t *testing.T) { "code_upload_access": { "permission": "Everybody" }, - "instantiate_default_permission": "Everybody", - "gas_multiplier": 100, - "instance_cost": 40000, - "compile_cost": 2 + "instantiate_default_permission": "Everybody" }, "codes": [ { @@ -530,7 +528,7 @@ func TestImportContractWithCodeHistoryReset(t *testing.T) { expCodeInfo := types.CodeInfo{ CodeHash: wasmCodeHash[:], Creator: codeCreatorAddr, - InstantiateConfig: wasmTypes.AccessConfig{ + InstantiateConfig: types.AccessConfig{ Permission: types.AccessTypeOnlyAddress, Address: codeCreatorAddr, }, @@ -603,7 +601,7 @@ func TestSupportedGenMsgTypes(t *testing.T) { Sum: &types.GenesisState_GenMsgs_ExecuteContract{ ExecuteContract: &types.MsgExecuteContract{ Sender: verifierAddress.String(), - Contract: BuildContractAddress(1, 1).String(), + Contract: BuildContractAddressClassic(1, 1).String(), Msg: []byte(`{"release":{}}`), }, }, @@ -628,7 +626,7 @@ func TestSupportedGenMsgTypes(t *testing.T) { require.NotNil(t, codeInfo) // verify contract instantiated - cInfo := keeper.GetContractInfo(ctx, BuildContractAddress(1, 1)) + cInfo := keeper.GetContractInfo(ctx, BuildContractAddressClassic(1, 1)) require.NotNil(t, cInfo) // verify contract executed @@ -643,17 +641,18 @@ func setupKeeper(t *testing.T) (*Keeper, sdk.Context, []sdk.StoreKey) { t.Cleanup(func() { os.RemoveAll(tempDir) }) var ( keyParams = sdk.NewKVStoreKey(paramtypes.StoreKey) - tkeyParams = sdk.NewKVStoreKey(paramtypes.TStoreKey) - keyWasm = sdk.NewKVStoreKey(wasmTypes.StoreKey) + tkeyParams = sdk.NewTransientStoreKey(paramtypes.TStoreKey) + 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) require.NoError(t, ms.LoadLatestVersion()) - ctx := sdk.NewContext(ms, ocproto.Header{ + ctx := sdk.NewContext(ms, tmproto.Header{ Height: 1234567, Time: time.Date(2020, time.April, 22, 12, 0, 0, 0, time.UTC), }, false, log.NewNopLogger()) @@ -667,10 +666,28 @@ func setupKeeper(t *testing.T) (*Keeper, sdk.Context, []sdk.StoreKey) { // also registering gov interfaces for nested Any type govtypes.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), authkeeper.AccountKeeper{}, bankpluskeeper.BaseKeeper{}, stakingkeeper.Keeper{}, distributionkeeper.Keeper{}, nil, nil, nil, nil, nil, nil, tempDir, wasmConfig, SupportedFeatures, nil, nil) + srcKeeper := NewKeeper( + encodingConfig.Marshaler, + keyWasm, + pk.Subspace(types.ModuleName), + authkeeper.AccountKeeper{}, + &bankpluskeeper.BaseKeeper{}, + stakingkeeper.Keeper{}, + distributionkeeper.Keeper{}, + nil, + nil, + nil, + nil, + nil, + nil, + tempDir, + wasmConfig, + AvailableCapabilities, + &mockpluskeeper{}, + ) return &srcKeeper, ctx, []sdk.StoreKey{keyWasm, keyParams} } diff --git a/x/wasm/keeper/handler_plugin.go b/x/wasm/keeper/handler_plugin.go index 944e0fdc41..c37c4a394d 100644 --- a/x/wasm/keeper/handler_plugin.go +++ b/x/wasm/keeper/handler_plugin.go @@ -4,12 +4,12 @@ import ( "errors" "fmt" + channeltypes "github.com/line/ibc-go/v3/modules/core/04-channel/types" + host "github.com/line/ibc-go/v3/modules/core/24-host" "github.com/line/lbm-sdk/baseapp" codectypes "github.com/line/lbm-sdk/codec/types" sdk "github.com/line/lbm-sdk/types" sdkerrors "github.com/line/lbm-sdk/types/errors" - channeltypes "github.com/line/lbm-sdk/x/ibc/core/04-channel/types" - host "github.com/line/lbm-sdk/x/ibc/core/24-host" wasmvmtypes "github.com/line/wasmvm/types" "github.com/line/wasmd/x/wasm/types" diff --git a/x/wasm/keeper/handler_plugin_encoders.go b/x/wasm/keeper/handler_plugin_encoders.go index d1e5612d05..6acf2432c6 100644 --- a/x/wasm/keeper/handler_plugin_encoders.go +++ b/x/wasm/keeper/handler_plugin_encoders.go @@ -4,15 +4,15 @@ import ( "encoding/json" "fmt" + ibctransfertypes "github.com/line/ibc-go/v3/modules/apps/transfer/types" + ibcclienttypes "github.com/line/ibc-go/v3/modules/core/02-client/types" + channeltypes "github.com/line/ibc-go/v3/modules/core/04-channel/types" codectypes "github.com/line/lbm-sdk/codec/types" sdk "github.com/line/lbm-sdk/types" sdkerrors "github.com/line/lbm-sdk/types/errors" banktypes "github.com/line/lbm-sdk/x/bank/types" distributiontypes "github.com/line/lbm-sdk/x/distribution/types" govtypes "github.com/line/lbm-sdk/x/gov/types" - ibctransfertypes "github.com/line/lbm-sdk/x/ibc/applications/transfer/types" - ibcclienttypes "github.com/line/lbm-sdk/x/ibc/core/02-client/types" - channeltypes "github.com/line/lbm-sdk/x/ibc/core/04-channel/types" stakingtypes "github.com/line/lbm-sdk/x/staking/types" wasmvmtypes "github.com/line/wasmvm/types" diff --git a/x/wasm/keeper/handler_plugin_encoders_test.go b/x/wasm/keeper/handler_plugin_encoders_test.go index 0ae62d8647..43ba932145 100644 --- a/x/wasm/keeper/handler_plugin_encoders_test.go +++ b/x/wasm/keeper/handler_plugin_encoders_test.go @@ -7,14 +7,14 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + ibctransfertypes "github.com/line/ibc-go/v3/modules/apps/transfer/types" + clienttypes "github.com/line/ibc-go/v3/modules/core/02-client/types" + channeltypes "github.com/line/ibc-go/v3/modules/core/04-channel/types" codectypes "github.com/line/lbm-sdk/codec/types" sdk "github.com/line/lbm-sdk/types" banktypes "github.com/line/lbm-sdk/x/bank/types" distributiontypes "github.com/line/lbm-sdk/x/distribution/types" govtypes "github.com/line/lbm-sdk/x/gov/types" - ibctransfertypes "github.com/line/lbm-sdk/x/ibc/applications/transfer/types" - clienttypes "github.com/line/lbm-sdk/x/ibc/core/02-client/types" - channeltypes "github.com/line/lbm-sdk/x/ibc/core/04-channel/types" stakingtypes "github.com/line/lbm-sdk/x/staking/types" wasmvmtypes "github.com/line/wasmvm/types" @@ -374,7 +374,7 @@ func TestEncoding(t *testing.T) { sender: addr2, srcMsg: wasmvmtypes.CosmosMsg{ Stargate: &wasmvmtypes.StargateMsg{ - TypeURL: "/lbm.bank.invalidversion.MsgSend", + TypeURL: "/cosmos.bank.v2.MsgSend", Value: bankMsgBin, }, }, @@ -634,5 +634,4 @@ func TestConvertWasmCoinToSdkCoin(t *testing.T) { assert.Equal(t, spec.expVal, gotVal) }) } - } diff --git a/x/wasm/keeper/handler_plugin_test.go b/x/wasm/keeper/handler_plugin_test.go index 02fa9fc1ed..15d4736fb0 100644 --- a/x/wasm/keeper/handler_plugin_test.go +++ b/x/wasm/keeper/handler_plugin_test.go @@ -7,14 +7,14 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + clienttypes "github.com/line/ibc-go/v3/modules/core/02-client/types" + channeltypes "github.com/line/ibc-go/v3/modules/core/04-channel/types" + ibcexported "github.com/line/ibc-go/v3/modules/core/exported" "github.com/line/lbm-sdk/baseapp" sdk "github.com/line/lbm-sdk/types" sdkerrors "github.com/line/lbm-sdk/types/errors" banktypes "github.com/line/lbm-sdk/x/bank/types" capabilitytypes "github.com/line/lbm-sdk/x/capability/types" - clienttypes "github.com/line/lbm-sdk/x/ibc/core/02-client/types" - channeltypes "github.com/line/lbm-sdk/x/ibc/core/04-channel/types" - ibcexported "github.com/line/lbm-sdk/x/ibc/core/exported" wasmvm "github.com/line/wasmvm" wasmvmtypes "github.com/line/wasmvm/types" @@ -28,13 +28,15 @@ func TestMessageHandlerChainDispatch(t *testing.T) { alwaysUnknownMsgHandler := &wasmtesting.MockMessageHandler{ DispatchMsgFn: func(ctx sdk.Context, contractAddr sdk.AccAddress, contractIBCPortID string, msg wasmvmtypes.CosmosMsg) (events []sdk.Event, data [][]byte, err error) { return nil, nil, types.ErrUnknownMsg - }} + }, + } assertNotCalledHandler := &wasmtesting.MockMessageHandler{ DispatchMsgFn: func(ctx sdk.Context, contractAddr sdk.AccAddress, contractIBCPortID string, msg wasmvmtypes.CosmosMsg) (events []sdk.Event, data [][]byte, err error) { t.Fatal("not expected to be called") return - }} + }, + } myMsg := wasmvmtypes.CosmosMsg{Custom: []byte(`{}`)} specs := map[string]struct { @@ -55,15 +57,18 @@ func TestMessageHandlerChainDispatch(t *testing.T) { handlers: []Messenger{&wasmtesting.MockMessageHandler{ DispatchMsgFn: func(ctx sdk.Context, contractAddr sdk.AccAddress, contractIBCPortID string, msg wasmvmtypes.CosmosMsg) (events []sdk.Event, data [][]byte, err error) { return nil, nil, types.ErrInvalidMsg - }}, assertNotCalledHandler}, + }, + }, assertNotCalledHandler}, expErr: types.ErrInvalidMsg, }, "return events when handle": { - handlers: []Messenger{&wasmtesting.MockMessageHandler{ - DispatchMsgFn: func(ctx sdk.Context, contractAddr sdk.AccAddress, contractIBCPortID string, msg wasmvmtypes.CosmosMsg) (events []sdk.Event, data [][]byte, err error) { - _, data, _ = capturingHandler.DispatchMsg(ctx, contractAddr, contractIBCPortID, msg) - return []sdk.Event{sdk.NewEvent("myEvent", sdk.NewAttribute("foo", "bar"))}, data, nil - }}, + handlers: []Messenger{ + &wasmtesting.MockMessageHandler{ + DispatchMsgFn: func(ctx sdk.Context, contractAddr sdk.AccAddress, contractIBCPortID string, msg wasmvmtypes.CosmosMsg) (events []sdk.Event, data [][]byte, err error) { + _, data, _ = capturingHandler.DispatchMsg(ctx, contractAddr, contractIBCPortID, msg) + return []sdk.Event{sdk.NewEvent("myEvent", sdk.NewAttribute("foo", "bar"))}, data, nil + }, + }, }, expEvents: []sdk.Event{sdk.NewEvent("myEvent", sdk.NewAttribute("foo", "bar"))}, }, @@ -232,7 +237,8 @@ func TestIBCRawPacketHandler(t *testing.T) { Counterparty: channeltypes.NewCounterparty( "other-port", "other-channel-1", - )}, true + ), + }, true }, SendPacketFn: func(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet ibcexported.PacketI) error { capturedPacket = packet @@ -279,7 +285,8 @@ func TestIBCRawPacketHandler(t *testing.T) { chanKeeper: &wasmtesting.MockChannelKeeper{ GetNextSequenceSendFn: func(ctx sdk.Context, portID, channelID string) (uint64, bool) { return 0, false - }}, + }, + }, expErr: channeltypes.ErrSequenceSendNotFound, }, "capability not found returns error": { @@ -292,7 +299,8 @@ func TestIBCRawPacketHandler(t *testing.T) { capKeeper: wasmtesting.MockCapabilityKeeper{ GetCapabilityFn: func(ctx sdk.Context, name string) (*capabilitytypes.Capability, bool) { return nil, false - }}, + }, + }, expErr: channeltypes.ErrChannelCapabilityNotFound, }, } @@ -320,7 +328,7 @@ func TestBurnCoinMessageHandlerIntegration(t *testing.T) { // picks the message in the default handler chain ctx, keepers := CreateDefaultTestInput(t) // set some supply - keepers.Faucet.NewFundedAccount(ctx, sdk.NewCoin("denom", sdk.NewInt(10_000_000))) + keepers.Faucet.NewFundedRandomAccount(ctx, sdk.NewCoin("denom", sdk.NewInt(10_000_000))) k := keepers.WasmKeeper example := InstantiateHackatomExampleContract(t, ctx, keepers) // with deposit of 100 stake @@ -373,9 +381,10 @@ func TestBurnCoinMessageHandlerIntegration(t *testing.T) { t.Run(name, func(t *testing.T) { ctx, _ = parentCtx.CacheContext() k.wasmVM = &wasmtesting.MockWasmer{ExecuteFn: func(codeID 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) { - return &wasmvmtypes.Response{Messages: []wasmvmtypes.SubMsg{ - {Msg: wasmvmtypes.CosmosMsg{Bank: &wasmvmtypes.BankMsg{Burn: &spec.msg}}, ReplyOn: wasmvmtypes.ReplyNever}, - }, + return &wasmvmtypes.Response{ + Messages: []wasmvmtypes.SubMsg{ + {Msg: wasmvmtypes.CosmosMsg{Bank: &wasmvmtypes.BankMsg{Burn: &spec.msg}}, ReplyOn: wasmvmtypes.ReplyNever}, + }, }, 0, nil }} diff --git a/x/wasm/keeper/ibc.go b/x/wasm/keeper/ibc.go index a2c81479aa..a8be4e5e43 100644 --- a/x/wasm/keeper/ibc.go +++ b/x/wasm/keeper/ibc.go @@ -3,10 +3,10 @@ package keeper import ( "strings" + host "github.com/line/ibc-go/v3/modules/core/24-host" sdk "github.com/line/lbm-sdk/types" sdkerrors "github.com/line/lbm-sdk/types/errors" capabilitytypes "github.com/line/lbm-sdk/x/capability/types" - host "github.com/line/lbm-sdk/x/ibc/core/24-host" "github.com/line/wasmd/x/wasm/types" ) diff --git a/x/wasm/keeper/ibc_test.go b/x/wasm/keeper/ibc_test.go index db20c36e2b..28f01f7868 100644 --- a/x/wasm/keeper/ibc_test.go +++ b/x/wasm/keeper/ibc_test.go @@ -11,14 +11,14 @@ import ( ) func TestDontBindPortNonIBCContract(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) example := InstantiateHackatomExampleContract(t, ctx, keepers) // ensure we bound the port _, _, err := keepers.IBCKeeper.PortKeeper.LookupModuleByPort(ctx, keepers.WasmKeeper.GetContractInfo(ctx, example.Contract).IBCPortID) require.Error(t, err) } func TestBindingPortForIBCContractOnInstantiate(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) example := InstantiateIBCReflectContract(t, ctx, keepers) // ensure we bound the port owner, _, err := keepers.IBCKeeper.PortKeeper.LookupModuleByPort(ctx, keepers.WasmKeeper.GetContractInfo(ctx, example.Contract).IBCPortID) require.NoError(t, err) @@ -41,7 +41,7 @@ func TestBindingPortForIBCContractOnInstantiate(t *testing.T) { } func TestContractFromPortID(t *testing.T) { - contractAddr := BuildContractAddress(1, 100) + contractAddr := BuildContractAddressClassic(1, 100) specs := map[string]struct { srcPort string expAddr sdk.AccAddress diff --git a/x/wasm/keeper/keeper.go b/x/wasm/keeper/keeper.go index 30a063c8f3..4dfafd2717 100644 --- a/x/wasm/keeper/keeper.go +++ b/x/wasm/keeper/keeper.go @@ -4,21 +4,21 @@ import ( "bytes" "context" "encoding/binary" + "encoding/hex" "fmt" "math" "path/filepath" + "reflect" "strconv" "strings" "time" "github.com/line/lbm-sdk/codec" "github.com/line/lbm-sdk/store/prefix" - storetypes "github.com/line/lbm-sdk/store/types" sdk "github.com/line/lbm-sdk/types" - "github.com/line/lbm-sdk/types/address" sdkerrors "github.com/line/lbm-sdk/types/errors" - authkeeper "github.com/line/lbm-sdk/x/auth/keeper" - bankpluskeeper "github.com/line/lbm-sdk/x/bankplus/keeper" + authtypes "github.com/line/lbm-sdk/x/auth/types" + vestingexported "github.com/line/lbm-sdk/x/auth/vesting/exported" paramtypes "github.com/line/lbm-sdk/x/params/types" "github.com/line/ostracon/libs/log" wasmvm "github.com/line/wasmvm" @@ -53,8 +53,15 @@ type WasmVMQueryHandler interface { type CoinTransferrer interface { // TransferCoins sends the coin amounts from the source to the destination with rules applied. TransferCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error - AddToInactiveAddr(ctx sdk.Context, address sdk.AccAddress) - DeleteFromInactiveAddr(ctx sdk.Context, address sdk.AccAddress) +} + +// AccountPruner handles the balances and data cleanup for accounts that are pruned on contract instantiate. +// This is an extension point to attach custom logic +type AccountPruner interface { + // CleanupExistingAccount handles the cleanup process for balances and data of the given account. The persisted account + // type is already reset to base account at this stage. + // The method returns true when the account address can be reused. Unsupported account types are rejected by returning false + CleanupExistingAccount(ctx sdk.Context, existingAccount authtypes.AccountI) (handled bool, err error) } // WasmVMResponseHandler is an extension point to handles the response data returned by a contract call. @@ -69,6 +76,12 @@ type WasmVMResponseHandler interface { ) ([]byte, error) } +// list of account types that are accepted for wasm contracts. Chains importing wasmd +// can overwrite this list with the WithAcceptedAccountTypesOnContractInstantiation option. +var defaultAcceptedAccountTypes = map[reflect.Type]struct{}{ + reflect.TypeOf(&authtypes.BaseAccount{}): {}, +} + // Keeper will have a reference to Wasmer with it's own data directory. type Keeper struct { storeKey sdk.StoreKey @@ -83,10 +96,13 @@ type Keeper struct { messenger Messenger metrics *Metrics // queryGasLimit is the max wasmvm gas that can be spent on executing a query with a contract - queryGasLimit uint64 - paramSpace paramtypes.Subspace - gasRegister WasmGasRegister - maxQueryStackSize uint32 + queryGasLimit uint64 + paramSpace paramtypes.Subspace + gasRegister GasRegister + maxQueryStackSize uint32 + acceptedAccountTypes map[reflect.Type]struct{} + accountPruner AccountPruner + pluskeeper PlusKeeper } // NewKeeper creates a new contract Keeper instance @@ -95,7 +111,7 @@ func NewKeeper( cdc codec.Codec, storeKey sdk.StoreKey, paramSpace paramtypes.Subspace, - accountKeeper authkeeper.AccountKeeper, + accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, stakingKeeper types.StakingKeeper, distKeeper types.DistributionKeeper, @@ -107,12 +123,11 @@ func NewKeeper( queryRouter GRPCQueryRouter, homeDir string, wasmConfig types.WasmConfig, - supportedFeatures string, - customEncoders *MessageEncoders, - customPlugins *QueryPlugins, + availableCapabilities string, + pluskeeper PlusKeeper, opts ...Option, ) Keeper { - wasmer, err := wasmvm.NewVM(filepath.Join(homeDir, "wasm"), supportedFeatures, contractMemoryLimit, wasmConfig.ContractDebugMode, wasmConfig.MemoryCacheSize) + wasmer, err := wasmvm.NewVM(filepath.Join(homeDir, "wasm"), availableCapabilities, contractMemoryLimit, wasmConfig.ContractDebugMode, wasmConfig.MemoryCacheSize) if err != nil { panic(err) } @@ -122,21 +137,24 @@ func NewKeeper( } keeper := &Keeper{ - storeKey: storeKey, - cdc: cdc, - wasmVM: wasmer, - accountKeeper: accountKeeper, - bank: NewBankCoinTransferrer(bankKeeper), - portKeeper: portKeeper, - capabilityKeeper: capabilityKeeper, - messenger: NewDefaultMessageHandler(router, channelKeeper, capabilityKeeper, bankKeeper, cdc, portSource, customEncoders), - queryGasLimit: wasmConfig.SmartQueryGasLimit, - paramSpace: paramSpace, - metrics: NopMetrics(), - gasRegister: NewDefaultWasmGasRegister(), - maxQueryStackSize: types.DefaultMaxQueryStackSize, - } - keeper.wasmVMQueryHandler = DefaultQueryPlugins(bankKeeper, stakingKeeper, distKeeper, channelKeeper, queryRouter, keeper).Merge(customPlugins) + storeKey: storeKey, + cdc: cdc, + wasmVM: wasmer, + accountKeeper: accountKeeper, + bank: NewBankCoinTransferrer(bankKeeper), + accountPruner: NewVestingCoinBurner(bankKeeper), + portKeeper: portKeeper, + capabilityKeeper: capabilityKeeper, + messenger: NewDefaultMessageHandler(router, channelKeeper, capabilityKeeper, bankKeeper, cdc, portSource), + queryGasLimit: wasmConfig.SmartQueryGasLimit, + paramSpace: paramSpace, + metrics: NopMetrics(), + gasRegister: NewDefaultWasmGasRegister(), + maxQueryStackSize: types.DefaultMaxQueryStackSize, + acceptedAccountTypes: defaultAcceptedAccountTypes, + pluskeeper: pluskeeper, + } + keeper.wasmVMQueryHandler = DefaultQueryPlugins(bankKeeper, stakingKeeper, distKeeper, channelKeeper, queryRouter, keeper) for _, o := range opts { o.apply(keeper) } @@ -157,66 +175,6 @@ func (k Keeper) getInstantiateAccessConfig(ctx sdk.Context) types.AccessType { return a } -func (k Keeper) getGasMultiplier(ctx sdk.Context) GasMultiplier { - var a uint64 - k.paramSpace.Get(ctx, types.ParamStoreKeyGasMultiplier, &a) - return NewGasMultiplier(a) -} - -func (k Keeper) getInstanceCost(ctx sdk.Context) uint64 { - var a uint64 - k.paramSpace.Get(ctx, types.ParamStoreKeyInstanceCost, &a) - return a -} - -// NewContractInstanceCosts costs to crate a new contract instance from code -func (k Keeper) newContractInstanceCosts(g WasmGasRegister, ctx sdk.Context, pinned bool, msgLen int) storetypes.Gas { - return k.instantiateContractCosts(g, ctx, pinned, msgLen) -} - -// InstantiateContractCosts costs when interacting with a wasm contract -func (k Keeper) instantiateContractCosts(g WasmGasRegister, ctx sdk.Context, pinned bool, msgLen int) sdk.Gas { - if msgLen < 0 { - panic(sdkerrors.Wrap(types.ErrInvalid, "negative length")) - } - dataCosts := sdk.Gas(msgLen) * g.c.ContractMessageDataCost - if pinned { - return dataCosts - } - return k.getInstanceCost(ctx) + dataCosts -} - -// ReplyCosts costs to to handle a message reply -func (k Keeper) replyCosts(g WasmGasRegister, ctx sdk.Context, pinned bool, reply wasmvmtypes.Reply) sdk.Gas { - var eventGas sdk.Gas - msgLen := len(reply.Result.Err) - if reply.Result.Ok != nil { - msgLen += len(reply.Result.Ok.Data) - var attrs []wasmvmtypes.EventAttribute - for _, e := range reply.Result.Ok.Events { - eventGas += sdk.Gas(len(e.Type)) * g.c.EventAttributeDataCost - attrs = append(attrs, e.Attributes...) - } - // apply free tier on the whole set not per event - eventGas += g.EventCosts(attrs, nil) - } - return eventGas + k.instantiateContractCosts(g, ctx, pinned, msgLen) -} - -func (k Keeper) getCompileCost(ctx sdk.Context) uint64 { - var a uint64 - k.paramSpace.Get(ctx, types.ParamStoreKeyCompileCost, &a) - return a -} - -// CompileCosts costs to persist and "compile" a new wasm contract -func (k Keeper) compileCosts(ctx sdk.Context, byteLength int) storetypes.Gas { - if byteLength < 0 { - panic(sdkerrors.Wrap(types.ErrInvalid, "negative length")) - } - return k.getCompileCost(ctx) * uint64(byteLength) -} - // GetParams returns the total set of wasm parameters. func (k Keeper) GetParams(ctx sdk.Context) types.Params { var params types.Params @@ -228,13 +186,13 @@ func (k Keeper) SetParams(ctx sdk.Context, ps types.Params) { k.paramSpace.SetParamSet(ctx, &ps) } -func (k Keeper) create(ctx sdk.Context, creator sdk.AccAddress, wasmCode []byte, instantiateAccess *types.AccessConfig, authZ AuthorizationPolicy) (codeID uint64, err error) { +func (k Keeper) create(ctx sdk.Context, creator sdk.AccAddress, wasmCode []byte, instantiateAccess *types.AccessConfig, authZ AuthorizationPolicy) (codeID uint64, checksum []byte, err error) { if creator == nil { - return 0, sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "cannot be empty") + return 0, checksum, sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "cannot be nil") } if !authZ.CanCreateCode(k.getUploadAccessConfig(ctx), creator) { - return 0, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "can not create code") + return 0, checksum, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "can not create code") } // figure out proper instantiate access defaultAccessConfig := k.getInstantiateAccessConfig(ctx).With(creator) @@ -242,38 +200,42 @@ func (k Keeper) create(ctx sdk.Context, creator sdk.AccAddress, wasmCode []byte, instantiateAccess = &defaultAccessConfig } else if !instantiateAccess.IsSubset(defaultAccessConfig) { // we enforce this must be subset of default upload access - return 0, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "instantiate access must be subset of default upload access") + return 0, checksum, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "instantiate access must be subset of default upload access") } - wasmCode, err = ioutils.Uncompress(wasmCode, uint64(types.MaxWasmSize)) - if err != nil { - return 0, sdkerrors.Wrap(types.ErrCreateFailed, err.Error()) + if ioutils.IsGzip(wasmCode) { + ctx.GasMeter().ConsumeGas(k.gasRegister.UncompressCosts(len(wasmCode)), "Uncompress gzip bytecode") + wasmCode, err = ioutils.Uncompress(wasmCode, uint64(types.MaxWasmSize)) + if err != nil { + return 0, checksum, sdkerrors.Wrap(types.ErrCreateFailed, err.Error()) + } } - ctx.GasMeter().ConsumeGas(k.compileCosts(ctx, len(wasmCode)), "Compiling WASM Bytecode") - checksum, err := k.wasmVM.Create(wasmCode) + ctx.GasMeter().ConsumeGas(k.gasRegister.CompileCosts(len(wasmCode)), "Compiling wasm bytecode") + checksum, err = k.wasmVM.Create(wasmCode) if err != nil { - return 0, sdkerrors.Wrap(types.ErrCreateFailed, err.Error()) + return 0, checksum, sdkerrors.Wrap(types.ErrCreateFailed, err.Error()) } report, err := k.wasmVM.AnalyzeCode(checksum) if err != nil { - return 0, sdkerrors.Wrap(types.ErrCreateFailed, err.Error()) + return 0, checksum, sdkerrors.Wrap(types.ErrCreateFailed, err.Error()) } codeID = k.autoIncrementID(ctx, types.KeyLastCodeID) - k.Logger(ctx).Debug("storing new contract", "features", report.RequiredFeatures, "code_id", codeID) + k.Logger(ctx).Debug("storing new contract", "capabilities", report.RequiredCapabilities, "code_id", codeID) codeInfo := types.NewCodeInfo(checksum, creator, *instantiateAccess) k.storeCodeInfo(ctx, codeID, codeInfo) evt := sdk.NewEvent( types.EventTypeStoreCode, - sdk.NewAttribute(types.AttributeKeyCodeID, strconv.FormatUint(codeID, 10)), + sdk.NewAttribute(types.AttributeKeyChecksum, hex.EncodeToString(checksum)), + sdk.NewAttribute(types.AttributeKeyCodeID, strconv.FormatUint(codeID, 10)), // last element to be compatible with scripts ) - for _, f := range strings.Split(report.RequiredFeatures, ",") { - evt.AppendAttributes(sdk.NewAttribute(types.AttributeKeyFeature, strings.TrimSpace(f))) + for _, f := range strings.Split(report.RequiredCapabilities, ",") { + evt.AppendAttributes(sdk.NewAttribute(types.AttributeKeyRequiredCapability, strings.TrimSpace(f))) } ctx.EventManager().EmitEvent(evt) - return codeID, nil + return codeID, checksum, nil } func (k Keeper) storeCodeInfo(ctx sdk.Context, codeID uint64, codeInfo types.CodeInfo) { @@ -283,9 +245,12 @@ func (k Keeper) storeCodeInfo(ctx sdk.Context, codeID uint64, codeInfo types.Cod } func (k Keeper) importCode(ctx sdk.Context, codeID uint64, codeInfo types.CodeInfo, wasmCode []byte) error { - wasmCode, err := ioutils.Uncompress(wasmCode, uint64(types.MaxWasmSize)) - if err != nil { - return sdkerrors.Wrap(types.ErrCreateFailed, err.Error()) + if ioutils.IsGzip(wasmCode) { + var err error + wasmCode, err = ioutils.Uncompress(wasmCode, uint64(types.MaxWasmSize)) + if err != nil { + return sdkerrors.Wrap(types.ErrCreateFailed, err.Error()) + } } newCodeHash, err := k.wasmVM.Create(wasmCode) if err != nil { @@ -305,42 +270,75 @@ func (k Keeper) importCode(ctx sdk.Context, codeID uint64, codeInfo types.CodeIn return nil } -func (k Keeper) instantiate(ctx sdk.Context, codeID uint64, creator, admin sdk.AccAddress, initMsg []byte, label string, deposit sdk.Coins, authZ AuthorizationPolicy) (sdk.AccAddress, []byte, error) { +func (k Keeper) instantiate( + ctx sdk.Context, + codeID uint64, + creator, admin sdk.AccAddress, + initMsg []byte, + label string, + deposit sdk.Coins, + addressGenerator AddressGenerator, + authPolicy AuthorizationPolicy, +) (sdk.AccAddress, []byte, error) { defer func(begin time.Time) { k.metrics.InstantiateElapsedTimes.Observe(time.Since(begin).Seconds()) }(time.Now()) - instanceCosts := k.newContractInstanceCosts(k.gasRegister, ctx, k.IsPinnedCode(ctx, codeID), len(initMsg)) + if creator == nil { + return nil, nil, types.ErrEmpty.Wrap("creator") + } + instanceCosts := k.gasRegister.NewContractInstanceCosts(k.IsPinnedCode(ctx, codeID), len(initMsg)) ctx.GasMeter().ConsumeGas(instanceCosts, "Loading CosmWasm module: instantiate") - // create contract address - contractAddress := k.generateContractAddress(ctx, codeID) - existingAcct := k.accountKeeper.GetAccount(ctx, contractAddress) - if existingAcct != nil { - return nil, nil, sdkerrors.Wrap(types.ErrAccountExists, existingAcct.GetAddress().String()) + // get contact info + codeInfo := k.GetCodeInfo(ctx, codeID) + if codeInfo == nil { + return nil, nil, sdkerrors.Wrap(types.ErrNotFound, "code") + } + if !authPolicy.CanInstantiateContract(codeInfo.InstantiateConfig, creator) { + return nil, nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "can not instantiate") } - // deposit initial contract funds - if !deposit.IsZero() { - if err := k.bank.TransferCoins(ctx, creator, contractAddress, deposit); err != nil { - return nil, nil, err + contractAddress := addressGenerator(ctx, codeID, codeInfo.CodeHash) + if k.HasContractInfo(ctx, contractAddress) { + return nil, nil, types.ErrDuplicate.Wrap("instance with this code id, sender and label exists: try a different label") + } + + // check account + // every cosmos module can define custom account types when needed. The cosmos-sdk comes with extension points + // to support this and a set of base and vesting account types that we integrated in our default lists. + // But not all account types of other modules are known or may make sense for contracts, therefore we kept this + // decision logic also very flexible and extendable. We provide new options to overwrite the default settings via WithAcceptedAccountTypesOnContractInstantiation and + // WithPruneAccountTypesOnContractInstantiation as constructor arguments + existingAcct := k.accountKeeper.GetAccount(ctx, contractAddress) + if existingAcct != nil { + if existingAcct.GetSequence() != 0 || existingAcct.GetPubKey() != nil { + return nil, nil, types.ErrAccountExists.Wrap("address is claimed by external account") + } + if _, accept := k.acceptedAccountTypes[reflect.TypeOf(existingAcct)]; accept { + // keep account and balance as it is + k.Logger(ctx).Info("instantiate contract with existing account", "address", contractAddress.String()) + } else { + // consider an account in the wasmd namespace spam and overwrite it. + k.Logger(ctx).Info("pruning existing account for contract instantiation", "address", contractAddress.String()) + contractAccount := k.accountKeeper.NewAccountWithAddress(ctx, contractAddress) + k.accountKeeper.SetAccount(ctx, contractAccount) + // also handle balance to not open cases where these accounts are abused and become liquid + switch handled, err := k.accountPruner.CleanupExistingAccount(ctx, existingAcct); { + case err != nil: + return nil, nil, sdkerrors.Wrap(err, "prune balance") + case !handled: + return nil, nil, types.ErrAccountExists.Wrap("address is claimed by external account") + } } } else { // create an empty account (so we don't have issues later) - // TODO: can we remove this? contractAccount := k.accountKeeper.NewAccountWithAddress(ctx, contractAddress) k.accountKeeper.SetAccount(ctx, contractAccount) } - - // get contact info - store := ctx.KVStore(k.storeKey) - bz := store.Get(types.GetCodeKey(codeID)) - if bz == nil { - return nil, nil, sdkerrors.Wrap(types.ErrNotFound, "code") - } - var codeInfo types.CodeInfo - k.cdc.MustUnmarshal(bz, &codeInfo) - - if !authZ.CanInstantiateContract(codeInfo.InstantiateConfig, creator) { - return nil, nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "can not instantiate") + // deposit initial contract funds + if !deposit.IsZero() { + if err := k.bank.TransferCoins(ctx, creator, contractAddress, deposit); err != nil { + return nil, nil, err + } } // prepare params for contract instantiate call @@ -348,17 +346,16 @@ func (k Keeper) instantiate(ctx sdk.Context, codeID uint64, creator, admin sdk.A info := types.NewInfo(creator, deposit) // create prefixed data store - // 0x03 | BuildContractAddress (sdk.AccAddress) + // 0x03 | BuildContractAddressClassic (sdk.AccAddress) prefixStoreKey := types.GetContractStorePrefix(contractAddress) prefixStore := prefix.NewStore(ctx.KVStore(k.storeKey), prefixStoreKey) - wasmStore := types.NewWasmStore(prefixStore) // prepare querier querier := k.newQueryHandler(ctx, contractAddress) // instantiate wasm contract gas := k.runtimeGasForContract(ctx) - res, gasUsed, err := k.wasmVM.Instantiate(codeInfo.CodeHash, env, info, initMsg, wasmStore, k.cosmwasmAPI(ctx), querier, k.gasMeter(ctx), gas, costJSONDeserialization) + res, gasUsed, err := k.wasmVM.Instantiate(codeInfo.CodeHash, env, info, initMsg, prefixStore, k.pluskeeper.CosmwasmAPI(ctx), querier, k.gasMeter(ctx), gas, costJSONDeserialization) k.consumeRuntimeGas(ctx, gasUsed) if err != nil { return nil, nil, sdkerrors.Wrap(types.ErrInstantiateFailed, err.Error()) @@ -409,11 +406,8 @@ func (k Keeper) execute(ctx sdk.Context, contractAddress sdk.AccAddress, caller if err != nil { return nil, err } - if k.IsInactiveContract(ctx, contractAddress) { - return nil, sdkerrors.Wrap(types.ErrInactiveContract, "can not execute") - } - executeCosts := k.instantiateContractCosts(k.gasRegister, ctx, k.IsPinnedCode(ctx, contractInfo.CodeID), len(msg)) + executeCosts := k.gasRegister.InstantiateContractCosts(k.IsPinnedCode(ctx, contractInfo.CodeID), len(msg)) ctx.GasMeter().ConsumeGas(executeCosts, "Loading CosmWasm module: execute") // add more funds @@ -429,8 +423,7 @@ func (k Keeper) execute(ctx sdk.Context, contractAddress sdk.AccAddress, caller // prepare querier querier := k.newQueryHandler(ctx, contractAddress) gas := k.runtimeGasForContract(ctx) - wasmStore := types.NewWasmStore(prefixStore) - res, gasUsed, execErr := k.wasmVM.Execute(codeInfo.CodeHash, env, info, msg, wasmStore, k.cosmwasmAPI(ctx), querier, k.gasMeter(ctx), gas, costJSONDeserialization) + res, gasUsed, execErr := k.wasmVM.Execute(codeInfo.CodeHash, env, info, msg, prefixStore, k.pluskeeper.CosmwasmAPI(ctx), querier, k.gasMeter(ctx), gas, costJSONDeserialization) k.consumeRuntimeGas(ctx, gasUsed) if execErr != nil { return nil, sdkerrors.Wrap(types.ErrExecuteFailed, execErr.Error()) @@ -451,16 +444,13 @@ func (k Keeper) execute(ctx sdk.Context, contractAddress sdk.AccAddress, caller func (k Keeper) migrate(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, newCodeID uint64, msg []byte, authZ AuthorizationPolicy) ([]byte, error) { defer func(begin time.Time) { k.metrics.MigrateElapsedTimes.Observe(time.Since(begin).Seconds()) }(time.Now()) - migrateSetupCosts := k.instantiateContractCosts(k.gasRegister, ctx, k.IsPinnedCode(ctx, newCodeID), len(msg)) + migrateSetupCosts := k.gasRegister.InstantiateContractCosts(k.IsPinnedCode(ctx, newCodeID), len(msg)) ctx.GasMeter().ConsumeGas(migrateSetupCosts, "Loading CosmWasm module: migrate") contractInfo := k.GetContractInfo(ctx, contractAddress) if contractInfo == nil { return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "unknown contract") } - if k.IsInactiveContract(ctx, contractAddress) { - return nil, sdkerrors.Wrap(types.ErrInactiveContract, "can not migrate") - } if !authZ.CanModifyContract(contractInfo.AdminAddr(), caller) { return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "can not migrate") } @@ -470,6 +460,10 @@ func (k Keeper) migrate(ctx sdk.Context, contractAddress sdk.AccAddress, caller return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "unknown code") } + if !authZ.CanInstantiateContract(newCodeInfo.InstantiateConfig, caller) { + return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "to use new code") + } + // check for IBC flag switch report, err := k.wasmVM.AnalyzeCode(newCodeInfo.CodeHash); { case err != nil: @@ -494,8 +488,7 @@ func (k Keeper) migrate(ctx sdk.Context, contractAddress sdk.AccAddress, caller prefixStoreKey := types.GetContractStorePrefix(contractAddress) prefixStore := prefix.NewStore(ctx.KVStore(k.storeKey), prefixStoreKey) gas := k.runtimeGasForContract(ctx) - wasmStore := types.NewWasmStore(prefixStore) - res, gasUsed, err := k.wasmVM.Migrate(newCodeInfo.CodeHash, env, msg, &wasmStore, k.cosmwasmAPI(ctx), &querier, k.gasMeter(ctx), gas, costJSONDeserialization) + res, gasUsed, err := k.wasmVM.Migrate(newCodeInfo.CodeHash, env, msg, &prefixStore, k.pluskeeper.CosmwasmAPI(ctx), &querier, k.gasMeter(ctx), gas, costJSONDeserialization) k.consumeRuntimeGas(ctx, gasUsed) if err != nil { return nil, sdkerrors.Wrap(types.ErrMigrationFailed, err.Error()) @@ -533,16 +526,15 @@ func (k Keeper) Sudo(ctx sdk.Context, contractAddress sdk.AccAddress, msg []byte return nil, err } - sudoSetupCosts := k.instantiateContractCosts(k.gasRegister, ctx, k.IsPinnedCode(ctx, contractInfo.CodeID), len(msg)) + sudoSetupCosts := k.gasRegister.InstantiateContractCosts(k.IsPinnedCode(ctx, contractInfo.CodeID), len(msg)) ctx.GasMeter().ConsumeGas(sudoSetupCosts, "Loading CosmWasm module: sudo") env := types.NewEnv(ctx, contractAddress) // prepare querier querier := k.newQueryHandler(ctx, contractAddress) - wasmStore := types.NewWasmStore(prefixStore) gas := k.runtimeGasForContract(ctx) - res, gasUsed, execErr := k.wasmVM.Sudo(codeInfo.CodeHash, env, msg, wasmStore, k.cosmwasmAPI(ctx), querier, k.gasMeter(ctx), gas, costJSONDeserialization) + res, gasUsed, execErr := k.wasmVM.Sudo(codeInfo.CodeHash, env, msg, prefixStore, k.pluskeeper.CosmwasmAPI(ctx), querier, k.gasMeter(ctx), gas, costJSONDeserialization) k.consumeRuntimeGas(ctx, gasUsed) if execErr != nil { return nil, sdkerrors.Wrap(types.ErrExecuteFailed, execErr.Error()) @@ -569,7 +561,7 @@ func (k Keeper) reply(ctx sdk.Context, contractAddress sdk.AccAddress, reply was } // always consider this pinned - replyCosts := k.replyCosts(k.gasRegister, ctx, true, reply) + replyCosts := k.gasRegister.ReplyCosts(true, reply) ctx.GasMeter().ConsumeGas(replyCosts, "Loading CosmWasm module: reply") env := types.NewEnv(ctx, contractAddress) @@ -577,8 +569,8 @@ func (k Keeper) reply(ctx sdk.Context, contractAddress sdk.AccAddress, reply was // prepare querier querier := k.newQueryHandler(ctx, contractAddress) gas := k.runtimeGasForContract(ctx) - wasmStore := types.NewWasmStore(prefixStore) - res, gasUsed, execErr := k.wasmVM.Reply(codeInfo.CodeHash, env, reply, wasmStore, k.cosmwasmAPI(ctx), querier, k.gasMeter(ctx), gas, costJSONDeserialization) + + res, gasUsed, execErr := k.wasmVM.Reply(codeInfo.CodeHash, env, reply, prefixStore, k.pluskeeper.CosmwasmAPI(ctx), querier, k.gasMeter(ctx), gas, costJSONDeserialization) k.consumeRuntimeGas(ctx, gasUsed) if execErr != nil { return nil, sdkerrors.Wrap(types.ErrExecuteFailed, execErr.Error()) @@ -627,9 +619,6 @@ func (k Keeper) setContractAdmin(ctx sdk.Context, contractAddress, caller, newAd if contractInfo == nil { return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "unknown contract") } - if k.IsInactiveContract(ctx, contractAddress) { - return sdkerrors.Wrap(types.ErrInactiveContract, "can not modify contract") - } if !authZ.CanModifyContract(contractInfo.AdminAddr(), caller) { return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "can not modify contract") } @@ -647,13 +636,13 @@ func (k Keeper) appendToContractHistory(ctx sdk.Context, contractAddr sdk.AccAdd defer iter.Close() if iter.Valid() { - pos = sdk.BigEndianToUint64(iter.Value()) + pos = sdk.BigEndianToUint64(iter.Key()) } // then store with incrementing position - for i := range newEntries { + for _, e := range newEntries { pos++ key := types.GetContractCodeHistoryElementKey(contractAddr, pos) - store.Set(key, k.cdc.MustMarshal(&newEntries[i])) //nolint:gosec + store.Set(key, k.cdc.MustMarshal(&e)) //nolint:gosec } } @@ -701,15 +690,14 @@ func (k Keeper) QuerySmart(ctx sdk.Context, contractAddr sdk.AccAddress, req []b return nil, err } - smartQuerySetupCosts := k.instantiateContractCosts(k.gasRegister, ctx, k.IsPinnedCode(ctx, contractInfo.CodeID), len(req)) + smartQuerySetupCosts := k.gasRegister.InstantiateContractCosts(k.IsPinnedCode(ctx, contractInfo.CodeID), len(req)) ctx.GasMeter().ConsumeGas(smartQuerySetupCosts, "Loading CosmWasm module: query") // prepare querier querier := k.newQueryHandler(ctx, contractAddr) env := types.NewEnv(ctx, contractAddr) - wasmStore := types.NewWasmStore(prefixStore) - queryResult, gasUsed, qErr := k.wasmVM.Query(codeInfo.CodeHash, env, req, wasmStore, k.cosmwasmAPI(ctx), querier, k.gasMeter(ctx), k.runtimeGasForContract(ctx), costJSONDeserialization) + queryResult, gasUsed, qErr := k.wasmVM.Query(codeInfo.CodeHash, env, req, prefixStore, k.pluskeeper.CosmwasmAPI(ctx), querier, k.gasMeter(ctx), k.runtimeGasForContract(ctx), costJSONDeserialization) k.consumeRuntimeGas(ctx, gasUsed) if qErr != nil { return nil, sdkerrors.Wrap(types.ErrQueryFailed, qErr.Error()) @@ -961,12 +949,17 @@ func (k Keeper) setContractInfoExtension(ctx sdk.Context, contractAddr sdk.AccAd } // setAccessConfig updates the access config of a code id. -func (k Keeper) setAccessConfig(ctx sdk.Context, codeID uint64, config types.AccessConfig) error { +func (k Keeper) setAccessConfig(ctx sdk.Context, codeID uint64, caller sdk.AccAddress, newConfig types.AccessConfig, authz AuthorizationPolicy) error { info := k.GetCodeInfo(ctx, codeID) if info == nil { return sdkerrors.Wrap(types.ErrNotFound, "code info") } - info.InstantiateConfig = config + isSubset := newConfig.Permission.IsSubset(k.getInstantiateAccessConfig(ctx)) + if !authz.CanModifyCodeAccessConfig(sdk.MustAccAddressFromBech32(info.Creator), caller, isSubset) { + return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "can not modify code access config") + } + + info.InstantiateConfig = newConfig k.storeCodeInfo(ctx, codeID, *info) return nil } @@ -1006,16 +999,14 @@ 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 return math.MaxUint64 } - - return k.getGasMultiplier(ctx).ToWasmVMGas(meter.Limit() - meter.GasConsumedToLimit()) + return k.gasRegister.ToWasmVMGas(meter.Limit() - meter.GasConsumedToLimit()) } func (k Keeper) consumeRuntimeGas(ctx sdk.Context, gas uint64) { - consumed := k.getGasMultiplier(ctx).FromWasmVMGas(gas) + consumed := k.gasRegister.FromWasmVMGas(gas) ctx.GasMeter().ConsumeGas(consumed, "wasm contract") // throw OutOfGas error if we ran out (got exactly to zero due to better limit enforcing) if ctx.GasMeter().IsOutOfGas() { @@ -1023,20 +1014,6 @@ func (k Keeper) consumeRuntimeGas(ctx sdk.Context, gas uint64) { } } -// generates a contract address from codeID + instanceID -func (k Keeper) generateContractAddress(ctx sdk.Context, codeID uint64) sdk.AccAddress { - instanceID := k.autoIncrementID(ctx, types.KeyLastInstanceID) - return BuildContractAddress(codeID, instanceID) -} - -// BuildContractAddress builds an sdk account address for a contract. -func BuildContractAddress(codeID, instanceID uint64) sdk.AccAddress { - contractID := make([]byte, 16) - binary.BigEndian.PutUint64(contractID[:8], codeID) - binary.BigEndian.PutUint64(contractID[8:], instanceID) - return address.Module(types.ModuleName, contractID)[:types.ContractAddrLen] -} - func (k Keeper) autoIncrementID(ctx sdk.Context, lastIDKey []byte) uint64 { store := ctx.KVStore(k.storeKey) bz := store.Get(lastIDKey) @@ -1086,53 +1063,27 @@ func (k Keeper) importContract(ctx sdk.Context, contractAddr sdk.AccAddress, c * } func (k Keeper) newQueryHandler(ctx sdk.Context, contractAddress sdk.AccAddress) QueryHandler { - return NewQueryHandler(ctx, k.wasmVMQueryHandler, contractAddress, k.getGasMultiplier(ctx)) -} - -type GasMultiplier struct { - multiplier uint64 -} - -func NewGasMultiplier(multiplier uint64) GasMultiplier { - if multiplier == 0 { - panic(sdkerrors.Wrap(sdkerrors.ErrLogic, "GasMultiplier can not be 0")) - } - - return GasMultiplier{multiplier: multiplier} -} - -// ToWasmVMGas convert to wasmVM contract runtime gas unit -func (m GasMultiplier) ToWasmVMGas(source storetypes.Gas) uint64 { - x := source * m.multiplier - if x < source { - panic(sdk.ErrorOutOfGas{Descriptor: "overflow"}) - } - return x -} - -// FromWasmVMGas converts to SDK gas unit -func (m GasMultiplier) FromWasmVMGas(source uint64) sdk.Gas { - return source / m.multiplier + return NewQueryHandler(ctx, k.wasmVMQueryHandler, contractAddress, k.gasRegister) } // MultipliedGasMeter wraps the GasMeter from context and multiplies all reads by out defined multiplier type MultipliedGasMeter struct { originalMeter sdk.GasMeter - GasMultiplier GasMultiplier + GasRegister GasRegister } -func NewMultipliedGasMeter(originalMeter sdk.GasMeter, m GasMultiplier) MultipliedGasMeter { - return MultipliedGasMeter{originalMeter: originalMeter, GasMultiplier: m} +func NewMultipliedGasMeter(originalMeter sdk.GasMeter, gr GasRegister) MultipliedGasMeter { + return MultipliedGasMeter{originalMeter: originalMeter, GasRegister: gr} } var _ wasmvm.GasMeter = MultipliedGasMeter{} func (m MultipliedGasMeter) GasConsumed() sdk.Gas { - return m.GasMultiplier.ToWasmVMGas(m.originalMeter.GasConsumed()) + return m.GasRegister.ToWasmVMGas(m.originalMeter.GasConsumed()) } func (k Keeper) gasMeter(ctx sdk.Context) MultipliedGasMeter { - return NewMultipliedGasMeter(ctx.GasMeter(), k.getGasMultiplier(ctx)) + return NewMultipliedGasMeter(ctx.GasMeter(), k.gasRegister) } // Logger returns a module-specific logger. @@ -1145,7 +1096,7 @@ func moduleLogger(ctx sdk.Context) log.Logger { } // Querier creates a new grpc querier instance -func Querier(k *Keeper) *GrpcQuerier { //nolint:revive +func Querier(k *Keeper) *grpcQuerier { //nolint:revive return NewGrpcQuerier(k.cdc, k.storeKey, k, k.queryGasLimit) } @@ -1155,16 +1106,14 @@ func (k Keeper) QueryGasLimit() sdk.Gas { } // BankCoinTransferrer replicates the cosmos-sdk behaviour as in -// lbm-sdk's x/bank/keeper/msg_server.go Send -// (https://github.com/line/lbm-sdk/blob/2a5a2d2c885b03e278bcd67546d4f21e74614ead/x/bank/keeper/msg_server.go#L26) +// https://github.com/cosmos/cosmos-sdk/blob/v0.41.4/x/bank/keeper/msg_server.go#L26 type BankCoinTransferrer struct { - keeper bankpluskeeper.Keeper + keeper types.BankKeeper } func NewBankCoinTransferrer(keeper types.BankKeeper) BankCoinTransferrer { - bankPlusKeeper := keeper.(bankpluskeeper.Keeper) return BankCoinTransferrer{ - keeper: bankPlusKeeper, + keeper: keeper, } } @@ -1193,12 +1142,41 @@ func (c BankCoinTransferrer) TransferCoins(parentCtx sdk.Context, fromAddr sdk.A return nil } -func (c BankCoinTransferrer) AddToInactiveAddr(ctx sdk.Context, address sdk.AccAddress) { - c.keeper.AddToInactiveAddr(ctx, address) +var _ AccountPruner = VestingCoinBurner{} + +// VestingCoinBurner default implementation for AccountPruner to burn the coins +type VestingCoinBurner struct { + bank types.BankKeeper +} + +// NewVestingCoinBurner constructor +func NewVestingCoinBurner(bank types.BankKeeper) VestingCoinBurner { + if bank == nil { + panic("bank keeper must not be nil") + } + return VestingCoinBurner{bank: bank} } -func (c BankCoinTransferrer) DeleteFromInactiveAddr(ctx sdk.Context, address sdk.AccAddress) { - c.keeper.DeleteFromInactiveAddr(ctx, address) +// CleanupExistingAccount accepts only vesting account types to burns all their original vesting coin balances. +// Other account types will be rejected and returned as unhandled. +func (b VestingCoinBurner) CleanupExistingAccount(ctx sdk.Context, existingAcc authtypes.AccountI) (handled bool, err error) { + v, ok := existingAcc.(vestingexported.VestingAccount) + if !ok { + return false, nil + } + + ctx = ctx.WithGasMeter(sdk.NewInfiniteGasMeter()) + coinsToBurn := sdk.NewCoins() + for _, orig := range v.GetOriginalVesting() { // focus on the coin denoms that were setup originally; getAllBalances has some issues + coinsToBurn = append(coinsToBurn, b.bank.GetBalance(ctx, existingAcc.GetAddress(), orig.Denom)) + } + if err := b.bank.SendCoinsFromAccountToModule(ctx, existingAcc.GetAddress(), types.ModuleName, coinsToBurn); err != nil { + return false, sdkerrors.Wrap(err, "prune account balance") + } + if err := b.bank.BurnCoins(ctx, types.ModuleName, coinsToBurn); err != nil { + return false, sdkerrors.Wrap(err, "burn account balance") + } + return true, nil } type msgDispatcher interface { diff --git a/x/wasm/keeper/keeper_extension.go b/x/wasm/keeper/keeper_extension.go deleted file mode 100644 index 73a0ba7306..0000000000 --- a/x/wasm/keeper/keeper_extension.go +++ /dev/null @@ -1,67 +0,0 @@ -package keeper - -import ( - sdk "github.com/line/lbm-sdk/types" - sdkerrors "github.com/line/lbm-sdk/types/errors" - - wasmtypes "github.com/line/wasmd/x/wasm/types" -) - -func (k Keeper) IsInactiveContract(ctx sdk.Context, contractAddress sdk.AccAddress) bool { - store := ctx.KVStore(k.storeKey) - return store.Has(wasmtypes.GetInactiveContractKey(contractAddress)) -} - -func (k Keeper) IterateInactiveContracts(ctx sdk.Context, fn func(contractAddress sdk.AccAddress) (stop bool)) { - store := ctx.KVStore(k.storeKey) - prefix := wasmtypes.InactiveContractPrefix - iterator := sdk.KVStorePrefixIterator(store, prefix) - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - contractAddress := sdk.AccAddress(iterator.Value()) - if stop := fn(contractAddress); stop { - break - } - } -} - -func (k Keeper) addInactiveContract(ctx sdk.Context, contractAddress sdk.AccAddress) { - store := ctx.KVStore(k.storeKey) - key := wasmtypes.GetInactiveContractKey(contractAddress) - - store.Set(key, contractAddress) -} - -func (k Keeper) deleteInactiveContract(ctx sdk.Context, contractAddress sdk.AccAddress) { - store := ctx.KVStore(k.storeKey) - key := wasmtypes.GetInactiveContractKey(contractAddress) - store.Delete(key) -} - -// activateContract delete the contract address from inactivateContract list if the contract is deactivated. -func (k Keeper) activateContract(ctx sdk.Context, contractAddress sdk.AccAddress) error { - if !k.IsInactiveContract(ctx, contractAddress) { - return sdkerrors.Wrapf(wasmtypes.ErrNotFound, "no inactivate contract %s", contractAddress.String()) - } - - k.deleteInactiveContract(ctx, contractAddress) - k.bank.DeleteFromInactiveAddr(ctx, contractAddress) - - return nil -} - -// deactivateContract add the contract address to inactivateContract list. -func (k Keeper) deactivateContract(ctx sdk.Context, contractAddress sdk.AccAddress) error { - if k.IsInactiveContract(ctx, contractAddress) { - return sdkerrors.Wrapf(wasmtypes.ErrAccountExists, "already inactivate contract %s", contractAddress.String()) - } - if !k.HasContractInfo(ctx, contractAddress) { - return sdkerrors.Wrapf(wasmtypes.ErrInvalid, "no contract %s", contractAddress.String()) - } - - k.addInactiveContract(ctx, contractAddress) - k.bank.AddToInactiveAddr(ctx, contractAddress) - - return nil -} diff --git a/x/wasm/keeper/keeper_test.go b/x/wasm/keeper/keeper_test.go index 7d1f407dc9..fb2743d113 100644 --- a/x/wasm/keeper/keeper_test.go +++ b/x/wasm/keeper/keeper_test.go @@ -2,24 +2,31 @@ package keeper import ( "bytes" + _ "embed" "encoding/json" "errors" "fmt" - "math" "os" "testing" "time" + fuzz "github.com/google/gofuzz" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/line/lbm-sdk/baseapp" + "github.com/line/lbm-sdk/crypto/keys/ed25519" stypes "github.com/line/lbm-sdk/store/types" sdk "github.com/line/lbm-sdk/types" + "github.com/line/lbm-sdk/types/address" sdkerrors "github.com/line/lbm-sdk/types/errors" authtypes "github.com/line/lbm-sdk/x/auth/types" + "github.com/line/lbm-sdk/x/auth/vesting" + vestingtypes "github.com/line/lbm-sdk/x/auth/vesting/types" banktypes "github.com/line/lbm-sdk/x/bank/types" distributiontypes "github.com/line/lbm-sdk/x/distribution/types" - ocproto "github.com/line/ostracon/proto/ostracon/types" + "github.com/line/ostracon/libs/rand" wasmvm "github.com/line/wasmvm" wasmvmtypes "github.com/line/wasmvm/types" @@ -36,24 +43,25 @@ func init() { hackatomWasm = b } +//go:embed testdata/hackatom.wasm var hackatomWasm []byte -const SupportedFeatures = "iterator,staking,stargate" +const AvailableCapabilities = "iterator,staking,stargate,cosmwasm_1_1" func TestNewKeeper(t *testing.T) { - _, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + _, keepers := CreateTestInput(t, false, AvailableCapabilities) require.NotNil(t, keepers.ContractKeeper) } func TestCreateSuccess(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.ContractKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) em := sdk.NewEventManager() - contractID, err := keeper.Create(ctx.WithEventManager(em), creator, hackatomWasm, nil) + contractID, _, err := keeper.Create(ctx.WithEventManager(em), creator, hackatomWasm, nil) require.NoError(t, err) require.Equal(t, uint64(1), contractID) // and verify content @@ -61,32 +69,33 @@ func TestCreateSuccess(t *testing.T) { require.NoError(t, err) require.Equal(t, hackatomWasm, storedCode) // and events emitted - exp := sdk.Events{sdk.NewEvent("store_code", sdk.NewAttribute("code_id", "1"))} + codeHash := "470c5b703a682f778b8b088d48169b8d6e43f7f44ac70316692cdbe69e6605e3" + exp := sdk.Events{sdk.NewEvent("store_code", sdk.NewAttribute("code_checksum", codeHash), sdk.NewAttribute("code_id", "1"))} assert.Equal(t, exp, em.Events()) } func TestCreateNilCreatorAddress(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) - _, err := keepers.ContractKeeper.Create(ctx, nil, hackatomWasm, nil) + _, _, err := keepers.ContractKeeper.Create(ctx, nil, hackatomWasm, nil) require.Error(t, err, "nil creator is not allowed") } func TestCreateNilWasmCode(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) - _, err := keepers.ContractKeeper.Create(ctx, creator, nil, nil) + _, _, err := keepers.ContractKeeper.Create(ctx, creator, nil, nil) require.Error(t, err, "nil WASM code is not allowed") } func TestCreateInvalidWasmCode(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) - _, err := keepers.ContractKeeper.Create(ctx, creator, []byte("potatoes"), nil) + _, _, err := keepers.ContractKeeper.Create(ctx, creator, []byte("potatoes"), nil) require.Error(t, err, "potatoes are not valid WASM code") } @@ -119,18 +128,15 @@ func TestCreateStoresInstantiatePermission(t *testing.T) { } for msg, spec := range specs { t.Run(msg, func(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) accKeeper, keeper, bankKeeper := keepers.AccountKeeper, keepers.ContractKeeper, keepers.BankKeeper keepers.WasmKeeper.SetParams(ctx, types.Params{ CodeUploadAccess: types.AllowEverybody, InstantiateDefaultPermission: spec.srcPermission, - GasMultiplier: types.DefaultGasMultiplier, - InstanceCost: types.DefaultInstanceCost, - CompileCost: types.DefaultCompileCost, }) fundAccounts(t, ctx, accKeeper, bankKeeper, myAddr, deposit) - codeID, err := keeper.Create(ctx, myAddr, hackatomWasm, nil) + codeID, _, err := keeper.Create(ctx, myAddr, hackatomWasm, nil) require.NoError(t, err) codeInfo := keepers.WasmKeeper.GetCodeInfo(ctx, codeID) @@ -141,12 +147,12 @@ func TestCreateStoresInstantiatePermission(t *testing.T) { } func TestCreateWithParamPermissions(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.ContractKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit...) - otherAddr := keepers.Faucet.NewFundedAccount(ctx, deposit...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) + otherAddr := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) specs := map[string]struct { srcPermission types.AccessConfig @@ -175,7 +181,7 @@ func TestCreateWithParamPermissions(t *testing.T) { params := types.DefaultParams() params.CodeUploadAccess = spec.srcPermission keepers.WasmKeeper.SetParams(ctx, params) - _, err := keeper.Create(ctx, creator, hackatomWasm, nil) + _, _, err := keeper.Create(ctx, creator, hackatomWasm, nil) require.True(t, spec.expError.Is(err), err) if spec.expError != nil { return @@ -187,13 +193,13 @@ func TestCreateWithParamPermissions(t *testing.T) { // ensure that the user cannot set the code instantiate permission to something more permissive // than the default func TestEnforceValidPermissionsOnCreate(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.WasmKeeper contractKeeper := keepers.ContractKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit...) - other := keepers.Faucet.NewFundedAccount(ctx, deposit...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) + other := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) onlyCreator := types.AccessTypeOnlyAddress.With(creator) onlyOther := types.AccessTypeOnlyAddress.With(other) @@ -252,7 +258,7 @@ func TestEnforceValidPermissionsOnCreate(t *testing.T) { params := types.DefaultParams() params.InstantiateDefaultPermission = spec.defaultPermssion keeper.SetParams(ctx, params) - codeID, err := contractKeeper.Create(ctx, creator, hackatomWasm, spec.requestedPermission) + codeID, _, err := contractKeeper.Create(ctx, creator, hackatomWasm, spec.requestedPermission) require.True(t, spec.expError.Is(err), err) if spec.expError == nil { codeInfo := keeper.GetCodeInfo(ctx, codeID) @@ -263,19 +269,19 @@ func TestEnforceValidPermissionsOnCreate(t *testing.T) { } func TestCreateDuplicate(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.ContractKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) // create one copy - contractID, err := keeper.Create(ctx, creator, hackatomWasm, nil) + contractID, _, err := keeper.Create(ctx, creator, hackatomWasm, nil) require.NoError(t, err) require.Equal(t, uint64(1), contractID) // create second copy - duplicateID, err := keeper.Create(ctx, creator, hackatomWasm, nil) + duplicateID, _, err := keeper.Create(ctx, creator, hackatomWasm, nil) require.NoError(t, err) require.Equal(t, uint64(2), duplicateID) @@ -289,24 +295,24 @@ func TestCreateDuplicate(t *testing.T) { } func TestCreateWithSimulation(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) - ctx = ctx.WithBlockHeader(ocproto.Header{Height: 1}). + ctx = ctx.WithBlockHeader(tmproto.Header{Height: 1}). WithGasMeter(stypes.NewInfiniteGasMeter()) deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) // create this once in simulation mode - contractID, err := keepers.ContractKeeper.Create(ctx, creator, hackatomWasm, nil) + contractID, _, err := keepers.ContractKeeper.Create(ctx, creator, hackatomWasm, nil) require.NoError(t, err) require.Equal(t, uint64(1), contractID) // then try to create it in non-simulation mode (should not fail) - ctx, keepers = CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers = CreateTestInput(t, false, AvailableCapabilities) ctx = ctx.WithGasMeter(sdk.NewGasMeter(10_000_000)) - creator = keepers.Faucet.NewFundedAccount(ctx, deposit...) - contractID, err = keepers.ContractKeeper.Create(ctx, creator, hackatomWasm, nil) + creator = keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) + contractID, _, err = keepers.ContractKeeper.Create(ctx, creator, hackatomWasm, nil) require.NoError(t, err) require.Equal(t, uint64(1), contractID) @@ -323,15 +329,15 @@ func TestIsSimulationMode(t *testing.T) { exp bool }{ "genesis block": { - ctx: sdk.Context{}.WithBlockHeader(ocproto.Header{}).WithGasMeter(stypes.NewInfiniteGasMeter()), + ctx: sdk.Context{}.WithBlockHeader(tmproto.Header{}).WithGasMeter(stypes.NewInfiniteGasMeter()), exp: false, }, "any regular block": { - ctx: sdk.Context{}.WithBlockHeader(ocproto.Header{Height: 1}).WithGasMeter(stypes.NewGasMeter(10000000)), + ctx: sdk.Context{}.WithBlockHeader(tmproto.Header{Height: 1}).WithGasMeter(stypes.NewGasMeter(10000000)), exp: false, }, "simulation": { - ctx: sdk.Context{}.WithBlockHeader(ocproto.Header{Height: 1}).WithGasMeter(stypes.NewInfiniteGasMeter()), + ctx: sdk.Context{}.WithBlockHeader(tmproto.Header{Height: 1}).WithGasMeter(stypes.NewInfiniteGasMeter()), exp: true, }, } @@ -343,16 +349,16 @@ func TestIsSimulationMode(t *testing.T) { } func TestCreateWithGzippedPayload(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.ContractKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) wasmCode, err := os.ReadFile("./testdata/hackatom.wasm.gzip") require.NoError(t, err, "reading gzipped WASM code") - contractID, err := keeper.Create(ctx, creator, wasmCode, nil) + contractID, _, err := keeper.Create(ctx, creator, wasmCode, nil) require.NoError(t, err) require.Equal(t, uint64(1), contractID) // and verify content @@ -361,22 +367,35 @@ func TestCreateWithGzippedPayload(t *testing.T) { require.Equal(t, hackatomWasm, storedCode) } -func TestInstantiate(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) +func TestCreateWithBrokenGzippedPayload(t *testing.T) { + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.ContractKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) - codeID, err := keeper.Create(ctx, creator, hackatomWasm, nil) - require.NoError(t, err) + wasmCode, err := os.ReadFile("./testdata/broken_crc.gzip") + require.NoError(t, err, "reading gzipped WASM code") - _, _, bob := keyPubAddr() - _, _, fred := keyPubAddr() + gm := sdk.NewInfiniteGasMeter() + codeID, checksum, err := keeper.Create(ctx.WithGasMeter(gm), creator, wasmCode, nil) + require.Error(t, err) + assert.Empty(t, codeID) + assert.Empty(t, checksum) + assert.GreaterOrEqual(t, gm.GasConsumed(), sdk.Gas(121384)) // 809232 * 0.15 (default uncompress costs) = 121384 +} + +func TestInstantiate(t *testing.T) { + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) + + deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) + creator := sdk.AccAddress(bytes.Repeat([]byte{1}, address.Len)) + keepers.Faucet.Fund(ctx, creator, deposit...) + example := StoreHackatomExampleContract(t, ctx, keepers) initMsg := HackatomExampleInitMsg{ - Verifier: fred, - Beneficiary: bob, + Verifier: RandomAccountAddress(t), + Beneficiary: RandomAccountAddress(t), } initMsgBz, err := json.Marshal(initMsg) require.NoError(t, err) @@ -385,25 +404,25 @@ func TestInstantiate(t *testing.T) { em := sdk.NewEventManager() // create with no balance is also legal - gotContractAddr, _, err := keepers.ContractKeeper.Instantiate(ctx.WithEventManager(em), codeID, creator, nil, initMsgBz, "demo contract 1", nil) + gotContractAddr, _, err := keepers.ContractKeeper.Instantiate(ctx.WithEventManager(em), example.CodeID, creator, nil, initMsgBz, "demo contract 1", nil) require.NoError(t, err) require.Equal(t, "link14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sgf2vn8", gotContractAddr.String()) gasAfter := ctx.GasMeter().GasConsumed() if types.EnableGasVerification { - require.Equal(t, uint64(0x18c0a), gasAfter-gasBefore) + require.Equal(t, uint64(0x194a5), gasAfter-gasBefore) } // ensure it is stored properly info := keepers.WasmKeeper.GetContractInfo(ctx, gotContractAddr) require.NotNil(t, info) assert.Equal(t, creator.String(), info.Creator) - assert.Equal(t, codeID, info.CodeID) + assert.Equal(t, example.CodeID, info.CodeID) assert.Equal(t, "demo contract 1", info.Label) exp := []types.ContractCodeHistoryEntry{{ Operation: types.ContractCodeHistoryOperationTypeInit, - CodeID: codeID, + CodeID: example.CodeID, Updated: types.NewAbsoluteTxPosition(ctx), Msg: initMsgBz, }} @@ -425,12 +444,9 @@ func TestInstantiateWithDeposit(t *testing.T) { fred = bytes.Repeat([]byte{2}, types.SDKAddrLen) deposit = sdk.NewCoins(sdk.NewInt64Coin("denom", 100)) - initMsg = HackatomExampleInitMsg{Verifier: fred, Beneficiary: bob} + initMsg = mustMarshal(t, HackatomExampleInitMsg{Verifier: fred, Beneficiary: bob}) ) - initMsgBz, err := json.Marshal(initMsg) - require.NoError(t, err) - specs := map[string]struct { srcActor sdk.AccAddress expError bool @@ -452,17 +468,17 @@ func TestInstantiateWithDeposit(t *testing.T) { } for msg, spec := range specs { t.Run(msg, func(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) accKeeper, bankKeeper, keeper := keepers.AccountKeeper, keepers.BankKeeper, keepers.ContractKeeper if spec.fundAddr { fundAccounts(t, ctx, accKeeper, bankKeeper, spec.srcActor, sdk.NewCoins(sdk.NewInt64Coin("denom", 200))) } - contractID, err := keeper.Create(ctx, spec.srcActor, hackatomWasm, nil) + contractID, _, err := keeper.Create(ctx, spec.srcActor, hackatomWasm, nil) require.NoError(t, err) // when - addr, _, err := keepers.ContractKeeper.Instantiate(ctx, contractID, spec.srcActor, nil, initMsgBz, "my label", deposit) + addr, _, err := keepers.ContractKeeper.Instantiate(ctx, contractID, spec.srcActor, nil, initMsg, "my label", deposit) // then if spec.expError { require.Error(t, err) @@ -520,11 +536,11 @@ func TestInstantiateWithPermissions(t *testing.T) { } for msg, spec := range specs { t.Run(msg, func(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) accKeeper, bankKeeper, keeper := keepers.AccountKeeper, keepers.BankKeeper, keepers.ContractKeeper fundAccounts(t, ctx, accKeeper, bankKeeper, spec.srcActor, deposit) - contractID, err := keeper.Create(ctx, myAddr, hackatomWasm, &spec.srcPermission) + contractID, _, err := keeper.Create(ctx, myAddr, hackatomWasm, &spec.srcPermission) require.NoError(t, err) _, _, err = keepers.ContractKeeper.Instantiate(ctx, contractID, spec.srcActor, nil, initMsgBz, "demo contract 1", nil) @@ -533,11 +549,147 @@ func TestInstantiateWithPermissions(t *testing.T) { } } +func TestInstantiateWithAccounts(t *testing.T) { + parentCtx, keepers := CreateTestInput(t, false, AvailableCapabilities) + example := StoreHackatomExampleContract(t, parentCtx, keepers) + require.Equal(t, uint64(1), example.CodeID) + initMsg := mustMarshal(t, HackatomExampleInitMsg{Verifier: RandomAccountAddress(t), Beneficiary: RandomAccountAddress(t)}) + + senderAddr := DeterministicAccountAddress(t, 1) + keepers.Faucet.Fund(parentCtx, senderAddr, sdk.NewInt64Coin("denom", 100000000)) + const myLabel = "testing" + mySalt := []byte(`my salt`) + contractAddr := BuildContractAddressPredictable(example.Checksum, senderAddr, mySalt, []byte{}) + + lastAccountNumber := keepers.AccountKeeper.GetAccount(parentCtx, senderAddr).GetAccountNumber() + + specs := map[string]struct { + option Option + account authtypes.AccountI + initBalance sdk.Coin + deposit sdk.Coins + expErr error + expAccount authtypes.AccountI + expBalance sdk.Coins + }{ + "unused BaseAccount exists": { + account: authtypes.NewBaseAccount(contractAddr, nil, 0, 0), + initBalance: sdk.NewInt64Coin("denom", 100000000), + expAccount: authtypes.NewBaseAccount(contractAddr, nil, lastAccountNumber+1, 0), // +1 for next seq + expBalance: sdk.NewCoins(sdk.NewInt64Coin("denom", 100000000)), + }, + "BaseAccount with sequence exists": { + account: authtypes.NewBaseAccount(contractAddr, nil, 0, 1), + expErr: types.ErrAccountExists, + }, + "BaseAccount with pubkey exists": { + account: authtypes.NewBaseAccount(contractAddr, &ed25519.PubKey{}, 0, 0), + expErr: types.ErrAccountExists, + }, + "no account existed": { + expAccount: authtypes.NewBaseAccount(contractAddr, nil, lastAccountNumber+1, 0), // +1 for next seq, + expBalance: sdk.NewCoins(), + }, + "no account existed before create with deposit": { + expAccount: authtypes.NewBaseAccount(contractAddr, nil, lastAccountNumber+1, 0), // +1 for next seq + deposit: sdk.NewCoins(sdk.NewCoin("denom", sdk.NewInt(1_000))), + expBalance: sdk.NewCoins(sdk.NewCoin("denom", sdk.NewInt(1_000))), + }, + "prunable DelayedVestingAccount gets overwritten": { + account: vestingtypes.NewDelayedVestingAccount( + authtypes.NewBaseAccount(contractAddr, nil, 0, 0), + sdk.NewCoins(sdk.NewCoin("denom", sdk.NewInt(1_000))), time.Now().Add(30*time.Hour).Unix()), + initBalance: sdk.NewCoin("denom", sdk.NewInt(1_000)), + deposit: sdk.NewCoins(sdk.NewCoin("denom", sdk.NewInt(1))), + expAccount: authtypes.NewBaseAccount(contractAddr, nil, lastAccountNumber+2, 0), // +1 for next seq, +1 for spec.account created + expBalance: sdk.NewCoins(sdk.NewCoin("denom", sdk.NewInt(1))), + }, + "prunable ContinuousVestingAccount gets overwritten": { + account: vestingtypes.NewContinuousVestingAccount( + authtypes.NewBaseAccount(contractAddr, nil, 0, 0), + sdk.NewCoins(sdk.NewCoin("denom", sdk.NewInt(1_000))), time.Now().Add(time.Hour).Unix(), time.Now().Add(2*time.Hour).Unix()), + initBalance: sdk.NewCoin("denom", sdk.NewInt(1_000)), + deposit: sdk.NewCoins(sdk.NewCoin("denom", sdk.NewInt(1))), + expAccount: authtypes.NewBaseAccount(contractAddr, nil, lastAccountNumber+2, 0), // +1 for next seq, +1 for spec.account created + expBalance: sdk.NewCoins(sdk.NewCoin("denom", sdk.NewInt(1))), + }, + "prunable account without balance gets overwritten": { + account: vestingtypes.NewContinuousVestingAccount( + authtypes.NewBaseAccount(contractAddr, nil, 0, 0), + sdk.NewCoins(sdk.NewCoin("denom", sdk.NewInt(0))), time.Now().Add(time.Hour).Unix(), time.Now().Add(2*time.Hour).Unix()), + expAccount: authtypes.NewBaseAccount(contractAddr, nil, lastAccountNumber+2, 0), // +1 for next seq, +1 for spec.account created + expBalance: sdk.NewCoins(), + }, + "unknown account type is rejected with error": { + account: authtypes.NewModuleAccount( + authtypes.NewBaseAccount(contractAddr, nil, 0, 0), + "testing", + ), + initBalance: sdk.NewCoin("denom", sdk.NewInt(1_000)), + expErr: types.ErrAccountExists, + }, + "with option used to set non default type to accept list": { + option: WithAcceptedAccountTypesOnContractInstantiation(&vestingtypes.DelayedVestingAccount{}), + account: vestingtypes.NewDelayedVestingAccount( + authtypes.NewBaseAccount(contractAddr, nil, 0, 0), + sdk.NewCoins(sdk.NewCoin("denom", sdk.NewInt(1_000))), time.Now().Add(30*time.Hour).Unix()), + initBalance: sdk.NewCoin("denom", sdk.NewInt(1_000)), + deposit: sdk.NewCoins(sdk.NewCoin("denom", sdk.NewInt(1))), + expAccount: vestingtypes.NewDelayedVestingAccount(authtypes.NewBaseAccount(contractAddr, nil, lastAccountNumber+1, 0), + sdk.NewCoins(sdk.NewCoin("denom", sdk.NewInt(1_000))), time.Now().Add(30*time.Hour).Unix()), + expBalance: sdk.NewCoins(sdk.NewCoin("denom", sdk.NewInt(1_001))), + }, + "pruning account fails": { + option: WithAccountPruner(wasmtesting.AccountPrunerMock{CleanupExistingAccountFn: func(ctx sdk.Context, existingAccount authtypes.AccountI) (handled bool, err error) { + return false, types.ErrUnsupportedForContract.Wrap("testing") + }}), + account: vestingtypes.NewDelayedVestingAccount( + authtypes.NewBaseAccount(contractAddr, nil, 0, 0), + sdk.NewCoins(sdk.NewCoin("denom", sdk.NewInt(1_000))), time.Now().Add(30*time.Hour).Unix()), + expErr: types.ErrUnsupportedForContract, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + ctx, _ := parentCtx.CacheContext() + if spec.account != nil { + keepers.AccountKeeper.SetAccount(ctx, keepers.AccountKeeper.NewAccount(ctx, spec.account)) + } + if !spec.initBalance.IsNil() { + keepers.Faucet.Fund(ctx, spec.account.GetAddress(), spec.initBalance) + } + if spec.option != nil { + spec.option.apply(keepers.WasmKeeper) + } + defer func() { + if spec.option != nil { // reset + WithAcceptedAccountTypesOnContractInstantiation(&authtypes.BaseAccount{}).apply(keepers.WasmKeeper) + WithAccountPruner(NewVestingCoinBurner(keepers.BankKeeper)).apply(keepers.WasmKeeper) + } + }() + // when + gotAddr, _, gotErr := keepers.ContractKeeper.Instantiate2(ctx, 1, senderAddr, nil, initMsg, myLabel, spec.deposit, mySalt, false) + if spec.expErr != nil { + assert.ErrorIs(t, gotErr, spec.expErr) + return + } + require.NoError(t, gotErr) + assert.Equal(t, contractAddr, gotAddr) + // and + gotAcc := keepers.AccountKeeper.GetAccount(ctx, contractAddr) + assert.Equal(t, spec.expAccount, gotAcc) + // and + gotBalance := keepers.BankKeeper.GetAllBalances(ctx, contractAddr) + assert.Equal(t, spec.expBalance, gotBalance) + }) + } +} + func TestInstantiateWithNonExistingCodeID(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) initMsg := HackatomExampleInitMsg{} initMsgBz, err := json.Marshal(initMsg) @@ -550,7 +702,7 @@ func TestInstantiateWithNonExistingCodeID(t *testing.T) { } func TestInstantiateWithContractDataResponse(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) wasmerMock := &wasmtesting.MockWasmer{ InstantiateFn: func(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, initMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.Response, uint64, error) { @@ -566,19 +718,96 @@ func TestInstantiateWithContractDataResponse(t *testing.T) { assert.Equal(t, []byte("my-response-data"), data) } +func TestInstantiateWithContractFactoryChildQueriesParent(t *testing.T) { + // Scenario: + // given a factory contract stored + // when instantiated, the contract creates a new child contract instance + // and the child contracts queries the senders ContractInfo on instantiation + // then the factory contract's ContractInfo should be returned to the child contract + // + // see also: https://github.com/CosmWasm/wasmd/issues/896 + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) + keeper := keepers.WasmKeeper + + var instantiationCount int + callbacks := make([]func(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, initMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.Response, uint64, error), 2) + wasmerMock := &wasmtesting.MockWasmer{ + // dispatch instantiation calls to callbacks + InstantiateFn: func(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, initMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.Response, uint64, error) { + require.Greater(t, len(callbacks), instantiationCount, "unexpected call to instantiation") + do := callbacks[instantiationCount] + instantiationCount++ + return do(codeID, env, info, initMsg, store, goapi, querier, gasMeter, gasLimit, deserCost) + }, + AnalyzeCodeFn: wasmtesting.WithoutIBCAnalyzeFn, + CreateFn: wasmtesting.NoOpCreateFn, + } + + // overwrite wasmvm in router + router := baseapp.NewMsgServiceRouter() + router.SetInterfaceRegistry(keepers.EncodingConfig.InterfaceRegistry) + types.RegisterMsgServer(router, NewMsgServerImpl(NewDefaultPermissionKeeper(keeper))) + keeper.messenger = NewDefaultMessageHandler(router, nil, nil, nil, keepers.EncodingConfig.Marshaler, nil) + // overwrite wasmvm in response handler + keeper.wasmVMResponseHandler = NewDefaultWasmVMContractResponseHandler(NewMessageDispatcher(keeper.messenger, keeper)) + + example := StoreRandomContract(t, ctx, keepers, wasmerMock) + // factory contract + callbacks[0] = func(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, initMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.Response, uint64, error) { + t.Log("called factory") + return &wasmvmtypes.Response{Data: []byte("parent"), Messages: []wasmvmtypes.SubMsg{ + { + ID: 1, ReplyOn: wasmvmtypes.ReplyNever, + Msg: wasmvmtypes.CosmosMsg{ + Wasm: &wasmvmtypes.WasmMsg{ + Instantiate: &wasmvmtypes.InstantiateMsg{CodeID: example.CodeID, Msg: []byte(`{}`), Label: "child"}, + }, + }, + }, + }}, 0, nil + } + + // child contract + var capturedSenderAddr string + var capturedCodeInfo []byte + callbacks[1] = func(codeID wasmvm.Checksum, env wasmvmtypes.Env, info wasmvmtypes.MessageInfo, initMsg []byte, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.Response, uint64, error) { + t.Log("called child") + capturedSenderAddr = info.Sender + var err error + capturedCodeInfo, err = querier.Query(wasmvmtypes.QueryRequest{ + Wasm: &wasmvmtypes.WasmQuery{ + ContractInfo: &wasmvmtypes.ContractInfoQuery{ContractAddr: info.Sender}, + }, + }, gasLimit) + require.NoError(t, err) + return &wasmvmtypes.Response{Data: []byte("child")}, 0, nil + } + + // when + parentAddr, data, err := keepers.ContractKeeper.Instantiate(ctx, example.CodeID, example.CreatorAddr, nil, nil, "test", nil) + + // then + require.NoError(t, err) + assert.Equal(t, []byte("parent"), data) + require.Equal(t, parentAddr.String(), capturedSenderAddr) + expCodeInfo := fmt.Sprintf(`{"code_id":%d,"creator":%q,"pinned":false}`, example.CodeID, example.CreatorAddr.String()) + assert.JSONEq(t, expCodeInfo, string(capturedCodeInfo)) +} + func TestExecute(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) accKeeper, keeper, bankKeeper := keepers.AccountKeeper, keepers.ContractKeeper, keepers.BankKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) topUp := sdk.NewCoins(sdk.NewInt64Coin("denom", 5000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit.Add(deposit...)...) - fred := keepers.Faucet.NewFundedAccount(ctx, topUp...) + creator := DeterministicAccountAddress(t, 1) + keepers.Faucet.Fund(ctx, creator, deposit.Add(deposit...)...) + fred := keepers.Faucet.NewFundedRandomAccount(ctx, topUp...) + bob := RandomAccountAddress(t) - contractID, err := keeper.Create(ctx, creator, hackatomWasm, nil) + contractID, _, err := keeper.Create(ctx, creator, hackatomWasm, nil) require.NoError(t, err) - _, _, bob := keyPubAddr() initMsg := HackatomExampleInitMsg{ Verifier: fred, Beneficiary: bob, @@ -625,7 +854,7 @@ func TestExecute(t *testing.T) { // make sure gas is properly deducted from ctx gasAfter := ctx.GasMeter().GasConsumed() if types.EnableGasVerification { - require.Equal(t, uint64(0x16fa0), gasAfter-gasBefore) + require.Equal(t, uint64(0x16c6c), gasAfter-gasBefore) } // ensure bob now exists and got both payments released bobAcct = accKeeper.GetAccount(ctx, bob) @@ -704,7 +933,7 @@ func TestExecuteWithDeposit(t *testing.T) { } for msg, spec := range specs { t.Run(msg, func(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) accKeeper, bankKeeper, keeper := keepers.AccountKeeper, keepers.BankKeeper, keepers.ContractKeeper if spec.newBankParams != nil { bankKeeper.SetParams(ctx, *spec.newBankParams) @@ -712,7 +941,7 @@ func TestExecuteWithDeposit(t *testing.T) { if spec.fundAddr { fundAccounts(t, ctx, accKeeper, bankKeeper, spec.srcActor, sdk.NewCoins(sdk.NewInt64Coin("denom", 200))) } - codeID, err := keeper.Create(ctx, spec.srcActor, hackatomWasm, nil) + codeID, _, err := keeper.Create(ctx, spec.srcActor, hackatomWasm, nil) require.NoError(t, err) initMsg := HackatomExampleInitMsg{Verifier: spec.srcActor, Beneficiary: spec.beneficiary} @@ -738,11 +967,12 @@ func TestExecuteWithDeposit(t *testing.T) { } func TestExecuteWithNonExistingAddress(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.ContractKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit.Add(deposit...)...) + creator := DeterministicAccountAddress(t, 1) + keepers.Faucet.Fund(ctx, creator, deposit.Add(deposit...)...) // unauthorized - trialCtx so we don't change state nonExistingAddress := RandomAccountAddress(t) @@ -751,15 +981,16 @@ func TestExecuteWithNonExistingAddress(t *testing.T) { } func TestExecuteWithPanic(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.ContractKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) topUp := sdk.NewCoins(sdk.NewInt64Coin("denom", 5000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit.Add(deposit...)...) - fred := keepers.Faucet.NewFundedAccount(ctx, topUp...) + creator := DeterministicAccountAddress(t, 1) + keepers.Faucet.Fund(ctx, creator, deposit.Add(deposit...)...) + fred := keepers.Faucet.NewFundedRandomAccount(ctx, topUp...) - contractID, err := keeper.Create(ctx, creator, hackatomWasm, nil) + contractID, _, err := keeper.Create(ctx, creator, hackatomWasm, nil) require.NoError(t, err) _, _, bob := keyPubAddr() @@ -782,15 +1013,16 @@ func TestExecuteWithPanic(t *testing.T) { } func TestExecuteWithCpuLoop(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.ContractKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) topUp := sdk.NewCoins(sdk.NewInt64Coin("denom", 5000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit.Add(deposit...)...) - fred := keepers.Faucet.NewFundedAccount(ctx, topUp...) + creator := DeterministicAccountAddress(t, 1) + keepers.Faucet.Fund(ctx, creator, deposit.Add(deposit...)...) + fred := keepers.Faucet.NewFundedRandomAccount(ctx, topUp...) - contractID, err := keeper.Create(ctx, creator, hackatomWasm, nil) + contractID, _, err := keeper.Create(ctx, creator, hackatomWasm, nil) require.NoError(t, err) _, _, bob := keyPubAddr() @@ -823,15 +1055,16 @@ func TestExecuteWithCpuLoop(t *testing.T) { } func TestExecuteWithStorageLoop(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.ContractKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) topUp := sdk.NewCoins(sdk.NewInt64Coin("denom", 5000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit.Add(deposit...)...) - fred := keepers.Faucet.NewFundedAccount(ctx, topUp...) + creator := DeterministicAccountAddress(t, 1) + keepers.Faucet.Fund(ctx, creator, deposit.Add(deposit...)...) + fred := keepers.Faucet.NewFundedRandomAccount(ctx, topUp...) - contractID, err := keeper.Create(ctx, creator, hackatomWasm, nil) + contractID, _, err := keeper.Create(ctx, creator, hackatomWasm, nil) require.NoError(t, err) _, _, bob := keyPubAddr() @@ -864,19 +1097,25 @@ func TestExecuteWithStorageLoop(t *testing.T) { } func TestMigrate(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + parentCtx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.ContractKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) topUp := sdk.NewCoins(sdk.NewInt64Coin("denom", 5000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit.Add(deposit...)...) - fred := keepers.Faucet.NewFundedAccount(ctx, topUp...) - - originalCodeID := StoreHackatomExampleContract(t, ctx, keepers).CodeID - newCodeID := StoreHackatomExampleContract(t, ctx, keepers).CodeID - ibcCodeID := StoreIBCReflectContract(t, ctx, keepers).CodeID + creator := DeterministicAccountAddress(t, 1) + keepers.Faucet.Fund(parentCtx, creator, deposit.Add(deposit...)...) + fred := DeterministicAccountAddress(t, 2) + keepers.Faucet.Fund(parentCtx, fred, topUp...) + + originalCodeID := StoreHackatomExampleContract(t, parentCtx, keepers).CodeID + newCodeID := StoreHackatomExampleContract(t, parentCtx, keepers).CodeID + ibcCodeID := StoreIBCReflectContract(t, parentCtx, keepers).CodeID require.NotEqual(t, originalCodeID, newCodeID) + restrictedCodeExample := StoreHackatomExampleContract(t, parentCtx, keepers) + require.NoError(t, keeper.SetAccessConfig(parentCtx, restrictedCodeExample.CodeID, restrictedCodeExample.CreatorAddr, types.AllowNobody)) + require.NotEqual(t, originalCodeID, restrictedCodeExample.CodeID) + anyAddr := RandomAccountAddress(t) newVerifierAddr := RandomAccountAddress(t) initMsgBz := HackatomExampleInitMsg{ @@ -954,6 +1193,15 @@ func TestMigrate(t *testing.T) { toCodeID: originalCodeID, expErr: sdkerrors.ErrUnauthorized, }, + "prevent migration when new code is restricted": { + admin: creator, + caller: creator, + initMsg: initMsgBz, + fromCodeID: originalCodeID, + toCodeID: restrictedCodeExample.CodeID, + migrateMsg: migMsgBz, + expErr: sdkerrors.ErrUnauthorized, + }, "fail with non existing code id": { admin: creator, caller: creator, @@ -991,7 +1239,7 @@ func TestMigrate(t *testing.T) { "fail when no IBC callbacks": { admin: fred, caller: fred, - initMsg: IBCReflectInitMsg{ReflectCodeID: StoreReflectContract(t, ctx, keepers)}.GetBytes(t), + initMsg: IBCReflectInitMsg{ReflectCodeID: StoreReflectContract(t, parentCtx, keepers).CodeID}.GetBytes(t), fromCodeID: ibcCodeID, toCodeID: newCodeID, migrateMsg: migMsgBz, @@ -999,10 +1247,13 @@ func TestMigrate(t *testing.T) { }, } + blockHeight := parentCtx.BlockHeight() for msg, spec := range specs { t.Run(msg, func(t *testing.T) { // given a contract instance - ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) + ctx, _ := parentCtx.WithBlockHeight(blockHeight + 1).CacheContext() + blockHeight++ + contractAddr, _, err := keepers.ContractKeeper.Instantiate(ctx, spec.fromCodeID, creator, spec.admin, spec.initMsg, "demo contract", nil) require.NoError(t, err) if spec.overrideContractAddr != nil { @@ -1045,7 +1296,7 @@ func TestMigrate(t *testing.T) { } func TestMigrateReplacesTheSecondIndex(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) example := InstantiateHackatomExampleContract(t, ctx, keepers) // then assert a second index exists @@ -1079,19 +1330,20 @@ func TestMigrateReplacesTheSecondIndex(t *testing.T) { } func TestMigrateWithDispatchedMessage(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.ContractKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit.Add(deposit...)...) - fred := keepers.Faucet.NewFundedAccount(ctx, sdk.NewInt64Coin("denom", 5000)) + creator := DeterministicAccountAddress(t, 1) + keepers.Faucet.Fund(ctx, creator, deposit.Add(deposit...)...) + fred := keepers.Faucet.NewFundedRandomAccount(ctx, sdk.NewInt64Coin("denom", 5000)) burnerCode, err := os.ReadFile("./testdata/burner.wasm") require.NoError(t, err) - originalContractID, err := keeper.Create(ctx, creator, hackatomWasm, nil) + originalContractID, _, err := keeper.Create(ctx, creator, hackatomWasm, nil) require.NoError(t, err) - burnerContractID, err := keeper.Create(ctx, creator, burnerCode, nil) + burnerContractID, _, err := keeper.Create(ctx, creator, burnerCode, nil) require.NoError(t, err) require.NotEqual(t, originalContractID, burnerContractID) @@ -1164,7 +1416,7 @@ func TestMigrateWithDispatchedMessage(t *testing.T) { } func TestIterateContractsByCode(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) k, c := keepers.WasmKeeper, keepers.ContractKeeper example1 := InstantiateHackatomExampleContract(t, ctx, keepers) ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) @@ -1210,7 +1462,7 @@ func TestIterateContractsByCodeWithMigration(t *testing.T) { return &wasmvmtypes.Response{}, 1, nil }} wasmtesting.MakeInstantiable(&mockWasmVM) - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil, WithWasmEngine(&mockWasmVM)) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities, WithWasmEngine(&mockWasmVM)) k, c := keepers.WasmKeeper, keepers.ContractKeeper example1 := InstantiateHackatomExampleContract(t, ctx, keepers) ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) @@ -1249,13 +1501,14 @@ type stealFundsMsg struct { } func TestSudo(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) accKeeper, keeper, bankKeeper := keepers.AccountKeeper, keepers.ContractKeeper, keepers.BankKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit.Add(deposit...)...) + creator := DeterministicAccountAddress(t, 1) + keepers.Faucet.Fund(ctx, creator, deposit.Add(deposit...)...) - contractID, err := keeper.Create(ctx, creator, hackatomWasm, nil) + contractID, _, err := keeper.Create(ctx, creator, hackatomWasm, nil) require.NoError(t, err) _, _, bob := keyPubAddr() @@ -1332,15 +1585,16 @@ func mustMarshal(t *testing.T, r interface{}) []byte { } func TestUpdateContractAdmin(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + parentCtx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.ContractKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) topUp := sdk.NewCoins(sdk.NewInt64Coin("denom", 5000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit.Add(deposit...)...) - fred := keepers.Faucet.NewFundedAccount(ctx, topUp...) + creator := DeterministicAccountAddress(t, 1) + keepers.Faucet.Fund(parentCtx, creator, deposit.Add(deposit...)...) + fred := keepers.Faucet.NewFundedRandomAccount(parentCtx, topUp...) - originalContractID, err := keeper.Create(ctx, creator, hackatomWasm, nil) + originalContractID, _, err := keeper.Create(parentCtx, creator, hackatomWasm, nil) require.NoError(t, err) _, _, anyAddr := keyPubAddr() @@ -1383,6 +1637,7 @@ func TestUpdateContractAdmin(t *testing.T) { } for msg, spec := range specs { t.Run(msg, func(t *testing.T) { + ctx, _ := parentCtx.CacheContext() addr, _, err := keepers.ContractKeeper.Instantiate(ctx, originalContractID, creator, spec.instAdmin, initMsgBz, "demo contract", nil) require.NoError(t, err) if spec.overrideContractAddr != nil { @@ -1400,15 +1655,16 @@ func TestUpdateContractAdmin(t *testing.T) { } func TestClearContractAdmin(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + parentCtx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.ContractKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) topUp := sdk.NewCoins(sdk.NewInt64Coin("denom", 5000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit.Add(deposit...)...) - fred := keepers.Faucet.NewFundedAccount(ctx, topUp...) + creator := DeterministicAccountAddress(t, 1) + keepers.Faucet.Fund(parentCtx, creator, deposit.Add(deposit...)...) + fred := keepers.Faucet.NewFundedRandomAccount(parentCtx, topUp...) - originalContractID, err := keeper.Create(ctx, creator, hackatomWasm, nil) + originalContractID, _, err := keeper.Create(parentCtx, creator, hackatomWasm, nil) require.NoError(t, err) _, _, anyAddr := keyPubAddr() @@ -1446,6 +1702,7 @@ func TestClearContractAdmin(t *testing.T) { } for msg, spec := range specs { t.Run(msg, func(t *testing.T) { + ctx, _ := parentCtx.CacheContext() addr, _, err := keepers.ContractKeeper.Instantiate(ctx, originalContractID, creator, spec.instAdmin, initMsgBz, "demo contract", nil) require.NoError(t, err) if spec.overrideContractAddr != nil { @@ -1463,18 +1720,18 @@ func TestClearContractAdmin(t *testing.T) { } func TestExecuteManualInactiveContractFailure(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.ContractKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) topUp := sdk.NewCoins(sdk.NewInt64Coin("denom", 5000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit...) - fred := keepers.Faucet.NewFundedAccount(ctx, topUp...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) + fred := keepers.Faucet.NewFundedRandomAccount(ctx, topUp...) wasmCode, err := os.ReadFile("./testdata/hackatom.wasm") require.NoError(t, err) - contractID, err := keeper.Create(ctx, creator, wasmCode, nil) + contractID, _, err := keeper.Create(ctx, creator, wasmCode, nil) require.NoError(t, err) _, _, bob := keyPubAddr() @@ -1491,7 +1748,7 @@ func TestExecuteManualInactiveContractFailure(t *testing.T) { } func TestPinCode(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) k := keepers.WasmKeeper var capturedChecksums []wasmvm.Checksum @@ -1518,7 +1775,7 @@ func TestPinCode(t *testing.T) { } func TestUnpinCode(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) k := keepers.WasmKeeper var capturedChecksums []wasmvm.Checksum @@ -1552,7 +1809,7 @@ func TestUnpinCode(t *testing.T) { } func TestInitializePinnedCodes(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) k := keepers.WasmKeeper var capturedChecksums []wasmvm.Checksum @@ -1592,7 +1849,7 @@ func TestPinnedContractLoops(t *testing.T) { // a pinned contract that calls itself via submessages should terminate with an // error at some point - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil, WithWasmEngine(&mock)) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities, WithWasmEngine(&mock)) k := keepers.WasmKeeper example := SeedNewContractInstance(t, ctx, keepers, &mock) @@ -1618,7 +1875,7 @@ func TestPinnedContractLoops(t *testing.T) { }, }, 0, nil } - ctx = ctx.WithGasMeter(sdk.NewGasMeter(21000)) + ctx = ctx.WithGasMeter(sdk.NewGasMeter(20000)) require.PanicsWithValue(t, sdk.ErrorOutOfGas{Descriptor: "ReadFlat"}, func() { _, err := k.execute(ctx, example.Contract, RandomAccountAddress(t), anyMsg, nil) require.NoError(t, err) @@ -1688,9 +1945,7 @@ func TestNewDefaultWasmVMContractResponseHandler(t *testing.T) { } for name, spec := range specs { t.Run(name, func(t *testing.T) { - var ( - msgs []wasmvmtypes.SubMsg - ) + var msgs []wasmvmtypes.SubMsg var mock wasmtesting.MockMsgDispatcher spec.setup(&mock) d := NewDefaultWasmVMContractResponseHandler(&mock) @@ -1710,7 +1965,7 @@ func TestNewDefaultWasmVMContractResponseHandler(t *testing.T) { } func TestReply(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) k := keepers.WasmKeeper var mock wasmtesting.MockWasmer wasmtesting.MakeInstantiable(&mock) @@ -1735,7 +1990,7 @@ func TestReply(t *testing.T) { Bank: &wasmvmtypes.BankQuery{ Balance: &wasmvmtypes.BalanceQuery{Address: env.Contract.Address, Denom: "stake"}, }, - }, 1_000_000*types.DefaultGasMultiplier) + }, 1_000_000*DefaultGasMultiplier) require.NoError(t, err) var gotBankRsp wasmvmtypes.BalanceResponse require.NoError(t, json.Unmarshal(bzRsp, &gotBankRsp)) @@ -1779,7 +2034,7 @@ func TestReply(t *testing.T) { } func TestQueryIsolation(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) k := keepers.WasmKeeper var mock wasmtesting.MockWasmer wasmtesting.MakeInstantiable(&mock) @@ -1799,7 +2054,7 @@ func TestQueryIsolation(t *testing.T) { mock.ReplyFn = func(codeID wasmvm.Checksum, env wasmvmtypes.Env, reply wasmvmtypes.Reply, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.Response, uint64, error) { _, err := querier.Query(wasmvmtypes.QueryRequest{ Custom: []byte(`{}`), - }, 1_000_000*types.DefaultGasMultiplier) + }, 1_000_000*DefaultGasMultiplier) require.NoError(t, err) return &wasmvmtypes.Response{}, 0, nil } @@ -1809,137 +2064,179 @@ func TestQueryIsolation(t *testing.T) { assert.Nil(t, ctx.KVStore(k.storeKey).Get([]byte(`set_in_query`))) } -func TestBuildContractAddress(t *testing.T) { +func TestSetAccessConfig(t *testing.T) { + parentCtx, keepers := CreateTestInput(t, false, AvailableCapabilities) + k := keepers.WasmKeeper + creatorAddr := RandomAccountAddress(t) + nonCreatorAddr := RandomAccountAddress(t) + specs := map[string]struct { - srcCodeID uint64 - srcInstanceID uint64 - expectedAddr string + authz AuthorizationPolicy + chainPermission types.AccessType + newConfig types.AccessConfig + caller sdk.AccAddress + expErr bool }{ - "initial contract": { - srcCodeID: 1, - srcInstanceID: 1, - expectedAddr: "link14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sgf2vn8", - }, - "demo value": { - srcCodeID: 1, - srcInstanceID: 100, - expectedAddr: "link1mujpjkwhut9yjw4xueyugc02evfv46y0dtmnz4lh8xxkkdapym9skz93hr", - }, - "both below max": { - srcCodeID: math.MaxUint32 - 1, - srcInstanceID: math.MaxUint32 - 1, - }, - "both at max": { - srcCodeID: math.MaxUint32, - srcInstanceID: math.MaxUint32, - }, - "codeID > max u32": { - srcCodeID: math.MaxUint32 + 1, - srcInstanceID: 17, - expectedAddr: "link1673hrexz4h6s0ft04l96ygq667djzh2nsr335kstjp49x5dk6rps5267na", - }, - "instanceID > max u32": { - srcCodeID: 22, - srcInstanceID: math.MaxUint32 + 1, - expectedAddr: "link10q3pgfvmeyy0veekgtqhxujxkhz0vm9zmalqgc7evrhj68q3l62q7nceel", + "user with new permissions == chain permissions": { + authz: DefaultAuthorizationPolicy{}, + chainPermission: types.AccessTypeEverybody, + newConfig: types.AllowEverybody, + caller: creatorAddr, + }, + "user with new permissions < chain permissions": { + authz: DefaultAuthorizationPolicy{}, + chainPermission: types.AccessTypeEverybody, + newConfig: types.AllowNobody, + caller: creatorAddr, + }, + "user with new permissions > chain permissions": { + authz: DefaultAuthorizationPolicy{}, + chainPermission: types.AccessTypeNobody, + newConfig: types.AllowEverybody, + caller: creatorAddr, + expErr: true, + }, + "different actor": { + authz: DefaultAuthorizationPolicy{}, + chainPermission: types.AccessTypeEverybody, + newConfig: types.AllowEverybody, + caller: nonCreatorAddr, + expErr: true, + }, + "gov with new permissions == chain permissions": { + authz: GovAuthorizationPolicy{}, + chainPermission: types.AccessTypeEverybody, + newConfig: types.AllowEverybody, + caller: creatorAddr, + }, + "gov with new permissions < chain permissions": { + authz: GovAuthorizationPolicy{}, + chainPermission: types.AccessTypeEverybody, + newConfig: types.AllowNobody, + caller: creatorAddr, + }, + "gov with new permissions > chain permissions": { + authz: GovAuthorizationPolicy{}, + chainPermission: types.AccessTypeNobody, + newConfig: types.AccessTypeOnlyAddress.With(creatorAddr), + caller: creatorAddr, + }, + "gov without actor": { + authz: GovAuthorizationPolicy{}, + chainPermission: types.AccessTypeEverybody, + newConfig: types.AllowEverybody, }, } + const codeID = 1 for name, spec := range specs { t.Run(name, func(t *testing.T) { - gotAddr := BuildContractAddress(spec.srcCodeID, spec.srcInstanceID) - require.NotNil(t, gotAddr) - assert.Nil(t, sdk.VerifyAddressFormat(gotAddr)) - if len(spec.expectedAddr) > 0 { - require.Equal(t, spec.expectedAddr, gotAddr.String()) + ctx, _ := parentCtx.CacheContext() + newParams := types.DefaultParams() + newParams.InstantiateDefaultPermission = spec.chainPermission + k.SetParams(ctx, newParams) + + k.storeCodeInfo(ctx, codeID, types.NewCodeInfo(nil, creatorAddr, types.AllowNobody)) + // when + gotErr := k.setAccessConfig(ctx, codeID, spec.caller, spec.newConfig, spec.authz) + if spec.expErr { + require.Error(t, gotErr) + return } + require.NoError(t, gotErr) }) } } -func TestActivateContract(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) - - k := keepers.WasmKeeper - var mock wasmtesting.MockWasmer - wasmtesting.MakeInstantiable(&mock) - example := SeedNewContractInstance(t, ctx, keepers, &mock) - em := sdk.NewEventManager() - - // request no contract address -> fail - err := k.activateContract(ctx, example.CreatorAddr) - require.Error(t, err, fmt.Sprintf("no contract %s", example.CreatorAddr)) - - // try to activate an activated contract -> fail - err = k.activateContract(ctx.WithEventManager(em), example.Contract) - require.Error(t, err, fmt.Sprintf("no inactivate contract %s", example.Contract)) - - // add to inactive contract - err = k.deactivateContract(ctx, example.Contract) - require.NoError(t, err) - - // try to activate an inactivated contract -> success - err = k.activateContract(ctx, example.Contract) - require.NoError(t, err) +func TestAppendToContractHistory(t *testing.T) { + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) + var contractAddr sdk.AccAddress = rand.Bytes(types.ContractAddrLen) + var orderedEntries []types.ContractCodeHistoryEntry + + f := fuzz.New().Funcs(ModelFuzzers...) + for i := 0; i < 10; i++ { + var entry types.ContractCodeHistoryEntry + f.Fuzz(&entry) + keepers.WasmKeeper.appendToContractHistory(ctx, contractAddr, entry) + orderedEntries = append(orderedEntries, entry) + } + // when + gotHistory := keepers.WasmKeeper.GetContractHistory(ctx, contractAddr) + assert.Equal(t, orderedEntries, gotHistory) } -func TestDeactivateContract(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) +func TestCoinBurnerPruneBalances(t *testing.T) { + parentCtx, keepers := CreateTestInput(t, false, AvailableCapabilities) + amts := sdk.NewCoins(sdk.NewInt64Coin("denom", 100)) + senderAddr := keepers.Faucet.NewFundedRandomAccount(parentCtx, amts...) - k := keepers.WasmKeeper - var mock wasmtesting.MockWasmer - wasmtesting.MakeInstantiable(&mock) - example := SeedNewContractInstance(t, ctx, keepers, &mock) - em := sdk.NewEventManager() - - // request no contract address -> fail - err := k.deactivateContract(ctx, example.CreatorAddr) - require.Error(t, err, fmt.Sprintf("no contract %s", example.CreatorAddr)) - - // success case - err = k.deactivateContract(ctx, example.Contract) + // create vesting account + var vestingAddr sdk.AccAddress = rand.Bytes(types.ContractAddrLen) + msgCreateVestingAccount := vestingtypes.NewMsgCreateVestingAccount(senderAddr, vestingAddr, amts, time.Now().Add(time.Minute).Unix(), false) + _, err := vesting.NewMsgServerImpl(keepers.AccountKeeper, keepers.BankKeeper).CreateVestingAccount(sdk.WrapSDKContext(parentCtx), msgCreateVestingAccount) require.NoError(t, err) + myVestingAccount := keepers.AccountKeeper.GetAccount(parentCtx, vestingAddr) + require.NotNil(t, myVestingAccount) - // already inactivate contract -> fail - err = k.deactivateContract(ctx.WithEventManager(em), example.Contract) - require.Error(t, err, fmt.Sprintf("already inactivate contract %s", example.Contract)) -} - -func TestIterateInactiveContracts(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) - k := keepers.WasmKeeper - - var mock wasmtesting.MockWasmer - wasmtesting.MakeInstantiable(&mock) - example1 := SeedNewContractInstance(t, ctx, keepers, &mock) - ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) - example2 := SeedNewContractInstance(t, ctx, keepers, &mock) - ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) - - err := k.deactivateContract(ctx, example1.Contract) - require.NoError(t, err) - err = k.deactivateContract(ctx, example2.Contract) - require.NoError(t, err) + specs := map[string]struct { + setupAcc func(t *testing.T, ctx sdk.Context) authtypes.AccountI + expBalances sdk.Coins + expHandled bool + expErr *sdkerrors.Error + }{ + "vesting account - all removed": { + setupAcc: func(t *testing.T, ctx sdk.Context) authtypes.AccountI { return myVestingAccount }, + expBalances: sdk.NewCoins(), + expHandled: true, + }, + "vesting account with other tokens - only original denoms removed": { + setupAcc: func(t *testing.T, ctx sdk.Context) authtypes.AccountI { + keepers.Faucet.Fund(ctx, vestingAddr, sdk.NewCoin("other", sdk.NewInt(2))) + return myVestingAccount + }, + expBalances: sdk.NewCoins(sdk.NewCoin("other", sdk.NewInt(2))), + expHandled: true, + }, + "non vesting account - not handled": { + setupAcc: func(t *testing.T, ctx sdk.Context) authtypes.AccountI { + return &authtypes.BaseAccount{Address: myVestingAccount.GetAddress().String()} + }, + expBalances: sdk.NewCoins(sdk.NewCoin("denom", sdk.NewInt(100))), + expHandled: false, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + ctx, _ := parentCtx.CacheContext() + existingAccount := spec.setupAcc(t, ctx) + // overwrite account in store as in keeper before calling prune + keepers.AccountKeeper.SetAccount(ctx, keepers.AccountKeeper.NewAccountWithAddress(ctx, vestingAddr)) - var inactiveContracts []sdk.AccAddress - k.IterateInactiveContracts(ctx, func(contractAddress sdk.AccAddress) (stop bool) { - inactiveContracts = append(inactiveContracts, contractAddress) - return false - }) - assert.Equal(t, 2, len(inactiveContracts)) - expectList := []sdk.AccAddress{example1.Contract, example2.Contract} - assert.ElementsMatch(t, expectList, inactiveContracts) + // when + noGasCtx := ctx.WithGasMeter(sdk.NewGasMeter(0)) // should not use callers gas + gotHandled, gotErr := NewVestingCoinBurner(keepers.BankKeeper).CleanupExistingAccount(noGasCtx, existingAccount) + // then + if spec.expErr != nil { + require.ErrorIs(t, gotErr, spec.expErr) + return + } + require.NoError(t, gotErr) + assert.Equal(t, spec.expBalances, keepers.BankKeeper.GetAllBalances(ctx, vestingAddr)) + assert.Equal(t, spec.expHandled, gotHandled) + // and no out of gas panic + }) + } } func TestKeeper_GetByteCode(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.ContractKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) em := sdk.NewEventManager() - _, err := keeper.Create(ctx.WithEventManager(em), creator, hackatomWasm, nil) + _, _, err := keeper.Create(ctx.WithEventManager(em), creator, hackatomWasm, nil) require.NoError(t, err) tests := []struct { diff --git a/x/wasm/keeper/legacy_querier.go b/x/wasm/keeper/legacy_querier.go index 59f9a481f1..66a6efeee1 100644 --- a/x/wasm/keeper/legacy_querier.go +++ b/x/wasm/keeper/legacy_querier.go @@ -5,9 +5,10 @@ import ( "reflect" "strconv" + abci "github.com/tendermint/tendermint/abci/types" + sdk "github.com/line/lbm-sdk/types" sdkerrors "github.com/line/lbm-sdk/types/errors" - abci "github.com/line/ostracon/abci/types" "github.com/line/wasmd/x/wasm/types" ) @@ -19,8 +20,6 @@ const ( QueryGetCode = "code" QueryListCode = "list-code" QueryContractHistory = "contract-history" - QueryInactiveContracts = "inactive-contracts" - QueryIsInactiveContract = "inactive-contract" ) const ( @@ -73,16 +72,6 @@ func NewLegacyQuerier(keeper types.ViewKeeper, gasLimit sdk.Gas) sdk.Querier { } //nolint:staticcheck rsp, err = queryContractHistory(ctx, contractAddr, keeper) - case QueryInactiveContracts: - //nolint:staticcheck - rsp = queryInactiveContracts(ctx, keeper) - case QueryIsInactiveContract: - contractAddr, addrErr := sdk.AccAddressFromBech32(path[1]) - if addrErr != nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, addrErr.Error()) - } - //nolint:staticcheck - rsp = keeper.IsInactiveContract(ctx, contractAddr) default: return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "unknown data query endpoint") } @@ -171,12 +160,3 @@ func queryContractListByCode(ctx sdk.Context, codeID uint64, keeper types.ViewKe }) return contracts } - -func queryInactiveContracts(ctx sdk.Context, keeper types.ViewKeeper) []string { - var contracts []string - keeper.IterateInactiveContracts(ctx, func(contractAddress sdk.AccAddress) bool { - contracts = append(contracts, contractAddress.String()) - return false - }) - return contracts -} diff --git a/x/wasm/keeper/legacy_querier_test.go b/x/wasm/keeper/legacy_querier_test.go index 76dbbadcab..18fdc313b8 100644 --- a/x/wasm/keeper/legacy_querier_test.go +++ b/x/wasm/keeper/legacy_querier_test.go @@ -10,25 +10,25 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" sdk "github.com/line/lbm-sdk/types" - abci "github.com/line/ostracon/abci/types" "github.com/line/wasmd/x/wasm/types" ) func TestLegacyQueryContractState(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.WasmKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit.Add(deposit...)...) - anyAddr := keepers.Faucet.NewFundedAccount(ctx, sdk.NewInt64Coin("denom", 5000)) + 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) + contractID, _, err := keepers.ContractKeeper.Create(ctx, creator, wasmCode, nil) require.NoError(t, err) _, _, bob := keyPubAddr() @@ -155,18 +155,18 @@ func TestLegacyQueryContractState(t *testing.T) { } func TestLegacyQueryContractListByCodeOrdering(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + 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.NewFundedAccount(ctx, deposit.Add(deposit...)...) - anyAddr := keepers.Faucet.NewFundedAccount(ctx, topUp...) + 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) + codeID, _, err := keepers.ContractKeeper.Create(ctx, creator, wasmCode, nil) require.NoError(t, err) _, _, bob := keyPubAddr() @@ -219,7 +219,7 @@ func TestLegacyQueryContractListByCodeOrdering(t *testing.T) { } func TestLegacyQueryContractHistory(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.WasmKeeper var otherAddr sdk.AccAddress = bytes.Repeat([]byte{0x2}, types.ContractAddrLen) @@ -330,7 +330,7 @@ func TestLegacyQueryCodeList(t *testing.T) { for msg, spec := range specs { t.Run(msg, func(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.WasmKeeper for _, codeID := range spec.codeIDs { diff --git a/x/wasm/keeper/msg_dispatcher.go b/x/wasm/keeper/msg_dispatcher.go index 0b56701c18..83b507aa0a 100644 --- a/x/wasm/keeper/msg_dispatcher.go +++ b/x/wasm/keeper/msg_dispatcher.go @@ -1,11 +1,14 @@ package keeper import ( + "bytes" "fmt" + "sort" + + abci "github.com/tendermint/tendermint/abci/types" sdk "github.com/line/lbm-sdk/types" sdkerrors "github.com/line/lbm-sdk/types/errors" - abci "github.com/line/ostracon/abci/types" wasmvmtypes "github.com/line/wasmvm/types" "github.com/line/wasmd/x/wasm/types" @@ -107,6 +110,16 @@ func (d MessageDispatcher) DispatchSubmessages(ctx sdk.Context, contractAddr sdk commit() filteredEvents = filterEvents(append(em.Events(), events...)) ctx.EventManager().EmitEvents(filteredEvents) + if msg.Msg.Wasm == nil { + filteredEvents = []sdk.Event{} + } else { + 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 + }) + } + } } // on failure, revert state from sandbox, and ignore events (just skip doing the above) // we only callback if requested. Short-circuit here the cases we don't want to diff --git a/x/wasm/keeper/msg_dispatcher_test.go b/x/wasm/keeper/msg_dispatcher_test.go index 8c3e4bb115..c2e1296352 100644 --- a/x/wasm/keeper/msg_dispatcher_test.go +++ b/x/wasm/keeper/msg_dispatcher_test.go @@ -7,9 +7,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" sdk "github.com/line/lbm-sdk/types" - abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/libs/log" wasmvmtypes "github.com/line/wasmvm/types" @@ -295,8 +295,9 @@ func TestDispatchSubmessages(t *testing.T) { expCommits: []bool{true}, expEvents: []sdk.Event{sdk.NewEvent("execute", sdk.NewAttribute("foo", "bar"))}, }, - "reply gets proper events": { - msgs: []wasmvmtypes.SubMsg{{ID: 1, ReplyOn: wasmvmtypes.ReplyAlways}}, + "wasm reply gets proper events": { + // put fake wasmmsg in here to show where it comes from + msgs: []wasmvmtypes.SubMsg{{ID: 1, ReplyOn: wasmvmtypes.ReplyAlways, Msg: wasmvmtypes.CosmosMsg{Wasm: &wasmvmtypes.WasmMsg{}}}}, replyer: &mockReplyer{ replyFn: func(ctx sdk.Context, contractAddress sdk.AccAddress, reply wasmvmtypes.Reply) ([]byte, error) { if reply.Result.Err != "" { @@ -342,6 +343,48 @@ func TestDispatchSubmessages(t *testing.T) { sdk.NewEvent("wasm-reply"), }, }, + "non-wasm reply events get filtered": { + // show events from a stargate message gets filtered out + msgs: []wasmvmtypes.SubMsg{{ID: 1, ReplyOn: wasmvmtypes.ReplyAlways, Msg: wasmvmtypes.CosmosMsg{Stargate: &wasmvmtypes.StargateMsg{}}}}, + replyer: &mockReplyer{ + replyFn: func(ctx sdk.Context, contractAddress sdk.AccAddress, reply wasmvmtypes.Reply) ([]byte, error) { + if reply.Result.Err != "" { + return nil, errors.New(reply.Result.Err) + } + res := reply.Result.Ok + + // ensure the input events are what we expect + // I didn't use require.Equal() to act more like a contract... but maybe that would be better + if len(res.Events) != 0 { + return nil, errors.New("events not filtered out") + } + + // let's add a custom event here and see if it makes it out + ctx.EventManager().EmitEvent(sdk.NewEvent("stargate-reply")) + + // update data from what we got in + return res.Data, nil + }, + }, + msgHandler: &wasmtesting.MockMessageHandler{ + DispatchMsgFn: func(ctx sdk.Context, contractAddr sdk.AccAddress, contractIBCPortID string, msg wasmvmtypes.CosmosMsg) (events []sdk.Event, data [][]byte, err error) { + events = []sdk.Event{ + // this is filtered out + sdk.NewEvent("message", sdk.NewAttribute("stargate", "something-something")), + // we still emit this to the client, but not the contract + sdk.NewEvent("non-determinstic"), + } + return events, [][]byte{[]byte("subData")}, nil + }, + }, + expData: []byte("subData"), + expCommits: []bool{true}, + expEvents: []sdk.Event{ + sdk.NewEvent("non-determinstic"), + // the event from reply is also exposed + sdk.NewEvent("stargate-reply"), + }, + }, } for name, spec := range specs { t.Run(name, func(t *testing.T) { diff --git a/x/wasm/keeper/msg_server.go b/x/wasm/keeper/msg_server.go index 5cef0f2bfa..9706ca5f2c 100644 --- a/x/wasm/keeper/msg_server.go +++ b/x/wasm/keeper/msg_server.go @@ -6,7 +6,6 @@ import ( sdk "github.com/line/lbm-sdk/types" sdkerrors "github.com/line/lbm-sdk/types/errors" - "github.com/line/wasmd/x/wasm/lbmtypes" "github.com/line/wasmd/x/wasm/types" ) @@ -21,6 +20,9 @@ func NewMsgServerImpl(k types.ContractOpsKeeper) types.MsgServer { } func (m msgServer) StoreCode(goCtx context.Context, msg *types.MsgStoreCode) (*types.MsgStoreCodeResponse, error) { + if err := msg.ValidateBasic(); err != nil { + return nil, err + } ctx := sdk.UnwrapSDKContext(goCtx) senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { @@ -33,17 +35,22 @@ func (m msgServer) StoreCode(goCtx context.Context, msg *types.MsgStoreCode) (*t sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), )) - codeID, err := m.keeper.Create(ctx, senderAddr, msg.WASMByteCode, msg.InstantiatePermission) + codeID, checksum, err := m.keeper.Create(ctx, senderAddr, msg.WASMByteCode, msg.InstantiatePermission) if err != nil { return nil, err } return &types.MsgStoreCodeResponse{ - CodeID: codeID, + CodeID: codeID, + Checksum: checksum, }, nil } +// InstantiateContract instantiate a new contract with classic sequence based address generation func (m msgServer) InstantiateContract(goCtx context.Context, msg *types.MsgInstantiateContract) (*types.MsgInstantiateContractResponse, error) { + if err := msg.ValidateBasic(); err != nil { + return nil, err + } ctx := sdk.UnwrapSDKContext(goCtx) senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) @@ -74,16 +81,22 @@ func (m msgServer) InstantiateContract(goCtx context.Context, msg *types.MsgInst }, nil } -func (m msgServer) StoreCodeAndInstantiateContract(goCtx context.Context, - msg *lbmtypes.MsgStoreCodeAndInstantiateContract) (*lbmtypes.MsgStoreCodeAndInstantiateContractResponse, error) { +// InstantiateContract2 instantiate a new contract with predicatable address generated +func (m msgServer) InstantiateContract2(goCtx context.Context, msg *types.MsgInstantiateContract2) (*types.MsgInstantiateContract2Response, error) { + if err := msg.ValidateBasic(); err != nil { + return nil, err + } ctx := sdk.UnwrapSDKContext(goCtx) + senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { return nil, sdkerrors.Wrap(err, "sender") } - codeID, err := m.keeper.Create(ctx, senderAddr, msg.WASMByteCode, msg.InstantiatePermission) - if err != nil { - return nil, err + var adminAddr sdk.AccAddress + if msg.Admin != "" { + if adminAddr, err = sdk.AccAddressFromBech32(msg.Admin); err != nil { + return nil, sdkerrors.Wrap(err, "admin") + } } ctx.EventManager().EmitEvent(sdk.NewEvent( @@ -91,29 +104,22 @@ func (m msgServer) StoreCodeAndInstantiateContract(goCtx context.Context, sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), )) - - var adminAddr sdk.AccAddress - if msg.Admin != "" { - adminAddr, err = sdk.AccAddressFromBech32(msg.Admin) - if err != nil { - return nil, sdkerrors.Wrap(err, "admin") - } - } - - contractAddr, data, err := m.keeper.Instantiate(ctx, codeID, senderAddr, adminAddr, msg.Msg, - msg.Label, msg.Funds) + contractAddr, data, err := m.keeper.Instantiate2(ctx, msg.CodeID, senderAddr, adminAddr, msg.Msg, msg.Label, msg.Funds, msg.Salt, msg.FixMsg) if err != nil { return nil, err } - return &lbmtypes.MsgStoreCodeAndInstantiateContractResponse{ - CodeID: codeID, + return &types.MsgInstantiateContract2Response{ Address: contractAddr.String(), Data: data, }, nil } func (m msgServer) ExecuteContract(goCtx context.Context, msg *types.MsgExecuteContract) (*types.MsgExecuteContractResponse, error) { + if err := msg.ValidateBasic(); err != nil { + return nil, err + } + ctx := sdk.UnwrapSDKContext(goCtx) senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { @@ -141,6 +147,10 @@ func (m msgServer) ExecuteContract(goCtx context.Context, msg *types.MsgExecuteC } func (m msgServer) MigrateContract(goCtx context.Context, msg *types.MsgMigrateContract) (*types.MsgMigrateContractResponse, error) { + if err := msg.ValidateBasic(); err != nil { + return nil, err + } + ctx := sdk.UnwrapSDKContext(goCtx) senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { @@ -168,6 +178,10 @@ func (m msgServer) MigrateContract(goCtx context.Context, msg *types.MsgMigrateC } func (m msgServer) UpdateAdmin(goCtx context.Context, msg *types.MsgUpdateAdmin) (*types.MsgUpdateAdminResponse, error) { + if err := msg.ValidateBasic(); err != nil { + return nil, err + } + ctx := sdk.UnwrapSDKContext(goCtx) senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { @@ -196,6 +210,10 @@ func (m msgServer) UpdateAdmin(goCtx context.Context, msg *types.MsgUpdateAdmin) } func (m msgServer) ClearAdmin(goCtx context.Context, msg *types.MsgClearAdmin) (*types.MsgClearAdminResponse, error) { + if err := msg.ValidateBasic(); err != nil { + return nil, err + } + ctx := sdk.UnwrapSDKContext(goCtx) senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) if err != nil { diff --git a/x/wasm/keeper/msg_server_integration_test.go b/x/wasm/keeper/msg_server_integration_test.go new file mode 100644 index 0000000000..e9fc5ce0cd --- /dev/null +++ b/x/wasm/keeper/msg_server_integration_test.go @@ -0,0 +1,46 @@ +package keeper_test + +import ( + "crypto/sha256" + _ "embed" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + "github.com/line/lbm-sdk/testutil/testdata" + + "github.com/line/wasmd/app" + "github.com/line/wasmd/x/wasm/types" +) + +//go:embed testdata/reflect.wasm +var wasmContract []byte + +func TestStoreCode(t *testing.T) { + wasmApp := app.Setup(false) + ctx := wasmApp.BaseApp.NewContext(false, tmproto.Header{}) + _, _, sender := testdata.KeyTestPubAddr() + msg := types.MsgStoreCodeFixture(func(m *types.MsgStoreCode) { + m.WASMByteCode = wasmContract + m.Sender = sender.String() + }) + + // when + rsp, err := wasmApp.MsgServiceRouter().Handler(msg)(ctx, msg) + + // then + require.NoError(t, err) + var result types.MsgStoreCodeResponse + require.NoError(t, wasmApp.AppCodec().Unmarshal(rsp.Data, &result)) + assert.Equal(t, uint64(1), result.CodeID) + expHash := sha256.Sum256(wasmContract) + assert.Equal(t, expHash[:], result.Checksum) + // and + info := wasmApp.WasmKeeper.GetCodeInfo(ctx, 1) + assert.NotNil(t, info) + assert.Equal(t, expHash[:], info.CodeHash) + assert.Equal(t, sender.String(), info.Creator) + assert.Equal(t, types.DefaultParams().InstantiateDefaultPermission.With(sender), info.InstantiateConfig) +} diff --git a/x/wasm/keeper/options.go b/x/wasm/keeper/options.go index fe0b45672a..65673ab462 100644 --- a/x/wasm/keeper/options.go +++ b/x/wasm/keeper/options.go @@ -2,9 +2,12 @@ package keeper import ( "fmt" + "reflect" "github.com/prometheus/client_golang/prometheus" + authtypes "github.com/line/lbm-sdk/x/auth/types" + "github.com/line/wasmd/x/wasm/types" ) @@ -89,35 +92,80 @@ func WithMessageEncoders(x *MessageEncoders) Option { // WithCoinTransferrer is an optional constructor parameter to set a custom coin transferrer func WithCoinTransferrer(x CoinTransferrer) Option { + if x == nil { + panic("must not be nil") + } return optsFn(func(k *Keeper) { k.bank = x }) } -func WithVMCacheMetrics(r prometheus.Registerer) Option { +// WithAccountPruner is an optional constructor parameter to set a custom type that handles balances and data cleanup +// for accounts pruned on contract instantiate +func WithAccountPruner(x AccountPruner) Option { + if x == nil { + panic("must not be nil") + } return optsFn(func(k *Keeper) { - NewWasmVMCacheMetricsCollector(k.wasmVM).Register(r) + k.accountPruner = x }) } -func WithVMMetrics(provider MetricsProvider) Option { +func WithVMCacheMetrics(r prometheus.Registerer) Option { return optsFn(func(k *Keeper) { - k.metrics = provider() + NewWasmVMCacheMetricsCollector(k.wasmVM).Register(r) }) } // WithGasRegister set a new gas register to implement custom gas costs. // When the "gas multiplier" for wasmvm gas conversion is modified inside the new register, // make sure to also use `WithApiCosts` option for non default values -func WithGasRegister(x WasmGasRegister) Option { +func WithGasRegister(x GasRegister) Option { + if x == nil { + panic("must not be nil") + } return optsFn(func(k *Keeper) { k.gasRegister = x }) } +// WithAPICosts sets custom api costs. Amounts are in cosmwasm gas Not SDK gas. +func WithAPICosts(human, canonical uint64) Option { + return optsFn(func(_ *Keeper) { + costHumanize = human + costCanonical = canonical + }) +} + // WithMaxQueryStackSize overwrites the default limit for maximum query stacks func WithMaxQueryStackSize(m uint32) Option { return optsFn(func(k *Keeper) { k.maxQueryStackSize = m }) } + +// WithAcceptedAccountTypesOnContractInstantiation sets the accepted account types. Account types of this list won't be overwritten or cause a failure +// when they exist for an address on contract instantiation. +// +// Values should be references and contain the `*authtypes.BaseAccount` as default bank account type. +func WithAcceptedAccountTypesOnContractInstantiation(accts ...authtypes.AccountI) Option { + m := asTypeMap(accts) + return optsFn(func(k *Keeper) { + k.acceptedAccountTypes = m + }) +} + +func asTypeMap(accts []authtypes.AccountI) map[reflect.Type]struct{} { + m := make(map[reflect.Type]struct{}, len(accts)) + for _, a := range accts { + if a == nil { + panic(types.ErrEmpty.Wrap("address")) + } + at := reflect.TypeOf(a) + if _, exists := m[at]; exists { + panic(types.ErrDuplicate.Wrapf("%T", a)) + } + m[at] = struct{}{} + } + return m +} diff --git a/x/wasm/keeper/options_test.go b/x/wasm/keeper/options_test.go index cf2f29e1d2..0b2278af80 100644 --- a/x/wasm/keeper/options_test.go +++ b/x/wasm/keeper/options_test.go @@ -1,12 +1,15 @@ package keeper import ( + "reflect" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" authkeeper "github.com/line/lbm-sdk/x/auth/keeper" + authtypes "github.com/line/lbm-sdk/x/auth/types" + vestingtypes "github.com/line/lbm-sdk/x/auth/vesting/types" bankpluskeeper "github.com/line/lbm-sdk/x/bankplus/keeper" distributionkeeper "github.com/line/lbm-sdk/x/distribution/keeper" paramtypes "github.com/line/lbm-sdk/x/params/types" @@ -63,18 +66,52 @@ func TestConstructorOptions(t *testing.T) { assert.IsType(t, &wasmtesting.MockCoinTransferrer{}, k.bank) }, }, + "costs": { + srcOpt: WithGasRegister(&wasmtesting.MockGasRegister{}), + verify: func(t *testing.T, k Keeper) { + assert.IsType(t, &wasmtesting.MockGasRegister{}, k.gasRegister) + }, + }, + "api costs": { + srcOpt: WithAPICosts(1, 2), + verify: func(t *testing.T, k Keeper) { + t.Cleanup(setApiDefaults) + assert.Equal(t, uint64(1), costHumanize) + assert.Equal(t, uint64(2), costCanonical) + }, + }, "max recursion query limit": { srcOpt: WithMaxQueryStackSize(1), verify: func(t *testing.T, k Keeper) { assert.IsType(t, uint32(1), k.maxQueryStackSize) }, }, + "accepted account types": { + srcOpt: WithAcceptedAccountTypesOnContractInstantiation(&authtypes.BaseAccount{}, &vestingtypes.ContinuousVestingAccount{}), + verify: func(t *testing.T, k Keeper) { + exp := map[reflect.Type]struct{}{ + reflect.TypeOf(&authtypes.BaseAccount{}): {}, + reflect.TypeOf(&vestingtypes.ContinuousVestingAccount{}): {}, + } + assert.Equal(t, exp, k.acceptedAccountTypes) + }, + }, + "account pruner": { + srcOpt: WithAccountPruner(VestingCoinBurner{}), + verify: func(t *testing.T, k Keeper) { + assert.Equal(t, VestingCoinBurner{}, k.accountPruner) + }, + }, } for name, spec := range specs { t.Run(name, func(t *testing.T) { - k := NewKeeper(nil, nil, paramtypes.NewSubspace(nil, nil, nil, nil, ""), authkeeper.AccountKeeper{}, bankpluskeeper.BaseKeeper{}, stakingkeeper.Keeper{}, distributionkeeper.Keeper{}, nil, nil, nil, nil, nil, nil, "tempDir", types.DefaultWasmConfig(), SupportedFeatures, nil, nil, spec.srcOpt) + k := NewKeeper(nil, nil, paramtypes.NewSubspace(nil, nil, nil, nil, ""), authkeeper.AccountKeeper{}, bankpluskeeper.BaseKeeper{}, stakingkeeper.Keeper{}, distributionkeeper.Keeper{}, nil, nil, nil, nil, nil, nil, "tempDir", types.DefaultWasmConfig(), AvailableCapabilities, &mockpluskeeper{}, spec.srcOpt) spec.verify(t, k) }) } +} +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 e86d9e9ad1..55f1cd1c0c 100644 --- a/x/wasm/keeper/proposal_handler.go +++ b/x/wasm/keeper/proposal_handler.go @@ -7,7 +7,6 @@ import ( sdkerrors "github.com/line/lbm-sdk/types/errors" govtypes "github.com/line/lbm-sdk/x/gov/types" - "github.com/line/wasmd/x/wasm/lbmtypes" "github.com/line/wasmd/x/wasm/types" ) @@ -50,10 +49,6 @@ func NewWasmProposalHandlerX(k types.ContractOpsKeeper, enabledProposalTypes []t return handleUnpinCodesProposal(ctx, k, *c) case *types.UpdateInstantiateConfigProposal: return handleUpdateInstantiateConfigProposal(ctx, k, *c) - case *lbmtypes.DeactivateContractProposal: - return handleDeactivateContractProposal(ctx, k, *c) - case *lbmtypes.ActivateContractProposal: - return handleActivateContractProposal(ctx, k, *c) default: return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized wasm proposal content type: %T", c) } @@ -69,10 +64,15 @@ func handleStoreCodeProposal(ctx sdk.Context, k types.ContractOpsKeeper, p types if err != nil { return sdkerrors.Wrap(err, "run as address") } - codeID, err := k.Create(ctx, runAsAddr, p.WASMByteCode, p.InstantiatePermission) + codeID, _, err := k.Create(ctx, runAsAddr, p.WASMByteCode, p.InstantiatePermission) if err != nil { return err } + + // if code should not be pinned return earlier + if p.UnpinCode { + return nil + } return k.PinCode(ctx, codeID) } @@ -112,6 +112,7 @@ func handleMigrateProposal(ctx sdk.Context, k types.ContractOpsKeeper, p types.M if err != nil { return sdkerrors.Wrap(err, "contract") } + // runAs is not used if this is permissioned, so just put any valid address there (second contractAddr) data, err := k.Migrate(ctx, contractAddr, contractAddr, p.CodeID, p.Msg) if err != nil { @@ -223,7 +224,6 @@ func handleUnpinCodesProposal(ctx sdk.Context, k types.ContractOpsKeeper, p type return sdkerrors.Wrapf(err, "code id: %d", v) } } - return nil } @@ -232,56 +232,11 @@ func handleUpdateInstantiateConfigProposal(ctx sdk.Context, k types.ContractOpsK return err } + var emptyCaller sdk.AccAddress for _, accessConfigUpdate := range p.AccessConfigUpdates { - if err := k.SetAccessConfig(ctx, accessConfigUpdate.CodeID, accessConfigUpdate.InstantiatePermission); err != nil { + if err := k.SetAccessConfig(ctx, accessConfigUpdate.CodeID, emptyCaller, accessConfigUpdate.InstantiatePermission); err != nil { return sdkerrors.Wrapf(err, "code id: %d", accessConfigUpdate.CodeID) } } return nil } - -func handleDeactivateContractProposal(ctx sdk.Context, k types.ContractOpsKeeper, p lbmtypes.DeactivateContractProposal) error { - if err := p.ValidateBasic(); err != nil { - return err - } - - // The error is already checked in ValidateBasic. - //nolint:errcheck - contractAddr, _ := sdk.AccAddressFromBech32(p.Contract) - - err := k.DeactivateContract(ctx, contractAddr) - if err != nil { - return err - } - - event := lbmtypes.EventDeactivateContractProposal{ - Contract: contractAddr.String(), - } - if err := ctx.EventManager().EmitTypedEvent(&event); err != nil { - return err - } - - return nil -} - -func handleActivateContractProposal(ctx sdk.Context, k types.ContractOpsKeeper, p lbmtypes.ActivateContractProposal) error { - if err := p.ValidateBasic(); err != nil { - return err - } - - // The error is already checked in ValidateBasic. - //nolint:errcheck - contractAddr, _ := sdk.AccAddressFromBech32(p.Contract) - - err := k.ActivateContract(ctx, contractAddr) - if err != nil { - return err - } - - event := lbmtypes.EventActivateContractProposal{Contract: contractAddr.String()} - if err := ctx.EventManager().EmitTypedEvent(&event); err != nil { - return nil - } - - return nil -} diff --git a/x/wasm/keeper/proposal_integration_test.go b/x/wasm/keeper/proposal_integration_test.go index 5c9a58e55a..42cfde6cad 100644 --- a/x/wasm/keeper/proposal_integration_test.go +++ b/x/wasm/keeper/proposal_integration_test.go @@ -18,59 +18,70 @@ import ( wasmvm "github.com/line/wasmvm" "github.com/line/wasmd/x/wasm/keeper/wasmtesting" - "github.com/line/wasmd/x/wasm/lbmtypes" "github.com/line/wasmd/x/wasm/types" ) func TestStoreCodeProposal(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, "staking", nil, nil) + parentCtx, keepers := CreateTestInput(t, false, "staking") govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper - wasmKeeper.SetParams(ctx, types.Params{ + wasmKeeper.SetParams(parentCtx, types.Params{ CodeUploadAccess: types.AllowNobody, InstantiateDefaultPermission: types.AccessTypeNobody, - GasMultiplier: types.DefaultGasMultiplier, - InstanceCost: types.DefaultInstanceCost, - CompileCost: types.DefaultCompileCost, }) wasmCode, err := os.ReadFile("./testdata/hackatom.wasm") require.NoError(t, err) - myActorAddress := RandomBech32AccountAddress(t) + specs := map[string]struct { + codeID int64 + unpinCode bool + }{ + "upload with pinning (default)": { + unpinCode: false, + }, + "upload with code unpin": { + unpinCode: true, + }, + } - src := types.StoreCodeProposalFixture(func(p *types.StoreCodeProposal) { - p.RunAs = myActorAddress - p.WASMByteCode = wasmCode - }) + for msg, spec := range specs { + t.Run(msg, func(t *testing.T) { + ctx, _ := parentCtx.CacheContext() + myActorAddress := RandomBech32AccountAddress(t) - // when stored - storedProposal, err := govKeeper.SubmitProposal(ctx, src) - require.NoError(t, err) + src := types.StoreCodeProposalFixture(func(p *types.StoreCodeProposal) { + p.RunAs = myActorAddress + p.WASMByteCode = wasmCode + p.UnpinCode = spec.unpinCode + }) - // and proposal execute - handler := govKeeper.Router().GetRoute(storedProposal.ProposalRoute()) - err = handler(ctx, storedProposal.GetContent()) - require.NoError(t, err) + // when stored + storedProposal, err := govKeeper.SubmitProposal(ctx, src) + require.NoError(t, err) - // then - cInfo := wasmKeeper.GetCodeInfo(ctx, 1) - require.NotNil(t, cInfo) - assert.Equal(t, myActorAddress, cInfo.Creator) - assert.True(t, wasmKeeper.IsPinnedCode(ctx, 1)) + // and proposal execute + handler := govKeeper.Router().GetRoute(storedProposal.ProposalRoute()) + err = handler(ctx, storedProposal.GetContent()) + require.NoError(t, err) - storedCode, err := wasmKeeper.GetByteCode(ctx, 1) - require.NoError(t, err) - assert.Equal(t, wasmCode, storedCode) + // then + cInfo := wasmKeeper.GetCodeInfo(ctx, 1) + require.NotNil(t, cInfo) + assert.Equal(t, myActorAddress, cInfo.Creator) + assert.Equal(t, !spec.unpinCode, wasmKeeper.IsPinnedCode(ctx, 1)) + + storedCode, err := wasmKeeper.GetByteCode(ctx, 1) + require.NoError(t, err) + assert.Equal(t, wasmCode, storedCode) + }) + } } func TestInstantiateProposal(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, "staking", nil, nil) + ctx, keepers := CreateTestInput(t, false, "staking") govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper wasmKeeper.SetParams(ctx, types.Params{ CodeUploadAccess: types.AllowNobody, InstantiateDefaultPermission: types.AccessTypeNobody, - GasMultiplier: types.DefaultGasMultiplier, - InstanceCost: types.DefaultInstanceCost, - CompileCost: types.DefaultCompileCost, }) wasmCode, err := os.ReadFile("./testdata/hackatom.wasm") @@ -131,14 +142,11 @@ func TestInstantiateProposal(t *testing.T) { } func TestInstantiateProposal_NoAdmin(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, "staking", nil, nil) + ctx, keepers := CreateTestInput(t, false, "staking") govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper wasmKeeper.SetParams(ctx, types.Params{ CodeUploadAccess: types.AllowNobody, InstantiateDefaultPermission: types.AccessTypeNobody, - GasMultiplier: types.DefaultGasMultiplier, - InstanceCost: types.DefaultInstanceCost, - CompileCost: types.DefaultCompileCost, }) wasmCode, err := os.ReadFile("./testdata/hackatom.wasm") @@ -206,14 +214,11 @@ func TestInstantiateProposal_NoAdmin(t *testing.T) { } func TestMigrateProposal(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, "staking", nil, nil) + ctx, keepers := CreateTestInput(t, false, "staking") govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper wasmKeeper.SetParams(ctx, types.Params{ CodeUploadAccess: types.AllowNobody, InstantiateDefaultPermission: types.AccessTypeNobody, - GasMultiplier: types.DefaultGasMultiplier, - InstanceCost: types.DefaultInstanceCost, - CompileCost: types.DefaultCompileCost, }) wasmCode, err := os.ReadFile("./testdata/hackatom.wasm") @@ -224,9 +229,9 @@ func TestMigrateProposal(t *testing.T) { require.NoError(t, wasmKeeper.importCode(ctx, 2, codeInfoFixture, wasmCode)) var ( - anyAddress sdk.AccAddress = bytes.Repeat([]byte{0x1}, types.ContractAddrLen) - otherAddress sdk.AccAddress = bytes.Repeat([]byte{0x2}, types.ContractAddrLen) - contractAddr = BuildContractAddress(1, 1) + anyAddress = DeterministicAccountAddress(t, 1) + otherAddress = DeterministicAccountAddress(t, 2) + contractAddr = BuildContractAddressClassic(1, 1) ) contractInfoFixture := types.ContractInfoFixture(func(c *types.ContractInfo) { @@ -290,7 +295,7 @@ func TestMigrateProposal(t *testing.T) { } func TestExecuteProposal(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, "staking", nil, nil) + ctx, keepers := CreateTestInput(t, false, "staking") govKeeper, bankKeeper := keepers.GovKeeper, keepers.BankKeeper exampleContract := InstantiateHackatomExampleContract(t, ctx, keepers) @@ -350,7 +355,7 @@ func TestExecuteProposal(t *testing.T) { } func TestSudoProposal(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, "staking", nil, nil) + ctx, keepers := CreateTestInput(t, false, "staking") govKeeper, bankKeeper := keepers.GovKeeper, keepers.BankKeeper exampleContract := InstantiateHackatomExampleContract(t, ctx, keepers) @@ -405,7 +410,7 @@ func TestSudoProposal(t *testing.T) { func TestAdminProposals(t *testing.T) { var ( otherAddress sdk.AccAddress = bytes.Repeat([]byte{0x2}, types.ContractAddrLen) - contractAddr = BuildContractAddress(1, 1) + contractAddr = BuildContractAddressClassic(1, 1) ) wasmCode, err := os.ReadFile("./testdata/hackatom.wasm") require.NoError(t, err) @@ -460,14 +465,11 @@ func TestAdminProposals(t *testing.T) { } for msg, spec := range specs { t.Run(msg, func(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, "staking", nil, nil) + ctx, keepers := CreateTestInput(t, false, "staking") govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper wasmKeeper.SetParams(ctx, types.Params{ CodeUploadAccess: types.AllowNobody, InstantiateDefaultPermission: types.AccessTypeNobody, - GasMultiplier: types.DefaultGasMultiplier, - InstanceCost: types.DefaultInstanceCost, - CompileCost: types.DefaultCompileCost, }) codeInfoFixture := types.CodeInfoFixture(types.WithSHA256CodeHash(wasmCode)) @@ -492,7 +494,7 @@ func TestAdminProposals(t *testing.T) { } func TestUpdateParamsProposal(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, "staking", nil, nil) + ctx, keepers := CreateTestInput(t, false, "staking") govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper var ( @@ -589,7 +591,7 @@ func TestUpdateParamsProposal(t *testing.T) { } func TestPinCodesProposal(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, "staking", nil, nil) + ctx, keepers := CreateTestInput(t, false, "staking") govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper mock := wasmtesting.MockWasmer{ @@ -677,7 +679,7 @@ func TestPinCodesProposal(t *testing.T) { } func TestUnpinCodesProposal(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, "staking", nil, nil) + ctx, keepers := CreateTestInput(t, false, "staking") govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper mock := wasmtesting.MockWasmer{ @@ -765,7 +767,7 @@ func TestUnpinCodesProposal(t *testing.T) { } func TestUpdateInstantiateConfigProposal(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, "staking", nil, nil) + ctx, keepers := CreateTestInput(t, false, "staking") govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper mock := wasmtesting.MockWasmer{ @@ -857,66 +859,3 @@ func TestUpdateInstantiateConfigProposal(t *testing.T) { }) } } - -func TestValidateDeactivateContractProposal(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, "staking", nil, nil) - govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper - - var mock wasmtesting.MockWasmer - wasmtesting.MakeInstantiable(&mock) - example := SeedNewContractInstance(t, ctx, keepers, &mock) - - src := lbmtypes.DeactivateContractProposal{ - Title: "Foo", - Description: "Bar", - Contract: example.Contract.String(), - } - - em := sdk.NewEventManager() - - // when stored - storedProposal, err := govKeeper.SubmitProposal(ctx, &src) - require.NoError(t, err) - - // proposal execute - handler := govKeeper.Router().GetRoute(storedProposal.ProposalRoute()) - err = handler(ctx.WithEventManager(em), storedProposal.GetContent()) - require.NoError(t, err) - - // then - isInactive := wasmKeeper.IsInactiveContract(ctx, example.Contract) - require.True(t, isInactive) -} - -func TestActivateContractProposal(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, "staking", nil, nil) - govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper - - var mock wasmtesting.MockWasmer - wasmtesting.MakeInstantiable(&mock) - example := SeedNewContractInstance(t, ctx, keepers, &mock) - // set deactivate - err := wasmKeeper.deactivateContract(ctx, example.Contract) - require.NoError(t, err) - - src := lbmtypes.ActivateContractProposal{ - Title: "Foo", - Description: "Bar", - Contract: example.Contract.String(), - } - - em := sdk.NewEventManager() - - // when stored - storedProposal, err := govKeeper.SubmitProposal(ctx, &src) - require.NoError(t, err) - - // proposal execute - handler := govKeeper.Router().GetRoute(storedProposal.ProposalRoute()) - err = handler(ctx.WithEventManager(em), storedProposal.GetContent()) - require.NoError(t, err) - - // then - isInactive := wasmKeeper.IsInactiveContract(ctx, example.Contract) - require.False(t, isInactive) -} diff --git a/x/wasm/keeper/querier.go b/x/wasm/keeper/querier.go index 0728135ac7..c5c316ca1a 100644 --- a/x/wasm/keeper/querier.go +++ b/x/wasm/keeper/querier.go @@ -14,13 +14,12 @@ import ( sdkerrors "github.com/line/lbm-sdk/types/errors" "github.com/line/lbm-sdk/types/query" - "github.com/line/wasmd/x/wasm/lbmtypes" "github.com/line/wasmd/x/wasm/types" ) -var _ types.QueryServer = &GrpcQuerier{} +var _ types.QueryServer = &grpcQuerier{} -type GrpcQuerier struct { +type grpcQuerier struct { cdc codec.Codec storeKey sdk.StoreKey keeper types.ViewKeeper @@ -28,11 +27,11 @@ type GrpcQuerier struct { } // NewGrpcQuerier constructor -func NewGrpcQuerier(cdc codec.Codec, storeKey sdk.StoreKey, keeper types.ViewKeeper, queryGasLimit sdk.Gas) *GrpcQuerier { //nolint:revive - return &GrpcQuerier{cdc: cdc, storeKey: storeKey, keeper: keeper, queryGasLimit: queryGasLimit} +func NewGrpcQuerier(cdc codec.Codec, storeKey sdk.StoreKey, keeper types.ViewKeeper, queryGasLimit sdk.Gas) *grpcQuerier { //nolint:revive + return &grpcQuerier{cdc: cdc, storeKey: storeKey, keeper: keeper, queryGasLimit: queryGasLimit} } -func (q GrpcQuerier) ContractInfo(c context.Context, req *types.QueryContractInfoRequest) (*types.QueryContractInfoResponse, error) { +func (q grpcQuerier) ContractInfo(c context.Context, req *types.QueryContractInfoRequest) (*types.QueryContractInfoResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -50,7 +49,7 @@ func (q GrpcQuerier) ContractInfo(c context.Context, req *types.QueryContractInf return rsp, nil } -func (q GrpcQuerier) ContractHistory(c context.Context, req *types.QueryContractHistoryRequest) (*types.QueryContractHistoryResponse, error) { +func (q grpcQuerier) ContractHistory(c context.Context, req *types.QueryContractHistoryRequest) (*types.QueryContractHistoryResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -84,7 +83,7 @@ func (q GrpcQuerier) ContractHistory(c context.Context, req *types.QueryContract } // ContractsByCode lists all smart contracts for a code id -func (q GrpcQuerier) ContractsByCode(c context.Context, req *types.QueryContractsByCodeRequest) (*types.QueryContractsByCodeResponse, error) { +func (q grpcQuerier) ContractsByCode(c context.Context, req *types.QueryContractsByCodeRequest) (*types.QueryContractsByCodeResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -111,7 +110,7 @@ func (q GrpcQuerier) ContractsByCode(c context.Context, req *types.QueryContract }, nil } -func (q GrpcQuerier) AllContractState(c context.Context, req *types.QueryAllContractStateRequest) (*types.QueryAllContractStateResponse, error) { +func (q grpcQuerier) AllContractState(c context.Context, req *types.QueryAllContractStateRequest) (*types.QueryAllContractStateResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -144,7 +143,7 @@ func (q GrpcQuerier) AllContractState(c context.Context, req *types.QueryAllCont }, nil } -func (q GrpcQuerier) RawContractState(c context.Context, req *types.QueryRawContractStateRequest) (*types.QueryRawContractStateResponse, error) { +func (q grpcQuerier) RawContractState(c context.Context, req *types.QueryRawContractStateRequest) (*types.QueryRawContractStateResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -162,7 +161,7 @@ func (q GrpcQuerier) RawContractState(c context.Context, req *types.QueryRawCont return &types.QueryRawContractStateResponse{Data: rsp}, nil } -func (q GrpcQuerier) SmartContractState(c context.Context, req *types.QuerySmartContractStateRequest) (rsp *types.QuerySmartContractStateResponse, err error) { +func (q grpcQuerier) SmartContractState(c context.Context, req *types.QuerySmartContractStateRequest) (rsp *types.QuerySmartContractStateResponse, err error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -205,7 +204,7 @@ func (q GrpcQuerier) SmartContractState(c context.Context, req *types.QuerySmart return &types.QuerySmartContractStateResponse{Data: bz}, nil } -func (q GrpcQuerier) Code(c context.Context, req *types.QueryCodeRequest) (*types.QueryCodeResponse, error) { +func (q grpcQuerier) Code(c context.Context, req *types.QueryCodeRequest) (*types.QueryCodeResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -225,7 +224,7 @@ func (q GrpcQuerier) Code(c context.Context, req *types.QueryCodeRequest) (*type }, nil } -func (q GrpcQuerier) Codes(c context.Context, req *types.QueryCodesRequest) (*types.QueryCodesResponse, error) { +func (q grpcQuerier) Codes(c context.Context, req *types.QueryCodesRequest) (*types.QueryCodesResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -290,7 +289,7 @@ func queryCode(ctx sdk.Context, codeID uint64, keeper types.ViewKeeper) (*types. return &types.QueryCodeResponse{CodeInfoResponse: &info, Data: code}, nil } -func (q GrpcQuerier) PinnedCodes(c context.Context, req *types.QueryPinnedCodesRequest) (*types.QueryPinnedCodesResponse, error) { +func (q grpcQuerier) PinnedCodes(c context.Context, req *types.QueryPinnedCodesRequest) (*types.QueryPinnedCodesResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") } @@ -313,47 +312,9 @@ func (q GrpcQuerier) PinnedCodes(c context.Context, req *types.QueryPinnedCodesR }, nil } -func (q GrpcQuerier) InactiveContracts(c context.Context, req *lbmtypes.QueryInactiveContractsRequest) (*lbmtypes.QueryInactiveContractsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") - } +// Params returns params of the module. +func (q grpcQuerier) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { ctx := sdk.UnwrapSDKContext(c) - - addresses := make([]string, 0) - prefixStore := prefix.NewStore(ctx.KVStore(q.storeKey), types.InactiveContractPrefix) - pageRes, err := query.FilteredPaginate(prefixStore, req.Pagination, func(key []byte, value []byte, accumulate bool) (bool, error) { - if accumulate { - contractAddress := sdk.AccAddress(value) - addresses = append(addresses, contractAddress.String()) - } - return true, nil - }) - if err != nil { - return nil, err - } - return &lbmtypes.QueryInactiveContractsResponse{ - Addresses: addresses, - Pagination: pageRes, - }, nil -} - -func (q GrpcQuerier) InactiveContract(c context.Context, req *lbmtypes.QueryInactiveContractRequest) (*lbmtypes.QueryInactiveContractResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") - } - ctx := sdk.UnwrapSDKContext(c) - - contractAddr, err := sdk.AccAddressFromBech32(req.Address) - if err != nil { - return nil, err - } - - if !q.keeper.HasContractInfo(ctx, contractAddr) { - return nil, types.ErrNotFound - } - - inactivated := q.keeper.IsInactiveContract(ctx, contractAddr) - return &lbmtypes.QueryInactiveContractResponse{ - Inactivated: inactivated, - }, nil + params := q.keeper.GetParams(ctx) + return &types.QueryParamsResponse{Params: params}, nil } diff --git a/x/wasm/keeper/querier_test.go b/x/wasm/keeper/querier_test.go index 3b84c44ab3..b1b5c4b802 100644 --- a/x/wasm/keeper/querier_test.go +++ b/x/wasm/keeper/querier_test.go @@ -23,12 +23,11 @@ import ( wasmvmtypes "github.com/line/wasmvm/types" "github.com/line/wasmd/x/wasm/keeper/wasmtesting" - "github.com/line/wasmd/x/wasm/lbmtypes" "github.com/line/wasmd/x/wasm/types" ) func TestQueryAllContractState(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.WasmKeeper exampleContract := InstantiateHackatomExampleContract(t, ctx, keepers) @@ -115,7 +114,7 @@ func TestQueryAllContractState(t *testing.T) { } func TestQuerySmartContractState(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.WasmKeeper exampleContract := InstantiateHackatomExampleContract(t, ctx, keepers) @@ -158,14 +157,14 @@ func TestQuerySmartContractState(t *testing.T) { } func TestQuerySmartContractPanics(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) - contractAddr := BuildContractAddress(1, 1) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) + contractAddr := BuildContractAddressClassic(1, 1) keepers.WasmKeeper.storeCodeInfo(ctx, 1, types.CodeInfo{}) keepers.WasmKeeper.storeContractInfo(ctx, contractAddr, &types.ContractInfo{ CodeID: 1, Created: types.NewAbsoluteTxPosition(ctx), }) - ctx = ctx.WithGasMeter(sdk.NewGasMeter(types.DefaultInstanceCost)).WithLogger(log.TestingLogger()) + ctx = ctx.WithGasMeter(sdk.NewGasMeter(DefaultInstanceCost)).WithLogger(log.TestingLogger()) specs := map[string]struct { doInContract func() @@ -203,7 +202,7 @@ func TestQuerySmartContractPanics(t *testing.T) { } func TestQueryRawContractState(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.WasmKeeper exampleContract := InstantiateHackatomExampleContract(t, ctx, keepers) @@ -258,18 +257,18 @@ func TestQueryRawContractState(t *testing.T) { } func TestQueryContractListByCodeOrdering(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + 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.NewFundedAccount(ctx, deposit...) - anyAddr := keepers.Faucet.NewFundedAccount(ctx, topUp...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, 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) + codeID, _, err := keepers.ContractKeeper.Create(ctx, creator, wasmCode, nil) require.NoError(t, err) _, _, bob := keyPubAddr() @@ -314,7 +313,7 @@ func TestQueryContractListByCodeOrdering(t *testing.T) { } func TestQueryContractHistory(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.WasmKeeper var ( @@ -458,7 +457,7 @@ func TestQueryCode(t *testing.T) { wasmCode, err := os.ReadFile("./testdata/hackatom.wasm") require.NoError(t, err) - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.WasmKeeper codeID := uint64(1) @@ -511,7 +510,7 @@ func TestQueryCodeList(t *testing.T) { wasmCode, err := os.ReadFile("./testdata/hackatom.wasm") require.NoError(t, err) - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.WasmKeeper specs := map[string]struct { @@ -587,7 +586,7 @@ func TestQueryContractInfo(t *testing.T) { contractAddr = RandomAccountAddress(t) anyDate = time.Now().UTC() ) - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) // register an example extension. must be protobuf keepers.EncodingConfig.InterfaceRegistry.RegisterImplementations( (*types.ContractInfoExtension)(nil), @@ -653,7 +652,7 @@ func TestQueryContractInfo(t *testing.T) { } func TestQueryPinnedCodes(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.WasmKeeper exampleContract1 := InstantiateHackatomExampleContract(t, ctx, keepers) @@ -665,11 +664,11 @@ func TestQueryPinnedCodes(t *testing.T) { specs := map[string]struct { srcQuery *types.QueryPinnedCodesRequest expCodeIDs []uint64 - expErr bool + expErr error }{ "req nil": { srcQuery: nil, - expErr: true, + expErr: status.Error(codes.InvalidArgument, "empty request"), }, "query all": { srcQuery: &types.QueryPinnedCodesRequest{}, @@ -690,7 +689,7 @@ func TestQueryPinnedCodes(t *testing.T) { Key: []byte("test"), }, }, - expErr: true, + expErr: fmt.Errorf("invalid request, either offset or key is expected, got both"), }, "with pagination limit": { srcQuery: &types.QueryPinnedCodesRequest{ @@ -712,7 +711,7 @@ func TestQueryPinnedCodes(t *testing.T) { for msg, spec := range specs { t.Run(msg, func(t *testing.T) { got, err := q.PinnedCodes(sdk.WrapSDKContext(ctx), spec.srcQuery) - if spec.expErr { + if spec.expErr != nil { assert.Nil(t, got) assert.NotNil(t, err) @@ -724,11 +723,39 @@ func TestQueryPinnedCodes(t *testing.T) { } } +func TestQueryParams(t *testing.T) { + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) + keeper := keepers.WasmKeeper + + q := Querier(keeper) + + paramsResponse, err := q.Params(sdk.WrapSDKContext(ctx), &types.QueryParamsRequest{}) + require.NoError(t, err) + require.NotNil(t, paramsResponse) + + defaultParams := types.DefaultParams() + + require.Equal(t, paramsResponse.Params.CodeUploadAccess, defaultParams.CodeUploadAccess) + require.Equal(t, paramsResponse.Params.InstantiateDefaultPermission, defaultParams.InstantiateDefaultPermission) + + keeper.SetParams(ctx, types.Params{ + CodeUploadAccess: types.AllowNobody, + InstantiateDefaultPermission: types.AccessTypeNobody, + }) + + paramsResponse, err = q.Params(sdk.WrapSDKContext(ctx), &types.QueryParamsRequest{}) + require.NoError(t, err) + require.NotNil(t, paramsResponse) + + require.Equal(t, paramsResponse.Params.CodeUploadAccess, types.AllowNobody) + require.Equal(t, paramsResponse.Params.InstantiateDefaultPermission, types.AccessTypeNobody) +} + func TestQueryCodeInfo(t *testing.T) { wasmCode, err := os.ReadFile("./testdata/hackatom.wasm") require.NoError(t, err) - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.WasmKeeper anyAddress, err := sdk.AccAddressFromBech32("link1qyqszqgpqyqszqgpqyqszqgpqyqszqgp8apuk5") @@ -780,11 +807,10 @@ func TestQueryCodeInfo(t *testing.T) { } func TestQueryCodeInfoList(t *testing.T) { - wasmCode, err := os.ReadFile("./testdata/hackatom.wasm") require.NoError(t, err) - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) keeper := keepers.WasmKeeper anyAddress, err := sdk.AccAddressFromBech32("link1qyqszqgpqyqszqgpqyqszqgpqyqszqgp8apuk5") @@ -851,54 +877,3 @@ func fromBase64(s string) []byte { } return r } - -func TestQueryInactiveContracts(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) - keeper := keepers.WasmKeeper - - var mock wasmtesting.MockWasmer - wasmtesting.MakeInstantiable(&mock) - example1 := SeedNewContractInstance(t, ctx, keepers, &mock) - ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) - example2 := SeedNewContractInstance(t, ctx, keepers, &mock) - ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) - - // set inactive - err := keeper.deactivateContract(ctx, example1.Contract) - require.NoError(t, err) - err = keeper.deactivateContract(ctx, example2.Contract) - require.NoError(t, err) - - q := Querier(keeper) - rq := lbmtypes.QueryInactiveContractsRequest{} - res, err := q.InactiveContracts(sdk.WrapSDKContext(ctx), &rq) - require.NoError(t, err) - expect := []string{example1.Contract.String(), example2.Contract.String()} - for _, exp := range expect { - assert.Contains(t, res.Addresses, exp) - } -} - -func TestQueryIsInactiveContract(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) - keeper := keepers.WasmKeeper - - var mock wasmtesting.MockWasmer - wasmtesting.MakeInstantiable(&mock) - example := SeedNewContractInstance(t, ctx, keepers, &mock) - - q := Querier(keeper) - rq := lbmtypes.QueryInactiveContractRequest{Address: example.Contract.String()} - res, err := q.InactiveContract(sdk.WrapSDKContext(ctx), &rq) - require.NoError(t, err) - require.False(t, res.Inactivated) - - // set inactive - err = keeper.deactivateContract(ctx, example.Contract) - require.NoError(t, err) - - rq = lbmtypes.QueryInactiveContractRequest{Address: example.Contract.String()} - res, err = q.InactiveContract(sdk.WrapSDKContext(ctx), &rq) - require.NoError(t, err) - require.True(t, res.Inactivated) -} diff --git a/x/wasm/keeper/query_plugins.go b/x/wasm/keeper/query_plugins.go index eaa6295eb7..29a95874a4 100644 --- a/x/wasm/keeper/query_plugins.go +++ b/x/wasm/keeper/query_plugins.go @@ -4,31 +4,32 @@ import ( "encoding/json" "errors" + abci "github.com/tendermint/tendermint/abci/types" + + channeltypes "github.com/line/ibc-go/v3/modules/core/04-channel/types" baseapp "github.com/line/lbm-sdk/baseapp" sdk "github.com/line/lbm-sdk/types" sdkerrors "github.com/line/lbm-sdk/types/errors" distributiontypes "github.com/line/lbm-sdk/x/distribution/types" - channeltypes "github.com/line/lbm-sdk/x/ibc/core/04-channel/types" stakingtypes "github.com/line/lbm-sdk/x/staking/types" - abci "github.com/line/ostracon/abci/types" wasmvmtypes "github.com/line/wasmvm/types" "github.com/line/wasmd/x/wasm/types" ) type QueryHandler struct { - Ctx sdk.Context - Plugins WasmVMQueryHandler - Caller sdk.AccAddress - GasMultiplier GasMultiplier + Ctx sdk.Context + Plugins WasmVMQueryHandler + Caller sdk.AccAddress + gasRegister GasRegister } -func NewQueryHandler(ctx sdk.Context, vmQueryHandler WasmVMQueryHandler, caller sdk.AccAddress, gasMultiplier GasMultiplier) QueryHandler { +func NewQueryHandler(ctx sdk.Context, vmQueryHandler WasmVMQueryHandler, caller sdk.AccAddress, gasRegister GasRegister) QueryHandler { return QueryHandler{ - Ctx: ctx, - Plugins: vmQueryHandler, - Caller: caller, - GasMultiplier: gasMultiplier, + Ctx: ctx, + Plugins: vmQueryHandler, + Caller: caller, + gasRegister: gasRegister, } } @@ -42,7 +43,7 @@ var _ wasmvmtypes.Querier = QueryHandler{} func (q QueryHandler) Query(request wasmvmtypes.QueryRequest, gasLimit uint64) ([]byte, error) { // set a limit for a subCtx - sdkGas := q.GasMultiplier.FromWasmVMGas(gasLimit) + sdkGas := q.gasRegister.FromWasmVMGas(gasLimit) // discard all changes/ events in subCtx by not committing the cached context subCtx, _ := q.Ctx.WithGasMeter(sdk.NewGasMeter(sdkGas)).CacheContext() @@ -188,9 +189,24 @@ func BankQuerier(bankKeeper types.BankViewKeeper) func(ctx sdk.Context, request } return json.Marshal(res) } + if request.Supply != nil { + coin := bankKeeper.GetSupply(ctx, request.Supply.Denom) + res := wasmvmtypes.SupplyResponse{ + Amount: wasmvmtypes.Coin{ + Denom: coin.Denom, + Amount: coin.Amount.String(), + }, + } + return json.Marshal(res) + } return nil, wasmvmtypes.UnsupportedRequest{Kind: "unknown BankQuery variant"} } } + +func NoCustomQuerier(sdk.Context, json.RawMessage) ([]byte, error) { + return nil, wasmvmtypes.UnsupportedRequest{Kind: "custom"} +} + func CustomQuerierImpl(queryRouter GRPCQueryRouter) func(ctx sdk.Context, querierJson json.RawMessage) ([]byte, error) { return func(ctx sdk.Context, querierJson json.RawMessage) ([]byte, error) { var linkQueryWrapper types.LinkQueryWrapper @@ -389,8 +405,7 @@ func sdkToDelegations(ctx sdk.Context, keeper types.StakingKeeper, delegations [ } // shares to amount logic comes from here: - // x/staking/keeper/querier.go DelegationToDelegationResponse - /// https://github.com/cosmos/cosmos-sdk/blob/3ccf3913f53e2a9ccb4be8429bee32e67669e89a/x/staking/keeper/querier.go#L450 + // https://github.com/cosmos/cosmos-sdk/blob/v0.38.3/x/staking/keeper/querier.go#L404 val, found := keeper.GetValidator(ctx, valAddr) if !found { return nil, sdkerrors.Wrap(stakingtypes.ErrNoValidatorFound, "can't load validator for delegation") @@ -425,7 +440,7 @@ func sdkToFullDelegation(ctx sdk.Context, keeper types.StakingKeeper, distKeeper delegationCoins := ConvertSdkCoinToWasmCoin(amount) // FIXME: this is very rough but better than nothing... - // https://github.com/line/lbm-sdk/issues/225 + // https://github.com/CosmWasm/wasmd/issues/282 // if this (val, delegate) pair is receiving a redelegation, it cannot redelegate more // otherwise, it can redelegate the full amount // (there are cases of partial funds redelegated, but this is a start) diff --git a/x/wasm/keeper/query_plugins_test.go b/x/wasm/keeper/query_plugins_test.go index 805df3067b..580349bb67 100644 --- a/x/wasm/keeper/query_plugins_test.go +++ b/x/wasm/keeper/query_plugins_test.go @@ -8,10 +8,10 @@ import ( "github.com/stretchr/testify/require" dbm "github.com/tendermint/tm-db" + channeltypes "github.com/line/ibc-go/v3/modules/core/04-channel/types" "github.com/line/lbm-sdk/store" sdk "github.com/line/lbm-sdk/types" sdkerrors "github.com/line/lbm-sdk/types/errors" - channeltypes "github.com/line/lbm-sdk/x/ibc/core/04-channel/types" wasmvmtypes "github.com/line/wasmvm/types" "github.com/line/wasmd/x/wasm/keeper/wasmtesting" @@ -316,7 +316,6 @@ func TestIBCQuerier(t *testing.T) { assert.JSONEq(t, spec.expJsonResult, string(gotResult), string(gotResult)) }) } - } func TestBankQuerierBalance(t *testing.T) { @@ -466,7 +465,7 @@ func TestQueryErrors(t *testing.T) { return nil, spec.src }) ctx := sdk.Context{}.WithGasMeter(sdk.NewInfiniteGasMeter()).WithMultiStore(store.NewCommitMultiStore(dbm.NewMemDB())) - q := NewQueryHandler(ctx, mock, sdk.AccAddress{}, NewGasMultiplier(types.DefaultGasMultiplier)) + q := NewQueryHandler(ctx, mock, sdk.AccAddress{}, NewDefaultWasmGasRegister()) _, gotErr := q.Query(wasmvmtypes.QueryRequest{}, 1) assert.Equal(t, spec.expErr, gotErr) }) @@ -509,10 +508,18 @@ func (m mockWasmQueryKeeper) IsPinnedCode(ctx sdk.Context, codeID uint64) bool { } type bankKeeperMock struct { + GetSupplyFn func(ctx sdk.Context, denom string) sdk.Coin GetBalanceFn func(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin GetAllBalancesFn func(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins } +func (m bankKeeperMock) GetSupply(ctx sdk.Context, denom string) sdk.Coin { + if m.GetSupplyFn == nil { + panic("not expected to be called") + } + return m.GetSupplyFn(ctx, denom) +} + func (m bankKeeperMock) GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin { if m.GetBalanceFn == nil { panic("not expected to be called") diff --git a/x/wasm/keeper/recurse_test.go b/x/wasm/keeper/recurse_test.go index cd870a4aa1..1ca2f18155 100644 --- a/x/wasm/keeper/recurse_test.go +++ b/x/wasm/keeper/recurse_test.go @@ -6,9 +6,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" sdk "github.com/line/lbm-sdk/types" - abci "github.com/line/ostracon/abci/types" wasmvmtypes "github.com/line/wasmvm/types" "github.com/line/wasmd/x/wasm/types" @@ -45,7 +45,7 @@ func initRecurseContract(t *testing.T) (contract sdk.AccAddress, creator sdk.Acc return realWasmQuerier.HandleQuery(ctx, caller, request) }) } - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil, WithQueryHandlerDecorator(countingQuerierDec)) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities, WithQueryHandlerDecorator(countingQuerierDec)) keeper = keepers.WasmKeeper exampleContract := InstantiateHackatomExampleContract(t, ctx, keepers) return exampleContract.Contract, exampleContract.CreatorAddr, ctx, keeper @@ -58,7 +58,7 @@ func TestGasCostOnQuery(t *testing.T) { GasWork50 uint64 = 64_229 // this is a little shy of 50k gas - to keep an eye on the limit GasReturnUnhashed uint64 = 29 - GasReturnHashed uint64 = 24 + GasReturnHashed uint64 = 23 ) cases := map[string]struct { @@ -91,7 +91,7 @@ func TestGasCostOnQuery(t *testing.T) { Depth: 1, Work: 50, }, - expectedGas: 2*GasWork50 + GasReturnHashed, + expectedGas: 2*GasWork50 + GasReturnHashed + 1, // +1 for rounding }, "recursion 4, some work": { gasLimit: 400_000, @@ -99,7 +99,7 @@ func TestGasCostOnQuery(t *testing.T) { Depth: 4, Work: 50, }, - expectedGas: 5*GasWork50 + 4*GasReturnHashed, + expectedGas: 5*GasWork50 + 4*GasReturnHashed + 4, }, } @@ -140,7 +140,7 @@ func TestGasCostOnQuery(t *testing.T) { func TestGasOnExternalQuery(t *testing.T) { const ( - GasWork50 uint64 = types.DefaultInstanceCost + 8_464 + GasWork50 uint64 = DefaultInstanceCost + 8_464 ) cases := map[string]struct { @@ -218,7 +218,7 @@ func TestLimitRecursiveQueryGas(t *testing.T) { // Note: about 100 SDK gas (10k wasmer gas) for each round of sha256 GasWork2k uint64 = 78_193 // = NewContractInstanceCosts + x // we have 6x gas used in cpu than in the instance // This is overhead for calling into a sub-contract - GasReturnHashed uint64 = 21 + GasReturnHashed uint64 = 26 ) cases := map[string]struct { @@ -246,7 +246,7 @@ func TestLimitRecursiveQueryGas(t *testing.T) { }, expectQueriesFromContract: 5, // FIXME: why -1 ... confused a bit by calculations, seems like rounding issues - expectedGas: GasWork2k + 5*(GasWork2k+GasReturnHashed) + 16, + expectedGas: GasWork2k + 5*(GasWork2k+GasReturnHashed) - 9, }, // this is where we expect an error... // it has enough gas to run 4 times and die on the 5th (4th time dispatching to sub-contract) @@ -270,7 +270,7 @@ func TestLimitRecursiveQueryGas(t *testing.T) { expectQueriesFromContract: 10, expectOutOfGas: false, expectError: "query wasm contract failed", // Error we get from the contract instance doing the failing query, not wasmd - expectedGas: 10*(GasWork2k+GasReturnHashed) - 224, + expectedGas: 10*(GasWork2k+GasReturnHashed) - 274, }, } diff --git a/x/wasm/keeper/reflect_test.go b/x/wasm/keeper/reflect_test.go index 57df48cbd9..fc7c8d295c 100644 --- a/x/wasm/keeper/reflect_test.go +++ b/x/wasm/keeper/reflect_test.go @@ -20,59 +20,13 @@ import ( banktypes "github.com/line/lbm-sdk/x/bank/types" wasmvmtypes "github.com/line/wasmvm/types" + "github.com/line/wasmd/x/wasm/keeper/testdata" "github.com/line/wasmd/x/wasm/types" ) // ReflectInitMsg is {} -// ReflectHandleMsg is used to encode handle messages -type ReflectHandleMsg struct { - Reflect *reflectPayload `json:"reflect_msg,omitempty"` - ReflectSubMsg *reflectSubPayload `json:"reflect_sub_msg,omitempty"` - Change *ownerPayload `json:"change_owner,omitempty"` -} - -type ownerPayload struct { - Owner sdk.Address `json:"owner"` -} - -type reflectPayload struct { - Msgs []wasmvmtypes.CosmosMsg `json:"msgs"` -} - -type reflectSubPayload struct { - Msgs []wasmvmtypes.SubMsg `json:"msgs"` -} - -// ReflectQueryMsg is used to encode query messages -type ReflectQueryMsg struct { - Owner *struct{} `json:"owner,omitempty"` - Capitalized *Text `json:"capitalized,omitempty"` - Chain *ChainQuery `json:"chain,omitempty"` - SubMsgResult *SubCall `json:"sub_msg_result,omitempty"` -} - -type ChainQuery struct { - Request *wasmvmtypes.QueryRequest `json:"request,omitempty"` -} - -type Text struct { - Text string `json:"text"` -} - -type SubCall struct { - ID uint64 `json:"id"` -} - -type OwnerResponse struct { - Owner string `json:"owner,omitempty"` -} - -type ChainResponse struct { - Data []byte `json:"data,omitempty"` -} - -func buildReflectQuery(t *testing.T, query *ReflectQueryMsg) []byte { +func buildReflectQuery(t *testing.T, query *testdata.ReflectQueryMsg) []byte { bz, err := json.Marshal(query) require.NoError(t, err) return bz @@ -83,28 +37,26 @@ func mustParse(t *testing.T, data []byte, res interface{}) { require.NoError(t, err) } -const ReflectFeatures = "staking,mask,stargate" +const ReflectFeatures = "staking,mask,stargate,cosmwasm_1_1" func TestReflectContractSend(t *testing.T) { cdc := MakeEncodingConfig(t).Marshaler - ctx, keepers := CreateTestInput(t, false, ReflectFeatures, nil, nil, WithMessageEncoders(reflectEncoders(cdc))) + ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc))) accKeeper, keeper, bankKeeper := keepers.AccountKeeper, keepers.ContractKeeper, keepers.BankKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) _, _, bob := keyPubAddr() // upload reflect code - reflectCode, err := os.ReadFile("./testdata/reflect.wasm") - require.NoError(t, err) - reflectID, err := keeper.Create(ctx, creator, reflectCode, nil) + reflectID, _, err := keeper.Create(ctx, creator, testdata.ReflectContractWasm(), nil) require.NoError(t, err) require.Equal(t, uint64(1), reflectID) // upload hackatom escrow code escrowCode, err := os.ReadFile("./testdata/hackatom.wasm") require.NoError(t, err) - escrowID, err := keeper.Create(ctx, creator, escrowCode, nil) + escrowID, _, err := keeper.Create(ctx, creator, escrowCode, nil) require.NoError(t, err) require.Equal(t, uint64(2), escrowID) @@ -149,8 +101,8 @@ func TestReflectContractSend(t *testing.T) { }, }, }} - reflectSend := ReflectHandleMsg{ - Reflect: &reflectPayload{ + reflectSend := testdata.ReflectHandleMsg{ + Reflect: &testdata.ReflectPayload{ Msgs: msgs, }, } @@ -168,18 +120,16 @@ func TestReflectContractSend(t *testing.T) { func TestReflectCustomMsg(t *testing.T) { cdc := MakeEncodingConfig(t).Marshaler - ctx, keepers := CreateTestInput(t, false, ReflectFeatures, nil, nil, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins())) + ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins())) accKeeper, keeper, bankKeeper := keepers.AccountKeeper, keepers.ContractKeeper, keepers.BankKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit...) - bob := keepers.Faucet.NewFundedAccount(ctx, deposit...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) + bob := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) _, _, fred := keyPubAddr() // upload code - reflectCode, err := os.ReadFile("./testdata/reflect.wasm") - require.NoError(t, err) - codeID, err := keeper.Create(ctx, creator, reflectCode, nil) + codeID, _, err := keeper.Create(ctx, creator, testdata.ReflectContractWasm(), nil) require.NoError(t, err) require.Equal(t, uint64(1), codeID) @@ -190,8 +140,8 @@ func TestReflectCustomMsg(t *testing.T) { require.NotEmpty(t, contractAddr) // set owner to bob - transfer := ReflectHandleMsg{ - Change: &ownerPayload{ + transfer := testdata.ReflectHandleMsg{ + ChangeOwner: &testdata.OwnerPayload{ Owner: bob, }, } @@ -217,8 +167,8 @@ func TestReflectCustomMsg(t *testing.T) { }, }, }} - reflectSend := ReflectHandleMsg{ - Reflect: &reflectPayload{ + reflectSend := testdata.ReflectHandleMsg{ + Reflect: &testdata.ReflectPayload{ Msgs: msgs, }, } @@ -241,8 +191,8 @@ func TestReflectCustomMsg(t *testing.T) { } opaque, err := toReflectRawMsg(cdc, sdkSendMsg) require.NoError(t, err) - reflectOpaque := ReflectHandleMsg{ - Reflect: &reflectPayload{ + reflectOpaque := testdata.ReflectHandleMsg{ + Reflect: &testdata.ReflectPayload{ Msgs: []wasmvmtypes.CosmosMsg{opaque}, }, } @@ -261,16 +211,14 @@ func TestReflectCustomMsg(t *testing.T) { func TestMaskReflectCustomQuery(t *testing.T) { cdc := MakeEncodingConfig(t).Marshaler - ctx, keepers := CreateTestInput(t, false, ReflectFeatures, nil, nil, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins())) + ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins())) keeper := keepers.WasmKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) // upload code - reflectCode, err := os.ReadFile("./testdata/reflect.wasm") - require.NoError(t, err) - codeID, err := keepers.ContractKeeper.Create(ctx, creator, reflectCode, nil) + codeID, _, err := keepers.ContractKeeper.Create(ctx, creator, testdata.ReflectContractWasm(), nil) require.NoError(t, err) require.Equal(t, uint64(1), codeID) @@ -281,21 +229,21 @@ func TestMaskReflectCustomQuery(t *testing.T) { require.NotEmpty(t, contractAddr) // let's perform a normal query of state - ownerQuery := ReflectQueryMsg{ + ownerQuery := testdata.ReflectQueryMsg{ Owner: &struct{}{}, } ownerQueryBz, err := json.Marshal(ownerQuery) require.NoError(t, err) ownerRes, err := keeper.QuerySmart(ctx, contractAddr, ownerQueryBz) require.NoError(t, err) - var res OwnerResponse + var res testdata.OwnerResponse err = json.Unmarshal(ownerRes, &res) require.NoError(t, err) assert.Equal(t, res.Owner, creator.String()) // and now making use of the custom querier callbacks - customQuery := ReflectQueryMsg{ - Capitalized: &Text{ + customQuery := testdata.ReflectQueryMsg{ + Capitalized: &testdata.Text{ Text: "all Caps noW", }, } @@ -311,18 +259,16 @@ func TestMaskReflectCustomQuery(t *testing.T) { func TestReflectStargateQuery(t *testing.T) { cdc := MakeEncodingConfig(t).Marshaler - ctx, keepers := CreateTestInput(t, false, ReflectFeatures, nil, nil, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins())) + ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins())) keeper := keepers.WasmKeeper funds := sdk.NewCoins(sdk.NewInt64Coin("denom", 320000)) contractStart := sdk.NewCoins(sdk.NewInt64Coin("denom", 40000)) expectedBalance := funds.Sub(contractStart) - creator := keepers.Faucet.NewFundedAccount(ctx, funds...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, funds...) // upload code - reflectCode, err := os.ReadFile("./testdata/reflect.wasm") - require.NoError(t, err) - codeID, err := keepers.ContractKeeper.Create(ctx, creator, reflectCode, nil) + codeID, _, err := keepers.ContractKeeper.Create(ctx, creator, testdata.ReflectContractWasm(), nil) require.NoError(t, err) require.Equal(t, uint64(1), codeID) @@ -339,13 +285,13 @@ func TestReflectStargateQuery(t *testing.T) { }, }, } - simpleQueryBz, err := json.Marshal(ReflectQueryMsg{ - Chain: &ChainQuery{Request: &bankQuery}, + simpleQueryBz, err := json.Marshal(testdata.ReflectQueryMsg{ + Chain: &testdata.ChainQuery{Request: &bankQuery}, }) require.NoError(t, err) simpleRes, err := keeper.QuerySmart(ctx, contractAddr, simpleQueryBz) require.NoError(t, err) - var simpleChain ChainResponse + var simpleChain testdata.ChainResponse mustParse(t, simpleRes, &simpleChain) var simpleBalance wasmvmtypes.AllBalancesResponse mustParse(t, simpleChain.Data, &simpleBalance) @@ -354,19 +300,68 @@ func TestReflectStargateQuery(t *testing.T) { assert.Equal(t, simpleBalance.Amount[0].Denom, expectedBalance[0].Denom) } +func TestReflectTotalSupplyQuery(t *testing.T) { + cdc := MakeEncodingConfig(t).Marshaler + ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins())) + keeper := keepers.WasmKeeper + // upload code + codeID := StoreReflectContract(t, ctx, keepers).CodeID + // creator instantiates a contract and gives it tokens + creator := RandomAccountAddress(t) + contractAddr, _, err := keepers.ContractKeeper.Instantiate(ctx, codeID, creator, nil, []byte("{}"), "testing", nil) + require.NoError(t, err) + + currentStakeSupply := keepers.BankKeeper.GetSupply(ctx, "stake") + require.NotEmpty(t, currentStakeSupply.Amount) // ensure we have real data + specs := map[string]struct { + denom string + expAmount wasmvmtypes.Coin + }{ + "known denom": { + denom: "stake", + expAmount: ConvertSdkCoinToWasmCoin(currentStakeSupply), + }, + "unknown denom": { + denom: "unknown", + expAmount: wasmvmtypes.Coin{Denom: "unknown", Amount: "0"}, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + // when + queryBz := mustMarshal(t, testdata.ReflectQueryMsg{ + Chain: &testdata.ChainQuery{ + Request: &wasmvmtypes.QueryRequest{ + Bank: &wasmvmtypes.BankQuery{ + Supply: &wasmvmtypes.SupplyQuery{spec.denom}, + }, + }, + }, + }) + simpleRes, err := keeper.QuerySmart(ctx, contractAddr, queryBz) + + // then + require.NoError(t, err) + var rsp testdata.ChainResponse + mustParse(t, simpleRes, &rsp) + var supplyRsp wasmvmtypes.SupplyResponse + mustParse(t, rsp.Data, &supplyRsp) + assert.Equal(t, spec.expAmount, supplyRsp.Amount, spec.expAmount) + }) + } +} + func TestReflectInvalidStargateQuery(t *testing.T) { cdc := MakeEncodingConfig(t).Marshaler - ctx, keepers := CreateTestInput(t, false, ReflectFeatures, nil, nil, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins())) + ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins())) keeper := keepers.WasmKeeper funds := sdk.NewCoins(sdk.NewInt64Coin("denom", 320000)) contractStart := sdk.NewCoins(sdk.NewInt64Coin("denom", 40000)) - creator := keepers.Faucet.NewFundedAccount(ctx, funds...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, funds...) // upload code - reflectCode, err := os.ReadFile("./testdata/reflect.wasm") - require.NoError(t, err) - codeID, err := keepers.ContractKeeper.Create(ctx, creator, reflectCode, nil) + codeID, _, err := keepers.ContractKeeper.Create(ctx, creator, testdata.ReflectContractWasm(), nil) require.NoError(t, err) require.Equal(t, uint64(1), codeID) @@ -386,8 +381,8 @@ func TestReflectInvalidStargateQuery(t *testing.T) { Data: protoQueryBin, }, } - protoQueryBz, err := json.Marshal(ReflectQueryMsg{ - Chain: &ChainQuery{Request: &protoRequest}, + protoQueryBz, err := json.Marshal(testdata.ReflectQueryMsg{ + Chain: &testdata.ChainQuery{Request: &protoRequest}, }) require.NoError(t, err) @@ -403,8 +398,8 @@ func TestReflectInvalidStargateQuery(t *testing.T) { Data: []byte{}, }, } - protoQueryBz, err = json.Marshal(ReflectQueryMsg{ - Chain: &ChainQuery{Request: &protoRequest}, + protoQueryBz, err = json.Marshal(testdata.ReflectQueryMsg{ + Chain: &testdata.ChainQuery{Request: &protoRequest}, }) require.NoError(t, err) @@ -420,8 +415,8 @@ func TestReflectInvalidStargateQuery(t *testing.T) { Data: []byte{}, }, } - protoQueryBz, err = json.Marshal(ReflectQueryMsg{ - Chain: &ChainQuery{Request: &protoRequest}, + protoQueryBz, err = json.Marshal(testdata.ReflectQueryMsg{ + Chain: &testdata.ChainQuery{Request: &protoRequest}, }) require.NoError(t, err) @@ -437,16 +432,14 @@ type reflectState struct { func TestMaskReflectWasmQueries(t *testing.T) { cdc := MakeEncodingConfig(t).Marshaler - ctx, keepers := CreateTestInput(t, false, ReflectFeatures, nil, nil, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins())) + ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins())) keeper := keepers.WasmKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) // upload reflect code - reflectCode, err := os.ReadFile("./testdata/reflect.wasm") - require.NoError(t, err) - reflectID, err := keepers.ContractKeeper.Create(ctx, creator, reflectCode, nil) + reflectID, _, err := keepers.ContractKeeper.Create(ctx, creator, testdata.ReflectContractWasm(), nil) require.NoError(t, err) require.Equal(t, uint64(1), reflectID) @@ -457,10 +450,10 @@ func TestMaskReflectWasmQueries(t *testing.T) { require.NotEmpty(t, reflectAddr) // for control, let's make some queries directly on the reflect - ownerQuery := buildReflectQuery(t, &ReflectQueryMsg{Owner: &struct{}{}}) + ownerQuery := buildReflectQuery(t, &testdata.ReflectQueryMsg{Owner: &struct{}{}}) res, err := keeper.QuerySmart(ctx, reflectAddr, ownerQuery) require.NoError(t, err) - var ownerRes OwnerResponse + var ownerRes testdata.OwnerResponse mustParse(t, res, &ownerRes) require.Equal(t, ownerRes.Owner, creator.String()) @@ -472,7 +465,7 @@ func TestMaskReflectWasmQueries(t *testing.T) { require.Equal(t, stateRes.Owner, creator.String()) // now, let's reflect a smart query into the x/wasm handlers and see if we get the same result - reflectOwnerQuery := ReflectQueryMsg{Chain: &ChainQuery{Request: &wasmvmtypes.QueryRequest{Wasm: &wasmvmtypes.WasmQuery{ + reflectOwnerQuery := testdata.ReflectQueryMsg{Chain: &testdata.ChainQuery{Request: &wasmvmtypes.QueryRequest{Wasm: &wasmvmtypes.WasmQuery{ Smart: &wasmvmtypes.SmartQuery{ ContractAddr: reflectAddr.String(), Msg: ownerQuery, @@ -482,14 +475,14 @@ func TestMaskReflectWasmQueries(t *testing.T) { res, err = keeper.QuerySmart(ctx, reflectAddr, reflectOwnerBin) require.NoError(t, err) // first we pull out the data from chain response, before parsing the original response - var reflectRes ChainResponse + var reflectRes testdata.ChainResponse mustParse(t, res, &reflectRes) - var reflectOwnerRes OwnerResponse + var reflectOwnerRes testdata.OwnerResponse mustParse(t, reflectRes.Data, &reflectOwnerRes) require.Equal(t, reflectOwnerRes.Owner, creator.String()) // and with queryRaw - reflectStateQuery := ReflectQueryMsg{Chain: &ChainQuery{Request: &wasmvmtypes.QueryRequest{Wasm: &wasmvmtypes.WasmQuery{ + reflectStateQuery := testdata.ReflectQueryMsg{Chain: &testdata.ChainQuery{Request: &wasmvmtypes.QueryRequest{Wasm: &wasmvmtypes.WasmQuery{ Raw: &wasmvmtypes.RawQuery{ ContractAddr: reflectAddr.String(), Key: configKey, @@ -499,7 +492,7 @@ func TestMaskReflectWasmQueries(t *testing.T) { res, err = keeper.QuerySmart(ctx, reflectAddr, reflectStateBin) require.NoError(t, err) // first we pull out the data from chain response, before parsing the original response - var reflectRawRes ChainResponse + var reflectRawRes testdata.ChainResponse mustParse(t, res, &reflectRawRes) // now, with the raw data, we can parse it into state var reflectStateRes reflectState @@ -509,16 +502,14 @@ func TestMaskReflectWasmQueries(t *testing.T) { func TestWasmRawQueryWithNil(t *testing.T) { cdc := MakeEncodingConfig(t).Marshaler - ctx, keepers := CreateTestInput(t, false, ReflectFeatures, nil, nil, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins())) + ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageEncoders(reflectEncoders(cdc)), WithQueryPlugins(reflectPlugins())) keeper := keepers.WasmKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) // upload reflect code - reflectCode, err := os.ReadFile("./testdata/reflect.wasm") - require.NoError(t, err) - reflectID, err := keepers.ContractKeeper.Create(ctx, creator, reflectCode, nil) + reflectID, _, err := keepers.ContractKeeper.Create(ctx, creator, testdata.ReflectContractWasm(), nil) require.NoError(t, err) require.Equal(t, uint64(1), reflectID) @@ -534,7 +525,7 @@ func TestWasmRawQueryWithNil(t *testing.T) { require.Nil(t, raw) // and with queryRaw - reflectQuery := ReflectQueryMsg{Chain: &ChainQuery{Request: &wasmvmtypes.QueryRequest{Wasm: &wasmvmtypes.WasmQuery{ + reflectQuery := testdata.ReflectQueryMsg{Chain: &testdata.ChainQuery{Request: &wasmvmtypes.QueryRequest{Wasm: &wasmvmtypes.WasmQuery{ Raw: &wasmvmtypes.RawQuery{ ContractAddr: reflectAddr.String(), Key: missingKey, @@ -545,7 +536,7 @@ func TestWasmRawQueryWithNil(t *testing.T) { require.NoError(t, err) // first we pull out the data from chain response, before parsing the original response - var reflectRawRes ChainResponse + var reflectRawRes testdata.ChainResponse mustParse(t, res, &reflectRawRes) // and make sure there is no data require.Empty(t, reflectRawRes.Data) @@ -630,8 +621,8 @@ func fromReflectRawMsg(cdc codec.Codec) CustomEncoder { } type reflectCustomQuery struct { - Ping *struct{} `json:"ping,omitempty"` - Capitalized *Text `json:"capitalized,omitempty"` + Ping *struct{} `json:"ping,omitempty"` + Capitalized *testdata.Text `json:"capitalized,omitempty"` } // this is from the go code back to the contract (capitalized or ping) diff --git a/x/wasm/keeper/relay.go b/x/wasm/keeper/relay.go index 66d4cd6a98..c7c9fdf3f5 100644 --- a/x/wasm/keeper/relay.go +++ b/x/wasm/keeper/relay.go @@ -35,8 +35,7 @@ func (k Keeper) OnOpenChannel( querier := k.newQueryHandler(ctx, contractAddr) gas := k.runtimeGasForContract(ctx) - wasmStore := types.NewWasmStore(prefixStore) - res, gasUsed, execErr := k.wasmVM.IBCChannelOpen(codeInfo.CodeHash, env, msg, wasmStore, k.cosmwasmAPI(ctx), querier, ctx.GasMeter(), gas, costJSONDeserialization) + res, gasUsed, execErr := k.wasmVM.IBCChannelOpen(codeInfo.CodeHash, env, msg, prefixStore, k.pluskeeper.CosmwasmAPI(ctx), querier, ctx.GasMeter(), gas, costJSONDeserialization) k.consumeRuntimeGas(ctx, gasUsed) if execErr != nil { return "", sdkerrors.Wrap(types.ErrExecuteFailed, execErr.Error()) @@ -71,8 +70,7 @@ func (k Keeper) OnConnectChannel( querier := k.newQueryHandler(ctx, contractAddr) gas := k.runtimeGasForContract(ctx) - wasmStore := types.NewWasmStore(prefixStore) - res, gasUsed, execErr := k.wasmVM.IBCChannelConnect(codeInfo.CodeHash, env, msg, wasmStore, k.cosmwasmAPI(ctx), querier, ctx.GasMeter(), gas, costJSONDeserialization) + res, gasUsed, execErr := k.wasmVM.IBCChannelConnect(codeInfo.CodeHash, env, msg, prefixStore, k.pluskeeper.CosmwasmAPI(ctx), querier, ctx.GasMeter(), gas, costJSONDeserialization) k.consumeRuntimeGas(ctx, gasUsed) if execErr != nil { @@ -104,8 +102,7 @@ func (k Keeper) OnCloseChannel( querier := k.newQueryHandler(ctx, contractAddr) gas := k.runtimeGasForContract(ctx) - wasmStore := types.NewWasmStore(prefixStore) - res, gasUsed, execErr := k.wasmVM.IBCChannelClose(codeInfo.CodeHash, params, msg, wasmStore, k.cosmwasmAPI(ctx), querier, ctx.GasMeter(), gas, costJSONDeserialization) + res, gasUsed, execErr := k.wasmVM.IBCChannelClose(codeInfo.CodeHash, params, msg, prefixStore, k.pluskeeper.CosmwasmAPI(ctx), querier, ctx.GasMeter(), gas, costJSONDeserialization) k.consumeRuntimeGas(ctx, gasUsed) if execErr != nil { @@ -136,8 +133,7 @@ func (k Keeper) OnRecvPacket( querier := k.newQueryHandler(ctx, contractAddr) gas := k.runtimeGasForContract(ctx) - wasmStore := types.NewWasmStore(prefixStore) - res, gasUsed, execErr := k.wasmVM.IBCPacketReceive(codeInfo.CodeHash, env, msg, wasmStore, k.cosmwasmAPI(ctx), querier, ctx.GasMeter(), gas, costJSONDeserialization) + res, gasUsed, execErr := k.wasmVM.IBCPacketReceive(codeInfo.CodeHash, env, msg, prefixStore, k.pluskeeper.CosmwasmAPI(ctx), querier, ctx.GasMeter(), gas, costJSONDeserialization) k.consumeRuntimeGas(ctx, gasUsed) if execErr != nil { @@ -172,8 +168,7 @@ func (k Keeper) OnAckPacket( querier := k.newQueryHandler(ctx, contractAddr) gas := k.runtimeGasForContract(ctx) - wasmStore := types.NewWasmStore(prefixStore) - res, gasUsed, execErr := k.wasmVM.IBCPacketAck(codeInfo.CodeHash, env, msg, wasmStore, k.cosmwasmAPI(ctx), querier, ctx.GasMeter(), gas, costJSONDeserialization) + res, gasUsed, execErr := k.wasmVM.IBCPacketAck(codeInfo.CodeHash, env, msg, prefixStore, k.pluskeeper.CosmwasmAPI(ctx), querier, ctx.GasMeter(), gas, costJSONDeserialization) k.consumeRuntimeGas(ctx, gasUsed) if execErr != nil { @@ -201,8 +196,7 @@ func (k Keeper) OnTimeoutPacket( querier := k.newQueryHandler(ctx, contractAddr) gas := k.runtimeGasForContract(ctx) - wasmStore := types.NewWasmStore(prefixStore) - res, gasUsed, execErr := k.wasmVM.IBCPacketTimeout(codeInfo.CodeHash, env, msg, wasmStore, k.cosmwasmAPI(ctx), querier, ctx.GasMeter(), gas, costJSONDeserialization) + res, gasUsed, execErr := k.wasmVM.IBCPacketTimeout(codeInfo.CodeHash, env, msg, prefixStore, k.pluskeeper.CosmwasmAPI(ctx), querier, ctx.GasMeter(), gas, costJSONDeserialization) k.consumeRuntimeGas(ctx, gasUsed) if execErr != nil { diff --git a/x/wasm/keeper/relay_test.go b/x/wasm/keeper/relay_test.go index 8ec2a2d0dc..65b632c040 100644 --- a/x/wasm/keeper/relay_test.go +++ b/x/wasm/keeper/relay_test.go @@ -21,7 +21,7 @@ func TestOnOpenChannel(t *testing.T) { var m wasmtesting.MockWasmer wasmtesting.MakeIBCInstantiable(&m) messenger := &wasmtesting.MockMessageHandler{} - parentCtx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil, WithMessageHandler(messenger)) + parentCtx, keepers := CreateTestInput(t, false, AvailableCapabilities, WithMessageHandler(messenger)) example := SeedNewContractInstance(t, parentCtx, keepers, &m) const myContractGas = 40 @@ -39,8 +39,8 @@ func TestOnOpenChannel(t *testing.T) { }, "consume max gas": { contractAddr: example.Contract, - contractGas: math.MaxUint64 / types.DefaultGasMultiplier, - expGas: math.MaxUint64 / types.DefaultGasMultiplier, + contractGas: math.MaxUint64 / DefaultGasMultiplier, + expGas: math.MaxUint64 / DefaultGasMultiplier, }, "consume gas on error": { contractAddr: example.Contract, @@ -59,7 +59,7 @@ func TestOnOpenChannel(t *testing.T) { myMsg := wasmvmtypes.IBCChannelOpenMsg{OpenTry: &wasmvmtypes.IBCOpenTry{Channel: myChannel, CounterpartyVersion: "foo"}} m.IBCChannelOpenFn = func(codeID wasmvm.Checksum, env wasmvmtypes.Env, msg wasmvmtypes.IBCChannelOpenMsg, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.IBC3ChannelOpenResponse, uint64, error) { assert.Equal(t, myMsg, msg) - return &wasmvmtypes.IBC3ChannelOpenResponse{}, spec.contractGas * types.DefaultGasMultiplier, spec.contractErr + return &wasmvmtypes.IBC3ChannelOpenResponse{}, spec.contractGas * DefaultGasMultiplier, spec.contractErr } ctx, _ := parentCtx.CacheContext() @@ -91,7 +91,7 @@ func TestOnConnectChannel(t *testing.T) { var m wasmtesting.MockWasmer wasmtesting.MakeIBCInstantiable(&m) messenger := &wasmtesting.MockMessageHandler{} - parentCtx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil, WithMessageHandler(messenger)) + parentCtx, keepers := CreateTestInput(t, false, AvailableCapabilities, WithMessageHandler(messenger)) example := SeedNewContractInstance(t, parentCtx, keepers, &m) const myContractGas = 40 @@ -156,7 +156,7 @@ func TestOnConnectChannel(t *testing.T) { myMsg := wasmvmtypes.IBCChannelConnectMsg{OpenConfirm: &wasmvmtypes.IBCOpenConfirm{Channel: myChannel}} m.IBCChannelConnectFn = func(codeID wasmvm.Checksum, env wasmvmtypes.Env, msg wasmvmtypes.IBCChannelConnectMsg, store wasmvm.KVStore, goapi wasmvm.GoAPI, querier wasmvm.Querier, gasMeter wasmvm.GasMeter, gasLimit uint64, deserCost wasmvmtypes.UFraction) (*wasmvmtypes.IBCBasicResponse, uint64, error) { assert.Equal(t, msg, myMsg) - return spec.contractResp, myContractGas * types.DefaultGasMultiplier, spec.contractErr + return spec.contractResp, myContractGas * DefaultGasMultiplier, spec.contractErr } ctx, _ := parentCtx.CacheContext() @@ -202,7 +202,7 @@ func TestOnCloseChannel(t *testing.T) { var m wasmtesting.MockWasmer wasmtesting.MakeIBCInstantiable(&m) messenger := &wasmtesting.MockMessageHandler{} - parentCtx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil, WithMessageHandler(messenger)) + parentCtx, keepers := CreateTestInput(t, false, AvailableCapabilities, WithMessageHandler(messenger)) example := SeedNewContractInstance(t, parentCtx, keepers, &m) const myContractGas = 40 @@ -267,7 +267,7 @@ func TestOnCloseChannel(t *testing.T) { myMsg := wasmvmtypes.IBCChannelCloseMsg{CloseInit: &wasmvmtypes.IBCCloseInit{Channel: myChannel}} m.IBCChannelCloseFn = func(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) { assert.Equal(t, msg, myMsg) - return spec.contractResp, myContractGas * types.DefaultGasMultiplier, spec.contractErr + return spec.contractResp, myContractGas * DefaultGasMultiplier, spec.contractErr } ctx, _ := parentCtx.CacheContext() @@ -312,7 +312,7 @@ func TestOnRecvPacket(t *testing.T) { var m wasmtesting.MockWasmer wasmtesting.MakeIBCInstantiable(&m) messenger := &wasmtesting.MockMessageHandler{} - parentCtx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil, WithMessageHandler(messenger)) + parentCtx, keepers := CreateTestInput(t, false, AvailableCapabilities, WithMessageHandler(messenger)) example := SeedNewContractInstance(t, parentCtx, keepers, &m) const myContractGas = 40 const storageCosts = sdk.Gas(2879) @@ -424,7 +424,7 @@ func TestOnRecvPacket(t *testing.T) { m.IBCPacketReceiveFn = func(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) { assert.Equal(t, myPacket, msg.Packet) - return &wasmvmtypes.IBCReceiveResult{Ok: spec.contractResp}, myContractGas * types.DefaultGasMultiplier, spec.contractErr + return &wasmvmtypes.IBCReceiveResult{Ok: spec.contractResp}, myContractGas * DefaultGasMultiplier, spec.contractErr } if spec.mockReplyFn != nil { m.ReplyFn = spec.mockReplyFn @@ -474,7 +474,7 @@ func TestOnAckPacket(t *testing.T) { var m wasmtesting.MockWasmer wasmtesting.MakeIBCInstantiable(&m) messenger := &wasmtesting.MockMessageHandler{} - parentCtx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil, WithMessageHandler(messenger)) + parentCtx, keepers := CreateTestInput(t, false, AvailableCapabilities, WithMessageHandler(messenger)) example := SeedNewContractInstance(t, parentCtx, keepers, &m) const myContractGas = 40 @@ -538,7 +538,7 @@ func TestOnAckPacket(t *testing.T) { myAck := wasmvmtypes.IBCPacketAckMsg{Acknowledgement: wasmvmtypes.IBCAcknowledgement{Data: []byte("myAck")}} m.IBCPacketAckFn = func(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) { assert.Equal(t, myAck, msg) - return spec.contractResp, myContractGas * types.DefaultGasMultiplier, spec.contractErr + return spec.contractResp, myContractGas * DefaultGasMultiplier, spec.contractErr } ctx, _ := parentCtx.CacheContext() @@ -579,7 +579,7 @@ func TestOnTimeoutPacket(t *testing.T) { var m wasmtesting.MockWasmer wasmtesting.MakeIBCInstantiable(&m) messenger := &wasmtesting.MockMessageHandler{} - parentCtx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil, WithMessageHandler(messenger)) + parentCtx, keepers := CreateTestInput(t, false, AvailableCapabilities, WithMessageHandler(messenger)) example := SeedNewContractInstance(t, parentCtx, keepers, &m) const myContractGas = 40 @@ -658,7 +658,7 @@ func TestOnTimeoutPacket(t *testing.T) { myPacket := wasmvmtypes.IBCPacket{Data: []byte("my test packet")} m.IBCPacketTimeoutFn = func(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) { assert.Equal(t, myPacket, msg.Packet) - return spec.contractResp, myContractGas * types.DefaultGasMultiplier, spec.contractErr + return spec.contractResp, myContractGas * DefaultGasMultiplier, spec.contractErr } ctx, _ := parentCtx.CacheContext() diff --git a/x/wasm/keeper/snapshotter.go b/x/wasm/keeper/snapshotter.go index b6e7ec8917..d77b7734e3 100644 --- a/x/wasm/keeper/snapshotter.go +++ b/x/wasm/keeper/snapshotter.go @@ -5,12 +5,12 @@ import ( "io" protoio "github.com/gogo/protobuf/io" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" snapshot "github.com/line/lbm-sdk/snapshots/types" sdk "github.com/line/lbm-sdk/types" sdkerrors "github.com/line/lbm-sdk/types/errors" "github.com/line/ostracon/libs/log" - ocproto "github.com/line/ostracon/proto/ostracon/types" "github.com/line/wasmd/x/wasm/ioutils" "github.com/line/wasmd/x/wasm/types" @@ -52,7 +52,7 @@ func (ws *WasmSnapshotter) Snapshot(height uint64, protoWriter protoio.Writer) e return err } - ctx := sdk.NewContext(cacheMS, ocproto.Header{}, false, log.NewNopLogger()) + ctx := sdk.NewContext(cacheMS, tmproto.Header{}, false, log.NewNopLogger()) seenBefore := make(map[string]bool) var rerr error @@ -100,6 +100,9 @@ func (ws *WasmSnapshotter) Restore( } func restoreV1(ctx sdk.Context, k *Keeper, compressedCode []byte) error { + if !ioutils.IsGzip(compressedCode) { + return types.ErrInvalid.Wrap("not a gzip") + } wasmCode, err := ioutils.Uncompress(compressedCode, uint64(types.MaxWasmSize)) if err != nil { return sdkerrors.Wrap(types.ErrCreateFailed, err.Error()) @@ -124,7 +127,7 @@ func (ws *WasmSnapshotter) processAllItems( cb func(sdk.Context, *Keeper, []byte) error, finalize func(sdk.Context, *Keeper) error, ) (snapshot.SnapshotItem, error) { - ctx := sdk.NewContext(ws.cms, ocproto.Header{Height: int64(height)}, false, log.NewNopLogger()) + 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) diff --git a/x/wasm/keeper/snapshotter_integration_test.go b/x/wasm/keeper/snapshotter_integration_test.go index d5afa072e5..a3747d73cc 100644 --- a/x/wasm/keeper/snapshotter_integration_test.go +++ b/x/wasm/keeper/snapshotter_integration_test.go @@ -8,13 +8,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" cryptocodec "github.com/line/lbm-sdk/crypto/codec" "github.com/line/lbm-sdk/crypto/keys/ed25519" sdk "github.com/line/lbm-sdk/types" authtypes "github.com/line/lbm-sdk/x/auth/types" banktypes "github.com/line/lbm-sdk/x/bank/types" - ocproto "github.com/line/ostracon/proto/ostracon/types" octypes "github.com/line/ostracon/types" "github.com/line/wasmd/app" @@ -42,7 +42,7 @@ func TestSnapshotter(t *testing.T) { srcWasmApp, genesisAddr := newWasmExampleApp(t) // store wasm codes on chain - ctx := srcWasmApp.NewUncachedContext(false, ocproto.Header{ + ctx := srcWasmApp.NewUncachedContext(false, tmproto.Header{ ChainID: "foo", Height: srcWasmApp.LastBlockHeight() + 1, Time: time.Now(), @@ -54,11 +54,10 @@ func TestSnapshotter(t *testing.T) { for i, v := range spec.wasmFiles { wasmCode, err := os.ReadFile(v) require.NoError(t, err) - codeID, err := contractKeeper.Create(ctx, genesisAddr, wasmCode, nil) + codeID, checksum, err := contractKeeper.Create(ctx, genesisAddr, wasmCode, nil) require.NoError(t, err) require.Equal(t, uint64(i+1), codeID) - hash := sha256.Sum256(wasmCode) - srcCodeIDToChecksum[codeID] = hash[:] + srcCodeIDToChecksum[codeID] = checksum } // create snapshot srcWasmApp.Commit() @@ -82,7 +81,7 @@ func TestSnapshotter(t *testing.T) { // then all wasm contracts are imported wasmKeeper = app.NewTestSupport(t, destWasmApp).WasmKeeper() - ctx = destWasmApp.NewUncachedContext(false, ocproto.Header{ + ctx = destWasmApp.NewUncachedContext(false, tmproto.Header{ ChainID: "foo", Height: destWasmApp.LastBlockHeight() + 1, Time: time.Now(), diff --git a/x/wasm/keeper/staking_test.go b/x/wasm/keeper/staking_test.go index 244d550e6a..417e767625 100644 --- a/x/wasm/keeper/staking_test.go +++ b/x/wasm/keeper/staking_test.go @@ -21,6 +21,7 @@ import ( stakingtypes "github.com/line/lbm-sdk/x/staking/types" wasmvmtypes "github.com/line/wasmvm/types" + "github.com/line/wasmd/x/wasm/keeper/testdata" wasmtypes "github.com/line/wasmd/x/wasm/types" ) @@ -36,12 +37,12 @@ type StakingInitMsg struct { // StakingHandleMsg is used to encode handle messages type StakingHandleMsg struct { - Transfer *transferPayload `json:"transfer,omitempty"` - Bond *struct{} `json:"bond,omitempty"` - Unbond *unbondPayload `json:"unbond,omitempty"` - Claim *struct{} `json:"claim,omitempty"` - Reinvest *struct{} `json:"reinvest,omitempty"` - Change *ownerPayload `json:"change_owner,omitempty"` + Transfer *transferPayload `json:"transfer,omitempty"` + Bond *struct{} `json:"bond,omitempty"` + Unbond *unbondPayload `json:"unbond,omitempty"` + Claim *struct{} `json:"claim,omitempty"` + Reinvest *struct{} `json:"reinvest,omitempty"` + Change *testdata.OwnerPayload `json:"change_owner,omitempty"` } type transferPayload struct { @@ -93,7 +94,7 @@ type InvestmentResponse struct { } func TestInitializeStaking(t *testing.T) { - ctx, k := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, k := CreateTestInput(t, false, AvailableCapabilities) accKeeper, stakingKeeper, keeper, bankKeeper := k.AccountKeeper, k.StakingKeeper, k.ContractKeeper, k.BankKeeper valAddr := addValidator(t, ctx, stakingKeeper, k.Faucet, sdk.NewInt64Coin("stake", 1234567)) @@ -103,12 +104,12 @@ func TestInitializeStaking(t *testing.T) { assert.Equal(t, v.GetDelegatorShares(), sdk.NewDec(1234567)) deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000), sdk.NewInt64Coin("stake", 500000)) - creator := k.Faucet.NewFundedAccount(ctx, deposit...) + creator := k.Faucet.NewFundedRandomAccount(ctx, deposit...) // upload staking derivates code stakingCode, err := os.ReadFile("./testdata/staking.wasm") require.NoError(t, err) - stakingID, err := keeper.Create(ctx, creator, stakingCode, nil) + stakingID, _, err := keeper.Create(ctx, creator, stakingCode, nil) require.NoError(t, err) require.Equal(t, uint64(1), stakingID) @@ -168,7 +169,7 @@ type initInfo struct { } func initializeStaking(t *testing.T) initInfo { - ctx, k := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, k := CreateTestInput(t, false, AvailableCapabilities) accKeeper, stakingKeeper, keeper, bankKeeper := k.AccountKeeper, k.StakingKeeper, k.WasmKeeper, k.BankKeeper valAddr := addValidator(t, ctx, stakingKeeper, k.Faucet, sdk.NewInt64Coin("stake", 1000000)) @@ -186,12 +187,12 @@ func initializeStaking(t *testing.T) initInfo { assert.Equal(t, v.Status, stakingtypes.Bonded) deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000), sdk.NewInt64Coin("stake", 500000)) - creator := k.Faucet.NewFundedAccount(ctx, deposit...) + creator := k.Faucet.NewFundedRandomAccount(ctx, deposit...) // upload staking derivates code stakingCode, err := os.ReadFile("./testdata/staking.wasm") require.NoError(t, err) - stakingID, err := k.ContractKeeper.Create(ctx, creator, stakingCode, nil) + stakingID, _, err := k.ContractKeeper.Create(ctx, creator, stakingCode, nil) require.NoError(t, err) require.Equal(t, uint64(1), stakingID) @@ -239,7 +240,7 @@ func TestBonding(t *testing.T) { // bob has 160k, putting 80k into the contract full := sdk.NewCoins(sdk.NewInt64Coin("stake", 160000)) funds := sdk.NewCoins(sdk.NewInt64Coin("stake", 80000)) - bob := initInfo.faucet.NewFundedAccount(ctx, full...) + bob := initInfo.faucet.NewFundedRandomAccount(ctx, full...) // check contract state before assertBalance(t, ctx, keeper, contractAddr, bob, "0") @@ -287,7 +288,7 @@ func TestUnbonding(t *testing.T) { // bob has 160k, putting 80k into the contract full := sdk.NewCoins(sdk.NewInt64Coin("stake", 160000)) funds := sdk.NewCoins(sdk.NewInt64Coin("stake", 80000)) - bob := initInfo.faucet.NewFundedAccount(ctx, full...) + bob := initInfo.faucet.NewFundedRandomAccount(ctx, full...) bond := StakingHandleMsg{ Bond: &struct{}{}, @@ -354,7 +355,7 @@ func TestReinvest(t *testing.T) { // full is 2x funds, 1x goes to the contract, other stays on his wallet full := sdk.NewCoins(sdk.NewInt64Coin("stake", 400000)) funds := sdk.NewCoins(sdk.NewInt64Coin("stake", 200000)) - bob := initInfo.faucet.NewFundedAccount(ctx, full...) + bob := initInfo.faucet.NewFundedRandomAccount(ctx, full...) // we will stake 200k to a validator with 1M self-bond // this means we should get 1/6 of the rewards @@ -422,7 +423,7 @@ func TestQueryStakingInfo(t *testing.T) { // full is 2x funds, 1x goes to the contract, other stays on his wallet full := sdk.NewCoins(sdk.NewInt64Coin("stake", 400000)) funds := sdk.NewCoins(sdk.NewInt64Coin("stake", 200000)) - bob := initInfo.faucet.NewFundedAccount(ctx, full...) + bob := initInfo.faucet.NewFundedRandomAccount(ctx, full...) // we will stake 200k to a validator with 1M self-bond // this means we should get 1/6 of the rewards @@ -444,12 +445,10 @@ func TestQueryStakingInfo(t *testing.T) { // STEP 2: Prepare the mask contract deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := initInfo.faucet.NewFundedAccount(ctx, deposit...) + creator := initInfo.faucet.NewFundedRandomAccount(ctx, deposit...) // upload mask code - maskCode, err := os.ReadFile("./testdata/reflect.wasm") - require.NoError(t, err) - maskID, err := initInfo.contractKeeper.Create(ctx, creator, maskCode, nil) + maskID, _, err := initInfo.contractKeeper.Create(ctx, creator, testdata.ReflectContractWasm(), nil) require.NoError(t, err) require.Equal(t, uint64(2), maskID) @@ -460,21 +459,21 @@ func TestQueryStakingInfo(t *testing.T) { // STEP 3: now, let's reflect some queries. // let's get the bonded denom - reflectBondedQuery := ReflectQueryMsg{Chain: &ChainQuery{Request: &wasmvmtypes.QueryRequest{Staking: &wasmvmtypes.StakingQuery{ + reflectBondedQuery := testdata.ReflectQueryMsg{Chain: &testdata.ChainQuery{Request: &wasmvmtypes.QueryRequest{Staking: &wasmvmtypes.StakingQuery{ BondedDenom: &struct{}{}, }}}} reflectBondedBin := buildReflectQuery(t, &reflectBondedQuery) res, err := keeper.QuerySmart(ctx, maskAddr, reflectBondedBin) require.NoError(t, err) // first we pull out the data from chain response, before parsing the original response - var reflectRes ChainResponse + var reflectRes testdata.ChainResponse mustParse(t, res, &reflectRes) var bondedRes wasmvmtypes.BondedDenomResponse mustParse(t, reflectRes.Data, &bondedRes) assert.Equal(t, "stake", bondedRes.Denom) // now, let's reflect a smart query into the x/wasm handlers and see if we get the same result - reflectAllValidatorsQuery := ReflectQueryMsg{Chain: &ChainQuery{Request: &wasmvmtypes.QueryRequest{Staking: &wasmvmtypes.StakingQuery{ + reflectAllValidatorsQuery := testdata.ReflectQueryMsg{Chain: &testdata.ChainQuery{Request: &wasmvmtypes.QueryRequest{Staking: &wasmvmtypes.StakingQuery{ AllValidators: &wasmvmtypes.AllValidatorsQuery{}, }}}} reflectAllValidatorsBin := buildReflectQuery(t, &reflectAllValidatorsQuery) @@ -493,7 +492,7 @@ func TestQueryStakingInfo(t *testing.T) { require.Contains(t, valInfo.MaxChangeRate, "0.010") // find a validator - reflectValidatorQuery := ReflectQueryMsg{Chain: &ChainQuery{Request: &wasmvmtypes.QueryRequest{Staking: &wasmvmtypes.StakingQuery{ + reflectValidatorQuery := testdata.ReflectQueryMsg{Chain: &testdata.ChainQuery{Request: &wasmvmtypes.QueryRequest{Staking: &wasmvmtypes.StakingQuery{ Validator: &wasmvmtypes.ValidatorQuery{ Address: valAddr.String(), }, @@ -515,7 +514,7 @@ func TestQueryStakingInfo(t *testing.T) { // missing validator noVal := sdk.ValAddress(secp256k1.GenPrivKey().PubKey().Address()) - reflectNoValidatorQuery := ReflectQueryMsg{Chain: &ChainQuery{Request: &wasmvmtypes.QueryRequest{Staking: &wasmvmtypes.StakingQuery{ + reflectNoValidatorQuery := testdata.ReflectQueryMsg{Chain: &testdata.ChainQuery{Request: &wasmvmtypes.QueryRequest{Staking: &wasmvmtypes.StakingQuery{ Validator: &wasmvmtypes.ValidatorQuery{ Address: noVal.String(), }, @@ -530,7 +529,7 @@ func TestQueryStakingInfo(t *testing.T) { require.Nil(t, noValidatorRes.Validator) // test to get all my delegations - reflectAllDelegationsQuery := ReflectQueryMsg{Chain: &ChainQuery{Request: &wasmvmtypes.QueryRequest{Staking: &wasmvmtypes.StakingQuery{ + reflectAllDelegationsQuery := testdata.ReflectQueryMsg{Chain: &testdata.ChainQuery{Request: &wasmvmtypes.QueryRequest{Staking: &wasmvmtypes.StakingQuery{ AllDelegations: &wasmvmtypes.AllDelegationsQuery{ Delegator: contractAddr.String(), }, @@ -553,7 +552,7 @@ func TestQueryStakingInfo(t *testing.T) { require.Equal(t, funds[0].Amount.String(), delInfo.Amount.Amount) // test to get one delegations - reflectDelegationQuery := ReflectQueryMsg{Chain: &ChainQuery{Request: &wasmvmtypes.QueryRequest{Staking: &wasmvmtypes.StakingQuery{ + reflectDelegationQuery := testdata.ReflectQueryMsg{Chain: &testdata.ChainQuery{Request: &wasmvmtypes.QueryRequest{Staking: &wasmvmtypes.StakingQuery{ Delegation: &wasmvmtypes.DelegationQuery{ Validator: valAddr.String(), Delegator: contractAddr.String(), @@ -601,7 +600,7 @@ func TestQueryStakingPlugin(t *testing.T) { // full is 2x funds, 1x goes to the contract, other stays on his wallet full := sdk.NewCoins(sdk.NewInt64Coin("stake", 400000)) funds := sdk.NewCoins(sdk.NewInt64Coin("stake", 200000)) - bob := initInfo.faucet.NewFundedAccount(ctx, full...) + bob := initInfo.faucet.NewFundedRandomAccount(ctx, full...) // we will stake 200k to a validator with 1M self-bond // this means we should get 1/6 of the rewards @@ -654,7 +653,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 { - owner := faucet.NewFundedAccount(ctx, value) + owner := faucet.NewFundedRandomAccount(ctx, value) privKey := secp256k1.GenPrivKey() pubKey := privKey.PubKey() diff --git a/x/wasm/keeper/submsg_test.go b/x/wasm/keeper/submsg_test.go index 856f1b26bb..c0a93b16a8 100644 --- a/x/wasm/keeper/submsg_test.go +++ b/x/wasm/keeper/submsg_test.go @@ -13,6 +13,7 @@ import ( sdk "github.com/line/lbm-sdk/types" wasmvmtypes "github.com/line/wasmvm/types" + "github.com/line/wasmd/x/wasm/keeper/testdata" "github.com/line/wasmd/x/wasm/types" ) @@ -20,20 +21,18 @@ import ( // Try a simple send, no gas limit to for a sanity check before trying table tests func TestDispatchSubMsgSuccessCase(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, ReflectFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, ReflectFeatures) accKeeper, keeper, bankKeeper := keepers.AccountKeeper, keepers.WasmKeeper, keepers.BankKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) contractStart := sdk.NewCoins(sdk.NewInt64Coin("denom", 40000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) creatorBalance := deposit.Sub(contractStart) _, _, fred := keyPubAddr() // upload code - reflectCode, err := os.ReadFile("./testdata/reflect.wasm") - require.NoError(t, err) - codeID, err := keepers.ContractKeeper.Create(ctx, creator, reflectCode, nil) + codeID, _, err := keepers.ContractKeeper.Create(ctx, creator, testdata.ReflectContractWasm(), nil) require.NoError(t, err) require.Equal(t, uint64(1), codeID) @@ -59,8 +58,8 @@ func TestDispatchSubMsgSuccessCase(t *testing.T) { }, }, } - reflectSend := ReflectHandleMsg{ - ReflectSubMsg: &reflectSubPayload{ + reflectSend := testdata.ReflectHandleMsg{ + ReflectSubMsg: &testdata.ReflectSubPayload{ Msgs: []wasmvmtypes.SubMsg{{ ID: 7, Msg: msg, @@ -80,8 +79,8 @@ func TestDispatchSubMsgSuccessCase(t *testing.T) { checkAccount(t, ctx, accKeeper, bankKeeper, creator, creatorBalance) // query the reflect state to ensure the result was stored - query := ReflectQueryMsg{ - SubMsgResult: &SubCall{ID: 7}, + query := testdata.ReflectQueryMsg{ + SubMsgResult: &testdata.SubCall{ID: 7}, } queryBz, err := json.Marshal(query) require.NoError(t, err) @@ -96,15 +95,8 @@ func TestDispatchSubMsgSuccessCase(t *testing.T) { require.NotNil(t, res.Result.Ok) sub := res.Result.Ok assert.Empty(t, sub.Data) - require.Len(t, sub.Events, 3) - assert.Equal(t, "coin_spent", sub.Events[0].Type) - assert.Equal(t, "coin_received", sub.Events[1].Type) - transfer := sub.Events[2] - assert.Equal(t, "transfer", transfer.Type) - assert.Equal(t, wasmvmtypes.EventAttribute{ - Key: "recipient", - Value: fred.String(), - }, transfer.Attributes[0]) + // as of v0.28.0 we strip out all events that don't come from wasm contracts. can't trust the sdk. + require.Len(t, sub.Events, 0) } func TestDispatchSubMsgErrorHandling(t *testing.T) { @@ -114,23 +106,21 @@ func TestDispatchSubMsgErrorHandling(t *testing.T) { subGasLimit := uint64(300_000) // prep - create one chain and upload the code - ctx, keepers := CreateTestInput(t, false, ReflectFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, ReflectFeatures) ctx = ctx.WithGasMeter(sdk.NewInfiniteGasMeter()) ctx = ctx.WithBlockGasMeter(sdk.NewInfiniteGasMeter()) keeper := keepers.WasmKeeper contractStart := sdk.NewCoins(sdk.NewInt64Coin(fundedDenom, int64(fundedAmount))) - uploader := keepers.Faucet.NewFundedAccount(ctx, contractStart.Add(contractStart...)...) + uploader := keepers.Faucet.NewFundedRandomAccount(ctx, contractStart.Add(contractStart...)...) // upload code - reflectCode, err := os.ReadFile("./testdata/reflect.wasm") - require.NoError(t, err) - reflectID, err := keepers.ContractKeeper.Create(ctx, uploader, reflectCode, nil) + reflectID, _, err := keepers.ContractKeeper.Create(ctx, uploader, testdata.ReflectContractWasm(), nil) require.NoError(t, err) // create hackatom contract for testing (for infinite loop) hackatomCode, err := os.ReadFile("./testdata/hackatom.wasm") require.NoError(t, err) - hackatomID, err := keepers.ContractKeeper.Create(ctx, uploader, hackatomCode, nil) + hackatomID, _, err := keepers.ContractKeeper.Create(ctx, uploader, hackatomCode, nil) require.NoError(t, err) _, _, bob := keyPubAddr() _, _, fred := keyPubAddr() @@ -247,14 +237,14 @@ func TestDispatchSubMsgErrorHandling(t *testing.T) { "send tokens": { submsgID: 5, msg: validBankSend, - resultAssertions: []assertion{assertReturnedEvents(3), assertGasUsed(111000, 113100)}, + resultAssertions: []assertion{assertReturnedEvents(0), assertGasUsed(93000, 94000)}, }, "not enough tokens": { submsgID: 6, msg: invalidBankSend, subMsgError: true, // uses less gas than the send tokens (cost of bank transfer) - resultAssertions: []assertion{assertGasUsed(76000, 77000), assertErrorString("codespace: sdk, code: 5")}, + resultAssertions: []assertion{assertGasUsed(75000, 76000), assertErrorString("codespace: sdk, code: 5")}, }, "out of gas panic with no gas limit": { submsgID: 7, @@ -267,7 +257,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(3), assertGasUsed(111400, 111500)}, + resultAssertions: []assertion{assertReturnedEvents(0), assertGasUsed(93000, 94000)}, }, "not enough tokens with limit": { submsgID: 16, @@ -275,7 +265,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(76000, 77000), assertErrorString("codespace: sdk, code: 5")}, + resultAssertions: []assertion{assertGasUsed(75000, 76000), assertErrorString("codespace: sdk, code: 5")}, }, "out of gas caught with gas limit": { submsgID: 17, @@ -283,7 +273,7 @@ func TestDispatchSubMsgErrorHandling(t *testing.T) { subMsgError: true, gasLimit: &subGasLimit, // uses all the subGasLimit, plus the 52k or so for the main contract - resultAssertions: []assertion{assertGasUsed(subGasLimit+74000, subGasLimit+75000), assertErrorString("codespace: sdk, code: 11")}, + resultAssertions: []assertion{assertGasUsed(subGasLimit+73000, subGasLimit+74000), assertErrorString("codespace: sdk, code: 11")}, }, "instantiate contract gets address in data and events": { submsgID: 21, @@ -293,15 +283,15 @@ func TestDispatchSubMsgErrorHandling(t *testing.T) { } for name, tc := range cases { t.Run(name, func(t *testing.T) { - creator := keepers.Faucet.NewFundedAccount(ctx, contractStart...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, contractStart...) _, _, empty := keyPubAddr() contractAddr, _, err := keepers.ContractKeeper.Instantiate(ctx, reflectID, creator, nil, []byte("{}"), fmt.Sprintf("contract %s", name), contractStart) require.NoError(t, err) msg := tc.msg(contractAddr.String(), empty.String()) - reflectSend := ReflectHandleMsg{ - ReflectSubMsg: &reflectSubPayload{ + reflectSend := testdata.ReflectHandleMsg{ + ReflectSubMsg: &testdata.ReflectSubPayload{ Msgs: []wasmvmtypes.SubMsg{{ ID: tc.submsgID, Msg: msg, @@ -331,8 +321,8 @@ func TestDispatchSubMsgErrorHandling(t *testing.T) { require.NoError(t, err) // query the reply - query := ReflectQueryMsg{ - SubMsgResult: &SubCall{ID: tc.submsgID}, + query := testdata.ReflectQueryMsg{ + SubMsgResult: &testdata.SubCall{ID: tc.submsgID}, } queryBz, err := json.Marshal(query) require.NoError(t, err) @@ -371,19 +361,17 @@ func TestDispatchSubMsgEncodeToNoSdkMsg(t *testing.T) { Bank: nilEncoder, } - ctx, keepers := CreateTestInput(t, false, ReflectFeatures, nil, nil, WithMessageHandler(NewSDKMessageHandler(nil, customEncoders))) + ctx, keepers := CreateTestInput(t, false, ReflectFeatures, WithMessageHandler(NewSDKMessageHandler(nil, customEncoders))) keeper := keepers.WasmKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) contractStart := sdk.NewCoins(sdk.NewInt64Coin("denom", 40000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) _, _, fred := keyPubAddr() // upload code - reflectCode, err := os.ReadFile("./testdata/reflect.wasm") - require.NoError(t, err) - codeID, err := keepers.ContractKeeper.Create(ctx, creator, reflectCode, nil) + codeID, _, err := keepers.ContractKeeper.Create(ctx, creator, testdata.ReflectContractWasm(), nil) require.NoError(t, err) // creator instantiates a contract and gives it tokens @@ -403,8 +391,8 @@ func TestDispatchSubMsgEncodeToNoSdkMsg(t *testing.T) { }, }, } - reflectSend := ReflectHandleMsg{ - ReflectSubMsg: &reflectSubPayload{ + reflectSend := testdata.ReflectHandleMsg{ + ReflectSubMsg: &testdata.ReflectSubPayload{ Msgs: []wasmvmtypes.SubMsg{{ ID: 7, Msg: msg, @@ -418,8 +406,8 @@ func TestDispatchSubMsgEncodeToNoSdkMsg(t *testing.T) { require.NoError(t, err) // query the reflect state to ensure the result was stored - query := ReflectQueryMsg{ - SubMsgResult: &SubCall{ID: 7}, + query := testdata.ReflectQueryMsg{ + SubMsgResult: &testdata.SubCall{ID: 7}, } queryBz, err := json.Marshal(query) require.NoError(t, err) @@ -439,19 +427,17 @@ func TestDispatchSubMsgEncodeToNoSdkMsg(t *testing.T) { // Try a simple send, no gas limit to for a sanity check before trying table tests func TestDispatchSubMsgConditionalReplyOn(t *testing.T) { - ctx, keepers := CreateTestInput(t, false, ReflectFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, ReflectFeatures) keeper := keepers.WasmKeeper deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) contractStart := sdk.NewCoins(sdk.NewInt64Coin("denom", 40000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) _, _, fred := keyPubAddr() // upload code - reflectCode, err := os.ReadFile("./testdata/reflect.wasm") - require.NoError(t, err) - codeID, err := keepers.ContractKeeper.Create(ctx, creator, reflectCode, nil) + codeID, _, err := keepers.ContractKeeper.Create(ctx, creator, testdata.ReflectContractWasm(), nil) require.NoError(t, err) // creator instantiates a contract and gives it tokens @@ -529,8 +515,8 @@ func TestDispatchSubMsgConditionalReplyOn(t *testing.T) { subMsg.ReplyOn = wasmvmtypes.ReplyError } - reflectSend := ReflectHandleMsg{ - ReflectSubMsg: &reflectSubPayload{ + reflectSend := testdata.ReflectHandleMsg{ + ReflectSubMsg: &testdata.ReflectSubPayload{ Msgs: []wasmvmtypes.SubMsg{subMsg}, }, } @@ -545,8 +531,8 @@ func TestDispatchSubMsgConditionalReplyOn(t *testing.T) { } // query the reflect state to check if the result was stored - query := ReflectQueryMsg{ - SubMsgResult: &SubCall{ID: id}, + query := testdata.ReflectQueryMsg{ + SubMsgResult: &testdata.SubCall{ID: id}, } queryBz, err := json.Marshal(query) require.NoError(t, err) diff --git a/x/wasm/keeper/test_common.go b/x/wasm/keeper/test_common.go index f704a34f1a..01d0f86db2 100644 --- a/x/wasm/keeper/test_common.go +++ b/x/wasm/keeper/test_common.go @@ -1,6 +1,7 @@ package keeper import ( + "bytes" "encoding/binary" "encoding/json" "fmt" @@ -9,18 +10,26 @@ import ( "time" "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" dbm "github.com/tendermint/tm-db" + "github.com/line/ibc-go/v3/modules/apps/transfer" + ibctransfertypes "github.com/line/ibc-go/v3/modules/apps/transfer/types" + ibc "github.com/line/ibc-go/v3/modules/core" + ibchost "github.com/line/ibc-go/v3/modules/core/24-host" + ibckeeper "github.com/line/ibc-go/v3/modules/core/keeper" "github.com/line/lbm-sdk/baseapp" "github.com/line/lbm-sdk/codec" "github.com/line/lbm-sdk/std" "github.com/line/lbm-sdk/store" sdk "github.com/line/lbm-sdk/types" + "github.com/line/lbm-sdk/types/address" sdkerrors "github.com/line/lbm-sdk/types/errors" "github.com/line/lbm-sdk/types/module" "github.com/line/lbm-sdk/x/auth" authkeeper "github.com/line/lbm-sdk/x/auth/keeper" authtypes "github.com/line/lbm-sdk/x/auth/types" + "github.com/line/lbm-sdk/x/auth/vesting" authzkeeper "github.com/line/lbm-sdk/x/authz/keeper" "github.com/line/lbm-sdk/x/bank" bankkeeper "github.com/line/lbm-sdk/x/bank/keeper" @@ -42,11 +51,6 @@ import ( "github.com/line/lbm-sdk/x/gov" govkeeper "github.com/line/lbm-sdk/x/gov/keeper" govtypes "github.com/line/lbm-sdk/x/gov/types" - "github.com/line/lbm-sdk/x/ibc/applications/transfer" - ibctransfertypes "github.com/line/lbm-sdk/x/ibc/applications/transfer/types" - ibc "github.com/line/lbm-sdk/x/ibc/core" - ibchost "github.com/line/lbm-sdk/x/ibc/core/24-host" - ibckeeper "github.com/line/lbm-sdk/x/ibc/core/keeper" "github.com/line/lbm-sdk/x/mint" minttypes "github.com/line/lbm-sdk/x/mint/types" "github.com/line/lbm-sdk/x/params" @@ -67,15 +71,14 @@ import ( "github.com/line/ostracon/crypto/ed25519" "github.com/line/ostracon/libs/log" "github.com/line/ostracon/libs/rand" - ocproto "github.com/line/ostracon/proto/ostracon/types" + wasmvm "github.com/line/wasmvm" wasmappparams "github.com/line/wasmd/app/params" "github.com/line/wasmd/x/wasm/keeper/wasmtesting" - "github.com/line/wasmd/x/wasm/lbmtypes" "github.com/line/wasmd/x/wasm/types" ) -var ModuleBasics = module.NewBasicManager( +var moduleBasics = module.NewBasicManager( auth.AppModuleBasic{}, bank.AppModuleBasic{}, capability.AppModuleBasic{}, @@ -92,6 +95,7 @@ var ModuleBasics = module.NewBasicManager( upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, transfer.AppModuleBasic{}, + vesting.AppModuleBasic{}, ) func MakeTestCodec(t testing.TB) codec.Codec { @@ -106,11 +110,11 @@ func MakeEncodingConfig(_ testing.TB) wasmappparams.EncodingConfig { std.RegisterInterfaces(interfaceRegistry) std.RegisterLegacyAminoCodec(amino) - ModuleBasics.RegisterLegacyAminoCodec(amino) - ModuleBasics.RegisterInterfaces(interfaceRegistry) + moduleBasics.RegisterLegacyAminoCodec(amino) + moduleBasics.RegisterInterfaces(interfaceRegistry) // add wasmd types - lbmtypes.RegisterInterfaces(interfaceRegistry) - lbmtypes.RegisterLegacyAminoCodec(amino) + types.RegisterInterfaces(interfaceRegistry) + types.RegisterLegacyAminoCodec(amino) return encodingConfig } @@ -163,7 +167,7 @@ func (f *TestFaucet) Fund(parentCtx sdk.Context, receiver sdk.AccAddress, amount f.balance = f.balance.Sub(amounts) } -func (f *TestFaucet) NewFundedAccount(ctx sdk.Context, amounts ...sdk.Coin) sdk.AccAddress { +func (f *TestFaucet) NewFundedRandomAccount(ctx sdk.Context, amounts ...sdk.Coin) sdk.AccAddress { _, _, addr := keyPubAddr() f.Fund(ctx, addr, amounts...) return addr @@ -186,22 +190,35 @@ type TestKeepers struct { // CreateDefaultTestInput common settings for CreateTestInput func CreateDefaultTestInput(t testing.TB) (sdk.Context, TestKeepers) { - return CreateTestInput(t, false, "staking", nil, nil) + return CreateTestInput(t, false, "staking") } // CreateTestInput encoders can be nil to accept the defaults, or set it to override some of the message handlers (like default) -func CreateTestInput(t testing.TB, isCheckTx bool, supportedFeatures string, encoders *MessageEncoders, queriers *QueryPlugins, opts ...Option) (sdk.Context, TestKeepers) { +func CreateTestInput(t testing.TB, isCheckTx bool, availableCapabilities string, opts ...Option) (sdk.Context, TestKeepers) { // Load default wasm config - return createTestInput(t, isCheckTx, supportedFeatures, encoders, queriers, types.DefaultWasmConfig(), dbm.NewMemDB(), opts...) + return createTestInput(t, isCheckTx, availableCapabilities, types.DefaultWasmConfig(), dbm.NewMemDB(), opts...) +} + +type mockpluskeeper struct{} + +func (m *mockpluskeeper) CosmwasmAPI(ctx sdk.Context) wasmvm.GoAPI { + return wasmvm.GoAPI{ + HumanAddress: humanAddress, + CanonicalAddress: canonicalAddress, + CallCallablePoint: func(s string, b1, b2 []byte, b3 bool, b4 []byte, u uint64) ([]byte, uint64, error) { + return nil, 0, fmt.Errorf("mock does not implement CallCallablePoint") + }, + ValidateInterface: func(s string, b []byte) ([]byte, uint64, error) { + return nil, 0, fmt.Errorf("mock does not implement ValidateInterface") + }, + } } // encoders can be nil to accept the defaults, or set it to override some of the message handlers (like default) func createTestInput( t testing.TB, isCheckTx bool, - supportedFeatures string, - encoders *MessageEncoders, - queriers *QueryPlugins, + availableCapabilities string, wasmConfig types.WasmConfig, db dbm.DB, opts ...Option, @@ -232,7 +249,7 @@ func createTestInput( require.NoError(t, ms.LoadLatestVersion()) - ctx := sdk.NewContext(ms, ocproto.Header{ + ctx := sdk.NewContext(ms, tmproto.Header{ Height: 1234567, Time: time.Date(2020, time.April, 22, 12, 0, 0, 0, time.UTC), }, isCheckTx, log.NewNopLogger()) @@ -296,6 +313,7 @@ func createTestInput( accountKeeper, subspace(banktypes.ModuleName), blockedAddrs, + false, ) bankKeeper.SetParams(ctx, banktypes.DefaultParams()) @@ -389,9 +407,8 @@ func createTestInput( querier, tempDir, wasmConfig, - supportedFeatures, - encoders, - queriers, + availableCapabilities, + &mockpluskeeper{}, opts..., ) keeper.SetParams(ctx, types.DefaultParams()) @@ -412,7 +429,7 @@ func createTestInput( AddRoute(govtypes.RouterKey, govtypes.ProposalHandler). AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(paramsKeeper)). AddRoute(distributiontypes.RouterKey, distribution.NewCommunityPoolSpendProposalHandler(distKeeper)). - AddRoute(types.RouterKey, NewWasmProposalHandler(&keeper, lbmtypes.EnableAllProposals)) + AddRoute(types.RouterKey, NewWasmProposalHandler(&keeper, types.EnableAllProposals)) govKeeper := govkeeper.NewKeeper( appCodec, @@ -469,7 +486,7 @@ func handleStoreCode(ctx sdk.Context, k types.ContractOpsKeeper, msg *types.MsgS if err != nil { return nil, sdkerrors.Wrap(err, "sender") } - codeID, err := k.Create(ctx, senderAddr, msg.WASMByteCode, msg.InstantiatePermission) + codeID, _, err := k.Create(ctx, senderAddr, msg.WASMByteCode, msg.InstantiatePermission) if err != nil { return nil, err } @@ -528,6 +545,11 @@ func RandomAccountAddress(_ testing.TB) sdk.AccAddress { return addr } +// DeterministicAccountAddress creates a test address with v repeated to valid address size +func DeterministicAccountAddress(_ testing.TB, v byte) sdk.AccAddress { + return bytes.Repeat([]byte{v}, address.Len) +} + func RandomBech32AccountAddress(t testing.TB) string { return RandomAccountAddress(t).String() } @@ -537,6 +559,7 @@ type ExampleContract struct { Creator crypto.PrivKey CreatorAddr sdk.AccAddress CodeID uint64 + Checksum []byte } func StoreHackatomExampleContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) ExampleContract { @@ -551,14 +574,8 @@ func StoreIBCReflectContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) return StoreExampleContract(t, ctx, keepers, "./testdata/ibc_reflect.wasm") } -func StoreReflectContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) uint64 { - wasmCode, err := os.ReadFile("./testdata/reflect.wasm") - require.NoError(t, err) - - _, _, creatorAddr := keyPubAddr() - codeID, err := keepers.ContractKeeper.Create(ctx, creatorAddr, wasmCode, nil) - require.NoError(t, err) - return codeID +func StoreReflectContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) ExampleContract { + return StoreExampleContract(t, ctx, keepers, "./testdata/reflect.wasm") } func StoreExampleContract(t testing.TB, ctx sdk.Context, keepers TestKeepers, wasmFile string) ExampleContract { @@ -569,9 +586,10 @@ func StoreExampleContract(t testing.TB, ctx sdk.Context, keepers TestKeepers, wa wasmCode, err := os.ReadFile(wasmFile) require.NoError(t, err) - codeID, err := keepers.ContractKeeper.Create(ctx, creatorAddr, wasmCode, nil) + codeID, _, err := keepers.ContractKeeper.Create(ctx, creatorAddr, wasmCode, nil) require.NoError(t, err) - return ExampleContract{anyAmount, creator, creatorAddr, codeID} + hash := keepers.WasmKeeper.GetCodeInfo(ctx, codeID).CodeHash + return ExampleContract{anyAmount, creator, creatorAddr, codeID, hash} } var wasmIdent = []byte("\x00\x61\x73\x6D") @@ -610,9 +628,9 @@ func StoreRandomContractWithAccessConfig( fundAccounts(t, ctx, keepers.AccountKeeper, keepers.BankKeeper, creatorAddr, anyAmount) keepers.WasmKeeper.wasmVM = mock wasmCode := append(wasmIdent, rand.Bytes(10)...) //nolint:gocritic - codeID, err := keepers.ContractKeeper.Create(ctx, creatorAddr, wasmCode, cfg) + codeID, checksum, err := keepers.ContractKeeper.Create(ctx, creatorAddr, wasmCode, cfg) require.NoError(t, err) - exampleContract := ExampleContract{InitialAmount: anyAmount, Creator: creator, CreatorAddr: creatorAddr, CodeID: codeID} + exampleContract := ExampleContract{InitialAmount: anyAmount, Creator: creator, CreatorAddr: creatorAddr, CodeID: codeID, Checksum: checksum} return exampleContract } @@ -623,6 +641,8 @@ type HackatomExampleInstance struct { VerifierAddr sdk.AccAddress Beneficiary crypto.PrivKey BeneficiaryAddr sdk.AccAddress + Label string + Deposit sdk.Coins } // InstantiateHackatomExampleContract load and instantiate the "./testdata/hackatom.wasm" contract @@ -640,7 +660,8 @@ func InstantiateHackatomExampleContract(t testing.TB, ctx sdk.Context, keepers T initialAmount := sdk.NewCoins(sdk.NewInt64Coin("denom", 100)) adminAddr := contract.CreatorAddr - contractAddr, _, err := keepers.ContractKeeper.Instantiate(ctx, contract.CodeID, contract.CreatorAddr, adminAddr, initMsgBz, "demo contract to query", initialAmount) + label := "demo contract to query" + contractAddr, _, err := keepers.ContractKeeper.Instantiate(ctx, contract.CodeID, contract.CreatorAddr, adminAddr, initMsgBz, label, initialAmount) require.NoError(t, err) return HackatomExampleInstance{ ExampleContract: contract, @@ -649,6 +670,31 @@ func InstantiateHackatomExampleContract(t testing.TB, ctx sdk.Context, keepers T VerifierAddr: verifierAddr, Beneficiary: beneficiary, BeneficiaryAddr: beneficiaryAddr, + Label: label, + Deposit: initialAmount, + } +} + +type ExampleInstance struct { + ExampleContract + Contract sdk.AccAddress + Label string + Deposit sdk.Coins +} + +// InstantiateReflectExampleContract load and instantiate the "./testdata/reflect.wasm" contract +func InstantiateReflectExampleContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) ExampleInstance { + example := StoreReflectContract(t, ctx, keepers) + initialAmount := sdk.NewCoins(sdk.NewInt64Coin("denom", 100)) + label := "demo contract to query" + contractAddr, _, err := keepers.ContractKeeper.Instantiate(ctx, example.CodeID, example.CreatorAddr, nil, []byte("{}"), label, initialAmount) + + require.NoError(t, err) + return ExampleInstance{ + ExampleContract: example, + Contract: contractAddr, + Label: label, + Deposit: initialAmount, } } @@ -672,7 +718,7 @@ type IBCReflectExampleInstance struct { // InstantiateIBCReflectContract load and instantiate the "./testdata/ibc_reflect.wasm" contract func InstantiateIBCReflectContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) IBCReflectExampleInstance { - reflectID := StoreReflectContract(t, ctx, keepers) + reflectID := StoreReflectContract(t, ctx, keepers).CodeID ibcReflectID := StoreIBCReflectContract(t, ctx, keepers).CodeID initMsgBz := IBCReflectInitMsg{ diff --git a/x/wasm/keeper/testdata/broken_crc.gzip b/x/wasm/keeper/testdata/broken_crc.gzip new file mode 100644 index 0000000000..378713e2ff Binary files /dev/null and b/x/wasm/keeper/testdata/broken_crc.gzip differ diff --git a/x/wasm/keeper/testdata/reflect.go b/x/wasm/keeper/testdata/reflect.go index ad365ce0c2..0cafa631bb 100644 --- a/x/wasm/keeper/testdata/reflect.go +++ b/x/wasm/keeper/testdata/reflect.go @@ -2,6 +2,9 @@ package testdata import ( _ "embed" + + "github.com/line/lbm-sdk/types" + typwasmvmtypes "github.com/line/wasmvm/types" ) //go:embed reflect.wasm @@ -10,3 +13,50 @@ var reflectContract []byte func ReflectContractWasm() []byte { return reflectContract } + +// ReflectHandleMsg is used to encode handle messages +type ReflectHandleMsg struct { + Reflect *ReflectPayload `json:"reflect_msg,omitempty"` + ReflectSubMsg *ReflectSubPayload `json:"reflect_sub_msg,omitempty"` + ChangeOwner *OwnerPayload `json:"change_owner,omitempty"` +} + +type OwnerPayload struct { + Owner types.Address `json:"owner"` +} + +type ReflectPayload struct { + Msgs []typwasmvmtypes.CosmosMsg `json:"msgs"` +} + +type ReflectSubPayload struct { + Msgs []typwasmvmtypes.SubMsg `json:"msgs"` +} + +// ReflectQueryMsg is used to encode query messages +type ReflectQueryMsg struct { + Owner *struct{} `json:"owner,omitempty"` + Capitalized *Text `json:"capitalized,omitempty"` + Chain *ChainQuery `json:"chain,omitempty"` + SubMsgResult *SubCall `json:"sub_msg_result,omitempty"` +} + +type ChainQuery struct { + Request *typwasmvmtypes.QueryRequest `json:"request,omitempty"` +} + +type Text struct { + Text string `json:"text"` +} + +type SubCall struct { + ID uint64 `json:"id"` +} + +type OwnerResponse struct { + Owner string `json:"owner,omitempty"` +} + +type ChainResponse struct { + Data []byte `json:"data,omitempty"` +} diff --git a/x/wasm/keeper/testdata/reflect.wasm b/x/wasm/keeper/testdata/reflect.wasm index ef3ecaff84..6ca86ca83c 100644 Binary files a/x/wasm/keeper/testdata/reflect.wasm and b/x/wasm/keeper/testdata/reflect.wasm differ diff --git a/x/wasm/keeper/testdata/reflect.wasm.v1_0 b/x/wasm/keeper/testdata/reflect.wasm.v1_0 new file mode 100644 index 0000000000..312f45768d Binary files /dev/null and b/x/wasm/keeper/testdata/reflect.wasm.v1_0 differ diff --git a/x/wasm/keeper/wasmtesting/coin_transferrer.go b/x/wasm/keeper/wasmtesting/extension_mocks.go similarity index 60% rename from x/wasm/keeper/wasmtesting/coin_transferrer.go rename to x/wasm/keeper/wasmtesting/extension_mocks.go index 4164ee4046..d21323075c 100644 --- a/x/wasm/keeper/wasmtesting/coin_transferrer.go +++ b/x/wasm/keeper/wasmtesting/extension_mocks.go @@ -2,6 +2,7 @@ package wasmtesting import ( sdk "github.com/line/lbm-sdk/types" + authtypes "github.com/line/lbm-sdk/x/auth/types" ) type MockCoinTransferrer struct { @@ -22,3 +23,14 @@ func (m *MockCoinTransferrer) TransferCoins(ctx sdk.Context, fromAddr sdk.AccAdd } return m.TransferCoinsFn(ctx, fromAddr, toAddr, amt) } + +type AccountPrunerMock struct { + CleanupExistingAccountFn func(ctx sdk.Context, existingAccount authtypes.AccountI) (handled bool, err error) +} + +func (m AccountPrunerMock) CleanupExistingAccount(ctx sdk.Context, existingAccount authtypes.AccountI) (handled bool, err error) { + if m.CleanupExistingAccountFn == nil { + panic("not expected to be called") + } + return m.CleanupExistingAccountFn(ctx, existingAccount) +} diff --git a/x/wasm/keeper/wasmtesting/gas_register.go b/x/wasm/keeper/wasmtesting/gas_register.go new file mode 100644 index 0000000000..6f5873585a --- /dev/null +++ b/x/wasm/keeper/wasmtesting/gas_register.go @@ -0,0 +1,75 @@ +package wasmtesting + +import ( + sdk "github.com/line/lbm-sdk/types" + + wasmvmtypes "github.com/line/wasmvm/types" +) + +// MockGasRegister mock that implements keeper.GasRegister +type MockGasRegister struct { + CompileCostFn func(byteLength int) sdk.Gas + NewContractInstanceCostFn func(pinned bool, msgLen int) sdk.Gas + InstantiateContractCostFn func(pinned bool, msgLen int) sdk.Gas + ReplyCostFn func(pinned bool, reply wasmvmtypes.Reply) sdk.Gas + EventCostsFn func(evts []wasmvmtypes.EventAttribute) sdk.Gas + ToWasmVMGasFn func(source sdk.Gas) uint64 + FromWasmVMGasFn func(source uint64) sdk.Gas + UncompressCostsFn func(byteLength int) sdk.Gas +} + +func (m MockGasRegister) NewContractInstanceCosts(pinned bool, msgLen int) sdk.Gas { + if m.NewContractInstanceCostFn == nil { + panic("not expected to be called") + } + return m.NewContractInstanceCostFn(pinned, msgLen) +} + +func (m MockGasRegister) CompileCosts(byteLength int) sdk.Gas { + if m.CompileCostFn == nil { + panic("not expected to be called") + } + return m.CompileCostFn(byteLength) +} + +func (m MockGasRegister) UncompressCosts(byteLength int) sdk.Gas { + if m.UncompressCostsFn == nil { + panic("not expected to be called") + } + return m.UncompressCostsFn(byteLength) +} + +func (m MockGasRegister) InstantiateContractCosts(pinned bool, msgLen int) sdk.Gas { + if m.InstantiateContractCostFn == nil { + panic("not expected to be called") + } + return m.InstantiateContractCostFn(pinned, msgLen) +} + +func (m MockGasRegister) ReplyCosts(pinned bool, reply wasmvmtypes.Reply) sdk.Gas { + if m.ReplyCostFn == nil { + panic("not expected to be called") + } + return m.ReplyCostFn(pinned, reply) +} + +func (m MockGasRegister) EventCosts(evts []wasmvmtypes.EventAttribute, events wasmvmtypes.Events) sdk.Gas { + if m.EventCostsFn == nil { + panic("not expected to be called") + } + return m.EventCostsFn(evts) +} + +func (m MockGasRegister) ToWasmVMGas(source sdk.Gas) uint64 { + if m.ToWasmVMGasFn == nil { + panic("not expected to be called") + } + return m.ToWasmVMGasFn(source) +} + +func (m MockGasRegister) FromWasmVMGas(source uint64) sdk.Gas { + if m.FromWasmVMGasFn == nil { + panic("not expected to be called") + } + return m.FromWasmVMGasFn(source) +} diff --git a/x/wasm/keeper/wasmtesting/mock_keepers.go b/x/wasm/keeper/wasmtesting/mock_keepers.go index 52e51d4b52..ac81c0223a 100644 --- a/x/wasm/keeper/wasmtesting/mock_keepers.go +++ b/x/wasm/keeper/wasmtesting/mock_keepers.go @@ -1,10 +1,10 @@ package wasmtesting import ( + channeltypes "github.com/line/ibc-go/v3/modules/core/04-channel/types" + ibcexported "github.com/line/ibc-go/v3/modules/core/exported" sdk "github.com/line/lbm-sdk/types" capabilitytypes "github.com/line/lbm-sdk/x/capability/types" - channeltypes "github.com/line/lbm-sdk/x/ibc/core/04-channel/types" - ibcexported "github.com/line/lbm-sdk/x/ibc/core/exported" "github.com/line/wasmd/x/wasm/types" ) diff --git a/x/wasm/module.go b/x/wasm/module.go index 636e9dda8d..364b557e37 100644 --- a/x/wasm/module.go +++ b/x/wasm/module.go @@ -3,11 +3,15 @@ package wasm import ( "context" "encoding/json" + "fmt" "math/rand" + "runtime/debug" + "strings" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cast" "github.com/spf13/cobra" + abci "github.com/tendermint/tendermint/abci/types" "github.com/line/lbm-sdk/client" "github.com/line/lbm-sdk/codec" @@ -17,12 +21,10 @@ import ( sdk "github.com/line/lbm-sdk/types" "github.com/line/lbm-sdk/types/module" simtypes "github.com/line/lbm-sdk/types/simulation" - simKeeper "github.com/line/lbm-sdk/x/simulation" - abci "github.com/line/ostracon/abci/types" + wasmvm "github.com/line/wasmvm" "github.com/line/wasmd/x/wasm/client/cli" "github.com/line/wasmd/x/wasm/keeper" - "github.com/line/wasmd/x/wasm/lbmtypes" "github.com/line/wasmd/x/wasm/simulation" "github.com/line/wasmd/x/wasm/types" ) @@ -88,7 +90,7 @@ func (b AppModuleBasic) GetQueryCmd() *cobra.Command { // RegisterInterfaces implements InterfaceModule func (b AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { - lbmtypes.RegisterInterfaces(registry) + types.RegisterInterfaces(registry) } // ____________________________________________________________________________ @@ -100,7 +102,7 @@ type AppModule struct { keeper *Keeper validatorSetSource keeper.ValidatorSetSource accountKeeper types.AccountKeeper // for simulation - bankKeeper simKeeper.BankKeeper + bankKeeper simulation.BankKeeper } // ConsensusVersion is a sequence number for state-breaking change of the @@ -115,7 +117,7 @@ func NewAppModule( keeper *Keeper, validatorSetSource keeper.ValidatorSetSource, ak types.AccountKeeper, - bk simKeeper.BankKeeper, + bk simulation.BankKeeper, ) AppModule { return AppModule{ AppModuleBasic: AppModuleBasic{}, @@ -130,12 +132,6 @@ func NewAppModule( func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(keeper.NewDefaultPermissionKeeper(am.keeper))) types.RegisterQueryServer(cfg.QueryServer(), NewQuerier(am.keeper)) - lbmtypes.RegisterQueryServer(cfg.QueryServer(), NewQuerier(am.keeper)) - - // m := keeper.NewMigrator(*am.keeper) - // if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { - // panic(fmt.Sprintf("failed to migrate x/distribution from version 1 to 2: %v", err)) - // } } func (am AppModule) LegacyQuerierHandler(amino *codec.LegacyAmino) sdk.Querier { //nolint:staticcheck @@ -158,7 +154,7 @@ func (AppModule) QuerierRoute() string { // InitGenesis performs genesis initialization for the wasm module. It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { - var genesisState types.GenesisState + var genesisState GenesisState cdc.MustUnmarshalJSON(data, &genesisState) validators, err := InitGenesis(ctx, am.keeper, genesisState, am.validatorSetSource, am.Route().Handler()) if err != nil { @@ -219,6 +215,8 @@ func AddModuleInitFlags(startCmd *cobra.Command) { startCmd.Flags().Uint32(flagWasmMemoryCacheSize, defaults.MemoryCacheSize, "Sets the size in MiB (NOT bytes) of an in-memory cache for Wasm modules. Set to 0 to disable.") startCmd.Flags().Uint64(flagWasmQueryGasLimit, defaults.SmartQueryGasLimit, "Set the max gas that can be spent on executing a query with a Wasm contract") startCmd.Flags().String(flagWasmSimulationGasLimit, "", "Set the max gas that can be spent when executing a simulation TX") + + startCmd.PreRunE = chainPreRuns(checkLibwasmVersion, startCmd.PreRunE) } // ReadWasmConfig reads the wasm specifig configuration @@ -252,3 +250,50 @@ func ReadWasmConfig(opts servertypes.AppOptions) (types.WasmConfig, error) { } return cfg, nil } + +func getExpectedLibwasmVersion() string { + buildInfo, ok := debug.ReadBuildInfo() + if !ok { + panic("can't read build info") + } + for _, d := range buildInfo.Deps { + if d.Path != "github.com/line/wasmvm" { + continue + } + if d.Replace != nil { + return d.Replace.Version + } + return d.Version + } + return "" +} + +func checkLibwasmVersion(cmd *cobra.Command, args []string) error { + wasmVersion, err := wasmvm.LibwasmvmVersion() + if err != nil { + return fmt.Errorf("unable to retrieve libwasmversion %w", err) + } + wasmExpectedVersion := getExpectedLibwasmVersion() + if wasmExpectedVersion == "" { + return fmt.Errorf("wasmvm module not exist") + } + if !strings.Contains(wasmExpectedVersion, wasmVersion) { + return fmt.Errorf("libwasmversion mismatch. got: %s; expected: %s", wasmVersion, wasmExpectedVersion) + } + return nil +} + +type preRunFn func(cmd *cobra.Command, args []string) error + +func chainPreRuns(pfns ...preRunFn) preRunFn { + return func(cmd *cobra.Command, args []string) error { + for _, pfn := range pfns { + if pfn != nil { + if err := pfn(cmd, args); err != nil { + return err + } + } + } + return nil + } +} diff --git a/x/wasm/module_integration_test.go b/x/wasm/module_integration_test.go new file mode 100644 index 0000000000..98bbc85724 --- /dev/null +++ b/x/wasm/module_integration_test.go @@ -0,0 +1,32 @@ +package wasm_test + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + sdk "github.com/line/lbm-sdk/types" + "github.com/line/lbm-sdk/types/module" + upgradetypes "github.com/line/lbm-sdk/x/upgrade/types" + + "github.com/line/wasmd/app" + "github.com/line/wasmd/x/wasm" +) + +func TestModuleMigrations(t *testing.T) { + wasmApp := app.Setup(false) + 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) + } + fromVM := wasmApp.UpgradeKeeper.GetModuleVersionMap(ctx) + fromVM[wasm.ModuleName] = 1 // start with initial version + upgradeHandler(ctx, upgradetypes.Plan{Name: "testing"}, fromVM) + // when + gotVM, err := wasmApp.ModuleManager().RunMigrations(ctx, wasmApp.ModuleConfigurator(), fromVM) + // then + require.NoError(t, err) + assert.Equal(t, uint64(1), gotVM[wasm.ModuleName]) +} diff --git a/x/wasm/module_test.go b/x/wasm/module_test.go index e7d609da1d..5721452b0d 100644 --- a/x/wasm/module_test.go +++ b/x/wasm/module_test.go @@ -1,25 +1,33 @@ package wasm import ( + "bytes" "encoding/json" "fmt" + "io" "os" + "os/exec" + "path/filepath" + "strings" "testing" "github.com/dvsekhvalnov/jose2go/base64url" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" sdk "github.com/line/lbm-sdk/types" + "github.com/line/lbm-sdk/types/address" "github.com/line/lbm-sdk/types/module" authkeeper "github.com/line/lbm-sdk/x/auth/keeper" bankkeeper "github.com/line/lbm-sdk/x/bank/keeper" stakingkeeper "github.com/line/lbm-sdk/x/staking/keeper" - abci "github.com/line/ostracon/abci/types" "github.com/line/ostracon/crypto" "github.com/line/ostracon/crypto/ed25519" + wasmvm "github.com/line/wasmvm" "github.com/line/wasmd/x/wasm/keeper" + "github.com/line/wasmd/x/wasm/keeper/testdata" "github.com/line/wasmd/x/wasm/types" ) @@ -34,7 +42,7 @@ type testData struct { } func setupTest(t *testing.T) testData { - ctx, keepers := CreateTestInput(t, false, "iterator,staking,stargate", nil, nil) + ctx, keepers := CreateTestInput(t, false, "iterator,staking,stargate,cosmwasm_1_1") cdc := keeper.MakeTestCodec(t) data := testData{ module: NewAppModule(cdc, keepers.WasmKeeper, keepers.StakingKeeper, keepers.AccountKeeper, keepers.BankKeeper), @@ -67,7 +75,7 @@ var ( _, _, addrAcc1 = keyPubAddr() addr1 = addrAcc1.String() testContract = mustLoad("./keeper/testdata/hackatom.wasm") - maskContract = mustLoad("./keeper/testdata/reflect.wasm") + maskContract = testdata.ReflectContractWasm() oldContract = mustLoad("./testdata/escrow_0.7.wasm") ) @@ -136,8 +144,6 @@ type initMsg struct { Beneficiary sdk.AccAddress `json:"beneficiary"` } -type emptyMsg struct{} - type state struct { Verifier string `json:"verifier"` Beneficiary string `json:"beneficiary"` @@ -146,7 +152,7 @@ type state struct { func TestHandleInstantiate(t *testing.T) { data := setupTest(t) - creator := data.faucet.NewFundedAccount(data.ctx, sdk.NewInt64Coin("denom", 100000)) + creator := data.faucet.NewFundedRandomAccount(data.ctx, sdk.NewInt64Coin("denom", 100000)) h := data.module.Route().Handler() q := data.module.LegacyQuerierHandler(nil) @@ -175,74 +181,20 @@ func TestHandleInstantiate(t *testing.T) { CodeID: firstCodeID, Msg: initMsgBz, Funds: nil, + Label: "testing", } res, err = h(data.ctx, &initCmd) require.NoError(t, err) contractBech32Addr := parseInitResponse(t, res.Data) - assert.Equal(t, "link14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sgf2vn8", contractBech32Addr) - // this should be standard x/wasm init event, nothing from contract - assert.Equal(t, 3, len(res.Events), prettyEvents(res.Events)) - assert.Equal(t, "message", res.Events[0].Type) - assertAttribute(t, "module", "wasm", res.Events[0].Attributes[0]) - assert.Equal(t, "instantiate", res.Events[1].Type) - assert.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) - - assertContractList(t, q, data.ctx, 1, []string{contractBech32Addr}) - assertContractInfo(t, q, data.ctx, contractBech32Addr, 1, creator) - assertContractState(t, q, data.ctx, contractBech32Addr, state{ - Verifier: fred.String(), - Beneficiary: bob.String(), - Funder: creator.String(), - }) -} - -func TestHandleStoreAndInstantiate(t *testing.T) { - data := setupTest(t) - creator := data.faucet.NewFundedAccount(data.ctx, sdk.NewInt64Coin("denom", 100000)) - - h := data.module.Route().Handler() - q := data.module.LegacyQuerierHandler(nil) - - _, _, bob := keyPubAddr() - _, _, fred := keyPubAddr() - - initMsg := initMsg{ - Verifier: fred, - Beneficiary: bob, - } - msgBz, err := json.Marshal(initMsg) - require.NoError(t, err) - - // create with no balance is legal - msg := &MsgStoreCodeAndInstantiateContract{ - Sender: creator.String(), - WASMByteCode: testContract, - Msg: msgBz, - Label: "contract for test", - Funds: nil, - } - res, err := h(data.ctx, msg) - require.NoError(t, err) - codeID, contractBech32Addr := parseStoreAndInitResponse(t, res.Data) - - require.Equal(t, uint64(1), codeID) require.Equal(t, "link14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sgf2vn8", contractBech32Addr) // this should be standard x/wasm init event, nothing from contract - require.Equal(t, 4, len(res.Events), prettyEvents(res.Events)) - assert.Equal(t, "store_code", res.Events[0].Type) - assertAttribute(t, "code_id", "1", res.Events[0].Attributes[0]) - assert.Equal(t, "message", res.Events[1].Type) - assertAttribute(t, "module", "wasm", res.Events[1].Attributes[0]) - assert.Equal(t, "instantiate", res.Events[2].Type) + require.Equal(t, 3, len(res.Events), prettyEvents(res.Events)) + require.Equal(t, "message", res.Events[0].Type) + assertAttribute(t, "module", "wasm", res.Events[0].Attributes[0]) + require.Equal(t, "instantiate", res.Events[1].Type) + require.Equal(t, "wasm", res.Events[2].Type) assertAttribute(t, "_contract_address", contractBech32Addr, res.Events[2].Attributes[0]) - assertAttribute(t, "code_id", "1", res.Events[2].Attributes[1]) - assert.Equal(t, "wasm", res.Events[3].Type) - assertAttribute(t, "_contract_address", contractBech32Addr, res.Events[3].Attributes[0]) assertCodeList(t, q, data.ctx, 1) assertCodeBytes(t, q, data.ctx, 1, testContract) @@ -256,132 +208,14 @@ func TestHandleStoreAndInstantiate(t *testing.T) { }) } -func TestErrorsCreateAndInstantiate(t *testing.T) { - // init messages - _, _, bob := keyPubAddr() - _, _, fred := keyPubAddr() - initMsg := initMsg{ - Verifier: fred, - Beneficiary: bob, - } - validInitMsgBz, err := json.Marshal(initMsg) - require.NoError(t, err) - - invalidInitMsgBz, err := json.Marshal(emptyMsg{}) - - expectedContractBech32Addr := "link14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sgf2vn8" - - // test cases - cases := map[string]struct { - msg sdk.Msg - isValid bool - expectedCodes int - expectedBytes []byte - }{ - "empty": { - msg: &MsgStoreCodeAndInstantiateContract{}, - isValid: false, - expectedCodes: 0, - expectedBytes: nil, - }, - "valid one": { - msg: &MsgStoreCodeAndInstantiateContract{ - Sender: addr1, - WASMByteCode: testContract, - Msg: validInitMsgBz, - Label: "foo", - Funds: nil, - }, - isValid: true, - expectedCodes: 1, - expectedBytes: testContract, - }, - "invalid wasm": { - msg: &MsgStoreCodeAndInstantiateContract{ - Sender: addr1, - WASMByteCode: []byte("foobar"), - Msg: validInitMsgBz, - Label: "foo", - Funds: nil, - }, - isValid: false, - expectedCodes: 0, - expectedBytes: nil, - }, - "old wasm (0.7)": { - msg: &MsgStoreCodeAndInstantiateContract{ - Sender: addr1, - WASMByteCode: oldContract, - Msg: validInitMsgBz, - Label: "foo", - Funds: nil, - }, - isValid: false, - expectedCodes: 0, - expectedBytes: nil, - }, - "invalid init message": { - msg: &MsgStoreCodeAndInstantiateContract{ - Sender: addr1, - WASMByteCode: testContract, - Msg: invalidInitMsgBz, - Label: "foo", - Funds: nil, - }, - isValid: false, - expectedCodes: 1, - expectedBytes: testContract, - }, - } - - for name, tc := range cases { - tc := tc - t.Run(name, func(t *testing.T) { - data := setupTest(t) - - h := data.module.Route().Handler() - q := data.module.LegacyQuerierHandler(nil) - - // asserting response - res, err := h(data.ctx, tc.msg) - if tc.isValid { - require.NoError(t, err) - codeID, contractBech32Addr := parseStoreAndInitResponse(t, res.Data) - require.Equal(t, uint64(1), codeID) - require.Equal(t, expectedContractBech32Addr, contractBech32Addr) - - } else { - require.Error(t, err, "%#v", res) - } - - // asserting code state - assertCodeList(t, q, data.ctx, tc.expectedCodes) - assertCodeBytes(t, q, data.ctx, 1, tc.expectedBytes) - - // asserting contract state - if tc.isValid { - assertContractList(t, q, data.ctx, 1, []string{expectedContractBech32Addr}) - assertContractInfo(t, q, data.ctx, expectedContractBech32Addr, 1, addrAcc1) - assertContractState(t, q, data.ctx, expectedContractBech32Addr, state{ - Verifier: fred.String(), - Beneficiary: bob.String(), - Funder: addrAcc1.String(), - }) - } else { - assertContractList(t, q, data.ctx, 0, []string{}) - } - }) - } -} - func TestHandleExecute(t *testing.T) { data := setupTest(t) deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) topUp := sdk.NewCoins(sdk.NewInt64Coin("denom", 5000)) - creator := data.faucet.NewFundedAccount(data.ctx, deposit.Add(deposit...)...) - fred := data.faucet.NewFundedAccount(data.ctx, topUp...) + 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) @@ -407,21 +241,22 @@ func TestHandleExecute(t *testing.T) { CodeID: firstCodeID, Msg: initMsgBz, Funds: deposit, + Label: "testing", } res, err = h(data.ctx, &initCmd) require.NoError(t, err) contractBech32Addr := parseInitResponse(t, res.Data) - assert.Equal(t, "link14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sgf2vn8", contractBech32Addr) - // this should be standard x/wasm init event, plus a bank send event (2), with no custom contract events - assert.Equal(t, 6, len(res.Events), prettyEvents(res.Events)) - assert.Equal(t, "message", res.Events[0].Type) + require.Equal(t, "link14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sgf2vn8", contractBech32Addr) + // this should be standard x/wasm message event, init event, plus a bank send event (2), with no custom contract events + require.Equal(t, 6, len(res.Events), prettyEvents(res.Events)) + require.Equal(t, "message", res.Events[0].Type) assertAttribute(t, "module", "wasm", res.Events[0].Attributes[0]) - assert.Equal(t, "coin_spent", res.Events[1].Type) - assert.Equal(t, "coin_received", res.Events[2].Type) - assert.Equal(t, "transfer", res.Events[3].Type) - assert.Equal(t, "instantiate", res.Events[4].Type) - assert.Equal(t, "wasm", res.Events[5].Type) + require.Equal(t, "coin_spent", res.Events[1].Type) + require.Equal(t, "coin_received", res.Events[2].Type) + require.Equal(t, "transfer", res.Events[3].Type) + require.Equal(t, "instantiate", res.Events[4].Type) + require.Equal(t, "wasm", res.Events[5].Type) assertAttribute(t, "_contract_address", contractBech32Addr, res.Events[5].Attributes[0]) // ensure bob doesn't exist @@ -521,8 +356,9 @@ func TestHandleExecuteEscrow(t *testing.T) { deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) topUp := sdk.NewCoins(sdk.NewInt64Coin("denom", 5000)) - creator := data.faucet.NewFundedAccount(data.ctx, deposit.Add(deposit...)...) - fred := data.faucet.NewFundedAccount(data.ctx, topUp...) + creator := sdk.AccAddress(bytes.Repeat([]byte{1}, address.Len)) + data.faucet.Fund(data.ctx, creator, sdk.NewInt64Coin("denom", 100000)) + fred := data.faucet.NewFundedRandomAccount(data.ctx, topUp...) h := data.module.Route().Handler() @@ -546,6 +382,7 @@ func TestHandleExecuteEscrow(t *testing.T) { CodeID: firstCodeID, Msg: initMsgBz, Funds: deposit, + Label: "testing", } res, err = h(data.ctx, &initCmd) require.NoError(t, err) @@ -760,3 +597,38 @@ func assertContractInfo(t *testing.T, q sdk.Querier, ctx sdk.Context, contractBe assert.Equal(t, codeID, res.CodeID) assert.Equal(t, creator.String(), res.Creator) } + +func TestCheckLibwasmVersion(t *testing.T) { + f, err := os.Open(filepath.Join(moduleBasePath(t), "go.mod")) + assert.NoError(t, err) + + res, err := io.ReadAll(f) + assert.NoError(t, err) + parsed := strings.Split(string(res), "\n") + var expected string + for _, line := range parsed { + if strings.Contains(line, "github.com/line/wasmvm") { + expected = strings.Split(strings.TrimSpace(line), " ")[1] + } + } + got, err := wasmvm.LibwasmvmVersion() + assert.NoError(t, err) + assert.Contains(t, expected, got) +} + +func moduleBasePath(t *testing.T) string { + t.Helper() + + err := os.Setenv("GO111MODULE", "on") + if err != nil { + t.Fatalf("unable to set GO111MODULE env var: %v", err) + } + + cmd := exec.Command("go", "list", "-f", "{{.Module.Dir}}") + out, err := cmd.Output() + if err != nil { + t.Fatalf("failed to evaluate Go module base path: %v", err) + } + + return strings.TrimSpace(string(out)) +} diff --git a/x/wasm/relay_pingpong_test.go b/x/wasm/relay_pingpong_test.go index 4f0191d2c6..be630e35c3 100644 --- a/x/wasm/relay_pingpong_test.go +++ b/x/wasm/relay_pingpong_test.go @@ -8,12 +8,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + ibctransfertypes "github.com/line/ibc-go/v3/modules/apps/transfer/types" + clienttypes "github.com/line/ibc-go/v3/modules/core/02-client/types" + channeltypes "github.com/line/ibc-go/v3/modules/core/04-channel/types" + ibctesting "github.com/line/ibc-go/v3/testing" "github.com/line/lbm-sdk/store/prefix" sdk "github.com/line/lbm-sdk/types" - ibctransfertypes "github.com/line/lbm-sdk/x/ibc/applications/transfer/types" - clienttypes "github.com/line/lbm-sdk/x/ibc/core/02-client/types" - channeltypes "github.com/line/lbm-sdk/x/ibc/core/04-channel/types" - ibctesting "github.com/line/lbm-sdk/x/ibc/testing" wasmvm "github.com/line/wasmvm" wasmvmtypes "github.com/line/wasmvm/types" @@ -31,6 +31,7 @@ const ( var doNotTimeout = clienttypes.NewHeight(1, 1111111) func TestPinPong(t *testing.T) { + t.Skip("check it later after enable use ibc-go v3.3.0+ in lbm-sdk") // custom IBC protocol example // scenario: given two chains, // with a contract on chain A and chain B @@ -326,7 +327,7 @@ func (p player) incrementCounter(key []byte, store wasmvm.KVStore) uint64 { } func (p player) QueryState(key []byte) uint64 { - raw := p.chain.GetTestSupport().WasmKeeper().QueryRaw(p.chain.GetContext(), p.contractAddr, key) + raw := p.chain.App.WasmKeeper.QueryRaw(p.chain.GetContext(), p.contractAddr, key) return sdk.BigEndianToUint64(raw) } diff --git a/x/wasm/relay_test.go b/x/wasm/relay_test.go index eb0d3bcf5d..b2f11f3d27 100644 --- a/x/wasm/relay_test.go +++ b/x/wasm/relay_test.go @@ -9,12 +9,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + ibctransfertypes "github.com/line/ibc-go/v3/modules/apps/transfer/types" + clienttypes "github.com/line/ibc-go/v3/modules/core/02-client/types" + channeltypes "github.com/line/ibc-go/v3/modules/core/04-channel/types" + ibctesting "github.com/line/ibc-go/v3/testing" sdk "github.com/line/lbm-sdk/types" sdkerrors "github.com/line/lbm-sdk/types/errors" - ibctransfertypes "github.com/line/lbm-sdk/x/ibc/applications/transfer/types" - clienttypes "github.com/line/lbm-sdk/x/ibc/core/02-client/types" - channeltypes "github.com/line/lbm-sdk/x/ibc/core/04-channel/types" - ibctesting "github.com/line/lbm-sdk/x/ibc/testing" wasmvm "github.com/line/wasmvm" wasmvmtypes "github.com/line/wasmvm/types" @@ -24,7 +24,9 @@ import ( "github.com/line/wasmd/x/wasm/types" ) +// todo check it later after removing voter sampling of ostracon func TestFromIBCTransferToContract(t *testing.T) { + t.Skip("check it later after removing voter sampling of ostracon") // scenario: given two chains, // with a contract on chain B // then the contract can handle the receiving side of an ics20 transfer @@ -130,7 +132,9 @@ func TestFromIBCTransferToContract(t *testing.T) { } } +// todo check it later after removing voter sampling of ostracon func TestContractCanInitiateIBCTransferMsg(t *testing.T) { + t.Skip("check it later after removing voter sampling of ostracon") // scenario: given two chains, // with a contract on chain A // then the contract can start an ibc transfer via ibctransfertypes.NewMsgTransfer @@ -196,13 +200,15 @@ func TestContractCanInitiateIBCTransferMsg(t *testing.T) { require.Equal(t, 0, len(chainB.PendingSendPackets)) // and dest chain balance contains voucher - bankKeeperB := chainB.GetTestSupport().BankKeeper() + bankKeeperB := chainB.App.BankKeeper expBalance := ibctransfertypes.GetTransferCoin(path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, coinToSendToB.Denom, coinToSendToB.Amount) gotBalance := chainB.Balance(chainB.SenderAccount.GetAddress(), expBalance.Denom) assert.Equal(t, expBalance, gotBalance, "got total balance: %s", bankKeeperB.GetAllBalances(chainB.GetContext(), chainB.SenderAccount.GetAddress())) } +// todo check it later after removing voter sampling of ostracon func TestContractCanEmulateIBCTransferMessage(t *testing.T) { + t.Skip("check it later after removing voter sampling of ostracon") // scenario: given two chains, // with a contract on chain A // then the contract can emulate the ibc transfer module in the contract to send an ibc packet @@ -271,13 +277,15 @@ func TestContractCanEmulateIBCTransferMessage(t *testing.T) { require.Equal(t, 0, len(chainB.PendingSendPackets)) // and dest chain balance contains voucher - bankKeeperB := chainB.GetTestSupport().BankKeeper() + bankKeeperB := chainB.App.BankKeeper expBalance := ibctransfertypes.GetTransferCoin(path.EndpointB.ChannelConfig.PortID, path.EndpointB.ChannelID, coinToSendToB.Denom, coinToSendToB.Amount) gotBalance := chainB.Balance(chainB.SenderAccount.GetAddress(), expBalance.Denom) assert.Equal(t, expBalance, gotBalance, "got total balance: %s", bankKeeperB.GetAllBalances(chainB.GetContext(), chainB.SenderAccount.GetAddress())) } +// todo check it later after removing voter sampling of ostracon func TestContractCanEmulateIBCTransferMessageWithTimeout(t *testing.T) { + t.Skip("check it later after removing voter sampling of ostracon") // scenario: given two chains, // with a contract on chain A // then the contract can emulate the ibc transfer module in the contract to send an ibc packet @@ -359,7 +367,9 @@ func TestContractCanEmulateIBCTransferMessageWithTimeout(t *testing.T) { assert.Equal(t, initialSenderBalance.String(), newSenderBalance.String()) } +// todo check it later after removing voter sampling of ostracon func TestContractHandlesChannelClose(t *testing.T) { + t.Skip("check it later after removing voter sampling of ostracon") // scenario: a contract is the sending side of an ics20 transfer but the packet was not received // on the destination chain within the timeout boundaries myContractA := &captureCloseContract{} @@ -538,7 +548,7 @@ func (c *ackReceiverContract) IBCPacketReceive(codeID wasmvm.Checksum, env wasmv // call original ibctransfer keeper to not copy all code into this ibcPacket := toIBCPacket(packet) ctx := c.chain.GetContext() // HACK: please note that this is not reverted after checkTX - err := c.chain.GetTestSupport().TransferKeeper().OnRecvPacket(ctx, ibcPacket, src) + err := c.chain.App.TransferKeeper.OnRecvPacket(ctx, ibcPacket, src) if err != nil { return nil, 0, sdkerrors.Wrap(err, "within our smart contract") } @@ -563,7 +573,7 @@ func (c *ackReceiverContract) IBCPacketAck(codeID wasmvm.Checksum, env wasmvmtyp // call original ibctransfer keeper to not copy all code into this ctx := c.chain.GetContext() // HACK: please note that this is not reverted after checkTX ibcPacket := toIBCPacket(msg.OriginalPacket) - err := c.chain.GetTestSupport().TransferKeeper().OnAcknowledgementPacket(ctx, ibcPacket, data, ack) + err := c.chain.App.TransferKeeper.OnAcknowledgementPacket(ctx, ibcPacket, data, ack) if err != nil { return nil, 0, sdkerrors.Wrap(err, "within our smart contract") } diff --git a/x/wasm/simulation/genesis.go b/x/wasm/simulation/genesis.go index 4981401687..7720dca663 100644 --- a/x/wasm/simulation/genesis.go +++ b/x/wasm/simulation/genesis.go @@ -1,33 +1,28 @@ package simulation import ( - "encoding/json" - "fmt" - "github.com/line/lbm-sdk/types/module" "github.com/line/wasmd/x/wasm/types" ) -// RandomizedGenState RandomizeGenState generates a random GenesisState for wasm -func RandomizedGenState(simState *module.SimulationState) { - params := RandomParams(simState.Rand) +// RandomizedGenState generates a random GenesisState for wasm +func RandomizedGenState(simstate *module.SimulationState) { + params := types.DefaultParams() wasmGenesis := types.GenesisState{ Params: params, Codes: nil, Contracts: nil, Sequences: []types.Sequence{ - {IDKey: types.KeyLastCodeID, Value: simState.Rand.Uint64()}, - {IDKey: types.KeyLastInstanceID, Value: simState.Rand.Uint64()}, + {IDKey: types.KeyLastCodeID, Value: simstate.Rand.Uint64()}, }, GenMsgs: nil, } - bz, err := json.MarshalIndent(&wasmGenesis.Params, "", " ") + _, err := simstate.Cdc.MarshalJSON(&wasmGenesis) if err != nil { panic(err) } - fmt.Printf("Selected randomly generated wasm parameters:\n%s\n", bz) - simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&wasmGenesis) + simstate.GenState[types.ModuleName] = simstate.Cdc.MustMarshalJSON(&wasmGenesis) } diff --git a/x/wasm/simulation/operations.go b/x/wasm/simulation/operations.go index 5f2f0eedac..7208037c9c 100644 --- a/x/wasm/simulation/operations.go +++ b/x/wasm/simulation/operations.go @@ -1,72 +1,119 @@ package simulation import ( + "encoding/json" "math/rand" + "os" "github.com/line/lbm-sdk/baseapp" sdk "github.com/line/lbm-sdk/types" + sdkerrors "github.com/line/lbm-sdk/types/errors" "github.com/line/lbm-sdk/types/module" simtypes "github.com/line/lbm-sdk/types/simulation" "github.com/line/lbm-sdk/x/simulation" + wasmvmtypes "github.com/line/wasmvm/types" - wasmappparams "github.com/line/wasmd/app/params" + "github.com/line/wasmd/app/params" + wasmkeeper "github.com/line/wasmd/x/wasm/keeper" "github.com/line/wasmd/x/wasm/keeper/testdata" "github.com/line/wasmd/x/wasm/types" ) // Simulation operation weights constants +// +//nolint:gosec const ( - OpWeightMsgStoreCode = "op_weight_msg_store_code" //nolint:gosec - OpWeightMsgInstantiateContract = "op_weight_msg_instantiate_contract" //nolint:gosec - OpReflectContractPath = "op_reflect_contract_path" //nolint:gosec + OpWeightMsgStoreCode = "op_weight_msg_store_code" + OpWeightMsgInstantiateContract = "op_weight_msg_instantiate_contract" + OpWeightMsgExecuteContract = "op_weight_msg_execute_contract" + OpReflectContractPath = "op_reflect_contract_path" ) // WasmKeeper is a subset of the wasm keeper used by simulations type WasmKeeper interface { GetParams(ctx sdk.Context) types.Params IterateCodeInfos(ctx sdk.Context, cb func(uint64, types.CodeInfo) bool) + IterateContractInfo(ctx sdk.Context, cb func(sdk.AccAddress, types.ContractInfo) bool) + QuerySmart(ctx sdk.Context, contractAddr sdk.AccAddress, req []byte) ([]byte, error) + PeekAutoIncrementID(ctx sdk.Context, lastIDKey []byte) uint64 +} +type BankKeeper interface { + simulation.BankKeeper + IsSendEnabledCoin(ctx sdk.Context, coin sdk.Coin) bool } // WeightedOperations returns all the operations from the module with their respective weights func WeightedOperations( simstate *module.SimulationState, ak types.AccountKeeper, - bk simulation.BankKeeper, + bk BankKeeper, wasmKeeper WasmKeeper, ) simulation.WeightedOperations { var ( weightMsgStoreCode int weightMsgInstantiateContract int + weightMsgExecuteContract int + wasmContractPath string ) simstate.AppParams.GetOrGenerate(simstate.Cdc, OpWeightMsgStoreCode, &weightMsgStoreCode, nil, func(_ *rand.Rand) { - weightMsgStoreCode = wasmappparams.DefaultWeightMsgStoreCode + weightMsgStoreCode = params.DefaultWeightMsgStoreCode }, ) simstate.AppParams.GetOrGenerate(simstate.Cdc, OpWeightMsgInstantiateContract, &weightMsgInstantiateContract, nil, func(_ *rand.Rand) { - weightMsgInstantiateContract = wasmappparams.DefaultWeightMsgInstantiateContract + weightMsgInstantiateContract = params.DefaultWeightMsgInstantiateContract + }, + ) + simstate.AppParams.GetOrGenerate(simstate.Cdc, OpWeightMsgExecuteContract, &weightMsgInstantiateContract, nil, + func(_ *rand.Rand) { + weightMsgExecuteContract = params.DefaultWeightMsgExecuteContract + }, + ) + simstate.AppParams.GetOrGenerate(simstate.Cdc, OpReflectContractPath, &wasmContractPath, nil, + func(_ *rand.Rand) { + wasmContractPath = "" }, ) - wasmBz := testdata.ReflectContractWasm() + var wasmBz []byte + if wasmContractPath == "" { + wasmBz = testdata.ReflectContractWasm() + } else { + var err error + wasmBz, err = os.ReadFile(wasmContractPath) + if err != nil { + panic(err) + } + } return simulation.WeightedOperations{ simulation.NewWeightedOperation( weightMsgStoreCode, - SimulateMsgStoreCode(ak, bk, wasmKeeper, wasmBz), + SimulateMsgStoreCode(ak, bk, wasmKeeper, wasmBz, 5_000_000), ), simulation.NewWeightedOperation( weightMsgInstantiateContract, - SimulateMsgInstantiateContract(ak, bk, wasmKeeper), + SimulateMsgInstantiateContract(ak, bk, wasmKeeper, DefaultSimulationCodeIDSelector), + ), + simulation.NewWeightedOperation( + weightMsgExecuteContract, + SimulateMsgExecuteContract( + ak, + bk, + wasmKeeper, + DefaultSimulationExecuteContractSelector, + DefaultSimulationExecuteSenderSelector, + DefaultSimulationExecutePayloader, + ), ), } } // SimulateMsgStoreCode generates a MsgStoreCode with random values -func SimulateMsgStoreCode(ak types.AccountKeeper, bk simulation.BankKeeper, wasmKeeper WasmKeeper, wasmBz []byte) simtypes.Operation { +func SimulateMsgStoreCode(ak types.AccountKeeper, bk BankKeeper, wasmKeeper WasmKeeper, wasmBz []byte, gas uint64) simtypes.Operation { return func( r *rand.Rand, app *baseapp.BaseApp, @@ -78,37 +125,39 @@ func SimulateMsgStoreCode(ak types.AccountKeeper, bk simulation.BankKeeper, wasm return simtypes.NoOpMsg(types.ModuleName, types.MsgStoreCode{}.Type(), "no chain permission"), nil, nil } - config := &types.AccessConfig{ - Permission: types.AccessTypeEverybody, - } - simAccount, _ := simtypes.RandomAcc(r, accs) + + permission := wasmKeeper.GetParams(ctx).InstantiateDefaultPermission + config := permission.With(simAccount.Address) + msg := types.MsgStoreCode{ Sender: simAccount.Address.String(), WASMByteCode: wasmBz, - InstantiatePermission: config, + InstantiatePermission: &config, } + txCtx := BuildOperationInput(r, app, ctx, &msg, simAccount, ak, bk, nil) + return GenAndDeliverTxWithRandFees(txCtx, gas) + } +} - txCtx := simulation.OperationInput{ - R: r, - App: app, - TxGen: wasmappparams.MakeEncodingConfig().TxConfig, - Cdc: nil, - Msg: &msg, - MsgType: msg.Type(), - Context: ctx, - SimAccount: simAccount, - AccountKeeper: ak, - Bankkeeper: bk, - ModuleName: types.ModuleName, - } +// CodeIDSelector returns code id to be used in simulations +type CodeIDSelector = func(ctx sdk.Context, wasmKeeper WasmKeeper) uint64 - return simulation.GenAndDeliverTxWithRandFees(txCtx) - } +// DefaultSimulationCodeIDSelector picks the first code id +func DefaultSimulationCodeIDSelector(ctx sdk.Context, wasmKeeper WasmKeeper) uint64 { + var codeID uint64 + wasmKeeper.IterateCodeInfos(ctx, func(u uint64, info types.CodeInfo) bool { + if info.InstantiateConfig.Permission != types.AccessTypeEverybody { + return false + } + codeID = u + return true + }) + return codeID } // SimulateMsgInstantiateContract generates a MsgInstantiateContract with random values -func SimulateMsgInstantiateContract(ak types.AccountKeeper, bk simulation.BankKeeper, wasmKeeper WasmKeeper) simtypes.Operation { +func SimulateMsgInstantiateContract(ak types.AccountKeeper, bk BankKeeper, wasmKeeper WasmKeeper, codeSelector CodeIDSelector) simtypes.Operation { return func( r *rand.Rand, app *baseapp.BaseApp, @@ -118,20 +167,17 @@ func SimulateMsgInstantiateContract(ak types.AccountKeeper, bk simulation.BankKe ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { simAccount, _ := simtypes.RandomAcc(r, accs) - var codeID uint64 - wasmKeeper.IterateCodeInfos(ctx, func(u uint64, info types.CodeInfo) bool { - if info.InstantiateConfig.Permission != types.AccessTypeEverybody { - return false - } - codeID = u - return true - }) - + codeID := codeSelector(ctx, wasmKeeper) if codeID == 0 { return simtypes.NoOpMsg(types.ModuleName, types.MsgInstantiateContract{}.Type(), "no codes with permission available"), nil, nil } - - spendable := bk.SpendableCoins(ctx, simAccount.Address) + deposit := sdk.Coins{} + spendableCoins := bk.SpendableCoins(ctx, simAccount.Address) + for _, v := range spendableCoins { + if bk.IsSendEnabledCoin(ctx, v) { + deposit = deposit.Add(simtypes.RandSubsetCoins(r, sdk.NewCoins(v))...) + } + } msg := types.MsgInstantiateContract{ Sender: simAccount.Address.String(), @@ -139,23 +185,156 @@ func SimulateMsgInstantiateContract(ak types.AccountKeeper, bk simulation.BankKe CodeID: codeID, Label: simtypes.RandStringOfLength(r, 10), Msg: []byte(`{}`), - Funds: simtypes.RandSubsetCoins(r, spendable), + Funds: deposit, + } + txCtx := BuildOperationInput(r, app, ctx, &msg, simAccount, ak, bk, deposit) + return simulation.GenAndDeliverTxWithRandFees(txCtx) + } +} + +// MsgExecuteContractSelector returns contract address to be used in simulations +type MsgExecuteContractSelector = func(ctx sdk.Context, wasmKeeper WasmKeeper) sdk.AccAddress + +// MsgExecutePayloader extension point to modify msg with custom payload +type MsgExecutePayloader func(msg *types.MsgExecuteContract) error + +// MsgExecuteSenderSelector extension point that returns the sender address +type MsgExecuteSenderSelector func(wasmKeeper WasmKeeper, ctx sdk.Context, contractAddr sdk.AccAddress, accs []simtypes.Account) (simtypes.Account, error) + +// SimulateMsgExecuteContract create a execute message a reflect contract instance +func SimulateMsgExecuteContract( + ak types.AccountKeeper, + bk BankKeeper, + wasmKeeper WasmKeeper, + contractSelector MsgExecuteContractSelector, + senderSelector MsgExecuteSenderSelector, + payloader MsgExecutePayloader, +) simtypes.Operation { + return func( + r *rand.Rand, + app *baseapp.BaseApp, + ctx sdk.Context, + accs []simtypes.Account, + chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + contractAddr := contractSelector(ctx, wasmKeeper) + if contractAddr == nil { + return simtypes.NoOpMsg(types.ModuleName, types.MsgExecuteContract{}.Type(), "no contract instance available"), nil, nil + } + simAccount, err := senderSelector(wasmKeeper, ctx, contractAddr, accs) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.MsgExecuteContract{}.Type(), "query contract owner"), nil, err } - txCtx := simulation.OperationInput{ - R: r, - App: app, - TxGen: wasmappparams.MakeEncodingConfig().TxConfig, - Cdc: nil, - Msg: &msg, - MsgType: msg.Type(), - Context: ctx, - SimAccount: simAccount, - AccountKeeper: ak, - Bankkeeper: bk, - ModuleName: types.ModuleName, + deposit := sdk.Coins{} + spendableCoins := bk.SpendableCoins(ctx, simAccount.Address) + for _, v := range spendableCoins { + if bk.IsSendEnabledCoin(ctx, v) { + deposit = deposit.Add(simtypes.RandSubsetCoins(r, sdk.NewCoins(v))...) + } + } + if deposit.IsZero() { + return simtypes.NoOpMsg(types.ModuleName, types.MsgExecuteContract{}.Type(), "broke account"), nil, nil + } + msg := types.MsgExecuteContract{ + Sender: simAccount.Address.String(), + Contract: contractAddr.String(), + Funds: deposit, + } + if err := payloader(&msg); err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.MsgExecuteContract{}.Type(), "contract execute payload"), nil, err } + txCtx := BuildOperationInput(r, app, ctx, &msg, simAccount, ak, bk, deposit) 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: params.MakeEncodingConfig().TxConfig, + Cdc: nil, + Msg: msg, + MsgType: msg.Type(), + Context: ctx, + SimAccount: simAccount, + AccountKeeper: ak, + Bankkeeper: bk, + ModuleName: types.ModuleName, + CoinsSpentInMsg: deposit, + } +} + +// DefaultSimulationExecuteContractSelector picks the first contract address +func DefaultSimulationExecuteContractSelector(ctx sdk.Context, wasmKeeper WasmKeeper) sdk.AccAddress { + var r sdk.AccAddress + wasmKeeper.IterateContractInfo(ctx, func(address sdk.AccAddress, info types.ContractInfo) bool { + r = address + return true + }) + return r +} + +// DefaultSimulationExecuteSenderSelector queries reflect contract for owner address and selects accounts +func DefaultSimulationExecuteSenderSelector(wasmKeeper WasmKeeper, ctx sdk.Context, contractAddr sdk.AccAddress, accs []simtypes.Account) (simtypes.Account, error) { + var none simtypes.Account + bz, err := json.Marshal(testdata.ReflectQueryMsg{Owner: &struct{}{}}) + if err != nil { + return none, sdkerrors.Wrap(err, "build smart query") + } + got, err := wasmKeeper.QuerySmart(ctx, contractAddr, bz) + if err != nil { + return none, sdkerrors.Wrap(err, "exec smart query") + } + var ownerRes testdata.OwnerResponse + if err := json.Unmarshal(got, &ownerRes); err != nil || ownerRes.Owner == "" { + return none, sdkerrors.Wrap(err, "parse smart query response") + } + ownerAddr, err := sdk.AccAddressFromBech32(ownerRes.Owner) + if err != nil { + return none, sdkerrors.Wrap(err, "parse contract owner address") + } + simAccount, ok := simtypes.FindAccount(accs, ownerAddr) + if !ok { + return none, sdkerrors.Wrap(err, "unknown contract owner address") + } + return simAccount, nil +} + +// DefaultSimulationExecutePayloader implements a bank msg to send the +// tokens from contract account back to original sender +func DefaultSimulationExecutePayloader(msg *types.MsgExecuteContract) error { + reflectSend := testdata.ReflectHandleMsg{ + Reflect: &testdata.ReflectPayload{ + Msgs: []wasmvmtypes.CosmosMsg{{ + Bank: &wasmvmtypes.BankMsg{ + Send: &wasmvmtypes.SendMsg{ + ToAddress: msg.Sender, // + Amount: wasmkeeper.ConvertSdkCoinsToWasmCoins(msg.Funds), + }, + }, + }}, + }, + } + reflectSendBz, err := json.Marshal(reflectSend) + if err != nil { + return err + } + msg.Msg = reflectSendBz + return nil +} diff --git a/x/wasm/simulation/operations_test.go b/x/wasm/simulation/operations_test.go index 47981a8e45..acc8cdd3ec 100644 --- a/x/wasm/simulation/operations_test.go +++ b/x/wasm/simulation/operations_test.go @@ -18,7 +18,7 @@ func TestWeightedOperations(t *testing.T) { type args struct { simstate *module.SimulationState ak types.AccountKeeper - bk simulation.BankKeeper + bk BankKeeper wasmKeeper WasmKeeper wasmBz []byte } @@ -41,10 +41,15 @@ func TestWeightedOperations(t *testing.T) { want: simulation.WeightedOperations{ simulation.NewWeightedOperation( wasmappparams.DefaultWeightMsgStoreCode, - SimulateMsgStoreCode(params.ak, params.bk, params.wasmKeeper, params.wasmBz)), + SimulateMsgStoreCode(params.ak, params.bk, params.wasmKeeper, params.wasmBz, 5_000_000)), simulation.NewWeightedOperation( wasmappparams.DefaultWeightMsgInstantiateContract, - SimulateMsgInstantiateContract(params.ak, params.bk, params.wasmKeeper)), + SimulateMsgInstantiateContract(params.ak, params.bk, params.wasmKeeper, DefaultSimulationCodeIDSelector)), + simulation.NewWeightedOperation( + wasmappparams.DefaultWeightMsgExecuteContract, + SimulateMsgExecuteContract(params.ak, params.bk, params.wasmKeeper, + DefaultSimulationExecuteContractSelector, DefaultSimulationExecuteSenderSelector, + DefaultSimulationExecutePayloader)), }, }, } @@ -69,6 +74,6 @@ const SupportedFeatures = "iterator,staking,stargate" // Copy from keeper_test.go func makeKeeper(t *testing.T) keeper.TestKeepers { - _, keepers := keeper.CreateTestInput(t, false, SupportedFeatures, nil, nil) + _, keepers := keeper.CreateTestInput(t, false, SupportedFeatures) return keepers } diff --git a/x/wasm/simulation/params.go b/x/wasm/simulation/params.go index dcac18af09..fb8f3e4c22 100644 --- a/x/wasm/simulation/params.go +++ b/x/wasm/simulation/params.go @@ -12,7 +12,7 @@ import ( ) func ParamChanges(r *rand.Rand, cdc codec.Codec) []simtypes.ParamChange { - params := RandomParams(r) + params := types.DefaultParams() return []simtypes.ParamChange{ simulation.NewSimParamChange(types.ModuleName, string(types.ParamStoreKeyUploadAccess), func(r *rand.Rand) string { @@ -38,8 +38,5 @@ func RandomParams(r *rand.Rand) types.Params { return types.Params{ CodeUploadAccess: accessConfig, InstantiateDefaultPermission: accessConfig.Permission, - GasMultiplier: types.DefaultGasMultiplier, - InstanceCost: types.DefaultInstanceCost, - CompileCost: types.DefaultCompileCost, } } diff --git a/x/wasm/simulation/sim_utils.go b/x/wasm/simulation/sim_utils.go new file mode 100644 index 0000000000..7f5f9fde82 --- /dev/null +++ b/x/wasm/simulation/sim_utils.go @@ -0,0 +1,53 @@ +package simulation + +import ( + "github.com/line/lbm-sdk/simapp/helpers" + sdk "github.com/line/lbm-sdk/types" + simtypes "github.com/line/lbm-sdk/types/simulation" + "github.com/line/lbm-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/codec.go b/x/wasm/types/codec.go index a7012c26c6..a47d5f2741 100644 --- a/x/wasm/types/codec.go +++ b/x/wasm/types/codec.go @@ -16,6 +16,7 @@ import ( func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { //nolint:staticcheck legacy.RegisterAminoMsg(cdc, &MsgStoreCode{}, "wasm/MsgStoreCode") legacy.RegisterAminoMsg(cdc, &MsgInstantiateContract{}, "wasm/MsgInstantiateContract") + legacy.RegisterAminoMsg(cdc, &MsgInstantiateContract2{}, "wasm/MsgInstantiateContract2") legacy.RegisterAminoMsg(cdc, &MsgExecuteContract{}, "wasm/MsgExecuteContract") legacy.RegisterAminoMsg(cdc, &MsgMigrateContract{}, "wasm/MsgMigrateContract") legacy.RegisterAminoMsg(cdc, &MsgUpdateAdmin{}, "wasm/MsgUpdateAdmin") @@ -40,6 +41,7 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { (*sdk.Msg)(nil), &MsgStoreCode{}, &MsgInstantiateContract{}, + &MsgInstantiateContract2{}, &MsgExecuteContract{}, &MsgMigrateContract{}, &MsgUpdateAdmin{}, @@ -67,7 +69,10 @@ func RegisterInterfaces(registry types.InterfaceRegistry) { } var ( - amino = codec.NewLegacyAmino() + amino = codec.NewLegacyAmino() + + // ModuleCdc references the global x/wasm module codec. + ModuleCdc = codec.NewAminoCodec(amino) ) diff --git a/x/wasm/types/errors.go b/x/wasm/types/errors.go index 5eafb527ad..5717f464eb 100644 --- a/x/wasm/types/errors.go +++ b/x/wasm/types/errors.go @@ -55,7 +55,7 @@ var ( // ErrMaxIBCChannels error for maximum number of ibc channels reached ErrMaxIBCChannels = sdkErrors.Register(DefaultCodespace, 16, "max transfer channels") - // ErrUnsupportedForContract error when a feature is used that is not supported for/ by this contract + // ErrUnsupportedForContract error when a capability is used that is not supported for/ by this contract ErrUnsupportedForContract = sdkErrors.Register(DefaultCodespace, 17, "unsupported for this contract") // ErrPinContractFailed error for pinning contract failures @@ -87,9 +87,6 @@ var ( // ErrExceedMaxQueryStackSize error if max query stack size is exceeded ErrExceedMaxQueryStackSize = sdkErrors.Register(DefaultCodespace, 27, "max query stack size exceeded") - - // ErrInactiveContract error if the contract set inactive - ErrInactiveContract = sdkErrors.Register(DefaultCodespace, 101, "inactive contract") ) type ErrNoSuchContract struct { diff --git a/x/wasm/types/events.go b/x/wasm/types/events.go index 6ce6ba2bd2..579024ed0c 100644 --- a/x/wasm/types/events.go +++ b/x/wasm/types/events.go @@ -5,17 +5,11 @@ const ( WasmModuleEventType = "wasm" // CustomContractEventPrefix contracts can create custom events. To not mix them with other system events they got the `wasm-` prefix. CustomContractEventPrefix = "wasm-" - // events from callable point - CallablePointEventType = "wasm-callablepoint" - // prefix for custom events from callable point - CustomCallablePointEventPrefix = "wasm-callablepoint-" EventTypeStoreCode = "store_code" EventTypeInstantiate = "instantiate" EventTypeExecute = "execute" EventTypeMigrate = "migrate" - EventTypeUpdateAdmin = "update_admin" - EventTypeClearAdmin = "clear_admin" EventTypePinCode = "pin_code" EventTypeUnpinCode = "unpin_code" EventTypeSudo = "sudo" @@ -27,10 +21,9 @@ const ( const ( AttributeReservedPrefix = "_" - AttributeKeyContractAddr = "_contract_address" - AttributeKeyCallstack = "_callstack" - AttributeKeyCodeID = "code_id" - AttributeKeyCodeIDs = "code_ids" - AttributeKeyResultDataHex = "result" - AttributeKeyFeature = "feature" + AttributeKeyContractAddr = "_contract_address" + AttributeKeyCodeID = "code_id" + AttributeKeyChecksum = "code_checksum" + AttributeKeyResultDataHex = "result" + AttributeKeyRequiredCapability = "required_capability" ) diff --git a/x/wasm/types/expected_keepers.go b/x/wasm/types/expected_keepers.go index 20e5f0e13a..d2ad86913b 100644 --- a/x/wasm/types/expected_keepers.go +++ b/x/wasm/types/expected_keepers.go @@ -3,13 +3,13 @@ package types import ( "context" + connectiontypes "github.com/line/ibc-go/v3/modules/core/03-connection/types" + channeltypes "github.com/line/ibc-go/v3/modules/core/04-channel/types" + ibcexported "github.com/line/ibc-go/v3/modules/core/exported" sdk "github.com/line/lbm-sdk/types" authtypes "github.com/line/lbm-sdk/x/auth/types" capabilitytypes "github.com/line/lbm-sdk/x/capability/types" "github.com/line/lbm-sdk/x/distribution/types" - connectiontypes "github.com/line/lbm-sdk/x/ibc/core/03-connection/types" - channeltypes "github.com/line/lbm-sdk/x/ibc/core/04-channel/types" - ibcexported "github.com/line/lbm-sdk/x/ibc/core/exported" stakingtypes "github.com/line/lbm-sdk/x/staking/types" ) @@ -17,6 +17,7 @@ import ( type BankViewKeeper interface { GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin + GetSupply(ctx sdk.Context, denom string) sdk.Coin } // Burner is a subset of the sdk bank keeper methods diff --git a/x/wasm/types/exported_keepers.go b/x/wasm/types/exported_keepers.go index 1a8a0f4328..e1da1874d4 100644 --- a/x/wasm/types/exported_keepers.go +++ b/x/wasm/types/exported_keepers.go @@ -20,17 +20,35 @@ type ViewKeeper interface { IterateCodeInfos(ctx sdk.Context, cb func(uint64, CodeInfo) bool) GetByteCode(ctx sdk.Context, codeID uint64) ([]byte, error) IsPinnedCode(ctx sdk.Context, codeID uint64) bool - IterateInactiveContracts(ctx sdk.Context, fn func(contractAddress sdk.AccAddress) bool) - IsInactiveContract(ctx sdk.Context, contractAddress sdk.AccAddress) bool + GetParams(ctx sdk.Context) Params } // ContractOpsKeeper contains mutable operations on a contract. type ContractOpsKeeper interface { // Create uploads and compiles a WASM contract, returning a short identifier for the contract - Create(ctx sdk.Context, creator sdk.AccAddress, wasmCode []byte, instantiateAccess *AccessConfig) (codeID uint64, err error) + Create(ctx sdk.Context, creator sdk.AccAddress, wasmCode []byte, instantiateAccess *AccessConfig) (codeID uint64, checksum []byte, err error) - // Instantiate creates an instance of a WASM contract - Instantiate(ctx sdk.Context, codeID uint64, creator, admin sdk.AccAddress, initMsg []byte, label string, deposit sdk.Coins) (sdk.AccAddress, []byte, error) + // Instantiate creates an instance of a WASM contract using the classic sequence based address generator + Instantiate( + ctx sdk.Context, + codeID uint64, + creator, admin sdk.AccAddress, + initMsg []byte, + label string, + deposit sdk.Coins, + ) (sdk.AccAddress, []byte, error) + + // Instantiate2 creates an instance of a WASM contract using the predictable address generator + Instantiate2( + ctx sdk.Context, + codeID uint64, + creator, admin sdk.AccAddress, + initMsg []byte, + label string, + deposit sdk.Coins, + salt []byte, + fixMsg bool, + ) (sdk.AccAddress, []byte, error) // Execute executes the contract instance Execute(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, msg []byte, coins sdk.Coins) ([]byte, error) @@ -57,13 +75,7 @@ type ContractOpsKeeper interface { SetContractInfoExtension(ctx sdk.Context, contract sdk.AccAddress, extra ContractInfoExtension) error // SetAccessConfig updates the access config of a code id. - SetAccessConfig(ctx sdk.Context, codeID uint64, config AccessConfig) error - - // DeactivateContract add the contract address to inactive contract list. - DeactivateContract(ctx sdk.Context, contractAddress sdk.AccAddress) error - - // ActivateContract remove the contract address from inactive contract list. - ActivateContract(ctx sdk.Context, contractAddress sdk.AccAddress) error + SetAccessConfig(ctx sdk.Context, codeID uint64, caller sdk.AccAddress, newConfig AccessConfig) error } // IBCContractKeeper IBC lifecycle event handler diff --git a/x/wasm/types/genesis.go b/x/wasm/types/genesis.go index b8b08b3d61..810dfe51dc 100644 --- a/x/wasm/types/genesis.go +++ b/x/wasm/types/genesis.go @@ -37,11 +37,6 @@ func (s GenesisState) ValidateBasic() error { return sdkerrors.Wrapf(err, "gen message: %d", i) } } - for i, addr := range s.InactiveContractAddresses { - if _, err := sdk.AccAddressFromBech32(addr); err != nil { - return sdkerrors.Wrapf(err, "inactive contract address: %d", i) - } - } return nil } diff --git a/x/wasm/types/genesis.pb.go b/x/wasm/types/genesis.pb.go index ad5b145923..4fba3d0133 100644 --- a/x/wasm/types/genesis.pb.go +++ b/x/wasm/types/genesis.pb.go @@ -30,8 +30,6 @@ type GenesisState struct { Contracts []Contract `protobuf:"bytes,3,rep,name=contracts,proto3" json:"contracts,omitempty"` Sequences []Sequence `protobuf:"bytes,4,rep,name=sequences,proto3" json:"sequences,omitempty"` GenMsgs []GenesisState_GenMsgs `protobuf:"bytes,5,rep,name=gen_msgs,json=genMsgs,proto3" json:"gen_msgs,omitempty"` - // InactiveContractAddresses is a list of contract address that set inactive - InactiveContractAddresses []string `protobuf:"bytes,6,rep,name=inactive_contract_addresses,json=inactiveContractAddresses,proto3" json:"inactive_contract_address, omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -102,13 +100,6 @@ func (m *GenesisState) GetGenMsgs() []GenesisState_GenMsgs { return nil } -func (m *GenesisState) GetInactiveContractAddresses() []string { - if m != nil { - return m.InactiveContractAddresses - } - return nil -} - // GenMsgs define the messages that can be executed during genesis phase in // order. The intention is to have more human readable data that is auditable. type GenesisState_GenMsgs struct { @@ -406,50 +397,48 @@ func init() { func init() { proto.RegisterFile("cosmwasm/wasm/v1/genesis.proto", fileDescriptor_2ab3f539b23472a6) } var fileDescriptor_2ab3f539b23472a6 = []byte{ - // 679 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x94, 0xcd, 0x4e, 0xdb, 0x40, - 0x10, 0xc7, 0x63, 0x92, 0x98, 0x64, 0x48, 0x0b, 0x5a, 0x10, 0x18, 0xd3, 0x3a, 0x51, 0x8a, 0xaa, - 0x54, 0x42, 0x89, 0xa0, 0x52, 0x4f, 0xad, 0xaa, 0xba, 0xa0, 0x12, 0x21, 0xa4, 0xd6, 0xa8, 0x97, - 0x4a, 0x28, 0x32, 0xf6, 0x60, 0xac, 0x62, 0x6f, 0x9a, 0xdd, 0xa4, 0xe4, 0xdc, 0x5b, 0x4f, 0x7d, - 0x85, 0xbe, 0x4c, 0xc5, 0x91, 0x63, 0x4f, 0x51, 0x15, 0x6e, 0x3c, 0x45, 0xb5, 0xeb, 0x8f, 0x18, - 0x92, 0x5c, 0x2c, 0xcf, 0xcc, 0x7f, 0x7e, 0x3b, 0xb3, 0xbb, 0xb3, 0x60, 0x38, 0x94, 0x05, 0xdf, - 0x6d, 0x16, 0xb4, 0xe4, 0x67, 0xb0, 0xdb, 0xf2, 0x30, 0x44, 0xe6, 0xb3, 0x66, 0xb7, 0x47, 0x39, - 0x25, 0x2b, 0x49, 0xbc, 0x29, 0x3f, 0x83, 0x5d, 0x7d, 0xcd, 0xa3, 0x1e, 0x95, 0xc1, 0x96, 0xf8, - 0x8b, 0x74, 0xfa, 0x93, 0x29, 0x0e, 0x1f, 0x76, 0x31, 0xa6, 0xe8, 0x9b, 0xd3, 0xd1,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d4, 0x94, 0x46, 0xc9, 0x8a, - 0xad, 0xfa, 0x1f, 0x05, 0x4a, 0xe9, 0x56, 0xbc, 0x80, 0x95, 0x87, 0x07, 0x2e, 0x0b, 0x2e, 0x5b, - 0xcb, 0xce, 0xfd, 0x33, 0x26, 0x6d, 0x78, 0x94, 0x4a, 0x33, 0x15, 0x1b, 0xf3, 0x87, 0x2b, 0x53, - 0x75, 0xc5, 0xc9, 0xf8, 0xc8, 0x3e, 0x3c, 0x4e, 0x51, 0x4c, 0xdc, 0xea, 0x78, 0x50, 0x37, 0x66, - 0x6c, 0x3f, 0x75, 0xf1, 0x32, 0x86, 0xa4, 0xeb, 0xcb, 0x49, 0xa8, 0x9b, 0x50, 0x4a, 0xe6, 0x8d, - 0xd4, 0x40, 0xf5, 0xdd, 0xce, 0x57, 0x1c, 0xca, 0xea, 0x2b, 0x66, 0x79, 0x3c, 0xaa, 0x16, 0xdb, - 0xfb, 0x47, 0x38, 0xb4, 0x8a, 0xbe, 0x7b, 0x84, 0x43, 0xb2, 0x06, 0xc5, 0x81, 0x7d, 0xd9, 0x47, - 0x59, 0x76, 0xc1, 0x8a, 0x0c, 0xf3, 0xf5, 0xf5, 0xd8, 0x50, 0x6e, 0xc6, 0x86, 0xf2, 0x6f, 0x6c, - 0x28, 0xbf, 0x6e, 0x8d, 0xdc, 0xcd, 0xad, 0x91, 0xfb, 0x7b, 0x6b, 0xe4, 0xbe, 0xd4, 0x3d, 0x9f, - 0x5f, 0xf4, 0xcf, 0x9a, 0x0e, 0x0d, 0x5a, 0x97, 0x7e, 0x88, 0xf2, 0xe5, 0x73, 0x5b, 0x57, 0xd1, - 0x0b, 0x28, 0x1f, 0xc7, 0x33, 0x55, 0x3e, 0x81, 0x2f, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0x3b, - 0x04, 0x85, 0xd1, 0x85, 0x05, 0x00, 0x00, + // 643 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00,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 0xef, 0xef, 0x1e, 0xe0, 0xc4, 0xd1, + 0x43, 0xff, 0x00, 0x27, 0x64, 0x03, 0xf4, 0x73, 0xf7, 0x6c, 0x8c, 0xb2, 0xec, 0x8a, 0x93, 0x1c, + 0xec, 0xe7, 0x97, 0x33, 0x4b, 0xbb, 0x9a, 0x59, 0xda, 0xef, 0x99, 0xa5, 0x7d, 0xbb, 0xb6, 0x4a, + 0x57, 0xd7, 0x56, 0xe9, 0xd7, 0xb5, 0x55, 0xfa, 0xd0, 0x0e, 0x42, 0xfe, 0x71, 0x7c, 0xd2, 0xf5, + 0x68, 0xd4, 0x3b, 0x0b, 0x63, 0x94, 0xef, 0x91, 0xdf, 0xbb, 0x48, 0xde, 0x25, 0xf9, 0x64, 0x9d, + 0x54, 0xe5, 0xc3, 0xf4, 0xf4, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2e, 0xa4, 0x50, 0x6f, 0x1b, + 0x05, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -472,15 +461,6 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.InactiveContractAddresses) > 0 { - for iNdEx := len(m.InactiveContractAddresses) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.InactiveContractAddresses[iNdEx]) - copy(dAtA[i:], m.InactiveContractAddresses[iNdEx]) - i = encodeVarintGenesis(dAtA, i, uint64(len(m.InactiveContractAddresses[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } if len(m.GenMsgs) > 0 { for iNdEx := len(m.GenMsgs) - 1; iNdEx >= 0; iNdEx-- { { @@ -832,12 +812,6 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } - if len(m.InactiveContractAddresses) > 0 { - for _, s := range m.InactiveContractAddresses { - l = len(s) - n += 1 + l + sovGenesis(uint64(l)) - } - } return n } @@ -1151,38 +1125,6 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InactiveContractAddresses", 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.InactiveContractAddresses = append(m.InactiveContractAddresses, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/wasm/types/keys.go b/x/wasm/types/keys.go index bbf35094a9..4cf6991999 100644 --- a/x/wasm/types/keys.go +++ b/x/wasm/types/keys.go @@ -32,8 +32,6 @@ var ( PinnedCodeIndexPrefix = []byte{0x07} TXCounterPrefix = []byte{0x08} - InactiveContractPrefix = []byte{0x90} - KeyLastCodeID = append(SequenceKeyPrefix, []byte("lastCodeId")...) KeyLastInstanceID = append(SequenceKeyPrefix, []byte("lastContractId")...) ) @@ -107,10 +105,3 @@ func GetPinnedCodeIndexPrefix(codeID uint64) []byte { func ParsePinnedCodeIndex(s []byte) uint64 { return sdk.BigEndianToUint64(s) } - -func GetInactiveContractKey(contractAddress sdk.AccAddress) []byte { - key := make([]byte, len(InactiveContractPrefix)+len(contractAddress)) - copy(key, InactiveContractPrefix) - copy(key[len(InactiveContractPrefix):], contractAddress) - return key -} diff --git a/x/wasm/types/keys_test.go b/x/wasm/types/keys_test.go index 84c6e5e2f4..340f8041cf 100644 --- a/x/wasm/types/keys_test.go +++ b/x/wasm/types/keys_test.go @@ -70,13 +70,3 @@ func TestGetContractByCreatedSecondaryIndexKey(t *testing.T) { } assert.Equal(t, exp, got) } - -func TestGetInactiveContractKey(t *testing.T) { - addr := bytes.Repeat([]byte{4}, 20) - got := GetInactiveContractKey(addr) - exp := []byte{0x90, // prefix - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // address 20 bytes - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - } - assert.Equal(t, exp, got) -} diff --git a/x/wasm/types/params.go b/x/wasm/types/params.go index 7a7378cdb8..f93f64dce0 100644 --- a/x/wasm/types/params.go +++ b/x/wasm/types/params.go @@ -13,59 +13,41 @@ import ( paramtypes "github.com/line/lbm-sdk/x/params/types" ) -const ( - // DefaultGasMultiplier is how many CosmWasm gas points = 1 Cosmos SDK gas point. - // - // CosmWasm gas strategy is documented in https://https://github.com/line/cosmwasm/blob/v1.0.0-0.6.0/docs/GAS.md. - // LBM SDK reference costs can be found here: https://github.com/line/lbm-sdk/blob/main/store/types/gas.go#L199-L209. - // - // The original multiplier of 100 up to CosmWasm 0.16 was based on - // "A write at ~3000 gas and ~200us = 10 gas per us (microsecond) cpu/io - // Rough timing have 88k gas at 90us, which is equal to 1k sdk gas... (one read)" - // as well as manual Wasmer benchmarks from 2019. This was then multiplied by 150_000 - // in the 0.16 -> 1.0 upgrade (https://github.com/CosmWasm/cosmwasm/pull/1120). - // - // The multiplier deserves more reproducible benchmarking and a strategy that allows easy adjustments. - // This is tracked in https://github.com/CosmWasm/wasmd/issues/566 and https://github.com/CosmWasm/wasmd/issues/631. - // Gas adjustments are consensus breaking but may happen in any release marked as consensus breaking. - // Do not make assumptions on how much gas an operation will consume in places that are hard to adjust, - // such as hardcoding them in contracts. - // - // Please note that all gas prices returned to wasmvm should have this multiplied. - DefaultGasMultiplier uint64 = 140_000_000 - // DefaultInstanceCost is how much SDK gas we charge each time we load a WASM instance. - // Creating a new instance is costly, and this helps put a recursion limit to contract calling contracts. - DefaultInstanceCost = 60_000 - // DefaultCompileCost is how much SDK gas we charge *per byte* for compiling WASM code. - DefaultCompileCost = 3 +var ( + ParamStoreKeyUploadAccess = []byte("uploadAccess") + ParamStoreKeyInstantiateAccess = []byte("instantiateAccess") ) -var ParamStoreKeyUploadAccess = []byte("uploadAccess") -var ParamStoreKeyInstantiateAccess = []byte("instantiateAccess") - -// TODO: detach below params because these are lbm-sdk custom params - -var ParamStoreKeyGasMultiplier = []byte("gasMultiplier") -var ParamStoreKeyInstanceCost = []byte("instanceCost") -var ParamStoreKeyCompileCost = []byte("compileCost") - var AllAccessTypes = []AccessType{ AccessTypeNobody, AccessTypeOnlyAddress, + AccessTypeAnyOfAddresses, AccessTypeEverybody, } -func (a AccessType) With(addr sdk.AccAddress) AccessConfig { +func (a AccessType) With(addrs ...sdk.AccAddress) AccessConfig { switch a { case AccessTypeNobody: return AllowNobody case AccessTypeOnlyAddress: - if err := sdk.VerifyAddressFormat(addr); err != nil { + if n := len(addrs); n != 1 { + panic(fmt.Sprintf("expected exactly 1 address but got %d", n)) + } + if err := sdk.VerifyAddressFormat(addrs[0]); err != nil { panic(err) } - return AccessConfig{Permission: AccessTypeOnlyAddress, Address: addr.String()} + return AccessConfig{Permission: AccessTypeOnlyAddress, Address: addrs[0].String()} case AccessTypeEverybody: return AllowEverybody + case AccessTypeAnyOfAddresses: + bech32Addrs := make([]string, len(addrs)) + for i, v := range addrs { + bech32Addrs[i] = v.String() + } + if err := assertValidAddresses(bech32Addrs); err != nil { + panic(sdkerrors.Wrap(err, "addresses")) + } + return AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: bech32Addrs} } panic("unsupported access type") } @@ -78,6 +60,8 @@ func (a AccessType) String() string { return "OnlyAddress" case AccessTypeEverybody: return "Everybody" + case AccessTypeAnyOfAddresses: + return "AnyOfAddresses" } return "Unspecified" } @@ -125,9 +109,6 @@ func DefaultParams() Params { return Params{ CodeUploadAccess: AllowEverybody, InstantiateDefaultPermission: AccessTypeEverybody, - GasMultiplier: DefaultGasMultiplier, - InstanceCost: DefaultInstanceCost, - CompileCost: DefaultCompileCost, } } @@ -144,9 +125,6 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { return paramtypes.ParamSetPairs{ paramtypes.NewParamSetPair(ParamStoreKeyUploadAccess, &p.CodeUploadAccess, validateAccessConfig), paramtypes.NewParamSetPair(ParamStoreKeyInstantiateAccess, &p.InstantiateDefaultPermission, validateAccessType), - paramtypes.NewParamSetPair(ParamStoreKeyGasMultiplier, &p.GasMultiplier, validateGasMultiplier), - paramtypes.NewParamSetPair(ParamStoreKeyInstanceCost, &p.InstanceCost, validateInstanceCost), - paramtypes.NewParamSetPair(ParamStoreKeyCompileCost, &p.CompileCost, validateCompileCost), } } @@ -185,6 +163,7 @@ func validateAccessType(i interface{}) error { return sdkerrors.Wrapf(ErrInvalid, "unknown type: %q", a) } +// ValidateBasic performs basic validation func (a AccessConfig) ValidateBasic() error { switch a.Permission { case AccessTypeUnspecified: @@ -195,45 +174,39 @@ func (a AccessConfig) ValidateBasic() error { } return nil case AccessTypeOnlyAddress: + if len(a.Addresses) != 0 { + return ErrInvalid.Wrap("addresses field set") + } _, err := sdk.AccAddressFromBech32(a.Address) return err + case AccessTypeAnyOfAddresses: + if a.Address != "" { + return ErrInvalid.Wrap("address field set") + } + return sdkerrors.Wrap(assertValidAddresses(a.Addresses), "addresses") } return sdkerrors.Wrapf(ErrInvalid, "unknown type: %q", a.Permission) } -func validateGasMultiplier(i interface{}) error { - a, ok := i.(uint64) - if !ok { - return sdkerrors.Wrapf(ErrInvalid, "type: %T", i) - } - if a == 0 { - return sdkerrors.Wrap(ErrInvalid, "must be greater than 0") - } - return nil -} - -func validateInstanceCost(i interface{}) error { - a, ok := i.(uint64) - if !ok { - return sdkerrors.Wrapf(ErrInvalid, "type: %T", i) - } - if a == 0 { - return sdkerrors.Wrap(ErrInvalid, "must be greater than 0") +func assertValidAddresses(addrs []string) error { + if len(addrs) == 0 { + return ErrEmpty } - return nil -} - -func validateCompileCost(i interface{}) error { - a, ok := i.(uint64) - if !ok { - return sdkerrors.Wrapf(ErrInvalid, "type: %T", i) - } - if a == 0 { - return sdkerrors.Wrap(ErrInvalid, "must be greater than 0") + idx := make(map[string]struct{}, len(addrs)) + for _, a := range addrs { + if _, err := sdk.AccAddressFromBech32(a); err != nil { + return sdkerrors.Wrapf(err, "address: %s", a) + } + if _, exists := idx[a]; exists { + return ErrDuplicate.Wrapf("address: %s", a) + } + idx[a] = struct{}{} } return nil } +// Allowed returns if permission includes the actor. +// Actor address must be valid and not nil func (a AccessConfig) Allowed(actor sdk.AccAddress) bool { switch a.Permission { case AccessTypeNobody: @@ -242,6 +215,13 @@ func (a AccessConfig) Allowed(actor sdk.AccAddress) bool { return true case AccessTypeOnlyAddress: return a.Address == actor.String() + case AccessTypeAnyOfAddresses: + for _, v := range a.Addresses { + if v == actor.String() { + return true + } + } + return false default: panic("unknown type") } diff --git a/x/wasm/types/params_test.go b/x/wasm/types/params_test.go index f5a35f2c65..4159d393af 100644 --- a/x/wasm/types/params_test.go +++ b/x/wasm/types/params_test.go @@ -1,6 +1,7 @@ package types import ( + "bytes" "encoding/json" "testing" @@ -15,6 +16,7 @@ import ( func TestValidateParams(t *testing.T) { var ( anyAddress sdk.AccAddress = make([]byte, ContractAddrLen) + otherAddress sdk.AccAddress = bytes.Repeat([]byte{1}, ContractAddrLen) invalidAddress = "invalid address" ) @@ -29,35 +31,35 @@ func TestValidateParams(t *testing.T) { src: Params{ CodeUploadAccess: AllowNobody, InstantiateDefaultPermission: AccessTypeNobody, - GasMultiplier: DefaultGasMultiplier, - InstanceCost: DefaultInstanceCost, - CompileCost: DefaultCompileCost, }, }, "all good with everybody": { src: Params{ CodeUploadAccess: AllowEverybody, InstantiateDefaultPermission: AccessTypeEverybody, - GasMultiplier: DefaultGasMultiplier, - InstanceCost: DefaultInstanceCost, - CompileCost: DefaultCompileCost, }, }, "all good with only address": { src: Params{ CodeUploadAccess: AccessTypeOnlyAddress.With(anyAddress), InstantiateDefaultPermission: AccessTypeOnlyAddress, - GasMultiplier: DefaultGasMultiplier, - InstanceCost: DefaultInstanceCost, - CompileCost: DefaultCompileCost, + }, + }, + "all good with anyOf address": { + src: Params{ + CodeUploadAccess: AccessTypeAnyOfAddresses.With(anyAddress), + InstantiateDefaultPermission: AccessTypeAnyOfAddresses, + }, + }, + "all good with anyOf addresses": { + src: Params{ + CodeUploadAccess: AccessTypeAnyOfAddresses.With(anyAddress, otherAddress), + InstantiateDefaultPermission: AccessTypeAnyOfAddresses, }, }, "reject empty type in instantiate permission": { src: Params{ CodeUploadAccess: AllowNobody, - GasMultiplier: DefaultGasMultiplier, - InstanceCost: DefaultInstanceCost, - CompileCost: DefaultCompileCost, }, expErr: true, }, @@ -65,9 +67,6 @@ func TestValidateParams(t *testing.T) { src: Params{ CodeUploadAccess: AllowNobody, InstantiateDefaultPermission: 1111, - GasMultiplier: DefaultGasMultiplier, - InstanceCost: DefaultInstanceCost, - CompileCost: DefaultCompileCost, }, expErr: true, }, @@ -75,9 +74,13 @@ func TestValidateParams(t *testing.T) { src: Params{ CodeUploadAccess: AccessConfig{Permission: AccessTypeOnlyAddress, Address: invalidAddress}, InstantiateDefaultPermission: AccessTypeOnlyAddress, - GasMultiplier: DefaultGasMultiplier, - InstanceCost: DefaultInstanceCost, - CompileCost: DefaultCompileCost, + }, + expErr: true, + }, + "reject wrong field addresses in only address": { + src: Params{ + CodeUploadAccess: AccessConfig{Permission: AccessTypeOnlyAddress, Address: anyAddress.String(), Addresses: []string{anyAddress.String()}}, + InstantiateDefaultPermission: AccessTypeOnlyAddress, }, expErr: true, }, @@ -85,9 +88,6 @@ func TestValidateParams(t *testing.T) { src: Params{ CodeUploadAccess: AccessConfig{Permission: AccessTypeEverybody, Address: anyAddress.String()}, InstantiateDefaultPermission: AccessTypeOnlyAddress, - GasMultiplier: DefaultGasMultiplier, - InstanceCost: DefaultInstanceCost, - CompileCost: DefaultCompileCost, }, expErr: true, }, @@ -95,18 +95,12 @@ func TestValidateParams(t *testing.T) { src: Params{ CodeUploadAccess: AccessConfig{Permission: AccessTypeNobody, Address: anyAddress.String()}, InstantiateDefaultPermission: AccessTypeOnlyAddress, - GasMultiplier: DefaultGasMultiplier, - InstanceCost: DefaultInstanceCost, - CompileCost: DefaultCompileCost, }, expErr: true, }, "reject empty CodeUploadAccess": { src: Params{ InstantiateDefaultPermission: AccessTypeOnlyAddress, - GasMultiplier: DefaultGasMultiplier, - InstanceCost: DefaultInstanceCost, - CompileCost: DefaultCompileCost, }, expErr: true, }, @@ -114,9 +108,41 @@ func TestValidateParams(t *testing.T) { src: Params{ CodeUploadAccess: AccessConfig{Permission: AccessTypeUnspecified}, InstantiateDefaultPermission: AccessTypeOnlyAddress, - GasMultiplier: DefaultGasMultiplier, - InstanceCost: DefaultInstanceCost, - CompileCost: DefaultCompileCost, + }, + expErr: true, + }, + "reject empty addresses in any of addresses": { + src: Params{ + CodeUploadAccess: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{}}, + InstantiateDefaultPermission: AccessTypeAnyOfAddresses, + }, + expErr: true, + }, + "reject addresses not set in any of addresses": { + src: Params{ + CodeUploadAccess: AccessConfig{Permission: AccessTypeAnyOfAddresses}, + InstantiateDefaultPermission: AccessTypeAnyOfAddresses, + }, + expErr: true, + }, + "reject invalid address in any of addresses": { + src: Params{ + CodeUploadAccess: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{invalidAddress}}, + InstantiateDefaultPermission: AccessTypeAnyOfAddresses, + }, + expErr: true, + }, + "reject duplicate address in any of addresses": { + src: Params{ + CodeUploadAccess: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{anyAddress.String(), anyAddress.String()}}, + InstantiateDefaultPermission: AccessTypeAnyOfAddresses, + }, + expErr: true, + }, + "reject wrong field address in any of addresses": { + src: Params{ + CodeUploadAccess: AccessConfig{Permission: AccessTypeAnyOfAddresses, Address: anyAddress.String(), Addresses: []string{anyAddress.String()}}, + InstantiateDefaultPermission: AccessTypeAnyOfAddresses, }, expErr: true, }, @@ -138,11 +164,12 @@ func TestAccessTypeMarshalJson(t *testing.T) { src AccessType exp string }{ - "Unspecified": {src: AccessTypeUnspecified, exp: `"Unspecified"`}, - "Nobody": {src: AccessTypeNobody, exp: `"Nobody"`}, - "OnlyAddress": {src: AccessTypeOnlyAddress, exp: `"OnlyAddress"`}, - "Everybody": {src: AccessTypeEverybody, exp: `"Everybody"`}, - "unknown": {src: 999, exp: `"Unspecified"`}, + "Unspecified": {src: AccessTypeUnspecified, exp: `"Unspecified"`}, + "Nobody": {src: AccessTypeNobody, exp: `"Nobody"`}, + "OnlyAddress": {src: AccessTypeOnlyAddress, exp: `"OnlyAddress"`}, + "AccessTypeAnyOfAddresses": {src: AccessTypeAnyOfAddresses, exp: `"AnyOfAddresses"`}, + "Everybody": {src: AccessTypeEverybody, exp: `"Everybody"`}, + "unknown": {src: 999, exp: `"Unspecified"`}, } for msg, spec := range specs { t.Run(msg, func(t *testing.T) { @@ -158,11 +185,12 @@ func TestAccessTypeUnmarshalJson(t *testing.T) { src string exp AccessType }{ - "Unspecified": {src: `"Unspecified"`, exp: AccessTypeUnspecified}, - "Nobody": {src: `"Nobody"`, exp: AccessTypeNobody}, - "OnlyAddress": {src: `"OnlyAddress"`, exp: AccessTypeOnlyAddress}, - "Everybody": {src: `"Everybody"`, exp: AccessTypeEverybody}, - "unknown": {src: `""`, exp: AccessTypeUnspecified}, + "Unspecified": {src: `"Unspecified"`, exp: AccessTypeUnspecified}, + "Nobody": {src: `"Nobody"`, exp: AccessTypeNobody}, + "OnlyAddress": {src: `"OnlyAddress"`, exp: AccessTypeOnlyAddress}, + "AnyOfAddresses": {src: `"AnyOfAddresses"`, exp: AccessTypeAnyOfAddresses}, + "Everybody": {src: `"Everybody"`, exp: AccessTypeEverybody}, + "unknown": {src: `""`, exp: AccessTypeUnspecified}, } for msg, spec := range specs { t.Run(msg, func(t *testing.T) { @@ -181,10 +209,7 @@ func TestParamsUnmarshalJson(t *testing.T) { }{ "defaults": { src: `{"code_upload_access": {"permission": "Everybody"}, - "instantiate_default_permission": "Everybody", - "gas_multiplier": 140000000, - "instance_cost": 60000, - "compile_cost": 3}`, + "instantiate_default_permission": "Everybody"}`, exp: DefaultParams(), }, } @@ -200,3 +225,83 @@ func TestParamsUnmarshalJson(t *testing.T) { }) } } + +func TestAccessTypeWith(t *testing.T) { + myAddress := sdk.AccAddress(randBytes(SDKAddrLen)) + myOtherAddress := sdk.AccAddress(randBytes(SDKAddrLen)) + specs := map[string]struct { + src AccessType + addrs []sdk.AccAddress + exp AccessConfig + expPanic bool + }{ + "nobody": { + src: AccessTypeNobody, + exp: AccessConfig{Permission: AccessTypeNobody}, + }, + "nobody with address": { + src: AccessTypeNobody, + addrs: []sdk.AccAddress{myAddress}, + exp: AccessConfig{Permission: AccessTypeNobody}, + }, + "everybody": { + src: AccessTypeEverybody, + exp: AccessConfig{Permission: AccessTypeEverybody}, + }, + "everybody with address": { + src: AccessTypeEverybody, + addrs: []sdk.AccAddress{myAddress}, + exp: AccessConfig{Permission: AccessTypeEverybody}, + }, + "only address without address": { + src: AccessTypeOnlyAddress, + expPanic: true, + }, + "only address with address": { + src: AccessTypeOnlyAddress, + addrs: []sdk.AccAddress{myAddress}, + exp: AccessConfig{Permission: AccessTypeOnlyAddress, Address: myAddress.String()}, + }, + "only address with invalid address": { + src: AccessTypeOnlyAddress, + addrs: []sdk.AccAddress{nil}, + expPanic: true, + }, + "any of address without address": { + src: AccessTypeAnyOfAddresses, + expPanic: true, + }, + "any of address with single address": { + src: AccessTypeAnyOfAddresses, + addrs: []sdk.AccAddress{myAddress}, + exp: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{myAddress.String()}}, + }, + "any of address with multiple addresses": { + src: AccessTypeAnyOfAddresses, + addrs: []sdk.AccAddress{myAddress, myOtherAddress}, + exp: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{myAddress.String(), myOtherAddress.String()}}, + }, + "any of address with duplicate addresses": { + src: AccessTypeAnyOfAddresses, + addrs: []sdk.AccAddress{myAddress, myAddress}, + expPanic: true, + }, + "any of address with invalid address": { + src: AccessTypeAnyOfAddresses, + addrs: []sdk.AccAddress{nil}, + expPanic: true, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + if !spec.expPanic { + got := spec.src.With(spec.addrs...) + assert.Equal(t, spec.exp, got) + return + } + assert.Panics(t, func() { + spec.src.With(spec.addrs...) + }) + }) + } +} diff --git a/x/wasm/types/proposal.go b/x/wasm/types/proposal.go index 2c8bdfe7df..0aa92f9163 100644 --- a/x/wasm/types/proposal.go +++ b/x/wasm/types/proposal.go @@ -160,7 +160,7 @@ func (p InstantiateContractProposal) ValidateBasic() error { return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "code id is required") } - if err := validateLabel(p.Label); err != nil { + if err := ValidateLabel(p.Label); err != nil { return err } diff --git a/x/wasm/types/proposal.pb.go b/x/wasm/types/proposal.pb.go index 21d9bcb216..41c1e40932 100644 --- a/x/wasm/types/proposal.pb.go +++ b/x/wasm/types/proposal.pb.go @@ -38,6 +38,8 @@ type StoreCodeProposal struct { WASMByteCode []byte `protobuf:"bytes,4,opt,name=wasm_byte_code,json=wasmByteCode,proto3" json:"wasm_byte_code,omitempty"` // InstantiatePermission to apply on contract creation, optional InstantiatePermission *AccessConfig `protobuf:"bytes,7,opt,name=instantiate_permission,json=instantiatePermission,proto3" json:"instantiate_permission,omitempty"` + // UnpinCode code on upload, optional + UnpinCode bool `protobuf:"varint,8,opt,name=unpin_code,json=unpinCode,proto3" json:"unpin_code,omitempty"` } func (m *StoreCodeProposal) Reset() { *m = StoreCodeProposal{} } @@ -539,58 +541,60 @@ func init() { func init() { proto.RegisterFile("cosmwasm/wasm/v1/proposal.proto", fileDescriptor_be6422d717c730cb) } var fileDescriptor_be6422d717c730cb = []byte{ - // 815 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0x41, 0x6f, 0xe3, 0x44, - 0x14, 0xce, 0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, 0x00, 0x37, 0x62, 0xcc, 0xa3, 0x82, - 0xe4, 0x82, 0x30, 0xda, 0x5f, 0x53, 0xb1, 0xc5, 0x4f, 0xe6, 0x26, 0x34, 0x8a, 0x29, 0x0d, 0x11, - 0xef, 0xd7, 0x75, 0x61, 0x31, 0xa5, 0xbb, 0xdc, 0x7c, 0x17, 0xbe, 0x24, 0xb1, 0xc3, 0xc9, 0x99, - 0xc0, 0x61, 0xc4, 0x62, 0xdc, 0x6f, 0x0c, 0xc0, 0xb0, 0xe3, 0x77, 0x67, 0xa5, 0xdd, 0xf9, 0x64, - 0xf7, 0x70, 0xdf, 0x3f, 0x13, 0x8a, 0x40, 0xd0, 0x91, 0x79, 0xf3, 0x95, 0x79, 0x04, 0xb7, 0x08, - 0xe5, 0x02, 0x51, 0x41, 0x90, 0xc0, 0x61, 0x8e, 0x8b, 0x8c, 0x70, 0x2e, 0xb1, 0x5b, 0x03, 0x30, - 0xdc, 0xd8, 0xb1, 0xdc, 0x9b, 0x1a, 0xb9, 0xbb, 0x51, 0x84, 0x39, 0x1f, 0x33, 0x7a, 0x4c, 0x92, - 0x60, 0x73, 0xa1, 0xfa, 0xe0, 0xaa, 0xf8, 0x7e, 0xa3, 0xdd, 0xec, 0x1a, 0xf7, 0x1b, 0x6d, 0xa3, - 0xdb, 0x72, 0x7e, 0x59, 0x83, 0xaf, 0xed, 0xfd, 0x95, 0x35, 0x66, 0x54, 0x14, 0x28, 0x12, 0xab, - 0x52, 0xa2, 0x07, 0x9b, 0x28, 0xce, 0x08, 0x55, 0x02, 0xac, 0x07, 0x7a, 0x61, 0xde, 0x83, 0x2d, - 0xa9, 0x4a, 0x48, 0xe2, 0x7e, 0x73, 0x00, 0x86, 0x0d, 0x1f, 0xce, 0x4a, 0xdb, 0x90, 0x12, 0xec, - 0x7d, 0x18, 0x18, 0x32, 0xb4, 0x17, 0xcb, 0xd2, 0x14, 0x4d, 0x70, 0xda, 0x37, 0x74, 0xa9, 0x5a, - 0x98, 0x43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0xe1, 0xfe, 0xc7, 0xe7, 0x4f, 0xac, - 0xda, 0xe3, 0x27, 0x56, 0xed, 0xfb, 0x99, 0x05, 0xce, 0x67, 0x16, 0x78, 0x34, 0xb3, 0xc0, 0x6f, - 0x33, 0x0b, 0x7c, 0x7d, 0x61, 0xd5, 0x1e, 0x5d, 0x58, 0xb5, 0xc7, 0x17, 0x56, 0xed, 0x53, 0xe7, - 0xe6, 0xfd, 0x21, 0xc1, 0x62, 0xef, 0xa1, 0xfe, 0xdb, 0x51, 0x97, 0xc8, 0xc4, 0x50, 0xff, 0x3a, - 0xef, 0xfc, 0x19, 0x00, 0x00, 0xff, 0xff, 0x64, 0x4e, 0x2a, 0x98, 0x74, 0x09, 0x00, 0x00, + // 833 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0xcf, 0x6f, 0xe3, 0x44, + 0x14, 0xce, 0xe4, 0x87, 0x93, 0x4e, 0x23, 0x08, 0xde, 0xb4, 0x1b, 0x0a, 0xd8, 0x91, 0x17, 0xa1, + 0x48, 0x08, 0x5b, 0x29, 0x12, 0x02, 0x6e, 0x75, 0x40, 0xa2, 0x2b, 0x55, 0xaa, 0x5c, 0x55, 0x48, + 0x80, 0x88, 0x26, 0xf6, 0xd4, 0x3b, 0xc2, 0x9e, 0xb1, 0x3c, 0xe3, 0x76, 0xfb, 0x3f, 0x70, 0xe0, + 0x80, 0x38, 0xed, 0x1f, 0x80, 0xb8, 0x20, 0xee, 0x5c, 0x91, 0x7a, 0xdc, 0xe3, 0x9e, 0x0c, 0x9b, + 0xfe, 0x07, 0x3d, 0x72, 0x42, 0x33, 0xe3, 0x94, 0xb4, 0x4b, 0xbb, 0x8b, 0x68, 0x91, 0xf6, 0x12, + 0x65, 0xe6, 0xbd, 0x99, 0xef, 0x9b, 0x4f, 0xdf, 0x7b, 0xcf, 0xd0, 0x0e, 0x19, 0x4f, 0x8f, 0x10, + 0x4f, 0x3d, 0xf5, 0x73, 0x38, 0xf6, 0xb2, 0x9c, 0x65, 0x8c, 0xa3, 0xc4, 0xcd, 0x72, 0x26, 0x98, + 0xd9, 0x5b, 0x24, 0xb8, 0xea, 0xe7, 0x70, 0xbc, 0xd1, 0x8f, 0x59, 0xcc, 0x54, 0xd0, 0x93, 0xff, + 0x74, 0xde, 0x86, 0x25, 0xf3, 0x18, 0xf7, 0x66, 0x88, 0x63, 0xef, 0x70, 0x3c, 0xc3, 0x02, 0x8d, + 0xbd, 0x90, 0x11, 0x5a, 0xc5, 0xdf, 0x7c, 0x06, 0x48, 0x1c, 0x67, 0x98, 0xeb, 0xa8, 0xf3, 0xa8, + 0x0e, 0x5f, 0xdb, 0x13, 0x2c, 0xc7, 0x13, 0x16, 0xe1, 0xdd, 0x8a, 0x81, 0xd9, 0x87, 0x2d, 0x41, + 0x44, 0x82, 0x07, 0x60, 0x08, 0x46, 0x2b, 0x81, 0x5e, 0x98, 0x43, 0xb8, 0x1a, 0x61, 0x1e, 0xe6, + 0x24, 0x13, 0x84, 0xd1, 0x41, 0x5d, 0xc5, 0x96, 0xb7, 0xcc, 0x35, 0x68, 0xe4, 0x05, 0x9d, 0x22, + 0x3e, 0x68, 0xe8, 0x83, 0x79, 0x41, 0xb7, 0xb8, 0xf9, 0x01, 0x7c, 0x45, 0x62, 0x4f, 0x67, 0xc7, + 0x02, 0x4f, 0x43, 0x16, 0xe1, 0x41, 0x73, 0x08, 0x46, 0x5d, 0xbf, 0x37, 0x2f, 0xed, 0xee, 0xe7, + 0x5b, 0x7b, 0x3b, 0xfe, 0xb1, 0x50, 0x04, 0x82, 0xae, 0xcc, 0x5b, 0xac, 0xcc, 0x7d, 0xb8, 0x4e, + 0x28, 0x17, 0x88, 0x0a, 0x82, 0x04, 0x9e, 0x66, 0x38, 0x4f, 0x09, 0xe7, 0x12, 0xbb, 0x3d, 0x04, + 0xa3, 0xd5, 0x4d, 0xcb, 0xbd, 0xac, 0x91, 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, 0x9d, 0x34, 0x4f, 0x63, 0xd4, 0xf4, 0xad, 0x79, 0x69, 0xb7, 0x75, 0xd5, 0xf1, + 0xb3, 0xd2, 0x7e, 0x55, 0xdf, 0xb0, 0x48, 0x72, 0x82, 0xb6, 0xae, 0x44, 0xee, 0xfc, 0x02, 0xa0, + 0xb9, 0xbf, 0xe8, 0xc0, 0x2f, 0x09, 0xe7, 0x1f, 0x00, 0x34, 0x97, 0xc7, 0x8d, 0xb6, 0xde, 0x72, + 0xeb, 0x01, 0x57, 0xb6, 0x9e, 0x2f, 0xaf, 0x9c, 0x6c, 0xf5, 0x17, 0x99, 0x6c, 0x7e, 0x53, 0x96, + 0xc7, 0x15, 0xf3, 0xcd, 0x39, 0x05, 0xd0, 0xd6, 0x64, 0x2e, 0x8e, 0xae, 0x03, 0x12, 0xff, 0x8f, + 0xca, 0x7e, 0x0d, 0xd7, 0x90, 0xa2, 0x3c, 0x0d, 0x15, 0xf4, 0xb4, 0x50, 0x94, 0xb4, 0xcc, 0xab, + 0x9b, 0x6f, 0x5f, 0xff, 0x42, 0xcd, 0xbf, 0x7a, 0xe7, 0x1d, 0xf4, 0x4c, 0x84, 0xfb, 0x9f, 0x9d, + 0x3c, 0xb5, 0x6a, 0x4f, 0x9e, 0x5a, 0xb5, 0x1f, 0xe7, 0x16, 0x38, 0x99, 0x5b, 0xe0, 0xf1, 0xdc, + 0x02, 0x7f, 0xcc, 0x2d, 0xf0, 0xdd, 0xa9, 0x55, 0x7b, 0x7c, 0x6a, 0xd5, 0x9e, 0x9c, 0x5a, 0xb5, + 0x2f, 0x9c, 0xcb, 0xfd, 0x43, 0x82, 0x45, 0xde, 0x43, 0xfd, 0x31, 0xa4, 0x9a, 0xc8, 0xcc, 0x50, + 0x9f, 0x42, 0xef, 0xff, 0x15, 0x00, 0x00, 0xff, 0xff, 0x84, 0xae, 0x6e, 0x5d, 0x93, 0x09, 0x00, + 0x00, } func (this *StoreCodeProposal) Equal(that interface{}) bool { @@ -627,6 +631,9 @@ func (this *StoreCodeProposal) Equal(that interface{}) bool { if !this.InstantiatePermission.Equal(that1.InstantiatePermission) { return false } + if this.UnpinCode != that1.UnpinCode { + return false + } return true } func (this *InstantiateContractProposal) Equal(that interface{}) bool { @@ -1007,6 +1014,16 @@ func (m *StoreCodeProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.UnpinCode { + i-- + if m.UnpinCode { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } if m.InstantiatePermission != nil { { size, err := m.InstantiatePermission.MarshalToSizedBuffer(dAtA[:i]) @@ -1644,6 +1661,9 @@ func (m *StoreCodeProposal) Size() (n int) { l = m.InstantiatePermission.Size() n += 1 + l + sovProposal(uint64(l)) } + if m.UnpinCode { + n += 2 + } return n } @@ -2109,6 +2129,26 @@ func (m *StoreCodeProposal) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UnpinCode", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProposal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.UnpinCode = bool(v != 0) default: iNdEx = preIndex skippy, err := skipProposal(dAtA[iNdEx:]) diff --git a/x/wasm/types/proposal_test.go b/x/wasm/types/proposal_test.go index 50070590f2..77a8bdc043 100644 --- a/x/wasm/types/proposal_test.go +++ b/x/wasm/types/proposal_test.go @@ -163,9 +163,7 @@ func TestValidateStoreCodeProposal(t *testing.T) { } func TestValidateInstantiateContractProposal(t *testing.T) { - var ( - invalidAddress = "invalid address" - ) + invalidAddress := "invalid address" specs := map[string]struct { src *InstantiateContractProposal @@ -258,9 +256,7 @@ func TestValidateInstantiateContractProposal(t *testing.T) { } func TestValidateMigrateContractProposal(t *testing.T) { - var ( - invalidAddress = "invalid address2" - ) + invalidAddress := "invalid address2" specs := map[string]struct { src *MigrateContractProposal @@ -319,9 +315,7 @@ func TestValidateMigrateContractProposal(t *testing.T) { } func TestValidateSudoContractProposal(t *testing.T) { - var ( - invalidAddress = "invalid address" - ) + invalidAddress := "invalid address" specs := map[string]struct { src *SudoContractProposal @@ -374,9 +368,7 @@ func TestValidateSudoContractProposal(t *testing.T) { } func TestValidateExecuteContractProposal(t *testing.T) { - var ( - invalidAddress = "invalid address" - ) + invalidAddress := "invalid address" specs := map[string]struct { src *ExecuteContractProposal @@ -435,9 +427,7 @@ func TestValidateExecuteContractProposal(t *testing.T) { } func TestValidateUpdateAdminProposal(t *testing.T) { - var ( - invalidAddress = "invalid address" - ) + invalidAddress := "invalid address" specs := map[string]struct { src *UpdateAdminProposal @@ -490,9 +480,7 @@ func TestValidateUpdateAdminProposal(t *testing.T) { } func TestValidateClearAdminProposal(t *testing.T) { - var ( - invalidAddress = "invalid address" - ) + invalidAddress := "invalid address" specs := map[string]struct { src *ClearAdminProposal diff --git a/x/wasm/types/query.pb.go b/x/wasm/types/query.pb.go index ba70d57d94..3300614198 100644 --- a/x/wasm/types/query.pb.go +++ b/x/wasm/types/query.pb.go @@ -803,6 +803,82 @@ 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 { +} + +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_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) + } 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_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) + } 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 init() { proto.RegisterType((*QueryContractInfoRequest)(nil), "cosmwasm.wasm.v1.QueryContractInfoRequest") proto.RegisterType((*QueryContractInfoResponse)(nil), "cosmwasm.wasm.v1.QueryContractInfoResponse") @@ -823,87 +899,92 @@ func init() { proto.RegisterType((*QueryCodesResponse)(nil), "cosmwasm.wasm.v1.QueryCodesResponse") proto.RegisterType((*QueryPinnedCodesRequest)(nil), "cosmwasm.wasm.v1.QueryPinnedCodesRequest") proto.RegisterType((*QueryPinnedCodesResponse)(nil), "cosmwasm.wasm.v1.QueryPinnedCodesResponse") + proto.RegisterType((*QueryParamsRequest)(nil), "cosmwasm.wasm.v1.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "cosmwasm.wasm.v1.QueryParamsResponse") } func init() { proto.RegisterFile("cosmwasm/wasm/v1/query.proto", fileDescriptor_9677c207036b9f2b) } var fileDescriptor_9677c207036b9f2b = []byte{ - // 1188 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x97, 0x4f, 0x6f, 0x1b, 0xc5, - 0x1b, 0xc7, 0x3d, 0xa9, 0xe3, 0x3f, 0x93, 0xfc, 0x54, 0xff, 0x46, 0x90, 0x18, 0x93, 0xee, 0x46, - 0x4b, 0x15, 0xd2, 0x34, 0xec, 0x36, 0x69, 0xa3, 0x0a, 0x24, 0x84, 0xea, 0x04, 0x9a, 0x44, 0x8a, - 0x94, 0x6e, 0x0f, 0x48, 0xf4, 0x10, 0x8d, 0xbd, 0x13, 0x67, 0x25, 0x7b, 0xc7, 0xd9, 0x99, 0x24, - 0xb5, 0xa2, 0x00, 0xaa, 0xc4, 0x01, 0x09, 0x01, 0x12, 0xea, 0x19, 0x0e, 0xa8, 0x70, 0x86, 0x1b, - 0xaf, 0x20, 0xc7, 0x48, 0x5c, 0x38, 0x59, 0xe0, 0x70, 0x40, 0x79, 0x09, 0x3d, 0xa1, 0x99, 0x9d, - 0x75, 0xd6, 0x7f, 0x36, 0x76, 0xaa, 0x88, 0x8b, 0xe5, 0xf5, 0x3c, 0xf3, 0xcc, 0xe7, 0xf9, 0xee, - 0x33, 0xcf, 0xf3, 0x18, 0x4e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d, 0xff, 0x85, 0x85, 0x4b, 0xec, 0x50, 0xe8, 0x1f, 0x48, 0xf4, 0x77, 0xd1, 0xfd, - 0xe1, 0x44, 0x16, 0x8e, 0x3a, 0xe1, 0x1b, 0x30, 0x29, 0xd3, 0xd6, 0x88, 0xcd, 0xc3, 0xf3, 0x5c, - 0x7d, 0xeb, 0x42, 0x1b, 0x45, 0x34, 0x2b, 0x89, 0x0c, 0x34, 0x3d, 0x28, 0x41, 0x91, 0x0f, 0x47, - 0x65, 0x39, 0x44, 0x17, 0xf9, 0x0d, 0x0b, 0x72, 0xe1, 0xe6, 0xc5, 0x46, 0xea, 0x74, 0x4d, 0x9e, - 0x9e, 0x47, 0x13, 0xfd, 0x4f, 0x47, 0x5f, 0x01, 0x38, 0x16, 0xa9, 0xc4, 0xe8, 0x56, 0x8c, 0xd7, - 0xde, 0x8e, 0x50, 0x98, 0x1b, 0xc6, 0x54, 0x61, 0xcc, 0x48, 0x8c, 0x69, 0xa4, 0xf5, 0xc7, 0x60, - 0x56, 0x5d, 0x6e, 0x2a, 0xae, 0x1c, 0xff, 0xa5, 0x25, 0x7e, 0x6e, 0x69, 0x89, 0xe3, 0x96, 0x06, - 0x4e, 0x5a, 0x1a, 0xf8, 0xb3, 0xa5, 0x81, 0x6f, 0x4f, 0xb5, 0xc4, 0xc9, 0xa9, 0x96, 0xf8, 0xe3, - 0x54, 0x4b, 0x7c, 0x62, 0x74, 0x0f, 0x35, 0xc2, 0x8f, 0x63, 0x3d, 0x0d, 0xfc, 0xc9, 0x7f, 0xd8, - 0xa5, 0x94, 0xfc, 0x63, 0x7c, 0xf7, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3a, 0x66, 0x16, 0x91, - 0xc8, 0x0f, 0x00, 0x00, + // 1242 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x98, 0x4f, 0x6f, 0x1b, 0xc5, + 0x1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 0x81, 0x7e, + 0x6b, 0x20, 0xb4, 0x0f, 0x12, 0xa1, 0xfe, 0xb4, 0x4b, 0x36, 0x56, 0x6a, 0x8a, 0xb5, 0x03, 0xd9, + 0xc6, 0x61, 0xba, 0x42, 0x6d, 0xb2, 0xe1, 0xd8, 0x52, 0xb6, 0xa4, 0x95, 0x12, 0xaf, 0x2b, 0xf6, + 0x85, 0xa9, 0xf6, 0x45, 0xb7, 0x6a, 0x1d, 0x00, 0xa5, 0xda, 0x04, 0xcc, 0x06, 0xbb, 0xed, 0xeb, + 0x96, 0xb5, 0x4e, 0x3f, 0x5c, 0x9c, 0x0e, 0x9f, 0x07, 0x1c, 0xf7, 0x6b, 0xb5, 0x00, 0xe5, 0x11, + 0xc7, 0x9c, 0xfc, 0x77, 0x09, 0xf4, 0x3d, 0x80, 0xd7, 0x63, 0x10, 0x94, 0x16, 0x0b, 0x30, 0x55, + 0xa7, 0x36, 0xa9, 0x05, 0x09, 0x34, 0xde, 0x9b, 0x40, 0x6b, 0x62, 0x5c, 0x65, 0x8b, 0x32, 0xbe, + 0x38, 0x91, 0x3e, 0x56, 0x1a, 0x59, 0x78, 0xef, 0x9c, 0x1a, 0x5d, 0x87, 0x50, 0xae, 0xb1, 0x61, + 0x63, 0x8e, 0x25, 0xc2, 0x98, 0x95, 0x95, 0x5f, 0x96, 0x30, 0xc7, 0xfa, 0x1d, 0x15, 0x79, 0xaf, + 0x63, 0x15, 0x39, 0x82, 0x49, 0x39, 0x13, 0xc8, 0x99, 0xf2, 0x59, 0xdf, 0x86, 0x9a, 0x9c, 0xf4, + 0xa8, 0x8e, 0x3d, 0x7e, 0x4e, 0x9e, 0x85, 0x5e, 0x9e, 0xd2, 0xb5, 0x17, 0xad, 0x22, 0x0a, 0x11, + 0xac, 0x11, 0xc6, 0x84, 0x12, 0x21, 0xce, 0x35, 0x58, 0x8c, 0x5d, 0x52, 0x91, 0xce, 0x84, 0x49, + 0x63, 0x7d, 0xfa, 0x11, 0xdc, 0x82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 0x01, 0x7a, 0x0e, 0xe0, 0x95, 0xae, 0xce, 0x07, 0xbd, 0x3d, 0x60, 0xb9, 0x68, + 0x8f, 0x56, 0x30, 0x86, 0x35, 0x57, 0x80, 0x77, 0x25, 0xa0, 0x81, 0x66, 0x87, 0x01, 0x34, 0xb7, + 0x14, 0xd4, 0x8f, 0x21, 0x50, 0xd5, 0x6c, 0x0c, 0x04, 0x8d, 0x76, 0x45, 0x03, 0x41, 0xbb, 0x7a, + 0x18, 0x7d, 0x5e, 0x82, 0xce, 0xa2, 0x99, 0x7e, 0xa0, 0x36, 0x31, 0xf7, 0x55, 0xd6, 0x1e, 0x98, + 0xa7, 0x9d, 0xcd, 0x4f, 0x00, 0xe6, 0xba, 0x1b, 0x01, 0x14, 0xb7, 0x70, 0x4c, 0xd3, 0x52, 0x30, + 0x87, 0xb6, 0x1f, 0x86, 0xb4, 0x47, 0x52, 0x26, 0xa1, 0x7e, 0x01, 0x30, 0xd7, 0x7d, 0x71, 0xc7, + 0x92, 0xc6, 0xb4, 0x0e, 0xb1, 0xa4, 0x71, 0x1d, 0x81, 0xfe, 0xbe, 0x24, 0xbd, 0x87, 0x16, 0x86, + 0x22, 0xf5, 0xf0, 0x9e, 0xb9, 0x7f, 0x7a, 0xe3, 0x1f, 0xa0, 0xdf, 0x00, 0x44, 0xbd, 0xb7, 0x38, + 0xba, 0x1d, 0x83, 0x11, 0xdb, 0x63, 0x14, 0xe6, 0xce, 0x31, 0x43, 0xa1, 0x7f, 0x20, 0xd1, 0xdf, + 0x45, 0xf7, 0x86, 0x13, 0x59, 0x38, 0x8a, 0xc2, 0x37, 0x61, 0x52, 0xa6, 0xad, 0x1e, 0x9b, 0x87, + 0xa7, 0xb9, 0xfa, 0xc6, 0x99, 0x36, 0x8a, 0x68, 0x5a, 0x12, 0xe9, 0x68, 0x72, 0x50, 0x82, 0x22, + 0x0f, 0x8e, 0xca, 0x9a, 0x8b, 0xce, 0xf2, 0x1b, 0x54, 0xc1, 0xc2, 0x8d, 0xb3, 0x8d, 0xd4, 0xea, + 0x9a, 0x5c, 0x3d, 0x8f, 0xae, 0xf5, 0x5f, 0x1d, 0x7d, 0x05, 0xe0, 0xe5, 0x50, 0xb9, 0x47, 0x37, + 0x63, 0xbc, 0xf6, 0x5e, 0x3b, 0x85, 0x99, 0x61, 0x4c, 0x15, 0xc6, 0x94, 0xc4, 0x98, 0x44, 0x5a, + 0x7f, 0x0c, 0x66, 0x36, 0xe4, 0x24, 0x74, 0x00, 0x53, 0x7e, 0x8d, 0x46, 0x71, 0xe1, 0x45, 0xae, + 0x82, 0xc2, 0x9b, 0x03, 0xac, 0x86, 0x5e, 0xde, 0xbf, 0x18, 0x96, 0x0e, 0xff, 0xd2, 0x12, 0x3f, + 0xb7, 0xb5, 0xc4, 0x61, 0x5b, 0x03, 0x47, 0x6d, 0x0d, 0xfc, 0xd9, 0xd6, 0xc0, 0xb7, 0xc7, 0x5a, + 0xe2, 0xe8, 0x58, 0x4b, 0xfc, 0x71, 0xac, 0x25, 0x3e, 0xd1, 0xbb, 0x1b, 0x37, 0xe1, 0xc7, 0x36, + 0x9f, 0xf8, 0xfe, 0xe4, 0x7f, 0x11, 0xca, 0x29, 0xf9, 0xc7, 0xff, 0x9d, 0x7f, 0x03, 0x00, 0x00, + 0xff, 0xff, 0xf8, 0x94, 0xf6, 0x1f, 0xac, 0x10, 0x00, 0x00, } func (this *QueryContractInfoResponse) Equal(that interface{}) bool { @@ -1024,6 +1105,8 @@ type QueryClient interface { Codes(ctx context.Context, in *QueryCodesRequest, opts ...grpc.CallOption) (*QueryCodesResponse, error) // PinnedCodes gets the pinned code ids PinnedCodes(ctx context.Context, in *QueryPinnedCodesRequest, opts ...grpc.CallOption) (*QueryPinnedCodesResponse, error) + // Params gets the module params + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) } type queryClient struct { @@ -1115,6 +1198,15 @@ func (c *queryClient) PinnedCodes(ctx context.Context, in *QueryPinnedCodesReque return out, nil } +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // ContractInfo gets the contract meta data @@ -1135,6 +1227,8 @@ type QueryServer interface { Codes(context.Context, *QueryCodesRequest) (*QueryCodesResponse, error) // PinnedCodes gets the pinned code ids PinnedCodes(context.Context, *QueryPinnedCodesRequest) (*QueryPinnedCodesResponse, error) + // Params gets the module params + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1168,6 +1262,9 @@ func (*UnimplementedQueryServer) Codes(ctx context.Context, req *QueryCodesReque 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 RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1335,6 +1432,24 @@ func _Query_PinnedCodes_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmwasm.wasm.v1.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmwasm.wasm.v1.Query", HandlerType: (*QueryServer)(nil), @@ -1375,6 +1490,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "PinnedCodes", Handler: _Query_PinnedCodes_Handler, }, + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmwasm/wasm/v1/query.proto", @@ -2144,6 +2263,62 @@ func (m *QueryPinnedCodesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -2466,6 +2641,26 @@ func (m *QueryPinnedCodesResponse) Size() (n int) { return n } +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -4579,6 +4774,139 @@ func (m *QueryPinnedCodesResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func 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 f91f21ccf6..f5aed81ed2 100644 --- a/x/wasm/types/query.pb.gw.go +++ b/x/wasm/types/query.pb.gw.go @@ -579,6 +579,24 @@ func local_request_Query_PinnedCodes_0(ctx context.Context, marshaler runtime.Ma } +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -765,6 +783,26 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + 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.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) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -986,6 +1024,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1007,6 +1065,8 @@ var ( pattern_Query_Codes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"cosmwasm", "wasm", "v1", "code"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_PinnedCodes_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmwasm", "wasm", "v1", "codes", "pinned"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 4}, []string{"cosmwasm", "wasm", "v1", "codes", "params"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -1027,4 +1087,6 @@ var ( forward_Query_Codes_0 = runtime.ForwardResponseMessage forward_Query_PinnedCodes_0 = runtime.ForwardResponseMessage + + forward_Query_Params_0 = runtime.ForwardResponseMessage ) diff --git a/x/wasm/types/tx.go b/x/wasm/types/tx.go index 818b6e79b2..5082964882 100644 --- a/x/wasm/types/tx.go +++ b/x/wasm/types/tx.go @@ -95,7 +95,7 @@ func (msg MsgInstantiateContract) ValidateBasic() error { return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "code id is required") } - if err := validateLabel(msg.Label); err != nil { + if err := ValidateLabel(msg.Label); err != nil { return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "label is required") } @@ -306,3 +306,56 @@ func (msg MsgIBCCloseChannel) GetSignBytes() []byte { func (msg MsgIBCCloseChannel) GetSigners() []sdk.AccAddress { return nil } + +var _ sdk.Msg = &MsgInstantiateContract2{} + +func (msg MsgInstantiateContract2) Route() string { + return RouterKey +} + +func (msg MsgInstantiateContract2) Type() string { + return "instantiate2" +} + +func (msg MsgInstantiateContract2) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Sender); err != nil { + return sdkerrors.Wrap(err, "sender") + } + + if msg.CodeID == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "code id is required") + } + + if err := ValidateLabel(msg.Label); err != nil { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "label is required") + } + + if !msg.Funds.IsValid() { + return sdkerrors.ErrInvalidCoins + } + + if len(msg.Admin) != 0 { + if _, err := sdk.AccAddressFromBech32(msg.Admin); err != nil { + return sdkerrors.Wrap(err, "admin") + } + } + if err := msg.Msg.ValidateBasic(); err != nil { + return sdkerrors.Wrap(err, "payload msg") + } + if err := ValidateSalt(msg.Salt); err != nil { + return sdkerrors.Wrap(err, "salt") + } + return nil +} + +func (msg MsgInstantiateContract2) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) +} + +func (msg MsgInstantiateContract2) GetSigners() []sdk.AccAddress { + senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { // should never happen as valid basic rejects invalid addresses + panic(err.Error()) + } + return []sdk.AccAddress{senderAddr} +} diff --git a/x/wasm/types/tx.pb.go b/x/wasm/types/tx.pb.go index c6fbdaf895..5a12b05a90 100644 --- a/x/wasm/types/tx.pb.go +++ b/x/wasm/types/tx.pb.go @@ -78,6 +78,8 @@ var xxx_messageInfo_MsgStoreCode proto.InternalMessageInfo type MsgStoreCodeResponse struct { // CodeID is the reference to the stored WASM code CodeID uint64 `protobuf:"varint,1,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` + // Checksum is the sha256 hash of the stored code + Checksum []byte `protobuf:"bytes,2,opt,name=checksum,proto3" json:"checksum,omitempty"` } func (m *MsgStoreCodeResponse) Reset() { *m = MsgStoreCodeResponse{} } @@ -163,11 +165,66 @@ func (m *MsgInstantiateContract) XXX_DiscardUnknown() { var xxx_messageInfo_MsgInstantiateContract proto.InternalMessageInfo +// MsgInstantiateContract2 create a new smart contract instance for the given +// code id with a predicable address. +type MsgInstantiateContract2 struct { + // Sender is the that actor that signed the messages + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + // Admin is an optional address that can execute migrations + Admin string `protobuf:"bytes,2,opt,name=admin,proto3" json:"admin,omitempty"` + // CodeID is the reference to the stored WASM code + CodeID uint64 `protobuf:"varint,3,opt,name=code_id,json=codeId,proto3" json:"code_id,omitempty"` + // Label is optional metadata to be stored with a contract instance. + Label string `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"` + // Msg json encoded message to be passed to the contract on instantiation + Msg RawContractMessage `protobuf:"bytes,5,opt,name=msg,proto3,casttype=RawContractMessage" json:"msg,omitempty"` + // Funds coins that are transferred to the contract on instantiation + Funds github_com_line_lbm_sdk_types.Coins `protobuf:"bytes,6,rep,name=funds,proto3,castrepeated=github.com/line/lbm-sdk/types.Coins" json:"funds"` + // Salt is an arbitrary value provided by the sender. Size can be 1 to 64. + Salt []byte `protobuf:"bytes,7,opt,name=salt,proto3" json:"salt,omitempty"` + // FixMsg include the msg value into the hash for the predictable address. + // Default is false + FixMsg bool `protobuf:"varint,8,opt,name=fix_msg,json=fixMsg,proto3" json:"fix_msg,omitempty"` +} + +func (m *MsgInstantiateContract2) Reset() { *m = MsgInstantiateContract2{} } +func (m *MsgInstantiateContract2) String() string { return proto.CompactTextString(m) } +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) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + 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) +} + +var xxx_messageInfo_MsgInstantiateContract2 proto.InternalMessageInfo + // MsgInstantiateContractResponse return instantiation result data type MsgInstantiateContractResponse struct { // Address is the bech32 address of the new contract instance. Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` - // Data contains base64-encoded bytes to returned from the contract + // Data contains bytes to returned from the contract Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` } @@ -175,7 +232,7 @@ func (m *MsgInstantiateContractResponse) Reset() { *m = MsgInstantiateCo func (m *MsgInstantiateContractResponse) String() string { return proto.CompactTextString(m) } func (*MsgInstantiateContractResponse) ProtoMessage() {} func (*MsgInstantiateContractResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{3} + return fileDescriptor_4f74d82755520264, []int{4} } func (m *MsgInstantiateContractResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -204,6 +261,47 @@ func (m *MsgInstantiateContractResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgInstantiateContractResponse proto.InternalMessageInfo +// MsgInstantiateContract2Response return instantiation result data +type MsgInstantiateContract2Response struct { + // Address is the bech32 address of the new contract instance. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // Data contains bytes to returned from the contract + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` +} + +func (m *MsgInstantiateContract2Response) Reset() { *m = MsgInstantiateContract2Response{} } +func (m *MsgInstantiateContract2Response) String() string { return proto.CompactTextString(m) } +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) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + 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) +} + +var xxx_messageInfo_MsgInstantiateContract2Response proto.InternalMessageInfo + // MsgExecuteContract submits the given message data to a smart contract type MsgExecuteContract struct { // Sender is the that actor that signed the messages @@ -220,7 +318,7 @@ func (m *MsgExecuteContract) Reset() { *m = MsgExecuteContract{} } func (m *MsgExecuteContract) String() string { return proto.CompactTextString(m) } func (*MsgExecuteContract) ProtoMessage() {} func (*MsgExecuteContract) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{4} + return fileDescriptor_4f74d82755520264, []int{6} } func (m *MsgExecuteContract) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -251,7 +349,7 @@ var xxx_messageInfo_MsgExecuteContract proto.InternalMessageInfo // MsgExecuteContractResponse returns execution result data. type MsgExecuteContractResponse struct { - // Data contains base64-encoded bytes to returned from the contract + // Data contains bytes to returned from the contract Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` } @@ -259,7 +357,7 @@ func (m *MsgExecuteContractResponse) Reset() { *m = MsgExecuteContractRe func (m *MsgExecuteContractResponse) String() string { return proto.CompactTextString(m) } func (*MsgExecuteContractResponse) ProtoMessage() {} func (*MsgExecuteContractResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{5} + return fileDescriptor_4f74d82755520264, []int{7} } func (m *MsgExecuteContractResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -304,7 +402,7 @@ func (m *MsgMigrateContract) Reset() { *m = MsgMigrateContract{} } func (m *MsgMigrateContract) String() string { return proto.CompactTextString(m) } func (*MsgMigrateContract) ProtoMessage() {} func (*MsgMigrateContract) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{6} + return fileDescriptor_4f74d82755520264, []int{8} } func (m *MsgMigrateContract) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -344,7 +442,7 @@ func (m *MsgMigrateContractResponse) Reset() { *m = MsgMigrateContractRe func (m *MsgMigrateContractResponse) String() string { return proto.CompactTextString(m) } func (*MsgMigrateContractResponse) ProtoMessage() {} func (*MsgMigrateContractResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{7} + return fileDescriptor_4f74d82755520264, []int{9} } func (m *MsgMigrateContractResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -387,7 +485,7 @@ func (m *MsgUpdateAdmin) Reset() { *m = MsgUpdateAdmin{} } func (m *MsgUpdateAdmin) String() string { return proto.CompactTextString(m) } func (*MsgUpdateAdmin) ProtoMessage() {} func (*MsgUpdateAdmin) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{8} + return fileDescriptor_4f74d82755520264, []int{10} } func (m *MsgUpdateAdmin) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -424,7 +522,7 @@ func (m *MsgUpdateAdminResponse) Reset() { *m = MsgUpdateAdminResponse{} func (m *MsgUpdateAdminResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateAdminResponse) ProtoMessage() {} func (*MsgUpdateAdminResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{9} + return fileDescriptor_4f74d82755520264, []int{11} } func (m *MsgUpdateAdminResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -465,7 +563,7 @@ func (m *MsgClearAdmin) Reset() { *m = MsgClearAdmin{} } func (m *MsgClearAdmin) String() string { return proto.CompactTextString(m) } func (*MsgClearAdmin) ProtoMessage() {} func (*MsgClearAdmin) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{10} + return fileDescriptor_4f74d82755520264, []int{12} } func (m *MsgClearAdmin) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -502,7 +600,7 @@ func (m *MsgClearAdminResponse) Reset() { *m = MsgClearAdminResponse{} } func (m *MsgClearAdminResponse) String() string { return proto.CompactTextString(m) } func (*MsgClearAdminResponse) ProtoMessage() {} func (*MsgClearAdminResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_4f74d82755520264, []int{11} + return fileDescriptor_4f74d82755520264, []int{13} } func (m *MsgClearAdminResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -535,7 +633,9 @@ func init() { proto.RegisterType((*MsgStoreCode)(nil), "cosmwasm.wasm.v1.MsgStoreCode") proto.RegisterType((*MsgStoreCodeResponse)(nil), "cosmwasm.wasm.v1.MsgStoreCodeResponse") proto.RegisterType((*MsgInstantiateContract)(nil), "cosmwasm.wasm.v1.MsgInstantiateContract") + proto.RegisterType((*MsgInstantiateContract2)(nil), "cosmwasm.wasm.v1.MsgInstantiateContract2") proto.RegisterType((*MsgInstantiateContractResponse)(nil), "cosmwasm.wasm.v1.MsgInstantiateContractResponse") + proto.RegisterType((*MsgInstantiateContract2Response)(nil), "cosmwasm.wasm.v1.MsgInstantiateContract2Response") proto.RegisterType((*MsgExecuteContract)(nil), "cosmwasm.wasm.v1.MsgExecuteContract") proto.RegisterType((*MsgExecuteContractResponse)(nil), "cosmwasm.wasm.v1.MsgExecuteContractResponse") proto.RegisterType((*MsgMigrateContract)(nil), "cosmwasm.wasm.v1.MsgMigrateContract") @@ -549,55 +649,60 @@ func init() { func init() { proto.RegisterFile("cosmwasm/wasm/v1/tx.proto", fileDescriptor_4f74d82755520264) } var fileDescriptor_4f74d82755520264 = []byte{ - // 756 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcd, 0x6e, 0xd3, 0x4c, - 0x14, 0x8d, 0x1b, 0x27, 0x4d, 0x6e, 0xf3, 0xf5, 0x8b, 0x4c, 0x1b, 0x52, 0x83, 0x9c, 0xc8, 0x45, - 0x10, 0x09, 0xb0, 0x9b, 0x22, 0xb1, 0x61, 0x43, 0x13, 0x58, 0xb4, 0x92, 0x11, 0x72, 0x55, 0x10, - 0x08, 0x29, 0x9a, 0xd8, 0x53, 0x63, 0x91, 0x78, 0x82, 0x67, 0xda, 0xb4, 0x8f, 0xc0, 0x8e, 0x1d, - 0xef, 0xc0, 0x5b, 0xb0, 0xeb, 0x0a, 0x75, 0xc9, 0x2a, 0x40, 0xfa, 0x16, 0xac, 0x90, 0xff, 0x52, - 0xd7, 0x75, 0xd2, 0x20, 0xc4, 0xc6, 0x9a, 0xeb, 0x39, 0xf7, 0x9e, 0xb9, 0x47, 0x67, 0xee, 0xc0, - 0x9a, 0x41, 0x68, 0x7f, 0x88, 0x68, 0x5f, 0xf5, 0x3f, 0x87, 0x4d, 0x95, 0x1d, 0x29, 0x03, 0x97, - 0x30, 0x22, 0x94, 0xa3, 0x2d, 0xc5, 0xff, 0x1c, 0x36, 0x45, 0xc9, 0xfb, 0x43, 0xa8, 0xda, 0x45, - 0x14, 0xab, 0x87, 0xcd, 0x2e, 0x66, 0xa8, 0xa9, 0x1a, 0xc4, 0x76, 0x82, 0x0c, 0x71, 0xc5, 0x22, - 0x16, 0xf1, 0x97, 0xaa, 0xb7, 0x0a, 0xff, 0xde, 0xbc, 0x4c, 0x71, 0x3c, 0xc0, 0x34, 0xd8, 0x95, - 0xbf, 0x70, 0x50, 0xd2, 0xa8, 0xb5, 0xcb, 0x88, 0x8b, 0xdb, 0xc4, 0xc4, 0x42, 0x05, 0xf2, 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 0x84, 0x06, 0x64, 0xfb, 0xd4, 0xf2, 0x05, 0x29, 0xb5, 0x2a, 0xbf, - 0x46, 0x35, 0x41, 0x47, 0xc3, 0xe8, 0x18, 0x1a, 0xa6, 0x14, 0x59, 0x58, 0xf7, 0x20, 0xc2, 0x1b, - 0xc8, 0xed, 0x1f, 0x38, 0x26, 0xad, 0xe6, 0xeb, 0xd9, 0xc6, 0xd2, 0xe6, 0x9a, 0x12, 0x58, 0x42, - 0xf1, 0x2c, 0xa1, 0x84, 0x96, 0x50, 0xda, 0xc4, 0x76, 0x5a, 0x77, 0x4f, 0x46, 0xb5, 0xcc, 0xe7, - 0xef, 0xb5, 0x75, 0xcb, 0x66, 0x6f, 0x0f, 0xba, 0x8a, 0x41, 0xfa, 0x6a, 0xcf, 0x76, 0xb0, 0xda, - 0xeb, 0xf6, 0xef, 0x53, 0xf3, 0x5d, 0xe8, 0x02, 0x0f, 0x4b, 0xf5, 0xa0, 0xa8, 0xfc, 0x0c, 0xa4, - 0x74, 0x29, 0x26, 0x92, 0x56, 0x61, 0x11, 0x99, 0xa6, 0x8b, 0x29, 0x0d, 0x35, 0x89, 0x42, 0x41, - 0x00, 0xde, 0x44, 0x0c, 0x05, 0xae, 0xd0, 0xfd, 0xb5, 0x7c, 0xca, 0x81, 0xa0, 0x51, 0xeb, 0xe9, - 0x11, 0x36, 0x0e, 0xe6, 0xd0, 0x55, 0x84, 0x82, 0x11, 0x62, 0x42, 0x69, 0x27, 0x71, 0x24, 0x51, - 0xf6, 0x0f, 0x24, 0xca, 0xfd, 0x0b, 0x89, 0x36, 0x40, 0xbc, 0xdc, 0xd1, 0x44, 0x9e, 0x48, 0x04, - 0x2e, 0x26, 0xc2, 0xa7, 0x40, 0x04, 0xcd, 0xb6, 0x5c, 0xf4, 0x97, 0x22, 0xcc, 0x65, 0xb1, 0x50, - 0x29, 0xfe, 0x4a, 0xa5, 0xc2, 0x5e, 0x12, 0x07, 0x9b, 0xd9, 0x0b, 0x82, 0x65, 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6b, 0x39, 0x39, 0x73, 0xbc, 0x62, 0xa6, 0x7a, 0x14, 0x3c, 0xd2, 0xfe, 0xe0, - 0xe9, 0xe6, 0xfd, 0x27, 0xfa, 0xc1, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x26, 0x87, 0x1c, 0xe3, - 0x25, 0x08, 0x00, 0x00, + // 839 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x56, 0xcb, 0x8e, 0xe3, 0x44, + 0x14, 0x8d, 0x3b, 0xce, 0xeb, 0x76, 0x18, 0x22, 0x93, 0x49, 0x7b, 0x0c, 0x72, 0x22, 0x0f, 0x02, + 0x23, 0xc0, 0x9e, 0x04, 0x89, 0x35, 0x9d, 0xc0, 0xa2, 0x47, 0x32, 0x20, 0xb7, 0x86, 0x11, 0x08, + 0x29, 0xaa, 0xd8, 0x15, 0x8f, 0x35, 0xb1, 0x2b, 0xb8, 0x2a, 0x9d, 0xf4, 0x27, 0xb0, 0x63, 0xc7, + 0x3f, 0xf0, 0x03, 0xac, 0x91, 0x58, 0xf4, 0xb2, 0x97, 0xac, 0x02, 0xa4, 0xff, 0x82, 0x15, 0xf2, + 0xb3, 0x3d, 0x19, 0x27, 0x1d, 0x40, 0xac, 0x66, 0x63, 0xd5, 0x75, 0x9d, 0xfb, 0x3a, 0x75, 0x6e, + 0xd9, 0xf0, 0xc0, 0x22, 0xd4, 0x5b, 0x22, 0xea, 0xe9, 0xd1, 0xe3, 0xa2, 0xaf, 0xb3, 0x95, 0x36, + 0x0f, 0x08, 0x23, 0x42, 0x2b, 0xdd, 0xd2, 0xa2, 0xc7, 0x45, 0x5f, 0x92, 0xc3, 0x37, 0x84, 0xea, + 0x13, 0x44, 0xb1, 0x7e, 0xd1, 0x9f, 0x60, 0x86, 0xfa, 0xba, 0x45, 0x5c, 0x3f, 0xf6, 0x90, 0xda, + 0x0e, 0x71, 0x48, 0xb4,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, 0x2d, 0x74, 0x2f, 0x40, 0x4a, 0x8f, 0x0e, 0x45, 0x66, 0x29, + 0x19, 0xb4, 0x0b, 0xaf, 0xd4, 0xf7, 0x0e, 0x8d, 0x34, 0x90, 0xfa, 0x07, 0x43, 0xb3, 0xac, 0x18, + 0x5e, 0xdf, 0x9e, 0xf6, 0xb7, 0x0b, 0xa3, 0x6c, 0xa1, 0xa4, 0x0f, 0x0e, 0x41, 0xe5, 0xd3, 0x6c, + 0xcf, 0x53, 0x71, 0x9a, 0x2d, 0xd4, 0x8e, 0x34, 0xbb, 0x46, 0xe0, 0x6b, 0x38, 0xce, 0x6b, 0xbd, + 0x57, 0xe8, 0x9c, 0x43, 0x48, 0xea, 0x5d, 0x88, 0x2c, 0xf4, 0x57, 0x00, 0x39, 0x25, 0x77, 0x0b, + 0xfd, 0x6e, 0x01, 0xd2, 0xbb, 0x77, 0x00, 0xd2, 0xb8, 0xc3, 0x4f, 0xae, 0xfe, 0x94, 0x4b, 0x57, + 0x1b, 0x99, 0xbb, 0xde, 0xc8, 0xdc, 0x1f, 0x1b, 0x99, 0xfb, 0xe1, 0x46, 0x2e, 0x5d, 0xdf, 0xc8, + 0xa5, 0xdf, 0x6e, 0xe4, 0xd2, 0x37, 0xca, 0xf6, 0x4d, 0x17, 0x06, 0xb3, 0xf5, 0x55, 0xfc, 0x07, + 0x17, 0x5d, 0x77, 0x93, 0x6a, 0xf4, 0xff, 0xf6, 0xd1, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x1f, + 0x05, 0x74, 0x0c, 0x42, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -614,8 +719,12 @@ const _ = grpc.SupportPackageIsVersion4 type MsgClient interface { // StoreCode to submit Wasm code to the system StoreCode(ctx context.Context, in *MsgStoreCode, opts ...grpc.CallOption) (*MsgStoreCodeResponse, error) - // Instantiate creates a new smart contract instance for the given code id. + // InstantiateContract creates a new smart contract instance for the given + // code id. InstantiateContract(ctx context.Context, in *MsgInstantiateContract, opts ...grpc.CallOption) (*MsgInstantiateContractResponse, error) + // InstantiateContract2 creates a new smart contract instance for the given + // code id with a predictable address + InstantiateContract2(ctx context.Context, in *MsgInstantiateContract2, opts ...grpc.CallOption) (*MsgInstantiateContract2Response, error) // Execute submits the given message data to a smart contract ExecuteContract(ctx context.Context, in *MsgExecuteContract, opts ...grpc.CallOption) (*MsgExecuteContractResponse, error) // Migrate runs a code upgrade/ downgrade for a smart contract @@ -652,6 +761,15 @@ func (c *msgClient) InstantiateContract(ctx context.Context, in *MsgInstantiateC return out, nil } +func (c *msgClient) InstantiateContract2(ctx context.Context, in *MsgInstantiateContract2, opts ...grpc.CallOption) (*MsgInstantiateContract2Response, error) { + out := new(MsgInstantiateContract2Response) + err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1.Msg/InstantiateContract2", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) ExecuteContract(ctx context.Context, in *MsgExecuteContract, opts ...grpc.CallOption) (*MsgExecuteContractResponse, error) { out := new(MsgExecuteContractResponse) err := c.cc.Invoke(ctx, "/cosmwasm.wasm.v1.Msg/ExecuteContract", in, out, opts...) @@ -692,8 +810,12 @@ func (c *msgClient) ClearAdmin(ctx context.Context, in *MsgClearAdmin, opts ...g type MsgServer interface { // StoreCode to submit Wasm code to the system StoreCode(context.Context, *MsgStoreCode) (*MsgStoreCodeResponse, error) - // Instantiate creates a new smart contract instance for the given code id. + // InstantiateContract creates a new smart contract instance for the given + // code id. InstantiateContract(context.Context, *MsgInstantiateContract) (*MsgInstantiateContractResponse, error) + // InstantiateContract2 creates a new smart contract instance for the given + // code id with a predictable address + InstantiateContract2(context.Context, *MsgInstantiateContract2) (*MsgInstantiateContract2Response, error) // Execute submits the given message data to a smart contract ExecuteContract(context.Context, *MsgExecuteContract) (*MsgExecuteContractResponse, error) // Migrate runs a code upgrade/ downgrade for a smart contract @@ -714,6 +836,9 @@ func (*UnimplementedMsgServer) StoreCode(ctx context.Context, req *MsgStoreCode) 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") } @@ -767,6 +892,24 @@ func _Msg_InstantiateContract_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Msg_InstantiateContract2_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgInstantiateContract2) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).InstantiateContract2(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmwasm.wasm.v1.Msg/InstantiateContract2", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).InstantiateContract2(ctx, req.(*MsgInstantiateContract2)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_ExecuteContract_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgExecuteContract) if err := dec(in); err != nil { @@ -851,6 +994,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "InstantiateContract", Handler: _Msg_InstantiateContract_Handler, }, + { + MethodName: "InstantiateContract2", + Handler: _Msg_InstantiateContract2_Handler, + }, { MethodName: "ExecuteContract", Handler: _Msg_ExecuteContract_Handler, @@ -941,6 +1088,13 @@ func (m *MsgStoreCodeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Checksum) > 0 { + i -= len(m.Checksum) + copy(dAtA[i:], m.Checksum) + i = encodeVarintTx(dAtA, i, uint64(len(m.Checksum))) + i-- + dAtA[i] = 0x12 + } if m.CodeID != 0 { i = encodeVarintTx(dAtA, i, uint64(m.CodeID)) i-- @@ -1019,6 +1173,93 @@ func (m *MsgInstantiateContract) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgInstantiateContract2) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgInstantiateContract2) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgInstantiateContract2) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.FixMsg { + i-- + if m.FixMsg { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + if len(m.Salt) > 0 { + i -= len(m.Salt) + copy(dAtA[i:], m.Salt) + i = encodeVarintTx(dAtA, i, uint64(len(m.Salt))) + i-- + dAtA[i] = 0x3a + } + if len(m.Funds) > 0 { + for iNdEx := len(m.Funds) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Funds[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.Msg) > 0 { + i -= len(m.Msg) + copy(dAtA[i:], m.Msg) + i = encodeVarintTx(dAtA, i, uint64(len(m.Msg))) + i-- + dAtA[i] = 0x2a + } + if len(m.Label) > 0 { + i -= len(m.Label) + copy(dAtA[i:], m.Label) + i = encodeVarintTx(dAtA, i, uint64(len(m.Label))) + i-- + dAtA[i] = 0x22 + } + if m.CodeID != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.CodeID)) + i-- + dAtA[i] = 0x18 + } + if len(m.Admin) > 0 { + i -= len(m.Admin) + copy(dAtA[i:], m.Admin) + i = encodeVarintTx(dAtA, i, uint64(len(m.Admin))) + 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 *MsgInstantiateContractResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1056,6 +1297,43 @@ func (m *MsgInstantiateContractResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *MsgInstantiateContract2Response) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgInstantiateContract2Response) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgInstantiateContract2Response) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Data) > 0 { + i -= len(m.Data) + copy(dAtA[i:], m.Data) + i = encodeVarintTx(dAtA, i, uint64(len(m.Data))) + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *MsgExecuteContract) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1391,6 +1669,10 @@ func (m *MsgStoreCodeResponse) Size() (n int) { if m.CodeID != 0 { n += 1 + sovTx(uint64(m.CodeID)) } + l = len(m.Checksum) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -1428,34 +1710,24 @@ func (m *MsgInstantiateContract) Size() (n int) { return n } -func (m *MsgInstantiateContractResponse) Size() (n int) { +func (m *MsgInstantiateContract2) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Address) + l = len(m.Sender) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.Data) + l = len(m.Admin) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - return n -} - -func (m *MsgExecuteContract) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sender) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if m.CodeID != 0 { + n += 1 + sovTx(uint64(m.CodeID)) } - l = len(m.Contract) + l = len(m.Label) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -1469,15 +1741,26 @@ func (m *MsgExecuteContract) Size() (n int) { n += 1 + l + sovTx(uint64(l)) } } + l = len(m.Salt) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.FixMsg { + n += 2 + } return n } -func (m *MsgExecuteContractResponse) Size() (n int) { +func (m *MsgInstantiateContractResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } l = len(m.Data) if l > 0 { n += 1 + l + sovTx(uint64(l)) @@ -1485,37 +1768,94 @@ func (m *MsgExecuteContractResponse) Size() (n int) { return n } -func (m *MsgMigrateContract) Size() (n int) { +func (m *MsgInstantiateContract2Response) 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.Contract) + l = len(m.Address) if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.CodeID != 0 { - n += 1 + sovTx(uint64(m.CodeID)) - } - l = len(m.Msg) + l = len(m.Data) if l > 0 { n += 1 + l + sovTx(uint64(l)) } return n } -func (m *MsgMigrateContractResponse) Size() (n int) { +func (m *MsgExecuteContract) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Data) + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Contract) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Msg) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Funds) > 0 { + for _, e := range m.Funds { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgExecuteContractResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Data) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgMigrateContract) 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.Contract) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.CodeID != 0 { + n += 1 + sovTx(uint64(m.CodeID)) + } + l = len(m.Msg) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgMigrateContractResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Data) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -1784,6 +2124,40 @@ func (m *MsgStoreCodeResponse) Unmarshal(dAtA []byte) error { break } } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Checksum", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Checksum = append(m.Checksum[:0], dAtA[iNdEx:postIndex]...) + if m.Checksum == nil { + m.Checksum = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -2038,6 +2412,293 @@ func (m *MsgInstantiateContract) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgInstantiateContract2) Unmarshal(dAtA []byte) 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: MsgInstantiateContract2: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgInstantiateContract2: 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 Admin", 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.Admin = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CodeID", wireType) + } + m.CodeID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CodeID |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Label", 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.Label = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Msg", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Msg = append(m.Msg[:0], dAtA[iNdEx:postIndex]...) + if m.Msg == nil { + m.Msg = []byte{} + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Funds", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Funds = append(m.Funds, types.Coin{}) + if err := m.Funds[len(m.Funds)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Salt", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Salt = append(m.Salt[:0], dAtA[iNdEx:postIndex]...) + if m.Salt == nil { + m.Salt = []byte{} + } + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FixMsg", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.FixMsg = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgInstantiateContractResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2154,6 +2815,122 @@ func (m *MsgInstantiateContractResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgInstantiateContract2Response) Unmarshal(dAtA []byte) 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: MsgInstantiateContract2Response: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgInstantiateContract2Response: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 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.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) + if m.Data == nil { + m.Data = []byte{} + } + 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 *MsgExecuteContract) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/wasm/types/tx_test.go b/x/wasm/types/tx_test.go index d6e818306f..5692776d2d 100644 --- a/x/wasm/types/tx_test.go +++ b/x/wasm/types/tx_test.go @@ -84,6 +84,7 @@ func TestInstantiateContractValidation(t *testing.T) { badAddress := bad.String() // proper address size goodAddress := sdk.AccAddress(make([]byte, 20)).String() + sdk.GetConfig().SetAddressVerifier(VerifyAddressLen()) cases := map[string]struct { msg MsgInstantiateContract @@ -185,6 +186,142 @@ func TestInstantiateContractValidation(t *testing.T) { } } +func TestInstantiateContract2Validation(t *testing.T) { + bad, err := sdk.AccAddressFromHex("012345") + require.NoError(t, err) + badAddress := bad.String() + // proper address size + goodAddress := sdk.AccAddress(make([]byte, 20)).String() + sdk.GetConfig().SetAddressVerifier(VerifyAddressLen()) + + cases := map[string]struct { + msg MsgInstantiateContract2 + valid bool + }{ + "empty": { + msg: MsgInstantiateContract2{}, + valid: false, + }, + "correct minimal": { + msg: MsgInstantiateContract2{ + Sender: goodAddress, + CodeID: firstCodeID, + Label: "foo", + Msg: []byte("{}"), + Salt: []byte{0}, + }, + valid: true, + }, + "missing code": { + msg: MsgInstantiateContract2{ + Sender: goodAddress, + Label: "foo", + Msg: []byte("{}"), + Salt: []byte{0}, + }, + valid: false, + }, + "missing label": { + msg: MsgInstantiateContract2{ + Sender: goodAddress, + Msg: []byte("{}"), + Salt: []byte{0}, + }, + valid: false, + }, + "label too long": { + msg: MsgInstantiateContract2{ + Sender: goodAddress, + Label: strings.Repeat("food", 33), + Salt: []byte{0}, + }, + valid: false, + }, + "bad sender minimal": { + msg: MsgInstantiateContract2{ + Sender: badAddress, + CodeID: firstCodeID, + Label: "foo", + Msg: []byte("{}"), + Salt: []byte{0}, + }, + valid: false, + }, + "correct maximal": { + msg: MsgInstantiateContract2{ + Sender: goodAddress, + CodeID: firstCodeID, + Label: strings.Repeat("a", MaxLabelSize), + Msg: []byte(`{"some": "data"}`), + Funds: sdk.Coins{sdk.Coin{Denom: "foobar", Amount: sdk.NewInt(200)}}, + Salt: bytes.Repeat([]byte{0}, MaxSaltSize), + FixMsg: true, + }, + valid: true, + }, + "negative funds": { + msg: MsgInstantiateContract2{ + Sender: goodAddress, + CodeID: firstCodeID, + Label: "foo", + Msg: []byte(`{"some": "data"}`), + // we cannot use sdk.NewCoin() constructors as they panic on creating invalid data (before we can test) + Funds: sdk.Coins{sdk.Coin{Denom: "foobar", Amount: sdk.NewInt(-200)}}, + Salt: []byte{0}, + }, + valid: false, + }, + "non json init msg": { + msg: MsgInstantiateContract2{ + Sender: goodAddress, + CodeID: firstCodeID, + Label: "foo", + Msg: []byte("invalid-json"), + Salt: []byte{0}, + }, + valid: false, + }, + "empty init msg": { + msg: MsgInstantiateContract2{ + Sender: goodAddress, + CodeID: firstCodeID, + Label: "foo", + Salt: []byte{0}, + }, + valid: false, + }, + "empty salt": { + msg: MsgInstantiateContract2{ + Sender: goodAddress, + CodeID: firstCodeID, + Label: "foo", + Msg: []byte(`{"some": "data"}`), + }, + valid: false, + }, + "salt too long": { + msg: MsgInstantiateContract2{ + Sender: goodAddress, + CodeID: firstCodeID, + Label: "foo", + Msg: []byte(`{"some": "data"}`), + Salt: bytes.Repeat([]byte{0}, 65), + }, + valid: false, + }, + } + for name, tc := range cases { + t.Run(name, func(t *testing.T) { + err := tc.msg.ValidateBasic() + if tc.valid { + assert.NoError(t, err) + } else { + assert.Error(t, err) + } + }) + } +} + func TestExecuteContractValidation(t *testing.T) { bad, err := sdk.AccAddressFromHex("012345") require.NoError(t, err) diff --git a/x/wasm/types/types.go b/x/wasm/types/types.go index 8b04e0958a..b01fbd95f9 100644 --- a/x/wasm/types/types.go +++ b/x/wasm/types/types.go @@ -89,7 +89,7 @@ func (c *ContractInfo) ValidateBasic() error { return sdkerrors.Wrap(err, "admin") } } - if err := validateLabel(c.Label); err != nil { + if err := ValidateLabel(c.Label); err != nil { return sdkerrors.Wrap(err, "label") } if c.Extension == nil { @@ -335,18 +335,54 @@ func VerifyAddressLen() func(addr []byte) error { // IsSubset will return true if the caller is the same as the superset, // or if the caller is more restrictive than the superset. -func (a AccessConfig) IsSubset(superSet AccessConfig) bool { - switch superSet.Permission { +func (a AccessType) IsSubset(superSet AccessType) bool { + switch superSet { case AccessTypeEverybody: // Everything is a subset of this - return a.Permission != AccessTypeUnspecified + return a != AccessTypeUnspecified case AccessTypeNobody: // Only an exact match is a subset of this - return a.Permission == AccessTypeNobody + return a == AccessTypeNobody + case AccessTypeOnlyAddress, AccessTypeAnyOfAddresses: + // Nobody or address(es) + return a == AccessTypeNobody || a == AccessTypeOnlyAddress || a == AccessTypeAnyOfAddresses + default: + return false + } +} + +// IsSubset will return true if the caller is the same as the superset, +// or if the caller is more restrictive than the superset. +func (a AccessConfig) IsSubset(superSet AccessConfig) bool { + switch superSet.Permission { case AccessTypeOnlyAddress: // An exact match or nobody - return a.Permission == AccessTypeNobody || (a.Permission == AccessTypeOnlyAddress && a.Address == superSet.Address) - default: + return a.Permission == AccessTypeNobody || (a.Permission == AccessTypeOnlyAddress && a.Address == superSet.Address) || + (a.Permission == AccessTypeAnyOfAddresses && isSubset([]string{superSet.Address}, a.Addresses)) + case AccessTypeAnyOfAddresses: + // An exact match or nobody + return a.Permission == AccessTypeNobody || (a.Permission == AccessTypeOnlyAddress && isSubset(superSet.Addresses, []string{a.Address})) || + a.Permission == AccessTypeAnyOfAddresses && isSubset(superSet.Addresses, a.Addresses) + case AccessTypeUnspecified: return false + default: + return a.Permission.IsSubset(superSet.Permission) + } +} + +// return true when all elements in sub are also part of super +func isSubset(super, sub []string) bool { + if len(sub) == 0 { + return true + } + var matches int + for _, o := range sub { + for _, s := range super { + if o == s { + matches++ + break + } + } } + return matches == len(sub) } diff --git a/x/wasm/types/types.pb.go b/x/wasm/types/types.pb.go index f0764b5b23..b2a2d5720b 100644 --- a/x/wasm/types/types.pb.go +++ b/x/wasm/types/types.pb.go @@ -35,10 +35,13 @@ const ( AccessTypeUnspecified AccessType = 0 // AccessTypeNobody forbidden AccessTypeNobody AccessType = 1 - // AccessTypeOnlyAddress restricted to an address + // AccessTypeOnlyAddress restricted to a single address + // Deprecated: use AccessTypeAnyOfAddresses instead AccessTypeOnlyAddress AccessType = 2 // AccessTypeEverybody unrestricted AccessTypeEverybody AccessType = 3 + // AccessTypeAnyOfAddresses allow any of the addresses + AccessTypeAnyOfAddresses AccessType = 4 ) var AccessType_name = map[int32]string{ @@ -46,13 +49,15 @@ var AccessType_name = map[int32]string{ 1: "ACCESS_TYPE_NOBODY", 2: "ACCESS_TYPE_ONLY_ADDRESS", 3: "ACCESS_TYPE_EVERYBODY", + 4: "ACCESS_TYPE_ANY_OF_ADDRESSES", } var AccessType_value = map[string]int32{ - "ACCESS_TYPE_UNSPECIFIED": 0, - "ACCESS_TYPE_NOBODY": 1, - "ACCESS_TYPE_ONLY_ADDRESS": 2, - "ACCESS_TYPE_EVERYBODY": 3, + "ACCESS_TYPE_UNSPECIFIED": 0, + "ACCESS_TYPE_NOBODY": 1, + "ACCESS_TYPE_ONLY_ADDRESS": 2, + "ACCESS_TYPE_EVERYBODY": 3, + "ACCESS_TYPE_ANY_OF_ADDRESSES": 4, } func (AccessType) EnumDescriptor() ([]byte, []int) { @@ -136,7 +141,10 @@ var xxx_messageInfo_AccessTypeParam proto.InternalMessageInfo // AccessConfig access control type. type AccessConfig struct { Permission AccessType `protobuf:"varint,1,opt,name=permission,proto3,enum=cosmwasm.wasm.v1.AccessType" json:"permission,omitempty" yaml:"permission"` - Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty" yaml:"address"` + // Address + // Deprecated: replaced by addresses + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty" yaml:"address"` + Addresses []string `protobuf:"bytes,3,rep,name=addresses,proto3" json:"addresses,omitempty" yaml:"addresses"` } func (m *AccessConfig) Reset() { *m = AccessConfig{} } @@ -176,9 +184,6 @@ var xxx_messageInfo_AccessConfig proto.InternalMessageInfo type Params struct { CodeUploadAccess AccessConfig `protobuf:"bytes,1,opt,name=code_upload_access,json=codeUploadAccess,proto3" json:"code_upload_access" yaml:"code_upload_access"` InstantiateDefaultPermission AccessType `protobuf:"varint,2,opt,name=instantiate_default_permission,json=instantiateDefaultPermission,proto3,enum=cosmwasm.wasm.v1.AccessType" json:"instantiate_default_permission,omitempty" yaml:"instantiate_default_permission"` - GasMultiplier uint64 `protobuf:"varint,3,opt,name=gas_multiplier,json=gasMultiplier,proto3" json:"gas_multiplier,omitempty" yaml:"gas_multiplier"` - InstanceCost uint64 `protobuf:"varint,4,opt,name=instance_cost,json=instanceCost,proto3" json:"instance_cost,omitempty" yaml:"instance_cost"` - CompileCost uint64 `protobuf:"varint,5,opt,name=compile_cost,json=compileCost,proto3" json:"compile_cost,omitempty" yaml:"compile_cost"` } func (m *Params) Reset() { *m = Params{} } @@ -452,83 +457,81 @@ func init() { func init() { proto.RegisterFile("cosmwasm/wasm/v1/types.proto", fileDescriptor_e6155d98fa173e02) } var fileDescriptor_e6155d98fa173e02 = []byte{ - // 1213 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0x4d, 0x6f, 0x1b, 0x45, - 0x18, 0xf6, 0xda, 0xce, 0x87, 0x27, 0x6e, 0x71, 0xa7, 0x09, 0xb5, 0x4d, 0xe5, 0x75, 0x97, 0x22, - 0xd2, 0x36, 0xb5, 0xdb, 0x20, 0x81, 0x14, 0x89, 0x0a, 0xaf, 0xbd, 0x34, 0x5b, 0x11, 0xdb, 0x1a, - 0xbb, 0xa0, 0x20, 0x55, 0xab, 0xf5, 0xee, 0xc4, 0x19, 0x75, 0xbd, 0x63, 0xed, 0x8c, 0x53, 0xfb, - 0x1f, 0xa0, 0x48, 0x48, 0xdc, 0xe0, 0x12, 0x09, 0x01, 0x42, 0xfd, 0x01, 0x5c, 0xb9, 0x57, 0x88, - 0x43, 0x8f, 0x9c, 0x56, 0x90, 0x5e, 0xe0, 0xea, 0x63, 0xb9, 0xa0, 0x9d, 0xb1, 0xb1, 0x69, 0xd3, - 0x26, 0x5c, 0x56, 0xfb, 0x7e, 0x3c, 0xcf, 0xfb, 0x39, 0xb3, 0x0b, 0x2e, 0x3b, 0x94, 0xf5, 0x1e, - 0xd9, 0xac, 0x57, 0x16, 0x8f, 0x83, 0xdb, 0x65, 0x3e, 0xea, 0x63, 0x56, 0xea, 0x07, 0x94, 0x53, - 0x98, 0x99, 0x5a, 0x4b, 0xe2, 0x71, 0x70, 0x3b, 0x9f, 0x8b, 0x34, 0x94, 0x59, 0xc2, 0x5e, 0x96, - 0x82, 0x74, 0xce, 0xaf, 0x76, 0x69, 0x97, 0x4a, 0x7d, 0xf4, 0x36, 0xd1, 0xe6, 0xba, 0x94, 0x76, - 0x3d, 0x5c, 0x16, 0x52, 0x67, 0xb0, 0x57, 0xb6, 0xfd, 0x91, 0x34, 0x69, 0x0f, 0xc0, 0x1b, 0x15, - 0xc7, 0xc1, 0x8c, 0xb5, 0x47, 0x7d, 0xdc, 0xb4, 0x03, 0xbb, 0x07, 0x6b, 0x60, 0xe1, 0xc0, 0xf6, - 0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0x98, - 0x77, 0x51, 0xa5, 0x6d, 0x64, 0xe2, 0xf9, 0x1b, 0x87, 0x47, 0xc5, 0x77, 0x4f, 0xe3, 0xde, 0x21, - 0xdd, 0xc0, 0xe6, 0xf8, 0xcc, 0xf4, 0x77, 0x8d, 0xba, 0xd1, 0x32, 0x5b, 0x99, 0xc4, 0xd9, 0xe8, - 0xef, 0x62, 0x1f, 0x33, 0xc2, 0xf2, 0xc9, 0x68, 0x58, 0x7a, 0xed, 0xc9, 0x1f, 0x85, 0xd8, 0xe3, - 0xe3, 0x82, 0xf2, 0xe4, 0xb8, 0xa0, 0x3c, 0x3d, 0x2e, 0x28, 0xbf, 0x1f, 0x17, 0x94, 0xaf, 0x9e, - 0x15, 0x62, 0x4f, 0x9f, 0x15, 0x62, 0xbf, 0x3d, 0x2b, 0xc4, 0x3e, 0xd7, 0x5e, 0xdc, 0xff, 0xe8, - 0x30, 0xbb, 0xe5, 0xa1, 0xfc, 0x47, 0x13, 0x3f, 0x68, 0x9d, 0x45, 0x71, 0x93, 0xbd, 0xf7, 0x4f, - 0x00, 0x00, 0x00, 0xff, 0xff, 0xc4, 0xff, 0xd0, 0xc1, 0xc1, 0x09, 0x00, 0x00, + // 1171 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0xcd, 0x8f, 0xdb, 0x44, + 0x14, 0x8f, 0x93, 0xec, 0x47, 0xa6, 0x4b, 0x71, 0x87, 0x5d, 0x9a, 0x0d, 0xab, 0x24, 0x35, 0x45, + 0x6c, 0xdb, 0x6d, 0xd2, 0x2e, 0x12, 0x48, 0x3d, 0x54, 0x8a, 0x13, 0xb7, 0xeb, 0x8a, 0x8d, 0xa3, + 0x49, 0x0a, 0x5a, 0xa4, 0xca, 0x72, 0xec, 0xd9, 0xac, 0x55, 0xc7, 0x13, 0x79, 0x26, 0xdb, 0xf8, + 0x3f, 0x40, 0x91, 0x10, 0x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x36, 0x26, 0xe3, 0xc2, 0x05, 0x91, + 0x61, 0x8e, 0x54, 0x50, 0x2c, 0x0c, 0xdc, 0x01, 0x2b, 0x96, 0xe3, 0x04, 0x98, 0xd2, 0x6c, 0xb2, + 0x28, 0x6d, 0x67, 0x54, 0x38, 0x19, 0x17, 0xce, 0x0b, 0xcc, 0xd4, 0xa0, 0xa0, 0x99, 0x0b, 0xdc, + 0x05, 0x99, 0xe9, 0x11, 0xd3, 0x6c, 0xaa, 0x98, 0xda, 0xce, 0xa8, 0xeb, 0x93, 0x71, 0x41, 0xfe, + 0x8f, 0x3f, 0xa6, 0x0a, 0x9a, 0xbb, 0x4d, 0xbb, 0xf9, 0x3a, 0x09, 0x96, 0x39, 0x47, 0x14, 0x12, + 0x00, 0x6d, 0xe2, 0x60, 0xb3, 0xdf, 0xf3, 0x88, 0xe5, 0x98, 0x16, 0xaf, 0x97, 0xf7, 0x73, 0x6e, + 0x37, 0xff, 0xba, 0x7e, 0x04, 0x07, 0xea, 0xa5, 0x27, 0xe3, 0x42, 0x62, 0x32, 0x2e, 0x6c, 0x8a, + 0x8c, 0xaf, 0xc6, 0x51, 0x90, 0x1c, 0x29, 0xef, 0x73, 0x9d, 0x80, 0xc2, 0xaf, 0x24, 0x90, 0x77, + 0x7d, 0xca, 0x2c, 0x9f, 0xb9, 0x16, 0xc3, 0xa6, 0x83, 0x0f, 0xad, 0xbe, 0xc7, 0xcc, 0x18, 0x9b, + 0xc9, 0x05, 0xd8, 0xbc, 0x32, 0x19, 0x17, 0x3e, 0x10, 0x79, 0xdf, 0x1c, 0x4d, 0x41, 0x5b, 0x31, + 0x87, 0x9a, 0xb0, 0x37, 0x5e, 0x98, 0x39, 0x23, 0x09, 0xe5, 0x7b, 0x09, 0xac, 0x56, 0x89, 0x83, + 0x75, 0xff, 0x90, 0xc0, 0xf7, 0x40, 0x86, 0xf7, 0x72, 0x64, 0xd1, 0x23, 0x4e, 0xc5, 0x1a, 0x5a, + 0x8d, 0x14, 0x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 0x01, 0x00, 0x00, 0xff, 0xff, 0xce, 0x92, 0x6e, 0xc7, 0x78, + 0x09, 0x00, 0x00, } func (this *AccessTypeParam) Equal(that interface{}) bool { @@ -580,6 +583,14 @@ func (this *AccessConfig) Equal(that interface{}) bool { if this.Address != that1.Address { return false } + if len(this.Addresses) != len(that1.Addresses) { + return false + } + for i := range this.Addresses { + if this.Addresses[i] != that1.Addresses[i] { + return false + } + } return true } func (this *Params) Equal(that interface{}) bool { @@ -607,15 +618,6 @@ func (this *Params) Equal(that interface{}) bool { if this.InstantiateDefaultPermission != that1.InstantiateDefaultPermission { return false } - if this.GasMultiplier != that1.GasMultiplier { - return false - } - if this.InstanceCost != that1.InstanceCost { - return false - } - if this.CompileCost != that1.CompileCost { - return false - } return true } func (this *CodeInfo) Equal(that interface{}) bool { @@ -825,6 +827,15 @@ func (m *AccessConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Addresses) > 0 { + for iNdEx := len(m.Addresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Addresses[iNdEx]) + copy(dAtA[i:], m.Addresses[iNdEx]) + i = encodeVarintTypes(dAtA, i, uint64(len(m.Addresses[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } if len(m.Address) > 0 { i -= len(m.Address) copy(dAtA[i:], m.Address) @@ -860,21 +871,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.CompileCost != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.CompileCost)) - i-- - dAtA[i] = 0x28 - } - if m.InstanceCost != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.InstanceCost)) - i-- - dAtA[i] = 0x20 - } - if m.GasMultiplier != 0 { - i = encodeVarintTypes(dAtA, i, uint64(m.GasMultiplier)) - i-- - dAtA[i] = 0x18 - } if m.InstantiateDefaultPermission != 0 { i = encodeVarintTypes(dAtA, i, uint64(m.InstantiateDefaultPermission)) i-- @@ -1178,6 +1174,12 @@ func (m *AccessConfig) Size() (n int) { if l > 0 { n += 1 + l + sovTypes(uint64(l)) } + if len(m.Addresses) > 0 { + for _, s := range m.Addresses { + l = len(s) + n += 1 + l + sovTypes(uint64(l)) + } + } return n } @@ -1192,15 +1194,6 @@ func (m *Params) Size() (n int) { if m.InstantiateDefaultPermission != 0 { n += 1 + sovTypes(uint64(m.InstantiateDefaultPermission)) } - if m.GasMultiplier != 0 { - n += 1 + sovTypes(uint64(m.GasMultiplier)) - } - if m.InstanceCost != 0 { - n += 1 + sovTypes(uint64(m.InstanceCost)) - } - if m.CompileCost != 0 { - n += 1 + sovTypes(uint64(m.CompileCost)) - } return n } @@ -1469,6 +1462,38 @@ func (m *AccessConfig) Unmarshal(dAtA []byte) error { } m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + 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 ErrInvalidLengthTypes + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Addresses = append(m.Addresses, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -1571,63 +1596,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { break } } - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field GasMultiplier", wireType) - } - m.GasMultiplier = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.GasMultiplier |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field InstanceCost", wireType) - } - m.InstanceCost = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.InstanceCost |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CompileCost", wireType) - } - m.CompileCost = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTypes - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CompileCost |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) diff --git a/x/wasm/types/types_test.go b/x/wasm/types/types_test.go index 4add3c670d..e04d6fcc41 100644 --- a/x/wasm/types/types_test.go +++ b/x/wasm/types/types_test.go @@ -374,79 +374,332 @@ func TestVerifyAddressLen(t *testing.T) { } } -func TestAccesConfigSubset(t *testing.T) { +func TestAccessConfigSubset(t *testing.T) { + // read + // <, <= is subset of + // !< is not subset of specs := map[string]struct { check AccessConfig superSet AccessConfig isSubSet bool }{ + // nobody "nobody <= nobody": { superSet: AccessConfig{Permission: AccessTypeNobody}, check: AccessConfig{Permission: AccessTypeNobody}, isSubSet: true, }, - "only > nobody": { + "only !< nobody": { superSet: AccessConfig{Permission: AccessTypeNobody}, check: AccessConfig{Permission: AccessTypeOnlyAddress, Address: "foobar"}, isSubSet: false, }, - "everybody > nobody": { + "anyOf !< nobody": { + superSet: AccessConfig{Permission: AccessTypeNobody}, + check: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{"foobar"}}, + isSubSet: false, + }, + "everybody !< nobody ": { superSet: AccessConfig{Permission: AccessTypeNobody}, check: AccessConfig{Permission: AccessTypeEverybody}, isSubSet: false, }, - "unspecified > nobody": { + "unspecified !< nobody": { superSet: AccessConfig{Permission: AccessTypeNobody}, check: AccessConfig{Permission: AccessTypeUnspecified}, isSubSet: false, }, - "nobody <= everybody": { + // only + "nobody < only": { + superSet: AccessConfig{Permission: AccessTypeOnlyAddress, Address: "owner"}, + check: AccessConfig{Permission: AccessTypeNobody}, + isSubSet: true, + }, + "only <= only(same)": { + superSet: AccessConfig{Permission: AccessTypeOnlyAddress, Address: "owner"}, + check: AccessConfig{Permission: AccessTypeOnlyAddress, Address: "owner"}, + isSubSet: true, + }, + "only !< only(other)": { + superSet: AccessConfig{Permission: AccessTypeOnlyAddress, Address: "owner"}, + check: AccessConfig{Permission: AccessTypeOnlyAddress, Address: "other"}, + isSubSet: false, + }, + "anyOf(same) <= only": { + superSet: AccessConfig{Permission: AccessTypeOnlyAddress, Address: "owner"}, + check: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{"owner"}}, + isSubSet: true, + }, + "anyOf(other) !< only": { + superSet: AccessConfig{Permission: AccessTypeOnlyAddress, Address: "owner"}, + check: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{"foobar"}}, + isSubSet: false, + }, + "anyOf(same, other) !< only": { + superSet: AccessConfig{Permission: AccessTypeOnlyAddress, Address: "owner"}, + check: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{"owner", "foobar"}}, + isSubSet: false, + }, + "everybody !< only": { + superSet: AccessConfig{Permission: AccessTypeOnlyAddress, Address: "owner"}, + check: AccessConfig{Permission: AccessTypeEverybody}, + isSubSet: false, + }, + "unspecified !<= only": { + superSet: AccessConfig{Permission: AccessTypeOnlyAddress, Address: "owner"}, + check: AccessConfig{Permission: AccessTypeUnspecified}, + isSubSet: false, + }, + + // any of + "nobody < anyOf": { + superSet: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{"owner"}}, + check: AccessConfig{Permission: AccessTypeNobody}, + isSubSet: true, + }, + "only(same) < anyOf(same)": { + superSet: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{"owner"}}, + check: AccessConfig{Permission: AccessTypeOnlyAddress, Address: "owner"}, + isSubSet: true, + }, + "only(same) < anyOf(same, other)": { + superSet: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{"owner", "other"}}, + check: AccessConfig{Permission: AccessTypeOnlyAddress, Address: "owner"}, + isSubSet: true, + }, + "only(other) !< anyOf": { + superSet: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{"owner"}}, + check: AccessConfig{Permission: AccessTypeOnlyAddress, Address: "other"}, + isSubSet: false, + }, + "anyOf < anyOf": { + superSet: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{"owner"}}, + check: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{"owner"}}, + isSubSet: true, + }, + "anyOf(multiple) < anyOf(multiple)": { + superSet: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{"owner", "other"}}, + check: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{"owner", "other"}}, + isSubSet: true, + }, + "anyOf(multiple, other) !< anyOf(multiple)": { + superSet: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{"owner", "other", "foo"}}, + check: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{"owner", "other", "bar"}}, + isSubSet: false, + }, + "anyOf(multiple) !< anyOf": { + superSet: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{"owner"}}, + check: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{"owner", "other"}}, + isSubSet: false, + }, + "everybody !< anyOf": { + superSet: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{"owner"}}, + check: AccessConfig{Permission: AccessTypeEverybody}, + isSubSet: false, + }, + "unspecified !< anyOf ": { + superSet: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{"owner"}}, + check: AccessConfig{Permission: AccessTypeUnspecified}, + isSubSet: false, + }, + // everybody + "nobody < everybody": { superSet: AccessConfig{Permission: AccessTypeEverybody}, check: AccessConfig{Permission: AccessTypeNobody}, isSubSet: true, }, - "only <= everybody": { + "only < everybody": { superSet: AccessConfig{Permission: AccessTypeEverybody}, check: AccessConfig{Permission: AccessTypeOnlyAddress, Address: "foobar"}, isSubSet: true, }, + "anyOf < everybody": { + superSet: AccessConfig{Permission: AccessTypeEverybody}, + check: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{"foobar"}}, + isSubSet: true, + }, "everybody <= everybody": { superSet: AccessConfig{Permission: AccessTypeEverybody}, check: AccessConfig{Permission: AccessTypeEverybody}, isSubSet: true, }, - "unspecified > everybody": { + "unspecified !< everybody ": { superSet: AccessConfig{Permission: AccessTypeEverybody}, check: AccessConfig{Permission: AccessTypeUnspecified}, isSubSet: false, }, - "nobody <= only": { - superSet: AccessConfig{Permission: AccessTypeOnlyAddress, Address: "owner"}, + // unspecified + "nobody !< unspecified": { + superSet: AccessConfig{Permission: AccessTypeUnspecified}, check: AccessConfig{Permission: AccessTypeNobody}, - isSubSet: true, + isSubSet: false, }, - "only <= only(same)": { - superSet: AccessConfig{Permission: AccessTypeOnlyAddress, Address: "owner"}, - check: AccessConfig{Permission: AccessTypeOnlyAddress, Address: "owner"}, - isSubSet: true, + "only !< unspecified": { + superSet: AccessConfig{Permission: AccessTypeUnspecified}, + check: AccessConfig{Permission: AccessTypeOnlyAddress, Address: "foobar"}, + isSubSet: false, }, - "only > only(other)": { - superSet: AccessConfig{Permission: AccessTypeOnlyAddress, Address: "owner"}, - check: AccessConfig{Permission: AccessTypeOnlyAddress, Address: "other"}, + "anyOf !< unspecified": { + superSet: AccessConfig{Permission: AccessTypeUnspecified}, + check: AccessConfig{Permission: AccessTypeAnyOfAddresses, Addresses: []string{"foobar"}}, isSubSet: false, }, - "everybody > only": { - superSet: AccessConfig{Permission: AccessTypeOnlyAddress, Address: "owner"}, + "everybody !< unspecified": { + superSet: AccessConfig{Permission: AccessTypeUnspecified}, check: AccessConfig{Permission: AccessTypeEverybody}, isSubSet: false, }, - "nobody > unspecified": { + "unspecified !< unspecified ": { superSet: AccessConfig{Permission: AccessTypeUnspecified}, - check: AccessConfig{Permission: AccessTypeNobody}, + check: AccessConfig{Permission: AccessTypeUnspecified}, isSubSet: false, }, } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + subset := spec.check.IsSubset(spec.superSet) + require.Equal(t, spec.isSubSet, subset) + }) + } +} +func TestAccessTypeSubset(t *testing.T) { + specs := map[string]struct { + check AccessType + superSet AccessType + isSubSet bool + }{ + // nobody + "nobody <= nobody": { + superSet: AccessTypeNobody, + check: AccessTypeNobody, + isSubSet: true, + }, + "only !< nobody": { + superSet: AccessTypeNobody, + check: AccessTypeOnlyAddress, + isSubSet: false, + }, + "any !< nobody": { + superSet: AccessTypeNobody, + check: AccessTypeAnyOfAddresses, + isSubSet: false, + }, + "everybody !< nobody": { + superSet: AccessTypeNobody, + check: AccessTypeEverybody, + isSubSet: false, + }, + "unspecified !< nobody": { + superSet: AccessTypeNobody, + check: AccessTypeUnspecified, + isSubSet: false, + }, + // only + "nobody < only": { + superSet: AccessTypeOnlyAddress, + check: AccessTypeNobody, + isSubSet: true, + }, + "only <= only": { + superSet: AccessTypeOnlyAddress, + check: AccessTypeOnlyAddress, + isSubSet: true, + }, + "anyOf !< only": { + superSet: AccessTypeOnlyAddress, + check: AccessTypeAnyOfAddresses, + isSubSet: true, + }, + "everybody !< only": { + superSet: AccessTypeOnlyAddress, + check: AccessTypeEverybody, + isSubSet: false, + }, + "unspecified !< only": { + superSet: AccessTypeOnlyAddress, + check: AccessTypeUnspecified, + isSubSet: false, + }, + // any of + "nobody < anyOf": { + superSet: AccessTypeAnyOfAddresses, + check: AccessTypeNobody, + isSubSet: true, + }, + "only <= anyOf": { + superSet: AccessTypeAnyOfAddresses, + check: AccessTypeOnlyAddress, + isSubSet: true, + }, + "anyOf <= anyOf": { + superSet: AccessTypeAnyOfAddresses, + check: AccessTypeAnyOfAddresses, + isSubSet: true, + }, + "everybody !< anyOf": { + superSet: AccessTypeAnyOfAddresses, + check: AccessTypeEverybody, + isSubSet: false, + }, + "unspecified !< anyOf": { + superSet: AccessTypeAnyOfAddresses, + check: AccessTypeUnspecified, + isSubSet: false, + }, + // everybody + "nobody < everybody": { + superSet: AccessTypeEverybody, + check: AccessTypeNobody, + isSubSet: true, + }, + "only < everybody": { + superSet: AccessTypeEverybody, + check: AccessTypeOnlyAddress, + isSubSet: true, + }, + "anyOf < everybody": { + superSet: AccessTypeEverybody, + check: AccessTypeAnyOfAddresses, + isSubSet: true, + }, + "everybody <= everybody": { + superSet: AccessTypeEverybody, + check: AccessTypeEverybody, + isSubSet: true, + }, + "unspecified !< everybody": { + superSet: AccessTypeEverybody, + check: AccessTypeUnspecified, + isSubSet: false, + }, + // unspecified + "nobody !< unspecified": { + superSet: AccessTypeUnspecified, + check: AccessTypeNobody, + isSubSet: false, + }, + "only !< unspecified": { + superSet: AccessTypeUnspecified, + check: AccessTypeOnlyAddress, + isSubSet: false, + }, + "anyOf !< unspecified": { + superSet: AccessTypeUnspecified, + check: AccessTypeAnyOfAddresses, + isSubSet: false, + }, + "everybody !< unspecified": { + superSet: AccessTypeUnspecified, + check: AccessTypeEverybody, + isSubSet: false, + }, + "unspecified !< unspecified": { + superSet: AccessTypeUnspecified, + check: AccessTypeUnspecified, + isSubSet: false, + }, + } for name, spec := range specs { t.Run(name, func(t *testing.T) { subset := spec.check.IsSubset(spec.superSet) diff --git a/x/wasm/types/validation.go b/x/wasm/types/validation.go index 539c8d8a3b..8759aa06b8 100644 --- a/x/wasm/types/validation.go +++ b/x/wasm/types/validation.go @@ -4,8 +4,11 @@ import ( sdkerrors "github.com/line/lbm-sdk/types/errors" ) +// MaxSaltSize is the longest salt that can be used when instantiating a contract +const MaxSaltSize = 64 + var ( - // MaxLabelSize is the longest label that can be used when Instantiating a contract + // MaxLabelSize is the longest label that can be used when instantiating a contract MaxLabelSize = 128 // extension point for chains to customize via compile flag. // MaxWasmSize is the largest a compiled contract code can be when storing code on chain @@ -22,12 +25,24 @@ func validateWasmCode(s []byte) error { return nil } -func validateLabel(label string) error { +// ValidateLabel ensure label constraints +func ValidateLabel(label string) error { if label == "" { return sdkerrors.Wrap(ErrEmpty, "is required") } if len(label) > MaxLabelSize { - return sdkerrors.Wrap(ErrLimit, "cannot be longer than 128 characters") + return ErrLimit.Wrapf("cannot be longer than %d characters", MaxLabelSize) + } + return nil +} + +// ValidateSalt ensure salt constraints +func ValidateSalt(salt []byte) error { + switch n := len(salt); { + case n == 0: + return sdkerrors.Wrap(ErrEmpty, "is required") + case n > MaxSaltSize: + return ErrLimit.Wrapf("cannot be longer than %d characters", MaxSaltSize) } return nil } diff --git a/x/wasm/types/wasmer_engine.go b/x/wasm/types/wasmer_engine.go index 48451b32cd..30427e84e9 100644 --- a/x/wasm/types/wasmer_engine.go +++ b/x/wasm/types/wasmer_engine.go @@ -10,7 +10,6 @@ const DefaultMaxQueryStackSize uint32 = 10 // WasmerEngine defines the WASM contract runtime engine. type WasmerEngine interface { - // Create will compile the wasm code, and store the resulting pre-compile // as well as the original code. Both can be referenced later via CodeID // This must be done one time for given code, after which it can be diff --git a/x/wasmplus/README.md b/x/wasmplus/README.md new file mode 100644 index 0000000000..eea678281b --- /dev/null +++ b/x/wasmplus/README.md @@ -0,0 +1,36 @@ +# wasmplus + +Extended module of [line/wasmd/x/wasm](https://github.com/line/wasmd/tree/cae21ecd251cea44f56209e0a4586ca2979c6c87/x/wasm) module. + +## Concepts + +Implements the difference part with cosmwasm/wasmd. + +* Add smart contract Inactivate function +* Add `Msg/StoreCodeAndInstantiateContract` tx message + +### Inactivate +Add a function to deactivate or disable a specific smart contract address as a proposal. +Inactive smart contract address are stored and managed as `inactive_contract_addresses` in the genesis state. + +Inactive smart contract address restricts execution of `ExecuteContract`, `MigrateContract`, `UpdateAdmin`, `ClearAdmin`. +Through `ActivateContractProposal`, you can release restrictions on the use of inactive smart contract address. + +#### Proposal +##### DeactivateContractProposal +* If the deactivation succeeds, the [`EventDeactivateContractProposal`](../../docs/proto/proto-docs.md#eventdeactivatecontractproposal) event is emitted. +##### ActivateContractProposal +* Proposals activation of disabled smart contract address. +* If the activation succeeds, the [`EventActivateContractProposal`](../../docs/proto/proto-docs.md#eventactivatecontractproposal) event is emitted. + +#### queries +##### InactiveContracts +* Query API to query a list of all disabled smart contract addresses with pagination +* [Detailed specification](../../docs/proto/proto-docs.md#activatecontractproposal) +##### InactiveContract +* Query API to check if a specific smart contract address is disabled +* [Detailed specification](../../docs/proto/proto-docs.md#deactivatecontractproposal) + +### Msg/StoreCodeAndInstantiateContract +`Msg/StoreCodeAndInstantiateContract` allows `StoreCode` and `InstantiateContract` to be processed as one tx message. +More information can be found [here](../../docs/proto/proto-docs.md#msgstorecodeandinstantiatecontract) diff --git a/x/wasmplus/client/cli/gov_tx.go b/x/wasmplus/client/cli/gov_tx.go new file mode 100644 index 0000000000..44b08e74c9 --- /dev/null +++ b/x/wasmplus/client/cli/gov_tx.go @@ -0,0 +1,121 @@ +package cli + +import ( + "fmt" + + "github.com/spf13/cobra" + + "github.com/line/lbm-sdk/client" + "github.com/line/lbm-sdk/client/tx" + sdk "github.com/line/lbm-sdk/types" + "github.com/line/lbm-sdk/x/gov/client/cli" + govtypes "github.com/line/lbm-sdk/x/gov/types" + + "github.com/line/wasmd/x/wasmplus/types" +) + +func ProposalDeactivateContractCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "deactivate-contract [contract_addr_bech32]", + Short: "Deactivate the contract. This contract will not be executed after that.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + proposalTitle, err := cmd.Flags().GetString(cli.FlagTitle) + if err != nil { + return fmt.Errorf("proposal title: %s", err) + } + proposalDescr, err := cmd.Flags().GetString(cli.FlagDescription) + if err != nil { + return fmt.Errorf("proposal description: %s", err) + } + depositArg, err := cmd.Flags().GetString(cli.FlagDeposit) + if err != nil { + return fmt.Errorf("deposit: %s", err) + } + deposit, err := sdk.ParseCoinsNormalized(depositArg) + if err != nil { + return err + } + + content := types.DeactivateContractProposal{ + Title: proposalTitle, + Description: proposalDescr, + Contract: args[0], + } + + msg, err := govtypes.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress()) + if err != nil { + return err + } + if err = msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + cmd.Flags().String(cli.FlagTitle, "", "Title of proposal") + cmd.Flags().String(cli.FlagDescription, "", "Description of proposal") + cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal") + + return cmd +} + +func ProposalActivateContractCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "activate-contract [contract_addr_bech32]", + Short: "Activate the inactive contract. This contract will be executed after that.", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + proposalTitle, err := cmd.Flags().GetString(cli.FlagTitle) + if err != nil { + return fmt.Errorf("proposal title: %s", err) + } + proposalDescr, err := cmd.Flags().GetString(cli.FlagDescription) + if err != nil { + return fmt.Errorf("proposal description: %s", err) + } + depositArg, err := cmd.Flags().GetString(cli.FlagDeposit) + if err != nil { + return fmt.Errorf("deposit: %s", err) + } + deposit, err := sdk.ParseCoinsNormalized(depositArg) + if err != nil { + return err + } + + content := types.ActivateContractProposal{ + Title: proposalTitle, + Description: proposalDescr, + Contract: args[0], + } + + msg, err := govtypes.NewMsgSubmitProposal(&content, deposit, clientCtx.GetFromAddress()) + if err != nil { + return err + } + if err = msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + cmd.Flags().String(cli.FlagTitle, "", "Title of proposal") + cmd.Flags().String(cli.FlagDescription, "", "Description of proposal") + cmd.Flags().String(cli.FlagDeposit, "", "Deposit of proposal") + + return cmd +} diff --git a/x/wasmplus/client/cli/query.go b/x/wasmplus/client/cli/query.go new file mode 100644 index 0000000000..a88ead4fbb --- /dev/null +++ b/x/wasmplus/client/cli/query.go @@ -0,0 +1,119 @@ +package cli + +import ( + "context" + "encoding/base64" + + "github.com/spf13/cobra" + flag "github.com/spf13/pflag" + + "github.com/line/lbm-sdk/client" + "github.com/line/lbm-sdk/client/flags" + + wasmcli "github.com/line/wasmd/x/wasm/client/cli" + "github.com/line/wasmd/x/wasmplus/types" +) + +func GetQueryCmd() *cobra.Command { + queryCmd := &cobra.Command{ + Use: types.ModuleName, + Short: "Querying commands for the wasm module", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + queryCmd.AddCommand( + wasmcli.GetCmdListCode(), + wasmcli.GetCmdListContractByCode(), + wasmcli.GetCmdQueryCode(), + wasmcli.GetCmdQueryCodeInfo(), + wasmcli.GetCmdGetContractInfo(), + wasmcli.GetCmdGetContractHistory(), + wasmcli.GetCmdGetContractState(), + wasmcli.GetCmdListPinnedCode(), + wasmcli.GetCmdLibVersion(), + wasmcli.GetCmdQueryParams(), + wasmcli.GetCmdBuildAddress(), + GetCmdListInactiveContracts(), + GetCmdIsInactiveContract(), + ) + return queryCmd +} + +// sdk ReadPageRequest expects binary, but we encoded to base64 in our marshaller +func withPageKeyDecoded(flagSet *flag.FlagSet) *flag.FlagSet { + encoded, err := flagSet.GetString(flags.FlagPageKey) + if err != nil { + panic(err.Error()) + } + raw, err := base64.StdEncoding.DecodeString(encoded) + if err != nil { + panic(err.Error()) + } + err = flagSet.Set(flags.FlagPageKey, string(raw)) + if err != nil { + panic(err.Error()) + } + return flagSet +} + +func GetCmdListInactiveContracts() *cobra.Command { + cmd := &cobra.Command{ + Use: "inactive-contracts", + Long: "List all inactive contracts", + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + pageReq, err := client.ReadPageRequest(withPageKeyDecoded(cmd.Flags())) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + res, err := queryClient.InactiveContracts( + context.Background(), + &types.QueryInactiveContractsRequest{ + Pagination: pageReq, + }, + ) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "list of inactive contracts") + return cmd +} + +func GetCmdIsInactiveContract() *cobra.Command { + cmd := &cobra.Command{ + Use: "is-inactive [bech32_address]", + Long: "Check if inactive contract or not", + 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.InactiveContract( + context.Background(), + &types.QueryInactiveContractRequest{ + Address: args[0], + }, + ) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + return cmd +} diff --git a/x/wasmplus/client/cli/query_test.go b/x/wasmplus/client/cli/query_test.go new file mode 100644 index 0000000000..712002ac2d --- /dev/null +++ b/x/wasmplus/client/cli/query_test.go @@ -0,0 +1,140 @@ +package cli + +import ( + "context" + "errors" + "net/url" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/line/lbm-sdk/client" + "github.com/line/lbm-sdk/codec" + sdkerrors "github.com/line/lbm-sdk/types/errors" + ocrpcmocks "github.com/line/ostracon/rpc/client/mocks" + ocrpctypes "github.com/line/ostracon/rpc/core/types" + + "github.com/line/wasmd/x/wasmplus/types" +) + +var ( + accAddress = "link1yxfu3fldlgux939t0gwaqs82l4x77v2kasa7jf" +) + +type testcase []struct { + name string + want error + ctx context.Context + flags []string + args []string +} + +func TestGetCmdListInactiveContracts(t *testing.T) { + res := types.QueryInactiveContractsResponse{} + bz, err := res.Marshal() + require.NoError(t, err) + ctx := makeContext(bz) + tests := testcase{ + {"execute success", nil, ctx, nil, nil}, + { + "bad status", + status.Error(codes.Unknown, ""), + ctx, + nil, + nil, + }, + { + "invalid request", + sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, + "page and offset cannot be used together"), + ctx, + []string{"--page=2", "--offset=1"}, + nil}, + { + "invalid url", + &url.Error{Op: "parse", URL: string(rune(0)), + Err: errors.New("net/url: invalid control character in URL")}, + context.Background(), + []string{"--node=" + string(rune(0))}, + nil, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + cmd := GetCmdListInactiveContracts() + err := cmd.ParseFlags(tt.flags) + require.NoError(t, err) + cmd.SetContext(tt.ctx) + actual := cmd.RunE(cmd, tt.args) + if tt.want == nil { + assert.Nilf(t, actual, "GetCmdListInactiveContracts()") + } else { + assert.Equalf(t, tt.want.Error(), actual.Error(), "GetCmdListInactiveContracts()") + } + }) + } +} + +func TestGetCmdIsInactiveContract(t *testing.T) { + res := types.QueryInactiveContractResponse{} + bz, err := res.Marshal() + require.NoError(t, err) + ctx := makeContext(bz) + tests := testcase{ + {"execute success", nil, ctx, nil, []string{accAddress}}, + {"bad status", + status.Error(codes.Unknown, ""), + ctx, + nil, + []string{accAddress}, + }, + { + "invalid url", + &url.Error{Op: "parse", URL: string(rune(0)), + Err: errors.New("net/url: invalid control character in URL")}, + context.Background(), + []string{"--node=" + string(rune(0))}, + []string{accAddress}, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + cmd := GetCmdIsInactiveContract() + err := cmd.ParseFlags(tt.flags) + require.NoError(t, err) + cmd.SetContext(tt.ctx) + actual := cmd.RunE(cmd, tt.args) + if tt.want == nil { + assert.Nilf(t, actual, "GetCmdIsInactiveContract()") + } else { + assert.Equalf(t, tt.want.Error(), actual.Error(), "GetCmdIsInactiveContract()") + } + }) + } +} + +func makeContext(bz []byte) context.Context { + result := ocrpctypes.ResultABCIQuery{Response: abci.ResponseQuery{Value: bz}} + mockClient := ocrpcmocks.RemoteClient{} + { + // #1 + mockClient.On("ABCIQueryWithOptions", + mock.Anything, mock.Anything, mock.Anything, mock.Anything, + ).Once().Return(&result, nil) + } + { + // #2 + failure := result + failure.Response.Code = 1 + mockClient.On("ABCIQueryWithOptions", + mock.Anything, mock.Anything, mock.Anything, mock.Anything, + ).Once().Return(&failure, nil) + } + cli := client.Context{}.WithClient(&mockClient).WithCodec(codec.NewProtoCodec(nil)) + return context.WithValue(context.Background(), client.ClientContextKey, &cli) +} diff --git a/x/wasmplus/client/cli/tx.go b/x/wasmplus/client/cli/tx.go new file mode 100644 index 0000000000..00cee82abc --- /dev/null +++ b/x/wasmplus/client/cli/tx.go @@ -0,0 +1,160 @@ +package cli + +import ( + "errors" + "fmt" + "strconv" + + "github.com/spf13/cobra" + flag "github.com/spf13/pflag" + + "github.com/line/lbm-sdk/client" + "github.com/line/lbm-sdk/client/flags" + "github.com/line/lbm-sdk/client/tx" + sdk "github.com/line/lbm-sdk/types" + sdkerrors "github.com/line/lbm-sdk/types/errors" + + wasmcli "github.com/line/wasmd/x/wasm/client/cli" + "github.com/line/wasmd/x/wasm/client/cli/os" + "github.com/line/wasmd/x/wasm/ioutils" + wasmTypes "github.com/line/wasmd/x/wasm/types" + "github.com/line/wasmd/x/wasmplus/types" +) + +const ( + flagAmount = "amount" + flagLabel = "label" + flagAdmin = "admin" + flagInstantiateByEverybody = "instantiate-everybody" + flagInstantiateByAddress = "instantiate-only-address" +) + +// GetTxCmd returns the transaction commands for this module +func GetTxCmd() *cobra.Command { + txCmd := &cobra.Command{ + Use: types.ModuleName, + Short: "Wasm transaction subcommands", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + txCmd.AddCommand( + wasmcli.StoreCodeCmd(), + wasmcli.InstantiateContractCmd(), + wasmcli.InstantiateContract2Cmd(), + StoreCodeAndInstantiateContractCmd(), + wasmcli.ExecuteContractCmd(), + wasmcli.MigrateContractCmd(), + wasmcli.UpdateContractAdminCmd(), + wasmcli.ClearContractAdminCmd(), + ) + return txCmd +} + +// StoreCodeAndInstantiateContractCmd will upload code and instantiate a contract using it +func StoreCodeAndInstantiateContractCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "store-instantiate [wasm file] [json_encoded_init_args] --label [text] --admin [address,optional] --amount [coins,optional]", + Short: "Upload a wasm binary and instantiate a wasm contract from the code", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + msg, err := parseStoreCodeAndInstantiateContractArgs(args[0], args[1], clientCtx.GetFromAddress(), cmd.Flags()) + if err != nil { + return err + } + if err = msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) + }, + } + + cmd.Flags().String(flagInstantiateByEverybody, "", "Everybody can instantiate a contract from the code, optional") + cmd.Flags().String(flagInstantiateByAddress, "", "Only this address can instantiate a contract instance from the code, optional") + cmd.Flags().String(flagAmount, "", "Coins to send to the contract during instantiation") + cmd.Flags().String(flagLabel, "", "A human-readable name for this contract in lists") + cmd.Flags().String(flagAdmin, "", "Address of an admin") + flags.AddTxFlagsToCmd(cmd) + return cmd +} + +func parseStoreCodeAndInstantiateContractArgs(file string, initMsg string, sender sdk.AccAddress, flags *flag.FlagSet) (types.MsgStoreCodeAndInstantiateContract, error) { + wasm, err := os.ReadFileWithSizeLimit(file, int64(wasmTypes.MaxWasmSize)) + if err != nil { + return types.MsgStoreCodeAndInstantiateContract{}, err + } + + // gzip the wasm file + if ioutils.IsWasm(wasm) { + wasm, err = ioutils.GzipIt(wasm) + + if err != nil { + return types.MsgStoreCodeAndInstantiateContract{}, err + } + } else if !ioutils.IsGzip(wasm) { + return types.MsgStoreCodeAndInstantiateContract{}, fmt.Errorf("invalid input file. Use wasm binary or gzip") + } + + var perm *wasmTypes.AccessConfig + onlyAddrStr, err := flags.GetString(flagInstantiateByAddress) + if err != nil { + return types.MsgStoreCodeAndInstantiateContract{}, fmt.Errorf("instantiate by address: %s", err) + } + if onlyAddrStr != "" { + addr, err := sdk.AccAddressFromBech32(onlyAddrStr) + if err != nil { + return types.MsgStoreCodeAndInstantiateContract{}, sdkerrors.Wrap(err, flagInstantiateByAddress) + } + x := wasmTypes.AccessTypeOnlyAddress.With(addr) + perm = &x + } else { + everybodyStr, err := flags.GetString(flagInstantiateByEverybody) + if err != nil { + return types.MsgStoreCodeAndInstantiateContract{}, fmt.Errorf("instantiate by everybody: %s", err) + } + if everybodyStr != "" { + ok, err := strconv.ParseBool(everybodyStr) + if err != nil { + return types.MsgStoreCodeAndInstantiateContract{}, fmt.Errorf("boolean value expected for instantiate by everybody: %s", err) + } + if ok { + perm = &wasmTypes.AllowEverybody + } + } + } + + amountStr, err := flags.GetString(flagAmount) + if err != nil { + return types.MsgStoreCodeAndInstantiateContract{}, fmt.Errorf("amount: %s", err) + } + amount, err := sdk.ParseCoinsNormalized(amountStr) + if err != nil { + return types.MsgStoreCodeAndInstantiateContract{}, fmt.Errorf("amount: %s", err) + } + label, err := flags.GetString(flagLabel) + if err != nil { + return types.MsgStoreCodeAndInstantiateContract{}, fmt.Errorf("label: %s", err) + } + if label == "" { + return types.MsgStoreCodeAndInstantiateContract{}, errors.New("label is required on all contracts") + } + adminStr, err := flags.GetString(flagAdmin) + if err != nil { + return types.MsgStoreCodeAndInstantiateContract{}, fmt.Errorf("admin: %s", err) + } + + msg := types.MsgStoreCodeAndInstantiateContract{ + Sender: sender.String(), + WASMByteCode: wasm, + InstantiatePermission: perm, + Label: label, + Funds: amount, + Msg: []byte(initMsg), + Admin: adminStr, + } + return msg, nil +} diff --git a/x/wasmplus/client/proposal_handler.go b/x/wasmplus/client/proposal_handler.go new file mode 100644 index 0000000000..da0bb2bc5b --- /dev/null +++ b/x/wasmplus/client/proposal_handler.go @@ -0,0 +1,24 @@ +package client + +import ( + govclient "github.com/line/lbm-sdk/x/gov/client" + "github.com/line/wasmd/x/wasmplus/client/cli" + + wasmcli "github.com/line/wasmd/x/wasm/client/cli" +) + +// ProposalHandlers define the wasm cli proposal types and rest handler. +var ProposalHandlers = []govclient.ProposalHandler{ + govclient.NewProposalHandler(wasmcli.ProposalStoreCodeCmd), + govclient.NewProposalHandler(wasmcli.ProposalInstantiateContractCmd), + govclient.NewProposalHandler(wasmcli.ProposalMigrateContractCmd), + govclient.NewProposalHandler(wasmcli.ProposalExecuteContractCmd), + govclient.NewProposalHandler(wasmcli.ProposalSudoContractCmd), + govclient.NewProposalHandler(wasmcli.ProposalUpdateContractAdminCmd), + govclient.NewProposalHandler(wasmcli.ProposalClearContractAdminCmd), + govclient.NewProposalHandler(wasmcli.ProposalPinCodesCmd), + govclient.NewProposalHandler(wasmcli.ProposalUnpinCodesCmd), + govclient.NewProposalHandler(wasmcli.ProposalUpdateInstantiateConfigCmd), + govclient.NewProposalHandler(cli.ProposalDeactivateContractCmd), + govclient.NewProposalHandler(cli.ProposalActivateContractCmd), +} diff --git a/x/wasmplus/client/testutil/cli_test.go b/x/wasmplus/client/testutil/cli_test.go new file mode 100644 index 0000000000..ededc42407 --- /dev/null +++ b/x/wasmplus/client/testutil/cli_test.go @@ -0,0 +1,72 @@ +//go:build norace +// +build norace + +package testutil + +import ( + "fmt" + "testing" + "time" + + "github.com/stretchr/testify/suite" + dbm "github.com/tendermint/tm-db" + + "github.com/line/lbm-sdk/crypto/hd" + "github.com/line/lbm-sdk/crypto/keyring" + servertypes "github.com/line/lbm-sdk/server/types" + storetypes "github.com/line/lbm-sdk/store/types" + "github.com/line/lbm-sdk/testutil/network" + sdk "github.com/line/lbm-sdk/types" + authtypes "github.com/line/lbm-sdk/x/auth/types" + ostrand "github.com/line/ostracon/libs/rand" + + wasmapp "github.com/line/wasmd/app" + wasmappparams "github.com/line/wasmd/app/params" + wasmplusapp "github.com/line/wasmd/appplus" + "github.com/line/wasmd/x/wasmplus/types" +) + +func TestIntegrationTestSuite(t *testing.T) { + cfg := DefaultConfig() + cfg.NumValidators = 1 + suite.Run(t, NewIntegrationTestSuite(cfg)) +} + +func DefaultConfig() network.Config { + encCfg := wasmplusapp.MakeEncodingConfig() + + return network.Config{ + Codec: encCfg.Marshaler, + LegacyAmino: encCfg.Amino, + InterfaceRegistry: encCfg.InterfaceRegistry, + TxConfig: encCfg.TxConfig, + AccountRetriever: authtypes.AccountRetriever{}, + AppConstructor: NewAppConstructor(encCfg), + GenesisState: wasmplusapp.ModuleBasics.DefaultGenesis(encCfg.Marshaler), + TimeoutCommit: 1 * time.Second, + ChainID: "chain-" + ostrand.NewRand().Str(6), + NumValidators: 4, + BondDenom: sdk.DefaultBondDenom, + MinGasPrices: fmt.Sprintf("0.000006%s", sdk.DefaultBondDenom), + AccountTokens: sdk.TokensFromConsensusPower(1000, sdk.DefaultPowerReduction), + StakingTokens: sdk.TokensFromConsensusPower(500, sdk.DefaultPowerReduction), + BondedTokens: sdk.TokensFromConsensusPower(100, sdk.DefaultPowerReduction), + PruningStrategy: storetypes.PruningOptionNothing, + CleanupDir: true, + SigningAlgo: string(hd.Secp256k1Type), + KeyringOptions: []keyring.Option{}, + } +} + +func NewAppConstructor(encodingCfg wasmappparams.EncodingConfig) network.AppConstructor { + return func(val network.Validator) servertypes.Application { + return wasmplusapp.NewWasmApp( + val.Ctx.Logger, dbm.NewMemDB(), nil, true, + map[int64]bool{}, val.Ctx.Config.RootDir, 0, + encodingCfg, + types.EnableAllProposals, + wasmapp.EmptyBaseAppOptions{}, + nil, + ) + } +} diff --git a/x/wasm/client/testutil/gov.go b/x/wasmplus/client/testutil/gov.go similarity index 98% rename from x/wasm/client/testutil/gov.go rename to x/wasmplus/client/testutil/gov.go index ae2e960d8f..0dc912b7fd 100644 --- a/x/wasm/client/testutil/gov.go +++ b/x/wasmplus/client/testutil/gov.go @@ -9,7 +9,7 @@ import ( govcli "github.com/line/lbm-sdk/x/gov/client/cli" "github.com/line/lbm-sdk/x/gov/types" - "github.com/line/wasmd/x/wasm/client/cli" + "github.com/line/wasmd/x/wasmplus/client/cli" ) func (s *IntegrationTestSuite) TestProposalDeactivateContractCmd() { diff --git a/x/wasmplus/client/testutil/query.go b/x/wasmplus/client/testutil/query.go new file mode 100644 index 0000000000..d3095a7a78 --- /dev/null +++ b/x/wasmplus/client/testutil/query.go @@ -0,0 +1,79 @@ +package testutil + +import ( + "github.com/gogo/protobuf/proto" + + clitestutil "github.com/line/lbm-sdk/testutil/cli" + "github.com/line/lbm-sdk/types/query" + + "github.com/line/wasmd/x/wasmplus/client/cli" + "github.com/line/wasmd/x/wasmplus/types" +) + +func (s *IntegrationTestSuite) TestGetCmdListInactiveContracts() { + val := s.network.Validators[0] + + cmd := cli.GetCmdListInactiveContracts() + out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, s.queryCommonArgs()) + s.Require().NoError(err) + + expected := &types.QueryInactiveContractsResponse{ + Addresses: []string{s.inactiveContractAddress}, + Pagination: &query.PageResponse{}, + } + var resInfo types.QueryInactiveContractsResponse + s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &resInfo), out.String()) + s.Require().Equal(expected, &resInfo) +} + +func (s *IntegrationTestSuite) TestGetCmdIsInactiveContract() { + val := s.network.Validators[0] + + testCases := map[string]struct { + args []string + valid bool + expected proto.Message + }{ + "valid query(inactivate)": { + []string{ + s.inactiveContractAddress, + }, + true, + &types.QueryInactiveContractResponse{ + Inactivated: true, + }, + }, + "valid query(activate)": { + []string{ + "link1hmayw7vv0p3gzeh3jzwmw9xj8fy8a3kmpqgjrysljdnecqkps02qrq5rvm", + }, + false, + nil, + }, + "wrong bech32_address": { + []string{ + "xxx", + }, + false, + nil, + }, + } + + for name, tc := range testCases { + tc := tc + + s.Run(name, func() { + cmd := cli.GetCmdIsInactiveContract() + out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, s.queryCommonArgs()...)) + if !tc.valid { + s.Require().Error(err) + return + } + s.Require().NoError(err) + + var resInfo types.QueryInactiveContractResponse + s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &resInfo), out.String()) + s.Require().Equal(tc.expected, &resInfo) + }) + } +} diff --git a/x/wasmplus/client/testutil/suite.go b/x/wasmplus/client/testutil/suite.go new file mode 100644 index 0000000000..7607b19d03 --- /dev/null +++ b/x/wasmplus/client/testutil/suite.go @@ -0,0 +1,159 @@ +package testutil + +import ( + "fmt" + "os" + "testing" + + "github.com/line/lbm-sdk/client/flags" + clitestutil "github.com/line/lbm-sdk/testutil/cli" + "github.com/line/lbm-sdk/testutil/network" + sdk "github.com/line/lbm-sdk/types" + ostcli "github.com/line/ostracon/libs/cli" + "github.com/stretchr/testify/suite" + + "github.com/line/wasmd/x/wasm/client/cli" + wasmkeeper "github.com/line/wasmd/x/wasm/keeper" + wasmtypes "github.com/line/wasmd/x/wasm/types" + "github.com/line/wasmd/x/wasmplus/types" +) + +type IntegrationTestSuite struct { + suite.Suite + + cfg network.Config + network *network.Network + + setupHeight int64 + + codeID string + contractAddress string + nonExistValidAddress string + inactiveContractAddress string + + // for hackatom contract + verifier string + beneficiary sdk.AccAddress +} + +var commonArgs = []string{ + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100))).String()), +} + +func NewIntegrationTestSuite(cfg network.Config) *IntegrationTestSuite { + return &IntegrationTestSuite{cfg: cfg} +} + +func (s *IntegrationTestSuite) SetupSuite() { + if testing.Short() { + s.T().Skip("skipping test in unit-tests mode.") + } + + s.inactiveContractAddress = "link14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sgf2vn8" + + // add inactive contract to genesis + var wasmData types.GenesisState + genesisState := s.cfg.GenesisState + genesisData, err := os.ReadFile("./testdata/wasm_genesis.json") + s.Require().NoError(err) + s.Require().NoError(s.cfg.Codec.UnmarshalJSON(genesisData, &wasmData)) + wasmDataBz, err := s.cfg.Codec.MarshalJSON(&wasmData) + s.Require().NoError(err) + genesisState[types.ModuleName] = wasmDataBz + s.cfg.GenesisState = genesisState + + s.network = network.New(s.T(), s.cfg) + _, err = s.network.WaitForHeight(1) + s.Require().NoError(err) + + // deploy contract + s.codeID = s.deployContract() + + s.verifier = s.network.Validators[0].Address.String() + s.beneficiary = wasmkeeper.RandomAccountAddress(s.T()) + params := fmt.Sprintf("{\"verifier\": \"%s\", \"beneficiary\": \"%s\"}", s.verifier, s.beneficiary) + s.contractAddress = s.instantiate(s.codeID, params) + + s.nonExistValidAddress = wasmkeeper.RandomAccountAddress(s.T()).String() + + s.setupHeight, err = s.network.LatestHeight() + s.Require().NoError(err) + s.Require().NoError(s.network.WaitForNextBlock()) +} + +func (s *IntegrationTestSuite) TearDownSuite() { + s.T().Log("tearing down integration test suite") + s.network.Cleanup() +} + +func (s *IntegrationTestSuite) queryCommonArgs() []string { + return []string{ + fmt.Sprintf("--%s=%d", flags.FlagHeight, s.setupHeight), + fmt.Sprintf("--%s=json", ostcli.OutputFlag), + } +} + +func (s *IntegrationTestSuite) deployContract() string { + val := s.network.Validators[0] + + wasmPath := "../../../wasm/keeper/testdata/hackatom.wasm" + _, err := os.ReadFile(wasmPath) + s.Require().NoError(err) + + args := append([]string{ + wasmPath, + fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + fmt.Sprintf("--%s=%d", flags.FlagGas, 1500000), + }, commonArgs...) + + out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cli.StoreCodeCmd(), args) + s.Require().NoError(err) + + var res sdk.TxResponse + s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &res), out.String()) + s.Require().EqualValues(0, res.Code, out.String()) + + // parse codeID + for _, v := range res.Events { + if v.Type == wasmtypes.EventTypeStoreCode { + for _, attr := range v.Attributes { + if string(attr.Key) == wasmtypes.AttributeKeyCodeID { + return string(attr.Value) + } + } + } + } + + return "" +} + +func (s *IntegrationTestSuite) instantiate(codeID, params string) string { + val := s.network.Validators[0] + owner := val.Address.String() + + args := append([]string{ + codeID, + params, + fmt.Sprintf("--label=%s", "TestContract"), + fmt.Sprintf("--admin=%s", owner), + fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + }, commonArgs...) + + out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cli.InstantiateContractCmd(), args) + s.Require().NoError(err) + + var res sdk.TxResponse + s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &res), out.String()) + s.Require().EqualValues(0, res.Code, out.String()) + + // parse contractAddress + for _, v := range res.Events { + if v.Type == wasmtypes.EventTypeInstantiate { + return string(v.Attributes[0].Value) + } + } + + return "" +} diff --git a/x/wasmplus/client/testutil/testdata/wasm_genesis.json b/x/wasmplus/client/testutil/testdata/wasm_genesis.json new file mode 100644 index 0000000000..dabc0aa2db --- /dev/null +++ b/x/wasmplus/client/testutil/testdata/wasm_genesis.json @@ -0,0 +1,71 @@ +{ + "codes": + [ + { + "code_bytes": "AGFzbQEAAAABqgEYYAJ/fwF/YAJ/fwBgA39/fwF/YAN/f38AYAF/AGABfwF/YAR/f39/AGAFf39/f38AYAF/AX5gAABgCH9/f39/f39/AGADf39/AX5gBn9/f39/fwBgBH9/f38Bf2AAAX9gBX9/f39+AGAHf39/fn5/fwBgB39/f39/f38AYAN/f34AYAV/f39/fwF/YAN+f38AYAZ/f39/f38Bf2ADfn9/AX9gBX9+fn5+AAKTAg4DZW52BWFib3J0AAQDZW52B2RiX3JlYWQABQNlbnYIZGJfd3JpdGUAAQNlbnYJZGJfcmVtb3ZlAAQDZW52DWFkZHJfdmFsaWRhdGUABQNlbnYRYWRkcl9jYW5vbmljYWxpemUAAANlbnYNYWR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4ABqIAc2AgAgAyABNgJcIAMgAjYCWCAAQQhqQbWKwABBFiADQdgAahAcCyAAIBA2AgAgA0HwAGokAAumLwISfwJ+IwBBoAFrIgIkACACEMgBIAACfwJAAkACQAJAAkACQAJAAkACQAJAAkAgASgCAEEBRwRAIAIoAggiAyACKAIERgRAIAIgA0EBEA8gAigCCCEDCyACKAIAIANqQfsAOgAAIAIgA0EBajYCCCACQZABaiACQaGFwABBAhDLAQJAIAIoApABQQFHBEAgAigCCCIDIAIoAgRGBEAgAiADQQEQDyACKAIIIQMLIAIoAgAgA2pBOjoAACACIANBAWo2AgggAkGQAWogAhDPASACKAKQAUEBRg0BIAIgAigClAEiAzYCMCACQZgBai0AAARAIANBCGooAgAhBAwECyADKAIIIgUgA0EEaigCAEYEQCADIAVBARAPIAMoAgghBQsgAyAFQQFqIgQ2AgggAygCACAFakEsOgAADAMLIAJBHGogAkGcAWooAgA2AgAgAiACKQKUATcCFAwMCyACQSxqIAJBkAFqQQRyIgFBCGooAgA2AgAgAiABKQIANwIkDAoLIAJBEGogAiABQQRqECEgAigCEEEBRw0BDAoLIAJBADoANCADQQRqIgYoAgAgBEYEQCADIARBARAPIANBCGooAgAhBAsgAygCACAEakEiOgAAIANBCGoiBSAEQQFqIgQ2AgAgBigCACAEa0EHTQRAIAMgBEEIEA8gBSgCACEECyADKAIAIARqQu3KzZuX7Nmy8wA3AAAgBSAEQQhqIgQ2AgAgA0EEaigCACAEa0EBTQRAIAMgBEECEA8gA0EIaigCACEECyADKAIAIARqQaL0ADsAACADQQhqIARBAmo2AgAgASgCBCEEIAJBkAFqIAMgAUEMaigCACIDEM4BIAIoApABQQFGDQUgAkGYAWotAAAhBQJAAkAgAkE4aiACKAKUASILIAMEfyAEIANB6ABsaiEQIAJBkAFqQQRyIQwgAkGAAWpBBHIhCSAEQSxqIQYgBUUhAyALQQRqIREDQCADQQFxBEAgCygCCCIDIBEoAgBGBEAgCyADQQEQDyALKAIIIQMLIAsgA0EBajYCCCALKAIAI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gBOgBMIAIgAigClAE2AkggAkGQAWogAkHIAGpBrYXAAEEEIAQQEyACKAKQAUEBRg0GIAJBkAFqIAJByABqIARBDGoiBBAjIAIoApABQQFGBEAgAkGMAWogAkGcAWooAgA2AgAgAiACKQKUATcChAEMCQsgAkGAAWogAigCSCACLQBMEMYBIAIoAoABQQFGDQhBASEGIARBDGoiBCAJRw0AC0EABSAIC0H/AXFBAEcQxQEgAigCcEEBRg0HIANBCGoiBSgCACIEIANBBGoiBigCAEYEQCADIARBARAPIAUoAgAhBAsgAygCACAEakEsOgAAIAUgBEEBaiIENgIAIAJBADoANCAGKAIAIARGBEAgAyAEQQEQDyADQQhqKAIAIQQLIAMoAgAgBGpBIjoAACADQQhqIgUgBEEBaiIENgIAIAFBKGohASADQQRqIgYoAgAgBGtBA00EQCADIARBBBAPIAUoAgAhBAsgAygCACAEakHkwtGLBjYAACAFIARBBGoiBDYCACAGKAIAIARrQQFNBEAgAyAEQQIQDyADQQhqKAIAIQQLIAMoAgAgBGpBovQAOwAAIANBCGogBEECajYCACABKAIADQEgAkGQAWogAxDMAQwCCyACQYwBaiAHQQhqKAIANgIAIAIgBykCADcChAEMBQsgAkGAAWogARCeASACQZABaiADIAIoAoABIgEgAigCiAEQywEgAigChAFFIAFFcg0AIAEQ6wELIAIoApABQQFGBEAgAkEsaiACQZwBaigCADYCACACIAIpApQBNwIkDAkLIAJBIGogA0EAEMYBIAIoAiBBAUYNCCACKAIIIgMgAigCBEYEQCACIANBARAPIAIoAgghAwsgAigCACADakH9ADoAACACIANBAWo2AggLIAJBiAFqIAJBCGooAgAiATYCACACIAIpAwAiFDcDgAEgAEEMaiABNgIAIAAgFDcCBEEADAkLIAJBjAFqIAJBnAFqKAIANgIAIAIgAikClAE3AoQBDAELIAJB/ABqIAJBkAFqQQRyIgFBCGooAgA2AgAgAiABKQIANwJ0DAELIAJB/ABqIAJBjAFqKAIANgIAIAIgAikChAE3AnQLIAJBLGogAkH8AGooAgA2AgAgAiACKQJ0NwIkDAMLIAJBxABqIAJBkAFqQQRyIgFBCGooAgA2AgAgAiABKQIANwI8DAELIAJBxABqIAJB1ABqKAIANgIAIAIgAikCTDcCPAsgAkEsaiACQcQAaigCADYCACACIAIpAjw3AiQLIAJBHGogAkEsaigCADYCACACIAIpAiQ3AhQLIAJBiAFqIgEgAkEcaigCADYCACACIAIpAhQ3A4ABAkAgAigCBEUNACACKAIAIgNFDQAgAxDrAQsgAkGYAWogASgCADYCACACIAIpA4ABNwOQASAAQQhqQYSHwABB4QAgAkGQAWoQJEEBCzYCACACQaABaiQAC/0CAgJ/AX4jAEEgayIEJAAgASgCCCIDIAFBBGooAgBGBEAgASADQQEQDyABKAIIIQMLIAEgA0EBajYCCCABKAIAIANqQfsAOgAAIARBEGogAUGWhcAAQQUQywECQAJAIAQoAhBBAUcEQCABKAIIIgMgAUEEaigCAEYEQCABIANBARAPIAEoAgghAwsgASADQQFqNgIIIAEoAgAgA2pBOjoAACAEQRBqIAEgAigCACACQQhqKAIAEMsBIAQoAhBBAUYNASABKAIIIgMgAUEEaigCAEYEQCABIANBARAPIAEoAgghAwsgAEEANgIAIAEgA0EBajYCCCABKAIAIANqQf0AOgAADAILIARBCGogBEEcaigCACIBNgIAIAQgBCkCFCIFNwMAIABBDGogATYCACAAIAU3AgQgAEEBNgIADAELIARBCGogBEEcaigCACIBNgIAIAQgBCkCFCIFNwMAIABBDGogATYCACAAIAU3AgQgAEEBNgIACyAEQSBqJAALuQMCAn8BfiMAQTBrIgIkACABKAIIIgMgAUEEaigCAEYEQCABIANBARAPIAEoAgghAwsgASADQQFqNgIIIAEoAgAgA2pB+wA6AAAgAkEgaiABQYeBwABBBhDLAQJAAkACQAJAIAIoAiBBAUcEQCABKAIIIgMgAUEEaigCAEYEQCABIANBARAPIAEoAgghAwsgASADQQFqNgIIIAEoAgAgA2pBOjoAACACQSBqIAEQzwEgAigCIEEBRw0BIAJBHGogAkEgakEEciIBQQhqKAIANgIAIAIgASkCADcCFAwCCyACQRhqIAJBLGooAgAiATYCACACIAIpAiQiBDcDECAAQQxqIAE2AgAgACAENwIEIABBATYCAAwDCyACQRBqIAIoAiQgAkEoai0AABDGASACKAIQQQFHDQELIAJBCGogAkEcaigCACIBNgIAIAIgAikCFCIENwMAIABBDGogATYCACAAIAQ3AgQgAEEBNgIADAELIAEoAggiAyABQQRqKAIARgRAIAEgA0EBEA8gASgCCCEDCyAAQQA2AgAgASADQQFqNgIIIAEoAgAgA2pB/QA6AAALIAJBMGokAAuABwIFfwF+IwBB0ABrIgMkACABKAIAIQUCQCABLQAEBEAgBUEIaigCACEEDAELIAUoAggiBiAFQQRqKAIARgRAIAUgBkEBEA8gBSgCCCEGCyAFIAZBAWoiBDYCCCAFKAIAIAZqQSw6AAALIAFBADoABCAFQQRqIgYoAgAgBEYEQCAFIARBARAPIAVBCGooAgAhBAsgBSgCACAEakEiOgAAIAVBCGoiASAEQQFqIgQ2AgAgBigCACAEa0EJTQRAIAUgBEEKEA8gASgCACEECyAFKAIAIARqIgZBsYXAACkAADcAACAGQQhqQbmFwAAvAAA7AAAgASAEQQpqIgQ2AgAgBUEEaigCACAEa0EBTQRAIAUgBEECEA8gBUEIaigCACEECyAFKAIAIARqQaL0ADsAACAFQQhqIARBAmo2AgAgAigCACEEIANBQGsgBSACKAIIIgEQzgECQAJAAkAgAygCQEEBRwRAIANByABqLQAAIQYgAygCRCECAkACQCABBEAgBCABQRhsaiEHIANBQGtBBHIhBSAGQf8BcUUhASACQQRqIQYDQCABQQFxBEAgAigCCCIBIAYoAgBGBEAgAiABQQEQDyACKAIIIQELIAIgAUEBajYCCCACKAIAIAFqQSw6AAALIANBQGsgAhDPASADKAJAQQFGDQIgAyADLQBIOgA8IAMgAygCRDYCOCADQUBrIANBOGpB7IHAAEEDIAQQEyADKAJAQQFGDQMgA0FAayADQThqQcSFwABBBSAEQQxqIgQQEyADKAJAQQFGBEAgA0E0aiADQcwAaigCADYCACADIAMpAkQ3AiwMBgsgA0EoaiADKAI4IAMtADwQxgEgAygCKEEBRg0FQQEhASAEQQxqIgQgB0cNAAtBACEGC0EAIQQgA0EYaiACIAZB/wFxQQBHEMUBIAMoAhhBAUYNBAwFCyADQTRqIAVBCGooAgA2AgAgAyAFKQIANwIsDAILIANBNGogA0HMAGooAgA2AgAgAyADKQJENwIsDAELIANBJGogA0FAa0EEciIBQQhqKAIANgIAIAMgASkCADcCHAwBCyADQSRqIANBNGooAgA2AgAgAyADKQIsNwIcCyADQRBqIANBJGooAgAiATYCACADIAMpAhwiCDcDCCAAQQxqIAE2AgAgACAINwIEQQEhBAsgACAENgIAIANB0ABqJAALkAMBA38jAEFAaiIEJAACQAJAAkAgAkEATgRAIAINAUEBIQUMAgsQkwIACyACQQEQSyIFRQ0BCyAFIAEgAhDdAiEGIARCADcCBCAEQZSNwAAoAgA2AgAgBEEQaiIFIARB2IXAABDAAiMAQTBrIgEkAAJ/IAMoAgBFBEAgAUEcakEANgIAIAFBsNvAADYCGCABQgE3AgwgAUHw5MAANgIIIAUgAUEIahDDAgwBCyABIAM2AgQgAUEcakEBNgIAIAFCATcCDCABQcDbwAA2AgggAUHlADYCJCABIAFBIGo2AhggASABQSxqNgIgIAEgAUEEajYCLCAFIAFBCGoQwwILIAFBMGokAEUEQCAAQQxqIAI2AgAgAEEIaiACNgIAIAAgBjYCBCAAQRBqIAQpAwA3AgAgAEEJNgIAIABBGGogBEEIaigCADYCAAJAIAMoAgAiAEUNACADQQRqKAIARQ0AIAAQ6wELIARBQGskAA8LQfCFwABBNyAEQThqQbiMwABB9IbAABCvAgALIAJBARCSAgALnQ8CAn8BfiMAQeAAayICJAAgAkEIahDIASAAAn8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCABKAIAQQFrDgICAQALIAIoAhAiAyACKAIMRgRAIAJBCGogA0EBEA8gAigCECEDCyACKAIIIANqQfsAOgAAIAIgA0EBajYCECACQdAAaiACQQhqQY2BwABBBBDLASACKAJQQQFGDQMgAigCECIDIAIoAgxGBEAgAkEIaiADQ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ByABqQdyBwABBDSABQQhqEBMgAigCUEEBRg0GIAJB0ABqIAJByABqQeyBwAAgAUEUahASIAIoAlBBAUcEQCACQThqIAIoAkggAi0ATBDHAQwLCyACQcQAaiACQdwAaigCADYCACACIAIpAlQ3AjwgAkEBNgI4DAoLIAJB0ABqIAJBCGpB74HAAEEFENABIAIoAlBBAUYNBiACIAIoAlQ2AkggAiACQdgAai0AADoATCACQdAAaiACQcgAakHcgcAAQQ0gAUEIahATIAIoAlBBAUYNByACQdAAaiACQcgAakH0gcAAIAFBFGoQEiACKAJQQQFHBEAgAkE4aiACKAJIIAItAEwQxwEMCgsgAkHEAGogAkHcAGooAgA2AgAgAiACKQJUNwI8IAJBATYCOAwJCyACQRhqIAJBCGoQIiACKAIYQQFHDQsMDAsgAkHEAGogAkHcAGooAgA2AgAgAiACKQJUNwI8IAJBATYCOAwICyACQSRqIAJB3ABqKAIANgIAIAIgAikCVDcCHAwKCyACQcQAaiACQdwAaigCADYCACACIAIpAlQ3AjwgAkEBNgI4DAULIAJBxABqIAJB3ABqKAIANgIAIAIgAikCVDcCPCACQQE2AjgMBAsgAkHEAGogAkHcAGooAgA2AgAgAiACKQJUNwI8IAJBATYCOAwDCyACQcQAaiACQdwAaigCADYCACACIAIpAlQ3AjwgAkEBNgI4DAILIAJBxABqIAJB3ABqKAIANgIAIAIgAikCVDcCPCACQQE2AjgMAQsgAkEkaiACQdwAaigCADYCACACIAIpAlQ3AhwMBAsgAigCOEEBRw0BIAJBJGogAkHEAGooAgA2AgAgAiACKQI8NwIcDAMLIAIoAjhBAUcNACACQSRqIAJBxABqKAIANgIAIAIgAikCPDcCHAwCCyACKAIQIgEgAigCDEYEQCACQQhqIAFBARAPIAIoAhAhAQsgAigCCCABakH9ADoAACACIAFBAWo2AhALIAJBQGsgAkEQaigCACIBNgIAIAIgAikDCCIENwM4IABBDGogATYCACAAIAQ3AgRBAAwBCyACQUBrIgEgAkEkaigCADYCACACIAIpAhw3AzgCQCACKAIMRQ0AIAIoAggiA0UNACADEOsBCyACQdgAaiABKAIANgIAIAIgAikDODcDUCAAQQhqQcuKwABBxgAgAkHQAGoQJEEBCzYCACACQeAAaiQAC+YDAgJ/AX4jAEFAaiICJAAgAkEQaiIDEMgBIAJBMGogAxDPASAAAn8CQAJAAkACQCACKAIwQQFHBEAgAiACKAI0NgIAIAIgAkE4ai0AADoABCACQTBqIAJBjJPAAEEIIAEQEyACKAIwQQFGDQEgAkEwaiACQZSTwABBCyABQQxqEBMgAigCMEEBRg0CIAJBMGogAkGHlsAAQQYgAUEYahATIAIoAjBBAUYEQCACQSxqIAJBPGooAgA2AgAgAiACKQI0NwIkDAULIAJBIGogAigCACACLQAEEMYBIAIoAiBBAUcNAwwECyACQSxqIAJBMGpBBHIiAUEIaigCADYCACACIAEpAgA3AiQMAwsgAkEsaiACQTxqKAIANgIAIAIgAikCNDcCJAwCCyACQSxqIAJBPGooAgA2AgAgAiACKQI0NwIkDAELIAJBCGogAkEYaigCACIBNgIAIAIgAikDECIENwMAIABBDGogATYCACAAIAQ3AgRBAAwBCyACQQhqIgEgAkEsaigCADYCACACIAIpAiQ3AwACQCACKAIURQ0AIAIoAhAiA0UNACADEOsBCyACQThqIAEoAgA2AgAgAiACKQMANwMwIABBCGpBtYrAAEEWIAJBMGoQJEEBCzYCACACQUBrJAALwBIBDX8jAEHQAWsiAyQAIANBOGogAhAlAkACQCAAAn8CQAJAAkACQAJAAkACQAJAIAMoAjhBAUcEQCADQUBrKAIAIQ8gA0E4aiABKAIAIAMoAjwiDSADQcQAaiIEKAIAIAEoAgQoAgwRBgAgAygCOEEBRg0BIAMoAjxBAUYNAyADQegAaiADQcgAaigCADYCACADIANBQGspAwA3A2AgA0EwaiADQeAAahCfASADQagBaiIBIAMoAjAgAygCNBC8ASADQShqIAEQwwEgAy0AKEEBcQ0CQQQhAQwICyADQYgBaiADQdgAaikDADcDACADQYABaiADQdAAaikDADcDACADQfgAaiADQcgAaikDADcDACADIANBQGspAwA3A3AgA0GkAWpBATYCACADQgE3ApQBIANBjIPAADYCkAEgA0EDNgKsASADIANBqAFqNgKgASADIANB8ABqIgE2AqgBIANBwAFqIANBkAFqEJQCIAEQKCADKALAASEBIABBEGogAykCxAE3AgAgAEEMaiABNgIAIABBCGpBAzYCACAAQQE2AgAMCgsgA0GIAWogA0HUAGooAgA2AgAgA0GAAWogA0HMAGopAgA3AwAgA0H4AGogBCkCADcDACADIAMpAjw3A3AgA0GkAWpBATYCACADQgE3ApQBIANByILAADYCkAEgA0EENgKsASADIANBqAFqNgKgASADIANB8ABqNgKoASADQcABaiADQZABahCUAiAAQQhqQQM2AgAgAEEMaiADKQPAATcCACAAQRRqIANByAFqKAIANgIAIABBATYCAAJAAkACQAJAIAMoAnAOBAECAwwACyADQfgAaigCAEUNCyADKAJ0IgBFDQsgABDrAQwLCwJAIANB+ABqKAIARQ0AIAMoAnQiAEUNACAAEOsBCyADQYQBaigCAEUNCiADQYABaigCACIARQ0KIAAQ6wEMCgsCQCADQfgAaigCAEUNACADKAJ0IgBFDQAgABDrAQsgA0GEAWooAgBFDQkgA0GAAWooAgAiAEUNCSAAEOsBDAkLIANB+ABqKAIARQ0IIAMoAnQiAEUNCCAAEOsBDAgLIAMtAClB+wBHBEBBDiEBDAYLIANBqAFqIgEQvQEgA0EgaiABELsBIAMoAiAhBSADIAMtACRBAXEiAjoAvAEgAyAFNgK4ASADQRhqIAUQwwFBAiEBIAMtABhBAXFFDQIgA0HwAGpBBHIhDCADQcABakEEciEOIAMtABkhBCACIQYDQAJAAkACQAJAAkACQAJAAkAgBEH/AXEiCUEsRwRAIAlB/QBGDQMgAkH/AXENAUEJIQEMDAsgBkH/AXENACAFEL0BIANBEGogBRDDASADLQAQQQFxRQ0KIAMtABEhBAwBC0EAIQIgA0EAOgC8AQsgBEH/AXEiBEEiRwRAQRAhASAEQf0ARw0KQRMhAQwKCyADQQhqIAUQwwEgAy0ACEEBcUUNCCADLQAJQSJHBEBBDiEBDAoLIAUQvQEgA0HwAGogBRDCASAD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RAIAIgAUE/cUGAAXI6AA4gAiABQQx2QeABcjoADCACIAFBBnZBP3FBgAFyOgANQQMMAgsgAiABQT9xQYABcjoADyACIAFBEnZB8AFyOgAMIAIgAUEGdkE/cUGAAXI6AA4gAiABQQx2QT9xQYABcjoADUEEDAELIAIgAUE/cUGAAXI6AA0gAiABQQZ2QcABcjoADEECCyEBIAEgAEEEaigCACAAQQhqIgQoAgAiA2tLBEAgACADIAEQDyAEKAIAIQMLIAAoAgAgA2ogAkEMaiABEN0CGiAEIAEgA2o2AgALIAJBEGokAEEAC1oBAX8jAEEgayICJAAgAiAAKAIANgIEIAJBGGogAUEQaikCADcDACACQRBqIAFBCGopAgA3AwAgAiABKQIANwMIIAJBBGpB0IvAACACQQhqEKICIAJBIGokAAtPAQJ/IAIgACgCACIDQQRqKAIAIANBCGoiBCgCACIAa0sEQCADIAAgAhAPIAQoAgAhAAsgAygCACAAaiABIAIQ3QIaIAQgACACajYCAEEAC+QEAQF/IwBBsAFrIgIkACACQQhqIAFBDGopAgA3AwAgAkEQaiABQRRqKQIANwMAIAJBGGogAUEcaikCADcDACACQSBqIAFBJGopAgA3AwAgAkEoaiABQSxqKQIANwMAIAIgASkCBDcDAAJAAkAgASgCAEEBRwRAIABBADYCACAAIAFBBGoiASkCADcCBCAAQSxqIAFBKGopAgA3AgAgAEEkaiABQSBqKQIANwIAIABBHGogAUEYaikCADcCACAAQRRqIAFBEGopAgA3AgAgAEEMaiABQQhqKQIANwIADAELIAJByABqIAJBHGopAgA3AwAgAkFAayACQRRqKQIANwMAIAJBOGogAkEMaikCADcDACACIAIpAgQ3AzAgAkIANwJUIAJBlI3AACgCADYCUCACQeAAaiACQdAAakHYhcAAEMACAkAgAigCMEENRgRAIAJBrAFqQQA2AgAgAkGEjcAANgKoASACQgE3ApwBIAJB/JLAADYCmAEgAkHgAGogAkGYAWoQwwJFDQEMAwsgAkGsAWpBATYCACACQgE3ApwBIAJBhJPAADYCmAEgAkEGNgKMASACIAJBiAFqNgKo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AQQE6AAAgAEEEakEENgIADAILIABBAToAACAAQQRqQQ42AgAMAQsgAEEBOgAAIABBEGogBDYCACAAQQxqIAM2AgAgAEEIaiABNgIAIABBBGogBTYCAAsgAkEgaiQAC8ECAAJAAkACQAJAAkACQAJAAkACQAJAAkACQCACQQVrDhQGAAcCCQkEAQkJCQkJCQkJBQkJCAkLIAFBqZTAAEEGEOACDQggAEEBOgABDAoLIAFBlZTAAEEMEOACRQ0BIAFB/pPAAEEMEOACDQcgAEEFOgABDAkLIAEpAABC4+DV+8Xt27fwAFINBiAAQQI6AAEMCAsgAEEDOgABDAcLIAFBipTAAEELEOACDQQgAEEEOgABDAYLIAFB5JPAAEEVEOACDQMgAEEGOgABDAULIAFB35PAAEEFEOACDQIgAEEHOgABDAQLIAFB/47AAEEHEOACRQ0CDAELIAFBx5PAAEEYEOACDQAgAEEIOgABDAILIABBBGogASACQcCUwABBCRA8IABBAToAAA8LIABBADoAASAAQQA6AAAPCyAAQQA6AAALqgIBBH8jAEEgayICJAAgAiABEMMBAkACQAJAIAItAABBAXEEQCACLQABQSJHDQEgARC9ASACQQhqIAEQwgEgAkEYaigCACEEIAJBFGooAgAhAyACQRBqKAIAIQEgAigCDCEFIAIoAghBAUYNAiAFRQRAAkAgA0ELRgRAIAFBn5PAAEELEOACRQ0BCyAAIAEgA0Gsk8AAQQEQPAwFCyAAQRU2AgAMBAsCQAJAIARBC0YEQCABQZ+TwABBCxDgAkUNAQsgACABIARBrJPAAEEBEDwMAQsgAEEVNgIACyADRSABRXINAyABEOsBDAMLIABBBDYCAAwCCyAAQQ42AgAMAQsgACABNgIEIAAgBTYCACAAQQxqIAQ2AgAgAEEIaiADNgIACyACQSBqJAAL2SUCGX8EfiMAQcADayIDJAAQ8AEgA0HoAGogABCzASADQfgAaiABELMBIANBiAFqIAIQswEgA0G4AmogAygCaCIPIAMoAnAQFQJAAkACQAJAAkACQAJAAkACQAJAAkACQCADKQO4AkIBUgRAIANBsAFqIANByAJqIgApAwA3AwAgA0GgAWogA0HgAmopAwA3AwAgAyADKQPAAjcDqAEgAyADQdgCaiICKQMANwOYASADQdACaiIBKAIAIQ0gA0HUAmooAgAhEyADQegCaigCACELIANB7AJqKAIAIRQgA0HwAmopAwAhHCADQbgCaiADKAJ4IhUgAygCgAEQHSADKAK4AkEBRg0CIAEoAgAhDiADQcwCaigCACEQIAAoAgAhESADQcQCaigCACEZIAMoAsACIRYgAygCvAIhEiADQdABaiIAIAMoAogBIhcgAygCkAEQvAEgA0EoaiAAEMMBIAMtAChBAXENAUEEIQIMCAsgA0HoAWogA0HYAmopAwA3AwAgA0HgAWogA0HQAmopAwA3AwAgA0HYAWogA0HIAmopAwA3AwAgAyADKQPAAjcD0AEgA0IANwK8ASADQZSNwAAoAgA2ArgBIANBgAJqIgAgA0G4AWpB2IXAABDAAiADQdABaiAAELEBDQsgA0E8aiADQcABaigCADYCACADIAMpA7gBNwI0IANBATYCMCADQdABahAoDAkLIAMtAClB+wBHBEBBDiECDAcLIANB0AFqIgAQvQEgA0EgaiAAELsBIAMtACQhASADQRhqIAMoAiAiABDDASADLQAYQQFxRQRAQQIhAgwECyADQTBqQQRyIQogA0GAAmpBBHIhGCADQYgCaiEMIAMtABkhAiABQQFxIQEDQAJAAkACQAJAAkACQAJAAkACQAJAIAJB/wFxIgRBLEcEQCAEQf0ARg0CIAFB/wFxDQFBCSECDA8LIAFB/wFxBEBBECECDA8LIAAQvQEgA0EQaiAAEMMBIAMtABBBAXFFDQ0gAy0AESECCyACQf8BcSIBQSJHBEBBE0EQIAFB/QBGGyECDA4LIANBCGogABDDASADLQAIQQFxRQ0MIAMtAAlBIkcEQEEOIQIMDgsgABC9ASADQYACaiAAEMIBIAMoApACIQYgAygCjAIhBCADKAKIAiEBIAMoAoQCIQIgAygCgAJBAUYNDSACRQRAIARBCGsOBAIICAQIC0ECIQICQAJAAkAgBkEIaw4EAAICAQILQQBBfiABKQAAQvbKycvmrNqy8gBRGyECDAELQX5BASABQZSTwABBCxDgAhshAgsgBEUgAUVyRQRAIAEQ6wELIAJBHnRBHnVBAEgNByACQQNxQQFrDQIMBAsgBQRAIAcNBiADQYACakEEckGUk8AAQQsQFiADQZACaigCACEGIANBjAJqKAIAIQQgA0GIAmooAgAhASADKAKEAiECIAhFDRAgBRDrAQwQCyADQYACakEEckGMk8AAQQgQFiADQZACaigCACEGIANBjAJqKAIAIQQgA0GIAmooAgAhASADKAKEAiECDAoLIAEpAABC9srJy+as2rLyAFINBQsgBUUNAiADQYACakGMk8AAQQgQFyADQYwCaigCACEGIANBiAJqKAIAIQQgAygChAIhASADKAKAAiECDAoLIAFBlJPAAEELEOACDQMLIAcEQCADQYACakGUk8AAQQsQFyADQYwCaigCACEGIANBiAJqKAIAIQQgAygChAIhASADKAKAAiECIAkNCgwLCyADQTBqIAAQwQECQCADKAIwIgJBFUcEQCAMIAopAgA3AgAgDEEIaiAKQQhqKAIANgIADAELIANBgAJqIAAQGSADKAKAAkEBRwRAIAMoAowCIRogAygCiAIhCSADKAKEAiEHDAULIAMoAoQCIQILIANBkAJqKAIAIQYgAygCjAIhBCADKAKIAiEBDAoLIANBMGogABDBAQJAIAMoAjAiAkEVRwRAIAwgCikCADcCACAMQQhqIApBCGooAgA2AgAMAQsgA0GAAmogABAZIAMoAoACQQFHBEAgAygCjAIhGyADKAKIAiEIIAMoAoQCIQUMBAsgAygChAIhAgsgA0GQAmooAgAhBiADKAKMAiEEIAMoAogCIQEMBQsgA0GAAmogA0HQAWoQwAEgAygCgAIiAkEVRwRAIANBjAJqKAIAIQYgA0GIAmooAgAhBCADKAKEAiEBIAgEQCAFEOsBCyAJRQ0KIAcQ6wEMCgsgA0GAAmogA0HQAWoQvgEgAygCgAIiAkEVRwRAIANBjAJqKAIAIQYgA0GIAmooAgAhBCADKAKEAiEBIAgEQCAFEOsBCyAJRQ0KIAcQ6wEMCgsgA0HIAmogBzYCACADQcQCaiIBIBs2AgAgA0HQAmoiAiAaNgIAIANBzAJqIgAgCTYCACADQcABaiIEIAEpAgA3AwAgA0HIAWoiASAAKQIANwMAIAMgCDYCwAIgAyAFNgK8AiADIAMpArwCNwO4ASADQYQDakHkgMAANgIAIANB/AJqQbSAwAA2AgAgA0H0AmpBnIDAADYCACADQcACaiADQbABaikDADcDACAAIBM2AgAgAiADKQOYATcDACADQdgCaiADQaABaikDADcDACADQZwDaiAONgIAIANBmANqIBA2AgAgA0GUA2ogETYCACADQZADaiAZNgIAIANBjANqIBY2AgAgA0HoAmogHDcDACADQeQCaiAUNgIAIANBgANqIANBuANqIgA2AgAgA0H4AmogADYCACADIAMpA6gBNwO4AiADIA02AsgCIAMgEjYCiAMgAyALNgLgAiADIAA2AvACIANBsANqIAEpAwA3AwAgA0GoA2ogBCkDADcDACADIAMpA7gBNwOgAyADQYACaiIMIQEgA0G4AmohBiADQYgDaiECIwBB4AFrIgAkACADQfACaiIEKAIIIghBzJLAAEEPIARBDGooAgAiBSgCLBEDACAEKAIEIQ0gBCgCACEJIABBsAFqIAggA0GgA2oiBCgCACIHIARBCGooAgAgBSgCDCILEQYAAkACQAJAAkACQAJAIAAoArABQQFHBEAgAEG8AWooAgAhDiAAQbgBaigCACEKIAAoArQBIQUgAEGwAWogCCAEQQxqKAIAIgggBEEUaigCACALEQYAIAAoArABQQFGDQEgAEGQAWogAEG8AWooAgAiCzYCACAAQdwAaiALNgIAIAAgACkCtAEiHDcDiAEgAEHoAGogAkEIaigCADYCACAAIA42AlAgACAKNgJMIAAgBTYCSCAAIBw3AlQgACACKQIANwNgIABBIGogAEHIAGoQJiAAKAIgQQFGDQIgAEEoaigCACAJQfOOwABBBiAAKAIkIgkgAEEsaigCACANKAIQEQcARSAJRXJFBEAgCRDrAQsgCkUgBUVyRQRAIAUQ6wELAkAgAEHYAGooAgBFDQAgACgCVCIFRQ0AIAUQ6wELAkAgAEHkAGooAgBFDQAgACgCYCIFRQ0AIAUQ6wELIABBzAFqQgA3AgAgAEHAAWpCADcDACAAQQA2AtQBIABBhI3AACgCACIFNgLIASAAIAU2Arw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igCACIBRQ0AIAEQ6wELIAIoAgwhBSACQRRqKAIAIgEEQCABQQV0IQQgBUEUaiEBA0ACQCABKAIARQ0AIAFBBGsoAgAiB0UNACAHEOsBCyABQSBqIQEgBEEgayIEDQALCyACQRBqKAIAIgFFIAFBBXRFckUEQCAFEOsBCwJAIAZBFGooAgBFDQAgBkEQaigCACIBRQ0AIAEQ6wELIAZBLGooAgBFDQAgBkEoaigCACIBRQ0AIAEQ6wELIABB4AFqJAAgA0EwaiAMEDcgAygCjAFFIBdFckUEQCAXEOsBCyADKAJ8RSAVRXJFBEAgFRDrAQsgAygCbEUgD0VyDQwgDxDrAQwMCyADQYACaiAAEMEBAkAgAygCgAIiAkEVRwRAIAogGCkCADcCACAKQQhqIBhBCGooAgA2AgAMAQsgA0EwaiAAEBggAygCMCICQRVGDQELIANBPGooAgAhBiADQThqKAIAIQQgAygCNCEBDAULIAMgABDDAUEAIQEgAy0AASECIAMtAABBAXENAAtBAiECDAMLIANB6AFqIAIpAwA3AwAgA0HgAWogASkDADcDACADQdgBaiAAKQMANwMAIAMgAykDwAI3A9ABIANCADcCvAEgA0GUjcAAKAIANgK4ASADQYACaiIAIANBuAFqQdiFwAAQwAIgA0HQAWogABCxAUUEQCADQTxqIANBwAFqKAIANgIAIAMgAykDuAE3AjQgA0EBNgIwIANB0AFqECgMBwsMCQtBACEFDAELQQQhAgsgB0UgCUVyDQELIAcQ6wELIAVFIAhFcg0AIAUQ6wELIANBjAJqIAY2AgAgA0GIAmogBDYCACADIAE2AoQCIAMgAjYCgAIgA0HAAmpBkYvAAEEdIANBgAJqIgAQHCADQegBaiADQdgCaikDADcDACADQeABaiADQdACaikDADcDACADQdgBaiADQcgCaikDADcDACADIAMpA8ACNwPQASADQgA3AvQBIANBlI3AACgCADYC8AEgACADQfABakHYhcAAEMACIANB0AFqIAAQsQENAyADQTxqIANB+AFqKAIANgIAIAMgAykD8AE3AjQgA0EBNgIwIANB0AFqECggFkUgEkVyRQRAIBIQ6wELIA4EQCAOQQV0IQEgEUEUaiECA0ACQCACKAIARQ0AIAJBBGsoAgAiAEUNACAAEOsBCyACQSBqIQIgAUEgayIBDQALCyAQRSAQQQV0RXINACAREOsBCyATRSANRXJFBEAgDRDrAQsgFEUgC0VyDQAgCxDrAQsCQCADKAKMAUUNACADKAKIASIARQ0AIAAQ6wELAkAgAygCfEUNACADKAJ4IgBFDQAgABDrAQsgAygCbEUgD0VyDQAgDxDrAQsgA0G4AmogA0EwahAgIAMoArgCQQFHBEAgA0GIAmogA0HEAmooAgAiADYCACADIAMpArwCIhw3A4ACIANBwAJqIAA2AgAgAyAcNwO4AiADQbgCahCyAQJAIAMoAjBFBEAgA0EwakEEchAxDAELIANBOGooAgBFDQAgAygCNCIBRQ0AIAEQ6wELIANBwANqJAAPCyADQZgCaiADQdgCaikDADcDACADQZACaiADQdACaikDADcDACADQYgCaiADQcgCaikDADcDACADIANBwAJqKQMANwOAAkHIjMAAQSsgA0GAAmpB9IzAAEHYg8AAEK8CAAtB8IXAAEE3IANBuANqQbiMwABB9IbAABCvAgAL+RwCFH8EfiMAQZADayICJAAQ8AEgAkHwAGogABCzASACQYABaiABELMBIAJBqAJqIAIoAnAiDSACKAJ4EBUCQAJAAkACQAJAAkACQAJAAkAgAikDqAJCAVIEQCACQagBaiACQbgCaiISKQMANwMAIAJBmAFqIAJB0AJqKQMANwMAIAIgAikDsAI3A6ABIAIgAkHIAmoiEykDADcDkAEgAkHAAmoiFCgCACEKIAJBxAJqKAIAIQ8gAkHYAmooAgAhDiACQdwCaigCACEQIAJB4AJqKQMAIRYgAkGYAmoiASACKAKAASIAIAIoAogBELwBIAJBMGogARDDASACLQAwQQFxRQRAQQQhAQwHCyACLQAxQfsARwRAQQ4hAQwHCyACQZgCaiIBEL0BIAJBKGogARC7ASACLQAsIQUgAkEgaiACKAIoIgQQwwFBAiEBIAItACBBAXFFDQIgAkHgAWpBBHIhCyACQegBaiERIAJBwAFqQQRyIQwgAi0AISEGIAVBAXEhBQNAAkACQAJ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gAgAkHkAmpBnIDAADYCACACQbACaiACQagBaikDADcDACACQbwCaiAPNgIAIAJBwAJqIAIpA5ABNwMAIAJByAJqIAJBmAFqKQMANwMAIAJB2AJqIBY3AwAgAkHUAmogEDYCACACQfACaiACQYgDaiIBNgIAIAJB6AJqIAE2AgAgAiACKQOgATcDqAIgAiAKNgK4AiACIA42AtACIAIgATYC4AIgAkGAA2ogAygCADYCACACIAIpA7ABNwP4AiACQeABaiEDIAJBqAJqIQUgAkH4AmohBiMAQYABayIBJAAgAUHYAGogAkHgAmoiBCgCACILQfOOwABBBiAEKAIEIgwoAgwRBgACQAJAAkACQAJAIAEoAlgiB0UEQEEFQQEQSyIERQ0BIARBBGpBmI/AAC0AADoAACAEQZSPwAAoAAA2AAAgA0EQakKFgICA0AA3AwAgA0EMaiAENgIAIANBCGpBBzYCACADQQE2AgAMBAsgASgCXCEJIAFB2ABqIAcgAUHgAGoiCCgCABAfAkACQCABKAJYQQFHBEAgAUHQAGogAUH8AGooAgAiCDYCACABQRBqIAFB5ABqIgopAgA3AwAgAUEYaiABQewAaikCADcDACABQSBqIAFB9ABqKQIANwMAIAFBKGogCDYCACABIAEpAlw3AwggAUHYAGogBCgCCCAGKAIAIgggBkEIaigCACAEQQxqKAIAKAIMEQYAIAEoAlhBAUYNASABQThqIgQgCigCADYCACABIAEpAlw3AzACQCABKAIMRQ0AIAEoAggiCkUNACAKEOsBCyABQRBqIAQoAgA2AgAgASABKQMwNwMIIAFB2ABqIAFBCGoQJiABKAJYQQFGDQIgAUHgAGooAgAgC0HzjsAAQQYgASgCXCIEIAFB5ABqKAIAIAwoAhARBwBFIARFckUEQCAEEOsBCyADQQA2AgAgA0EoakEANgIAIANBIGpCADcCACADQRxqQYSNwAAoAgAiBDYCACADQRRqQgA3AgAgA0EQaiAENgIAIANBCGpCADcCACADQYyNwAAoAgA2AgQCQCABKAIMRQ0AIAEoAggiBEUNACAEEOsBCwJAIAFBGGooAgBFDQAgASgCFCIERQ0AIAQQ6wELA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MANwMAIAIgAikDsAI3A8ABIAJCADcCnAIgAkGUjcAAKAIANgKYAiACQeABaiIAIAJBmAJqQdiFwAAQwAIgAkHAAWogABCxAUUEQCACQcQAaiACQaACaigCADYCACACIAIpA5gCNwI8IAJBATYCOCACQcABahAoIAIoAoABIQAMBwsMCAtBBCEBCyACQcgAaiAHNgIAIAJBxABqIAY2AgAgAkFAayAFNgIAIAIgATYCPAsgCUUgCEVyDQELIAkQ6wELIAJByABqKAIAIQYgAkHEAGooAgAhBSACQUBrKAIAIQcgAigCPCEBCyACQewBaiAGNgIAIAJB6AFqIAU2AgAgAiAHNgLkASACIAE2AuABIAJBsAJqQZyKwABBGSACQeABaiIBEBwgAkHYAWogEykDADcDACACQdABaiAUKQMANwMAIAJByAFqIBIpAwA3AwAgAiACKQOwAjcDwAEgAkIANwKcAiACQZSNwAAoAgA2ApgCIAEgAkGYAmpB2IXAABDAAiACQcABaiABELEBDQIgAkHEAGogAkGgAmooAgA2AgAgAiACKQOYAjcCPCACQQE2AjggAkHAAWoQKCAPRSAKRXJFBEAgChDrAQsgEEUgDkVyDQAgDhDrAQsgAigChAFFIABFckUEQCAAEOsBCyACKAJ0RSANRXINACANEOsBCyACQagCaiACQThqECAgAigCqAJBAUcEQCACQegBaiACQbQCaigCACIANgIAIAIgAikCrAIiFjcD4AEgAkGwAmogADYCACACIBY3A6gCIAJBqAJqELIBAkAgAigCOEUEQCACQThqQQRyEDEMAQsgAkFAaygCAEUNACACKAI8IgFFDQAgARDrAQsgAkGQA2okAA8LIAJB+AFqIAJByAJqKQMANwMAIAJB8AFqIAJBwAJqKQMANwMAIAJB6AFqIAJBuAJqKQMANwMAIAIgAkGwAmopAwA3A+ABQciMwABBKyACQeABakH0jMAAQciDwAAQrwIAC0HwhcAAQTcgAkGIA2pBuIzAAEH0hsAAEK8CAAvwGwIXfwF+IwBB0AJrIgIkABDwASACQfgAaiAAELMBIAJBiAFqIAEQswEgAkGYAWogAigCeCIPIAIoAoABEBUCQAJAAkAC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AQsgAkGsAmooAgAhByACQagCaigCACEGIAIoAqQCIQQgBUUEQCADIQEMCQsgAyEBDAcLIAIgCRDDAUEAIQYgAi0AASEEIAItAABBAXENAAsMAwsgAkHMAGooAgAhByACQcgAaigCACEGIAIoAkQhBCADIQEMBwsgAkGIAmogAkG4AWopAwA3AwAgAkGAAmogAkGwAWopAwA3AwAgAkH4AWogAkGoAWopAwA3AwAgAiACKQOgATcD8AEgAkIANwLcASACQZSNwAAoAgA2AtgBIAJBoAJqIgAgAkHYAWpB2IXAABDAAiACQfABaiAAELEBRQRAIAJBzABqIAJB4AFqKAIANgIAIAIgAikD2AE3AkQgAkEBNgJAIAJB8AFqECggAigCiAEhAAwICwwJCyACQcwAaigCACEHIAJByABqKAIAIQYgAigCRCEEDAULIAVFDQIMAQtBBCEBIAVFDQELIAsEQCALQQV0IQggBUEUaiEDA0ACQCADKAIARQ0AIANBBGsoAgAiCUUNACAJEOsBCyADQSBqIQMgCEEgayIIDQALCyAMRSAMQQV0RXINACAFEOsBCyAKRSAORXINASAKEOsBDAELQQ4hAQsgAkHMAGoiAyAHNgIAIAJByABqIAY2AgAgAiAENgJEIAIgATYCQCACQaABakGGisAAQRYgAkFAaxAcIAJBiAJqIAJBuAFqKQMANwMAIAJBgAJqIBcpAwA3AwAgAkH4AWogAkGoAWopAwA3AwAgAiACKQOgATcD8AEgAkIANwKUAiACQZSNwAAoAgA2ApACIAJBoAJqIgEgAkGQAmpB2IXAABDAAiACQfABaiABELEBDQIgAyACQZgCaigCADYCACACIAIpA5ACNwJEIAJBATYCQCACQfABahAoIBRFIBFFckUEQCAREOsBCyATRSAQRXINACAQEOsBCyACKAKMAUUgAEVyRQRAIAAQ6wELIAIoAnxFIA9Fcg0AIA8Q6wELIAJBmAFqIAJBQGsQICACKAKYAUEBRwRAIAJBqAJqIAJBpAFqKAIAIgA2AgAgAiACKQKcASIZNwOgAiACQaABaiAANgIAIAIgGTcDmAEgAkGYAWoQsgECQCACKAJARQRAIAJBQGtBBHIQMQwBCyACQcgAaigCAEUNACACKAJEIgFFDQAgARDrAQsgAkHQAmokAA8LIAJBuAJqIAJBuAFqKQMANwMAIAJBsAJqIAJBsAFqKQMANwMAIAJBqAJqIAJBqAFqKQMANwMAIAIgAkGgAWopAwA3A6ACQciMwABBKyACQaACakH0jMAAQeiDwAAQrwIAC0HwhcAAQTcgAkHIAmpBuIzAAEH0hsAAEK8CAAvqwQECHX8EfiMAQZAHayIDJAAQ8AEgA0G4BGogABCzASADQcgEaiABELMBIANB2ARqIAIQswEgA0GYBmogAygCuAQiGiADKALABBAVAkACQAJAAkAgA0HEBWoCfwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADKQOYBkIBUgRAIANBgAVqIANBqAZqIgApAwA3AwAgA0HwBGogA0HABmopAwA3AwAgAyADKQOgBjcD+AQgAyADQbgGaiICKQMANwPoBCADQbAGaiIBKAIAIQkgA0G0BmooAgAhFSADQcgGaigCACEMIANBzAZqKAIAIREgA0HQBmopAwAhICADQZgGaiADKALIBCIdIAMoAtAEEB0gAygCmAZBAUYNAiABKAIAIQ4gA0GsBmooAgAhDyAAKAIAIRAgA0GkBmooAgAhFCADKAKgBiESIAMoApwGIRMgA0HwBWoiACADKALYBCIeIAMoAuAEELwBIANB+ANqIAAQwwFBACECIAMtAPgDQQFxDQFBBCEADBULIANBsAVqIANBuAZqKQMANwMAIANBqAVqIANBsAZqKQMANwMAIANBoAVqIANBqAZqKQMANwMAIAMgAykDoAY3A5gFIANCADcChAYgA0GUjcAAKAIANgKABiADQbgFaiIAIANBgAZqQdiFwAAQwAIgA0GYBWogABCxAQ0ZIANBjARqIANBiAZqKAIANgIAIAMgAykDgAY3AoQEIANBATYCgAQgA0GYBWoQKAwXCyADLQD5AyIAQfsARwRAIABBIkcEQEEKIQAMFQsgA0G4BWogA0HwBWoQQyADLQC4BUEBRg0CQQ4hAAwUCyADQfAFaiIEEL0BIANBuAVqIAQQQwJAAn8gAy0AuAVBAUcEQCADLQC5BSEBIANBuAVqIAQQwQEgAygCuAUiAEEVRwRAIANBwAVqKQMAISAgAygCvAUMAgsgAUEBaw4IDAsKCQgHBgUCCyADKAK8BSIAQQh2IQIgA0HEBWopAgAhICADQcAFaigCAAshASADICA3AoQGIAMgATYCgAYMFAsgA0EwaiAEEMMBIAMtADBBAXFFDREgAy0AMUH7AEcNECAEEL0BIANBKGogBBC7ASADLQAsIQggA0EgaiADKAIoIgEQwwEgAy0AIEEBcUUNDyADQYAEakEEciEHIANBuAVqQQRyIQsgAy0AISEAIAhBAXEhCANAAkACQAJAIABB/wFxIgZBLEcEQCAGQf0ARg0CIAhB/wFxDQFBCSEADBcLIAhB/wFxBEBBECEADBcLIAEQvQEgA0EYaiABEMMBIAMtABhBAXFFDRUgAy0AGSEACyAAQf8BcSINQSJHBEBBECEAIA1B/QBHDRZBEyEADBYLIANBCGogARDDASADLQAIQQFxRQ0UIAMtAAlBIkcNEyABEL0BIANBuAVqIAEQwgEgAygCxAUhCCADKALABSEGIAMoArwFIQAgAygCuAVBAUcEQCAGRSAARSAIRXJyDQIgBhDrAQwCCyAAQRVGDQEgAygCyAUhAgwVCyADQbgFaiAEEMABIAMoArgFIgBBFUcEQCADQcQFaigCACECIANBwAVqKAIAIQggAygCvAUhBgwVCyADQRBqIAQQwwEgAy0AEEEBcUUEQEEEIQAMFgtBCyEAIAMtABFB/QBHDRUgBBC9AUEAIQAMDAsgA0G4BWogARDBASADKAK4BSIAQRVHBEAgByALKQIANwIAIAdBCGogC0EIaigCADYCAAwQCyADQYAEaiABEBggAygCgAQiAEEVRw0PIAMgARDDAUEAIQggAy0AASEAIAMtAABBAXENAAsMDwsgA0GwBWogAikDADcDACADQagFaiABKQMANwMAIANBoAVqIAApAwA3AwAgAyADKQOgBjcDmAUgA0IANwKEBiADQZSNwAAoAgA2AoAGIANBuAVqIgAgA0GABmpB2IXAABDAAiADQZgFaiAAELEBRQRAIANBjARqIANBiAZqKAIANgIAIAMgAykDgAY3AoQ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BcSIIQSxHBEAgCEH9AEYNAyAGQf8BcQ0BQQkhAgwLCyABQf8BcQ0AIAsQvQEgA0HoAmogCxDDASADLQDoAkEBcUUNCSADLQDpAiEADAELQQAhBiADQQA6AJQGCyAAQf8BcSIHQSJHBEBBECECIAdB/QBHDQlBEyECDAkLIANB2AJqIAsQwwEgAy0A2AJBAXFFDQcgAy0A2QJBIkcEQEEOIQIMCQsgCxC9ASADQbgFaiALEMIBIAMoAsgFIQggAygCxAUhACADKALABSEBIAMoArwFIQcgAygCuAVBAUYEQCAHIQIMCQsCQCAHRQRAIABBBUcNAyABQfmTwABBBRDgAkEARyEHDAELQQEhByAIQQVGBEAgAUH5k8AAQQUQ4AJBAEchBwsgAEUgAUVyDQAgARDrAQsgBw0BIAUNAyADQbgFaiADQZAGahAbIAMoArgFQQFGDQIgAygCvAUhCkEBIQUMBQsgBQ0DIANBuAVqQQRyQfmTwABBBRAWIANBjARqIANBxAVqKQIANwIAIAMgAykCvAU3AoQEDAgLIANBuAVqIAsQwQECQCADKAK4BSIAQRVHBEAgDSAWKQIANwIAIA1BCGogFkEIaigCADYCACADIAA2ApgFDAELIANBmAVqIAsQGCADKAKYBUEVRg0ECyADQYwEaiADQaAFaikDADcCACADIAMpA5gFNwKEBAwHCyADQYwEaiADQcQFaikCADcCACADIAMpArwFNwKEBAwGCyADQYAEakEEckH5k8AAQQUQFwwFCyADQbgFaiAEEMABIAMoArgFIgBBFUcEQCADQcQFaigCACECIAMpArwFISAMBgsgA0HgAmogBBDDAUEAIQIgAy0A4AJBAXFFBEBBBCEADBULQQshACADLQDhAkH9AEcNFCAEEL0BIAMgCjYCgAZBBiEADAsLIANB0AJqIAsQwwFBACEBIAMtANECIQAgAy0A0AJBAXENAAsMAQtBBCECCyADQZAEaiAINgIAIANBjARqIAA2AgAgA0GIBGogATYCACADIAI2AoQECyADQYgEaikDACEgIANBkARqKAIAIQIgAygChAQhAAsgAyACNgKIBiADICA3A4AGIABBCHYhAgwOCyADQcgCaiAE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UUNByAKQQFGDQYgA0G4BWpBBHJBt5TAAEEJEBYgA0HIBWooAgAhBiADQcQFaigCACEIIANBwAVqKAIADAgLIAIpAABC7cq1+7Xs27n0AFINCgsgBQ0CIANBuAVqIANBmAVqEBsgAygCvAUhCyADKAK4BUEBRg0DQQEhBQwKCyACQbeUwABBCRDgAg0ICwJAIApBAUcEQCADQbgFaiADQZgFahAbIAMoArwFIQ0gAygCuAVBAUYNAUEBIQoMCgsgA0G4BWpBt5TAAEEJEBcMBwsgA0HIBWooAgAhBiADQcQFaigCACEIIANBwAVqKAIAIQIgDSEADA0LIANBuAVqQa+UwABBCBAXDAULIANByAVqKAIAIQYgA0HEBWooAgAhCCADQcAFaigCACECIAshAAwLCyADQbgFaiAEEMABIAMoArgFIgBBFUcEQCADQcQFaigCACEGIANBwAVqKAIAIQggAygCvAUhAgwLCyADQcgAaiAEEMMBQQAhAiADLQBIQQFxDQJBBCEADBALIANBuAVqQQRyQa+UwABBCBAWIANByAVqKAIAIQYgA0HEBWooAgAhCCADQcAFaigCAAshAiADKAK8BSEADAgLQQshACADLQBJQf0ARw0NIAQQvQEgAyANNgKEBiADIAs2AoAGQQEhAAwECyADQcQFaigCACEGIANBwAVqKAIAIQggAygCvAUhAiADKAK4BSEADAYLIANBuAVqIAEQwQECQCADKAK4BSIAQRVHBEAgFiAXKQIANwIAIBZBCGogF0EIaigCADYCAAwBCyADQYAEaiABEBggAygCgAQiAEEVRg0BCyADQYwEaigCACEGIANBiARqKAIAIQggAygChAQhAgwFCyADQThqIAEQwwFBACEAIAMtADkhAiADLQA4QQFxDQALDAILIAM1AoQGISEgAzUCgAYhIiADQbgFaiADQfAFahC+ASADKAK4BSICQRVHBEAgAykCvAUhICADQcQFaigCAAwKCyADICFCIIYgIoQ3A6AGIANBkAVqIgEgA0GkBmooAgA2AgAgAyAANgKcBiADIAMpApwGNwOIBSADQeQGakHkgMAANgIAIANB3AZqQbSAwAA2AgAgA0HUBmpBnIDAADYCACADQaAGaiADQYAFaikDADcDACADQawGaiAVNgIAIANBsAZqIAMpA+gENwMAIANBuAZqIANB8ARqKQMANwMAIANB/AZqIA42AgAgA0H4BmogDzYCACADQfQGaiAQNgIAIANB8AZqIBQ2AgAgA0HsBmogEjYCACADQcgGaiAgNwMAIANBxAZqIBE2AgAgA0HgBmogA0HwBWoiADYCACADQdgGaiAANgIAIAMgAykD+AQ3A5gGIAMgCTYCqAYgAyATNgLoBiADIAw2AsAGIAMgADYC0AYgA0GIB2ogASgCADYCACADIAMpA4gFNwOAByADQbgFaiEKIANB0AZqIQAgA0GYBmohECADQegGaiETIwBBwAJrIgQkAAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADQYAHaiIBKAIAQQFrDggBAgMEBQYHCAALIARBGGogAEEQaikCADcDACAEQRBqIABBCGopAgA3AwAgBCAAKQIAIiA3AwggEEEUaigCACEJIBBBLGooAgAhFSAQQTBqKQMAISEgE0EQaigCACECIBNBFGooAgAhBiAQKAIQIQcgECgCKCEFIBMoAgAhASATKAIEIQ4gEygCCCEAIBMoAgwhDSAEQdABaiAgp0HzjsAAQQYgBCgCDCgCDBEGACAEKALQASIPRQRAQQVBARBLIgBFDRkgAEEEakGYj8AALQAAOgAAIABBlI/AACgAADYAACAKQRBqQoWAgIDQADcDACAKQQxqIAA2AgAgCkEIakEHNgIAIApBATYCACAORSABRXJFBEAgARDrAQsgBgRAIAZBBXQhDyANQRRqIQADQAJAIAAoAgBFDQAgAEEEaygCACIBRQ0AIAEQ6wELIABBIGohACAPQSBrIg8NAAsLIAJFIAJBBXRFckUEQCANEOsBCyAJRSAHRXINHiAHEOsBDB4LIAQoAtQBIRAgBEHQAWogDyAEQdgBaigCABAfQQEhCwJAIAQoAtABQQFHBEAgBEHwAWooAgAhEyAEQewBaigCACEIIARB5AFqKAIAIRYgBEHgAWooAgAhESAEQdgBaigCACEXIAQoAtQBIQsgBEHcAWooAgAgAEY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ASAFKAIEIQYgDEEIaiEMIAFBAWohASAFKAKcASECDAALAAsCQCAFKAK4ASIMIAUoArwBIgJGDQAgBSAMQQRqNgK4AQNAIAwoAgAiAARAIAAgACgCACIBQQFrNgIAIAUgADYCrAEgAUEBRgRAIAVBrAFqEE8LIAUoArgBIgwgBSgCvAEiAkYNAiAFIAxBBGo2ArgBDAELCyAMQQRqIgEgAkYNAANAIAUgAUEEajYCuAEgASgCACIARQ0BIAAgACgCACIBQQFrNgIAIAUgADYCrAEgAUEBRgRAIAVBrAFqEE8LIAUoArgBIgEgBSgCvAFHDQALCyAFKAK0ASIARQ0LIAUoArABIgIgBSgCwAEiBkEIaiIHKAIAIgFGDQogBigCACIGIAFBAnRqIAYgAkECdGogAEECdBDeAgwKC0EIQQQQkgIACyAFIBc6ALQBIAUgEjYCsAFBvJzAAEErIAVBsAFqQeicwABB4JjAABCvAgALIAVBxAFqQQA2AgAgBUHAAWpBrJnAADYCACAFQgE3ArQBIAVBpJnAADYCsAEgBUEoaiAFQbABahBQAAtBFEEEEJICAAtBFEEEEJICAAsgBUGgAWogBUE0aikCADcDACAFIAUpAiw3A5gBQYybwABBLyAFQZgBakGcnMAAQbybwAAQrwIAC0EkQQQQkgIACwALQQxBBBCSAgALQRhBBBCSAgALIAcgACABajYCAAsgBSgCmAEhAiAFKAKcASEMIAUoAqABDAILIAcgACABajYCAAsgDSECQQALIQACQCAXDQBBxLPBACgCAEH/////B3FFDQAQ4AENACASQQE6AAELIBJBADoAAAJAAkAgAARAQQxBBBBLIgZFDQEgBiAANgIIIAYgDDYCBCAGIAI2AgAMAgtBACEGIAxBA3RFIAxFIAJFcnINASACEOsBDAELQQxBBBCSAgALIAUoApABIgAgACgCACIAQQFrNgIAIABBAUYEQCAFQZABahBVCyARQQFqIREgBgRAIAYoAgAhASAGKAIIIgAEQCABIABBA3RqIQADQCABKAIAIAFBBGoiAigCACgCABEEACACKAIAIgIoAgQEQCACKAIIGiABKAIAEOsBCyABQQhqIgEgAEcNA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EgAkEIdHIhAiADKQOABiEgIAMoAogGCzYCACADICA3ArwFIAMgAjYCuAUgA0GgBmpB7YnAAEEZIANBuAVqIgAQHCADQbAFaiADQbgGaikDADcDACADQagFaiADQbAGaikDADcDACADQaAFaiADQagGaikDADcDACADIAMpA6AGNwOYBSADQgA3AoQGIANBlI3AACgCADYCgAYgACADQYAGakHYhcAAEMACIANBmAVqIAAQsQENAyADQYwEaiADQYgGaigCADYCACADIAMpA4AGNwKEBCADQQE2AoAEIANBmAVqECggEkUgE0VyRQRAIBMQ6wELIA4EQCAOQQV0IQEgEEEUaiECA0ACQCACKAIARQ0AIAJBBGsoAgAiAEUNACAAEOsBCyACQSBqIQIgAUEgayIBDQALCyAPRSAPQQV0RXINACAQEOsBCyAVRSAJRXJFBEAgCRDrAQsgEUUgDEVyDQAgDBDrAQsCQCADKALcBEUNACADKALYBCIARQ0AIAAQ6wELAkAgAygCzARFDQAgAygCyAQiAEUNACAAEOsBCyADKAK8BEUgGkVyDQAgGhDrAQsgA0GYBmogA0GABGoQICADKAKYBkEBRwRAIANBwAVqIANBpAZqKAIAIgA2AgAgAyADKQKcBiIgNwO4BSADQaAGaiAANgIAIAMgIDcDmAYgA0GYBmoQsgECQCADKAKABEUEQCADQYAEakEEchAxDAELIANBiARqKAIARQ0AIAMoAoQEIgFFDQAgARDrAQsgA0GQB2okAA8LIANB0AVqIANBuAZqKQMANwMAIANByAVqIANBsAZqKQMANwMAIANBwAVqIANBqAZqKQMANwMAIAMgA0GgBmopAwA3A7gFQciMwABBKyADQbgFakH0jMAAQbiDwAAQrwIAC0HwhcAAQTcgA0HwBWpBuIzAAEH0hsAAEK8CAAvTdwIYfwR+IwBBsARrIgMkABDwASADQfgBaiAAELMBIANBiAJqIAEQswEgA0HwAmogAygC+AEiFCADKAKAAhAVAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADKQPwAkIBUgRAIANBsAJqIANBgANqKQMANwMAIANBoAJqIANBm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ADcCACACQQhqIAdBCGooAgA2AgAMDwsgA0HQA2ogBBAYIAMoAtADIgFBFUcNDiADIAQQwwFBACEGIAMtAAEhASADLQAAQQFxDQALDA4LIANB6ANqIANBkANqKQMANwMAIANB4ANqIANBiANqKQMANwMAIANB2ANqIANBgANqKQMANwMAIAMgAykD+AI3A9ADIANCADcC/AMgA0GUjcAAKAIANgL4AyADQcgCaiIAIANB+ANqQdiFwAAQwAIgA0HQA2ogABCxAUUEQCADQfQBaiADQYAEaigCADYCACADIAMpA/gDNwLsASADQQE2AugBIANB0ANqECggAygCiAIhAAwVCwwWCyADLwDNAiADLQDPAkEQdHIhCSADQdQCaikCACEaIANB0AJqKAIAIQYgAy0AzAIhAQwRCyADQdgBaiAIEMMBAkACQCADLQDYAUEBcUUNAAJAIAMtANkBQfsARw0AIAgQvQEgA0HQAWogCBC7ASADLQDUASEGIANByAFqIAMoAtABIgQQwwECQCADLQDIAUEBcUUNACADQdADakEEciECIANByAJqQQRyIQcgAy0AyQEhASAGQQFxIQYCQANAAkACQAJAIAFB/wFxIgVBLEcEQCAFQf0ARg0CIAZB/wFxDQFBCSEBDAkLIAZB/wFxBEBBECEBDAkLIAQQvQEgA0HAAWogBBDDASADLQDAAUEBcUUNByADLQDBASEBCyABQf8BcSILQSJHBEBBECEBIAtB/QBHDQhBEyEBDAgLIANBsAFqIAQQwwEgAy0AsAFBAXFFDQYgAy0AsQFBIkcNBSAEEL0BIANByAJqIAQQwgEgAygC1AIhBSADKALQAiEGIAMoAswCIQEgAygCyAJBAUcEQCAGRSABRSAFRXJyDQIgBhDrAQwCCyABQRVGDQEgAygC2AIhCAwHCyADQcgCaiAIEMABIAMoAsgCIgFBFUcEQCADQdQCaigCACEIIANB0AJqKAIAIQUgAygCzAIhBgwHCyADQbgBaiAIEMMBIAMtALgBQQFxRQ0WIAMtALkBQf0ARw0QIAgQvQFBAyEGQQAhAQwJCyADQcgCaiAEEMEBIAMoAsgCIgFBFUcEQCACIAcpAgA3AgAgAkEI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moiBCAbNwMAIAMgCzYC+AIgAyAGNgL0AiADIAMpAvQCNwO4AiADQbwDakHkgMAANgIAIANBtANqQbSAwAA2AgAgA0GsA2pBnIDAADYCACADQfgCaiADQbACaikDADcDACADQYQDaiAPNgIAIANBiANqIAMpA5gCNwMAIANBkANqIANBoAJqKQMANwMAIANBoANqIBo3AwAgA0GcA2ogEjYCACADQbgDaiADQagEaiIBNgIAIANBsANqIAE2AgAgAyADKQOoAjcD8AIgAyARNgKAAyADIAo2ApgDIAMgATYCqAMgA0HIA2ogBCkDADcDACADIAMpA7gCNwPAAyADQagDaiEBIANB8AJqIQ5BACEEQQAhCUEAIQ1BACEMIwBB0ARrIgIkAAJAAkACQAJAAkAgAgJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgA0HIAmoiCAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCADQcADaiILKAIAQQFrDgMDAQIACyACQbgDaiABKAIAQfOOwABBBiABKAIEKAIMEQYAIAIoArgDIgtFBEBBBSEHQQVBARBLIgENBUEFQQEQkgIACyACKAK8AyEFIAJBuANqIAsgAkHAA2oiESgCABAfIAIoArgDQQFHBEAgAkHYA2ooAgAgAkHUA2ooAgAhBCACQcwDaigCACACQcgDaigCACEGIAIoArwDIQEgAiARKQMANwK8AyACIAE2ArgDIAJByAJqIAJBuANqEJwBIAIoAsgCIQEgAigCzAIhByACKALQAiEMRSAGRXJFBEAgBhDrAQtFIARFckUEQCAEEOsBCyAFBEAgCxDrAQsgAiAMNgLoASACIAc2AuQBIAIgATYC4AEgAkG4AWoiBBDIASACQbgDaiAEEM8BIAIoArgDQQFGDQ4gAiACKAK8AzYCkAEgAiACQcADai0AADoAlAEgAkG4A2ogAkGQAWpBjJPAAEEIIAJB4AFqEBMgAigCuANBAUcNBCACQdQCaiACQcQDaigCADYCACACIAIpArwDNwLMAgwQCyACQdwDaigCACENIAJB2ANqKAIAIQkgAkHUA2ooAgAhDCACQd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AIQcgAUEANgIICyABIAdqQQxqQYABOgAAAkACQCABKAIIIhBBAWoiByAQTwRAIAEgBzYCCAJAIAdBwQBJBEAgASAHakEMakEAQcAAIAdrEN8CGkHAACABKAIIayIHQcEATw0BIAdBCEkEQCAPIApBARDXASABKAIIIgdBwQBPDQQgAUEMakEAIAcQ3wIaCyABQcQAaiAaQiiGQoCAgICAgMD/AIMgGkI4hoQgGkIYhkKAgICAgOA/gyAaQgiGQoCAgIDwH4OEhCAaQgiIQoCAgPgPgyAaQhiIQoCA/AeDhCAaQiiIQoD+A4MgGkI4iISEhDcCACAPIApBARDXASABQQA2AggMBAsgB0HAAEHE/8AAEJoCAAtBwIDBAEEhQeSAwQAQnQIAC0Gw/sAAQRxBtP/AABCdAgALIAdBwABB1P/AABCbAgALIAJB4AFqIgcgASgCTCIKQRh0IApBCHRBgID8B3FyIApBCHZBgP4DcSAKQRh2cnI2AAAgByABQegAaigCACIKQRh0IApBCHRBgID8B3FyIApBCHZBgP4DcSAKQRh2cnI2ABwgByABQeQAaigCACIKQRh0IApBCHRBgID8B3FyIApBCHZBgP4DcSAKQRh2cnI2ABggByABQeAAaigCACIKQRh0IApBCHRBgID8B3FyIApBCHZBgP4DcSAKQRh2cnI2ABQgByABQdwAaigCACIKQRh0IApBCHRBgID8B3FyIApBCHZBgP4DcSAKQRh2cnI2ABAgByABQdgAaigCACIKQRh0IApBCHRBgID8B3FyIApBCHZBgP4DcSAKQRh2cnI2AAwgByABQdQAaigCACIKQRh0IApBCHRBgID8B3FyIApBCHZBgP4DcSAKQRh2cnI2AAggByABQdAAaigCACIBQRh0IAFBCHRBgID8B3FyIAFBCHZBgP4DcSABQRh2cnI2AARBIEEBEEsiAUUNByABIAIpA+ABNwAAIAFBGGogDSkDADcAACABQRBqIAkpAwA3AAAgAUEIaiAMKQMANwAAIAVFIAtFckUEQCALEOsBC0EgIQdBICEFIARBAWsiBA0ACyACIAE2AqgCCyACIAU2AqwCIAIgBzYCsAIgEUUEQCACQcADaiACQbACaigCADYCACACIAIpA6gCNwO4AyACQcgCaiACQbgDahCcASACQcQBaiACQdACaigCADYCACACQQA2ArgBIAIgAikDyAI3ArwBIBNFIBJFcg0oIBIQ6wEMKAsgAiAXNgLAAyACIBM2ArwDIAIgEjYCuAMgAkG4AmogAkG4A2oQnAEgAkHABGoiARDIASACQYgCaiABQZeVwABBBxDQASACKAKIAkEBRg0GIAIgAigCjAI2ArgEIAIgAkGQAmotAAA6ALwEIAJBiAJqIAJBuARqQZ6VwABBBSARQQFrEBQgAigCiAJBAUYNByACQYgCaiACQbgEakGjlcAAQQQgBhAUIAIoAogCQQFGBEAgAkH0AGogAkGUAmooAgA2AgAgAiACKQKMAjcCbAwnCyACQegAaiACKAK4BCACLQC8BBDHASACKAJoQQFGDSYgAkHoAWogAkHIBGooAgAiATYCACACQcgAaiACKQO4AjcDACACQdAAaiACQcACaigCADYCACACQdQAaiACKQPABCIaNwIAIAJB3ABqIAE2AgAgAiAaNwPgASACQQA2AkQgAkECNgJAIAJBuANqIAJBQGsQJSACKAK4A0EBRwRAIAJBwANqKAIAIRMgAkG4A2ogFiACKAK8AyIPIAJBxANqIgQoAgAgFSgCDBEGAAJAAkAgAigCuANBAUcEQCACKAK8A0EBRg0CIAJByARqIAJByANqKAIANgIAIAIgAkHAA2opAwA3A8AEIAJBOGogAkHABGoQnwEgAkHoAGoiASACKAI4IAIoAjwQvAEgAkEwaiABEMMBIAItADBBAXENAUEEIQcMJgsgAkHgAmogAkHUA2ooAgA2AgAgAkHYAmogAkHMA2opAgA3AwAgAkHQAmoiASAEKQIANwMAIAIgAikCvAM3A8gCIAJB9AFqQQE2AgAgAkIBNwLkASACQciCwAA2AuABIAJBBDYCbCACIAJB6ABqNgLwASACIAJByAJqNgJoIAJBiAJqIAJB4AFqEJQCIAJBwAFqQQM2AgAgAkHEAWogAikDiAI3AgAgAkHMAWogAkGQAmooAgA2AgAgAkEBNgK4AQJAAkACQAJAIAIoAsgCDgQBAgMrAAsgASgCAEUNK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IAIoAsgCIgRBFUcNECACQQhqIAsQwwEgAi0ACEEBcUUNASACLQAJQSJHDQ4gCxC9ASACQcgCaiALEMIBIAIoAtgCIQkgAigC1AIhBiACKALQAiEEIAIoAswCIQwgAigCyAJBAUYNDwJAIAxFBEAgAkHgAWogBCAGED8MAQsgAkHgAWogBCAJED8gBkUgBEVyDQAgBBDrAQsgAigC4AFBAUYNIiACKALsASESIAIoAugBIREgAigC5AEhBAsgAiALEMMBQQAhCSACLQABIQ0gAi0AAEEBcQ0BDCMLCyACQQQ2AuQBDB8LIAJByAJqIAJB6ABqEMABIAIoAsgCIgdBFUcEQCACQdQCaigCACENIAJB0AJqKAIAIQkgAigCzAIhDCARRQ0lIAQQ6wEMJQsgAkHIAmogAkHoAGoQvgEgAigCyAIiB0EVRg0NIAJB1AJqKAIAIQ0gAkHQAmooAgAhCSACKALMAiEMIBFFDSQgBBDrAQwkCyACQegBaiACQcgDaigCADYCACACIAJBwANqKQMANwPgASACQdwCakEBNgIAIAJCATcCzAIgAkHogsAANgLIAiACQQU2AmwgAiACQegAajYC2AIgAiACQeABajYCaCACQYgCaiACQcgCahCUAiACQcABakEDNgIAIAJBxAFqIAIpA4gCNwIAIAJBzAFqIAJBkAJqKAIANgIAIAJBATYCuAEgAigC5AFFDSUgAigC4AEiAUUNJSABEOsBDCULIAJB4AJqIAJB2ANqKQMANwMAIAJB2AJqIAJB0ANqKQMANwMAIAJB0AJqIAJByANqKQMANwMAIAIgAkHAA2opAwA3A8gCIAJB9AFqQQE2AgAgAkIBNwLkASACQYyDwAA2AuABIAJBAzYCjAIgAiACQYgCajYC8AEgAiACQcgCaiIBNgKIAiACQagEaiACQeABahCUAiABECggAkHAAWpBAzYCACACQcgBaiACKQKsBDcDACACQcQBaiACKAKoBDYCACACQQE2ArgBDCULIAJBuAFqIgEQyAEgAkG4A2ogARDPASACKAK4A0EBRwRAIAIoArwDIQEgAkHAA2otAAAEQCABQQhqKAIAIQUMGAsgASgCCCIEIAFBBGooAgBGBEAgASAEQQEQDyABKAIIIQQLIAEgBEEBaiIFNgIIIAEoAgAgBGpBLDoAAAwXCyACQdQCaiACQbgDakEEciIBQQhqKAIANgIAIAIgASkCADcCzAIMFwsgAkH4AGoiBCABQRBqKQIANwMAIAJB8ABqIAFBCGopAgA3AwAgAiABKQIANwNoIAJBkAJqIAspAgQ3AwAgAkGYAmogC0EMaigCADYCACACQoCAgIAQNwOIAiACQbgDaiAEIAJBiAJqECcgAigCuANBAUYNEiACQegBaiIBIAJBxANqKAIANgIAIAIgAikCvAM3A+ABIAJBiAJqEDIgAkGYAWogASgCACIBNgIAIAJByABqIAE2AgAgAkHIBGogATYCACACIAIpA+ABIho3A0AgAiAaNwPABCACQbgBaiIBEMgBIAJBuANqIAEQzwEgAigCuANBAUcEQCACKAK8AyEBIAJBwANqLQAABEAgAUEIaigCACEFDBALIAEoAggiBCABQQRqKAIARgRAIAEgBEEBEA8gASgCCCEECyABIARBAWoiBTYCCCABKAIAIARqQSw6AAAMDwsgAkHUAmogAkG4A2pBBHIiAUEIaigCADYCACACIAEpAgA3AswCDA8LIAJByAJqIAIoApABIAItAJQBEMYBIAIoAsgCQQFHDQoMCwsgAUEEakGYj8AALQAAOgAAIAFBlI/AACgAADYAAEEHIRFBBSEGCyAIQQE2AgAgCEEkaiANNgIAIAhBIGogCTYCACAIQRxqIAw2AgAgCEEYaiAENgIAIAhBFGogBzYCACAIQRBqIAY2AgAgCEEMaiABNgIAIAhBCGogETYCAAwQC0EgQQEQkgIACyACQfQAaiACQZQCaigCADYCACACIAIpAowCNwJsDB8LIAJB9ABqIAJBlAJqKAIANgIAIAIgAikCjAI3AmwMHgsgAkEONgLkAQwTCyACIAk2AvABIAIgBjYC7AEgAiAENgLoASACIAw2AuQBDBILIBAgCikCADcCACAQQQhqIApBCGooAgA2AgAgAiAENgLkAQwRCyACQcQBaiASNgIAIAJBwAFqIBE2AgAgAiAENgK8AUEADBcLIAJB1AJqIAJBuANqQQRyIgRBCGooAgA2AgAgAi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ogGjcCACAIQRhqIBs3AgAgCEEQaiAcNwIAIAhBCGogHTcCACAIQQE2AgAgDkEUaigCAEUNASAOQRBqKAIAIgFFDQEgARDrAQwBCyACQZgBaiACQcQBaigCACIBNgIAIAJBiAFqIAE2AgAgAiACKQK8ASIaNwOQASACIBo3A4ABIAJB4AFqIgEQyAEgAkG4A2ogARDPAQJAAkACQAJAIAIoArgDQQFHBEAgAigCvAMhASACQcADai0AAARAIAFBCGooAgAhBQwCCyABKAIIIgQgAUEEaigCAEYEQCABIARBARAPIAEoAgghBAsgASAEQQFqIgU2AgggASgCACAEakEsOgAADAELIAJB1AJqIAJBuANqQQRyIgFBCGooAgA2AgAgAiABKQIANwLMAgwBCyABQQRqIgYoAgAgBUYEQCABIAVBARAPIAFBCGooAgAhBQsgASgCACAFakEiOgAAIAFBCGoiBCAFQQFqIgU2AgAgBigCACAFa0EFTQRAIAEgBUEGEA8gBCgCACEFCyABKAIAIAVqIgZB85XAACgAADYAACAGQQRqQfeVwAAvAAA7AAAgBCAFQQZqIgU2AgAgAUEEaigCACAFa0EBTQRAIAEgBUECEA8gAUEIaigCACEFCyABKAIAIAVqQaL0ADsAACABQQhqIAVBAmo2AgAgAkG4AWogAkGAAWoQngEgAkG4A2ogASACKAK4ASIEIAIoAsABEMsBIAIoArwBRSAERXJFBEAgBBDrAQsgAigCuANBAUYEQCACQdQCaiACQcQDaigCADYCACACIAIpArwDNwLMAgwBC0EAIQUgAkHIAmogAUEAEMYBIAIoAsgCQQFHDQELIAJBkAJqIgEgAkHUAmooAgA2AgAgAiACKQLMAjcDiAICQCACKALkAUUNACACKALgASIERQ0AIAQQ6wELIAJB0AJqIAEoAgA2AgAgAiACKQOIAjcDyAIgAkHAA2oiAUGSiMAAQR4gAkHIAmoQJCAIQSBqIAJB2ANqKQMANwMAIAhBGGogAkHQA2opAwA3AwAgCEEQaiACQcgDaikDADcDACAIQQhqIAEpAwA3AwBBASEFDAELIAJBxANqIAJB6AFqKAIAIgE2AgAgAiACK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2IXAABDAAiADQdADaiABELEBDQIgA0H0AWogA0GABGooAgA2AgAgAyADKQP4AzcC7AEgA0EBNgLoASADQdADahAoIA9FIBFFckUEQCAREOsBCyASRSAKRXINACAKEOsBCyADKAKMAkUgAEVyRQRAIAAQ6wELIAMoAvwBRSAURXJFBEAgFBDrAQtBASEBCyADQfgDahDIASADQegBakEEciEEAkACQAJAIAFFBEAgAygCgAQiACADKAL8A0YEQCADQfgDaiAAQQEQDyADKAKABCEACyADKAL4AyAAakH7ADoAACADIABBAWo2AoAEIANB8AJqIANB+ANqQaGFwABBAhDLASADKALwAkEBRg0BIAMoAoAEIgAgAygC/ANGBEAgA0H4A2ogAEEBEA8gAygCgAQhAAsgAygC+AMgAGpBOjoAACADIABBAWo2AoAEIANB0ANqIAQQngEgA0HwAmogA0H4A2ogAygC0AMiACADKALYAxDLASADKALUA0UgAEVyRQRAIAAQ6wELIAMoAvACQQFHBEAgAygCgAQiASADKAL8A0YEQCADQfgDaiABQQEQDyADKAKABCEBCyADKAL4AyABakH9ADoAACADIAFBAWo2AoAEDAQLIANB1AJqIANB/AJqKAIANgIAIAMgAykC9AI3AswCDAILIANByAJqIANB+ANqIAQQISADKALIAkEBRw0CDAELIANB1AJqIANB/AJqKAIANgIAIAMgAykC9AI3AswCCyADQcACaiIAIANB1AJqKAIANgIAIAMgAykCzAI3A7gCAkAgAygC/ANFDQAgAygC+AMiAUUNACABEOsBCyADQdACaiIBIAAoAgA2AgAgAyADKQO4AjcDyAIgA0H4AmoiAEHhiMAAQdQAIANByAJqIgQQJCADQeACaiADQZADaikDADcDACADQdgCaiADQYgDaikDADcDACABIANBgANqKQMANwMAIAMgACkDADcDyAJByIzAAEErIARB9IzAAEH4g8AAEK8CAAsgA0HYA2ogA0GABGooAgAiADYCACADIAMpA/gDIho3A9ADIANB+AJqIAA2AgAgAyAaNwPwAiADQfACahCyAQJAIANB8AFqKAIARQ0AIAMoAuwBIgFFDQAgARDrAQsgA0GwBGokAA8LQfCFwABBNyAD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AgsgByAGQdixwAAQmwIAC0HwrsAAQSFByLHAABCdAgALIAkgAkEIaiICRw0ACwsgBUHoAWohAiMAQUBqIgMkACADQThqIAVBEGoiBEE4aikDADcDACADQTBqIARBMGopAwA3AwAgA0EoaiAEQShqKQMANwMAIANBIGogBEEgaikDADcDACADQRhqIARBGGopAwA3AwAgA0EQaiAEQRBqKQMANwMAIANBCGogBEEIaikDADcDACADIAQpAwA3AwAgBC0A0AEiBkGBAU8EQCAGQYABQeixwAAQmwIACyAEQdAAaiAGIAMgBCkDQCAEQcgAaikDACAELQDRAUEAEG4gAiAELQDSAToAQCACIAMpAzg3ADggAiADKQMwNwAwIAIgAykDKDcAKCACIAMpAyA3ACAgAiADKQMYNwAYIAIgAykDEDcAECACIAMpAwg3AAggAiADKQMANwAAIANBQGskACAFQQhqIQMgAi0AQCIEQcEATwRAIARBwABB+LHAABCbAgALIAMgBDYCBCADIAI2AgAgBSgCDCICIAFHDQEgACAFKAIIIAEQ3QIaIAVBsANqJAAPCyAFQSRqQQE2AgAgBUIBNwIUIAVBwJbAADYCECAFQSQ2AqwDIAUgBUGoA2o2AiAgBSAFQaQDajYCqAMgBUEQakGgl8AAEKECAAsgASACQdShwAAQzgIAC9sFAQ5/IwBBoAFrIgQkAAJAAkACQAJAIAFBwQBPBEAgBEFAayIJQgA3AwAgBEE4aiIKQgA3AwAgBEEwaiILQgA3AwBBICEFIARBKGpCADcDACAEQSBqIgZCADcDACAEQRhqIgdCADcDACAEQRBqIghCADcDACAEQgA3AwggBEGAAWoiDEIANwMAIARB+ABqIg1CADcDACAEQfAAaiIOQgA3AwAgBEHoAGpCADcDACAEQeAAaiIPQgA3AwAgBEHYAGoiEEIANwMAIARB0ABqIhFCADcDACAEQgA3A0ggBEGUAWogAzYCACAEIAI2ApABIARBBDYCjAEgBCAEQZwBajYCiAEgBCABNgKcASAEQQhqQcAAIARBiAFqQQIQZiAAQRhqIAYpAwA3AAAgAEEQaiAHKQMANwAAIABBCGogCCkDADcAACAA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QgGGQv7///8fg358IgQgAEEgaiIbKQMAIgogACkDACIFfCAKQv////8PgyAFQgGGQv7///8fg358IgUgAEHgAGoiHCkDAIVCIIkiDSAAQUBrIh0pAwAiC3wgDUL/////D4MgC0IBhkL+////H4N+fCILIAqFQiiJIgogBXwgCkL/////D4MgBUIBhkL+////H4N+fCIFIA2FQjCJIg0gC3wgDUL/////D4MgC0IBhkL+////H4N+fCILIAqFQgGJIgp8IARCAYZC/v///x+DIApC/////w+DfnwiDiAAQTBqIh4pAwAiBiAAQRBqIh8pAwAiCXwgBkL/////D4MgCUIBhkL+////H4N+fCIJIABB8ABqIiApAwCFQiCJIg8gAEHQAGoiISkDACITfCAPQv////8PgyATQgGGQv7///8fg358IhMgBoVCKIkiBiAJfCAGQv////8PgyAJQgGGQv7///8fg358IgkgD4VCMIkiD4VCIIkiFSAAQShqIiIpAwAiFCAAQQhqIiMpAwAiEHwgFEL/////D4MgEEIBhkL+////H4N+fCIQIABB6ABqIiQpAwCFQiCJIhEgAEHIAGoiJSkDACISfCARQv////8PgyASQgGGQv7///8fg358IhIgFIVCKIkiFCAQfCAUQv////8PgyAQQgGGQv7///8fg358IhAgEYVCMIkiESASfCARQv////8PgyASQgGGQv7///8fg358IhJ8IBVC/////w+DIBJCAYZC/v///x+DfnwiFiAKhUIoiSIKIA58IApC/////w+DIA5CAYZC/v///x+DfnwiFzcDACAfIAcgBCAMhUIwiSIHIAh8IAdC/////w+DIAhCAYZC/v///x+DfnwiBIVCAYkiDCAJfCAMQv////8PgyAJQgGGQv7///8fg358IgggEYVCIIkiDiALfCAOQv////8PgyALQgGGQv7///8fg358IgsgDIVCKIkiDCAIfCAMQv////8PgyAIQgGGQv7///8fg358IhE3AwAgIyANIA8gE3wgD0L/////D4MgE0IBhkL+////H4N+fCIIIAaFQgGJIg0gEHwgDUL/////D4MgEEIBhkL+////H4N+fCIGhUIgiSIJIAR8IAlC/////w+DIARCAYZC/v///x+DfnwiBCANhUIoiSINIAZ8IA1C/////w+DIAZCAYZC/v///x+DfnwiDzcDACAAIAcgEiAUhUIBiSIGIAV8IAZC/////w+DIAVCAYZC/v///x+DfnwiBYVCIIkiByAIfCAIQgGGQv7///8fgyAHQv////8Pg358IgggBoVCKIkiBiAFfCAGQv////8PgyAFQgGGQv7///8fg358IhM3AwAgICAVIBeFQjCJIgU3AwAgAyAHIBOFQjCJIgc3AwAgJCAOIBGFQjCJIg43AwAgHCAJIA+FQjCJIgk3AwAgJSAFIBZ8IAVC/////w+DIBZCAYZC/v///x+DfnwiBTcDACAaIAQgCXwgCUL/////D4MgBEIBhkL+////H4N+fCIENwMAICEgByAIfCAHQv////8PgyAIQgGGQv7///8fg358Igc3AwAgHSALIA58IA5C/////w+DIAtCAYZC/v///x+DfnwiCDcDACAbIAUgCoVCAYk3AwAgGCAIIAyFQgGJNwMAIB4gBCANhUIBiTcDACAiIAYgB4VCAYk3AwAgAUGAAWoiAUGACEcNAAtBACEBA0AgASAZaiIAQYgBaiIDIABBgAJqIhgpAwAiByAAKQMAIgR8IAdC/////w+DIARCAYZC/v///x+DfnwiBCAAQYAGaiIaKQMAhUIgiSIMIABBgARqIhspAwAiCHwgDEL/////D4MgCEIBhkL+////H4N+fCIIIAeFQiiJIgcgBHwgB0L/////D4MgBEIBhkL+////H4N+fCIEIAyFQjCJIgwgCHwgDEL/////D4MgCEIBhkL+////H4N+fCIIIAeFQgGJIgcgAEGIA2oiHCkDACIKIAMpAwAiBXwgCkL/////D4MgBUIBhkL+////H4N+fCIFIABBiAdqIgMpAwCFQiCJIg0gAEGIBWoiHSkDACILfCANQv////8PgyALQgGGQv7///8fg358IgsgCoVCKIkiCiAFfCAKQv////8PgyAFQgGGQv7///8fg358IgV8IAdC/////w+DIAVCAYZC/v///x+DfnwiDiAAQYADaiIeKQMAIgYgAEGAAWoiHykDACIJfCAGQv////8PgyAJQgGGQv7///8fg358IgkgAEGAB2oiICkDAIVCIIkiDyAAQYAFaiIhKQMAIhN8IA9C/////w+DIBNCAYZC/v///x+DfnwiEyAGhUIoiSIGIAl8IAZC/////w+DIAlCAYZC/v///x+DfnwiCSAPhUIwiSIPhUIgiSIVIABBiAJqIiIpAwAiFCAAQQhqIiMpAwAiEHwgFEL/////D4MgEEIBhkL+////H4N+fCIQIABBiAZqIiQpAwCFQiCJIhEgAEGIBGoiJSkDACISfCARQv////8PgyASQgGGQv7///8fg358IhIgFIVCKIkiFCAQfCAUQv////8PgyAQQgGGQv7///8fg358IhAgEYVCMIkiESASfCARQv////8PgyASQgGGQv7///8fg358IhJ8IBVC/////w+DIBJCAYZC/v///x+DfnwiFiAHhUIoiSIHIA58IAdC/////w+DIA5CAYZC/v///x+DfnwiFzcDACAfIAogBSANhUIwiSIKIAt8IApC/////w+DIAtCAYZC/v///x+DfnwiBYVCAYkiDSAJfCANQv////8PgyAJQgGGQv7///8fg358IgsgEYVCIIkiDiAIfCAOQv////8PgyAIQgGGQv7///8fg358IgggDYVCKIkiDSALfCANQv////8PgyALQgGGQv7///8fg358IhE3AwAgIyAMIA8gE3wgD0L/////D4MgE0IBhkL+////H4N+fCIMIAaFQgGJIgsgEHwgC0L/////D4MgEEIBhkL+////H4N+fCIGhUIgiSIJIAV8IAlC/////w+DIAVCAYZC/v///x+DfnwiBSALhUIoiSILIAZ8IAtC/////w+DIAZCAYZC/v///x+DfnwiDzcDACAAIAogEiAUhUIBiSIKIAR8IApC/////w+DIARCAYZC/v///x+DfnwiBIVCIIkiBiAMfCAGQv////8PgyAMQgGGQv7///8fg358IgwgCoVCKIkiCiAEfCAKQv////8PgyAEQgGGQv7///8fg358IhM3AwAgICAVIBeFQjCJIgQ3AwAgAyAGIBOFQjCJIgY3AwAgJCAOIBGFQjCJIg43AwAgGiAJIA+FQjCJIgk3AwAgJSAEIBZ8IARC/////w+DIBZCAYZC/v///x+DfnwiBDcDACAdIAUgCXwgCUL/////D4MgBUIBhkL+////H4N+fCIFNwMAICEgBiAMfCAGQv////8PgyAMQgGGQv7///8fg358Igw3AwAgGyAIIA58IA5C/////w+DIAhCAYZC/v///x+DfnwiCDcDACAYIAQgB4VCAYk3AwAgHCAIIA2FQgGJNwMAIB4gBSALhUIBiTcDACAiIAogDIVCAYk3AwAgAUEQaiIBQYABRw0ACyACIBlBgAhqQYAIEN0CIQNBACEBA0AgASADaiIAIAApAwAgASAZaiICKQMAhTcDACAAQQhqIhggGCkDACACQQhqKQMAhTcDACAAQRBqIhggGCkDACACQRBqKQMAhTcDACAAQRhqIgAgACkDACACQRhqKQMAhTcDACABQSBqIgFBgAhHDQALIBlBgBBqJAALpwMBA38jAEEwayIEJABBm6nAACECQRMhAwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIAAtAABBAWsOEgABAgMEBQYHCAkKCwwNDg8QERILQYmpwAAhAkESIQMMEQtB9KjAACECQRUhAwwQC0HgqMAAIQJBFCEDDA8LQc+owAAhAkERIQMMDgtBv6jAACECQRAhAwwNC0GjqMAAIQJBHCEDDAwLQYiowAAhAkEbIQMMCwtB9afAACECDAoLQeOnwAAhAkESIQMMCQtBzafAACECQRYhAwwIC0G3p8AAIQJBFiEDDAcLQZ+nwAAhAkEYIQMMBgtBh6fAACECQRghAwwFC0H6psAAIQJBDSEDDAQLQeymwAAhAkEOIQMMAwtBzabAACECQR8hAwwCC0GrpsAAIQJBIiEDDAELQZymwAAhAkEPIQMLIARBHGpBATYCACAEIAM2AiwgBCACNgIoIARBJzYCJCAEQgE3AgwgBEHMpcAANgIIIAQgBEEoajYCICAEIARBIGo2AhggASAEQQhqEMMCIARBMGokAAtnAQF/IwBBIGsiAiQAIAJBrqrAADYCBCACIAA2AgAgAkEYaiABQRBqKQIANwMAIAJBEGogAUEIaikCADcDACACIAEpAgA3AwggAkGorMAAIAJBBGpBqKzAACACQQhqQbirwAAQrAIACysAIwBBEGsiACQAIAAgAUG4rMAAQQsQxgI3AwggAEEIahCzAiAAQRBqJAALmQIBBX8jAEEgayIBJAAgACgCACIALQAIIQIgAEEBOgAIIAEgAkEBcSICOgAHA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AgACgCACIAKAIAIABBCGooAgAgARDMAgu0AwEBfyAAKAIAIQIjAEEwayIAJAACfwJAAkACQAJAAkACQAJAIAIoAgBBAWsOBgECAwQFBgALIABBHGpBADYCACAAQeC3wAA2AhggAEIBNwIMIABB5NrAADYCCCABIABBCGoQwwIMBgsgAEEcakEANgIAIABB4LfAADYCGCAAQgE3AgwgAEHQ2sAANgIIIAEgAEEIahDDAgwFCyAAQRxqQQA2AgAgAEHgt8AANgIYIABCATcCDCAAQfDQwAA2AgggASAAQQhqEMMCDAQLIABBHGpBADYCACAAQeC3wAA2AhggAEIBNwIMIABB1NDAADYCCCABIABBCGoQwwIMAwsgAEEcakEANgIAIABB4LfAADYCGCAAQgE3AgwgAEG42sAANgIIIAEgAEEIahDDAgwCCyAAQRxqQQA2AgAgAEHgt8AANgIYIABCATcCDCAAQbTQwAA2AgggASAAQQhqEMMCDAELIABBHGpBATYCACAAQgE3AgwgAEHkzsAANgIIIABBPzYCJCAAIAJBBGo2AiwgACAAQSBqNgIYIAAgAEEsajYCICABIABBCGoQwwILIABBMGokAAveAQEBfyMAQTBrIgIkAAJ/AkACQAJAIAAoAgAiACgCAEEBaw4CAQIACyACQRxqQQA2AgAgAkHgt8AANgIYIAJCATcCDCACQbTPwAA2AgggASACQQhqEMMCDAILIAJBHGpBADYCACACQeC3wAA2AhggAkIBNwIMIAJBjM/AADYCCCABIAJBCGoQwwIMAQsgAkEcakEBNgIAIAJCATcCDCACQeTOwAA2AgggAkE/NgIkIAIgAEEEajYCLCACIAJBIGo2AhggAiACQSxqNgIgIAEgAkEIahDDAgsgAkEwaiQACwwAIAAoAgAgARCgAgueAQEBfyMAQUBqIgIkACAAKAIAIQAgAkEUakEDNgIAIAJBLGpBwAA2AgAgAkEkakHAADYCACACIABBGGo2AjQgAiAANgI4IAJCAzcCBCACQdTXwAA2AgAgAkHBADYCHCACIABBDGo2AjwgAiACQRhqNgIQIAIgAkE8ajYCKCACIAJBOGo2AiAgAiACQTRqNgIYIAEgAhDDAiACQUBrJAALlQIBAX8gACgCACECIwBBMGsiACQAAn8CQAJAAkACQCACKAIAQQFrDgMBAgMACyAAQRxqQQA2AgAgAEHgt8AANgIYIABCATcCDCAAQfDQwAA2AgggASAAQQhqEMMCDAMLIABBHGpBADYCACAAQeC3wAA2AhggAEIBNwIMIABB1NDAADYCCCABIABBCGoQwwIMAgsgAEEcakEANgIAIABB4LfAADYCGCAAQgE3AgwgAEG00MAANgIIIAEgAEEIahDDAgwBCyAAQRxqQQE2AgAgAEIBNwIMIABB5M7AADYCCCAAQT82AiQgACACQQRqNgIsIAAgAEEgajYCGCAAIABBLGo2AiAgASAAQQhqEMMCCyAAQTBqJAALYwEBfyMAQTBrIgIkACAAKAIAIQAgAkEcakEBNgIAIAJCAjcCDCACQejYwAA2AgggAkHAADYCJCACIAA2AiwgAiACQSBqNgIYIAIgAkEsajYCICABIAJBCGoQwwIgAkEwaiQAC1cBAX8jAEEgayICJAAgAiAANgIEIAJBGGogAUEQaikCADcDACACQRBqIAFBCGopAgA3AwAgAiABKQIANwMIIAJBBGpBjLbAACACQQhqEKICIAJBIGokAAscACMAQRBrIgAkACAAQQhqIAEQiQEgAEEQaiQAC64EAQR/IwBBQGoiACQAIABCADcCBCAAQeC3wAAoAgA2AgAgAEEQaiIEIABB2LPAABDAAiMAQUBqIgIkAEEBIQMCQCAEKAIYIgVBqJLBAEEMIARBHGooAgAiBCgCDBECAA0AAkAgASgCCCIDBEAgAiADNgIMIAJBlQE2AhQgAiACQQxqNgIQQQEhAyACQTxqQQE2AgAgAkICNwIsIAJBuJLBADYCKCACIAJBEGo2AjggBSAEIAJBKGoQogJFDQEMAgsgASgCACIDIAEoAgQoAgwRCABC9Pme5u6jqvn+AFINACACIAM2AgwgAkGWATYCFCACIAJBDGo2AhBBASEDIAJBPGpBATYCACACQgI3AiwgAkG4ksEANgIoIAIgAkEQajYCOCAFIAQgAkEoahCiAg0BCyABKAIMIQEgAkEkakEkNgIAIAJBHGpBJDYCACACIAFBDGo2AiAgAiABQQhqNgIYIAJBlAE2AhQgAiABNgIQIAJBPGpBAzYCACACQgM3AiwgAkGAksEANgIoIAIgAkEQajYCOCAFIAQgAkEoahCiAiEDCyACQUBrJAACQCADRQRAIAAoAgghAiAAKAIAIQNBDEEEEEsiAUUNASABIAI2AgggASACNgIEIAEgAzYCACABEAAgARDrAQJAIAAoAgRFDQAgACgCACIBRQ0AIAEQ6wELIABBQGskAA8LQfCzwABBNyAAQThqQbS2wABB9LTAABCvAgALQQxBBBCSAgALDwAgACgCACABEIsBGkEAC9QCAQN/IwBBEGsiAiQAAkAgAUH/AE0EQCAAKAIIIgMgAEEEaigCAEYEQCAAIANBARAPIAAoAgghAwsgACADQQFqNgIIIAAoAgAgA2ogAToAAAwBCyACQQA2AgwCfyABQYAQTwRAIAFBgIAETwRAIAIgAUE/cUGAAXI6AA8gAiABQRJ2QfABcjoADCACIAFBBnZBP3FBgAFyOgAOIAIgAUEMdkE/cUGAAXI6AA1BBAwCCyACIAFBP3FBgAFyOgAOIAIgAUEMdkHgAXI6AAwgAiABQQZ2QT9xQYABcjoADUEDDAELIAIgAUE/cUGAAXI6AA0gAiABQQZ2QcABcjoADEECCyEBIAEgAEEEaigCACAAQQhqIgQoAgAiA2tLBEAgACADIAEQDyAEKAIAIQMLIAAoAgAgA2ogAkEMaiABEN0CGiAEIAEgA2o2AgALIAJBEGokAEEAC1oBAX8jAEEgayICJAAgAiAAKAIANgIEIAJBGGogAUEQaikCADcDACACQRBqIAFBCGopAgA3AwAgAiABKQIANwMIIAJBBGpBjLbAACACQQhqEKICIAJBIGokAAvMAQEBfyMAQfAAayIDJAAgAyACNgIMIAMgATYCCCADQSRqQQE2AgAgA0ICNwIUIANB+LfAADYCECADQcIANgIsIAMgA0EoajYCICADIANBCGo2AiggA0IANwI0IANB4LfAACgCADYCMCADQUBrIgEgA0EwakHYs8AAEMACIANBEGogARCuAgRAQfCzwABBNyADQegAakG0tsAAQfS0wAAQrwIACyAAIAMpAzA3AgQg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gwECyANIBZqIgIgDUkNAiACIAJBAWsiC08EQCALrUIghiABrUL/AYNCCIaEQgKEIQMMBQtB4LvAAEEhQcC/wAAQnQIACyALIBdqIg4gA0I4iDwAACALQQFqIQEgAkUEQCABIQsMAQsgASALIBUgCyAVSxsiAkYNAiAOQQFqIANCMIg8AAAgC0ECaiEBIAxFBEAgASELDAELIAEgAkYNAiAOQQJqIANCKIg8AAAgC0EDaiEBIBRFBEAgASELDAELIAEgAkYNAiAOQQNqIANCIIg8AAAgC0EEaiEBIA9FBEAgASELDAELIAEgAkYNAiAOQQRqIANCGIg8AAAgC0EFaiEBIBFFBEAgASELDAELIAEgAkYNAiAOQQVqIANCEIg8AAAgC0EGaiELC0IAIQRBAyENIAsgFUsNAyASIAs2AjgMAwtBgLPAAEEcQcC/wAAQnQIACyACIBVB0L/AABCZAgALIANCCIghBCADpyENCyASKAI0IQIgEigCMCEBIAACfwJAIA1B/wFxQQNHBEAgEiANOgAgIBIgBD4AISASIARCMIg8ACcgEiAEQiCIPQAlIAJFIAFFckUEQCABEOsBCyASKAIgIQEgEiAEQhiIPgIsIBIgATYCKCASQgA3AjQgEkHgt8AAKAIANgIwIBJBQGsiCyASQTBqQdizwAAQwAIjAEEwayIBJAACfwJAAkACQCASQShqIgItAABBAWsOAgECAAsgASACQQRqKAIANgIAIAEgAi0AAToAByABQRxqQQI2AgAgAUEsakEkNgIAIAFCAzcCDCABQezrwAA2AgggAUHrADYCJCABIAFBIGo2AhggASABNgIoIAEgAUEHajYCICALIAFBCGoQwwIMAgsgAUEcakEANgIAIAFB3OvAADYCGCABQgE3AgwgAUHU68AANgIIIAsgAUEIahDDAgwBCyABIAJBBGooAgA2AgAgASACLQABOgAHIAFBHGpBAjYCACABQSxqQSQ2AgAgAUIDNwIMIAFBkOvAADYCCCABQesANgIkIAEgAUEgajYCGCABIAE2AiggASABQQdqNgIgIAsgAUEIahDDAgsgAUEwaiQARQ0BQfCzwABBNyASQegAakG0tsAAQfS0wAAQrwIACyASKAI4IQ0gAEEIaiACNgIAIAAgATYCBEEADAELIBJBCGogEkEYaikDACIDNwMAIBIgEikDECIENwMAIBIoAjAhDSASKQI0IQUgAEEgaiADNwIAIABBGGogBDcCACAAQRBqIAU3AwAgAEEIakEENgIAQQELNgIAIABBDGogDTYCACASQfAAaiQAC70CAQR/IwBBIGsiAiQAIAEoAgAhBCACIAFBCGooAgAiBUGAAhDSAQJAAkACQCACKAIABEAgAigCBCIBQQBIDQFBASEDIAEEQCABEE0iA0UNAwsgBCAFQYACIAMgARDRASACQQhqIAMgARDPAiACKAIIQQFGDQMgACABNgIIIAAgATYCBCAAIAM2AgAgAkEgaiQADwsjAEEQayIAJAAgAEHEwcAANgIIIABBLTYCBCAAQZTBwAA2AgAgACgCACEBIAAoAgQhAiAAKAIIIQMjAEEQayIAJAAgACACNgIMIAAgATYCCCAAQQhqQcSzwABBACADEPEBAAsQkwIACyABQQEQkgIACyACIAIpAgw3AhQgAiABNgIQIAIgATYCDCACIAM2AghB9cDAAEEMIAJBCGpBpLbAAEGEwcAAEK8CAAsZACAAIAFBCGooAgA2AgQgACABKAIANgIAC8AEAQJ/IwBBQGoiAiQAAkACQAJAAkACQAJAIAAoAgBBAWsOBAECAwQACyACIABBBGo2AgQgAkEYaiIDIABBEGooAgAgAEEYaigCABCVAiACQRRqQcMANgIAIAJBPGpBAjYCACACQcAANgIMIAJCAjcCLCACQdzDwAA2AiggAiADNgIQIAIgAkEEajYCCCACIAJBCGo2AjggASACQShqEMMCIQAgAigCGEUNBCACQSBqKAIARQ0EIAIoAhwiAUUNBCABEOsBDAQLIAIgAEEEajYCBCACQRhqIgMgAEEQaigCACAAQRhqKAIAEJUCIAJBFGpBwwA2AgAgAkE8akECNgIAIAJBwAA2AgwgAkICNwIsIAJBtMPAADYCKCACIAM2AhAgAiACQQRqNgIIIAIgAkEIajYCOCABIAJBKGoQwwIhACACKAIYRQ0DIAJBIGooAgBFDQMgAigCHCIBRQ0DIAEQ6wEMAwsgAiAAQQRqN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gt8AANgIYIAFCATcCDCABQfTNwAA2AgggAUEIakH8zcAAEKECAAsgAUEcakEANgIAIAFB4LfAADYCGCABQgE3AgwgAUGszsAANgIIIAFBCGpBtM7AABChAgALtAECAX8BfiMAQSBrIgEkAAJAQQxBBBBLIgQEQCAEIAM2AgggBCADNgIEIAQgAjYCAAJAIAQQASICRQRAIABBADYCAAwBCyACKAIAIgNFDQIgAikCBCEFIAIQ6wEgACAFNwIEIAAgAzYCAAsgBBDrASABQSBqJAAPC0EMQQQQkgIACyABQRxqQQA2AgAgAUHgt8AANgIYIAFCATcCDCABQazOwAA2AgggAUEIakG0zsAAEKECAAuzAQEBfyMAQSBrIgAkAAJAAkAgBARAQQxBBBBLIgVFDQEgBSACNgIIIAUgAjYCBCAFIAE2AgBBDEEEEEsiAUUNAiABIAQ2AgggASAENgIEIAEgAzYCACAFIAEQAiABEOsBIAUQ6wEgAEEgaiQADwsgAEEcakEANgIAIABB4LfAADYCGCAAQgE3AgwgAEHMyMAANgIIIABBCGpB+MjAABChAgALQQxBBBCSAgALQQxBBBCSAgALNABBDEEEEEsiAEUEQEEMQQQQkgIACyAAIAI2AgggACACNgIEIAAgATYCACAAEAMgABDrAQuaBAICfwF+IwBBQGoiASQAAkACQAJAAkACQAJAAkACQCADQYACTQRAQQxBBBBLIgRFDQUgBCADNgIIIAQgAzYCBCAEIAI2AgAgBBAEIgUNAyADDQFBASEFDAILQSBBARBLIgJFDQUgAEEBNgIAIAJBGGpBoMnAACkAADcAACACQRBqQZjJwAApAAA3AAAgAkEIakGQycAAKQAANwAAIAJBiMnAACkAADcAACAAQRBqQqCAgICABDcDACAAQQxqIAI2AgAgAEEIakEDNgIADAMLIANBARBLIgVFDQULIAUgAiADEN0CIQIgAEEMaiADNgIAIABBCGogAzYCACAAIAI2AgQgAEEANgIAIAQQ6wEMAQsgBSgCACICRQ0EIAUpAgQhBiAFEOsBIAEgBjcCBCABIAI2AgAgAUE8akEBNgIAIAFCATcCLCABQcDJwAA2AiggAU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AEMACIARBmANqIAYQsQENASAAQQhqIAQpA7gDNwIAIABBEGogBEHAA2ooAgA2AgAgAEEcaiAVNgIAIABBGGogFDYCACAAQRRqIBM2AgAgAEKBgICAEDcCACAEQZgDahAoCyASEOsBIARB8ANqJAAPC0Hws8AAQTcgBEGAA2pBtLbAAEH0tMAAEK8CAAvZCAEBfyMAQTBrIgIkAAJ/AkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgACgCAEEBaw4MAQIDBAUGBwgJCgsMAAsgAkEsakEBNgIAIAJCATcCHCACQdzUwAA2AhggAkHGADYCBCACIABBBGo2AhQgAiACNgIoIAIgAkEUajYCACABIAJBGGoQwwIMDAsgAkEsakEBNgIAIAJCATcCHCACQcDUwAA2AhggAkHHADYCBCACIABBBGo2AhQgAiACNgIoIAIgAkEUajYCACABIAJBGGoQwwIMCwsgAkEsakEBNgIAIAJCATcCHCACQaDUwAA2AhggAkHIADYCBCACIABBBGo2AhQgAiACNgIoIAIgAkEUajYCACABIAJBGGoQwwIMCgsgAkEsakEBNgIAIAJCATcCHCACQYDUwAA2AhggAkHAADYCBCACIABBBGo2AhQgAiACNgIoIAIgAkEUajYCACABIAJBGGoQwwIMCQsgAkEsakEBNgIAIAJCATcCHCACQejTwAA2AhggAkHAADYCBCACIABBBGo2AhQgAiACNgIoIAIgAkEUajYCACABIAJBGGoQwwIMCAsgAkEMakHJADYCACACQSxqQQI2AgAgAiAAQQhqNgIQIAJCAjcCHCACQcDTwAA2AhggAkHJADYCBCACIABBEGo2AhQgAiACNgIoIAIgAkEUajYCCCACIAJBEGo2AgAgASACQRhqEMMCDAcLIAJBLGpBATYCACACQgE3AhwgAkGU08AANgIYIAJBwAA2AgQgAiAAQQRqNgIUIAIgAjYCKCACIAJBFGo2AgAgASACQRhqEMMCDAYLIAJBLGpBATYCACACQgI3AhwgAkHc0sAANgIYIAJBwAA2AgQgAiAAQQRqNgIUIAIgAjYCKCACIAJBFGo2AgAgASACQRhqEMMCDAULIAJBDGpBwAA2AgAgAkEsakECNgIAIAIgAEEEajYCECACQgI3AhwgAkHA0sAANgIYIAJBwAA2AgQgAiAAQRBqNgIUIAIgAjYCKCACIAJBFGo2AgggAiACQRBqNgIAIAEgAkEYahDDAgwECyACQQxqQcAANgIAIAJBLGpBAjYCACACIABBBGo2AhAgAkICNwIcIAJBmNLAADYCGCACQcAANgIEIAIgAEEQajYCFCACIAI2AiggAiACQRRqNgIIIAIgAkEQajYCACABIAJBGGoQwwIMAwsgAkEsakEBNgIAIAJCATcCHCACQfTRwAA2AhggAkHKADYCBCACIABBBGo2AhQgAiACNgIoIAIgAkEUajYCACABIAJBGGoQwwIMAgsgAkEsakEBNgIAIAJCATcCHCACQeDRwAA2AhggAkHLADYCBCACIABBBGo2AhQgAiACNgIoIAIgAkEUajYCACABIAJBGGoQwwIMAQsgAkEsakEANgIAIAJB4LfAADYCKCACQgE3AhwgAkHI0cAANgIYIAEgAkEYahDDAgsgAkEwaiQAC0ABAn8gAEEIaigCACEBIAAoAgAhAkEMQQQQSyIARQRAQQxBBBCSAgALIAAgATYCCCAAIAE2AgQgACACNgIAIAALoQEBAn8jAEEgayICJAACQCABBEAgASgCACIDDQEgAkEcakEANgIAIAJB4LfAADYCGCACQgE3AgwgAkGszsAANgIIIAJBCGpBtM7AABChAgALIAJBHGpBADYCACACQeC3wAA2AhggAkIBNwIMIAJB9M3AADYCCCACQQhqQfzNwAAQoQIACyAAIAM2AgAgACABKQIENwIEIAEQ6wEgAkEgaiQACz4BAX8jAEEQayICJAAgAiABQcTOwABBBBDHAiACIAA2AgwgAiACQQxqQey4wAAQtQIaIAIQtgIgAkEQaiQACz4BAX8jAEEQayICJAAgAiABQcjOwABBDRDHAiACIAA2AgwgAiACQQxqQdy4wAAQtQIaIAIQtgIgAkEQaiQAC9wGAQF/IwBBEGsiAiQAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAKAIAQQFrDgwBAgMEBQYHCAkKCwwACyACIAFBkNfAAEEPEMYCNwMAIAIgA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AIAQQFrIgA2AgAgAA0AEOoBGg8LDwsgAkEDdiIDQQN0QdizwQBqIQECf0HQs8EAKAIAIgJBASADdCIDcQRAIAEoAggMAQtB0LPBACACIANyNgIAIAELIQMgASAANgIIIAMgADYCDCAAIAE2AgwgACADNgIIC2ABAX8jAEEQayIDJAAgAyACNgIIIAMgATYCBCADIAA2AgAgAygCACEBIAMoAgQhAiADKAIIIQMjAEEQayIAJAAgACACNgIMIAAgATYCCCAAQQhqQeyGwQBBACADEPEBAAuTBAEDfwJ/IwBBIGsiAiQAAkACQAJAAkACQAJAIAAtAABBAWsOAwECAwALIAIgAEEEaigCADYCACACIAFBwITBAEECEMYCNwMYIAJBGGpBwoTBAEEEIAJByITBABCnAiACQSg6AAdBjoTBAEEEIAJBB2pBlITBABCnAkEUQQEQSyIARQ0EIABBEGpB84vBACgAADYAACAAQQhqQeuLwQApAAA3AAAgAEHji8EAKQAANwAAIAJClICAgMACNwIMIAIgADYCCEGkhMEAQQcgAkEIakHYhMEAEKcCELQCIQAgAigCDEUNAyACKAIIIgFFDQMgARDrAQwDCyACIAAtAAE6ABggAkEIaiIAIAFBvITBAEEEEMcCIAAgAkEYakGUhMEAELUCELYCIQAMAgsgAEEEaigCACIDKAIAIQQgAiADKAIENgIcIAIgBDYCGCACIAAtAAE6AAAgAiABQYmEwQBBBRDGAjcDCCACQQhqQY6EwQBBBCACQZSEwQAQpwJBpITBAEEHIAJBGGpBrITBABCnAhC0AiEADAELIABBBGooAgAhACACIAFBqYfBAEEGEMYCNwMIIAIgAEEIajYCGCACQQhqIgFBjoTBAEEEIAJBGGoiA0Gwh8EAEKcCGiACIAA2AhggAUGkh8EAQQUgA0HAh8EAEKcCGiABELQCIQALIAJBIGokACAADAELQRRBARCSAgALC1UBAX8CQCAARQRAQam3wQAtAABFDQELQam3wQBBAToAAAJAQcizwQAoAgBBAUYEQEHMs8EAKAIAIQEMAQtByLPBAEEBNgIAC0HMs8EAIAA2AgALIAELAwABC6EBAQJ/AkBBxLPBACgCAEH/////B3EEQBDgAUUNAQtBuLPBACgCAEG4s8EAQX82AgBFBEBBwLPBACgCACEAQcCzwQBB7MPAADYCAEG8s8EAKAIAIQFBvLPBAEEBNgIAQbizwQBBADYCAAJAIABFDQAgASAAKAIAEQQAIAAoAgRFDQAgACgCCBogARDrAQsPCwALQaSFwQBBNEH0hcEAEOwBAAuKAgEDfyMAQSBrIgQkAEEBIQVBxLPBAEHEs8EAKAIAIgZBAWo2AgACQEGgt8EAKAIAQQFGBEBBpLfBACgCAEEBaiEFDAELQaC3wQBBATYCAAtBpLfBACAFNgIAAkACQCAGQQBIIAVBAktyDQAgBCADNgIcIAQgAjYCGEG4s8EAKAIAIgJBAEgNAEG4s8EAIAJBAWoiAjYCAEG4s8EAQcCzwQAoAgAiAwR/QbyzwQAoAgAgBEEIaiAAIAEoAhARAQAgBCAEKQMINwMQIARBEGogAygCFBEBAEG4s8EAKAIABSACC0EBazYCACAFQQFNDQELAAsjAEEQayICJAAgAiABNgIMIAIgADYCCAALqQICBH8BfiMAQTBrIgIkACABQQRqIQQCQCABKAIEBEBBjIPBACgCACEFDAELIAEoAgAhAyACQgA3AgwgAkGMg8EAKAIAIgU2AgggAiACQQhqNgIUIAJBKGogA0EQaikCADcDACACQSBqIANBCGopAgA3AwAgAiADKQIANwMYIAJBFGpB+IHBACACQRhqEKICGiAEQQhqIAJBEGooAgA2AgAgBCACKQMINwIACyACQSBqIgMgBEEIaigCADYCACABQQxqQQA2AgAgBCkCACEGIAFBCGpBADYCACABIAU2AgQgAiAGNwMYQQxBBBBLIgFFBEBBDEEEEJICAAsgASACKQMYNwIAIAFBCGogAygCADYCACAAQcyGwQA2AgQgACABNgIAIAJBMGokAAuxAQECfyMAQTBrIgIkACABQQRqIQMgASgCBEUEQCABKAIAIQEgAkIANwIMIAJBjIPBACgCADYCCCACIAJBCGo2AhQgAkEoaiABQRBqKQIANwMAIAJBIGogAUEIaikCADcDACACIAEpAgA3AxggAkEUakH4gcEAIAJBGGoQogIaIANBCGogAkEQaigCADYCACADIAIpAwg3AgALIABBzIbBADYCBCAAIAM2AgAgAkEwaiQAC0UBAn8gASgCBCECIAEoAgAhA0EIQQQQSyIBRQRAQQhBBBCSAgALIAEgAjYCBCABIAM2AgAgAEHchsEANgIEIAAgATYCAAsTACAAQdyGwQA2AgQgACABNgIAC1UBAn8gASgCACECIAFBADYCAAJAIAIEQCABKAIEIQNBCEEEEEsiAUUNASABIAM2AgQgASACNgIAIABB3IbBADYCBCAAIAE2AgAPCwALQQhBBBCSAgALHQAgASgCAEUEQAALIABB3IbBADYCBCAAIAE2AgALVwEBfyMAQRBrIgIkACACIAFBi4fBAEEIEMcCIAIgADYCDCACIAJBDGoiAUHsgsEAELUCGiACIABBBGo2AgwgAiABQZSHwQAQtQIaIAIQtgIgAkEQaiQACxAAIAAgAWpBAWtBACABa3ELDwAgAEEBdCIAQQAgAGtyCwoAQQAgAGsgAHELEgBBAEEZIABBAXZrIABBH0YbCwoAIAAoAgRBeHELDQAgAC0ABEECcUEBdgsKACAAKAIEQQFxCwsAIAAtAARBA3FFCyoAIAAgACgCBEEBcSABckECcjYCBCAAIAFqQQRqIgAgACgCAEEBcjYCAAshACAAIAFBA3I2AgQgACABakEEaiIAIAAoAgBBAXI2AgALDAAgACABQQNyNgIECxYAIAAgAUEBcjYCBCAAIAFqIAE2AgALIwAgAiACKAIEQX5xNgIEIAAgAUEBcjYCBCAAIAFqIAE2AgALBwAgACABagsHACAAIAFrCwcAIABBCGoLBwAgAEEIawsZAQF/IAAoAhAiAQR/IAEFIABBFGooAgALCwoAIAAoAgxBAXELCgAgACgCDEEBdgsNACAAKAIAIAAoAgRqC2cBAn8jAEEQayICJAAgACgCACIAQQhqKAIAIQMgACgCACEAIAIgARDIAjcDACADBEADQCACIAA2AgwgAiACQQxqQYSOwQAQtwIgAEEBaiEAIANBAWsiAw0ACwsgAhC4AiACQRBqJAAL7QEBAX8gACgCACECIwBBEGsiACQAIAAgAa1CgICAgBBCACABKAIYQbG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AgAkEwaygCACACQThrKAIAIANqampqampqaiEDIAJBQGshAiAEQQhqIgQNAAsgAkE8awsgB0UNAEEAIAdrIQJBBGohBANAIAQoAgAgA2ohAyAEQQhqIQQgAiACQQFqIgJNDQALCwJAAkACQCAIRQRAIAMhAgwBCwJAIAlFDQAgBigCBA0AIANBEEkNAgsgAyADaiICIANJDQELQQAhAwJAIAJBAE4EQCACRQRAQQEhBAwECyACQQEQSyIERQ0BIAIhAwwDCxCTAgALIAJBARCSAgALQQEhBEEAIQMLIABBADYCCCAAIAM2AgQgACAENgIAIAUgADYCBCAFQRhqIAFBEGopAgA3AwAgBUEQaiABQQhqKQIANwMAIAUgASkCADcDCCAFQQRqQeyNwQAgBUEIahCiAgRAQeSOwQBBMyAFQQhqQZSOwQBBsI/BABCvAgALIAVBIGokAAvwBAEFfyMAQUBqIgMkACADQQhqIAEgAhDRAiADIAMoAgggAygCDBDRAiADIAMpAwA3AxAgA0EwaiADQRBqENICAkACQAJAAkAgAygCMCIGBEAgAygCNCIEIAJHDQIgACAGNgIEDAELIABB5I7BADYCBEEAIQILIABBADYCACAAQQhqIAI2AgAMAQsCQAJAIAJBAE4EQCADQTxqKAIAIQcgAg0BQQEhBQwCCxCTAgALIAJBARBLIgVFDQILQQAhASADQQA2AiAgAyAFNgIYIAMgAjYCHCACIARJBEAgA0EYakEAIAQQDyADKAIYIQUgAygCICEBCyABIAVqIAYgBBDdAhogAyABIARqIgI2AiAgBwRAIAMoAhwgAmtBAk0EQCADQRhqIAJBAxAPIAMoAiAhAgsgAygCGCACaiIBQcCPwQAvAAA7AAAgAUECakHCj8EALQAAOgAAIAMgAkEDaiICNgIgCyADIAMpAxA3AyggA0EwaiADQShqENICIAMoAjAiBQRAA0AgAygCPCADKAI0IgQgAygCHCACa0sEQCADQRhqIAIgBBAPIAMoAiAhAgsgAygCGCIBIAJqIAUgBBDdAhogAyACIARqIgI2AiAEQCADKAIcIAJrQQJNBEAgA0EYaiACQQMQDyADKAIgIQIgAygCGCEBCyABIAJqIgFBwI/BAC8AADsAACABQQJqQcKPwQAtAAA6AAAgAyACQQNqIgI2AiALIANBMGogA0EoahDSAiADKAIwIgUNAAsLIAAgAykDGDcCBCAAQQE2AgAgAEEMaiADQSBqKAIANgIACyADQUBrJAAPCyACQQEQkgIAC2YBAn8CQAJAAkAgAUEIaigCACICQQBOBEAgASgCACEDIAINAUEBIQEMAgsQkwIACyACQQEQSyIBRQ0BCyABIAMgAhDdAiEBIAAgAjYCCCAAIAI2AgQgACABNgIADwsgAkEBEJICAAtoAQF/IwBBEGsiAiQAIAIgAUHDj8EAQQ0QxgI3AwAgAiAANgIMIAJB0I/BAEEFIAJBDGoiAUHYj8EAEKcCGiACIABBDGo2AgwgAkHoj8EAQQUgAUHwj8EAEKcCGiACELQCIAJBEGokAAsOACAAKAIAGgNADAALAAttAQF/IwBBMGsiAyQAIAMgATYCBCADIAA2AgAgA0EcakECNgIAIANBLGpBJDYCACADQgI3AgwgA0GEk8EANgIIIANBJDYCJCADIANBIGo2AhggAyADNgIoIAMgA0EEajYCICADQQhqIAIQoQIAC20BAX8jAEEwayIDJAAgAyABNgIEIAMgADYCACADQRxqQQI2AgAgA0EsakEkNgIAIANCAjcCDCADQaiZwQA2AgggA0EkNgIkIAMgA0EgajYCGCADIANBBGo2AiggAyADNgIgIANBCGogAhChAgALbQEBfyMAQTBrIgMkACADIAE2AgQgAyAANgIAIANBHGpBAjYCACADQSxqQSQ2AgAgA0ICNwIMIANByJnBADYCCCADQSQ2AiQgAyADQSBqNgIYIAMgA0EEajYCKCADIAM2AiAgA0EIaiACEKECAAvgBgEGfyAAKAIQIQQCQAJAAkACQCAAKAIIIghBAUcEQCAEQQFGDQEgACgCGCABIAIgAEEcaigCACgCDBECACEDDAMLIARBAUcNAQsgASACaiEHAkACQCAAQRRqKAIAIgZFBEAgASEEDAELIAEhBANAIAQiAyAHRg0CAn8gA0EBaiADLAAAIgRBAE4NABogA0ECaiAEQf8BcSIEQeABSQ0AGiADQQNqIAR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CDYCAAwHCyACIANBiJ7BABCbAgALIAUgA0GInsEAEJsCAAsCQCACIANNBEAgAiADTw0BDAULIAIgA0HoncEAEJsCAAsgBSADQeidwQAQmwIACyACIANJDQALIAFBADYCBCABQYSQwQA2AgAgACADNgIEIAAgBjYCACAAQQxqQQA2AgAgAEEIakGEkMEANgIADwsgAEEANgIADwsgASAENgIACyAAIAI2AgQgACAGNgIAIAEgAyAFazYCBAsgAEEMakEBNgIADAELIAEgBTYCACAAIAI2AgQgACAGNgIAIAEgAyAEazYCBCAAQQxqQQI2AgALIABBCGogBzYCAAuTAQEDfyMAQYABayIDJAAgAC0AACECQQAhAANAIAAgA2pB/wBqQTBB1wAgAkEPcSIEQQpJGyAEajoAACAAQQFrIQAgAiIEQQR2IQIgBEEPSw0ACyAAQYABaiICQYEBTwRAIAJBgAFB4JXBABCaAgALIAFBAUHwlcEAQQIgACADakGAAWpBACAAaxC6AiADQYABaiQACw4AIAApAwBBASABENYCC40BAQN/IwBBgAFrIgMkACAAKAIAIQADQCACIANqQf8AakEwQdcAIABBD3EiBEEKSRsgBGo6AAAgAkEBayECIABBD0sgAEEEdiEADQALIAJBgAFqIgBBgQFPBEAgAEGAAUHglcEAEJoCAAsgAUEBQfCVwQBBAiACIANqQYABakEAIAJrELoCIANBgAFqJAALwQICBX8BfiMAQTBrIgUkAEEnIQMCQCAAQpDOAFQEQCAAIQgMAQsDQCAFQQlqIANqIgRBBGsgACAAQpDOAIAiCEKQzgB+faciBkH//wNxQeQAbiIHQQF0QfKVwQBqLwAAOwAAIARBAmsgBiAHQeQAbGtB//8DcUEBdEHylcEAai8AADsAACADQQRrIQMgAEL/wdcvViAIIQANAAsLIAinIgRB4wBKBEAgA0ECayIDIAVBCWpqIAinIgQgBEH//wNxQeQAbiIEQeQAbGtB//8DcUEBdEHylcEAai8AADsAAAsCQCAEQQpOBEAgA0ECayIDIAVBCWpqIARBAXRB8pXBAGovAAA7AAAMAQsgA0EBayIDIAVBCWpqIARBMGo6AAALIAIgAUGEkMEAQQAgBUEJaiADakEnIANrELoCIAVBMGokAAuMAQEDfyMAQYABayIDJAAgACgCACEAA0AgAiADakH/AGpBMEE3IABBD3EiBEEKSRsgBGo6AAAgAkEBayECIABBD0sgAEEEdiEADQALIAJBgAFqIgBBgQFPBEAgAEGAAUHglcEAEJoCAAsgAUEBQfCVwQBBAiACIANqQYABakEAIAJrELoCIANBgAFqJAALIgAgACgCACIArSAAQX9zrEIBfCAAQQBOIgAbIAAgARDWAgscACABKAIYQayswQBBBSABQRxqKAIAKAIMEQIAC5gCAQJ/IwBBEGsiAiQAAn8gACgCACIALQAAQQFHBEAgASgCGEGorMEAQQQgAUEcaigCACgCDBECAAwBCyACIAEoAhhBpKzBAEEEIAFBHGooAgAoAgwRAgA6AAggAiABNgIAIAJBADoACSACQQA2AgQgAiAAQQFqNgIMIAIgAkEMakG0lcEAELUCGgJ/IAItAAgiASACKAIEIgNFDQAaIAFB/wFxIQBBASAADQAaIAIoAgAhAAJAIANBAUcNACACLQAJRQ0AIAAtAABBBHENAEEBIAAoAhhBsJXBAEEBIABBHGooAgAoAgwRAgANARoLIAAoAhhBsZXBAEEBIABBHGooAgAoAgwRAgALQf8BcUEARwsgAkEQaiQACwwAIAAoAgAgARCkAgvGAgEDfyMAQYABayIEJAAgACgCACEAAkACQAJ/AkAgASgCACICQRBxRQRAIAJBIHENASAAMQAAQQEgARDWAgwCCyAALQAAIQJBACEAA0AgACAEakH/AGpBMEHXACACQQ9xIgNBCkkbIANqOgAAIABBAWshACACIgNBBHYhAiADQQ9LDQALIABBgAFqIgJBgQFPDQIgAUEBQfCVwQBBAiAAIARqQYABakEAIABrELoCDAELIAAtAAAhAkEAIQADQCAAIARqQf8AakEwQTcgAkEPcSIDQQpJGyADajoAACAAQQFrIQAgAiIDQQR2IQIgA0EPSw0ACyAAQYABaiICQYEBTw0CIAFBAUHwlcEAQQIgACAEakGAAWpBACAAaxC6AgsgBEGAAWokAA8LIAJBgAFB4JXBABCaAgALIAJBg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wL3NyYy9kZWNvZGUucnM3NhAAVQAAALwAAAAKAAAAISIjJCUmJygpKissLTAxMjM0NTY3ODlAQUJDREVGR0hJSktMTU5QUVJTVFVWWFlaW2BhYmNkZWhpamtsbXBxckFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXowMTIzNDU2Nzg5KywuL0FCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXowMTIzNDU2Nzg5Li8wMTIzNDU2Nzg5QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ekFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXowMTIzNDU2Nzg5LV9BQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWmFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6MDEyMzQ1Njc4OSsv////////////////////////////////////////////AAECAwQFBgcICQoLDP//DQ4PEBESExQVFv///////xcYGRobHB0eHyAhIiMkJf8mJygpKiss/y0uLzD/////MTIzNDU2//83ODk6Ozz//z0+P/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8+P////zQ1Njc4OTo7PD3/////////AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBn///////8aGxwdHh8gISIjJCUmJygpKissLS4vMDEyM///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAE2Nzg5Ojs8PT4//////////wIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRob////////HB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDX//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wABAgMEBQYHCAkKC/////////8MDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJf///////yYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////z7//zQ1Njc4OTo7PD3/////////AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBn/////P/8aGxwdHh8gISIjJCUmJygpKissLS4vMDEyM///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Pv///z80NTY3ODk6Ozw9/////////wABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZ////////GhscHR4fICEiIyQlJicoKSorLC0uLzAxMjP/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////3DcQAJw3EABcNxAAHDcQANw2EACcNhAAHD0QABw8EAAcOxAAHDoQABw5EAAcOBAAbgAAAAgAAAAEAAAAbwAAAHAAAABuAAAACAAAAAQAAABxAAAAYG9uZSBvZiBxPhAABwAAACwgAACAPhAAAgAAAHA+EAABAAAAcD4QAAEAAABgIG9yIGAAAHA+EAABAAAAnD4QAAYAAABwPhAAAQAAAC91c3IvbG9jYWwvY2FyZ28vcmVnaXN0cnkvc3JjL2dpdGh1Yi5jb20tMWVjYzYyOTlkYjllYzgyMy9zZXJkZS0xLjAuMTM3L3NyYy9kZS9tb2QucnNleHBsaWNpdCBwYW5pYwC8PhAAVQAAAOgIAAASAAAAYXR0ZW1wdCB0byBhZGQgd2l0aCBvdmVyZmxvdy91c3IvbG9jYWwvY2FyZ28vcmVnaXN0cnkvc3JjL2dpdGh1Yi5jb20tMWVjYzYyOTlkYjllYzgyMy9ibG9jay1idWZmZXItMC45LjAvc3JjL2xpYi5ycwBMPxAAVwAAAIQAAAAJAAAATD8QAFcAAACFAAAACQAAAEw/EABXAAAAhwAAABcAAABMPxAAVwAAAIsAAAAbAAAATD8QAFcAAAA6AAAAIwAAAEw/EABXAAAAOgAAAA0AAABMPxA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BAnoGAwEBAgEHAQFIAgMBAQEAAgAFOwcAAT8EUQEAAgAuAhcAAQEDBAUICAIHHgSUAwA3BDIIAQ4BFgUBDwAHARECBwECAQUABwABPQQAB20HAGCA8ABBqLPBAAsBAQ==", + "code_id": "1", + "code_info": + { + "code_hash": "RwxbcDpoL3eLiwiNSBabjW5D9/RKxwMWaSzb5p5mBeM=", + "creator": "link146asaycmtydq45kxc8evntqfgepagygelel00h", + "instantiate_config": + { + "address": "", + "permission": "Everybody" + } + }, + "pinned": false + } + ], + "contracts": + [ + { + "contract_address": "link14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sgf2vn8", + "contract_info": + { + "admin": "", + "code_id": "1", + "created": null, + "creator": "link146asaycmtydq45kxc8evntqfgepagygelel00h", + "extension": null, + "ibc_port_id": "", + "label": "From deploy_hackatom.js (0)" + }, + "contract_state": + [ + { + "key": "636F6E666967", + "value": "eyJ2ZXJpZmllciI6ImxpbmsxNDZhc2F5Y210eWRxNDVreGM4ZXZudHFmZ2VwYWd5Z2VsZWwwMGgiLCJiZW5lZmljaWFyeSI6ImxpbmsxNDZhc2F5Y210eWRxNDVreGM4ZXZudHFmZ2VwYWd5Z2VsZWwwMGgiLCJmdW5kZXIiOiJsaW5rMTQ2YXNheWNtdHlkcTQ1a3hjOGV2bnRxZmdlcGFneWdlbGVsMDBoIn0=" + } + ] + } + ], + "gen_msgs": + [], + "inactive_contract_addresses": + ["link14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sgf2vn8"], + "params": + { + "code_upload_access": + { + "address": "", + "permission": "Everybody" + }, + "compile_cost": "3", + "gas_multiplier": "140000000", + "instance_cost": "60000", + "instantiate_default_permission": "Everybody" + }, + "sequences": + [ + { + "id_key": "BGxhc3RDb2RlSWQ=", + "value": "2" + }, + { + "id_key": "BGxhc3RDb250cmFjdElk", + "value": "2" + } + ] +} +} \ No newline at end of file diff --git a/x/wasmplus/client/testutil/tx.go b/x/wasmplus/client/testutil/tx.go new file mode 100644 index 0000000000..67fa32d5d0 --- /dev/null +++ b/x/wasmplus/client/testutil/tx.go @@ -0,0 +1,90 @@ +package testutil + +import ( + "fmt" + "os" + + "github.com/line/lbm-sdk/client/flags" + clitestutil "github.com/line/lbm-sdk/testutil/cli" + sdk "github.com/line/lbm-sdk/types" + + wasmkeeper "github.com/line/wasmd/x/wasm/keeper" + "github.com/line/wasmd/x/wasmplus/client/cli" +) + +func (s *IntegrationTestSuite) TestStoreCodeAndInstantiateContractCmd() { + val := s.network.Validators[0] + owner := val.Address.String() + + wasmPath := "../../../wasm/keeper/testdata/hackatom.wasm" + _, err := os.ReadFile(wasmPath) + s.Require().NoError(err) + + params := fmt.Sprintf("{\"verifier\": \"%s\", \"beneficiary\": \"%s\"}", s.network.Validators[0].Address.String(), wasmkeeper.RandomAccountAddress(s.T())) + + testCases := map[string]struct { + args []string + valid bool + }{ + "valid storeCodeAndInstantiateContract": { + []string{ + wasmPath, + params, + fmt.Sprintf("--label=%s", "TestContract"), + fmt.Sprintf("--admin=%s", owner), + fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + fmt.Sprintf("--%s=%d", flags.FlagGas, 1600000), + }, + true, + }, + "wrong args count": { + []string{"0"}, + false, + }, + "no label error": { + []string{ + wasmPath, + params, + }, + false, + }, + "no sender error": { + []string{ + wasmPath, + params, + fmt.Sprintf("--label=%s", "TestContract"), + fmt.Sprintf("--admin=%s", owner), + }, + false, + }, + "wrong wasm path error": { + []string{ + "../../keeper/testdata/noexist.wasm", + params, + fmt.Sprintf("--label=%s", "TestContract"), + fmt.Sprintf("--admin=%s", owner), + fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + fmt.Sprintf("--%s=%d", flags.FlagGas, 1600000), + }, + false, + }, + } + + for name, tc := range testCases { + tc := tc + + s.Run(name, func() { + cmd := cli.StoreCodeAndInstantiateContractCmd() + out, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, append(tc.args, commonArgs...)) + if !tc.valid { + s.Require().Error(err) + return + } + s.Require().NoError(err) + + var res sdk.TxResponse + s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(out.Bytes(), &res), out.String()) + s.Require().EqualValues(0, res.Code, out.String()) + }) + } +} diff --git a/x/wasmplus/common_test.go b/x/wasmplus/common_test.go new file mode 100644 index 0000000000..f291bf1897 --- /dev/null +++ b/x/wasmplus/common_test.go @@ -0,0 +1,36 @@ +package wasmplus + +import ( + "testing" + + "github.com/stretchr/testify/require" + + sdk "github.com/line/lbm-sdk/types" + "github.com/line/wasmd/x/wasm" +) + +// ensure store code returns the expected response +func assertStoreCodeResponse(t *testing.T, data []byte, expected uint64) { + var pStoreResp wasm.MsgStoreCodeResponse + require.NoError(t, pStoreResp.Unmarshal(data)) + require.Equal(t, pStoreResp.CodeID, expected) +} + +// ensure execution returns the expected data +func assertExecuteResponse(t *testing.T, data []byte, expected []byte) { + var pExecResp wasm.MsgExecuteContractResponse + require.NoError(t, pExecResp.Unmarshal(data)) + require.Equal(t, pExecResp.Data, expected) +} + +// ensures this returns a valid bech32 address and returns it +func parseInitResponse(t *testing.T, data []byte) string { + var pInstResp wasm.MsgInstantiateContractResponse + require.NoError(t, pInstResp.Unmarshal(data)) + require.NotEmpty(t, pInstResp.Address) + addr := pInstResp.Address + // ensure this is a valid sdk address + _, err := sdk.AccAddressFromBech32(addr) + require.NoError(t, err) + return addr +} diff --git a/x/wasm/dynamic_link_test.go b/x/wasmplus/dynamic_link_test.go similarity index 88% rename from x/wasm/dynamic_link_test.go rename to x/wasmplus/dynamic_link_test.go index d6c1d1c711..2d2f6e7714 100644 --- a/x/wasm/dynamic_link_test.go +++ b/x/wasmplus/dynamic_link_test.go @@ -1,13 +1,14 @@ -package wasm +package wasmplus import ( "fmt" "testing" - abci "github.com/line/ostracon/abci/types" + "github.com/line/wasmd/x/wasm" "github.com/line/wasmd/x/wasm/keeper" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" ) var ( @@ -27,7 +28,7 @@ func TestDynamicPingPongWorks(t *testing.T) { h := data.module.Route().Handler() // store dynamic callee code - storeCalleeMsg := &MsgStoreCode{ + storeCalleeMsg := &wasm.MsgStoreCode{ Sender: addr1, WASMByteCode: calleeContract, } @@ -38,7 +39,7 @@ func TestDynamicPingPongWorks(t *testing.T) { assertStoreCodeResponse(t, res.Data, calleeCodeId) // store dynamic caller code - storeCallerMsg := &MsgStoreCode{ + storeCallerMsg := &wasm.MsgStoreCode{ Sender: addr1, WASMByteCode: callerContract, } @@ -49,7 +50,7 @@ func TestDynamicPingPongWorks(t *testing.T) { assertStoreCodeResponse(t, res.Data, callerCodeId) // instantiate callee contract - instantiateCalleeMsg := &MsgInstantiateContract{ + instantiateCalleeMsg := &wasm.MsgInstantiateContract{ Sender: addr1, CodeID: calleeCodeId, Label: "callee", @@ -63,7 +64,7 @@ func TestDynamicPingPongWorks(t *testing.T) { // instantiate caller contract cosmwasmInstantiateCallerMsg := fmt.Sprintf(`{"callee_addr":"%s"}`, calleeContractAddress) - instantiateCallerMsg := &MsgInstantiateContract{ + instantiateCallerMsg := &wasm.MsgInstantiateContract{ Sender: addr1, CodeID: callerCodeId, Label: "caller", @@ -77,7 +78,7 @@ func TestDynamicPingPongWorks(t *testing.T) { // execute ping cosmwasmExecuteMsg := `{"ping":{"ping_num":"100"}}` - executeMsg := MsgExecuteContract{ + executeMsg := wasm.MsgExecuteContract{ Sender: addr1, Contract: callerContractAddress, Msg: []byte(cosmwasmExecuteMsg), @@ -104,7 +105,7 @@ func TestDynamicReEntrancyFails(t *testing.T) { h := data.module.Route().Handler() // store dynamic callee code - storeCalleeMsg := &MsgStoreCode{ + storeCalleeMsg := &wasm.MsgStoreCode{ Sender: addr1, WASMByteCode: calleeContract, } @@ -115,7 +116,7 @@ func TestDynamicReEntrancyFails(t *testing.T) { assertStoreCodeResponse(t, res.Data, calleeCodeId) // store dynamic caller code - storeCallerMsg := &MsgStoreCode{ + storeCallerMsg := &wasm.MsgStoreCode{ Sender: addr1, WASMByteCode: callerContract, } @@ -126,7 +127,7 @@ func TestDynamicReEntrancyFails(t *testing.T) { assertStoreCodeResponse(t, res.Data, callerCodeId) // instantiate callee contract - instantiateCalleeMsg := &MsgInstantiateContract{ + instantiateCalleeMsg := &wasm.MsgInstantiateContract{ Sender: addr1, CodeID: calleeCodeId, Label: "callee", @@ -140,7 +141,7 @@ func TestDynamicReEntrancyFails(t *testing.T) { // instantiate caller contract cosmwasmInstantiateCallerMsg := fmt.Sprintf(`{"callee_addr":"%s"}`, calleeContractAddress) - instantiateCallerMsg := &MsgInstantiateContract{ + instantiateCallerMsg := &wasm.MsgInstantiateContract{ Sender: addr1, CodeID: callerCodeId, Label: "caller", @@ -154,7 +155,7 @@ func TestDynamicReEntrancyFails(t *testing.T) { // execute ping cosmwasmExecuteMsg := `{"try_re_entrancy":{}}` - executeMsg := MsgExecuteContract{ + executeMsg := wasm.MsgExecuteContract{ Sender: addr1, Contract: callerContractAddress, Msg: []byte(cosmwasmExecuteMsg), @@ -171,7 +172,7 @@ func TestDynamicLinkInterfaceValidation(t *testing.T) { h := data.module.Route().Handler() // store dynamic callee code - storeCalleeMsg := &MsgStoreCode{ + storeCalleeMsg := &wasm.MsgStoreCode{ Sender: addr1, WASMByteCode: calleeContract, } @@ -182,7 +183,7 @@ func TestDynamicLinkInterfaceValidation(t *testing.T) { assertStoreCodeResponse(t, res.Data, calleeCodeId) // store dynamic caller code - storeCallerMsg := &MsgStoreCode{ + storeCallerMsg := &wasm.MsgStoreCode{ Sender: addr1, WASMByteCode: callerContract, } @@ -193,7 +194,7 @@ func TestDynamicLinkInterfaceValidation(t *testing.T) { assertStoreCodeResponse(t, res.Data, callerCodeId) // instantiate callee contract - instantiateCalleeMsg := &MsgInstantiateContract{ + instantiateCalleeMsg := &wasm.MsgInstantiateContract{ Sender: addr1, CodeID: calleeCodeId, Label: "callee", @@ -207,7 +208,7 @@ func TestDynamicLinkInterfaceValidation(t *testing.T) { // instantiate caller contract cosmwasmInstantiateCallerMsg := fmt.Sprintf(`{"callee_addr":"%s"}`, calleeContractAddress) - instantiateCallerMsg := &MsgInstantiateContract{ + instantiateCallerMsg := &wasm.MsgInstantiateContract{ Sender: addr1, CodeID: callerCodeId, Label: "caller", @@ -221,7 +222,7 @@ func TestDynamicLinkInterfaceValidation(t *testing.T) { // execute validate interface cosmwasmExecuteMsg := `{"validate_interface":{}}` - executeMsg := MsgExecuteContract{ + executeMsg := wasm.MsgExecuteContract{ Sender: addr1, Contract: callerContractAddress, Msg: []byte(cosmwasmExecuteMsg), @@ -232,7 +233,7 @@ func TestDynamicLinkInterfaceValidation(t *testing.T) { // execute validate interface error cosmwasmExecuteMsgErr := `{"validate_interface_err":{}}` - executeMsgErr := MsgExecuteContract{ + executeMsgErr := wasm.MsgExecuteContract{ Sender: addr1, Contract: callerContractAddress, Msg: []byte(cosmwasmExecuteMsgErr), @@ -252,7 +253,7 @@ func TestDynamicCallAndTraditionalQueryWork(t *testing.T) { q := data.module.LegacyQuerierHandler(nil) // store callee code (number) - storeCalleeMsg := &MsgStoreCode{ + storeCalleeMsg := &wasm.MsgStoreCode{ Sender: addr1, WASMByteCode: numberContract, } @@ -263,7 +264,7 @@ func TestDynamicCallAndTraditionalQueryWork(t *testing.T) { assertStoreCodeResponse(t, res.Data, calleeCodeId) // store caller code (call-number) - storeCallerMsg := &MsgStoreCode{ + storeCallerMsg := &wasm.MsgStoreCode{ Sender: addr1, WASMByteCode: callNumberContract, } @@ -274,7 +275,7 @@ func TestDynamicCallAndTraditionalQueryWork(t *testing.T) { assertStoreCodeResponse(t, res.Data, callerCodeId) // instantiate callee contract - instantiateCalleeMsg := &MsgInstantiateContract{ + instantiateCalleeMsg := &wasm.MsgInstantiateContract{ Sender: addr1, CodeID: calleeCodeId, Label: "number", @@ -288,7 +289,7 @@ func TestDynamicCallAndTraditionalQueryWork(t *testing.T) { // instantiate caller contract cosmwasmInstantiateCallerMsg := fmt.Sprintf(`{"callee_addr":"%s"}`, calleeContractAddress) - instantiateCallerMsg := &MsgInstantiateContract{ + instantiateCallerMsg := &wasm.MsgInstantiateContract{ Sender: addr1, CodeID: callerCodeId, Label: "call-number", @@ -302,7 +303,7 @@ func TestDynamicCallAndTraditionalQueryWork(t *testing.T) { // traditional queries from caller queryPath := []string{ - QueryGetContractState, + wasm.QueryGetContractState, callerContractAddress, keeper.QueryMethodContractStateSmart, } @@ -319,7 +320,7 @@ func TestDynamicCallAndTraditionalQueryWork(t *testing.T) { // execute mul cosmwasmExecuteMsg := `{"mul":{"value":2}}` - executeMsg := MsgExecuteContract{ + executeMsg := wasm.MsgExecuteContract{ Sender: addr1, Contract: callerContractAddress, Msg: []byte(cosmwasmExecuteMsg), @@ -352,7 +353,7 @@ func TestDynamicCallWithWriteFailsByQuery(t *testing.T) { q := data.module.LegacyQuerierHandler(nil) // store callee code (number) - storeCalleeMsg := &MsgStoreCode{ + storeCalleeMsg := &wasm.MsgStoreCode{ Sender: addr1, WASMByteCode: numberContract, } @@ -363,7 +364,7 @@ func TestDynamicCallWithWriteFailsByQuery(t *testing.T) { assertStoreCodeResponse(t, res.Data, calleeCodeId) // store caller code (call-number) - storeCallerMsg := &MsgStoreCode{ + storeCallerMsg := &wasm.MsgStoreCode{ Sender: addr1, WASMByteCode: callNumberContract, } @@ -374,7 +375,7 @@ func TestDynamicCallWithWriteFailsByQuery(t *testing.T) { assertStoreCodeResponse(t, res.Data, callerCodeId) // instantiate callee contract - instantiateCalleeMsg := &MsgInstantiateContract{ + instantiateCalleeMsg := &wasm.MsgInstantiateContract{ Sender: addr1, CodeID: calleeCodeId, Label: "number", @@ -388,7 +389,7 @@ func TestDynamicCallWithWriteFailsByQuery(t *testing.T) { // instantiate caller contract cosmwasmInstantiateCallerMsg := fmt.Sprintf(`{"callee_addr":"%s"}`, calleeContractAddress) - instantiateCallerMsg := &MsgInstantiateContract{ + instantiateCallerMsg := &wasm.MsgInstantiateContract{ Sender: addr1, CodeID: callerCodeId, Label: "call-number", @@ -402,7 +403,7 @@ func TestDynamicCallWithWriteFailsByQuery(t *testing.T) { // query which tries to write value to storage queryPath := []string{ - QueryGetContractState, + wasm.QueryGetContractState, callerContractAddress, keeper.QueryMethodContractStateSmart, } @@ -419,7 +420,7 @@ func TestDynamicCallCalleeFails(t *testing.T) { h := data.module.Route().Handler() // store dynamic callee code - storeCalleeMsg := &MsgStoreCode{ + storeCalleeMsg := &wasm.MsgStoreCode{ Sender: addr1, WASMByteCode: calleeContract, } @@ -430,7 +431,7 @@ func TestDynamicCallCalleeFails(t *testing.T) { assertStoreCodeResponse(t, res.Data, calleeCodeId) // store dynamic caller code - storeCallerMsg := &MsgStoreCode{ + storeCallerMsg := &wasm.MsgStoreCode{ Sender: addr1, WASMByteCode: callerContract, } @@ -441,7 +442,7 @@ func TestDynamicCallCalleeFails(t *testing.T) { assertStoreCodeResponse(t, res.Data, callerCodeId) // instantiate callee contract - instantiateCalleeMsg := &MsgInstantiateContract{ + instantiateCalleeMsg := &wasm.MsgInstantiateContract{ Sender: addr1, CodeID: calleeCodeId, Label: "callee", @@ -455,7 +456,7 @@ func TestDynamicCallCalleeFails(t *testing.T) { // instantiate caller contract cosmwasmInstantiateCallerMsg := fmt.Sprintf(`{"callee_addr":"%s"}`, calleeContractAddress) - instantiateCallerMsg := &MsgInstantiateContract{ + instantiateCallerMsg := &wasm.MsgInstantiateContract{ Sender: addr1, CodeID: callerCodeId, Label: "caller", @@ -469,7 +470,7 @@ func TestDynamicCallCalleeFails(t *testing.T) { // execute do_panic cosmwasmExecuteMsg := `{"do_panic":{}}` - executeMsg := MsgExecuteContract{ + executeMsg := wasm.MsgExecuteContract{ Sender: addr1, Contract: callerContractAddress, Msg: []byte(cosmwasmExecuteMsg), diff --git a/x/wasmplus/handler.go b/x/wasmplus/handler.go new file mode 100644 index 0000000000..b84a080e9a --- /dev/null +++ b/x/wasmplus/handler.go @@ -0,0 +1,31 @@ +package wasmplus + +import ( + "github.com/gogo/protobuf/proto" + + sdk "github.com/line/lbm-sdk/types" + + "github.com/line/wasmd/x/wasm" + wasmtypes "github.com/line/wasmd/x/wasm/types" + "github.com/line/wasmd/x/wasmplus/keeper" + "github.com/line/wasmd/x/wasmplus/types" +) + +func NewHandler(k wasmtypes.ContractOpsKeeper) sdk.Handler { + msgServer := keeper.NewMsgServerImpl(k) + wasmHandler := wasm.NewHandler(k) + + return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { + var ( + res proto.Message + err error + ) + switch msg := msg.(type) { + case *types.MsgStoreCodeAndInstantiateContract: + res, err = msgServer.StoreCodeAndInstantiateContract(sdk.WrapSDKContext(ctx), msg) + default: + return wasmHandler(ctx, msg) + } + return sdk.WrapServiceResult(ctx, res, err) + } +} diff --git a/x/wasmplus/keeper/api.go b/x/wasmplus/keeper/api.go new file mode 100644 index 0000000000..ba78ef3cea --- /dev/null +++ b/x/wasmplus/keeper/api.go @@ -0,0 +1,99 @@ +package keeper + +import ( + "fmt" + + sdk "github.com/line/lbm-sdk/types" + wasmkeeper "github.com/line/wasmd/x/wasm/keeper" + "github.com/line/wasmd/x/wasm/types" + wasmplustypes "github.com/line/wasmd/x/wasmplus/types" + wasmvm "github.com/line/wasmvm" +) + +type cosmwasmAPIImpl struct { + keeper *Keeper + ctx *sdk.Context +} + +func (a cosmwasmAPIImpl) callCallablePoint(contractAddrStr string, name []byte, args []byte, isReadonly bool, callstack []byte, gasLimit uint64) ([]byte, uint64, error) { + contractAddr := sdk.MustAccAddressFromBech32(contractAddrStr) + contractInfo, codeInfo, prefixStore, err := a.keeper.ContractInstance(*a.ctx, contractAddr) + if err != nil { + return nil, 0, err + } + + if a.keeper.IsInactiveContract(*a.ctx, contractAddr) { + return nil, 0, fmt.Errorf("called contract cannot be executed") + } + + env := types.NewEnv(*a.ctx, contractAddr) + wasmStore := wasmplustypes.NewWasmStore(prefixStore) + gasRegister := a.keeper.GetGasRegister() + querier := wasmkeeper.NewQueryHandler(*a.ctx, a.keeper.GetWasmVMQueryHandler(), contractAddr, gasRegister) + gasMeter := a.keeper.GasMeter(*a.ctx) + api := a.keeper.CosmwasmAPI(*a.ctx) + + instantiateCost := gasRegister.ToWasmVMGas(gasRegister.InstantiateContractCosts(a.keeper.IsPinnedCode(*a.ctx, contractInfo.CodeID), len(args))) + if gasLimit < instantiateCost { + return nil, 0, fmt.Errorf("lack of gas for calling callable point") + } + wasmGasLimit := gasLimit - instantiateCost + + result, events, attrs, gas, err := a.keeper.GetWasmVM().CallCallablePoint(name, codeInfo.CodeHash, isReadonly, callstack, env, args, wasmStore, api, querier, gasMeter, wasmGasLimit, wasmkeeper.CostJSONDeserialization) + gas += instantiateCost + if err != nil { + return nil, gas, err + } + + if !isReadonly { + // issue events and attrs + if len(attrs) != 0 { + eventsByAttr, err := newCallablePointEvent(attrs, contractAddr, callstack) + if err != nil { + return nil, gas, err + } + a.ctx.EventManager().EmitEvents(eventsByAttr) + } + + if len(events) != 0 { + customEvents, err := newCustomCallablePointEvents(events, contractAddr, callstack) + if err != nil { + return nil, gas, err + } + a.ctx.EventManager().EmitEvents(customEvents) + } + } + + return result, gas, err +} + +// returns result, gas used, error +func (a cosmwasmAPIImpl) validateInterface(contractAddrStr string, expectedInterface []byte) ([]byte, uint64, error) { + contractAddr := sdk.MustAccAddressFromBech32(contractAddrStr) + + if a.keeper.IsInactiveContract(*a.ctx, contractAddr) { + return nil, 0, fmt.Errorf("try to validate a contract cannot be executed") + } + + _, codeInfo, _, err := a.keeper.ContractInstance(*a.ctx, contractAddr) + if err != nil { + return nil, 0, err + } + + result, err := a.keeper.GetWasmVM().ValidateDynamicLinkInterface(codeInfo.CodeHash, expectedInterface) + + return result, 0, err +} + +func (k *Keeper) CosmwasmAPI(ctx sdk.Context) wasmvm.GoAPI { + x := cosmwasmAPIImpl{ + keeper: k, + ctx: &ctx, + } + return wasmvm.GoAPI{ + HumanAddress: wasmkeeper.HumanAddress, + CanonicalAddress: wasmkeeper.CanonicalAddress, + CallCallablePoint: x.callCallablePoint, + ValidateInterface: x.validateInterface, + } +} diff --git a/x/wasm/keeper/api_test.go b/x/wasmplus/keeper/api_test.go similarity index 90% rename from x/wasm/keeper/api_test.go rename to x/wasmplus/keeper/api_test.go index 4cc997035c..5a05788cd0 100644 --- a/x/wasm/keeper/api_test.go +++ b/x/wasmplus/keeper/api_test.go @@ -6,17 +6,17 @@ import ( "testing" sdk "github.com/line/lbm-sdk/types" - wasmtype "github.com/line/wasmd/x/wasm/types" wasmvm "github.com/line/wasmvm" + wasmkeeper "github.com/line/wasmd/x/wasm/keeper" wasmvmtypes "github.com/line/wasmvm/types" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func newAPI(t *testing.T) wasmvm.GoAPI { - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) - return keepers.WasmKeeper.cosmwasmAPI(ctx) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) + return keepers.WasmKeeper.CosmwasmAPI(ctx) } func TestAPIHumanAddress(t *testing.T) { @@ -31,13 +31,13 @@ func TestAPIHumanAddress(t *testing.T) { result, gas, err := api.HumanAddress(bz) require.NoError(t, err) assert.Equal(t, addr, result) - assert.Equal(t, wasmtype.DefaultGasMultiplier*5, gas) + assert.Equal(t, wasmkeeper.CostHumanize, gas) }) t.Run("invalid address", func(t *testing.T) { _, gas, err := api.HumanAddress([]byte("invalid_address")) require.Error(t, err) - assert.Equal(t, wasmtype.DefaultGasMultiplier*5, gas) + assert.Equal(t, wasmkeeper.CostHumanize, gas) }) } @@ -52,27 +52,27 @@ func TestAPICanonicalAddress(t *testing.T) { result, gas, err := api.CanonicalAddress(addr) require.NoError(t, err) assert.Equal(t, expected.Bytes(), result) - assert.Equal(t, wasmtype.DefaultGasMultiplier*4, gas) + assert.Equal(t, wasmkeeper.CostCanonical, gas) }) t.Run("invalid address", func(t *testing.T) { _, gas, err := api.CanonicalAddress("invalid_address") assert.Error(t, err) - assert.Equal(t, wasmtype.DefaultGasMultiplier*4, gas) + assert.Equal(t, wasmkeeper.CostCanonical, gas) }) } func TestCallCallablePoint(t *testing.T) { // prepare ctx and keeper - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) // instantiate an events contract numberWasm, err := ioutil.ReadFile("../testdata/events.wasm") require.NoError(t, err) deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) em := sdk.NewEventManager() - codeID, err := keepers.ContractKeeper.Create(ctx.WithEventManager(em), creator, numberWasm, nil) + codeID, _, err := keepers.ContractKeeper.Create(ctx.WithEventManager(em), creator, numberWasm, nil) require.NoError(t, err) initMsg := []byte(`{}`) contractAddr, _, err := keepers.ContractKeeper.Instantiate(ctx.WithEventManager(em), codeID, creator, nil, initMsg, "events", nil) @@ -80,10 +80,10 @@ func TestCallCallablePoint(t *testing.T) { callstack := []sdk.AccAddress{RandomAccountAddress(t), RandomAccountAddress(t)} callstackBin, err := json.Marshal(callstack) require.NoError(t, err) - var gasLimit uint64 = keepers.WasmKeeper.getGasMultiplier(ctx).ToWasmVMGas(400_000) + var gasLimit uint64 = keepers.WasmKeeper.GetGasRegister().ToWasmVMGas(400_000) // prepare API - api := keepers.WasmKeeper.cosmwasmAPI(ctx.WithEventManager(em)) + api := keepers.WasmKeeper.CosmwasmAPI(ctx.WithEventManager(em)) // prepare arg for succeed eventsIn := wasmvmtypes.Events{ @@ -229,22 +229,22 @@ func TestCallCallablePoint(t *testing.T) { func TestValidateDynamicLinkInterface(t *testing.T) { // prepare ctx and keeper - ctx, keepers := CreateTestInput(t, false, SupportedFeatures, nil, nil) + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) // instantiate an events contract numberWasm, err := ioutil.ReadFile("../testdata/events.wasm") require.NoError(t, err) deposit := sdk.NewCoins(sdk.NewInt64Coin("denom", 100000)) - creator := keepers.Faucet.NewFundedAccount(ctx, deposit...) + creator := keepers.Faucet.NewFundedRandomAccount(ctx, deposit...) em := sdk.NewEventManager() - codeID, err := keepers.ContractKeeper.Create(ctx.WithEventManager(em), creator, numberWasm, nil) + codeID, _, err := keepers.ContractKeeper.Create(ctx.WithEventManager(em), creator, numberWasm, nil) require.NoError(t, err) initMsg := []byte(`{}`) contractAddr, _, err := keepers.ContractKeeper.Instantiate(ctx.WithEventManager(em), codeID, creator, nil, initMsg, "events", nil) require.NoError(t, err) // prepare API - api := keepers.WasmKeeper.cosmwasmAPI(ctx.WithEventManager(em)) + api := keepers.WasmKeeper.CosmwasmAPI(ctx.WithEventManager(em)) t.Run("succeed valid", func(t *testing.T) { validInterface := []byte(`[{"name":"add_event_dyn","ty":{"params":["I32","I32","I32"],"results":[]}},{"name":"add_events_dyn","ty":{"params":["I32","I32"],"results":[]}},{"name":"add_attribute_dyn","ty":{"params":["I32","I32","I32"],"results":[]}},{"name":"add_attributes_dyn","ty":{"params":["I32","I32"],"results":[]}}]`) diff --git a/x/wasmplus/keeper/bench_test.go b/x/wasmplus/keeper/bench_test.go new file mode 100644 index 0000000000..153024ecdb --- /dev/null +++ b/x/wasmplus/keeper/bench_test.go @@ -0,0 +1,40 @@ +package keeper + +import ( + "testing" + + "github.com/stretchr/testify/require" + dbm "github.com/tendermint/tm-db" + + sdk "github.com/line/lbm-sdk/types" + + "github.com/line/wasmd/x/wasm/types" +) + +func BenchmarkAPI(b *testing.B) { + wasmConfig := types.WasmConfig{MemoryCacheSize: 0} + ctx, keepers := createTestInput(b, false, AvailableCapabilities, wasmConfig, dbm.NewMemDB()) + example := InstantiateHackatomExampleContract(b, ctx, keepers) + api := keepers.WasmKeeper.CosmwasmAPI(ctx) + addrStr := example.Contract.String() + addrBytes, err := sdk.AccAddressFromBech32(example.Contract.String()) + require.NoError(b, err) + + b.Run("CanonicalAddress", func(b *testing.B) { + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, _, err := api.CanonicalAddress(addrStr) + require.NoError(b, err) + } + }) + + b.Run("HumanAddress", func(b *testing.B) { + b.ReportAllocs() + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, _, err := api.HumanAddress(addrBytes) + require.NoError(b, err) + } + }) +} diff --git a/x/wasmplus/keeper/contract_keeper.go b/x/wasmplus/keeper/contract_keeper.go new file mode 100644 index 0000000000..37f5312afe --- /dev/null +++ b/x/wasmplus/keeper/contract_keeper.go @@ -0,0 +1,62 @@ +package keeper + +import ( + sdk "github.com/line/lbm-sdk/types" + sdkerrors "github.com/line/lbm-sdk/types/errors" + + wasmkeeper "github.com/line/wasmd/x/wasm/keeper" + "github.com/line/wasmd/x/wasmplus/types" +) + +var _ types.ContractOpsKeeper = PermissionedKeeper{} + +type decoratedKeeper interface { + types.ViewKeeper + activateContract(ctx sdk.Context, contractAddress sdk.AccAddress) error + deactivateContract(ctx sdk.Context, contractAddress sdk.AccAddress) error +} + +type PermissionedKeeper struct { + wasmkeeper.PermissionedKeeper + extended decoratedKeeper +} + +func NewPermissionedKeeper(k wasmkeeper.PermissionedKeeper, extended decoratedKeeper) *PermissionedKeeper { + return &PermissionedKeeper{k, extended} +} + +func (p PermissionedKeeper) Execute(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, msg []byte, coins sdk.Coins) ([]byte, error) { + if p.extended.IsInactiveContract(ctx, contractAddress) { + return nil, sdkerrors.Wrap(types.ErrInactiveContract, "can not execute") + } + return p.PermissionedKeeper.Execute(ctx, contractAddress, caller, msg, coins) +} + +func (p PermissionedKeeper) Migrate(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, newCodeID uint64, msg []byte) ([]byte, error) { + if p.extended.IsInactiveContract(ctx, contractAddress) { + return nil, sdkerrors.Wrap(types.ErrInactiveContract, "can not execute") + } + return p.PermissionedKeeper.Migrate(ctx, contractAddress, caller, newCodeID, msg) +} + +func (p PermissionedKeeper) UpdateContractAdmin(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress, newAdmin sdk.AccAddress) error { + if p.extended.IsInactiveContract(ctx, contractAddress) { + return sdkerrors.Wrap(types.ErrInactiveContract, "can not execute") + } + return p.PermissionedKeeper.UpdateContractAdmin(ctx, contractAddress, caller, newAdmin) +} + +func (p PermissionedKeeper) ClearContractAdmin(ctx sdk.Context, contractAddress sdk.AccAddress, caller sdk.AccAddress) error { + if p.extended.IsInactiveContract(ctx, contractAddress) { + return sdkerrors.Wrap(types.ErrInactiveContract, "can not execute") + } + return p.PermissionedKeeper.ClearContractAdmin(ctx, contractAddress, caller) +} + +func (p PermissionedKeeper) DeactivateContract(ctx sdk.Context, contractAddress sdk.AccAddress) error { + return p.extended.deactivateContract(ctx, contractAddress) +} + +func (p PermissionedKeeper) ActivateContract(ctx sdk.Context, contractAddress sdk.AccAddress) error { + return p.extended.activateContract(ctx, contractAddress) +} diff --git a/x/wasmplus/keeper/contract_keeper_test.go b/x/wasmplus/keeper/contract_keeper_test.go new file mode 100644 index 0000000000..fa1075401d --- /dev/null +++ b/x/wasmplus/keeper/contract_keeper_test.go @@ -0,0 +1,83 @@ +package keeper + +import ( + "encoding/json" + "fmt" + "testing" + + "github.com/stretchr/testify/require" + + wasmkeeper "github.com/line/wasmd/x/wasm/keeper" +) + +func mustMarshal(t *testing.T, r interface{}) []byte { + t.Helper() + bz, err := json.Marshal(r) + require.NoError(t, err) + return bz +} + +func TestInactivateContract(t *testing.T) { + parentCtx, keepers := CreateTestInput(t, false, AvailableCapabilities) + example := InstantiateHackatomExampleContract(t, parentCtx, keepers) + otherContract := StoreHackatomExampleContract(t, parentCtx, keepers) + newVerifier := RandomAccountAddress(t) + newAdmin := RandomAccountAddress(t) + migrateMsg := []byte(fmt.Sprintf("{\"verifier\":\"%s\"}", newVerifier.String())) + + contractKeeper := NewPermissionedKeeper(*wasmkeeper.NewDefaultPermissionKeeper(keepers.WasmKeeper), keepers.WasmKeeper) + + var err error + // deactivate state + { + // check execute + _, err := contractKeeper.Execute(parentCtx, example.Contract, example.VerifierAddr, []byte(`{"release":{}}`), nil) + require.NoError(t, err) + + // check Migrate + _, err = contractKeeper.Migrate(parentCtx, example.Contract, example.CreatorAddr, otherContract.CodeID, migrateMsg) + require.NoError(t, err) + + // check update contract admin + err = contractKeeper.UpdateContractAdmin(parentCtx, example.Contract, example.CreatorAddr, newAdmin) + require.NoError(t, err) + + // check clear contract admin + err = contractKeeper.ClearContractAdmin(parentCtx, example.Contract, newAdmin) + require.NoError(t, err) + } + + // set deactivate + err = contractKeeper.DeactivateContract(parentCtx, example.Contract) + require.NoError(t, err) + + // deactivate state + { + // check execute + _, err = contractKeeper.Execute(parentCtx, example.Contract, newVerifier, []byte(`{"release":{}}`), nil) + require.Error(t, err) + + // check migrate + _, err = contractKeeper.Migrate(parentCtx, example.Contract, example.CreatorAddr, otherContract.CodeID, migrateMsg) + require.Error(t, err) + + // check update contract admin + err = contractKeeper.UpdateContractAdmin(parentCtx, example.Contract, example.CreatorAddr, newAdmin) + require.Error(t, err) + + // check clear contract admin + err = contractKeeper.ClearContractAdmin(parentCtx, example.Contract, newAdmin) + require.Error(t, err) + } + + // set activate + err = contractKeeper.ActivateContract(parentCtx, example.Contract) + require.NoError(t, err) + + // activate state + { + // check execute + _, err = contractKeeper.Execute(parentCtx, example.Contract, newVerifier, []byte(`{"release":{}}`), nil) + require.NoError(t, err) + } +} diff --git a/x/wasmplus/keeper/events.go b/x/wasmplus/keeper/events.go new file mode 100644 index 0000000000..8c387fe2d1 --- /dev/null +++ b/x/wasmplus/keeper/events.go @@ -0,0 +1,50 @@ +package keeper + +import ( + "fmt" + "strings" + + sdk "github.com/line/lbm-sdk/types" + sdkerrors "github.com/line/lbm-sdk/types/errors" + wasmvmtypes "github.com/line/wasmvm/types" + + wasmkeeper "github.com/line/wasmd/x/wasm/keeper" + "github.com/line/wasmd/x/wasm/types" + wasmplustypes "github.com/line/wasmd/x/wasmplus/types" +) + +func newCallablePointEvent(customAttributes []wasmvmtypes.EventAttribute, contractAddr sdk.AccAddress, callstack []byte) (sdk.Events, error) { + attrs, err := callablePointSDKEventAttributes(customAttributes, contractAddr, callstack) + + if err != nil { + return nil, err + } + + return sdk.Events{sdk.NewEvent(wasmplustypes.CallablePointEventType, attrs...)}, nil +} + +func newCustomCallablePointEvents(evts wasmvmtypes.Events, contractAddr sdk.AccAddress, callstack []byte) (sdk.Events, error) { + events := make(sdk.Events, 0, len(evts)) + for _, e := range evts { + typ := strings.TrimSpace(e.Type) + if len(typ) <= wasmkeeper.EventTypeMinLength { + return nil, sdkerrors.Wrap(types.ErrInvalidEvent, fmt.Sprintf("Event type too short: '%s'", typ)) + } + attributes, err := callablePointSDKEventAttributes(e.Attributes, contractAddr, callstack) + if err != nil { + return nil, err + } + events = append(events, sdk.NewEvent(fmt.Sprintf("%s%s", wasmplustypes.CustomCallablePointEventPrefix, typ), attributes...)) + } + return events, nil +} + +func callablePointSDKEventAttributes(customAttributes []wasmvmtypes.EventAttribute, contractAddr sdk.AccAddress, callstack []byte) ([]sdk.Attribute, error) { + attrs, err := wasmkeeper.ContractSDKEventAttributes(customAttributes, contractAddr) + if err != nil { + return nil, err + } + // attrs[0] is addr + attrs = append([]sdk.Attribute{attrs[0], sdk.NewAttribute(wasmplustypes.AttributeKeyCallstack, string(callstack))}, attrs[1:]...) + return attrs, nil +} diff --git a/x/wasmplus/keeper/events_test.go b/x/wasmplus/keeper/events_test.go new file mode 100644 index 0000000000..c1d8d72c6a --- /dev/null +++ b/x/wasmplus/keeper/events_test.go @@ -0,0 +1,249 @@ +package keeper + +import ( + "encoding/json" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + sdk "github.com/line/lbm-sdk/types" + wasmvmtypes "github.com/line/wasmvm/types" +) + +func TestNewCustomCallablePointEvents(t *testing.T) { + myContract := RandomAccountAddress(t) + myCallstack := []sdk.AccAddress{RandomAccountAddress(t), RandomAccountAddress(t)} + myCallstackBinary, err := json.Marshal(myCallstack) + require.NoError(t, err) + specs := map[string]struct { + src wasmvmtypes.Events + exp sdk.Events + isError bool + }{ + "all good": { + src: wasmvmtypes.Events{{ + Type: "foo", + Attributes: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: "myVal"}}, + }}, + exp: sdk.Events{sdk.NewEvent("wasm-callablepoint-foo", + sdk.NewAttribute("_contract_address", myContract.String()), + sdk.NewAttribute("_callstack", string(myCallstackBinary)), + sdk.NewAttribute("myKey", "myVal"))}, + }, + "multiple attributes": { + src: wasmvmtypes.Events{{ + Type: "foo", + Attributes: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: "myVal"}, + {Key: "myOtherKey", Value: "myOtherVal"}}, + }}, + exp: sdk.Events{sdk.NewEvent("wasm-callablepoint-foo", + sdk.NewAttribute("_contract_address", myContract.String()), + sdk.NewAttribute("_callstack", string(myCallstackBinary)), + sdk.NewAttribute("myKey", "myVal"), + sdk.NewAttribute("myOtherKey", "myOtherVal"))}, + }, + "multiple events": { + src: wasmvmtypes.Events{{ + Type: "foo", + Attributes: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: "myVal"}}, + }, { + Type: "bar", + Attributes: []wasmvmtypes.EventAttribute{{Key: "otherKey", Value: "otherVal"}}, + }}, + exp: sdk.Events{ + sdk.NewEvent("wasm-callablepoint-foo", + sdk.NewAttribute("_contract_address", myContract.String()), + sdk.NewAttribute("_callstack", string(myCallstackBinary)), + sdk.NewAttribute("myKey", "myVal")), + sdk.NewEvent("wasm-callablepoint-bar", + sdk.NewAttribute("_contract_address", myContract.String()), + sdk.NewAttribute("_callstack", string(myCallstackBinary)), + sdk.NewAttribute("otherKey", "otherVal")), + }, + }, + "without attributes": { + src: wasmvmtypes.Events{{ + Type: "foo", + }}, + exp: sdk.Events{sdk.NewEvent("wasm-callablepoint-foo", + sdk.NewAttribute("_contract_address", myContract.String()), + sdk.NewAttribute("_callstack", string(myCallstackBinary))), + }, + }, + "error on short event type": { + src: wasmvmtypes.Events{{ + Type: "f", + }}, + isError: true, + }, + "error on _contract_address": { + src: wasmvmtypes.Events{{ + Type: "foo", + Attributes: []wasmvmtypes.EventAttribute{{Key: "_contract_address", Value: RandomBech32AccountAddress(t)}}, + }}, + isError: true, + }, + "error on reserved prefix": { + src: wasmvmtypes.Events{{ + Type: "wasm", + Attributes: []wasmvmtypes.EventAttribute{ + {Key: "_reserved", Value: "is skipped"}, + {Key: "normal", Value: "is used"}}, + }}, + isError: true, + }, + "error on empty value": { + src: wasmvmtypes.Events{{ + Type: "boom", + Attributes: []wasmvmtypes.EventAttribute{ + {Key: "some", Value: "data"}, + {Key: "key", Value: ""}, + }, + }}, + isError: true, + }, + "error on empty key": { + src: wasmvmtypes.Events{{ + Type: "boom", + Attributes: []wasmvmtypes.EventAttribute{ + {Key: "some", Value: "data"}, + {Key: "", Value: "value"}, + }, + }}, + isError: true, + }, + "error on whitespace type": { + src: wasmvmtypes.Events{{ + Type: " f ", + Attributes: []wasmvmtypes.EventAttribute{ + {Key: "some", Value: "data"}, + }, + }}, + isError: true, + }, + "error on only whitespace key": { + src: wasmvmtypes.Events{{ + Type: "boom", + Attributes: []wasmvmtypes.EventAttribute{ + {Key: "some", Value: "data"}, + {Key: "\n\n\n\n", Value: "value"}, + }, + }}, + isError: true, + }, + "error on only whitespace value": { + src: wasmvmtypes.Events{{ + Type: "boom", + Attributes: []wasmvmtypes.EventAttribute{ + {Key: "some", Value: "data"}, + {Key: "myKey", Value: " \t\r\n"}, + }, + }}, + isError: true, + }, + "strip out whitespace": { + src: wasmvmtypes.Events{{ + Type: " food\n", + Attributes: []wasmvmtypes.EventAttribute{{Key: "my Key", Value: "\tmyVal"}}, + }}, + exp: sdk.Events{sdk.NewEvent("wasm-callablepoint-food", + sdk.NewAttribute("_contract_address", myContract.String()), + sdk.NewAttribute("_callstack", string(myCallstackBinary)), + + sdk.NewAttribute("my Key", "myVal"))}, + }, + "empty event elements": { + src: make(wasmvmtypes.Events, 10), + isError: true, + }, + "nil": { + exp: sdk.Events{}, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + gotEvent, err := newCustomCallablePointEvents(spec.src, myContract, myCallstackBinary) + if spec.isError { + assert.Error(t, err) + } else { + assert.NoError(t, err) + assert.Equal(t, spec.exp, gotEvent) + } + }) + } +} + +func TestNewCallablePointEvent(t *testing.T) { + myContract := RandomAccountAddress(t) + myCallstack := []sdk.AccAddress{RandomAccountAddress(t), RandomAccountAddress(t)} + myCallstackBinary, err := json.Marshal(myCallstack) + require.NoError(t, err) + specs := map[string]struct { + src []wasmvmtypes.EventAttribute + exp sdk.Events + isError bool + }{ + "all good": { + src: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: "myVal"}}, + exp: sdk.Events{sdk.NewEvent("wasm-callablepoint", + sdk.NewAttribute("_contract_address", myContract.String()), + sdk.NewAttribute("_callstack", string(myCallstackBinary)), + sdk.NewAttribute("myKey", "myVal"))}, + }, + "multiple attributes": { + src: []wasmvmtypes.EventAttribute{{Key: "myKey", Value: "myVal"}, + {Key: "myOtherKey", Value: "myOtherVal"}}, + exp: sdk.Events{sdk.NewEvent("wasm-callablepoint", + sdk.NewAttribute("_contract_address", myContract.String()), + sdk.NewAttribute("_callstack", string(myCallstackBinary)), + sdk.NewAttribute("myKey", "myVal"), + sdk.NewAttribute("myOtherKey", "myOtherVal"))}, + }, + "without attributes": { + exp: sdk.Events{sdk.NewEvent("wasm-callablepoint", + sdk.NewAttribute("_contract_address", myContract.String()), sdk.NewAttribute("_callstack", string(myCallstackBinary))), + }, + }, + "error on _contract_address": { + src: []wasmvmtypes.EventAttribute{{Key: "_contract_address", Value: RandomBech32AccountAddress(t)}}, + isError: true, + }, + "error on whitespace key": { + src: []wasmvmtypes.EventAttribute{{Key: " ", Value: "value"}}, + isError: true, + }, + "error on whitespace value": { + src: []wasmvmtypes.EventAttribute{{Key: "key", Value: "\n\n\n"}}, + isError: true, + }, + "strip whitespace": { + src: []wasmvmtypes.EventAttribute{{Key: " my-real-key ", Value: "\n\n\nsome-val\t\t\t"}}, + exp: sdk.Events{sdk.NewEvent("wasm-callablepoint", + sdk.NewAttribute("_contract_address", myContract.String()), + sdk.NewAttribute("_callstack", string(myCallstackBinary)), + sdk.NewAttribute("my-real-key", "some-val"))}, + }, + "empty elements": { + src: make([]wasmvmtypes.EventAttribute, 10), + isError: true, + }, + "nil": { + exp: sdk.Events{sdk.NewEvent("wasm-callablepoint", + sdk.NewAttribute("_contract_address", myContract.String()), + sdk.NewAttribute("_callstack", string(myCallstackBinary)), + )}, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + gotEvent, err := newCallablePointEvent(spec.src, myContract, myCallstackBinary) + if spec.isError { + assert.Error(t, err) + } else { + assert.NoError(t, err) + assert.Equal(t, spec.exp, gotEvent) + } + }) + } +} diff --git a/x/wasmplus/keeper/genesis.go b/x/wasmplus/keeper/genesis.go new file mode 100644 index 0000000000..6893ca3ad3 --- /dev/null +++ b/x/wasmplus/keeper/genesis.go @@ -0,0 +1,55 @@ +package keeper + +import ( + abci "github.com/tendermint/tendermint/abci/types" + + sdk "github.com/line/lbm-sdk/types" + sdkerrors "github.com/line/lbm-sdk/types/errors" + + wasmkeeper "github.com/line/wasmd/x/wasm/keeper" + "github.com/line/wasmd/x/wasmplus/types" +) + +func InitGenesis( + ctx sdk.Context, + keeper *Keeper, + data types.GenesisState, + stakingKeeper wasmkeeper.ValidatorSetSource, + msgHandler sdk.Handler, +) ([]abci.ValidatorUpdate, error) { + result, err := wasmkeeper.InitGenesis(ctx, &keeper.Keeper, data.RawWasmState(), stakingKeeper, msgHandler) + if err != nil { + return nil, sdkerrors.Wrap(err, "wasm") + } + + // set InactiveContractAddresses + for i, contractAddr := range data.InactiveContractAddresses { + inactiveContractAddr := sdk.MustAccAddressFromBech32(contractAddr) + err = keeper.deactivateContract(ctx, inactiveContractAddr) + if err != nil { + return nil, sdkerrors.Wrapf(err, "contract number %d", i) + } + } + + return result, nil +} + +// ExportGenesis returns a GenesisState for a given context and keeper. +func ExportGenesis(ctx sdk.Context, keeper *Keeper) *types.GenesisState { + wasmState := wasmkeeper.ExportGenesis(ctx, &keeper.Keeper) + + genState := types.GenesisState{ + Params: wasmState.Params, + Codes: wasmState.Codes, + Contracts: wasmState.Contracts, + Sequences: wasmState.Sequences, + GenMsgs: wasmState.GenMsgs, + } + + keeper.IterateInactiveContracts(ctx, func(contractAddr sdk.AccAddress) (stop bool) { + genState.InactiveContractAddresses = append(genState.InactiveContractAddresses, contractAddr.String()) + return false + }) + + return &genState +} diff --git a/x/wasmplus/keeper/genesis_test.go b/x/wasmplus/keeper/genesis_test.go new file mode 100644 index 0000000000..732a0a664b --- /dev/null +++ b/x/wasmplus/keeper/genesis_test.go @@ -0,0 +1,631 @@ +package keeper + +import ( + "crypto/sha256" + "errors" + "os" + "testing" + "time" + + fuzz "github.com/google/gofuzz" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/proto/tendermint/crypto" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + dbm "github.com/tendermint/tm-db" + + "github.com/line/lbm-sdk/store" + sdk "github.com/line/lbm-sdk/types" + authkeeper "github.com/line/lbm-sdk/x/auth/keeper" + authtypes "github.com/line/lbm-sdk/x/auth/types" + banktypes "github.com/line/lbm-sdk/x/bank/types" + bankpluskeeper "github.com/line/lbm-sdk/x/bankplus/keeper" + distributionkeeper "github.com/line/lbm-sdk/x/distribution/keeper" + govtypes "github.com/line/lbm-sdk/x/gov/types" + paramskeeper "github.com/line/lbm-sdk/x/params/keeper" + paramstypes "github.com/line/lbm-sdk/x/params/types" + stakingkeeper "github.com/line/lbm-sdk/x/staking/keeper" + "github.com/line/ostracon/libs/log" + + "github.com/line/wasmd/x/wasm/keeper" + wasmkeeper "github.com/line/wasmd/x/wasm/keeper" + wasmTypes "github.com/line/wasmd/x/wasm/types" + "github.com/line/wasmd/x/wasmplus/types" +) + +const ( + firstCodeID = 1 + humanAddress = "link1hcttwju93d5m39467gjcq63p5kc4fdcn30dgd8" + + AvailableCapabilities = "iterator,staking,stargate,cosmwasm_1_1" +) + +func TestGenesisExportImport(t *testing.T) { + wasmKeeper, srcCtx, _ := setupKeeper(t) + contractKeeper := NewPermissionedKeeper(*wasmkeeper.NewGovPermissionKeeper(wasmKeeper), wasmKeeper) + + wasmCode, err := os.ReadFile("../../wasm/keeper/testdata/hackatom.wasm") + require.NoError(t, err) + + // store some test data + f := fuzz.New().Funcs(wasmkeeper.ModelFuzzers...) + + wasmKeeper.SetParams(srcCtx, wasmTypes.DefaultParams()) + + for i := 0; i < 5; i++ { + var ( + codeInfo wasmTypes.CodeInfo + contract wasmTypes.ContractInfo + stateModels []wasmTypes.Model + history []wasmTypes.ContractCodeHistoryEntry + pinned bool + contractExtension bool + verifier sdk.AccAddress + beneficiary sdk.AccAddress + ) + f.Fuzz(&codeInfo) + f.Fuzz(&contract) + f.Fuzz(&stateModels) + f.NilChance(0).Fuzz(&history) + f.Fuzz(&pinned) + f.Fuzz(&contractExtension) + f.Fuzz(&verifier) + f.Fuzz(&beneficiary) + + creatorAddr, err := sdk.AccAddressFromBech32(codeInfo.Creator) + require.NoError(t, err) + codeID, _, err := contractKeeper.Create(srcCtx, creatorAddr, wasmCode, &codeInfo.InstantiateConfig) + require.NoError(t, err) + if pinned { + err = contractKeeper.PinCode(srcCtx, codeID) + require.NoError(t, err) + } + if contractExtension { + anyTime := time.Now().UTC() + var nestedType govtypes.TextProposal + f.NilChance(0).Fuzz(&nestedType) + myExtension, err := govtypes.NewProposal(&nestedType, 1, anyTime, anyTime) + require.NoError(t, err) + err = contract.SetExtension(&myExtension) + require.NoError(t, err) + } + + initMsgBz := HackatomExampleInitMsg{ + Verifier: verifier, + Beneficiary: beneficiary, + }.GetBytes(t) + + _, _, err = contractKeeper.Instantiate(srcCtx, codeID, creatorAddr, creatorAddr, initMsgBz, "test", nil) + require.NoError(t, err) + } + var wasmParams wasmTypes.Params + f.NilChance(0).Fuzz(&wasmParams) + wasmKeeper.SetParams(srcCtx, wasmParams) + + // add inactiveContractAddr + var inactiveContractAddr []sdk.AccAddress + wasmKeeper.IterateContractInfo(srcCtx, func(address sdk.AccAddress, info wasmTypes.ContractInfo) bool { + err = contractKeeper.DeactivateContract(srcCtx, address) + require.NoError(t, err) + inactiveContractAddr = append(inactiveContractAddr, address) + return false + }) + + // export + exportedState := ExportGenesis(srcCtx, wasmKeeper) + exportedGenesis, err := wasmKeeper.cdc.MarshalJSON(exportedState) + require.NoError(t, err) + + // setup new instances + dstKeeper, dstCtx, _ := setupKeeper(t) + + // re-import + var importState types.GenesisState + err = dstKeeper.cdc.UnmarshalJSON(exportedGenesis, &importState) + require.NoError(t, err) + _, err = InitGenesis(dstCtx, dstKeeper, importState, &StakingKeeperMock{}, TestHandler(contractKeeper)) + require.NoError(t, err) + + // compare + dstParams := dstKeeper.GetParams(dstCtx) + require.Equal(t, wasmParams, dstParams) + + var destInactiveContractAddr []sdk.AccAddress + dstKeeper.IterateInactiveContracts(dstCtx, func(contractAddress sdk.AccAddress) (stop bool) { + destInactiveContractAddr = append(destInactiveContractAddr, contractAddress) + return false + }) + require.Equal(t, inactiveContractAddr, destInactiveContractAddr) +} + +func TestGenesisInit(t *testing.T) { + wasmCode, err := os.ReadFile("../../wasm/keeper/testdata/hackatom.wasm") + require.NoError(t, err) + + myCodeInfo := wasmTypes.CodeInfoFixture(wasmTypes.WithSHA256CodeHash(wasmCode)) + specs := map[string]struct { + src types.GenesisState + stakingMock StakingKeeperMock + msgHandlerMock MockMsgHandler + expSuccess bool + }{ + "happy path: code info correct": { + src: types.GenesisState{ + Codes: []wasmTypes.Code{{ + CodeID: firstCodeID, + CodeInfo: myCodeInfo, + CodeBytes: wasmCode, + }}, + Sequences: []wasmTypes.Sequence{ + {IDKey: wasmTypes.KeyLastCodeID, Value: 2}, + {IDKey: wasmTypes.KeyLastInstanceID, Value: 1}, + }, + Params: wasmTypes.DefaultParams(), + }, + expSuccess: true, + }, + "happy path: code ids can contain gaps": { + src: types.GenesisState{ + Codes: []wasmTypes.Code{{ + CodeID: firstCodeID, + CodeInfo: myCodeInfo, + CodeBytes: wasmCode, + }, { + CodeID: 3, + CodeInfo: myCodeInfo, + CodeBytes: wasmCode, + }}, + Sequences: []wasmTypes.Sequence{ + {IDKey: wasmTypes.KeyLastCodeID, Value: 10}, + {IDKey: wasmTypes.KeyLastInstanceID, Value: 1}, + }, + Params: wasmTypes.DefaultParams(), + }, + expSuccess: true, + }, + "happy path: code order does not matter": { + src: types.GenesisState{ + Codes: []wasmTypes.Code{{ + CodeID: 2, + CodeInfo: myCodeInfo, + CodeBytes: wasmCode, + }, { + CodeID: firstCodeID, + CodeInfo: myCodeInfo, + CodeBytes: wasmCode, + }}, + Contracts: nil, + Sequences: []wasmTypes.Sequence{ + {IDKey: wasmTypes.KeyLastCodeID, Value: 3}, + {IDKey: wasmTypes.KeyLastInstanceID, Value: 1}, + }, + Params: wasmTypes.DefaultParams(), + }, + expSuccess: true, + }, + "prevent code hash mismatch": {src: types.GenesisState{ + Codes: []wasmTypes.Code{{ + CodeID: firstCodeID, + CodeInfo: wasmTypes.CodeInfoFixture(func(i *wasmTypes.CodeInfo) { i.CodeHash = make([]byte, sha256.Size) }), + CodeBytes: wasmCode, + }}, + Params: wasmTypes.DefaultParams(), + }}, + "prevent duplicate codeIDs": {src: types.GenesisState{ + Codes: []wasmTypes.Code{ + { + CodeID: firstCodeID, + CodeInfo: myCodeInfo, + CodeBytes: wasmCode, + }, + { + CodeID: firstCodeID, + CodeInfo: myCodeInfo, + CodeBytes: wasmCode, + }, + }, + Params: wasmTypes.DefaultParams(), + }}, + "codes with same checksum can be pinned": { + src: types.GenesisState{ + Codes: []wasmTypes.Code{ + { + CodeID: firstCodeID, + CodeInfo: myCodeInfo, + CodeBytes: wasmCode, + Pinned: true, + }, + { + CodeID: 2, + CodeInfo: myCodeInfo, + CodeBytes: wasmCode, + Pinned: true, + }, + }, + Params: wasmTypes.DefaultParams(), + }, + }, + "happy path: code id in info and contract do match": { + src: types.GenesisState{ + Codes: []wasmTypes.Code{{ + CodeID: firstCodeID, + CodeInfo: myCodeInfo, + CodeBytes: wasmCode, + }}, + Contracts: []wasmTypes.Contract{ + { + ContractAddress: keeper.BuildContractAddressClassic(1, 1).String(), + ContractInfo: wasmTypes.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, wasmTypes.OnlyGenesisFields), + }, + }, + Sequences: []wasmTypes.Sequence{ + {IDKey: wasmTypes.KeyLastCodeID, Value: 2}, + {IDKey: wasmTypes.KeyLastInstanceID, Value: 2}, + }, + Params: wasmTypes.DefaultParams(), + }, + expSuccess: true, + }, + "happy path: code info with two contracts": { + src: types.GenesisState{ + Codes: []wasmTypes.Code{{ + CodeID: firstCodeID, + CodeInfo: myCodeInfo, + CodeBytes: wasmCode, + }}, + Contracts: []wasmTypes.Contract{ + { + ContractAddress: keeper.BuildContractAddressClassic(1, 1).String(), + ContractInfo: wasmTypes.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, wasmTypes.OnlyGenesisFields), + }, { + ContractAddress: keeper.BuildContractAddressClassic(1, 2).String(), + ContractInfo: wasmTypes.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, wasmTypes.OnlyGenesisFields), + }, + }, + Sequences: []wasmTypes.Sequence{ + {IDKey: wasmTypes.KeyLastCodeID, Value: 2}, + {IDKey: wasmTypes.KeyLastInstanceID, Value: 3}, + }, + Params: wasmTypes.DefaultParams(), + }, + expSuccess: true, + }, + "prevent contracts that points to non existing codeID": { + src: types.GenesisState{ + Contracts: []wasmTypes.Contract{ + { + ContractAddress: keeper.BuildContractAddressClassic(1, 1).String(), + ContractInfo: wasmTypes.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, wasmTypes.OnlyGenesisFields), + }, + }, + Params: wasmTypes.DefaultParams(), + }, + }, + "prevent duplicate contract address": { + src: types.GenesisState{ + Codes: []wasmTypes.Code{{ + CodeID: firstCodeID, + CodeInfo: myCodeInfo, + CodeBytes: wasmCode, + }}, + Contracts: []wasmTypes.Contract{ + { + ContractAddress: keeper.BuildContractAddressClassic(1, 1).String(), + ContractInfo: wasmTypes.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, wasmTypes.OnlyGenesisFields), + }, { + ContractAddress: keeper.BuildContractAddressClassic(1, 1).String(), + ContractInfo: wasmTypes.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, wasmTypes.OnlyGenesisFields), + }, + }, + Params: wasmTypes.DefaultParams(), + }, + }, + "prevent duplicate contract model keys": { + src: types.GenesisState{ + Codes: []wasmTypes.Code{{ + CodeID: firstCodeID, + CodeInfo: myCodeInfo, + CodeBytes: wasmCode, + }}, + Contracts: []wasmTypes.Contract{ + { + ContractAddress: keeper.BuildContractAddressClassic(1, 1).String(), + ContractInfo: wasmTypes.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, wasmTypes.OnlyGenesisFields), + ContractState: []wasmTypes.Model{ + { + Key: []byte{0x1}, + Value: []byte("foo"), + }, + { + Key: []byte{0x1}, + Value: []byte("bar"), + }, + }, + }, + }, + Params: wasmTypes.DefaultParams(), + }, + }, + "prevent duplicate sequences": { + src: types.GenesisState{ + Sequences: []wasmTypes.Sequence{ + {IDKey: []byte("foo"), Value: 1}, + {IDKey: []byte("foo"), Value: 9999}, + }, + Params: wasmTypes.DefaultParams(), + }, + }, + "prevent code id seq init value == max codeID used": { + src: types.GenesisState{ + Codes: []wasmTypes.Code{{ + CodeID: 2, + CodeInfo: myCodeInfo, + CodeBytes: wasmCode, + }}, + Sequences: []wasmTypes.Sequence{ + {IDKey: wasmTypes.KeyLastCodeID, Value: 1}, + }, + Params: wasmTypes.DefaultParams(), + }, + }, + "prevent contract id seq init value == count contracts": { + src: types.GenesisState{ + Codes: []wasmTypes.Code{{ + CodeID: firstCodeID, + CodeInfo: myCodeInfo, + CodeBytes: wasmCode, + }}, + Contracts: []wasmTypes.Contract{ + { + ContractAddress: keeper.BuildContractAddressClassic(1, 1).String(), + ContractInfo: wasmTypes.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, wasmTypes.OnlyGenesisFields), + }, + }, + Sequences: []wasmTypes.Sequence{ + {IDKey: wasmTypes.KeyLastCodeID, Value: 2}, + {IDKey: wasmTypes.KeyLastInstanceID, Value: 1}, + }, + Params: wasmTypes.DefaultParams(), + }, + }, + "validator set update called for any genesis messages": { + src: types.GenesisState{ + GenMsgs: []wasmTypes.GenesisState_GenMsgs{ + {Sum: &wasmTypes.GenesisState_GenMsgs_StoreCode{ + StoreCode: wasmTypes.MsgStoreCodeFixture(), + }}, + }, + Params: wasmTypes.DefaultParams(), + }, + stakingMock: StakingKeeperMock{expCalls: 1, validatorUpdate: []abci.ValidatorUpdate{ + { + PubKey: crypto.PublicKey{Sum: &crypto.PublicKey_Ed25519{ + Ed25519: []byte("a valid key"), + }}, + Power: 100, + }, + }}, + msgHandlerMock: MockMsgHandler{expCalls: 1, expMsg: wasmTypes.MsgStoreCodeFixture()}, + expSuccess: true, + }, + "validator set update not called on genesis msg handler errors": { + src: types.GenesisState{ + GenMsgs: []wasmTypes.GenesisState_GenMsgs{ + {Sum: &wasmTypes.GenesisState_GenMsgs_StoreCode{ + StoreCode: wasmTypes.MsgStoreCodeFixture(), + }}, + }, + Params: wasmTypes.DefaultParams(), + }, + msgHandlerMock: MockMsgHandler{expCalls: 1, err: errors.New("test error response")}, + stakingMock: StakingKeeperMock{expCalls: 0}, + expSuccess: false, + }, + "happy path: inactiveContract": { + src: types.GenesisState{ + Codes: []wasmTypes.Code{{ + CodeID: firstCodeID, + CodeInfo: myCodeInfo, + CodeBytes: wasmCode, + }}, + Contracts: []wasmTypes.Contract{ + { + ContractAddress: keeper.BuildContractAddressClassic(1, 1).String(), + ContractInfo: wasmTypes.ContractInfoFixture(func(c *wasmTypes.ContractInfo) { c.CodeID = 1 }, wasmTypes.OnlyGenesisFields), + }, + }, + Sequences: []wasmTypes.Sequence{ + {IDKey: wasmTypes.KeyLastCodeID, Value: 2}, + {IDKey: wasmTypes.KeyLastInstanceID, Value: 3}, + }, + Params: wasmTypes.DefaultParams(), + InactiveContractAddresses: []string{keeper.BuildContractAddressClassic(1, 1).String()}, + }, + expSuccess: true, + }, + "invalid path: inactiveContract - human address": { + src: types.GenesisState{ + Codes: []wasmTypes.Code{{ + CodeID: firstCodeID, + CodeInfo: myCodeInfo, + CodeBytes: wasmCode, + }}, + Sequences: []wasmTypes.Sequence{ + {IDKey: wasmTypes.KeyLastCodeID, Value: 2}, + {IDKey: wasmTypes.KeyLastInstanceID, Value: 1}, + }, + Params: wasmTypes.DefaultParams(), + InactiveContractAddresses: []string{humanAddress}, + }, + }, + "invalid path: inactiveContract - do not imported": { + src: types.GenesisState{ + Codes: []wasmTypes.Code{{ + CodeID: firstCodeID, + CodeInfo: myCodeInfo, + CodeBytes: wasmCode, + }}, + Sequences: []wasmTypes.Sequence{ + {IDKey: wasmTypes.KeyLastCodeID, Value: 2}, + {IDKey: wasmTypes.KeyLastInstanceID, Value: 1}, + }, + Params: wasmTypes.DefaultParams(), + InactiveContractAddresses: []string{keeper.BuildContractAddressClassic(1, 1).String()}, + }, + }, + } + for msg, spec := range specs { + t.Run(msg, func(t *testing.T) { + keeper, ctx, _ := setupKeeper(t) + + require.NoError(t, types.ValidateGenesis(spec.src)) + gotValidatorSet, gotErr := InitGenesis(ctx, keeper, spec.src, &spec.stakingMock, spec.msgHandlerMock.Handle) + if !spec.expSuccess { + require.Error(t, gotErr) + return + } + require.NoError(t, gotErr) + spec.msgHandlerMock.verifyCalls(t) + spec.stakingMock.verifyCalls(t) + assert.Equal(t, spec.stakingMock.validatorUpdate, gotValidatorSet) + for _, c := range spec.src.Codes { + assert.Equal(t, c.Pinned, keeper.IsPinnedCode(ctx, c.CodeID)) + } + }) + } +} + +func setupKeeper(t *testing.T) (*Keeper, sdk.Context, []sdk.StoreKey) { + t.Helper() + tempDir, err := os.MkdirTemp("", "wasm") + require.NoError(t, err) + t.Cleanup(func() { os.RemoveAll(tempDir) }) + + db := dbm.NewMemDB() + ms := store.NewCommitMultiStore(db) + + ctx := sdk.NewContext(ms, tmproto.Header{ + Height: 1234567, + Time: time.Date(2020, time.April, 22, 12, 0, 0, 0, time.UTC), + }, false, log.NewNopLogger()) + + encodingConfig := MakeEncodingConfig(t) + // register an example extension. must be protobuf + encodingConfig.InterfaceRegistry.RegisterImplementations( + (*wasmTypes.ContractInfoExtension)(nil), + &govtypes.Proposal{}, + ) + // also registering gov interfaces for nested Any type + govtypes.RegisterInterfaces(encodingConfig.InterfaceRegistry) + + wasmConfig := wasmTypes.DefaultWasmConfig() + + keys := sdk.NewKVStoreKeys( + authtypes.StoreKey, banktypes.StoreKey, paramstypes.StoreKey, types.StoreKey, + ) + for _, v := range keys { + ms.MountStoreWithDB(v, sdk.StoreTypeIAVL, db) + } + tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) + for _, v := range tkeys { + ms.MountStoreWithDB(v, sdk.StoreTypeTransient, db) + } + require.NoError(t, ms.LoadLatestVersion()) + appCodec, legacyAmino := encodingConfig.Marshaler, encodingConfig.Amino + + paramsKeeper := paramskeeper.NewKeeper( + appCodec, + legacyAmino, + keys[paramstypes.StoreKey], + tkeys[paramstypes.TStoreKey], + ) + for _, m := range []string{ + authtypes.ModuleName, + banktypes.ModuleName, + types.ModuleName, + } { + paramsKeeper.Subspace(m) + } + subspace := func(m string) paramstypes.Subspace { + r, ok := paramsKeeper.GetSubspace(m) + require.True(t, ok) + return r + } + maccPerms := map[string][]string{ // module account permissions + types.ModuleName: {authtypes.Burner}, + } + + accountKeeper := authkeeper.NewAccountKeeper( + appCodec, + keys[authtypes.StoreKey], // target store + subspace(authtypes.ModuleName), + authtypes.ProtoBaseAccount, // prototype + maccPerms, + ) + + bankKeeper := bankpluskeeper.NewBaseKeeper( + appCodec, + keys[banktypes.StoreKey], + accountKeeper, + subspace(banktypes.ModuleName), + map[string]bool{}, + false, + ) + + srcKeeper := NewKeeper( + appCodec, + keys[types.StoreKey], + subspace(types.ModuleName), + accountKeeper, + bankKeeper, + stakingkeeper.Keeper{}, + distributionkeeper.Keeper{}, + nil, + nil, + nil, + nil, + nil, + nil, + tempDir, + wasmConfig, + AvailableCapabilities, + ) + return &srcKeeper, ctx, []sdk.StoreKey{keys[types.StoreKey], keys[paramstypes.StoreKey]} +} + +type StakingKeeperMock struct { + err error + validatorUpdate []abci.ValidatorUpdate + expCalls int + gotCalls int +} + +func (s *StakingKeeperMock) ApplyAndReturnValidatorSetUpdates(_ sdk.Context) ([]abci.ValidatorUpdate, error) { + s.gotCalls++ + return s.validatorUpdate, s.err +} + +func (s *StakingKeeperMock) verifyCalls(t *testing.T) { + assert.Equal(t, s.expCalls, s.gotCalls, "number calls") +} + +type MockMsgHandler struct { + result *sdk.Result + err error + expCalls int + gotCalls int + expMsg sdk.Msg + gotMsg sdk.Msg +} + +func (m *MockMsgHandler) Handle(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { + m.gotCalls++ + m.gotMsg = msg + return m.result, m.err +} + +func (m *MockMsgHandler) verifyCalls(t *testing.T) { + assert.Equal(t, m.expMsg, m.gotMsg, "message param") + assert.Equal(t, m.expCalls, m.gotCalls, "number calls") +} diff --git a/x/wasmplus/keeper/keeper.go b/x/wasmplus/keeper/keeper.go new file mode 100644 index 0000000000..f8974765f5 --- /dev/null +++ b/x/wasmplus/keeper/keeper.go @@ -0,0 +1,151 @@ +package keeper + +import ( + "fmt" + + "github.com/line/lbm-sdk/codec" + sdk "github.com/line/lbm-sdk/types" + sdkerrors "github.com/line/lbm-sdk/types/errors" + bankpluskeeper "github.com/line/lbm-sdk/x/bankplus/keeper" + paramtypes "github.com/line/lbm-sdk/x/params/types" + "github.com/line/ostracon/libs/log" + + wasmkeeper "github.com/line/wasmd/x/wasm/keeper" + wasmtypes "github.com/line/wasmd/x/wasm/types" + "github.com/line/wasmd/x/wasmplus/types" +) + +type Keeper struct { + wasmkeeper.Keeper + cdc codec.Codec + storeKey sdk.StoreKey + metrics *wasmkeeper.Metrics + bank bankpluskeeper.Keeper +} + +func NewKeeper( + cdc codec.Codec, + storeKey sdk.StoreKey, + paramSpace paramtypes.Subspace, + accountKeeper wasmtypes.AccountKeeper, + bankKeeper wasmtypes.BankKeeper, + stakingKeeper wasmtypes.StakingKeeper, + distKeeper wasmtypes.DistributionKeeper, + channelKeeper wasmtypes.ChannelKeeper, + portKeeper wasmtypes.PortKeeper, + capabilityKeeper wasmtypes.CapabilityKeeper, + portSource wasmtypes.ICS20TransferPortSource, + router wasmkeeper.MessageRouter, + queryRouter wasmkeeper.GRPCQueryRouter, + homeDir string, + wasmConfig wasmtypes.WasmConfig, + availableCapabilities string, + opts ...wasmkeeper.Option, +) Keeper { + bankPlusKeeper, ok := bankKeeper.(bankpluskeeper.Keeper) + if !ok { + panic("bankKeeper should be bankPlusKeeper") + } + result := Keeper{ + cdc: cdc, + storeKey: storeKey, + metrics: wasmkeeper.NopMetrics(), + bank: bankPlusKeeper, + } + result.Keeper = wasmkeeper.NewKeeper( + cdc, + storeKey, + paramSpace, + accountKeeper, + bankKeeper, + stakingKeeper, + distKeeper, + channelKeeper, + portKeeper, + capabilityKeeper, + portSource, + router, + queryRouter, + homeDir, + wasmConfig, + availableCapabilities, + &result, + opts..., + ) + return result +} + +func WasmQuerier(k *Keeper) wasmtypes.QueryServer { + return wasmkeeper.NewGrpcQuerier(k.cdc, k.storeKey, k, k.QueryGasLimit()) +} + +func Querier(k *Keeper) types.QueryServer { + return newGrpcQuerier(k.storeKey, k) +} + +func (Keeper) Logger(ctx sdk.Context) log.Logger { + return ModuleLogger(ctx) +} + +func ModuleLogger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) +} + +func (k Keeper) IsInactiveContract(ctx sdk.Context, contractAddress sdk.AccAddress) bool { + store := ctx.KVStore(k.storeKey) + return store.Has(types.GetInactiveContractKey(contractAddress)) +} + +func (k Keeper) IterateInactiveContracts(ctx sdk.Context, fn func(contractAddress sdk.AccAddress) (stop bool)) { + store := ctx.KVStore(k.storeKey) + prefix := types.InactiveContractPrefix + iterator := sdk.KVStorePrefixIterator(store, prefix) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + contractAddress := sdk.AccAddress(iterator.Value()) + if stop := fn(contractAddress); stop { + break + } + } +} + +func (k Keeper) addInactiveContract(ctx sdk.Context, contractAddress sdk.AccAddress) { + store := ctx.KVStore(k.storeKey) + key := types.GetInactiveContractKey(contractAddress) + + store.Set(key, contractAddress) +} + +func (k Keeper) deleteInactiveContract(ctx sdk.Context, contractAddress sdk.AccAddress) { + store := ctx.KVStore(k.storeKey) + key := types.GetInactiveContractKey(contractAddress) + store.Delete(key) +} + +// activateContract delete the contract address from inactivateContract list if the contract is deactivated. +func (k Keeper) activateContract(ctx sdk.Context, contractAddress sdk.AccAddress) error { + if !k.IsInactiveContract(ctx, contractAddress) { + return sdkerrors.Wrapf(wasmtypes.ErrNotFound, "no inactivate contract %s", contractAddress.String()) + } + + k.deleteInactiveContract(ctx, contractAddress) + k.bank.DeleteFromInactiveAddr(ctx, contractAddress) + + return nil +} + +// deactivateContract add the contract address to inactivateContract list. +func (k Keeper) deactivateContract(ctx sdk.Context, contractAddress sdk.AccAddress) error { + if k.IsInactiveContract(ctx, contractAddress) { + return sdkerrors.Wrapf(wasmtypes.ErrAccountExists, "already inactivate contract %s", contractAddress.String()) + } + if !k.HasContractInfo(ctx, contractAddress) { + return sdkerrors.Wrapf(wasmtypes.ErrInvalid, "no contract %s", contractAddress.String()) + } + + k.addInactiveContract(ctx, contractAddress) + k.bank.AddToInactiveAddr(ctx, contractAddress) + + return nil +} diff --git a/x/wasmplus/keeper/keeper_test.go b/x/wasmplus/keeper/keeper_test.go new file mode 100644 index 0000000000..68956e562d --- /dev/null +++ b/x/wasmplus/keeper/keeper_test.go @@ -0,0 +1,79 @@ +package keeper + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + sdk "github.com/line/lbm-sdk/types" +) + +func TestActivateContract(t *testing.T) { + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) + + k := keepers.WasmKeeper + example := InstantiateHackatomExampleContract(t, ctx, keepers) + em := sdk.NewEventManager() + + // request no contract address -> fail + err := k.activateContract(ctx, example.CreatorAddr) + require.Error(t, err, fmt.Sprintf("no contract %s", example.CreatorAddr)) + + // try to activate an activated contract -> fail + err = k.activateContract(ctx.WithEventManager(em), example.Contract) + require.Error(t, err, fmt.Sprintf("no inactivate contract %s", example.Contract)) + + // add to inactive contract + err = k.deactivateContract(ctx, example.Contract) + require.NoError(t, err) + + // try to activate an inactivated contract -> success + err = k.activateContract(ctx, example.Contract) + require.NoError(t, err) +} + +func TestDeactivateContract(t *testing.T) { + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) + + k := keepers.WasmKeeper + example := InstantiateHackatomExampleContract(t, ctx, keepers) + em := sdk.NewEventManager() + + // request no contract address -> fail + err := k.deactivateContract(ctx, example.CreatorAddr) + require.Error(t, err, fmt.Sprintf("no contract %s", example.CreatorAddr)) + + // success case + err = k.deactivateContract(ctx, example.Contract) + require.NoError(t, err) + + // already inactivate contract -> fail + err = k.deactivateContract(ctx.WithEventManager(em), example.Contract) + require.Error(t, err, fmt.Sprintf("already inactivate contract %s", example.Contract)) +} + +func TestIterateInactiveContracts(t *testing.T) { + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) + k := keepers.WasmKeeper + + example1 := InstantiateHackatomExampleContract(t, ctx, keepers) + ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) + example2 := InstantiateHackatomExampleContract(t, ctx, keepers) + ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) + + err := k.deactivateContract(ctx, example1.Contract) + require.NoError(t, err) + err = k.deactivateContract(ctx, example2.Contract) + require.NoError(t, err) + + var inactiveContracts []sdk.AccAddress + k.IterateInactiveContracts(ctx, func(contractAddress sdk.AccAddress) (stop bool) { + inactiveContracts = append(inactiveContracts, contractAddress) + return false + }) + assert.Equal(t, 2, len(inactiveContracts)) + expectList := []sdk.AccAddress{example1.Contract, example2.Contract} + assert.ElementsMatch(t, expectList, inactiveContracts) +} diff --git a/x/wasmplus/keeper/msg_server.go b/x/wasmplus/keeper/msg_server.go new file mode 100644 index 0000000000..ab6f17553d --- /dev/null +++ b/x/wasmplus/keeper/msg_server.go @@ -0,0 +1,60 @@ +package keeper + +import ( + "context" + + sdk "github.com/line/lbm-sdk/types" + sdkerrors "github.com/line/lbm-sdk/types/errors" + + wasmtypes "github.com/line/wasmd/x/wasm/types" + "github.com/line/wasmd/x/wasmplus/types" +) + +var _ types.MsgServer = msgServer{} + +type msgServer struct { + keeper wasmtypes.ContractOpsKeeper +} + +func NewMsgServerImpl(k wasmtypes.ContractOpsKeeper) types.MsgServer { + return &msgServer{keeper: k} +} + +func (m msgServer) StoreCodeAndInstantiateContract(goCtx context.Context, + msg *types.MsgStoreCodeAndInstantiateContract) (*types.MsgStoreCodeAndInstantiateContractResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, sdkerrors.Wrap(err, "sender") + } + codeID, _, err := m.keeper.Create(ctx, senderAddr, msg.WASMByteCode, msg.InstantiatePermission) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvent(sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), + sdk.NewAttribute(sdk.AttributeKeySender, msg.Sender), + )) + + var adminAddr sdk.AccAddress + if msg.Admin != "" { + adminAddr, err = sdk.AccAddressFromBech32(msg.Admin) + if err != nil { + return nil, sdkerrors.Wrap(err, "admin") + } + } + + contractAddr, data, err := m.keeper.Instantiate(ctx, codeID, senderAddr, adminAddr, msg.Msg, + msg.Label, msg.Funds) + if err != nil { + return nil, err + } + + return &types.MsgStoreCodeAndInstantiateContractResponse{ + CodeID: codeID, + Address: contractAddr.String(), + Data: data, + }, nil +} diff --git a/x/wasmplus/keeper/proposal_handler.go b/x/wasmplus/keeper/proposal_handler.go new file mode 100644 index 0000000000..2727abb0ad --- /dev/null +++ b/x/wasmplus/keeper/proposal_handler.go @@ -0,0 +1,89 @@ +package keeper + +import ( + sdk "github.com/line/lbm-sdk/types" + sdkerrors "github.com/line/lbm-sdk/types/errors" + govtypes "github.com/line/lbm-sdk/x/gov/types" + + wasmkeeper "github.com/line/wasmd/x/wasm/keeper" + wasmtypes "github.com/line/wasmd/x/wasm/types" + "github.com/line/wasmd/x/wasmplus/types" +) + +// NewWasmProposalHandler creates a new governance Handler for wasm proposals +func NewWasmProposalHandler(k *Keeper, enabledProposalType []wasmtypes.ProposalType) govtypes.Handler { + govPerm := wasmkeeper.NewGovPermissionKeeper(k) + return NewWasmProposalHandlerX(NewPermissionedKeeper(*govPerm, k), enabledProposalType) +} + +// NewWasmProposalHandlerX creates a new governance Handler for wasm proposals +func NewWasmProposalHandlerX(k types.ContractOpsKeeper, enabledProposalTypes []wasmtypes.ProposalType) govtypes.Handler { + handler := wasmkeeper.NewWasmProposalHandlerX(k, enabledProposalTypes) + 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 { + err := handler(ctx, content) + if err != nil { + if _, ok := enabledTypes[content.ProposalType()]; !ok { + return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unsupported wasm proposal content type: %q", content.ProposalType()) + } + switch c := content.(type) { + case *types.DeactivateContractProposal: + return handleDeactivateContractProposal(ctx, k, *c) + case *types.ActivateContractProposal: + return handleActivateContractProposal(ctx, k, *c) + default: + return sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unrecognized wasm proposal content type: %T", c) + } + } + return nil + } +} + +func handleDeactivateContractProposal(ctx sdk.Context, k types.ContractOpsKeeper, p types.DeactivateContractProposal) error { + if err := p.ValidateBasic(); err != nil { + return err + } + + // The error is already checked in ValidateBasic. + //nolint:errcheck + contractAddr, _ := sdk.AccAddressFromBech32(p.Contract) + + err := k.DeactivateContract(ctx, contractAddr) + if err != nil { + return err + } + + event := types.EventDeactivateContractProposal{ + Contract: contractAddr.String(), + } + if err := ctx.EventManager().EmitTypedEvent(&event); err != nil { + return err + } + + return nil +} + +func handleActivateContractProposal(ctx sdk.Context, k types.ContractOpsKeeper, p types.ActivateContractProposal) error { + if err := p.ValidateBasic(); err != nil { + return err + } + + // The error is already checked in ValidateBasic. + //nolint:errcheck + contractAddr, _ := sdk.AccAddressFromBech32(p.Contract) + + err := k.ActivateContract(ctx, contractAddr) + if err != nil { + return err + } + + event := types.EventActivateContractProposal{Contract: contractAddr.String()} + if err := ctx.EventManager().EmitTypedEvent(&event); err != nil { + return nil + } + + return nil +} diff --git a/x/wasmplus/keeper/proposal_integration_test.go b/x/wasmplus/keeper/proposal_integration_test.go new file mode 100644 index 0000000000..4787ac7a0b --- /dev/null +++ b/x/wasmplus/keeper/proposal_integration_test.go @@ -0,0 +1,71 @@ +package keeper + +import ( + "testing" + + "github.com/stretchr/testify/require" + + sdk "github.com/line/lbm-sdk/types" + + "github.com/line/wasmd/x/wasmplus/types" +) + +func TestValidateDeactivateContractProposal(t *testing.T) { + ctx, keepers := CreateTestInput(t, false, "staking") + govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper + + example := InstantiateHackatomExampleContract(t, ctx, keepers) + + src := types.DeactivateContractProposal{ + Title: "Foo", + Description: "Bar", + Contract: example.Contract.String(), + } + + em := sdk.NewEventManager() + + // when stored + storedProposal, err := govKeeper.SubmitProposal(ctx, &src) + require.NoError(t, err) + + // proposal execute + handler := govKeeper.Router().GetRoute(storedProposal.ProposalRoute()) + err = handler(ctx.WithEventManager(em), storedProposal.GetContent()) + require.NoError(t, err) + + // then + isInactive := wasmKeeper.IsInactiveContract(ctx, example.Contract) + require.True(t, isInactive) +} + +func TestActivateContractProposal(t *testing.T) { + ctx, keepers := CreateTestInput(t, false, "staking") + govKeeper, wasmKeeper := keepers.GovKeeper, keepers.WasmKeeper + + example := InstantiateHackatomExampleContract(t, ctx, keepers) + + // set deactivate + err := wasmKeeper.deactivateContract(ctx, example.Contract) + require.NoError(t, err) + + src := types.ActivateContractProposal{ + Title: "Foo", + Description: "Bar", + Contract: example.Contract.String(), + } + + em := sdk.NewEventManager() + + // when stored + storedProposal, err := govKeeper.SubmitProposal(ctx, &src) + require.NoError(t, err) + + // proposal execute + handler := govKeeper.Router().GetRoute(storedProposal.ProposalRoute()) + err = handler(ctx.WithEventManager(em), storedProposal.GetContent()) + require.NoError(t, err) + + // then + isInactive := wasmKeeper.IsInactiveContract(ctx, example.Contract) + require.False(t, isInactive) +} diff --git a/x/wasmplus/keeper/querier.go b/x/wasmplus/keeper/querier.go new file mode 100644 index 0000000000..72160efc1a --- /dev/null +++ b/x/wasmplus/keeper/querier.go @@ -0,0 +1,78 @@ +package keeper + +import ( + "context" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/line/lbm-sdk/store/prefix" + sdk "github.com/line/lbm-sdk/types" + "github.com/line/lbm-sdk/types/query" + + wasmtypes "github.com/line/wasmd/x/wasm/types" + "github.com/line/wasmd/x/wasmplus/types" +) + +type queryKeeper interface { + IterateInactiveContracts(ctx sdk.Context, fn func(contractAddress sdk.AccAddress) bool) + IsInactiveContract(ctx sdk.Context, contractAddress sdk.AccAddress) bool + HasContractInfo(ctx sdk.Context, contractAddress sdk.AccAddress) bool +} + +var _ types.QueryServer = &grpcQuerier{} + +type grpcQuerier struct { + keeper queryKeeper + storeKey sdk.StoreKey +} + +// newGrpcQuerier constructor +func newGrpcQuerier(storeKey sdk.StoreKey, keeper queryKeeper) *grpcQuerier { + return &grpcQuerier{storeKey: storeKey, keeper: keeper} +} + +func (q grpcQuerier) InactiveContracts(c context.Context, req *types.QueryInactiveContractsRequest) (*types.QueryInactiveContractsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + ctx := sdk.UnwrapSDKContext(c) + + addresses := make([]string, 0) + prefixStore := prefix.NewStore(ctx.KVStore(q.storeKey), types.InactiveContractPrefix) + pageRes, err := query.FilteredPaginate(prefixStore, req.Pagination, func(key []byte, value []byte, accumulate bool) (bool, error) { + if accumulate { + contractAddress := sdk.AccAddress(value) + addresses = append(addresses, contractAddress.String()) + } + return true, nil + }) + if err != nil { + return nil, err + } + return &types.QueryInactiveContractsResponse{ + Addresses: addresses, + Pagination: pageRes, + }, nil +} + +func (q grpcQuerier) InactiveContract(c context.Context, req *types.QueryInactiveContractRequest) (*types.QueryInactiveContractResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + ctx := sdk.UnwrapSDKContext(c) + + contractAddr, err := sdk.AccAddressFromBech32(req.Address) + if err != nil { + return nil, err + } + + if !q.keeper.HasContractInfo(ctx, contractAddr) { + return nil, wasmtypes.ErrNotFound + } + + inactivated := q.keeper.IsInactiveContract(ctx, contractAddr) + return &types.QueryInactiveContractResponse{ + Inactivated: inactivated, + }, nil +} diff --git a/x/wasmplus/keeper/querier_test.go b/x/wasmplus/keeper/querier_test.go new file mode 100644 index 0000000000..72f0718168 --- /dev/null +++ b/x/wasmplus/keeper/querier_test.go @@ -0,0 +1,59 @@ +package keeper + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + sdk "github.com/line/lbm-sdk/types" + + "github.com/line/wasmd/x/wasmplus/types" +) + +func TestQueryInactiveContracts(t *testing.T) { + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) + keeper := keepers.WasmKeeper + + example1 := InstantiateHackatomExampleContract(t, ctx, keepers) + ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) + example2 := InstantiateHackatomExampleContract(t, ctx, keepers) + ctx = ctx.WithBlockHeight(ctx.BlockHeight() + 1) + + // set inactive + err := keeper.deactivateContract(ctx, example1.Contract) + require.NoError(t, err) + err = keeper.deactivateContract(ctx, example2.Contract) + require.NoError(t, err) + + q := Querier(keeper) + rq := types.QueryInactiveContractsRequest{} + res, err := q.InactiveContracts(sdk.WrapSDKContext(ctx), &rq) + require.NoError(t, err) + expect := []string{example1.Contract.String(), example2.Contract.String()} + for _, exp := range expect { + assert.Contains(t, res.Addresses, exp) + } +} + +func TestQueryIsInactiveContract(t *testing.T) { + ctx, keepers := CreateTestInput(t, false, AvailableCapabilities) + keeper := keepers.WasmKeeper + + example := InstantiateHackatomExampleContract(t, ctx, keepers) + + q := Querier(keeper) + rq := types.QueryInactiveContractRequest{Address: example.Contract.String()} + res, err := q.InactiveContract(sdk.WrapSDKContext(ctx), &rq) + require.NoError(t, err) + require.False(t, res.Inactivated) + + // set inactive + err = keeper.deactivateContract(ctx, example.Contract) + require.NoError(t, err) + + rq = types.QueryInactiveContractRequest{Address: example.Contract.String()} + res, err = q.InactiveContract(sdk.WrapSDKContext(ctx), &rq) + require.NoError(t, err) + require.True(t, res.Inactivated) +} diff --git a/x/wasmplus/keeper/test_common.go b/x/wasmplus/keeper/test_common.go new file mode 100644 index 0000000000..892dd20544 --- /dev/null +++ b/x/wasmplus/keeper/test_common.go @@ -0,0 +1,690 @@ +package keeper + +import ( + "bytes" + "encoding/binary" + "encoding/json" + "fmt" + "os" + "testing" + "time" + + "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + dbm "github.com/tendermint/tm-db" + + "github.com/line/ibc-go/v3/modules/apps/transfer" + ibctransfertypes "github.com/line/ibc-go/v3/modules/apps/transfer/types" + ibc "github.com/line/ibc-go/v3/modules/core" + ibchost "github.com/line/ibc-go/v3/modules/core/24-host" + ibckeeper "github.com/line/ibc-go/v3/modules/core/keeper" + "github.com/line/lbm-sdk/baseapp" + "github.com/line/lbm-sdk/codec" + "github.com/line/lbm-sdk/std" + "github.com/line/lbm-sdk/store" + sdk "github.com/line/lbm-sdk/types" + "github.com/line/lbm-sdk/types/address" + sdkerrors "github.com/line/lbm-sdk/types/errors" + "github.com/line/lbm-sdk/types/module" + "github.com/line/lbm-sdk/x/auth" + authkeeper "github.com/line/lbm-sdk/x/auth/keeper" + authtypes "github.com/line/lbm-sdk/x/auth/types" + "github.com/line/lbm-sdk/x/auth/vesting" + authzkeeper "github.com/line/lbm-sdk/x/authz/keeper" + "github.com/line/lbm-sdk/x/bank" + bankkeeper "github.com/line/lbm-sdk/x/bank/keeper" + banktypes "github.com/line/lbm-sdk/x/bank/types" + "github.com/line/lbm-sdk/x/bankplus" + bankpluskeeper "github.com/line/lbm-sdk/x/bankplus/keeper" + "github.com/line/lbm-sdk/x/capability" + capabilitykeeper "github.com/line/lbm-sdk/x/capability/keeper" + capabilitytypes "github.com/line/lbm-sdk/x/capability/types" + "github.com/line/lbm-sdk/x/crisis" + crisistypes "github.com/line/lbm-sdk/x/crisis/types" + "github.com/line/lbm-sdk/x/distribution" + distrclient "github.com/line/lbm-sdk/x/distribution/client" + distributionkeeper "github.com/line/lbm-sdk/x/distribution/keeper" + distributiontypes "github.com/line/lbm-sdk/x/distribution/types" + "github.com/line/lbm-sdk/x/evidence" + evidencetypes "github.com/line/lbm-sdk/x/evidence/types" + "github.com/line/lbm-sdk/x/feegrant" + "github.com/line/lbm-sdk/x/gov" + govkeeper "github.com/line/lbm-sdk/x/gov/keeper" + govtypes "github.com/line/lbm-sdk/x/gov/types" + "github.com/line/lbm-sdk/x/mint" + minttypes "github.com/line/lbm-sdk/x/mint/types" + "github.com/line/lbm-sdk/x/params" + paramsclient "github.com/line/lbm-sdk/x/params/client" + paramskeeper "github.com/line/lbm-sdk/x/params/keeper" + paramstypes "github.com/line/lbm-sdk/x/params/types" + paramproposal "github.com/line/lbm-sdk/x/params/types/proposal" + "github.com/line/lbm-sdk/x/slashing" + slashingtypes "github.com/line/lbm-sdk/x/slashing/types" + "github.com/line/lbm-sdk/x/staking" + stakingkeeper "github.com/line/lbm-sdk/x/staking/keeper" + stakingtypes "github.com/line/lbm-sdk/x/staking/types" + "github.com/line/lbm-sdk/x/upgrade" + upgradeclient "github.com/line/lbm-sdk/x/upgrade/client" + upgradekeeper "github.com/line/lbm-sdk/x/upgrade/keeper" + upgradetypes "github.com/line/lbm-sdk/x/upgrade/types" + "github.com/line/ostracon/crypto" + "github.com/line/ostracon/crypto/ed25519" + "github.com/line/ostracon/libs/log" + + wasmappparams "github.com/line/wasmd/app/params" + wasmkeeper "github.com/line/wasmd/x/wasm/keeper" + "github.com/line/wasmd/x/wasm/keeper/wasmtesting" + wasmtypes "github.com/line/wasmd/x/wasm/types" + "github.com/line/wasmd/x/wasmplus/types" +) + +var moduleBasics = module.NewBasicManager( + auth.AppModuleBasic{}, + bank.AppModuleBasic{}, + capability.AppModuleBasic{}, + staking.AppModuleBasic{}, + mint.AppModuleBasic{}, + distribution.AppModuleBasic{}, + gov.NewAppModuleBasic( + paramsclient.ProposalHandler, distrclient.ProposalHandler, upgradeclient.ProposalHandler, + ), + params.AppModuleBasic{}, + crisis.AppModuleBasic{}, + slashing.AppModuleBasic{}, + ibc.AppModuleBasic{}, + upgrade.AppModuleBasic{}, + evidence.AppModuleBasic{}, + transfer.AppModuleBasic{}, + vesting.AppModuleBasic{}, +) + +func MakeTestCodec(t testing.TB) codec.Codec { + return MakeEncodingConfig(t).Marshaler +} + +func MakeEncodingConfig(_ testing.TB) wasmappparams.EncodingConfig { + encodingConfig := wasmappparams.MakeEncodingConfig() + amino := encodingConfig.Amino + interfaceRegistry := encodingConfig.InterfaceRegistry + + std.RegisterInterfaces(interfaceRegistry) + std.RegisterLegacyAminoCodec(amino) + + moduleBasics.RegisterLegacyAminoCodec(amino) + moduleBasics.RegisterInterfaces(interfaceRegistry) + // add wasmd types + types.RegisterInterfaces(interfaceRegistry) + types.RegisterLegacyAminoCodec(amino) + + return encodingConfig +} + +var TestingStakeParams = stakingtypes.Params{ + UnbondingTime: 100, + MaxValidators: 10, + MaxEntries: 10, + HistoricalEntries: 10, + BondDenom: "stake", +} + +type TestKeepers struct { + AccountKeeper authkeeper.AccountKeeper + StakingKeeper stakingkeeper.Keeper + DistKeeper distributionkeeper.Keeper + BankKeeper bankkeeper.Keeper + GovKeeper govkeeper.Keeper + ContractKeeper types.ContractOpsKeeper + WasmKeeper *Keeper + IBCKeeper *ibckeeper.Keeper + Router *baseapp.Router + EncodingConfig wasmappparams.EncodingConfig + Faucet *wasmkeeper.TestFaucet + MultiStore sdk.CommitMultiStore +} + +// CreateDefaultTestInput common settings for CreateTestInput +func CreateDefaultTestInput(t testing.TB) (sdk.Context, TestKeepers) { + return CreateTestInput(t, false, "staking") +} + +// CreateTestInput encoders can be nil to accept the defaults, or set it to override some of the message handlers (like default) +func CreateTestInput( + t testing.TB, + isCheckTx bool, + availableCapabilities string, + opts ...wasmkeeper.Option, +) (sdk.Context, TestKeepers) { + // Load default wasm config + return createTestInput(t, isCheckTx, availableCapabilities, wasmtypes.DefaultWasmConfig(), dbm.NewMemDB(), opts...) +} + +// encoders can be nil to accept the defaults, or set it to override some of the message handlers (like default) +func createTestInput( + t testing.TB, + isCheckTx bool, + availableCapabilities string, + wasmConfig wasmtypes.WasmConfig, + db dbm.DB, + opts ...wasmkeeper.Option, +) (sdk.Context, TestKeepers) { + tempDir := t.TempDir() + + keys := sdk.NewKVStoreKeys( + authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, + minttypes.StoreKey, distributiontypes.StoreKey, slashingtypes.StoreKey, + govtypes.StoreKey, paramstypes.StoreKey, ibchost.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) + } + tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) + for _, v := range tkeys { + ms.MountStoreWithDB(v, sdk.StoreTypeTransient, db) + } + + memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) + for _, v := range memKeys { + ms.MountStoreWithDB(v, sdk.StoreTypeMemory, db) + } + + require.NoError(t, ms.LoadLatestVersion()) + + ctx := sdk.NewContext(ms, tmproto.Header{ + Height: 1234567, + Time: time.Date(2020, time.April, 22, 12, 0, 0, 0, time.UTC), + }, isCheckTx, log.NewNopLogger()) + ctx = wasmtypes.WithTXCounter(ctx, 0) + + encodingConfig := MakeEncodingConfig(t) + appCodec, legacyAmino := encodingConfig.Marshaler, encodingConfig.Amino + + paramsKeeper := paramskeeper.NewKeeper( + appCodec, + legacyAmino, + keys[paramstypes.StoreKey], + tkeys[paramstypes.TStoreKey], + ) + for _, m := range []string{ + authtypes.ModuleName, + banktypes.ModuleName, + stakingtypes.ModuleName, + minttypes.ModuleName, + distributiontypes.ModuleName, + slashingtypes.ModuleName, + crisistypes.ModuleName, + ibctransfertypes.ModuleName, + capabilitytypes.ModuleName, + ibchost.ModuleName, + govtypes.ModuleName, + types.ModuleName, + } { + paramsKeeper.Subspace(m) + } + subspace := func(m string) paramstypes.Subspace { + r, ok := paramsKeeper.GetSubspace(m) + require.True(t, ok) + return r + } + maccPerms := map[string][]string{ // module account permissions + authtypes.FeeCollectorName: nil, + distributiontypes.ModuleName: nil, + minttypes.ModuleName: {authtypes.Minter}, + stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, + stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, + govtypes.ModuleName: {authtypes.Burner}, + ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + types.ModuleName: {authtypes.Burner}, + } + accountKeeper := authkeeper.NewAccountKeeper( + appCodec, + keys[authtypes.StoreKey], // target store + subspace(authtypes.ModuleName), + authtypes.ProtoBaseAccount, // prototype + maccPerms, + ) + blockedAddrs := make(map[string]bool) + for acc := range maccPerms { + blockedAddrs[authtypes.NewModuleAddress(acc).String()] = true + } + + bankKeeper := bankpluskeeper.NewBaseKeeper( + appCodec, + keys[banktypes.StoreKey], + accountKeeper, + subspace(banktypes.ModuleName), + blockedAddrs, + false, + ) + bankKeeper.SetParams(ctx, banktypes.DefaultParams()) + + stakingKeeper := stakingkeeper.NewKeeper( + appCodec, + keys[stakingtypes.StoreKey], + accountKeeper, + bankKeeper, + subspace(stakingtypes.ModuleName), + ) + stakingKeeper.SetParams(ctx, TestingStakeParams) + + distKeeper := distributionkeeper.NewKeeper( + appCodec, + keys[distributiontypes.StoreKey], + subspace(distributiontypes.ModuleName), + accountKeeper, + bankKeeper, + stakingKeeper, + authtypes.FeeCollectorName, + nil, + ) + distKeeper.SetParams(ctx, distributiontypes.DefaultParams()) + stakingKeeper.SetHooks(distKeeper.Hooks()) + + // set genesis items required for distribution + distKeeper.SetFeePool(ctx, distributiontypes.InitialFeePool()) + + upgradeKeeper := upgradekeeper.NewKeeper( + map[int64]bool{}, + keys[upgradetypes.StoreKey], + appCodec, + tempDir, + nil, + ) + + faucet := wasmkeeper.NewTestFaucet(t, ctx, bankKeeper, minttypes.ModuleName, sdk.NewCoin("stake", sdk.NewInt(100_000_000_000))) + + // set some funds ot pay out validatores, based on code from: + // https://github.com/line/lbm-sdk/blob/95b22d3a685f7eb531198e0023ef06873835e632/x/distribution/keeper/keeper_test.go#L49-L56 + distrAcc := distKeeper.GetDistributionAccount(ctx) + faucet.Fund(ctx, distrAcc.GetAddress(), sdk.NewCoin("stake", sdk.NewInt(2000000))) + accountKeeper.SetModuleAccount(ctx, distrAcc) + + capabilityKeeper := capabilitykeeper.NewKeeper( + appCodec, + keys[capabilitytypes.StoreKey], + memKeys[capabilitytypes.MemStoreKey], + ) + scopedIBCKeeper := capabilityKeeper.ScopeToModule(ibchost.ModuleName) + scopedWasmKeeper := capabilityKeeper.ScopeToModule(types.ModuleName) + + ibcKeeper := ibckeeper.NewKeeper( + appCodec, + keys[ibchost.StoreKey], + subspace(ibchost.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() + msgRouter.SetInterfaceRegistry(encodingConfig.InterfaceRegistry) + + cfg := sdk.GetConfig() + cfg.SetAddressVerifier(wasmtypes.VerifyAddressLen()) + + keeper := NewKeeper( + appCodec, + keys[types.StoreKey], + subspace(types.ModuleName), + accountKeeper, + bankKeeper, + stakingKeeper, + distKeeper, + ibcKeeper.ChannelKeeper, + &ibcKeeper.PortKeeper, + scopedWasmKeeper, + wasmtesting.MockIBCTransferKeeper{}, + msgRouter, + querier, + tempDir, + wasmConfig, + availableCapabilities, + opts..., + ) + keeper.SetParams(ctx, wasmtypes.DefaultParams()) + // add wasm handler so we can loop-back (contracts calling contracts) + contractKeeper := NewPermissionedKeeper(*wasmkeeper.NewDefaultPermissionKeeper(&keeper), keeper) + router.AddRoute(sdk.NewRoute(types.RouterKey, TestHandler(contractKeeper))) + + am := module.NewManager( // minimal module set that we use for message/ query tests + bankplus.NewAppModule(appCodec, bankKeeper, accountKeeper), + staking.NewAppModule(appCodec, stakingKeeper, accountKeeper, bankKeeper), + distribution.NewAppModule(appCodec, distKeeper, accountKeeper, bankKeeper, stakingKeeper), + ) + am.RegisterServices(module.NewConfigurator(appCodec, msgRouter, querier)) + // wasmplus service + types.RegisterMsgServer(msgRouter, NewMsgServerImpl(wasmkeeper.NewDefaultPermissionKeeper(keeper))) + types.RegisterQueryServer(querier, Querier(&keeper)) + // wasm service + wasmtypes.RegisterMsgServer(msgRouter, wasmkeeper.NewMsgServerImpl(wasmkeeper.NewDefaultPermissionKeeper(keeper))) + wasmtypes.RegisterQueryServer(querier, WasmQuerier(&keeper)) + + govRouter := govtypes.NewRouter(). + AddRoute(govtypes.RouterKey, govtypes.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, + ) + + govKeeper.SetProposalID(ctx, govtypes.DefaultStartingProposalID) + govKeeper.SetDepositParams(ctx, govtypes.DefaultDepositParams()) + govKeeper.SetVotingParams(ctx, govtypes.DefaultVotingParams()) + govKeeper.SetTallyParams(ctx, govtypes.DefaultTallyParams()) + + keepers := TestKeepers{ + AccountKeeper: accountKeeper, + StakingKeeper: stakingKeeper, + DistKeeper: distKeeper, + ContractKeeper: contractKeeper, + WasmKeeper: &keeper, + BankKeeper: bankKeeper, + GovKeeper: govKeeper, + IBCKeeper: ibcKeeper, + Router: router, + EncodingConfig: encodingConfig, + Faucet: faucet, + MultiStore: ms, + } + return ctx, keepers +} + +// 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) { + ctx = ctx.WithEventManager(sdk.NewEventManager()) + switch msg := msg.(type) { + case *wasmtypes.MsgStoreCode: + return handleStoreCode(ctx, k, msg) + case *wasmtypes.MsgInstantiateContract: + return handleInstantiate(ctx, k, msg) + case *wasmtypes.MsgExecuteContract: + return handleExecute(ctx, k, msg) + default: + errMsg := fmt.Sprintf("unrecognized wasm message type: %T", msg) + return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + } + } +} + +func handleStoreCode(ctx sdk.Context, k types.ContractOpsKeeper, msg *wasmtypes.MsgStoreCode) (*sdk.Result, error) { + senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, sdkerrors.Wrap(err, "sender") + } + codeID, _, err := k.Create(ctx, senderAddr, msg.WASMByteCode, msg.InstantiatePermission) + if err != nil { + return nil, err + } + + return &sdk.Result{ + Data: []byte(fmt.Sprintf("%d", codeID)), + Events: ctx.EventManager().ABCIEvents(), + }, nil +} + +func handleInstantiate(ctx sdk.Context, k types.ContractOpsKeeper, msg *wasmtypes.MsgInstantiateContract) (*sdk.Result, error) { + senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, sdkerrors.Wrap(err, "sender") + } + var adminAddr sdk.AccAddress + if msg.Admin != "" { + if adminAddr, err = sdk.AccAddressFromBech32(msg.Admin); err != nil { + return nil, sdkerrors.Wrap(err, "admin") + } + } + + contractAddr, _, err := k.Instantiate(ctx, msg.CodeID, senderAddr, adminAddr, msg.Msg, msg.Label, msg.Funds) + if err != nil { + return nil, err + } + + return &sdk.Result{ + Data: contractAddr, + Events: ctx.EventManager().Events().ToABCIEvents(), + }, nil +} + +func handleExecute(ctx sdk.Context, k types.ContractOpsKeeper, msg *wasmtypes.MsgExecuteContract) (*sdk.Result, error) { + senderAddr, err := sdk.AccAddressFromBech32(msg.Sender) + if err != nil { + return nil, sdkerrors.Wrap(err, "sender") + } + contractAddr, err := sdk.AccAddressFromBech32(msg.Contract) + if err != nil { + return nil, sdkerrors.Wrap(err, "admin") + } + data, err := k.Execute(ctx, contractAddr, senderAddr, msg.Msg, msg.Funds) + if err != nil { + return nil, err + } + + return &sdk.Result{ + Data: data, + Events: ctx.EventManager().Events().ToABCIEvents(), + }, nil +} + +func RandomAccountAddress(_ testing.TB) sdk.AccAddress { + _, _, addr := keyPubAddr() + return addr +} + +// DeterministicAccountAddress creates a test address with v repeated to valid address size +func DeterministicAccountAddress(_ testing.TB, v byte) sdk.AccAddress { + return bytes.Repeat([]byte{v}, address.Len) +} + +func RandomBech32AccountAddress(t testing.TB) string { + return RandomAccountAddress(t).String() +} + +type ExampleContract struct { + InitialAmount sdk.Coins + Creator crypto.PrivKey + CreatorAddr sdk.AccAddress + CodeID uint64 + Checksum []byte +} + +func StoreHackatomExampleContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) ExampleContract { + return StoreExampleContract(t, ctx, keepers, "../../wasm/keeper/testdata/hackatom.wasm") +} + +func StoreBurnerExampleContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) ExampleContract { + return StoreExampleContract(t, ctx, keepers, "../../wasm/keeper/testdata/burner.wasm") +} + +func StoreIBCReflectContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) ExampleContract { + return StoreExampleContract(t, ctx, keepers, "../../wasm/keeper/testdata/ibc_reflect.wasm") +} + +func StoreReflectContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) ExampleContract { + return StoreExampleContract(t, ctx, keepers, "../../wasm/keeper/testdata/reflect.wasm") +} + +func StoreExampleContract(t testing.TB, ctx sdk.Context, keepers TestKeepers, wasmFile string) ExampleContract { + anyAmount := sdk.NewCoins(sdk.NewInt64Coin("denom", 1000)) + creator, _, creatorAddr := keyPubAddr() + fundAccounts(t, ctx, keepers.AccountKeeper, keepers.BankKeeper, creatorAddr, anyAmount) + + wasmCode, err := os.ReadFile(wasmFile) + require.NoError(t, err) + + codeID, _, err := keepers.ContractKeeper.Create(ctx, creatorAddr, wasmCode, nil) + require.NoError(t, err) + hash := keepers.WasmKeeper.GetCodeInfo(ctx, codeID).CodeHash + return ExampleContract{anyAmount, creator, creatorAddr, codeID, hash} +} + +type ExampleContractInstance struct { + ExampleContract + Contract sdk.AccAddress +} + +type HackatomExampleInstance struct { + ExampleContract + Contract sdk.AccAddress + Verifier crypto.PrivKey + VerifierAddr sdk.AccAddress + Beneficiary crypto.PrivKey + BeneficiaryAddr sdk.AccAddress + Label string + Deposit sdk.Coins +} + +// InstantiateHackatomExampleContract load and instantiate the "./testdata/hackatom.wasm" contract +func InstantiateHackatomExampleContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) HackatomExampleInstance { + contract := StoreHackatomExampleContract(t, ctx, keepers) + + verifier, _, verifierAddr := keyPubAddr() + fundAccounts(t, ctx, keepers.AccountKeeper, keepers.BankKeeper, verifierAddr, contract.InitialAmount) + + beneficiary, _, beneficiaryAddr := keyPubAddr() + initMsgBz := HackatomExampleInitMsg{ + Verifier: verifierAddr, + Beneficiary: beneficiaryAddr, + }.GetBytes(t) + initialAmount := sdk.NewCoins(sdk.NewInt64Coin("denom", 100)) + + adminAddr := contract.CreatorAddr + label := "demo contract to query" + contractAddr, _, err := keepers.ContractKeeper.Instantiate(ctx, contract.CodeID, contract.CreatorAddr, adminAddr, initMsgBz, label, initialAmount) + require.NoError(t, err) + return HackatomExampleInstance{ + ExampleContract: contract, + Contract: contractAddr, + Verifier: verifier, + VerifierAddr: verifierAddr, + Beneficiary: beneficiary, + BeneficiaryAddr: beneficiaryAddr, + Label: label, + Deposit: initialAmount, + } +} + +type ExampleInstance struct { + ExampleContract + Contract sdk.AccAddress + Label string + Deposit sdk.Coins +} + +// InstantiateReflectExampleContract load and instantiate the "./testdata/reflect.wasm" contract +func InstantiateReflectExampleContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) ExampleInstance { + example := StoreReflectContract(t, ctx, keepers) + initialAmount := sdk.NewCoins(sdk.NewInt64Coin("denom", 100)) + label := "demo contract to query" + contractAddr, _, err := keepers.ContractKeeper.Instantiate(ctx, example.CodeID, example.CreatorAddr, nil, []byte("{}"), label, initialAmount) + + require.NoError(t, err) + return ExampleInstance{ + ExampleContract: example, + Contract: contractAddr, + Label: label, + Deposit: initialAmount, + } +} + +type HackatomExampleInitMsg struct { + Verifier sdk.AccAddress `json:"verifier"` + Beneficiary sdk.AccAddress `json:"beneficiary"` +} + +func (m HackatomExampleInitMsg) GetBytes(t testing.TB) []byte { + initMsgBz, err := json.Marshal(m) + require.NoError(t, err) + return initMsgBz +} + +type IBCReflectExampleInstance struct { + Contract sdk.AccAddress + Admin sdk.AccAddress + CodeID uint64 + ReflectCodeID uint64 +} + +// InstantiateIBCReflectContract load and instantiate the "./testdata/ibc_reflect.wasm" contract +func InstantiateIBCReflectContract(t testing.TB, ctx sdk.Context, keepers TestKeepers) IBCReflectExampleInstance { + reflectID := StoreReflectContract(t, ctx, keepers).CodeID + ibcReflectID := StoreIBCReflectContract(t, ctx, keepers).CodeID + + initMsgBz := IBCReflectInitMsg{ + ReflectCodeID: reflectID, + }.GetBytes(t) + adminAddr := RandomAccountAddress(t) + + contractAddr, _, err := keepers.ContractKeeper.Instantiate(ctx, ibcReflectID, adminAddr, adminAddr, initMsgBz, "ibc-reflect-factory", nil) + require.NoError(t, err) + return IBCReflectExampleInstance{ + Admin: adminAddr, + Contract: contractAddr, + CodeID: ibcReflectID, + ReflectCodeID: reflectID, + } +} + +type IBCReflectInitMsg struct { + ReflectCodeID uint64 `json:"reflect_code_id"` +} + +func (m IBCReflectInitMsg) GetBytes(t testing.TB) []byte { + initMsgBz, err := json.Marshal(m) + require.NoError(t, err) + return initMsgBz +} + +type BurnerExampleInitMsg struct { + Payout sdk.AccAddress `json:"payout"` +} + +func (m BurnerExampleInitMsg) GetBytes(t testing.TB) []byte { + initMsgBz, err := json.Marshal(m) + require.NoError(t, err) + return initMsgBz +} + +func fundAccounts(t testing.TB, ctx sdk.Context, am authkeeper.AccountKeeper, bank bankkeeper.Keeper, addr sdk.AccAddress, coins sdk.Coins) { + acc := am.NewAccountWithAddress(ctx, addr) + am.SetAccount(ctx, acc) + wasmkeeper.NewTestFaucet(t, ctx, bank, minttypes.ModuleName, coins...).Fund(ctx, addr, coins...) +} + +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) +// +//nolint:unparam +func keyPubAddr() (crypto.PrivKey, crypto.PubKey, sdk.AccAddress) { + keyCounter++ + seed := make([]byte, 8) + binary.BigEndian.PutUint64(seed, keyCounter) + + key := ed25519.GenPrivKeyFromSecret(seed) + pub := key.PubKey() + addr := sdk.AccAddress(pub.Address()) + return key, pub, addr +} diff --git a/x/wasmplus/module.go b/x/wasmplus/module.go new file mode 100644 index 0000000000..cde2e6568f --- /dev/null +++ b/x/wasmplus/module.go @@ -0,0 +1,188 @@ +package wasmplus + +import ( + "context" + "encoding/json" + "math/rand" + + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + abci "github.com/tendermint/tendermint/abci/types" + + "github.com/line/lbm-sdk/client" + "github.com/line/lbm-sdk/codec" + cdctypes "github.com/line/lbm-sdk/codec/types" + sdk "github.com/line/lbm-sdk/types" + sdkerrors "github.com/line/lbm-sdk/types/errors" + "github.com/line/lbm-sdk/types/module" + simtypes "github.com/line/lbm-sdk/types/simulation" + + wasmkeeper "github.com/line/wasmd/x/wasm/keeper" + "github.com/line/wasmd/x/wasm/simulation" + wasmtypes "github.com/line/wasmd/x/wasm/types" + "github.com/line/wasmd/x/wasmplus/client/cli" + "github.com/line/wasmd/x/wasmplus/keeper" + "github.com/line/wasmd/x/wasmplus/types" +) + +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} +) + +// AppModuleBasic defines the basic application module used by the wasm module. +type AppModuleBasic struct{} + +// Name returns the wasm module's name. +func (a AppModuleBasic) Name() string { + return types.ModuleName +} + +func (a AppModuleBasic) RegisterLegacyAminoCodec(amino *codec.LegacyAmino) { + types.RegisterLegacyAminoCodec(amino) +} + +// RegisterInterfaces implements InterfaceModule +func (a AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(registry) +} + +// DefaultGenesis returns default genesis state as raw bytes for the wasm module. +func (a AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(&types.GenesisState{ + Params: wasmtypes.DefaultParams(), + }) +} + +// ValidateGenesis performs genesis state validation for the wasm module. +func (a AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, message json.RawMessage) error { + var data types.GenesisState + if err := cdc.UnmarshalJSON(message, &data); err != nil { + return sdkerrors.Wrap(err, "validate genesis") + } + return data.ValidateBasic() +} + +func (a AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, serveMux *runtime.ServeMux) { + if err := types.RegisterQueryHandlerClient(context.Background(), serveMux, types.NewQueryClient(clientCtx)); err != nil { + panic(err) + } + if err := wasmtypes.RegisterQueryHandlerClient(context.Background(), serveMux, wasmtypes.NewQueryClient(clientCtx)); err != nil { + panic(err) + } +} + +// GetTxCmd returns the root tx command for the wasm module. +func (a AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.GetTxCmd() +} + +// GetQueryCmd returns no root query command for the wasm module. +func (a AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd() +} + +type AppModule struct { + AppModuleBasic + cdc codec.Codec + keeper *keeper.Keeper + validatorSetSource wasmkeeper.ValidatorSetSource + accountKeeper wasmtypes.AccountKeeper // for simulation + bankKeeper simulation.BankKeeper +} + +func NewAppModule( + cdc codec.Codec, + keeper *keeper.Keeper, + vs wasmkeeper.ValidatorSetSource, + ak wasmtypes.AccountKeeper, + bk simulation.BankKeeper, +) AppModule { + return AppModule{ + AppModuleBasic: AppModuleBasic{}, + cdc: cdc, + keeper: keeper, + validatorSetSource: vs, + accountKeeper: ak, + bankKeeper: bk, + } +} + +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) []abci.ValidatorUpdate { + var genesisState types.GenesisState + cdc.MustUnmarshalJSON(data, &genesisState) + validators, err := keeper.InitGenesis(ctx, am.keeper, genesisState, am.validatorSetSource, am.Route().Handler()) + if err != nil { + panic(err) + } + return validators +} + +// ExportGenesis returns the exported genesis state as raw bytes for the wasm module. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + gs := keeper.ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(gs) +} + +// RegisterInvariants registers the wasm module invariants. +func (am AppModule) RegisterInvariants(registry sdk.InvariantRegistry) {} + +// Route returns the message routing key for the wasm module. +func (am AppModule) Route() sdk.Route { + return sdk.NewRoute(types.RouterKey, + NewHandler(keeper.NewPermissionedKeeper(*wasmkeeper.NewDefaultPermissionKeeper(am.keeper), am.keeper))) +} + +// QuerierRoute returns the wasm module's querier route name. +func (am AppModule) QuerierRoute() string { + return wasmtypes.QuerierRoute +} + +func (am AppModule) LegacyQuerierHandler(amino *codec.LegacyAmino) sdk.Querier { + return wasmkeeper.NewLegacyQuerier(am.keeper, am.keeper.QueryGasLimit()) +} + +func (am AppModule) RegisterServices(cfg module.Configurator) { + // wasmplus service + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(wasmkeeper.NewDefaultPermissionKeeper(am.keeper))) + types.RegisterQueryServer(cfg.QueryServer(), keeper.Querier(am.keeper)) + // wasm service + wasmtypes.RegisterMsgServer(cfg.MsgServer(), wasmkeeper.NewMsgServerImpl(wasmkeeper.NewDefaultPermissionKeeper(am.keeper))) + wasmtypes.RegisterQueryServer(cfg.QueryServer(), keeper.WasmQuerier(am.keeper)) +} + +// 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 (am AppModule) ConsensusVersion() uint64 { + return 1 +} + +// ____________________________________________________________________________ + +// AppModuleSimulation functions + +// GenerateGenesisState creates a randomized GenState of the bank module. +func (am AppModule) GenerateGenesisState(simState *module.SimulationState) { + simulation.RandomizedGenState(simState) +} + +// ProposalContents doesn't return any content functions for governance proposals. +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.ParamChange { + return simulation.ParamChanges(r, am.cdc) +} + +// RegisterStoreDecoder registers a decoder for supply module's types +func (am AppModule) RegisterStoreDecoder(registry 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.accountKeeper, am.bankKeeper, am.keeper) +} diff --git a/x/wasmplus/module_integration_test.go b/x/wasmplus/module_integration_test.go new file mode 100644 index 0000000000..a6ff782d90 --- /dev/null +++ b/x/wasmplus/module_integration_test.go @@ -0,0 +1,32 @@ +package wasmplus_test + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + sdk "github.com/line/lbm-sdk/types" + "github.com/line/lbm-sdk/types/module" + upgradetypes "github.com/line/lbm-sdk/x/upgrade/types" + + "github.com/line/wasmd/appplus" + "github.com/line/wasmd/x/wasm" +) + +func TestAppPlusModuleMigrations(t *testing.T) { + wasmApp := appplus.Setup(false) + 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) + } + fromVM := wasmApp.UpgradeKeeper.GetModuleVersionMap(ctx) + fromVM[wasm.ModuleName] = 1 // start with initial version + upgradeHandler(ctx, upgradetypes.Plan{Name: "testing"}, fromVM) + // when + gotVM, err := wasmApp.ModuleManager().RunMigrations(ctx, wasmApp.ModuleConfigurator(), fromVM) + // then + require.NoError(t, err) + assert.Equal(t, uint64(1), gotVM[wasm.ModuleName]) +} diff --git a/x/wasmplus/module_test.go b/x/wasmplus/module_test.go new file mode 100644 index 0000000000..b5df999ed8 --- /dev/null +++ b/x/wasmplus/module_test.go @@ -0,0 +1,440 @@ +package wasmplus + +import ( + "encoding/json" + "fmt" + "os" + "testing" + + "github.com/dvsekhvalnov/jose2go/base64url" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + + sdk "github.com/line/lbm-sdk/types" + "github.com/line/lbm-sdk/types/module" + authkeeper "github.com/line/lbm-sdk/x/auth/keeper" + bankkeeper "github.com/line/lbm-sdk/x/bank/keeper" + stakingkeeper "github.com/line/lbm-sdk/x/staking/keeper" + "github.com/line/ostracon/crypto" + "github.com/line/ostracon/crypto/ed25519" + + wasmkeeper "github.com/line/wasmd/x/wasm/keeper" + wasmtypes "github.com/line/wasmd/x/wasm/types" + "github.com/line/wasmd/x/wasmplus/keeper" + "github.com/line/wasmd/x/wasmplus/types" +) + +type testData struct { + module module.AppModule + ctx sdk.Context + acctKeeper authkeeper.AccountKeeper + keeper keeper.Keeper + bankKeeper bankkeeper.Keeper + stakingKeeper stakingkeeper.Keeper + faucet *wasmkeeper.TestFaucet +} + +func setupTest(t *testing.T) testData { + ctx, keepers := keeper.CreateTestInput(t, false, "iterator,staking,stargate,cosmwasm_1_1") + cdc := wasmkeeper.MakeTestCodec(t) + 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, + } + return data +} + +func keyPubAddr() (crypto.PrivKey, crypto.PubKey, sdk.AccAddress) { + key := ed25519.GenPrivKey() + pub := key.PubKey() + addr := sdk.AccAddress(pub.Address()) + return key, pub, addr +} + +func mustLoad(path string) []byte { + bz, err := os.ReadFile(path) + if err != nil { + panic(err) + } + return bz +} + +var ( + _, _, addrAcc1 = keyPubAddr() + addr1 = addrAcc1.String() + testContract = mustLoad("../wasm/keeper/testdata/hackatom.wasm") + oldContract = mustLoad("../wasm/testdata/escrow_0.7.wasm") +) + +type initMsg struct { + Verifier sdk.AccAddress `json:"verifier"` + Beneficiary sdk.AccAddress `json:"beneficiary"` +} + +type emptyMsg struct{} + +type state struct { + Verifier string `json:"verifier"` + Beneficiary string `json:"beneficiary"` + Funder string `json:"funder"` +} + +// ensures this returns a valid codeID and bech32 address and returns it +func parseStoreAndInitResponse(t *testing.T, data []byte) (uint64, string) { + var res types.MsgStoreCodeAndInstantiateContractResponse + require.NoError(t, res.Unmarshal(data)) + require.NotEmpty(t, res.CodeID) + require.NotEmpty(t, res.Address) + addr := res.Address + codeID := res.CodeID + // ensure this is a valid sdk address + _, err := sdk.AccAddressFromBech32(addr) + require.NoError(t, err) + return codeID, addr +} + +type prettyEvent struct { + Type string + Attr []sdk.Attribute +} + +func prettyEvents(evts []abci.Event) string { + res := make([]prettyEvent, len(evts)) + for i, e := range evts { + res[i] = prettyEvent{ + Type: e.Type, + Attr: prettyAttrs(e.Attributes), + } + } + bz, err := json.MarshalIndent(res, "", " ") + if err != nil { + panic(err) + } + return string(bz) +} + +func prettyAttrs(attrs []abci.EventAttribute) []sdk.Attribute { + pretty := make([]sdk.Attribute, len(attrs)) + for i, a := range attrs { + pretty[i] = prettyAttr(a) + } + return pretty +} + +func prettyAttr(attr abci.EventAttribute) sdk.Attribute { + return sdk.NewAttribute(string(attr.Key), string(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)) +} + +func assertCodeList(t *testing.T, q sdk.Querier, ctx sdk.Context, expectedNum int) { + bz, sdkerr := q(ctx, []string{wasmkeeper.QueryListCode}, abci.RequestQuery{}) + require.NoError(t, sdkerr) + + if len(bz) == 0 { + require.Equal(t, expectedNum, 0) + return + } + + var res []wasmtypes.CodeInfo + err := json.Unmarshal(bz, &res) + require.NoError(t, err) + + assert.Equal(t, expectedNum, len(res)) +} + +func assertCodeBytes(t *testing.T, q sdk.Querier, ctx sdk.Context, codeID uint64, expectedBytes []byte) { + path := []string{wasmkeeper.QueryGetCode, fmt.Sprintf("%d", codeID)} + bz, sdkerr := q(ctx, path, abci.RequestQuery{}) + require.NoError(t, sdkerr) + + if len(expectedBytes) == 0 { + require.Equal(t, len(bz), 0, "%q", string(bz)) + return + } + var res map[string]interface{} + err := json.Unmarshal(bz, &res) + require.NoError(t, err) + + 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"]) +} + +func assertContractList(t *testing.T, q sdk.Querier, ctx sdk.Context, codeID uint64, expContractAddrs []string) { + bz, sdkerr := q(ctx, []string{wasmkeeper.QueryListContractByCode, fmt.Sprintf("%d", codeID)}, abci.RequestQuery{}) + require.NoError(t, sdkerr) + + if len(bz) == 0 { + require.Equal(t, len(expContractAddrs), 0) + return + } + + var res []string + err := json.Unmarshal(bz, &res) + require.NoError(t, err) + + hasAddrs := make([]string, len(res)) + for i, r := range res { + hasAddrs[i] = r + } + + assert.Equal(t, expContractAddrs, hasAddrs) +} + +func assertContractInfo(t *testing.T, q sdk.Querier, ctx sdk.Context, contractBech32Addr string, codeID uint64, creator sdk.AccAddress) { + t.Helper() + path := []string{wasmkeeper.QueryGetContract, contractBech32Addr} + bz, sdkerr := q(ctx, path, abci.RequestQuery{}) + require.NoError(t, sdkerr) + + var res wasmtypes.ContractInfo + err := json.Unmarshal(bz, &res) + require.NoError(t, err) + + assert.Equal(t, codeID, res.CodeID) + assert.Equal(t, creator.String(), res.Creator) +} + +func assertContractState(t *testing.T, q sdk.Querier, ctx sdk.Context, contractBech32Addr string, expected state) { + t.Helper() + path := []string{wasmkeeper.QueryGetContractState, contractBech32Addr, wasmkeeper.QueryMethodContractStateAll} + bz, sdkerr := q(ctx, path, abci.RequestQuery{}) + require.NoError(t, sdkerr) + + var res []wasmtypes.Model + err := json.Unmarshal(bz, &res) + require.NoError(t, err) + require.Equal(t, 1, len(res), "#v", res) + require.Equal(t, []byte("config"), []byte(res[0].Key)) + + expectedBz, err := json.Marshal(expected) + require.NoError(t, err) + assert.Equal(t, expectedBz, res[0].Value) +} + +func TestHandleStoreAndInstantiate(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) + + _, _, bob := keyPubAddr() + _, _, fred := keyPubAddr() + + initMsg := initMsg{ + Verifier: fred, + Beneficiary: bob, + } + msgBz, err := json.Marshal(initMsg) + require.NoError(t, err) + + // create with no balance is legal + msg := &types.MsgStoreCodeAndInstantiateContract{ + Sender: creator.String(), + WASMByteCode: testContract, + Msg: msgBz, + Label: "contract for test", + Funds: nil, + } + res, err := h(data.ctx, msg) + require.NoError(t, err) + codeID, contractBech32Addr := parseStoreAndInitResponse(t, res.Data) + + require.Equal(t, uint64(1), codeID) + require.Equal(t, "link14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sgf2vn8", contractBech32Addr) + // this should be standard x/wasm init event, nothing from contract + require.Equal(t, 4, len(res.Events), prettyEvents(res.Events)) + assert.Equal(t, "store_code", res.Events[0].Type) + assertAttribute(t, "code_id", "1", res.Events[0].Attributes[1]) + assert.Equal(t, "message", res.Events[1].Type) + assertAttribute(t, "module", "wasm", res.Events[1].Attributes[0]) + assert.Equal(t, "instantiate", res.Events[2].Type) + assertAttribute(t, "_contract_address", contractBech32Addr, res.Events[2].Attributes[0]) + assertAttribute(t, "code_id", "1", res.Events[2].Attributes[1]) + assert.Equal(t, "wasm", res.Events[3].Type) + assertAttribute(t, "_contract_address", contractBech32Addr, res.Events[3].Attributes[0]) + + assertCodeList(t, q, data.ctx, 1) + assertCodeBytes(t, q, data.ctx, 1, testContract) + + assertContractList(t, q, data.ctx, 1, []string{contractBech32Addr}) + assertContractInfo(t, q, data.ctx, contractBech32Addr, 1, creator) + assertContractState(t, q, data.ctx, contractBech32Addr, state{ + Verifier: fred.String(), + Beneficiary: bob.String(), + Funder: creator.String(), + }) +} + +func TestErrorsCreateAndInstantiate(t *testing.T) { + // init messages + _, _, bob := keyPubAddr() + _, _, fred := keyPubAddr() + initMsg := initMsg{ + Verifier: fred, + Beneficiary: bob, + } + validInitMsgBz, err := json.Marshal(initMsg) + require.NoError(t, err) + + invalidInitMsgBz, err := json.Marshal(emptyMsg{}) + + expectedContractBech32Addr := "link14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9sgf2vn8" + + // test cases + cases := map[string]struct { + msg sdk.Msg + isValid bool + expectedCodes int + expectedBytes []byte + }{ + "empty": { + msg: &types.MsgStoreCodeAndInstantiateContract{}, + isValid: false, + expectedCodes: 0, + expectedBytes: nil, + }, + "valid one": { + msg: &types.MsgStoreCodeAndInstantiateContract{ + Sender: addr1, + WASMByteCode: testContract, + Msg: validInitMsgBz, + Label: "foo", + Funds: nil, + }, + isValid: true, + expectedCodes: 1, + expectedBytes: testContract, + }, + "invalid wasm": { + msg: &types.MsgStoreCodeAndInstantiateContract{ + Sender: addr1, + WASMByteCode: []byte("foobar"), + Msg: validInitMsgBz, + Label: "foo", + Funds: nil, + }, + isValid: false, + expectedCodes: 0, + expectedBytes: nil, + }, + "old wasm (0.7)": { + msg: &types.MsgStoreCodeAndInstantiateContract{ + Sender: addr1, + WASMByteCode: oldContract, + Msg: validInitMsgBz, + Label: "foo", + Funds: nil, + }, + isValid: false, + expectedCodes: 0, + expectedBytes: nil, + }, + "invalid init message": { + msg: &types.MsgStoreCodeAndInstantiateContract{ + Sender: addr1, + WASMByteCode: testContract, + Msg: invalidInitMsgBz, + Label: "foo", + Funds: nil, + }, + isValid: false, + expectedCodes: 1, + expectedBytes: testContract, + }, + } + + for name, tc := range cases { + tc := tc + t.Run(name, func(t *testing.T) { + data := setupTest(t) + + h := data.module.Route().Handler() + q := data.module.LegacyQuerierHandler(nil) + + // asserting response + res, err := h(data.ctx, tc.msg) + if tc.isValid { + require.NoError(t, err) + codeID, contractBech32Addr := parseStoreAndInitResponse(t, res.Data) + require.Equal(t, uint64(1), codeID) + require.Equal(t, expectedContractBech32Addr, contractBech32Addr) + + } else { + require.Error(t, err, "%#v", res) + } + + // asserting code state + assertCodeList(t, q, data.ctx, tc.expectedCodes) + assertCodeBytes(t, q, data.ctx, 1, tc.expectedBytes) + + // asserting contract state + if tc.isValid { + assertContractList(t, q, data.ctx, 1, []string{expectedContractBech32Addr}) + assertContractInfo(t, q, data.ctx, expectedContractBech32Addr, 1, addrAcc1) + assertContractState(t, q, data.ctx, expectedContractBech32Addr, state{ + Verifier: fred.String(), + Beneficiary: bob.String(), + Funder: addrAcc1.String(), + }) + } else { + assertContractList(t, q, data.ctx, 0, []string{}) + } + }) + } +} + +func TestHandleNonPlusWasmCreate(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 := &wasmtypes.MsgStoreCode{ + Sender: creator.String(), + WASMByteCode: testContract, + } + + res, err := h(data.ctx, msg) + require.NoError(t, err) + assertStoreCodeResponse(t, res.Data, 1) + + require.Equal(t, 2, len(res.Events), prettyEvents(res.Events)) + assert.Equal(t, "message", res.Events[0].Type) + assertAttribute(t, "module", "wasm", res.Events[0].Attributes[0]) + assert.Equal(t, "store_code", res.Events[1].Type) + assertAttribute(t, "code_id", "1", res.Events[1].Attributes[1]) + + assertCodeList(t, q, data.ctx, 1) + assertCodeBytes(t, q, data.ctx, 1, testContract) +} + +func TestErrorHandleNonPlusWasmCreate(t *testing.T) { + data := setupTest(t) + creator := data.faucet.NewFundedRandomAccount(data.ctx, sdk.NewInt64Coin("denom", 100000)) + + h := data.module.Route().Handler() + + msg := &wasmtypes.MsgStoreCode{ + Sender: creator.String(), + WASMByteCode: []byte("invalid WASM contract"), + } + + _, err := h(data.ctx, msg) + require.ErrorContains(t, err, "Wasm validation") +} diff --git a/x/wasm/testdata/call_number.wasm b/x/wasmplus/testdata/call_number.wasm similarity index 100% rename from x/wasm/testdata/call_number.wasm rename to x/wasmplus/testdata/call_number.wasm diff --git a/x/wasm/testdata/dynamic_callee_contract.wasm b/x/wasmplus/testdata/dynamic_callee_contract.wasm similarity index 100% rename from x/wasm/testdata/dynamic_callee_contract.wasm rename to x/wasmplus/testdata/dynamic_callee_contract.wasm diff --git a/x/wasm/testdata/dynamic_caller_contract.wasm b/x/wasmplus/testdata/dynamic_caller_contract.wasm similarity index 100% rename from x/wasm/testdata/dynamic_caller_contract.wasm rename to x/wasmplus/testdata/dynamic_caller_contract.wasm diff --git a/x/wasm/testdata/events.wasm b/x/wasmplus/testdata/events.wasm similarity index 100% rename from x/wasm/testdata/events.wasm rename to x/wasmplus/testdata/events.wasm diff --git a/x/wasm/testdata/number.wasm b/x/wasmplus/testdata/number.wasm similarity index 100% rename from x/wasm/testdata/number.wasm rename to x/wasmplus/testdata/number.wasm diff --git a/x/wasm/lbmtypes/codec.go b/x/wasmplus/types/codec.go similarity index 96% rename from x/wasm/lbmtypes/codec.go rename to x/wasmplus/types/codec.go index c25188bdd4..9e3073be6f 100644 --- a/x/wasm/lbmtypes/codec.go +++ b/x/wasmplus/types/codec.go @@ -1,4 +1,4 @@ -package lbmtypes +package types import ( "github.com/line/lbm-sdk/codec" @@ -16,7 +16,7 @@ import ( // RegisterLegacyAminoCodec registers the account types and interface func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { //nolint:staticcheck - legacy.RegisterAminoMsg(cdc, &MsgStoreCodeAndInstantiateContract{}, "wasm/StoreCodeAndInstantiateContract") + legacy.RegisterAminoMsg(cdc, &MsgStoreCodeAndInstantiateContract{}, "wasm/MsgStoreCodeAndInstantiateContract") cdc.RegisterConcrete(&DeactivateContractProposal{}, "wasm/DeactivateContractProposal", nil) cdc.RegisterConcrete(&ActivateContractProposal{}, "wasm/ActivateContractProposal", nil) diff --git a/x/wasmplus/types/errors.go b/x/wasmplus/types/errors.go new file mode 100644 index 0000000000..0df644fbe4 --- /dev/null +++ b/x/wasmplus/types/errors.go @@ -0,0 +1,13 @@ +package types + +import ( + sdkErrors "github.com/line/lbm-sdk/types/errors" + + wasmtypes "github.com/line/wasmd/x/wasm/types" +) + +// Codes for wasm contract errors +var ( + // ErrInactiveContract error if the contract set inactive + ErrInactiveContract = sdkErrors.Register(wasmtypes.DefaultCodespace, 101, "inactive contract") +) diff --git a/x/wasm/lbmtypes/event.pb.go b/x/wasmplus/types/event.pb.go similarity index 96% rename from x/wasm/lbmtypes/event.pb.go rename to x/wasmplus/types/event.pb.go index ead9217eec..dc8c32b259 100644 --- a/x/wasm/lbmtypes/event.pb.go +++ b/x/wasmplus/types/event.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: lbm/wasm/v1/event.proto -package lbmtypes +package types import ( fmt "fmt" @@ -122,19 +122,19 @@ func init() { func init() { proto.RegisterFile("lbm/wasm/v1/event.proto", fileDescriptor_4be408da9fc96f03) } var fileDescriptor_4be408da9fc96f03 = []byte{ - // 183 bytes of a gzipped FileDescriptorProto + // 184 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcf, 0x49, 0xca, 0xd5, 0x2f, 0x4f, 0x2c, 0xce, 0xd5, 0x2f, 0x33, 0xd4, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xce, 0x49, 0xca, 0xd5, 0x03, 0x49, 0xe8, 0x95, 0x19, 0x2a, 0xd9, 0x72, 0xc9, 0xbb, 0x82, 0xe4, 0x5c, 0x52, 0x13, 0x93, 0x4b, 0x32, 0xcb, 0x12, 0x4b, 0x52, 0x9d, 0xf3, 0xf3, 0x4a, 0x8a, 0x12, 0x93, 0x4b, 0x02, 0x8a, 0xf2, 0x0b, 0xf2, 0x8b, 0x13, 0x73, 0x84, 0xa4, 0xb8, 0x38, 0x92, 0xa1, 0x62, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x41, 0x70, 0xbe, 0x92, - 0x35, 0x97, 0x2c, 0x58, 0xbb, 0x23, 0x19, 0x9a, 0x9d, 0xec, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, + 0x35, 0x97, 0x2c, 0x58, 0xbb, 0x23, 0x19, 0x9a, 0x9d, 0x1c, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, - 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x35, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, - 0x3f, 0x27, 0x33, 0x2f, 0x15, 0xec, 0x8f, 0x14, 0xfd, 0x0a, 0x88, 0x7f, 0x72, 0x92, 0x72, 0x4b, - 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x1e, 0x32, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x7e, - 0x8a, 0x63, 0x0f, 0xeb, 0x00, 0x00, 0x00, + 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x2d, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, + 0x3f, 0x27, 0x33, 0x2f, 0x15, 0xec, 0x8f, 0x14, 0xfd, 0x0a, 0x30, 0x5d, 0x90, 0x53, 0x5a, 0xac, + 0x5f, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0xf6, 0x91, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, + 0x73, 0x99, 0x3a, 0x14, 0xec, 0x00, 0x00, 0x00, } func (m *EventDeactivateContractProposal) Marshal() (dAtA []byte, err error) { diff --git a/x/wasmplus/types/events.go b/x/wasmplus/types/events.go new file mode 100644 index 0000000000..c5813f245f --- /dev/null +++ b/x/wasmplus/types/events.go @@ -0,0 +1,15 @@ +package types + +const ( + // events from callable point + CallablePointEventType = "wasm-callablepoint" + // prefix for custom events from callable point + CustomCallablePointEventPrefix = "wasm-callablepoint-" +) + +// event attributes returned from contract execution +const ( + AttributeKeyCallstack = "_callstack" + AttributeKeyCodeIDs = "code_ids" + AttributeKeyFeature = "feature" +) diff --git a/x/wasmplus/types/exported_keepers.go b/x/wasmplus/types/exported_keepers.go new file mode 100644 index 0000000000..c4b067b252 --- /dev/null +++ b/x/wasmplus/types/exported_keepers.go @@ -0,0 +1,22 @@ +package types + +import ( + sdk "github.com/line/lbm-sdk/types" + + wasmtypes "github.com/line/wasmd/x/wasm/types" +) + +type ViewKeeper interface { + IterateInactiveContracts(ctx sdk.Context, fn func(contractAddress sdk.AccAddress) bool) + IsInactiveContract(ctx sdk.Context, contractAddress sdk.AccAddress) bool +} + +type ContractOpsKeeper interface { + wasmtypes.ContractOpsKeeper + + // DeactivateContract add the contract address to inactive contract list. + DeactivateContract(ctx sdk.Context, contractAddress sdk.AccAddress) error + + // ActivateContract remove the contract address from inactive contract list. + ActivateContract(ctx sdk.Context, contractAddress sdk.AccAddress) error +} diff --git a/x/wasmplus/types/genesis.go b/x/wasmplus/types/genesis.go new file mode 100644 index 0000000000..c3031e37c1 --- /dev/null +++ b/x/wasmplus/types/genesis.go @@ -0,0 +1,60 @@ +package types + +import ( + sdk "github.com/line/lbm-sdk/types" + sdkerrors "github.com/line/lbm-sdk/types/errors" + + wasmtypes "github.com/line/wasmd/x/wasm/types" +) + +func (gs GenesisState) ValidateBasic() error { + if err := gs.Params.ValidateBasic(); err != nil { + return sdkerrors.Wrap(err, "params") + } + for i := range gs.Codes { + if err := gs.Codes[i].ValidateBasic(); err != nil { + return sdkerrors.Wrapf(err, "code: %d", i) + } + } + for i := range gs.Contracts { + if err := gs.Contracts[i].ValidateBasic(); err != nil { + return sdkerrors.Wrapf(err, "contract: %d", i) + } + } + for i := range gs.Sequences { + if err := gs.Sequences[i].ValidateBasic(); err != nil { + return sdkerrors.Wrapf(err, "sequence: %d", i) + } + } + for i := range gs.GenMsgs { + if err := gs.GenMsgs[i].ValidateBasic(); err != nil { + return sdkerrors.Wrapf(err, "gen message: %d", i) + } + } + for i, addr := range gs.InactiveContractAddresses { + if _, err := sdk.AccAddressFromBech32(addr); err != nil { + return sdkerrors.Wrapf(err, "inactive contract address: %d", i) + } + } + return nil +} + +// RawWasmState convert to wasm genesis state for vanilla import. +// Custom data models for privileged contracts are not included +func (gs GenesisState) RawWasmState() wasmtypes.GenesisState { + params := wasmtypes.Params{ + CodeUploadAccess: gs.Params.CodeUploadAccess, + InstantiateDefaultPermission: gs.Params.InstantiateDefaultPermission, + } + return wasmtypes.GenesisState{ + Params: params, + Codes: gs.Codes, + Contracts: gs.Contracts, + Sequences: gs.Sequences, + GenMsgs: gs.GenMsgs, + } +} + +func ValidateGenesis(data GenesisState) error { + return data.ValidateBasic() +} diff --git a/x/wasmplus/types/genesis.pb.go b/x/wasmplus/types/genesis.pb.go new file mode 100644 index 0000000000..ac95ec1614 --- /dev/null +++ b/x/wasmplus/types/genesis.pb.go @@ -0,0 +1,638 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: lbm/wasm/v1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + types "github.com/line/wasmd/x/wasm/types" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState - genesis state of x/wasm +type GenesisState struct { + Params types.Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + Codes []types.Code `protobuf:"bytes,2,rep,name=codes,proto3" json:"codes,omitempty"` + Contracts []types.Contract `protobuf:"bytes,3,rep,name=contracts,proto3" json:"contracts,omitempty"` + Sequences []types.Sequence `protobuf:"bytes,4,rep,name=sequences,proto3" json:"sequences,omitempty"` + GenMsgs []types.GenesisState_GenMsgs `protobuf:"bytes,5,rep,name=gen_msgs,json=genMsgs,proto3" json:"gen_msgs,omitempty"` + // InactiveContractAddresses is a list of contract address that set inactive + InactiveContractAddresses []string `protobuf:"bytes,6,rep,name=inactive_contract_addresses,json=inactiveContractAddresses,proto3" json:"inactive_contract_address,omitempty"` +} + +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_3308f670fed712dc, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() types.Params { + if m != nil { + return m.Params + } + return types.Params{} +} + +func (m *GenesisState) GetCodes() []types.Code { + if m != nil { + return m.Codes + } + return nil +} + +func (m *GenesisState) GetContracts() []types.Contract { + if m != nil { + return m.Contracts + } + return nil +} + +func (m *GenesisState) GetSequences() []types.Sequence { + if m != nil { + return m.Sequences + } + return nil +} + +func (m *GenesisState) GetGenMsgs() []types.GenesisState_GenMsgs { + if m != nil { + return m.GenMsgs + } + return nil +} + +func (m *GenesisState) GetInactiveContractAddresses() []string { + if m != nil { + return m.InactiveContractAddresses + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "lbm.wasm.v1.GenesisState") +} + +func init() { proto.RegisterFile("lbm/wasm/v1/genesis.proto", fileDescriptor_3308f670fed712dc) } + +var fileDescriptor_3308f670fed712dc = []byte{ + // 399 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xcf, 0x4b, 0xe3, 0x40, + 0x14, 0xc7, 0x93, 0xed, 0x8f, 0xdd, 0xa6, 0x0b, 0x0b, 0xd9, 0x65, 0x37, 0x4d, 0x97, 0xb4, 0x28, + 0xd4, 0x1e, 0x24, 0xa1, 0x15, 0x3c, 0x6b, 0x44, 0x3c, 0x09, 0xd2, 0xe2, 0x45, 0x90, 0x92, 0x1f, + 0xc3, 0x18, 0xc8, 0x64, 0x62, 0xde, 0xb4, 0xda, 0xb3, 0xff, 0x80, 0x7f, 0x56, 0x8f, 0x3d, 0x7a, + 0x2a, 0xd2, 0xde, 0xfa, 0x57, 0x48, 0x26, 0x99, 0x36, 0x52, 0x7b, 0x4a, 0xf2, 0xde, 0xe7, 0xfb, + 0x79, 0x99, 0xe1, 0x29, 0x8d, 0xd0, 0x25, 0xd6, 0x93, 0x03, 0xc4, 0x9a, 0xf4, 0x2c, 0x8c, 0x22, + 0x04, 0x01, 0x98, 0x71, 0x42, 0x19, 0x55, 0xeb, 0xa1, 0x4b, 0xcc, 0xb4, 0x65, 0x4e, 0x7a, 0xfa, + 0x1f, 0x4c, 0x31, 0xe5, 0x75, 0x2b, 0x7d, 0xcb, 0x10, 0xfd, 0xbf, 0x47, 0x81, 0xf0, 0xb4, 0x50, + 0xb0, 0x69, 0x8c, 0x72, 0x81, 0x6e, 0xec, 0x74, 0x3f, 0x0d, 0x38, 0x78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x87, 0x7b, 0xb1, 0x82, 0xb6, 0x21, 0x20, 0x71, 0x7b, 0xe7, 0xc2, 0x64, 0x9f, + 0xcd, 0x96, 0x86, 0x3c, 0x5f, 0x1a, 0xf2, 0xfb, 0xd2, 0x90, 0x5f, 0x57, 0x86, 0x34, 0x5f, 0x19, + 0xd2, 0xdb, 0xca, 0x90, 0xee, 0x3a, 0x38, 0x60, 0x0f, 0x63, 0xd7, 0xf4, 0x28, 0xb1, 0xc2, 0x20, + 0x42, 0x7c, 0x8d, 0x7c, 0xeb, 0x99, 0x3f, 0xe3, 0x70, 0x0c, 0xd9, 0xb6, 0xb9, 0x55, 0xbe, 0x4e, + 0x27, 0x1f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x90, 0xa2, 0x83, 0x75, 0xcc, 0x02, 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.InactiveContractAddresses) > 0 { + for iNdEx := len(m.InactiveContractAddresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.InactiveContractAddresses[iNdEx]) + copy(dAtA[i:], m.InactiveContractAddresses[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.InactiveContractAddresses[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(m.GenMsgs) > 0 { + for iNdEx := len(m.GenMsgs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.GenMsgs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.Sequences) > 0 { + for iNdEx := len(m.Sequences) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Sequences[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Contracts) > 0 { + for iNdEx := len(m.Contracts) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Contracts[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Codes) > 0 { + for iNdEx := len(m.Codes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Codes[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 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.Codes) > 0 { + for _, e := range m.Codes { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Contracts) > 0 { + for _, e := range m.Contracts { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Sequences) > 0 { + for _, e := range m.Sequences { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.GenMsgs) > 0 { + for _, e := range m.GenMsgs { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.InactiveContractAddresses) > 0 { + for _, s := range m.InactiveContractAddresses { + l = len(s) + 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 Codes", 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.Codes = append(m.Codes, types.Code{}) + if err := m.Codes[len(m.Codes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Contracts", 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.Contracts = append(m.Contracts, types.Contract{}) + if err := m.Contracts[len(m.Contracts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequences", 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.Sequences = append(m.Sequences, types.Sequence{}) + if err := m.Sequences[len(m.Sequences)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GenMsgs", 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.GenMsgs = append(m.GenMsgs, types.GenesisState_GenMsgs{}) + if err := m.GenMsgs[len(m.GenMsgs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InactiveContractAddresses", 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.InactiveContractAddresses = append(m.InactiveContractAddresses, string(dAtA[iNdEx:postIndex])) + 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/wasmplus/types/keys.go b/x/wasmplus/types/keys.go new file mode 100644 index 0000000000..80a38c507e --- /dev/null +++ b/x/wasmplus/types/keys.go @@ -0,0 +1,29 @@ +package types + +import ( + sdk "github.com/line/lbm-sdk/types" + + wasmtypes "github.com/line/wasmd/x/wasm/types" +) + +const ( + // ModuleName is the name of this module. + ModuleName = wasmtypes.ModuleName + + // RouterKey is used to route governance proposals + RouterKey = wasmtypes.RouterKey + + // StoreKey is the prefix under which we store this module's data + StoreKey = wasmtypes.StoreKey +) + +var ( + InactiveContractPrefix = []byte{0x90} +) + +func GetInactiveContractKey(contractAddress sdk.AccAddress) []byte { + key := make([]byte, len(InactiveContractPrefix)+len(contractAddress)) + copy(key, InactiveContractPrefix) + copy(key[len(InactiveContractPrefix):], contractAddress) + return key +} diff --git a/x/wasmplus/types/keys_test.go b/x/wasmplus/types/keys_test.go new file mode 100644 index 0000000000..3ff589fe9b --- /dev/null +++ b/x/wasmplus/types/keys_test.go @@ -0,0 +1,18 @@ +package types + +import ( + "bytes" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestGetInactiveContractKey(t *testing.T) { + addr := bytes.Repeat([]byte{4}, 20) + got := GetInactiveContractKey(addr) + exp := []byte{0x90, // prefix + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // address 20 bytes + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + } + assert.Equal(t, exp, got) +} diff --git a/x/wasm/lbmtypes/proposal.go b/x/wasmplus/types/proposal.go similarity index 94% rename from x/wasm/lbmtypes/proposal.go rename to x/wasmplus/types/proposal.go index 32e18f78cb..743a7db824 100644 --- a/x/wasm/lbmtypes/proposal.go +++ b/x/wasmplus/types/proposal.go @@ -1,4 +1,4 @@ -package lbmtypes +package types import ( "fmt" @@ -57,7 +57,9 @@ func (p ActivateContractProposal) GetDescription() string { return p.Description func (p ActivateContractProposal) ProposalRoute() string { return wasmtypes.RouterKey } -func (p ActivateContractProposal) ProposalType() string { return string(ProposalTypeActivateContract) } +func (p ActivateContractProposal) ProposalType() string { + return string(ProposalTypeActivateContract) +} func (p ActivateContractProposal) ValidateBasic() error { if _, err := sdk.AccAddressFromBech32(p.Contract); err != nil { diff --git a/x/wasm/lbmtypes/proposal.pb.go b/x/wasmplus/types/proposal.pb.go similarity index 97% rename from x/wasm/lbmtypes/proposal.pb.go rename to x/wasmplus/types/proposal.pb.go index bbeb16d93b..73d045a5b6 100644 --- a/x/wasm/lbmtypes/proposal.pb.go +++ b/x/wasmplus/types/proposal.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: lbm/wasm/v1/proposal.proto -package lbmtypes +package types import ( fmt "fmt" @@ -115,7 +115,7 @@ func init() { func init() { proto.RegisterFile("lbm/wasm/v1/proposal.proto", fileDescriptor_38b6af62537450c9) } var fileDescriptor_38b6af62537450c9 = []byte{ - // 279 bytes of a gzipped FileDescriptorProto + // 280 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xca, 0x49, 0xca, 0xd5, 0x2f, 0x4f, 0x2c, 0xce, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0x28, 0xca, 0x2f, 0xc8, 0x2f, 0x4e, 0xcc, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xce, 0x49, 0xca, 0xd5, 0x03, 0xc9, 0xe9, 0x95, @@ -127,13 +127,13 @@ var fileDescriptor_38b6af62537450c9 = []byte{ 0x93, 0x8b, 0x32, 0x0b, 0x4a, 0x32, 0xf3, 0xf3, 0x24, 0x98, 0xc0, 0xaa, 0xc5, 0x3e, 0xdd, 0x93, 0x17, 0x82, 0xa8, 0x46, 0x92, 0x54, 0x0a, 0x42, 0x56, 0x2a, 0xa4, 0xcf, 0xc5, 0x91, 0x0c, 0xb5, 0x55, 0x82, 0x19, 0xac, 0x4d, 0xf8, 0xd3, 0x3d, 0x79, 0x7e, 0x88, 0x36, 0x98, 0x8c, 0x52, 0x10, - 0x5c, 0x91, 0xd2, 0x5a, 0x46, 0x2e, 0x09, 0xc7, 0xa1, 0xe3, 0x5e, 0x27, 0xef, 0x13, 0x0f, 0xe5, + 0x5c, 0x91, 0xd2, 0x5a, 0x46, 0x2e, 0x09, 0xc7, 0xa1, 0xe3, 0x5e, 0x27, 0x9f, 0x13, 0x0f, 0xe5, 0x18, 0x6e, 0x3c, 0x94, 0x63, 0x58, 0xf1, 0x48, 0x8e, 0xf1, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, - 0x8f, 0xe5, 0x18, 0xa2, 0x54, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, - 0x73, 0x32, 0xf3, 0x52, 0xc1, 0x51, 0x9a, 0xa2, 0x5f, 0x01, 0x89, 0xda, 0x9c, 0xa4, 0xdc, 0x92, - 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, 0xac, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x1f, - 0xd4, 0x06, 0xb2, 0xf6, 0x01, 0x00, 0x00, + 0x8f, 0xe5, 0x18, 0xa2, 0xd4, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, + 0x73, 0x32, 0xf3, 0x52, 0xc1, 0x51, 0x9a, 0xa2, 0x5f, 0x01, 0xa6, 0x0b, 0x72, 0x4a, 0x8b, 0xf5, + 0x4b, 0x2a, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0xd1, 0x66, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, + 0xe7, 0x14, 0x20, 0xca, 0xf7, 0x01, 0x00, 0x00, } func (this *DeactivateContractProposal) Equal(that interface{}) bool { diff --git a/x/wasmplus/types/proposal_test.go b/x/wasmplus/types/proposal_test.go new file mode 100644 index 0000000000..e682c96d27 --- /dev/null +++ b/x/wasmplus/types/proposal_test.go @@ -0,0 +1,82 @@ +package types + +import ( + "bytes" + "testing" + + "github.com/stretchr/testify/require" + + sdk "github.com/line/lbm-sdk/types" + + wasmtypes "github.com/line/wasmd/x/wasm/types" +) + +func TestValidateDeactivateContractProposal(t *testing.T) { + var anyAddress sdk.AccAddress = bytes.Repeat([]byte{0x0}, wasmtypes.ContractAddrLen) + + specs := map[string]struct { + src DeactivateContractProposal + expErr bool + }{ + "all good": { + src: DeactivateContractProposal{ + Title: "Foo", + Description: "Bar", + Contract: anyAddress.String(), + }, + }, + "invalid address": { + src: DeactivateContractProposal{ + Title: "Foo", + Description: "Bar", + Contract: "invalid_address", + }, + expErr: true, + }, + } + for msg, spec := range specs { + t.Run(msg, func(t *testing.T) { + err := spec.src.ValidateBasic() + if spec.expErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} + +func TestValidateActivateContractProposal(t *testing.T) { + var anyAddress sdk.AccAddress = bytes.Repeat([]byte{0x0}, wasmtypes.ContractAddrLen) + + specs := map[string]struct { + src ActivateContractProposal + expErr bool + }{ + "all good": { + src: ActivateContractProposal{ + Title: "Foo", + Description: "Bar", + Contract: anyAddress.String(), + }, + }, + "invalid address": { + src: ActivateContractProposal{ + Title: "Foo", + Description: "Bar", + Contract: "invalid_address", + }, + expErr: true, + }, + } + for msg, spec := range specs { + t.Run(msg, func(t *testing.T) { + err := spec.src.ValidateBasic() + if spec.expErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + }) + } +} diff --git a/x/wasm/lbmtypes/query.pb.go b/x/wasmplus/types/query.pb.go similarity index 90% rename from x/wasm/lbmtypes/query.pb.go rename to x/wasmplus/types/query.pb.go index c4311ddf58..d2673d2dc1 100644 --- a/x/wasm/lbmtypes/query.pb.go +++ b/x/wasmplus/types/query.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: lbm/wasm/v1/query.proto -package lbmtypes +package types import ( context "context" @@ -198,35 +198,35 @@ func init() { func init() { proto.RegisterFile("lbm/wasm/v1/query.proto", fileDescriptor_f1bdb66850244231) } var fileDescriptor_f1bdb66850244231 = []byte{ - // 439 bytes of a gzipped FileDescri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0x57, 0xf0, 0xf6, 0xe1, - 0xf1, 0xd9, 0x4f, 0xec, 0x7d, 0xa9, 0xb1, 0x77, 0x56, 0x63, 0x70, 0x5e, 0x63, 0xf0, 0xa3, 0xc6, - 0xe0, 0xc3, 0x1c, 0x7b, 0xe7, 0x73, 0xec, 0x7d, 0x9f, 0x63, 0xef, 0xf9, 0x1d, 0x91, 0x9a, 0x97, - 0xb3, 0x88, 0xc4, 0x2a, 0xa7, 0x59, 0x2a, 0xb9, 0xf5, 0x4d, 0xe8, 0x6b, 0xe7, 0x9f, 0x45, 0xb9, - 0x39, 0x2d, 0xb8, 0x8e, 0x2e, 0xd9, 0x1f, 0xe0, 0xde, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x60, - 0xc8, 0xe6, 0x11, 0x88, 0x03, 0x00, 0x00, + // 440 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xbd, 0x8e, 0xd4, 0x30, + 0x10, 0xc7, 0xe3, 0x45, 0x7c, 0xac, 0xb7, 0x01, 0x0b, 0x89, 0xd5, 0x6a, 0x31, 0x4b, 0x8a, 0xfb, + 0xd8, 0x93, 0x6c, 0xe5, 0x68, 0x68, 0x01, 0x89, 0x8f, 0x0e, 0x52, 0xd2, 0x20, 0x27, 0xb1, 0x4c, + 0xa4, 0xc4, 0xce, 0xc5, 0x4e, 0xe0, 0x84, 0x68, 0x68, 0x68, 0x91, 0x10, 0x1d, 0x0f, 0xc0, 0x53, + 0x50, 0x5f, 0x79, 0x12, 0x0d, 0x25, 0x64, 0x79, 0x10, 0x14, 0x3b, 0x7b, 0x97, 0x05, 0x96, 0xdd, + 0x2a, 0xc9, 0xcc, 0x7f, 0xe6, 0xff, 0x1b, 0x4f, 0x0c, 0x6f, 0x64, 0x51, 0x4e, 0x5f, 0x31, 0x9d, + 0xd3, 0x3a, 0xa0, 0x47, 0x15, 0x2f, 0x8f, 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, 0x62, + 0xcb, 0xaf, 0x84, 0xfd, 0xd0, 0xe1, 0xd7, 0x01, 0xbc, 0x68, 0x7b, 0xa0, 0x4f, 0x00, 0x5e, 0xfb, + 0xeb, 0x2c, 0xd0, 0x9c, 0xf4, 0xb6, 0x4f, 0xfe, 0xbb, 0x9a, 0xc9, 0xc1, 0x56, 0x5a, 0x87, 0xe6, + 0xef, 0xbe, 0xfb, 0xf6, 0xeb, 0xe3, 0xe0, 0x36, 0xba, 0x45, 0xfb, 0xff, 0x5d, 0x87, 0xc6, 0x5f, + 0xc4, 0x67, 0x04, 0x9f, 0x01, 0xbc, 0xfa, 0x67, 0x1b, 0xb4, 0xbf, 0xd9, 0x6a, 0x49, 0x35, 0xdf, + 0x46, 0xda, 0x41, 0x05, 0x16, 0xea, 0x00, 0xed, 0x6f, 0x80, 0xa2, 0x6f, 0xba, 0x15, 0xbc, 0xbd, + 0xff, 0xf8, 0xe4, 0x27, 0xf6, 0xbe, 0x34, 0xd8, 0x3b, 0x69, 0x30, 0x38, 0x6d, 0x30, 0xf8, 0xd1, + 0x60, 0xf0, 0x61, 0x81, 0xbd, 0xd3, 0x05, 0xf6, 0xbe, 0x2f, 0xb0, 0xf7, 0x7c, 0x47, 0xa4, 0xe6, + 0x65, 0x15, 0x91, 0x58, 0xe5, 0x34, 0x4b, 0x25, 0xb7, 0x7d, 0x13, 0xfa, 0xda, 0x3e, 0x8b, 0xac, + 0xd2, 0xd4, 0x1c, 0x17, 0x5c, 0x47, 0x97, 0xec, 0x0d, 0xb8, 0xf3, 0x3b, 0x00, 0x00, 0xff, 0xff, + 0xd3, 0xd6, 0x64, 0x3a, 0x89, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -243,6 +243,7 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // InactiveContracts queries all inactive contracts InactiveContracts(ctx context.Context, in *QueryInactiveContractsRequest, opts ...grpc.CallOption) (*QueryInactiveContractsResponse, error) + // InactiveContract check it the contract is inactive state or not InactiveContract(ctx context.Context, in *QueryInactiveContractRequest, opts ...grpc.CallOption) (*QueryInactiveContractResponse, error) } @@ -276,6 +277,7 @@ func (c *queryClient) InactiveContract(ctx context.Context, in *QueryInactiveCon type QueryServer interface { // InactiveContracts queries all inactive contracts InactiveContracts(context.Context, *QueryInactiveContractsRequest) (*QueryInactiveContractsResponse, error) + // InactiveContract check it the contract is inactive state or not InactiveContract(context.Context, *QueryInactiveContractRequest) (*QueryInactiveContractResponse, error) } diff --git a/x/wasm/lbmtypes/query.pb.gw.go b/x/wasmplus/types/query.pb.gw.go similarity index 99% rename from x/wasm/lbmtypes/query.pb.gw.go rename to x/wasmplus/types/query.pb.gw.go index e3c64cb7f2..220edddb05 100644 --- a/x/wasm/lbmtypes/query.pb.gw.go +++ b/x/wasmplus/types/query.pb.gw.go @@ -2,11 +2,11 @@ // source: lbm/wasm/v1/query.proto /* -Package lbmtypes is a reverse proxy. +Package types is a reverse proxy. It translates gRPC into RESTful JSON APIs. */ -package lbmtypes +package types import ( "context" diff --git a/x/wasm/types/store.go b/x/wasmplus/types/store.go similarity index 100% rename from x/wasm/types/store.go rename to x/wasmplus/types/store.go diff --git a/x/wasm/lbmtypes/tx.go b/x/wasmplus/types/tx.go similarity index 89% rename from x/wasm/lbmtypes/tx.go rename to x/wasmplus/types/tx.go index fa9089de80..7d425b342b 100644 --- a/x/wasm/lbmtypes/tx.go +++ b/x/wasmplus/types/tx.go @@ -1,14 +1,12 @@ -package lbmtypes +package types import ( sdk "github.com/line/lbm-sdk/types" sdkerrors "github.com/line/lbm-sdk/types/errors" - - wasmtypes "github.com/line/wasmd/x/wasm/types" ) func (msg MsgStoreCodeAndInstantiateContract) Route() string { - return wasmtypes.RouterKey + return RouterKey } func (msg MsgStoreCodeAndInstantiateContract) Type() string { @@ -51,7 +49,7 @@ func (msg MsgStoreCodeAndInstantiateContract) ValidateBasic() error { } func (msg MsgStoreCodeAndInstantiateContract) GetSignBytes() []byte { - return sdk.MustSortJSON(wasmtypes.ModuleCdc.MustMarshalJSON(&msg)) + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) } func (msg MsgStoreCodeAndInstantiateContract) GetSigners() []sdk.AccAddress { diff --git a/x/wasm/lbmtypes/tx.pb.go b/x/wasmplus/types/tx.pb.go similarity index 88% rename from x/wasm/lbmtypes/tx.pb.go rename to x/wasmplus/types/tx.pb.go index f4e4a54ab0..1741b63126 100644 --- a/x/wasm/lbmtypes/tx.pb.go +++ b/x/wasmplus/types/tx.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: lbm/wasm/v1/tx.proto -package lbmtypes +package types import ( context "context" @@ -137,41 +137,41 @@ func init() { func init() { proto.RegisterFile("lbm/wasm/v1/tx.proto", fileDescriptor_751e1d2b9f9bf9e8) } var fileDescriptor_751e1d2b9f9bf9e8 = []byte{ - // 540 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x4f, 0x8b, 0xd3, 0x4e, - 0x18, 0x6e, 0x7e, 0x49, 0xff, 0x4d, 0xcb, 0x8f, 0x32, 0xd4, 0x25, 0x16, 0x49, 0x4a, 0x17, 0xa1, - 0x28, 0x4e, 0x68, 0x45, 0xc5, 0x63, 0x5b, 0x2f, 0x5d, 0x29, 0x48, 0x16, 0x11, 0x44, 0x28, 0x93, - 0xcc, 0x6c, 0x0c, 0x26, 0x33, 0x25, 0x33, 0xdb, 0xdd, 0x9e, 0xfc, 0x00, 0x5e, 0x04, 0xbf, 0x85, - 0x07, 0x3f, 0x47, 0x8f, 0x7b, 0xf4, 0x54, 0xb5, 0xfd, 0x16, 0x9e, 0x64, 0x26, 0xcd, 0xba, 0x78, - 0xb0, 0x78, 0x9b, 0xe7, 0xfd, 0xf3, 0xbc, 0xef, 0x3c, 0xcf, 0x0c, 0x68, 0x27, 0x41, 0xea, 0x5d, - 0x60, 0x91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0c, 0x60, 0xce, - 0x44, 0x04, 0x3f, 0x18, 0xc0, 0x3d, 0xf4, 0x6c, 0x3c, 0x74, 0xe3, 0xfd, 0xa2, 0xc3, 0x7b, 0x77, - 0x9e, 0xfc, 0x63, 0x43, 0x71, 0xd1, 0xf1, 0x64, 0xfd, 0xc3, 0x29, 0xad, 0xb7, 0x8e, 0x71, 0xb5, - 0x75, 0x8c, 0xef, 0x5b, 0xc7, 0xf8, 0xb8, 0x73, 0x4a, 0x57, 0x3b, 0xa7, 0xf4, 0x75, 0xe7, 0x94, - 0x5e, 0xdf, 0xfd, 0xab, 0xb5, 0x49, 0x90, 0x6a, 0xd1, 0x83, 0x8a, 0xfe, 0x13, 0x0f, 0x7f, 0x05, - 0x00, 0x00, 0xff, 0xff, 0xca, 0xf8, 0xad, 0x18, 0x8c, 0x03, 0x00, 0x00, + // 541 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x4d, 0x8b, 0xd3, 0x40, + 0x18, 0x6e, 0x4c, 0xda, 0xdd, 0x9d, 0x5d, 0x64, 0x19, 0xea, 0x12, 0x8b, 0x24, 0xa5, 0x0b, 0x52, + 0x14, 0x27, 0xb4, 0xa2, 0xe2, 0xb1, 0xed, 0x5e, 0xba, 0x52, 0x90, 0x2c, 0x22, 0x88, 0x50, 0x26, + 0x99, 0xd9, 0x18, 0x4c, 0x66, 0x4a, 0xde, 0x69, 0x77, 0x7b, 0xf2, 0x07, 0x78, 0x11, 0xfc, 0x17, + 0x1e, 0xfc, 0x1d, 0x3d, 0xee, 0xd1, 0x53, 0xd5, 0xf6, 0x5f, 0x78, 0x92, 0x49, 0x9a, 0x75, 0xf1, + 0x60, 0xf1, 0x36, 0xcf, 0xfb, 0xf1, 0xbc, 0xef, 0x3c, 0xcf, 0x0c, 0xaa, 0x27, 0x41, 0xea, 0x5d, + 0x50, 0x48, 0xbd, 0x59, 0xc7, 0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x3f, 0x1a, 0xc8, 0xdd, 0xf6, 0x6c, 0x3c, 0x72, 0xe3, 0xfd, 0x92, 0xed, 0x7b, 0x37, + 0x9e, 0xfd, 0x67, 0x43, 0x79, 0xd1, 0xfe, 0xc9, 0xe2, 0xa7, 0x53, 0x59, 0xac, 0x1c, 0xe3, 0x6a, + 0xe5, 0x18, 0x3f, 0x56, 0x8e, 0xf1, 0x69, 0xed, 0x54, 0xae, 0xd6, 0x4e, 0xe5, 0xdb, 0xda, 0xa9, + 0xbc, 0xb9, 0xff, 0x2f, 0x6b, 0x27, 0xc9, 0x14, 0x0a, 0xd5, 0x83, 0x5a, 0xfe, 0x29, 0x1e, 0xff, + 0x0e, 0x00, 0x00, 0xff, 0xff, 0x92, 0x19, 0xa9, 0x26, 0x8d, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/wasm/lbmtypes/tx_test.go b/x/wasmplus/types/tx_test.go similarity index 73% rename from x/wasm/lbmtypes/tx_test.go rename to x/wasmplus/types/tx_test.go index 2f91297b3e..c7f1c134a1 100644 --- a/x/wasm/lbmtypes/tx_test.go +++ b/x/wasmplus/types/tx_test.go @@ -1,4 +1,4 @@ -package lbmtypes +package types import ( "encoding/hex" @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/require" sdk "github.com/line/lbm-sdk/types" + "github.com/line/lbm-sdk/x/auth/legacy/legacytx" wasmTypes "github.com/line/wasmd/x/wasm/types" ) @@ -135,3 +136,37 @@ func TestNewMsgStoreCodeAndInstantiateContractGetSigners(t *testing.T) { bytes := sdk.MustAccAddressFromBech32(res[0].String()) require.Equal(t, "696e707574313131313131313131313131313131", fmt.Sprintf("%v", hex.EncodeToString(bytes))) } + +func TestMsgJsonSignBytes(t *testing.T) { + const myInnerMsg = `{"foo":"bar"}` + specs := map[string]struct { + src legacytx.LegacyMsg + exp string + }{ + "MsgInstantiateContract with every field": { + src: &MsgStoreCodeAndInstantiateContract{Sender: "sender1", WASMByteCode: []byte{89, 69, 76, 76, 79, 87, 32, 83, 85, 66, 77, 65, 82, 73, 78, 69}, + InstantiatePermission: &wasmTypes.AccessConfig{Permission: wasmTypes.AccessTypeAnyOfAddresses, Addresses: []string{"address1", "address2"}}, + Admin: "admin1", Label: "My", Msg: wasmTypes.RawContractMessage(myInnerMsg), Funds: sdk.Coins{{Denom: "denom1", Amount: sdk.NewInt(1)}}}, + exp: ` +{ + "type":"wasm/MsgStoreCodeAndInstantiateContract", + "value": {"admin":"admin1","funds":[{"amount":"1","denom":"denom1"}],"instantiate_permission":{"addresses":["address1","address2"], + "permission":"AnyOfAddresses"},"label":"My","msg":{"foo":"bar"},"sender":"sender1","wasm_byte_code":"WUVMTE9XIFNVQk1BUklORQ=="} +}`, + }, + "MsgInstantiateContract with minimum field": { + src: &MsgStoreCodeAndInstantiateContract{}, + exp: ` +{ + "type":"wasm/MsgStoreCodeAndInstantiateContract", + "value": {"funds":[]} +}`, + }, + } + for name, spec := range specs { + t.Run(name, func(t *testing.T) { + bz := spec.src.GetSignBytes() + assert.JSONEq(t, spec.exp, string(bz), "raw: %s", string(bz)) + }) + } +} diff --git a/x/wasm/lbmtypes/validation.go b/x/wasmplus/types/validation.go similarity index 97% rename from x/wasm/lbmtypes/validation.go rename to x/wasmplus/types/validation.go index 0d3465209c..1d526ab4a3 100644 --- a/x/wasm/lbmtypes/validation.go +++ b/x/wasmplus/types/validation.go @@ -1,4 +1,4 @@ -package lbmtypes +package types import ( sdkerrors "github.com/line/lbm-sdk/types/errors"