From aecacd3b3d4a3268ef6265544c7ff1f139160b5e Mon Sep 17 00:00:00 2001 From: Carolyn Russell Date: Mon, 14 Feb 2022 13:54:20 -0700 Subject: [PATCH] Upgrade to 1.8.0 prov release * Brought in the new proto jar, which replaces the in-service proto building * Dependency cleanup * Added attributes, UUID to NFT API * Fully supporting msg based fee breakdown * Updated Params API to include MsgFee params * Updates to event scraping, tied to increased Smart Contract usage closes: #299 --- CHANGELOG.md | 17 + build.gradle.kts | 41 +- buildSrc/build.gradle.kts | 15 - buildSrc/src/main/kotlin/Dependencies.kt | 43 +- buildSrc/src/main/kotlin/Platform.kt | 15 + .../io/provenance/DownloadProtosPlugin.kt | 28 - .../io/provenance/DownloadProtosTask.kt | 315 ------ database/build.gradle.kts | 6 +- .../db/migration/V1_49__1.8.0_updates.sql | 300 ++++++ proto/README.md | 55 -- proto/build.gradle.kts | 77 -- scripts/copy_proto_v2.sh | 30 - service/build.gradle.kts | 80 +- .../io/provenance/explorer/Application.kt | 1 + .../provenance/explorer/config/RestConfig.kt | 10 +- .../explorer/domain/entities/Accounts.kt | 3 +- .../explorer/domain/entities/Transactions.kt | 135 ++- .../domain/models/explorer/NftModels.kt | 5 +- .../domain/models/explorer/ParamModels.kt | 1 + .../models/explorer/TransactionModels.kt | 4 +- .../explorer/grpc/extensions/MsgConverter.kt | 188 +++- .../explorer/grpc/v1/MsgFeeGrpcClient.kt | 48 + .../explorer/service/ExplorerService.kt | 4 + .../provenance/explorer/service/NftService.kt | 11 +- .../explorer/service/async/AsyncCachingV2.kt | 60 +- .../service/utility/MigrationService.kt | 16 + .../web/v2/utility/MigrationController.kt | 5 + settings.gradle.kts | 1 - third_party/proto/confio/proofs.proto | 234 ----- .../proto/cosmos/auth/v1beta1/auth.proto | 50 - .../proto/cosmos/auth/v1beta1/genesis.proto | 17 - .../proto/cosmos/auth/v1beta1/query.proto | 68 -- .../proto/cosmos/authz/v1beta1/authz.proto | 26 - .../proto/cosmos/authz/v1beta1/event.proto | 24 - .../proto/cosmos/authz/v1beta1/genesis.proto | 23 - .../proto/cosmos/authz/v1beta1/query.proto | 34 - .../proto/cosmos/authz/v1beta1/tx.proto | 69 -- .../proto/cosmos/bank/v1beta1/authz.proto | 17 - .../proto/cosmos/bank/v1beta1/bank.proto | 92 -- .../proto/cosmos/bank/v1beta1/genesis.proto | 39 - .../proto/cosmos/bank/v1beta1/query.proto | 159 --- .../proto/cosmos/bank/v1beta1/tx.proto | 42 - .../proto/cosmos/base/abci/v1beta1/abci.proto | 137 --- .../proto/cosmos/base/kv/v1beta1/kv.proto | 17 - .../base/query/v1beta1/pagination.proto | 53 - .../base/reflection/v1beta1/reflection.proto | 44 - .../base/reflection/v2alpha1/reflection.proto | 217 ----- .../base/snapshots/v1beta1/snapshot.proto | 20 - .../base/store/v1beta1/commit_info.proto | 29 - .../cosmos/base/store/v1beta1/listening.proto | 14 - .../cosmos/base/store/v1beta1/snapshot.proto | 28 - .../base/tendermint/v1beta1/query.proto | 137 --- .../proto/cosmos/base/v1beta1/coin.proto | 40 - .../capability/v1beta1/capability.proto | 30 - .../cosmos/capability/v1beta1/genesis.proto | 26 - .../proto/cosmos/crisis/v1beta1/genesis.proto | 15 - .../proto/cosmos/crisis/v1beta1/tx.proto | 25 - .../proto/cosmos/crypto/ed25519/keys.proto | 23 - .../proto/cosmos/crypto/multisig/keys.proto | 18 - .../crypto/multisig/v1beta1/multisig.proto | 25 - .../proto/cosmos/crypto/secp256k1/keys.proto | 22 - .../proto/cosmos/crypto/secp256r1/keys.proto | 22 - .../distribution/v1beta1/distribution.proto | 157 --- .../cosmos/distribution/v1beta1/genesis.proto | 155 --- .../cosmos/distribution/v1beta1/query.proto | 218 ----- .../cosmos/distribution/v1beta1/tx.proto | 79 -- .../cosmos/evidence/v1beta1/evidence.proto | 21 - .../cosmos/evidence/v1beta1/genesis.proto | 12 - .../proto/cosmos/evidence/v1beta1/query.proto | 51 - .../proto/cosmos/evidence/v1beta1/tx.proto | 32 - .../cosmos/feegrant/v1beta1/feegrant.proto | 77 -- .../cosmos/feegrant/v1beta1/genesis.proto | 12 - .../proto/cosmos/feegrant/v1beta1/query.proto | 54 -- .../proto/cosmos/feegrant/v1beta1/tx.proto | 48 - .../cosmos/genutil/v1beta1/genesis.proto | 16 - .../proto/cosmos/gov/v1beta1/genesis.proto | 26 - .../proto/cosmos/gov/v1beta1/gov.proto | 197 ---- .../proto/cosmos/gov/v1beta1/query.proto | 190 ---- third_party/proto/cosmos/gov/v1beta1/tx.proto | 93 -- .../proto/cosmos/mint/v1beta1/genesis.proto | 16 - .../proto/cosmos/mint/v1beta1/mint.proto | 53 - .../proto/cosmos/mint/v1beta1/query.proto | 57 -- .../proto/cosmos/params/v1beta1/params.proto | 27 - .../proto/cosmos/params/v1beta1/query.proto | 32 - .../cosmos/slashing/v1beta1/genesis.proto | 50 - .../proto/cosmos/slashing/v1beta1/query.proto | 63 -- .../cosmos/slashing/v1beta1/slashing.proto | 58 -- .../proto/cosmos/slashing/v1beta1/tx.proto | 26 - .../proto/cosmos/staking/v1beta1/authz.proto | 43 - .../cosmos/staking/v1beta1/genesis.proto | 53 - .../proto/cosmos/staking/v1beta1/query.proto | 348 ------- .../cosmos/staking/v1beta1/staking.proto | 334 ------- .../proto/cosmos/staking/v1beta1/tx.proto | 126 --- .../cosmos/tx/signing/v1beta1/signing.proto | 79 -- .../proto/cosmos/tx/v1beta1/service.proto | 132 --- third_party/proto/cosmos/tx/v1beta1/tx.proto | 183 ---- .../proto/cosmos/upgrade/v1beta1/query.proto | 97 -- .../cosmos/upgrade/v1beta1/upgrade.proto | 76 -- .../proto/cosmos/vesting/v1beta1/tx.proto | 31 - .../cosmos/vesting/v1beta1/vesting.proto | 83 -- third_party/proto/cosmos_proto/cosmos.proto | 16 - .../proto/cosmwasm/wasm/v1/genesis.proto | 60 -- third_party/proto/cosmwasm/wasm/v1/ibc.proto | 30 - .../proto/cosmwasm/wasm/v1/proposal.proto | 118 --- .../proto/cosmwasm/wasm/v1/query.proto | 202 ---- third_party/proto/cosmwasm/wasm/v1/tx.proto | 135 --- .../proto/cosmwasm/wasm/v1/types.proto | 140 --- .../proto/cosmwasm/wasm/v1beta1/genesis.proto | 60 -- .../proto/cosmwasm/wasm/v1beta1/ibc.proto | 30 - .../cosmwasm/wasm/v1beta1/proposal.proto | 121 --- .../proto/cosmwasm/wasm/v1beta1/query.proto | 201 ---- .../proto/cosmwasm/wasm/v1beta1/tx.proto | 138 --- .../proto/cosmwasm/wasm/v1beta1/types.proto | 143 --- third_party/proto/gogoproto/gogo.proto | 145 --- .../proto/google/api/annotations.proto | 31 - third_party/proto/google/api/http.proto | 318 ------ third_party/proto/google/api/httpbody.proto | 78 -- third_party/proto/google/protobuf/any.proto | 164 ---- .../proto/google/protobuf/descriptor.proto | 909 ------------------ .../applications/transfer/v1/genesis.proto | 19 - .../ibc/applications/transfer/v1/query.proto | 67 -- .../applications/transfer/v1/transfer.proto | 44 - .../ibc/applications/transfer/v1/tx.proto | 44 - .../proto/ibc/core/channel/v1/channel.proto | 148 --- .../proto/ibc/core/channel/v1/genesis.proto | 32 - .../proto/ibc/core/channel/v1/query.proto | 374 ------- .../proto/ibc/core/channel/v1/tx.proto | 211 ---- .../proto/ibc/core/client/v1/client.proto | 100 -- .../proto/ibc/core/client/v1/genesis.proto | 48 - .../proto/ibc/core/client/v1/query.proto | 184 ---- third_party/proto/ibc/core/client/v1/tx.proto | 100 -- .../ibc/core/commitment/v1/commitment.proto | 41 - .../ibc/core/connection/v1/connection.proto | 114 --- .../ibc/core/connection/v1/genesis.proto | 18 - .../proto/ibc/core/connection/v1/query.proto | 138 --- .../proto/ibc/core/connection/v1/tx.proto | 119 --- .../proto/ibc/core/types/v1/genesis.proto | 23 - .../lightclients/localhost/v1/localhost.proto | 18 - .../solomachine/v1/solomachine.proto | 189 ---- .../solomachine/v2/solomachine.proto | 189 ---- .../tendermint/v1/tendermint.proto | 115 --- .../provenance/attribute/v1/attribute.proto | 87 -- .../provenance/attribute/v1/genesis.proto | 21 - .../proto/provenance/attribute/v1/query.proto | 115 --- .../proto/provenance/attribute/v1/tx.proto | 115 --- .../provenance/marker/v1/accessgrant.proto | 46 - .../proto/provenance/marker/v1/authz.proto | 19 - .../proto/provenance/marker/v1/genesis.proto | 22 - .../proto/provenance/marker/v1/marker.proto | 190 ---- .../provenance/marker/v1/proposals.proto | 114 --- .../proto/provenance/marker/v1/query.proto | 160 --- .../proto/provenance/marker/v1/si.proto | 58 -- .../proto/provenance/marker/v1/tx.proto | 159 --- .../proto/provenance/metadata/v1/events.proto | 177 ---- .../provenance/metadata/v1/genesis.proto | 34 - .../provenance/metadata/v1/metadata.proto | 131 --- .../provenance/metadata/v1/objectstore.proto | 27 - .../provenance/metadata/v1/p8e/p8e.proto | 217 ----- .../proto/provenance/metadata/v1/query.proto | 702 -------------- .../proto/provenance/metadata/v1/scope.proto | 252 ----- .../metadata/v1/specification.proto | 175 ---- .../proto/provenance/metadata/v1/tx.proto | 623 ------------ .../proto/provenance/name/v1/genesis.proto | 21 - .../proto/provenance/name/v1/name.proto | 60 -- .../proto/provenance/name/v1/query.proto | 77 -- third_party/proto/provenance/name/v1/tx.proto | 48 - third_party/proto/tendermint/abci/types.proto | 407 -------- .../proto/tendermint/crypto/keys.proto | 17 - .../proto/tendermint/crypto/proof.proto | 41 - .../proto/tendermint/libs/bits/types.proto | 9 - third_party/proto/tendermint/p2p/types.proto | 34 - .../proto/tendermint/types/block.proto | 15 - .../proto/tendermint/types/evidence.proto | 38 - .../proto/tendermint/types/params.proto | 80 -- .../proto/tendermint/types/types.proto | 157 --- .../proto/tendermint/types/validator.proto | 25 - .../proto/tendermint/version/types.proto | 24 - 177 files changed, 815 insertions(+), 15811 deletions(-) create mode 100644 buildSrc/src/main/kotlin/Platform.kt delete mode 100644 buildSrc/src/main/kotlin/io/provenance/DownloadProtosPlugin.kt delete mode 100644 buildSrc/src/main/kotlin/io/provenance/DownloadProtosTask.kt create mode 100644 database/src/main/resources/db/migration/V1_49__1.8.0_updates.sql delete mode 100644 proto/README.md delete mode 100644 proto/build.gradle.kts delete mode 100755 scripts/copy_proto_v2.sh create mode 100644 service/src/main/kotlin/io/provenance/explorer/grpc/v1/MsgFeeGrpcClient.kt delete mode 100644 third_party/proto/confio/proofs.proto delete mode 100644 third_party/proto/cosmos/auth/v1beta1/auth.proto delete mode 100644 third_party/proto/cosmos/auth/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/auth/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/authz/v1beta1/authz.proto delete mode 100644 third_party/proto/cosmos/authz/v1beta1/event.proto delete mode 100644 third_party/proto/cosmos/authz/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/authz/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/authz/v1beta1/tx.proto delete mode 100644 third_party/proto/cosmos/bank/v1beta1/authz.proto delete mode 100644 third_party/proto/cosmos/bank/v1beta1/bank.proto delete mode 100644 third_party/proto/cosmos/bank/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/bank/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/bank/v1beta1/tx.proto delete mode 100644 third_party/proto/cosmos/base/abci/v1beta1/abci.proto delete mode 100644 third_party/proto/cosmos/base/kv/v1beta1/kv.proto delete mode 100644 third_party/proto/cosmos/base/query/v1beta1/pagination.proto delete mode 100644 third_party/proto/cosmos/base/reflection/v1beta1/reflection.proto delete mode 100644 third_party/proto/cosmos/base/reflection/v2alpha1/reflection.proto delete mode 100644 third_party/proto/cosmos/base/snapshots/v1beta1/snapshot.proto delete mode 100644 third_party/proto/cosmos/base/store/v1beta1/commit_info.proto delete mode 100644 third_party/proto/cosmos/base/store/v1beta1/listening.proto delete mode 100644 third_party/proto/cosmos/base/store/v1beta1/snapshot.proto delete mode 100644 third_party/proto/cosmos/base/tendermint/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/base/v1beta1/coin.proto delete mode 100644 third_party/proto/cosmos/capability/v1beta1/capability.proto delete mode 100644 third_party/proto/cosmos/capability/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/crisis/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/crisis/v1beta1/tx.proto delete mode 100644 third_party/proto/cosmos/crypto/ed25519/keys.proto delete mode 100644 third_party/proto/cosmos/crypto/multisig/keys.proto delete mode 100644 third_party/proto/cosmos/crypto/multisig/v1beta1/multisig.proto delete mode 100644 third_party/proto/cosmos/crypto/secp256k1/keys.proto delete mode 100644 third_party/proto/cosmos/crypto/secp256r1/keys.proto delete mode 100644 third_party/proto/cosmos/distribution/v1beta1/distribution.proto delete mode 100644 third_party/proto/cosmos/distribution/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/distribution/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/distribution/v1beta1/tx.proto delete mode 100644 third_party/proto/cosmos/evidence/v1beta1/evidence.proto delete mode 100644 third_party/proto/cosmos/evidence/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/evidence/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/evidence/v1beta1/tx.proto delete mode 100644 third_party/proto/cosmos/feegrant/v1beta1/feegrant.proto delete mode 100644 third_party/proto/cosmos/feegrant/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/feegrant/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/feegrant/v1beta1/tx.proto delete mode 100644 third_party/proto/cosmos/genutil/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/gov/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/gov/v1beta1/gov.proto delete mode 100644 third_party/proto/cosmos/gov/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/gov/v1beta1/tx.proto delete mode 100644 third_party/proto/cosmos/mint/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/mint/v1beta1/mint.proto delete mode 100644 third_party/proto/cosmos/mint/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/params/v1beta1/params.proto delete mode 100644 third_party/proto/cosmos/params/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/slashing/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/slashing/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/slashing/v1beta1/slashing.proto delete mode 100644 third_party/proto/cosmos/slashing/v1beta1/tx.proto delete mode 100644 third_party/proto/cosmos/staking/v1beta1/authz.proto delete mode 100644 third_party/proto/cosmos/staking/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmos/staking/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/staking/v1beta1/staking.proto delete mode 100644 third_party/proto/cosmos/staking/v1beta1/tx.proto delete mode 100644 third_party/proto/cosmos/tx/signing/v1beta1/signing.proto delete mode 100644 third_party/proto/cosmos/tx/v1beta1/service.proto delete mode 100644 third_party/proto/cosmos/tx/v1beta1/tx.proto delete mode 100644 third_party/proto/cosmos/upgrade/v1beta1/query.proto delete mode 100644 third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto delete mode 100644 third_party/proto/cosmos/vesting/v1beta1/tx.proto delete mode 100644 third_party/proto/cosmos/vesting/v1beta1/vesting.proto delete mode 100644 third_party/proto/cosmos_proto/cosmos.proto delete mode 100644 third_party/proto/cosmwasm/wasm/v1/genesis.proto delete mode 100644 third_party/proto/cosmwasm/wasm/v1/ibc.proto delete mode 100644 third_party/proto/cosmwasm/wasm/v1/proposal.proto delete mode 100644 third_party/proto/cosmwasm/wasm/v1/query.proto delete mode 100644 third_party/proto/cosmwasm/wasm/v1/tx.proto delete mode 100644 third_party/proto/cosmwasm/wasm/v1/types.proto delete mode 100644 third_party/proto/cosmwasm/wasm/v1beta1/genesis.proto delete mode 100644 third_party/proto/cosmwasm/wasm/v1beta1/ibc.proto delete mode 100644 third_party/proto/cosmwasm/wasm/v1beta1/proposal.proto delete mode 100644 third_party/proto/cosmwasm/wasm/v1beta1/query.proto delete mode 100644 third_party/proto/cosmwasm/wasm/v1beta1/tx.proto delete mode 100644 third_party/proto/cosmwasm/wasm/v1beta1/types.proto delete mode 100644 third_party/proto/gogoproto/gogo.proto delete mode 100644 third_party/proto/google/api/annotations.proto delete mode 100644 third_party/proto/google/api/http.proto delete mode 100644 third_party/proto/google/api/httpbody.proto delete mode 100644 third_party/proto/google/protobuf/any.proto delete mode 100644 third_party/proto/google/protobuf/descriptor.proto delete mode 100644 third_party/proto/ibc/applications/transfer/v1/genesis.proto delete mode 100644 third_party/proto/ibc/applications/transfer/v1/query.proto delete mode 100644 third_party/proto/ibc/applications/transfer/v1/transfer.proto delete mode 100644 third_party/proto/ibc/applications/transfer/v1/tx.proto delete mode 100644 third_party/proto/ibc/core/channel/v1/channel.proto delete mode 100644 third_party/proto/ibc/core/channel/v1/genesis.proto delete mode 100644 third_party/proto/ibc/core/channel/v1/query.proto delete mode 100644 third_party/proto/ibc/core/channel/v1/tx.proto delete mode 100644 third_party/proto/ibc/core/client/v1/client.proto delete mode 100644 third_party/proto/ibc/core/client/v1/genesis.proto delete mode 100644 third_party/proto/ibc/core/client/v1/query.proto delete mode 100644 third_party/proto/ibc/core/client/v1/tx.proto delete mode 100644 third_party/proto/ibc/core/commitment/v1/commitment.proto delete mode 100644 third_party/proto/ibc/core/connection/v1/connection.proto delete mode 100644 third_party/proto/ibc/core/connection/v1/genesis.proto delete mode 100644 third_party/proto/ibc/core/connection/v1/query.proto delete mode 100644 third_party/proto/ibc/core/connection/v1/tx.proto delete mode 100644 third_party/proto/ibc/core/types/v1/genesis.proto delete mode 100644 third_party/proto/ibc/lightclients/localhost/v1/localhost.proto delete mode 100644 third_party/proto/ibc/lightclients/solomachine/v1/solomachine.proto delete mode 100644 third_party/proto/ibc/lightclients/solomachine/v2/solomachine.proto delete mode 100644 third_party/proto/ibc/lightclients/tendermint/v1/tendermint.proto delete mode 100644 third_party/proto/provenance/attribute/v1/attribute.proto delete mode 100644 third_party/proto/provenance/attribute/v1/genesis.proto delete mode 100644 third_party/proto/provenance/attribute/v1/query.proto delete mode 100644 third_party/proto/provenance/attribute/v1/tx.proto delete mode 100644 third_party/proto/provenance/marker/v1/accessgrant.proto delete mode 100644 third_party/proto/provenance/marker/v1/authz.proto delete mode 100644 third_party/proto/provenance/marker/v1/genesis.proto delete mode 100644 third_party/proto/provenance/marker/v1/marker.proto delete mode 100644 third_party/proto/provenance/marker/v1/proposals.proto delete mode 100644 third_party/proto/provenance/marker/v1/query.proto delete mode 100644 third_party/proto/provenance/marker/v1/si.proto delete mode 100644 third_party/proto/provenance/marker/v1/tx.proto delete mode 100644 third_party/proto/provenance/metadata/v1/events.proto delete mode 100644 third_party/proto/provenance/metadata/v1/genesis.proto delete mode 100644 third_party/proto/provenance/metadata/v1/metadata.proto delete mode 100644 third_party/proto/provenance/metadata/v1/objectstore.proto delete mode 100644 third_party/proto/provenance/metadata/v1/p8e/p8e.proto delete mode 100644 third_party/proto/provenance/metadata/v1/query.proto delete mode 100644 third_party/proto/provenance/metadata/v1/scope.proto delete mode 100644 third_party/proto/provenance/metadata/v1/specification.proto delete mode 100644 third_party/proto/provenance/metadata/v1/tx.proto delete mode 100644 third_party/proto/provenance/name/v1/genesis.proto delete mode 100644 third_party/proto/provenance/name/v1/name.proto delete mode 100644 third_party/proto/provenance/name/v1/query.proto delete mode 100644 third_party/proto/provenance/name/v1/tx.proto delete mode 100644 third_party/proto/tendermint/abci/types.proto delete mode 100644 third_party/proto/tendermint/crypto/keys.proto delete mode 100644 third_party/proto/tendermint/crypto/proof.proto delete mode 100644 third_party/proto/tendermint/libs/bits/types.proto delete mode 100644 third_party/proto/tendermint/p2p/types.proto delete mode 100644 third_party/proto/tendermint/types/block.proto delete mode 100644 third_party/proto/tendermint/types/evidence.proto delete mode 100644 third_party/proto/tendermint/types/params.proto delete mode 100644 third_party/proto/tendermint/types/types.proto delete mode 100644 third_party/proto/tendermint/types/validator.proto delete mode 100644 third_party/proto/tendermint/version/types.proto diff --git a/CHANGELOG.md b/CHANGELOG.md index f0f38754..b6bca48a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,23 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## Unreleased +### Features +* Added attributes, UUID to NFT API #299 +* Fully supporting msg based fee breakdown #299 +* Updated Params API to include MsgFee params #299 + +### Improvements +* Now using provenance-io produced proto jar #199 +* Dependency cleanup +* Updates to event scraping #299 + * tied to increased Smart Contract usage + +### Data +* Migration 1.49 - 1.8.0 updates #299 + * Added `msg_type` to `tx_fee` table + * Updated `add_tx()` procedure + * Updated `tx_fee_unique_idx` + ## [v3.3.2](https://github.com/provenance-io/explorer-service/releases/tag/v3.3.2) - 2022-02-16 ### Release Name: Friar Julian diff --git a/build.gradle.kts b/build.gradle.kts index d2d58c9e..c4f5ac98 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,10 +5,7 @@ plugins { java id(PluginIds.Idea) id(PluginIds.TaskTree) version PluginVersions.TaskTree - id(PluginIds.TestLogger) version PluginVersions.TestLogger apply false id(PluginIds.DependencyAnalysis) version PluginVersions.DependencyAnalysis - id(PluginIds.Protobuf) version PluginVersions.Protobuf - id(PluginIds.ProvenanceDownloadProtos) } allprojects { @@ -31,8 +28,6 @@ subprojects { apply { plugin(PluginIds.Kotlin) plugin(PluginIds.Idea) - plugin(PluginIds.TestLogger) - plugin(PluginIds.Protobuf) } repositories { @@ -58,43 +53,11 @@ subprojects { } } - plugins.withType { - configure { - theme = com.adarshr.gradle.testlogger.theme.ThemeType.STANDARD - showCauses = true - slowThreshold = 1000 - showSummary = true - } - } - - tasks.withType { - useJUnitPlatform { - excludeTags("intTest") - includeTags("junit-jupiter", "junit-vintage") - } - - failFast = true - } - - dependencies { - implementation(Libraries.KotlinReflect) - implementation(Libraries.KotlinStdlib) - - testImplementation(Libraries.SpringBootStarterTest) { - exclude(module = "junit") - exclude(module = "mockito-core") - exclude(module = "assertj-core") - } - testImplementation(Libraries.JunitJupiterApi) - testRuntimeOnly(Libraries.JunitJupiterEngine) - testImplementation(Libraries.SpringMockk) - testImplementation(Libraries.KotestAssert) - } - configurations.all { resolutionStrategy.eachDependency { - if (requested.group == "org.apache.logging.log4j") { + if (requested.group == "org.apache.logging.log4j" && (requested.version == "2.14.1") || (requested.version == "2.15.0")) { useVersion("2.15.0") + because("CVE-2021-44228") } } } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index f96e92e5..410cd87e 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -6,18 +6,3 @@ plugins { repositories { mavenCentral() } - -dependencies { - api("org.apache.commons:commons-compress:1.20") - api("commons-io:commons-io:2.6") - api("org.apache.httpcomponents:httpclient:4.5.12") -} - -gradlePlugin { - plugins { - create("downloadProtos") { - id = "io.provenance.download-protos" - implementationClass = "io.provenance.DownloadProtosPlugin" - } - } -} diff --git a/buildSrc/src/main/kotlin/Dependencies.kt b/buildSrc/src/main/kotlin/Dependencies.kt index 7c6a18de..5e0ddea2 100644 --- a/buildSrc/src/main/kotlin/Dependencies.kt +++ b/buildSrc/src/main/kotlin/Dependencies.kt @@ -14,9 +14,6 @@ object PluginIds { // please keep this sorted in sections const val SpringDependency = "io.spring.dependency-management" const val SpringBoot = "org.springframework.boot" - const val Protobuf = "com.google.protobuf" - const val Grpc = "grpc" - const val GrpcKt = "grpckt" // Provenance const val ProvenanceDownloadProtos = "io.provenance.download-protos" @@ -24,7 +21,7 @@ object PluginIds { // please keep this sorted in sections object PluginVersions { // please keep this sorted in sections // Kotlin - const val Kotlin = "1.5.30" + const val Kotlin = "1.5.31" // 3rd Party const val Flyway = "7.15.0" @@ -34,8 +31,7 @@ object PluginVersions { // please keep this sorted in sections const val GoryLenkoGitProps = "1.5.2" const val SpringDependency = "1.0.11.RELEASE" - const val SpringBoot = "2.4.3" - const val Protobuf = "0.8.17" + const val SpringBoot = "2.5.6" } object Versions { @@ -49,29 +45,21 @@ object Versions { const val BouncyCastle = "1.69" const val Exposed = "0.34.1" const val Flyway = PluginVersions.Flyway - const val Jackson = "2.11.2" + const val Jackson = "2.12.5" const val JacksonProtobuf = "0.9.12" const val Json = "20211205" const val KaseChange = "1.3.0" const val Ktor = "1.6.7" - const val Logback = "0.1.5" const val SpringBoot = PluginVersions.SpringBoot const val Swagger = "3.0.0" - const val Protobuf = "3.19.1" const val Grpc = "1.40.1" - const val KotlinGrpc = "1.2.0" + const val ProvProto = "v1.8.0-rc6" const val Postgres = "42.2.23" // Testing const val Jupiter = "5.7.1" const val SpringMockk = "3.0.1" const val Kotest = "4.4.3" - - // external protos - const val Provenance = "v1.7.5" - const val Cosmos = "v0.44.3" - const val Wasmd = "v0.19.0" - const val Ibc = "v1.1.0" } object Libraries { @@ -100,21 +88,9 @@ object Libraries { const val KaseChange = "net.pearx.kasechange:kasechange:${Versions.KaseChange}" const val Json = "org.json:json:${Versions.Json}" - // Logging - const val LogbackCore = "ch.qos.logback.contrib:logback-json-core:${Versions.Logback}" - const val LogbackClassic = "ch.qos.logback.contrib:logback-json-classic:${Versions.Logback}" - const val LogbackJackson = "ch.qos.logback.contrib:logback-jackson:${Versions.Logback}" - // Protobuf - const val ProtobufJavaUtil = "com.google.protobuf:protobuf-java-util:${Versions.Protobuf}" - const val ProtobufKotlin = "com.google.protobuf:protobuf-kotlin:${Versions.Protobuf}" - const val GrpcProtobuf = "io.grpc:grpc-protobuf:${Versions.Grpc}" - const val GrpcStub = "io.grpc:grpc-stub:${Versions.Grpc}" - const val GrpcKotlinStub = "io.grpc:grpc-kotlin-stub:${Versions.KotlinGrpc}" - const val ProtocArtifact = "com.google.protobuf:protoc:${Versions.Protobuf}" - const val GrpcArtifact = "io.grpc:protoc-gen-grpc-java:${Versions.Grpc}" - const val GrpcKotlinArtifact = "io.grpc:protoc-gen-grpc-kotlin:${Versions.KotlinGrpc}:jdk7@jar" const val GrpcNetty = "io.grpc:grpc-netty:${Versions.Grpc}" + const val ProvenanceProto = "io.provenance:proto-kotlin:${Versions.ProvProto}" // Spring const val SpringBootDevTools = "org.springframework.boot:spring-boot-devtools:${Versions.SpringBoot}" @@ -133,12 +109,3 @@ object Libraries { const val SpringMockk = "com.ninja-squad:springmockk:${Versions.SpringMockk}" const val KotestAssert = "io.kotest:kotest-assertions-core:${Versions.Kotest}" } - -// gradle configurations -const val kapt = "kapt" -const val api = "api" -const val implementation = "implementation" -const val testCompileOnly = "testCompileOnly" -const val testImplementation = "testImplementation" -const val testRuntimeOnly = "testRuntimeOnly" -const val developmentOnly = "developmentOnly" diff --git a/buildSrc/src/main/kotlin/Platform.kt b/buildSrc/src/main/kotlin/Platform.kt new file mode 100644 index 00000000..3c3608e8 --- /dev/null +++ b/buildSrc/src/main/kotlin/Platform.kt @@ -0,0 +1,15 @@ +object Platform { + object OS { + val name: String + get() = System.getProperty("os.name") + val arch: String + get() = System.getProperty("os.arch") + val isAppleSilicon: Boolean + get() = name == "Mac OS X" && arch == "aarch64" + } + + val availableProcessors: Int + get() = Runtime().availableProcessors() +} + +fun Runtime(): Runtime = Runtime.getRuntime() diff --git a/buildSrc/src/main/kotlin/io/provenance/DownloadProtosPlugin.kt b/buildSrc/src/main/kotlin/io/provenance/DownloadProtosPlugin.kt deleted file mode 100644 index 646ce900..00000000 --- a/buildSrc/src/main/kotlin/io/provenance/DownloadProtosPlugin.kt +++ /dev/null @@ -1,28 +0,0 @@ -package io.provenance - -import org.gradle.api.Plugin -import org.gradle.api.Project -import org.gradle.kotlin.dsl.register - -/** - * Custom gradle plugin to download Provenance, Cosmos, and CosmWasm/wasmd protobuf files. - * - */ -class DownloadProtosPlugin : Plugin { - override fun apply(project: Project) { - project.tasks.register( - "downloadProtos", - DownloadProtosTask::class - ) { - this.group = "protobuf" - this.description = - """Downloads Provenance and Cosmos protobuf files. - Specify the Provenance, Cosmos, and CosmWasm versions: - --provenance-version vX.Y.Z --cosmos-version vX.Y.Z --wasmd-version vX.Y.Z - Version information can be found at: - https://github.com/provenance-io/provenance/releases, - https://github.com/cosmos/cosmos-sdk/releases, and - https://github.com/CosmWasm/wasmd/tags.""" - } - } -} diff --git a/buildSrc/src/main/kotlin/io/provenance/DownloadProtosTask.kt b/buildSrc/src/main/kotlin/io/provenance/DownloadProtosTask.kt deleted file mode 100644 index cebd2ff7..00000000 --- a/buildSrc/src/main/kotlin/io/provenance/DownloadProtosTask.kt +++ /dev/null @@ -1,315 +0,0 @@ -package io.provenance - -import org.apache.commons.compress.archivers.tar.TarArchiveEntry -import org.apache.commons.compress.archivers.tar.TarArchiveInputStream -import org.apache.commons.io.FileUtils -import org.apache.commons.io.IOUtils -import org.apache.http.client.methods.HttpGet -import org.apache.http.impl.client.HttpClients -import org.apache.http.impl.client.LaxRedirectStrategy -import org.gradle.api.DefaultTask -import org.gradle.api.tasks.Input -import org.gradle.api.tasks.TaskAction -import org.gradle.api.tasks.options.Option -import java.io.File -import java.io.FileInputStream -import java.io.FileOutputStream -import java.io.IOException -import java.io.InputStream -import java.util.zip.GZIPInputStream -import java.util.zip.ZipEntry -import java.util.zip.ZipFile - -/** - * Custom gradle task to download Provenance and Cosmos protobuf files. - */ -open class DownloadProtosTask : DefaultTask() { - private val tempPrefix = this.javaClass.name - - @Option( - option = "provenance-version", - description = "Provenance release version (e.g. v1.7.5)" - ) - @Input - var provenanceVersion: String? = null - - @Option( - option = "cosmos-version", - description = "Cosmos release version (e.g. v0.44.3)" - ) - @Input - var cosmosVersion: String? = null - - @Option( - option = "wasmd-version", - description = "provenance-io/wasmd release version (e.g. v0.19.0)" - ) - @Input - var wasmdVersion: String? = null - - @Option( - option = "ibc-version", - description = "Cosmos IBC release version (e.g. v1.1.0)" - ) - @Input - var ibcVersion: String? = null - - /** - * Hard coded to v0.17.0 for backwards compatibility. Needed to serialize/deserialize older wasmd protos. - */ - @Input - val cosmwasmVersion: String = "v0.17.0" - - /** - * Connects directly to provenance-io GitHub release directory - * and downloads the `provenanceVersion` proto zip file. - * - * Connects directly to cosmos-sdk GitHub tarball release directory - * and downloads the `cosmosVersion` proto gzipped tar file. - * - * Connects directly to provenance-io/wasmd GitHub tarball release directory - * and downloads the `wasmdVersion` proto gzipped tar file. - * - * All files are uncompressed into the `third_party/proto` directory - * of this root gradle project. - * - */ - @TaskAction - fun downloadProtos() { - - cleanDestination(thirdPartyPath()) - - unzip( - file = toTempFile("https://github.com/provenance-io/provenance/releases/download/${this.provenanceVersion}/protos-${this.provenanceVersion}.zip"), - destinationDir = thirdPartyPath(), - includePattern = Regex(".*\\.proto\$") - ) - - untar( - file = unGzip(toTempFile("https://github.com/provenance-io/wasmd/tarball/${this.wasmdVersion}")), - destinationDir = thirdPartyPath(), - includePattern = Regex(".*/proto/.*\\.proto\$"), - excludePattern = Regex(".*third_party/.*|.*proto/ibc/.*"), - protoRootDir = "proto" - ) - - untar( - file = unGzip(toTempFile("https://github.com/cosmos/ibc-go/tarball/${this.ibcVersion}")), - destinationDir = thirdPartyPath(), - includePattern = Regex(".*/proto/.*\\.proto\$"), - excludePattern = Regex("FAILSAFE_STRING"), - protoRootDir = "proto" - ) - - untar( - file = unGzip(toTempFile("https://github.com/cosmos/cosmos-sdk/tarball/${this.cosmosVersion}")), - destinationDir = thirdPartyPath(), - includePattern = Regex(".*/proto/.*\\.proto\$"), - excludePattern = Regex(".*testutil/.*"), - protoRootDir = "proto" - ) - - untar( - file = unGzip(toTempFile("https://github.com/CosmWasm/wasmd/tarball/${this.cosmwasmVersion}")), - destinationDir = thirdPartyPath(), - includePattern = Regex(".*/proto/.*\\.proto\$"), - excludePattern = Regex(".*third_party/.*|.*proto/ibc/.*"), - protoRootDir = "proto" - ) - } - - /** - * The default destination directory for downloaded and uncompressed - * protos - */ - private fun thirdPartyPath() = - "${this.project.rootProject.rootDir}${File.separator}third_party${File.separator}" - - /** - * Clean the destination for the downloaded and uncompressed *.proto - * files (i.e. `third_party/proto`) - * - */ - private fun cleanDestination(destinationDir: String) { - FileUtils.forceDelete(File(destinationDir)) - FileUtils.forceMkdir(File(destinationDir)) - } - - /** - * Extract `url` to a local machine temp directory - */ - private fun toTempFile(url: String): File = - HttpClients.custom().setRedirectStrategy(LaxRedirectStrategy()).build() - .use { client -> - client.execute( - HttpGet(url) - ) { response -> - if (response == null || response.statusLine.statusCode != 200) { - throw IOException("could not retrieve: ${response?.statusLine?.reasonPhrase}") - } - File.createTempFile(tempPrefix, "zip").let { tempFile -> - IOUtils.copy( - response.entity.content, - FileOutputStream( - tempFile - ) - ) - tempFile - } - } - } - - /** - * Unzip the given `file` to `destinationDir` but only include files - * that match the `includePattern` regex - */ - private fun unzip( - file: File, - destinationDir: String, - includePattern: Regex - ) { - ZipFile(file).use { zip -> - zip.entries().asSequence() - .forEach { zipEntry -> - handleZipEntry( - zipInputStream = zip.getInputStream(zipEntry), - zipEntry = zipEntry, - destinationDir = File(destinationDir), - includePattern = includePattern - ) - } - } - } - - /** - * Given a zip input stream and an entry in the zip file, extract - * the zip entry to the `destinationDir` when the zip entry file matches - * the `includePattern` - */ - @Throws(IOException::class) - private fun handleZipEntry( - zipInputStream: InputStream, - zipEntry: ZipEntry, - destinationDir: File, - includePattern: Regex - ) { - if (zipEntry.name.matches(includePattern)) { - val newFile = File(destinationDir, zipEntry.name) - if (zipEntry.isDirectory) { - if (!newFile.isDirectory && !newFile.mkdirs()) { - throw IOException("Failed to create directory $newFile") - } - } else { - // fix for Windows-created archives - val parent = newFile.parentFile - if (!parent.isDirectory && !parent.mkdirs()) { - throw IOException("Failed to create directory $parent") - } - IOUtils.copy(zipInputStream, FileOutputStream(newFile)) - } - } - } - - /** - * UnTar the given `file` to `destinationDir` but only include files - * that match the `includePattern` regex and don't match the `excludePattern`. - * - * The `protoRootDir` is used to find the first occurrence directory of - * the `proto` directory (for example). This `protoRootDir` is the directory - * copied to the local `thirdPartyPath()`. - */ - @Throws(IOException::class) - private fun untar( - file: File, - destinationDir: String, - includePattern: Regex, - excludePattern: Regex, - protoRootDir: String - ) { - val tempDir = File.createTempFile(tempPrefix, "dir").parentFile - - // Keep the first (top) occurrence of a directory in the tar so - // copying entire directories is simpler - var topTarDirectory: File? = null - - TarArchiveInputStream(FileInputStream(file)).use { tarArchiveInputStream -> - var tarEntry: TarArchiveEntry? - while (tarArchiveInputStream.nextTarEntry.also { - tarEntry = it - } != null - ) { - if (topTarDirectory == null) { - topTarDirectory = File(tempDir.absolutePath + File.separator + tarEntry?.name) - } - - if (tarEntry?.name?.matches(includePattern) == true && - tarEntry?.name?.matches(excludePattern) == false - ) { - // write to temp file first so we can pick the dirs we want - val outputFile = File(tempDir.absolutePath + File.separator + tarEntry?.name) - if (tarEntry?.isDirectory == true) { - if (!outputFile.exists()) { - outputFile.mkdirs() - } - } else { - outputFile.let { - it.parentFile.mkdirs() - IOUtils.copy( - tarArchiveInputStream, - FileOutputStream(it) - ) - } - } - } - } - } - // Copy from proto root dir to the local project third_party dir - topTarDirectory?.let { topTar -> - mutableListOf().let { matchedDirs -> - findDirectory(topTar, protoRootDir, matchedDirs) - matchedDirs.forEach { - FileUtils.copyDirectory(it, File("$destinationDir${File.separator}proto")) - } - } - } ?: throw IOException("tar file ${file.absolutePath} is not a well formed tar file - missing top level directory") - } - - /** - * Given a cwd find the all of the first directories matching the `findDirectory` name. - * For example, given a `findDirectory` of `proto` this will return matching - * directories named: - * `./some/dir/level/proto/messages` and `./some/other/dir/proto/messages` - * - */ - private fun findDirectory( - currentDirectory: File, - findDirectory: String, - matchingDirectories: MutableList - ) { - if (currentDirectory.isDirectory && currentDirectory.name == findDirectory) { - matchingDirectories.add(currentDirectory) - } else { - val files = currentDirectory.listFiles() ?: emptyArray() - for (file in files) { - if (file.isFile) { - continue - } - if (file.isDirectory) { - findDirectory(file, findDirectory, matchingDirectories) - } - } - } - } - - /** - * ungzip a given gZippedFile tar file - */ - @Throws(IOException::class) - private fun unGzip(gZippedFile: File): File = - GZIPInputStream(FileInputStream(gZippedFile)).let { gzip -> - File.createTempFile(tempPrefix, "tar").let { tempFile -> - FileUtils.copyToFile(gzip, tempFile) - tempFile - } - } -} diff --git a/database/build.gradle.kts b/database/build.gradle.kts index 56d8e5b2..c8ec4390 100644 --- a/database/build.gradle.kts +++ b/database/build.gradle.kts @@ -2,12 +2,8 @@ plugins { id(PluginIds.Flyway) version PluginVersions.Flyway } -apply { - plugin(PluginIds.Flyway) -} - dependencies { - api(Libraries.FlywayCore) + implementation(Libraries.FlywayCore) } flyway { diff --git a/database/src/main/resources/db/migration/V1_49__1.8.0_updates.sql b/database/src/main/resources/db/migration/V1_49__1.8.0_updates.sql new file mode 100644 index 00000000..67b323db --- /dev/null +++ b/database/src/main/resources/db/migration/V1_49__1.8.0_updates.sql @@ -0,0 +1,300 @@ +SELECT 'Adding tx_fee.msg_type' AS comment; +ALTER TABLE tx_fee + ADD COLUMN IF NOT EXISTS msg_type VARCHAR(256); + +DROP INDEX IF EXISTS tx_fee_unique_idx; +CREATE UNIQUE INDEX IF NOT EXISTS tx_fee_unique_idx ON tx_fee (tx_hash_id, fee_type, msg_type, marker_id); + +SELECT 'Updating tx insert procedure' AS comment; +CREATE OR REPLACE PROCEDURE add_tx(tu tx_update, tx_height INT, timez TIMESTAMP) + LANGUAGE plpgsql +AS +$$ +DECLARE + tx_id INT; -- tx id + tf tx_fee; + msg tx_msg; + msgId integer; + event tx_event; + eventId integer; + attr tx_msg_event_attr; + sm tx_single_message_cache; + aj tx_address_join; + mj tx_marker_join; + nj tx_nft_join; + gp gov_proposal; + pm proposal_monitor; + gd gov_deposit; + gv gov_vote; + ibcl ibc_ledger; + codej tx_sm_code; + contractj tx_sm_contract; + sig signature_join; + tfp tx_feepayer; +BEGIN + + -- Insert tx record, getting id + WITH t AS ( + INSERT INTO tx_cache (hash, height, gas_wanted, gas_used, tx_timestamp, error_code, codespace, tx_v2) + VALUES ((tu).tx.hash, + tx_height, + (tu).tx.gas_wanted, + (tu).tx.gas_used, + timez, + (tu).tx.error_code, + (tu).tx.codespace, + (tu).tx.tx_v2) + ON CONFLICT (hash) DO NOTHING + RETURNING id + ) + SELECT * FROM t + UNION SELECT id FROM tx_cache WHERE hash = (tu).tx.hash + INTO tx_id; + + -- insert gas fee + INSERT INTO tx_gas_cache(hash, gas_wanted, gas_used, tx_timestamp, fee_amount) + VALUES ((tu).txGasFee.hash, (tu).txGasFee.gas_wanted, (tu).txGasFee.gas_used, timez, (tu).txGasFee.fee_amount) + ON CONFLICT (hash) DO NOTHING; + -- insert fee + FOREACH tf IN ARRAY (tu).txFees + LOOP + INSERT INTO tx_fee(tx_hash, fee_type, marker_id, marker, amount, block_height, tx_hash_id, msg_type) + VALUES (tf.tx_hash, tf.fee_type, tf.marker_id, tf.marker, tf.amount, tx_height, tx_id, tf.msg_type) + ON CONFLICT (tx_hash_id, fee_type, msg_type, marker_id) DO NOTHING; + END LOOP; + + -- insert msgs + FOREACH msg IN ARRAY (tu).txMsgs + LOOP + WITH m AS ( + INSERT INTO tx_message (tx_hash, block_height, tx_hash_id, tx_message_type_id, tx_message_hash, + msg_idx, "tx_message") + VALUES ((msg).txMsg.tx_hash, + tx_height, + tx_id, + (msg).txMsg.tx_message_type_id, + (msg).txMsg.tx_message_hash, + (msg).txMsg.msg_idx, + (msg).txMsg.tx_message) + ON CONFLICT (tx_hash_id, tx_message_hash, msg_idx) DO NOTHING + RETURNING id + ) + SELECT * FROM m + UNION SELECT id FROM tx_message + WHERE tx_hash_id = tx_id + AND tx_message_hash = (msg).txMsg.tx_message_hash + AND msg_idx = (msg).txMsg.msg_idx + INTO msgId; + -- insert events + FOREACH event IN ARRAY (msg).txEvents + LOOP + WITH e AS ( + INSERT INTO tx_msg_event (tx_hash, block_height, tx_hash_id, tx_message_id, event_type, + tx_msg_type_id) + VALUES ((event).txEvent.tx_hash, + tx_height, + tx_id, + msgId, + (event).txEvent.event_type, + (event).txEvent.tx_msg_type_id) + ON CONFLICT (tx_hash_id, tx_message_id, event_type) DO NOTHING + RETURNING id + ) + SELECT * FROM e + UNION SELECT id FROM tx_msg_event + WHERE tx_hash_id = tx_id + AND tx_message_id = msgId + AND event_type = (event).txEvent.event_type + INTO eventId; + -- insert attributes + FOREACH attr IN ARRAY (event).txAttrs + LOOP + INSERT INTO tx_msg_event_attr(tx_msg_event_id, attr_key, attr_value, attr_idx, attr_hash) + VALUES (eventId, attr.attr_key, attr.attr_value, attr.attr_idx, attr.attr_hash) + ON CONFLICT (tx_msg_event_id, attr_hash) DO NOTHING; + END LOOP; + END LOOP; + END LOOP; + + -- insert single msg record + FOREACH sm IN ARRAY (tu).singleMsg + LOOP + INSERT INTO tx_single_message_cache(tx_hash, tx_timestamp, gas_used, tx_message_type) + VALUES (sm.tx_hash, timez, sm.gas_used, sm.tx_message_type) + ON CONFLICT (tx_hash) DO NOTHING; + END LOOP; + + -- insert address join + FOREACH aj IN ARRAY (tu).addressJoin + LOOP + INSERT INTO tx_address_join(block_height, tx_hash, address, tx_hash_id, address_id, address_type) + VALUES (tx_height, aj.tx_hash, aj.address, tx_id, aj.address_id, aj.address_type) + ON CONFLICT (tx_hash, address) DO NOTHING; + END LOOP; + + -- insert marker join + FOREACH mj IN ARRAY (tu).markerJoin + LOOP + INSERT INTO tx_marker_join(block_height, tx_hash, denom, tx_hash_id, marker_id) + VALUES (tx_height, mj.tx_hash, mj.denom, tx_id, mj.marker_id) + ON CONFLICT (tx_hash, marker_id) DO NOTHING; + END LOOP; + + -- insert scope join + FOREACH nj IN ARRAY (tu).nftJoin + LOOP + INSERT INTO tx_nft_join(block_height, tx_hash, tx_hash_id, metadata_id, metadata_type, + metadata_uuid) + VALUES (tx_height, nj.tx_hash, tx_id, nj.metadata_id, nj.metadata_type, nj.metadata_uuid) + ON CONFLICT (tx_hash, metadata_type, metadata_id) DO NOTHING; + END LOOP; + + -- insert proposal + FOREACH gp IN ARRAY (tu).proposals + LOOP + INSERT INTO gov_proposal(proposal_id, proposal_type, address_id, address, is_validator, title, + description, + status, data, content, block_height, tx_hash, tx_timestamp) + VALUES (gp.proposal_id, + gp.proposal_type, + gp.address_id, + gp.address, + gp.is_validator, + gp.title, + gp.description, + gp.status, + gp.data, + gp.content, + tx_height, + gp.tx_hash, + timez) + ON CONFLICT (proposal_id) DO UPDATE + SET status = gp.status, + data = gp.data, + tx_hash = gp.tx_hash, + tx_timestamp = timez, + block_height = tx_height; + END LOOP; + -- insert monitor + FOREACH pm IN ARRAY (tu).proposalMonitors + LOOP + INSERT INTO proposal_monitor(proposal_id, submitted_height, proposed_completion_height, + voting_end_time, proposal_type, matching_data_hash) + VALUES (pm.proposal_id, + pm.submitted_height, + pm.proposed_completion_height, + pm.voting_end_time, + pm.proposal_type, + pm.matching_data_hash) + ON CONFLICT (proposal_id) DO NOTHING; + END LOOP; + -- insert deposit + FOREACH gd IN ARRAY (tu).deposits + LOOP + INSERT INTO gov_deposit(proposal_id, address_id, address, block_height, tx_hash, tx_timestamp, + is_validator, deposit_type, amount, denom) + VALUES (gd.proposal_id, + gd.address_id, + gd.address, + tx_height, + gd.tx_hash, + timez, + gd.is_validator, + gd.deposit_type, + gd.amount, + gd.denom) + ON CONFLICT (proposal_id, tx_hash, deposit_type, address_id, denom) DO NOTHING; + END LOOP; + -- insert vote + FOREACH gv IN ARRAY (tu).votes + LOOP + INSERT INTO gov_vote(proposal_id, address_id, address, block_height, tx_hash, tx_timestamp, + is_validator, vote) + VALUES (gv.proposal_id, + gv.address_id, + gv.address, + tx_height, + gv.tx_hash, + timez, + gv.is_validator, + gv.vote) + ON CONFLICT (proposal_id, address_id) DO UPDATE + SET vote = gv.vote, + block_height = tx_height, + tx_hash = gv.tx_hash, + tx_timestamp = timez + WHERE tx_height > gov_vote.block_height; + END LOOP; + + -- insert ledger + FOREACH ibcl IN ARRAY (tu).ibcLedgers + LOOP + INSERT INTO ibc_ledger(dst_chain_name, channel_id, denom, denom_trace, balance_in, balance_out, + from_address, to_address, pass_through_address_id, pass_through_address, + logs, block_height, tx_hash_id, tx_hash, tx_timestamp, acknowledged, + ack_success) + VALUES (ibcl.dst_chain_name, + ibcl.channel_id, + ibcl.denom, + ibcl.denom_trace, + ibcl.balance_in, + ibcl.balance_out, + ibcl.from_address, + ibcl.to_address, + ibcl.pass_through_address_id, + ibcl.pass_through_address, + ibcl.logs, + ibcl.block_height, + CASE WHEN ibcl.tx_hash_id < 0 THEN tx_id ELSE ibcl.tx_hash_id END, + ibcl.tx_hash, + ibcl.tx_timestamp, + ibcl.acknowledged, + ibcl.ack_success) + ON CONFLICT (channel_id, from_address, to_address, denom_trace, balance_in, balance_out, tx_hash_id) + DO UPDATE + SET acknowledged = true, + ack_success = ibcl.ack_success, + ack_logs = ibcl.ack_logs, + ack_block_height = tx_height, + ack_tx_hash_id = tx_id, + ack_tx_hash = ibcl.ack_tx_hash, + ack_tx_timestamp = timez; + END LOOP; + + -- insert sm join + FOREACH codej IN ARRAY (tu).smCodes + LOOP + INSERT INTO tx_sm_code(block_height, tx_hash, tx_hash_id, sm_code) + VALUES (tx_height, codej.tx_hash, tx_id, codej.sm_code) + ON CONFLICT (tx_hash, sm_code) DO NOTHING; + END LOOP; + + FOREACH contractj IN ARRAY (tu).smContracts + LOOP + INSERT INTO tx_sm_contract(block_height, tx_hash, tx_hash_id, sm_contract_id, sm_contract_address) + VALUES (tx_height, contractj.tx_hash, tx_id, contractj.sm_contract_id, contractj.sm_contract_address) + ON CONFLICT (tx_hash, sm_contract_id) DO NOTHING; + END LOOP; + + -- insert sig join + FOREACH sig IN ARRAY (tu).sigs + LOOP + INSERT INTO signature_join(join_type, join_key, signature_id) + VALUES (sig.join_type, sig.join_key, sig.signature_id) + ON CONFLICT (join_type, join_key, signature_id) DO NOTHING; + END LOOP; + + -- insert feepayer + FOREACH tfp IN ARRAY (tu).feepayers + LOOP + INSERT INTO tx_feepayer(block_height, tx_hash_id, tx_hash, payer_type, address_id, address) + VALUES (tx_height, tx_id, tfp.tx_hash, tfp.payer_type, tfp.address_id, tfp.address) + ON CONFLICT (tx_hash, payer_type, address_id) DO NOTHING; + END LOOP; + + RAISE INFO 'UPDATED tx'; +EXCEPTION + WHEN others THEN + RAISE EXCEPTION 'Error saving tx %', (tu).tx.hash; +END; +$$; diff --git a/proto/README.md b/proto/README.md deleted file mode 100644 index ad5c355f..00000000 --- a/proto/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# Provenance Blockchain Protobuf Install and Build - -The Provenance Explorer uses a combination of [Provenance](https://github.com/provenance-io/provenance), -[Cosmos](https://github.com/cosmos/cosmos-sdk), [provenance-io/wasmd](https://github.com/provenance-io/wasmd) -and [IBC](https://github.com/cosmos/ibc-go) [protobuf](https://developers.google.com/protocol-buffers) definitions. -Protocol buffers (protobuf) are Google's language-neutral, platform-neutral, -extensible mechanism for serializing structured data. The Provenance -[gRPC](https://grpc.io) and protobuf provide the RPC mechanism that Provenance -Explorer (and all middleware, really) uses to communicate with the Provenance blockchain. - -## Download Provenance Blockchain Protos - -This `proto` module compiles the protobuf definitions (protos) from the `third_party` directory. -The compiled protos are then used in the Provenance Explorer `service` module -to communicate with the blockchain. - -Before compiling the protos, they must be downloaded locally. The `third_party` -directory contains the last download of the protos. To update the `third_party` -directory run this `gradle` task *from the root project directory*: - -```bash -./gradlew proto:downloadProtos -``` - -> The `downloadProtos` task will clean the `third_party` directory prior to -> download. Do not edit the protos in that directory. - -This `gradle` task will download the Provenance, Cosmos, and provenance-io/wasmd proto versions defined -in the `./buildSrc/src/main/kotlin/Dependencies.kt` file: - -```kotlin - //external protos - const val Provenance = "v1.7.5" - const val Cosmos = "v0.44.3" - const val Wasmd = "v0.19.0" - const val Ibc = "v1.1.0" -``` - -To manually specify the versions run this `gradle` task *from the root project directory*: - -```bash -./gradlew downloadProtos --provenance-version v1.7.5 --cosmos-version v0.44.3 --wasmd-version v0.19.0 --ibc-version v1.1.0 -``` - -> The proto download process does not need to be run very often, -> only when major version of the Provenance or Cosmos proto definitions -> are released. - -## Build Protos - -Once the protos have been downloaded, run the `gradle` task *from the root project directory*: - -```bash -./gradlew clean proto:generateProto -``` diff --git a/proto/build.gradle.kts b/proto/build.gradle.kts deleted file mode 100644 index 81d5872c..00000000 --- a/proto/build.gradle.kts +++ /dev/null @@ -1,77 +0,0 @@ -import com.google.protobuf.gradle.generateProtoTasks -import com.google.protobuf.gradle.id -import com.google.protobuf.gradle.ofSourceSet -import com.google.protobuf.gradle.plugins -import com.google.protobuf.gradle.protobuf -import com.google.protobuf.gradle.protoc - -sourceSets.main { - proto.srcDirs("../third_party/proto/") -} - -dependencies { -// protobuf(files("cosmWasm-v0.17.0.tar.gz")) - api(Libraries.ProtobufJavaUtil) - implementation(Libraries.ProtobufKotlin) - api(Libraries.GrpcKotlinStub) - api(Libraries.GrpcProtobuf) - implementation(Libraries.GrpcStub) - - if (JavaVersion.current().isJava9Compatible) { - // Workaround for @javax.annotation.Generated - // see: https://github.com/grpc/grpc-java/issues/3633 - api("javax.annotation:javax.annotation-api:1.3.1") - } -} - -tasks.withType().all { - kotlinOptions { - freeCompilerArgs = listOf("-Xopt-in=kotlin.RequiresOptIn") - } -} - -protobuf { - protoc { - // The artifact spec for the Protobuf Compiler - artifact = Libraries.ProtocArtifact - } - plugins { - // Optional: an artifact spec for a protoc plugin, with "grpc" as - // the identifier, which can be referred to in the "plugins" - // container of the "generateProtoTasks" closure. - id(PluginIds.Grpc) { - artifact = Libraries.GrpcArtifact - } - id(PluginIds.GrpcKt) { - artifact = Libraries.GrpcKotlinArtifact - } - } - generateProtoTasks { - all().forEach { - it.plugins { - id(PluginIds.Grpc) - id(PluginIds.GrpcKt) - } - it.builtins { - id(PluginIds.Kotlin) - } - } - } -} - -tasks.register("downloadProtos") { - provenanceVersion = Versions.Provenance - cosmosVersion = Versions.Cosmos - wasmdVersion = Versions.Wasmd - ibcVersion = Versions.Ibc -} - -//tasks.register("downloadTest"){ -// mapOf("cosmWasm-v0.17.0.tar.gz" to "https://github.com/CosmWasm/wasmd/tarball/v0.17.0") -// .forEach { (k, v) -> download(v,k) } -//} -// -//fun download(url : String, path : String){ -// val destFile = File(path) -// ant.invokeMethod("get", mapOf("src" to url, "dest" to destFile)) -//} diff --git a/scripts/copy_proto_v2.sh b/scripts/copy_proto_v2.sh deleted file mode 100755 index 0105d36d..00000000 --- a/scripts/copy_proto_v2.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash - -# -# DEPRECATED - use `./gradlew downloadProtos -p proto` instead -# - -echo "version to download: prov: $1, cosmos: $2" -echo "Starting proto copy" - -THIRD_PARTY="third_party" -PROV_ZIP_URL="https://github.com/provenance-io/provenance/releases/download/$1/protos-$1.zip" -COS_ZIP_URL="https://github.com/cosmos/cosmos-sdk/tarball/$2" - -echo "Removing existing protos" -rm -r $THIRD_PARTY -mkdir -p $THIRD_PARTY - -echo "Getting cos zip" -cd $THIRD_PARTY -curl -sSL $COS_ZIP_URL | tar --exclude='testutil/' --exclude='proto/ibc/' -xvf - --strip-components 1 --include '*.proto' -mv third_party/proto/* proto -rm -rf third_party - -echo "Getting prov zip" -cd ../ -curl -sSL $PROV_ZIP_URL >$THIRD_PARTY/protos.zip -unzip -o $THIRD_PARTY/protos.zip -d $THIRD_PARTY -rm $THIRD_PARTY/protos.zip - -echo "Finished proto copy" diff --git a/service/build.gradle.kts b/service/build.gradle.kts index de113f63..bc74c955 100644 --- a/service/build.gradle.kts +++ b/service/build.gradle.kts @@ -8,6 +8,7 @@ plugins { id(PluginIds.GoryLenkoGitProps) version PluginVersions.GoryLenkoGitProps id(PluginIds.SpringDependency) version PluginVersions.SpringDependency id(PluginIds.SpringBoot) version PluginVersions.SpringBoot + id(PluginIds.TestLogger) version PluginVersions.TestLogger apply false } sourceSets { @@ -20,22 +21,23 @@ sourceSets { } dependencies { - api(project(":database")) - api(project(":proto")) - - api(Libraries.SpringBootStarterWeb) - api(Libraries.SpringBootDevTools) - api(Libraries.SpringBootStarterJdbc) - api(Libraries.SpringBootStarterActuator) - api(Libraries.SpringBootStarterValidation) + implementation(project(":database")) + implementation(Libraries.ProvenanceProto) + implementation(Libraries.KotlinReflect) + implementation(Libraries.KotlinStdlib) + + implementation(Libraries.SpringBootStarterWeb) + implementation(Libraries.SpringBootStarterJdbc) + implementation(Libraries.SpringBootStarterActuator) + implementation(Libraries.SpringBootStarterValidation) kapt(Libraries.SpringBootConfigProcessor) - api(Libraries.BouncyCastle) - api(Libraries.KotlinXCoRoutinesCore) - api(Libraries.KotlinXCoRoutinesGuava) - api(Libraries.ApacheCommonsText) + implementation(Libraries.BouncyCastle) + implementation(Libraries.KotlinXCoRoutinesCore) + implementation(Libraries.KotlinXCoRoutinesGuava) + implementation(Libraries.ApacheCommonsText) implementation(Libraries.KaseChange) - api(Libraries.ApacheHttpClient) + implementation(Libraries.ApacheHttpClient) implementation(Libraries.KtorClientCore) implementation(Libraries.KtorClientEngineJava) implementation(Libraries.KtorClientSerialization) @@ -43,22 +45,29 @@ dependencies { implementation(Libraries.GrpcNetty) - api(Libraries.LogbackCore) - api(Libraries.LogbackClassic) - api(Libraries.LogbackJackson) - - api(Libraries.JacksonModuleKotlin) - api(Libraries.JacksonDatatype) - api(Libraries.JacksonProtobuf) + implementation(Libraries.JacksonModuleKotlin) + implementation(Libraries.JacksonDatatype) + implementation(Libraries.JacksonProtobuf) implementation(Libraries.Postgres) - api(Libraries.Swagger) - api(Libraries.Exposed) - api(Libraries.ExposedJavaTime) - api(Libraries.ExposedDao) - api(Libraries.ExposedJdbc) + implementation(Libraries.Swagger) + implementation(Libraries.Exposed) + implementation(Libraries.ExposedJavaTime) + implementation(Libraries.ExposedDao) + implementation(Libraries.ExposedJdbc) + implementation(Libraries.FlywayCore) developmentOnly(Libraries.SpringBootDevTools) + + testImplementation(Libraries.SpringBootStarterTest) { + exclude(module = "junit") + exclude(module = "mockito-core") + exclude(module = "assertj-core") + } + testImplementation(Libraries.JunitJupiterApi) + testRuntimeOnly(Libraries.JunitJupiterEngine) + testImplementation(Libraries.SpringMockk) + testImplementation(Libraries.KotestAssert) } dependencyManagement { @@ -69,8 +78,9 @@ dependencyManagement { configurations.all { resolutionStrategy.eachDependency { - if (requested.group == "org.apache.logging.log4j") { + if (requested.group == "org.apache.logging.log4j" && (requested.version == "2.14.1") || (requested.version == "2.15.0")) { useVersion("2.15.0") + because("CVE-2021-44228") } } } @@ -89,3 +99,21 @@ tasks.getByName("bootJar") { classpath += configurations.developmentOnly enabled = true } + +plugins.withType { + configure { + theme = com.adarshr.gradle.testlogger.theme.ThemeType.STANDARD + showCauses = true + slowThreshold = 1000 + showSummary = true + } +} + +tasks.withType { + useJUnitPlatform { + excludeTags("intTest") + includeTags("junit-jupiter", "junit-vintage") + } + + failFast = true +} diff --git a/service/src/main/kotlin/io/provenance/explorer/Application.kt b/service/src/main/kotlin/io/provenance/explorer/Application.kt index 2731457c..77f17d58 100644 --- a/service/src/main/kotlin/io/provenance/explorer/Application.kt +++ b/service/src/main/kotlin/io/provenance/explorer/Application.kt @@ -1,6 +1,7 @@ package io.provenance.explorer import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.databind.PropertyNamingStrategies import com.fasterxml.jackson.databind.PropertyNamingStrategy import com.fasterxml.jackson.databind.node.JsonNodeFactory import io.ktor.client.HttpClient diff --git a/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt b/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt index 0ea28032..72c55d27 100644 --- a/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt +++ b/service/src/main/kotlin/io/provenance/explorer/config/RestConfig.kt @@ -104,6 +104,9 @@ import io.provenance.metadata.v1.MsgWriteRecordSpecificationRequest import io.provenance.metadata.v1.MsgWriteScopeRequest import io.provenance.metadata.v1.MsgWriteScopeSpecificationRequest import io.provenance.metadata.v1.MsgWriteSessionRequest +import io.provenance.msgfees.v1.AddMsgFeeProposal +import io.provenance.msgfees.v1.RemoveMsgFeeProposal +import io.provenance.msgfees.v1.UpdateMsgFeeProposal import io.provenance.name.v1.CreateRootNameProposal import io.provenance.name.v1.EventNameBound import io.provenance.name.v1.EventNameUnbound @@ -291,7 +294,7 @@ fun msgDescriptors() = cosmos.feegrant.v1beta1.Tx.MsgGrantAllowance.getDescriptor(), cosmos.feegrant.v1beta1.Tx.MsgRevokeAllowance.getDescriptor(), Ibc.MsgIBCSend.getDescriptor(), - Ibc.MsgIBCCloseChannel.getDescriptor() + Ibc.MsgIBCCloseChannel.getDescriptor(), ) fun contentDescriptors() = @@ -325,7 +328,10 @@ fun contentDescriptors() = cosmwasm.wasm.v1beta1.Proposal.PinCodesProposal.getDescriptor(), cosmwasm.wasm.v1beta1.Proposal.UnpinCodesProposal.getDescriptor(), Client.ClientUpdateProposal.getDescriptor(), - SetDenomMetadataProposal.getDescriptor() + SetDenomMetadataProposal.getDescriptor(), + AddMsgFeeProposal.getDescriptor(), + UpdateMsgFeeProposal.getDescriptor(), + RemoveMsgFeeProposal.getDescriptor() ) fun events() = listOf( diff --git a/service/src/main/kotlin/io/provenance/explorer/domain/entities/Accounts.kt b/service/src/main/kotlin/io/provenance/explorer/domain/entities/Accounts.kt index 1799cb79..96f3fde5 100644 --- a/service/src/main/kotlin/io/provenance/explorer/domain/entities/Accounts.kt +++ b/service/src/main/kotlin/io/provenance/explorer/domain/entities/Accounts.kt @@ -96,9 +96,10 @@ class AccountRecord(id: EntityID) : IntEntity(id) { ( findByAddress(address)?.apply { this.baseAccount = baseAccount - this.accountNumber = baseAccount.accountNumber + this.accountNumber = number this.data = data this.isContract = isContract + this.type = type // can change from base to marker with 1.8.0 } ?: AccountTable.insertAndGetId { it[this.accountAddress] = address it[this.type] = type diff --git a/service/src/main/kotlin/io/provenance/explorer/domain/entities/Transactions.kt b/service/src/main/kotlin/io/provenance/explorer/domain/entities/Transactions.kt index 8d9974e6..31a6fafc 100644 --- a/service/src/main/kotlin/io/provenance/explorer/domain/entities/Transactions.kt +++ b/service/src/main/kotlin/io/provenance/explorer/domain/entities/Transactions.kt @@ -14,9 +14,11 @@ import io.provenance.explorer.domain.extensions.NHASH import io.provenance.explorer.domain.extensions.exec import io.provenance.explorer.domain.extensions.map import io.provenance.explorer.domain.extensions.startOfDay +import io.provenance.explorer.domain.extensions.stringfy import io.provenance.explorer.domain.extensions.toCoinStr import io.provenance.explorer.domain.extensions.toDateTime import io.provenance.explorer.domain.extensions.toDbHash +import io.provenance.explorer.domain.models.explorer.FeeCoinStr import io.provenance.explorer.domain.models.explorer.GasStats import io.provenance.explorer.domain.models.explorer.TxData import io.provenance.explorer.domain.models.explorer.TxFee @@ -28,6 +30,9 @@ import io.provenance.explorer.domain.models.explorer.TxUpdate import io.provenance.explorer.domain.models.explorer.getCategoryForType import io.provenance.explorer.domain.models.explorer.onlyTxQuery import io.provenance.explorer.domain.models.explorer.toProcedureObject +import io.provenance.explorer.grpc.extensions.getByDefinedEvent +import io.provenance.explorer.grpc.extensions.getExecuteContractTypeUrl +import io.provenance.explorer.grpc.v1.MsgFeeGrpcClient import io.provenance.explorer.service.AssetService import net.pearx.kasechange.toTitleCase import org.jetbrains.exposed.dao.IntEntity @@ -471,8 +476,8 @@ object TxGasCacheTable : IntIdTable(name = "tx_gas_cache") { class TxGasCacheRecord(id: EntityID) : IntEntity(id) { companion object : IntEntityClass(TxGasCacheTable) { - fun buildInsert(tx: ServiceOuterClass.GetTxResponse, txTime: DateTime) = - TxFeeRecord.calcBaseGasFee(tx.txResponse.gasWanted).toDouble().let { + fun buildInsert(tx: ServiceOuterClass.GetTxResponse, txTime: DateTime, floorGasPrice: Long) = + TxFeeRecord.calcBaseGasFee(tx.txResponse.gasWanted, floorGasPrice).toDouble().let { listOf( 0, tx.txResponse.txhash, @@ -570,35 +575,49 @@ object TxFeeTable : IntIdTable(name = "tx_fee") { val markerId = integer("marker_id") val marker = varchar("marker", 256) val amount = decimal("amount", 100, 10) + val msgType = varchar("msg_type", 256).nullable() } enum class FeeType { BASE_FEE_USED, BASE_FEE_OVERAGE, PRIORITY_FEE, MSG_BASED_FEE } fun List.toFees() = this.groupBy { it.feeType } - .map { (k, v) -> TxFee(k.toTitleCase(), v.map { it.amount.toCoinStr(it.marker) }) } + .map { (k, v) -> TxFee(k.toTitleCase(), v.map { it.toFeeCoinStr() }) } + +fun TxFeeRecord.toFeeCoinStr() = FeeCoinStr(this.amount.stringfy(), this.marker, this.msgType) fun List.toFeePaid() = this.sumOf { it.amount }.toCoinStr(this.first().marker) class TxFeeRecord(id: EntityID) : IntEntity(id) { companion object : IntEntityClass(TxFeeTable) { - // TODO: Replace 1905 with value from chain when 1.8.0 gets released - fun calcBaseGasFee(gasWanted: Long) = gasWanted * 1905 + fun calcBaseGasFee(gasWanted: Long, floorGasPrice: Long) = gasWanted * floorGasPrice - fun buildInserts(txInfo: TxData, tx: ServiceOuterClass.GetTxResponse, assetService: AssetService) = + fun buildInserts( + txInfo: TxData, + tx: ServiceOuterClass.GetTxResponse, + assetService: AssetService, + msgFeeClient: MsgFeeGrpcClient + ) = transaction { val success = tx.txResponse.code == 0 val feeList = mutableListOf() // calc baseFeeUsed, baseFeeOverage in nhash, and remaining as priority in nhash tx.tx.authInfo.fee.amountList.first { it.denom == NHASH }.let { - val baseFee = calcBaseGasFee(tx.txResponse.gasWanted) - val baseFeeUsed = calcBaseGasFee(tx.txResponse.gasUsed) + val baseFee = calcBaseGasFee(tx.txResponse.gasWanted, msgFeeClient.getFloorGasPrice()) + val baseFeeUsed = calcBaseGasFee(tx.txResponse.gasUsed, msgFeeClient.getFloorGasPrice()) Triple(it.amount.toLong() - baseFee, baseFee - baseFeeUsed, baseFeeUsed) }.let { (priority, baseFeeOverage, baseFeeUsed) -> val nhash = assetService.getAssetRaw(NHASH).second // insert used fee feeList.add( - buildInsert(txInfo, BASE_FEE_USED.name, nhash.id.value, nhash.denom, baseFeeUsed.toBigDecimal()) + buildInsert( + txInfo, + BASE_FEE_USED.name, + nhash.id.value, + nhash.denom, + baseFeeUsed.toBigDecimal(), + null + ) ) // insert paid too much fee feeList.add( @@ -607,14 +626,80 @@ class TxFeeRecord(id: EntityID) : IntEntity(id) { BASE_FEE_OVERAGE.name, nhash.id.value, nhash.denom, - baseFeeOverage.toBigDecimal() + baseFeeOverage.toBigDecimal(), + null ) ) - // insert any overage as priority for now - if (priority > 0) - feeList.add( - buildInsert(txInfo, PRIORITY_FEE.name, nhash.id.value, nhash.denom, priority.toBigDecimal()) - ) + // insert any additional msg fees + if (priority > 0) { + // find any msgs that have additional fees + val msgToFee = mutableMapOf>() + var pri = priority + val msgTypes = tx.tx.body.messagesList.groupingBy { it.typeUrl }.eachCount() + val msgFees = + msgFeeClient.getMsgFees().msgFeesList.associate { it.msgTypeUrl to it.additionalFee } + msgFees.filter { msgTypes.keys.contains(it.key) } + .forEach { + val amount = it.value.amount.toLong() * msgTypes[it.key]!! + msgToFee[TxMessageTypeRecord.findByProtoType(it.key)!!.type]?.add(amount) + ?: msgToFee.put( + TxMessageTypeRecord.findByProtoType(it.key)!!.type, + mutableListOf(amount) + ) + pri -= amount + } + // find any events for contract executes that have additional fees + if (msgTypes.keys.contains(getExecuteContractTypeUrl())) { + val indices = tx.tx.body.messagesList.mapIndexed { idx, msg -> idx to msg.typeUrl } + .filter { it.second == getExecuteContractTypeUrl() } + .map { it.first } + val definedEvents = getByDefinedEvent() + tx.txResponse.logsList.filterIndexed { idx, _ -> indices.contains(idx) } + .forEach { log -> + log.eventsList.filter { definedEvents.keys.contains(it.type) } + .forEach { event -> + val defined = definedEvents[event.type]!! + val fee = msgFees[defined.msg]!! + val count = + event.attributesList.filter { it.key == defined.uniqueField }.count() + val amount = fee.amount.toLong() * count + msgToFee[TxMessageTypeRecord.findByProtoType(defined.msg)!!.type] + ?.add(amount) + ?: msgToFee.put( + TxMessageTypeRecord.findByProtoType(defined.msg)!!.type, + mutableListOf(amount) + ) + pri -= amount + } + } + } + // insert additional fees grouped by msg type + msgToFee.forEach { (k, v) -> + feeList.add( + buildInsert( + txInfo, + MSG_BASED_FEE.name, + nhash.id.value, + nhash.denom, + v.sum().toBigDecimal(), + k + ) + ) + } + + // insert the remaining value as priority + if (pri > 0) + feeList.add( + buildInsert( + txInfo, + PRIORITY_FEE.name, + nhash.id.value, + nhash.denom, + pri.toBigDecimal(), + null + ) + ) + } } // Save remaining denoms as MSG_BASED_FEE, only if tx is successful @@ -627,15 +712,28 @@ class TxFeeRecord(id: EntityID) : IntEntity(id) { MSG_BASED_FEE.name, denom.id.value, denom.denom, - it.amount.toBigDecimal() + it.amount.toBigDecimal(), + null // TODO: FOR NOW, NO MSG TYPE APPLIED ) ) } feeList } - private fun buildInsert(txInfo: TxData, type: String, markerId: Int, marker: String, amount: BigDecimal) = - listOf(0, txInfo.blockHeight, 0, txInfo.txHash, type, markerId, marker, amount).toProcedureObject() + private fun buildInsert( + txInfo: TxData, type: String, markerId: Int, marker: String, amount: BigDecimal, msgType: String? + ) = + listOf( + 0, + txInfo.blockHeight, + 0, + txInfo.txHash, + type, + markerId, + marker, + amount, + msgType + ).toProcedureObject() } var blockHeight by TxFeeTable.blockHeight @@ -645,4 +743,5 @@ class TxFeeRecord(id: EntityID) : IntEntity(id) { var markerId by TxFeeTable.markerId var marker by TxFeeTable.marker var amount by TxFeeTable.amount + var msgType by TxFeeTable.msgType } diff --git a/service/src/main/kotlin/io/provenance/explorer/domain/models/explorer/NftModels.kt b/service/src/main/kotlin/io/provenance/explorer/domain/models/explorer/NftModels.kt index d64df8d5..cd316b07 100644 --- a/service/src/main/kotlin/io/provenance/explorer/domain/models/explorer/NftModels.kt +++ b/service/src/main/kotlin/io/provenance/explorer/domain/models/explorer/NftModels.kt @@ -7,6 +7,7 @@ import io.provenance.metadata.v1.Party import io.provenance.metadata.v1.RecordOutput data class ScopeListview( + val scopeUuid: String, val scopeAddr: String, val specName: String?, val specAddr: String, @@ -17,13 +18,15 @@ data class ScopeListview( ) data class ScopeDetail( + val scopeUuid: String, val scopeAddr: String, val specName: String?, val specAddr: String, val description: SpecDescrip?, val owners: List, val dataAccess: List, - val valueOwner: String? + val valueOwner: String?, + val attributes: List ) data class SpecDescrip( diff --git a/service/src/main/kotlin/io/provenance/explorer/domain/models/explorer/ParamModels.kt b/service/src/main/kotlin/io/provenance/explorer/domain/models/explorer/ParamModels.kt index 5c093b92..ea358b9c 100644 --- a/service/src/main/kotlin/io/provenance/explorer/domain/models/explorer/ParamModels.kt +++ b/service/src/main/kotlin/io/provenance/explorer/domain/models/explorer/ParamModels.kt @@ -64,4 +64,5 @@ data class ProvParams( val marker: JsonNode, val metadata: JsonNode, val name: JsonNode, + val msgFees: JsonNode ) diff --git a/service/src/main/kotlin/io/provenance/explorer/domain/models/explorer/TransactionModels.kt b/service/src/main/kotlin/io/provenance/explorer/domain/models/explorer/TransactionModels.kt index 71568ac5..e04638f7 100644 --- a/service/src/main/kotlin/io/provenance/explorer/domain/models/explorer/TransactionModels.kt +++ b/service/src/main/kotlin/io/provenance/explorer/domain/models/explorer/TransactionModels.kt @@ -68,7 +68,9 @@ data class TxDetails( data class TxFeepayer(val type: String, val address: String) -data class TxFee(val type: String, val fees: List) +data class TxFee(val type: String, val fees: List) + +data class FeeCoinStr(val amount: String, val denom: String, val msgType: String?) data class Gas( val gasUsed: Int, diff --git a/service/src/main/kotlin/io/provenance/explorer/grpc/extensions/MsgConverter.kt b/service/src/main/kotlin/io/provenance/explorer/grpc/extensions/MsgConverter.kt index 9c324642..3389d8cb 100644 --- a/service/src/main/kotlin/io/provenance/explorer/grpc/extensions/MsgConverter.kt +++ b/service/src/main/kotlin/io/provenance/explorer/grpc/extensions/MsgConverter.kt @@ -30,6 +30,7 @@ import io.provenance.attribute.v1.MsgDeleteDistinctAttributeRequest import io.provenance.attribute.v1.MsgUpdateAttributeRequest import io.provenance.explorer.domain.core.MetadataAddress import io.provenance.explorer.domain.core.blankToNull +import io.provenance.explorer.domain.core.isMAddress import io.provenance.explorer.domain.core.logger import io.provenance.explorer.domain.core.toMAddress import io.provenance.explorer.domain.core.toMAddressContractSpec @@ -37,8 +38,28 @@ import io.provenance.explorer.domain.core.toMAddressScope import io.provenance.explorer.domain.core.toMAddressScopeSpec import io.provenance.explorer.domain.core.toMAddressSession import io.provenance.explorer.domain.core.toUuidOrNull +import io.provenance.explorer.grpc.extensions.MdEvents.AA +import io.provenance.explorer.grpc.extensions.MdEvents.AD +import io.provenance.explorer.grpc.extensions.MdEvents.ADD +import io.provenance.explorer.grpc.extensions.MdEvents.AU +import io.provenance.explorer.grpc.extensions.MdEvents.CRSC +import io.provenance.explorer.grpc.extensions.MdEvents.CRSD +import io.provenance.explorer.grpc.extensions.MdEvents.CRSU import io.provenance.explorer.grpc.extensions.MdEvents.CSPC +import io.provenance.explorer.grpc.extensions.MdEvents.CSPD import io.provenance.explorer.grpc.extensions.MdEvents.CSPU +import io.provenance.explorer.grpc.extensions.MdEvents.RC +import io.provenance.explorer.grpc.extensions.MdEvents.RD +import io.provenance.explorer.grpc.extensions.MdEvents.RU +import io.provenance.explorer.grpc.extensions.MdEvents.SC +import io.provenance.explorer.grpc.extensions.MdEvents.SD +import io.provenance.explorer.grpc.extensions.MdEvents.SEC +import io.provenance.explorer.grpc.extensions.MdEvents.SED +import io.provenance.explorer.grpc.extensions.MdEvents.SEU +import io.provenance.explorer.grpc.extensions.MdEvents.SSC +import io.provenance.explorer.grpc.extensions.MdEvents.SSD +import io.provenance.explorer.grpc.extensions.MdEvents.SSU +import io.provenance.explorer.grpc.extensions.MdEvents.SU import io.provenance.explorer.service.getDenomByAddress import io.provenance.marker.v1.MsgActivateRequest import io.provenance.marker.v1.MsgAddAccessRequest @@ -89,8 +110,12 @@ fun Any.toMsgVote() = this.unpack(cosmos.gov.v1beta1.Tx.MsgVote::class.java) fun Any.toMsgVoteWeighted() = this.unpack(cosmos.gov.v1beta1.Tx.MsgVoteWeighted::class.java) fun Any.toMsgDeposit() = this.unpack(cosmos.gov.v1beta1.Tx.MsgDeposit::class.java) fun Any.toMsgSetWithdrawAddress() = this.unpack(cosmos.distribution.v1beta1.Tx.MsgSetWithdrawAddress::class.java) -fun Any.toMsgWithdrawDelegatorReward() = this.unpack(cosmos.distribution.v1beta1.Tx.MsgWithdrawDelegatorReward::class.java) -fun Any.toMsgWithdrawValidatorCommission() = this.unpack(cosmos.distribution.v1beta1.Tx.MsgWithdrawValidatorCommission::class.java) +fun Any.toMsgWithdrawDelegatorReward() = + this.unpack(cosmos.distribution.v1beta1.Tx.MsgWithdrawDelegatorReward::class.java) + +fun Any.toMsgWithdrawValidatorCommission() = + this.unpack(cosmos.distribution.v1beta1.Tx.MsgWithdrawValidatorCommission::class.java) + fun Any.toMsgFundCommunityPool() = this.unpack(cosmos.distribution.v1beta1.Tx.MsgFundCommunityPool::class.java) fun Any.toMsgSubmitEvidence() = this.unpack(cosmos.evidence.v1beta1.Tx.MsgSubmitEvidence::class.java) fun Any.toMsgUnjail() = this.unpack(cosmos.slashing.v1beta1.Tx.MsgUnjail::class.java) @@ -151,7 +176,9 @@ fun Any.toMsgDeleteScopeOwnerRequest() = this.unpack(MsgDeleteScopeOwnerRequest: fun Any.toMsgUpdateAttributeRequest() = this.unpack(MsgUpdateAttributeRequest::class.java) fun Any.toMsgDeleteDistinctAttributeRequest() = this.unpack(MsgDeleteDistinctAttributeRequest::class.java) fun Any.toMsgAddContractSpecToScopeSpecRequest() = this.unpack(MsgAddContractSpecToScopeSpecRequest::class.java) -fun Any.toMsgDeleteContractSpecFromScopeSpecRequest() = this.unpack(MsgDeleteContractSpecFromScopeSpecRequest::class.java) +fun Any.toMsgDeleteContractSpecFromScopeSpecRequest() = + this.unpack(MsgDeleteContractSpecFromScopeSpecRequest::class.java) + fun Any.toMsgTransfer() = this.unpack(MsgTransfer::class.java) fun Any.toMsgChannelOpenInit() = this.unpack(MsgChannelOpenInit::class.java) fun Any.toMsgChannelOpenTry() = this.unpack(MsgChannelOpenTry::class.java) @@ -225,12 +252,17 @@ fun Any.getAssociatedAddresses(): List = typeUrl.endsWith("MsgBurnRequest") -> this.toMsgBurnRequest().let { listOf(it.administrator) } typeUrl.endsWith("MsgTransferRequest") -> this.toMsgTransferRequest() .let { listOf(it.administrator, it.toAddress, it.fromAddress) } - typeUrl.endsWith("MsgSetDenomMetadataRequest") -> this.toMsgSetDenomMetadataRequest().let { listOf(it.administrator) } - typeUrl.endsWith("MsgBindNameRequest") -> this.toMsgBindNameRequest().let { listOf(it.parent.address, it.record.address) } + typeUrl.endsWith("MsgSetDenomMetadataRequest") -> this.toMsgSetDenomMetadataRequest() + .let { listOf(it.administrator) } + typeUrl.endsWith("MsgBindNameRequest") -> this.toMsgBindNameRequest() + .let { listOf(it.parent.address, it.record.address) } typeUrl.endsWith("MsgDeleteNameRequest") -> this.toMsgDeleteNameRequest().let { listOf(it.record.address) } - typeUrl.endsWith("MsgAddAttributeRequest") -> this.toMsgAddAttributeRequest().let { listOf(it.account, it.owner) } - typeUrl.endsWith("MsgDeleteAttributeRequest") -> this.toMsgDeleteAttributeRequest().let { listOf(it.account, it.owner) } - typeUrl.endsWith("MsgP8eMemorializeContractRequest") -> this.toMsgP8eMemorializeContractRequest().let { listOf(it.invoker) } + typeUrl.endsWith("MsgAddAttributeRequest") -> this.toMsgAddAttributeRequest() + .let { listOf(it.account, it.owner) } + typeUrl.endsWith("MsgDeleteAttributeRequest") -> this.toMsgDeleteAttributeRequest() + .let { listOf(it.account, it.owner) } + typeUrl.endsWith("MsgP8eMemorializeContractRequest") -> this.toMsgP8eMemorializeContractRequest() + .let { listOf(it.invoker) } typeUrl.endsWith("MsgWriteP8eContractSpecRequest") -> this.toMsgWriteP8eContractSpecRequest().signersList typeUrl.endsWith("MsgWriteScopeRequest") -> this.toMsgWriteScopeRequest() .let { it.signersList + it.scope.ownersList.map { o -> o.address } + listOf(it.scope.valueOwnerAddress) } @@ -249,10 +281,13 @@ fun Any.getAssociatedAddresses(): List = typeUrl.endsWith("MsgWriteRecordSpecificationRequest") -> this.toMsgWriteRecordSpecificationRequest().signersList typeUrl.endsWith("MsgDeleteRecordSpecificationRequest") -> this.toMsgDeleteRecordSpecificationRequest().signersList typeUrl.endsWith("MsgBindOSLocatorRequest") -> this.toMsgBindOSLocatorRequest().let { listOf(it.locator.owner) } - typeUrl.endsWith("MsgDeleteOSLocatorRequest") -> this.toMsgDeleteOSLocatorRequest().let { listOf(it.locator.owner) } - typeUrl.endsWith("MsgModifyOSLocatorRequest") -> this.toMsgModifyOSLocatorRequest().let { listOf(it.locator.owner) } + typeUrl.endsWith("MsgDeleteOSLocatorRequest") -> this.toMsgDeleteOSLocatorRequest() + .let { listOf(it.locator.owner) } + typeUrl.endsWith("MsgModifyOSLocatorRequest") -> this.toMsgModifyOSLocatorRequest() + .let { listOf(it.locator.owner) } typeUrl.endsWith("v1.MsgStoreCode") -> this.toMsgStoreCode().let { listOf(it.sender) } - typeUrl.endsWith("v1.MsgInstantiateContract") -> this.toMsgInstantiateContract().let { listOf(it.sender, it.admin) } + typeUrl.endsWith("v1.MsgInstantiateContract") -> this.toMsgInstantiateContract() + .let { listOf(it.sender, it.admin) } typeUrl.endsWith("v1.MsgExecuteContract") -> this.toMsgExecuteContract().let { listOf(it.sender) } typeUrl.endsWith("v1.MsgMigrateContract") -> this.toMsgMigrateContract().let { listOf(it.sender) } typeUrl.endsWith("v1.MsgUpdateAdmin") -> this.toMsgUpdateAdmin().let { listOf(it.sender, it.newAdmin) } @@ -332,8 +367,10 @@ fun Any.getAssociatedDenoms(): List = .let { it.account.getDenomByAddress()?.let { denom -> listOf(denom) } ?: listOf() } typeUrl.endsWith("MsgDeleteAttributeRequest") -> this.toMsgDeleteAttributeRequest() .let { it.account.getDenomByAddress()?.let { denom -> listOf(denom) } ?: listOf() } - typeUrl.endsWith("v1.MsgInstantiateContract") -> this.toMsgInstantiateContract().let { it.fundsList.map { c -> c.denom } } - typeUrl.endsWith("v1.MsgExecuteContract") -> this.toMsgExecuteContract().let { it.fundsList.map { c -> c.denom } } + typeUrl.endsWith("v1.MsgInstantiateContract") -> this.toMsgInstantiateContract() + .let { it.fundsList.map { c -> c.denom } } + typeUrl.endsWith("v1.MsgExecuteContract") -> this.toMsgExecuteContract() + .let { it.fundsList.map { c -> c.denom } } typeUrl.endsWith("v1beta1.MsgInstantiateContract") -> this.toMsgInstantiateContractOld() .let { it.fundsList.map { c -> c.denom } } typeUrl.endsWith("v1beta1.MsgExecuteContract") -> this.toMsgExecuteContractOld() @@ -379,7 +416,31 @@ fun Any.getIbcLedgerMsgs() = enum class MdEvents(val event: String, val idField: String) { // Contract Spec CSPC("provenance.metadata.v1.EventContractSpecificationCreated", "contract_specification_addr"), - CSPU("provenance.metadata.v1.EventContractSpecificationUpdated", "contract_specification_addr") + CSPU("provenance.metadata.v1.EventContractSpecificationUpdated", "contract_specification_addr"), + CSPD("provenance.metadata.v1.EventContractSpecificationDeleted", "contract_specification_addr"), + CRSC("provenance.metadata.v1.EventRecordSpecificationCreated", "contract_specification_addr"), + CRSU("provenance.metadata.v1.EventRecordSpecificationUpdated", "contract_specification_addr"), + CRSD("provenance.metadata.v1.EventRecordSpecificationDeleted", "contract_specification_addr"), + + // Scope + SC("provenance.metadata.v1.EventScopeCreated", "scope_addr"), + SU("provenance.metadata.v1.EventScopeUpdated", "scope_addr"), + SD("provenance.metadata.v1.EventScopeDeleted", "scope_addr"), + AA("provenance.attribute.v1.EventAttributeAdd", "account"), + AU("provenance.attribute.v1.EventAttributeUpdate", "account"), + AD("provenance.attribute.v1.EventAttributeDelete", "account"), + ADD("provenance.attribute.v1.EventAttributeDistinctDelete", "account"), + SEC("provenance.metadata.v1.EventSessionCreated", "scope_addr"), + SEU("provenance.metadata.v1.EventSessionUpdated", "scope_addr"), + SED("provenance.metadata.v1.EventSessionDeleted", "scope_addr"), + RC("provenance.metadata.v1.EventRecordCreated", "scope_addr"), + RU("provenance.metadata.v1.EventRecordUpdated", "scope_addr"), + RD("provenance.metadata.v1.EventRecordDeleted", "scope_addr"), + + // Scope Spec + SSC("provenance.metadata.v1.EventScopeSpecificationCreated", "scope_specification_addr"), + SSU("provenance.metadata.v1.EventScopeSpecificationUpdated", "scope_specification_addr"), + SSD("provenance.metadata.v1.EventScopeSpecificationDeleted", "scope_specification_addr"), } fun Any.isMetadataDeletionMsg() = @@ -393,6 +454,11 @@ fun Any.isMetadataDeletionMsg() = fun Any.getAssociatedMetadataEvents() = when { typeUrl.endsWith("MsgWriteP8eContractSpecRequest") -> listOf(CSPC, CSPU) + typeUrl.endsWith("v1beta1.MsgExecuteContract") + || typeUrl.endsWith("v1.MsgExecuteContract") -> listOf( + AA, AU, AD, ADD, SC, SU, SD, SEC, SEU, SED, RC, + RU, RD, CSPC, CSPU, CSPD, CRSC, CRSU, CRSD, SSC, SSU, SSD + ) else -> listOf() .also { logger().debug("This typeUrl is not yet supported in as an metadata-event-based msg: $typeUrl") } } @@ -402,34 +468,61 @@ fun MetadataAddress.toList() = listOf(this) fun Any.getAssociatedMetadata() = when { typeUrl.endsWith("MsgWriteScopeRequest") -> this.toMsgWriteScopeRequest() - .let { (it.scopeUuid?.blankToNull()?.toMAddressScope() ?: it.scope.scopeId?.toMAddress())?.toList() ?: listOf(null) } + .let { + (it.scopeUuid?.blankToNull()?.toMAddressScope() ?: it.scope.scopeId?.toMAddress())?.toList() ?: listOf( + null + ) + } typeUrl.endsWith("MsgDeleteScopeRequest") -> this.toMsgDeleteScopeRequest().scopeId.toMAddress().toList() - typeUrl.endsWith("MsgAddScopeDataAccessRequest") -> this.toMsgAddScopeDataAccessRequest().scopeId.toMAddress().toList() - typeUrl.endsWith("MsgDeleteScopeDataAccessRequest") -> this.toMsgDeleteScopeDataAccessRequest().scopeId.toMAddress().toList() + typeUrl.endsWith("MsgAddScopeDataAccessRequest") -> this.toMsgAddScopeDataAccessRequest().scopeId.toMAddress() + .toList() + typeUrl.endsWith("MsgDeleteScopeDataAccessRequest") -> this.toMsgDeleteScopeDataAccessRequest().scopeId.toMAddress() + .toList() typeUrl.endsWith("MsgAddScopeOwnerRequest") -> this.toMsgAddScopeOwnerRequest().scopeId.toMAddress().toList() - typeUrl.endsWith("MsgDeleteScopeOwnerRequest") -> this.toMsgDeleteScopeOwnerRequest().scopeId.toMAddress().toList() + typeUrl.endsWith("MsgDeleteScopeOwnerRequest") -> this.toMsgDeleteScopeOwnerRequest().scopeId.toMAddress() + .toList() typeUrl.endsWith("MsgWriteSessionRequest") -> this.toMsgWriteSessionRequest() .let { it.sessionIdComponents.toMAddress() ?: it.session.sessionId.toMAddress() }.toList() typeUrl.endsWith("MsgWriteRecordRequest") -> this.toMsgWriteRecordRequest() .let { it.sessionIdComponents.toMAddress() ?: it.record.sessionId.toMAddress() }.toList() typeUrl.endsWith("MsgDeleteRecordRequest") -> this.toMsgDeleteRecordRequest().recordId.toMAddress().toList() typeUrl.endsWith("MsgWriteScopeSpecificationRequest") -> this.toMsgWriteScopeSpecificationRequest() - .let { (it.specUuid?.blankToNull()?.toMAddressScopeSpec() ?: it.specification.specificationId?.toMAddress())?.toList() ?: listOf(null) } + .let { + (it.specUuid?.blankToNull()?.toMAddressScopeSpec() + ?: it.specification.specificationId?.toMAddress())?.toList() ?: listOf(null) + } typeUrl.endsWith("MsgDeleteScopeSpecificationRequest") -> this.toMsgDeleteScopeSpecificationRequest().specificationId.toMAddress().toList() typeUrl.endsWith("MsgWriteContractSpecificationRequest") -> this.toMsgWriteContractSpecificationRequest() - .let { (it.specUuid?.blankToNull()?.toMAddressContractSpec() ?: it.specification.specificationId?.toMAddress())?.toList() ?: listOf(null) } + .let { + (it.specUuid?.blankToNull()?.toMAddressContractSpec() + ?: it.specification.specificationId?.toMAddress())?.toList() ?: listOf(null) + } typeUrl.endsWith("MsgDeleteContractSpecificationRequest") -> this.toMsgDeleteContractSpecificationRequest().specificationId.toMAddress().toList() typeUrl.endsWith("MsgWriteRecordSpecificationRequest") -> this.toMsgWriteRecordSpecificationRequest() - .let { (it.contractSpecUuid?.blankToNull()?.toMAddressContractSpec() ?: it.specification.specificationId?.toMAddress())?.toList() ?: listOf(null) } + .let { + (it.contractSpecUuid?.blankToNull()?.toMAddressContractSpec() + ?: it.specification.specificationId?.toMAddress())?.toList() ?: listOf(null) + } typeUrl.endsWith("MsgDeleteRecordSpecificationRequest") -> this.toMsgDeleteRecordSpecificationRequest().specificationId.toMAddress().toList() - typeUrl.endsWith("MsgP8eMemorializeContractRequest") -> this.toMsgP8eMemorializeContractRequest().scopeId.toMAddressScope().toList() + typeUrl.endsWith("MsgP8eMemorializeContractRequest") -> this.toMsgP8eMemorializeContractRequest().scopeId.toMAddressScope() + .toList() typeUrl.endsWith("MsgAddContractSpecToScopeSpecRequest") -> - this.toMsgAddContractSpecToScopeSpecRequest().let { listOf(it.contractSpecificationId.toMAddress(), it.scopeSpecificationId.toMAddress()) } + this.toMsgAddContractSpecToScopeSpecRequest() + .let { listOf(it.contractSpecificationId.toMAddress(), it.scopeSpecificationId.toMAddress()) } typeUrl.endsWith("MsgDeleteContractSpecFromScopeSpecRequest") -> - this.toMsgDeleteContractSpecFromScopeSpecRequest().let { listOf(it.contractSpecificationId.toMAddress(), it.scopeSpecificationId.toMAddress()) } + this.toMsgDeleteContractSpecFromScopeSpecRequest() + .let { listOf(it.contractSpecificationId.toMAddress(), it.scopeSpecificationId.toMAddress()) } + typeUrl.endsWith("MsgAddAttributeRequest") -> this.toMsgAddAttributeRequest() + .let { if (it.account.isMAddress()) it.account.toMAddress().toList() else listOf(null) } + typeUrl.endsWith("MsgDeleteAttributeRequest") -> this.toMsgDeleteAttributeRequest() + .let { if (it.account.isMAddress()) it.account.toMAddress().toList() else listOf(null) } + typeUrl.endsWith("MsgUpdateAttributeRequest") -> this.toMsgUpdateAttributeRequest() + .let { if (it.account.isMAddress()) it.account.toMAddress().toList() else listOf(null) } + typeUrl.endsWith("MsgDeleteDistinctAttributeRequest") -> this.toMsgDeleteDistinctAttributeRequest() + .let { if (it.account.isMAddress()) it.account.toMAddress().toList() else listOf(null) } else -> listOf(null) .also { logger().debug("This typeUrl is not yet supported in as an metadata-based msg: $typeUrl") } } @@ -488,7 +581,10 @@ enum class SmContractValue { CODE, CONTRACT } enum class SmContractEventKeys(val eventType: String, val eventKey: Map) { V1BETA1("message", mapOf("code_id" to SmContractValue.CODE, "contract_address" to SmContractValue.CONTRACT)), STORE_CODE_V1("store_code", mapOf("code_id" to SmContractValue.CODE)), - INSTANTIATE_V1("instantiate", mapOf("_contract_address" to SmContractValue.CONTRACT, "code_id" to SmContractValue.CODE)), + INSTANTIATE_V1( + "instantiate", + mapOf("_contract_address" to SmContractValue.CONTRACT, "code_id" to SmContractValue.CODE) + ), EXECUTE_V1("execute", mapOf("_contract_address" to SmContractValue.CONTRACT)) } @@ -503,8 +599,11 @@ enum class DenomEvents(val event: String, val idField: String, val parse: Boolea MARKER_WITHDRAW("provenance.marker.v1.EventMarkerWithdraw", "denom"), MARKER_ACTIVATE("provenance.marker.v1.EventMarkerActivate", "denom"), MARKER_ADD_ACCESS("provenance.marker.v1.EventMarkerAddAccess", "denom"), + MARKER_DELETE_ACCESS("provenance.marker.v1.EventMarkerDeleteAccess", "denom"), MARKER_FINALIZE("provenance.marker.v1.EventMarkerFinalize", "denom"), + MARKER_CANCEL("provenance.marker.v1.EventMarkerCancel", "denom"), MARKER_BURN("provenance.marker.v1.EventMarkerBurn", "denom"), + MARKER_DELETE("provenance.marker.v1.EventMarkerDelete", "denom"), IBC_ACKNOWLEDGE("fungible_token_packet", "denom"), IBC_RECV_PACKET("denomination_trace", "denom"), } @@ -524,15 +623,54 @@ enum class AddressEvents(val event: String, vararg val idField: String) { MARKER_WITHDRAW("provenance.marker.v1.EventMarkerWithdraw", "administrator", "to_address"), MARKER_ACTIVATE("provenance.marker.v1.EventMarkerActivate", "administrator"), MARKER_ADD_ACCESS("provenance.marker.v1.EventMarkerAddAccess", "administrator"), + MARKER_DELETE_ACCESS("provenance.marker.v1.EventMarkerDeleteAccess", "administrator", "remove_address"), MARKER_FINALIZE("provenance.marker.v1.EventMarkerFinalize", "administrator"), + MARKER_CANCEL("provenance.marker.v1.EventMarkerCancel", "administrator"), MARKER_BURN("provenance.marker.v1.EventMarkerBurn", "administrator"), + MARKER_DELETE("provenance.marker.v1.EventMarkerDelete", "administrator"), IBC_RECV_PACKET("fungible_token_packet", "receiver"), NAME_BOUND("provenance.name.v1.EventNameBound", "address"), NAME_BOUND_OLD("name_bound", "address"), GRANT("cosmos.authz.v1beta1.EventGrant", "granter", "grantee"), REVOKE("cosmos.authz.v1beta1.EventRevoke", "granter", "grantee"), + ATTRIBUTE_ADD("provenance.attribute.v1.EventAttributeAdd", "account", "owner"), + ATTRIBUTE_UPDATE("provenance.attribute.v1.EventAttributeUpdate", "account", "owner"), + ATTRIBUTE_DELETE("provenance.attribute.v1.EventAttributeDelete", "account", "owner"), + ATTRIBUTE_DISTINCT_DELETE("provenance.attribute.v1.EventAttributeDistinctDelete", "account", "owner") } fun getAddressEventByEvent(event: String) = AddressEvents.values().firstOrNull { it.event == event } fun String.scrubQuotes() = this.removeSurrounding("\"") + +// ///////// MSG TO DEFINED EVENT +// This links a msg type to a specific event it always emits. Helps to identify actions within an ExecuteContract msg +enum class MsgToDefinedEvent(val msg: String, val definedEvent: String, val uniqueField: String) { + ATTRIBUTE_ADD( + "/provenance.attribute.v1.MsgAddAttributeRequest", + "provenance.attribute.v1.EventAttributeAdd", + "account" + ), + SCOPE_WRITE( + "/provenance.metadata.v1.MsgWriteScopeRequest", + "provenance.metadata.v1.EventScopeCreated", + "scope_addr" + ), + SCOPE_UPDATED( + "/provenance.metadata.v1.MsgWriteScopeRequest", + "provenance.metadata.v1.EventScopeUpdated", + "scope_addr" + ), + NAME_BIND("/provenance.name.v1.MsgBindNameRequest", "provenance.name.v1.EventNameBound", "address"), + PROPOSAL_SUBMIT("/cosmos.gov.v1beta1.MsgSubmitProposal", "submit_proposal", "proposal_id"), + MARKER_ADD("/provenance.marker.v1.MsgAddMarkerRequest", "provenance.marker.v1.EventMarkerAdd", "denom") +} + +fun getDefinedEventsByMsg(msg: String) = MsgToDefinedEvent.values().firstOrNull { it.msg == msg } +fun getDefinedEventsByEvent(event: String) = MsgToDefinedEvent.values().firstOrNull { it.definedEvent == event } +fun getByDefinedEvent() = MsgToDefinedEvent.values().associateBy { it.definedEvent } + +fun getExecuteContractTypeUrl() = + Any.pack(cosmwasm.wasm.v1.Tx.MsgExecuteContract.getDefaultInstance()).typeUrl + .split("/")[1] + .let { "/$it" } diff --git a/service/src/main/kotlin/io/provenance/explorer/grpc/v1/MsgFeeGrpcClient.kt b/service/src/main/kotlin/io/provenance/explorer/grpc/v1/MsgFeeGrpcClient.kt new file mode 100644 index 00000000..c636fcff --- /dev/null +++ b/service/src/main/kotlin/io/provenance/explorer/grpc/v1/MsgFeeGrpcClient.kt @@ -0,0 +1,48 @@ +package io.provenance.explorer.grpc.v1 + +import io.grpc.ManagedChannelBuilder +import io.provenance.explorer.config.GrpcLoggingInterceptor +import io.provenance.explorer.grpc.extensions.getPagination +import io.provenance.msgfees.v1.QueryGrpcKt +import io.provenance.msgfees.v1.queryAllMsgFeesRequest +import kotlinx.coroutines.runBlocking +import org.springframework.stereotype.Component +import java.net.URI +import java.util.concurrent.TimeUnit + +@Component +class MsgFeeGrpcClient(channelUri: URI) { + + private val msgFeeClient: QueryGrpcKt.QueryCoroutineStub + + init { + val channel = + ManagedChannelBuilder.forAddress(channelUri.host, channelUri.port) + .also { + if (channelUri.scheme == "grpcs") { + it.useTransportSecurity() + } else { + it.usePlaintext() + } + } + .idleTimeout(60, TimeUnit.SECONDS) + .keepAliveTime(10, TimeUnit.SECONDS) + .keepAliveTimeout(10, TimeUnit.SECONDS) + .intercept(GrpcLoggingInterceptor()) + .build() + + msgFeeClient = QueryGrpcKt.QueryCoroutineStub(channel) + } + + fun getMsgFees(offset: Int = 0, limit: Int = 100) = runBlocking { + msgFeeClient.queryAllMsgFees( + queryAllMsgFeesRequest { + this.pagination = getPagination(offset, limit) + } + ) + } + + suspend fun getMsgFeeParams() = msgFeeClient.params(io.provenance.msgfees.v1.queryParamsRequest { }) + + fun getFloorGasPrice() = runBlocking { getMsgFeeParams().params.floorGasPrice.amount.toLong() } +} diff --git a/service/src/main/kotlin/io/provenance/explorer/service/ExplorerService.kt b/service/src/main/kotlin/io/provenance/explorer/service/ExplorerService.kt index 6067273f..ccac0b83 100644 --- a/service/src/main/kotlin/io/provenance/explorer/service/ExplorerService.kt +++ b/service/src/main/kotlin/io/provenance/explorer/service/ExplorerService.kt @@ -58,6 +58,7 @@ import io.provenance.explorer.grpc.v1.GovGrpcClient import io.provenance.explorer.grpc.v1.IbcGrpcClient import io.provenance.explorer.grpc.v1.MarkerGrpcClient import io.provenance.explorer.grpc.v1.MetadataGrpcClient +import io.provenance.explorer.grpc.v1.MsgFeeGrpcClient import io.provenance.explorer.grpc.v1.ValidatorGrpcClient import io.provenance.explorer.service.async.AsyncCachingV2 import kotlinx.coroutines.Dispatchers @@ -85,6 +86,7 @@ class ExplorerService( private val attrClient: AttributeGrpcClient, private val metadataClient: MetadataGrpcClient, private val markerClient: MarkerGrpcClient, + private val msgFeeClient: MsgFeeGrpcClient, private val validatorClient: ValidatorGrpcClient, private val protoPrinter: JsonFormat.Printer ) { @@ -286,6 +288,7 @@ class ExplorerService( val markerParams = markerClient.getMarkerParams().params val metadataParams = metadataClient.getMetadataParams().params val nameParams = attrClient.getNameParams().params + val msgParams = async { msgFeeClient.getMsgFeeParams().params } Params( CosmosParams( @@ -311,6 +314,7 @@ class ExplorerService( markerParams.toObjectNodePrint(protoPrinter), metadataParams.toObjectNodePrint(protoPrinter), nameParams.toObjectNodePrint(protoPrinter), + msgParams.await().toObjectNodePrint(protoPrinter) ), ) } diff --git a/service/src/main/kotlin/io/provenance/explorer/service/NftService.kt b/service/src/main/kotlin/io/provenance/explorer/service/NftService.kt index 0de68979..789f43be 100644 --- a/service/src/main/kotlin/io/provenance/explorer/service/NftService.kt +++ b/service/src/main/kotlin/io/provenance/explorer/service/NftService.kt @@ -29,7 +29,9 @@ import io.provenance.explorer.domain.models.explorer.ScopeRecord import io.provenance.explorer.domain.models.explorer.toDataObject import io.provenance.explorer.domain.models.explorer.toOwnerRoles import io.provenance.explorer.domain.models.explorer.toSpecDescrip +import io.provenance.explorer.grpc.v1.AttributeGrpcClient import io.provenance.explorer.grpc.v1.MetadataGrpcClient +import kotlinx.coroutines.async import kotlinx.coroutines.flow.asFlow import kotlinx.coroutines.flow.flatMapMerge import kotlinx.coroutines.flow.map @@ -41,6 +43,7 @@ import org.springframework.stereotype.Service @Service class NftService( private val metadataClient: MetadataGrpcClient, + private val attrClient: AttributeGrpcClient, private val protoPrinter: JsonFormat.Printer ) { @@ -59,6 +62,7 @@ class NftService( metadataClient.getScopeById(addr).let { val lastTx = TxNftJoinRecord.findTxByUuid(it.scope.scopeIdInfo.scopeUuid, 0, 1).firstOrNull() ScopeListview( + it.scope.scopeIdInfo.scopeUuid, it.scope.scopeIdInfo.scopeAddr, getScopeDescrip(it.scope.scopeSpecIdInfo.scopeSpecAddr)?.name, it.scope.scopeSpecIdInfo.scopeSpecAddr, @@ -73,14 +77,17 @@ class NftService( fun getScopeDetail(addr: String) = runBlocking { metadataClient.getScopeById(addr).let { val spec = getScopeDescrip(it.scope.scopeSpecIdInfo.scopeSpecAddr) + val attributes = async { attrClient.getAllAttributesForAddress(it.scope.scopeIdInfo.scopeAddr) } ScopeDetail( + it.scope.scopeIdInfo.scopeUuid, it.scope.scopeIdInfo.scopeAddr, spec?.name, it.scope.scopeSpecIdInfo.scopeSpecAddr, spec?.toSpecDescrip(), it.scope.scope.ownersList.toOwnerRoles(), it.scope.scope.dataAccessList, - it.scope.scope.valueOwnerAddress + it.scope.scope.valueOwnerAddress, + attributes.await().map { attr -> attr.toResponse() } ) } } @@ -90,7 +97,7 @@ class NftService( val scope = metadataClient.getScopeById(addr, true, true) // get scope spec -> contract specs val scopeSpec = metadataClient.getScopeSpecById(scope.scope.scopeSpecIdInfo.scopeSpecAddr) - val contractSpecs = scopeSpec.scopeSpecification.specification.contractSpecIdsList.map { it.toMAddress() } + val contractSpecs = scopeSpec.scopeSpecification.specification.contractSpecIdsList.map { it.toMAddress() }.toSet() // get record specs for each contract spec val recordSpecs = contractSpecs.asFlow() .flatMapMerge { cs -> metadataClient.getRecordSpecsForContractSpec(cs.toString()).recordSpecificationsList.asFlow() } diff --git a/service/src/main/kotlin/io/provenance/explorer/service/async/AsyncCachingV2.kt b/service/src/main/kotlin/io/provenance/explorer/service/async/AsyncCachingV2.kt index 0e4a85c5..6a8fb64e 100644 --- a/service/src/main/kotlin/io/provenance/explorer/service/async/AsyncCachingV2.kt +++ b/service/src/main/kotlin/io/provenance/explorer/service/async/AsyncCachingV2.kt @@ -8,6 +8,7 @@ import cosmos.base.tendermint.v1beta1.Query import cosmos.tx.v1beta1.ServiceOuterClass import cosmos.tx.v1beta1.TxOuterClass import io.provenance.explorer.config.ExplorerProperties +import io.provenance.explorer.domain.core.isMAddress import io.provenance.explorer.domain.core.logger import io.provenance.explorer.domain.core.sql.toArray import io.provenance.explorer.domain.core.sql.toObject @@ -77,6 +78,7 @@ import io.provenance.explorer.grpc.extensions.toMsgSubmitProposal import io.provenance.explorer.grpc.extensions.toMsgTimeoutOnClose import io.provenance.explorer.grpc.extensions.toMsgTransfer import io.provenance.explorer.grpc.extensions.toMsgVote +import io.provenance.explorer.grpc.v1.MsgFeeGrpcClient import io.provenance.explorer.grpc.v1.TransactionGrpcClient import io.provenance.explorer.service.AccountService import io.provenance.explorer.service.AssetService @@ -96,6 +98,7 @@ import java.math.BigInteger @Service class AsyncCachingV2( private val txClient: TransactionGrpcClient, + private val msgFeeClient: MsgFeeGrpcClient, private val blockService: BlockService, private val validatorService: ValidatorService, private val accountService: AccountService, @@ -112,18 +115,18 @@ class AsyncCachingV2( protected var chainId: String = "" fun getChainIdString() = - if (chainId.isEmpty()) getBlock(blockService.getLatestBlockHeightIndex())!!.block.header.chainId.also { - this.chainId = it - } + if (chainId.isEmpty()) + getBlock(blockService.getLatestBlockHeightIndex())!!.block.header.chainId.also { this.chainId = it } else this.chainId fun getBlock(blockHeight: Int) = transaction { - BlockCacheRecord.findById(blockHeight)?.also { - BlockCacheRecord.updateHitCount(blockHeight) - }?.block + BlockCacheRecord.findById(blockHeight)?.also { BlockCacheRecord.updateHitCount(blockHeight) }?.block } ?: saveBlockEtc(blockService.getBlockAtHeightFromChain(blockHeight)) - fun saveBlockEtc(blockRes: Query.GetBlockByHeightResponse?): Query.GetBlockByHeightResponse? { + fun saveBlockEtc( + blockRes: Query.GetBlockByHeightResponse?, + rerunTxs: Boolean = false + ): Query.GetBlockByHeightResponse? { if (blockRes == null) return null logger.info("saving block ${blockRes.block.height()}") val blockTimestamp = blockRes.block.header.time.toDateTime() @@ -137,8 +140,13 @@ class AsyncCachingV2( val proposerRec = validatorService.buildProposerInsert(blockRes, blockTimestamp, blockRes.block.height()) val valsAtHeight = validatorService.buildValidatorsAtHeight(blockRes.block.height()) validatorService.saveMissedBlocks(blockRes) - val txs = if (blockRes.block.data.txsCount > 0) saveTxs(blockRes, proposerRec).map { it.toProcedureObject() } - else listOf() + val txs = + if (blockRes.block.data.txsCount > 0) saveTxs( + blockRes, + proposerRec, + rerunTxs + ).map { it.toProcedureObject() } + else listOf() val blockUpdate = BlockUpdate(block, proposerRec.buildInsert(), valsAtHeight, txs) try { BlockCacheRecord.insertToProcedure(blockUpdate) @@ -155,13 +163,18 @@ class AsyncCachingV2( val txUpdate: TxUpdate ) - fun saveTxs(blockRes: Query.GetBlockByHeightResponse, proposerRec: BlockProposer): List { + fun saveTxs( + blockRes: Query.GetBlockByHeightResponse, + proposerRec: BlockProposer, + rerunTxs: Boolean = false + ): List { val toBeUpdated = addTxsToCache( blockRes.block.height(), blockRes.block.data.txsCount, blockRes.block.header.time, - proposerRec + proposerRec, + rerunTxs ) toBeUpdated.flatMap { it.markers }.toSet().let { assetService.updateAssets(it, blockRes.block.header.time) } toBeUpdated.flatMap { it.addresses.entries } @@ -182,8 +195,14 @@ class AsyncCachingV2( private fun txCountForHeight(blockHeight: Int) = transaction { TxCacheRecord.findByHeight(blockHeight).count() } - fun addTxsToCache(blockHeight: Int, expectedNumTxs: Int, blockTime: Timestamp, proposerRec: BlockProposer) = - if (txCountForHeight(blockHeight).toInt() == expectedNumTxs) + fun addTxsToCache( + blockHeight: Int, + expectedNumTxs: Int, + blockTime: Timestamp, + proposerRec: BlockProposer, + rerunTxs: Boolean = false + ) = + if (txCountForHeight(blockHeight).toInt() == expectedNumTxs && !rerunTxs) logger.info("Cache hit for transaction at height $blockHeight with $expectedNumTxs transactions") .let { listOf() } else { @@ -230,8 +249,8 @@ class AsyncCachingV2( val tx = TxCacheRecord.buildInsert(res, blockTime) val txUpdate = TxUpdate(tx) val txInfo = TxData(res.txResponse.height.toInt(), null, res.txResponse.txhash, blockTime) - saveTxGasFees(res, txInfo, txUpdate) saveMessages(txInfo, res, txUpdate) + saveTxGasFees(res, txInfo, txUpdate) val addrs = saveAddresses(txInfo, res, txUpdate) val markers = saveMarkers(txInfo, res, txUpdate) saveNftData(txInfo, res, txUpdate) @@ -267,8 +286,8 @@ class AsyncCachingV2( private fun saveTxGasFees(tx: ServiceOuterClass.GetTxResponse, txInfo: TxData, txUpdate: TxUpdate) = txUpdate.apply { - this.txGasFee = TxGasCacheRecord.buildInsert(tx, txInfo.txTimestamp) - this.txFees.addAll(TxFeeRecord.buildInserts(txInfo, tx, assetService)) + this.txGasFee = TxGasCacheRecord.buildInsert(tx, txInfo.txTimestamp, msgFeeClient.getFloorGasPrice()) + this.txFees.addAll(TxFeeRecord.buildInserts(txInfo, tx, assetService, msgFeeClient)) } fun saveMessages(txInfo: TxData, tx: ServiceOuterClass.GetTxResponse, txUpdate: TxUpdate) = transaction { @@ -317,13 +336,13 @@ class AsyncCachingV2( (msgAddrs + eventAddrs).toSet() .filter { it.isNotEmpty() } - .map { saveAddr(it, txInfo, txUpdate) } + .mapNotNull { saveAddr(it, txInfo, txUpdate) } .filter { it.second != null }.groupBy({ it.first }) { it.second!! } } - private fun saveAddr(addr: String, txInfo: TxData, txUpdate: TxUpdate): Pair { - val addrPair = addr.getAddressType(props) - var pairCopy = addrPair!!.copy() + private fun saveAddr(addr: String, txInfo: TxData, txUpdate: TxUpdate): Pair? { + val addrPair = addr.getAddressType(props) ?: return null + var pairCopy = addrPair.copy() if (addrPair.second == null) { try { when (addrPair.first) { @@ -389,6 +408,7 @@ class AsyncCachingV2( .filter { a -> a.key in me.map { m -> m.idField } } .map { jacksonObjectMapper().readValue(it.value, String::class.java) } } + .filter { it.isMAddress() } .map { addr -> addr.toMAddress() } // Save the nft addresses diff --git a/service/src/main/kotlin/io/provenance/explorer/service/utility/MigrationService.kt b/service/src/main/kotlin/io/provenance/explorer/service/utility/MigrationService.kt index 813a11ee..b7a2fe3a 100644 --- a/service/src/main/kotlin/io/provenance/explorer/service/utility/MigrationService.kt +++ b/service/src/main/kotlin/io/provenance/explorer/service/utility/MigrationService.kt @@ -33,6 +33,22 @@ class MigrationService( list.forEach { accountService.saveAccount(it) } } + fun updateBlocks(startHeight: Int, endHeight: Int, inc: Int) { + logger.info("Start height: $startHeight") + var start = startHeight + while (start <= endHeight) { + transaction { + logger.info("Fetching $start to ${start + inc - 1}") + BlockCacheRecord.find { BlockCacheTable.id.between(start, start + inc - 1) } + .orderBy(Pair(BlockCacheTable.id, SortOrder.ASC)).forEach { + asyncCaching.saveBlockEtc(it.block, true) + } + } + start += inc + } + logger.info("End height: $endHeight") + } + fun updateMissedBlocks(startHeight: Int, endHeight: Int, inc: Int) { logger.info("Start height: $startHeight") var start = startHeight diff --git a/service/src/main/kotlin/io/provenance/explorer/web/v2/utility/MigrationController.kt b/service/src/main/kotlin/io/provenance/explorer/web/v2/utility/MigrationController.kt index 109b4129..bddf2490 100644 --- a/service/src/main/kotlin/io/provenance/explorer/web/v2/utility/MigrationController.kt +++ b/service/src/main/kotlin/io/provenance/explorer/web/v2/utility/MigrationController.kt @@ -45,4 +45,9 @@ class MigrationController(private val migrationService: MigrationService) { @GetMapping("/update/blocks/missed") fun updateMissedBlocks(@RequestParam start: Int, @RequestParam end: Int, @RequestParam inc: Int) = ResponseEntity.ok(migrationService.updateMissedBlocks(start, end, inc)) + + @ApiOperation("Updates blocks") + @GetMapping("/update/blocks") + fun updateBlocks(@RequestParam start: Int, @RequestParam end: Int, @RequestParam inc: Int) = + ResponseEntity.ok(migrationService.updateBlocks(start, end, inc)) } diff --git a/settings.gradle.kts b/settings.gradle.kts index 26192493..39416d4d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,7 +1,6 @@ rootProject.name = "explorer-service" include("database") include("service") -include("proto") pluginManagement { repositories { diff --git a/third_party/proto/confio/proofs.proto b/third_party/proto/confio/proofs.proto deleted file mode 100644 index da43503e..00000000 --- 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 72e1d9ec..00000000 --- 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 c88b94ee..00000000 --- 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 76d30dd6..00000000 --- a/third_party/proto/cosmos/auth/v1beta1/query.proto +++ /dev/null @@ -1,68 +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 - 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. -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. -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 c69a93c1..00000000 --- a/third_party/proto/cosmos/authz/v1beta1/authz.proto +++ /dev/null @@ -1,26 +0,0 @@ -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 c77cea3e..00000000 --- a/third_party/proto/cosmos/authz/v1beta1/event.proto +++ /dev/null @@ -1,24 +0,0 @@ -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 411fd276..00000000 --- a/third_party/proto/cosmos/authz/v1beta1/genesis.proto +++ /dev/null @@ -1,23 +0,0 @@ -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 3b66e031..00000000 --- a/third_party/proto/cosmos/authz/v1beta1/query.proto +++ /dev/null @@ -1,34 +0,0 @@ -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 dd68984e..00000000 --- a/third_party/proto/cosmos/authz/v1beta1/tx.proto +++ /dev/null @@ -1,69 +0,0 @@ -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 f3505ad4..00000000 --- a/third_party/proto/cosmos/bank/v1beta1/authz.proto +++ /dev/null @@ -1,17 +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. -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 eb843b2c..00000000 --- a/third_party/proto/cosmos/bank/v1beta1/bank.proto +++ /dev/null @@ -1,92 +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) - string name = 5; - // symbol is the token symbol usually shown on exchanges (eg: ATOM). This can - // be the same as the display. - 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 8fd7329a..00000000 --- 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 e3a464f8..00000000 --- a/third_party/proto/cosmos/bank/v1beta1/query.proto +++ /dev/null @@ -1,159 +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}/{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. - 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. - 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 26b2ab41..00000000 --- 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 72da2aac..00000000 --- a/third_party/proto/cosmos/base/abci/v1beta1/abci.proto +++ /dev/null @@ -1,137 +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; -} - -// 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 4e9b8d28..00000000 --- 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/query/v1beta1/pagination.proto b/third_party/proto/cosmos/base/query/v1beta1/pagination.proto deleted file mode 100644 index 784c4795..00000000 --- a/third_party/proto/cosmos/base/query/v1beta1/pagination.proto +++ /dev/null @@ -1,53 +0,0 @@ -syntax = "proto3"; -package cosmos.base.query.v1beta1; - -option go_package = "github.com/cosmos/cosmos-sdk/types/query"; - -// PageRequest is to be embedded in gRPC request messages for efficient -// pagination. Ex: -// -// message SomeRequest { -// Foo some_parameter = 1; -// PageRequest pagination = 2; -// } -message PageRequest { - // key is a value returned in PageResponse.next_key to begin - // querying the next page most efficiently. Only one of offset or key - // should be set. - bytes key = 1; - - // offset is a numeric offset that can be used when key is unavailable. - // It is less efficient than using key. Only one of offset or key should - // be set. - uint64 offset = 2; - - // limit is the total number of results to be returned in the result page. - // If left empty it will default to a value to be set by each app. - uint64 limit = 3; - - // count_total is set to true to indicate that the result set should include - // a count of the total number of items available for pagination in UIs. - // count_total is only respected when offset is used. It is ignored when key - // is set. - bool count_total = 4; - - // reverse is set to true if results are to be returned in the descending order. - bool reverse = 5; -} - -// PageResponse is to be embedded in gRPC response messages where the -// corresponding request message has used PageRequest. -// -// message SomeResponse { -// repeated Bar results = 1; -// PageResponse page = 2; -// } -message PageResponse { - // next_key is the key to be passed to PageRequest.key to - // query the next page most efficiently - bytes next_key = 1; - - // total is total number of results available if PageRequest.count_total - // was set, its value is undefined otherwise - uint64 total = 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 22670e72..00000000 --- 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 3e8e9404..00000000 --- a/third_party/proto/cosmos/base/reflection/v2alpha1/reflection.proto +++ /dev/null @@ -1,217 +0,0 @@ -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 9ac5a7c3..00000000 --- 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 98a33d30..00000000 --- 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 186ecee4..00000000 --- a/third_party/proto/cosmos/base/store/v1beta1/listening.proto +++ /dev/null @@ -1,14 +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 -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 83485509..00000000 --- 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 505d4131..00000000 --- a/third_party/proto/cosmos/base/tendermint/v1beta1/query.proto +++ /dev/null @@ -1,137 +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; - 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/base/v1beta1/coin.proto b/third_party/proto/cosmos/base/v1beta1/coin.proto deleted file mode 100644 index fab75284..00000000 --- a/third_party/proto/cosmos/base/v1beta1/coin.proto +++ /dev/null @@ -1,40 +0,0 @@ -syntax = "proto3"; -package cosmos.base.v1beta1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/cosmos/cosmos-sdk/types"; -option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.stringer_all) = false; - -// Coin defines a token with a denomination and an amount. -// -// NOTE: The amount field is an Int which implements the custom method -// signatures required by gogoproto. -message Coin { - option (gogoproto.equal) = true; - - string denom = 1; - string amount = 2 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; -} - -// DecCoin defines a token with a denomination and a decimal amount. -// -// NOTE: The amount field is an Dec which implements the custom method -// signatures required by gogoproto. -message DecCoin { - option (gogoproto.equal) = true; - - string denom = 1; - string amount = 2 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; -} - -// IntProto defines a Protobuf wrapper around an Int object. -message IntProto { - string int = 1 [(gogoproto.customtype) = "Int", (gogoproto.nullable) = false]; -} - -// DecProto defines a Protobuf wrapper around a Dec object. -message DecProto { - string dec = 1 [(gogoproto.customtype) = "Dec", (gogoproto.nullable) = false]; -} 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 1c8332f3..00000000 --- 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 05bb0afc..00000000 --- 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 5b0ff7ec..00000000 --- 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 26457ad6..00000000 --- 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 6ffec344..00000000 --- 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 f8398e80..00000000 --- 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 bf671f17..00000000 --- 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 a2272571..00000000 --- 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 b0aad99d..00000000 --- a/third_party/proto/cosmos/crypto/secp256r1/keys.proto +++ /dev/null @@ -1,22 +0,0 @@ -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 ae98ec0b..00000000 --- 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 c0b17cdf..00000000 --- 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 2991218d..00000000 --- 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 e6ce478b..00000000 --- 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 14612c31..00000000 --- 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 199f446f..00000000 --- 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 eda00544..00000000 --- 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 38795f25..00000000 --- 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 dfd9b782..00000000 --- a/third_party/proto/cosmos/feegrant/v1beta1/feegrant.proto +++ /dev/null @@ -1,77 +0,0 @@ -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 4c1e51fd..00000000 --- a/third_party/proto/cosmos/feegrant/v1beta1/genesis.proto +++ /dev/null @@ -1,12 +0,0 @@ -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 00ea598b..00000000 --- a/third_party/proto/cosmos/feegrant/v1beta1/query.proto +++ /dev/null @@ -1,54 +0,0 @@ -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 66c27a79..00000000 --- a/third_party/proto/cosmos/feegrant/v1beta1/tx.proto +++ /dev/null @@ -1,48 +0,0 @@ -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 a0207793..00000000 --- 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 a9995004..00000000 --- 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 f040772e..00000000 --- a/third_party/proto/cosmos/gov/v1beta1/gov.proto +++ /dev/null @@ -1,197 +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. -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]; - 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 da62bdba..00000000 --- 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 ecb1cdfe..00000000 --- a/third_party/proto/cosmos/gov/v1beta1/tx.proto +++ /dev/null @@ -1,93 +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. - 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. -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. -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 4e783fb5..00000000 --- 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 f94d4ae2..00000000 --- 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 acd341d7..00000000 --- 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 5382fd79..00000000 --- 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 1078e02a..00000000 --- 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 a7aebcfb..00000000 --- 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 869049a0..00000000 --- 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 882a0fb6..00000000 --- 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 4d63370e..00000000 --- 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 6345612f..00000000 --- a/third_party/proto/cosmos/staking/v1beta1/authz.proto +++ /dev/null @@ -1,43 +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. -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 -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 d1563dbc..00000000 --- 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 4852c535..00000000 --- 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 76e9599e..00000000 --- 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 7b05d89e..00000000 --- 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 4c1be405..00000000 --- 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 646175c0..00000000 --- a/third_party/proto/cosmos/tx/v1beta1/service.proto +++ /dev/null @@ -1,132 +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. - 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 6d5caf12..00000000 --- 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 0703ef34..00000000 --- a/third_party/proto/cosmos/upgrade/v1beta1/query.proto +++ /dev/null @@ -1,97 +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. - 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; - - bytes upgraded_consensus_state = 2; -} - -// QueryModuleVersionsRequest is the request type for the Query/ModuleVersions -// RPC method. -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. -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 4e1d69aa..00000000 --- a/third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto +++ /dev/null @@ -1,76 +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. -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 c49be802..00000000 --- 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 26e78683..00000000 --- a/third_party/proto/cosmos/vesting/v1beta1/vesting.proto +++ /dev/null @@ -1,83 +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. -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/cosmos_proto/cosmos.proto b/third_party/proto/cosmos_proto/cosmos.proto deleted file mode 100644 index 167b1707..00000000 --- a/third_party/proto/cosmos_proto/cosmos.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; -package cosmos_proto; - -import "google/protobuf/descriptor.proto"; - -option go_package = "github.com/regen-network/cosmos-proto"; - -extend google.protobuf.MessageOptions { - string interface_type = 93001; - - string implements_interface = 93002; -} - -extend google.protobuf.FieldOptions { - string accepts_interface = 93001; -} diff --git a/third_party/proto/cosmwasm/wasm/v1/genesis.proto b/third_party/proto/cosmwasm/wasm/v1/genesis.proto deleted file mode 100644 index f02f3307..00000000 --- a/third_party/proto/cosmwasm/wasm/v1/genesis.proto +++ /dev/null @@ -1,60 +0,0 @@ -syntax = "proto3"; -package cosmwasm.wasm.v1; - -import "gogoproto/gogo.proto"; -import "cosmwasm/wasm/v1/types.proto"; -import "cosmwasm/wasm/v1/tx.proto"; - -option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; - -// GenesisState - genesis state of x/wasm -message GenesisState { - Params params = 1 [ (gogoproto.nullable) = false ]; - repeated Code codes = 2 - [ (gogoproto.nullable) = false, (gogoproto.jsontag) = "codes,omitempty" ]; - repeated Contract contracts = 3 [ - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "contracts,omitempty" - ]; - repeated Sequence sequences = 4 [ - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "sequences,omitempty" - ]; - repeated GenMsgs gen_msgs = 5 [ - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "gen_msgs,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 { - // sum is a single message - oneof sum { - MsgStoreCode store_code = 1; - MsgInstantiateContract instantiate_contract = 2; - MsgExecuteContract execute_contract = 3; - } - } -} - -// Code struct encompasses CodeInfo and CodeBytes -message Code { - uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; - CodeInfo code_info = 2 [ (gogoproto.nullable) = false ]; - bytes code_bytes = 3; - // Pinned to wasmvm cache - bool pinned = 4; -} - -// Contract struct encompasses ContractAddress, ContractInfo, and ContractState -message Contract { - string contract_address = 1; - ContractInfo contract_info = 2 [ (gogoproto.nullable) = false ]; - repeated Model contract_state = 3 [ (gogoproto.nullable) = false ]; -} - -// Sequence key and value of an id generation counter -message Sequence { - bytes id_key = 1 [ (gogoproto.customname) = "IDKey" ]; - uint64 value = 2; -} \ No newline at end of file diff --git a/third_party/proto/cosmwasm/wasm/v1/ibc.proto b/third_party/proto/cosmwasm/wasm/v1/ibc.proto deleted file mode 100644 index 1b30d315..00000000 --- a/third_party/proto/cosmwasm/wasm/v1/ibc.proto +++ /dev/null @@ -1,30 +0,0 @@ -syntax = "proto3"; -package cosmwasm.wasm.v1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; -option (gogoproto.goproto_getters_all) = false; - -// MsgIBCSend -message MsgIBCSend { - // the channel by which the packet will be sent - string channel = 2 [ (gogoproto.moretags) = "yaml:\"source_channel\"" ]; - - // Timeout height relative to the current block height. - // The timeout is disabled when set to 0. - uint64 timeout_height = 4 - [ (gogoproto.moretags) = "yaml:\"timeout_height\"" ]; - // Timeout timestamp (in nanoseconds) relative to the current block timestamp. - // The timeout is disabled when set to 0. - uint64 timeout_timestamp = 5 - [ (gogoproto.moretags) = "yaml:\"timeout_timestamp\"" ]; - - // data is the payload to transfer - bytes data = 6 [ (gogoproto.casttype) = "encoding/json.RawMessage" ]; -} - -// MsgIBCCloseChannel port and channel need to be owned by the contract -message MsgIBCCloseChannel { - string channel = 2 [ (gogoproto.moretags) = "yaml:\"source_channel\"" ]; -} diff --git a/third_party/proto/cosmwasm/wasm/v1/proposal.proto b/third_party/proto/cosmwasm/wasm/v1/proposal.proto deleted file mode 100644 index 551894ad..00000000 --- a/third_party/proto/cosmwasm/wasm/v1/proposal.proto +++ /dev/null @@ -1,118 +0,0 @@ -syntax = "proto3"; -package cosmwasm.wasm.v1; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmwasm/wasm/v1/types.proto"; - -option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; -option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.goproto_getters_all) = false; -option (gogoproto.equal_all) = true; - -// StoreCodeProposal gov proposal content type to submit WASM code to the system -message StoreCodeProposal { - // Title is a short summary - string title = 1; - // Description is a human readable text - string description = 2; - // RunAs is the address that is passed to the contract's environment as sender - string run_as = 3; - // WASMByteCode can be raw or gzip compressed - bytes wasm_byte_code = 4 [ (gogoproto.customname) = "WASMByteCode" ]; - // Used in v1beta1 - reserved 5, 6; - // InstantiatePermission to apply on contract creation, optional - AccessConfig instantiate_permission = 7; -} - -// InstantiateContractProposal gov proposal content type to instantiate a -// contract. -message InstantiateContractProposal { - // Title is a short summary - string title = 1; - // Description is a human readable text - string description = 2; - // RunAs is the address that is passed to the contract's environment as sender - string run_as = 3; - // Admin is an optional address that can execute migrations - string admin = 4; - // CodeID is the reference to the stored WASM code - uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; - // Label is optional metadata to be stored with a constract instance. - string label = 6; - // Msg json encoded message to be passed to the contract on instantiation - bytes msg = 7; - // Funds coins that are transferred to the contract on instantiation - repeated cosmos.base.v1beta1.Coin funds = 8 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// MigrateContractProposal gov proposal content type to migrate a contract. -message MigrateContractProposal { - // Title is a short summary - string title = 1; - // Description is a human readable text - string description = 2; - // RunAs is the address that is passed to the contract's environment as sender - string run_as = 3; - // Contract is the address of the smart contract - string contract = 4; - // CodeID references the new WASM code - uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; - // Msg json encoded message to be passed to the contract on migration - bytes msg = 6; -} - -// UpdateAdminProposal gov proposal content type to set an admin for a contract. -message UpdateAdminProposal { - // Title is a short summary - string title = 1; - // Description is a human readable text - string description = 2; - // NewAdmin address to be set - string new_admin = 3 [ (gogoproto.moretags) = "yaml:\"new_admin\"" ]; - // Contract is the address of the smart contract - string contract = 4; -} - -// ClearAdminProposal gov proposal content type to clear the admin of a -// contract. -message ClearAdminProposal { - // Title is a short summary - string title = 1; - // Description is a human readable text - string description = 2; - // Contract is the address of the smart contract - string contract = 3; -} - -// PinCodesProposal gov proposal content type to pin a set of code ids in the -// wasmvm cache. -message PinCodesProposal { - // Title is a short summary - string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ]; - // Description is a human readable text - string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ]; - // CodeIDs references the new WASM codes - repeated uint64 code_ids = 3 [ - (gogoproto.customname) = "CodeIDs", - (gogoproto.moretags) = "yaml:\"code_ids\"" - ]; -} - -// UnpinCodesProposal gov proposal content type to unpin a set of code ids in -// the wasmvm cache. -message UnpinCodesProposal { - // Title is a short summary - string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ]; - // Description is a human readable text - string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ]; - // CodeIDs references the WASM codes - repeated uint64 code_ids = 3 [ - (gogoproto.customname) = "CodeIDs", - (gogoproto.moretags) = "yaml:\"code_ids\"" - ]; -} diff --git a/third_party/proto/cosmwasm/wasm/v1/query.proto b/third_party/proto/cosmwasm/wasm/v1/query.proto deleted file mode 100644 index 4a992abb..00000000 --- a/third_party/proto/cosmwasm/wasm/v1/query.proto +++ /dev/null @@ -1,202 +0,0 @@ -syntax = "proto3"; -package cosmwasm.wasm.v1; - -import "gogoproto/gogo.proto"; -import "cosmwasm/wasm/v1/types.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; - -option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; -option (gogoproto.goproto_getters_all) = false; -option (gogoproto.equal_all) = false; - -// Query provides defines the gRPC querier service -service Query { - // ContractInfo gets the contract meta data - rpc ContractInfo(QueryContractInfoRequest) - returns (QueryContractInfoResponse) { - option (google.api.http).get = "/cosmwasm/wasm/v1/contract/{address}"; - } - // ContractHistory gets the contract code history - rpc ContractHistory(QueryContractHistoryRequest) - returns (QueryContractHistoryResponse) { - option (google.api.http).get = - "/cosmwasm/wasm/v1/contract/{address}/history"; - } - // ContractsByCode lists all smart contracts for a code id - rpc ContractsByCode(QueryContractsByCodeRequest) - returns (QueryContractsByCodeResponse) { - option (google.api.http).get = "/cosmwasm/wasm/v1/code/{code_id}/contracts"; - } - // AllContractState gets all raw store data for a single contract - rpc AllContractState(QueryAllContractStateRequest) - returns (QueryAllContractStateResponse) { - option (google.api.http).get = "/cosmwasm/wasm/v1/contract/{address}/state"; - } - // RawContractState gets single key from the raw store data of a contract - rpc RawContractState(QueryRawContractStateRequest) - returns (QueryRawContractStateResponse) { - option (google.api.http).get = - "/wasm/v1/contract/{address}/raw/{query_data}"; - } - // SmartContractState get smart query result from the contract - rpc SmartContractState(QuerySmartContractStateRequest) - returns (QuerySmartContractStateResponse) { - option (google.api.http).get = - "/wasm/v1/contract/{address}/smart/{query_data}"; - } - // Code gets the binary code and metadata for a singe wasm code - rpc Code(QueryCodeRequest) returns (QueryCodeResponse) { - option (google.api.http).get = "/cosmwasm/wasm/v1/code/{code_id}"; - } - // Codes gets the metadata for all stored wasm codes - rpc Codes(QueryCodesRequest) returns (QueryCodesResponse) { - option (google.api.http).get = "/cosmwasm/wasm/v1/code"; - } -} - -// QueryContractInfoRequest is the request type for the Query/ContractInfo RPC -// method -message QueryContractInfoRequest { - // address is the address of the contract to query - string address = 1; -} -// QueryContractInfoResponse is the response type for the Query/ContractInfo RPC -// method -message QueryContractInfoResponse { - option (gogoproto.equal) = true; - - // address is the address of the contract - string address = 1; - ContractInfo contract_info = 2 [ - (gogoproto.embed) = true, - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "" - ]; -} - -// QueryContractHistoryRequest is the request type for the Query/ContractHistory -// RPC method -message QueryContractHistoryRequest { - // address is the address of the contract to query - string address = 1; - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryContractHistoryResponse is the response type for the -// Query/ContractHistory RPC method -message QueryContractHistoryResponse { - repeated ContractCodeHistoryEntry entries = 1 - [ (gogoproto.nullable) = false ]; - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryContractsByCodeRequest is the request type for the Query/ContractsByCode -// RPC method -message QueryContractsByCodeRequest { - uint64 code_id = 1; // grpc-gateway_out does not support Go style CodID - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryContractsByCodeResponse is the response type for the -// Query/ContractsByCode RPC method -message QueryContractsByCodeResponse { - // contracts are a set of contract addresses - repeated string contracts = 1; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryAllContractStateRequest is the request type for the -// Query/AllContractState RPC method -message QueryAllContractStateRequest { - // address is the address of the contract - string address = 1; - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryAllContractStateResponse is the response type for the -// Query/AllContractState RPC method -message QueryAllContractStateResponse { - repeated Model models = 1 [ (gogoproto.nullable) = false ]; - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryRawContractStateRequest is the request type for the -// Query/RawContractState RPC method -message QueryRawContractStateRequest { - // address is the address of the contract - string address = 1; - bytes query_data = 2; -} - -// QueryRawContractStateResponse is the response type for the -// Query/RawContractState RPC method -message QueryRawContractStateResponse { - // Data contains the raw store data - bytes data = 1; -} - -// QuerySmartContractStateRequest is the request type for the -// Query/SmartContractState RPC method -message QuerySmartContractStateRequest { - // address is the address of the contract - string address = 1; - // QueryData contains the query data passed to the contract - bytes query_data = 2; -} - -// QuerySmartContractStateResponse is the response type for the -// Query/SmartContractState RPC method -message QuerySmartContractStateResponse { - // Data contains the json data returned from the smart contract - bytes data = 1 [ (gogoproto.casttype) = "encoding/json.RawMessage" ]; -} - -// QueryCodeRequest is the request type for the Query/Code RPC method -message QueryCodeRequest { - uint64 code_id = 1; // grpc-gateway_out does not support Go style CodID -} - -// CodeInfoResponse contains code meta data from CodeInfo -message CodeInfoResponse { - option (gogoproto.equal) = true; - - uint64 code_id = 1 [ - (gogoproto.customname) = "CodeID", - (gogoproto.jsontag) = "id" - ]; // id for legacy support - string creator = 2; - bytes data_hash = 3 - [ (gogoproto.casttype) = - "github.com/tendermint/tendermint/libs/bytes.HexBytes" ]; - // Used in v1beta1 - reserved 4, 5; -} - -// QueryCodeResponse is the response type for the Query/Code RPC method -message QueryCodeResponse { - option (gogoproto.equal) = true; - CodeInfoResponse code_info = 1 - [ (gogoproto.embed) = true, (gogoproto.jsontag) = "" ]; - bytes data = 2 [ (gogoproto.jsontag) = "data" ]; -} - -// QueryCodesRequest is the request type for the Query/Codes RPC method -message QueryCodesRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryCodesResponse is the response type for the Query/Codes RPC method -message QueryCodesResponse { - repeated CodeInfoResponse code_infos = 1 [ (gogoproto.nullable) = false ]; - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} diff --git a/third_party/proto/cosmwasm/wasm/v1/tx.proto b/third_party/proto/cosmwasm/wasm/v1/tx.proto deleted file mode 100644 index 768b0a01..00000000 --- a/third_party/proto/cosmwasm/wasm/v1/tx.proto +++ /dev/null @@ -1,135 +0,0 @@ -syntax = "proto3"; -package cosmwasm.wasm.v1; - -import "cosmos/base/v1beta1/coin.proto"; -import "gogoproto/gogo.proto"; -import "cosmwasm/wasm/v1/types.proto"; - -option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; -option (gogoproto.goproto_getters_all) = false; - -// Msg defines the wasm Msg service. -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. - rpc InstantiateContract(MsgInstantiateContract) - returns (MsgInstantiateContractResponse); - // 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 - rpc MigrateContract(MsgMigrateContract) returns (MsgMigrateContractResponse); - // UpdateAdmin sets a new admin for a smart contract - rpc UpdateAdmin(MsgUpdateAdmin) returns (MsgUpdateAdminResponse); - // ClearAdmin removes any admin stored for a smart contract - rpc ClearAdmin(MsgClearAdmin) returns (MsgClearAdminResponse); -} - -// MsgStoreCode submit Wasm code to the system -message MsgStoreCode { - // Sender is the that actor that signed the messages - string sender = 1; - // WASMByteCode can be raw or gzip compressed - bytes wasm_byte_code = 2 [ (gogoproto.customname) = "WASMByteCode" ]; - // Used in v1beta1 - reserved 3, 4; - // InstantiatePermission access control to apply on contract creation, - // optional - AccessConfig instantiate_permission = 5; -} -// MsgStoreCodeResponse returns store result data. -message MsgStoreCodeResponse { - // CodeID is the reference to the stored WASM code - uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; -} - -// MsgInstantiateContract create a new smart contract instance for the given -// code id. -message MsgInstantiateContract { - // 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; - // Funds coins that are transferred to the contract on instantiation - repeated cosmos.base.v1beta1.Coin funds = 6 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} -// 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 - bytes data = 2; -} - -// MsgExecuteContract submits the given message data to a smart contract -message MsgExecuteContract { - // Sender is the that actor that signed the messages - string sender = 1; - // Contract is the address of the smart contract - string contract = 2; - // Msg json encoded message to be passed to the contract - bytes msg = 3; - // Funds coins that are transferred to the contract on execution - repeated cosmos.base.v1beta1.Coin funds = 5 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// MsgExecuteContractResponse returns execution result data. -message MsgExecuteContractResponse { - // Data contains base64-encoded bytes to returned from the contract - bytes data = 1; -} - -// MsgMigrateContract runs a code upgrade/ downgrade for a smart contract -message MsgMigrateContract { - // Sender is the that actor that signed the messages - string sender = 1; - // Contract is the address of the smart contract - string contract = 2; - // CodeID references the new WASM code - uint64 code_id = 3 [ (gogoproto.customname) = "CodeID" ]; - // Msg json encoded message to be passed to the contract on migration - bytes msg = 4; -} - -// MsgMigrateContractResponse returns contract migration result data. -message MsgMigrateContractResponse { - // Data contains same raw bytes returned as data from the wasm contract. - // (May be empty) - bytes data = 1; -} - -// MsgUpdateAdmin sets a new admin for a smart contract -message MsgUpdateAdmin { - // Sender is the that actor that signed the messages - string sender = 1; - // NewAdmin address to be set - string new_admin = 2; - // Contract is the address of the smart contract - string contract = 3; -} - -// MsgUpdateAdminResponse returns empty data -message MsgUpdateAdminResponse {} - -// MsgClearAdmin removes any admin stored for a smart contract -message MsgClearAdmin { - // Sender is the that actor that signed the messages - string sender = 1; - // Contract is the address of the smart contract - string contract = 3; -} - -// MsgClearAdminResponse returns empty data -message MsgClearAdminResponse {} diff --git a/third_party/proto/cosmwasm/wasm/v1/types.proto b/third_party/proto/cosmwasm/wasm/v1/types.proto deleted file mode 100644 index 48259332..00000000 --- a/third_party/proto/cosmwasm/wasm/v1/types.proto +++ /dev/null @@ -1,140 +0,0 @@ -syntax = "proto3"; -package cosmwasm.wasm.v1; - -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; -option (gogoproto.goproto_getters_all) = false; -option (gogoproto.equal_all) = true; - -// AccessType permission types -enum AccessType { - option (gogoproto.goproto_enum_prefix) = false; - option (gogoproto.goproto_enum_stringer) = false; - // AccessTypeUnspecified placeholder for empty value - ACCESS_TYPE_UNSPECIFIED = 0 - [ (gogoproto.enumvalue_customname) = "AccessTypeUnspecified" ]; - // AccessTypeNobody forbidden - ACCESS_TYPE_NOBODY = 1 - [ (gogoproto.enumvalue_customname) = "AccessTypeNobody" ]; - // AccessTypeOnlyAddress restricted to an address - ACCESS_TYPE_ONLY_ADDRESS = 2 - [ (gogoproto.enumvalue_customname) = "AccessTypeOnlyAddress" ]; - // AccessTypeEverybody unrestricted - ACCESS_TYPE_EVERYBODY = 3 - [ (gogoproto.enumvalue_customname) = "AccessTypeEverybody" ]; -} - -// AccessTypeParam -message AccessTypeParam { - option (gogoproto.goproto_stringer) = true; - AccessType value = 1 [ (gogoproto.moretags) = "yaml:\"value\"" ]; -} - -// AccessConfig access control type. -message AccessConfig { - option (gogoproto.goproto_stringer) = true; - AccessType permission = 1 [ (gogoproto.moretags) = "yaml:\"permission\"" ]; - string address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; -} - -// Params defines the set of wasm parameters. -message Params { - option (gogoproto.goproto_stringer) = false; - AccessConfig code_upload_access = 1 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"code_upload_access\"" - ]; - AccessType instantiate_default_permission = 2 - [ (gogoproto.moretags) = "yaml:\"instantiate_default_permission\"" ]; - uint64 max_wasm_code_size = 3 - [ (gogoproto.moretags) = "yaml:\"max_wasm_code_size\"" ]; -} - -// CodeInfo is data for the uploaded contract WASM code -message CodeInfo { - // CodeHash is the unique identifier created by wasmvm - bytes code_hash = 1; - // Creator address who initially stored the code - string creator = 2; - // Used in v1beta1 - reserved 3, 4; - // InstantiateConfig access control to apply on contract creation, optional - AccessConfig instantiate_config = 5 [ (gogoproto.nullable) = false ]; -} - -// ContractInfo stores a WASM contract instance -message ContractInfo { - option (gogoproto.equal) = true; - - // CodeID is the reference to the stored Wasm code - uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; - // Creator address who initially instantiated the contract - string creator = 2; - // Admin is an optional address that can execute migrations - string admin = 3; - // Label is optional metadata to be stored with a contract instance. - string label = 4; - // Created Tx position when the contract was instantiated. - // This data should kept internal and not be exposed via query results. Just - // use for sorting - AbsoluteTxPosition created = 5; - string ibc_port_id = 6 [ (gogoproto.customname) = "IBCPortID" ]; - - // Extension is an extension point to store custom metadata within the - // persistence model. - google.protobuf.Any extension = 7 - [ (cosmos_proto.accepts_interface) = "ContractInfoExtension" ]; -} - -// ContractCodeHistoryOperationType actions that caused a code change -enum ContractCodeHistoryOperationType { - option (gogoproto.goproto_enum_prefix) = false; - // ContractCodeHistoryOperationTypeUnspecified placeholder for empty value - CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED = 0 - [ (gogoproto.enumvalue_customname) = - "ContractCodeHistoryOperationTypeUnspecified" ]; - // ContractCodeHistoryOperationTypeInit on chain contract instantiation - CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT = 1 - [ (gogoproto.enumvalue_customname) = - "ContractCodeHistoryOperationTypeInit" ]; - // ContractCodeHistoryOperationTypeMigrate code migration - CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE = 2 - [ (gogoproto.enumvalue_customname) = - "ContractCodeHistoryOperationTypeMigrate" ]; - // ContractCodeHistoryOperationTypeGenesis based on genesis data - CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS = 3 - [ (gogoproto.enumvalue_customname) = - "ContractCodeHistoryOperationTypeGenesis" ]; -} - -// ContractCodeHistoryEntry metadata to a contract. -message ContractCodeHistoryEntry { - ContractCodeHistoryOperationType operation = 1; - // CodeID is the reference to the stored WASM code - uint64 code_id = 2 [ (gogoproto.customname) = "CodeID" ]; - // Updated Tx position when the operation was executed. - AbsoluteTxPosition updated = 3; - bytes msg = 4 [ (gogoproto.casttype) = "encoding/json.RawMessage" ]; -} - -// AbsoluteTxPosition is a unique transaction position that allows for global -// ordering of transactions. -message AbsoluteTxPosition { - // BlockHeight is the block the contract was created at - uint64 block_height = 1; - // TxIndex is a monotonic counter within the block (actual transaction index, - // or gas consumed) - uint64 tx_index = 2; -} - -// Model is a struct that holds a KV pair -message Model { - // hex-encode key to read it better (this is often ascii) - bytes key = 1 [ (gogoproto.casttype) = - "github.com/tendermint/tendermint/libs/bytes.HexBytes" ]; - // base64-encode raw value - bytes value = 2; -} diff --git a/third_party/proto/cosmwasm/wasm/v1beta1/genesis.proto b/third_party/proto/cosmwasm/wasm/v1beta1/genesis.proto deleted file mode 100644 index c00fd066..00000000 --- a/third_party/proto/cosmwasm/wasm/v1beta1/genesis.proto +++ /dev/null @@ -1,60 +0,0 @@ -syntax = "proto3"; -package cosmwasm.wasm.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmwasm/wasm/v1beta1/types.proto"; -import "cosmwasm/wasm/v1beta1/tx.proto"; - -option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; - -// GenesisState - genesis state of x/wasm -message GenesisState { - Params params = 1 [ (gogoproto.nullable) = false ]; - repeated Code codes = 2 - [ (gogoproto.nullable) = false, (gogoproto.jsontag) = "codes,omitempty" ]; - repeated Contract contracts = 3 [ - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "contracts,omitempty" - ]; - repeated Sequence sequences = 4 [ - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "sequences,omitempty" - ]; - repeated GenMsgs gen_msgs = 5 [ - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "gen_msgs,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 { - // sum is a single message - oneof sum { - MsgStoreCode store_code = 1; - MsgInstantiateContract instantiate_contract = 2; - MsgExecuteContract execute_contract = 3; - } - } -} - -// Code struct encompasses CodeInfo and CodeBytes -message Code { - uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; - CodeInfo code_info = 2 [ (gogoproto.nullable) = false ]; - bytes code_bytes = 3; - // Pinned to wasmvm cache - bool pinned = 4; -} - -// Contract struct encompasses ContractAddress, ContractInfo, and ContractState -message Contract { - string contract_address = 1; - ContractInfo contract_info = 2 [ (gogoproto.nullable) = false ]; - repeated Model contract_state = 3 [ (gogoproto.nullable) = false ]; -} - -// Sequence key and value of an id generation counter -message Sequence { - bytes id_key = 1 [ (gogoproto.customname) = "IDKey" ]; - uint64 value = 2; -} \ No newline at end of file diff --git a/third_party/proto/cosmwasm/wasm/v1beta1/ibc.proto b/third_party/proto/cosmwasm/wasm/v1beta1/ibc.proto deleted file mode 100644 index e0462c34..00000000 --- a/third_party/proto/cosmwasm/wasm/v1beta1/ibc.proto +++ /dev/null @@ -1,30 +0,0 @@ -syntax = "proto3"; -package cosmwasm.wasm.v1beta1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; -option (gogoproto.goproto_getters_all) = false; - -// MsgIBCSend -message MsgIBCSend { - // the channel by which the packet will be sent - string channel = 2 [ (gogoproto.moretags) = "yaml:\"source_channel\"" ]; - - // Timeout height relative to the current block height. - // The timeout is disabled when set to 0. - uint64 timeout_height = 4 - [ (gogoproto.moretags) = "yaml:\"timeout_height\"" ]; - // Timeout timestamp (in nanoseconds) relative to the current block timestamp. - // The timeout is disabled when set to 0. - uint64 timeout_timestamp = 5 - [ (gogoproto.moretags) = "yaml:\"timeout_timestamp\"" ]; - - // data is the payload to transfer - bytes data = 6 [ (gogoproto.casttype) = "encoding/json.RawMessage" ]; -} - -// MsgIBCCloseChannel port and channel need to be owned by the contract -message MsgIBCCloseChannel { - string channel = 2 [ (gogoproto.moretags) = "yaml:\"source_channel\"" ]; -} diff --git a/third_party/proto/cosmwasm/wasm/v1beta1/proposal.proto b/third_party/proto/cosmwasm/wasm/v1beta1/proposal.proto deleted file mode 100644 index 4387bb67..00000000 --- a/third_party/proto/cosmwasm/wasm/v1beta1/proposal.proto +++ /dev/null @@ -1,121 +0,0 @@ -syntax = "proto3"; -package cosmwasm.wasm.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmwasm/wasm/v1beta1/types.proto"; - -option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; -option (gogoproto.goproto_stringer_all) = false; -option (gogoproto.goproto_getters_all) = false; -option (gogoproto.equal_all) = true; - -// StoreCodeProposal gov proposal content type to submit WASM code to the system -message StoreCodeProposal { - // Title is a short summary - string title = 1; - // Description is a human readable text - string description = 2; - // RunAs is the address that is passed to the contract's environment as sender - string run_as = 3; - // WASMByteCode can be raw or gzip compressed - bytes wasm_byte_code = 4 [ (gogoproto.customname) = "WASMByteCode" ]; - // Source is a valid absolute HTTPS URI to the contract's source code, - // optional - string source = 5; - // Builder is a valid docker image name with tag, optional - string builder = 6; - // InstantiatePermission to apply on contract creation, optional - AccessConfig instantiate_permission = 7; -} - -// InstantiateContractProposal gov proposal content type to instantiate a -// contract. -message InstantiateContractProposal { - // Title is a short summary - string title = 1; - // Description is a human readable text - string description = 2; - // RunAs is the address that is passed to the contract's environment as sender - string run_as = 3; - // Admin is an optional address that can execute migrations - string admin = 4; - // CodeID is the reference to the stored WASM code - uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; - // Label is optional metadata to be stored with a constract instance. - string label = 6; - // InitMsg json encoded message to be passed to the contract on instantiation - bytes init_msg = 7; - // Funds coins that are transferred to the contract on instantiation - repeated cosmos.base.v1beta1.Coin funds = 8 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// MigrateContractProposal gov proposal content type to migrate a contract. -message MigrateContractProposal { - // Title is a short summary - string title = 1; - // Description is a human readable text - string description = 2; - // RunAs is the address that is passed to the contract's environment as sender - string run_as = 3; - // Contract is the address of the smart contract - string contract = 4; - // CodeID references the new WASM code - uint64 code_id = 5 [ (gogoproto.customname) = "CodeID" ]; - // MigrateMsg json encoded message to be passed to the contract on migration - bytes migrate_msg = 6; -} - -// UpdateAdminProposal gov proposal content type to set an admin for a contract. -message UpdateAdminProposal { - // Title is a short summary - string title = 1; - // Description is a human readable text - string description = 2; - // NewAdmin address to be set - string new_admin = 3 [ (gogoproto.moretags) = "yaml:\"new_admin\"" ]; - // Contract is the address of the smart contract - string contract = 4; -} - -// ClearAdminProposal gov proposal content type to clear the admin of a -// contract. -message ClearAdminProposal { - // Title is a short summary - string title = 1; - // Description is a human readable text - string description = 2; - // Contract is the address of the smart contract - string contract = 3; -} - -// PinCodesProposal gov proposal content type to pin a set of code ids in the -// wasmvm cache. -message PinCodesProposal { - // Title is a short summary - string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ]; - // Description is a human readable text - string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ]; - // CodeIDs references the new WASM codes - repeated uint64 code_ids = 3 [ - (gogoproto.customname) = "CodeIDs", - (gogoproto.moretags) = "yaml:\"code_ids\"" - ]; -} - -// UnpinCodesProposal gov proposal content type to unpin a set of code ids in -// the wasmvm cache. -message UnpinCodesProposal { - // Title is a short summary - string title = 1 [ (gogoproto.moretags) = "yaml:\"title\"" ]; - // Description is a human readable text - string description = 2 [ (gogoproto.moretags) = "yaml:\"description\"" ]; - // CodeIDs references the WASM codes - repeated uint64 code_ids = 3 [ - (gogoproto.customname) = "CodeIDs", - (gogoproto.moretags) = "yaml:\"code_ids\"" - ]; -} diff --git a/third_party/proto/cosmwasm/wasm/v1beta1/query.proto b/third_party/proto/cosmwasm/wasm/v1beta1/query.proto deleted file mode 100644 index 3f96cc68..00000000 --- a/third_party/proto/cosmwasm/wasm/v1beta1/query.proto +++ /dev/null @@ -1,201 +0,0 @@ -syntax = "proto3"; -package cosmwasm.wasm.v1beta1; - -import "gogoproto/gogo.proto"; -import "cosmwasm/wasm/v1beta1/types.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; - -option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; -option (gogoproto.goproto_getters_all) = false; -option (gogoproto.equal_all) = false; - -// Query provides defines the gRPC querier service -service Query { - // ContractInfo gets the contract meta data - rpc ContractInfo(QueryContractInfoRequest) - returns (QueryContractInfoResponse) { - option (google.api.http).get = "/wasm/v1beta1/contract/{address}"; - } - // ContractHistory gets the contract code history - rpc ContractHistory(QueryContractHistoryRequest) - returns (QueryContractHistoryResponse) { - option (google.api.http).get = "/wasm/v1beta1/contract/{address}/history"; - } - // ContractsByCode lists all smart contracts for a code id - rpc ContractsByCode(QueryContractsByCodeRequest) - returns (QueryContractsByCodeResponse) { - option (google.api.http).get = "/wasm/v1beta1/code/{code_id}/contracts"; - } - // AllContractState gets all raw store data for a single contract - rpc AllContractState(QueryAllContractStateRequest) - returns (QueryAllContractStateResponse) { - option (google.api.http).get = "/wasm/v1beta1/contract/{address}/state"; - } - // RawContractState gets single key from the raw store data of a contract - rpc RawContractState(QueryRawContractStateRequest) - returns (QueryRawContractStateResponse) { - option (google.api.http).get = - "/wasm/v1beta1/contract/{address}/raw/{query_data}"; - } - // SmartContractState get smart query result from the contract - rpc SmartContractState(QuerySmartContractStateRequest) - returns (QuerySmartContractStateResponse) { - option (google.api.http).get = - "/wasm/v1beta1/contract/{address}/smart/{query_data}"; - } - // Code gets the binary code and metadata for a singe wasm code - rpc Code(QueryCodeRequest) returns (QueryCodeResponse) { - option (google.api.http).get = "/wasm/v1beta1/code/{code_id}"; - } - // Codes gets the metadata for all stored wasm codes - rpc Codes(QueryCodesRequest) returns (QueryCodesResponse) { - option (google.api.http).get = "/wasm/v1beta1/code"; - } -} - -// QueryContractInfoRequest is the request type for the Query/ContractInfo RPC -// method -message QueryContractInfoRequest { - // address is the address of the contract to query - string address = 1; -} -// QueryContractInfoResponse is the response type for the Query/ContractInfo RPC -// method -message QueryContractInfoResponse { - option (gogoproto.equal) = true; - - // address is the address of the contract - string address = 1; - ContractInfo contract_info = 2 [ - (gogoproto.embed) = true, - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "" - ]; -} - -// QueryContractHistoryRequest is the request type for the Query/ContractHistory -// RPC method -message QueryContractHistoryRequest { - // address is the address of the contract to query - string address = 1; - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryContractHistoryResponse is the response type for the -// Query/ContractHistory RPC method -message QueryContractHistoryResponse { - repeated ContractCodeHistoryEntry entries = 1 - [ (gogoproto.nullable) = false ]; - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryContractsByCodeRequest is the request type for the Query/ContractsByCode -// RPC method -message QueryContractsByCodeRequest { - uint64 code_id = 1; // grpc-gateway_out does not support Go style CodID - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryContractsByCodeResponse is the response type for the -// Query/ContractsByCode RPC method -message QueryContractsByCodeResponse { - // contracts are a set of contract addresses - repeated string contracts = 1; - - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryAllContractStateRequest is the request type for the -// Query/AllContractState RPC method -message QueryAllContractStateRequest { - // address is the address of the contract - string address = 1; - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryAllContractStateResponse is the response type for the -// Query/AllContractState RPC method -message QueryAllContractStateResponse { - repeated Model models = 1 [ (gogoproto.nullable) = false ]; - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryRawContractStateRequest is the request type for the -// Query/RawContractState RPC method -message QueryRawContractStateRequest { - // address is the address of the contract - string address = 1; - bytes query_data = 2; -} - -// QueryRawContractStateResponse is the response type for the -// Query/RawContractState RPC method -message QueryRawContractStateResponse { - // Data contains the raw store data - bytes data = 1; -} - -// QuerySmartContractStateRequest is the request type for the -// Query/SmartContractState RPC method -message QuerySmartContractStateRequest { - // address is the address of the contract - string address = 1; - // QueryData contains the query data passed to the contract - bytes query_data = 2; -} - -// QuerySmartContractStateResponse is the response type for the -// Query/SmartContractState RPC method -message QuerySmartContractStateResponse { - // Data contains the json data returned from the smart contract - bytes data = 1 [ (gogoproto.casttype) = "encoding/json.RawMessage" ]; -} - -// QueryCodeRequest is the request type for the Query/Code RPC method -message QueryCodeRequest { - uint64 code_id = 1; // grpc-gateway_out does not support Go style CodID -} - -// CodeInfoResponse contains code meta data from CodeInfo -message CodeInfoResponse { - option (gogoproto.equal) = true; - - uint64 code_id = 1 [ - (gogoproto.customname) = "CodeID", - (gogoproto.jsontag) = "id" - ]; // id for legacy support - string creator = 2; - bytes data_hash = 3 - [ (gogoproto.casttype) = - "github.com/tendermint/tendermint/libs/bytes.HexBytes" ]; - string source = 4; - string builder = 5; -} - -// QueryCodeResponse is the response type for the Query/Code RPC method -message QueryCodeResponse { - option (gogoproto.equal) = true; - CodeInfoResponse code_info = 1 - [ (gogoproto.embed) = true, (gogoproto.jsontag) = "" ]; - bytes data = 2 [ (gogoproto.jsontag) = "data" ]; -} - -// QueryCodesRequest is the request type for the Query/Codes RPC method -message QueryCodesRequest { - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; -} - -// QueryCodesResponse is the response type for the Query/Codes RPC method -message QueryCodesResponse { - repeated CodeInfoResponse code_infos = 1 [ (gogoproto.nullable) = false ]; - // pagination defines the pagination in the response. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} diff --git a/third_party/proto/cosmwasm/wasm/v1beta1/tx.proto b/third_party/proto/cosmwasm/wasm/v1beta1/tx.proto deleted file mode 100644 index c3ddd3bf..00000000 --- a/third_party/proto/cosmwasm/wasm/v1beta1/tx.proto +++ /dev/null @@ -1,138 +0,0 @@ -syntax = "proto3"; -package cosmwasm.wasm.v1beta1; - -import "cosmos/base/v1beta1/coin.proto"; -import "gogoproto/gogo.proto"; -import "cosmwasm/wasm/v1beta1/types.proto"; - -option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; -option (gogoproto.goproto_getters_all) = false; - -// Msg defines the wasm Msg service. -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. - rpc InstantiateContract(MsgInstantiateContract) - returns (MsgInstantiateContractResponse); - // 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 - rpc MigrateContract(MsgMigrateContract) returns (MsgMigrateContractResponse); - // UpdateAdmin sets a new admin for a smart contract - rpc UpdateAdmin(MsgUpdateAdmin) returns (MsgUpdateAdminResponse); - // ClearAdmin removes any admin stored for a smart contract - rpc ClearAdmin(MsgClearAdmin) returns (MsgClearAdminResponse); -} - -// MsgStoreCode submit Wasm code to the system -message MsgStoreCode { - // Sender is the that actor that signed the messages - string sender = 1; - // WASMByteCode can be raw or gzip compressed - bytes wasm_byte_code = 2 [ (gogoproto.customname) = "WASMByteCode" ]; - // Source is a valid absolute HTTPS URI to the contract's source code, - // optional - string source = 3; - // Builder is a valid docker image name with tag, optional - string builder = 4; - // InstantiatePermission access control to apply on contract creation, - // optional - AccessConfig instantiate_permission = 5; -} -// MsgStoreCodeResponse returns store result data. -message MsgStoreCodeResponse { - // CodeID is the reference to the stored WASM code - uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; -} - -// MsgInstantiateContract create a new smart contract instance for the given -// code id. -message MsgInstantiateContract { - // 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; - // InitMsg json encoded message to be passed to the contract on instantiation - bytes init_msg = 5; - // Funds coins that are transferred to the contract on instantiation - repeated cosmos.base.v1beta1.Coin funds = 6 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} -// 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 - bytes data = 2; -} - -// MsgExecuteContract submits the given message data to a smart contract -message MsgExecuteContract { - // Sender is the that actor that signed the messages - string sender = 1; - // Contract is the address of the smart contract - string contract = 2; - // Msg json encoded message to be passed to the contract - bytes msg = 3; - // Funds coins that are transferred to the contract on execution - repeated cosmos.base.v1beta1.Coin funds = 5 [ - (gogoproto.nullable) = false, - (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" - ]; -} - -// MsgExecuteContractResponse returns execution result data. -message MsgExecuteContractResponse { - // Data contains base64-encoded bytes to returned from the contract - bytes data = 1; -} - -// MsgMigrateContract runs a code upgrade/ downgrade for a smart contract -message MsgMigrateContract { - // Sender is the that actor that signed the messages - string sender = 1; - // Contract is the address of the smart contract - string contract = 2; - // CodeID references the new WASM code - uint64 code_id = 3 [ (gogoproto.customname) = "CodeID" ]; - // MigrateMsg json encoded message to be passed to the contract on migration - bytes migrate_msg = 4; -} - -// MsgMigrateContractResponse returns contract migration result data. -message MsgMigrateContractResponse { - // Data contains same raw bytes returned as data from the wasm contract. - // (May be empty) - bytes data = 1; -} - -// MsgUpdateAdmin sets a new admin for a smart contract -message MsgUpdateAdmin { - // Sender is the that actor that signed the messages - string sender = 1; - // NewAdmin address to be set - string new_admin = 2; - // Contract is the address of the smart contract - string contract = 3; -} - -// MsgUpdateAdminResponse returns empty data -message MsgUpdateAdminResponse {} - -// MsgClearAdmin removes any admin stored for a smart contract -message MsgClearAdmin { - // Sender is the that actor that signed the messages - string sender = 1; - // Contract is the address of the smart contract - string contract = 3; -} - -// MsgClearAdminResponse returns empty data -message MsgClearAdminResponse {} diff --git a/third_party/proto/cosmwasm/wasm/v1beta1/types.proto b/third_party/proto/cosmwasm/wasm/v1beta1/types.proto deleted file mode 100644 index 6e17eeae..00000000 --- a/third_party/proto/cosmwasm/wasm/v1beta1/types.proto +++ /dev/null @@ -1,143 +0,0 @@ -syntax = "proto3"; -package cosmwasm.wasm.v1beta1; - -import "cosmos_proto/cosmos.proto"; -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/CosmWasm/wasmd/x/wasm/types"; -option (gogoproto.goproto_getters_all) = false; -option (gogoproto.equal_all) = true; - -// AccessType permission types -enum AccessType { - option (gogoproto.goproto_enum_prefix) = false; - option (gogoproto.goproto_enum_stringer) = false; - // AccessTypeUnspecified placeholder for empty value - ACCESS_TYPE_UNSPECIFIED = 0 - [ (gogoproto.enumvalue_customname) = "AccessTypeUnspecified" ]; - // AccessTypeNobody forbidden - ACCESS_TYPE_NOBODY = 1 - [ (gogoproto.enumvalue_customname) = "AccessTypeNobody" ]; - // AccessTypeOnlyAddress restricted to an address - ACCESS_TYPE_ONLY_ADDRESS = 2 - [ (gogoproto.enumvalue_customname) = "AccessTypeOnlyAddress" ]; - // AccessTypeEverybody unrestricted - ACCESS_TYPE_EVERYBODY = 3 - [ (gogoproto.enumvalue_customname) = "AccessTypeEverybody" ]; -} - -// AccessTypeParam -message AccessTypeParam { - option (gogoproto.goproto_stringer) = true; - AccessType value = 1 [ (gogoproto.moretags) = "yaml:\"value\"" ]; -} - -// AccessConfig access control type. -message AccessConfig { - option (gogoproto.goproto_stringer) = true; - AccessType permission = 1 [ (gogoproto.moretags) = "yaml:\"permission\"" ]; - string address = 2 [ (gogoproto.moretags) = "yaml:\"address\"" ]; -} - -// Params defines the set of wasm parameters. -message Params { - option (gogoproto.goproto_stringer) = false; - AccessConfig code_upload_access = 1 [ - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"code_upload_access\"" - ]; - AccessType instantiate_default_permission = 2 - [ (gogoproto.moretags) = "yaml:\"instantiate_default_permission\"" ]; - uint64 max_wasm_code_size = 3 - [ (gogoproto.moretags) = "yaml:\"max_wasm_code_size\"" ]; -} - -// CodeInfo is data for the uploaded contract WASM code -message CodeInfo { - // CodeHash is the unique identifier created by wasmvm - bytes code_hash = 1; - // Creator address who initially stored the code - string creator = 2; - // Source is a valid absolute HTTPS URI to the contract's source code, - // optional - string source = 3; - // Builder is a valid docker image name with tag, optional - string builder = 4; - // InstantiateConfig access control to apply on contract creation, optional - AccessConfig instantiate_config = 5 [ (gogoproto.nullable) = false ]; -} - -// ContractInfo stores a WASM contract instance -message ContractInfo { - option (gogoproto.equal) = true; - - // CodeID is the reference to the stored Wasm code - uint64 code_id = 1 [ (gogoproto.customname) = "CodeID" ]; - // Creator address who initially instantiated the contract - string creator = 2; - // Admin is an optional address that can execute migrations - string admin = 3; - // Label is optional metadata to be stored with a contract instance. - string label = 4; - // Created Tx position when the contract was instantiated. - // This data should kept internal and not be exposed via query results. Just - // use for sorting - AbsoluteTxPosition created = 5; - string ibc_port_id = 6 [ (gogoproto.customname) = "IBCPortID" ]; - - // Extension is an extension point to store custom metadata within the - // persistence model. - google.protobuf.Any extension = 7 - [ (cosmos_proto.accepts_interface) = "ContractInfoExtension" ]; -} - -// ContractCodeHistoryOperationType actions that caused a code change -enum ContractCodeHistoryOperationType { - option (gogoproto.goproto_enum_prefix) = false; - // ContractCodeHistoryOperationTypeUnspecified placeholder for empty value - CONTRACT_CODE_HISTORY_OPERATION_TYPE_UNSPECIFIED = 0 - [ (gogoproto.enumvalue_customname) = - "ContractCodeHistoryOperationTypeUnspecified" ]; - // ContractCodeHistoryOperationTypeInit on chain contract instantiation - CONTRACT_CODE_HISTORY_OPERATION_TYPE_INIT = 1 - [ (gogoproto.enumvalue_customname) = - "ContractCodeHistoryOperationTypeInit" ]; - // ContractCodeHistoryOperationTypeMigrate code migration - CONTRACT_CODE_HISTORY_OPERATION_TYPE_MIGRATE = 2 - [ (gogoproto.enumvalue_customname) = - "ContractCodeHistoryOperationTypeMigrate" ]; - // ContractCodeHistoryOperationTypeGenesis based on genesis data - CONTRACT_CODE_HISTORY_OPERATION_TYPE_GENESIS = 3 - [ (gogoproto.enumvalue_customname) = - "ContractCodeHistoryOperationTypeGenesis" ]; -} - -// ContractCodeHistoryEntry metadata to a contract. -message ContractCodeHistoryEntry { - ContractCodeHistoryOperationType operation = 1; - // CodeID is the reference to the stored WASM code - uint64 code_id = 2 [ (gogoproto.customname) = "CodeID" ]; - // Updated Tx position when the operation was executed. - AbsoluteTxPosition updated = 3; - bytes msg = 4 [ (gogoproto.casttype) = "encoding/json.RawMessage" ]; -} - -// AbsoluteTxPosition is a unique transaction position that allows for global -// ordering of transactions. -message AbsoluteTxPosition { - // BlockHeight is the block the contract was created at - uint64 block_height = 1; - // TxIndex is a monotonic counter within the block (actual transaction index, - // or gas consumed) - uint64 tx_index = 2; -} - -// Model is a struct that holds a KV pair -message Model { - // hex-encode key to read it better (this is often ascii) - bytes key = 1 [ (gogoproto.casttype) = - "github.com/tendermint/tendermint/libs/bytes.HexBytes" ]; - // base64-encode raw value - bytes value = 2; -} diff --git a/third_party/proto/gogoproto/gogo.proto b/third_party/proto/gogoproto/gogo.proto deleted file mode 100644 index 49e78f99..00000000 --- a/third_party/proto/gogoproto/gogo.proto +++ /dev/null @@ -1,145 +0,0 @@ -// Protocol Buffers for Go with Gadgets -// -// Copyright (c) 2013, The GoGo Authors. All rights reserved. -// http://github.com/gogo/protobuf -// -// 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. -// -// 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 = "proto2"; -package gogoproto; - -import "google/protobuf/descriptor.proto"; - -option java_package = "com.google.protobuf"; -option java_outer_classname = "GoGoProtos"; -option go_package = "github.com/gogo/protobuf/gogoproto"; - -extend google.protobuf.EnumOptions { - optional bool goproto_enum_prefix = 62001; - optional bool goproto_enum_stringer = 62021; - optional bool enum_stringer = 62022; - optional string enum_customname = 62023; - optional bool enumdecl = 62024; -} - -extend google.protobuf.EnumValueOptions { - optional string enumvalue_customname = 66001; -} - -extend google.protobuf.FileOptions { - optional bool goproto_getters_all = 63001; - optional bool goproto_enum_prefix_all = 63002; - optional bool goproto_stringer_all = 63003; - optional bool verbose_equal_all = 63004; - optional bool face_all = 63005; - optional bool gostring_all = 63006; - optional bool populate_all = 63007; - optional bool stringer_all = 63008; - optional bool onlyone_all = 63009; - - optional bool equal_all = 63013; - optional bool description_all = 63014; - optional bool testgen_all = 63015; - optional bool benchgen_all = 63016; - optional bool marshaler_all = 63017; - optional bool unmarshaler_all = 63018; - optional bool stable_marshaler_all = 63019; - - optional bool sizer_all = 63020; - - optional bool goproto_enum_stringer_all = 63021; - optional bool enum_stringer_all = 63022; - - optional bool unsafe_marshaler_all = 63023; - optional bool unsafe_unmarshaler_all = 63024; - - optional bool goproto_extensions_map_all = 63025; - optional bool goproto_unrecognized_all = 63026; - optional bool gogoproto_import = 63027; - optional bool protosizer_all = 63028; - optional bool compare_all = 63029; - optional bool typedecl_all = 63030; - optional bool enumdecl_all = 63031; - - optional bool goproto_registration = 63032; - optional bool messagename_all = 63033; - - optional bool goproto_sizecache_all = 63034; - optional bool goproto_unkeyed_all = 63035; -} - -extend google.protobuf.MessageOptions { - optional bool goproto_getters = 64001; - optional bool goproto_stringer = 64003; - optional bool verbose_equal = 64004; - optional bool face = 64005; - optional bool gostring = 64006; - optional bool populate = 64007; - optional bool stringer = 67008; - optional bool onlyone = 64009; - - optional bool equal = 64013; - optional bool description = 64014; - optional bool testgen = 64015; - optional bool benchgen = 64016; - optional bool marshaler = 64017; - optional bool unmarshaler = 64018; - optional bool stable_marshaler = 64019; - - optional bool sizer = 64020; - - optional bool unsafe_marshaler = 64023; - optional bool unsafe_unmarshaler = 64024; - - optional bool goproto_extensions_map = 64025; - optional bool goproto_unrecognized = 64026; - - optional bool protosizer = 64028; - optional bool compare = 64029; - - optional bool typedecl = 64030; - - optional bool messagename = 64033; - - optional bool goproto_sizecache = 64034; - optional bool goproto_unkeyed = 64035; -} - -extend google.protobuf.FieldOptions { - optional bool nullable = 65001; - optional bool embed = 65002; - optional string customtype = 65003; - optional string customname = 65004; - optional string jsontag = 65005; - optional string moretags = 65006; - optional string casttype = 65007; - optional string castkey = 65008; - optional string castvalue = 65009; - - optional bool stdtime = 65010; - optional bool stdduration = 65011; - optional bool wktpointer = 65012; - - optional string castrepeated = 65013; -} diff --git a/third_party/proto/google/api/annotations.proto b/third_party/proto/google/api/annotations.proto deleted file mode 100644 index 85c361b4..00000000 --- a/third_party/proto/google/api/annotations.proto +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 2015, Google Inc. -// -// 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/api/http.proto"; -import "google/protobuf/descriptor.proto"; - -option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; -option java_multiple_files = true; -option java_outer_classname = "AnnotationsProto"; -option java_package = "com.google.api"; -option objc_class_prefix = "GAPI"; - -extend google.protobuf.MethodOptions { - // See `HttpRule`. - HttpRule http = 72295728; -} diff --git a/third_party/proto/google/api/http.proto b/third_party/proto/google/api/http.proto deleted file mode 100644 index 2bd3a19b..00000000 --- a/third_party/proto/google/api/http.proto +++ /dev/null @@ -1,318 +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; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; -option java_multiple_files = true; -option java_outer_classname = "HttpProto"; -option java_package = "com.google.api"; -option objc_class_prefix = "GAPI"; - - -// Defines the HTTP configuration for an API service. It contains a list of -// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method -// to one or more HTTP REST API methods. -message Http { - // A list of HTTP configuration rules that apply to individual API methods. - // - // **NOTE:** All service configuration rules follow "last one wins" order. - repeated HttpRule rules = 1; - - // When set to true, URL path parmeters will be fully URI-decoded except in - // cases of single segment matches in reserved expansion, where "%2F" will be - // left encoded. - // - // The default behavior is to not decode RFC 6570 reserved characters in multi - // segment matches. - bool fully_decode_reserved_expansion = 2; -} - -// `HttpRule` defines the mapping of an RPC method to one or more HTTP -// REST API methods. The mapping specifies how different portions of the RPC -// request message are mapped to URL path, URL query parameters, and -// HTTP request body. The mapping is typically specified as an -// `google.api.http` annotation on the RPC method, -// see "google/api/annotations.proto" for details. -// -// The mapping consists of a field specifying the path template and -// method kind. The path template can refer to fields in the request -// message, as in the example below which describes a REST GET -// operation on a resource collection of messages: -// -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}"; -// } -// } -// message GetMessageRequest { -// message SubMessage { -// string subfield = 1; -// } -// string message_id = 1; // mapped to the URL -// SubMessage sub = 2; // `sub.subfield` is url-mapped -// } -// message Message { -// string text = 1; // content of the resource -// } -// -// The same http annotation can alternatively be expressed inside the -// `GRPC API Configuration` YAML file. -// -// http: -// rules: -// - selector: .Messaging.GetMessage -// get: /v1/messages/{message_id}/{sub.subfield} -// -// This definition enables an automatic, bidrectional mapping of HTTP -// JSON to RPC. Example: -// -// HTTP | RPC -// -----|----- -// `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))` -// -// In general, not only fields but also field paths can be referenced -// from a path pattern. Fields mapped to the path pattern cannot be -// repeated and must have a primitive (non-message) type. -// -// Any fields in the request message which are not bound by the path -// pattern automatically become (optional) HTTP query -// parameters. Assume the following definition of the request message: -// -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http).get = "/v1/messages/{message_id}"; -// } -// } -// message GetMessageRequest { -// message SubMessage { -// string subfield = 1; -// } -// string message_id = 1; // mapped to the URL -// int64 revision = 2; // becomes a parameter -// SubMessage sub = 3; // `sub.subfield` becomes a parameter -// } -// -// -// This enables a HTTP JSON to RPC mapping as below: -// -// HTTP | RPC -// -----|----- -// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))` -// -// Note that fields which are mapped to HTTP parameters must have a -// primitive type or a repeated primitive type. Message types are not -// allowed. In the case of a repeated type, the parameter can be -// repeated in the URL, as in `...?param=A¶m=B`. -// -// For HTTP method kinds which allow a request body, the `body` field -// specifies the mapping. Consider a REST update method on the -// message resource collection: -// -// -// service Messaging { -// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { -// option (google.api.http) = { -// put: "/v1/messages/{message_id}" -// body: "message" -// }; -// } -// } -// message UpdateMessageRequest { -// string message_id = 1; // mapped to the URL -// Message message = 2; // mapped to the body -// } -// -// -// The following HTTP JSON to RPC mapping is enabled, where the -// representation of the JSON in the request body is determined by -// protos JSON encoding: -// -// HTTP | RPC -// -----|----- -// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })` -// -// The special name `*` can be used in the body mapping to define that -// every field not bound by the path template should be mapped to the -// request body. This enables the following alternative definition of -// the update method: -// -// service Messaging { -// rpc UpdateMessage(Message) returns (Message) { -// option (google.api.http) = { -// put: "/v1/messages/{message_id}" -// body: "*" -// }; -// } -// } -// message Message { -// string message_id = 1; -// string text = 2; -// } -// -// -// The following HTTP JSON to RPC mapping is enabled: -// -// HTTP | RPC -// -----|----- -// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")` -// -// Note that when using `*` in the body mapping, it is not possible to -// have HTTP parameters, as all fields not bound by the path end in -// the body. This makes this option more rarely used in practice of -// defining REST APIs. The common usage of `*` is in custom methods -// which don't use the URL at all for transferring data. -// -// It is possible to define multiple HTTP methods for one RPC by using -// the `additional_bindings` option. Example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get: "/v1/messages/{message_id}" -// additional_bindings { -// get: "/v1/users/{user_id}/messages/{message_id}" -// } -// }; -// } -// } -// message GetMessageRequest { -// string message_id = 1; -// string user_id = 2; -// } -// -// -// This enables the following two alternative HTTP JSON to RPC -// mappings: -// -// HTTP | RPC -// -----|----- -// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` -// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")` -// -// # Rules for HTTP mapping -// -// The rules for mapping HTTP path, query parameters, and body fields -// to the request message are as follows: -// -// 1. The `body` field specifies either `*` or a field path, or is -// omitted. If omitted, it indicates there is no HTTP request body. -// 2. Leaf fields (recursive expansion of nested messages in the -// request) can be classified into three types: -// (a) Matched in the URL template. -// (b) Covered by body (if body is `*`, everything except (a) fields; -// else everything under the body field) -// (c) All other fields. -// 3. URL query parameters found in the HTTP request are mapped to (c) fields. -// 4. Any body sent with an HTTP request can contain only (b) fields. -// -// The syntax of the path template is as follows: -// -// Template = "/" Segments [ Verb ] ; -// Segments = Segment { "/" Segment } ; -// Segment = "*" | "**" | LITERAL | Variable ; -// Variable = "{" FieldPath [ "=" Segments ] "}" ; -// FieldPath = IDENT { "." IDENT } ; -// Verb = ":" LITERAL ; -// -// The syntax `*` matches a single path segment. The syntax `**` matches zero -// or more path segments, which must be the last part of the path except the -// `Verb`. The syntax `LITERAL` matches literal text in the path. -// -// The syntax `Variable` matches part of the URL path as specified by its -// template. A variable template must not contain other variables. If a variable -// matches a single path segment, its template may be omitted, e.g. `{var}` -// is equivalent to `{var=*}`. -// -// If a variable contains exactly one path segment, such as `"{var}"` or -// `"{var=*}"`, when such a variable is expanded into a URL path, all characters -// except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the -// Discovery Document as `{var}`. -// -// If a variable contains one or more path segments, such as `"{var=foo/*}"` -// or `"{var=**}"`, when such a variable is expanded into a URL path, all -// characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables -// show up in the Discovery Document as `{+var}`. -// -// NOTE: While the single segment variable matches the semantics of -// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 -// Simple String Expansion, the multi segment variable **does not** match -// RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion -// does not expand special characters like `?` and `#`, which would lead -// to invalid URLs. -// -// NOTE: the field paths in variables and in the `body` must not refer to -// repeated fields or map fields. -message HttpRule { - // Selects methods to which this rule applies. - // - // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. - string selector = 1; - - // Determines the URL pattern is matched by this rules. This pattern can be - // used with any of the {get|put|post|delete|patch} methods. A custom method - // can be defined using the 'custom' field. - oneof pattern { - // Used for listing and getting information about resources. - string get = 2; - - // Used for updating a resource. - string put = 3; - - // Used for creating a resource. - string post = 4; - - // Used for deleting a resource. - string delete = 5; - - // Used for updating a resource. - string patch = 6; - - // The custom pattern is used for specifying an HTTP method that is not - // included in the `pattern` field, such as HEAD, or "*" to leave the - // HTTP method unspecified for this rule. The wild-card rule is useful - // for services that provide content to Web (HTML) clients. - CustomHttpPattern custom = 8; - } - - // The name of the request field whose value is mapped to the HTTP body, or - // `*` for mapping all fields not captured by the path pattern to the HTTP - // body. NOTE: the referred field must not be a repeated field and must be - // present at the top-level of request message type. - string body = 7; - - // Optional. The name of the response field whose value is mapped to the HTTP - // body of response. Other response fields are ignored. When - // not set, the response message will be used as HTTP body of response. - string response_body = 12; - - // Additional HTTP bindings for the selector. Nested bindings must - // not contain an `additional_bindings` field themselves (that is, - // the nesting may only be one level deep). - repeated HttpRule additional_bindings = 11; -} - -// A custom pattern is used for defining custom HTTP verb. -message CustomHttpPattern { - // The name of this custom HTTP verb. - string kind = 1; - - // The path matched by this custom verb. - string path = 2; -} diff --git a/third_party/proto/google/api/httpbody.proto b/third_party/proto/google/api/httpbody.proto deleted file mode 100644 index 4428515c..00000000 --- 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 58b51158..00000000 --- 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/google/protobuf/descriptor.proto b/third_party/proto/google/protobuf/descriptor.proto deleted file mode 100644 index 9f0ce6cd..00000000 --- a/third_party/proto/google/protobuf/descriptor.proto +++ /dev/null @@ -1,909 +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. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// The messages in this file describe the definitions found in .proto files. -// A valid .proto file can be translated directly to a FileDescriptorProto -// without any other information (e.g. without reading its imports). - - -syntax = "proto2"; - -package google.protobuf; - -option go_package = "google.golang.org/protobuf/types/descriptorpb"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "DescriptorProtos"; -option csharp_namespace = "Google.Protobuf.Reflection"; -option objc_class_prefix = "GPB"; -option cc_enable_arenas = true; - -// descriptor.proto must be optimized for speed because reflection-based -// algorithms don't work during bootstrapping. -option optimize_for = SPEED; - -// The protocol compiler can output a FileDescriptorSet containing the .proto -// files it parses. -message FileDescriptorSet { - repeated FileDescriptorProto file = 1; -} - -// Describes a complete .proto file. -message FileDescriptorProto { - optional string name = 1; // file name, relative to root of source tree - optional string package = 2; // e.g. "foo", "foo.bar", etc. - - // Names of files imported by this file. - repeated string dependency = 3; - // Indexes of the public imported files in the dependency list above. - repeated int32 public_dependency = 10; - // Indexes of the weak imported files in the dependency list. - // For Google-internal migration only. Do not use. - repeated int32 weak_dependency = 11; - - // All top-level definitions in this file. - repeated DescriptorProto message_type = 4; - repeated EnumDescriptorProto enum_type = 5; - repeated ServiceDescriptorProto service = 6; - repeated FieldDescriptorProto extension = 7; - - optional FileOptions options = 8; - - // This field contains optional information about the original source code. - // You may safely remove this entire field without harming runtime - // functionality of the descriptors -- the information is needed only by - // development tools. - optional SourceCodeInfo source_code_info = 9; - - // The syntax of the proto file. - // The supported values are "proto2" and "proto3". - optional string syntax = 12; -} - -// Describes a message type. -message DescriptorProto { - optional string name = 1; - - repeated FieldDescriptorProto field = 2; - repeated FieldDescriptorProto extension = 6; - - repeated DescriptorProto nested_type = 3; - repeated EnumDescriptorProto enum_type = 4; - - message ExtensionRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Exclusive. - - optional ExtensionRangeOptions options = 3; - } - repeated ExtensionRange extension_range = 5; - - repeated OneofDescriptorProto oneof_decl = 8; - - optional MessageOptions options = 7; - - // Range of reserved tag numbers. Reserved tag numbers may not be used by - // fields or extension ranges in the same message. Reserved ranges may - // not overlap. - message ReservedRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Exclusive. - } - repeated ReservedRange reserved_range = 9; - // Reserved field names, which may not be used by fields in the same message. - // A given name may only be reserved once. - repeated string reserved_name = 10; -} - -message ExtensionRangeOptions { - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -// Describes a field within a message. -message FieldDescriptorProto { - enum Type { - // 0 is reserved for errors. - // Order is weird for historical reasons. - TYPE_DOUBLE = 1; - TYPE_FLOAT = 2; - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if - // negative values are likely. - TYPE_INT64 = 3; - TYPE_UINT64 = 4; - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if - // negative values are likely. - TYPE_INT32 = 5; - TYPE_FIXED64 = 6; - TYPE_FIXED32 = 7; - TYPE_BOOL = 8; - TYPE_STRING = 9; - // Tag-delimited aggregate. - // Group type is deprecated and not supported in proto3. However, Proto3 - // implementations should still be able to parse the group wire format and - // treat group fields as unknown fields. - TYPE_GROUP = 10; - TYPE_MESSAGE = 11; // Length-delimited aggregate. - - // New in version 2. - TYPE_BYTES = 12; - TYPE_UINT32 = 13; - TYPE_ENUM = 14; - TYPE_SFIXED32 = 15; - TYPE_SFIXED64 = 16; - TYPE_SINT32 = 17; // Uses ZigZag encoding. - TYPE_SINT64 = 18; // Uses ZigZag encoding. - } - - enum Label { - // 0 is reserved for errors - LABEL_OPTIONAL = 1; - LABEL_REQUIRED = 2; - LABEL_REPEATED = 3; - } - - optional string name = 1; - optional int32 number = 3; - optional Label label = 4; - - // If type_name is set, this need not be set. If both this and type_name - // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. - optional Type type = 5; - - // For message and enum types, this is the name of the type. If the name - // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - // rules are used to find the type (i.e. first the nested types within this - // message are searched, then within the parent, on up to the root - // namespace). - optional string type_name = 6; - - // For extensions, this is the name of the type being extended. It is - // resolved in the same manner as type_name. - optional string extendee = 2; - - // For numeric types, contains the original text representation of the value. - // For booleans, "true" or "false". - // For strings, contains the default text contents (not escaped in any way). - // For bytes, contains the C escaped value. All bytes >= 128 are escaped. - // TODO(kenton): Base-64 encode? - optional string default_value = 7; - - // If set, gives the index of a oneof in the containing type's oneof_decl - // list. This field is a member of that oneof. - optional int32 oneof_index = 9; - - // JSON name of this field. The value is set by protocol compiler. If the - // user has set a "json_name" option on this field, that option's value - // will be used. Otherwise, it's deduced from the field's name by converting - // it to camelCase. - optional string json_name = 10; - - optional FieldOptions options = 8; - - // If true, this is a proto3 "optional". When a proto3 field is optional, it - // tracks presence regardless of field type. - // - // When proto3_optional is true, this field must be belong to a oneof to - // signal to old proto3 clients that presence is tracked for this field. This - // oneof is known as a "synthetic" oneof, and this field must be its sole - // member (each proto3 optional field gets its own synthetic oneof). Synthetic - // oneofs exist in the descriptor only, and do not generate any API. Synthetic - // oneofs must be ordered after all "real" oneofs. - // - // For message fields, proto3_optional doesn't create any semantic change, - // since non-repeated message fields always track presence. However it still - // indicates the semantic detail of whether the user wrote "optional" or not. - // This can be useful for round-tripping the .proto file. For consistency we - // give message fields a synthetic oneof also, even though it is not required - // to track presence. This is especially important because the parser can't - // tell if a field is a message or an enum, so it must always create a - // synthetic oneof. - // - // Proto2 optional fields do not set this flag, because they already indicate - // optional with `LABEL_OPTIONAL`. - optional bool proto3_optional = 17; -} - -// Describes a oneof. -message OneofDescriptorProto { - optional string name = 1; - optional OneofOptions options = 2; -} - -// Describes an enum type. -message EnumDescriptorProto { - optional string name = 1; - - repeated EnumValueDescriptorProto value = 2; - - optional EnumOptions options = 3; - - // Range of reserved numeric values. Reserved values may not be used by - // entries in the same enum. Reserved ranges may not overlap. - // - // Note that this is distinct from DescriptorProto.ReservedRange in that it - // is inclusive such that it can appropriately represent the entire int32 - // domain. - message EnumReservedRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Inclusive. - } - - // Range of reserved numeric values. Reserved numeric values may not be used - // by enum values in the same enum declaration. Reserved ranges may not - // overlap. - repeated EnumReservedRange reserved_range = 4; - - // Reserved enum value names, which may not be reused. A given name may only - // be reserved once. - repeated string reserved_name = 5; -} - -// Describes a value within an enum. -message EnumValueDescriptorProto { - optional string name = 1; - optional int32 number = 2; - - optional EnumValueOptions options = 3; -} - -// Describes a service. -message ServiceDescriptorProto { - optional string name = 1; - repeated MethodDescriptorProto method = 2; - - optional ServiceOptions options = 3; -} - -// Describes a method of a service. -message MethodDescriptorProto { - optional string name = 1; - - // Input and output type names. These are resolved in the same way as - // FieldDescriptorProto.type_name, but must refer to a message type. - optional string input_type = 2; - optional string output_type = 3; - - optional MethodOptions options = 4; - - // Identifies if client streams multiple client messages - optional bool client_streaming = 5 [default = false]; - // Identifies if server streams multiple server messages - optional bool server_streaming = 6 [default = false]; -} - - -// =================================================================== -// Options - -// Each of the definitions above may have "options" attached. These are -// just annotations which may cause code to be generated slightly differently -// or may contain hints for code that manipulates protocol messages. -// -// Clients may define custom options as extensions of the *Options messages. -// These extensions may not yet be known at parsing time, so the parser cannot -// store the values in them. Instead it stores them in a field in the *Options -// message called uninterpreted_option. This field must have the same name -// across all *Options messages. We then use this field to populate the -// extensions when we build a descriptor, at which point all protos have been -// parsed and so all extensions are known. -// -// Extension numbers for custom options may be chosen as follows: -// * For options which will only be used within a single application or -// organization, or for experimental options, use field numbers 50000 -// through 99999. It is up to you to ensure that you do not use the -// same number for multiple options. -// * For options which will be published and used publicly by multiple -// independent entities, e-mail protobuf-global-extension-registry@google.com -// to reserve extension numbers. Simply provide your project name (e.g. -// Objective-C plugin) and your project website (if available) -- there's no -// need to explain how you intend to use them. Usually you only need one -// extension number. You can declare multiple options with only one extension -// number by putting them in a sub-message. See the Custom Options section of -// the docs for examples: -// https://developers.google.com/protocol-buffers/docs/proto#options -// If this turns out to be popular, a web service will be set up -// to automatically assign option numbers. - -message FileOptions { - - // Sets the Java package where classes generated from this .proto will be - // placed. By default, the proto package is used, but this is often - // inappropriate because proto packages do not normally start with backwards - // domain names. - optional string java_package = 1; - - - // If set, all the classes from the .proto file are wrapped in a single - // outer class with the given name. This applies to both Proto1 - // (equivalent to the old "--one_java_file" option) and Proto2 (where - // a .proto always translates to a single class, but you may want to - // explicitly choose the class name). - optional string java_outer_classname = 8; - - // If set true, then the Java code generator will generate a separate .java - // file for each top-level message, enum, and service defined in the .proto - // file. Thus, these types will *not* be nested inside the outer class - // named by java_outer_classname. However, the outer class will still be - // generated to contain the file's getDescriptor() method as well as any - // top-level extensions defined in the file. - optional bool java_multiple_files = 10 [default = false]; - - // This option does nothing. - optional bool java_generate_equals_and_hash = 20 [deprecated=true]; - - // If set true, then the Java2 code generator will generate code that - // throws an exception whenever an attempt is made to assign a non-UTF-8 - // byte sequence to a string field. - // Message reflection will do the same. - // However, an extension field still accepts non-UTF-8 byte sequences. - // This option has no effect on when used with the lite runtime. - optional bool java_string_check_utf8 = 27 [default = false]; - - - // Generated classes can be optimized for speed or code size. - enum OptimizeMode { - SPEED = 1; // Generate complete code for parsing, serialization, - // etc. - CODE_SIZE = 2; // Use ReflectionOps to implement these methods. - LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. - } - optional OptimizeMode optimize_for = 9 [default = SPEED]; - - // Sets the Go package where structs generated from this .proto will be - // placed. If omitted, the Go package will be derived from the following: - // - The basename of the package import path, if provided. - // - Otherwise, the package statement in the .proto file, if present. - // - Otherwise, the basename of the .proto file, without extension. - optional string go_package = 11; - - - - - // Should generic services be generated in each language? "Generic" services - // are not specific to any particular RPC system. They are generated by the - // main code generators in each language (without additional plugins). - // Generic services were the only kind of service generation supported by - // early versions of google.protobuf. - // - // Generic services are now considered deprecated in favor of using plugins - // that generate code specific to your particular RPC system. Therefore, - // these default to false. Old code which depends on generic services should - // explicitly set them to true. - optional bool cc_generic_services = 16 [default = false]; - optional bool java_generic_services = 17 [default = false]; - optional bool py_generic_services = 18 [default = false]; - optional bool php_generic_services = 42 [default = false]; - - // Is this file deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for everything in the file, or it will be completely ignored; in the very - // least, this is a formalization for deprecating files. - optional bool deprecated = 23 [default = false]; - - // Enables the use of arenas for the proto messages in this file. This applies - // only to generated classes for C++. - optional bool cc_enable_arenas = 31 [default = true]; - - - // Sets the objective c class prefix which is prepended to all objective c - // generated classes from this .proto. There is no default. - optional string objc_class_prefix = 36; - - // Namespace for generated classes; defaults to the package. - optional string csharp_namespace = 37; - - // By default Swift generators will take the proto package and CamelCase it - // replacing '.' with underscore and use that to prefix the types/symbols - // defined. When this options is provided, they will use this value instead - // to prefix the types/symbols defined. - optional string swift_prefix = 39; - - // Sets the php class prefix which is prepended to all php generated classes - // from this .proto. Default is empty. - optional string php_class_prefix = 40; - - // Use this option to change the namespace of php generated classes. Default - // is empty. When this option is empty, the package name will be used for - // determining the namespace. - optional string php_namespace = 41; - - // Use this option to change the namespace of php generated metadata classes. - // Default is empty. When this option is empty, the proto file name will be - // used for determining the namespace. - optional string php_metadata_namespace = 44; - - // Use this option to change the package of ruby generated classes. Default - // is empty. When this option is not set, the package name will be used for - // determining the ruby package. - optional string ruby_package = 45; - - - // The parser stores options it doesn't recognize here. - // See the documentation for the "Options" section above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. - // See the documentation for the "Options" section above. - extensions 1000 to max; - - reserved 38; -} - -message MessageOptions { - // Set true to use the old proto1 MessageSet wire format for extensions. - // This is provided for backwards-compatibility with the MessageSet wire - // format. You should not use this for any other reason: It's less - // efficient, has fewer features, and is more complicated. - // - // The message must be defined exactly as follows: - // message Foo { - // option message_set_wire_format = true; - // extensions 4 to max; - // } - // Note that the message cannot have any defined fields; MessageSets only - // have extensions. - // - // All extensions of your type must be singular messages; e.g. they cannot - // be int32s, enums, or repeated messages. - // - // Because this is an option, the above two restrictions are not enforced by - // the protocol compiler. - optional bool message_set_wire_format = 1 [default = false]; - - // Disables the generation of the standard "descriptor()" accessor, which can - // conflict with a field of the same name. This is meant to make migration - // from proto1 easier; new code should avoid fields named "descriptor". - optional bool no_standard_descriptor_accessor = 2 [default = false]; - - // Is this message deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the message, or it will be completely ignored; in the very least, - // this is a formalization for deprecating messages. - optional bool deprecated = 3 [default = false]; - - // Whether the message is an automatically generated map entry type for the - // maps field. - // - // For maps fields: - // map map_field = 1; - // The parsed descriptor looks like: - // message MapFieldEntry { - // option map_entry = true; - // optional KeyType key = 1; - // optional ValueType value = 2; - // } - // repeated MapFieldEntry map_field = 1; - // - // Implementations may choose not to generate the map_entry=true message, but - // use a native map in the target language to hold the keys and values. - // The reflection APIs in such implementations still need to work as - // if the field is a repeated message field. - // - // NOTE: Do not set the option in .proto files. Always use the maps syntax - // instead. The option should only be implicitly set by the proto compiler - // parser. - optional bool map_entry = 7; - - reserved 8; // javalite_serializable - reserved 9; // javanano_as_lite - - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message FieldOptions { - // The ctype option instructs the C++ code generator to use a different - // representation of the field than it normally would. See the specific - // options below. This option is not yet implemented in the open source - // release -- sorry, we'll try to include it in a future version! - optional CType ctype = 1 [default = STRING]; - enum CType { - // Default mode. - STRING = 0; - - CORD = 1; - - STRING_PIECE = 2; - } - // The packed option can be enabled for repeated primitive fields to enable - // a more efficient representation on the wire. Rather than repeatedly - // writing the tag and type for each element, the entire array is encoded as - // a single length-delimited blob. In proto3, only explicit setting it to - // false will avoid using packed encoding. - optional bool packed = 2; - - // The jstype option determines the JavaScript type used for values of the - // field. The option is permitted only for 64 bit integral and fixed types - // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING - // is represented as JavaScript string, which avoids loss of precision that - // can happen when a large value is converted to a floating point JavaScript. - // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to - // use the JavaScript "number" type. The behavior of the default option - // JS_NORMAL is implementation dependent. - // - // This option is an enum to permit additional types to be added, e.g. - // goog.math.Integer. - optional JSType jstype = 6 [default = JS_NORMAL]; - enum JSType { - // Use the default type. - JS_NORMAL = 0; - - // Use JavaScript strings. - JS_STRING = 1; - - // Use JavaScript numbers. - JS_NUMBER = 2; - } - - // Should this field be parsed lazily? Lazy applies only to message-type - // fields. It means that when the outer message is initially parsed, the - // inner message's contents will not be parsed but instead stored in encoded - // form. The inner message will actually be parsed when it is first accessed. - // - // This is only a hint. Implementations are free to choose whether to use - // eager or lazy parsing regardless of the value of this option. However, - // setting this option true suggests that the protocol author believes that - // using lazy parsing on this field is worth the additional bookkeeping - // overhead typically needed to implement it. - // - // This option does not affect the public interface of any generated code; - // all method signatures remain the same. Furthermore, thread-safety of the - // interface is not affected by this option; const methods remain safe to - // call from multiple threads concurrently, while non-const methods continue - // to require exclusive access. - // - // - // Note that implementations may choose not to check required fields within - // a lazy sub-message. That is, calling IsInitialized() on the outer message - // may return true even if the inner message has missing required fields. - // This is necessary because otherwise the inner message would have to be - // parsed in order to perform the check, defeating the purpose of lazy - // parsing. An implementation which chooses not to check required fields - // must be consistent about it. That is, for any particular sub-message, the - // implementation must either *always* check its required fields, or *never* - // check its required fields, regardless of whether or not the message has - // been parsed. - optional bool lazy = 5 [default = false]; - - // Is this field deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for accessors, or it will be completely ignored; in the very least, this - // is a formalization for deprecating fields. - optional bool deprecated = 3 [default = false]; - - // For Google-internal migration only. Do not use. - optional bool weak = 10 [default = false]; - - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; - - reserved 4; // removed jtype -} - -message OneofOptions { - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message EnumOptions { - - // Set this option to true to allow mapping different tag names to the same - // value. - optional bool allow_alias = 2; - - // Is this enum deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the enum, or it will be completely ignored; in the very least, this - // is a formalization for deprecating enums. - optional bool deprecated = 3 [default = false]; - - reserved 5; // javanano_as_lite - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message EnumValueOptions { - // Is this enum value deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the enum value, or it will be completely ignored; in the very least, - // this is a formalization for deprecating enum values. - optional bool deprecated = 1 [default = false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message ServiceOptions { - - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. - - // Is this service deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the service, or it will be completely ignored; in the very least, - // this is a formalization for deprecating services. - optional bool deprecated = 33 [default = false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message MethodOptions { - - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. - - // Is this method deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the method, or it will be completely ignored; in the very least, - // this is a formalization for deprecating methods. - optional bool deprecated = 33 [default = false]; - - // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, - // or neither? HTTP based RPC implementation may choose GET verb for safe - // methods, and PUT verb for idempotent methods instead of the default POST. - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0; - NO_SIDE_EFFECTS = 1; // implies idempotent - IDEMPOTENT = 2; // idempotent, but may have side effects - } - optional IdempotencyLevel idempotency_level = 34 - [default = IDEMPOTENCY_UNKNOWN]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - - -// A message representing a option the parser does not recognize. This only -// appears in options protos created by the compiler::Parser class. -// DescriptorPool resolves these when building Descriptor objects. Therefore, -// options protos in descriptor objects (e.g. returned by Descriptor::options(), -// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions -// in them. -message UninterpretedOption { - // The name of the uninterpreted option. Each string represents a segment in - // a dot-separated name. is_extension is true iff a segment represents an - // extension (denoted with parentheses in options specs in .proto files). - // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents - // "foo.(bar.baz).qux". - message NamePart { - required string name_part = 1; - required bool is_extension = 2; - } - repeated NamePart name = 2; - - // The value of the uninterpreted option, in whatever type the tokenizer - // identified it as during parsing. Exactly one of these should be set. - optional string identifier_value = 3; - optional uint64 positive_int_value = 4; - optional int64 negative_int_value = 5; - optional double double_value = 6; - optional bytes string_value = 7; - optional string aggregate_value = 8; -} - -// =================================================================== -// Optional source code info - -// Encapsulates information about the original source file from which a -// FileDescriptorProto was generated. -message SourceCodeInfo { - // A Location identifies a piece of source code in a .proto file which - // corresponds to a particular definition. This information is intended - // to be useful to IDEs, code indexers, documentation generators, and similar - // tools. - // - // For example, say we have a file like: - // message Foo { - // optional string foo = 1; - // } - // Let's look at just the field definition: - // optional string foo = 1; - // ^ ^^ ^^ ^ ^^^ - // a bc de f ghi - // We have the following locations: - // span path represents - // [a,i) [ 4, 0, 2, 0 ] The whole field definition. - // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). - // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). - // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). - // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - // - // Notes: - // - A location may refer to a repeated field itself (i.e. not to any - // particular index within it). This is used whenever a set of elements are - // logically enclosed in a single code segment. For example, an entire - // extend block (possibly containing multiple extension definitions) will - // have an outer location whose path refers to the "extensions" repeated - // field without an index. - // - Multiple locations may have the same path. This happens when a single - // logical declaration is spread out across multiple places. The most - // obvious example is the "extend" block again -- there may be multiple - // extend blocks in the same scope, each of which will have the same path. - // - A location's span is not always a subset of its parent's span. For - // example, the "extendee" of an extension declaration appears at the - // beginning of the "extend" block and is shared by all extensions within - // the block. - // - Just because a location's span is a subset of some other location's span - // does not mean that it is a descendant. For example, a "group" defines - // both a type and a field in a single declaration. Thus, the locations - // corresponding to the type and field and their components will overlap. - // - Code which tries to interpret locations should probably be designed to - // ignore those that it doesn't understand, as more types of locations could - // be recorded in the future. - repeated Location location = 1; - message Location { - // Identifies which part of the FileDescriptorProto was defined at this - // location. - // - // Each element is a field number or an index. They form a path from - // the root FileDescriptorProto to the place where the definition. For - // example, this path: - // [ 4, 3, 2, 7, 1 ] - // refers to: - // file.message_type(3) // 4, 3 - // .field(7) // 2, 7 - // .name() // 1 - // This is because FileDescriptorProto.message_type has field number 4: - // repeated DescriptorProto message_type = 4; - // and DescriptorProto.field has field number 2: - // repeated FieldDescriptorProto field = 2; - // and FieldDescriptorProto.name has field number 1: - // optional string name = 1; - // - // Thus, the above path gives the location of a field name. If we removed - // the last element: - // [ 4, 3, 2, 7 ] - // this path refers to the whole field declaration (from the beginning - // of the label to the terminating semicolon). - repeated int32 path = 1 [packed = true]; - - // Always has exactly three or four elements: start line, start column, - // end line (optional, otherwise assumed same as start line), end column. - // These are packed into a single field for efficiency. Note that line - // and column numbers are zero-based -- typically you will want to add - // 1 to each before displaying to a user. - repeated int32 span = 2 [packed = true]; - - // If this SourceCodeInfo represents a complete declaration, these are any - // comments appearing before and after the declaration which appear to be - // attached to the declaration. - // - // A series of line comments appearing on consecutive lines, with no other - // tokens appearing on those lines, will be treated as a single comment. - // - // leading_detached_comments will keep paragraphs of comments that appear - // before (but not connected to) the current element. Each paragraph, - // separated by empty lines, will be one comment element in the repeated - // field. - // - // Only the comment content is provided; comment markers (e.g. //) are - // stripped out. For block comments, leading whitespace and an asterisk - // will be stripped from the beginning of each line other than the first. - // Newlines are included in the output. - // - // Examples: - // - // optional int32 foo = 1; // Comment attached to foo. - // // Comment attached to bar. - // optional int32 bar = 2; - // - // optional string baz = 3; - // // Comment attached to baz. - // // Another line attached to baz. - // - // // Comment attached to qux. - // // - // // Another line attached to qux. - // optional double qux = 4; - // - // // Detached comment for corge. This is not leading or trailing comments - // // to qux or corge because there are blank lines separating it from - // // both. - // - // // Detached comment for corge paragraph 2. - // - // optional string corge = 5; - // /* Block comment attached - // * to corge. Leading asterisks - // * will be removed. */ - // /* Block comment attached to - // * grault. */ - // optional int32 grault = 6; - // - // // ignored detached comments. - optional string leading_comments = 3; - optional string trailing_comments = 4; - repeated string leading_detached_comments = 6; - } -} - -// Describes the relationship between generated code and its original source -// file. A GeneratedCodeInfo message is associated with only one generated -// source file, but may contain references to different source .proto files. -message GeneratedCodeInfo { - // An Annotation connects some span of text in generated code to an element - // of its generating .proto file. - repeated Annotation annotation = 1; - message Annotation { - // Identifies the element in the original source .proto file. This field - // is formatted the same as SourceCodeInfo.Location.path. - repeated int32 path = 1 [packed = true]; - - // Identifies the filesystem path to the original source .proto. - optional string source_file = 2; - - // Identifies the starting offset in bytes in the generated code - // that relates to the identified object. - optional int32 begin = 3; - - // Identifies the ending offset in bytes in the generated code that - // relates to the identified offset. The end offset should be one past - // the last relevant byte (so the length of the text = end - begin). - optional int32 end = 4; - } -} 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 9c6b78ac..00000000 --- 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/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 cd428413..00000000 --- a/third_party/proto/ibc/applications/transfer/v1/query.proto +++ /dev/null @@ -1,67 +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/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"; - } -} - -// 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; -} 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 b1c41f6a..00000000 --- a/third_party/proto/ibc/applications/transfer/v1/transfer.proto +++ /dev/null @@ -1,44 +0,0 @@ -syntax = "proto3"; - -package ibc.applications.transfer.v1; - -option go_package = "github.com/cosmos/ibc-go/modules/apps/transfer/types"; - -import "gogoproto/gogo.proto"; - -// FungibleTokenPacketData defines a struct for the packet payload -// See FungibleTokenPacketData spec: -// https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer#data-structures -message FungibleTokenPacketData { - // the token denomination to be transferred - string denom = 1; - // the token amount to be transferred - uint64 amount = 2; - // the sender address - string sender = 3; - // the recipient address on the destination chain - string receiver = 4; -} - -// 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 eb56b470..00000000 --- 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/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/ics/tree/master/spec/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 nanoseconds) relative to the current block timestamp. - // 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/core/channel/v1/channel.proto b/third_party/proto/ibc/core/channel/v1/channel.proto deleted file mode 100644 index edb39d04..00000000 --- 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/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/ics/tree/master/spec/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 75bf1fdb..00000000 --- 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/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 194fe867..00000000 --- a/third_party/proto/ibc/core/channel/v1/query.proto +++ /dev/null @@ -1,374 +0,0 @@ -syntax = "proto3"; - -package ibc.core.channel.v1; - -option go_package = "github.com/cosmos/ibc-go/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; -} - -// 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 59af0d3f..00000000 --- a/third_party/proto/ibc/core/channel/v1/tx.proto +++ /dev/null @@ -1,211 +0,0 @@ -syntax = "proto3"; - -package ibc.core.channel.v1; - -option go_package = "github.com/cosmos/ibc-go/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); -} - -// 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 {} - -// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel -// on Chain B. -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\""]; - 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 {} - -// 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 {} - -// 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 {} - -// 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 {} 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 88a6c343..00000000 --- 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/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 30592cf7..00000000 --- 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/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 36a51357..00000000 --- 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/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 35386adb..00000000 --- a/third_party/proto/ibc/core/client/v1/tx.proto +++ /dev/null @@ -1,100 +0,0 @@ -syntax = "proto3"; - -package ibc.core.client.v1; - -option go_package = "github.com/cosmos/ibc-go/modules/core/02-client/types"; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "ibc/core/client/v1/client.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 47d82394..00000000 --- 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/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 72c0ff7d..00000000 --- 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/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/ics/tree/master/spec/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 64f2e026..00000000 --- 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/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 ca90e0ee..00000000 --- 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/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 6318f9fd..00000000 --- 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/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 2451da32..00000000 --- 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/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 77e17bc3..00000000 --- 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/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 4ba0da25..00000000 --- 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/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 fdb659f6..00000000 --- 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/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 17a6cce4..00000000 --- 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/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/provenance/attribute/v1/attribute.proto b/third_party/proto/provenance/attribute/v1/attribute.proto deleted file mode 100644 index 4f8f131b..00000000 --- a/third_party/proto/provenance/attribute/v1/attribute.proto +++ /dev/null @@ -1,87 +0,0 @@ -syntax = "proto3"; -package provenance.attribute.v1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/provenance-io/provenance/x/attribute/types"; - -option java_package = "io.provenance.attribute.v1"; -option java_multiple_files = true; - -// Params defines the set of params for the attribute module. -message Params { - option (gogoproto.goproto_stringer) = false; - // maximum length of data to allow in an attribute value - uint32 max_value_length = 1; -} - -// Attribute holds a typed key/value structure for data associated with an account -message Attribute { - option (gogoproto.goproto_stringer) = false; - // The attribute name. - string name = 1; - // The attribute value. - bytes value = 2; - // The attribute value type. - AttributeType attribute_type = 3; - // The address the attribute is bound to - string address = 4; -} - -// AttributeType defines the type of the data stored in the attribute value -enum AttributeType { - // ATTRIBUTE_TYPE_UNSPECIFIED defines an unknown/invalid type - ATTRIBUTE_TYPE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "Unspecified"]; - // ATTRIBUTE_TYPE_UUID defines an attribute value that contains a string value representation of a V4 uuid - ATTRIBUTE_TYPE_UUID = 1 [(gogoproto.enumvalue_customname) = "UUID"]; - // ATTRIBUTE_TYPE_JSON defines an attribute value that contains a byte string containing json data - ATTRIBUTE_TYPE_JSON = 2 [(gogoproto.enumvalue_customname) = "JSON"]; - // ATTRIBUTE_TYPE_STRING defines an attribute value that contains a generic string value - ATTRIBUTE_TYPE_STRING = 3 [(gogoproto.enumvalue_customname) = "String"]; - // ATTRIBUTE_TYPE_URI defines an attribute value that contains a URI - ATTRIBUTE_TYPE_URI = 4 [(gogoproto.enumvalue_customname) = "Uri"]; - // ATTRIBUTE_TYPE_INT defines an attribute value that contains an integer (cast as int64) - ATTRIBUTE_TYPE_INT = 5 [(gogoproto.enumvalue_customname) = "Int"]; - // ATTRIBUTE_TYPE_FLOAT defines an attribute value that contains a float - ATTRIBUTE_TYPE_FLOAT = 6 [(gogoproto.enumvalue_customname) = "Float"]; - // ATTRIBUTE_TYPE_PROTO defines an attribute value that contains a serialized proto value in bytes - ATTRIBUTE_TYPE_PROTO = 7 [(gogoproto.enumvalue_customname) = "Proto"]; - // ATTRIBUTE_TYPE_BYTES defines an attribute value that contains an untyped array of bytes - ATTRIBUTE_TYPE_BYTES = 8 [(gogoproto.enumvalue_customname) = "Bytes"]; -} - -// EventAttributeAdd event emitted when attribute is added -message EventAttributeAdd { - string name = 1; - string value = 2; - string type = 3; - string account = 4; - string owner = 5; -} - -// EventAttributeUpdate event emitted when attribute is updated -message EventAttributeUpdate { - string name = 1; - string original_value = 2; - string original_type = 3; - string update_value = 4; - string update_type = 5; - string account = 6; - string owner = 7; -} - -// EventAttributeDelete event emitted when attribute is deleted -message EventAttributeDelete { - string name = 1; - string account = 2; - string owner = 3; -} - -// EventAttributeDistinctDelete event emitted when attribute is deleted with matching value -message EventAttributeDistinctDelete { - string name = 1; - string value = 2; - string attribute_type = 3; - string account = 4; - string owner = 5; -} \ No newline at end of file diff --git a/third_party/proto/provenance/attribute/v1/genesis.proto b/third_party/proto/provenance/attribute/v1/genesis.proto deleted file mode 100644 index 36d5399e..00000000 --- a/third_party/proto/provenance/attribute/v1/genesis.proto +++ /dev/null @@ -1,21 +0,0 @@ -syntax = "proto3"; -package provenance.attribute.v1; - -import "gogoproto/gogo.proto"; -import "provenance/attribute/v1/attribute.proto"; - -option go_package = "github.com/provenance-io/provenance/x/attribute/types"; -option java_package = "io.provenance.attribute.v1"; -option java_multiple_files = true; - -// GenesisState defines the attribute module's genesis state. -message GenesisState { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // params defines all the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false]; - - // deposits defines all the deposits present at genesis. - repeated Attribute attributes = 2 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/provenance/attribute/v1/query.proto b/third_party/proto/provenance/attribute/v1/query.proto deleted file mode 100644 index 2d379696..00000000 --- a/third_party/proto/provenance/attribute/v1/query.proto +++ /dev/null @@ -1,115 +0,0 @@ -syntax = "proto3"; -package provenance.attribute.v1; - -option go_package = "github.com/provenance-io/provenance/x/attribute/types"; - -option java_package = "io.provenance.attribute.v1"; -option java_multiple_files = true; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "provenance/attribute/v1/attribute.proto"; - -// Query defines the gRPC querier service for attribute module. -service Query { - // Params queries params of the attribute module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/provenance/attribute/v1/params"; - } - - // Attribute queries attributes on a given account (address) for one (or more) with the given name - rpc Attribute(QueryAttributeRequest) returns (QueryAttributeResponse) { - option (google.api.http).get = "/provenance/attribute/v1/attribute/{account}/{name}"; - } - - // Attributes queries attributes on a given account (address) for any defined attributes - rpc Attributes(QueryAttributesRequest) returns (QueryAttributesResponse) { - option (google.api.http).get = "/provenance/attribute/v1/attributes/{account}"; - } - - // Scan queries attributes on a given account (address) for any that match the provided suffix - rpc Scan(QueryScanRequest) returns (QueryScanResponse) { - option (google.api.http).get = "/provenance/attribute/v1/attribute/{account}/scan/{suffix}"; - } -} - -// 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]; -} - -// QueryAttributeRequest is the request type for the Query/Attribute method. -message QueryAttributeRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // account defines the address to query for. - string account = 1; - // name is the attribute name to query for - string name = 2; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 3; -} - -// QueryAttributeResponse is the response type for the Query/Attribute method. -message QueryAttributeResponse { - // a string containing the address of the account the attributes are assigned to. - string account = 1; - // a list of attribute values - repeated Attribute attributes = 2 [(gogoproto.nullable) = false]; - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageResponse pagination = 3; -} - -// QueryAttributesRequest is the request type for the Query/Attributes method. -message QueryAttributesRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // account defines the address to query for. - string account = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryAttributesResponse is the response type for the Query/Attribute method. -message QueryAttributesResponse { - // a string containing the address of the account the attributes are assigned to= - string account = 1; - // a list of attribute values - repeated Attribute attributes = 2 [(gogoproto.nullable) = false]; - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageResponse pagination = 3; -} - -// QueryScanRequest is the request type for the Query/Scan account attributes method. -message QueryScanRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // account defines the address to query for. - string account = 1; - - // name defines the partial attribute name to search for base on names being in RDNS format. - string suffix = 2; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 3; -} - -// QueryScanResponse is the response type for the Query/Attribute method. -message QueryScanResponse { - // a string containing the address of the account the attributes are assigned to= - string account = 1; - // a list of attribute values - repeated Attribute attributes = 2 [(gogoproto.nullable) = false]; - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageResponse pagination = 3; -} \ No newline at end of file diff --git a/third_party/proto/provenance/attribute/v1/tx.proto b/third_party/proto/provenance/attribute/v1/tx.proto deleted file mode 100644 index 6b1fe341..00000000 --- a/third_party/proto/provenance/attribute/v1/tx.proto +++ /dev/null @@ -1,115 +0,0 @@ -syntax = "proto3"; -package provenance.attribute.v1; - -option go_package = "github.com/provenance-io/provenance/x/attribute/types"; - -option java_package = "io.provenance.attribute.v1"; -option java_multiple_files = true; - -import "gogoproto/gogo.proto"; -import "provenance/attribute/v1/attribute.proto"; - -// Msg defines the bank Msg service. -service Msg { - // AddAttribute defines a method to verify a particular invariance. - rpc AddAttribute(MsgAddAttributeRequest) returns (MsgAddAttributeResponse); - - // UpdateAttribute defines a method to verify a particular invariance. - rpc UpdateAttribute(MsgUpdateAttributeRequest) returns (MsgUpdateAttributeResponse); - - // DeleteAttribute defines a method to verify a particular invariance. - rpc DeleteAttribute(MsgDeleteAttributeRequest) returns (MsgDeleteAttributeResponse); - - // DeleteDistinctAttribute defines a method to verify a particular invariance. - rpc DeleteDistinctAttribute(MsgDeleteDistinctAttributeRequest) returns (MsgDeleteDistinctAttributeResponse); -} - -// MsgAddAttributeRequest defines an sdk.Msg type that is used to add a new attribute to an account -// Attributes may only be set in an account by the account that the attribute name resolves to. -message MsgAddAttributeRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // The attribute name. - string name = 1; - // The attribute value. - bytes value = 2; - // The attribute value type. - AttributeType attribute_type = 3; - // The account to add the attribute to. - string account = 4; - // The address that the name must resolve to. - string owner = 5; -} - -// MsgAddAttributeResponse defines the Msg/Vote response type. -message MsgAddAttributeResponse {} - -// MsgUpdateAttributeRequest defines an sdk.Msg type that is used to update an existing attribute to an account -// Attributes may only be set in an account by the account that the attribute name resolves to. -message MsgUpdateAttributeRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // The attribute name. - string name = 1; - // The original attribute value. - bytes original_value = 2; - // The update attribute value. - bytes update_value = 3; - // The original attribute value type. - AttributeType original_attribute_type = 4; - // The update attribute value type. - AttributeType update_attribute_type = 5; - // The account to add the attribute to. - string account = 6; - // The address that the name must resolve to. - string owner = 7; -} - -// MsgUpdateAttributeResponse defines the Msg/Vote response type. -message MsgUpdateAttributeResponse {} - -// MsgDeleteAttributeRequest defines a message to delete an attribute from an account -// Attributes may only be remove from an account by the account that the attribute name resolves to. -message MsgDeleteAttributeRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // The attribute name. - string name = 1; - // The account to add the attribute to. - string account = 2; - // The address that the name must resolve to. - string owner = 3; -} - -// MsgDeleteAttributeResponse defines the Msg/Vote response type. -message MsgDeleteAttributeResponse {} - -// MsgDeleteDistinctAttributeRequest defines a message to delete an attribute with matching name, value, and type from -// an account Attributes may only be remove from an account by the account that the attribute name resolves to. -message MsgDeleteDistinctAttributeRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // The attribute name. - string name = 1; - // The attribute value. - bytes value = 2; - // The account to add the attribute to. - string account = 3; - // The address that the name must resolve to. - string owner = 4; -} - -// MsgDeleteDistinctAttributeResponse defines the Msg/Vote response type. -message MsgDeleteDistinctAttributeResponse {} diff --git a/third_party/proto/provenance/marker/v1/accessgrant.proto b/third_party/proto/provenance/marker/v1/accessgrant.proto deleted file mode 100644 index 913d3a30..00000000 --- a/third_party/proto/provenance/marker/v1/accessgrant.proto +++ /dev/null @@ -1,46 +0,0 @@ -syntax = "proto3"; -package provenance.marker.v1; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; - -option go_package = "github.com/provenance-io/provenance/x/marker/types"; - -option java_package = "io.provenance.marker.v1"; -option java_multiple_files = true; -option java_outer_classname = "AccessGrantProto"; - -// AccessGrant associates a colelction of permisssions with an address for delegated marker account control. -message AccessGrant { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.equal) = true; - - option (cosmos_proto.implements_interface) = "AccessGrantI"; - - string address = 1; - repeated Access permissions = 2 [(gogoproto.castrepeated) = "AccessList"]; -} - -// Access defines the different types of permissions that a marker supports granting to an address. -enum Access { - // ACCESS_UNSPECIFIED defines a no-op vote option. - ACCESS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "Unknown"]; - // ACCESS_MINT is the ability to increase the supply of a marker - ACCESS_MINT = 1 [(gogoproto.enumvalue_customname) = "Mint"]; - // ACCESS_BURN is the ability to decrease the supply of the marker using coin held by the marker. - ACCESS_BURN = 2 [(gogoproto.enumvalue_customname) = "Burn"]; - // ACCESS_DEPOSIT is the ability to set a marker reference to this marker in the metadata/scopes module - ACCESS_DEPOSIT = 3 [(gogoproto.enumvalue_customname) = "Deposit"]; - // ACCESS_WITHDRAW is the ability to remove marker references to this marker in from metadata/scopes or - // transfer coin from this marker account to another account. - ACCESS_WITHDRAW = 4 [(gogoproto.enumvalue_customname) = "Withdraw"]; - // ACCESS_DELETE is the ability to move a proposed, finalized or active marker into the cancelled state. This - // access also allows cancelled markers to be marked for deletion - ACCESS_DELETE = 5 [(gogoproto.enumvalue_customname) = "Delete"]; - // ACCESS_ADMIN is the ability to add access grants for accounts to the list of marker permissions. - ACCESS_ADMIN = 6 [(gogoproto.enumvalue_customname) = "Admin"]; - // ACCESS_TRANSFER is the ability to invoke a send operation using the marker module to facilitate exchange. - // This access right is only supported on RESTRICTED markers. - ACCESS_TRANSFER = 7 [(gogoproto.enumvalue_customname) = "Transfer"]; -} \ No newline at end of file diff --git a/third_party/proto/provenance/marker/v1/authz.proto b/third_party/proto/provenance/marker/v1/authz.proto deleted file mode 100644 index 347facbf..00000000 --- a/third_party/proto/provenance/marker/v1/authz.proto +++ /dev/null @@ -1,19 +0,0 @@ -package provenance.marker.v1; - -import "gogoproto/gogo.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/base/v1beta1/coin.proto"; - -option go_package = "github.com/provenance-io/provenance/x/marker/types"; -option java_package = "io.provenance.marker.v1"; -option java_multiple_files = true; - -// MarkerTransferAuthorization gives the grantee permissions to execute -// a marker transfer on behalf of the granter's account. -message MarkerTransferAuthorization { - option (cosmos_proto.implements_interface) = "Authorization"; - - // transfer_limit is the total amount the grantee can transfer - repeated cosmos.base.v1beta1.Coin transfer_limit = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} diff --git a/third_party/proto/provenance/marker/v1/genesis.proto b/third_party/proto/provenance/marker/v1/genesis.proto deleted file mode 100644 index 6445c288..00000000 --- a/third_party/proto/provenance/marker/v1/genesis.proto +++ /dev/null @@ -1,22 +0,0 @@ -syntax = "proto3"; -package provenance.marker.v1; - -option go_package = "github.com/provenance-io/provenance/x/marker/types"; - -option java_package = "io.provenance.marker.v1"; -option java_multiple_files = true; - -import "gogoproto/gogo.proto"; -import "provenance/marker/v1/marker.proto"; - -// GenesisState defines the account module's genesis state. -message GenesisState { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // params defines all the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false]; - - // A collection of marker accounts to create on start - repeated MarkerAccount markers = 2 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/provenance/marker/v1/marker.proto b/third_party/proto/provenance/marker/v1/marker.proto deleted file mode 100644 index 293aea51..00000000 --- a/third_party/proto/provenance/marker/v1/marker.proto +++ /dev/null @@ -1,190 +0,0 @@ -syntax = "proto3"; -package provenance.marker.v1; - -import "gogoproto/gogo.proto"; -import "cosmos/auth/v1beta1/auth.proto"; -import "cosmos_proto/cosmos.proto"; -import "provenance/marker/v1/accessgrant.proto"; - -option go_package = "github.com/provenance-io/provenance/x/marker/types"; -option java_package = "io.provenance.marker.v1"; -option java_multiple_files = true; - -// Params defines the set of params for the account module. -message Params { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - - // maximum amount of supply to allow a marker to be created with - uint64 max_total_supply = 1 [(gogoproto.customtype) = "uint64", (gogoproto.nullable) = false]; - // indicates if governance based controls of markers is allowed. - bool enable_governance = 2; - // a regular expression used to validate marker denom values from normal create requests (governance - // requests are only subject to platform coin validation denom expression) - string unrestricted_denom_regex = 3; -} - -// MarkerAccount holds the marker configuration information in addition to a base account structure. -message MarkerAccount { - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - option (cosmos_proto.implements_interface) = "MarkerAccountI"; - - // base cosmos account information including address and coin holdings. - cosmos.auth.v1beta1.BaseAccount base_account = 1 - [(gogoproto.embed) = true, (gogoproto.moretags) = "yaml:\"base_account\""]; - // Address that owns the marker configuration. This account must sign any requests - // to change marker config (only valid for statuses prior to finalization) - string manager = 2 [(gogoproto.moretags) = "json:\"manager,omitempty\""]; - // Access control lists - repeated AccessGrant access_control = 3 [(gogoproto.nullable) = false]; - // Indicates the current status of this marker record. - MarkerStatus status = 4; - // value denomination and total supply for the token. - string denom = 5; - // the total supply expected for a marker. This is the amount that is minted when a marker is created. - string supply = 6 [ - (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "json:\"total_supply\" yaml:\"total_supply\"" - ]; - // Marker type information - MarkerType marker_type = 7 [(gogoproto.moretags) = "json:\"marker_type,omitempty\""]; - // A fixed supply will mint additional coin automatically if the total supply decreases below a set value. This - // may occur if the coin is burned or an account holding the coin is slashed. (default: true) - bool supply_fixed = 8; - // indicates that governance based control is allowed for this marker - bool allow_governance_control = 9; -} - -// MarkerType defines the types of marker -enum MarkerType { - // MARKER_TYPE_UNSPECIFIED is an invalid/unknown marker type. - MARKER_TYPE_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "Unknown"]; - // MARKER_TYPE_COIN is a marker that represents a standard fungible coin (default). - MARKER_TYPE_COIN = 1 [(gogoproto.enumvalue_customname) = "Coin"]; - // MARKER_TYPE_RESTRICTED is a marker that represents a denom with send_enabled = false. - MARKER_TYPE_RESTRICTED = 2 [(gogoproto.enumvalue_customname) = "RestrictedCoin"]; -} - -// MarkerStatus defines the various states a marker account can be in. -enum MarkerStatus { - option (gogoproto.goproto_enum_prefix) = false; - option (gogoproto.goproto_enum_stringer) = false; - - // MARKER_STATUS_UNSPECIFIED - Unknown/Invalid Marker Status - MARKER_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "StatusUndefined"]; - // MARKER_STATUS_PROPOSED - Initial configuration period, updates allowed, token supply not created. - MARKER_STATUS_PROPOSED = 1 [(gogoproto.enumvalue_customname) = "StatusProposed"]; - // MARKER_STATUS_FINALIZED - Configuration finalized, ready for supply creation - MARKER_STATUS_FINALIZED = 2 [(gogoproto.enumvalue_customname) = "StatusFinalized"]; - // MARKER_STATUS_ACTIVE - Supply is created, rules are in force. - MARKER_STATUS_ACTIVE = 3 [(gogoproto.enumvalue_customname) = "StatusActive"]; - // MARKER_STATUS_CANCELLED - Marker has been cancelled, pending destroy - MARKER_STATUS_CANCELLED = 4 [(gogoproto.enumvalue_customname) = "StatusCancelled"]; - // MARKER_STATUS_DESTROYED - Marker supply has all been recalled, marker is considered destroyed and no further - // actions allowed. - MARKER_STATUS_DESTROYED = 5 [(gogoproto.enumvalue_customname) = "StatusDestroyed"]; -} - -// EventMarkerAdd event emitted when marker is added -message EventMarkerAdd { - string denom = 1; - string amount = 2; - string status = 3; - string manager = 4; - string marker_type = 5; -} - -// EventMarkerAddAccess event emitted when marker access is added -message EventMarkerAddAccess { - EventMarkerAccess access = 1 [(gogoproto.nullable) = false]; - string denom = 2; - string administrator = 3; -} - -// EventMarkerAccess event access permissions for address -message EventMarkerAccess { - string address = 1; - repeated string permissions = 2; -} - -// EventMarkerDeleteAccess event emitted when marker access is revoked -message EventMarkerDeleteAccess { - string remove_address = 1; - string denom = 2; - string administrator = 3; -} - -// EventMarkerFinalize event emitted when marker is finalized -message EventMarkerFinalize { - string denom = 1; - string administrator = 2; -} - -// EventMarkerActivate event emitted when marker is activated -message EventMarkerActivate { - string denom = 1; - string administrator = 2; -} - -// EventMarkerCancel event emitted when marker is cancelled -message EventMarkerCancel { - string denom = 1; - string administrator = 2; -} - -// EventMarkerDelete event emitted when marker is deleted -message EventMarkerDelete { - string denom = 1; - string administrator = 2; -} - -// EventMarkerMint event emitted when additional marker supply is minted -message EventMarkerMint { - string amount = 1; - string denom = 2; - string administrator = 3; -} - -// EventMarkerBurn event emitted when coin is burned from marker -message EventMarkerBurn { - string amount = 1; - string denom = 2; - string administrator = 3; -} - -// EventMarkerWithdraw event emitted when coins are withdrew from marker -message EventMarkerWithdraw { - string coins = 1; - string denom = 2; - string administrator = 3; - string to_address = 4; -} - -// EventMarkerTransfer event emitted when coins are transfered to from account to another -message EventMarkerTransfer { - string amount = 1; - string denom = 2; - string administrator = 3; - string to_address = 4; - string from_address = 5; -} - -// EventMarkerSetDenomMetadata event emitted when metadata is set on marker with denom -message EventMarkerSetDenomMetadata { - string metadata_base = 1; - string metadata_description = 2; - string metadata_display = 3; - repeated EventDenomUnit metadata_denom_units = 4; - string administrator = 5; - string metadata_name = 6; - string metadata_symbol = 7; -} - -// EventDenomUnit denom units for set denom metadata event -message EventDenomUnit { - string denom = 1; - string exponent = 2; - repeated string aliases = 3; -} diff --git a/third_party/proto/provenance/marker/v1/proposals.proto b/third_party/proto/provenance/marker/v1/proposals.proto deleted file mode 100644 index fcb5d254..00000000 --- a/third_party/proto/provenance/marker/v1/proposals.proto +++ /dev/null @@ -1,114 +0,0 @@ -syntax = "proto3"; -package provenance.marker.v1; - -import "gogoproto/gogo.proto"; -import "cosmos/bank/v1beta1/bank.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "provenance/marker/v1/marker.proto"; -import "provenance/marker/v1/accessgrant.proto"; - -option go_package = "github.com/provenance-io/provenance/x/marker/types"; - -option java_package = "io.provenance.marker.v1"; -option java_multiple_files = true; - -// AddMarkerProposal defines defines a governance proposal to create a new marker -message AddMarkerProposal { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - string title = 1; - string description = 2; - - cosmos.base.v1beta1.Coin amount = 3 - [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin"]; - string manager = 4; - MarkerStatus status = 5; - MarkerType marker_type = 6; - repeated AccessGrant access_list = 7 [(gogoproto.nullable) = false]; - bool supply_fixed = 8; - bool allow_governance_control = 9; -} - -// SupplyIncreaseProposal defines a governance proposal to administer a marker and increase total supply of the marker -// through minting coin and placing it within the marker or assigning it directly to an account -message SupplyIncreaseProposal { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - string title = 1; - string description = 2; - cosmos.base.v1beta1.Coin amount = 3 - [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin"]; - string target_address = 4; // an optional target address for the minted coin from this request -} - -// SupplyDecreaseProposal defines a governance proposal to administer a marker and decrease the total supply through -// burning coin held within the marker -message SupplyDecreaseProposal { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - string title = 1; - string description = 2; - cosmos.base.v1beta1.Coin amount = 3 - [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin"]; -} - -// SetAdministratorProposal defines a governance proposal to administer a marker and set administrators with specific -// access on the marker -message SetAdministratorProposal { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - string title = 1; - string description = 2; - string denom = 3; - repeated AccessGrant access = 4 [(gogoproto.nullable) = false]; -} - -// RemoveAdministratorProposal defines a governance proposal to administer a marker and remove all permissions for a -// given address -message RemoveAdministratorProposal { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - string title = 1; - string description = 2; - string denom = 3; - repeated string removed_address = 4; -} - -// ChangeStatusProposal defines a governance proposal to administer a marker to change its status -message ChangeStatusProposal { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - string title = 1; - string description = 2; - string denom = 3; - MarkerStatus new_status = 4; -} - -// WithdrawEscrowProposal defines a governance proposal to withdraw escrow coins from a marker -message WithdrawEscrowProposal { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; - - string title = 1; - string description = 2; - string denom = 3; - repeated cosmos.base.v1beta1.Coin amount = 4 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - string target_address = 5; -} - -// SetDenomMetadataProposal defines a governance proposal to set the metadata for a denom -message SetDenomMetadataProposal { - option (gogoproto.goproto_stringer) = false; - - string title = 1; - string description = 2; - cosmos.bank.v1beta1.Metadata metadata = 3 - [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/x/bank/types.Metadata"]; -} \ No newline at end of file diff --git a/third_party/proto/provenance/marker/v1/query.proto b/third_party/proto/provenance/marker/v1/query.proto deleted file mode 100644 index d4161e44..00000000 --- a/third_party/proto/provenance/marker/v1/query.proto +++ /dev/null @@ -1,160 +0,0 @@ -syntax = "proto3"; -package provenance.marker.v1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/bank/v1beta1/bank.proto"; -import "cosmos_proto/cosmos.proto"; -import "google/api/annotations.proto"; -import "provenance/marker/v1/marker.proto"; -import "provenance/marker/v1/accessgrant.proto"; - -option go_package = "github.com/provenance-io/provenance/x/marker/types"; -option java_package = "io.provenance.marker.v1"; -option java_multiple_files = true; - -// Query defines the gRPC querier service for marker module. -service Query { - // Params queries the parameters of x/bank module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/provenance/marker/v1/params"; - } - - // Returns a list of all markers on the blockchain - rpc AllMarkers(QueryAllMarkersRequest) returns (QueryAllMarkersResponse) { - option (google.api.http).get = "/provenance/marker/v1/all"; - } - - // query for a single marker by denom or address - rpc Marker(QueryMarkerRequest) returns (QueryMarkerResponse) { - option (google.api.http).get = "/provenance/marker/v1/detail/{id}"; - } - - // query for all accounts holding the given marker coins - rpc Holding(QueryHoldingRequest) returns (QueryHoldingResponse) { - option (google.api.http).get = "/provenance/marker/v1/holding/{id}"; - } - - // query for supply of coin on a marker account - rpc Supply(QuerySupplyRequest) returns (QuerySupplyResponse) { - option (google.api.http).get = "/provenance/marker/v1/supply/{id}"; - } - - // query for coins on a marker account - rpc Escrow(QueryEscrowRequest) returns (QueryEscrowResponse) { - option (google.api.http).get = "/provenance/marker/v1/escrow/{id}"; - } - - // query for access records on an account - rpc Access(QueryAccessRequest) returns (QueryAccessResponse) { - option (google.api.http).get = "/provenance/marker/v1/accesscontrol/{id}"; - } - - // query for access records on an account - rpc DenomMetadata(QueryDenomMetadataRequest) returns (QueryDenomMetadataResponse) { - option (google.api.http).get = "/provenance/marker/v1/getdenommetadata/{denom}"; - } -} - -// 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]; -} - -// QueryAllMarkersRequest is the request type for the Query/AllMarkers method. -message QueryAllMarkersRequest { - // Optional status to filter request - MarkerStatus status = 1; - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} -// QueryAllMarkersResponse is the response type for the Query/AllMarkers method. -message QueryAllMarkersResponse { - repeated google.protobuf.Any markers = 1 [(cosmos_proto.accepts_interface) = "MarkerAccountI"]; - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QueryMarkerRequest is the request type for the Query/Marker method. -message QueryMarkerRequest { - // the address or denom of the marker - string id = 1; -} -// QueryMarkerResponse is the response type for the Query/Marker method. -message QueryMarkerResponse { - google.protobuf.Any marker = 1 [(cosmos_proto.accepts_interface) = "MarkerAccountI"]; -} - -// QueryHoldingRequest is the request type for the Query/MarkerHolders method. -message QueryHoldingRequest { - // the address or denom of the marker - string id = 1; - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} -// QueryHoldingResponse is the response type for the Query/MarkerHolders method. -message QueryHoldingResponse { - repeated Balance balances = 1 [(gogoproto.nullable) = false]; - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} - -// QuerySupplyRequest is the request type for the Query/MarkerSupply method. -message QuerySupplyRequest { - // address or denom for the marker - string id = 1; -} -// QuerySupplyResponse is the response type for the Query/MarkerSupply method. -message QuerySupplyResponse { - // amount is the supply of the marker. - cosmos.base.v1beta1.Coin amount = 1 [(gogoproto.nullable) = false]; -} - -// QueryEscrowRequest is the request type for the Query/MarkerEscrow method. -message QueryEscrowRequest { - // address or denom for the marker - string id = 1; -} -// QueryEscrowResponse is the response type for the Query/MarkerEscrow method. -message QueryEscrowResponse { - repeated cosmos.base.v1beta1.Coin escrow = 1 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} - -// QueryAccessRequest is the request type for the Query/MarkerAccess method. -message QueryAccessRequest { - // address or denom for the marker - string id = 1; -} -// QueryAccessResponse is the response type for the Query/MarkerAccess method. -message QueryAccessResponse { - repeated AccessGrant accounts = 1 [(gogoproto.nullable) = false]; -} - -// QueryDenomMetadataRequest is the request type for Query/DenomMetadata -message QueryDenomMetadataRequest { - string denom = 1; -} -// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata -message QueryDenomMetadataResponse { - cosmos.bank.v1beta1.Metadata metadata = 1 [(gogoproto.nullable) = false]; -} - -// Balance defines an account address and balance pair used in queries for accounts holding a marker -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]; -} \ No newline at end of file diff --git a/third_party/proto/provenance/marker/v1/si.proto b/third_party/proto/provenance/marker/v1/si.proto deleted file mode 100644 index fab3361a..00000000 --- a/third_party/proto/provenance/marker/v1/si.proto +++ /dev/null @@ -1,58 +0,0 @@ -syntax = "proto3"; -package provenance.marker.v1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/provenance-io/provenance/x/marker/types"; - -option java_package = "io.provenance.marker.v1"; -option java_multiple_files = true; - -// SIPrefix represents an International System of Units (SI) Prefix. -enum SIPrefix { - option (gogoproto.goproto_enum_prefix) = false; - // 10^0 (none) - SI_PREFIX_NONE = 0; - - // 10^1 deka da - SI_PREFIX_DEKA = 1; - // 10^2 hecto h - SI_PREFIX_HECTO = 2; - // 10^3 kilo k - SI_PREFIX_KILO = 3; - // 10^6 mega M - SI_PREFIX_MEGA = 6; - // 10^9 giga G - SI_PREFIX_GIGA = 9; - // 10^12 tera T - SI_PREFIX_TERA = 12; - // 10^15 peta P - SI_PREFIX_PETA = 15; - // 10^18 exa E - SI_PREFIX_EXA = 18; - // 10^21 zetta Z - SI_PREFIX_ZETTA = 21; - // 10^24 yotta Y - SI_PREFIX_YOTTA = 24; - - // 10^-1 deci d - SI_PREFIX_DECI = -1; - // 10^-2 centi c - SI_PREFIX_CENTI = -2; - // 10^-3 milli m - SI_PREFIX_MILLI = -3; - // 10^-6 micro µ - SI_PREFIX_MICRO = -6; - // 10^-9 nano n - SI_PREFIX_NANO = -9; - // 10^-12 pico p - SI_PREFIX_PICO = -12; - // 10^-15 femto f - SI_PREFIX_FEMTO = -15; - // 10^-18 atto a - SI_PREFIX_ATTO = -18; - // 10^-21 zepto z - SI_PREFIX_ZEPTO = -21; - // 10^-24 yocto y - SI_PREFIX_YOCTO = -24; -} \ No newline at end of file diff --git a/third_party/proto/provenance/marker/v1/tx.proto b/third_party/proto/provenance/marker/v1/tx.proto deleted file mode 100644 index fedd5fc0..00000000 --- a/third_party/proto/provenance/marker/v1/tx.proto +++ /dev/null @@ -1,159 +0,0 @@ -syntax = "proto3"; -package provenance.marker.v1; - -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos/bank/v1beta1/bank.proto"; -import "provenance/marker/v1/marker.proto"; -import "provenance/marker/v1/accessgrant.proto"; - -option go_package = "github.com/provenance-io/provenance/x/marker/types"; - -option java_package = "io.provenance.marker.v1"; -option java_multiple_files = true; - -// Msg defines the Marker Msg service. -service Msg { - // Finalize - rpc Finalize(MsgFinalizeRequest) returns (MsgFinalizeResponse); - // Activate - rpc Activate(MsgActivateRequest) returns (MsgActivateResponse); - // Cancel - rpc Cancel(MsgCancelRequest) returns (MsgCancelResponse); - // Delete - rpc Delete(MsgDeleteRequest) returns (MsgDeleteResponse); - // Mint - rpc Mint(MsgMintRequest) returns (MsgMintResponse); - // Burn - rpc Burn(MsgBurnRequest) returns (MsgBurnResponse); - // AddAccess - rpc AddAccess(MsgAddAccessRequest) returns (MsgAddAccessResponse); - // DeleteAccess - rpc DeleteAccess(MsgDeleteAccessRequest) returns (MsgDeleteAccessResponse); - // Withdraw - rpc Withdraw(MsgWithdrawRequest) returns (MsgWithdrawResponse); - // AddMarker - rpc AddMarker(MsgAddMarkerRequest) returns (MsgAddMarkerResponse); - // Transfer marker denominated coin between accounts - rpc Transfer(MsgTransferRequest) returns (MsgTransferResponse); - // Allows Denom Metadata (see bank module) to be set for the Marker's Denom - rpc SetDenomMetadata(MsgSetDenomMetadataRequest) returns (MsgSetDenomMetadataResponse); -} - -// MsgAddMarkerRequest defines the Msg/AddMarker request type -message MsgAddMarkerRequest { - cosmos.base.v1beta1.Coin amount = 1 - [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin"]; - string manager = 3; - string from_address = 4; - MarkerStatus status = 5; - MarkerType marker_type = 6; - repeated AccessGrant access_list = 7 [(gogoproto.nullable) = false]; - bool supply_fixed = 8; - bool allow_governance_control = 9; -} - -// MsgAddMarkerResponse defines the Msg/AddMarker response type -message MsgAddMarkerResponse {} - -// MsgAddAccessRequest defines the Msg/AddAccess request type -message MsgAddAccessRequest { - string denom = 1; - string administrator = 2; - repeated AccessGrant access = 3 [(gogoproto.nullable) = false]; -} - -// MsgAddAccessResponse defines the Msg/AddAccess response type -message MsgAddAccessResponse {} - -// MsgDeleteAccessRequest defines the Msg/DeleteAccess request type -message MsgDeleteAccessRequest { - string denom = 1; - string administrator = 2; - string removed_address = 3; -} -// MsgDeleteAccessResponse defines the Msg/DeleteAccess response type -message MsgDeleteAccessResponse {} - -// MsgFinalizeRequest defines the Msg/Finalize request type -message MsgFinalizeRequest { - string denom = 1; - string administrator = 2; -} -// MsgFinalizeResponse defines the Msg/Finalize response type -message MsgFinalizeResponse {} - -// MsgActivateRequest defines the Msg/Activate request type -message MsgActivateRequest { - string denom = 1; - string administrator = 2; -} -// MsgActivateResponse defines the Msg/Activate response type -message MsgActivateResponse {} - -// MsgCancelRequest defines the Msg/Cancel request type -message MsgCancelRequest { - string denom = 1; - string administrator = 2; -} -// MsgCancelResponse defines the Msg/Cancel response type -message MsgCancelResponse {} - -// MsgDeleteRequest defines the Msg/Delete request type -message MsgDeleteRequest { - string denom = 1; - string administrator = 2; -} -// MsgDeleteResponse defines the Msg/Delete response type -message MsgDeleteResponse {} - -// MsgMintRequest defines the Msg/Mint request type -message MsgMintRequest { - cosmos.base.v1beta1.Coin amount = 1 - [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin"]; - string administrator = 2; -} -// MsgMintResponse defines the Msg/Mint response type -message MsgMintResponse {} - -// MsgBurnRequest defines the Msg/Burn request type -message MsgBurnRequest { - cosmos.base.v1beta1.Coin amount = 1 - [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin"]; - string administrator = 2; -} -// MsgBurnResponse defines the Msg/Burn response type -message MsgBurnResponse {} - -// MsgWithdrawRequest defines the Msg/Withdraw request type -message MsgWithdrawRequest { - string denom = 1; - string administrator = 2; - string to_address = 3; - repeated cosmos.base.v1beta1.Coin amount = 4 - [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; -} -// MsgWithdrawResponse defines the Msg/Withdraw response type -message MsgWithdrawResponse {} - -// MsgTransferRequest defines the Msg/Transfer request type -message MsgTransferRequest { - cosmos.base.v1beta1.Coin amount = 1 - [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Coin"]; - string administrator = 3; - string from_address = 4; - string to_address = 5; -} - -// MsgTransferResponse defines the Msg/Transfer response type -message MsgTransferResponse {} - -// MsgSetDenomMetadataRequest defines the Msg/SetDenomMetadata request type -message MsgSetDenomMetadataRequest { - cosmos.bank.v1beta1.Metadata metadata = 1 - [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/x/bank/types.Metadata"]; - string administrator = 2; -} - -// MsgSetDenomMetadataResponse defines the Msg/SetDenomMetadata response type -message MsgSetDenomMetadataResponse {} \ No newline at end of file diff --git a/third_party/proto/provenance/metadata/v1/events.proto b/third_party/proto/provenance/metadata/v1/events.proto deleted file mode 100644 index 7d8366f1..00000000 --- a/third_party/proto/provenance/metadata/v1/events.proto +++ /dev/null @@ -1,177 +0,0 @@ -syntax = "proto3"; -package provenance.metadata.v1; - -option go_package = "github.com/provenance-io/provenance/x/metadata/types"; - -option java_package = "io.provenance.metadata.v1"; -option java_multiple_files = true; - -// EventTxCompleted is an event message indicating that a TX has completed. -message EventTxCompleted { - // module is the module the TX belongs to. - string module = 1; - // endpoint is the rpc endpoint that was just completed. - string endpoint = 2; - // signers are the bech32 address strings of the signers of this TX. - repeated string signers = 3; -} - -// EventScopeCreated is an event message indicating a scope has been created. -message EventScopeCreated { - // scope_addr is the bech32 address string of the scope id that was created. - string scope_addr = 1; -} - -// EventScopeUpdated is an event message indicating a scope has been updated. -message EventScopeUpdated { - // scope_addr is the bech32 address string of the scope id that was updated. - string scope_addr = 1; -} - -// EventScopeDeleted is an event message indicating a scope has been deleted. -message EventScopeDeleted { - // scope_addr is the bech32 address string of the scope id that was deleted. - string scope_addr = 1; -} - -// EventSessionCreated is an event message indicating a session has been created. -message EventSessionCreated { - // session_addr is the bech32 address string of the session id that was created. - string session_addr = 1; - // scope_addr is the bech32 address string of the scope id this session belongs to. - string scope_addr = 2; -} - -// EventSessionUpdated is an event message indicating a session has been updated. -message EventSessionUpdated { - // session_addr is the bech32 address string of the session id that was updated. - string session_addr = 1; - // scope_addr is the bech32 address string of the scope id this session belongs to. - string scope_addr = 2; -} - -// EventSessionDeleted is an event message indicating a session has been deleted. -message EventSessionDeleted { - // session_addr is the bech32 address string of the session id that was deleted. - string session_addr = 1; - // scope_addr is the bech32 address string of the scope id this session belongs to. - string scope_addr = 2; -} - -// EventRecordCreated is an event message indicating a record has been created. -message EventRecordCreated { - // record_addr is the bech32 address string of the record id that was created. - string record_addr = 1; - // session_addr is the bech32 address string of the session id this record belongs to. - string session_addr = 2; - // scope_addr is the bech32 address string of the scope id this record belongs to. - string scope_addr = 3; -} - -// EventRecordUpdated is an event message indicating a record has been updated. -message EventRecordUpdated { - // record_addr is the bech32 address string of the record id that was updated. - string record_addr = 1; - // session_addr is the bech32 address string of the session id this record belongs to. - string session_addr = 2; - // scope_addr is the bech32 address string of the scope id this record belongs to. - string scope_addr = 3; -} - -// EventRecordDeleted is an event message indicating a record has been deleted. -message EventRecordDeleted { - // record is the bech32 address string of the record id that was deleted. - string record_addr = 1; - // scope_addr is the bech32 address string of the scope id this record belonged to. - string scope_addr = 3; -} - -// EventScopeSpecificationCreated is an event message indicating a scope specification has been created. -message EventScopeSpecificationCreated { - // scope_specification_addr is the bech32 address string of the specification id of the scope specification that was - // created. - string scope_specification_addr = 1; -} - -// EventScopeSpecificationUpdated is an event message indicating a scope specification has been updated. -message EventScopeSpecificationUpdated { - // scope_specification_addr is the bech32 address string of the specification id of the scope specification that was - // updated. - string scope_specification_addr = 1; -} - -// EventScopeSpecificationDeleted is an event message indicating a scope specification has been deleted. -message EventScopeSpecificationDeleted { - // scope_specification_addr is the bech32 address string of the specification id of the scope specification that was - // deleted. - string scope_specification_addr = 1; -} - -// EventContractSpecificationCreated is an event message indicating a contract specification has been created. -message EventContractSpecificationCreated { - // contract_specification_addr is the bech32 address string of the specification id of the contract specification that - // was created. - string contract_specification_addr = 1; -} - -// EventContractSpecificationUpdated is an event message indicating a contract specification has been updated. -message EventContractSpecificationUpdated { - // contract_specification_addr is the bech32 address string of the specification id of the contract specification that - // was updated. - string contract_specification_addr = 1; -} - -// EventContractSpecificationDeleted is an event message indicating a contract specification has been deleted. -message EventContractSpecificationDeleted { - // contract_specification_addr is the bech32 address string of the specification id of the contract specification that - // was deleted. - string contract_specification_addr = 1; -} - -// EventRecordSpecificationCreated is an event message indicating a record specification has been created. -message EventRecordSpecificationCreated { - // record_specification_addr is the bech32 address string of the specification id of the record specification that was - // created. - string record_specification_addr = 1; - // contract_specification_addr is the bech32 address string of the contract specification id this record specification - // belongs to. - string contract_specification_addr = 2; -} - -// EventRecordSpecificationUpdated is an event message indicating a record specification has been updated. -message EventRecordSpecificationUpdated { - // record_specification_addr is the bech32 address string of the specification id of the record specification that was - // updated. - string record_specification_addr = 1; - // contract_specification_addr is the bech32 address string of the contract specification id this record specification - // belongs to. - string contract_specification_addr = 2; -} - -// EventRecordSpecificationDeleted is an event message indicating a record specification has been deleted. -message EventRecordSpecificationDeleted { - // record_specification_addr is the bech32 address string of the specification id of the record specification that was - // deleted. - string record_specification_addr = 1; - // contract_specification_addr is the bech32 address string of the contract specification id this record specification - // belongs to. - string contract_specification_addr = 2; -} - -// EventOSLocatorCreated is an event message indicating an object store locator has been created. -message EventOSLocatorCreated { - // owner is the owner in the object store locator that was created. - string owner = 1; -} - -// EventOSLocatorUpdated is an event message indicating an object store locator has been updated. -message EventOSLocatorUpdated { - // owner is the owner in the object store locator that was updated. - string owner = 1; -} - -// EventOSLocatorDeleted is an event message indicating an object store locator has been deleted. -message EventOSLocatorDeleted { - // owner is the owner in the object store locator that was deleted. - string owner = 1; -} diff --git a/third_party/proto/provenance/metadata/v1/genesis.proto b/third_party/proto/provenance/metadata/v1/genesis.proto deleted file mode 100644 index e037c3b9..00000000 --- a/third_party/proto/provenance/metadata/v1/genesis.proto +++ /dev/null @@ -1,34 +0,0 @@ -syntax = "proto3"; -package provenance.metadata.v1; - -option go_package = "github.com/provenance-io/provenance/x/metadata/types"; - -option java_package = "io.provenance.metadata.v1"; -option java_multiple_files = true; - -import "gogoproto/gogo.proto"; -import "provenance/metadata/v1/metadata.proto"; -import "provenance/metadata/v1/scope.proto"; -import "provenance/metadata/v1/specification.proto"; -import "provenance/metadata/v1/objectstore.proto"; - -// GenesisState defines the account module's genesis state. -message GenesisState { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // params defines all the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false]; - - // A collection of metadata scopes and specs to create on start - repeated Scope scopes = 2 [(gogoproto.nullable) = false]; - repeated Session sessions = 3 [(gogoproto.nullable) = false]; - repeated Record records = 4 [(gogoproto.nullable) = false]; - - repeated ScopeSpecification scope_specifications = 5 [(gogoproto.nullable) = false]; - repeated ContractSpecification contract_specifications = 6 [(gogoproto.nullable) = false]; - repeated RecordSpecification record_specifications = 7 [(gogoproto.nullable) = false]; - - OSLocatorParams o_s_locator_params = 8 [(gogoproto.nullable) = false]; - repeated ObjectStoreLocator object_store_locators = 9 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/provenance/metadata/v1/metadata.proto b/third_party/proto/provenance/metadata/v1/metadata.proto deleted file mode 100644 index a613103b..00000000 --- a/third_party/proto/provenance/metadata/v1/metadata.proto +++ /dev/null @@ -1,131 +0,0 @@ -syntax = "proto3"; -package provenance.metadata.v1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/provenance-io/provenance/x/metadata/types"; - -option java_package = "io.provenance.metadata.v1"; -option java_multiple_files = true; - -// Params defines the set of params for the metadata module. -message Params { - option (gogoproto.equal) = true; - option (gogoproto.goproto_stringer) = false; -} - -// ScopeIdInfo contains various info regarding a scope id. -message ScopeIdInfo { - // scope_id is the raw bytes of the scope address. - bytes scope_id = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"scope_id\"" - ]; - // scope_id_prefix is the prefix portion of the scope_id. - bytes scope_id_prefix = 2 [(gogoproto.moretags) = "yaml:\"scope_id_prefix\""]; - // scope_id_scope_uuid is the scope_uuid portion of the scope_id. - bytes scope_id_scope_uuid = 3 [(gogoproto.moretags) = "yaml:\"scope_id_scope_uuid\""]; - // scope_addr is the bech32 string version of the scope_id. - string scope_addr = 4 [(gogoproto.moretags) = "yaml:\"scope_addr\""]; - // scope_uuid is the uuid hex string of the scope_id_scope_uuid. - string scope_uuid = 5 [(gogoproto.moretags) = "yaml:\"scope_uuid\""]; -} - -// SessionIdInfo contains various info regarding a session id. -message SessionIdInfo { - // session_id is the raw bytes of the session address. - bytes session_id = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"session_id\"" - ]; - // session_id_prefix is the prefix portion of the session_id. - bytes session_id_prefix = 2 [(gogoproto.moretags) = "yaml:\"session_id_prefix\""]; - // session_id_scope_uuid is the scope_uuid portion of the session_id. - bytes session_id_scope_uuid = 3 [(gogoproto.moretags) = "yaml:\"session_id_scope_uuid\""]; - // session_id_session_uuid is the session_uuid portion of the session_id. - bytes session_id_session_uuid = 4 [(gogoproto.moretags) = "yaml:\"session_id_session_uuid\""]; - // session_addr is the bech32 string version of the session_id. - string session_addr = 5 [(gogoproto.moretags) = "yaml:\"session_addr\""]; - // session_uuid is the uuid hex string of the session_id_session_uuid. - string session_uuid = 6 [(gogoproto.moretags) = "yaml:\"session_uuid\""]; - // scope_id_info is information about the scope id referenced in the session_id. - ScopeIdInfo scope_id_info = 7 [(gogoproto.moretags) = "yaml:\"scope_id_info\""]; -} - -// RecordIdInfo contains various info regarding a record id. -message RecordIdInfo { - // record_id is the raw bytes of the record address. - bytes record_id = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"record_id\"" - ]; - // record_id_prefix is the prefix portion of the record_id. - bytes record_id_prefix = 2 [(gogoproto.moretags) = "yaml:\"record_id_prefix\""]; - // record_id_scope_uuid is the scope_uuid portion of the record_id. - bytes record_id_scope_uuid = 3 [(gogoproto.moretags) = "yaml:\"record_id_scope_uuid\""]; - // record_id_hashed_name is the hashed name portion of the record_id. - bytes record_id_hashed_name = 4 [(gogoproto.moretags) = "yaml:\"record_id_hashed_name\""]; - // record_addr is the bech32 string version of the record_id. - string record_addr = 5 [(gogoproto.moretags) = "yaml:\"record_addr\""]; - // scope_id_info is information about the scope id referenced in the record_id. - ScopeIdInfo scope_id_info = 6 [(gogoproto.moretags) = "yaml:\"scope_id_info\""]; -} - -// ScopeSpecIdInfo contains various info regarding a scope specification id. -message ScopeSpecIdInfo { - // scope_spec_id is the raw bytes of the scope specification address. - bytes scope_spec_id = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"scope_spec_id\"" - ]; - // scope_spec_id_prefix is the prefix portion of the scope_spec_id. - bytes scope_spec_id_prefix = 2 [(gogoproto.moretags) = "yaml:\"scope_spec_id_prefix\""]; - // scope_spec_id_scope_spec_uuid is the scope_spec_uuid portion of the scope_spec_id. - bytes scope_spec_id_scope_spec_uuid = 3 [(gogoproto.moretags) = "yaml:\"scope_spec_id_scope_spec_uuid\""]; - // scope_spec_addr is the bech32 string version of the scope_spec_id. - string scope_spec_addr = 4 [(gogoproto.moretags) = "yaml:\"scope_spec_addr\""]; - // scope_spec_uuid is the uuid hex string of the scope_spec_id_scope_spec_uuid. - string scope_spec_uuid = 5 [(gogoproto.moretags) = "yaml:\"scope_spec_uuid\""]; -} - -// ContractSpecIdInfo contains various info regarding a contract specification id. -message ContractSpecIdInfo { - // contract_spec_id is the raw bytes of the contract specification address. - bytes contract_spec_id = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"contract_spec_id\"" - ]; - // contract_spec_id_prefix is the prefix portion of the contract_spec_id. - bytes contract_spec_id_prefix = 2 [(gogoproto.moretags) = "yaml:\"contract_spec_id_prefix\""]; - // contract_spec_id_contract_spec_uuid is the contract_spec_uuid portion of the contract_spec_id. - bytes contract_spec_id_contract_spec_uuid = 3 [(gogoproto.moretags) = "yaml:\"contract_spec_id_contract_spec_uuid\""]; - // contract_spec_addr is the bech32 string version of the contract_spec_id. - string contract_spec_addr = 4 [(gogoproto.moretags) = "yaml:\"contract_spec_addr\""]; - // contract_spec_uuid is the uuid hex string of the contract_spec_id_contract_spec_uuid. - string contract_spec_uuid = 5 [(gogoproto.moretags) = "yaml:\"contract_spec_uuid\""]; -} - -// RecordSpecIdInfo contains various info regarding a record specification id. -message RecordSpecIdInfo { - // record_spec_id is the raw bytes of the record specification address. - bytes record_spec_id = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"record_spec_id\"" - ]; - // record_spec_id_prefix is the prefix portion of the record_spec_id. - bytes record_spec_id_prefix = 2 [(gogoproto.moretags) = "yaml:\"record_spec_id_prefix\""]; - // record_spec_id_contract_spec_uuid is the contract_spec_uuid portion of the record_spec_id. - bytes record_spec_id_contract_spec_uuid = 3 [(gogoproto.moretags) = "yaml:\"record_spec_id_contract_spec_uuid\""]; - // record_spec_id_hashed_name is the hashed name portion of the record_spec_id. - bytes record_spec_id_hashed_name = 4 [(gogoproto.moretags) = "yaml:\"record_spec_id_hashed_name\""]; - // record_spec_addr is the bech32 string version of the record_spec_id. - string record_spec_addr = 5 [(gogoproto.moretags) = "yaml:\"record_spec_addr\""]; - // contract_spec_id_info is information about the contract spec id referenced in the record_spec_id. - ContractSpecIdInfo contract_spec_id_info = 6 [(gogoproto.moretags) = "yaml:\"contract_spec_id_info\""]; -} diff --git a/third_party/proto/provenance/metadata/v1/objectstore.proto b/third_party/proto/provenance/metadata/v1/objectstore.proto deleted file mode 100644 index c892d88f..00000000 --- a/third_party/proto/provenance/metadata/v1/objectstore.proto +++ /dev/null @@ -1,27 +0,0 @@ -syntax = "proto3"; -package provenance.metadata.v1; -import "gogoproto/gogo.proto"; -option go_package = "github.com/provenance-io/provenance/x/metadata/types"; - -option java_package = "io.provenance.metadata.v1"; -option java_multiple_files = true; - -// Defines an Locator object stored on chain, which represents a owner( blockchain address) associated with a endpoint -// uri for it's associated object store. -message ObjectStoreLocator { - // account address the endpoint is owned by - string owner = 1; - // locator endpoint uri - string locator_uri = 2; - // owners encryption key address - string encryption_key = 3; -} - -// Params defines the parameters for the metadata-locator module methods. -message OSLocatorParams { - uint32 max_uri_length = 1 [ - (gogoproto.customtype) = "uint32", - (gogoproto.nullable) = false, - (gogoproto.moretags) = "yaml:\"max_uri_length\"" - ]; -} diff --git a/third_party/proto/provenance/metadata/v1/p8e/p8e.proto b/third_party/proto/provenance/metadata/v1/p8e/p8e.proto deleted file mode 100644 index 919387f3..00000000 --- a/third_party/proto/provenance/metadata/v1/p8e/p8e.proto +++ /dev/null @@ -1,217 +0,0 @@ -syntax = "proto3"; -package provenance.metadata.v1.p8e; - -option go_package = "github.com/provenance-io/provenance/x/metadata/types/p8e"; - -option java_package = "io.provenance.metadata.v1.p8e"; -option java_multiple_files = true; - -// This stuff only exists to help facilitate the transition to new stuff. -// It is copied from (or modeled after) old stuff. -// The goal is to remove this entire file (and everything defined in it) in the near future. - -// The rest of the messages defined in here were copied from the old provenance repo. -// Changes: -// * locations of types were updated, e.g. types.PartyType became just PartyType -// * Lots of comments added to conform with new requirements. - -message Contract { - DefinitionSpec definition = 1; - - // Points to the proto for the contractSpec - Fact spec = 2; - - // Invoker of this contract - SigningAndEncryptionPublicKeys invoker = 3; - - // Constructor arguments. - // These are always the output of a previously recorded consideration. - repeated Fact inputs = 4; - - // conditions is a deprecated field that is not used at all anymore. - repeated Condition conditions = 5 [deprecated = true]; - repeated Consideration considerations = 6; - - repeated Recital recitals = 7; - - int32 times_executed = 8; - - // This is only set once when the contract is initially executed - Timestamp start_time = 9; - - bytes context = 10; -} - -message DefinitionSpec { - string name = 1; - Location resource_location = 2; - Signature signature = 3; - DefinitionSpecType type = 4; -} - -message Fact { - string name = 1; - Location data_location = 2; -} - -message Condition { - string condition_name = 1; - ExecutionResult result = 2; -} - -message Consideration { - string consideration_name = 1; - - // Data pushed to a consideration that will ultimately match the output_spec of the consideration - repeated ProposedFact inputs = 2; - - ExecutionResult result = 3; -} - -message ProposedFact { - string name = 1; - string hash = 2; - string classname = 3; - ProvenanceReference ancestor = 4; -} - -message ExecutionResult { - ProposedFact output = 1; - ExecutionResultType result = 2; - Timestamp recorded_at = 3; - string error_message = 4; -} - -message Recitals { - repeated Recital parties = 1; -} - -message Recital { - PartyType signer_role = 1; - SigningAndEncryptionPublicKeys signer = 2; - bytes address = 3; -} - -message Location { - ProvenanceReference ref = 1; - string classname = 2; -} - -message ProvenanceReference { - // [Req] [Scope.uuid] - // Scope ID - UUID scope_uuid = 1; - // [Opt] [RecordGroup.group_uuid] - // require record to be within a specific group - UUID group_uuid = 2; - // [Opt] [Record.result_hash] - // specify a specific record inside a scope (and group) by result-hash - string hash = 3; - // [Opt] [Record.result_name] - // specify a result-name of a record within a scope - string name = 4; -} - -message SignatureSet { - repeated Signature signatures = 1; -} - -message Signature { - // Signature Detail - string algo = 1; - string provider = 2; - string signature = 3; - - // Identity of signer - SigningAndEncryptionPublicKeys signer = 4; -} - -message SigningAndEncryptionPublicKeys { - PublicKey signing_public_key = 1; - PublicKey encryption_public_key = 2; -} - -message PublicKey { - bytes public_key_bytes = 1; - PublicKeyType type = 2; - PublicKeyCurve curve = 3; -} - -message UUID { - string value = 1; -} - -enum DefinitionSpecType { - DEFINITION_SPEC_TYPE_UNKNOWN = 0; - DEFINITION_SPEC_TYPE_PROPOSED = 1; - DEFINITION_SPEC_TYPE_FACT = 2; - DEFINITION_SPEC_TYPE_FACT_LIST = 3; -} - -enum PublicKeyCurve { - SECP256K1 = 0; - P256 = 1; -} - -enum PublicKeyType { ELLIPTIC = 0; } - -enum ExecutionResultType { - RESULT_TYPE_UNKNOWN = 0; - RESULT_TYPE_PASS = 1; - // Couldn't process the condition/consideration due to missing facts being generated by other considerations. - RESULT_TYPE_SKIP = 2; - RESULT_TYPE_FAIL = 3; -} - -enum PartyType { - PARTY_TYPE_UNKNOWN = 0; - PARTY_TYPE_ORIGINATOR = 1; - PARTY_TYPE_SERVICER = 2; - PARTY_TYPE_INVESTOR = 3; - PARTY_TYPE_CUSTODIAN = 4; - PARTY_TYPE_OWNER = 5; - PARTY_TYPE_AFFILIATE = 6; - PARTY_TYPE_OMNIBUS = 7; - PARTY_TYPE_PROVENANCE = 8; - PARTY_TYPE_MARKER = 9; -} - -// Copied from google/protobuf/timestamp.proto into here because using that version results in generated code looking -// for methods that don't exist: MarshalToSizedBuffer, Size, and Unmarshal. - -// A Timestamp represents a point in time using values relative to the epoch. -message Timestamp { - // Represents seconds of UTC time since Unix epoch - int64 seconds = 1; - - // Non-negative fractions of a second at nanosecond resolution. - int32 nanos = 2; -} - -message ContractSpec { - DefinitionSpec definition = 1; - repeated DefinitionSpec input_specs = 2; - repeated PartyType parties_involved = 3; - repeated ConditionSpec condition_specs = 4; - repeated ConsiderationSpec consideration_specs = 5; -} - -message ConditionSpec { - string func_name = 1; - repeated DefinitionSpec input_specs = 2; - OutputSpec output_spec = 3; -} - -message ConsiderationSpec { - string func_name = 1; - - // Invoking party - PartyType responsible_party = 2; - - repeated DefinitionSpec input_specs = 3; - OutputSpec output_spec = 4; -} - -message OutputSpec { - DefinitionSpec spec = 1; -} \ No newline at end of file diff --git a/third_party/proto/provenance/metadata/v1/query.proto b/third_party/proto/provenance/metadata/v1/query.proto deleted file mode 100644 index 6a1c5de3..00000000 --- a/third_party/proto/provenance/metadata/v1/query.proto +++ /dev/null @@ -1,702 +0,0 @@ -syntax = "proto3"; -package provenance.metadata.v1; - -import "gogoproto/gogo.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "google/api/annotations.proto"; -import "provenance/metadata/v1/metadata.proto"; -import "provenance/metadata/v1/scope.proto"; -import "provenance/metadata/v1/specification.proto"; -import "provenance/metadata/v1/objectstore.proto"; - -option go_package = "github.com/provenance-io/provenance/x/metadata/types"; - -option java_package = "io.provenance.metadata.v1"; -option java_multiple_files = true; - -// Query defines the Metadata Query service. -service Query { - // Params queries the parameters of x/metadata module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/provenance/metadata/v1/params"; - } - - // ---- Primary Data Queries ----- - - // Scope searches for a scope. - // - // The scope id, if provided, must either be scope uuid, e.g. 91978ba2-5f35-459a-86a7-feca1b0512e0 or a scope address, - // e.g. scope1qzge0zaztu65tx5x5llv5xc9ztsqxlkwel. The session addr, if provided, must be a bech32 session address, - // e.g. session1qxge0zaztu65tx5x5llv5xc9zts9sqlch3sxwn44j50jzgt8rshvqyfrjcr. The record_addr, if provided, must be a - // bech32 record address, e.g. record1q2ge0zaztu65tx5x5llv5xc9ztsw42dq2jdvmdazuwzcaddhh8gmu3mcze3. - // - // * If only a scope_id is provided, that scope is returned. - // * If only a session_addr is provided, the scope containing that session is returned. - // * If only a record_addr is provided, the scope containing that record is returned. - // * If more than one of scope_id, session_addr, and record_addr are provided, and they don't refer to the same scope, - // a bad request is returned. - // - // Providing a session addr or record addr does not limit the sessions and records returned (if requested). - // Those parameters are only used to find the scope. - // - // By default, sessions and records are not included. - // Set include_sessions and/or include_records to true to include sessions and/or records. - rpc Scope(ScopeRequest) returns (ScopeResponse) { - option (google.api.http) = { - get: "/provenance/metadata/v1/scope/{scope_id}" - additional_bindings: [ - {get: "/provenance/metadata/v1/session/{session_addr}/scope"}, - {get: "/provenance/metadata/v1/record/{record_addr}/scope"} - ] - }; - } - - // ScopesAll retrieves all scopes. - rpc ScopesAll(ScopesAllRequest) returns (ScopesAllResponse) { - option (google.api.http).get = "/provenance/metadata/v1/scopes/all"; - } - - // Sessions searches for sessions. - // - // The scope_id can either be scope uuid, e.g. 91978ba2-5f35-459a-86a7-feca1b0512e0 or a scope address, e.g. - // scope1qzge0zaztu65tx5x5llv5xc9ztsqxlkwel. Similarly, the session_id can either be a uuid or session address, e.g. - // session1qxge0zaztu65tx5x5llv5xc9zts9sqlch3sxwn44j50jzgt8rshvqyfrjcr. The record_addr, if provided, must be a - // bech32 record address, e.g. record1q2ge0zaztu65tx5x5llv5xc9ztsw42dq2jdvmdazuwzcaddhh8gmu3mcze3. - // - // * If only a scope_id is provided, all sessions in that scope are returned. - // * If only a session_id is provided, it must be an address, and that single session is returned. - // * If the session_id is a uuid, then either a scope_id or record_addr must also be provided, and that single session - // is returned. - // * If only a record_addr is provided, the session containing that record will be returned. - // * If a record_name is provided then either a scope_id, session_id as an address, or record_addr must also be - // provided, and the session containing that record will be returned. - // - // A bad request is returned if: - // * The session_id is a uuid and is provided without a scope_id or record_addr. - // * A record_name is provided without any way to identify the scope (e.g. a scope_id, a session_id as an address, or - // a record_addr). - // * Two or more of scope_id, session_id as an address, and record_addr are provided and don't all refer to the same - // scope. - // * A record_addr (or scope_id and record_name) is provided with a session_id and that session does not contain such - // a record. - // * A record_addr and record_name are both provided, but reference different records. - // - // By default, the scope and records are not included. - // Set include_scope and/or include_records to true to include the scope and/or records. - rpc Sessions(SessionsRequest) returns (SessionsResponse) { - option (google.api.http) = { - get: "/provenance/metadata/v1/session/{session_id}", - additional_bindings: [ - {get: "/provenance/metadata/v1/scope/{scope_id}/sessions"}, - {get: "/provenance/metadata/v1/scope/{scope_id}/session/{session_id}"}, - {get: "/provenance/metadata/v1/record/{record_addr}/session"}, - {get: "/provenance/metadata/v1/scope/{scope_id}/record/{record_name}/session"} - ] - }; - } - - // SessionsAll retrieves all sessions. - rpc SessionsAll(SessionsAllRequest) returns (SessionsAllResponse) { - option (google.api.http).get = "/provenance/metadata/v1/sessions/all"; - } - - // Records searches for records. - // - // The record_addr, if provided, must be a bech32 record address, e.g. - // record1q2ge0zaztu65tx5x5llv5xc9ztsw42dq2jdvmdazuwzcaddhh8gmu3mcze3. The scope-id can either be scope uuid, e.g. - // 91978ba2-5f35-459a-86a7-feca1b0512e0 or a scope address, e.g. scope1qzge0zaztu65tx5x5llv5xc9ztsqxlkwel. Similarly, - // the session_id can either be a uuid or session address, e.g. - // session1qxge0zaztu65tx5x5llv5xc9zts9sqlch3sxwn44j50jzgt8rshvqyfrjcr. The name is the name of the record you're - // interested in. - // - // * If only a record_addr is provided, that single record will be returned. - // * If only a scope_id is provided, all records in that scope will be returned. - // * If only a session_id (or scope_id/session_id), all records in that session will be returned. - // * If a name is provided with a scope_id and/or session_id, that single record will be returned. - // - // A bad request is returned if: - // * The session_id is a uuid and no scope_id is provided. - // * There are two or more of record_addr, session_id, and scope_id, and they don't all refer to the same scope. - // * A name is provided, but not a scope_id and/or a session_id. - // * A name and record_addr are provided and the name doesn't match the record_addr. - // - // By default, the scope and sessions are not included. - // Set include_scope and/or include_sessions to true to include the scope and/or sessions. - rpc Records(RecordsRequest) returns (RecordsResponse) { - option (google.api.http) = { - get: "/provenance/metadata/v1/record/{record_addr}", - additional_bindings: [ - {get: "/provenance/metadata/v1/scope/{scope_id}/records"}, - {get: "/provenance/metadata/v1/scope/{scope_id}/record/{name}"}, - {get: "/provenance/metadata/v1/scope/{scope_id}/session/{session_id}/records"}, - {get: "/provenance/metadata/v1/scope/{scope_id}/session/{session_id}/record/{name}"}, - {get: "/provenance/metadata/v1/session/{session_id}/records"}, - {get: "/provenance/metadata/v1/session/{session_id}/record/{name}"} - ] - }; - } - - // RecordsAll retrieves all records. - rpc RecordsAll(RecordsAllRequest) returns (RecordsAllResponse) { - option (google.api.http).get = "/provenance/metadata/v1/records/all"; - } - - // Ownership returns the scope identifiers that list the given address as either a data or value owner. - rpc Ownership(OwnershipRequest) returns (OwnershipResponse) { - option (google.api.http).get = "/provenance/metadata/v1/ownership/{address}"; - } - - // ValueOwnership returns the scope identifiers that list the given address as the value owner. - rpc ValueOwnership(ValueOwnershipRequest) returns (ValueOwnershipResponse) { - option (google.api.http).get = "/provenance/metadata/v1/valueownership/{address}"; - } - - // ---- Specification Queries ----- - - // ScopeSpecification returns a scope specification for the given specification id. - // - // The specification_id can either be a uuid, e.g. dc83ea70-eacd-40fe-9adf-1cf6148bf8a2 or a bech32 scope - // specification address, e.g. scopespec1qnwg86nsatx5pl56muw0v9ytlz3qu3jx6m. - rpc ScopeSpecification(ScopeSpecificationRequest) returns (ScopeSpecificationResponse) { - option (google.api.http).get = "/provenance/metadata/v1/scopespec/{specification_id}"; - } - - // ScopeSpecificationsAll retrieves all scope specifications. - rpc ScopeSpecificationsAll(ScopeSpecificationsAllRequest) returns (ScopeSpecificationsAllResponse) { - option (google.api.http).get = "/provenance/metadata/v1/scopespecs/all"; - } - - // ContractSpecification returns a contract specification for the given specification id. - // - // The specification_id can either be a uuid, e.g. def6bc0a-c9dd-4874-948f-5206e6060a84, a bech32 contract - // specification address, e.g. contractspec1q000d0q2e8w5say53afqdesxp2zqzkr4fn, or a bech32 record specification - // address, e.g. recspec1qh00d0q2e8w5say53afqdesxp2zw42dq2jdvmdazuwzcaddhh8gmuqhez44. If it is a record specification - // address, then the contract specification that contains that record specification is looked up. - // - // By default, the record specifications for this contract specification are not included. - // Set include_record_specs to true to include them in the result. - rpc ContractSpecification(ContractSpecificationRequest) returns (ContractSpecificationResponse) { - option (google.api.http).get = "/provenance/metadata/v1/contractspec/{specification_id}"; - } - - // ContractSpecificationsAll retrieves all contract specifications. - rpc ContractSpecificationsAll(ContractSpecificationsAllRequest) returns (ContractSpecificationsAllResponse) { - option (google.api.http).get = "/provenance/metadata/v1/contractspecs/all"; - } - - // RecordSpecificationsForContractSpecification returns the record specifications for the given input. - // - // The specification_id can either be a uuid, e.g. def6bc0a-c9dd-4874-948f-5206e6060a84, a bech32 contract - // specification address, e.g. contractspec1q000d0q2e8w5say53afqdesxp2zqzkr4fn, or a bech32 record specification - // address, e.g. recspec1qh00d0q2e8w5say53afqdesxp2zw42dq2jdvmdazuwzcaddhh8gmuqhez44. If it is a record specification - // address, then the contract specification that contains that record specification is used. - rpc RecordSpecificationsForContractSpecification(RecordSpecificationsForContractSpecificationRequest) - returns (RecordSpecificationsForContractSpecificationResponse) { - option (google.api.http).get = "/provenance/metadata/v1/contractspec/{specification_id}/recordspecs"; - } - - // RecordSpecification returns a record specification for the given input. - rpc RecordSpecification(RecordSpecificationRequest) returns (RecordSpecificationResponse) { - option (google.api.http) = { - get: "/provenance/metadata/v1/recordspec/{specification_id}" - additional_bindings: [{get: "/provenance/metadata/v1/contractspec/{specification_id}/recordspec/{name}"}] - }; - } - - // RecordSpecificationsAll retrieves all record specifications. - rpc RecordSpecificationsAll(RecordSpecificationsAllRequest) returns (RecordSpecificationsAllResponse) { - option (google.api.http).get = "/provenance/metadata/v1/recordspecs/all"; - } - - // ---- Object Store Locator Queries ----- - - // OSLocatorParams returns all parameters for the object store locator sub module. - rpc OSLocatorParams(OSLocatorParamsRequest) returns (OSLocatorParamsResponse) { - option (google.api.http).get = "/provenance/metadata/v1/locator/params"; - } - - // OSLocator returns an ObjectStoreLocator by its owner's address. - rpc OSLocator(OSLocatorRequest) returns (OSLocatorResponse) { - option (google.api.http).get = "/provenance/metadata/v1/locator/{owner}"; - } - - // OSLocatorsByURI returns all ObjectStoreLocator entries for a locator uri. - rpc OSLocatorsByURI(OSLocatorsByURIRequest) returns (OSLocatorsByURIResponse) { - option (google.api.http).get = "/provenance/metadata/v1/locator/uri/{uri}"; - } - - // OSLocatorsByScope returns all ObjectStoreLocator entries for a for all signer's present in the specified scope. - rpc OSLocatorsByScope(OSLocatorsByScopeRequest) returns (OSLocatorsByScopeResponse) { - option (google.api.http).get = "/provenance/metadata/v1/locator/scope/{scope_id}"; - } - - // OSAllLocators returns all ObjectStoreLocator entries. - rpc OSAllLocators(OSAllLocatorsRequest) returns (OSAllLocatorsResponse) { - option (google.api.http).get = "/provenance/metadata/v1/locators/all"; - } -} - -// 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]; - - // request is a copy of the request that generated these results. - QueryParamsRequest request = 98; -} - -// ScopeRequest is the request type for the Query/Scope RPC method. -message ScopeRequest { - // scope_id can either be a uuid, e.g. 91978ba2-5f35-459a-86a7-feca1b0512e0 or a bech32 scope address, e.g. - // scope1qzge0zaztu65tx5x5llv5xc9ztsqxlkwel. - string scope_id = 1 [(gogoproto.moretags) = "yaml:\"scope_id\""]; - // session_addr is a bech32 session address, e.g. - // session1qxge0zaztu65tx5x5llv5xc9zts9sqlch3sxwn44j50jzgt8rshvqyfrjcr. - string session_addr = 2 [(gogoproto.moretags) = "yaml:\"session_addr\""]; - // record_addr is a bech32 record address, e.g. record1q2ge0zaztu65tx5x5llv5xc9ztsw42dq2jdvmdazuwzcaddhh8gmu3mcze3. - string record_addr = 3 [(gogoproto.moretags) = "yaml:\"record_addr\""]; - - // include_sessions is a flag for whether or not the sessions in the scope should be included. - bool include_sessions = 10 [(gogoproto.moretags) = "yaml:\"include_sessions\""]; - // include_records is a flag for whether or not the records in the scope should be included. - bool include_records = 11 [(gogoproto.moretags) = "yaml:\"include_records\""]; -} - -// ScopeResponse is the response type for the Query/Scope RPC method. -message ScopeResponse { - // scope is the wrapped scope result. - ScopeWrapper scope = 1; - // sessions is any number of wrapped sessions in this scope (if requested). - repeated SessionWrapper sessions = 2 [(gogoproto.moretags) = "yaml:\"sessions,omitempty\""]; - // records is any number of wrapped records in this scope (if requested). - repeated RecordWrapper records = 3 [(gogoproto.moretags) = "yaml:\"records,omitempty\""]; - - // request is a copy of the request that generated these results. - ScopeRequest request = 98; -} - -// SessionWrapper contains a single scope and its uuid. -message ScopeWrapper { - // scope is the on-chain scope message. - Scope scope = 1; - // scope_id_info contains information about the id/address of the scope. - ScopeIdInfo scope_id_info = 2 [(gogoproto.moretags) = "yaml:\"scope_id_info\""]; - // scope_spec_id_info contains information about the id/address of the scope specification. - ScopeSpecIdInfo scope_spec_id_info = 3 [(gogoproto.moretags) = "yaml:\"scope_spec_id_info\""]; -} - -// ScopesAllRequest is the request type for the Query/ScopesAll RPC method. -message ScopesAllRequest { - // pagination defines optional pagination parameters for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 99; -} - -// ScopesAllResponse is the response type for the Query/ScopesAll RPC method. -message ScopesAllResponse { - // scopes are the wrapped scopes. - repeated ScopeWrapper scopes = 1; - - // request is a copy of the request that generated these results. - ScopesAllRequest request = 98; - // pagination provides the pagination information of this response. - cosmos.base.query.v1beta1.PageResponse pagination = 99; -} - -// SessionsRequest is the request type for the Query/Sessions RPC method. -message SessionsRequest { - // scope_id can either be a uuid, e.g. 91978ba2-5f35-459a-86a7-feca1b0512e0 or a bech32 scope address, e.g. - // scope1qzge0zaztu65tx5x5llv5xc9ztsqxlkwel. - string scope_id = 1 [(gogoproto.moretags) = "yaml:\"scope_id\""]; - // session_id can either be a uuid, e.g. 5803f8bc-6067-4eb5-951f-2121671c2ec0 or a bech32 session address, e.g. - // session1qxge0zaztu65tx5x5llv5xc9zts9sqlch3sxwn44j50jzgt8rshvqyfrjcr. This can only be a uuid if a scope_id is also - // provided. - string session_id = 2 [(gogoproto.moretags) = "yaml:\"session_id\""]; - // record_addr is a bech32 record address, e.g. record1q2ge0zaztu65tx5x5llv5xc9ztsw42dq2jdvmdazuwzcaddhh8gmu3mcze3. - string record_addr = 3 [(gogoproto.moretags) = "yaml:\"record_addr\""]; - // record_name is the name of the record to find the session for in the provided scope. - string record_name = 4 [(gogoproto.moretags) = "yaml:\"record_name\""]; - - // include_scope is a flag for whether or not the scope containing these sessions should be included. - bool include_scope = 10 [(gogoproto.moretags) = "yaml:\"include_scope\""]; - // include_records is a flag for whether or not the records in these sessions should be included. - bool include_records = 11 [(gogoproto.moretags) = "yaml:\"include_records\""]; -} - -// SessionsResponse is the response type for the Query/Sessions RPC method. -message SessionsResponse { - // scope is the wrapped scope that holds these sessions (if requested). - ScopeWrapper scope = 1 [(gogoproto.moretags) = "yaml:\"scope,omitempty\""]; - // sessions is any number of wrapped session results. - repeated SessionWrapper sessions = 2; - // records is any number of wrapped records contained in these sessions (if requested). - repeated RecordWrapper records = 3 [(gogoproto.moretags) = "yaml:\"records,omitempty\""]; - - // request is a copy of the request that generated these results. - SessionsRequest request = 98; -} - -// SessionWrapper contains a single session and some extra identifiers for it. -message SessionWrapper { - // session is the on-chain session message. - Session session = 1; - // session_id_info contains information about the id/address of the session. - SessionIdInfo session_id_info = 2 [(gogoproto.moretags) = "yaml:\"session_id_info\""]; - // contract_spec_id_info contains information about the id/address of the contract specification. - ContractSpecIdInfo contract_spec_id_info = 3 [(gogoproto.moretags) = "yaml:\"contract_spec_id_info\""]; -} - -// SessionsAllRequest is the request type for the Query/SessionsAll RPC method. -message SessionsAllRequest { - // pagination defines optional pagination parameters for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 99; -} - -// SessionsAllResponse is the response type for the Query/SessionsAll RPC method. -message SessionsAllResponse { - // sessions are the wrapped sessions. - repeated SessionWrapper sessions = 1; - - // request is a copy of the request that generated these results. - SessionsAllRequest request = 98; - // pagination provides the pagination information of this response. - cosmos.base.query.v1beta1.PageResponse pagination = 99; -} - -// RecordsRequest is the request type for the Query/Records RPC method. -message RecordsRequest { - // record_addr is a bech32 record address, e.g. record1q2ge0zaztu65tx5x5llv5xc9ztsw42dq2jdvmdazuwzcaddhh8gmu3mcze3. - string record_addr = 1 [(gogoproto.moretags) = "yaml:\"record_addr\""]; - // scope_id can either be a uuid, e.g. 91978ba2-5f35-459a-86a7-feca1b0512e0 or a bech32 scope address, e.g. - // scope1qzge0zaztu65tx5x5llv5xc9ztsqxlkwel. - string scope_id = 2 [(gogoproto.moretags) = "yaml:\"scope_id\""]; - // session_id can either be a uuid, e.g. 5803f8bc-6067-4eb5-951f-2121671c2ec0 or a bech32 session address, e.g. - // session1qxge0zaztu65tx5x5llv5xc9zts9sqlch3sxwn44j50jzgt8rshvqyfrjcr. This can only be a uuid if a scope_id is also - // provided. - string session_id = 3 [(gogoproto.moretags) = "yaml:\"session_id\""]; - // name is the name of the record to look for - string name = 4; - - // include_scope is a flag for whether or not the scope containing these records should be included. - bool include_scope = 10 [(gogoproto.moretags) = "yaml:\"include_scope\""]; - // include_sessions is a flag for whether or not the sessions containing these records should be included. - bool include_sessions = 11 [(gogoproto.moretags) = "yaml:\"include_sessions\""]; -} - -// RecordsResponse is the response type for the Query/Records RPC method. -message RecordsResponse { - // scope is the wrapped scope that holds these records (if requested). - ScopeWrapper scope = 1 [(gogoproto.moretags) = "yaml:\"scope,omitempty\""]; - // sessions is any number of wrapped sessions that hold these records (if requested). - repeated SessionWrapper sessions = 2 [(gogoproto.moretags) = "yaml:\"sessions,omitempty\""]; - // records is any number of wrapped record results. - repeated RecordWrapper records = 3; - - // request is a copy of the request that generated these results. - RecordsRequest request = 98; -} - -// RecordWrapper contains a single record and some extra identifiers for it. -message RecordWrapper { - // record is the on-chain record message. - Record record = 1; - // record_id_info contains information about the id/address of the record. - RecordIdInfo record_id_info = 2 [(gogoproto.moretags) = "yaml:\"record_id_info\""]; - // record_spec_id_info contains information about the id/address of the record specification. - RecordSpecIdInfo record_spec_id_info = 3 [(gogoproto.moretags) = "yaml:\"record_spec_id_info\""]; -} - -// RecordsAllRequest is the request type for the Query/RecordsAll RPC method. -message RecordsAllRequest { - // pagination defines optional pagination parameters for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 99; -} - -// RecordsAllResponse is the response type for the Query/RecordsAll RPC method. -message RecordsAllResponse { - // records are the wrapped records. - repeated RecordWrapper records = 1; - - // request is a copy of the request that generated these results. - RecordsAllRequest request = 98; - // pagination provides the pagination information of this response. - cosmos.base.query.v1beta1.PageResponse pagination = 99; -} - -// OwnershipRequest is the request type for the Query/Ownership RPC method. -message OwnershipRequest { - string address = 1; - - // pagination defines optional pagination parameters for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 99; -} - -// OwnershipResponse is the response type for the Query/Ownership RPC method. -message OwnershipResponse { - // A list of scope ids (uuid) associated with the given address. - repeated string scope_uuids = 1 [(gogoproto.moretags) = "yaml:\"scope_uuids\""]; - - // request is a copy of the request that generated these results. - OwnershipRequest request = 98; - // pagination provides the pagination information of this response. - cosmos.base.query.v1beta1.PageResponse pagination = 99; -} - -// ValueOwnershipRequest is the request type for the Query/ValueOwnership RPC method. -message ValueOwnershipRequest { - string address = 1; - - // pagination defines optional pagination parameters for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 99; -} - -// ValueOwnershipResponse is the response type for the Query/ValueOwnership RPC method. -message ValueOwnershipResponse { - // A list of scope ids (uuid) associated with the given address. - repeated string scope_uuids = 1 [(gogoproto.moretags) = "yaml:\"scope_uuids\""]; - - // request is a copy of the request that generated these results. - ValueOwnershipRequest request = 98; - // pagination provides the pagination information of this response. - cosmos.base.query.v1beta1.PageResponse pagination = 99; -} - -// ScopeSpecificationRequest is the request type for the Query/ScopeSpecification RPC method. -message ScopeSpecificationRequest { - // specification_id can either be a uuid, e.g. dc83ea70-eacd-40fe-9adf-1cf6148bf8a2 or a bech32 scope specification - // address, e.g. scopespec1qnwg86nsatx5pl56muw0v9ytlz3qu3jx6m. - string specification_id = 1 [(gogoproto.moretags) = "yaml:\"specification_id\""]; -} - -// ScopeSpecificationResponse is the response type for the Query/ScopeSpecification RPC method. -message ScopeSpecificationResponse { - // scope_specification is the wrapped scope specification. - ScopeSpecificationWrapper scope_specification = 1 [(gogoproto.moretags) = "yaml:\"scope_specification\""]; - - // request is a copy of the request that generated these results. - ScopeSpecificationRequest request = 98; -} - -// ScopeSpecificationWrapper contains a single scope specification and some extra identifiers for it. -message ScopeSpecificationWrapper { - // specification is the on-chain scope specification message. - ScopeSpecification specification = 1; - // scope_spec_id_info contains information about the id/address of the scope specification. - ScopeSpecIdInfo scope_spec_id_info = 2 [(gogoproto.moretags) = "yaml:\"scope_spec_id_info\""]; -} - -// ScopeSpecificationsAllRequest is the request type for the Query/ScopeSpecificationsAll RPC method. -message ScopeSpecificationsAllRequest { - // pagination defines optional pagination parameters for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 99; -} - -// ScopeSpecificationsAllResponse is the response type for the Query/ScopeSpecificationsAll RPC method. -message ScopeSpecificationsAllResponse { - // scope_specifications are the wrapped scope specifications. - repeated ScopeSpecificationWrapper scope_specifications = 1 [(gogoproto.moretags) = "yaml:\"scope_specifications\""]; - - // request is a copy of the request that generated these results. - ScopeSpecificationsAllRequest request = 98; - // pagination provides the pagination information of this response. - cosmos.base.query.v1beta1.PageResponse pagination = 99; -} - -// ContractSpecificationRequest is the request type for the Query/ContractSpecification RPC method. -message ContractSpecificationRequest { - // specification_id can either be a uuid, e.g. def6bc0a-c9dd-4874-948f-5206e6060a84 or a bech32 contract specification - // address, e.g. contractspec1q000d0q2e8w5say53afqdesxp2zqzkr4fn. - // It can also be a record specification address, e.g. - // recspec1qh00d0q2e8w5say53afqdesxp2zw42dq2jdvmdazuwzcaddhh8gmuqhez44. - string specification_id = 1 [(gogoproto.moretags) = "yaml:\"specification_id\""]; - - // include_record_specs is a flag for whether or not the record specifications in this contract specification should - // be included in the result. - bool include_record_specs = 10 [(gogoproto.moretags) = "yaml:\"include_record_specs\""]; -} - -// ContractSpecificationResponse is the response type for the Query/ContractSpecification RPC method. -message ContractSpecificationResponse { - // contract_specification is the wrapped contract specification. - ContractSpecificationWrapper contract_specification = 1 [(gogoproto.moretags) = "yaml:\"contract_specification\""]; - // record_specifications is any number or wrapped record specifications associated with this contract_specification - // (if requested). - repeated RecordSpecificationWrapper record_specifications = 3 - [(gogoproto.moretags) = "yaml:\"record_specifications,omitempty\""]; - - // request is a copy of the request that generated these results. - ContractSpecificationRequest request = 98; -} - -// ContractSpecificationWrapper contains a single contract specification and some extra identifiers for it. -message ContractSpecificationWrapper { - // specification is the on-chain contract specification message. - ContractSpecification specification = 1; - // contract_spec_id_info contains information about the id/address of the contract specification. - ContractSpecIdInfo contract_spec_id_info = 2 [(gogoproto.moretags) = "yaml:\"contract_spec_id_info\""]; -} - -// ContractSpecificationsAllRequest is the request type for the Query/ContractSpecificationsAll RPC method. -message ContractSpecificationsAllRequest { - // pagination defines optional pagination parameters for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 99; -} - -// ContractSpecificationsAllResponse is the response type for the Query/ContractSpecificationsAll RPC method. -message ContractSpecificationsAllResponse { - // contract_specifications are the wrapped contract specifications. - repeated ContractSpecificationWrapper contract_specifications = 1 - [(gogoproto.moretags) = "yaml:\"contract_specifications\""]; - - // request is a copy of the request that generated these results. - ContractSpecificationsAllRequest request = 98; - // pagination provides the pagination information of this response. - cosmos.base.query.v1beta1.PageResponse pagination = 99; -} - -// RecordSpecificationsForContractSpecificationRequest is the request type for the -// Query/RecordSpecificationsForContractSpecification RPC method. -message RecordSpecificationsForContractSpecificationRequest { - // specification_id can either be a uuid, e.g. def6bc0a-c9dd-4874-948f-5206e6060a84 or a bech32 contract specification - // address, e.g. contractspec1q000d0q2e8w5say53afqdesxp2zqzkr4fn. - // It can also be a record specification address, e.g. - // recspec1qh00d0q2e8w5say53afqdesxp2zw42dq2jdvmdazuwzcaddhh8gmuqhez44. - string specification_id = 1 [(gogoproto.moretags) = "yaml:\"specification_id\""]; -} - -// RecordSpecificationsForContractSpecificationResponse is the response type for the -// Query/RecordSpecificationsForContractSpecification RPC method. -message RecordSpecificationsForContractSpecificationResponse { - // record_specifications is any number of wrapped record specifications associated with this contract_specification. - repeated RecordSpecificationWrapper record_specifications = 1 - [(gogoproto.moretags) = "yaml:\"record_specifications\""]; - // contract_specification_uuid is the uuid of this contract specification. - string contract_specification_uuid = 2 [(gogoproto.moretags) = "yaml:\"contract_specification_uuid\""]; - // contract_specification_addr is the contract specification address as a bech32 encoded string. - string contract_specification_addr = 3 [(gogoproto.moretags) = "yaml:\"contract_specification_addr\""]; - - // request is a copy of the request that generated these results. - RecordSpecificationsForContractSpecificationRequest request = 98; -} - -// RecordSpecificationRequest is the request type for the Query/RecordSpecification RPC method. -message RecordSpecificationRequest { - // specification_id can either be a uuid, e.g. def6bc0a-c9dd-4874-948f-5206e6060a84 or a bech32 contract specification - // address, e.g. contractspec1q000d0q2e8w5say53afqdesxp2zqzkr4fn. - // It can also be a record specification address, e.g. - // recspec1qh00d0q2e8w5say53afqdesxp2zw42dq2jdvmdazuwzcaddhh8gmuqhez44. - string specification_id = 1 [(gogoproto.moretags) = "yaml:\"specification_id\""]; - // name is the name of the record to look up. - // It is required if the specification_id is a uuid or contract specification address. - // It is ignored if the specification_id is a record specification address. - string name = 2; -} - -// RecordSpecificationResponse is the response type for the Query/RecordSpecification RPC method. -message RecordSpecificationResponse { - // record_specification is the wrapped record specification. - RecordSpecificationWrapper record_specification = 1 [(gogoproto.moretags) = "yaml:\"record_specification\""]; - - // request is a copy of the request that generated these results. - RecordSpecificationRequest request = 98; -} - -// RecordSpecificationWrapper contains a single record specification and some extra identifiers for it. -message RecordSpecificationWrapper { - // specification is the on-chain record specification message. - RecordSpecification specification = 1; - // record_spec_id_info contains information about the id/address of the record specification. - RecordSpecIdInfo record_spec_id_info = 2 [(gogoproto.moretags) = "yaml:\"record_spec_id_info\""]; -} - -// RecordSpecificationsAllRequest is the request type for the Query/RecordSpecificationsAll RPC method. -message RecordSpecificationsAllRequest { - // pagination defines optional pagination parameters for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 99; -} - -// RecordSpecificationsAllResponse is the response type for the Query/RecordSpecificationsAll RPC method. -message RecordSpecificationsAllResponse { - // record_specifications are the wrapped record specifications. - repeated RecordSpecificationWrapper record_specifications = 1 - [(gogoproto.moretags) = "yaml:\"record_specifications\""]; - - // request is a copy of the request that generated these results. - RecordSpecificationsAllRequest request = 98; - // pagination provides the pagination information of this response. - cosmos.base.query.v1beta1.PageResponse pagination = 99; -} - -// OSLocatorParamsRequest is the request type for the Query/OSLocatorParams RPC method. -message OSLocatorParamsRequest {} - -// OSLocatorParamsResponse is the response type for the Query/OSLocatorParams RPC method. -message OSLocatorParamsResponse { - // params defines the parameters of the module. - OSLocatorParams params = 1 [(gogoproto.nullable) = false]; - - // request is a copy of the request that generated these results. - OSLocatorParamsRequest request = 98; -} - -// OSLocatorRequest is the request type for the Query/OSLocator RPC method. -message OSLocatorRequest { - string owner = 1; -} - -// OSLocatorResponse is the response type for the Query/OSLocator RPC method. -message OSLocatorResponse { - ObjectStoreLocator locator = 1; - - // request is a copy of the request that generated these results. - OSLocatorRequest request = 98; -} - -// OSLocatorsByURIRequest is the request type for the Query/OSLocatorsByURI RPC method. -message OSLocatorsByURIRequest { - string uri = 1; - - // pagination defines optional pagination parameters for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 99; -} - -// OSLocatorsByURIResponse is the response type for the Query/OSLocatorsByURI RPC method. -message OSLocatorsByURIResponse { - repeated ObjectStoreLocator locators = 1 [(gogoproto.nullable) = false]; - - // request is a copy of the request that generated these results. - OSLocatorsByURIRequest request = 98; - // pagination provides the pagination information of this response. - cosmos.base.query.v1beta1.PageResponse pagination = 99; -} - -// OSLocatorsByScopeRequest is the request type for the Query/OSLocatorsByScope RPC method. -message OSLocatorsByScopeRequest { - string scope_id = 1 [(gogoproto.moretags) = "yaml:\"scope_id\""]; -} - -// OSLocatorsByScopeResponse is the response type for the Query/OSLocatorsByScope RPC method. -message OSLocatorsByScopeResponse { - repeated ObjectStoreLocator locators = 1 [(gogoproto.nullable) = false]; - - // request is a copy of the request that generated these results. - OSLocatorsByScopeRequest request = 98; -} - -// OSAllLocatorsRequest is the request type for the Query/OSAllLocators RPC method. -message OSAllLocatorsRequest { - // pagination defines optional pagination parameters for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 99; -} - -// OSAllLocatorsResponse is the response type for the Query/OSAllLocators RPC method. -message OSAllLocatorsResponse { - repeated ObjectStoreLocator locators = 1 [(gogoproto.nullable) = false]; - - // request is a copy of the request that generated these results. - OSAllLocatorsRequest request = 98; - // pagination provides the pagination information of this response. - cosmos.base.query.v1beta1.PageResponse pagination = 99; -} diff --git a/third_party/proto/provenance/metadata/v1/scope.proto b/third_party/proto/provenance/metadata/v1/scope.proto deleted file mode 100644 index 51a98785..00000000 --- a/third_party/proto/provenance/metadata/v1/scope.proto +++ /dev/null @@ -1,252 +0,0 @@ -syntax = "proto3"; -package provenance.metadata.v1; - -option go_package = "github.com/provenance-io/provenance/x/metadata/types"; - -option java_package = "io.provenance.metadata.v1"; -option java_multiple_files = true; - -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/descriptor.proto"; -import "provenance/metadata/v1/specification.proto"; - -/** - -Overview - -The structures in this file are used to efficiently store the data for the metadata module. The structure the core -concept of the Metadata module is a Scope that contains a list of Records/Facts. Updates to scopes are performed -in a session with details persisted in a Session. Each session contains a specification that details -constraints on parties that must sign, inputs, and outputs that can be recorded. Each Scope may contain a list of -allowed specifications that may be used. - - -Data Structures - - Metadata Scope - - A metadata scope contains a collection of records of data, each made up of a hash, data type, and ownership - information that establishes provenance. - - Sessions - - Typically multiple records will be established within a scope at the same time (see: Contract Memorialization). A - Session contains context for the recording of these records linking a set of records into a common process/ - execution associated with a specification indicating allowed and required values. - - Record - - A single record collects information about a process that generated it, a collection of inputs, and one or more - outputs into a structure identified by a name that is unique within a scope. - - -KVStore State Data - -Iterators -- Get All Scopes () []Scope -- Get All Sessions (:) []Session - * This method would be used to list all current session/transaction contexts with Records set on the scope -- Get All Scope Records (:) : []Record - - -Direct Access -- Get Scope (:) Scope -- Get Session (::) : Session -- Get Record (::) : Record - - -Indexes (special kvstore records for efficient cross reference/queries) -- Get Session Records - use filtered iterator over all scope records -- Get all scopes for a party/address? -- Get all scopes of a specific type (scope spec)? -- Get all sessions of a specific specification type? -- Get all Records of a type? - - -*/ - -// Scope defines a root reference for a collection of records owned by one or more parties. -message Scope { - option (gogoproto.goproto_stringer) = false; - - // Unique ID for this scope. Implements sdk.Address interface for use where addresses are required in Cosmos - bytes scope_id = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"scope_id\"" - ]; - // the scope specification that contains the specifications for data elements allowed within this scope - bytes specification_id = 2 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"specification_id\"" - ]; - // These parties represent top level owners of the records within. These parties must sign any requests that modify - // the data within the scope. These addresses are in union with parties listed on the sessions. - repeated Party owners = 3 [(gogoproto.nullable) = false]; - // Addessses in this list are authorized to recieve off-chain data associated with this scope. - repeated string data_access = 4 [(gogoproto.moretags) = "yaml:\"data_access\""]; - // An address that controls the value associated with this scope. Standard blockchain accounts and marker accounts - // are supported for this value. This attribute may only be changed by the entity indicated once it is set. - string value_owner_address = 5 [(gogoproto.moretags) = "yaml:\"value_owner_address\""]; -} - -/* -A Session is created for an execution context against a specific specification instance - -The context will have a specification and set of parties involved. The Session may be updated several -times so long as the parties listed are signers on the transaction. NOTE: When there are no Records within a Scope -that reference a Session it is removed. -*/ -message Session { - option (gogoproto.goproto_stringer) = false; - - bytes session_id = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"session_id\"" - ]; - // unique id of the contract specification that was used to create this session. - bytes specification_id = 2 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"specification_id\"" - ]; - // parties is the set of identities that signed this contract - repeated Party parties = 3 [(gogoproto.nullable) = false]; - // name to associate with this session execution context, typically classname - string name = 4 [(gogoproto.jsontag) = "type", (gogoproto.moretags) = "yaml:\"type\""]; - // context is a field for storing client specific data associated with a session. - bytes context = 5; - // Created by, updated by, timestamps, version number, and related info. - AuditFields audit = 99 [(gogoproto.moretags) = "yaml:\"audit,omitempty\""]; -} - -// A record (of fact) is attached to a session or each consideration output from a contract -message Record { - option (gogoproto.goproto_stringer) = false; - - // name/identifier for this record. Value must be unique within the scope. Also known as a Fact name - string name = 1 [(gogoproto.jsontag) = "id", (gogoproto.moretags) = "yaml:\"id\""]; - // id of the session context that was used to create this record (use with filtered kvprefix iterator) - bytes session_id = 2 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"session_id\"" - ]; - // process contain information used to uniquely identify an execution on or off chain that generated this record - Process process = 3 [(gogoproto.nullable) = false]; - // inputs used with the process to achieve the output on this record - repeated RecordInput inputs = 4 [(gogoproto.nullable) = false]; - // output(s) is the results of executing the process on the given process indicated in this record - repeated RecordOutput outputs = 5 [(gogoproto.nullable) = false]; - // specification_id is the id of the record specification that was used to create this record. - bytes specification_id = 6 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"specification_id\"" - ]; -} - -// Process contains information used to uniquely identify what was used to generate this record -message Process { - option (gogoproto.goproto_stringer) = false; - // unique identifier for this process - oneof process_id { - // the address of a smart contract used for this process - string address = 1; - // the hash of an off-chain process used - string hash = 2; - } - // a name associated with the process (type_name, classname or smart contract common name) - string name = 3; - // method is a name or reference to a specific operation (method) within a class/contract that was invoked - string method = 4; -} - -// Tracks the inputs used to establish this record -message RecordInput { - option (gogoproto.goproto_stringer) = false; - // Name value included to link back to the definition spec. - string name = 1; - // data source - oneof source { - // the address of a record on chain (For Established Records) - bytes record_id = 2 [(gogoproto.customtype) = "MetadataAddress", (gogoproto.moretags) = "yaml:\"record_id\""]; - // the hash of an off-chain piece of information (For Proposed Records) - string hash = 3; - } - // from proposed fact structure to unmarshal - string type_name = 4 [(gogoproto.moretags) = "yaml:\"type_name\""]; - // Indicates if this input was a recorded fact on chain or just a given hashed input - RecordInputStatus status = 5; -} - -// A set of types for inputs on a record (of fact) -enum RecordInputStatus { - // RECORD_INPUT_STATUS_UNSPECIFIED indicates an invalid/unknown input type - RECORD_INPUT_STATUS_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "Unknown"]; - // RECORD_INPUT_STATUS_PROPOSED indicates this input was an arbitrary piece of data that was hashed - RECORD_INPUT_STATUS_PROPOSED = 1 [(gogoproto.enumvalue_customname) = "Proposed"]; - // RECORD_INPUT_STATUS_RECORD indicates this input is a reference to a previously recorded fact on blockchain - RECORD_INPUT_STATUS_RECORD = 2 [(gogoproto.enumvalue_customname) = "Record"]; -} - -// RecordOutput encapsulates the output of a process recorded on chain -message RecordOutput { - option (gogoproto.goproto_stringer) = false; - - // Hash of the data output that was output/generated for this record - string hash = 1; - // Status of the process execution associated with this output indicating success,failure, or pending - ResultStatus status = 2; -} - -// ResultStatus indicates the various states of execution of a record -enum ResultStatus { - // RESULT_STATUS_UNSPECIFIED indicates an unset condition - RESULT_STATUS_UNSPECIFIED = 0; - // RESULT_STATUS_PASS indicates the execution was successfult - RESULT_STATUS_PASS = 1; - // RESULT_STATUS_SKIP indicates condition/consideration was skipped due to missing inputs or delayed execution - RESULT_STATUS_SKIP = 2; - // RESULT_STATUS_FAIL indicates the execution of the condition/consideration failed. - RESULT_STATUS_FAIL = 3; -} - -// A Party is an address with/in a given role associated with a contract -message Party { - option (gogoproto.goproto_stringer) = false; - - // address of the account (on chain) - string address = 1; - // a role for this account within the context of the processes used - PartyType role = 2; -} - -// AuditFields capture information about the last account to make modifications and when they were made -message AuditFields { - // the date/time when this entry was created - google.protobuf.Timestamp created_date = 1 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "created_date,omitempty", - (gogoproto.moretags) = "yaml:\"created_date,omitempty\"" - ]; - // the address of the account that created this record - string created_by = 2 [(gogoproto.moretags) = "yaml:\"created_by,omitempty\""]; - // the date/time when this entry was last updated - google.protobuf.Timestamp updated_date = 3 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false, - (gogoproto.jsontag) = "updated_date,omitempty", - (gogoproto.moretags) = "yaml:\"updated_date,omitempty\"" - ]; - // the address of the account that modified this record - string updated_by = 4 [(gogoproto.moretags) = "yaml:\"updated_by,omitempty\""]; - // an optional version number that is incremented with each update - uint32 version = 5 [(gogoproto.moretags) = "yaml:\"version,omitempty\""]; - // an optional message associated with the creation/update event - string message = 6 [(gogoproto.moretags) = "yaml:\"message,omitempty\""]; -} diff --git a/third_party/proto/provenance/metadata/v1/specification.proto b/third_party/proto/provenance/metadata/v1/specification.proto deleted file mode 100644 index 1308d059..00000000 --- a/third_party/proto/provenance/metadata/v1/specification.proto +++ /dev/null @@ -1,175 +0,0 @@ -syntax = "proto3"; -package provenance.metadata.v1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/provenance-io/provenance/x/metadata/types"; -option java_package = "io.provenance.metadata.v1"; -option java_multiple_files = true; - -// Specifications are a heirarchy of references to existing on chain data as well as a list of requirements that -// incoming requests to record data against a scope must meet. Typical requirements included hashes that must be -// supplied corosponding to process/executable that must be ran, required signatures and sources of accounts that -// must sign requests, and allowed attributes/records that may be added to a scope. -// -// Scope Specification -// The top level specification for a scope indicates a set of allowed ContractSpecifications (see add contract spec) -// that are allowed to be used against a given scope to perform updates. Requests to record data that do not derive -// from these contractspecifications are not allowed. -// -// Record Specification -// The specifics of which records are allowed within a group (and by extension the scope overall) are outlined using -// Consideration_Specs. These considerations include required inputs, output format, and parties that must be -// associated with any request to record. -// -// Contract Specification -// The primary function of contract specifications is to denote the Contracts/Processes that will be used to manage -// the data within a scope. These specifications control what information may be recorded on chain. The use of -// definitions for inputs can build a chain of data references that must be in place in order for records to be -// added to the chain. -// -// Example: -// A ContractSpecification may list a RecordSpecification that requires an input of type "Record" (indicating a -// reference to a scope/record must exist on chain) in order for a specific Consideration (process/method) to be -// executed and have an output_spec ultimately result in a record added to the scope. - -// ScopeSpecification defines the required parties, resources, conditions, and consideration outputs for a contract -message ScopeSpecification { - option (gogoproto.goproto_stringer) = false; - - // unique identifier for this specification on chain - bytes specification_id = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"specification_id\"" - ]; - // General information about this scope specification. - Description description = 2; - // Addresses of the owners of this scope specification. - repeated string owner_addresses = 3 [(gogoproto.moretags) = "yaml:\"owner_addresses\""]; - // A list of parties that must be present on a scope (and their associated roles) - repeated PartyType parties_involved = 4 [(gogoproto.moretags) = "yaml:\"parties_involved\""]; - // A list of contract specification ids allowed for a scope based on this specification. - repeated bytes contract_spec_ids = 5 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"contract_spec_ids\"" - ]; -} - -// ContractSpecification defines the required parties, resources, conditions, and consideration outputs for a contract -message ContractSpecification { - option (gogoproto.goproto_stringer) = false; - - // unique identifier for this specification on chain - bytes specification_id = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"specification_id\"" - ]; - // Description information for this contract specification - Description description = 2; - // Address of the account that owns this specificaiton - repeated string owner_addresses = 3 [(gogoproto.moretags) = "yaml:\"owner_addresses\""]; - // a list of party roles that must be fullfilled when signing a transaction for this contract specification - repeated PartyType parties_involved = 4 [(gogoproto.moretags) = "yaml:\"parties_involved\""]; - // Reference to a metadata record with a hash and type information for the instance of code that will process this - // contract - oneof source { - // the address of a record on chain that represents this contract - bytes resource_id = 5 [(gogoproto.customtype) = "MetadataAddress", (gogoproto.moretags) = "yaml:\"resource_id\""]; - // the hash of contract binary (off-chain instance) - string hash = 6; - } - // name of the class/type of this contract executable - string class_name = 7 [(gogoproto.moretags) = "yaml:\"class_name\""]; -} - -// RecordSpecification defines the specification for a Record including allowed/required inputs/outputs -message RecordSpecification { - option (gogoproto.goproto_stringer) = false; - - // unique identifier for this specification on chain - bytes specification_id = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"specification_id\"" - ]; - // Name of Record that will be created when this specification is used - string name = 2; - // A set of inputs that must be satisified to apply this RecordSpecification and create a Record - repeated InputSpecification inputs = 3; - // A type name for data associated with this record (typically a class or proto name) - string type_name = 4 [(gogoproto.moretags) = "yaml:\"type_name\""]; - // Type of result for this record specification (must be RECORD or RECORD_LIST) - DefinitionType result_type = 5 [(gogoproto.moretags) = "yaml:\"result_type\""]; - // Type of party responsible for this record - repeated PartyType responsible_parties = 6 [(gogoproto.moretags) = "yaml:\"responsible_parties\""]; -} - -// InputSpecification defines a name, type_name, and source reference (either on or off chain) to define an input -// parameter -message InputSpecification { - option (gogoproto.goproto_stringer) = false; - - // name for this input - string name = 1; - // a type_name (typically a proto name or class_name) - string type_name = 2 [(gogoproto.moretags) = "yaml:\"type_name\""]; - // source is either on chain (record_id) or off-chain (hash) - oneof source { - // the address of a record on chain (For Established Records) - bytes record_id = 3 [(gogoproto.customtype) = "MetadataAddress", (gogoproto.moretags) = "yaml:\"record_id\""]; - // the hash of an off-chain piece of information (For Proposed Records) - string hash = 4; - } -} - -// Description holds general information that is handy to associate with a structure. -message Description { - option (gogoproto.goproto_stringer) = false; - - // A Name for this thing. - string name = 1; - // A description of this thing. - string description = 3; - // URL to find even more info. - string website_url = 4 [(gogoproto.moretags) = "yaml:\"website_url\""]; - // URL of an icon. - string icon_url = 5 [(gogoproto.moretags) = "yaml:\"icon_url\""]; -} - -// DefinitionType indicates the required definition type for this value -enum DefinitionType { - // DEFINITION_TYPE_UNSPECIFIED indicates an unknown/invalid value - DEFINITION_TYPE_UNSPECIFIED = 0; - // DEFINITION_TYPE_PROPOSED indicates a proposed value is used here (a record that is not on-chain) - DEFINITION_TYPE_PROPOSED = 1; - // DEFINITION_TYPE_RECORD indicates the value must be a reference to a record on chain - DEFINITION_TYPE_RECORD = 2; - // DEFINITION_TYPE_RECORD_LIST indicates the value maybe a reference to a collection of values on chain having - // the same name - DEFINITION_TYPE_RECORD_LIST = 3; -} - -// PartyType are the different roles parties on a contract may use -enum PartyType { - // PARTY_TYPE_UNSPECIFIED is an error condition - PARTY_TYPE_UNSPECIFIED = 0; - // PARTY_TYPE_ORIGINATOR is an asset originator - PARTY_TYPE_ORIGINATOR = 1; - // PARTY_TYPE_SERVICER provides debt servicing functions - PARTY_TYPE_SERVICER = 2; - // PARTY_TYPE_INVESTOR is a generic investor - PARTY_TYPE_INVESTOR = 3; - // PARTY_TYPE_CUSTODIAN is an entity that provides custodian services for assets - PARTY_TYPE_CUSTODIAN = 4; - // PARTY_TYPE_OWNER indicates this party is an owner of the item - PARTY_TYPE_OWNER = 5; - // PARTY_TYPE_AFFILIATE is a party with an affiliate agreement - PARTY_TYPE_AFFILIATE = 6; - // PARTY_TYPE_OMNIBUS is a special type of party that controls an omnibus bank account - PARTY_TYPE_OMNIBUS = 7; - // PARTY_TYPE_PROVENANCE is used to indicate this party represents the blockchain or a smart contract action - PARTY_TYPE_PROVENANCE = 8; -} diff --git a/third_party/proto/provenance/metadata/v1/tx.proto b/third_party/proto/provenance/metadata/v1/tx.proto deleted file mode 100644 index 54f742fc..00000000 --- a/third_party/proto/provenance/metadata/v1/tx.proto +++ /dev/null @@ -1,623 +0,0 @@ -syntax = "proto3"; -package provenance.metadata.v1; - -import "gogoproto/gogo.proto"; -import "provenance/metadata/v1/metadata.proto"; -import "provenance/metadata/v1/objectstore.proto"; -import "provenance/metadata/v1/p8e/p8e.proto"; -import "provenance/metadata/v1/scope.proto"; -import "provenance/metadata/v1/specification.proto"; - -option go_package = "github.com/provenance-io/provenance/x/metadata/types"; - -option java_package = "io.provenance.metadata.v1"; -option java_multiple_files = true; - -// Msg defines the Metadata Msg service. -service Msg { - // ---- Primary Data Management ----- - - // WriteScope adds or updates a scope. - rpc WriteScope(MsgWriteScopeRequest) returns (MsgWriteScopeResponse); - // DeleteScope deletes a scope and all associated Records, Sessions. - rpc DeleteScope(MsgDeleteScopeRequest) returns (MsgDeleteScopeResponse); - - // AddScopeDataAccess adds data access AccAddress to scope - rpc AddScopeDataAccess(MsgAddScopeDataAccessRequest) returns (MsgAddScopeDataAccessResponse); - // DeleteScopeDataAccess removes data access AccAddress from scope - rpc DeleteScopeDataAccess(MsgDeleteScopeDataAccessRequest) returns (MsgDeleteScopeDataAccessResponse); - - // AddScopeOwner adds new owner AccAddress to scope - rpc AddScopeOwner(MsgAddScopeOwnerRequest) returns (MsgAddScopeOwnerResponse); - // DeleteScopeOwner removes data access AccAddress from scope - rpc DeleteScopeOwner(MsgDeleteScopeOwnerRequest) returns (MsgDeleteScopeOwnerResponse); - - // WriteSession adds or updates a session context. - rpc WriteSession(MsgWriteSessionRequest) returns (MsgWriteSessionResponse); - - // WriteRecord adds or updates a record. - rpc WriteRecord(MsgWriteRecordRequest) returns (MsgWriteRecordResponse); - // DeleteRecord deletes a record. - rpc DeleteRecord(MsgDeleteRecordRequest) returns (MsgDeleteRecordResponse); - - // ---- Specification Management ----- - - // WriteScopeSpecification adds or updates a scope specification. - rpc WriteScopeSpecification(MsgWriteScopeSpecificationRequest) returns (MsgWriteScopeSpecificationResponse); - // DeleteScopeSpecification deletes a scope specification. - rpc DeleteScopeSpecification(MsgDeleteScopeSpecificationRequest) returns (MsgDeleteScopeSpecificationResponse); - - // WriteContractSpecification adds or updates a contract specification. - rpc WriteContractSpecification(MsgWriteContractSpecificationRequest) returns (MsgWriteContractSpecificationResponse); - // DeleteContractSpecification deletes a contract specification. - rpc DeleteContractSpecification(MsgDeleteContractSpecificationRequest) - returns (MsgDeleteContractSpecificationResponse); - - // AddContractSpecToScopeSpec adds contract specification to a scope specification. - rpc AddContractSpecToScopeSpec(MsgAddContractSpecToScopeSpecRequest) returns (MsgAddContractSpecToScopeSpecResponse); - // DeleteContractSpecFromScopeSpec deletes a contract specification from a scope specification. - rpc DeleteContractSpecFromScopeSpec(MsgDeleteContractSpecFromScopeSpecRequest) - returns (MsgDeleteContractSpecFromScopeSpecResponse); - - // WriteRecordSpecification adds or updates a record specification. - rpc WriteRecordSpecification(MsgWriteRecordSpecificationRequest) returns (MsgWriteRecordSpecificationResponse); - // DeleteRecordSpecification deletes a record specification. - rpc DeleteRecordSpecification(MsgDeleteRecordSpecificationRequest) returns (MsgDeleteRecordSpecificationResponse); - - // ---- Deprecated Transition Endpoints ----- - - // WriteP8eContractSpec adds a P8e v39 contract spec as a v40 ContractSpecification - // It only exists to help facilitate the transition. Users should transition to WriteContractSpecification. - rpc WriteP8eContractSpec(MsgWriteP8eContractSpecRequest) returns (MsgWriteP8eContractSpecResponse) { - option deprecated = true; - }; - // P8EMemorializeContract records the results of a P8e contract execution as a session and set of records in a scope - // It only exists to help facilitate the transition. Users should transition to calling the individual Write methods. - rpc P8eMemorializeContract(MsgP8eMemorializeContractRequest) returns (MsgP8eMemorializeContractResponse) { - option deprecated = true; - }; - - // ---- Object Store Locator Management ----- - - // BindOSLocator binds an owner address to a uri. - rpc BindOSLocator(MsgBindOSLocatorRequest) returns (MsgBindOSLocatorResponse); - // DeleteOSLocator deletes an existing ObjectStoreLocator record. - rpc DeleteOSLocator(MsgDeleteOSLocatorRequest) returns (MsgDeleteOSLocatorResponse); - // ModifyOSLocator updates an ObjectStoreLocator record by the current owner. - rpc ModifyOSLocator(MsgModifyOSLocatorRequest) returns (MsgModifyOSLocatorResponse); -} - -// MsgWriteScopeRequest is the request type for the Msg/WriteScope RPC method. -message MsgWriteScopeRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // scope is the Scope you want added or updated. - Scope scope = 1 [(gogoproto.nullable) = false]; - // signers is the list of address of those signing this request. - repeated string signers = 2; - - // scope_uuid is an optional uuid string, e.g. "91978ba2-5f35-459a-86a7-feca1b0512e0" - // If provided, it will be used to generate the MetadataAddress for the scope which will override the scope_id in the - // provided scope. If not provided (or it is an empty string), nothing special happens. - // If there is a value in scope.scope_id that is different from the one created from this uuid, an error is returned. - string scope_uuid = 3 [(gogoproto.moretags) = "yaml:\"scope_uuid\""]; - - // spec_uuid is an optional scope specification uuid string, e.g. "dc83ea70-eacd-40fe-9adf-1cf6148bf8a2" - // If provided, it will be used to generate the MetadataAddress for the scope specification which will override the - // specification_id in the provided scope. If not provided (or it is an empty string), nothing special happens. - // If there is a value in scope.specification_id that is different from the one created from this uuid, an error is - // returned. - string spec_uuid = 4 [(gogoproto.moretags) = "yaml:\"spec_uuid\""]; -} - -// MsgWriteScopeResponse is the response type for the Msg/WriteScope RPC method. -message MsgWriteScopeResponse { - // scope_id_info contains information about the id/address of the scope that was added or updated. - ScopeIdInfo scope_id_info = 1 [(gogoproto.moretags) = "yaml:\"scope_id_info\""]; -} - -// MsgDeleteScopeRequest is the request type for the Msg/DeleteScope RPC method. -message MsgDeleteScopeRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // Unique ID for the scope to delete - bytes scope_id = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"scope_id\"" - ]; - repeated string signers = 2; -} - -// MsgDeleteScopeResponse is the response type for the Msg/DeleteScope RPC method. -message MsgDeleteScopeResponse {} - -// MsgAddScopeDataAccessRequest is the request to add data access AccAddress to scope -message MsgAddScopeDataAccessRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // scope MetadataAddress for updating data access - bytes scope_id = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"scope_id\"" - ]; - - // AccAddress addresses to be added to scope - repeated string data_access = 2 [(gogoproto.moretags) = "yaml:\"data_access\""]; - // signers is the list of address of those signing this request. - repeated string signers = 3; -} - -// MsgAddScopeDataAccessResponse is the response for adding data access AccAddress to scope -message MsgAddScopeDataAccessResponse {} - -// MsgDeleteScopeDataAccessRequest is the request to remove data access AccAddress to scope -message MsgDeleteScopeDataAccessRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // scope MetadataAddress for removing data access - bytes scope_id = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"scope_id\"" - ]; - - // AccAddress address to be removed from scope - repeated string data_access = 2 [(gogoproto.moretags) = "yaml:\"data_access\""]; - // signers is the list of address of those signing this request. - repeated string signers = 3; -} - -// MsgDeleteScopeDataAccessResponse is the response from removing data access AccAddress to scope -message MsgDeleteScopeDataAccessResponse {} - -// MsgAddScopeOwnerRequest is the request to add owner AccAddress to scope -message MsgAddScopeOwnerRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // scope MetadataAddress for updating data access - bytes scope_id = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"scope_id\"" - ]; - - // AccAddress owner addresses to be added to scope - repeated Party owners = 2 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"owners\""]; - // signers is the list of address of those signing this request. - repeated string signers = 3; -} - -// MsgAddScopeOwnerResponse is the response for adding owner AccAddresses to scope -message MsgAddScopeOwnerResponse {} - -// MsgDeleteScopeOwnerRequest is the request to remove owner AccAddresses to scope -message MsgDeleteScopeOwnerRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // scope MetadataAddress for removing data access - bytes scope_id = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"scope_id\"" - ]; - - // AccAddress owner addresses to be removed from scope - repeated string owners = 2 [(gogoproto.moretags) = "yaml:\"owners\""]; - // signers is the list of address of those signing this request. - repeated string signers = 3; -} - -// MsgDeleteScopeOwnerResponse is the response from removing owner AccAddress to scope -message MsgDeleteScopeOwnerResponse {} - -// MsgWriteSessionRequest is the request type for the Msg/WriteSession RPC method. -message MsgWriteSessionRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // session is the Session you want added or updated. - Session session = 1 [(gogoproto.nullable) = false]; - // signers is the list of address of those signing this request. - repeated string signers = 2; - - // SessionIDComponents is an optional (alternate) way of defining what the session_id should be in the provided - // session. If provided, it must have both a scope and session_uuid. Those components will be used to create the - // MetadataAddress for the session which will override the session_id in the provided session. If not provided (or - // all empty), nothing special happens. - // If there is a value in session.session_id that is different from the one created from these components, an error is - // returned. - SessionIdComponents session_id_components = 3 [(gogoproto.moretags) = "yaml:\"session_id_components\""]; - - // spec_uuid is an optional contract specification uuid string, e.g. "def6bc0a-c9dd-4874-948f-5206e6060a84" - // If provided, it will be used to generate the MetadataAddress for the contract specification which will override the - // specification_id in the provided session. If not provided (or it is an empty string), nothing special happens. - // If there is a value in session.specification_id that is different from the one created from this uuid, an error is - // returned. - string spec_uuid = 4 [(gogoproto.moretags) = "yaml:\"spec_uuid\""]; -} - -// SessionIDComponents contains fields for the components that make up a session id. -message SessionIdComponents { - // scope is used to define the scope this session belongs to. - oneof scope_identifier { - // scope_uuid is the uuid string for the scope, e.g. "91978ba2-5f35-459a-86a7-feca1b0512e0" - string scope_uuid = 1 [(gogoproto.moretags) = "yaml:\"scope_uuid\""]; - // scope_addr is the bech32 address string for the scope, g.g. "scope1qzge0zaztu65tx5x5llv5xc9ztsqxlkwel" - string scope_addr = 2 [(gogoproto.moretags) = "yaml:\"scope_addr\""]; - } - // session_uuid is a uuid string for identifying this session, e.g. "5803f8bc-6067-4eb5-951f-2121671c2ec0" - string session_uuid = 3 [(gogoproto.moretags) = "yaml:\"session_uuid\""]; -} - -// MsgWriteSessionResponse is the response type for the Msg/WriteSession RPC method. -message MsgWriteSessionResponse { - // session_id_info contains information about the id/address of the session that was added or updated. - SessionIdInfo session_id_info = 1 [(gogoproto.moretags) = "yaml:\"session_id_info\""]; -} - -// MsgWriteRecordRequest is the request type for the Msg/WriteRecord RPC method. -message MsgWriteRecordRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // record is the Record you want added or updated. - Record record = 1 [(gogoproto.nullable) = false]; - // signers is the list of address of those signing this request. - repeated string signers = 2; - - // SessionIDComponents is an optional (alternate) way of defining what the session_id should be in the provided - // record. If provided, it must have both a scope and session_uuid. Those components will be used to create the - // MetadataAddress for the session which will override the session_id in the provided record. If not provided (or - // all empty), nothing special happens. - // If there is a value in record.session_id that is different from the one created from these components, an error is - // returned. - SessionIdComponents session_id_components = 3 [(gogoproto.moretags) = "yaml:\"session_id_components\""]; - - // contract_spec_uuid is an optional contract specification uuid string, e.g. "def6bc0a-c9dd-4874-948f-5206e6060a84" - // If provided, it will be combined with the record name to generate the MetadataAddress for the record specification - // which will override the specification_id in the provided record. If not provided (or it is an empty string), - // nothing special happens. - // If there is a value in record.specification_id that is different from the one created from this uuid and - // record.name, an error is returned. - string contract_spec_uuid = 4 [(gogoproto.moretags) = "yaml:\"contract_spec_uuid\""]; - - // parties is the list of parties involved with this record. - repeated Party parties = 5 [(gogoproto.nullable) = false]; -} - -// MsgWriteRecordResponse is the response type for the Msg/WriteRecord RPC method. -message MsgWriteRecordResponse { - // record_id_info contains information about the id/address of the record that was added or updated. - RecordIdInfo record_id_info = 1 [(gogoproto.moretags) = "yaml:\"record_id_info\""]; -} - -// MsgDeleteRecordRequest is the request type for the Msg/DeleteRecord RPC method. -message MsgDeleteRecordRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - bytes record_id = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"record_id\"" - ]; - - repeated string signers = 2; -} - -// MsgDeleteRecordResponse is the response type for the Msg/DeleteRecord RPC method. -message MsgDeleteRecordResponse {} - -// MsgWriteScopeSpecificationRequest is the request type for the Msg/WriteScopeSpecification RPC method. -message MsgWriteScopeSpecificationRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // specification is the ScopeSpecification you want added or updated. - ScopeSpecification specification = 1 [(gogoproto.nullable) = false]; - // signers is the list of address of those signing this request. - repeated string signers = 2; - - // spec_uuid is an optional scope specification uuid string, e.g. "dc83ea70-eacd-40fe-9adf-1cf6148bf8a2" - // If provided, it will be used to generate the MetadataAddress for the scope specification which will override the - // specification_id in the provided specification. If not provided (or it is an empty string), nothing special - // happens. - // If there is a value in specification.specification_id that is different from the one created from this uuid, an - // error is returned. - string spec_uuid = 3 [(gogoproto.moretags) = "yaml:\"spec_uuid\""]; -} - -// MsgWriteScopeSpecificationResponse is the response type for the Msg/WriteScopeSpecification RPC method. -message MsgWriteScopeSpecificationResponse { - // scope_spec_id_info contains information about the id/address of the scope specification that was added or updated. - ScopeSpecIdInfo scope_spec_id_info = 1 [(gogoproto.moretags) = "yaml:\"scope_spec_id_info\""]; -} - -// MsgDeleteScopeSpecificationRequest is the request type for the Msg/DeleteScopeSpecification RPC method. -message MsgDeleteScopeSpecificationRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // MetadataAddress for the scope specification to delete. - bytes specification_id = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"specification_id\"" - ]; - repeated string signers = 2; -} - -// MsgDeleteScopeSpecificationResponse is the response type for the Msg/DeleteScopeSpecification RPC method. -message MsgDeleteScopeSpecificationResponse {} - -// MsgWriteContractSpecificationRequest is the request type for the Msg/WriteContractSpecification RPC method. -message MsgWriteContractSpecificationRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // specification is the ContractSpecification you want added or updated. - ContractSpecification specification = 1 [(gogoproto.nullable) = false]; - // signers is the list of address of those signing this request. - repeated string signers = 2; - - // spec_uuid is an optional contract specification uuid string, e.g. "def6bc0a-c9dd-4874-948f-5206e6060a84" - // If provided, it will be used to generate the MetadataAddress for the contract specification which will override the - // specification_id in the provided specification. If not provided (or it is an empty string), nothing special - // happens. - // If there is a value in specification.specification_id that is different from the one created from this uuid, an - // error is returned. - string spec_uuid = 3 [(gogoproto.moretags) = "yaml:\"spec_uuid\""]; -} - -// MsgWriteContractSpecificationResponse is the response type for the Msg/WriteContractSpecification RPC method. -message MsgWriteContractSpecificationResponse { - // contract_spec_id_info contains information about the id/address of the contract specification that was added or - // updated. - ContractSpecIdInfo contract_spec_id_info = 1 [(gogoproto.moretags) = "yaml:\"contract_spec_id_info\""]; -} - -// MsgAddContractSpecToScopeSpecRequest is the request type for the Msg/AddContractSpecToScopeSpec RPC method. -message MsgAddContractSpecToScopeSpecRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // MetadataAddress for the contract specification to add. - bytes contract_specification_id = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"specification_id\"" - ]; - - // MetadataAddress for the scope specification to add contract specification to. - bytes scope_specification_id = 2 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"specification_id\"" - ]; - repeated string signers = 3; -} - -// MsgAddContractSpecToScopeSpecResponse is the response type for the Msg/AddContractSpecToScopeSpec RPC method. -message MsgAddContractSpecToScopeSpecResponse {} - -// MsgDeleteContractSpecFromScopeSpecRequest is the request type for the Msg/DeleteContractSpecFromScopeSpec RPC method. -message MsgDeleteContractSpecFromScopeSpecRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // MetadataAddress for the contract specification to add. - bytes contract_specification_id = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"specification_id\"" - ]; - - // MetadataAddress for the scope specification to add contract specification to. - bytes scope_specification_id = 2 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"specification_id\"" - ]; - repeated string signers = 3; -} - -// MsgDeleteContractSpecFromScopeSpecResponse is the response type for the Msg/DeleteContractSpecFromScopeSpec RPC -// method. -message MsgDeleteContractSpecFromScopeSpecResponse {} - -// MsgDeleteContractSpecificationRequest is the request type for the Msg/DeleteContractSpecification RPC method. -message MsgDeleteContractSpecificationRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // MetadataAddress for the contract specification to delete. - bytes specification_id = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"specification_id\"" - ]; - repeated string signers = 2; -} - -// MsgDeleteContractSpecificationResponse is the response type for the Msg/DeleteContractSpecification RPC method. -message MsgDeleteContractSpecificationResponse {} - -// MsgWriteRecordSpecificationRequest is the request type for the Msg/WriteRecordSpecification RPC method. -message MsgWriteRecordSpecificationRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // specification is the RecordSpecification you want added or updated. - RecordSpecification specification = 1 [(gogoproto.nullable) = false]; - // signers is the list of address of those signing this request. - repeated string signers = 2; - - // contract_spec_uuid is an optional contract specification uuid string, e.g. "def6bc0a-c9dd-4874-948f-5206e6060a84" - // If provided, it will be combined with the record specification name to generate the MetadataAddress for the record - // specification which will override the specification_id in the provided specification. If not provided (or it is an - // empty string), nothing special happens. - // If there is a value in specification.specification_id that is different from the one created from this uuid and - // specification.name, an error is returned. - string contract_spec_uuid = 3 [(gogoproto.moretags) = "yaml:\"contract_spec_uuid\""]; -} - -// MsgWriteRecordSpecificationResponse is the response type for the Msg/WriteRecordSpecification RPC method. -message MsgWriteRecordSpecificationResponse { - // record_spec_id_info contains information about the id/address of the record specification that was added or - // updated. - RecordSpecIdInfo record_spec_id_info = 1 [(gogoproto.moretags) = "yaml:\"record_spec_id_info\""]; -} - -// MsgDeleteRecordSpecificationRequest is the request type for the Msg/DeleteRecordSpecification RPC method. -message MsgDeleteRecordSpecificationRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // MetadataAddress for the record specification to delete. - bytes specification_id = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "MetadataAddress", - (gogoproto.moretags) = "yaml:\"specification_id\"" - ]; - repeated string signers = 2; -} - -// MsgDeleteRecordSpecificationResponse is the response type for the Msg/DeleteRecordSpecification RPC method. -message MsgDeleteRecordSpecificationResponse {} - -// MsgWriteP8eContractSpecRequest is the request type for the Msg/WriteP8eContractSpec RPC method. -message MsgWriteP8eContractSpecRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // ContractSpec v39 p8e ContractSpect to be converted into a v40 - p8e.ContractSpec contractspec = 1 [(gogoproto.nullable) = false]; - repeated string signers = 2; -} - -// MsgWriteP8eContractSpecResponse is the response type for the Msg/WriteP8eContractSpec RPC method. -message MsgWriteP8eContractSpecResponse { - // contract_spec_id_info contains information about the id/address of the contract specification that was added or - // updated. - ContractSpecIdInfo contract_spec_id_info = 1 [(gogoproto.moretags) = "yaml:\"contract_spec_id_info\""]; - // record_spec_id_infos contains information about the ids/addresses of the record specifications that were added or - // updated. - repeated RecordSpecIdInfo record_spec_id_infos = 2 [(gogoproto.moretags) = "yaml:\"record_spec_id_infos\""]; -} - -// MsgP8eMemorializeContractRequest is the request type for the Msg/P8eMemorializeContract RPC method. -message MsgP8eMemorializeContractRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_stringer) = false; - option (gogoproto.stringer) = false; - option (gogoproto.goproto_getters) = false; - - // The scope id of the object being add or modified on blockchain. - string scope_id = 1; - // The uuid of the contract execution. - string group_id = 2; - // The scope specification id. - string scope_specification_id = 3; - // The new recitals for the scope. Used in leu of Contract for direct ownership changes. - provenance.metadata.v1.p8e.Recitals recitals = 4; - // The executed contract. - provenance.metadata.v1.p8e.Contract contract = 5; - // The contract signatures - provenance.metadata.v1.p8e.SignatureSet signatures = 6; - // The bech32 address of the notary (ie the broadcaster of this message). - string invoker = 7; -} - -// MsgP8eMemorializeContractResponse is the response type for the Msg/P8eMemorializeContract RPC method. -message MsgP8eMemorializeContractResponse { - // scope_id_info contains information about the id/address of the scope that was added or updated. - ScopeIdInfo scope_id_info = 1 [(gogoproto.moretags) = "yaml:\"scope_id_info\""]; - // session_id_info contains information about the id/address of the session that was added or updated. - SessionIdInfo session_id_info = 2 [(gogoproto.moretags) = "yaml:\"session_id_info\""]; - // record_id_infos contains information about the ids/addresses of the records that were added or updated. - repeated RecordIdInfo record_id_infos = 3 [(gogoproto.moretags) = "yaml:\"record_id_infos\""]; -} - -// MsgBindOSLocatorRequest is the request type for the Msg/BindOSLocator RPC method. -message MsgBindOSLocatorRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - // The object locator to bind the address to bind to the URI. - ObjectStoreLocator locator = 1 [(gogoproto.nullable) = false]; -} - -// MsgBindOSLocatorResponse is the response type for the Msg/BindOSLocator RPC method. -message MsgBindOSLocatorResponse { - ObjectStoreLocator locator = 1 [(gogoproto.nullable) = false]; -} - -// MsgDeleteOSLocatorRequest is the request type for the Msg/DeleteOSLocator RPC method. -message MsgDeleteOSLocatorRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // The record being removed - ObjectStoreLocator locator = 1 [(gogoproto.nullable) = false]; -} - -// MsgDeleteOSLocatorResponse is the response type for the Msg/DeleteOSLocator RPC method. -message MsgDeleteOSLocatorResponse { - ObjectStoreLocator locator = 1 [(gogoproto.nullable) = false]; -} - -// MsgModifyOSLocatorRequest is the request type for the Msg/ModifyOSLocator RPC method. -message MsgModifyOSLocatorRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - // The object locator to bind the address to bind to the URI. - ObjectStoreLocator locator = 1 [(gogoproto.nullable) = false]; -} - -// MsgModifyOSLocatorResponse is the response type for the Msg/ModifyOSLocator RPC method. -message MsgModifyOSLocatorResponse { - ObjectStoreLocator locator = 1 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/provenance/name/v1/genesis.proto b/third_party/proto/provenance/name/v1/genesis.proto deleted file mode 100644 index ce23e57f..00000000 --- a/third_party/proto/provenance/name/v1/genesis.proto +++ /dev/null @@ -1,21 +0,0 @@ -syntax = "proto3"; -package provenance.name.v1; - -import "gogoproto/gogo.proto"; -import "provenance/name/v1/name.proto"; - -option go_package = "github.com/provenance-io/provenance/x/name/types"; -option java_package = "io.provenance.name.v1"; -option java_multiple_files = true; - -// GenesisState defines the name module's genesis state. -message GenesisState { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // params defines all the parameters of the module. - Params params = 1 [(gogoproto.nullable) = false]; - - // bindings defines all the name records present at genesis - repeated NameRecord bindings = 2 [(gogoproto.nullable) = false]; -} diff --git a/third_party/proto/provenance/name/v1/name.proto b/third_party/proto/provenance/name/v1/name.proto deleted file mode 100644 index 7f2e0f67..00000000 --- a/third_party/proto/provenance/name/v1/name.proto +++ /dev/null @@ -1,60 +0,0 @@ -syntax = "proto3"; -package provenance.name.v1; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/provenance-io/provenance/x/name/types"; - -option java_package = "io.provenance.name.v1"; -option java_multiple_files = true; - -// Params defines the set of params for the name module. -message Params { - // maximum length of name segment to allow - uint32 max_segment_length = 1; - // minimum length of name segment to allow - uint32 min_segment_length = 2; - // maximum number of name segments to allow. Example: `foo.bar.baz` would be 3 - uint32 max_name_levels = 3; - // determines if unrestricted name keys are allowed or not - bool allow_unrestricted_names = 4; -} - -// NameRecord is a structure used to bind ownership of a name hierarchy to a collection of addresses -message NameRecord { - option (gogoproto.goproto_stringer) = false; - - // The bound name - string name = 1; - // The address the name resolved to. - string address = 2; - // Whether owner signature is required to add sub-names. - bool restricted = 3; -} - -// CreateRootNameProposal details a proposal to create a new root name -// that is controlled by a given owner and optionally restricted to the owner -// for the sole creation of sub names. -message CreateRootNameProposal { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - option (gogoproto.goproto_stringer) = false; - - string title = 1; - string description = 2; - string name = 3; - string owner = 4; - bool restricted = 5; -} - -// Event emitted when name is bound. -message EventNameBound { - string address = 1; - string name = 2; -} - -// Event emitted when name is unbound. -message EventNameUnbound { - string address = 1; - string name = 2; -} diff --git a/third_party/proto/provenance/name/v1/query.proto b/third_party/proto/provenance/name/v1/query.proto deleted file mode 100644 index f27d411f..00000000 --- a/third_party/proto/provenance/name/v1/query.proto +++ /dev/null @@ -1,77 +0,0 @@ -syntax = "proto3"; -package provenance.name.v1; - -option go_package = "github.com/provenance-io/provenance/x/name/types"; - -option java_package = "io.provenance.name.v1"; -option java_multiple_files = true; - -import "cosmos/base/query/v1beta1/pagination.proto"; -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "provenance/name/v1/name.proto"; - -// Query defines the gRPC querier service for distribution module. -service Query { - // Params queries params of the name module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/provenance/name/v1/params"; - } - - // Resolve queries for the address associated with a given name - rpc Resolve(QueryResolveRequest) returns (QueryResolveResponse) { - option (google.api.http).get = "/provenance/name/v1/resolve/{name}"; - } - - // ReverseLookup queries for all names bound against a given address - rpc ReverseLookup(QueryReverseLookupRequest) returns (QueryReverseLookupResponse) { - option (google.api.http).get = "/provenance/name/v1/lookup/{address}"; - } -} - -// 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]; -} - -// QueryResolveRequest is the request type for the Query/Resolve method. -message QueryResolveRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // name to resolve the address for - string name = 1; -} - -// QueryResolveResponse is the response type for the Query/Resolve method. -message QueryResolveResponse { - // a string containing the address the name resolves to - string address = 1; -} - -// QueryReverseLookupRequest is the request type for the Query/ReverseLookup method. -message QueryReverseLookupRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // address to find name records for - string address = 1; - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 2; -} - -// QueryReverseLookupResponse is the response type for the Query/Resolve method. -message QueryReverseLookupResponse { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // an array of names bound against a given address - repeated string name = 1; - - // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageResponse pagination = 2; -} \ No newline at end of file diff --git a/third_party/proto/provenance/name/v1/tx.proto b/third_party/proto/provenance/name/v1/tx.proto deleted file mode 100644 index bdd1eeb5..00000000 --- a/third_party/proto/provenance/name/v1/tx.proto +++ /dev/null @@ -1,48 +0,0 @@ -syntax = "proto3"; -package provenance.name.v1; - -import "gogoproto/gogo.proto"; -import "provenance/name/v1/name.proto"; - -option go_package = "github.com/provenance-io/provenance/x/name/types"; - -option java_package = "io.provenance.name.v1"; -option java_multiple_files = true; - -// Msg defines the bank Msg service. -service Msg { - // BindName binds a name to an address under a root name. - rpc BindName(MsgBindNameRequest) returns (MsgBindNameResponse); - - // DeleteName defines a method to verify a particular invariance. - rpc DeleteName(MsgDeleteNameRequest) returns (MsgDeleteNameResponse); -} - -// MsgBindNameRequest defines an sdk.Msg type that is used to add an address/name binding under an optional parent name. -// The record may optionally be restricted to prevent additional names from being added under this one without the -// owner signing the request. -message MsgBindNameRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // The parent record to bind this name under. - NameRecord parent = 1 [(gogoproto.nullable) = false]; - // The name record to bind under the parent - NameRecord record = 2 [(gogoproto.nullable) = false]; -} - -// MsgBindNameResponse defines the Msg/BindName response type. -message MsgBindNameResponse {} - -// MsgDeleteNameRequest defines an sdk.Msg type that is used to remove an existing address/name binding. The binding -// may not have any child names currently bound for this request to be successful. -message MsgDeleteNameRequest { - option (gogoproto.equal) = false; - option (gogoproto.goproto_getters) = false; - - // The record being removed - NameRecord record = 1 [(gogoproto.nullable) = false]; -} - -// MsgDeleteNameResponse defines the Msg/DeleteName response type. -message MsgDeleteNameResponse {} diff --git a/third_party/proto/tendermint/abci/types.proto b/third_party/proto/tendermint/abci/types.proto deleted file mode 100644 index 2cbcabb2..00000000 --- a/third_party/proto/tendermint/abci/types.proto +++ /dev/null @@ -1,407 +0,0 @@ -syntax = "proto3"; -package tendermint.abci; - -option go_package = "github.com/tendermint/tendermint/abci/types"; - -// For more information on gogo.proto, see: -// https://github.com/gogo/protobuf/blob/master/extensions.md -import "tendermint/crypto/proof.proto"; -import "tendermint/types/types.proto"; -import "tendermint/crypto/keys.proto"; -import "tendermint/types/params.proto"; -import "google/protobuf/timestamp.proto"; -import "gogoproto/gogo.proto"; - -// 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 - -//---------------------------------------- -// Request types - -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; - } -} - -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; - tendermint.types.Header header = 2 [(gogoproto.nullable) = false]; - LastCommitInfo last_commit_info = 3 [(gogoproto.nullable) = false]; - repeated 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; -} - -message RequestDeliverTx { - bytes tx = 1; -} - -message RequestEndBlock { - 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; - } -} - -// 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; - tendermint.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 - [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; - string codespace = 8; -} - -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; -} - -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; - tendermint.types.EvidenceParams evidence = 2; - tendermint.types.ValidatorParams validator = 3; - tendermint.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 -} - -// ValidatorUpdate -message ValidatorUpdate { - tendermint.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; -} - -//---------------------------------------- -// 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 -} - -//---------------------------------------- -// 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); -} diff --git a/third_party/proto/tendermint/crypto/keys.proto b/third_party/proto/tendermint/crypto/keys.proto deleted file mode 100644 index 16fd7adf..00000000 --- a/third_party/proto/tendermint/crypto/keys.proto +++ /dev/null @@ -1,17 +0,0 @@ -syntax = "proto3"; -package tendermint.crypto; - -option go_package = "github.com/tendermint/tendermint/proto/tendermint/crypto"; - -import "gogoproto/gogo.proto"; - -// PublicKey defines the keys available for use with Tendermint 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/tendermint/crypto/proof.proto b/third_party/proto/tendermint/crypto/proof.proto deleted file mode 100644 index 975df768..00000000 --- a/third_party/proto/tendermint/crypto/proof.proto +++ /dev/null @@ -1,41 +0,0 @@ -syntax = "proto3"; -package tendermint.crypto; - -option go_package = "github.com/tendermint/tendermint/proto/tendermint/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/tendermint/libs/bits/types.proto b/third_party/proto/tendermint/libs/bits/types.proto deleted file mode 100644 index 3111d113..00000000 --- a/third_party/proto/tendermint/libs/bits/types.proto +++ /dev/null @@ -1,9 +0,0 @@ -syntax = "proto3"; -package tendermint.libs.bits; - -option go_package = "github.com/tendermint/tendermint/proto/tendermint/libs/bits"; - -message BitArray { - int64 bits = 1; - repeated uint64 elems = 2; -} diff --git a/third_party/proto/tendermint/p2p/types.proto b/third_party/proto/tendermint/p2p/types.proto deleted file mode 100644 index 0d42ea40..00000000 --- a/third_party/proto/tendermint/p2p/types.proto +++ /dev/null @@ -1,34 +0,0 @@ -syntax = "proto3"; -package tendermint.p2p; - -option go_package = "github.com/tendermint/tendermint/proto/tendermint/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/tendermint/types/block.proto b/third_party/proto/tendermint/types/block.proto deleted file mode 100644 index 84e9bb15..00000000 --- a/third_party/proto/tendermint/types/block.proto +++ /dev/null @@ -1,15 +0,0 @@ -syntax = "proto3"; -package tendermint.types; - -option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; - -import "gogoproto/gogo.proto"; -import "tendermint/types/types.proto"; -import "tendermint/types/evidence.proto"; - -message Block { - Header header = 1 [(gogoproto.nullable) = false]; - Data data = 2 [(gogoproto.nullable) = false]; - tendermint.types.EvidenceList evidence = 3 [(gogoproto.nullable) = false]; - Commit last_commit = 4; -} diff --git a/third_party/proto/tendermint/types/evidence.proto b/third_party/proto/tendermint/types/evidence.proto deleted file mode 100644 index 3b234571..00000000 --- a/third_party/proto/tendermint/types/evidence.proto +++ /dev/null @@ -1,38 +0,0 @@ -syntax = "proto3"; -package tendermint.types; - -option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; - -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; -import "tendermint/types/types.proto"; -import "tendermint/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 { - tendermint.types.Vote vote_a = 1; - tendermint.types.Vote vote_b = 2; - int64 total_voting_power = 3; - int64 validator_power = 4; - google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; -} - -// LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client. -message LightClientAttackEvidence { - tendermint.types.LightBlock conflicting_block = 1; - int64 common_height = 2; - repeated tendermint.types.Validator byzantine_validators = 3; - int64 total_voting_power = 4; - 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/tendermint/types/params.proto b/third_party/proto/tendermint/types/params.proto deleted file mode 100644 index 0de7d846..00000000 --- a/third_party/proto/tendermint/types/params.proto +++ /dev/null @@ -1,80 +0,0 @@ -syntax = "proto3"; -package tendermint.types; - -option go_package = "github.com/tendermint/tendermint/proto/tendermint/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/tendermint/types/types.proto b/third_party/proto/tendermint/types/types.proto deleted file mode 100644 index 7f7ea74c..00000000 --- a/third_party/proto/tendermint/types/types.proto +++ /dev/null @@ -1,157 +0,0 @@ -syntax = "proto3"; -package tendermint.types; - -option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; - -import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; -import "tendermint/crypto/proof.proto"; -import "tendermint/version/types.proto"; -import "tendermint/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; - tendermint.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 - tendermint.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; - tendermint.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; - tendermint.crypto.Proof proof = 3; -} diff --git a/third_party/proto/tendermint/types/validator.proto b/third_party/proto/tendermint/types/validator.proto deleted file mode 100644 index 49860b96..00000000 --- a/third_party/proto/tendermint/types/validator.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; -package tendermint.types; - -option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; - -import "gogoproto/gogo.proto"; -import "tendermint/crypto/keys.proto"; - -message ValidatorSet { - repeated Validator validators = 1; - Validator proposer = 2; - int64 total_voting_power = 3; -} - -message Validator { - bytes address = 1; - tendermint.crypto.PublicKey pub_key = 2 [(gogoproto.nullable) = false]; - int64 voting_power = 3; - int64 proposer_priority = 4; -} - -message SimpleValidator { - tendermint.crypto.PublicKey pub_key = 1; - int64 voting_power = 2; -} diff --git a/third_party/proto/tendermint/version/types.proto b/third_party/proto/tendermint/version/types.proto deleted file mode 100644 index 6061868b..00000000 --- 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; -}