From ce11c9043e9b483fcdb520ee31e3f3b5a68fbe17 Mon Sep 17 00:00:00 2001 From: Marko Date: Wed, 27 Jan 2021 10:08:18 +0000 Subject: [PATCH 01/19] avoid login when in PR (#8449) --- .github/workflows/docker.yml | 1 + .github/workflows/proto-docker.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 9456ebf30..6116e6d92 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -42,6 +42,7 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Login to DockerHub + if: ${{ github.event_name != 'pull_request' }} uses: docker/login-action@v1 with: username: ${{ secrets.DOCKER_USERNAME }} diff --git a/.github/workflows/proto-docker.yml b/.github/workflows/proto-docker.yml index b127de0a5..7a9aecfb2 100644 --- a/.github/workflows/proto-docker.yml +++ b/.github/workflows/proto-docker.yml @@ -31,6 +31,7 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Login to DockerHub + if: ${{ github.event_name != 'pull_request' }} uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUBTM_USERNAME }} From fd04f41e234c9bbcef4f4fb4b7204c032d4eaddf Mon Sep 17 00:00:00 2001 From: Jun Kimura Date: Wed, 27 Jan 2021 19:19:04 +0900 Subject: [PATCH 02/19] ibc-transfer: fix non-deterministic attribute value (#8442) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- x/ibc/applications/transfer/module.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/ibc/applications/transfer/module.go b/x/ibc/applications/transfer/module.go index 039597afe..900526f58 100644 --- a/x/ibc/applications/transfer/module.go +++ b/x/ibc/applications/transfer/module.go @@ -379,7 +379,7 @@ func (am AppModule) OnAcknowledgementPacket( sdk.NewAttribute(types.AttributeKeyReceiver, data.Receiver), sdk.NewAttribute(types.AttributeKeyDenom, data.Denom), sdk.NewAttribute(types.AttributeKeyAmount, fmt.Sprintf("%d", data.Amount)), - sdk.NewAttribute(types.AttributeKeyAck, fmt.Sprintf("%v", ack)), + sdk.NewAttribute(types.AttributeKeyAck, ack.String()), ), ) From e2f510afcc3478edab4a7d8d786dccbec333dddd Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Wed, 27 Jan 2021 12:07:45 +0100 Subject: [PATCH 03/19] Compatibility with the ARM architecture (#8396) Co-authored-by: Alessio Treglia Co-authored-by: Jonathan Gimeno --- .github/workflows/test.yml | 20 ++++++++++++++++++++ CHANGELOG.md | 1 + Makefile | 2 +- snapshots/store.go | 6 +++--- store/rootmulti/store.go | 4 ++-- x/ibc/applications/transfer/module.go | 4 ++-- x/ibc/core/02-client/types/client.go | 2 +- 7 files changed, 30 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d8f051e60..dd0904186 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,6 +31,26 @@ jobs: path: ~/go/bin key: ${{ runner.os }}-go-tparse-binary + build: + runs-on: ubuntu-latest + strategy: + matrix: + go-arch: ["amd64", "arm", "arm64"] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2.1.3 + with: + go-version: 1.15 + - uses: technote-space/get-diff-action@v4 + id: git_diff + with: + PATTERNS: | + **/**.go + go.mod + go.sum + - name: Build + run: GOARCH=${{ matrix.go-arch }} LEDGER_ENABLED=false make build + test-cosmovisor: runs-on: ubuntu-latest steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index 75f7adb0b..0ea84cb34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements * (x/ibc) [\#8404](https://github.com/cosmos/cosmos-sdk/pull/8404) Reorder IBC `ChanOpenAck` and `ChanOpenConfirm` handler execution to perform core handler first, followed by application callbacks. +* [\#8396](https://github.com/cosmos/cosmos-sdk/pull/8396) Add support for ARM platform ### Bug Fixes diff --git a/Makefile b/Makefile index 0f4cf9e80..f49f95e73 100644 --- a/Makefile +++ b/Makefile @@ -479,4 +479,4 @@ rosetta-data: docker run --name data_dir_build -t rosetta-ci:latest sh /rosetta/data.sh docker cp data_dir_build:/tmp/data.tar.gz "$(CURDIR)/contrib/rosetta/node/data.tar.gz" docker container rm data_dir_build -.PHONY: rosetta-data \ No newline at end of file +.PHONY: rosetta-data diff --git a/snapshots/store.go b/snapshots/store.go index e0bcbe6bd..77ff58e22 100644 --- a/snapshots/store.go +++ b/snapshots/store.go @@ -91,7 +91,7 @@ func (s *Store) Get(height uint64, format uint32) (*types.Snapshot, error) { // Get fetches the latest snapshot from the database, if any. func (s *Store) GetLatest() (*types.Snapshot, error) { - iter, err := s.db.ReverseIterator(encodeKey(0, 0), encodeKey(math.MaxUint64, math.MaxUint32)) + iter, err := s.db.ReverseIterator(encodeKey(0, 0), encodeKey(uint64(math.MaxUint64), math.MaxUint32)) if err != nil { return nil, sdkerrors.Wrap(err, "failed to find latest snapshot") } @@ -111,7 +111,7 @@ func (s *Store) GetLatest() (*types.Snapshot, error) { // List lists snapshots, in reverse order (newest first). func (s *Store) List() ([]*types.Snapshot, error) { - iter, err := s.db.ReverseIterator(encodeKey(0, 0), encodeKey(math.MaxUint64, math.MaxUint32)) + iter, err := s.db.ReverseIterator(encodeKey(0, 0), encodeKey(uint64(math.MaxUint64), math.MaxUint32)) if err != nil { return nil, sdkerrors.Wrap(err, "failed to list snapshots") } @@ -181,7 +181,7 @@ func (s *Store) loadChunkFile(height uint64, format uint32, chunk uint32) (io.Re // Prune removes old snapshots. The given number of most recent heights (regardless of format) are retained. func (s *Store) Prune(retain uint32) (uint64, error) { - iter, err := s.db.ReverseIterator(encodeKey(0, 0), encodeKey(math.MaxUint64, math.MaxUint32)) + iter, err := s.db.ReverseIterator(encodeKey(0, 0), encodeKey(uint64(math.MaxUint64), math.MaxUint32)) if err != nil { return 0, sdkerrors.Wrap(err, "failed to prune snapshots") } diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 03fa1b561..0e8cba44e 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -711,9 +711,9 @@ func (rs *Store) Restore( if height == 0 { return sdkerrors.Wrap(sdkerrors.ErrLogic, "cannot restore snapshot at height 0") } - if height > math.MaxInt64 { + if height > uint64(math.MaxUint64) { return sdkerrors.Wrapf(snapshottypes.ErrInvalidMetadata, - "snapshot height %v cannot exceed %v", height, math.MaxInt64) + "snapshot height %v cannot exceed %v", height, int64(math.MaxInt64)) } // Signal readiness. Must be done before the readers below are set up, since the zlib diff --git a/x/ibc/applications/transfer/module.go b/x/ibc/applications/transfer/module.go index 900526f58..67c736555 100644 --- a/x/ibc/applications/transfer/module.go +++ b/x/ibc/applications/transfer/module.go @@ -202,8 +202,8 @@ func ValidateTransferChannelParams( if err != nil { return err } - if channelSequence > math.MaxUint32 { - return sdkerrors.Wrapf(types.ErrMaxTransferChannels, "channel sequence %d is greater than max allowed transfer channels %d", channelSequence, math.MaxUint32) + if channelSequence > uint64(math.MaxUint32) { + return sdkerrors.Wrapf(types.ErrMaxTransferChannels, "channel sequence %d is greater than max allowed transfer channels %d", channelSequence, uint64(math.MaxUint32)) } if order != channeltypes.UNORDERED { return sdkerrors.Wrapf(channeltypes.ErrInvalidChannelOrdering, "expected %s channel, got %s ", channeltypes.UNORDERED, order) diff --git a/x/ibc/core/02-client/types/client.go b/x/ibc/core/02-client/types/client.go index 1c44d6e2b..6d51828af 100644 --- a/x/ibc/core/02-client/types/client.go +++ b/x/ibc/core/02-client/types/client.go @@ -93,7 +93,7 @@ func ValidateClientType(clientType string) error { } smallestPossibleClientID := FormatClientIdentifier(clientType, 0) - largestPossibleClientID := FormatClientIdentifier(clientType, math.MaxUint64) + largestPossibleClientID := FormatClientIdentifier(clientType, uint64(math.MaxUint64)) // IsValidClientID will check client type format and if the sequence is a uint64 if !IsValidClientID(smallestPossibleClientID) { From 580e9681a5eb41773cad73ea03647e7253704fed Mon Sep 17 00:00:00 2001 From: Emmanuel T Odeke Date: Wed, 27 Jan 2021 22:40:56 -0800 Subject: [PATCH 04/19] types: use proper lowercase syntax for coins in benchmarks (#8435) Instead of COINZ_%d use coinZ%d which is the syntax accepted by types.ParseCoin, to generate coins to use in benchmarking. Fixes #8433 --- types/coin_benchmark_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/coin_benchmark_test.go b/types/coin_benchmark_test.go index fc73afe87..bfc2bfe99 100644 --- a/types/coin_benchmark_test.go +++ b/types/coin_benchmark_test.go @@ -6,7 +6,7 @@ import ( ) func coinName(suffix int) string { - return fmt.Sprintf("COINZ_%d", suffix) + return fmt.Sprintf("coinz%d", suffix) } func BenchmarkCoinsAdditionIntersect(b *testing.B) { From 784a9a69a160d805fffd7fa945c281f8cdcf19d3 Mon Sep 17 00:00:00 2001 From: Emmanuel T Odeke Date: Wed, 27 Jan 2021 23:52:08 -0800 Subject: [PATCH 05/19] all: ensure b.ReportAllocs() in all the benchmarks (#8460) With this change, we'll get details on the number of allocations performed by code. Later on when we have continuous benchmarking infrastructure, this change will prove useful to flag regressions. Fixes #8459 Co-authored-by: Alessio Treglia --- crypto/armor_test.go | 2 ++ crypto/keys/internal/benchmarking/bench.go | 1 + crypto/keys/secp256k1/bench_test.go | 3 +++ simapp/sim_bench_test.go | 2 ++ store/cache/benchmark_test.go | 1 + store/cachekv/store_bench_test.go | 1 + store/cachekv/store_test.go | 2 ++ store/iavl/store_test.go | 1 + store/rootmulti/store_test.go | 2 ++ types/address_bench_test.go | 2 ++ types/coin_benchmark_test.go | 2 ++ types/decimal_test.go | 1 + x/auth/keeper/keeper_bench_test.go | 1 + x/bank/bench_test.go | 1 + x/mint/types/minter_test.go | 3 +++ 15 files changed, 25 insertions(+) diff --git a/crypto/armor_test.go b/crypto/armor_test.go index abbc7870a..70854f6dc 100644 --- a/crypto/armor_test.go +++ b/crypto/armor_test.go @@ -158,6 +158,8 @@ func TestUnarmorInfoBytesErrors(t *testing.T) { } func BenchmarkBcryptGenerateFromPassword(b *testing.B) { + b.ReportAllocs() + passphrase := []byte("passphrase") for securityParam := 9; securityParam < 16; securityParam++ { param := securityParam diff --git a/crypto/keys/internal/benchmarking/bench.go b/crypto/keys/internal/benchmarking/bench.go index a789da91f..a55936d5c 100644 --- a/crypto/keys/internal/benchmarking/bench.go +++ b/crypto/keys/internal/benchmarking/bench.go @@ -25,6 +25,7 @@ func (zeroReader) Read(buf []byte) (int, error) { // BenchmarkKeyGeneration benchmarks the given key generation algorithm using // a dummy reader. func BenchmarkKeyGeneration(b *testing.B, generateKey func(reader io.Reader) types.PrivKey) { + b.ReportAllocs() var zero zeroReader for i := 0; i < b.N; i++ { generateKey(zero) diff --git a/crypto/keys/secp256k1/bench_test.go b/crypto/keys/secp256k1/bench_test.go index 423f7a5a5..a9f694de7 100644 --- a/crypto/keys/secp256k1/bench_test.go +++ b/crypto/keys/secp256k1/bench_test.go @@ -9,6 +9,7 @@ import ( ) func BenchmarkKeyGeneration(b *testing.B) { + b.ReportAllocs() benchmarkKeygenWrapper := func(reader io.Reader) types.PrivKey { priv := genPrivKey(reader) return &PrivKey{Key: priv} @@ -17,11 +18,13 @@ func BenchmarkKeyGeneration(b *testing.B) { } func BenchmarkSigning(b *testing.B) { + b.ReportAllocs() priv := GenPrivKey() benchmarking.BenchmarkSigning(b, priv) } func BenchmarkVerification(b *testing.B) { + b.ReportAllocs() priv := GenPrivKey() benchmarking.BenchmarkVerification(b, priv) } diff --git a/simapp/sim_bench_test.go b/simapp/sim_bench_test.go index 7c22dcfe8..ba5c71c6f 100644 --- a/simapp/sim_bench_test.go +++ b/simapp/sim_bench_test.go @@ -14,6 +14,7 @@ import ( // Profile with: // /usr/local/go/bin/go test -benchmem -run=^$ github.com/cosmos/cosmos-sdk/simapp -bench ^BenchmarkFullAppSimulation$ -Commit=true -cpuprofile cpu.out func BenchmarkFullAppSimulation(b *testing.B) { + b.ReportAllocs() config, db, dir, logger, _, err := SetupSimulation("goleveldb-app-sim", "Simulation") if err != nil { b.Fatalf("simulation setup failed: %s", err.Error()) @@ -57,6 +58,7 @@ func BenchmarkFullAppSimulation(b *testing.B) { } func BenchmarkInvariants(b *testing.B) { + b.ReportAllocs() config, db, dir, logger, _, err := SetupSimulation("leveldb-app-invariant-bench", "Simulation") if err != nil { b.Fatalf("simulation setup failed: %s", err.Error()) diff --git a/store/cache/benchmark_test.go b/store/cache/benchmark_test.go index cf8206272..10b5da2bf 100644 --- a/store/cache/benchmark_test.go +++ b/store/cache/benchmark_test.go @@ -22,6 +22,7 @@ func populate(mgr *CommitKVStoreCacheManager) { } func BenchmarkReset(b *testing.B) { + b.ReportAllocs() mgr := freshMgr() b.ResetTimer() diff --git a/store/cachekv/store_bench_test.go b/store/cachekv/store_bench_test.go index 490281983..2957fe6a6 100644 --- a/store/cachekv/store_bench_test.go +++ b/store/cachekv/store_bench_test.go @@ -12,6 +12,7 @@ import ( ) func benchmarkCacheKVStoreIterator(numKVs int, b *testing.B) { + b.ReportAllocs() mem := dbadapter.Store{DB: dbm.NewMemDB()} cstore := cachekv.NewStore(mem) keys := make([]string, numKVs) diff --git a/store/cachekv/store_test.go b/store/cachekv/store_test.go index e3b33341b..0404f33f2 100644 --- a/store/cachekv/store_test.go +++ b/store/cachekv/store_test.go @@ -516,6 +516,7 @@ func (krc *keyRangeCounter) key() int { func bz(s string) []byte { return []byte(s) } func BenchmarkCacheKVStoreGetNoKeyFound(b *testing.B) { + b.ReportAllocs() st := newCacheKVStore() b.ResetTimer() // assumes b.N < 2**24 @@ -525,6 +526,7 @@ func BenchmarkCacheKVStoreGetNoKeyFound(b *testing.B) { } func BenchmarkCacheKVStoreGetKeyFound(b *testing.B) { + b.ReportAllocs() st := newCacheKVStore() for i := 0; i < b.N; i++ { arr := []byte{byte((i & 0xFF0000) >> 16), byte((i & 0xFF00) >> 8), byte(i & 0xFF)} diff --git a/store/iavl/store_test.go b/store/iavl/store_test.go index 790830038..cfda5efac 100644 --- a/store/iavl/store_test.go +++ b/store/iavl/store_test.go @@ -556,6 +556,7 @@ func TestIAVLStoreQuery(t *testing.T) { } func BenchmarkIAVLIteratorNext(b *testing.B) { + b.ReportAllocs() db := dbm.NewMemDB() treeSize := 1000 tree, err := iavl.NewMutableTree(db, cacheSize) diff --git a/store/rootmulti/store_test.go b/store/rootmulti/store_test.go index e4654f410..eafc0d6bb 100644 --- a/store/rootmulti/store_test.go +++ b/store/rootmulti/store_test.go @@ -689,6 +689,7 @@ func BenchmarkMultistoreSnapshotRestore1M(b *testing.B) { } func benchmarkMultistoreSnapshot(b *testing.B, stores uint8, storeKeys uint64) { + b.ReportAllocs() b.StopTimer() source := newMultiStoreWithGeneratedData(dbm.NewMemDB(), stores, storeKeys) version := source.LastCommitID().Version @@ -716,6 +717,7 @@ func benchmarkMultistoreSnapshot(b *testing.B, stores uint8, storeKeys uint64) { } func benchmarkMultistoreSnapshotRestore(b *testing.B, stores uint8, storeKeys uint64) { + b.ReportAllocs() b.StopTimer() source := newMultiStoreWithGeneratedData(dbm.NewMemDB(), stores, storeKeys) version := uint64(source.LastCommitID().Version) diff --git a/types/address_bench_test.go b/types/address_bench_test.go index 59222dacf..88a7e537a 100644 --- a/types/address_bench_test.go +++ b/types/address_bench_test.go @@ -12,6 +12,7 @@ import ( ) func BenchmarkBech32ifyPubKey(b *testing.B) { + b.ReportAllocs() pkBz := make([]byte, ed25519.PubKeySize) pk := &ed25519.PubKey{Key: pkBz} rng := rand.New(rand.NewSource(time.Now().Unix())) @@ -29,6 +30,7 @@ func BenchmarkBech32ifyPubKey(b *testing.B) { } func BenchmarkGetPubKeyFromBech32(b *testing.B) { + b.ReportAllocs() pkBz := make([]byte, ed25519.PubKeySize) pk := &ed25519.PubKey{Key: pkBz} rng := rand.New(rand.NewSource(time.Now().Unix())) diff --git a/types/coin_benchmark_test.go b/types/coin_benchmark_test.go index bfc2bfe99..c6e040112 100644 --- a/types/coin_benchmark_test.go +++ b/types/coin_benchmark_test.go @@ -10,6 +10,7 @@ func coinName(suffix int) string { } func BenchmarkCoinsAdditionIntersect(b *testing.B) { + b.ReportAllocs() benchmarkingFunc := func(numCoinsA int, numCoinsB int) func(b *testing.B) { return func(b *testing.B) { coinsA := Coins(make([]Coin, numCoinsA)) @@ -39,6 +40,7 @@ func BenchmarkCoinsAdditionIntersect(b *testing.B) { } func BenchmarkCoinsAdditionNoIntersect(b *testing.B) { + b.ReportAllocs() benchmarkingFunc := func(numCoinsA int, numCoinsB int) func(b *testing.B) { return func(b *testing.B) { coinsA := Coins(make([]Coin, numCoinsA)) diff --git a/types/decimal_test.go b/types/decimal_test.go index ffd09afc2..8e62275a0 100644 --- a/types/decimal_test.go +++ b/types/decimal_test.go @@ -487,6 +487,7 @@ func (s *decimalTestSuite) TestOperationOrders() { } func BenchmarkMarshalTo(b *testing.B) { + b.ReportAllocs() bis := []struct { in sdk.Dec want []byte diff --git a/x/auth/keeper/keeper_bench_test.go b/x/auth/keeper/keeper_bench_test.go index a217eddac..1a18dff84 100644 --- a/x/auth/keeper/keeper_bench_test.go +++ b/x/auth/keeper/keeper_bench_test.go @@ -7,6 +7,7 @@ import ( ) func BenchmarkAccountMapperGetAccountFound(b *testing.B) { + b.ReportAllocs() app, ctx := createTestApp(false) // assumes b.N < 2**24 diff --git a/x/bank/bench_test.go b/x/bank/bench_test.go index f1affb9d9..0648b3b62 100644 --- a/x/bank/bench_test.go +++ b/x/bank/bench_test.go @@ -18,6 +18,7 @@ import ( var moduleAccAddr = authtypes.NewModuleAddress(stakingtypes.BondedPoolName) func BenchmarkOneBankSendTxPerBlock(b *testing.B) { + b.ReportAllocs() // Add an account at genesis acc := authtypes.BaseAccount{ Address: addr1.String(), diff --git a/x/mint/types/minter_test.go b/x/mint/types/minter_test.go index 8760a66f4..4abedb51c 100644 --- a/x/mint/types/minter_test.go +++ b/x/mint/types/minter_test.go @@ -89,6 +89,7 @@ func TestBlockProvision(t *testing.T) { // using sdk.Dec operations: (current implementation) // BenchmarkBlockProvision-4 3000000 429 ns/op func BenchmarkBlockProvision(b *testing.B) { + b.ReportAllocs() minter := InitialMinter(sdk.NewDecWithPrec(1, 1)) params := DefaultParams() @@ -105,6 +106,7 @@ func BenchmarkBlockProvision(b *testing.B) { // Next inflation benchmarking // BenchmarkNextInflation-4 1000000 1828 ns/op func BenchmarkNextInflation(b *testing.B) { + b.ReportAllocs() minter := InitialMinter(sdk.NewDecWithPrec(1, 1)) params := DefaultParams() bondedRatio := sdk.NewDecWithPrec(1, 1) @@ -119,6 +121,7 @@ func BenchmarkNextInflation(b *testing.B) { // Next annual provisions benchmarking // BenchmarkNextAnnualProvisions-4 5000000 251 ns/op func BenchmarkNextAnnualProvisions(b *testing.B) { + b.ReportAllocs() minter := InitialMinter(sdk.NewDecWithPrec(1, 1)) params := DefaultParams() totalSupply := sdk.NewInt(100000000000000) From 034d14048856940877be4edb356ae729308f1ca9 Mon Sep 17 00:00:00 2001 From: Rikard Hjort Date: Thu, 28 Jan 2021 17:59:51 +0100 Subject: [PATCH 06/19] Misc documentation fixes (#8452) * EndBlock: "beginning" => "end" * misc fixes * beginning => end * fix error in run-node tutorial * Use correct keyring backend when interacting * multiply stakes by 1000 * query accounts with the bank submodule, not accounts * specify key backend for transactions Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- docs/building-modules/beginblock-endblock.md | 2 +- docs/building-modules/module-manager.md | 5 +++-- docs/run-node/interact-node.md | 8 ++++---- docs/run-node/run-node.md | 4 ++-- docs/run-node/txs.md | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/building-modules/beginblock-endblock.md b/docs/building-modules/beginblock-endblock.md index 09a48df88..cb8dbba1d 100644 --- a/docs/building-modules/beginblock-endblock.md +++ b/docs/building-modules/beginblock-endblock.md @@ -24,7 +24,7 @@ The actual implementation of `BeginBlocker` and `EndBlocker` in `./abci.go` are A specificity of the `EndBlocker` is that it can return validator updates to the underlying consensus engine in the form of an [`[]abci.ValidatorUpdates`](https://tendermint.com/docs/app-dev/abci-spec.html#validatorupdate). This is the preferred way to implement custom validator changes. -It is possible for developers to defined the order of execution between the `BeginBlocker`/`EndBlocker` functions of each of their application's modules via the module's manager `SetOrderBeginBlocker`/`SetOrderEndBlocker` methods. For more on the module manager, click [here](./module-manager.md#manager). +It is possible for developers to define the order of execution between the `BeginBlocker`/`EndBlocker` functions of each of their application's modules via the module's manager `SetOrderBeginBlocker`/`SetOrderEndBlocker` methods. For more on the module manager, click [here](./module-manager.md#manager). See an example implementation of `BeginBlocker` from the `distr` module: diff --git a/docs/building-modules/module-manager.md b/docs/building-modules/module-manager.md index cd8cc4b9e..919ec1425 100644 --- a/docs/building-modules/module-manager.md +++ b/docs/building-modules/module-manager.md @@ -74,7 +74,8 @@ Let us go through the methods of `AppModule`: - `LegacyQuerierHandler(*codec.LegacyAmino)` (deprecated): Returns a [`querier`](./query-services.md#legacy-queriers) given the query `path`, in order to process the `query`. - `RegisterServices(Configurator)`: Allows a module to register services. - `BeginBlock(sdk.Context, abci.RequestBeginBlock)`: This method gives module developers the option to implement logic that is automatically triggered at the beginning of each block. Implement empty if no logic needs to be triggered at the beginning of each block for this module. -- `EndBlock(sdk.Context, abci.RequestEndBlock)`: This method gives module developers the option to implement logic that is automatically triggered at the beginning of each block. This is also where the module can inform the underlying consensus engine of validator set changes (e.g. the `staking` module). Implement empty if no logic needs to be triggered at the beginning of each block for this module. +- `EndBlock(sdk.Context, abci.RequestEndBlock)`: This method gives module developers the option to implement logic that is automatically triggered at the end of each block. This is also where the module can inform the underlying consensus engine of validator set changes (e.g. the `staking` module). Implement empty if no logic needs to be triggered at the end of each block for this module. + ### Implementing the Application Module Interfaces @@ -132,7 +133,7 @@ The module manager is used throughout the application whenever an action on a co - `SetOrderInitGenesis(moduleNames ...string)`: Sets the order in which the [`InitGenesis`](./genesis.md#initgenesis) function of each module will be called when the application is first started. This function is generally called from the application's main [constructor function](../basics/app-anatomy.md#constructor-function). - `SetOrderExportGenesis(moduleNames ...string)`: Sets the order in which the [`ExportGenesis`](./genesis.md#exportgenesis) function of each module will be called in case of an export. This function is generally called from the application's main [constructor function](../basics/app-anatomy.md#constructor-function). - `SetOrderBeginBlockers(moduleNames ...string)`: Sets the order in which the `BeginBlock()` function of each module will be called at the beginning of each block. This function is generally called from the application's main [constructor function](../basics/app-anatomy.md#constructor-function). -- `SetOrderEndBlockers(moduleNames ...string)`: Sets the order in which the `EndBlock()` function of each module will be called at the beginning of each block. This function is generally called from the application's main [constructor function](../basics/app-anatomy.md#constructor-function). +- `SetOrderEndBlockers(moduleNames ...string)`: Sets the order in which the `EndBlock()` function of each module will be called at the end of each block. This function is generally called from the application's main [constructor function](../basics/app-anatomy.md#constructor-function). - `RegisterInvariants(ir sdk.InvariantRegistry)`: Registers the [invariants](./invariants.md) of each module. - `RegisterRoutes(router sdk.Router, queryRouter sdk.QueryRouter, legacyQuerierCdc *codec.LegacyAmino)`: Registers legacy [`Msg`](./messages-and-queries.md#messages) and [`querier`](./query-services.md#legacy-queriers) routes. - `RegisterServices(cfg Configurator)`: Registers all module services. diff --git a/docs/run-node/interact-node.md b/docs/run-node/interact-node.md index a07981341..bb208f7d8 100644 --- a/docs/run-node/interact-node.md +++ b/docs/run-node/interact-node.md @@ -16,7 +16,7 @@ There are multiple ways to interact with a node: using the CLI, using gRPC or us Now that your chain is running, it is time to try sending tokens from the first account you created to a second account. In a new terminal window, start by running the following query command: ```bash -simd query account $MY_VALIDATOR_ADDRESS --chain-id my-test-chain +simd query bank balances $MY_VALIDATOR_ADDRESS --chain-id my-test-chain ``` You should see the current balance of the account you created, equal to the original balance of `stake` you granted it minus the amount you delegated via the `gentx`. Now, create a second account: @@ -31,16 +31,16 @@ RECIPIENT=$(simd keys show recipient -a --keyring-backend test) The command above creates a local key-pair that is not yet registered on the chain. An account is created the first time it receives tokens from another account. Now, run the following command to send tokens to the `recipient` account: ```bash -simd tx bank send $MY_VALIDATOR_ADDRESS $RECIPIENT 1000stake --chain-id my-test-chain +simd tx bank send $MY_VALIDATOR_ADDRESS $RECIPIENT 1000000stake --chain-id my-test-chain --keyring-backend test # Check that the recipient account did receive the tokens. -simd query account $RECIPIENT --chain-id my-test-chain +simd query bank balances $RECIPIENT --chain-id my-test-chain ``` Finally, delegate some of the stake tokens sent to the `recipient` account to the validator: ```bash -simd tx staking delegate $(simd keys show my_validator --bech val -a --keyring-backend test) 500stake --from recipient --chain-id my-test-chain +simd tx staking delegate $(simd keys show my_validator --bech val -a --keyring-backend test) 500stake --from recipient --chain-id my-test-chain --keyring-backend test # Query the total delegations to `validator`. simd query staking delegations-to $(simd keys show my_validator --bech val -a --keyring-backend test) --chain-id my-test-chain diff --git a/docs/run-node/run-node.md b/docs/run-node/run-node.md index aee7d84e1..d7aaf8f58 100644 --- a/docs/run-node/run-node.md +++ b/docs/run-node/run-node.md @@ -44,7 +44,7 @@ Before starting the chain, you need to populate the state with at least one acco Now that you have created a local account, go ahead and grant it some `stake` tokens in your chain's genesis file. Doing so will also make sure your chain is aware of this account's existence: ```bash -simd add-genesis-account $MY_VALIDATOR_ADDRESS 100000000stake +simd add-genesis-account $MY_VALIDATOR_ADDRESS 100000000000stake ``` Recall that `$MY_VALIDATOR_ADDRESS` is a variable that holds the address of the `my_validator` key in the [keyring](./keyring.md#adding-keys-to-the-keyring). Also note that the tokens in the SDK have the `{amount}{denom}` format: `amount` is is a 18-digit-precision decimal number, and `denom` is the unique token identifier with its denomination key (e.g. `atom` or `uatom`). Here, we are granting `stake` tokens, as `stake` is the token identifier used for staking in [`simapp`](https://github.com/cosmos/cosmos-sdk/tree/v0.40.0-rc3/simapp). For your own chain with its own staking denom, that token identifier should be used instead. @@ -53,7 +53,7 @@ Now that your account has some tokens, you need to add a validator to your chain ```bash # Create a gentx. -simd gentx my_validator 100000stake --chain-id my-test-chain --keyring-backend test +simd gentx my_validator 100000000stake --chain-id my-test-chain --keyring-backend test # Add the gentx to the genesis file. simd collect-gentxs diff --git a/docs/run-node/txs.md b/docs/run-node/txs.md index 9fbc642ef..ce977212d 100644 --- a/docs/run-node/txs.md +++ b/docs/run-node/txs.md @@ -11,7 +11,7 @@ This document describes how to generate an (unsigned) transaction, signing it (w The easiest way to send transactions is using the CLI, as we have seen in the previous page when [interacting with a node](./interact-node.md#using-the-cli). For example, running the following command ```bash -simd tx bank send $MY_VALIDATOR_ADDRESS $RECIPIENT 1000stake --chain-id my-test-chain +simd tx bank send $MY_VALIDATOR_ADDRESS $RECIPIENT 1000stake --chain-id my-test-chain --keyring-backend test ``` will run the following steps: From c252a60ff8781a01c716aba8fa661954d6e6c703 Mon Sep 17 00:00:00 2001 From: Artur Troian Date: Thu, 28 Jan 2021 20:58:44 -0500 Subject: [PATCH 07/19] fix: bind values from env variables to flags (#8337) allows clients access values in env variables Signed-off-by: Artur Troian --- docs/core/cli.md | 18 ++++++++++++++++++ server/util.go | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/docs/core/cli.md b/docs/core/cli.md index 8e11bf488..10203e769 100644 --- a/docs/core/cli.md +++ b/docs/core/cli.md @@ -108,6 +108,24 @@ Flags are added to commands directly (generally in the [module's CLI file](../bu +++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/simapp/simd/cmd/root.go#L118 +## Environment variables + +Each flag is bound to it's respecteve named environment variable. Then name of the environment variable consist of two parts - capital case `basename` followed by flag name of the flag. `-` must be substituted with `_`. For example flag `--home` for application with basename `GAIA` is bound to `GAIA_HOME`. It allows to reduce amount of flags typed for routine operations. For example instead of: +```sh +gaia --home=./ --node= --chain-id="testchain-1" --keyring-backend=test tx ... --from= +``` +this will be more convinient: +```sh +# define env variables in .env, .envrc etc +GAIA_HOME= +GAIA_NODE= +GAIA_CHAIN_ID="testchain-1" +GAIA_KEYRING_BACKEND="test" + +# and later just use +gaia tx ... --from= +``` + ## Configurations It is vital that the root command of an application uses `PersistentPreRun()` cobra command property for executing the command, so all child commands have access to the server and client contexts. These contexts are set as their default values initially and maybe modified, scoped to the command, in their respective `PersistentPreRun()` functions. Note that the `client.Context` is typically pre-populated with "default" values that may be useful for all commands to inherit and override if necessary. diff --git a/server/util.go b/server/util.go index e461a12fb..b431b715d 100644 --- a/server/util.go +++ b/server/util.go @@ -17,6 +17,7 @@ import ( "github.com/rs/zerolog" "github.com/rs/zerolog/log" "github.com/spf13/cobra" + "github.com/spf13/pflag" "github.com/spf13/viper" tmcfg "github.com/tendermint/tendermint/config" tmlog "github.com/tendermint/tendermint/libs/log" @@ -63,6 +64,37 @@ func NewContext(v *viper.Viper, config *tmcfg.Config, logger tmlog.Logger) *Cont return &Context{v, config, logger} } +func bindFlags(basename string, cmd *cobra.Command, v *viper.Viper) (err error) { + defer func() { + recover() + }() + + cmd.Flags().VisitAll(func(f *pflag.Flag) { + // Environment variables can't have dashes in them, so bind them to their equivalent + // keys with underscores, e.g. --favorite-color to STING_FAVORITE_COLOR + err = v.BindEnv(f.Name, fmt.Sprintf("%s_%s", basename, strings.ToUpper(strings.ReplaceAll(f.Name, "-", "_")))) + if err != nil { + panic(err) + } + + err = v.BindPFlag(f.Name, f) + if err != nil { + panic(err) + } + + // Apply the viper config value to the flag when the flag is not set and viper has a value + if !f.Changed && v.IsSet(f.Name) { + val := v.Get(f.Name) + err = cmd.Flags().Set(f.Name, fmt.Sprintf("%v", val)) + if err != nil { + panic(err) + } + } + }) + + return +} + // InterceptConfigsPreRunHandler performs a pre-run function for the root daemon // application command. It will create a Viper literal and a default server // Context. The server Tendermint configuration will either be read and parsed @@ -98,6 +130,9 @@ func InterceptConfigsPreRunHandler(cmd *cobra.Command) error { // return value is a tendermint configuration object serverCtx.Config = config + if err = bindFlags(basename, cmd, serverCtx.Viper); err != nil { + return err + } var logWriter io.Writer if strings.ToLower(serverCtx.Viper.GetString(flags.FlagLogFormat)) == tmcfg.LogFormatPlain { From 3b8e0f9387386dc3cb375a662bc4bc0ad211f284 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Fri, 29 Jan 2021 18:46:23 +0000 Subject: [PATCH 08/19] store/multistore: revert a height limit increase from #8396 (#8466) See https://github.com/cosmos/cosmos-sdk/pull/8396#discussion_r565654207 Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- store/rootmulti/store.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 0e8cba44e..1ca43eae9 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -711,7 +711,7 @@ func (rs *Store) Restore( if height == 0 { return sdkerrors.Wrap(sdkerrors.ErrLogic, "cannot restore snapshot at height 0") } - if height > uint64(math.MaxUint64) { + if height > uint64(math.MaxInt64) { return sdkerrors.Wrapf(snapshottypes.ErrInvalidMetadata, "snapshot height %v cannot exceed %v", height, int64(math.MaxInt64)) } From d97e7907f176777ed8a464006d360bb3e1a223e4 Mon Sep 17 00:00:00 2001 From: atheeshp <59333759+atheeshp@users.noreply.github.com> Date: Sat, 30 Jan 2021 01:24:51 +0530 Subject: [PATCH 09/19] Add fee grant module (#8061) * Add docs * Add BasicFeeAllowance implementation * Add expiration structs and complete basic fee * Add delegation messages, add validation logic * Add keeper and helper structs * Add alias and handler to top level * Add delegation module * Add basic querier * Add types tests * Add types tests * More internal test coverage * Solid internal test coverage * Expose Querier to top level module * Add FeeAccount to auth/types, like StdTx, SignDoc * Fix all tests in x/auth * All tests pass * Appease the Golang Linter * Add fee-account command line flag * Start on DelegatedDeductFeeDecorator * Cleanup the Decorator * Wire up delegation module in simapp * add basic test for decorator (no delegation) * Table tests for deduct fees * Table tests over all conditions of delegated fee decorator * Build full ante handler stack and test it * Start genesis * Implement Genesis * Rename package delegation to subkeys * Clarify antes test cases, handle empty account w/o fees * Allow paying delegated fees with no account * Pull mempool into delegated ante, for control on StdFee * Use custom DelegatedTx, DelegatedFee for subkeys * Revert all changes to x/auth.StdTx * Appease scopelint * Register DelegatedTx with codec * Address PR comments * Remove unnecessary DelegatedMempoolFeeDecorator * Cleaned up errors in querier * Clean up message sign bytes * Minor PR comments * Replace GetAllFees... with Iterator variants * PrepareForExport adjusts grant expiration height * Panic on de/serialization error in keeper * Move custom ante handler chain to tests, update docs * More cleanup * More doc cleanup * Renamed subkeys module to fee_grant * Rename subkeys/delegation to fee grant in all strings * Modify Msg and Keeper methods to use Grant not Delegate * Add PeriodicFeeAllowance * Update aliases * Cover all accept cases for PeriodicFeeAllowance * Et tu scopelint? * Update docs as requested * Remove error return from GetFeeGrant * Code cleanup as requested by PR * Updated all errors to use new sdk/errors package * Use test suite for keeper tests * Clean up alias.go file * Define expected interfaces in exported, rather than importing from account * Remove dependency on auth/ante * Improve godoc, Logger * Cleaned up ExpiresAt * Improve error reporting with UseGrantedFee * Enforce period limit subset of basic limit * Add events * Rename fee_grant to feegrant * Ensure KeeperTestSuite actually runs * Move types/tx to types * Update alias file, include ante * I do need nolint in alias.go * Properly emit events in the handler. Use cosmos-sdk in amino types * Update godoc * Linting... * Update errors * Update pkg doc and fix ante-handler order * Merge PR #5782: Migrate x/feegrant to proto * fix errors * proto changes * proto changes * fix errors * fix errors * genesis state changed to proto * fix keeper tests * fix test * fixed tests * fix tests * updated expected keepers * updated ante tests * lint * deleted alias.go * tx updated to proto tx * remove explicit signmode * tests * Added `cli/query.go` * Added tx.go in cli * updated `module.go` * resolve errors in tx.go * Add fee payer gentx func * updated tx * fixed error * WIP: cli tests * fix query error * fix tests * Unused types and funcs * fix tests * rename helper func to create tx * remove unused * update tx cfg * fix cli tests * added simulations * Add `decoder.go` * fix build fail * added init genesis code * update tx.go * fixed LGTM alert * modified cli * remove gogoproto extensions * change acc address type to string * lint * fix simulations * Add gen simulations * remove legacy querier * remove legacy code * add grpc queries tests * fix simulations * update module.go * lint * register feegrant NewSimulationManager * fix sims * fix sims * add genesis test * add periodic grant * updated cmd * changed times * updated flags * removed days as period clock * added condition for period and exp * add periodic fee cli tests * udpated tests * fix lint * fix tests * fix sims * renaming to `fee_grant` * review changes * fix test * add condition for duplicate grants * fix tests * add `genTxWithFeeGranter` in tests * fix simulation * one of changes & test fixes * fix test * fix lint * changed package name `feegrant` to `fee_grant` * review comments * review changes * review change * review changes * added fee-account in flags * address review changes * read fee granter from cli * updated create account with mnemonic * Address review comments * move `simapp/ante` file to `feegrant/ante` * update keeper logic to create account * update docs * fix tests * update `serviceMsgClientConn` from `msgservice` * review changes * add test case for using more fees than allowed * eliminate panic checks from keeper * fix lint * change store keys string to bytes * fix tests * review changes * review changes * udpate docs * make spend limit optional * fix tests * fix tests * review changes * add norace tag * proto-docs * add docs Co-authored-by: Ethan Frey Co-authored-by: Alexander Bezobchuk Co-authored-by: Aleksandr Bezobchuk Co-authored-by: SaReN Co-authored-by: aleem1413 Co-authored-by: MD Aleem <72057206+aleem1314@users.noreply.github.com> Co-authored-by: Anil Kumar Kammari Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- client/cmd.go | 13 + client/context.go | 8 + client/flags/flags.go | 2 + client/query.go | 5 + client/tx/tx.go | 1 + client/tx_config.go | 1 + docs/core/proto-docs.md | 9266 +++++++++--------- proto/cosmos/feegrant/v1beta1/feegrant.proto | 81 + proto/cosmos/feegrant/v1beta1/genesis.proto | 12 + proto/cosmos/feegrant/v1beta1/query.proto | 52 + proto/cosmos/feegrant/v1beta1/tx.proto | 40 + simapp/app.go | 17 +- simapp/params/weights.go | 4 + x/auth/legacy/legacytx/stdtx_builder.go | 3 + x/feegrant/ante/ante.go | 35 + x/feegrant/ante/fee.go | 82 + x/feegrant/ante/fee_test.go | 287 + x/feegrant/client/cli/cli_test.go | 621 ++ x/feegrant/client/cli/query.go | 129 + x/feegrant/client/cli/tx.go | 211 + x/feegrant/client/rest/grpc_query_test.go | 209 + x/feegrant/doc.go | 29 + x/feegrant/genesis.go | 61 + x/feegrant/genesis_test.go | 56 + x/feegrant/keeper/grpc_query.go | 94 + x/feegrant/keeper/keeper.go | 190 + x/feegrant/keeper/keeper_test.go | 257 + x/feegrant/keeper/msg_server.go | 72 + x/feegrant/module.go | 210 + x/feegrant/simulation/decoder.go | 26 + x/feegrant/simulation/decoder_test.go | 62 + x/feegrant/simulation/genesis.go | 38 + x/feegrant/simulation/genesis_test.go | 39 + x/feegrant/simulation/operations.go | 200 + x/feegrant/simulation/operations_test.go | 173 + x/feegrant/types/basic_fee.go | 61 + x/feegrant/types/basic_fee_test.go | 140 + x/feegrant/types/codec.go | 24 + x/feegrant/types/errors.go | 21 + x/feegrant/types/events.go | 13 + x/feegrant/types/expected_keepers.go | 23 + x/feegrant/types/expiration.go | 138 + x/feegrant/types/expiration_test.go | 161 + x/feegrant/types/feegrant.pb.go | 1701 ++++ x/feegrant/types/fees.go | 32 + x/feegrant/types/genesis.go | 40 + x/feegrant/types/genesis.pb.go | 333 + x/feegrant/types/grant.go | 92 + x/feegrant/types/grant_test.go | 99 + x/feegrant/types/key.go | 35 + x/feegrant/types/msgs.go | 101 + x/feegrant/types/periodic_fee.go | 120 + x/feegrant/types/periodic_fee_test.go | 205 + x/feegrant/types/query.pb.go | 1172 +++ x/feegrant/types/query.pb.gw.go | 322 + x/feegrant/types/tx.pb.go | 1033 ++ x/mint/simulation/decoder.go | 2 +- 57 files changed, 13983 insertions(+), 4471 deletions(-) create mode 100644 proto/cosmos/feegrant/v1beta1/feegrant.proto create mode 100644 proto/cosmos/feegrant/v1beta1/genesis.proto create mode 100644 proto/cosmos/feegrant/v1beta1/query.proto create mode 100644 proto/cosmos/feegrant/v1beta1/tx.proto create mode 100644 x/feegrant/ante/ante.go create mode 100644 x/feegrant/ante/fee.go create mode 100644 x/feegrant/ante/fee_test.go create mode 100644 x/feegrant/client/cli/cli_test.go create mode 100644 x/feegrant/client/cli/query.go create mode 100644 x/feegrant/client/cli/tx.go create mode 100644 x/feegrant/client/rest/grpc_query_test.go create mode 100644 x/feegrant/doc.go create mode 100644 x/feegrant/genesis.go create mode 100644 x/feegrant/genesis_test.go create mode 100644 x/feegrant/keeper/grpc_query.go create mode 100644 x/feegrant/keeper/keeper.go create mode 100644 x/feegrant/keeper/keeper_test.go create mode 100644 x/feegrant/keeper/msg_server.go create mode 100644 x/feegrant/module.go create mode 100644 x/feegrant/simulation/decoder.go create mode 100644 x/feegrant/simulation/decoder_test.go create mode 100644 x/feegrant/simulation/genesis.go create mode 100644 x/feegrant/simulation/genesis_test.go create mode 100644 x/feegrant/simulation/operations.go create mode 100644 x/feegrant/simulation/operations_test.go create mode 100644 x/feegrant/types/basic_fee.go create mode 100644 x/feegrant/types/basic_fee_test.go create mode 100644 x/feegrant/types/codec.go create mode 100644 x/feegrant/types/errors.go create mode 100644 x/feegrant/types/events.go create mode 100644 x/feegrant/types/expected_keepers.go create mode 100644 x/feegrant/types/expiration.go create mode 100644 x/feegrant/types/expiration_test.go create mode 100644 x/feegrant/types/feegrant.pb.go create mode 100644 x/feegrant/types/fees.go create mode 100644 x/feegrant/types/genesis.go create mode 100644 x/feegrant/types/genesis.pb.go create mode 100644 x/feegrant/types/grant.go create mode 100644 x/feegrant/types/grant_test.go create mode 100644 x/feegrant/types/key.go create mode 100644 x/feegrant/types/msgs.go create mode 100644 x/feegrant/types/periodic_fee.go create mode 100644 x/feegrant/types/periodic_fee_test.go create mode 100644 x/feegrant/types/query.pb.go create mode 100644 x/feegrant/types/query.pb.gw.go create mode 100644 x/feegrant/types/tx.pb.go diff --git a/client/cmd.go b/client/cmd.go index eccf59c35..437022695 100644 --- a/client/cmd.go +++ b/client/cmd.go @@ -221,6 +221,19 @@ func readTxCommandFlags(clientCtx Context, flagSet *pflag.FlagSet) (Context, err clientCtx = clientCtx.WithSignModeStr(signModeStr) } + if clientCtx.FeeGranter == nil || flagSet.Changed(flags.FlagFeeAccount) { + granter, _ := flagSet.GetString(flags.FlagFeeAccount) + + if granter != "" { + granterAcc, err := sdk.AccAddressFromBech32(granter) + if err != nil { + return clientCtx, err + } + + clientCtx = clientCtx.WithFeeGranterAddress(granterAcc) + } + } + if clientCtx.From == "" || flagSet.Changed(flags.FlagFrom) { from, _ := flagSet.GetString(flags.FlagFrom) fromAddr, fromName, keyType, err := GetFromFields(clientCtx.Keyring, from, clientCtx.GenerateOnly) diff --git a/client/context.go b/client/context.go index 0e3d1181a..f7f555339 100644 --- a/client/context.go +++ b/client/context.go @@ -44,6 +44,7 @@ type Context struct { TxConfig TxConfig AccountRetriever AccountRetriever NodeURI string + FeeGranter sdk.AccAddress // TODO: Deprecated (remove). LegacyAmino *codec.LegacyAmino @@ -166,6 +167,13 @@ func (ctx Context) WithFromAddress(addr sdk.AccAddress) Context { return ctx } +// WithFeeGranterAddress returns a copy of the context with an updated fee granter account +// address. +func (ctx Context) WithFeeGranterAddress(addr sdk.AccAddress) Context { + ctx.FeeGranter = addr + return ctx +} + // WithBroadcastMode returns a copy of the context with an updated broadcast // mode. func (ctx Context) WithBroadcastMode(mode string) Context { diff --git a/client/flags/flags.go b/client/flags/flags.go index 282a61c4c..1afb55b46 100644 --- a/client/flags/flags.go +++ b/client/flags/flags.go @@ -70,6 +70,7 @@ const ( FlagCountTotal = "count-total" FlagTimeoutHeight = "timeout-height" FlagKeyAlgorithm = "algo" + FlagFeeAccount = "fee-account" // Tendermint logging flags FlagLogLevel = "log_level" @@ -112,6 +113,7 @@ func AddTxFlagsToCmd(cmd *cobra.Command) { cmd.Flags().String(FlagKeyringBackend, DefaultKeyringBackend, "Select keyring's backend (os|file|kwallet|pass|test)") cmd.Flags().String(FlagSignMode, "", "Choose sign mode (direct|amino-json), this is an advanced feature") cmd.Flags().Uint64(FlagTimeoutHeight, 0, "Set a block timeout height to prevent the tx from being committed past a certain height") + cmd.Flags().String(FlagFeeAccount, "", "Fee account pays fees for the transaction instead of deducting from the signer") // --gas can accept integers and "auto" cmd.Flags().String(FlagGas, "", fmt.Sprintf("gas limit to set per-transaction; set to %q to calculate sufficient gas automatically (default %d)", GasFlagAuto, DefaultGasLimit)) diff --git a/client/query.go b/client/query.go index 18a5c3c2f..bb65d9bf3 100644 --- a/client/query.go +++ b/client/query.go @@ -57,6 +57,11 @@ func (ctx Context) GetFromAddress() sdk.AccAddress { return ctx.FromAddress } +// GetFeeGranterAddress returns the fee granter address from the context +func (ctx Context) GetFeeGranterAddress() sdk.AccAddress { + return ctx.FeeGranter +} + // GetFromName returns the key name for the current context. func (ctx Context) GetFromName() string { return ctx.FromName diff --git a/client/tx/tx.go b/client/tx/tx.go index 594293732..62e3e9098 100644 --- a/client/tx/tx.go +++ b/client/tx/tx.go @@ -117,6 +117,7 @@ func BroadcastTx(clientCtx client.Context, txf Factory, msgs ...sdk.Msg) error { } } + tx.SetFeeGranter(clientCtx.GetFeeGranterAddress()) err = Sign(txf, clientCtx.GetFromName(), tx, true) if err != nil { return err diff --git a/client/tx_config.go b/client/tx_config.go index 6992a7a24..8220e917b 100644 --- a/client/tx_config.go +++ b/client/tx_config.go @@ -42,5 +42,6 @@ type ( SetFeeAmount(amount sdk.Coins) SetGasLimit(limit uint64) SetTimeoutHeight(height uint64) + SetFeeGranter(feeGranter sdk.AccAddress) } ) diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index ec30ba730..6b5909a3d 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -4,70 +4,116 @@ ## Table of Contents -- [cosmos/auth/v1beta1/auth.proto](#cosmos/auth/v1beta1/auth.proto) - - [BaseAccount](#cosmos.auth.v1beta1.BaseAccount) - - [ModuleAccount](#cosmos.auth.v1beta1.ModuleAccount) - - [Params](#cosmos.auth.v1beta1.Params) +- [cosmos/tx/v1beta1/tx.proto](#cosmos/tx/v1beta1/tx.proto) + - [AuthInfo](#cosmos.tx.v1beta1.AuthInfo) + - [Fee](#cosmos.tx.v1beta1.Fee) + - [ModeInfo](#cosmos.tx.v1beta1.ModeInfo) + - [ModeInfo.Multi](#cosmos.tx.v1beta1.ModeInfo.Multi) + - [ModeInfo.Single](#cosmos.tx.v1beta1.ModeInfo.Single) + - [SignDoc](#cosmos.tx.v1beta1.SignDoc) + - [SignerInfo](#cosmos.tx.v1beta1.SignerInfo) + - [Tx](#cosmos.tx.v1beta1.Tx) + - [TxBody](#cosmos.tx.v1beta1.TxBody) + - [TxRaw](#cosmos.tx.v1beta1.TxRaw) -- [cosmos/auth/v1beta1/genesis.proto](#cosmos/auth/v1beta1/genesis.proto) - - [GenesisState](#cosmos.auth.v1beta1.GenesisState) +- [cosmos/tx/v1beta1/service.proto](#cosmos/tx/v1beta1/service.proto) + - [BroadcastTxRequest](#cosmos.tx.v1beta1.BroadcastTxRequest) + - [BroadcastTxResponse](#cosmos.tx.v1beta1.BroadcastTxResponse) + - [GetTxRequest](#cosmos.tx.v1beta1.GetTxRequest) + - [GetTxResponse](#cosmos.tx.v1beta1.GetTxResponse) + - [GetTxsEventRequest](#cosmos.tx.v1beta1.GetTxsEventRequest) + - [GetTxsEventResponse](#cosmos.tx.v1beta1.GetTxsEventResponse) + - [SimulateRequest](#cosmos.tx.v1beta1.SimulateRequest) + - [SimulateResponse](#cosmos.tx.v1beta1.SimulateResponse) -- [cosmos/auth/v1beta1/query.proto](#cosmos/auth/v1beta1/query.proto) - - [QueryAccountRequest](#cosmos.auth.v1beta1.QueryAccountRequest) - - [QueryAccountResponse](#cosmos.auth.v1beta1.QueryAccountResponse) - - [QueryParamsRequest](#cosmos.auth.v1beta1.QueryParamsRequest) - - [QueryParamsResponse](#cosmos.auth.v1beta1.QueryParamsResponse) + - [BroadcastMode](#cosmos.tx.v1beta1.BroadcastMode) - - [Query](#cosmos.auth.v1beta1.Query) + - [Service](#cosmos.tx.v1beta1.Service) -- [cosmos/base/v1beta1/coin.proto](#cosmos/base/v1beta1/coin.proto) - - [Coin](#cosmos.base.v1beta1.Coin) - - [DecCoin](#cosmos.base.v1beta1.DecCoin) - - [DecProto](#cosmos.base.v1beta1.DecProto) - - [IntProto](#cosmos.base.v1beta1.IntProto) +- [cosmos/tx/signing/v1beta1/signing.proto](#cosmos/tx/signing/v1beta1/signing.proto) + - [SignatureDescriptor](#cosmos.tx.signing.v1beta1.SignatureDescriptor) + - [SignatureDescriptor.Data](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data) + - [SignatureDescriptor.Data.Multi](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi) + - [SignatureDescriptor.Data.Single](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single) + - [SignatureDescriptors](#cosmos.tx.signing.v1beta1.SignatureDescriptors) -- [cosmos/authz/v1beta1/authz.proto](#cosmos/authz/v1beta1/authz.proto) - - [AuthorizationGrant](#cosmos.authz.v1beta1.AuthorizationGrant) - - [GenericAuthorization](#cosmos.authz.v1beta1.GenericAuthorization) - - [SendAuthorization](#cosmos.authz.v1beta1.SendAuthorization) + - [SignMode](#cosmos.tx.signing.v1beta1.SignMode) -- [cosmos/base/abci/v1beta1/abci.proto](#cosmos/base/abci/v1beta1/abci.proto) - - [ABCIMessageLog](#cosmos.base.abci.v1beta1.ABCIMessageLog) - - [Attribute](#cosmos.base.abci.v1beta1.Attribute) - - [GasInfo](#cosmos.base.abci.v1beta1.GasInfo) - - [MsgData](#cosmos.base.abci.v1beta1.MsgData) - - [Result](#cosmos.base.abci.v1beta1.Result) - - [SearchTxsResult](#cosmos.base.abci.v1beta1.SearchTxsResult) - - [SimulationResponse](#cosmos.base.abci.v1beta1.SimulationResponse) - - [StringEvent](#cosmos.base.abci.v1beta1.StringEvent) - - [TxMsgData](#cosmos.base.abci.v1beta1.TxMsgData) - - [TxResponse](#cosmos.base.abci.v1beta1.TxResponse) +- [cosmos/crisis/v1beta1/tx.proto](#cosmos/crisis/v1beta1/tx.proto) + - [MsgVerifyInvariant](#cosmos.crisis.v1beta1.MsgVerifyInvariant) + - [MsgVerifyInvariantResponse](#cosmos.crisis.v1beta1.MsgVerifyInvariantResponse) -- [cosmos/authz/v1beta1/tx.proto](#cosmos/authz/v1beta1/tx.proto) - - [MsgExecAuthorizedRequest](#cosmos.authz.v1beta1.MsgExecAuthorizedRequest) - - [MsgExecAuthorizedResponse](#cosmos.authz.v1beta1.MsgExecAuthorizedResponse) - - [MsgGrantAuthorizationRequest](#cosmos.authz.v1beta1.MsgGrantAuthorizationRequest) - - [MsgGrantAuthorizationResponse](#cosmos.authz.v1beta1.MsgGrantAuthorizationResponse) - - [MsgRevokeAuthorizationRequest](#cosmos.authz.v1beta1.MsgRevokeAuthorizationRequest) - - [MsgRevokeAuthorizationResponse](#cosmos.authz.v1beta1.MsgRevokeAuthorizationResponse) + - [Msg](#cosmos.crisis.v1beta1.Msg) - - [Msg](#cosmos.authz.v1beta1.Msg) +- [cosmos/crisis/v1beta1/genesis.proto](#cosmos/crisis/v1beta1/genesis.proto) + - [GenesisState](#cosmos.crisis.v1beta1.GenesisState) -- [cosmos/authz/v1beta1/genesis.proto](#cosmos/authz/v1beta1/genesis.proto) - - [GenesisState](#cosmos.authz.v1beta1.GenesisState) - - [GrantAuthorization](#cosmos.authz.v1beta1.GrantAuthorization) +- [cosmos/crypto/multisig/keys.proto](#cosmos/crypto/multisig/keys.proto) + - [LegacyAminoPubKey](#cosmos.crypto.multisig.LegacyAminoPubKey) -- [cosmos/base/query/v1beta1/pagination.proto](#cosmos/base/query/v1beta1/pagination.proto) - - [PageRequest](#cosmos.base.query.v1beta1.PageRequest) - - [PageResponse](#cosmos.base.query.v1beta1.PageResponse) +- [cosmos/crypto/multisig/v1beta1/multisig.proto](#cosmos/crypto/multisig/v1beta1/multisig.proto) + - [CompactBitArray](#cosmos.crypto.multisig.v1beta1.CompactBitArray) + - [MultiSignature](#cosmos.crypto.multisig.v1beta1.MultiSignature) -- [cosmos/authz/v1beta1/query.proto](#cosmos/authz/v1beta1/query.proto) - - [QueryAuthorizationRequest](#cosmos.authz.v1beta1.QueryAuthorizationRequest) - - [QueryAuthorizationResponse](#cosmos.authz.v1beta1.QueryAuthorizationResponse) - - [QueryAuthorizationsRequest](#cosmos.authz.v1beta1.QueryAuthorizationsRequest) - - [QueryAuthorizationsResponse](#cosmos.authz.v1beta1.QueryAuthorizationsResponse) +- [cosmos/crypto/secp256k1/keys.proto](#cosmos/crypto/secp256k1/keys.proto) + - [PrivKey](#cosmos.crypto.secp256k1.PrivKey) + - [PubKey](#cosmos.crypto.secp256k1.PubKey) - - [Query](#cosmos.authz.v1beta1.Query) +- [cosmos/crypto/ed25519/keys.proto](#cosmos/crypto/ed25519/keys.proto) + - [PrivKey](#cosmos.crypto.ed25519.PrivKey) + - [PubKey](#cosmos.crypto.ed25519.PubKey) + +- [cosmos/mint/v1beta1/query.proto](#cosmos/mint/v1beta1/query.proto) + - [QueryAnnualProvisionsRequest](#cosmos.mint.v1beta1.QueryAnnualProvisionsRequest) + - [QueryAnnualProvisionsResponse](#cosmos.mint.v1beta1.QueryAnnualProvisionsResponse) + - [QueryInflationRequest](#cosmos.mint.v1beta1.QueryInflationRequest) + - [QueryInflationResponse](#cosmos.mint.v1beta1.QueryInflationResponse) + - [QueryParamsRequest](#cosmos.mint.v1beta1.QueryParamsRequest) + - [QueryParamsResponse](#cosmos.mint.v1beta1.QueryParamsResponse) + + - [Query](#cosmos.mint.v1beta1.Query) + +- [cosmos/mint/v1beta1/genesis.proto](#cosmos/mint/v1beta1/genesis.proto) + - [GenesisState](#cosmos.mint.v1beta1.GenesisState) + +- [cosmos/mint/v1beta1/mint.proto](#cosmos/mint/v1beta1/mint.proto) + - [Minter](#cosmos.mint.v1beta1.Minter) + - [Params](#cosmos.mint.v1beta1.Params) + +- [cosmos/feegrant/v1beta1/feegrant.proto](#cosmos/feegrant/v1beta1/feegrant.proto) + - [BasicFeeAllowance](#cosmos.feegrant.v1beta1.BasicFeeAllowance) + - [Duration](#cosmos.feegrant.v1beta1.Duration) + - [ExpiresAt](#cosmos.feegrant.v1beta1.ExpiresAt) + - [FeeAllowanceGrant](#cosmos.feegrant.v1beta1.FeeAllowanceGrant) + - [PeriodicFeeAllowance](#cosmos.feegrant.v1beta1.PeriodicFeeAllowance) + +- [cosmos/feegrant/v1beta1/query.proto](#cosmos/feegrant/v1beta1/query.proto) + - [QueryFeeAllowanceRequest](#cosmos.feegrant.v1beta1.QueryFeeAllowanceRequest) + - [QueryFeeAllowanceResponse](#cosmos.feegrant.v1beta1.QueryFeeAllowanceResponse) + - [QueryFeeAllowancesRequest](#cosmos.feegrant.v1beta1.QueryFeeAllowancesRequest) + - [QueryFeeAllowancesResponse](#cosmos.feegrant.v1beta1.QueryFeeAllowancesResponse) + + - [Query](#cosmos.feegrant.v1beta1.Query) + +- [cosmos/feegrant/v1beta1/tx.proto](#cosmos/feegrant/v1beta1/tx.proto) + - [MsgGrantFeeAllowance](#cosmos.feegrant.v1beta1.MsgGrantFeeAllowance) + - [MsgGrantFeeAllowanceResponse](#cosmos.feegrant.v1beta1.MsgGrantFeeAllowanceResponse) + - [MsgRevokeFeeAllowance](#cosmos.feegrant.v1beta1.MsgRevokeFeeAllowance) + - [MsgRevokeFeeAllowanceResponse](#cosmos.feegrant.v1beta1.MsgRevokeFeeAllowanceResponse) + + - [Msg](#cosmos.feegrant.v1beta1.Msg) + +- [cosmos/feegrant/v1beta1/genesis.proto](#cosmos/feegrant/v1beta1/genesis.proto) + - [GenesisState](#cosmos.feegrant.v1beta1.GenesisState) + +- [cosmos/capability/v1beta1/capability.proto](#cosmos/capability/v1beta1/capability.proto) + - [Capability](#cosmos.capability.v1beta1.Capability) + - [CapabilityOwners](#cosmos.capability.v1beta1.CapabilityOwners) + - [Owner](#cosmos.capability.v1beta1.Owner) + +- [cosmos/capability/v1beta1/genesis.proto](#cosmos/capability/v1beta1/genesis.proto) + - [GenesisOwners](#cosmos.capability.v1beta1.GenesisOwners) + - [GenesisState](#cosmos.capability.v1beta1.GenesisState) - [cosmos/bank/v1beta1/bank.proto](#cosmos/bank/v1beta1/bank.proto) - [DenomUnit](#cosmos.bank.v1beta1.DenomUnit) @@ -78,10 +124,6 @@ - [SendEnabled](#cosmos.bank.v1beta1.SendEnabled) - [Supply](#cosmos.bank.v1beta1.Supply) -- [cosmos/bank/v1beta1/genesis.proto](#cosmos/bank/v1beta1/genesis.proto) - - [Balance](#cosmos.bank.v1beta1.Balance) - - [GenesisState](#cosmos.bank.v1beta1.GenesisState) - - [cosmos/bank/v1beta1/query.proto](#cosmos/bank/v1beta1/query.proto) - [QueryAllBalancesRequest](#cosmos.bank.v1beta1.QueryAllBalancesRequest) - [QueryAllBalancesResponse](#cosmos.bank.v1beta1.QueryAllBalancesResponse) @@ -108,107 +150,85 @@ - [Msg](#cosmos.bank.v1beta1.Msg) -- [cosmos/base/kv/v1beta1/kv.proto](#cosmos/base/kv/v1beta1/kv.proto) - - [Pair](#cosmos.base.kv.v1beta1.Pair) - - [Pairs](#cosmos.base.kv.v1beta1.Pairs) +- [cosmos/bank/v1beta1/genesis.proto](#cosmos/bank/v1beta1/genesis.proto) + - [Balance](#cosmos.bank.v1beta1.Balance) + - [GenesisState](#cosmos.bank.v1beta1.GenesisState) -- [cosmos/base/reflection/v1beta1/reflection.proto](#cosmos/base/reflection/v1beta1/reflection.proto) - - [ListAllInterfacesRequest](#cosmos.base.reflection.v1beta1.ListAllInterfacesRequest) - - [ListAllInterfacesResponse](#cosmos.base.reflection.v1beta1.ListAllInterfacesResponse) - - [ListImplementationsRequest](#cosmos.base.reflection.v1beta1.ListImplementationsRequest) - - [ListImplementationsResponse](#cosmos.base.reflection.v1beta1.ListImplementationsResponse) +- [cosmos/authz/v1beta1/authz.proto](#cosmos/authz/v1beta1/authz.proto) + - [AuthorizationGrant](#cosmos.authz.v1beta1.AuthorizationGrant) + - [GenericAuthorization](#cosmos.authz.v1beta1.GenericAuthorization) + - [SendAuthorization](#cosmos.authz.v1beta1.SendAuthorization) - - [ReflectionService](#cosmos.base.reflection.v1beta1.ReflectionService) +- [cosmos/authz/v1beta1/query.proto](#cosmos/authz/v1beta1/query.proto) + - [QueryAuthorizationRequest](#cosmos.authz.v1beta1.QueryAuthorizationRequest) + - [QueryAuthorizationResponse](#cosmos.authz.v1beta1.QueryAuthorizationResponse) + - [QueryAuthorizationsRequest](#cosmos.authz.v1beta1.QueryAuthorizationsRequest) + - [QueryAuthorizationsResponse](#cosmos.authz.v1beta1.QueryAuthorizationsResponse) -- [cosmos/base/snapshots/v1beta1/snapshot.proto](#cosmos/base/snapshots/v1beta1/snapshot.proto) - - [Metadata](#cosmos.base.snapshots.v1beta1.Metadata) - - [Snapshot](#cosmos.base.snapshots.v1beta1.Snapshot) + - [Query](#cosmos.authz.v1beta1.Query) -- [cosmos/base/store/v1beta1/commit_info.proto](#cosmos/base/store/v1beta1/commit_info.proto) - - [CommitID](#cosmos.base.store.v1beta1.CommitID) - - [CommitInfo](#cosmos.base.store.v1beta1.CommitInfo) - - [StoreInfo](#cosmos.base.store.v1beta1.StoreInfo) +- [cosmos/authz/v1beta1/tx.proto](#cosmos/authz/v1beta1/tx.proto) + - [MsgExecAuthorizedRequest](#cosmos.authz.v1beta1.MsgExecAuthorizedRequest) + - [MsgExecAuthorizedResponse](#cosmos.authz.v1beta1.MsgExecAuthorizedResponse) + - [MsgGrantAuthorizationRequest](#cosmos.authz.v1beta1.MsgGrantAuthorizationRequest) + - [MsgGrantAuthorizationResponse](#cosmos.authz.v1beta1.MsgGrantAuthorizationResponse) + - [MsgRevokeAuthorizationRequest](#cosmos.authz.v1beta1.MsgRevokeAuthorizationRequest) + - [MsgRevokeAuthorizationResponse](#cosmos.authz.v1beta1.MsgRevokeAuthorizationResponse) -- [cosmos/base/store/v1beta1/snapshot.proto](#cosmos/base/store/v1beta1/snapshot.proto) - - [SnapshotIAVLItem](#cosmos.base.store.v1beta1.SnapshotIAVLItem) - - [SnapshotItem](#cosmos.base.store.v1beta1.SnapshotItem) - - [SnapshotStoreItem](#cosmos.base.store.v1beta1.SnapshotStoreItem) + - [Msg](#cosmos.authz.v1beta1.Msg) -- [cosmos/base/tendermint/v1beta1/query.proto](#cosmos/base/tendermint/v1beta1/query.proto) - - [GetBlockByHeightRequest](#cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest) - - [GetBlockByHeightResponse](#cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse) - - [GetLatestBlockRequest](#cosmos.base.tendermint.v1beta1.GetLatestBlockRequest) - - [GetLatestBlockResponse](#cosmos.base.tendermint.v1beta1.GetLatestBlockResponse) - - [GetLatestValidatorSetRequest](#cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest) - - [GetLatestValidatorSetResponse](#cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse) - - [GetNodeInfoRequest](#cosmos.base.tendermint.v1beta1.GetNodeInfoRequest) - - [GetNodeInfoResponse](#cosmos.base.tendermint.v1beta1.GetNodeInfoResponse) - - [GetSyncingRequest](#cosmos.base.tendermint.v1beta1.GetSyncingRequest) - - [GetSyncingResponse](#cosmos.base.tendermint.v1beta1.GetSyncingResponse) - - [GetValidatorSetByHeightRequest](#cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest) - - [GetValidatorSetByHeightResponse](#cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse) - - [Module](#cosmos.base.tendermint.v1beta1.Module) - - [Validator](#cosmos.base.tendermint.v1beta1.Validator) - - [VersionInfo](#cosmos.base.tendermint.v1beta1.VersionInfo) +- [cosmos/authz/v1beta1/genesis.proto](#cosmos/authz/v1beta1/genesis.proto) + - [GenesisState](#cosmos.authz.v1beta1.GenesisState) + - [GrantAuthorization](#cosmos.authz.v1beta1.GrantAuthorization) - - [Service](#cosmos.base.tendermint.v1beta1.Service) +- [cosmos/gov/v1beta1/gov.proto](#cosmos/gov/v1beta1/gov.proto) + - [Deposit](#cosmos.gov.v1beta1.Deposit) + - [DepositParams](#cosmos.gov.v1beta1.DepositParams) + - [Proposal](#cosmos.gov.v1beta1.Proposal) + - [TallyParams](#cosmos.gov.v1beta1.TallyParams) + - [TallyResult](#cosmos.gov.v1beta1.TallyResult) + - [TextProposal](#cosmos.gov.v1beta1.TextProposal) + - [Vote](#cosmos.gov.v1beta1.Vote) + - [VotingParams](#cosmos.gov.v1beta1.VotingParams) -- [cosmos/capability/v1beta1/capability.proto](#cosmos/capability/v1beta1/capability.proto) - - [Capability](#cosmos.capability.v1beta1.Capability) - - [CapabilityOwners](#cosmos.capability.v1beta1.CapabilityOwners) - - [Owner](#cosmos.capability.v1beta1.Owner) + - [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) + - [VoteOption](#cosmos.gov.v1beta1.VoteOption) -- [cosmos/capability/v1beta1/genesis.proto](#cosmos/capability/v1beta1/genesis.proto) - - [GenesisOwners](#cosmos.capability.v1beta1.GenesisOwners) - - [GenesisState](#cosmos.capability.v1beta1.GenesisState) +- [cosmos/gov/v1beta1/query.proto](#cosmos/gov/v1beta1/query.proto) + - [QueryDepositRequest](#cosmos.gov.v1beta1.QueryDepositRequest) + - [QueryDepositResponse](#cosmos.gov.v1beta1.QueryDepositResponse) + - [QueryDepositsRequest](#cosmos.gov.v1beta1.QueryDepositsRequest) + - [QueryDepositsResponse](#cosmos.gov.v1beta1.QueryDepositsResponse) + - [QueryParamsRequest](#cosmos.gov.v1beta1.QueryParamsRequest) + - [QueryParamsResponse](#cosmos.gov.v1beta1.QueryParamsResponse) + - [QueryProposalRequest](#cosmos.gov.v1beta1.QueryProposalRequest) + - [QueryProposalResponse](#cosmos.gov.v1beta1.QueryProposalResponse) + - [QueryProposalsRequest](#cosmos.gov.v1beta1.QueryProposalsRequest) + - [QueryProposalsResponse](#cosmos.gov.v1beta1.QueryProposalsResponse) + - [QueryTallyResultRequest](#cosmos.gov.v1beta1.QueryTallyResultRequest) + - [QueryTallyResultResponse](#cosmos.gov.v1beta1.QueryTallyResultResponse) + - [QueryVoteRequest](#cosmos.gov.v1beta1.QueryVoteRequest) + - [QueryVoteResponse](#cosmos.gov.v1beta1.QueryVoteResponse) + - [QueryVotesRequest](#cosmos.gov.v1beta1.QueryVotesRequest) + - [QueryVotesResponse](#cosmos.gov.v1beta1.QueryVotesResponse) -- [cosmos/crisis/v1beta1/genesis.proto](#cosmos/crisis/v1beta1/genesis.proto) - - [GenesisState](#cosmos.crisis.v1beta1.GenesisState) + - [Query](#cosmos.gov.v1beta1.Query) -- [cosmos/crisis/v1beta1/tx.proto](#cosmos/crisis/v1beta1/tx.proto) - - [MsgVerifyInvariant](#cosmos.crisis.v1beta1.MsgVerifyInvariant) - - [MsgVerifyInvariantResponse](#cosmos.crisis.v1beta1.MsgVerifyInvariantResponse) +- [cosmos/gov/v1beta1/tx.proto](#cosmos/gov/v1beta1/tx.proto) + - [MsgDeposit](#cosmos.gov.v1beta1.MsgDeposit) + - [MsgDepositResponse](#cosmos.gov.v1beta1.MsgDepositResponse) + - [MsgSubmitProposal](#cosmos.gov.v1beta1.MsgSubmitProposal) + - [MsgSubmitProposalResponse](#cosmos.gov.v1beta1.MsgSubmitProposalResponse) + - [MsgVote](#cosmos.gov.v1beta1.MsgVote) + - [MsgVoteResponse](#cosmos.gov.v1beta1.MsgVoteResponse) - - [Msg](#cosmos.crisis.v1beta1.Msg) + - [Msg](#cosmos.gov.v1beta1.Msg) -- [cosmos/crypto/ed25519/keys.proto](#cosmos/crypto/ed25519/keys.proto) - - [PrivKey](#cosmos.crypto.ed25519.PrivKey) - - [PubKey](#cosmos.crypto.ed25519.PubKey) +- [cosmos/gov/v1beta1/genesis.proto](#cosmos/gov/v1beta1/genesis.proto) + - [GenesisState](#cosmos.gov.v1beta1.GenesisState) -- [cosmos/crypto/multisig/keys.proto](#cosmos/crypto/multisig/keys.proto) - - [LegacyAminoPubKey](#cosmos.crypto.multisig.LegacyAminoPubKey) - -- [cosmos/crypto/multisig/v1beta1/multisig.proto](#cosmos/crypto/multisig/v1beta1/multisig.proto) - - [CompactBitArray](#cosmos.crypto.multisig.v1beta1.CompactBitArray) - - [MultiSignature](#cosmos.crypto.multisig.v1beta1.MultiSignature) - -- [cosmos/crypto/secp256k1/keys.proto](#cosmos/crypto/secp256k1/keys.proto) - - [PrivKey](#cosmos.crypto.secp256k1.PrivKey) - - [PubKey](#cosmos.crypto.secp256k1.PubKey) - -- [cosmos/distribution/v1beta1/distribution.proto](#cosmos/distribution/v1beta1/distribution.proto) - - [CommunityPoolSpendProposal](#cosmos.distribution.v1beta1.CommunityPoolSpendProposal) - - [CommunityPoolSpendProposalWithDeposit](#cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit) - - [DelegationDelegatorReward](#cosmos.distribution.v1beta1.DelegationDelegatorReward) - - [DelegatorStartingInfo](#cosmos.distribution.v1beta1.DelegatorStartingInfo) - - [FeePool](#cosmos.distribution.v1beta1.FeePool) - - [Params](#cosmos.distribution.v1beta1.Params) - - [ValidatorAccumulatedCommission](#cosmos.distribution.v1beta1.ValidatorAccumulatedCommission) - - [ValidatorCurrentRewards](#cosmos.distribution.v1beta1.ValidatorCurrentRewards) - - [ValidatorHistoricalRewards](#cosmos.distribution.v1beta1.ValidatorHistoricalRewards) - - [ValidatorOutstandingRewards](#cosmos.distribution.v1beta1.ValidatorOutstandingRewards) - - [ValidatorSlashEvent](#cosmos.distribution.v1beta1.ValidatorSlashEvent) - - [ValidatorSlashEvents](#cosmos.distribution.v1beta1.ValidatorSlashEvents) - -- [cosmos/distribution/v1beta1/genesis.proto](#cosmos/distribution/v1beta1/genesis.proto) - - [DelegatorStartingInfoRecord](#cosmos.distribution.v1beta1.DelegatorStartingInfoRecord) - - [DelegatorWithdrawInfo](#cosmos.distribution.v1beta1.DelegatorWithdrawInfo) - - [GenesisState](#cosmos.distribution.v1beta1.GenesisState) - - [ValidatorAccumulatedCommissionRecord](#cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord) - - [ValidatorCurrentRewardsRecord](#cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord) - - [ValidatorHistoricalRewardsRecord](#cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord) - - [ValidatorOutstandingRewardsRecord](#cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord) - - [ValidatorSlashEventRecord](#cosmos.distribution.v1beta1.ValidatorSlashEventRecord) +- [cosmos/genutil/v1beta1/genesis.proto](#cosmos/genutil/v1beta1/genesis.proto) + - [GenesisState](#cosmos.genutil.v1beta1.GenesisState) - [cosmos/distribution/v1beta1/query.proto](#cosmos/distribution/v1beta1/query.proto) - [QueryCommunityPoolRequest](#cosmos.distribution.v1beta1.QueryCommunityPoolRequest) @@ -244,112 +264,116 @@ - [Msg](#cosmos.distribution.v1beta1.Msg) -- [cosmos/evidence/v1beta1/evidence.proto](#cosmos/evidence/v1beta1/evidence.proto) - - [Equivocation](#cosmos.evidence.v1beta1.Equivocation) +- [cosmos/distribution/v1beta1/genesis.proto](#cosmos/distribution/v1beta1/genesis.proto) + - [DelegatorStartingInfoRecord](#cosmos.distribution.v1beta1.DelegatorStartingInfoRecord) + - [DelegatorWithdrawInfo](#cosmos.distribution.v1beta1.DelegatorWithdrawInfo) + - [GenesisState](#cosmos.distribution.v1beta1.GenesisState) + - [ValidatorAccumulatedCommissionRecord](#cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord) + - [ValidatorCurrentRewardsRecord](#cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord) + - [ValidatorHistoricalRewardsRecord](#cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord) + - [ValidatorOutstandingRewardsRecord](#cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord) + - [ValidatorSlashEventRecord](#cosmos.distribution.v1beta1.ValidatorSlashEventRecord) -- [cosmos/evidence/v1beta1/genesis.proto](#cosmos/evidence/v1beta1/genesis.proto) - - [GenesisState](#cosmos.evidence.v1beta1.GenesisState) +- [cosmos/distribution/v1beta1/distribution.proto](#cosmos/distribution/v1beta1/distribution.proto) + - [CommunityPoolSpendProposal](#cosmos.distribution.v1beta1.CommunityPoolSpendProposal) + - [CommunityPoolSpendProposalWithDeposit](#cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit) + - [DelegationDelegatorReward](#cosmos.distribution.v1beta1.DelegationDelegatorReward) + - [DelegatorStartingInfo](#cosmos.distribution.v1beta1.DelegatorStartingInfo) + - [FeePool](#cosmos.distribution.v1beta1.FeePool) + - [Params](#cosmos.distribution.v1beta1.Params) + - [ValidatorAccumulatedCommission](#cosmos.distribution.v1beta1.ValidatorAccumulatedCommission) + - [ValidatorCurrentRewards](#cosmos.distribution.v1beta1.ValidatorCurrentRewards) + - [ValidatorHistoricalRewards](#cosmos.distribution.v1beta1.ValidatorHistoricalRewards) + - [ValidatorOutstandingRewards](#cosmos.distribution.v1beta1.ValidatorOutstandingRewards) + - [ValidatorSlashEvent](#cosmos.distribution.v1beta1.ValidatorSlashEvent) + - [ValidatorSlashEvents](#cosmos.distribution.v1beta1.ValidatorSlashEvents) -- [cosmos/evidence/v1beta1/query.proto](#cosmos/evidence/v1beta1/query.proto) - - [QueryAllEvidenceRequest](#cosmos.evidence.v1beta1.QueryAllEvidenceRequest) - - [QueryAllEvidenceResponse](#cosmos.evidence.v1beta1.QueryAllEvidenceResponse) - - [QueryEvidenceRequest](#cosmos.evidence.v1beta1.QueryEvidenceRequest) - - [QueryEvidenceResponse](#cosmos.evidence.v1beta1.QueryEvidenceResponse) +- [cosmos/upgrade/v1beta1/query.proto](#cosmos/upgrade/v1beta1/query.proto) + - [QueryAppliedPlanRequest](#cosmos.upgrade.v1beta1.QueryAppliedPlanRequest) + - [QueryAppliedPlanResponse](#cosmos.upgrade.v1beta1.QueryAppliedPlanResponse) + - [QueryCurrentPlanRequest](#cosmos.upgrade.v1beta1.QueryCurrentPlanRequest) + - [QueryCurrentPlanResponse](#cosmos.upgrade.v1beta1.QueryCurrentPlanResponse) + - [QueryUpgradedConsensusStateRequest](#cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest) + - [QueryUpgradedConsensusStateResponse](#cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse) - - [Query](#cosmos.evidence.v1beta1.Query) + - [Query](#cosmos.upgrade.v1beta1.Query) -- [cosmos/evidence/v1beta1/tx.proto](#cosmos/evidence/v1beta1/tx.proto) - - [MsgSubmitEvidence](#cosmos.evidence.v1beta1.MsgSubmitEvidence) - - [MsgSubmitEvidenceResponse](#cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse) +- [cosmos/upgrade/v1beta1/upgrade.proto](#cosmos/upgrade/v1beta1/upgrade.proto) + - [CancelSoftwareUpgradeProposal](#cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal) + - [Plan](#cosmos.upgrade.v1beta1.Plan) + - [SoftwareUpgradeProposal](#cosmos.upgrade.v1beta1.SoftwareUpgradeProposal) - - [Msg](#cosmos.evidence.v1beta1.Msg) +- [cosmos/base/kv/v1beta1/kv.proto](#cosmos/base/kv/v1beta1/kv.proto) + - [Pair](#cosmos.base.kv.v1beta1.Pair) + - [Pairs](#cosmos.base.kv.v1beta1.Pairs) -- [cosmos/genutil/v1beta1/genesis.proto](#cosmos/genutil/v1beta1/genesis.proto) - - [GenesisState](#cosmos.genutil.v1beta1.GenesisState) +- [cosmos/base/abci/v1beta1/abci.proto](#cosmos/base/abci/v1beta1/abci.proto) + - [ABCIMessageLog](#cosmos.base.abci.v1beta1.ABCIMessageLog) + - [Attribute](#cosmos.base.abci.v1beta1.Attribute) + - [GasInfo](#cosmos.base.abci.v1beta1.GasInfo) + - [MsgData](#cosmos.base.abci.v1beta1.MsgData) + - [Result](#cosmos.base.abci.v1beta1.Result) + - [SearchTxsResult](#cosmos.base.abci.v1beta1.SearchTxsResult) + - [SimulationResponse](#cosmos.base.abci.v1beta1.SimulationResponse) + - [StringEvent](#cosmos.base.abci.v1beta1.StringEvent) + - [TxMsgData](#cosmos.base.abci.v1beta1.TxMsgData) + - [TxResponse](#cosmos.base.abci.v1beta1.TxResponse) -- [cosmos/gov/v1beta1/gov.proto](#cosmos/gov/v1beta1/gov.proto) - - [Deposit](#cosmos.gov.v1beta1.Deposit) - - [DepositParams](#cosmos.gov.v1beta1.DepositParams) - - [Proposal](#cosmos.gov.v1beta1.Proposal) - - [TallyParams](#cosmos.gov.v1beta1.TallyParams) - - [TallyResult](#cosmos.gov.v1beta1.TallyResult) - - [TextProposal](#cosmos.gov.v1beta1.TextProposal) - - [Vote](#cosmos.gov.v1beta1.Vote) - - [VotingParams](#cosmos.gov.v1beta1.VotingParams) +- [cosmos/base/query/v1beta1/pagination.proto](#cosmos/base/query/v1beta1/pagination.proto) + - [PageRequest](#cosmos.base.query.v1beta1.PageRequest) + - [PageResponse](#cosmos.base.query.v1beta1.PageResponse) - - [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) - - [VoteOption](#cosmos.gov.v1beta1.VoteOption) +- [cosmos/base/store/v1beta1/snapshot.proto](#cosmos/base/store/v1beta1/snapshot.proto) + - [SnapshotIAVLItem](#cosmos.base.store.v1beta1.SnapshotIAVLItem) + - [SnapshotItem](#cosmos.base.store.v1beta1.SnapshotItem) + - [SnapshotStoreItem](#cosmos.base.store.v1beta1.SnapshotStoreItem) -- [cosmos/gov/v1beta1/genesis.proto](#cosmos/gov/v1beta1/genesis.proto) - - [GenesisState](#cosmos.gov.v1beta1.GenesisState) +- [cosmos/base/store/v1beta1/commit_info.proto](#cosmos/base/store/v1beta1/commit_info.proto) + - [CommitID](#cosmos.base.store.v1beta1.CommitID) + - [CommitInfo](#cosmos.base.store.v1beta1.CommitInfo) + - [StoreInfo](#cosmos.base.store.v1beta1.StoreInfo) -- [cosmos/gov/v1beta1/query.proto](#cosmos/gov/v1beta1/query.proto) - - [QueryDepositRequest](#cosmos.gov.v1beta1.QueryDepositRequest) - - [QueryDepositResponse](#cosmos.gov.v1beta1.QueryDepositResponse) - - [QueryDepositsRequest](#cosmos.gov.v1beta1.QueryDepositsRequest) - - [QueryDepositsResponse](#cosmos.gov.v1beta1.QueryDepositsResponse) - - [QueryParamsRequest](#cosmos.gov.v1beta1.QueryParamsRequest) - - [QueryParamsResponse](#cosmos.gov.v1beta1.QueryParamsResponse) - - [QueryProposalRequest](#cosmos.gov.v1beta1.QueryProposalRequest) - - [QueryProposalResponse](#cosmos.gov.v1beta1.QueryProposalResponse) - - [QueryProposalsRequest](#cosmos.gov.v1beta1.QueryProposalsRequest) - - [QueryProposalsResponse](#cosmos.gov.v1beta1.QueryProposalsResponse) - - [QueryTallyResultRequest](#cosmos.gov.v1beta1.QueryTallyResultRequest) - - [QueryTallyResultResponse](#cosmos.gov.v1beta1.QueryTallyResultResponse) - - [QueryVoteRequest](#cosmos.gov.v1beta1.QueryVoteRequest) - - [QueryVoteResponse](#cosmos.gov.v1beta1.QueryVoteResponse) - - [QueryVotesRequest](#cosmos.gov.v1beta1.QueryVotesRequest) - - [QueryVotesResponse](#cosmos.gov.v1beta1.QueryVotesResponse) +- [cosmos/base/v1beta1/coin.proto](#cosmos/base/v1beta1/coin.proto) + - [Coin](#cosmos.base.v1beta1.Coin) + - [DecCoin](#cosmos.base.v1beta1.DecCoin) + - [DecProto](#cosmos.base.v1beta1.DecProto) + - [IntProto](#cosmos.base.v1beta1.IntProto) - - [Query](#cosmos.gov.v1beta1.Query) +- [cosmos/base/tendermint/v1beta1/query.proto](#cosmos/base/tendermint/v1beta1/query.proto) + - [GetBlockByHeightRequest](#cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest) + - [GetBlockByHeightResponse](#cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse) + - [GetLatestBlockRequest](#cosmos.base.tendermint.v1beta1.GetLatestBlockRequest) + - [GetLatestBlockResponse](#cosmos.base.tendermint.v1beta1.GetLatestBlockResponse) + - [GetLatestValidatorSetRequest](#cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest) + - [GetLatestValidatorSetResponse](#cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse) + - [GetNodeInfoRequest](#cosmos.base.tendermint.v1beta1.GetNodeInfoRequest) + - [GetNodeInfoResponse](#cosmos.base.tendermint.v1beta1.GetNodeInfoResponse) + - [GetSyncingRequest](#cosmos.base.tendermint.v1beta1.GetSyncingRequest) + - [GetSyncingResponse](#cosmos.base.tendermint.v1beta1.GetSyncingResponse) + - [GetValidatorSetByHeightRequest](#cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest) + - [GetValidatorSetByHeightResponse](#cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse) + - [Module](#cosmos.base.tendermint.v1beta1.Module) + - [Validator](#cosmos.base.tendermint.v1beta1.Validator) + - [VersionInfo](#cosmos.base.tendermint.v1beta1.VersionInfo) -- [cosmos/gov/v1beta1/tx.proto](#cosmos/gov/v1beta1/tx.proto) - - [MsgDeposit](#cosmos.gov.v1beta1.MsgDeposit) - - [MsgDepositResponse](#cosmos.gov.v1beta1.MsgDepositResponse) - - [MsgSubmitProposal](#cosmos.gov.v1beta1.MsgSubmitProposal) - - [MsgSubmitProposalResponse](#cosmos.gov.v1beta1.MsgSubmitProposalResponse) - - [MsgVote](#cosmos.gov.v1beta1.MsgVote) - - [MsgVoteResponse](#cosmos.gov.v1beta1.MsgVoteResponse) + - [Service](#cosmos.base.tendermint.v1beta1.Service) - - [Msg](#cosmos.gov.v1beta1.Msg) +- [cosmos/base/snapshots/v1beta1/snapshot.proto](#cosmos/base/snapshots/v1beta1/snapshot.proto) + - [Metadata](#cosmos.base.snapshots.v1beta1.Metadata) + - [Snapshot](#cosmos.base.snapshots.v1beta1.Snapshot) -- [cosmos/mint/v1beta1/mint.proto](#cosmos/mint/v1beta1/mint.proto) - - [Minter](#cosmos.mint.v1beta1.Minter) - - [Params](#cosmos.mint.v1beta1.Params) +- [cosmos/base/reflection/v1beta1/reflection.proto](#cosmos/base/reflection/v1beta1/reflection.proto) + - [ListAllInterfacesRequest](#cosmos.base.reflection.v1beta1.ListAllInterfacesRequest) + - [ListAllInterfacesResponse](#cosmos.base.reflection.v1beta1.ListAllInterfacesResponse) + - [ListImplementationsRequest](#cosmos.base.reflection.v1beta1.ListImplementationsRequest) + - [ListImplementationsResponse](#cosmos.base.reflection.v1beta1.ListImplementationsResponse) -- [cosmos/mint/v1beta1/genesis.proto](#cosmos/mint/v1beta1/genesis.proto) - - [GenesisState](#cosmos.mint.v1beta1.GenesisState) - -- [cosmos/mint/v1beta1/query.proto](#cosmos/mint/v1beta1/query.proto) - - [QueryAnnualProvisionsRequest](#cosmos.mint.v1beta1.QueryAnnualProvisionsRequest) - - [QueryAnnualProvisionsResponse](#cosmos.mint.v1beta1.QueryAnnualProvisionsResponse) - - [QueryInflationRequest](#cosmos.mint.v1beta1.QueryInflationRequest) - - [QueryInflationResponse](#cosmos.mint.v1beta1.QueryInflationResponse) - - [QueryParamsRequest](#cosmos.mint.v1beta1.QueryParamsRequest) - - [QueryParamsResponse](#cosmos.mint.v1beta1.QueryParamsResponse) - - - [Query](#cosmos.mint.v1beta1.Query) - -- [cosmos/params/v1beta1/params.proto](#cosmos/params/v1beta1/params.proto) - - [ParamChange](#cosmos.params.v1beta1.ParamChange) - - [ParameterChangeProposal](#cosmos.params.v1beta1.ParameterChangeProposal) - -- [cosmos/params/v1beta1/query.proto](#cosmos/params/v1beta1/query.proto) - - [QueryParamsRequest](#cosmos.params.v1beta1.QueryParamsRequest) - - [QueryParamsResponse](#cosmos.params.v1beta1.QueryParamsResponse) - - - [Query](#cosmos.params.v1beta1.Query) + - [ReflectionService](#cosmos.base.reflection.v1beta1.ReflectionService) - [cosmos/slashing/v1beta1/slashing.proto](#cosmos/slashing/v1beta1/slashing.proto) - [Params](#cosmos.slashing.v1beta1.Params) - [ValidatorSigningInfo](#cosmos.slashing.v1beta1.ValidatorSigningInfo) -- [cosmos/slashing/v1beta1/genesis.proto](#cosmos/slashing/v1beta1/genesis.proto) - - [GenesisState](#cosmos.slashing.v1beta1.GenesisState) - - [MissedBlock](#cosmos.slashing.v1beta1.MissedBlock) - - [SigningInfo](#cosmos.slashing.v1beta1.SigningInfo) - - [ValidatorMissedBlocks](#cosmos.slashing.v1beta1.ValidatorMissedBlocks) - - [cosmos/slashing/v1beta1/query.proto](#cosmos/slashing/v1beta1/query.proto) - [QueryParamsRequest](#cosmos.slashing.v1beta1.QueryParamsRequest) - [QueryParamsResponse](#cosmos.slashing.v1beta1.QueryParamsResponse) @@ -366,33 +390,47 @@ - [Msg](#cosmos.slashing.v1beta1.Msg) -- [cosmos/staking/v1beta1/staking.proto](#cosmos/staking/v1beta1/staking.proto) - - [Commission](#cosmos.staking.v1beta1.Commission) - - [CommissionRates](#cosmos.staking.v1beta1.CommissionRates) - - [DVPair](#cosmos.staking.v1beta1.DVPair) - - [DVPairs](#cosmos.staking.v1beta1.DVPairs) - - [DVVTriplet](#cosmos.staking.v1beta1.DVVTriplet) - - [DVVTriplets](#cosmos.staking.v1beta1.DVVTriplets) - - [Delegation](#cosmos.staking.v1beta1.Delegation) - - [DelegationResponse](#cosmos.staking.v1beta1.DelegationResponse) - - [Description](#cosmos.staking.v1beta1.Description) - - [HistoricalInfo](#cosmos.staking.v1beta1.HistoricalInfo) - - [Params](#cosmos.staking.v1beta1.Params) - - [Pool](#cosmos.staking.v1beta1.Pool) - - [Redelegation](#cosmos.staking.v1beta1.Redelegation) - - [RedelegationEntry](#cosmos.staking.v1beta1.RedelegationEntry) - - [RedelegationEntryResponse](#cosmos.staking.v1beta1.RedelegationEntryResponse) - - [RedelegationResponse](#cosmos.staking.v1beta1.RedelegationResponse) - - [UnbondingDelegation](#cosmos.staking.v1beta1.UnbondingDelegation) - - [UnbondingDelegationEntry](#cosmos.staking.v1beta1.UnbondingDelegationEntry) - - [ValAddresses](#cosmos.staking.v1beta1.ValAddresses) - - [Validator](#cosmos.staking.v1beta1.Validator) +- [cosmos/slashing/v1beta1/genesis.proto](#cosmos/slashing/v1beta1/genesis.proto) + - [GenesisState](#cosmos.slashing.v1beta1.GenesisState) + - [MissedBlock](#cosmos.slashing.v1beta1.MissedBlock) + - [SigningInfo](#cosmos.slashing.v1beta1.SigningInfo) + - [ValidatorMissedBlocks](#cosmos.slashing.v1beta1.ValidatorMissedBlocks) - - [BondStatus](#cosmos.staking.v1beta1.BondStatus) +- [cosmos/evidence/v1beta1/evidence.proto](#cosmos/evidence/v1beta1/evidence.proto) + - [Equivocation](#cosmos.evidence.v1beta1.Equivocation) -- [cosmos/staking/v1beta1/genesis.proto](#cosmos/staking/v1beta1/genesis.proto) - - [GenesisState](#cosmos.staking.v1beta1.GenesisState) - - [LastValidatorPower](#cosmos.staking.v1beta1.LastValidatorPower) +- [cosmos/evidence/v1beta1/query.proto](#cosmos/evidence/v1beta1/query.proto) + - [QueryAllEvidenceRequest](#cosmos.evidence.v1beta1.QueryAllEvidenceRequest) + - [QueryAllEvidenceResponse](#cosmos.evidence.v1beta1.QueryAllEvidenceResponse) + - [QueryEvidenceRequest](#cosmos.evidence.v1beta1.QueryEvidenceRequest) + - [QueryEvidenceResponse](#cosmos.evidence.v1beta1.QueryEvidenceResponse) + + - [Query](#cosmos.evidence.v1beta1.Query) + +- [cosmos/evidence/v1beta1/tx.proto](#cosmos/evidence/v1beta1/tx.proto) + - [MsgSubmitEvidence](#cosmos.evidence.v1beta1.MsgSubmitEvidence) + - [MsgSubmitEvidenceResponse](#cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse) + + - [Msg](#cosmos.evidence.v1beta1.Msg) + +- [cosmos/evidence/v1beta1/genesis.proto](#cosmos/evidence/v1beta1/genesis.proto) + - [GenesisState](#cosmos.evidence.v1beta1.GenesisState) + +- [cosmos/auth/v1beta1/auth.proto](#cosmos/auth/v1beta1/auth.proto) + - [BaseAccount](#cosmos.auth.v1beta1.BaseAccount) + - [ModuleAccount](#cosmos.auth.v1beta1.ModuleAccount) + - [Params](#cosmos.auth.v1beta1.Params) + +- [cosmos/auth/v1beta1/query.proto](#cosmos/auth/v1beta1/query.proto) + - [QueryAccountRequest](#cosmos.auth.v1beta1.QueryAccountRequest) + - [QueryAccountResponse](#cosmos.auth.v1beta1.QueryAccountResponse) + - [QueryParamsRequest](#cosmos.auth.v1beta1.QueryParamsRequest) + - [QueryParamsResponse](#cosmos.auth.v1beta1.QueryParamsResponse) + + - [Query](#cosmos.auth.v1beta1.Query) + +- [cosmos/auth/v1beta1/genesis.proto](#cosmos/auth/v1beta1/genesis.proto) + - [GenesisState](#cosmos.auth.v1beta1.GenesisState) - [cosmos/staking/v1beta1/query.proto](#cosmos/staking/v1beta1/query.proto) - [QueryDelegationRequest](#cosmos.staking.v1beta1.QueryDelegationRequest) @@ -440,55 +478,33 @@ - [Msg](#cosmos.staking.v1beta1.Msg) -- [cosmos/tx/signing/v1beta1/signing.proto](#cosmos/tx/signing/v1beta1/signing.proto) - - [SignatureDescriptor](#cosmos.tx.signing.v1beta1.SignatureDescriptor) - - [SignatureDescriptor.Data](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data) - - [SignatureDescriptor.Data.Multi](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi) - - [SignatureDescriptor.Data.Single](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single) - - [SignatureDescriptors](#cosmos.tx.signing.v1beta1.SignatureDescriptors) +- [cosmos/staking/v1beta1/genesis.proto](#cosmos/staking/v1beta1/genesis.proto) + - [GenesisState](#cosmos.staking.v1beta1.GenesisState) + - [LastValidatorPower](#cosmos.staking.v1beta1.LastValidatorPower) - - [SignMode](#cosmos.tx.signing.v1beta1.SignMode) +- [cosmos/staking/v1beta1/staking.proto](#cosmos/staking/v1beta1/staking.proto) + - [Commission](#cosmos.staking.v1beta1.Commission) + - [CommissionRates](#cosmos.staking.v1beta1.CommissionRates) + - [DVPair](#cosmos.staking.v1beta1.DVPair) + - [DVPairs](#cosmos.staking.v1beta1.DVPairs) + - [DVVTriplet](#cosmos.staking.v1beta1.DVVTriplet) + - [DVVTriplets](#cosmos.staking.v1beta1.DVVTriplets) + - [Delegation](#cosmos.staking.v1beta1.Delegation) + - [DelegationResponse](#cosmos.staking.v1beta1.DelegationResponse) + - [Description](#cosmos.staking.v1beta1.Description) + - [HistoricalInfo](#cosmos.staking.v1beta1.HistoricalInfo) + - [Params](#cosmos.staking.v1beta1.Params) + - [Pool](#cosmos.staking.v1beta1.Pool) + - [Redelegation](#cosmos.staking.v1beta1.Redelegation) + - [RedelegationEntry](#cosmos.staking.v1beta1.RedelegationEntry) + - [RedelegationEntryResponse](#cosmos.staking.v1beta1.RedelegationEntryResponse) + - [RedelegationResponse](#cosmos.staking.v1beta1.RedelegationResponse) + - [UnbondingDelegation](#cosmos.staking.v1beta1.UnbondingDelegation) + - [UnbondingDelegationEntry](#cosmos.staking.v1beta1.UnbondingDelegationEntry) + - [ValAddresses](#cosmos.staking.v1beta1.ValAddresses) + - [Validator](#cosmos.staking.v1beta1.Validator) -- [cosmos/tx/v1beta1/tx.proto](#cosmos/tx/v1beta1/tx.proto) - - [AuthInfo](#cosmos.tx.v1beta1.AuthInfo) - - [Fee](#cosmos.tx.v1beta1.Fee) - - [ModeInfo](#cosmos.tx.v1beta1.ModeInfo) - - [ModeInfo.Multi](#cosmos.tx.v1beta1.ModeInfo.Multi) - - [ModeInfo.Single](#cosmos.tx.v1beta1.ModeInfo.Single) - - [SignDoc](#cosmos.tx.v1beta1.SignDoc) - - [SignerInfo](#cosmos.tx.v1beta1.SignerInfo) - - [Tx](#cosmos.tx.v1beta1.Tx) - - [TxBody](#cosmos.tx.v1beta1.TxBody) - - [TxRaw](#cosmos.tx.v1beta1.TxRaw) - -- [cosmos/tx/v1beta1/service.proto](#cosmos/tx/v1beta1/service.proto) - - [BroadcastTxRequest](#cosmos.tx.v1beta1.BroadcastTxRequest) - - [BroadcastTxResponse](#cosmos.tx.v1beta1.BroadcastTxResponse) - - [GetTxRequest](#cosmos.tx.v1beta1.GetTxRequest) - - [GetTxResponse](#cosmos.tx.v1beta1.GetTxResponse) - - [GetTxsEventRequest](#cosmos.tx.v1beta1.GetTxsEventRequest) - - [GetTxsEventResponse](#cosmos.tx.v1beta1.GetTxsEventResponse) - - [SimulateRequest](#cosmos.tx.v1beta1.SimulateRequest) - - [SimulateResponse](#cosmos.tx.v1beta1.SimulateResponse) - - - [BroadcastMode](#cosmos.tx.v1beta1.BroadcastMode) - - - [Service](#cosmos.tx.v1beta1.Service) - -- [cosmos/upgrade/v1beta1/upgrade.proto](#cosmos/upgrade/v1beta1/upgrade.proto) - - [CancelSoftwareUpgradeProposal](#cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal) - - [Plan](#cosmos.upgrade.v1beta1.Plan) - - [SoftwareUpgradeProposal](#cosmos.upgrade.v1beta1.SoftwareUpgradeProposal) - -- [cosmos/upgrade/v1beta1/query.proto](#cosmos/upgrade/v1beta1/query.proto) - - [QueryAppliedPlanRequest](#cosmos.upgrade.v1beta1.QueryAppliedPlanRequest) - - [QueryAppliedPlanResponse](#cosmos.upgrade.v1beta1.QueryAppliedPlanResponse) - - [QueryCurrentPlanRequest](#cosmos.upgrade.v1beta1.QueryCurrentPlanRequest) - - [QueryCurrentPlanResponse](#cosmos.upgrade.v1beta1.QueryCurrentPlanResponse) - - [QueryUpgradedConsensusStateRequest](#cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest) - - [QueryUpgradedConsensusStateResponse](#cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse) - - - [Query](#cosmos.upgrade.v1beta1.Query) + - [BondStatus](#cosmos.staking.v1beta1.BondStatus) - [cosmos/vesting/v1beta1/tx.proto](#cosmos/vesting/v1beta1/tx.proto) - [MsgCreateVestingAccount](#cosmos.vesting.v1beta1.MsgCreateVestingAccount) @@ -503,13 +519,15 @@ - [Period](#cosmos.vesting.v1beta1.Period) - [PeriodicVestingAccount](#cosmos.vesting.v1beta1.PeriodicVestingAccount) -- [ibc/applications/transfer/v1/transfer.proto](#ibc/applications/transfer/v1/transfer.proto) - - [DenomTrace](#ibc.applications.transfer.v1.DenomTrace) - - [FungibleTokenPacketData](#ibc.applications.transfer.v1.FungibleTokenPacketData) - - [Params](#ibc.applications.transfer.v1.Params) +- [cosmos/params/v1beta1/query.proto](#cosmos/params/v1beta1/query.proto) + - [QueryParamsRequest](#cosmos.params.v1beta1.QueryParamsRequest) + - [QueryParamsResponse](#cosmos.params.v1beta1.QueryParamsResponse) -- [ibc/applications/transfer/v1/genesis.proto](#ibc/applications/transfer/v1/genesis.proto) - - [GenesisState](#ibc.applications.transfer.v1.GenesisState) + - [Query](#cosmos.params.v1beta1.Query) + +- [cosmos/params/v1beta1/params.proto](#cosmos/params/v1beta1/params.proto) + - [ParamChange](#cosmos.params.v1beta1.ParamChange) + - [ParameterChangeProposal](#cosmos.params.v1beta1.ParameterChangeProposal) - [ibc/applications/transfer/v1/query.proto](#ibc/applications/transfer/v1/query.proto) - [QueryDenomTraceRequest](#ibc.applications.transfer.v1.QueryDenomTraceRequest) @@ -521,6 +539,20 @@ - [Query](#ibc.applications.transfer.v1.Query) +- [ibc/applications/transfer/v1/tx.proto](#ibc/applications/transfer/v1/tx.proto) + - [MsgTransfer](#ibc.applications.transfer.v1.MsgTransfer) + - [MsgTransferResponse](#ibc.applications.transfer.v1.MsgTransferResponse) + + - [Msg](#ibc.applications.transfer.v1.Msg) + +- [ibc/applications/transfer/v1/transfer.proto](#ibc/applications/transfer/v1/transfer.proto) + - [DenomTrace](#ibc.applications.transfer.v1.DenomTrace) + - [FungibleTokenPacketData](#ibc.applications.transfer.v1.FungibleTokenPacketData) + - [Params](#ibc.applications.transfer.v1.Params) + +- [ibc/applications/transfer/v1/genesis.proto](#ibc/applications/transfer/v1/genesis.proto) + - [GenesisState](#ibc.applications.transfer.v1.GenesisState) + - [ibc/core/client/v1/client.proto](#ibc/core/client/v1/client.proto) - [ClientConsensusStates](#ibc.core.client.v1.ClientConsensusStates) - [ClientUpdateProposal](#ibc.core.client.v1.ClientUpdateProposal) @@ -529,11 +561,36 @@ - [IdentifiedClientState](#ibc.core.client.v1.IdentifiedClientState) - [Params](#ibc.core.client.v1.Params) -- [ibc/applications/transfer/v1/tx.proto](#ibc/applications/transfer/v1/tx.proto) - - [MsgTransfer](#ibc.applications.transfer.v1.MsgTransfer) - - [MsgTransferResponse](#ibc.applications.transfer.v1.MsgTransferResponse) +- [ibc/core/client/v1/query.proto](#ibc/core/client/v1/query.proto) + - [QueryClientParamsRequest](#ibc.core.client.v1.QueryClientParamsRequest) + - [QueryClientParamsResponse](#ibc.core.client.v1.QueryClientParamsResponse) + - [QueryClientStateRequest](#ibc.core.client.v1.QueryClientStateRequest) + - [QueryClientStateResponse](#ibc.core.client.v1.QueryClientStateResponse) + - [QueryClientStatesRequest](#ibc.core.client.v1.QueryClientStatesRequest) + - [QueryClientStatesResponse](#ibc.core.client.v1.QueryClientStatesResponse) + - [QueryConsensusStateRequest](#ibc.core.client.v1.QueryConsensusStateRequest) + - [QueryConsensusStateResponse](#ibc.core.client.v1.QueryConsensusStateResponse) + - [QueryConsensusStatesRequest](#ibc.core.client.v1.QueryConsensusStatesRequest) + - [QueryConsensusStatesResponse](#ibc.core.client.v1.QueryConsensusStatesResponse) - - [Msg](#ibc.applications.transfer.v1.Msg) + - [Query](#ibc.core.client.v1.Query) + +- [ibc/core/client/v1/tx.proto](#ibc/core/client/v1/tx.proto) + - [MsgCreateClient](#ibc.core.client.v1.MsgCreateClient) + - [MsgCreateClientResponse](#ibc.core.client.v1.MsgCreateClientResponse) + - [MsgSubmitMisbehaviour](#ibc.core.client.v1.MsgSubmitMisbehaviour) + - [MsgSubmitMisbehaviourResponse](#ibc.core.client.v1.MsgSubmitMisbehaviourResponse) + - [MsgUpdateClient](#ibc.core.client.v1.MsgUpdateClient) + - [MsgUpdateClientResponse](#ibc.core.client.v1.MsgUpdateClientResponse) + - [MsgUpgradeClient](#ibc.core.client.v1.MsgUpgradeClient) + - [MsgUpgradeClientResponse](#ibc.core.client.v1.MsgUpgradeClientResponse) + + - [Msg](#ibc.core.client.v1.Msg) + +- [ibc/core/client/v1/genesis.proto](#ibc/core/client/v1/genesis.proto) + - [GenesisMetadata](#ibc.core.client.v1.GenesisMetadata) + - [GenesisState](#ibc.core.client.v1.GenesisState) + - [IdentifiedGenesisMetadata](#ibc.core.client.v1.IdentifiedGenesisMetadata) - [ibc/core/channel/v1/channel.proto](#ibc/core/channel/v1/channel.proto) - [Acknowledgement](#ibc.core.channel.v1.Acknowledgement) @@ -546,10 +603,6 @@ - [Order](#ibc.core.channel.v1.Order) - [State](#ibc.core.channel.v1.State) -- [ibc/core/channel/v1/genesis.proto](#ibc/core/channel/v1/genesis.proto) - - [GenesisState](#ibc.core.channel.v1.GenesisState) - - [PacketSequence](#ibc.core.channel.v1.PacketSequence) - - [ibc/core/channel/v1/query.proto](#ibc/core/channel/v1/query.proto) - [QueryChannelClientStateRequest](#ibc.core.channel.v1.QueryChannelClientStateRequest) - [QueryChannelClientStateResponse](#ibc.core.channel.v1.QueryChannelClientStateResponse) @@ -604,36 +657,9 @@ - [Msg](#ibc.core.channel.v1.Msg) -- [ibc/core/client/v1/genesis.proto](#ibc/core/client/v1/genesis.proto) - - [GenesisMetadata](#ibc.core.client.v1.GenesisMetadata) - - [GenesisState](#ibc.core.client.v1.GenesisState) - - [IdentifiedGenesisMetadata](#ibc.core.client.v1.IdentifiedGenesisMetadata) - -- [ibc/core/client/v1/query.proto](#ibc/core/client/v1/query.proto) - - [QueryClientParamsRequest](#ibc.core.client.v1.QueryClientParamsRequest) - - [QueryClientParamsResponse](#ibc.core.client.v1.QueryClientParamsResponse) - - [QueryClientStateRequest](#ibc.core.client.v1.QueryClientStateRequest) - - [QueryClientStateResponse](#ibc.core.client.v1.QueryClientStateResponse) - - [QueryClientStatesRequest](#ibc.core.client.v1.QueryClientStatesRequest) - - [QueryClientStatesResponse](#ibc.core.client.v1.QueryClientStatesResponse) - - [QueryConsensusStateRequest](#ibc.core.client.v1.QueryConsensusStateRequest) - - [QueryConsensusStateResponse](#ibc.core.client.v1.QueryConsensusStateResponse) - - [QueryConsensusStatesRequest](#ibc.core.client.v1.QueryConsensusStatesRequest) - - [QueryConsensusStatesResponse](#ibc.core.client.v1.QueryConsensusStatesResponse) - - - [Query](#ibc.core.client.v1.Query) - -- [ibc/core/client/v1/tx.proto](#ibc/core/client/v1/tx.proto) - - [MsgCreateClient](#ibc.core.client.v1.MsgCreateClient) - - [MsgCreateClientResponse](#ibc.core.client.v1.MsgCreateClientResponse) - - [MsgSubmitMisbehaviour](#ibc.core.client.v1.MsgSubmitMisbehaviour) - - [MsgSubmitMisbehaviourResponse](#ibc.core.client.v1.MsgSubmitMisbehaviourResponse) - - [MsgUpdateClient](#ibc.core.client.v1.MsgUpdateClient) - - [MsgUpdateClientResponse](#ibc.core.client.v1.MsgUpdateClientResponse) - - [MsgUpgradeClient](#ibc.core.client.v1.MsgUpgradeClient) - - [MsgUpgradeClientResponse](#ibc.core.client.v1.MsgUpgradeClientResponse) - - - [Msg](#ibc.core.client.v1.Msg) +- [ibc/core/channel/v1/genesis.proto](#ibc/core/channel/v1/genesis.proto) + - [GenesisState](#ibc.core.channel.v1.GenesisState) + - [PacketSequence](#ibc.core.channel.v1.PacketSequence) - [ibc/core/commitment/v1/commitment.proto](#ibc/core/commitment/v1/commitment.proto) - [MerklePath](#ibc.core.commitment.v1.MerklePath) @@ -651,9 +677,6 @@ - [State](#ibc.core.connection.v1.State) -- [ibc/core/connection/v1/genesis.proto](#ibc/core/connection/v1/genesis.proto) - - [GenesisState](#ibc.core.connection.v1.GenesisState) - - [ibc/core/connection/v1/query.proto](#ibc/core/connection/v1/query.proto) - [QueryClientConnectionsRequest](#ibc.core.connection.v1.QueryClientConnectionsRequest) - [QueryClientConnectionsResponse](#ibc.core.connection.v1.QueryClientConnectionsResponse) @@ -680,12 +703,22 @@ - [Msg](#ibc.core.connection.v1.Msg) +- [ibc/core/connection/v1/genesis.proto](#ibc/core/connection/v1/genesis.proto) + - [GenesisState](#ibc.core.connection.v1.GenesisState) + - [ibc/core/types/v1/genesis.proto](#ibc/core/types/v1/genesis.proto) - [GenesisState](#ibc.core.types.v1.GenesisState) - [ibc/lightclients/localhost/v1/localhost.proto](#ibc/lightclients/localhost/v1/localhost.proto) - [ClientState](#ibc.lightclients.localhost.v1.ClientState) +- [ibc/lightclients/tendermint/v1/tendermint.proto](#ibc/lightclients/tendermint/v1/tendermint.proto) + - [ClientState](#ibc.lightclients.tendermint.v1.ClientState) + - [ConsensusState](#ibc.lightclients.tendermint.v1.ConsensusState) + - [Fraction](#ibc.lightclients.tendermint.v1.Fraction) + - [Header](#ibc.lightclients.tendermint.v1.Header) + - [Misbehaviour](#ibc.lightclients.tendermint.v1.Misbehaviour) + - [ibc/lightclients/solomachine/v1/solomachine.proto](#ibc/lightclients/solomachine/v1/solomachine.proto) - [ChannelStateData](#ibc.lightclients.solomachine.v1.ChannelStateData) - [ClientState](#ibc.lightclients.solomachine.v1.ClientState) @@ -706,74 +739,190 @@ - [DataType](#ibc.lightclients.solomachine.v1.DataType) -- [ibc/lightclients/tendermint/v1/tendermint.proto](#ibc/lightclients/tendermint/v1/tendermint.proto) - - [ClientState](#ibc.lightclients.tendermint.v1.ClientState) - - [ConsensusState](#ibc.lightclients.tendermint.v1.ConsensusState) - - [Fraction](#ibc.lightclients.tendermint.v1.Fraction) - - [Header](#ibc.lightclients.tendermint.v1.Header) - - [Misbehaviour](#ibc.lightclients.tendermint.v1.Misbehaviour) - - [Scalar Value Types](#scalar-value-types) - +

Top

-## cosmos/auth/v1beta1/auth.proto +## cosmos/tx/v1beta1/tx.proto - + -### BaseAccount -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). +### AuthInfo +AuthInfo describes the fee and signer modes that are used to sign a +transaction. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | | -| `pub_key` | [google.protobuf.Any](#google.protobuf.Any) | | | -| `account_number` | [uint64](#uint64) | | | -| `sequence` | [uint64](#uint64) | | | +| `signer_infos` | [SignerInfo](#cosmos.tx.v1beta1.SignerInfo) | repeated | 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. | +| `fee` | [Fee](#cosmos.tx.v1beta1.Fee) | | 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. | - + -### ModuleAccount -ModuleAccount defines an account for modules that holds coins on a pool. +### Fee +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. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `base_account` | [BaseAccount](#cosmos.auth.v1beta1.BaseAccount) | | | -| `name` | [string](#string) | | | -| `permissions` | [string](#string) | repeated | | +| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | amount is the amount of coins to be paid as a fee | +| `gas_limit` | [uint64](#uint64) | | gas_limit is the maximum gas that can be used in transaction processing before an out of gas error occurs | +| `payer` | [string](#string) | | 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. | +| `granter` | [string](#string) | | 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 | - + -### Params -Params defines the parameters for the auth module. +### ModeInfo +ModeInfo describes the signing mode of a single or nested multisig signer. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `max_memo_characters` | [uint64](#uint64) | | | -| `tx_sig_limit` | [uint64](#uint64) | | | -| `tx_size_cost_per_byte` | [uint64](#uint64) | | | -| `sig_verify_cost_ed25519` | [uint64](#uint64) | | | -| `sig_verify_cost_secp256k1` | [uint64](#uint64) | | | +| `single` | [ModeInfo.Single](#cosmos.tx.v1beta1.ModeInfo.Single) | | single represents a single signer | +| `multi` | [ModeInfo.Multi](#cosmos.tx.v1beta1.ModeInfo.Multi) | | multi represents a nested multisig signer | + + + + + + + + +### ModeInfo.Multi +Multi is the mode info for a multisig public key + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `bitarray` | [cosmos.crypto.multisig.v1beta1.CompactBitArray](#cosmos.crypto.multisig.v1beta1.CompactBitArray) | | bitarray specifies which keys within the multisig are signing | +| `mode_infos` | [ModeInfo](#cosmos.tx.v1beta1.ModeInfo) | repeated | mode_infos is the corresponding modes of the signers of the multisig which could include nested multisig public keys | + + + + + + + + +### ModeInfo.Single +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 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `mode` | [cosmos.tx.signing.v1beta1.SignMode](#cosmos.tx.signing.v1beta1.SignMode) | | mode is the signing mode of the single signer | + + + + + + + + +### SignDoc +SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `body_bytes` | [bytes](#bytes) | | body_bytes is protobuf serialization of a TxBody that matches the representation in TxRaw. | +| `auth_info_bytes` | [bytes](#bytes) | | auth_info_bytes is a protobuf serialization of an AuthInfo that matches the representation in TxRaw. | +| `chain_id` | [string](#string) | | 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 | +| `account_number` | [uint64](#uint64) | | account_number is the account number of the account in state | + + + + + + + + +### SignerInfo +SignerInfo describes the public key and signing mode of a single top-level +signer. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `public_key` | [google.protobuf.Any](#google.protobuf.Any) | | 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. | +| `mode_info` | [ModeInfo](#cosmos.tx.v1beta1.ModeInfo) | | mode_info describes the signing mode of the signer and is a nested structure to support nested multisig pubkey's | +| `sequence` | [uint64](#uint64) | | 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. | + + + + + + + + +### Tx +Tx is the standard type used for broadcasting transactions. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `body` | [TxBody](#cosmos.tx.v1beta1.TxBody) | | body is the processable content of the transaction | +| `auth_info` | [AuthInfo](#cosmos.tx.v1beta1.AuthInfo) | | auth_info is the authorization related content of the transaction, specifically signers, signer modes and fee | +| `signatures` | [bytes](#bytes) | repeated | 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. | + + + + + + + + +### TxBody +TxBody is the body of a transaction that all signers sign over. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | 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. | +| `memo` | [string](#string) | | memo is any arbitrary memo to be added to the transaction | +| `timeout_height` | [uint64](#uint64) | | timeout is the block height after which this transaction will not be processed by the chain | +| `extension_options` | [google.protobuf.Any](#google.protobuf.Any) | repeated | 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 | +| `non_critical_extension_options` | [google.protobuf.Any](#google.protobuf.Any) | repeated | 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 | + + + + + + + + +### TxRaw +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `body_bytes` | [bytes](#bytes) | | body_bytes is a protobuf serialization of a TxBody that matches the representation in SignDoc. | +| `auth_info_bytes` | [bytes](#bytes) | | auth_info_bytes is a protobuf serialization of an AuthInfo that matches the representation in SignDoc. | +| `signatures` | [bytes](#bytes) | repeated | 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. | @@ -789,23 +938,364 @@ Params defines the parameters for the auth module. - +

Top

-## cosmos/auth/v1beta1/genesis.proto +## cosmos/tx/v1beta1/service.proto - + + +### BroadcastTxRequest +BroadcastTxRequest is the request type for the Service.BroadcastTxRequest +RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `tx_bytes` | [bytes](#bytes) | | tx_bytes is the raw transaction. | +| `mode` | [BroadcastMode](#cosmos.tx.v1beta1.BroadcastMode) | | | + + + + + + + + +### BroadcastTxResponse +BroadcastTxResponse is the response type for the +Service.BroadcastTx method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `tx_response` | [cosmos.base.abci.v1beta1.TxResponse](#cosmos.base.abci.v1beta1.TxResponse) | | tx_response is the queried TxResponses. | + + + + + + + + +### GetTxRequest +GetTxRequest is the request type for the Service.GetTx +RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `hash` | [string](#string) | | hash is the tx hash to query, encoded as a hex string. | + + + + + + + + +### GetTxResponse +GetTxResponse is the response type for the Service.GetTx method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `tx` | [Tx](#cosmos.tx.v1beta1.Tx) | | tx is the queried transaction. | +| `tx_response` | [cosmos.base.abci.v1beta1.TxResponse](#cosmos.base.abci.v1beta1.TxResponse) | | tx_response is the queried TxResponses. | + + + + + + + + +### GetTxsEventRequest +GetTxsEventRequest is the request type for the Service.TxsByEvents +RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `events` | [string](#string) | repeated | events is the list of transaction event type. | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an pagination for the request. | + + + + + + + + +### GetTxsEventResponse +GetTxsEventResponse is the response type for the Service.TxsByEvents +RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `txs` | [Tx](#cosmos.tx.v1beta1.Tx) | repeated | txs is the list of queried transactions. | +| `tx_responses` | [cosmos.base.abci.v1beta1.TxResponse](#cosmos.base.abci.v1beta1.TxResponse) | repeated | tx_responses is the list of queried TxResponses. | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines an pagination for the response. | + + + + + + + + +### SimulateRequest +SimulateRequest is the request type for the Service.Simulate +RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `tx` | [Tx](#cosmos.tx.v1beta1.Tx) | | tx is the transaction to simulate. | + + + + + + + + +### SimulateResponse +SimulateResponse is the response type for the +Service.SimulateRPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `gas_info` | [cosmos.base.abci.v1beta1.GasInfo](#cosmos.base.abci.v1beta1.GasInfo) | | gas_info is the information about gas used in the simulation. | +| `result` | [cosmos.base.abci.v1beta1.Result](#cosmos.base.abci.v1beta1.Result) | | result is the result of the simulation. | + + + + + + + + + + +### BroadcastMode +BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| BROADCAST_MODE_UNSPECIFIED | 0 | zero-value for mode ordering | +| BROADCAST_MODE_BLOCK | 1 | BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for the tx to be committed in a block. | +| BROADCAST_MODE_SYNC | 2 | BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for a CheckTx execution response only. | +| BROADCAST_MODE_ASYNC | 3 | BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns immediately. | + + + + + + + + + +### Service +Service defines a gRPC service for interacting with transactions. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `Simulate` | [SimulateRequest](#cosmos.tx.v1beta1.SimulateRequest) | [SimulateResponse](#cosmos.tx.v1beta1.SimulateResponse) | Simulate simulates executing a transaction for estimating gas usage. | POST|/cosmos/tx/v1beta1/simulate| +| `GetTx` | [GetTxRequest](#cosmos.tx.v1beta1.GetTxRequest) | [GetTxResponse](#cosmos.tx.v1beta1.GetTxResponse) | GetTx fetches a tx by hash. | GET|/cosmos/tx/v1beta1/txs/{hash}| +| `BroadcastTx` | [BroadcastTxRequest](#cosmos.tx.v1beta1.BroadcastTxRequest) | [BroadcastTxResponse](#cosmos.tx.v1beta1.BroadcastTxResponse) | BroadcastTx broadcast transaction. | POST|/cosmos/tx/v1beta1/txs| +| `GetTxsEvent` | [GetTxsEventRequest](#cosmos.tx.v1beta1.GetTxsEventRequest) | [GetTxsEventResponse](#cosmos.tx.v1beta1.GetTxsEventResponse) | GetTxsEvent fetches txs by event. | GET|/cosmos/tx/v1beta1/txs| + + + + + + +

Top

+ +## cosmos/tx/signing/v1beta1/signing.proto + + + + + +### SignatureDescriptor +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `public_key` | [google.protobuf.Any](#google.protobuf.Any) | | public_key is the public key of the signer | +| `data` | [SignatureDescriptor.Data](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data) | | | +| `sequence` | [uint64](#uint64) | | 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. | + + + + + + + + +### SignatureDescriptor.Data +Data represents signature data + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `single` | [SignatureDescriptor.Data.Single](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single) | | single represents a single signer | +| `multi` | [SignatureDescriptor.Data.Multi](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi) | | multi represents a multisig signer | + + + + + + + + +### SignatureDescriptor.Data.Multi +Multi is the signature data for a multisig public key + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `bitarray` | [cosmos.crypto.multisig.v1beta1.CompactBitArray](#cosmos.crypto.multisig.v1beta1.CompactBitArray) | | bitarray specifies which keys within the multisig are signing | +| `signatures` | [SignatureDescriptor.Data](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data) | repeated | signatures is the signatures of the multi-signature | + + + + + + + + +### SignatureDescriptor.Data.Single +Single is the signature data for a single signer + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `mode` | [SignMode](#cosmos.tx.signing.v1beta1.SignMode) | | mode is the signing mode of the single signer | +| `signature` | [bytes](#bytes) | | signature is the raw signature bytes | + + + + + + + + +### SignatureDescriptors +SignatureDescriptors wraps multiple SignatureDescriptor's. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `signatures` | [SignatureDescriptor](#cosmos.tx.signing.v1beta1.SignatureDescriptor) | repeated | signatures are the signature descriptors | + + + + + + + + + + +### SignMode +SignMode represents a signing mode with its own security guarantees. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| SIGN_MODE_UNSPECIFIED | 0 | SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be rejected | +| SIGN_MODE_DIRECT | 1 | SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is verified with raw bytes from Tx | +| SIGN_MODE_TEXTUAL | 2 | 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_LEGACY_AMINO_JSON | 127 | SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses Amino JSON and will be removed in the future | + + + + + + + + + + + +

Top

+ +## cosmos/crisis/v1beta1/tx.proto + + + + + +### MsgVerifyInvariant +MsgVerifyInvariant represents a message to verify a particular invariance. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `sender` | [string](#string) | | | +| `invariant_module_name` | [string](#string) | | | +| `invariant_route` | [string](#string) | | | + + + + + + + + +### MsgVerifyInvariantResponse +MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. + + + + + + + + + + + + + + +### Msg +Msg defines the bank Msg service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `VerifyInvariant` | [MsgVerifyInvariant](#cosmos.crisis.v1beta1.MsgVerifyInvariant) | [MsgVerifyInvariantResponse](#cosmos.crisis.v1beta1.MsgVerifyInvariantResponse) | VerifyInvariant defines a method to verify a particular invariance. | | + + + + + + +

Top

+ +## cosmos/crisis/v1beta1/genesis.proto + + + + ### GenesisState -GenesisState defines the auth module's genesis state. +GenesisState defines the crisis module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `params` | [Params](#cosmos.auth.v1beta1.Params) | | params defines all the paramaters of the module. | -| `accounts` | [google.protobuf.Any](#google.protobuf.Any) | repeated | accounts are the accounts present at genesis. | +| `constant_fee` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | constant_fee is the fee used to verify the invariant in the crisis module. | @@ -821,44 +1311,253 @@ GenesisState defines the auth module's genesis state. - +

Top

-## cosmos/auth/v1beta1/query.proto +## cosmos/crypto/multisig/keys.proto - + -### QueryAccountRequest -QueryAccountRequest is the request type for the Query/Account RPC method. +### LegacyAminoPubKey +LegacyAminoPubKey specifies a public key type +which nests multiple public keys and a threshold, +it uses legacy amino address rules. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | address defines the address to query for. | +| `threshold` | [uint32](#uint32) | | | +| `public_keys` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | + - + -### QueryAccountResponse -QueryAccountResponse is the response type for the Query/Account RPC method. + + + + + + + +

Top

+ +## cosmos/crypto/multisig/v1beta1/multisig.proto + + + + + +### CompactBitArray +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. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `account` | [google.protobuf.Any](#google.protobuf.Any) | | account defines the account of the corresponding address. | +| `extra_bits_stored` | [uint32](#uint32) | | | +| `elems` | [bytes](#bytes) | | | - + + +### MultiSignature +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `signatures` | [bytes](#bytes) | repeated | | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/crypto/secp256k1/keys.proto + + + + + +### PrivKey +PrivKey defines a secp256k1 private key. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `key` | [bytes](#bytes) | | | + + + + + + + + +### PubKey +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `key` | [bytes](#bytes) | | | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/crypto/ed25519/keys.proto + + + + + +### PrivKey +PrivKey defines a ed25519 private key. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `key` | [bytes](#bytes) | | | + + + + + + + + +### PubKey +PubKey defines a ed25519 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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `key` | [bytes](#bytes) | | | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/mint/v1beta1/query.proto + + + + + +### QueryAnnualProvisionsRequest +QueryAnnualProvisionsRequest is the request type for the +Query/AnnualProvisions RPC method. + + + + + + + + +### QueryAnnualProvisionsResponse +QueryAnnualProvisionsResponse is the response type for the +Query/AnnualProvisions RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `annual_provisions` | [bytes](#bytes) | | annual_provisions is the current minting annual provisions value. | + + + + + + + + +### QueryInflationRequest +QueryInflationRequest is the request type for the Query/Inflation RPC method. + + + + + + + + +### QueryInflationResponse +QueryInflationResponse is the response type for the Query/Inflation RPC +method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `inflation` | [bytes](#bytes) | | inflation is the current minting inflation value. | + + + + + + + ### QueryParamsRequest QueryParamsRequest is the request type for the Query/Params RPC method. @@ -868,7 +1567,7 @@ QueryParamsRequest is the request type for the Query/Params RPC method. - + ### QueryParamsResponse QueryParamsResponse is the response type for the Query/Params RPC method. @@ -876,7 +1575,7 @@ QueryParamsResponse is the response type for the Query/Params RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `params` | [Params](#cosmos.auth.v1beta1.Params) | | params defines the parameters of the module. | +| `params` | [Params](#cosmos.mint.v1beta1.Params) | | params defines the parameters of the module. | @@ -889,89 +1588,38 @@ QueryParamsResponse is the response type for the Query/Params RPC method. - + ### Query -Query defines the gRPC querier service. +Query provides defines the gRPC querier service. | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Account` | [QueryAccountRequest](#cosmos.auth.v1beta1.QueryAccountRequest) | [QueryAccountResponse](#cosmos.auth.v1beta1.QueryAccountResponse) | Account returns account details based on address. | GET|/cosmos/auth/v1beta1/accounts/{address}| -| `Params` | [QueryParamsRequest](#cosmos.auth.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.auth.v1beta1.QueryParamsResponse) | Params queries all parameters. | GET|/cosmos/auth/v1beta1/params| +| `Params` | [QueryParamsRequest](#cosmos.mint.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.mint.v1beta1.QueryParamsResponse) | Params returns the total set of minting parameters. | GET|/cosmos/mint/v1beta1/params| +| `Inflation` | [QueryInflationRequest](#cosmos.mint.v1beta1.QueryInflationRequest) | [QueryInflationResponse](#cosmos.mint.v1beta1.QueryInflationResponse) | Inflation returns the current minting inflation value. | GET|/cosmos/mint/v1beta1/inflation| +| `AnnualProvisions` | [QueryAnnualProvisionsRequest](#cosmos.mint.v1beta1.QueryAnnualProvisionsRequest) | [QueryAnnualProvisionsResponse](#cosmos.mint.v1beta1.QueryAnnualProvisionsResponse) | AnnualProvisions current minting annual provisions value. | GET|/cosmos/mint/v1beta1/annual_provisions| - +

Top

-## cosmos/base/v1beta1/coin.proto +## cosmos/mint/v1beta1/genesis.proto - + -### Coin -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. +### GenesisState +GenesisState defines the mint module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `denom` | [string](#string) | | | -| `amount` | [string](#string) | | | - - - - - - - - -### DecCoin -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `denom` | [string](#string) | | | -| `amount` | [string](#string) | | | - - - - - - - - -### DecProto -DecProto defines a Protobuf wrapper around a Dec object. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `dec` | [string](#string) | | | - - - - - - - - -### IntProto -IntProto defines a Protobuf wrapper around an Int object. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `int` | [string](#string) | | | +| `minter` | [Minter](#cosmos.mint.v1beta1.Minter) | | minter is a space for holding current inflation information. | +| `params` | [Params](#cosmos.mint.v1beta1.Params) | | params defines all the paramaters of the module. | @@ -987,56 +1635,147 @@ IntProto defines a Protobuf wrapper around an Int object. - +

Top

-## cosmos/authz/v1beta1/authz.proto +## cosmos/mint/v1beta1/mint.proto - + -### AuthorizationGrant -AuthorizationGrant gives permissions to execute -the provide method with expiration time. +### Minter +Minter represents the minting state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `authorization` | [google.protobuf.Any](#google.protobuf.Any) | | | -| `expiration` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `inflation` | [string](#string) | | current annual inflation rate | +| `annual_provisions` | [string](#string) | | current annual expected provisions | - + -### GenericAuthorization -GenericAuthorization gives the grantee unrestricted permissions to execute -the provided method on behalf of the granter's account. +### Params +Params holds parameters for the mint module. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `method_name` | [string](#string) | | method name to grant unrestricted permissions to execute Note: MethodName() is already a method on `GenericAuthorization` type, we need some custom naming here so using `MessageName` | +| `mint_denom` | [string](#string) | | type of coin to mint | +| `inflation_rate_change` | [string](#string) | | maximum annual change in inflation rate | +| `inflation_max` | [string](#string) | | maximum inflation rate | +| `inflation_min` | [string](#string) | | minimum inflation rate | +| `goal_bonded` | [string](#string) | | goal of percent bonded atoms | +| `blocks_per_year` | [uint64](#uint64) | | expected blocks per year | + - + -### SendAuthorization -SendAuthorization allows the grantee to spend up to spend_limit coins from -the granter's account. + + + + + + + +

Top

+ +## cosmos/feegrant/v1beta1/feegrant.proto + + + + + +### BasicFeeAllowance +BasicFeeAllowance implements FeeAllowance with a one-time grant of tokens +that optionally expires. The delegatee can use up to SpendLimit to cover fees. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `spend_limit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | +| `expiration` | [ExpiresAt](#cosmos.feegrant.v1beta1.ExpiresAt) | | | + + + + + + + + +### Duration +Duration is a span of a clock time or number of blocks. +This is designed to be added to an ExpiresAt struct. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `duration` | [google.protobuf.Duration](#google.protobuf.Duration) | | | +| `blocks` | [uint64](#uint64) | | | + + + + + + + + +### ExpiresAt +ExpiresAt is a point in time where something expires. +It may be *either* block time or block height + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `height` | [int64](#int64) | | | + + + + + + + + +### FeeAllowanceGrant +FeeAllowanceGrant is stored in the KVStore to record a grant with full context + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `granter` | [string](#string) | | | +| `grantee` | [string](#string) | | | +| `allowance` | [google.protobuf.Any](#google.protobuf.Any) | | | + + + + + + + + +### PeriodicFeeAllowance +PeriodicFeeAllowance extends FeeAllowance to allow for both a maximum cap, +as well as a limit per time period. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `basic` | [BasicFeeAllowance](#cosmos.feegrant.v1beta1.BasicFeeAllowance) | | | +| `period` | [Duration](#cosmos.feegrant.v1beta1.Duration) | | | +| `period_spend_limit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | +| `period_can_spend` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | +| `period_reset` | [ExpiresAt](#cosmos.feegrant.v1beta1.ExpiresAt) | | | @@ -1052,480 +1791,52 @@ the granter's account. - +

Top

-## cosmos/base/abci/v1beta1/abci.proto +## cosmos/feegrant/v1beta1/query.proto - + -### ABCIMessageLog -ABCIMessageLog defines a structure containing an indexed tx ABCI message log. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `msg_index` | [uint32](#uint32) | | | -| `log` | [string](#string) | | | -| `events` | [StringEvent](#cosmos.base.abci.v1beta1.StringEvent) | repeated | Events contains a slice of Event objects that were emitted during some execution. | - - - - - - - - -### Attribute -Attribute defines an attribute wrapper where the key and value are -strings instead of raw bytes. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `key` | [string](#string) | | | -| `value` | [string](#string) | | | - - - - - - - - -### GasInfo -GasInfo defines tx execution gas context. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `gas_wanted` | [uint64](#uint64) | | GasWanted is the maximum units of work we allow this tx to perform. | -| `gas_used` | [uint64](#uint64) | | GasUsed is the amount of gas actually consumed. | - - - - - - - - -### MsgData -MsgData defines the data returned in a Result object during message -execution. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `msg_type` | [string](#string) | | | -| `data` | [bytes](#bytes) | | | - - - - - - - - -### Result -Result is the union of ResponseFormat and ResponseCheckTx. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `data` | [bytes](#bytes) | | Data is any data returned from message or handler execution. It MUST be length prefixed in order to separate data from multiple message executions. | -| `log` | [string](#string) | | Log contains the log information from message or handler execution. | -| `events` | [tendermint.abci.Event](#tendermint.abci.Event) | repeated | Events contains a slice of Event objects that were emitted during message or handler execution. | - - - - - - - - -### SearchTxsResult -SearchTxsResult defines a structure for querying txs pageable - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `total_count` | [uint64](#uint64) | | Count of all txs | -| `count` | [uint64](#uint64) | | Count of txs in current page | -| `page_number` | [uint64](#uint64) | | Index of current page, start from 1 | -| `page_total` | [uint64](#uint64) | | Count of total pages | -| `limit` | [uint64](#uint64) | | Max count txs per page | -| `txs` | [TxResponse](#cosmos.base.abci.v1beta1.TxResponse) | repeated | List of txs in current page | - - - - - - - - -### SimulationResponse -SimulationResponse defines the response generated when a transaction is -successfully simulated. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `gas_info` | [GasInfo](#cosmos.base.abci.v1beta1.GasInfo) | | | -| `result` | [Result](#cosmos.base.abci.v1beta1.Result) | | | - - - - - - - - -### StringEvent -StringEvent defines en Event object wrapper where all the attributes -contain key/value pairs that are strings instead of raw bytes. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `type` | [string](#string) | | | -| `attributes` | [Attribute](#cosmos.base.abci.v1beta1.Attribute) | repeated | | - - - - - - - - -### TxMsgData -TxMsgData defines a list of MsgData. A transaction will have a MsgData object -for each message. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `data` | [MsgData](#cosmos.base.abci.v1beta1.MsgData) | repeated | | - - - - - - - - -### TxResponse -TxResponse defines a structure containing relevant tx data and metadata. The -tags are stringified and the log is JSON decoded. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `height` | [int64](#int64) | | The block height | -| `txhash` | [string](#string) | | The transaction hash. | -| `codespace` | [string](#string) | | Namespace for the Code | -| `code` | [uint32](#uint32) | | Response code. | -| `data` | [string](#string) | | Result bytes, if any. | -| `raw_log` | [string](#string) | | The output of the application's logger (raw string). May be non-deterministic. | -| `logs` | [ABCIMessageLog](#cosmos.base.abci.v1beta1.ABCIMessageLog) | repeated | The output of the application's logger (typed). May be non-deterministic. | -| `info` | [string](#string) | | Additional information. May be non-deterministic. | -| `gas_wanted` | [int64](#int64) | | Amount of gas requested for transaction. | -| `gas_used` | [int64](#int64) | | Amount of gas consumed by transaction. | -| `tx` | [google.protobuf.Any](#google.protobuf.Any) | | The request transaction bytes. | -| `timestamp` | [string](#string) | | 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. | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/authz/v1beta1/tx.proto - - - - - -### MsgExecAuthorizedRequest -MsgExecAuthorizedRequest 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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `grantee` | [string](#string) | | | -| `msgs` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | - - - - - - - - -### MsgExecAuthorizedResponse -MsgExecAuthorizedResponse defines the Msg/MsgExecAuthorizedResponse response type. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `result` | [cosmos.base.abci.v1beta1.Result](#cosmos.base.abci.v1beta1.Result) | | | - - - - - - - - -### MsgGrantAuthorizationRequest -MsgGrantAuthorizationRequest grants the provided authorization to the grantee on the granter's -account with the provided expiration time. +### QueryFeeAllowanceRequest +QueryFeeAllowanceRequest is the request type for the Query/FeeAllowance RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `granter` | [string](#string) | | | | `grantee` | [string](#string) | | | -| `authorization` | [google.protobuf.Any](#google.protobuf.Any) | | | -| `expiration` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | - + -### MsgGrantAuthorizationResponse -MsgGrantAuthorizationResponse defines the Msg/MsgGrantAuthorization response type. - - - - - - - - -### MsgRevokeAuthorizationRequest -MsgRevokeAuthorizationRequest revokes any authorization with the provided sdk.Msg type on the -granter's account with that has been granted to the grantee. +### QueryFeeAllowanceResponse +QueryFeeAllowanceResponse is the response type for the Query/FeeAllowance RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `granter` | [string](#string) | | | -| `grantee` | [string](#string) | | | -| `method_name` | [string](#string) | | | +| `fee_allowance` | [FeeAllowanceGrant](#cosmos.feegrant.v1beta1.FeeAllowanceGrant) | | fee_allowance is a fee_allowance granted for grantee by granter. | - + -### MsgRevokeAuthorizationResponse -MsgRevokeAuthorizationResponse defines the Msg/MsgRevokeAuthorizationResponse response type. - - - - - - - - - - - - - - -### Msg -Msg defines the authz Msg service. - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `GrantAuthorization` | [MsgGrantAuthorizationRequest](#cosmos.authz.v1beta1.MsgGrantAuthorizationRequest) | [MsgGrantAuthorizationResponse](#cosmos.authz.v1beta1.MsgGrantAuthorizationResponse) | GrantAuthorization grants the provided authorization to the grantee on the granter's account with the provided expiration time. | | -| `ExecAuthorized` | [MsgExecAuthorizedRequest](#cosmos.authz.v1beta1.MsgExecAuthorizedRequest) | [MsgExecAuthorizedResponse](#cosmos.authz.v1beta1.MsgExecAuthorizedResponse) | ExecAuthorized 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. | | -| `RevokeAuthorization` | [MsgRevokeAuthorizationRequest](#cosmos.authz.v1beta1.MsgRevokeAuthorizationRequest) | [MsgRevokeAuthorizationResponse](#cosmos.authz.v1beta1.MsgRevokeAuthorizationResponse) | RevokeAuthorization revokes any authorization corresponding to the provided method name on the granter's account that has been granted to the grantee. | | - - - - - - -

Top

- -## cosmos/authz/v1beta1/genesis.proto - - - - - -### GenesisState -GenesisState defines the authz module's genesis state. +### QueryFeeAllowancesRequest +QueryFeeAllowancesRequest is the request type for the Query/FeeAllowances RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `authorization` | [GrantAuthorization](#cosmos.authz.v1beta1.GrantAuthorization) | repeated | | - - - - - - - - -### GrantAuthorization -GrantAuthorization defines the GenesisState/GrantAuthorization type. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `granter` | [string](#string) | | | -| `grantee` | [string](#string) | | | -| `authorization` | [google.protobuf.Any](#google.protobuf.Any) | | | -| `expiration` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/base/query/v1beta1/pagination.proto - - - - - -### PageRequest -PageRequest is to be embedded in gRPC request messages for efficient -pagination. Ex: - - message SomeRequest { - Foo some_parameter = 1; - PageRequest pagination = 2; - } - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `key` | [bytes](#bytes) | | key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set. | -| `offset` | [uint64](#uint64) | | offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set. | -| `limit` | [uint64](#uint64) | | limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app. | -| `count_total` | [bool](#bool) | | 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. | - - - - - - - - -### PageResponse -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; - } - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `next_key` | [bytes](#bytes) | | next_key is the key to be passed to PageRequest.key to query the next page most efficiently | -| `total` | [uint64](#uint64) | | total is total number of results available if PageRequest.count_total was set, its value is undefined otherwise | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/authz/v1beta1/query.proto - - - - - -### QueryAuthorizationRequest -QueryAuthorizationRequest is the request type for the Query/Authorization RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `granter` | [string](#string) | | | -| `grantee` | [string](#string) | | | -| `method_name` | [string](#string) | | | - - - - - - - - -### QueryAuthorizationResponse -QueryAuthorizationResponse is the response type for the Query/Authorization RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `authorization` | [AuthorizationGrant](#cosmos.authz.v1beta1.AuthorizationGrant) | | authorization is a authorization granted for grantee by granter. | - - - - - - - - -### QueryAuthorizationsRequest -QueryAuthorizationsRequest is the request type for the Query/Authorizations RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `granter` | [string](#string) | | | | `grantee` | [string](#string) | | | | `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an pagination for the request. | @@ -1534,15 +1845,15 @@ QueryAuthorizationsRequest is the request type for the Query/Authorizations RPC - + -### QueryAuthorizationsResponse -QueryAuthorizationsResponse is the response type for the Query/Authorizations RPC method. +### QueryFeeAllowancesResponse +QueryFeeAllowancesResponse is the response type for the Query/FeeAllowances RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `authorizations` | [AuthorizationGrant](#cosmos.authz.v1beta1.AuthorizationGrant) | repeated | authorizations is a list of grants granted for grantee by granter. | +| `fee_allowances` | [FeeAllowanceGrant](#cosmos.feegrant.v1beta1.FeeAllowanceGrant) | repeated | fee_allowances are fee_allowance's granted for grantee by granter. | | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines an pagination for the response. | @@ -1556,15 +1867,240 @@ QueryAuthorizationsResponse is the response type for the Query/Authorizations RP - + ### Query Query defines the gRPC querier service. | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Authorization` | [QueryAuthorizationRequest](#cosmos.authz.v1beta1.QueryAuthorizationRequest) | [QueryAuthorizationResponse](#cosmos.authz.v1beta1.QueryAuthorizationResponse) | Returns any `Authorization` (or `nil`), with the expiration time, granted to the grantee by the granter for the provided msg type. | GET|/cosmos/authz/v1beta1/granters/{granter}/grantees/{grantee}/grant| -| `Authorizations` | [QueryAuthorizationsRequest](#cosmos.authz.v1beta1.QueryAuthorizationsRequest) | [QueryAuthorizationsResponse](#cosmos.authz.v1beta1.QueryAuthorizationsResponse) | Returns list of `Authorization`, granted to the grantee by the granter. | GET|/cosmos/authz/v1beta1/granters/{granter}/grantees/{grantee}/grants| +| `FeeAllowance` | [QueryFeeAllowanceRequest](#cosmos.feegrant.v1beta1.QueryFeeAllowanceRequest) | [QueryFeeAllowanceResponse](#cosmos.feegrant.v1beta1.QueryFeeAllowanceResponse) | FeeAllowance returns fee granted to the grantee by the granter. | GET|/cosmos/feegrant/v1beta1/fee_allowance/{granter}/{grantee}| +| `FeeAllowances` | [QueryFeeAllowancesRequest](#cosmos.feegrant.v1beta1.QueryFeeAllowancesRequest) | [QueryFeeAllowancesResponse](#cosmos.feegrant.v1beta1.QueryFeeAllowancesResponse) | FeeAllowances returns all the grants for address. | GET|/cosmos/feegrant/v1beta1/fee_allowances/{grantee}| + + + + + + +

Top

+ +## cosmos/feegrant/v1beta1/tx.proto + + + + + +### MsgGrantFeeAllowance +MsgGrantFeeAllowance adds permission for Grantee to spend up to Allowance +of fees from the account of Granter. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `granter` | [string](#string) | | | +| `grantee` | [string](#string) | | | +| `allowance` | [google.protobuf.Any](#google.protobuf.Any) | | | + + + + + + + + +### MsgGrantFeeAllowanceResponse +MsgGrantFeeAllowanceResponse defines the Msg/GrantFeeAllowanceResponse response type. + + + + + + + + +### MsgRevokeFeeAllowance +MsgRevokeFeeAllowance removes any existing FeeAllowance from Granter to Grantee. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `granter` | [string](#string) | | | +| `grantee` | [string](#string) | | | + + + + + + + + +### MsgRevokeFeeAllowanceResponse +MsgRevokeFeeAllowanceResponse defines the Msg/RevokeFeeAllowanceResponse response type. + + + + + + + + + + + + + + +### Msg +Msg defines the feegrant msg service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `GrantFeeAllowance` | [MsgGrantFeeAllowance](#cosmos.feegrant.v1beta1.MsgGrantFeeAllowance) | [MsgGrantFeeAllowanceResponse](#cosmos.feegrant.v1beta1.MsgGrantFeeAllowanceResponse) | GrantFeeAllowance grants fee allowance to the grantee on the granter's account with the provided expiration time. | | +| `RevokeFeeAllowance` | [MsgRevokeFeeAllowance](#cosmos.feegrant.v1beta1.MsgRevokeFeeAllowance) | [MsgRevokeFeeAllowanceResponse](#cosmos.feegrant.v1beta1.MsgRevokeFeeAllowanceResponse) | RevokeFeeAllowance revokes any fee allowance of granter's account that has been granted to the grantee. | | + + + + + + +

Top

+ +## cosmos/feegrant/v1beta1/genesis.proto + + + + + +### GenesisState +GenesisState contains a set of fee allowances, persisted from the store + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `fee_allowances` | [FeeAllowanceGrant](#cosmos.feegrant.v1beta1.FeeAllowanceGrant) | repeated | | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/capability/v1beta1/capability.proto + + + + + +### Capability +Capability defines an implementation of an object capability. The index +provided to a Capability must be globally unique. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `index` | [uint64](#uint64) | | | + + + + + + + + +### CapabilityOwners +CapabilityOwners defines a set of owners of a single Capability. The set of +owners must be unique. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `owners` | [Owner](#cosmos.capability.v1beta1.Owner) | repeated | | + + + + + + + + +### Owner +Owner defines a single capability owner. An owner is defined by the name of +capability and the module name. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `module` | [string](#string) | | | +| `name` | [string](#string) | | | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/capability/v1beta1/genesis.proto + + + + + +### GenesisOwners +GenesisOwners defines the capability owners with their corresponding index. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `index` | [uint64](#uint64) | | index is the index of the capability owner. | +| `index_owners` | [CapabilityOwners](#cosmos.capability.v1beta1.CapabilityOwners) | | index_owners are the owners at the given index. | + + + + + + + + +### GenesisState +GenesisState defines the capability module's genesis state. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `index` | [uint64](#uint64) | | index is the capability global index. | +| `owners` | [GenesisOwners](#cosmos.capability.v1beta1.GenesisOwners) | repeated | owners represents a map from index to owners of the capability index index key is string to allow amino marshalling. | + + + + + + + + + + @@ -1694,57 +2230,6 @@ amounts in the network. - - - - - - - - - - - -

Top

- -## cosmos/bank/v1beta1/genesis.proto - - - - - -### Balance -Balance defines an account address and balance pair used in the bank module's -genesis state. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | address is the address of the balance holder. | -| `coins` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | coins defines the different coins this balance holds. | - - - - - - - - -### GenesisState -GenesisState defines the bank module's genesis state. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `params` | [Params](#cosmos.bank.v1beta1.Params) | | params defines all the paramaters of the module. | -| `balances` | [Balance](#cosmos.bank.v1beta1.Balance) | repeated | balances is an array containing the balances of all the accounts. | -| `supply` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | supply represents the total supply. | -| `denom_metadata` | [Metadata](#cosmos.bank.v1beta1.Metadata) | repeated | denom_metadata defines the metadata of the differents coins. | - - - - - @@ -2076,38 +2561,42 @@ Msg defines the bank Msg service. - +

Top

-## cosmos/base/kv/v1beta1/kv.proto +## cosmos/bank/v1beta1/genesis.proto - + -### Pair -Pair defines a key/value bytes tuple. +### Balance +Balance defines an account address and balance pair used in the bank module's +genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `key` | [bytes](#bytes) | | | -| `value` | [bytes](#bytes) | | | +| `address` | [string](#string) | | address is the address of the balance holder. | +| `coins` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | coins defines the different coins this balance holds. | - + -### Pairs -Pairs defines a repeated slice of Pair objects. +### GenesisState +GenesisState defines the bank module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `pairs` | [Pair](#cosmos.base.kv.v1beta1.Pair) | repeated | | +| `params` | [Params](#cosmos.bank.v1beta1.Params) | | params defines all the paramaters of the module. | +| `balances` | [Balance](#cosmos.bank.v1beta1.Balance) | repeated | balances is an array containing the balances of all the accounts. | +| `supply` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | supply represents the total supply. | +| `denom_metadata` | [Metadata](#cosmos.bank.v1beta1.Metadata) | repeated | denom_metadata defines the metadata of the differents coins. | @@ -2123,125 +2612,56 @@ Pairs defines a repeated slice of Pair objects. - +

Top

-## cosmos/base/reflection/v1beta1/reflection.proto +## cosmos/authz/v1beta1/authz.proto - + -### ListAllInterfacesRequest -ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. - - - - - - - - -### ListAllInterfacesResponse -ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. +### AuthorizationGrant +AuthorizationGrant gives permissions to execute +the provide method with expiration time. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `interface_names` | [string](#string) | repeated | interface_names is an array of all the registered interfaces. | +| `authorization` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `expiration` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | - + -### ListImplementationsRequest -ListImplementationsRequest is the request type of the ListImplementations -RPC. +### GenericAuthorization +GenericAuthorization gives the grantee unrestricted permissions to execute +the provided method on behalf of the granter's account. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `interface_name` | [string](#string) | | interface_name defines the interface to query the implementations for. | +| `method_name` | [string](#string) | | method name to grant unrestricted permissions to execute Note: MethodName() is already a method on `GenericAuthorization` type, we need some custom naming here so using `MessageName` | - + -### ListImplementationsResponse -ListImplementationsResponse is the response type of the ListImplementations -RPC. +### SendAuthorization +SendAuthorization allows the grantee to spend up to spend_limit coins from +the granter's account. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `implementation_message_names` | [string](#string) | repeated | | - - - - - - - - - - - - - - -### ReflectionService -ReflectionService defines a service for interface reflection. - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `ListAllInterfaces` | [ListAllInterfacesRequest](#cosmos.base.reflection.v1beta1.ListAllInterfacesRequest) | [ListAllInterfacesResponse](#cosmos.base.reflection.v1beta1.ListAllInterfacesResponse) | ListAllInterfaces lists all the interfaces registered in the interface registry. | GET|/cosmos/base/reflection/v1beta1/interfaces| -| `ListImplementations` | [ListImplementationsRequest](#cosmos.base.reflection.v1beta1.ListImplementationsRequest) | [ListImplementationsResponse](#cosmos.base.reflection.v1beta1.ListImplementationsResponse) | ListImplementations list all the concrete types that implement a given interface. | GET|/cosmos/base/reflection/v1beta1/interfaces/{interface_name}/implementations| - - - - - - -

Top

- -## cosmos/base/snapshots/v1beta1/snapshot.proto - - - - - -### Metadata -Metadata contains SDK-specific snapshot metadata. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `chunk_hashes` | [bytes](#bytes) | repeated | SHA-256 chunk hashes | - - - - - - - - -### Snapshot -Snapshot contains Tendermint state sync snapshot info. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `height` | [uint64](#uint64) | | | -| `format` | [uint32](#uint32) | | | -| `chunks` | [uint32](#uint32) | | | -| `hash` | [bytes](#bytes) | | | -| `metadata` | [Metadata](#cosmos.base.snapshots.v1beta1.Metadata) | | | +| `spend_limit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | @@ -2257,210 +2677,55 @@ Snapshot contains Tendermint state sync snapshot info. - +

Top

-## cosmos/base/store/v1beta1/commit_info.proto +## cosmos/authz/v1beta1/query.proto - + -### CommitID -CommitID defines the committment information when a specific store is -committed. +### QueryAuthorizationRequest +QueryAuthorizationRequest is the request type for the Query/Authorization RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `version` | [int64](#int64) | | | -| `hash` | [bytes](#bytes) | | | +| `granter` | [string](#string) | | | +| `grantee` | [string](#string) | | | +| `method_name` | [string](#string) | | | - + -### CommitInfo -CommitInfo defines commit information used by the multi-store when committing -a version/height. +### QueryAuthorizationResponse +QueryAuthorizationResponse is the response type for the Query/Authorization RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `version` | [int64](#int64) | | | -| `store_infos` | [StoreInfo](#cosmos.base.store.v1beta1.StoreInfo) | repeated | | +| `authorization` | [AuthorizationGrant](#cosmos.authz.v1beta1.AuthorizationGrant) | | authorization is a authorization granted for grantee by granter. | - + -### StoreInfo -StoreInfo defines store-specific commit information. It contains a reference -between a store name and the commit ID. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `name` | [string](#string) | | | -| `commit_id` | [CommitID](#cosmos.base.store.v1beta1.CommitID) | | | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/base/store/v1beta1/snapshot.proto - - - - - -### SnapshotIAVLItem -SnapshotIAVLItem is an exported IAVL node. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `key` | [bytes](#bytes) | | | -| `value` | [bytes](#bytes) | | | -| `version` | [int64](#int64) | | | -| `height` | [int32](#int32) | | | - - - - - - - - -### SnapshotItem -SnapshotItem is an item contained in a rootmulti.Store snapshot. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `store` | [SnapshotStoreItem](#cosmos.base.store.v1beta1.SnapshotStoreItem) | | | -| `iavl` | [SnapshotIAVLItem](#cosmos.base.store.v1beta1.SnapshotIAVLItem) | | | - - - - - - - - -### SnapshotStoreItem -SnapshotStoreItem contains metadata about a snapshotted store. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `name` | [string](#string) | | | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/base/tendermint/v1beta1/query.proto - - - - - -### GetBlockByHeightRequest -GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `height` | [int64](#int64) | | | - - - - - - - - -### GetBlockByHeightResponse -GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `block_id` | [tendermint.types.BlockID](#tendermint.types.BlockID) | | | -| `block` | [tendermint.types.Block](#tendermint.types.Block) | | | - - - - - - - - -### GetLatestBlockRequest -GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. - - - - - - - - -### GetLatestBlockResponse -GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `block_id` | [tendermint.types.BlockID](#tendermint.types.BlockID) | | | -| `block` | [tendermint.types.Block](#tendermint.types.Block) | | | - - - - - - - - -### GetLatestValidatorSetRequest -GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. +### QueryAuthorizationsRequest +QueryAuthorizationsRequest is the request type for the Query/Authorizations RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | +| `granter` | [string](#string) | | | +| `grantee` | [string](#string) | | | | `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an pagination for the request. | @@ -2468,162 +2733,21 @@ GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetBy - + -### GetLatestValidatorSetResponse -GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. +### QueryAuthorizationsResponse +QueryAuthorizationsResponse is the response type for the Query/Authorizations RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `block_height` | [int64](#int64) | | | -| `validators` | [Validator](#cosmos.base.tendermint.v1beta1.Validator) | repeated | | +| `authorizations` | [AuthorizationGrant](#cosmos.authz.v1beta1.AuthorizationGrant) | repeated | authorizations is a list of grants granted for grantee by granter. | | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines an pagination for the response. | - - - -### GetNodeInfoRequest -GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. - - - - - - - - -### GetNodeInfoResponse -GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `default_node_info` | [tendermint.p2p.DefaultNodeInfo](#tendermint.p2p.DefaultNodeInfo) | | | -| `application_version` | [VersionInfo](#cosmos.base.tendermint.v1beta1.VersionInfo) | | | - - - - - - - - -### GetSyncingRequest -GetSyncingRequest is the request type for the Query/GetSyncing RPC method. - - - - - - - - -### GetSyncingResponse -GetSyncingResponse is the response type for the Query/GetSyncing RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `syncing` | [bool](#bool) | | | - - - - - - - - -### GetValidatorSetByHeightRequest -GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `height` | [int64](#int64) | | | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an pagination for the request. | - - - - - - - - -### GetValidatorSetByHeightResponse -GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `block_height` | [int64](#int64) | | | -| `validators` | [Validator](#cosmos.base.tendermint.v1beta1.Validator) | repeated | | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines an pagination for the response. | - - - - - - - - -### Module -Module is the type for VersionInfo - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `path` | [string](#string) | | module path | -| `version` | [string](#string) | | module version | -| `sum` | [string](#string) | | checksum | - - - - - - - - -### Validator -Validator is the type for the validator-set. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | | -| `pub_key` | [google.protobuf.Any](#google.protobuf.Any) | | | -| `voting_power` | [int64](#int64) | | | -| `proposer_priority` | [int64](#int64) | | | - - - - - - - - -### VersionInfo -VersionInfo is the type for the GetNodeInfoResponse message. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `name` | [string](#string) | | | -| `app_name` | [string](#string) | | | -| `version` | [string](#string) | | | -| `git_commit` | [string](#string) | | | -| `build_tags` | [string](#string) | | | -| `go_version` | [string](#string) | | | -| `build_deps` | [Module](#cosmos.base.tendermint.v1beta1.Module) | repeated | | - - - - - @@ -2631,196 +2755,111 @@ VersionInfo is the type for the GetNodeInfoResponse message. - + -### Service -Service defines the gRPC querier service for tendermint queries. +### Query +Query defines the gRPC querier service. | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `GetNodeInfo` | [GetNodeInfoRequest](#cosmos.base.tendermint.v1beta1.GetNodeInfoRequest) | [GetNodeInfoResponse](#cosmos.base.tendermint.v1beta1.GetNodeInfoResponse) | GetNodeInfo queries the current node info. | GET|/cosmos/base/tendermint/v1beta1/node_info| -| `GetSyncing` | [GetSyncingRequest](#cosmos.base.tendermint.v1beta1.GetSyncingRequest) | [GetSyncingResponse](#cosmos.base.tendermint.v1beta1.GetSyncingResponse) | GetSyncing queries node syncing. | GET|/cosmos/base/tendermint/v1beta1/syncing| -| `GetLatestBlock` | [GetLatestBlockRequest](#cosmos.base.tendermint.v1beta1.GetLatestBlockRequest) | [GetLatestBlockResponse](#cosmos.base.tendermint.v1beta1.GetLatestBlockResponse) | GetLatestBlock returns the latest block. | GET|/cosmos/base/tendermint/v1beta1/blocks/latest| -| `GetBlockByHeight` | [GetBlockByHeightRequest](#cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest) | [GetBlockByHeightResponse](#cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse) | GetBlockByHeight queries block for given height. | GET|/cosmos/base/tendermint/v1beta1/blocks/{height}| -| `GetLatestValidatorSet` | [GetLatestValidatorSetRequest](#cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest) | [GetLatestValidatorSetResponse](#cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse) | GetLatestValidatorSet queries latest validator-set. | GET|/cosmos/base/tendermint/v1beta1/validatorsets/latest| -| `GetValidatorSetByHeight` | [GetValidatorSetByHeightRequest](#cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest) | [GetValidatorSetByHeightResponse](#cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse) | GetValidatorSetByHeight queries validator-set at a given height. | GET|/cosmos/base/tendermint/v1beta1/validatorsets/{height}| +| `Authorization` | [QueryAuthorizationRequest](#cosmos.authz.v1beta1.QueryAuthorizationRequest) | [QueryAuthorizationResponse](#cosmos.authz.v1beta1.QueryAuthorizationResponse) | Returns any `Authorization` (or `nil`), with the expiration time, granted to the grantee by the granter for the provided msg type. | GET|/cosmos/authz/v1beta1/granters/{granter}/grantees/{grantee}/grant| +| `Authorizations` | [QueryAuthorizationsRequest](#cosmos.authz.v1beta1.QueryAuthorizationsRequest) | [QueryAuthorizationsResponse](#cosmos.authz.v1beta1.QueryAuthorizationsResponse) | Returns list of `Authorization`, granted to the grantee by the granter. | GET|/cosmos/authz/v1beta1/granters/{granter}/grantees/{grantee}/grants| - +

Top

-## cosmos/capability/v1beta1/capability.proto +## cosmos/authz/v1beta1/tx.proto - + -### Capability -Capability defines an implementation of an object capability. The index -provided to a Capability must be globally unique. +### MsgExecAuthorizedRequest +MsgExecAuthorizedRequest 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. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `index` | [uint64](#uint64) | | | +| `grantee` | [string](#string) | | | +| `msgs` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | - + -### CapabilityOwners -CapabilityOwners defines a set of owners of a single Capability. The set of -owners must be unique. +### MsgExecAuthorizedResponse +MsgExecAuthorizedResponse defines the Msg/MsgExecAuthorizedResponse response type. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `owners` | [Owner](#cosmos.capability.v1beta1.Owner) | repeated | | +| `result` | [cosmos.base.abci.v1beta1.Result](#cosmos.base.abci.v1beta1.Result) | | | - + -### Owner -Owner defines a single capability owner. An owner is defined by the name of -capability and the module name. +### MsgGrantAuthorizationRequest +MsgGrantAuthorizationRequest grants the provided authorization to the grantee on the granter's +account with the provided expiration time. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `module` | [string](#string) | | | -| `name` | [string](#string) | | | +| `granter` | [string](#string) | | | +| `grantee` | [string](#string) | | | +| `authorization` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `expiration` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | - - + - - - +### MsgGrantAuthorizationResponse +MsgGrantAuthorizationResponse defines the Msg/MsgGrantAuthorization response type. - -

Top

- -## cosmos/capability/v1beta1/genesis.proto - + -### GenesisOwners -GenesisOwners defines the capability owners with their corresponding index. +### MsgRevokeAuthorizationRequest +MsgRevokeAuthorizationRequest revokes any authorization with the provided sdk.Msg type on the +granter's account with that has been granted to the grantee. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `index` | [uint64](#uint64) | | index is the index of the capability owner. | -| `index_owners` | [CapabilityOwners](#cosmos.capability.v1beta1.CapabilityOwners) | | index_owners are the owners at the given index. | +| `granter` | [string](#string) | | | +| `grantee` | [string](#string) | | | +| `method_name` | [string](#string) | | | - + -### GenesisState -GenesisState defines the capability module's genesis state. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `index` | [uint64](#uint64) | | index is the capability global index. | -| `owners` | [GenesisOwners](#cosmos.capability.v1beta1.GenesisOwners) | repeated | owners represents a map from index to owners of the capability index index key is string to allow amino marshalling. | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/crisis/v1beta1/genesis.proto - - - - - -### GenesisState -GenesisState defines the crisis module's genesis state. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `constant_fee` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | constant_fee is the fee used to verify the invariant in the crisis module. | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/crisis/v1beta1/tx.proto - - - - - -### MsgVerifyInvariant -MsgVerifyInvariant represents a message to verify a particular invariance. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `sender` | [string](#string) | | | -| `invariant_module_name` | [string](#string) | | | -| `invariant_route` | [string](#string) | | | - - - - - - - - -### MsgVerifyInvariantResponse -MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. +### MsgRevokeAuthorizationResponse +MsgRevokeAuthorizationResponse defines the Msg/MsgRevokeAuthorizationResponse response type. @@ -2833,54 +2872,55 @@ MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. - + ### Msg -Msg defines the bank Msg service. +Msg defines the authz Msg service. | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `VerifyInvariant` | [MsgVerifyInvariant](#cosmos.crisis.v1beta1.MsgVerifyInvariant) | [MsgVerifyInvariantResponse](#cosmos.crisis.v1beta1.MsgVerifyInvariantResponse) | VerifyInvariant defines a method to verify a particular invariance. | | +| `GrantAuthorization` | [MsgGrantAuthorizationRequest](#cosmos.authz.v1beta1.MsgGrantAuthorizationRequest) | [MsgGrantAuthorizationResponse](#cosmos.authz.v1beta1.MsgGrantAuthorizationResponse) | GrantAuthorization grants the provided authorization to the grantee on the granter's account with the provided expiration time. | | +| `ExecAuthorized` | [MsgExecAuthorizedRequest](#cosmos.authz.v1beta1.MsgExecAuthorizedRequest) | [MsgExecAuthorizedResponse](#cosmos.authz.v1beta1.MsgExecAuthorizedResponse) | ExecAuthorized 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. | | +| `RevokeAuthorization` | [MsgRevokeAuthorizationRequest](#cosmos.authz.v1beta1.MsgRevokeAuthorizationRequest) | [MsgRevokeAuthorizationResponse](#cosmos.authz.v1beta1.MsgRevokeAuthorizationResponse) | RevokeAuthorization revokes any authorization corresponding to the provided method name on the granter's account that has been granted to the grantee. | | - +

Top

-## cosmos/crypto/ed25519/keys.proto +## cosmos/authz/v1beta1/genesis.proto - + -### PrivKey -PrivKey defines a ed25519 private key. +### GenesisState +GenesisState defines the authz module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `key` | [bytes](#bytes) | | | +| `authorization` | [GrantAuthorization](#cosmos.authz.v1beta1.GrantAuthorization) | repeated | | - + -### PubKey -PubKey defines a ed25519 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. +### GrantAuthorization +GrantAuthorization defines the GenesisState/GrantAuthorization type. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `key` | [bytes](#bytes) | | | +| `granter` | [string](#string) | | | +| `grantee` | [string](#string) | | | +| `authorization` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `expiration` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | @@ -2896,162 +2936,24 @@ This prefix is followed with the x-coordinate. - +

Top

-## cosmos/crypto/multisig/keys.proto +## cosmos/gov/v1beta1/gov.proto - + -### LegacyAminoPubKey -LegacyAminoPubKey specifies a public key type -which nests multiple public keys and a threshold, -it uses legacy amino address rules. +### Deposit +Deposit defines an amount deposited by an account address to an active +proposal. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `threshold` | [uint32](#uint32) | | | -| `public_keys` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/crypto/multisig/v1beta1/multisig.proto - - - - - -### CompactBitArray -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `extra_bits_stored` | [uint32](#uint32) | | | -| `elems` | [bytes](#bytes) | | | - - - - - - - - -### MultiSignature -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `signatures` | [bytes](#bytes) | repeated | | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/crypto/secp256k1/keys.proto - - - - - -### PrivKey -PrivKey defines a secp256k1 private key. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `key` | [bytes](#bytes) | | | - - - - - - - - -### PubKey -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `key` | [bytes](#bytes) | | | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/distribution/v1beta1/distribution.proto - - - - - -### CommunityPoolSpendProposal -CommunityPoolSpendProposal details a proposal for use of community funds, -together with how many coins are proposed to be spent, and to which -recipient account. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `title` | [string](#string) | | | -| `description` | [string](#string) | | | -| `recipient` | [string](#string) | | | +| `proposal_id` | [uint64](#uint64) | | | +| `depositor` | [string](#string) | | | | `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | @@ -3059,203 +2961,593 @@ recipient account. - + -### CommunityPoolSpendProposalWithDeposit -CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal -with a deposit +### DepositParams +DepositParams defines the params for deposits on governance proposals. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `min_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Minimum deposit for a proposal to enter voting period. | +| `max_deposit_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | Maximum period for Atom holders to deposit on a proposal. Initial value: 2 months. | + + + + + + + + +### Proposal +Proposal defines the core field members of a governance proposal. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposal_id` | [uint64](#uint64) | | | +| `content` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `status` | [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) | | | +| `final_tally_result` | [TallyResult](#cosmos.gov.v1beta1.TallyResult) | | | +| `submit_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `deposit_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `total_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | +| `voting_start_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `voting_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | + + + + + + + + +### TallyParams +TallyParams defines the params for tallying votes on governance proposals. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `quorum` | [bytes](#bytes) | | Minimum percentage of total stake needed to vote for a result to be considered valid. | +| `threshold` | [bytes](#bytes) | | Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. | +| `veto_threshold` | [bytes](#bytes) | | Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Default value: 1/3. | + + + + + + + + +### TallyResult +TallyResult defines a standard tally for a governance proposal. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `yes` | [string](#string) | | | +| `abstain` | [string](#string) | | | +| `no` | [string](#string) | | | +| `no_with_veto` | [string](#string) | | | + + + + + + + + +### TextProposal +TextProposal defines a standard text proposal whose changes need to be +manually updated in case of approval. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `title` | [string](#string) | | | | `description` | [string](#string) | | | -| `recipient` | [string](#string) | | | -| `amount` | [string](#string) | | | -| `deposit` | [string](#string) | | | - + -### DelegationDelegatorReward -DelegationDelegatorReward represents the properties -of a delegator's delegation reward. +### Vote +Vote defines a vote on a governance proposal. +A Vote consists of a proposal ID, the voter, and the vote option. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `validator_address` | [string](#string) | | | -| `reward` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | +| `proposal_id` | [uint64](#uint64) | | | +| `voter` | [string](#string) | | | +| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | | - + -### DelegatorStartingInfo -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. +### VotingParams +VotingParams defines the params for voting on governance proposals. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `previous_period` | [uint64](#uint64) | | | -| `stake` | [string](#string) | | | -| `height` | [uint64](#uint64) | | | +| `voting_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | Length of the voting period. | + - -### FeePool -FeePool is the global fee pool for distribution. + + +### ProposalStatus +ProposalStatus enumerates the valid statuses of a proposal. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| PROPOSAL_STATUS_UNSPECIFIED | 0 | PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. | +| PROPOSAL_STATUS_DEPOSIT_PERIOD | 1 | PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit period. | +| PROPOSAL_STATUS_VOTING_PERIOD | 2 | PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting period. | +| PROPOSAL_STATUS_PASSED | 3 | PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has passed. | +| PROPOSAL_STATUS_REJECTED | 4 | PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has been rejected. | +| PROPOSAL_STATUS_FAILED | 5 | PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has failed. | + + + + + +### VoteOption +VoteOption enumerates the valid vote options for a given governance proposal. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| VOTE_OPTION_UNSPECIFIED | 0 | VOTE_OPTION_UNSPECIFIED defines a no-op vote option. | +| VOTE_OPTION_YES | 1 | VOTE_OPTION_YES defines a yes vote option. | +| VOTE_OPTION_ABSTAIN | 2 | VOTE_OPTION_ABSTAIN defines an abstain vote option. | +| VOTE_OPTION_NO | 3 | VOTE_OPTION_NO defines a no vote option. | +| VOTE_OPTION_NO_WITH_VETO | 4 | VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. | + + + + + + + + + + + +

Top

+ +## cosmos/gov/v1beta1/query.proto + + + + + +### QueryDepositRequest +QueryDepositRequest is the request type for the Query/Deposit RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `community_pool` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | +| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | +| `depositor` | [string](#string) | | depositor defines the deposit addresses from the proposals. | - + -### Params -Params defines the set of params for the distribution module. +### QueryDepositResponse +QueryDepositResponse is the response type for the Query/Deposit RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `community_tax` | [string](#string) | | | -| `base_proposer_reward` | [string](#string) | | | -| `bonus_proposer_reward` | [string](#string) | | | -| `withdraw_addr_enabled` | [bool](#bool) | | | +| `deposit` | [Deposit](#cosmos.gov.v1beta1.Deposit) | | deposit defines the requested deposit. | - + -### ValidatorAccumulatedCommission -ValidatorAccumulatedCommission represents accumulated commission -for a validator kept as a running counter, can be withdrawn at any time. +### QueryDepositsRequest +QueryDepositsRequest is the request type for the Query/Deposits RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `commission` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | +| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | - + -### ValidatorCurrentRewards -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. +### QueryDepositsResponse +QueryDepositsResponse is the response type for the Query/Deposits RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `rewards` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | -| `period` | [uint64](#uint64) | | | +| `deposits` | [Deposit](#cosmos.gov.v1beta1.Deposit) | repeated | | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | - + -### ValidatorHistoricalRewards -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 +### QueryParamsRequest +QueryParamsRequest is the request type for the Query/Params RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `cumulative_reward_ratio` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | -| `reference_count` | [uint32](#uint32) | | | +| `params_type` | [string](#string) | | params_type defines which parameters to query for, can be one of "voting", "tallying" or "deposit". | - + -### ValidatorOutstandingRewards -ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards -for a validator inexpensive to track, allows simple sanity checks. +### QueryParamsResponse +QueryParamsResponse is the response type for the Query/Params RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `rewards` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | +| `voting_params` | [VotingParams](#cosmos.gov.v1beta1.VotingParams) | | voting_params defines the parameters related to voting. | +| `deposit_params` | [DepositParams](#cosmos.gov.v1beta1.DepositParams) | | deposit_params defines the parameters related to deposit. | +| `tally_params` | [TallyParams](#cosmos.gov.v1beta1.TallyParams) | | tally_params defines the parameters related to tally. | - + -### ValidatorSlashEvent -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. +### QueryProposalRequest +QueryProposalRequest is the request type for the Query/Proposal RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `validator_period` | [uint64](#uint64) | | | -| `fraction` | [string](#string) | | | +| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | - + -### ValidatorSlashEvents -ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. +### QueryProposalResponse +QueryProposalResponse is the response type for the Query/Proposal RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `validator_slash_events` | [ValidatorSlashEvent](#cosmos.distribution.v1beta1.ValidatorSlashEvent) | repeated | | +| `proposal` | [Proposal](#cosmos.gov.v1beta1.Proposal) | | | + + + + + + + + +### QueryProposalsRequest +QueryProposalsRequest is the request type for the Query/Proposals RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposal_status` | [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) | | proposal_status defines the status of the proposals. | +| `voter` | [string](#string) | | voter defines the voter address for the proposals. | +| `depositor` | [string](#string) | | depositor defines the deposit addresses from the proposals. | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | + + + + + + + + +### QueryProposalsResponse +QueryProposalsResponse is the response type for the Query/Proposals RPC +method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposals` | [Proposal](#cosmos.gov.v1beta1.Proposal) | repeated | | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | + + + + + + + + +### QueryTallyResultRequest +QueryTallyResultRequest is the request type for the Query/Tally RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | + + + + + + + + +### QueryTallyResultResponse +QueryTallyResultResponse is the response type for the Query/Tally RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `tally` | [TallyResult](#cosmos.gov.v1beta1.TallyResult) | | tally defines the requested tally. | + + + + + + + + +### QueryVoteRequest +QueryVoteRequest is the request type for the Query/Vote RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | +| `voter` | [string](#string) | | voter defines the oter address for the proposals. | + + + + + + + + +### QueryVoteResponse +QueryVoteResponse is the response type for the Query/Vote RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `vote` | [Vote](#cosmos.gov.v1beta1.Vote) | | vote defined the queried vote. | + + + + + + + + +### QueryVotesRequest +QueryVotesRequest is the request type for the Query/Votes RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | + + + + + + + + +### QueryVotesResponse +QueryVotesResponse is the response type for the Query/Votes RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `votes` | [Vote](#cosmos.gov.v1beta1.Vote) | repeated | votes defined the queried votes. | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | + + + + + + + + + + + + + + +### Query +Query defines the gRPC querier service for gov module + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `Proposal` | [QueryProposalRequest](#cosmos.gov.v1beta1.QueryProposalRequest) | [QueryProposalResponse](#cosmos.gov.v1beta1.QueryProposalResponse) | Proposal queries proposal details based on ProposalID. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}| +| `Proposals` | [QueryProposalsRequest](#cosmos.gov.v1beta1.QueryProposalsRequest) | [QueryProposalsResponse](#cosmos.gov.v1beta1.QueryProposalsResponse) | Proposals queries all proposals based on given status. | GET|/cosmos/gov/v1beta1/proposals| +| `Vote` | [QueryVoteRequest](#cosmos.gov.v1beta1.QueryVoteRequest) | [QueryVoteResponse](#cosmos.gov.v1beta1.QueryVoteResponse) | Vote queries voted information based on proposalID, voterAddr. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}| +| `Votes` | [QueryVotesRequest](#cosmos.gov.v1beta1.QueryVotesRequest) | [QueryVotesResponse](#cosmos.gov.v1beta1.QueryVotesResponse) | Votes queries votes of a given proposal. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/votes| +| `Params` | [QueryParamsRequest](#cosmos.gov.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.gov.v1beta1.QueryParamsResponse) | Params queries all parameters of the gov module. | GET|/cosmos/gov/v1beta1/params/{params_type}| +| `Deposit` | [QueryDepositRequest](#cosmos.gov.v1beta1.QueryDepositRequest) | [QueryDepositResponse](#cosmos.gov.v1beta1.QueryDepositResponse) | Deposit queries single deposit information based proposalID, depositAddr. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}| +| `Deposits` | [QueryDepositsRequest](#cosmos.gov.v1beta1.QueryDepositsRequest) | [QueryDepositsResponse](#cosmos.gov.v1beta1.QueryDepositsResponse) | Deposits queries all deposits of a single proposal. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits| +| `TallyResult` | [QueryTallyResultRequest](#cosmos.gov.v1beta1.QueryTallyResultRequest) | [QueryTallyResultResponse](#cosmos.gov.v1beta1.QueryTallyResultResponse) | TallyResult queries the tally of a proposal vote. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/tally| + + + + + + +

Top

+ +## cosmos/gov/v1beta1/tx.proto + + + + + +### MsgDeposit +MsgDeposit defines a message to submit a deposit to an existing proposal. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposal_id` | [uint64](#uint64) | | | +| `depositor` | [string](#string) | | | +| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | + + + + + + + + +### MsgDepositResponse +MsgDepositResponse defines the Msg/Deposit response type. + + + + + + + + +### MsgSubmitProposal +MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary +proposal Content. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `content` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `initial_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | +| `proposer` | [string](#string) | | | + + + + + + + + +### MsgSubmitProposalResponse +MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposal_id` | [uint64](#uint64) | | | + + + + + + + + +### MsgVote +MsgVote defines a message to cast a vote. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposal_id` | [uint64](#uint64) | | | +| `voter` | [string](#string) | | | +| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | | + + + + + + + + +### MsgVoteResponse +MsgVoteResponse defines the Msg/Vote response type. + + + + + + + + + + + + + + +### Msg +Msg defines the bank Msg service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `SubmitProposal` | [MsgSubmitProposal](#cosmos.gov.v1beta1.MsgSubmitProposal) | [MsgSubmitProposalResponse](#cosmos.gov.v1beta1.MsgSubmitProposalResponse) | SubmitProposal defines a method to create new proposal given a content. | | +| `Vote` | [MsgVote](#cosmos.gov.v1beta1.MsgVote) | [MsgVoteResponse](#cosmos.gov.v1beta1.MsgVoteResponse) | Vote defines a method to add a vote on a specific proposal. | | +| `Deposit` | [MsgDeposit](#cosmos.gov.v1beta1.MsgDeposit) | [MsgDepositResponse](#cosmos.gov.v1beta1.MsgDepositResponse) | Deposit defines a method to add deposit on a specific proposal. | | + + + + + + +

Top

+ +## cosmos/gov/v1beta1/genesis.proto + + + + + +### GenesisState +GenesisState defines the gov module's genesis state. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `starting_proposal_id` | [uint64](#uint64) | | starting_proposal_id is the ID of the starting proposal. | +| `deposits` | [Deposit](#cosmos.gov.v1beta1.Deposit) | repeated | deposits defines all the deposits present at genesis. | +| `votes` | [Vote](#cosmos.gov.v1beta1.Vote) | repeated | votes defines all the votes present at genesis. | +| `proposals` | [Proposal](#cosmos.gov.v1beta1.Proposal) | repeated | proposals defines all the proposals present at genesis. | +| `deposit_params` | [DepositParams](#cosmos.gov.v1beta1.DepositParams) | | params defines all the paramaters of related to deposit. | +| `voting_params` | [VotingParams](#cosmos.gov.v1beta1.VotingParams) | | params defines all the paramaters of related to voting. | +| `tally_params` | [TallyParams](#cosmos.gov.v1beta1.TallyParams) | | params defines all the paramaters of related to tally. | @@ -3271,151 +3563,22 @@ ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. - +

Top

-## cosmos/distribution/v1beta1/genesis.proto +## cosmos/genutil/v1beta1/genesis.proto - - -### DelegatorStartingInfoRecord -DelegatorStartingInfoRecord used for import / export via genesis json. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `delegator_address` | [string](#string) | | delegator_address is the address of the delegator. | -| `validator_address` | [string](#string) | | validator_address is the address of the validator. | -| `starting_info` | [DelegatorStartingInfo](#cosmos.distribution.v1beta1.DelegatorStartingInfo) | | starting_info defines the starting info of a delegator. | - - - - - - - - -### DelegatorWithdrawInfo -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `delegator_address` | [string](#string) | | delegator_address is the address of the delegator. | -| `withdraw_address` | [string](#string) | | withdraw_address is the address to withdraw the delegation rewards to. | - - - - - - - + ### GenesisState -GenesisState defines the distribution module's genesis state. +GenesisState defines the raw genesis transaction in JSON. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `params` | [Params](#cosmos.distribution.v1beta1.Params) | | params defines all the paramaters of the module. | -| `fee_pool` | [FeePool](#cosmos.distribution.v1beta1.FeePool) | | fee_pool defines the fee pool at genesis. | -| `delegator_withdraw_infos` | [DelegatorWithdrawInfo](#cosmos.distribution.v1beta1.DelegatorWithdrawInfo) | repeated | fee_pool defines the delegator withdraw infos at genesis. | -| `previous_proposer` | [string](#string) | | fee_pool defines the previous proposer at genesis. | -| `outstanding_rewards` | [ValidatorOutstandingRewardsRecord](#cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord) | repeated | fee_pool defines the outstanding rewards of all validators at genesis. | -| `validator_accumulated_commissions` | [ValidatorAccumulatedCommissionRecord](#cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord) | repeated | fee_pool defines the accumulated commisions of all validators at genesis. | -| `validator_historical_rewards` | [ValidatorHistoricalRewardsRecord](#cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord) | repeated | fee_pool defines the historical rewards of all validators at genesis. | -| `validator_current_rewards` | [ValidatorCurrentRewardsRecord](#cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord) | repeated | fee_pool defines the current rewards of all validators at genesis. | -| `delegator_starting_infos` | [DelegatorStartingInfoRecord](#cosmos.distribution.v1beta1.DelegatorStartingInfoRecord) | repeated | fee_pool defines the delegator starting infos at genesis. | -| `validator_slash_events` | [ValidatorSlashEventRecord](#cosmos.distribution.v1beta1.ValidatorSlashEventRecord) | repeated | fee_pool defines the validator slash events at genesis. | - - - - - - - - -### ValidatorAccumulatedCommissionRecord -ValidatorAccumulatedCommissionRecord is used for import / export via genesis -json. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `validator_address` | [string](#string) | | validator_address is the address of the validator. | -| `accumulated` | [ValidatorAccumulatedCommission](#cosmos.distribution.v1beta1.ValidatorAccumulatedCommission) | | accumulated is the accumulated commission of a validator. | - - - - - - - - -### ValidatorCurrentRewardsRecord -ValidatorCurrentRewardsRecord is used for import / export via genesis json. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `validator_address` | [string](#string) | | validator_address is the address of the validator. | -| `rewards` | [ValidatorCurrentRewards](#cosmos.distribution.v1beta1.ValidatorCurrentRewards) | | rewards defines the current rewards of a validator. | - - - - - - - - -### ValidatorHistoricalRewardsRecord -ValidatorHistoricalRewardsRecord is used for import / export via genesis -json. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `validator_address` | [string](#string) | | validator_address is the address of the validator. | -| `period` | [uint64](#uint64) | | period defines the period the historical rewards apply to. | -| `rewards` | [ValidatorHistoricalRewards](#cosmos.distribution.v1beta1.ValidatorHistoricalRewards) | | rewards defines the historical rewards of a validator. | - - - - - - - - -### ValidatorOutstandingRewardsRecord -ValidatorOutstandingRewardsRecord is used for import/export via genesis json. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `validator_address` | [string](#string) | | validator_address is the address of the validator. | -| `outstanding_rewards` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | outstanding_rewards represents the oustanding rewards of a validator. | - - - - - - - - -### ValidatorSlashEventRecord -ValidatorSlashEventRecord is used for import / export via genesis json. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `validator_address` | [string](#string) | | validator_address is the address of the validator. | -| `height` | [uint64](#uint64) | | height defines the block height at which the slash event occured. | -| `period` | [uint64](#uint64) | | period is the period of the slash event. | -| `validator_slash_event` | [ValidatorSlashEvent](#cosmos.distribution.v1beta1.ValidatorSlashEvent) | | validator_slash_event describes the slash event. | +| `gen_txs` | [bytes](#bytes) | repeated | gen_txs defines the genesis transactions. | @@ -3883,57 +4046,151 @@ Msg defines the distribution Msg service. - +

Top

-## cosmos/evidence/v1beta1/evidence.proto +## cosmos/distribution/v1beta1/genesis.proto - + -### Equivocation -Equivocation implements the Evidence interface and defines evidence of double -signing misbehavior. +### DelegatorStartingInfoRecord +DelegatorStartingInfoRecord used for import / export via genesis json. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `height` | [int64](#int64) | | | -| `time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `power` | [int64](#int64) | | | -| `consensus_address` | [string](#string) | | | +| `delegator_address` | [string](#string) | | delegator_address is the address of the delegator. | +| `validator_address` | [string](#string) | | validator_address is the address of the validator. | +| `starting_info` | [DelegatorStartingInfo](#cosmos.distribution.v1beta1.DelegatorStartingInfo) | | starting_info defines the starting info of a delegator. | - - + - +### DelegatorWithdrawInfo +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. - + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `delegator_address` | [string](#string) | | delegator_address is the address of the delegator. | +| `withdraw_address` | [string](#string) | | withdraw_address is the address to withdraw the delegation rewards to. | - -

Top

- -## cosmos/evidence/v1beta1/genesis.proto - + ### GenesisState -GenesisState defines the evidence module's genesis state. +GenesisState defines the distribution module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `evidence` | [google.protobuf.Any](#google.protobuf.Any) | repeated | evidence defines all the evidence at genesis. | +| `params` | [Params](#cosmos.distribution.v1beta1.Params) | | params defines all the paramaters of the module. | +| `fee_pool` | [FeePool](#cosmos.distribution.v1beta1.FeePool) | | fee_pool defines the fee pool at genesis. | +| `delegator_withdraw_infos` | [DelegatorWithdrawInfo](#cosmos.distribution.v1beta1.DelegatorWithdrawInfo) | repeated | fee_pool defines the delegator withdraw infos at genesis. | +| `previous_proposer` | [string](#string) | | fee_pool defines the previous proposer at genesis. | +| `outstanding_rewards` | [ValidatorOutstandingRewardsRecord](#cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord) | repeated | fee_pool defines the outstanding rewards of all validators at genesis. | +| `validator_accumulated_commissions` | [ValidatorAccumulatedCommissionRecord](#cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord) | repeated | fee_pool defines the accumulated commisions of all validators at genesis. | +| `validator_historical_rewards` | [ValidatorHistoricalRewardsRecord](#cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord) | repeated | fee_pool defines the historical rewards of all validators at genesis. | +| `validator_current_rewards` | [ValidatorCurrentRewardsRecord](#cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord) | repeated | fee_pool defines the current rewards of all validators at genesis. | +| `delegator_starting_infos` | [DelegatorStartingInfoRecord](#cosmos.distribution.v1beta1.DelegatorStartingInfoRecord) | repeated | fee_pool defines the delegator starting infos at genesis. | +| `validator_slash_events` | [ValidatorSlashEventRecord](#cosmos.distribution.v1beta1.ValidatorSlashEventRecord) | repeated | fee_pool defines the validator slash events at genesis. | + + + + + + + + +### ValidatorAccumulatedCommissionRecord +ValidatorAccumulatedCommissionRecord is used for import / export via genesis +json. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `validator_address` | [string](#string) | | validator_address is the address of the validator. | +| `accumulated` | [ValidatorAccumulatedCommission](#cosmos.distribution.v1beta1.ValidatorAccumulatedCommission) | | accumulated is the accumulated commission of a validator. | + + + + + + + + +### ValidatorCurrentRewardsRecord +ValidatorCurrentRewardsRecord is used for import / export via genesis json. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `validator_address` | [string](#string) | | validator_address is the address of the validator. | +| `rewards` | [ValidatorCurrentRewards](#cosmos.distribution.v1beta1.ValidatorCurrentRewards) | | rewards defines the current rewards of a validator. | + + + + + + + + +### ValidatorHistoricalRewardsRecord +ValidatorHistoricalRewardsRecord is used for import / export via genesis +json. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `validator_address` | [string](#string) | | validator_address is the address of the validator. | +| `period` | [uint64](#uint64) | | period defines the period the historical rewards apply to. | +| `rewards` | [ValidatorHistoricalRewards](#cosmos.distribution.v1beta1.ValidatorHistoricalRewards) | | rewards defines the historical rewards of a validator. | + + + + + + + + +### ValidatorOutstandingRewardsRecord +ValidatorOutstandingRewardsRecord is used for import/export via genesis json. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `validator_address` | [string](#string) | | validator_address is the address of the validator. | +| `outstanding_rewards` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | outstanding_rewards represents the oustanding rewards of a validator. | + + + + + + + + +### ValidatorSlashEventRecord +ValidatorSlashEventRecord is used for import / export via genesis json. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `validator_address` | [string](#string) | | validator_address is the address of the validator. | +| `height` | [uint64](#uint64) | | height defines the block height at which the slash event occured. | +| `period` | [uint64](#uint64) | | period is the period of the slash event. | +| `validator_slash_event` | [ValidatorSlashEvent](#cosmos.distribution.v1beta1.ValidatorSlashEvent) | | validator_slash_event describes the slash event. | @@ -3949,203 +4206,26 @@ GenesisState defines the evidence module's genesis state. - +

Top

-## cosmos/evidence/v1beta1/query.proto +## cosmos/distribution/v1beta1/distribution.proto - + -### QueryAllEvidenceRequest -QueryEvidenceRequest is the request type for the Query/AllEvidence RPC -method. +### CommunityPoolSpendProposal +CommunityPoolSpendProposal details a proposal for use of community funds, +together with how many coins are proposed to be spent, and to which +recipient account. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | - - - - - - - - -### QueryAllEvidenceResponse -QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC -method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `evidence` | [google.protobuf.Any](#google.protobuf.Any) | repeated | evidence returns all evidences. | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | - - - - - - - - -### QueryEvidenceRequest -QueryEvidenceRequest is the request type for the Query/Evidence RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `evidence_hash` | [bytes](#bytes) | | evidence_hash defines the hash of the requested evidence. | - - - - - - - - -### QueryEvidenceResponse -QueryEvidenceResponse is the response type for the Query/Evidence RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `evidence` | [google.protobuf.Any](#google.protobuf.Any) | | evidence returns the requested evidence. | - - - - - - - - - - - - - - -### Query -Query defines the gRPC querier service. - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Evidence` | [QueryEvidenceRequest](#cosmos.evidence.v1beta1.QueryEvidenceRequest) | [QueryEvidenceResponse](#cosmos.evidence.v1beta1.QueryEvidenceResponse) | Evidence queries evidence based on evidence hash. | GET|/cosmos/evidence/v1beta1/evidence/{evidence_hash}| -| `AllEvidence` | [QueryAllEvidenceRequest](#cosmos.evidence.v1beta1.QueryAllEvidenceRequest) | [QueryAllEvidenceResponse](#cosmos.evidence.v1beta1.QueryAllEvidenceResponse) | AllEvidence queries all evidence. | GET|/cosmos/evidence/v1beta1/evidence| - - - - - - -

Top

- -## cosmos/evidence/v1beta1/tx.proto - - - - - -### MsgSubmitEvidence -MsgSubmitEvidence represents a message that supports submitting arbitrary -Evidence of misbehavior such as equivocation or counterfactual signing. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `submitter` | [string](#string) | | | -| `evidence` | [google.protobuf.Any](#google.protobuf.Any) | | | - - - - - - - - -### MsgSubmitEvidenceResponse -MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `hash` | [bytes](#bytes) | | hash defines the hash of the evidence. | - - - - - - - - - - - - - - -### Msg -Msg defines the evidence Msg service. - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `SubmitEvidence` | [MsgSubmitEvidence](#cosmos.evidence.v1beta1.MsgSubmitEvidence) | [MsgSubmitEvidenceResponse](#cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse) | SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or counterfactual signing. | | - - - - - - -

Top

- -## cosmos/genutil/v1beta1/genesis.proto - - - - - -### GenesisState -GenesisState defines the raw genesis transaction in JSON. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `gen_txs` | [bytes](#bytes) | repeated | gen_txs defines the genesis transactions. | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/gov/v1beta1/gov.proto - - - - - -### Deposit -Deposit defines an amount deposited by an account address to an active -proposal. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | | -| `depositor` | [string](#string) | | | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `recipient` | [string](#string) | | | | `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | @@ -4153,85 +4233,349 @@ proposal. - + -### DepositParams -DepositParams defines the params for deposits on governance proposals. +### CommunityPoolSpendProposalWithDeposit +CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal +with a deposit | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `min_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Minimum deposit for a proposal to enter voting period. | -| `max_deposit_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | Maximum period for Atom holders to deposit on a proposal. Initial value: 2 months. | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `recipient` | [string](#string) | | | +| `amount` | [string](#string) | | | +| `deposit` | [string](#string) | | | - + -### Proposal -Proposal defines the core field members of a governance proposal. +### DelegationDelegatorReward +DelegationDelegatorReward represents the properties +of a delegator's delegation reward. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | | -| `content` | [google.protobuf.Any](#google.protobuf.Any) | | | -| `status` | [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) | | | -| `final_tally_result` | [TallyResult](#cosmos.gov.v1beta1.TallyResult) | | | -| `submit_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `deposit_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `total_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | -| `voting_start_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `voting_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `validator_address` | [string](#string) | | | +| `reward` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | - + -### TallyParams -TallyParams defines the params for tallying votes on governance proposals. +### DelegatorStartingInfo +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. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `quorum` | [bytes](#bytes) | | Minimum percentage of total stake needed to vote for a result to be considered valid. | -| `threshold` | [bytes](#bytes) | | Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. | -| `veto_threshold` | [bytes](#bytes) | | Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Default value: 1/3. | +| `previous_period` | [uint64](#uint64) | | | +| `stake` | [string](#string) | | | +| `height` | [uint64](#uint64) | | | - + -### TallyResult -TallyResult defines a standard tally for a governance proposal. +### FeePool +FeePool is the global fee pool for distribution. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `yes` | [string](#string) | | | -| `abstain` | [string](#string) | | | -| `no` | [string](#string) | | | -| `no_with_veto` | [string](#string) | | | +| `community_pool` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | - + -### TextProposal -TextProposal defines a standard text proposal whose changes need to be -manually updated in case of approval. +### Params +Params defines the set of params for the distribution module. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `community_tax` | [string](#string) | | | +| `base_proposer_reward` | [string](#string) | | | +| `bonus_proposer_reward` | [string](#string) | | | +| `withdraw_addr_enabled` | [bool](#bool) | | | + + + + + + + + +### ValidatorAccumulatedCommission +ValidatorAccumulatedCommission represents accumulated commission +for a validator kept as a running counter, can be withdrawn at any time. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `commission` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | + + + + + + + + +### ValidatorCurrentRewards +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `rewards` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | +| `period` | [uint64](#uint64) | | | + + + + + + + + +### ValidatorHistoricalRewards +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 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `cumulative_reward_ratio` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | +| `reference_count` | [uint32](#uint32) | | | + + + + + + + + +### ValidatorOutstandingRewards +ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards +for a validator inexpensive to track, allows simple sanity checks. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `rewards` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | + + + + + + + + +### ValidatorSlashEvent +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `validator_period` | [uint64](#uint64) | | | +| `fraction` | [string](#string) | | | + + + + + + + + +### ValidatorSlashEvents +ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `validator_slash_events` | [ValidatorSlashEvent](#cosmos.distribution.v1beta1.ValidatorSlashEvent) | repeated | | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/upgrade/v1beta1/query.proto + + + + + +### QueryAppliedPlanRequest +QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC +method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `name` | [string](#string) | | name is the name of the applied plan to query for. | + + + + + + + + +### QueryAppliedPlanResponse +QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC +method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `height` | [int64](#int64) | | height is the block height at which the plan was applied. | + + + + + + + + +### QueryCurrentPlanRequest +QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC +method. + + + + + + + + +### QueryCurrentPlanResponse +QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC +method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `plan` | [Plan](#cosmos.upgrade.v1beta1.Plan) | | plan is the current upgrade plan. | + + + + + + + + +### QueryUpgradedConsensusStateRequest +QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState +RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `last_height` | [int64](#int64) | | last height of the current chain must be sent in request as this is the height under which next consensus state is stored | + + + + + + + + +### QueryUpgradedConsensusStateResponse +QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState +RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `upgraded_consensus_state` | [google.protobuf.Any](#google.protobuf.Any) | | | + + + + + + + + + + + + + + +### Query +Query defines the gRPC upgrade querier service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `CurrentPlan` | [QueryCurrentPlanRequest](#cosmos.upgrade.v1beta1.QueryCurrentPlanRequest) | [QueryCurrentPlanResponse](#cosmos.upgrade.v1beta1.QueryCurrentPlanResponse) | CurrentPlan queries the current upgrade plan. | GET|/cosmos/upgrade/v1beta1/current_plan| +| `AppliedPlan` | [QueryAppliedPlanRequest](#cosmos.upgrade.v1beta1.QueryAppliedPlanRequest) | [QueryAppliedPlanResponse](#cosmos.upgrade.v1beta1.QueryAppliedPlanResponse) | AppliedPlan queries a previously applied upgrade plan by its name. | GET|/cosmos/upgrade/v1beta1/applied_plan/{name}| +| `UpgradedConsensusState` | [QueryUpgradedConsensusStateRequest](#cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest) | [QueryUpgradedConsensusStateResponse](#cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse) | 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 | GET|/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}| + + + + + + +

Top

+ +## cosmos/upgrade/v1beta1/upgrade.proto + + + + + +### CancelSoftwareUpgradeProposal +CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software +upgrade. | Field | Type | Label | Description | @@ -4244,101 +4588,37 @@ manually updated in case of approval. - + -### Vote -Vote defines a vote on a governance proposal. -A Vote consists of a proposal ID, the voter, and the vote option. +### Plan +Plan specifies information about a planned upgrade and when it should occur. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | | -| `voter` | [string](#string) | | | -| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | | +| `name` | [string](#string) | | 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. | +| `time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | The time after which the upgrade must be performed. Leave set to its zero value to use a pre-defined Height instead. | +| `height` | [int64](#int64) | | The height at which the upgrade must be performed. Only used if Time is not set. | +| `info` | [string](#string) | | Any application specific upgrade info to be included on-chain such as a git commit that validators could automatically upgrade to | +| `upgraded_client_state` | [google.protobuf.Any](#google.protobuf.Any) | | IBC-enabled chains can opt-in to including the upgraded client state in its upgrade plan 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 | - + -### VotingParams -VotingParams defines the params for voting on governance proposals. +### SoftwareUpgradeProposal +SoftwareUpgradeProposal is a gov Content type for initiating a software +upgrade. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `voting_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | Length of the voting period. | - - - - - - - - - - -### ProposalStatus -ProposalStatus enumerates the valid statuses of a proposal. - -| Name | Number | Description | -| ---- | ------ | ----------- | -| PROPOSAL_STATUS_UNSPECIFIED | 0 | PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. | -| PROPOSAL_STATUS_DEPOSIT_PERIOD | 1 | PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit period. | -| PROPOSAL_STATUS_VOTING_PERIOD | 2 | PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting period. | -| PROPOSAL_STATUS_PASSED | 3 | PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has passed. | -| PROPOSAL_STATUS_REJECTED | 4 | PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has been rejected. | -| PROPOSAL_STATUS_FAILED | 5 | PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has failed. | - - - - - -### VoteOption -VoteOption enumerates the valid vote options for a given governance proposal. - -| Name | Number | Description | -| ---- | ------ | ----------- | -| VOTE_OPTION_UNSPECIFIED | 0 | VOTE_OPTION_UNSPECIFIED defines a no-op vote option. | -| VOTE_OPTION_YES | 1 | VOTE_OPTION_YES defines a yes vote option. | -| VOTE_OPTION_ABSTAIN | 2 | VOTE_OPTION_ABSTAIN defines an abstain vote option. | -| VOTE_OPTION_NO | 3 | VOTE_OPTION_NO defines a no vote option. | -| VOTE_OPTION_NO_WITH_VETO | 4 | VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. | - - - - - - - - - - - -

Top

- -## cosmos/gov/v1beta1/genesis.proto - - - - - -### GenesisState -GenesisState defines the gov module's genesis state. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `starting_proposal_id` | [uint64](#uint64) | | starting_proposal_id is the ID of the starting proposal. | -| `deposits` | [Deposit](#cosmos.gov.v1beta1.Deposit) | repeated | deposits defines all the deposits present at genesis. | -| `votes` | [Vote](#cosmos.gov.v1beta1.Vote) | repeated | votes defines all the votes present at genesis. | -| `proposals` | [Proposal](#cosmos.gov.v1beta1.Proposal) | repeated | proposals defines all the proposals present at genesis. | -| `deposit_params` | [DepositParams](#cosmos.gov.v1beta1.DepositParams) | | params defines all the paramaters of related to deposit. | -| `voting_params` | [VotingParams](#cosmos.gov.v1beta1.VotingParams) | | params defines all the paramaters of related to voting. | -| `tally_params` | [TallyParams](#cosmos.gov.v1beta1.TallyParams) | | params defines all the paramaters of related to tally. | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `plan` | [Plan](#cosmos.upgrade.v1beta1.Plan) | | | @@ -4354,444 +4634,38 @@ GenesisState defines the gov module's genesis state. - +

Top

-## cosmos/gov/v1beta1/query.proto +## cosmos/base/kv/v1beta1/kv.proto - + -### QueryDepositRequest -QueryDepositRequest is the request type for the Query/Deposit RPC method. +### Pair +Pair defines a key/value bytes tuple. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | -| `depositor` | [string](#string) | | depositor defines the deposit addresses from the proposals. | +| `key` | [bytes](#bytes) | | | +| `value` | [bytes](#bytes) | | | - + -### QueryDepositResponse -QueryDepositResponse is the response type for the Query/Deposit RPC method. +### Pairs +Pairs defines a repeated slice of Pair objects. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `deposit` | [Deposit](#cosmos.gov.v1beta1.Deposit) | | deposit defines the requested deposit. | - - - - - - - - -### QueryDepositsRequest -QueryDepositsRequest is the request type for the Query/Deposits RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | - - - - - - - - -### QueryDepositsResponse -QueryDepositsResponse is the response type for the Query/Deposits RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `deposits` | [Deposit](#cosmos.gov.v1beta1.Deposit) | repeated | | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | - - - - - - - - -### QueryParamsRequest -QueryParamsRequest is the request type for the Query/Params RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `params_type` | [string](#string) | | params_type defines which parameters to query for, can be one of "voting", "tallying" or "deposit". | - - - - - - - - -### QueryParamsResponse -QueryParamsResponse is the response type for the Query/Params RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `voting_params` | [VotingParams](#cosmos.gov.v1beta1.VotingParams) | | voting_params defines the parameters related to voting. | -| `deposit_params` | [DepositParams](#cosmos.gov.v1beta1.DepositParams) | | deposit_params defines the parameters related to deposit. | -| `tally_params` | [TallyParams](#cosmos.gov.v1beta1.TallyParams) | | tally_params defines the parameters related to tally. | - - - - - - - - -### QueryProposalRequest -QueryProposalRequest is the request type for the Query/Proposal RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | - - - - - - - - -### QueryProposalResponse -QueryProposalResponse is the response type for the Query/Proposal RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal` | [Proposal](#cosmos.gov.v1beta1.Proposal) | | | - - - - - - - - -### QueryProposalsRequest -QueryProposalsRequest is the request type for the Query/Proposals RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_status` | [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) | | proposal_status defines the status of the proposals. | -| `voter` | [string](#string) | | voter defines the voter address for the proposals. | -| `depositor` | [string](#string) | | depositor defines the deposit addresses from the proposals. | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | - - - - - - - - -### QueryProposalsResponse -QueryProposalsResponse is the response type for the Query/Proposals RPC -method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposals` | [Proposal](#cosmos.gov.v1beta1.Proposal) | repeated | | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | - - - - - - - - -### QueryTallyResultRequest -QueryTallyResultRequest is the request type for the Query/Tally RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | - - - - - - - - -### QueryTallyResultResponse -QueryTallyResultResponse is the response type for the Query/Tally RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `tally` | [TallyResult](#cosmos.gov.v1beta1.TallyResult) | | tally defines the requested tally. | - - - - - - - - -### QueryVoteRequest -QueryVoteRequest is the request type for the Query/Vote RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | -| `voter` | [string](#string) | | voter defines the oter address for the proposals. | - - - - - - - - -### QueryVoteResponse -QueryVoteResponse is the response type for the Query/Vote RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `vote` | [Vote](#cosmos.gov.v1beta1.Vote) | | vote defined the queried vote. | - - - - - - - - -### QueryVotesRequest -QueryVotesRequest is the request type for the Query/Votes RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | - - - - - - - - -### QueryVotesResponse -QueryVotesResponse is the response type for the Query/Votes RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `votes` | [Vote](#cosmos.gov.v1beta1.Vote) | repeated | votes defined the queried votes. | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | - - - - - - - - - - - - - - -### Query -Query defines the gRPC querier service for gov module - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Proposal` | [QueryProposalRequest](#cosmos.gov.v1beta1.QueryProposalRequest) | [QueryProposalResponse](#cosmos.gov.v1beta1.QueryProposalResponse) | Proposal queries proposal details based on ProposalID. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}| -| `Proposals` | [QueryProposalsRequest](#cosmos.gov.v1beta1.QueryProposalsRequest) | [QueryProposalsResponse](#cosmos.gov.v1beta1.QueryProposalsResponse) | Proposals queries all proposals based on given status. | GET|/cosmos/gov/v1beta1/proposals| -| `Vote` | [QueryVoteRequest](#cosmos.gov.v1beta1.QueryVoteRequest) | [QueryVoteResponse](#cosmos.gov.v1beta1.QueryVoteResponse) | Vote queries voted information based on proposalID, voterAddr. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}| -| `Votes` | [QueryVotesRequest](#cosmos.gov.v1beta1.QueryVotesRequest) | [QueryVotesResponse](#cosmos.gov.v1beta1.QueryVotesResponse) | Votes queries votes of a given proposal. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/votes| -| `Params` | [QueryParamsRequest](#cosmos.gov.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.gov.v1beta1.QueryParamsResponse) | Params queries all parameters of the gov module. | GET|/cosmos/gov/v1beta1/params/{params_type}| -| `Deposit` | [QueryDepositRequest](#cosmos.gov.v1beta1.QueryDepositRequest) | [QueryDepositResponse](#cosmos.gov.v1beta1.QueryDepositResponse) | Deposit queries single deposit information based proposalID, depositAddr. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}| -| `Deposits` | [QueryDepositsRequest](#cosmos.gov.v1beta1.QueryDepositsRequest) | [QueryDepositsResponse](#cosmos.gov.v1beta1.QueryDepositsResponse) | Deposits queries all deposits of a single proposal. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits| -| `TallyResult` | [QueryTallyResultRequest](#cosmos.gov.v1beta1.QueryTallyResultRequest) | [QueryTallyResultResponse](#cosmos.gov.v1beta1.QueryTallyResultResponse) | TallyResult queries the tally of a proposal vote. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/tally| - - - - - - -

Top

- -## cosmos/gov/v1beta1/tx.proto - - - - - -### MsgDeposit -MsgDeposit defines a message to submit a deposit to an existing proposal. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | | -| `depositor` | [string](#string) | | | -| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | - - - - - - - - -### MsgDepositResponse -MsgDepositResponse defines the Msg/Deposit response type. - - - - - - - - -### MsgSubmitProposal -MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary -proposal Content. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `content` | [google.protobuf.Any](#google.protobuf.Any) | | | -| `initial_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | -| `proposer` | [string](#string) | | | - - - - - - - - -### MsgSubmitProposalResponse -MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | | - - - - - - - - -### MsgVote -MsgVote defines a message to cast a vote. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | | -| `voter` | [string](#string) | | | -| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | | - - - - - - - - -### MsgVoteResponse -MsgVoteResponse defines the Msg/Vote response type. - - - - - - - - - - - - - - -### Msg -Msg defines the bank Msg service. - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `SubmitProposal` | [MsgSubmitProposal](#cosmos.gov.v1beta1.MsgSubmitProposal) | [MsgSubmitProposalResponse](#cosmos.gov.v1beta1.MsgSubmitProposalResponse) | SubmitProposal defines a method to create new proposal given a content. | | -| `Vote` | [MsgVote](#cosmos.gov.v1beta1.MsgVote) | [MsgVoteResponse](#cosmos.gov.v1beta1.MsgVoteResponse) | Vote defines a method to add a vote on a specific proposal. | | -| `Deposit` | [MsgDeposit](#cosmos.gov.v1beta1.MsgDeposit) | [MsgDepositResponse](#cosmos.gov.v1beta1.MsgDepositResponse) | Deposit defines a method to add deposit on a specific proposal. | | - - - - - - -

Top

- -## cosmos/mint/v1beta1/mint.proto - - - - - -### Minter -Minter represents the minting state. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `inflation` | [string](#string) | | current annual inflation rate | -| `annual_provisions` | [string](#string) | | current annual expected provisions | - - - - - - - - -### Params -Params holds parameters for the mint module. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `mint_denom` | [string](#string) | | type of coin to mint | -| `inflation_rate_change` | [string](#string) | | maximum annual change in inflation rate | -| `inflation_max` | [string](#string) | | maximum inflation rate | -| `inflation_min` | [string](#string) | | minimum inflation rate | -| `goal_bonded` | [string](#string) | | goal of percent bonded atoms | -| `blocks_per_year` | [uint64](#uint64) | | expected blocks per year | +| `pairs` | [Pair](#cosmos.base.kv.v1beta1.Pair) | repeated | | @@ -4807,161 +4681,39 @@ Params holds parameters for the mint module. - +

Top

-## cosmos/mint/v1beta1/genesis.proto +## cosmos/base/abci/v1beta1/abci.proto - + -### GenesisState -GenesisState defines the mint module's genesis state. +### ABCIMessageLog +ABCIMessageLog defines a structure containing an indexed tx ABCI message log. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `minter` | [Minter](#cosmos.mint.v1beta1.Minter) | | minter is a space for holding current inflation information. | -| `params` | [Params](#cosmos.mint.v1beta1.Params) | | params defines all the paramaters of the module. | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/mint/v1beta1/query.proto - - - - - -### QueryAnnualProvisionsRequest -QueryAnnualProvisionsRequest is the request type for the -Query/AnnualProvisions RPC method. +| `msg_index` | [uint32](#uint32) | | | +| `log` | [string](#string) | | | +| `events` | [StringEvent](#cosmos.base.abci.v1beta1.StringEvent) | repeated | Events contains a slice of Event objects that were emitted during some execution. | - + -### QueryAnnualProvisionsResponse -QueryAnnualProvisionsResponse is the response type for the -Query/AnnualProvisions RPC method. +### Attribute +Attribute defines an attribute wrapper where the key and value are +strings instead of raw bytes. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `annual_provisions` | [bytes](#bytes) | | annual_provisions is the current minting annual provisions value. | - - - - - - - - -### QueryInflationRequest -QueryInflationRequest is the request type for the Query/Inflation RPC method. - - - - - - - - -### QueryInflationResponse -QueryInflationResponse is the response type for the Query/Inflation RPC -method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `inflation` | [bytes](#bytes) | | inflation is the current minting inflation value. | - - - - - - - - -### QueryParamsRequest -QueryParamsRequest is the request type for the Query/Params RPC method. - - - - - - - - -### QueryParamsResponse -QueryParamsResponse is the response type for the Query/Params RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `params` | [Params](#cosmos.mint.v1beta1.Params) | | params defines the parameters of the module. | - - - - - - - - - - - - - - -### Query -Query provides defines the gRPC querier service. - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Params` | [QueryParamsRequest](#cosmos.mint.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.mint.v1beta1.QueryParamsResponse) | Params returns the total set of minting parameters. | GET|/cosmos/mint/v1beta1/params| -| `Inflation` | [QueryInflationRequest](#cosmos.mint.v1beta1.QueryInflationRequest) | [QueryInflationResponse](#cosmos.mint.v1beta1.QueryInflationResponse) | Inflation returns the current minting inflation value. | GET|/cosmos/mint/v1beta1/inflation| -| `AnnualProvisions` | [QueryAnnualProvisionsRequest](#cosmos.mint.v1beta1.QueryAnnualProvisionsRequest) | [QueryAnnualProvisionsResponse](#cosmos.mint.v1beta1.QueryAnnualProvisionsResponse) | AnnualProvisions current minting annual provisions value. | GET|/cosmos/mint/v1beta1/annual_provisions| - - - - - - -

Top

- -## cosmos/params/v1beta1/params.proto - - - - - -### ParamChange -ParamChange defines an individual parameter change, for use in -ParameterChangeProposal. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `subspace` | [string](#string) | | | | `key` | [string](#string) | | | | `value` | [string](#string) | | | @@ -4970,17 +4722,147 @@ ParameterChangeProposal. - + -### ParameterChangeProposal -ParameterChangeProposal defines a proposal to change one or more parameters. +### GasInfo +GasInfo defines tx execution gas context. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `title` | [string](#string) | | | -| `description` | [string](#string) | | | -| `changes` | [ParamChange](#cosmos.params.v1beta1.ParamChange) | repeated | | +| `gas_wanted` | [uint64](#uint64) | | GasWanted is the maximum units of work we allow this tx to perform. | +| `gas_used` | [uint64](#uint64) | | GasUsed is the amount of gas actually consumed. | + + + + + + + + +### MsgData +MsgData defines the data returned in a Result object during message +execution. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `msg_type` | [string](#string) | | | +| `data` | [bytes](#bytes) | | | + + + + + + + + +### Result +Result is the union of ResponseFormat and ResponseCheckTx. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `data` | [bytes](#bytes) | | Data is any data returned from message or handler execution. It MUST be length prefixed in order to separate data from multiple message executions. | +| `log` | [string](#string) | | Log contains the log information from message or handler execution. | +| `events` | [tendermint.abci.Event](#tendermint.abci.Event) | repeated | Events contains a slice of Event objects that were emitted during message or handler execution. | + + + + + + + + +### SearchTxsResult +SearchTxsResult defines a structure for querying txs pageable + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `total_count` | [uint64](#uint64) | | Count of all txs | +| `count` | [uint64](#uint64) | | Count of txs in current page | +| `page_number` | [uint64](#uint64) | | Index of current page, start from 1 | +| `page_total` | [uint64](#uint64) | | Count of total pages | +| `limit` | [uint64](#uint64) | | Max count txs per page | +| `txs` | [TxResponse](#cosmos.base.abci.v1beta1.TxResponse) | repeated | List of txs in current page | + + + + + + + + +### SimulationResponse +SimulationResponse defines the response generated when a transaction is +successfully simulated. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `gas_info` | [GasInfo](#cosmos.base.abci.v1beta1.GasInfo) | | | +| `result` | [Result](#cosmos.base.abci.v1beta1.Result) | | | + + + + + + + + +### StringEvent +StringEvent defines en Event object wrapper where all the attributes +contain key/value pairs that are strings instead of raw bytes. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `type` | [string](#string) | | | +| `attributes` | [Attribute](#cosmos.base.abci.v1beta1.Attribute) | repeated | | + + + + + + + + +### TxMsgData +TxMsgData defines a list of MsgData. A transaction will have a MsgData object +for each message. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `data` | [MsgData](#cosmos.base.abci.v1beta1.MsgData) | repeated | | + + + + + + + + +### TxResponse +TxResponse defines a structure containing relevant tx data and metadata. The +tags are stringified and the log is JSON decoded. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `height` | [int64](#int64) | | The block height | +| `txhash` | [string](#string) | | The transaction hash. | +| `codespace` | [string](#string) | | Namespace for the Code | +| `code` | [uint32](#uint32) | | Response code. | +| `data` | [string](#string) | | Result bytes, if any. | +| `raw_log` | [string](#string) | | The output of the application's logger (raw string). May be non-deterministic. | +| `logs` | [ABCIMessageLog](#cosmos.base.abci.v1beta1.ABCIMessageLog) | repeated | The output of the application's logger (typed). May be non-deterministic. | +| `info` | [string](#string) | | Additional information. May be non-deterministic. | +| `gas_wanted` | [int64](#int64) | | Amount of gas requested for transaction. | +| `gas_used` | [int64](#int64) | | Amount of gas consumed by transaction. | +| `tx` | [google.protobuf.Any](#google.protobuf.Any) | | The request transaction bytes. | +| `timestamp` | [string](#string) | | 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. | @@ -4996,38 +4878,514 @@ ParameterChangeProposal defines a proposal to change one or more parameters. - +

Top

-## cosmos/params/v1beta1/query.proto +## cosmos/base/query/v1beta1/pagination.proto - + -### QueryParamsRequest -QueryParamsRequest is request type for the Query/Params RPC method. +### PageRequest +PageRequest is to be embedded in gRPC request messages for efficient +pagination. Ex: + + message SomeRequest { + Foo some_parameter = 1; + PageRequest pagination = 2; + } | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `subspace` | [string](#string) | | subspace defines the module to query the parameter for. | -| `key` | [string](#string) | | key defines the key of the parameter in the subspace. | +| `key` | [bytes](#bytes) | | key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set. | +| `offset` | [uint64](#uint64) | | offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set. | +| `limit` | [uint64](#uint64) | | limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app. | +| `count_total` | [bool](#bool) | | 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. | - + -### QueryParamsResponse -QueryParamsResponse is response type for the Query/Params RPC method. +### PageResponse +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; + } | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `param` | [ParamChange](#cosmos.params.v1beta1.ParamChange) | | param defines the queried parameter. | +| `next_key` | [bytes](#bytes) | | next_key is the key to be passed to PageRequest.key to query the next page most efficiently | +| `total` | [uint64](#uint64) | | total is total number of results available if PageRequest.count_total was set, its value is undefined otherwise | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/base/store/v1beta1/snapshot.proto + + + + + +### SnapshotIAVLItem +SnapshotIAVLItem is an exported IAVL node. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `key` | [bytes](#bytes) | | | +| `value` | [bytes](#bytes) | | | +| `version` | [int64](#int64) | | | +| `height` | [int32](#int32) | | | + + + + + + + + +### SnapshotItem +SnapshotItem is an item contained in a rootmulti.Store snapshot. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `store` | [SnapshotStoreItem](#cosmos.base.store.v1beta1.SnapshotStoreItem) | | | +| `iavl` | [SnapshotIAVLItem](#cosmos.base.store.v1beta1.SnapshotIAVLItem) | | | + + + + + + + + +### SnapshotStoreItem +SnapshotStoreItem contains metadata about a snapshotted store. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `name` | [string](#string) | | | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/base/store/v1beta1/commit_info.proto + + + + + +### CommitID +CommitID defines the committment information when a specific store is +committed. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `version` | [int64](#int64) | | | +| `hash` | [bytes](#bytes) | | | + + + + + + + + +### CommitInfo +CommitInfo defines commit information used by the multi-store when committing +a version/height. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `version` | [int64](#int64) | | | +| `store_infos` | [StoreInfo](#cosmos.base.store.v1beta1.StoreInfo) | repeated | | + + + + + + + + +### StoreInfo +StoreInfo defines store-specific commit information. It contains a reference +between a store name and the commit ID. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `name` | [string](#string) | | | +| `commit_id` | [CommitID](#cosmos.base.store.v1beta1.CommitID) | | | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/base/v1beta1/coin.proto + + + + + +### Coin +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `denom` | [string](#string) | | | +| `amount` | [string](#string) | | | + + + + + + + + +### DecCoin +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `denom` | [string](#string) | | | +| `amount` | [string](#string) | | | + + + + + + + + +### DecProto +DecProto defines a Protobuf wrapper around a Dec object. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `dec` | [string](#string) | | | + + + + + + + + +### IntProto +IntProto defines a Protobuf wrapper around an Int object. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `int` | [string](#string) | | | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/base/tendermint/v1beta1/query.proto + + + + + +### GetBlockByHeightRequest +GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `height` | [int64](#int64) | | | + + + + + + + + +### GetBlockByHeightResponse +GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `block_id` | [tendermint.types.BlockID](#tendermint.types.BlockID) | | | +| `block` | [tendermint.types.Block](#tendermint.types.Block) | | | + + + + + + + + +### GetLatestBlockRequest +GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. + + + + + + + + +### GetLatestBlockResponse +GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `block_id` | [tendermint.types.BlockID](#tendermint.types.BlockID) | | | +| `block` | [tendermint.types.Block](#tendermint.types.Block) | | | + + + + + + + + +### GetLatestValidatorSetRequest +GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an pagination for the request. | + + + + + + + + +### GetLatestValidatorSetResponse +GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `block_height` | [int64](#int64) | | | +| `validators` | [Validator](#cosmos.base.tendermint.v1beta1.Validator) | repeated | | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines an pagination for the response. | + + + + + + + + +### GetNodeInfoRequest +GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. + + + + + + + + +### GetNodeInfoResponse +GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `default_node_info` | [tendermint.p2p.DefaultNodeInfo](#tendermint.p2p.DefaultNodeInfo) | | | +| `application_version` | [VersionInfo](#cosmos.base.tendermint.v1beta1.VersionInfo) | | | + + + + + + + + +### GetSyncingRequest +GetSyncingRequest is the request type for the Query/GetSyncing RPC method. + + + + + + + + +### GetSyncingResponse +GetSyncingResponse is the response type for the Query/GetSyncing RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `syncing` | [bool](#bool) | | | + + + + + + + + +### GetValidatorSetByHeightRequest +GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `height` | [int64](#int64) | | | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an pagination for the request. | + + + + + + + + +### GetValidatorSetByHeightResponse +GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `block_height` | [int64](#int64) | | | +| `validators` | [Validator](#cosmos.base.tendermint.v1beta1.Validator) | repeated | | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines an pagination for the response. | + + + + + + + + +### Module +Module is the type for VersionInfo + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `path` | [string](#string) | | module path | +| `version` | [string](#string) | | module version | +| `sum` | [string](#string) | | checksum | + + + + + + + + +### Validator +Validator is the type for the validator-set. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `address` | [string](#string) | | | +| `pub_key` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `voting_power` | [int64](#int64) | | | +| `proposer_priority` | [int64](#int64) | | | + + + + + + + + +### VersionInfo +VersionInfo is the type for the GetNodeInfoResponse message. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `name` | [string](#string) | | | +| `app_name` | [string](#string) | | | +| `version` | [string](#string) | | | +| `git_commit` | [string](#string) | | | +| `build_tags` | [string](#string) | | | +| `go_version` | [string](#string) | | | +| `build_deps` | [Module](#cosmos.base.tendermint.v1beta1.Module) | repeated | | @@ -5040,14 +5398,153 @@ QueryParamsResponse is response type for the Query/Params RPC method. - + -### Query -Query defines the gRPC querier service. +### Service +Service defines the gRPC querier service for tendermint queries. | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Params` | [QueryParamsRequest](#cosmos.params.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.params.v1beta1.QueryParamsResponse) | Params queries a specific parameter of a module, given its subspace and key. | GET|/cosmos/params/v1beta1/params| +| `GetNodeInfo` | [GetNodeInfoRequest](#cosmos.base.tendermint.v1beta1.GetNodeInfoRequest) | [GetNodeInfoResponse](#cosmos.base.tendermint.v1beta1.GetNodeInfoResponse) | GetNodeInfo queries the current node info. | GET|/cosmos/base/tendermint/v1beta1/node_info| +| `GetSyncing` | [GetSyncingRequest](#cosmos.base.tendermint.v1beta1.GetSyncingRequest) | [GetSyncingResponse](#cosmos.base.tendermint.v1beta1.GetSyncingResponse) | GetSyncing queries node syncing. | GET|/cosmos/base/tendermint/v1beta1/syncing| +| `GetLatestBlock` | [GetLatestBlockRequest](#cosmos.base.tendermint.v1beta1.GetLatestBlockRequest) | [GetLatestBlockResponse](#cosmos.base.tendermint.v1beta1.GetLatestBlockResponse) | GetLatestBlock returns the latest block. | GET|/cosmos/base/tendermint/v1beta1/blocks/latest| +| `GetBlockByHeight` | [GetBlockByHeightRequest](#cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest) | [GetBlockByHeightResponse](#cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse) | GetBlockByHeight queries block for given height. | GET|/cosmos/base/tendermint/v1beta1/blocks/{height}| +| `GetLatestValidatorSet` | [GetLatestValidatorSetRequest](#cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest) | [GetLatestValidatorSetResponse](#cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse) | GetLatestValidatorSet queries latest validator-set. | GET|/cosmos/base/tendermint/v1beta1/validatorsets/latest| +| `GetValidatorSetByHeight` | [GetValidatorSetByHeightRequest](#cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest) | [GetValidatorSetByHeightResponse](#cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse) | GetValidatorSetByHeight queries validator-set at a given height. | GET|/cosmos/base/tendermint/v1beta1/validatorsets/{height}| + + + + + + +

Top

+ +## cosmos/base/snapshots/v1beta1/snapshot.proto + + + + + +### Metadata +Metadata contains SDK-specific snapshot metadata. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `chunk_hashes` | [bytes](#bytes) | repeated | SHA-256 chunk hashes | + + + + + + + + +### Snapshot +Snapshot contains Tendermint state sync snapshot info. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `height` | [uint64](#uint64) | | | +| `format` | [uint32](#uint32) | | | +| `chunks` | [uint32](#uint32) | | | +| `hash` | [bytes](#bytes) | | | +| `metadata` | [Metadata](#cosmos.base.snapshots.v1beta1.Metadata) | | | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/base/reflection/v1beta1/reflection.proto + + + + + +### ListAllInterfacesRequest +ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. + + + + + + + + +### ListAllInterfacesResponse +ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `interface_names` | [string](#string) | repeated | interface_names is an array of all the registered interfaces. | + + + + + + + + +### ListImplementationsRequest +ListImplementationsRequest is the request type of the ListImplementations +RPC. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `interface_name` | [string](#string) | | interface_name defines the interface to query the implementations for. | + + + + + + + + +### ListImplementationsResponse +ListImplementationsResponse is the response type of the ListImplementations +RPC. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `implementation_message_names` | [string](#string) | repeated | | + + + + + + + + + + + + + + +### ReflectionService +ReflectionService defines a service for interface reflection. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `ListAllInterfaces` | [ListAllInterfacesRequest](#cosmos.base.reflection.v1beta1.ListAllInterfacesRequest) | [ListAllInterfacesResponse](#cosmos.base.reflection.v1beta1.ListAllInterfacesResponse) | ListAllInterfaces lists all the interfaces registered in the interface registry. | GET|/cosmos/base/reflection/v1beta1/interfaces| +| `ListImplementations` | [ListImplementationsRequest](#cosmos.base.reflection.v1beta1.ListImplementationsRequest) | [ListImplementationsResponse](#cosmos.base.reflection.v1beta1.ListImplementationsResponse) | ListImplementations list all the concrete types that implement a given interface. | GET|/cosmos/base/reflection/v1beta1/interfaces/{interface_name}/implementations| @@ -5099,88 +5596,6 @@ liveness activity. - - - - - - - - - - - -

Top

- -## cosmos/slashing/v1beta1/genesis.proto - - - - - -### GenesisState -GenesisState defines the slashing module's genesis state. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `params` | [Params](#cosmos.slashing.v1beta1.Params) | | params defines all the paramaters of related to deposit. | -| `signing_infos` | [SigningInfo](#cosmos.slashing.v1beta1.SigningInfo) | repeated | signing_infos represents a map between validator addresses and their signing infos. | -| `missed_blocks` | [ValidatorMissedBlocks](#cosmos.slashing.v1beta1.ValidatorMissedBlocks) | repeated | signing_infos represents a map between validator addresses and their missed blocks. | - - - - - - - - -### MissedBlock -MissedBlock contains height and missed status as boolean. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `index` | [int64](#int64) | | index is the height at which the block was missed. | -| `missed` | [bool](#bool) | | missed is the missed status. | - - - - - - - - -### SigningInfo -SigningInfo stores validator signing info of corresponding address. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | address is the validator address. | -| `validator_signing_info` | [ValidatorSigningInfo](#cosmos.slashing.v1beta1.ValidatorSigningInfo) | | validator_signing_info represents the signing info of this validator. | - - - - - - - - -### ValidatorMissedBlocks -ValidatorMissedBlocks contains array of missed blocks of corresponding -address. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | address is the validator address. | -| `missed_blocks` | [MissedBlock](#cosmos.slashing.v1beta1.MissedBlock) | repeated | missed_blocks is an array of missed blocks by the validator. | - - - - - @@ -5360,375 +5775,73 @@ Msg defines the slashing Msg service. - +

Top

-## cosmos/staking/v1beta1/staking.proto +## cosmos/slashing/v1beta1/genesis.proto - + -### Commission -Commission defines commission parameters for a given validator. +### GenesisState +GenesisState defines the slashing module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `commission_rates` | [CommissionRates](#cosmos.staking.v1beta1.CommissionRates) | | | -| `update_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `params` | [Params](#cosmos.slashing.v1beta1.Params) | | params defines all the paramaters of related to deposit. | +| `signing_infos` | [SigningInfo](#cosmos.slashing.v1beta1.SigningInfo) | repeated | signing_infos represents a map between validator addresses and their signing infos. | +| `missed_blocks` | [ValidatorMissedBlocks](#cosmos.slashing.v1beta1.ValidatorMissedBlocks) | repeated | signing_infos represents a map between validator addresses and their missed blocks. | - + -### CommissionRates -CommissionRates defines the initial commission rates to be used for creating -a validator. +### MissedBlock +MissedBlock contains height and missed status as boolean. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `rate` | [string](#string) | | | -| `max_rate` | [string](#string) | | | -| `max_change_rate` | [string](#string) | | | +| `index` | [int64](#int64) | | index is the height at which the block was missed. | +| `missed` | [bool](#bool) | | missed is the missed status. | - + -### DVPair -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. +### SigningInfo +SigningInfo stores validator signing info of corresponding address. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `delegator_address` | [string](#string) | | | -| `validator_address` | [string](#string) | | | +| `address` | [string](#string) | | address is the validator address. | +| `validator_signing_info` | [ValidatorSigningInfo](#cosmos.slashing.v1beta1.ValidatorSigningInfo) | | validator_signing_info represents the signing info of this validator. | - + -### DVPairs -DVPairs defines an array of DVPair objects. +### ValidatorMissedBlocks +ValidatorMissedBlocks contains array of missed blocks of corresponding +address. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `pairs` | [DVPair](#cosmos.staking.v1beta1.DVPair) | repeated | | - - - - - - - - -### DVVTriplet -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `delegator_address` | [string](#string) | | | -| `validator_src_address` | [string](#string) | | | -| `validator_dst_address` | [string](#string) | | | - - - - - - - - -### DVVTriplets -DVVTriplets defines an array of DVVTriplet objects. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `triplets` | [DVVTriplet](#cosmos.staking.v1beta1.DVVTriplet) | repeated | | - - - - - - - - -### Delegation -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `delegator_address` | [string](#string) | | | -| `validator_address` | [string](#string) | | | -| `shares` | [string](#string) | | | - - - - - - - - -### DelegationResponse -DelegationResponse is equivalent to Delegation except that it contains a -balance in addition to shares which is more suitable for client responses. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `delegation` | [Delegation](#cosmos.staking.v1beta1.Delegation) | | | -| `balance` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | | - - - - - - - - -### Description -Description defines a validator description. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `moniker` | [string](#string) | | | -| `identity` | [string](#string) | | | -| `website` | [string](#string) | | | -| `security_contact` | [string](#string) | | | -| `details` | [string](#string) | | | - - - - - - - - -### HistoricalInfo -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). - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `header` | [tendermint.types.Header](#tendermint.types.Header) | | | -| `valset` | [Validator](#cosmos.staking.v1beta1.Validator) | repeated | | - - - - - - - - -### Params -Params defines the parameters for the staking module. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `unbonding_time` | [google.protobuf.Duration](#google.protobuf.Duration) | | | -| `max_validators` | [uint32](#uint32) | | | -| `max_entries` | [uint32](#uint32) | | | -| `historical_entries` | [uint32](#uint32) | | | -| `bond_denom` | [string](#string) | | | - - - - - - - - -### Pool -Pool is used for tracking bonded and not-bonded token supply of the bond -denomination. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `not_bonded_tokens` | [string](#string) | | | -| `bonded_tokens` | [string](#string) | | | - - - - - - - - -### Redelegation -Redelegation contains the list of a particular delegator's redelegating bonds -from a particular source validator to a particular destination validator. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `delegator_address` | [string](#string) | | | -| `validator_src_address` | [string](#string) | | | -| `validator_dst_address` | [string](#string) | | | -| `entries` | [RedelegationEntry](#cosmos.staking.v1beta1.RedelegationEntry) | repeated | redelegation entries | - - - - - - - - -### RedelegationEntry -RedelegationEntry defines a redelegation object with relevant metadata. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `creation_height` | [int64](#int64) | | | -| `completion_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `initial_balance` | [string](#string) | | | -| `shares_dst` | [string](#string) | | | - - - - - - - - -### RedelegationEntryResponse -RedelegationEntryResponse is equivalent to a RedelegationEntry except that it -contains a balance in addition to shares which is more suitable for client -responses. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `redelegation_entry` | [RedelegationEntry](#cosmos.staking.v1beta1.RedelegationEntry) | | | -| `balance` | [string](#string) | | | - - - - - - - - -### RedelegationResponse -RedelegationResponse is equivalent to a Redelegation except that its entries -contain a balance in addition to shares which is more suitable for client -responses. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `redelegation` | [Redelegation](#cosmos.staking.v1beta1.Redelegation) | | | -| `entries` | [RedelegationEntryResponse](#cosmos.staking.v1beta1.RedelegationEntryResponse) | repeated | | - - - - - - - - -### UnbondingDelegation -UnbondingDelegation stores all of a single delegator's unbonding bonds -for a single validator in an time-ordered list. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `delegator_address` | [string](#string) | | | -| `validator_address` | [string](#string) | | | -| `entries` | [UnbondingDelegationEntry](#cosmos.staking.v1beta1.UnbondingDelegationEntry) | repeated | unbonding delegation entries | - - - - - - - - -### UnbondingDelegationEntry -UnbondingDelegationEntry defines an unbonding object with relevant metadata. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `creation_height` | [int64](#int64) | | | -| `completion_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `initial_balance` | [string](#string) | | | -| `balance` | [string](#string) | | | - - - - - - - - -### ValAddresses -ValAddresses defines a repeated set of validator addresses. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `addresses` | [string](#string) | repeated | | - - - - - - - - -### Validator -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `operator_address` | [string](#string) | | | -| `consensus_pubkey` | [google.protobuf.Any](#google.protobuf.Any) | | | -| `jailed` | [bool](#bool) | | | -| `status` | [BondStatus](#cosmos.staking.v1beta1.BondStatus) | | | -| `tokens` | [string](#string) | | | -| `delegator_shares` | [string](#string) | | | -| `description` | [Description](#cosmos.staking.v1beta1.Description) | | | -| `unbonding_height` | [int64](#int64) | | | -| `unbonding_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `commission` | [Commission](#cosmos.staking.v1beta1.Commission) | | | -| `min_self_delegation` | [string](#string) | | | +| `address` | [string](#string) | | address is the validator address. | +| `missed_blocks` | [MissedBlock](#cosmos.slashing.v1beta1.MissedBlock) | repeated | missed_blocks is an array of missed blocks by the validator. | @@ -5736,20 +5849,6 @@ multiplied by exchange rate. - - - -### BondStatus -BondStatus is the status of a validator. - -| Name | Number | Description | -| ---- | ------ | ----------- | -| BOND_STATUS_UNSPECIFIED | 0 | UNSPECIFIED defines an invalid validator status. | -| BOND_STATUS_UNBONDED | 1 | UNBONDED defines a validator that is not bonded. | -| BOND_STATUS_UNBONDING | 2 | UNBONDING defines a validator that is unbonding. | -| BOND_STATUS_BONDED | 3 | BONDED defines a validator that is bonded. | - - @@ -5758,45 +5857,391 @@ BondStatus is the status of a validator. - +

Top

-## cosmos/staking/v1beta1/genesis.proto +## cosmos/evidence/v1beta1/evidence.proto - + + +### Equivocation +Equivocation implements the Evidence interface and defines evidence of double +signing misbehavior. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `height` | [int64](#int64) | | | +| `time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `power` | [int64](#int64) | | | +| `consensus_address` | [string](#string) | | | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/evidence/v1beta1/query.proto + + + + + +### QueryAllEvidenceRequest +QueryEvidenceRequest is the request type for the Query/AllEvidence RPC +method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | + + + + + + + + +### QueryAllEvidenceResponse +QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC +method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `evidence` | [google.protobuf.Any](#google.protobuf.Any) | repeated | evidence returns all evidences. | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | + + + + + + + + +### QueryEvidenceRequest +QueryEvidenceRequest is the request type for the Query/Evidence RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `evidence_hash` | [bytes](#bytes) | | evidence_hash defines the hash of the requested evidence. | + + + + + + + + +### QueryEvidenceResponse +QueryEvidenceResponse is the response type for the Query/Evidence RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `evidence` | [google.protobuf.Any](#google.protobuf.Any) | | evidence returns the requested evidence. | + + + + + + + + + + + + + + +### Query +Query defines the gRPC querier service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `Evidence` | [QueryEvidenceRequest](#cosmos.evidence.v1beta1.QueryEvidenceRequest) | [QueryEvidenceResponse](#cosmos.evidence.v1beta1.QueryEvidenceResponse) | Evidence queries evidence based on evidence hash. | GET|/cosmos/evidence/v1beta1/evidence/{evidence_hash}| +| `AllEvidence` | [QueryAllEvidenceRequest](#cosmos.evidence.v1beta1.QueryAllEvidenceRequest) | [QueryAllEvidenceResponse](#cosmos.evidence.v1beta1.QueryAllEvidenceResponse) | AllEvidence queries all evidence. | GET|/cosmos/evidence/v1beta1/evidence| + + + + + + +

Top

+ +## cosmos/evidence/v1beta1/tx.proto + + + + + +### MsgSubmitEvidence +MsgSubmitEvidence represents a message that supports submitting arbitrary +Evidence of misbehavior such as equivocation or counterfactual signing. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `submitter` | [string](#string) | | | +| `evidence` | [google.protobuf.Any](#google.protobuf.Any) | | | + + + + + + + + +### MsgSubmitEvidenceResponse +MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `hash` | [bytes](#bytes) | | hash defines the hash of the evidence. | + + + + + + + + + + + + + + +### Msg +Msg defines the evidence Msg service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `SubmitEvidence` | [MsgSubmitEvidence](#cosmos.evidence.v1beta1.MsgSubmitEvidence) | [MsgSubmitEvidenceResponse](#cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse) | SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or counterfactual signing. | | + + + + + + +

Top

+ +## cosmos/evidence/v1beta1/genesis.proto + + + + ### GenesisState -GenesisState defines the staking module's genesis state. +GenesisState defines the evidence module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `params` | [Params](#cosmos.staking.v1beta1.Params) | | params defines all the paramaters of related to deposit. | -| `last_total_power` | [bytes](#bytes) | | last_total_power tracks the total amounts of bonded tokens recorded during the previous end block. | -| `last_validator_powers` | [LastValidatorPower](#cosmos.staking.v1beta1.LastValidatorPower) | repeated | last_validator_powers is a special index that provides a historical list of the last-block's bonded validators. | -| `validators` | [Validator](#cosmos.staking.v1beta1.Validator) | repeated | delegations defines the validator set at genesis. | -| `delegations` | [Delegation](#cosmos.staking.v1beta1.Delegation) | repeated | delegations defines the delegations active at genesis. | -| `unbonding_delegations` | [UnbondingDelegation](#cosmos.staking.v1beta1.UnbondingDelegation) | repeated | unbonding_delegations defines the unbonding delegations active at genesis. | -| `redelegations` | [Redelegation](#cosmos.staking.v1beta1.Redelegation) | repeated | redelegations defines the redelegations active at genesis. | -| `exported` | [bool](#bool) | | | +| `evidence` | [google.protobuf.Any](#google.protobuf.Any) | repeated | evidence defines all the evidence at genesis. | + - + -### LastValidatorPower -LastValidatorPower required for validator set update logic. + + + + + + + +

Top

+ +## cosmos/auth/v1beta1/auth.proto + + + + + +### BaseAccount +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). | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | address is the address of the validator. | -| `power` | [int64](#int64) | | power defines the power of the validator. | +| `address` | [string](#string) | | | +| `pub_key` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `account_number` | [uint64](#uint64) | | | +| `sequence` | [uint64](#uint64) | | | + + + + + + + + +### ModuleAccount +ModuleAccount defines an account for modules that holds coins on a pool. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `base_account` | [BaseAccount](#cosmos.auth.v1beta1.BaseAccount) | | | +| `name` | [string](#string) | | | +| `permissions` | [string](#string) | repeated | | + + + + + + + + +### Params +Params defines the parameters for the auth module. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `max_memo_characters` | [uint64](#uint64) | | | +| `tx_sig_limit` | [uint64](#uint64) | | | +| `tx_size_cost_per_byte` | [uint64](#uint64) | | | +| `sig_verify_cost_ed25519` | [uint64](#uint64) | | | +| `sig_verify_cost_secp256k1` | [uint64](#uint64) | | | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/auth/v1beta1/query.proto + + + + + +### QueryAccountRequest +QueryAccountRequest is the request type for the Query/Account RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `address` | [string](#string) | | address defines the address to query for. | + + + + + + + + +### QueryAccountResponse +QueryAccountResponse is the response type for the Query/Account RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `account` | [google.protobuf.Any](#google.protobuf.Any) | | account defines the account of the corresponding address. | + + + + + + + + +### QueryParamsRequest +QueryParamsRequest is the request type for the Query/Params RPC method. + + + + + + + + +### QueryParamsResponse +QueryParamsResponse is the response type for the Query/Params RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `params` | [Params](#cosmos.auth.v1beta1.Params) | | params defines the parameters of the module. | + + + + + + + + + + + + + + +### Query +Query defines the gRPC querier service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `Account` | [QueryAccountRequest](#cosmos.auth.v1beta1.QueryAccountRequest) | [QueryAccountResponse](#cosmos.auth.v1beta1.QueryAccountResponse) | Account returns account details based on address. | GET|/cosmos/auth/v1beta1/accounts/{address}| +| `Params` | [QueryParamsRequest](#cosmos.auth.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.auth.v1beta1.QueryParamsResponse) | Params queries all parameters. | GET|/cosmos/auth/v1beta1/params| + + + + + + +

Top

+ +## cosmos/auth/v1beta1/genesis.proto + + + + + +### GenesisState +GenesisState defines the auth module's genesis state. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `params` | [Params](#cosmos.auth.v1beta1.Params) | | params defines all the paramaters of the module. | +| `accounts` | [google.protobuf.Any](#google.protobuf.Any) | repeated | accounts are the accounts present at genesis. | @@ -6482,90 +6927,429 @@ Msg defines the staking Msg service. - +

Top

-## cosmos/tx/signing/v1beta1/signing.proto +## cosmos/staking/v1beta1/genesis.proto - + -### SignatureDescriptor -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. +### GenesisState +GenesisState defines the staking module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `public_key` | [google.protobuf.Any](#google.protobuf.Any) | | public_key is the public key of the signer | -| `data` | [SignatureDescriptor.Data](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data) | | | -| `sequence` | [uint64](#uint64) | | 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. | +| `params` | [Params](#cosmos.staking.v1beta1.Params) | | params defines all the paramaters of related to deposit. | +| `last_total_power` | [bytes](#bytes) | | last_total_power tracks the total amounts of bonded tokens recorded during the previous end block. | +| `last_validator_powers` | [LastValidatorPower](#cosmos.staking.v1beta1.LastValidatorPower) | repeated | last_validator_powers is a special index that provides a historical list of the last-block's bonded validators. | +| `validators` | [Validator](#cosmos.staking.v1beta1.Validator) | repeated | delegations defines the validator set at genesis. | +| `delegations` | [Delegation](#cosmos.staking.v1beta1.Delegation) | repeated | delegations defines the delegations active at genesis. | +| `unbonding_delegations` | [UnbondingDelegation](#cosmos.staking.v1beta1.UnbondingDelegation) | repeated | unbonding_delegations defines the unbonding delegations active at genesis. | +| `redelegations` | [Redelegation](#cosmos.staking.v1beta1.Redelegation) | repeated | redelegations defines the redelegations active at genesis. | +| `exported` | [bool](#bool) | | | - + -### SignatureDescriptor.Data -Data represents signature data +### LastValidatorPower +LastValidatorPower required for validator set update logic. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `single` | [SignatureDescriptor.Data.Single](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single) | | single represents a single signer | -| `multi` | [SignatureDescriptor.Data.Multi](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi) | | multi represents a multisig signer | +| `address` | [string](#string) | | address is the address of the validator. | +| `power` | [int64](#int64) | | power defines the power of the validator. | + - + -### SignatureDescriptor.Data.Multi -Multi is the signature data for a multisig public key + + + + + + + +

Top

+ +## cosmos/staking/v1beta1/staking.proto + + + + + +### Commission +Commission defines commission parameters for a given validator. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `bitarray` | [cosmos.crypto.multisig.v1beta1.CompactBitArray](#cosmos.crypto.multisig.v1beta1.CompactBitArray) | | bitarray specifies which keys within the multisig are signing | -| `signatures` | [SignatureDescriptor.Data](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data) | repeated | signatures is the signatures of the multi-signature | +| `commission_rates` | [CommissionRates](#cosmos.staking.v1beta1.CommissionRates) | | | +| `update_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | - + -### SignatureDescriptor.Data.Single -Single is the signature data for a single signer +### CommissionRates +CommissionRates defines the initial commission rates to be used for creating +a validator. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `mode` | [SignMode](#cosmos.tx.signing.v1beta1.SignMode) | | mode is the signing mode of the single signer | -| `signature` | [bytes](#bytes) | | signature is the raw signature bytes | +| `rate` | [string](#string) | | | +| `max_rate` | [string](#string) | | | +| `max_change_rate` | [string](#string) | | | - + -### SignatureDescriptors -SignatureDescriptors wraps multiple SignatureDescriptor's. +### DVPair +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. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `signatures` | [SignatureDescriptor](#cosmos.tx.signing.v1beta1.SignatureDescriptor) | repeated | signatures are the signature descriptors | +| `delegator_address` | [string](#string) | | | +| `validator_address` | [string](#string) | | | + + + + + + + + +### DVPairs +DVPairs defines an array of DVPair objects. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `pairs` | [DVPair](#cosmos.staking.v1beta1.DVPair) | repeated | | + + + + + + + + +### DVVTriplet +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `delegator_address` | [string](#string) | | | +| `validator_src_address` | [string](#string) | | | +| `validator_dst_address` | [string](#string) | | | + + + + + + + + +### DVVTriplets +DVVTriplets defines an array of DVVTriplet objects. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `triplets` | [DVVTriplet](#cosmos.staking.v1beta1.DVVTriplet) | repeated | | + + + + + + + + +### Delegation +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `delegator_address` | [string](#string) | | | +| `validator_address` | [string](#string) | | | +| `shares` | [string](#string) | | | + + + + + + + + +### DelegationResponse +DelegationResponse is equivalent to Delegation except that it contains a +balance in addition to shares which is more suitable for client responses. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `delegation` | [Delegation](#cosmos.staking.v1beta1.Delegation) | | | +| `balance` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | | + + + + + + + + +### Description +Description defines a validator description. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `moniker` | [string](#string) | | | +| `identity` | [string](#string) | | | +| `website` | [string](#string) | | | +| `security_contact` | [string](#string) | | | +| `details` | [string](#string) | | | + + + + + + + + +### HistoricalInfo +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). + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `header` | [tendermint.types.Header](#tendermint.types.Header) | | | +| `valset` | [Validator](#cosmos.staking.v1beta1.Validator) | repeated | | + + + + + + + + +### Params +Params defines the parameters for the staking module. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `unbonding_time` | [google.protobuf.Duration](#google.protobuf.Duration) | | | +| `max_validators` | [uint32](#uint32) | | | +| `max_entries` | [uint32](#uint32) | | | +| `historical_entries` | [uint32](#uint32) | | | +| `bond_denom` | [string](#string) | | | + + + + + + + + +### Pool +Pool is used for tracking bonded and not-bonded token supply of the bond +denomination. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `not_bonded_tokens` | [string](#string) | | | +| `bonded_tokens` | [string](#string) | | | + + + + + + + + +### Redelegation +Redelegation contains the list of a particular delegator's redelegating bonds +from a particular source validator to a particular destination validator. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `delegator_address` | [string](#string) | | | +| `validator_src_address` | [string](#string) | | | +| `validator_dst_address` | [string](#string) | | | +| `entries` | [RedelegationEntry](#cosmos.staking.v1beta1.RedelegationEntry) | repeated | redelegation entries | + + + + + + + + +### RedelegationEntry +RedelegationEntry defines a redelegation object with relevant metadata. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `creation_height` | [int64](#int64) | | | +| `completion_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `initial_balance` | [string](#string) | | | +| `shares_dst` | [string](#string) | | | + + + + + + + + +### RedelegationEntryResponse +RedelegationEntryResponse is equivalent to a RedelegationEntry except that it +contains a balance in addition to shares which is more suitable for client +responses. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `redelegation_entry` | [RedelegationEntry](#cosmos.staking.v1beta1.RedelegationEntry) | | | +| `balance` | [string](#string) | | | + + + + + + + + +### RedelegationResponse +RedelegationResponse is equivalent to a Redelegation except that its entries +contain a balance in addition to shares which is more suitable for client +responses. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `redelegation` | [Redelegation](#cosmos.staking.v1beta1.Redelegation) | | | +| `entries` | [RedelegationEntryResponse](#cosmos.staking.v1beta1.RedelegationEntryResponse) | repeated | | + + + + + + + + +### UnbondingDelegation +UnbondingDelegation stores all of a single delegator's unbonding bonds +for a single validator in an time-ordered list. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `delegator_address` | [string](#string) | | | +| `validator_address` | [string](#string) | | | +| `entries` | [UnbondingDelegationEntry](#cosmos.staking.v1beta1.UnbondingDelegationEntry) | repeated | unbonding delegation entries | + + + + + + + + +### UnbondingDelegationEntry +UnbondingDelegationEntry defines an unbonding object with relevant metadata. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `creation_height` | [int64](#int64) | | | +| `completion_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `initial_balance` | [string](#string) | | | +| `balance` | [string](#string) | | | + + + + + + + + +### ValAddresses +ValAddresses defines a repeated set of validator addresses. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `addresses` | [string](#string) | repeated | | + + + + + + + + +### Validator +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `operator_address` | [string](#string) | | | +| `consensus_pubkey` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `jailed` | [bool](#bool) | | | +| `status` | [BondStatus](#cosmos.staking.v1beta1.BondStatus) | | | +| `tokens` | [string](#string) | | | +| `delegator_shares` | [string](#string) | | | +| `description` | [Description](#cosmos.staking.v1beta1.Description) | | | +| `unbonding_height` | [int64](#int64) | | | +| `unbonding_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `commission` | [Commission](#cosmos.staking.v1beta1.Commission) | | | +| `min_self_delegation` | [string](#string) | | | @@ -6574,17 +7358,17 @@ SignatureDescriptors wraps multiple SignatureDescriptor's. - + -### SignMode -SignMode represents a signing mode with its own security guarantees. +### BondStatus +BondStatus is the status of a validator. | Name | Number | Description | | ---- | ------ | ----------- | -| SIGN_MODE_UNSPECIFIED | 0 | SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be rejected | -| SIGN_MODE_DIRECT | 1 | SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is verified with raw bytes from Tx | -| SIGN_MODE_TEXTUAL | 2 | 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_LEGACY_AMINO_JSON | 127 | SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses Amino JSON and will be removed in the future | +| BOND_STATUS_UNSPECIFIED | 0 | UNSPECIFIED defines an invalid validator status. | +| BOND_STATUS_UNBONDED | 1 | UNBONDED defines a validator that is not bonded. | +| BOND_STATUS_UNBONDING | 2 | UNBONDING defines a validator that is unbonding. | +| BOND_STATUS_BONDED | 3 | BONDED defines a validator that is bonded. | @@ -6595,566 +7379,6 @@ SignMode represents a signing mode with its own security guarantees. - -

Top

- -## cosmos/tx/v1beta1/tx.proto - - - - - -### AuthInfo -AuthInfo describes the fee and signer modes that are used to sign a -transaction. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `signer_infos` | [SignerInfo](#cosmos.tx.v1beta1.SignerInfo) | repeated | 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. | -| `fee` | [Fee](#cosmos.tx.v1beta1.Fee) | | 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 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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | amount is the amount of coins to be paid as a fee | -| `gas_limit` | [uint64](#uint64) | | gas_limit is the maximum gas that can be used in transaction processing before an out of gas error occurs | -| `payer` | [string](#string) | | 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. | -| `granter` | [string](#string) | | 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 | - - - - - - - - -### ModeInfo -ModeInfo describes the signing mode of a single or nested multisig signer. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `single` | [ModeInfo.Single](#cosmos.tx.v1beta1.ModeInfo.Single) | | single represents a single signer | -| `multi` | [ModeInfo.Multi](#cosmos.tx.v1beta1.ModeInfo.Multi) | | multi represents a nested multisig signer | - - - - - - - - -### ModeInfo.Multi -Multi is the mode info for a multisig public key - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `bitarray` | [cosmos.crypto.multisig.v1beta1.CompactBitArray](#cosmos.crypto.multisig.v1beta1.CompactBitArray) | | bitarray specifies which keys within the multisig are signing | -| `mode_infos` | [ModeInfo](#cosmos.tx.v1beta1.ModeInfo) | repeated | mode_infos is the corresponding modes of the signers of the multisig which could include nested multisig public keys | - - - - - - - - -### ModeInfo.Single -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 - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `mode` | [cosmos.tx.signing.v1beta1.SignMode](#cosmos.tx.signing.v1beta1.SignMode) | | mode is the signing mode of the single signer | - - - - - - - - -### SignDoc -SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `body_bytes` | [bytes](#bytes) | | body_bytes is protobuf serialization of a TxBody that matches the representation in TxRaw. | -| `auth_info_bytes` | [bytes](#bytes) | | auth_info_bytes is a protobuf serialization of an AuthInfo that matches the representation in TxRaw. | -| `chain_id` | [string](#string) | | 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 | -| `account_number` | [uint64](#uint64) | | account_number is the account number of the account in state | - - - - - - - - -### SignerInfo -SignerInfo describes the public key and signing mode of a single top-level -signer. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `public_key` | [google.protobuf.Any](#google.protobuf.Any) | | 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. | -| `mode_info` | [ModeInfo](#cosmos.tx.v1beta1.ModeInfo) | | mode_info describes the signing mode of the signer and is a nested structure to support nested multisig pubkey's | -| `sequence` | [uint64](#uint64) | | 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. | - - - - - - - - -### Tx -Tx is the standard type used for broadcasting transactions. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `body` | [TxBody](#cosmos.tx.v1beta1.TxBody) | | body is the processable content of the transaction | -| `auth_info` | [AuthInfo](#cosmos.tx.v1beta1.AuthInfo) | | auth_info is the authorization related content of the transaction, specifically signers, signer modes and fee | -| `signatures` | [bytes](#bytes) | repeated | 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. | - - - - - - - - -### TxBody -TxBody is the body of a transaction that all signers sign over. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | 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. | -| `memo` | [string](#string) | | memo is any arbitrary memo to be added to the transaction | -| `timeout_height` | [uint64](#uint64) | | timeout is the block height after which this transaction will not be processed by the chain | -| `extension_options` | [google.protobuf.Any](#google.protobuf.Any) | repeated | 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 | -| `non_critical_extension_options` | [google.protobuf.Any](#google.protobuf.Any) | repeated | 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 | - - - - - - - - -### TxRaw -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `body_bytes` | [bytes](#bytes) | | body_bytes is a protobuf serialization of a TxBody that matches the representation in SignDoc. | -| `auth_info_bytes` | [bytes](#bytes) | | auth_info_bytes is a protobuf serialization of an AuthInfo that matches the representation in SignDoc. | -| `signatures` | [bytes](#bytes) | repeated | 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. | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/tx/v1beta1/service.proto - - - - - -### BroadcastTxRequest -BroadcastTxRequest is the request type for the Service.BroadcastTxRequest -RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `tx_bytes` | [bytes](#bytes) | | tx_bytes is the raw transaction. | -| `mode` | [BroadcastMode](#cosmos.tx.v1beta1.BroadcastMode) | | | - - - - - - - - -### BroadcastTxResponse -BroadcastTxResponse is the response type for the -Service.BroadcastTx method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `tx_response` | [cosmos.base.abci.v1beta1.TxResponse](#cosmos.base.abci.v1beta1.TxResponse) | | tx_response is the queried TxResponses. | - - - - - - - - -### GetTxRequest -GetTxRequest is the request type for the Service.GetTx -RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `hash` | [string](#string) | | hash is the tx hash to query, encoded as a hex string. | - - - - - - - - -### GetTxResponse -GetTxResponse is the response type for the Service.GetTx method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `tx` | [Tx](#cosmos.tx.v1beta1.Tx) | | tx is the queried transaction. | -| `tx_response` | [cosmos.base.abci.v1beta1.TxResponse](#cosmos.base.abci.v1beta1.TxResponse) | | tx_response is the queried TxResponses. | - - - - - - - - -### GetTxsEventRequest -GetTxsEventRequest is the request type for the Service.TxsByEvents -RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `events` | [string](#string) | repeated | events is the list of transaction event type. | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an pagination for the request. | - - - - - - - - -### GetTxsEventResponse -GetTxsEventResponse is the response type for the Service.TxsByEvents -RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `txs` | [Tx](#cosmos.tx.v1beta1.Tx) | repeated | txs is the list of queried transactions. | -| `tx_responses` | [cosmos.base.abci.v1beta1.TxResponse](#cosmos.base.abci.v1beta1.TxResponse) | repeated | tx_responses is the list of queried TxResponses. | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines an pagination for the response. | - - - - - - - - -### SimulateRequest -SimulateRequest is the request type for the Service.Simulate -RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `tx` | [Tx](#cosmos.tx.v1beta1.Tx) | | tx is the transaction to simulate. | - - - - - - - - -### SimulateResponse -SimulateResponse is the response type for the -Service.SimulateRPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `gas_info` | [cosmos.base.abci.v1beta1.GasInfo](#cosmos.base.abci.v1beta1.GasInfo) | | gas_info is the information about gas used in the simulation. | -| `result` | [cosmos.base.abci.v1beta1.Result](#cosmos.base.abci.v1beta1.Result) | | result is the result of the simulation. | - - - - - - - - - - -### BroadcastMode -BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. - -| Name | Number | Description | -| ---- | ------ | ----------- | -| BROADCAST_MODE_UNSPECIFIED | 0 | zero-value for mode ordering | -| BROADCAST_MODE_BLOCK | 1 | BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for the tx to be committed in a block. | -| BROADCAST_MODE_SYNC | 2 | BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for a CheckTx execution response only. | -| BROADCAST_MODE_ASYNC | 3 | BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns immediately. | - - - - - - - - - -### Service -Service defines a gRPC service for interacting with transactions. - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Simulate` | [SimulateRequest](#cosmos.tx.v1beta1.SimulateRequest) | [SimulateResponse](#cosmos.tx.v1beta1.SimulateResponse) | Simulate simulates executing a transaction for estimating gas usage. | POST|/cosmos/tx/v1beta1/simulate| -| `GetTx` | [GetTxRequest](#cosmos.tx.v1beta1.GetTxRequest) | [GetTxResponse](#cosmos.tx.v1beta1.GetTxResponse) | GetTx fetches a tx by hash. | GET|/cosmos/tx/v1beta1/txs/{hash}| -| `BroadcastTx` | [BroadcastTxRequest](#cosmos.tx.v1beta1.BroadcastTxRequest) | [BroadcastTxResponse](#cosmos.tx.v1beta1.BroadcastTxResponse) | BroadcastTx broadcast transaction. | POST|/cosmos/tx/v1beta1/txs| -| `GetTxsEvent` | [GetTxsEventRequest](#cosmos.tx.v1beta1.GetTxsEventRequest) | [GetTxsEventResponse](#cosmos.tx.v1beta1.GetTxsEventResponse) | GetTxsEvent fetches txs by event. | GET|/cosmos/tx/v1beta1/txs| - - - - - - -

Top

- -## cosmos/upgrade/v1beta1/upgrade.proto - - - - - -### CancelSoftwareUpgradeProposal -CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software -upgrade. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `title` | [string](#string) | | | -| `description` | [string](#string) | | | - - - - - - - - -### Plan -Plan specifies information about a planned upgrade and when it should occur. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `name` | [string](#string) | | 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. | -| `time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | The time after which the upgrade must be performed. Leave set to its zero value to use a pre-defined Height instead. | -| `height` | [int64](#int64) | | The height at which the upgrade must be performed. Only used if Time is not set. | -| `info` | [string](#string) | | Any application specific upgrade info to be included on-chain such as a git commit that validators could automatically upgrade to | -| `upgraded_client_state` | [google.protobuf.Any](#google.protobuf.Any) | | IBC-enabled chains can opt-in to including the upgraded client state in its upgrade plan 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 | - - - - - - - - -### SoftwareUpgradeProposal -SoftwareUpgradeProposal is a gov Content type for initiating a software -upgrade. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `title` | [string](#string) | | | -| `description` | [string](#string) | | | -| `plan` | [Plan](#cosmos.upgrade.v1beta1.Plan) | | | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/upgrade/v1beta1/query.proto - - - - - -### QueryAppliedPlanRequest -QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC -method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `name` | [string](#string) | | name is the name of the applied plan to query for. | - - - - - - - - -### QueryAppliedPlanResponse -QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC -method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `height` | [int64](#int64) | | height is the block height at which the plan was applied. | - - - - - - - - -### QueryCurrentPlanRequest -QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC -method. - - - - - - - - -### QueryCurrentPlanResponse -QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC -method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `plan` | [Plan](#cosmos.upgrade.v1beta1.Plan) | | plan is the current upgrade plan. | - - - - - - - - -### QueryUpgradedConsensusStateRequest -QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState -RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `last_height` | [int64](#int64) | | last height of the current chain must be sent in request as this is the height under which next consensus state is stored | - - - - - - - - -### QueryUpgradedConsensusStateResponse -QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState -RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `upgraded_consensus_state` | [google.protobuf.Any](#google.protobuf.Any) | | | - - - - - - - - - - - - - - -### Query -Query defines the gRPC upgrade querier service. - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `CurrentPlan` | [QueryCurrentPlanRequest](#cosmos.upgrade.v1beta1.QueryCurrentPlanRequest) | [QueryCurrentPlanResponse](#cosmos.upgrade.v1beta1.QueryCurrentPlanResponse) | CurrentPlan queries the current upgrade plan. | GET|/cosmos/upgrade/v1beta1/current_plan| -| `AppliedPlan` | [QueryAppliedPlanRequest](#cosmos.upgrade.v1beta1.QueryAppliedPlanRequest) | [QueryAppliedPlanResponse](#cosmos.upgrade.v1beta1.QueryAppliedPlanResponse) | AppliedPlan queries a previously applied upgrade plan by its name. | GET|/cosmos/upgrade/v1beta1/applied_plan/{name}| -| `UpgradedConsensusState` | [QueryUpgradedConsensusStateRequest](#cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest) | [QueryUpgradedConsensusStateResponse](#cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse) | 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 | GET|/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}| - - - - -

Top

@@ -7315,63 +7539,38 @@ periodically vests by unlocking coins during each specified period. - +

Top

-## ibc/applications/transfer/v1/transfer.proto +## cosmos/params/v1beta1/query.proto - + -### DenomTrace -DenomTrace contains the base denomination for ICS20 fungible tokens and the -source tracing information path. +### QueryParamsRequest +QueryParamsRequest is request type for the Query/Params RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `path` | [string](#string) | | path defines the chain of port/channel identifiers used for tracing the source of the fungible token. | -| `base_denom` | [string](#string) | | base denomination of the relayed fungible token. | +| `subspace` | [string](#string) | | subspace defines the module to query the parameter for. | +| `key` | [string](#string) | | key defines the key of the parameter in the subspace. | - + -### FungibleTokenPacketData -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 +### QueryParamsResponse +QueryParamsResponse is response type for the Query/Params RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `denom` | [string](#string) | | the token denomination to be transferred | -| `amount` | [uint64](#uint64) | | the token amount to be transferred | -| `sender` | [string](#string) | | the sender address | -| `receiver` | [string](#string) | | the recipient address on the destination chain | - - - - - - - - -### Params -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `send_enabled` | [bool](#bool) | | send_enabled enables or disables all cross-chain token transfers from this chain. | -| `receive_enabled` | [bool](#bool) | | receive_enabled enables or disables all cross-chain token transfers to this chain. | +| `param` | [ParamChange](#cosmos.params.v1beta1.ParamChange) | | param defines the queried parameter. | @@ -7383,28 +7582,56 @@ parameter for the denomination to false. + + + +### Query +Query defines the gRPC querier service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `Params` | [QueryParamsRequest](#cosmos.params.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.params.v1beta1.QueryParamsResponse) | Params queries a specific parameter of a module, given its subspace and key. | GET|/cosmos/params/v1beta1/params| + - +

Top

-## ibc/applications/transfer/v1/genesis.proto +## cosmos/params/v1beta1/params.proto - + -### GenesisState -GenesisState defines the ibc-transfer genesis state +### ParamChange +ParamChange defines an individual parameter change, for use in +ParameterChangeProposal. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `port_id` | [string](#string) | | | -| `denom_traces` | [DenomTrace](#ibc.applications.transfer.v1.DenomTrace) | repeated | | -| `params` | [Params](#ibc.applications.transfer.v1.Params) | | | +| `subspace` | [string](#string) | | | +| `key` | [string](#string) | | | +| `value` | [string](#string) | | | + + + + + + + + +### ParameterChangeProposal +ParameterChangeProposal defines a proposal to change one or more parameters. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `changes` | [ParamChange](#cosmos.params.v1beta1.ParamChange) | repeated | | @@ -7538,6 +7765,170 @@ Query provides defines the gRPC querier service. + +

Top

+ +## ibc/applications/transfer/v1/tx.proto + + + + + +### MsgTransfer +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 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `source_port` | [string](#string) | | the port on which the packet will be sent | +| `source_channel` | [string](#string) | | the channel by which the packet will be sent | +| `token` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | the tokens to be transferred | +| `sender` | [string](#string) | | the sender address | +| `receiver` | [string](#string) | | the recipient address on the destination chain | +| `timeout_height` | [ibc.core.client.v1.Height](#ibc.core.client.v1.Height) | | Timeout height relative to the current block height. The timeout is disabled when set to 0. | +| `timeout_timestamp` | [uint64](#uint64) | | Timeout timestamp (in nanoseconds) relative to the current block timestamp. The timeout is disabled when set to 0. | + + + + + + + + +### MsgTransferResponse +MsgTransferResponse defines the Msg/Transfer response type. + + + + + + + + + + + + + + +### Msg +Msg defines the ibc/transfer Msg service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `Transfer` | [MsgTransfer](#ibc.applications.transfer.v1.MsgTransfer) | [MsgTransferResponse](#ibc.applications.transfer.v1.MsgTransferResponse) | Transfer defines a rpc handler method for MsgTransfer. | | + + + + + + +

Top

+ +## ibc/applications/transfer/v1/transfer.proto + + + + + +### DenomTrace +DenomTrace contains the base denomination for ICS20 fungible tokens and the +source tracing information path. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `path` | [string](#string) | | path defines the chain of port/channel identifiers used for tracing the source of the fungible token. | +| `base_denom` | [string](#string) | | base denomination of the relayed fungible token. | + + + + + + + + +### FungibleTokenPacketData +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 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `denom` | [string](#string) | | the token denomination to be transferred | +| `amount` | [uint64](#uint64) | | the token amount to be transferred | +| `sender` | [string](#string) | | the sender address | +| `receiver` | [string](#string) | | the recipient address on the destination chain | + + + + + + + + +### Params +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `send_enabled` | [bool](#bool) | | send_enabled enables or disables all cross-chain token transfers from this chain. | +| `receive_enabled` | [bool](#bool) | | receive_enabled enables or disables all cross-chain token transfers to this chain. | + + + + + + + + + + + + + + + + +

Top

+ +## ibc/applications/transfer/v1/genesis.proto + + + + + +### GenesisState +GenesisState defines the ibc-transfer genesis state + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `port_id` | [string](#string) | | | +| `denom_traces` | [DenomTrace](#ibc.applications.transfer.v1.DenomTrace) | repeated | | +| `params` | [Params](#ibc.applications.transfer.v1.Params) | | | + + + + + + + + + + + + + + +

Top

@@ -7663,40 +8054,172 @@ Params defines the set of IBC light client parameters. - +

Top

-## ibc/applications/transfer/v1/tx.proto +## ibc/core/client/v1/query.proto - + -### MsgTransfer -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 +### QueryClientParamsRequest +QueryClientParamsRequest is the request type for the Query/ClientParams RPC method. + + + + + + + + +### QueryClientParamsResponse +QueryClientParamsResponse is the response type for the Query/ClientParams RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `source_port` | [string](#string) | | the port on which the packet will be sent | -| `source_channel` | [string](#string) | | the channel by which the packet will be sent | -| `token` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | the tokens to be transferred | -| `sender` | [string](#string) | | the sender address | -| `receiver` | [string](#string) | | the recipient address on the destination chain | -| `timeout_height` | [ibc.core.client.v1.Height](#ibc.core.client.v1.Height) | | Timeout height relative to the current block height. The timeout is disabled when set to 0. | -| `timeout_timestamp` | [uint64](#uint64) | | Timeout timestamp (in nanoseconds) relative to the current block timestamp. The timeout is disabled when set to 0. | +| `params` | [Params](#ibc.core.client.v1.Params) | | params defines the parameters of the module. | - + -### MsgTransferResponse -MsgTransferResponse defines the Msg/Transfer response type. +### QueryClientStateRequest +QueryClientStateRequest is the request type for the Query/ClientState RPC +method + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `client_id` | [string](#string) | | client state unique identifier | + + + + + + + + +### QueryClientStateResponse +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `client_state` | [google.protobuf.Any](#google.protobuf.Any) | | client state associated with the request identifier | +| `proof` | [bytes](#bytes) | | merkle proof of existence | +| `proof_height` | [Height](#ibc.core.client.v1.Height) | | height at which the proof was retrieved | + + + + + + + + +### QueryClientStatesRequest +QueryClientStatesRequest is the request type for the Query/ClientStates RPC +method + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination request | + + + + + + + + +### QueryClientStatesResponse +QueryClientStatesResponse is the response type for the Query/ClientStates RPC +method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `client_states` | [IdentifiedClientState](#ibc.core.client.v1.IdentifiedClientState) | repeated | list of stored ClientStates of the chain. | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination response | + + + + + + + + +### QueryConsensusStateRequest +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `client_id` | [string](#string) | | client identifier | +| `revision_number` | [uint64](#uint64) | | consensus state revision number | +| `revision_height` | [uint64](#uint64) | | consensus state revision height | +| `latest_height` | [bool](#bool) | | latest_height overrrides the height field and queries the latest stored ConsensusState | + + + + + + + + +### QueryConsensusStateResponse +QueryConsensusStateResponse is the response type for the Query/ConsensusState +RPC method + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `consensus_state` | [google.protobuf.Any](#google.protobuf.Any) | | consensus state associated with the client identifier at the given height | +| `proof` | [bytes](#bytes) | | merkle proof of existence | +| `proof_height` | [Height](#ibc.core.client.v1.Height) | | height at which the proof was retrieved | + + + + + + + + +### QueryConsensusStatesRequest +QueryConsensusStatesRequest is the request type for the Query/ConsensusStates +RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `client_id` | [string](#string) | | client identifier | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination request | + + + + + + + + +### QueryConsensusStatesResponse +QueryConsensusStatesResponse is the response type for the +Query/ConsensusStates RPC method + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `consensus_states` | [ConsensusStateWithHeight](#ibc.core.client.v1.ConsensusStateWithHeight) | repeated | consensus states associated with the identifier | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination response | @@ -7709,14 +8232,229 @@ MsgTransferResponse defines the Msg/Transfer response type. - + -### Msg -Msg defines the ibc/transfer Msg service. +### Query +Query provides defines the gRPC querier service | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Transfer` | [MsgTransfer](#ibc.applications.transfer.v1.MsgTransfer) | [MsgTransferResponse](#ibc.applications.transfer.v1.MsgTransferResponse) | Transfer defines a rpc handler method for MsgTransfer. | | +| `ClientState` | [QueryClientStateRequest](#ibc.core.client.v1.QueryClientStateRequest) | [QueryClientStateResponse](#ibc.core.client.v1.QueryClientStateResponse) | ClientState queries an IBC light client. | GET|/ibc/core/client/v1beta1/client_states/{client_id}| +| `ClientStates` | [QueryClientStatesRequest](#ibc.core.client.v1.QueryClientStatesRequest) | [QueryClientStatesResponse](#ibc.core.client.v1.QueryClientStatesResponse) | ClientStates queries all the IBC light clients of a chain. | GET|/ibc/core/client/v1beta1/client_states| +| `ConsensusState` | [QueryConsensusStateRequest](#ibc.core.client.v1.QueryConsensusStateRequest) | [QueryConsensusStateResponse](#ibc.core.client.v1.QueryConsensusStateResponse) | ConsensusState queries a consensus state associated with a client state at a given height. | GET|/ibc/core/client/v1beta1/consensus_states/{client_id}/revision/{revision_number}/height/{revision_height}| +| `ConsensusStates` | [QueryConsensusStatesRequest](#ibc.core.client.v1.QueryConsensusStatesRequest) | [QueryConsensusStatesResponse](#ibc.core.client.v1.QueryConsensusStatesResponse) | ConsensusStates queries all the consensus state associated with a given client. | GET|/ibc/core/client/v1beta1/consensus_states/{client_id}| +| `ClientParams` | [QueryClientParamsRequest](#ibc.core.client.v1.QueryClientParamsRequest) | [QueryClientParamsResponse](#ibc.core.client.v1.QueryClientParamsResponse) | ClientParams queries all parameters of the ibc client. | GET|/ibc/client/v1beta1/params| + + + + + + +

Top

+ +## ibc/core/client/v1/tx.proto + + + + + +### MsgCreateClient +MsgCreateClient defines a message to create an IBC client + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `client_state` | [google.protobuf.Any](#google.protobuf.Any) | | light client state | +| `consensus_state` | [google.protobuf.Any](#google.protobuf.Any) | | consensus state associated with the client that corresponds to a given height. | +| `signer` | [string](#string) | | signer address | + + + + + + + + +### MsgCreateClientResponse +MsgCreateClientResponse defines the Msg/CreateClient response type. + + + + + + + + +### MsgSubmitMisbehaviour +MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for +light client misbehaviour. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `client_id` | [string](#string) | | client unique identifier | +| `misbehaviour` | [google.protobuf.Any](#google.protobuf.Any) | | misbehaviour used for freezing the light client | +| `signer` | [string](#string) | | signer address | + + + + + + + + +### MsgSubmitMisbehaviourResponse +MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response type. + + + + + + + + +### MsgUpdateClient +MsgUpdateClient defines an sdk.Msg to update a IBC client state using +the given header. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `client_id` | [string](#string) | | client unique identifier | +| `header` | [google.protobuf.Any](#google.protobuf.Any) | | header to update the light client | +| `signer` | [string](#string) | | signer address | + + + + + + + + +### MsgUpdateClientResponse +MsgUpdateClientResponse defines the Msg/UpdateClient response type. + + + + + + + + +### MsgUpgradeClient +MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client state + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `client_id` | [string](#string) | | client unique identifier | +| `client_state` | [google.protobuf.Any](#google.protobuf.Any) | | upgraded client state | +| `consensus_state` | [google.protobuf.Any](#google.protobuf.Any) | | upgraded consensus state, only contains enough information to serve as a basis of trust in update logic | +| `proof_upgrade_client` | [bytes](#bytes) | | proof that old chain committed to new client | +| `proof_upgrade_consensus_state` | [bytes](#bytes) | | proof that old chain committed to new consensus state | +| `signer` | [string](#string) | | signer address | + + + + + + + + +### MsgUpgradeClientResponse +MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. + + + + + + + + + + + + + + +### Msg +Msg defines the ibc/client Msg service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `CreateClient` | [MsgCreateClient](#ibc.core.client.v1.MsgCreateClient) | [MsgCreateClientResponse](#ibc.core.client.v1.MsgCreateClientResponse) | CreateClient defines a rpc handler method for MsgCreateClient. | | +| `UpdateClient` | [MsgUpdateClient](#ibc.core.client.v1.MsgUpdateClient) | [MsgUpdateClientResponse](#ibc.core.client.v1.MsgUpdateClientResponse) | UpdateClient defines a rpc handler method for MsgUpdateClient. | | +| `UpgradeClient` | [MsgUpgradeClient](#ibc.core.client.v1.MsgUpgradeClient) | [MsgUpgradeClientResponse](#ibc.core.client.v1.MsgUpgradeClientResponse) | UpgradeClient defines a rpc handler method for MsgUpgradeClient. | | +| `SubmitMisbehaviour` | [MsgSubmitMisbehaviour](#ibc.core.client.v1.MsgSubmitMisbehaviour) | [MsgSubmitMisbehaviourResponse](#ibc.core.client.v1.MsgSubmitMisbehaviourResponse) | SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. | | + + + + + + +

Top

+ +## ibc/core/client/v1/genesis.proto + + + + + +### GenesisMetadata +GenesisMetadata defines the genesis type for metadata that clients may return +with ExportMetadata + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `key` | [bytes](#bytes) | | store key of metadata without clientID-prefix | +| `value` | [bytes](#bytes) | | metadata value | + + + + + + + + +### GenesisState +GenesisState defines the ibc client submodule's genesis state. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `clients` | [IdentifiedClientState](#ibc.core.client.v1.IdentifiedClientState) | repeated | client states with their corresponding identifiers | +| `clients_consensus` | [ClientConsensusStates](#ibc.core.client.v1.ClientConsensusStates) | repeated | consensus states from each client | +| `clients_metadata` | [IdentifiedGenesisMetadata](#ibc.core.client.v1.IdentifiedGenesisMetadata) | repeated | metadata from each client | +| `params` | [Params](#ibc.core.client.v1.Params) | | | +| `create_localhost` | [bool](#bool) | | create localhost on initialization | +| `next_client_sequence` | [uint64](#uint64) | | the sequence for the next generated client identifier | + + + + + + + + +### IdentifiedGenesisMetadata +IdentifiedGenesisMetadata has the client metadata with the corresponding client id. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `client_id` | [string](#string) | | | +| `client_metadata` | [GenesisMetadata](#ibc.core.client.v1.GenesisMetadata) | repeated | | + + + + + + + + + + @@ -7891,62 +8629,6 @@ CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. - -

Top

- -## ibc/core/channel/v1/genesis.proto - - - - - -### GenesisState -GenesisState defines the ibc channel submodule's genesis state. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `channels` | [IdentifiedChannel](#ibc.core.channel.v1.IdentifiedChannel) | repeated | | -| `acknowledgements` | [PacketState](#ibc.core.channel.v1.PacketState) | repeated | | -| `commitments` | [PacketState](#ibc.core.channel.v1.PacketState) | repeated | | -| `receipts` | [PacketState](#ibc.core.channel.v1.PacketState) | repeated | | -| `send_sequences` | [PacketSequence](#ibc.core.channel.v1.PacketSequence) | repeated | | -| `recv_sequences` | [PacketSequence](#ibc.core.channel.v1.PacketSequence) | repeated | | -| `ack_sequences` | [PacketSequence](#ibc.core.channel.v1.PacketSequence) | repeated | | -| `next_channel_sequence` | [uint64](#uint64) | | the sequence for the next generated channel identifier | - - - - - - - - -### PacketSequence -PacketSequence defines the genesis type necessary to retrieve and store -next send and receive sequences. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `port_id` | [string](#string) | | | -| `channel_id` | [string](#string) | | | -| `sequence` | [uint64](#uint64) | | | - - - - - - - - - - - - - - -

Top

@@ -8779,60 +9461,47 @@ Msg defines the ibc/channel Msg service. - +

Top

-## ibc/core/client/v1/genesis.proto +## ibc/core/channel/v1/genesis.proto - - -### GenesisMetadata -GenesisMetadata defines the genesis type for metadata that clients may return -with ExportMetadata - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `key` | [bytes](#bytes) | | store key of metadata without clientID-prefix | -| `value` | [bytes](#bytes) | | metadata value | - - - - - - - + ### GenesisState -GenesisState defines the ibc client submodule's genesis state. +GenesisState defines the ibc channel submodule's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `clients` | [IdentifiedClientState](#ibc.core.client.v1.IdentifiedClientState) | repeated | client states with their corresponding identifiers | -| `clients_consensus` | [ClientConsensusStates](#ibc.core.client.v1.ClientConsensusStates) | repeated | consensus states from each client | -| `clients_metadata` | [IdentifiedGenesisMetadata](#ibc.core.client.v1.IdentifiedGenesisMetadata) | repeated | metadata from each client | -| `params` | [Params](#ibc.core.client.v1.Params) | | | -| `create_localhost` | [bool](#bool) | | create localhost on initialization | -| `next_client_sequence` | [uint64](#uint64) | | the sequence for the next generated client identifier | +| `channels` | [IdentifiedChannel](#ibc.core.channel.v1.IdentifiedChannel) | repeated | | +| `acknowledgements` | [PacketState](#ibc.core.channel.v1.PacketState) | repeated | | +| `commitments` | [PacketState](#ibc.core.channel.v1.PacketState) | repeated | | +| `receipts` | [PacketState](#ibc.core.channel.v1.PacketState) | repeated | | +| `send_sequences` | [PacketSequence](#ibc.core.channel.v1.PacketSequence) | repeated | | +| `recv_sequences` | [PacketSequence](#ibc.core.channel.v1.PacketSequence) | repeated | | +| `ack_sequences` | [PacketSequence](#ibc.core.channel.v1.PacketSequence) | repeated | | +| `next_channel_sequence` | [uint64](#uint64) | | the sequence for the next generated channel identifier | - + -### IdentifiedGenesisMetadata -IdentifiedGenesisMetadata has the client metadata with the corresponding client id. +### PacketSequence +PacketSequence defines the genesis type necessary to retrieve and store +next send and receive sequences. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `client_id` | [string](#string) | | | -| `client_metadata` | [GenesisMetadata](#ibc.core.client.v1.GenesisMetadata) | repeated | | +| `port_id` | [string](#string) | | | +| `channel_id` | [string](#string) | | | +| `sequence` | [uint64](#uint64) | | | @@ -8848,343 +9517,6 @@ IdentifiedGenesisMetadata has the client metadata with the corresponding client - -

Top

- -## ibc/core/client/v1/query.proto - - - - - -### QueryClientParamsRequest -QueryClientParamsRequest is the request type for the Query/ClientParams RPC method. - - - - - - - - -### QueryClientParamsResponse -QueryClientParamsResponse is the response type for the Query/ClientParams RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `params` | [Params](#ibc.core.client.v1.Params) | | params defines the parameters of the module. | - - - - - - - - -### QueryClientStateRequest -QueryClientStateRequest is the request type for the Query/ClientState RPC -method - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `client_id` | [string](#string) | | client state unique identifier | - - - - - - - - -### QueryClientStateResponse -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `client_state` | [google.protobuf.Any](#google.protobuf.Any) | | client state associated with the request identifier | -| `proof` | [bytes](#bytes) | | merkle proof of existence | -| `proof_height` | [Height](#ibc.core.client.v1.Height) | | height at which the proof was retrieved | - - - - - - - - -### QueryClientStatesRequest -QueryClientStatesRequest is the request type for the Query/ClientStates RPC -method - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination request | - - - - - - - - -### QueryClientStatesResponse -QueryClientStatesResponse is the response type for the Query/ClientStates RPC -method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `client_states` | [IdentifiedClientState](#ibc.core.client.v1.IdentifiedClientState) | repeated | list of stored ClientStates of the chain. | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination response | - - - - - - - - -### QueryConsensusStateRequest -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `client_id` | [string](#string) | | client identifier | -| `revision_number` | [uint64](#uint64) | | consensus state revision number | -| `revision_height` | [uint64](#uint64) | | consensus state revision height | -| `latest_height` | [bool](#bool) | | latest_height overrrides the height field and queries the latest stored ConsensusState | - - - - - - - - -### QueryConsensusStateResponse -QueryConsensusStateResponse is the response type for the Query/ConsensusState -RPC method - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `consensus_state` | [google.protobuf.Any](#google.protobuf.Any) | | consensus state associated with the client identifier at the given height | -| `proof` | [bytes](#bytes) | | merkle proof of existence | -| `proof_height` | [Height](#ibc.core.client.v1.Height) | | height at which the proof was retrieved | - - - - - - - - -### QueryConsensusStatesRequest -QueryConsensusStatesRequest is the request type for the Query/ConsensusStates -RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `client_id` | [string](#string) | | client identifier | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination request | - - - - - - - - -### QueryConsensusStatesResponse -QueryConsensusStatesResponse is the response type for the -Query/ConsensusStates RPC method - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `consensus_states` | [ConsensusStateWithHeight](#ibc.core.client.v1.ConsensusStateWithHeight) | repeated | consensus states associated with the identifier | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination response | - - - - - - - - - - - - - - -### Query -Query provides defines the gRPC querier service - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `ClientState` | [QueryClientStateRequest](#ibc.core.client.v1.QueryClientStateRequest) | [QueryClientStateResponse](#ibc.core.client.v1.QueryClientStateResponse) | ClientState queries an IBC light client. | GET|/ibc/core/client/v1beta1/client_states/{client_id}| -| `ClientStates` | [QueryClientStatesRequest](#ibc.core.client.v1.QueryClientStatesRequest) | [QueryClientStatesResponse](#ibc.core.client.v1.QueryClientStatesResponse) | ClientStates queries all the IBC light clients of a chain. | GET|/ibc/core/client/v1beta1/client_states| -| `ConsensusState` | [QueryConsensusStateRequest](#ibc.core.client.v1.QueryConsensusStateRequest) | [QueryConsensusStateResponse](#ibc.core.client.v1.QueryConsensusStateResponse) | ConsensusState queries a consensus state associated with a client state at a given height. | GET|/ibc/core/client/v1beta1/consensus_states/{client_id}/revision/{revision_number}/height/{revision_height}| -| `ConsensusStates` | [QueryConsensusStatesRequest](#ibc.core.client.v1.QueryConsensusStatesRequest) | [QueryConsensusStatesResponse](#ibc.core.client.v1.QueryConsensusStatesResponse) | ConsensusStates queries all the consensus state associated with a given client. | GET|/ibc/core/client/v1beta1/consensus_states/{client_id}| -| `ClientParams` | [QueryClientParamsRequest](#ibc.core.client.v1.QueryClientParamsRequest) | [QueryClientParamsResponse](#ibc.core.client.v1.QueryClientParamsResponse) | ClientParams queries all parameters of the ibc client. | GET|/ibc/client/v1beta1/params| - - - - - - -

Top

- -## ibc/core/client/v1/tx.proto - - - - - -### MsgCreateClient -MsgCreateClient defines a message to create an IBC client - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `client_state` | [google.protobuf.Any](#google.protobuf.Any) | | light client state | -| `consensus_state` | [google.protobuf.Any](#google.protobuf.Any) | | consensus state associated with the client that corresponds to a given height. | -| `signer` | [string](#string) | | signer address | - - - - - - - - -### MsgCreateClientResponse -MsgCreateClientResponse defines the Msg/CreateClient response type. - - - - - - - - -### MsgSubmitMisbehaviour -MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for -light client misbehaviour. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `client_id` | [string](#string) | | client unique identifier | -| `misbehaviour` | [google.protobuf.Any](#google.protobuf.Any) | | misbehaviour used for freezing the light client | -| `signer` | [string](#string) | | signer address | - - - - - - - - -### MsgSubmitMisbehaviourResponse -MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response type. - - - - - - - - -### MsgUpdateClient -MsgUpdateClient defines an sdk.Msg to update a IBC client state using -the given header. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `client_id` | [string](#string) | | client unique identifier | -| `header` | [google.protobuf.Any](#google.protobuf.Any) | | header to update the light client | -| `signer` | [string](#string) | | signer address | - - - - - - - - -### MsgUpdateClientResponse -MsgUpdateClientResponse defines the Msg/UpdateClient response type. - - - - - - - - -### MsgUpgradeClient -MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client state - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `client_id` | [string](#string) | | client unique identifier | -| `client_state` | [google.protobuf.Any](#google.protobuf.Any) | | upgraded client state | -| `consensus_state` | [google.protobuf.Any](#google.protobuf.Any) | | upgraded consensus state, only contains enough information to serve as a basis of trust in update logic | -| `proof_upgrade_client` | [bytes](#bytes) | | proof that old chain committed to new client | -| `proof_upgrade_consensus_state` | [bytes](#bytes) | | proof that old chain committed to new consensus state | -| `signer` | [string](#string) | | signer address | - - - - - - - - -### MsgUpgradeClientResponse -MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. - - - - - - - - - - - - - - -### Msg -Msg defines the ibc/client Msg service. - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `CreateClient` | [MsgCreateClient](#ibc.core.client.v1.MsgCreateClient) | [MsgCreateClientResponse](#ibc.core.client.v1.MsgCreateClientResponse) | CreateClient defines a rpc handler method for MsgCreateClient. | | -| `UpdateClient` | [MsgUpdateClient](#ibc.core.client.v1.MsgUpdateClient) | [MsgUpdateClientResponse](#ibc.core.client.v1.MsgUpdateClientResponse) | UpdateClient defines a rpc handler method for MsgUpdateClient. | | -| `UpgradeClient` | [MsgUpgradeClient](#ibc.core.client.v1.MsgUpgradeClient) | [MsgUpgradeClientResponse](#ibc.core.client.v1.MsgUpgradeClientResponse) | UpgradeClient defines a rpc handler method for MsgUpgradeClient. | | -| `SubmitMisbehaviour` | [MsgSubmitMisbehaviour](#ibc.core.client.v1.MsgSubmitMisbehaviour) | [MsgSubmitMisbehaviourResponse](#ibc.core.client.v1.MsgSubmitMisbehaviourResponse) | SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. | | - - - - -

Top

@@ -9409,39 +9741,6 @@ INIT, TRYOPEN, OPEN or UNINITIALIZED. - -

Top

- -## ibc/core/connection/v1/genesis.proto - - - - - -### GenesisState -GenesisState defines the ibc connection submodule's genesis state. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `connections` | [IdentifiedConnection](#ibc.core.connection.v1.IdentifiedConnection) | repeated | | -| `client_connection_paths` | [ConnectionPaths](#ibc.core.connection.v1.ConnectionPaths) | repeated | | -| `next_connection_sequence` | [uint64](#uint64) | | the sequence for the next generated connection identifier | - - - - - - - - - - - - - - -

Top

@@ -9806,6 +10105,39 @@ Msg defines the ibc/connection Msg service. + +

Top

+ +## ibc/core/connection/v1/genesis.proto + + + + + +### GenesisState +GenesisState defines the ibc connection submodule's genesis state. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `connections` | [IdentifiedConnection](#ibc.core.connection.v1.IdentifiedConnection) | repeated | | +| `client_connection_paths` | [ConnectionPaths](#ibc.core.connection.v1.ConnectionPaths) | repeated | | +| `next_connection_sequence` | [uint64](#uint64) | | the sequence for the next generated connection identifier | + + + + + + + + + + + + + + +

Top

@@ -9862,6 +10194,128 @@ access to keys outside the client prefix. + + + + + + + + + + + +

Top

+ +## ibc/lightclients/tendermint/v1/tendermint.proto + + + + + +### ClientState +ClientState from Tendermint tracks the current validator set, latest height, +and a possible frozen height. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `chain_id` | [string](#string) | | | +| `trust_level` | [Fraction](#ibc.lightclients.tendermint.v1.Fraction) | | | +| `trusting_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | duration of the period since the LastestTimestamp during which the submitted headers are valid for upgrade | +| `unbonding_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | duration of the staking unbonding period | +| `max_clock_drift` | [google.protobuf.Duration](#google.protobuf.Duration) | | defines how much new (untrusted) header's Time can drift into the future. | +| `frozen_height` | [ibc.core.client.v1.Height](#ibc.core.client.v1.Height) | | Block height when the client was frozen due to a misbehaviour | +| `latest_height` | [ibc.core.client.v1.Height](#ibc.core.client.v1.Height) | | Latest height the client was updated to | +| `proof_specs` | [ics23.ProofSpec](#ics23.ProofSpec) | repeated | Proof specifications used in verifying counterparty state | +| `upgrade_path` | [string](#string) | repeated | 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"}` | +| `allow_update_after_expiry` | [bool](#bool) | | This flag, when set to true, will allow governance to recover a client which has expired | +| `allow_update_after_misbehaviour` | [bool](#bool) | | This flag, when set to true, will allow governance to unfreeze a client whose chain has experienced a misbehaviour event | + + + + + + + + +### ConsensusState +ConsensusState defines the consensus state from Tendermint. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `timestamp` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | timestamp that corresponds to the block height in which the ConsensusState was stored. | +| `root` | [ibc.core.commitment.v1.MerkleRoot](#ibc.core.commitment.v1.MerkleRoot) | | commitment root (i.e app hash) | +| `next_validators_hash` | [bytes](#bytes) | | | + + + + + + + + +### Fraction +Fraction defines the protobuf message type for tmmath.Fraction that only supports positive values. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `numerator` | [uint64](#uint64) | | | +| `denominator` | [uint64](#uint64) | | | + + + + + + + + +### Header +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `signed_header` | [tendermint.types.SignedHeader](#tendermint.types.SignedHeader) | | | +| `validator_set` | [tendermint.types.ValidatorSet](#tendermint.types.ValidatorSet) | | | +| `trusted_height` | [ibc.core.client.v1.Height](#ibc.core.client.v1.Height) | | | +| `trusted_validators` | [tendermint.types.ValidatorSet](#tendermint.types.ValidatorSet) | | | + + + + + + + + +### Misbehaviour +Misbehaviour is a wrapper over two conflicting Headers +that implements Misbehaviour interface expected by ICS-02 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `client_id` | [string](#string) | | | +| `header_1` | [Header](#ibc.lightclients.tendermint.v1.Header) | | | +| `header_2` | [Header](#ibc.lightclients.tendermint.v1.Header) | | | + + + + + @@ -10189,128 +10643,6 @@ data sign byte encodings. - -

Top

- -## ibc/lightclients/tendermint/v1/tendermint.proto - - - - - -### ClientState -ClientState from Tendermint tracks the current validator set, latest height, -and a possible frozen height. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `chain_id` | [string](#string) | | | -| `trust_level` | [Fraction](#ibc.lightclients.tendermint.v1.Fraction) | | | -| `trusting_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | duration of the period since the LastestTimestamp during which the submitted headers are valid for upgrade | -| `unbonding_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | duration of the staking unbonding period | -| `max_clock_drift` | [google.protobuf.Duration](#google.protobuf.Duration) | | defines how much new (untrusted) header's Time can drift into the future. | -| `frozen_height` | [ibc.core.client.v1.Height](#ibc.core.client.v1.Height) | | Block height when the client was frozen due to a misbehaviour | -| `latest_height` | [ibc.core.client.v1.Height](#ibc.core.client.v1.Height) | | Latest height the client was updated to | -| `proof_specs` | [ics23.ProofSpec](#ics23.ProofSpec) | repeated | Proof specifications used in verifying counterparty state | -| `upgrade_path` | [string](#string) | repeated | 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"}` | -| `allow_update_after_expiry` | [bool](#bool) | | This flag, when set to true, will allow governance to recover a client which has expired | -| `allow_update_after_misbehaviour` | [bool](#bool) | | This flag, when set to true, will allow governance to unfreeze a client whose chain has experienced a misbehaviour event | - - - - - - - - -### ConsensusState -ConsensusState defines the consensus state from Tendermint. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `timestamp` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | timestamp that corresponds to the block height in which the ConsensusState was stored. | -| `root` | [ibc.core.commitment.v1.MerkleRoot](#ibc.core.commitment.v1.MerkleRoot) | | commitment root (i.e app hash) | -| `next_validators_hash` | [bytes](#bytes) | | | - - - - - - - - -### Fraction -Fraction defines the protobuf message type for tmmath.Fraction that only supports positive values. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `numerator` | [uint64](#uint64) | | | -| `denominator` | [uint64](#uint64) | | | - - - - - - - - -### Header -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `signed_header` | [tendermint.types.SignedHeader](#tendermint.types.SignedHeader) | | | -| `validator_set` | [tendermint.types.ValidatorSet](#tendermint.types.ValidatorSet) | | | -| `trusted_height` | [ibc.core.client.v1.Height](#ibc.core.client.v1.Height) | | | -| `trusted_validators` | [tendermint.types.ValidatorSet](#tendermint.types.ValidatorSet) | | | - - - - - - - - -### Misbehaviour -Misbehaviour is a wrapper over two conflicting Headers -that implements Misbehaviour interface expected by ICS-02 - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `client_id` | [string](#string) | | | -| `header_1` | [Header](#ibc.lightclients.tendermint.v1.Header) | | | -| `header_2` | [Header](#ibc.lightclients.tendermint.v1.Header) | | | - - - - - - - - - - - - - - - ## Scalar Value Types | .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | diff --git a/proto/cosmos/feegrant/v1beta1/feegrant.proto b/proto/cosmos/feegrant/v1beta1/feegrant.proto new file mode 100644 index 000000000..534de582d --- /dev/null +++ b/proto/cosmos/feegrant/v1beta1/feegrant.proto @@ -0,0 +1,81 @@ +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/types"; + +// BasicFeeAllowance implements FeeAllowance with a one-time grant of tokens +// that optionally expires. The delegatee can use up to SpendLimit to cover fees. +message BasicFeeAllowance { + 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 + ExpiresAt expiration = 2 [(gogoproto.nullable) = false]; +} + +// PeriodicFeeAllowance extends FeeAllowance to allow for both a maximum cap, +// as well as a limit per time period. +message PeriodicFeeAllowance { + option (cosmos_proto.implements_interface) = "FeeAllowanceI"; + + // basic specifies a struct of `BasicFeeAllowance` + BasicFeeAllowance basic = 1 [(gogoproto.nullable) = false]; + + // period specifies the time duration in which period_spend_limit coins can + // be spent before that allowance is reset + Duration period = 2 [(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 + ExpiresAt period_reset = 5 [(gogoproto.nullable) = false]; +} + +// Duration is a span of a clock time or number of blocks. +// This is designed to be added to an ExpiresAt struct. +message Duration { + // sum is the oneof that represents either duration or block + oneof sum { + google.protobuf.Duration duration = 1 [(gogoproto.stdduration) = true]; + uint64 blocks = 2; + } +} + +// ExpiresAt is a point in time where something expires. +// It may be *either* block time or block height +message ExpiresAt { + // sum is the oneof that represents either time or height + oneof sum { + google.protobuf.Timestamp time = 1 [(gogoproto.stdtime) = true]; + int64 height = 2; + } +} + +// FeeAllowanceGrant is stored in the KVStore to record a grant with full context +message FeeAllowanceGrant { + + string granter = 1; + string grantee = 2; + google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; +} diff --git a/proto/cosmos/feegrant/v1beta1/genesis.proto b/proto/cosmos/feegrant/v1beta1/genesis.proto new file mode 100644 index 000000000..a021ea61d --- /dev/null +++ b/proto/cosmos/feegrant/v1beta1/genesis.proto @@ -0,0 +1,12 @@ +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/types"; + +// GenesisState contains a set of fee allowances, persisted from the store +message GenesisState { + repeated FeeAllowanceGrant fee_allowances = 1 [(gogoproto.nullable) = false]; +} diff --git a/proto/cosmos/feegrant/v1beta1/query.proto b/proto/cosmos/feegrant/v1beta1/query.proto new file mode 100644 index 000000000..42d5f3020 --- /dev/null +++ b/proto/cosmos/feegrant/v1beta1/query.proto @@ -0,0 +1,52 @@ +syntax = "proto3"; +package cosmos.feegrant.v1beta1; + +import "gogoproto/gogo.proto"; +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/types"; + +// Query defines the gRPC querier service. +service Query { + + // FeeAllowance returns fee granted to the grantee by the granter. + rpc FeeAllowance(QueryFeeAllowanceRequest) returns (QueryFeeAllowanceResponse) { + option (google.api.http).get = "/cosmos/feegrant/v1beta1/fee_allowance/{granter}/{grantee}"; + } + + // FeeAllowances returns all the grants for address. + rpc FeeAllowances(QueryFeeAllowancesRequest) returns (QueryFeeAllowancesResponse) { + option (google.api.http).get = "/cosmos/feegrant/v1beta1/fee_allowances/{grantee}"; + } +} + +// QueryFeeAllowanceRequest is the request type for the Query/FeeAllowance RPC method. +message QueryFeeAllowanceRequest { + string granter = 1; + string grantee = 2; +} + +// QueryFeeAllowanceResponse is the response type for the Query/FeeAllowance RPC method. +message QueryFeeAllowanceResponse { + // fee_allowance is a fee_allowance granted for grantee by granter. + cosmos.feegrant.v1beta1.FeeAllowanceGrant fee_allowance = 1; +} + +// QueryFeeAllowancesRequest is the request type for the Query/FeeAllowances RPC method. +message QueryFeeAllowancesRequest { + string grantee = 1; + + // pagination defines an pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryFeeAllowancesResponse is the response type for the Query/FeeAllowances RPC method. +message QueryFeeAllowancesResponse { + // fee_allowances are fee_allowance's granted for grantee by granter. + repeated cosmos.feegrant.v1beta1.FeeAllowanceGrant fee_allowances = 1; + + // pagination defines an pagination for the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/proto/cosmos/feegrant/v1beta1/tx.proto b/proto/cosmos/feegrant/v1beta1/tx.proto new file mode 100644 index 000000000..a36f358f2 --- /dev/null +++ b/proto/cosmos/feegrant/v1beta1/tx.proto @@ -0,0 +1,40 @@ +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/types"; + +// Msg defines the feegrant msg service. +service Msg { + + // GrantFeeAllowance grants fee allowance to the grantee on the granter's + // account with the provided expiration time. + rpc GrantFeeAllowance(MsgGrantFeeAllowance) returns (MsgGrantFeeAllowanceResponse); + + // RevokeFeeAllowance revokes any fee allowance of granter's account that + // has been granted to the grantee. + rpc RevokeFeeAllowance(MsgRevokeFeeAllowance) returns (MsgRevokeFeeAllowanceResponse); +} + +// MsgGrantFeeAllowance adds permission for Grantee to spend up to Allowance +// of fees from the account of Granter. +message MsgGrantFeeAllowance { + string granter = 1; + string grantee = 2; + google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; +} + +// MsgGrantFeeAllowanceResponse defines the Msg/GrantFeeAllowanceResponse response type. +message MsgGrantFeeAllowanceResponse {} + +// MsgRevokeFeeAllowance removes any existing FeeAllowance from Granter to Grantee. +message MsgRevokeFeeAllowance { + string granter = 1; + string grantee = 2; +} + +// MsgRevokeFeeAllowanceResponse defines the Msg/RevokeFeeAllowanceResponse response type. +message MsgRevokeFeeAllowanceResponse {} diff --git a/simapp/app.go b/simapp/app.go index 5e9c3e29e..23ced043d 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -55,6 +55,10 @@ import ( "github.com/cosmos/cosmos-sdk/x/evidence" evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper" evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types" + feegrant "github.com/cosmos/cosmos-sdk/x/feegrant" + feegrantante "github.com/cosmos/cosmos-sdk/x/feegrant/ante" + feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" + feegranttypes "github.com/cosmos/cosmos-sdk/x/feegrant/types" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "github.com/cosmos/cosmos-sdk/x/gov" @@ -120,6 +124,7 @@ var ( crisis.AppModuleBasic{}, slashing.AppModuleBasic{}, ibc.AppModuleBasic{}, + feegrant.AppModuleBasic{}, upgrade.AppModuleBasic{}, evidence.AppModuleBasic{}, transfer.AppModuleBasic{}, @@ -181,6 +186,7 @@ type SimApp struct { IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly EvidenceKeeper evidencekeeper.Keeper TransferKeeper ibctransferkeeper.Keeper + FeeGrantKeeper feegrantkeeper.Keeper // make scoped keepers public for test purposes ScopedIBCKeeper capabilitykeeper.ScopedKeeper @@ -222,7 +228,7 @@ func NewSimApp( keys := sdk.NewKVStoreKeys( authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, - govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, + govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, feegranttypes.StoreKey, evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey, authztypes.StoreKey, ) @@ -277,6 +283,8 @@ func NewSimApp( app.CrisisKeeper = crisiskeeper.NewKeeper( app.GetSubspace(crisistypes.ModuleName), invCheckPeriod, app.BankKeeper, authtypes.FeeCollectorName, ) + + app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, keys[feegranttypes.StoreKey], app.AccountKeeper) app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath) // register the staking hooks @@ -347,6 +355,7 @@ func NewSimApp( bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper), capability.NewAppModule(appCodec, *app.CapabilityKeeper), crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants), + feegrant.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper), mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper), slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), @@ -379,6 +388,7 @@ func NewSimApp( capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, distrtypes.ModuleName, stakingtypes.ModuleName, slashingtypes.ModuleName, govtypes.ModuleName, minttypes.ModuleName, crisistypes.ModuleName, ibchost.ModuleName, genutiltypes.ModuleName, evidencetypes.ModuleName, authztypes.ModuleName, ibctransfertypes.ModuleName, + feegranttypes.ModuleName, ) app.mm.RegisterInvariants(&app.CrisisKeeper) @@ -396,6 +406,7 @@ func NewSimApp( auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts), bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper), capability.NewAppModule(appCodec, *app.CapabilityKeeper), + feegrant.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry), gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper), mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper), staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), @@ -419,8 +430,8 @@ func NewSimApp( app.SetInitChainer(app.InitChainer) app.SetBeginBlocker(app.BeginBlocker) app.SetAnteHandler( - ante.NewAnteHandler( - app.AccountKeeper, app.BankKeeper, ante.DefaultSigVerificationGasConsumer, + feegrantante.NewAnteHandler( + app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, ante.DefaultSigVerificationGasConsumer, encodingConfig.TxConfig.SignModeHandler(), ), ) diff --git a/simapp/params/weights.go b/simapp/params/weights.go index 0ba377b00..a7ea85ef7 100644 --- a/simapp/params/weights.go +++ b/simapp/params/weights.go @@ -20,4 +20,8 @@ const ( DefaultWeightCommunitySpendProposal int = 5 DefaultWeightTextProposal int = 5 DefaultWeightParamChangeProposal int = 5 + + // feegrant + DefaultWeightGrantFeeAllowance int = 100 + DefaultWeightRevokeFeeAllowance int = 100 ) diff --git a/x/auth/legacy/legacytx/stdtx_builder.go b/x/auth/legacy/legacytx/stdtx_builder.go index 153c4b2bb..ae0e97a3f 100644 --- a/x/auth/legacy/legacytx/stdtx_builder.go +++ b/x/auth/legacy/legacytx/stdtx_builder.go @@ -84,6 +84,9 @@ func (s *StdTxBuilder) SetTimeoutHeight(height uint64) { s.TimeoutHeight = height } +// SetFeeGranter does nothing for stdtx +func (s *StdTxBuilder) SetFeeGranter(_ sdk.AccAddress) {} + // StdTxConfig is a context.TxConfig for StdTx type StdTxConfig struct { Cdc *codec.LegacyAmino diff --git a/x/feegrant/ante/ante.go b/x/feegrant/ante/ante.go new file mode 100644 index 000000000..483868c23 --- /dev/null +++ b/x/feegrant/ante/ante.go @@ -0,0 +1,35 @@ +package ante + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + authante "github.com/cosmos/cosmos-sdk/x/auth/ante" + authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + "github.com/cosmos/cosmos-sdk/x/auth/signing" + feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" + feegranttypes "github.com/cosmos/cosmos-sdk/x/feegrant/types" +) + +// NewAnteHandler returns an AnteHandler that checks and increments sequence +// numbers, checks signatures & account numbers, and deducts fees from the +// fee_payer or from fee_granter (if valid grant exist). +func NewAnteHandler( + ak authkeeper.AccountKeeper, bankKeeper feegranttypes.BankKeeper, feeGrantKeeper feegrantkeeper.Keeper, + sigGasConsumer authante.SignatureVerificationGasConsumer, signModeHandler signing.SignModeHandler, +) sdk.AnteHandler { + + return sdk.ChainAnteDecorators( + authante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first + authante.NewRejectExtensionOptionsDecorator(), + authante.NewMempoolFeeDecorator(), + authante.NewValidateBasicDecorator(), + authante.TxTimeoutHeightDecorator{}, + authante.NewValidateMemoDecorator(ak), + authante.NewConsumeGasForTxSizeDecorator(ak), + NewDeductGrantedFeeDecorator(ak, bankKeeper, feeGrantKeeper), + authante.NewSetPubKeyDecorator(ak), // SetPubKeyDecorator must be called before all signature verification decorators + authante.NewValidateSigCountDecorator(ak), + authante.NewSigGasConsumeDecorator(ak, sigGasConsumer), + authante.NewSigVerificationDecorator(ak, signModeHandler), + authante.NewIncrementSequenceDecorator(ak), // innermost AnteDecorator + ) +} diff --git a/x/feegrant/ante/fee.go b/x/feegrant/ante/fee.go new file mode 100644 index 000000000..52cbda721 --- /dev/null +++ b/x/feegrant/ante/fee.go @@ -0,0 +1,82 @@ +package ante + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + authante "github.com/cosmos/cosmos-sdk/x/auth/ante" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" + "github.com/cosmos/cosmos-sdk/x/feegrant/types" +) + +// DeductGrantedFeeDecorator deducts fees from fee_payer or fee_granter (if exists a valid fee allowance) of the tx +// If the fee_payer or fee_granter does not have the funds to pay for the fees, return with InsufficientFunds error +// Call next AnteHandler if fees successfully deducted +// CONTRACT: Tx must implement GrantedFeeTx interface to use DeductGrantedFeeDecorator +type DeductGrantedFeeDecorator struct { + ak types.AccountKeeper + k keeper.Keeper + bk types.BankKeeper +} + +func NewDeductGrantedFeeDecorator(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper) DeductGrantedFeeDecorator { + return DeductGrantedFeeDecorator{ + ak: ak, + k: k, + bk: bk, + } +} + +// AnteHandle performs a decorated ante-handler responsible for deducting transaction +// fees. Fees will be deducted from the account designated by the FeePayer on a +// transaction by default. However, if the fee payer differs from the transaction +// signer, the handler will check if a fee grant has been authorized. If the +// transaction's signer does not exist, it will be created. +func (d DeductGrantedFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { + feeTx, ok := tx.(sdk.FeeTx) + if !ok { + return ctx, sdkerrors.Wrap(sdkerrors.ErrTxDecode, "Tx must be a GrantedFeeTx") + } + + // sanity check from DeductFeeDecorator + if addr := d.ak.GetModuleAddress(authtypes.FeeCollectorName); addr == nil { + panic(fmt.Sprintf("%s module account has not been set", authtypes.FeeCollectorName)) + } + + fee := feeTx.GetFee() + feePayer := feeTx.FeePayer() + feeGranter := feeTx.FeeGranter() + + deductFeesFrom := feePayer + + // ensure the grant is allowed, if we request a different fee payer + if feeGranter != nil && !feeGranter.Equals(feePayer) { + err := d.k.UseGrantedFees(ctx, feeGranter, feePayer, fee) + if err != nil { + return ctx, sdkerrors.Wrapf(err, "%s not allowed to pay fees from %s", feeGranter, feePayer) + } + + deductFeesFrom = feeGranter + } + + // now, either way, we know that we are authorized to deduct the fees from the deductFeesFrom account + deductFeesFromAcc := d.ak.GetAccount(ctx, deductFeesFrom) + if deductFeesFromAcc == nil { + return ctx, sdkerrors.Wrapf(sdkerrors.ErrUnknownAddress, "fee payer address: %s does not exist", deductFeesFrom) + } + + // move on if there is no fee to deduct + if fee.IsZero() { + return next(ctx, tx, simulate) + } + + // deduct fee if non-zero + err = authante.DeductFees(d.bk, ctx, deductFeesFromAcc, fee) + if err != nil { + return ctx, err + } + + return next(ctx, tx, simulate) +} diff --git a/x/feegrant/ante/fee_test.go b/x/feegrant/ante/fee_test.go new file mode 100644 index 000000000..293f448d7 --- /dev/null +++ b/x/feegrant/ante/fee_test.go @@ -0,0 +1,287 @@ +package ante_test + +import ( + "math/rand" + "testing" + "time" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/stretchr/testify/suite" + "github.com/tendermint/tendermint/crypto" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/simapp/helpers" + "github.com/cosmos/cosmos-sdk/testutil/testdata" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + authante "github.com/cosmos/cosmos-sdk/x/auth/ante" + authsign "github.com/cosmos/cosmos-sdk/x/auth/signing" + "github.com/cosmos/cosmos-sdk/x/auth/tx" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/cosmos/cosmos-sdk/x/feegrant/ante" + "github.com/cosmos/cosmos-sdk/x/feegrant/types" +) + +// AnteTestSuite is a test suite to be used with ante handler tests. +type AnteTestSuite struct { + suite.Suite + + app *simapp.SimApp + anteHandler sdk.AnteHandler + ctx sdk.Context + clientCtx client.Context + txBuilder client.TxBuilder +} + +// SetupTest setups a new test, with new app, context, and anteHandler. +func (suite *AnteTestSuite) SetupTest(isCheckTx bool) { + suite.app, suite.ctx = createTestApp(isCheckTx) + suite.ctx = suite.ctx.WithBlockHeight(1) + + // Set up TxConfig. + encodingConfig := simapp.MakeTestEncodingConfig() + // We're using TestMsg encoding in some tests, so register it here. + encodingConfig.Amino.RegisterConcrete(&testdata.TestMsg{}, "testdata.TestMsg", nil) + testdata.RegisterInterfaces(encodingConfig.InterfaceRegistry) + + suite.clientCtx = client.Context{}. + WithTxConfig(encodingConfig.TxConfig) + + suite.anteHandler = ante.NewAnteHandler(suite.app.AccountKeeper, suite.app.BankKeeper, suite.app.FeeGrantKeeper, authante.DefaultSigVerificationGasConsumer, encodingConfig.TxConfig.SignModeHandler()) +} + +func (suite *AnteTestSuite) TestDeductFeesNoDelegation() { + suite.SetupTest(true) + // setup + app, ctx := suite.app, suite.ctx + + protoTxCfg := tx.NewTxConfig(codec.NewProtoCodec(app.InterfaceRegistry()), tx.DefaultSignModes) + + // this just tests our handler + dfd := ante.NewDeductGrantedFeeDecorator(app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper) + ourAnteHandler := sdk.ChainAnteDecorators(dfd) + + // this tests the whole stack + anteHandlerStack := suite.anteHandler + + // keys and addresses + priv1, _, addr1 := testdata.KeyTestPubAddr() + priv2, _, addr2 := testdata.KeyTestPubAddr() + priv3, _, addr3 := testdata.KeyTestPubAddr() + priv4, _, addr4 := testdata.KeyTestPubAddr() + priv5, _, addr5 := testdata.KeyTestPubAddr() + + // Set addr1 with insufficient funds + acc1 := app.AccountKeeper.NewAccountWithAddress(ctx, addr1) + app.AccountKeeper.SetAccount(ctx, acc1) + app.BankKeeper.SetBalances(ctx, addr1, []sdk.Coin{sdk.NewCoin("atom", sdk.NewInt(10))}) + + // Set addr2 with more funds + acc2 := app.AccountKeeper.NewAccountWithAddress(ctx, addr2) + app.AccountKeeper.SetAccount(ctx, acc2) + app.BankKeeper.SetBalances(ctx, addr2, []sdk.Coin{sdk.NewCoin("atom", sdk.NewInt(99999))}) + + // grant fee allowance from `addr2` to `addr3` (plenty to pay) + err := app.FeeGrantKeeper.GrantFeeAllowance(ctx, addr2, addr3, &types.BasicFeeAllowance{ + SpendLimit: sdk.NewCoins(sdk.NewInt64Coin("atom", 500)), + }) + suite.Require().NoError(err) + + // grant low fee allowance (20atom), to check the tx requesting more than allowed. + err = app.FeeGrantKeeper.GrantFeeAllowance(ctx, addr2, addr4, &types.BasicFeeAllowance{ + SpendLimit: sdk.NewCoins(sdk.NewInt64Coin("atom", 20)), + }) + suite.Require().NoError(err) + + cases := map[string]struct { + signerKey cryptotypes.PrivKey + signer sdk.AccAddress + feeAccount sdk.AccAddress + feeAccountKey cryptotypes.PrivKey + handler sdk.AnteHandler + fee int64 + valid bool + }{ + "paying with low funds (only ours)": { + signerKey: priv1, + signer: addr1, + fee: 50, + handler: ourAnteHandler, + valid: false, + }, + "paying with good funds (only ours)": { + signerKey: priv2, + signer: addr2, + fee: 50, + handler: ourAnteHandler, + valid: true, + }, + "paying with no account (only ours)": { + signerKey: priv3, + signer: addr3, + fee: 1, + handler: ourAnteHandler, + valid: false, + }, + "no fee with real account (only ours)": { + signerKey: priv1, + signer: addr1, + fee: 0, + handler: ourAnteHandler, + valid: true, + }, + "no fee with no account (only ours)": { + signerKey: priv5, + signer: addr5, + fee: 0, + handler: ourAnteHandler, + valid: false, + }, + "valid fee grant without account (only ours)": { + signerKey: priv3, + signer: addr3, + feeAccount: addr2, + fee: 50, + handler: ourAnteHandler, + valid: true, + }, + "no fee grant (only ours)": { + signerKey: priv3, + signer: addr3, + feeAccount: addr1, + fee: 2, + handler: ourAnteHandler, + valid: false, + }, + "allowance smaller than requested fee (only ours)": { + signerKey: priv4, + signer: addr4, + feeAccount: addr2, + fee: 50, + handler: ourAnteHandler, + valid: false, + }, + "granter cannot cover allowed fee grant (only ours)": { + signerKey: priv4, + signer: addr4, + feeAccount: addr1, + fee: 50, + handler: ourAnteHandler, + valid: false, + }, + } + + for name, stc := range cases { + tc := stc // to make scopelint happy + suite.T().Run(name, func(t *testing.T) { + fee := sdk.NewCoins(sdk.NewInt64Coin("atom", tc.fee)) + msgs := []sdk.Msg{testdata.NewTestMsg(tc.signer)} + + acc := app.AccountKeeper.GetAccount(ctx, tc.signer) + privs, accNums, seqs := []cryptotypes.PrivKey{tc.signerKey}, []uint64{0}, []uint64{0} + if acc != nil { + accNums, seqs = []uint64{acc.GetAccountNumber()}, []uint64{acc.GetSequence()} + } + + tx, err := genTxWithFeeGranter(protoTxCfg, msgs, fee, helpers.DefaultGenTxGas, ctx.ChainID(), accNums, seqs, tc.feeAccount, privs...) + suite.Require().NoError(err) + _, err = ourAnteHandler(ctx, tx, false) + if tc.valid { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + } + + _, err = anteHandlerStack(ctx, tx, false) + if tc.valid { + suite.Require().NoError(err) + } else { + suite.Require().Error(err) + } + }) + } +} + +// returns context and app with params set on account keeper +func createTestApp(isCheckTx bool) (*simapp.SimApp, sdk.Context) { + app := simapp.Setup(isCheckTx) + ctx := app.BaseApp.NewContext(isCheckTx, tmproto.Header{}) + app.AccountKeeper.SetParams(ctx, authtypes.DefaultParams()) + + return app, ctx +} + +// don't consume any gas +func SigGasNoConsumer(meter sdk.GasMeter, sig []byte, pubkey crypto.PubKey, params authtypes.Params) error { + return nil +} + +func genTxWithFeeGranter(gen client.TxConfig, msgs []sdk.Msg, feeAmt sdk.Coins, gas uint64, chainID string, accNums, + accSeqs []uint64, feeGranter sdk.AccAddress, priv ...cryptotypes.PrivKey) (sdk.Tx, error) { + sigs := make([]signing.SignatureV2, len(priv)) + + // create a random length memo + r := rand.New(rand.NewSource(time.Now().UnixNano())) + + memo := simulation.RandStringOfLength(r, simulation.RandIntBetween(r, 0, 100)) + + signMode := gen.SignModeHandler().DefaultMode() + + // 1st round: set SignatureV2 with empty signatures, to set correct + // signer infos. + for i, p := range priv { + sigs[i] = signing.SignatureV2{ + PubKey: p.PubKey(), + Data: &signing.SingleSignatureData{ + SignMode: signMode, + }, + Sequence: accSeqs[i], + } + } + + tx := gen.NewTxBuilder() + err := tx.SetMsgs(msgs...) + if err != nil { + return nil, err + } + err = tx.SetSignatures(sigs...) + if err != nil { + return nil, err + } + tx.SetMemo(memo) + tx.SetFeeAmount(feeAmt) + tx.SetGasLimit(gas) + tx.SetFeeGranter(feeGranter) + + // 2nd round: once all signer infos are set, every signer can sign. + for i, p := range priv { + signerData := authsign.SignerData{ + ChainID: chainID, + AccountNumber: accNums[i], + Sequence: accSeqs[i], + } + signBytes, err := gen.SignModeHandler().GetSignBytes(signMode, signerData, tx.GetTx()) + if err != nil { + panic(err) + } + sig, err := p.Sign(signBytes) + if err != nil { + panic(err) + } + sigs[i].Data.(*signing.SingleSignatureData).Signature = sig + err = tx.SetSignatures(sigs...) + if err != nil { + panic(err) + } + } + + return tx.GetTx(), nil +} + +func TestAnteTestSuite(t *testing.T) { + suite.Run(t, new(AnteTestSuite)) +} diff --git a/x/feegrant/client/cli/cli_test.go b/x/feegrant/client/cli/cli_test.go new file mode 100644 index 000000000..224e7282a --- /dev/null +++ b/x/feegrant/client/cli/cli_test.go @@ -0,0 +1,621 @@ +// +build norace + +package cli_test + +import ( + "fmt" + "testing" + + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/crypto/hd" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/cosmos/cosmos-sdk/testutil/network" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/feegrant/client/cli" + "github.com/cosmos/cosmos-sdk/x/feegrant/types" + govtestutil "github.com/cosmos/cosmos-sdk/x/gov/client/testutil" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + "github.com/gogo/protobuf/proto" + "github.com/stretchr/testify/suite" + tmcli "github.com/tendermint/tendermint/libs/cli" +) + +type IntegrationTestSuite struct { + suite.Suite + + cfg network.Config + network *network.Network + addedGranter sdk.AccAddress + addedGrantee sdk.AccAddress + addedGrant types.FeeAllowanceGrant +} + +func (s *IntegrationTestSuite) SetupSuite() { + s.T().Log("setting up integration test suite") + + if testing.Short() { + s.T().Skip("skipping test in unit-tests mode.") + } + + cfg := network.DefaultConfig() + cfg.NumValidators = 2 + + s.cfg = cfg + s.network = network.New(s.T(), cfg) + + _, err := s.network.WaitForHeight(1) + s.Require().NoError(err) + + val := s.network.Validators[0] + granter := val.Address + grantee := s.network.Validators[1].Address + + clientCtx := val.ClientCtx + commonFlags := []string{ + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + } + + fee := sdk.NewCoin("stake", sdk.NewInt(100)) + duration := 365 * 24 * 60 * 60 + + args := append( + []string{ + granter.String(), + grantee.String(), + fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, fee.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), + fmt.Sprintf("--%s=%v", cli.FlagExpiration, duration), + }, + commonFlags..., + ) + + cmd := cli.NewCmdFeeGrant() + + _, err = clitestutil.ExecTestCLICmd(clientCtx, cmd, args) + s.Require().NoError(err) + _, err = s.network.WaitForHeight(1) + s.Require().NoError(err) + + s.addedGranter = granter + s.addedGrantee = grantee + + grant, err := types.NewFeeAllowanceGrant(granter, grantee, &types.BasicFeeAllowance{ + SpendLimit: sdk.NewCoins(fee), + }) + s.Require().NoError(err) + + s.addedGrant = grant +} + +func (s *IntegrationTestSuite) TearDownSuite() { + s.T().Log("tearing down integration test suite") + s.network.Cleanup() +} + +func (s *IntegrationTestSuite) TestCmdGetFeeGrant() { + val := s.network.Validators[0] + granter := val.Address + grantee := s.addedGrantee + clientCtx := val.ClientCtx + + testCases := []struct { + name string + args []string + expectErrMsg string + expectErr bool + respType *types.FeeAllowanceGrant + resp *types.FeeAllowanceGrant + }{ + { + "wrong granter", + []string{ + "wrong_granter", + grantee.String(), + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + }, + "decoding bech32 failed", + true, nil, nil, + }, + { + "wrong grantee", + []string{ + granter.String(), + "wrong_grantee", + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + }, + "decoding bech32 failed", + true, nil, nil, + }, + { + "non existed grant", + []string{ + "cosmos1nph3cfzk6trsmfxkeu943nvach5qw4vwstnvkl", + grantee.String(), + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + }, + "no fee allowance found", + true, nil, nil, + }, + { + "valid req", + []string{ + granter.String(), + grantee.String(), + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + }, + "", + false, + &types.FeeAllowanceGrant{}, + &s.addedGrant, + }, + } + + for _, tc := range testCases { + tc := tc + + s.Run(tc.name, func() { + cmd := cli.GetCmdQueryFeeGrant() + out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) + + if tc.expectErr { + s.Require().Error(err) + s.Require().Contains(err.Error(), tc.expectErrMsg) + } else { + s.Require().NoError(err) + s.Require().NoError(clientCtx.JSONMarshaler.UnmarshalJSON(out.Bytes(), tc.respType), out.String()) + s.Require().Equal(tc.respType.Grantee, tc.respType.Grantee) + s.Require().Equal(tc.respType.Granter, tc.respType.Granter) + s.Require().Equal( + tc.respType.GetFeeGrant().(*types.BasicFeeAllowance).SpendLimit, + tc.resp.GetFeeGrant().(*types.BasicFeeAllowance).SpendLimit, + ) + } + }) + } +} + +func (s *IntegrationTestSuite) TestCmdGetFeeGrants() { + val := s.network.Validators[0] + grantee := s.addedGrantee + clientCtx := val.ClientCtx + + testCases := []struct { + name string + args []string + expectErr bool + resp *types.QueryFeeAllowancesResponse + expectLength int + }{ + { + "wrong grantee", + []string{ + "wrong_grantee", + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + }, + true, nil, 0, + }, + { + "non existed grantee", + []string{ + "cosmos1nph3cfzk6trsmfxkeu943nvach5qw4vwstnvkl", + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + }, + false, &types.QueryFeeAllowancesResponse{}, 0, + }, + { + "valid req", + []string{ + grantee.String(), + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + }, + false, &types.QueryFeeAllowancesResponse{}, 1, + }, + } + + for _, tc := range testCases { + tc := tc + + s.Run(tc.name, func() { + cmd := cli.GetCmdQueryFeeGrants() + out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) + + if tc.expectErr { + s.Require().Error(err) + } else { + s.Require().NoError(err) + s.Require().NoError(clientCtx.JSONMarshaler.UnmarshalJSON(out.Bytes(), tc.resp), out.String()) + s.Require().Len(tc.resp.FeeAllowances, tc.expectLength) + } + }) + } +} + +func (s *IntegrationTestSuite) TestNewCmdFeeGrant() { + val := s.network.Validators[0] + granter := val.Address + alreadyExistedGrantee := s.addedGrantee + clientCtx := val.ClientCtx + + commonFlags := []string{ + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + } + + testCases := []struct { + name string + args []string + expectErr bool + respType proto.Message + expectedCode uint32 + }{ + { + "wrong granter address", + append( + []string{ + "wrong_granter", + "cosmos1nph3cfzk6trsmfxkeu943nvach5qw4vwstnvkl", + fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, "100stake"), + fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), + }, + commonFlags..., + ), + true, nil, 0, + }, + { + "wrong grantee address", + append( + []string{ + granter.String(), + "wrong_grantee", + fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, "100stake"), + fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), + }, + commonFlags..., + ), + true, nil, 0, + }, + { + "valid basic fee grant", + append( + []string{ + granter.String(), + "cosmos1nph3cfzk6trsmfxkeu943nvach5qw4vwstnvkl", + fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, "100stake"), + fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), + }, + commonFlags..., + ), + false, &sdk.TxResponse{}, 0, + }, + { + "valid basic fee grant without spend limit", + append( + []string{ + granter.String(), + "cosmos17h5lzptx3ghvsuhk7wx4c4hnl7rsswxjer97em", + fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), + }, + commonFlags..., + ), + false, &sdk.TxResponse{}, 0, + }, + { + "valid basic fee grant without expiration", + append( + []string{ + granter.String(), + "cosmos16dlc38dcqt0uralyd8hksxyrny6kaeqfjvjwp5", + fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, "100stake"), + fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), + }, + commonFlags..., + ), + false, &sdk.TxResponse{}, 0, + }, + { + "valid basic fee grant without spend-limit and expiration", + append( + []string{ + granter.String(), + "cosmos1ku40qup9vwag4wtf8cls9mkszxfthaklxkp3c8", + fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), + }, + commonFlags..., + ), + false, &sdk.TxResponse{}, 0, + }, + { + "try to add existed grant", + append( + []string{ + granter.String(), + alreadyExistedGrantee.String(), + fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, "100stake"), + fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), + }, + commonFlags..., + ), + false, &sdk.TxResponse{}, 18, + }, + { + "invalid number of args(periodic fee grant)", + append( + []string{ + granter.String(), + "cosmos1nph3cfzk6trsmfxkeu943nvach5qw4vwstnvkl", + fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, "100stake"), + fmt.Sprintf("--%s=%s", cli.FlagPeriodLimit, "10stake"), + fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), + fmt.Sprintf("--%s=%d", cli.FlagExpiration, 10*60*60), + }, + commonFlags..., + ), + true, nil, 0, + }, + { + "period mentioned and period limit omitted, invalid periodic grant", + append( + []string{ + granter.String(), + "cosmos1nph3cfzk6trsmfxkeu943nvach5qw4vwstnvkl", + fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, "100stake"), + fmt.Sprintf("--%s=%d", cli.FlagPeriod, 10*60*60), + fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), + fmt.Sprintf("--%s=%d", cli.FlagExpiration, 60*60), + }, + commonFlags..., + ), + true, nil, 0, + }, + { + "period cannot be greater than the actual expiration(periodic fee grant)", + append( + []string{ + granter.String(), + "cosmos1nph3cfzk6trsmfxkeu943nvach5qw4vwstnvkl", + fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, "100stake"), + fmt.Sprintf("--%s=%d", cli.FlagPeriod, 10*60*60), + fmt.Sprintf("--%s=%s", cli.FlagPeriodLimit, "10stake"), + fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), + fmt.Sprintf("--%s=%d", cli.FlagExpiration, 60*60), + }, + commonFlags..., + ), + true, nil, 0, + }, + { + "valid periodic fee grant", + append( + []string{ + granter.String(), + "cosmos1w55kgcf3ltaqdy4ww49nge3klxmrdavrr6frmp", + fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, "100stake"), + fmt.Sprintf("--%s=%d", cli.FlagPeriod, 60*60), + fmt.Sprintf("--%s=%s", cli.FlagPeriodLimit, "10stake"), + fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), + fmt.Sprintf("--%s=%d", cli.FlagExpiration, 10*60*60), + }, + commonFlags..., + ), + false, &sdk.TxResponse{}, 0, + }, + { + "valid periodic fee grant without spend-limit", + append( + []string{ + granter.String(), + "cosmos1vevyks8pthkscvgazc97qyfjt40m6g9xe85ry8", + fmt.Sprintf("--%s=%d", cli.FlagPeriod, 60*60), + fmt.Sprintf("--%s=%s", cli.FlagPeriodLimit, "10stake"), + fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), + fmt.Sprintf("--%s=%d", cli.FlagExpiration, 10*60*60), + }, + commonFlags..., + ), + false, &sdk.TxResponse{}, 0, + }, + { + "valid periodic fee grant without expiration", + append( + []string{ + granter.String(), + "cosmos14cm33pvnrv2497tyt8sp9yavhmw83nwej3m0e8", + fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, "100stake"), + fmt.Sprintf("--%s=%d", cli.FlagPeriod, 60*60), + fmt.Sprintf("--%s=%s", cli.FlagPeriodLimit, "10stake"), + fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), + }, + commonFlags..., + ), + false, &sdk.TxResponse{}, 0, + }, + { + "valid periodic fee grant without spend-limit and expiration", + append( + []string{ + granter.String(), + "cosmos12nyk4pcf4arshznkpz882e4l4ts0lt0ap8ce54", + fmt.Sprintf("--%s=%d", cli.FlagPeriod, 60*60), + fmt.Sprintf("--%s=%s", cli.FlagPeriodLimit, "10stake"), + fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), + }, + commonFlags..., + ), + false, &sdk.TxResponse{}, 0, + }, + } + + for _, tc := range testCases { + tc := tc + + s.Run(tc.name, func() { + cmd := cli.NewCmdFeeGrant() + out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) + + if tc.expectErr { + s.Require().Error(err) + } else { + s.Require().NoError(err) + s.Require().NoError(clientCtx.JSONMarshaler.UnmarshalJSON(out.Bytes(), tc.respType), out.String()) + + txResp := tc.respType.(*sdk.TxResponse) + s.Require().Equal(tc.expectedCode, txResp.Code, out.String()) + } + }) + } +} + +func (s *IntegrationTestSuite) TestNewCmdRevokeFeegrant() { + val := s.network.Validators[0] + granter := s.addedGranter + grantee := s.addedGrantee + clientCtx := val.ClientCtx + + commonFlags := []string{ + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + } + + testCases := []struct { + name string + args []string + expectErr bool + respType proto.Message + expectedCode uint32 + }{ + { + "invalid grantee", + append( + []string{ + "wrong_granter", + grantee.String(), + fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), + }, + commonFlags..., + ), + true, + nil, + 0, + }, + { + "invalid grantee", + append( + []string{ + granter.String(), + "wrong_grantee", + fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), + }, + commonFlags..., + ), + true, + nil, + 0, + }, + { + "Non existed grant", + append( + []string{ + granter.String(), + "cosmos1aeuqja06474dfrj7uqsvukm6rael982kk89mqr", + fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), + }, + commonFlags..., + ), + false, + &sdk.TxResponse{}, + 4, + }, + { + "Valid revoke", + append( + []string{ + granter.String(), + grantee.String(), + fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), + }, + commonFlags..., + ), + false, + &sdk.TxResponse{}, + 0, + }, + } + + for _, tc := range testCases { + tc := tc + + s.Run(tc.name, func() { + cmd := cli.NewCmdRevokeFeegrant() + out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) + + if tc.expectErr { + s.Require().Error(err) + } else { + s.Require().NoError(err) + s.Require().NoError(clientCtx.JSONMarshaler.UnmarshalJSON(out.Bytes(), tc.respType), out.String()) + + txResp := tc.respType.(*sdk.TxResponse) + s.Require().Equal(tc.expectedCode, txResp.Code, out.String()) + } + }) + } +} + +func (s *IntegrationTestSuite) TestTxWithFeeGrant() { + val := s.network.Validators[0] + clientCtx := val.ClientCtx + granter := val.Address + + // creating an account manually (This account won't be exist in state) + info, _, err := val.ClientCtx.Keyring.NewMnemonic("grantee", keyring.English, sdk.FullFundraiserPath, hd.Secp256k1) + s.Require().NoError(err) + grantee := sdk.AccAddress(info.GetPubKey().Address()) + + commonFlags := []string{ + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + } + + fee := sdk.NewCoin("stake", sdk.NewInt(100)) + duration := 365 * 24 * 60 * 60 + + args := append( + []string{ + granter.String(), + grantee.String(), + fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, fee.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, granter), + fmt.Sprintf("--%s=%v", cli.FlagExpiration, duration), + }, + commonFlags..., + ) + + cmd := cli.NewCmdFeeGrant() + + _, err = clitestutil.ExecTestCLICmd(clientCtx, cmd, args) + s.Require().NoError(err) + _, err = s.network.WaitForHeight(1) + s.Require().NoError(err) + + // granted fee allowance for an account which is not in state and creating + // any tx with it by using --fee-account shouldn't fail + out, err := govtestutil.MsgSubmitProposal(val.ClientCtx, grantee.String(), + "Text Proposal", "No desc", govtypes.ProposalTypeText, + fmt.Sprintf("--%s=%s", flags.FlagFeeAccount, granter.String()), + ) + + s.Require().NoError(err) + var resp sdk.TxResponse + s.Require().NoError(clientCtx.JSONMarshaler.UnmarshalJSON(out.Bytes(), &resp), out.String()) + s.Require().Equal(uint32(0), resp.Code) +} + +func TestIntegrationTestSuite(t *testing.T) { + suite.Run(t, new(IntegrationTestSuite)) +} diff --git a/x/feegrant/client/cli/query.go b/x/feegrant/client/cli/query.go new file mode 100644 index 000000000..c3a488ab5 --- /dev/null +++ b/x/feegrant/client/cli/query.go @@ -0,0 +1,129 @@ +package cli + +import ( + "fmt" + "strings" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/version" + "github.com/cosmos/cosmos-sdk/x/feegrant/types" + "github.com/spf13/cobra" +) + +// GetQueryCmd returns the cli query commands for this module +func GetQueryCmd() *cobra.Command { + feegrantQueryCmd := &cobra.Command{ + Use: types.ModuleName, + Short: "Querying commands for the feegrant module", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + feegrantQueryCmd.AddCommand( + GetCmdQueryFeeGrant(), + GetCmdQueryFeeGrants(), + ) + + return feegrantQueryCmd +} + +// GetCmdQueryFeeGrant returns cmd to query for a grant between granter and grantee. +func GetCmdQueryFeeGrant() *cobra.Command { + cmd := &cobra.Command{ + Use: "grant [granter] [grantee]", + Args: cobra.ExactArgs(2), + Short: "Query details of a single grant", + Long: strings.TrimSpace( + fmt.Sprintf(`Query details for a grant. +You can find the fee-grant of a granter and grantee. + +Example: +$ %s query feegrant grant [granter] [grantee] +`, version.AppName), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + queryClient := types.NewQueryClient(clientCtx) + + granterAddr, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + + granteeAddr, err := sdk.AccAddressFromBech32(args[1]) + if err != nil { + return err + } + + res, err := queryClient.FeeAllowance( + cmd.Context(), + &types.QueryFeeAllowanceRequest{ + Granter: granterAddr.String(), + Grantee: granteeAddr.String(), + }, + ) + + if err != nil { + return err + } + + return clientCtx.PrintProto(res.FeeAllowance) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdQueryFeeGrants returns cmd to query for all grants for a grantee. +func GetCmdQueryFeeGrants() *cobra.Command { + cmd := &cobra.Command{ + Use: "grants [grantee]", + Args: cobra.ExactArgs(1), + Short: "Query all grants of a grantee", + Long: strings.TrimSpace( + fmt.Sprintf(`Queries all the grants for a grantee address. + +Example: +$ %s query feegrant grants [grantee] +`, version.AppName), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + queryClient := types.NewQueryClient(clientCtx) + + granteeAddr, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + res, err := queryClient.FeeAllowances( + cmd.Context(), + &types.QueryFeeAllowancesRequest{ + Grantee: granteeAddr.String(), + Pagination: pageReq, + }, + ) + + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "grants") + + return cmd +} diff --git a/x/feegrant/client/cli/tx.go b/x/feegrant/client/cli/tx.go new file mode 100644 index 000000000..a28ddb976 --- /dev/null +++ b/x/feegrant/client/cli/tx.go @@ -0,0 +1,211 @@ +package cli + +import ( + "fmt" + "strings" + "time" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" + "github.com/cosmos/cosmos-sdk/version" + "github.com/cosmos/cosmos-sdk/x/feegrant/types" +) + +// flag for feegrant module +const ( + FlagExpiration = "expiration" + FlagPeriod = "period" + FlagPeriodLimit = "period-limit" + FlagSpendLimit = "spend-limit" +) + +// GetTxCmd returns the transaction commands for this module +func GetTxCmd() *cobra.Command { + feegrantTxCmd := &cobra.Command{ + Use: types.ModuleName, + Short: "Feegrant transactions subcommands", + Long: "Grant and revoke fee allowance for a grantee by a granter", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + feegrantTxCmd.AddCommand( + NewCmdFeeGrant(), + NewCmdRevokeFeegrant(), + ) + + return feegrantTxCmd +} + +// NewCmdFeeGrant returns a CLI command handler for creating a MsgGrantFeeAllowance transaction. +func NewCmdFeeGrant() *cobra.Command { + cmd := &cobra.Command{ + Use: "grant [granter] [grantee]", + Short: "Grant Fee allowance to an address", + Long: strings.TrimSpace( + fmt.Sprintf( + `Grant authorization to pay fees from your address. Note, the'--from' flag is + ignored as it is implied from [granter]. + +Examples: +%s tx %s grant cosmos1skjw... cosmos1skjw... --spend-limit 100stake --expiration 36000 or +%s tx %s grant cosmos1skjw... cosmos1skjw... --spend-limit 100stake --period 3600 --period-limit 10stake --expiration 36000 + `, version.AppName, types.ModuleName, version.AppName, types.ModuleName, + ), + ), + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + _, err := sdk.AccAddressFromBech32(args[0]) + if err != nil { + return err + } + + cmd.Flags().Set(flags.FlagFrom, args[0]) + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + grantee, err := sdk.AccAddressFromBech32(args[1]) + if err != nil { + return err + } + + granter := clientCtx.GetFromAddress() + sl, err := cmd.Flags().GetString(FlagSpendLimit) + if err != nil { + return err + } + + // if `FlagSpendLimit` isn't set, limit will be nil + limit, err := sdk.ParseCoinsNormalized(sl) + if err != nil { + return err + } + + exp, err := cmd.Flags().GetInt64(FlagExpiration) + if err != nil { + return err + } + + basic := types.BasicFeeAllowance{ + SpendLimit: limit, + } + + if exp != 0 { + expDuration := time.Duration(exp) * time.Second + basic.Expiration = types.ExpiresAtTime(time.Now().Add(expDuration)) + } + + var grant types.FeeAllowanceI + grant = &basic + + periodClock, err := cmd.Flags().GetInt64(FlagPeriod) + if err != nil { + return err + } + + periodLimitVal, err := cmd.Flags().GetString(FlagPeriodLimit) + if err != nil { + return err + } + + // Check any of period or periodLimit flags set, If set consider it as periodic fee allowance. + if periodClock > 0 || periodLimitVal != "" { + periodLimit, err := sdk.ParseCoinsNormalized(periodLimitVal) + if err != nil { + return err + } + + if periodClock > 0 && periodLimit != nil { + if exp > 0 && periodClock > exp { + return fmt.Errorf("period(%d) cannot be greater than the expiration(%d)", periodClock, exp) + } + + periodic := types.PeriodicFeeAllowance{ + Basic: basic, + Period: types.ClockDuration(time.Duration(periodClock) * time.Second), + PeriodReset: types.ExpiresAtTime(time.Now().Add(time.Duration(periodClock) * time.Second)), + PeriodSpendLimit: periodLimit, + PeriodCanSpend: periodLimit, + } + + grant = &periodic + + } else { + return fmt.Errorf("invalid number of args %d", len(args)) + } + } + + msg, err := types.NewMsgGrantFeeAllowance(grant, granter, grantee) + if err != nil { + return err + } + + svcMsgClientConn := &msgservice.ServiceMsgClientConn{} + feeGrantMsgClient := types.NewMsgClient(svcMsgClientConn) + _, err = feeGrantMsgClient.GrantFeeAllowance(cmd.Context(), msg) + if err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), svcMsgClientConn.GetMsgs()...) + }, + } + + flags.AddTxFlagsToCmd(cmd) + cmd.Flags().Int64(FlagExpiration, 0, "The second unit of time duration which the grant is active for the user") + cmd.Flags().String(FlagSpendLimit, "", "Spend limit specifies the max limit can be used, if not mentioned there is no limit") + cmd.Flags().Int64(FlagPeriod, 0, "period specifies the time duration in which period_spend_limit coins can be spent before that allowance is reset") + cmd.Flags().String(FlagPeriodLimit, "", "// period limit specifies the maximum number of coins that can be spent in the period") + + return cmd +} + +// NewCmdRevokeFeegrant returns a CLI command handler for creating a MsgRevokeFeeAllowance transaction. +func NewCmdRevokeFeegrant() *cobra.Command { + cmd := &cobra.Command{ + Use: "revoke [granter_address] [grantee_address]", + Short: "revoke fee-grant", + Long: strings.TrimSpace( + fmt.Sprintf(`revoke fee grant from a granter to a grantee. Note, the'--from' flag is + ignored as it is implied from [granter_address]. + +Example: + $ %s tx %s revoke cosmos1skj.. cosmos1skj.. + `, version.AppName, types.ModuleName), + ), + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + cmd.Flags().Set(flags.FlagFrom, args[0]) + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + grantee, err := sdk.AccAddressFromBech32(args[1]) + if err != nil { + return err + } + + msg := types.NewMsgRevokeFeeAllowance(clientCtx.GetFromAddress(), grantee) + svcMsgClientConn := &msgservice.ServiceMsgClientConn{} + feeGrantMsgClient := types.NewMsgClient(svcMsgClientConn) + _, err = feeGrantMsgClient.RevokeFeeAllowance(cmd.Context(), &msg) + if err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), svcMsgClientConn.GetMsgs()...) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} diff --git a/x/feegrant/client/rest/grpc_query_test.go b/x/feegrant/client/rest/grpc_query_test.go new file mode 100644 index 000000000..10d77a1e4 --- /dev/null +++ b/x/feegrant/client/rest/grpc_query_test.go @@ -0,0 +1,209 @@ +package rest_test + +import ( + "fmt" + "testing" + + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/crypto/hd" + "github.com/cosmos/cosmos-sdk/crypto/keyring" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/cosmos/cosmos-sdk/testutil/network" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/rest" + banktestutil "github.com/cosmos/cosmos-sdk/x/bank/client/testutil" + "github.com/cosmos/cosmos-sdk/x/feegrant/client/cli" + "github.com/cosmos/cosmos-sdk/x/feegrant/types" + "github.com/stretchr/testify/suite" +) + +type IntegrationTestSuite struct { + suite.Suite + cfg network.Config + network *network.Network + grantee sdk.AccAddress +} + +func (s *IntegrationTestSuite) SetupSuite() { + s.T().Log("setting up integration test suite") + + cfg := network.DefaultConfig() + + cfg.NumValidators = 1 + s.cfg = cfg + s.network = network.New(s.T(), cfg) + + val := s.network.Validators[0] + // Create new account in the keyring. + info, _, err := val.ClientCtx.Keyring.NewMnemonic("grantee", keyring.English, sdk.FullFundraiserPath, hd.Secp256k1) + s.Require().NoError(err) + newAddr := sdk.AccAddress(info.GetPubKey().Address()) + + // Send some funds to the new account. + _, err = banktestutil.MsgSendExec( + val.ClientCtx, + val.Address, + newAddr, + sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(200))), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + ) + s.Require().NoError(err) + + s.grantee = newAddr + _, err = s.network.WaitForHeight(1) + s.Require().NoError(err) +} + +func (s *IntegrationTestSuite) TearDownSuite() { + s.T().Log("tearing down integration test suite") + s.network.Cleanup() +} + +func (s *IntegrationTestSuite) TestQueryFeeAllowance() { + val := s.network.Validators[0] + baseURL := val.APIAddress + testCases := []struct { + name string + url string + expectErr bool + errorMsg string + preRun func() + postRun func(_ types.QueryFeeAllowanceResponse) + }{ + { + "fail: invalid granter", + fmt.Sprintf("%s/cosmos/feegrant/v1beta1/fee_allowance/%s/%s", baseURL, "invalid_granter", s.grantee.String()), + true, + "decoding bech32 failed: invalid index of 1: invalid request", + func() {}, + func(types.QueryFeeAllowanceResponse) {}, + }, + { + "fail: invalid grantee", + fmt.Sprintf("%s/cosmos/feegrant/v1beta1/fee_allowance/%s/%s", baseURL, val.Address.String(), "invalid_grantee"), + true, + "decoding bech32 failed: invalid index of 1: invalid request", + func() {}, + func(types.QueryFeeAllowanceResponse) {}, + }, + { + "fail: no grants", + fmt.Sprintf("%s/cosmos/feegrant/v1beta1/fee_allowance/%s/%s", baseURL, val.Address.String(), s.grantee.String()), + true, + "no fee allowance found", + func() {}, + func(types.QueryFeeAllowanceResponse) {}, + }, + { + "valid query: expect single grant", + fmt.Sprintf("%s/cosmos/feegrant/v1beta1/fee_allowance/%s/%s", baseURL, val.Address.String(), s.grantee.String()), + false, + "", + func() { + execFeeAllowance(val, s) + }, + func(allowance types.QueryFeeAllowanceResponse) { + s.Require().Equal(allowance.FeeAllowance.Granter, val.Address.String()) + s.Require().Equal(allowance.FeeAllowance.Grantee, s.grantee.String()) + }, + }, + } + for _, tc := range testCases { + s.Run(tc.name, func() { + tc.preRun() + resp, _ := rest.GetRequest(tc.url) + if tc.expectErr { + s.Require().Contains(string(resp), tc.errorMsg) + } else { + var allowance types.QueryFeeAllowanceResponse + err := val.ClientCtx.JSONMarshaler.UnmarshalJSON(resp, &allowance) + s.Require().NoError(err) + tc.postRun(allowance) + } + }) + } +} + +func (s *IntegrationTestSuite) TestQueryGranteeAllowances() { + val := s.network.Validators[0] + baseURL := val.APIAddress + testCases := []struct { + name string + url string + expectErr bool + errorMsg string + preRun func() + postRun func(_ types.QueryFeeAllowancesResponse) + }{ + { + "fail: invalid grantee", + fmt.Sprintf("%s/cosmos/feegrant/v1beta1/fee_allowances/%s", baseURL, "invalid_grantee"), + true, + "decoding bech32 failed: invalid index of 1: invalid request", + func() {}, + func(types.QueryFeeAllowancesResponse) {}, + }, + { + "success: no grants", + fmt.Sprintf("%s/cosmos/feegrant/v1beta1/fee_allowances/%s?pagination.offset=1", baseURL, s.grantee.String()), + false, + "", + func() {}, + func(allowances types.QueryFeeAllowancesResponse) { + s.Require().Equal(len(allowances.FeeAllowances), 0) + }, + }, + { + "valid query: expect single grant", + fmt.Sprintf("%s/cosmos/feegrant/v1beta1/fee_allowances/%s", baseURL, s.grantee.String()), + false, + "", + func() { + execFeeAllowance(val, s) + }, + func(allowances types.QueryFeeAllowancesResponse) { + s.Require().Equal(len(allowances.FeeAllowances), 1) + s.Require().Equal(allowances.FeeAllowances[0].Granter, val.Address.String()) + s.Require().Equal(allowances.FeeAllowances[0].Grantee, s.grantee.String()) + }, + }, + } + for _, tc := range testCases { + s.Run(tc.name, func() { + tc.preRun() + resp, _ := rest.GetRequest(tc.url) + if tc.expectErr { + s.Require().Contains(string(resp), tc.errorMsg) + } else { + var allowance types.QueryFeeAllowancesResponse + err := val.ClientCtx.JSONMarshaler.UnmarshalJSON(resp, &allowance) + s.Require().NoError(err) + tc.postRun(allowance) + } + }) + } +} + +func execFeeAllowance(val *network.Validator, s *IntegrationTestSuite) { + fee := sdk.NewCoin("steak", sdk.NewInt(100)) + duration := 365 * 24 * 60 * 60 + args := []string{ + val.Address.String(), + s.grantee.String(), + fmt.Sprintf("--%s=%s", cli.FlagSpendLimit, fee.String()), + fmt.Sprintf("--%s=%s", flags.FlagFrom, val.Address.String()), + fmt.Sprintf("--%s=%v", cli.FlagExpiration, duration), + fmt.Sprintf("--%s=%s", flags.FlagBroadcastMode, flags.BroadcastBlock), + fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), + fmt.Sprintf("--%s=%s", flags.FlagFees, sdk.NewCoins(sdk.NewCoin(s.cfg.BondDenom, sdk.NewInt(10))).String()), + } + + cmd := cli.NewCmdFeeGrant() + _, err := clitestutil.ExecTestCLICmd(val.ClientCtx, cmd, args) + s.Require().NoError(err) +} + +func TestIntegrationTestSuite(t *testing.T) { + suite.Run(t, new(IntegrationTestSuite)) +} diff --git a/x/feegrant/doc.go b/x/feegrant/doc.go new file mode 100644 index 000000000..4f190e314 --- /dev/null +++ b/x/feegrant/doc.go @@ -0,0 +1,29 @@ +/* +Package feegrant provides functionality for authorizing the payment of transaction +fees from one account (key) to another account (key). + +Effectively, this allows for a user to pay fees using the balance of an account +different from their own. Example use cases would be allowing a key on a device to +pay for fees using a master wallet, or a third party service allowing users to +pay for transactions without ever really holding their own tokens. This package +provides ways for specifying fee allowances such that authorizing fee payment to +another account can be done with clear and safe restrictions. + +A user would authorize granting fee payment to another user using +MsgDelegateFeeAllowance and revoke that delegation using MsgRevokeFeeAllowance. +In both cases, Granter is the one who is authorizing fee payment and Grantee is +the one who is receiving the fee payment authorization. So grantee would correspond +to the one who is signing a transaction and the granter would be the address that +pays the fees. + +The fee allowance that a grantee receives is specified by an implementation of +the FeeAllowance interface. Two FeeAllowance implementations are provided in +this package: BasicFeeAllowance and PeriodicFeeAllowance. + +In order to integrate this into an application, we must use the DeductGrantedFeeDecorator +ante handler from this package instead of the default DeductFeeDecorator from x/auth. + +To allow handling txs from empty accounts (with fees paid from an existing account), +we have to re-order the decorators as well. +*/ +package feegrant diff --git a/x/feegrant/genesis.go b/x/feegrant/genesis.go new file mode 100644 index 000000000..f65cfdb57 --- /dev/null +++ b/x/feegrant/genesis.go @@ -0,0 +1,61 @@ +package feegrant + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" + "github.com/cosmos/cosmos-sdk/x/feegrant/types" +) + +// GenesisState contains a set of fee allowances, persisted from the store +type GenesisState []types.FeeAllowanceGrant + +// ValidateBasic ensures all grants in the genesis state are valid +func (g GenesisState) ValidateBasic() error { + for _, f := range g { + err := f.GetFeeGrant().ValidateBasic() + if err != nil { + return err + } + } + return nil +} + +// InitGenesis will initialize the keeper from a *previously validated* GenesisState +func InitGenesis(ctx sdk.Context, k keeper.Keeper, data *types.GenesisState) { + for _, f := range data.FeeAllowances { + granter, err := sdk.AccAddressFromBech32(f.Granter) + if err != nil { + panic(err) + } + grantee, err := sdk.AccAddressFromBech32(f.Grantee) + if err != nil { + panic(err) + } + + err = k.GrantFeeAllowance(ctx, granter, grantee, f.GetFeeGrant()) + if err != nil { + panic(err) + } + } +} + +// ExportGenesis will dump the contents of the keeper into a serializable GenesisState +// +// All expiration heights will be thrown off if we dump state and start at a new +// chain at height 0. Thus, we allow the Allowances to "prepare themselves" +// for export, like if they have expiry at 5000 and current is 4000, they export with +// expiry of 1000. Every FeeAllowance has a method `PrepareForExport` that allows +// them to perform any changes needed prior to export. +func ExportGenesis(ctx sdk.Context, k keeper.Keeper) (*types.GenesisState, error) { + time, height := ctx.BlockTime(), ctx.BlockHeight() + var grants []types.FeeAllowanceGrant + + err := k.IterateAllFeeAllowances(ctx, func(grant types.FeeAllowanceGrant) bool { + grants = append(grants, grant.PrepareForExport(time, height)) + return false + }) + + return &types.GenesisState{ + FeeAllowances: grants, + }, err +} diff --git a/x/feegrant/genesis_test.go b/x/feegrant/genesis_test.go new file mode 100644 index 000000000..d086daac0 --- /dev/null +++ b/x/feegrant/genesis_test.go @@ -0,0 +1,56 @@ +package feegrant_test + +import ( + "testing" + + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" + feegrant "github.com/cosmos/cosmos-sdk/x/feegrant" + "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" + "github.com/cosmos/cosmos-sdk/x/feegrant/types" + "github.com/stretchr/testify/suite" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" +) + +type GenesisTestSuite struct { + suite.Suite + ctx sdk.Context + keeper keeper.Keeper +} + +func (suite *GenesisTestSuite) SetupTest() { + checkTx := false + app := simapp.Setup(checkTx) + suite.ctx = app.BaseApp.NewContext(checkTx, tmproto.Header{Height: 1}) + suite.keeper = app.FeeGrantKeeper +} + +var ( + granteePub = secp256k1.GenPrivKey().PubKey() + granterPub = secp256k1.GenPrivKey().PubKey() + granteeAddr = sdk.AccAddress(granteePub.Address()) + granterAddr = sdk.AccAddress(granterPub.Address()) +) + +func (suite *GenesisTestSuite) TestImportExportGenesis() { + coins := sdk.NewCoins(sdk.NewCoin("foo", sdk.NewInt(1_000))) + now := suite.ctx.BlockHeader().Time + + allowance := &types.BasicFeeAllowance{SpendLimit: coins, Expiration: types.ExpiresAtTime(now.AddDate(1, 0, 0))} + err := suite.keeper.GrantFeeAllowance(suite.ctx, granterAddr, granteeAddr, allowance) + suite.Require().NoError(err) + + genesis, err := feegrant.ExportGenesis(suite.ctx, suite.keeper) + suite.Require().NoError(err) + // Clear keeper + suite.keeper.RevokeFeeAllowance(suite.ctx, granterAddr, granteeAddr) + feegrant.InitGenesis(suite.ctx, suite.keeper, genesis) + newGenesis, err := feegrant.ExportGenesis(suite.ctx, suite.keeper) + suite.Require().NoError(err) + suite.Require().Equal(genesis, newGenesis) +} + +func TestGenesisTestSuite(t *testing.T) { + suite.Run(t, new(GenesisTestSuite)) +} diff --git a/x/feegrant/keeper/grpc_query.go b/x/feegrant/keeper/grpc_query.go new file mode 100644 index 000000000..0fce084f9 --- /dev/null +++ b/x/feegrant/keeper/grpc_query.go @@ -0,0 +1,94 @@ +package keeper + +import ( + "context" + + "github.com/gogo/protobuf/proto" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/cosmos/cosmos-sdk/x/feegrant/types" +) + +var _ types.QueryServer = Keeper{} + +// FeeAllowance returns fee granted to the grantee by the granter. +func (q Keeper) FeeAllowance(c context.Context, req *types.QueryFeeAllowanceRequest) (*types.QueryFeeAllowanceResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + granterAddr, err := sdk.AccAddressFromBech32(req.Granter) + if err != nil { + return nil, err + } + + granteeAddr, err := sdk.AccAddressFromBech32(req.Grantee) + if err != nil { + return nil, err + } + + ctx := sdk.UnwrapSDKContext(c) + + feeAllowance := q.GetFeeAllowance(ctx, granterAddr, granteeAddr) + if feeAllowance == nil { + return nil, status.Errorf(codes.NotFound, "no fee allowance found") + } + + msg, ok := feeAllowance.(proto.Message) + if !ok { + return nil, status.Errorf(codes.Internal, "can't proto marshal %T", msg) + } + + feeAllowanceAny, err := codectypes.NewAnyWithValue(msg) + if err != nil { + return nil, status.Errorf(codes.Internal, err.Error()) + } + + return &types.QueryFeeAllowanceResponse{ + FeeAllowance: &types.FeeAllowanceGrant{ + Granter: granterAddr.String(), + Grantee: granteeAddr.String(), + Allowance: feeAllowanceAny, + }, + }, nil +} + +func (q Keeper) FeeAllowances(c context.Context, req *types.QueryFeeAllowancesRequest) (*types.QueryFeeAllowancesResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + granteeAddr, err := sdk.AccAddressFromBech32(req.Grantee) + if err != nil { + return nil, err + } + + ctx := sdk.UnwrapSDKContext(c) + + var grants []*types.FeeAllowanceGrant + + store := ctx.KVStore(q.storeKey) + grantsStore := prefix.NewStore(store, types.FeeAllowancePrefixByGrantee(granteeAddr)) + + pageRes, err := query.Paginate(grantsStore, req.Pagination, func(key []byte, value []byte) error { + var grant types.FeeAllowanceGrant + + if err := q.cdc.UnmarshalBinaryBare(value, &grant); err != nil { + return err + } + + grants = append(grants, &grant) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryFeeAllowancesResponse{FeeAllowances: grants, Pagination: pageRes}, nil +} diff --git a/x/feegrant/keeper/keeper.go b/x/feegrant/keeper/keeper.go new file mode 100644 index 000000000..e6606bf0c --- /dev/null +++ b/x/feegrant/keeper/keeper.go @@ -0,0 +1,190 @@ +package keeper + +import ( + "fmt" + + "github.com/tendermint/tendermint/libs/log" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/feegrant/types" +) + +// Keeper manages state of all fee grants, as well as calculating approval. +// It must have a codec with all available allowances registered. +type Keeper struct { + cdc codec.BinaryMarshaler + storeKey sdk.StoreKey + authKeeper types.AccountKeeper +} + +// NewKeeper creates a fee grant Keeper +func NewKeeper(cdc codec.BinaryMarshaler, storeKey sdk.StoreKey, ak types.AccountKeeper) Keeper { + return Keeper{ + cdc: cdc, + storeKey: storeKey, + authKeeper: ak, + } +} + +// Logger returns a module-specific logger. +func (k Keeper) Logger(ctx sdk.Context) log.Logger { + return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) +} + +// GrantFeeAllowance creates a new grant +func (k Keeper) GrantFeeAllowance(ctx sdk.Context, granter, grantee sdk.AccAddress, feeAllowance types.FeeAllowanceI) error { + + // create the account if it is not in account state + granteeAcc := k.authKeeper.GetAccount(ctx, grantee) + if granteeAcc == nil { + granteeAcc = k.authKeeper.NewAccountWithAddress(ctx, grantee) + k.authKeeper.SetAccount(ctx, granteeAcc) + } + + store := ctx.KVStore(k.storeKey) + key := types.FeeAllowanceKey(granter, grantee) + grant, err := types.NewFeeAllowanceGrant(granter, grantee, feeAllowance) + if err != nil { + return err + } + + bz, err := k.cdc.MarshalBinaryBare(&grant) + if err != nil { + return err + } + + store.Set(key, bz) + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeSetFeeGrant, + sdk.NewAttribute(types.AttributeKeyGranter, grant.Granter), + sdk.NewAttribute(types.AttributeKeyGrantee, grant.Grantee), + ), + ) + + return nil +} + +// RevokeFeeAllowance removes an existing grant +func (k Keeper) RevokeFeeAllowance(ctx sdk.Context, granter, grantee sdk.AccAddress) error { + store := ctx.KVStore(k.storeKey) + key := types.FeeAllowanceKey(granter, grantee) + _, found := k.GetFeeGrant(ctx, granter, grantee) + if !found { + return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "fee-grant not found") + } + + store.Delete(key) + + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeRevokeFeeGrant, + sdk.NewAttribute(types.AttributeKeyGranter, granter.String()), + sdk.NewAttribute(types.AttributeKeyGrantee, grantee.String()), + ), + ) + return nil +} + +// GetFeeAllowance returns the allowance between the granter and grantee. +// If there is none, it returns nil, nil. +// Returns an error on parsing issues +func (k Keeper) GetFeeAllowance(ctx sdk.Context, granter, grantee sdk.AccAddress) types.FeeAllowanceI { + grant, found := k.GetFeeGrant(ctx, granter, grantee) + if !found { + return nil + } + + return grant.GetFeeGrant() +} + +// GetFeeGrant returns entire grant between both accounts +func (k Keeper) GetFeeGrant(ctx sdk.Context, granter sdk.AccAddress, grantee sdk.AccAddress) (types.FeeAllowanceGrant, bool) { + store := ctx.KVStore(k.storeKey) + key := types.FeeAllowanceKey(granter, grantee) + bz := store.Get(key) + if len(bz) == 0 { + return types.FeeAllowanceGrant{}, false + } + + var feegrant types.FeeAllowanceGrant + k.cdc.MustUnmarshalBinaryBare(bz, &feegrant) + + return feegrant, true +} + +// IterateAllGranteeFeeAllowances iterates over all the grants from anyone to the given grantee. +// Callback to get all data, returns true to stop, false to keep reading +func (k Keeper) IterateAllGranteeFeeAllowances(ctx sdk.Context, grantee sdk.AccAddress, cb func(types.FeeAllowanceGrant) bool) error { + store := ctx.KVStore(k.storeKey) + prefix := types.FeeAllowancePrefixByGrantee(grantee) + iter := sdk.KVStorePrefixIterator(store, prefix) + defer iter.Close() + + stop := false + for ; iter.Valid() && !stop; iter.Next() { + bz := iter.Value() + + var feeGrant types.FeeAllowanceGrant + k.cdc.MustUnmarshalBinaryBare(bz, &feeGrant) + + stop = cb(feeGrant) + } + + return nil +} + +// IterateAllFeeAllowances iterates over all the grants in the store. +// Callback to get all data, returns true to stop, false to keep reading +// Calling this without pagination is very expensive and only designed for export genesis +func (k Keeper) IterateAllFeeAllowances(ctx sdk.Context, cb func(types.FeeAllowanceGrant) bool) error { + store := ctx.KVStore(k.storeKey) + iter := sdk.KVStorePrefixIterator(store, types.FeeAllowanceKeyPrefix) + defer iter.Close() + + stop := false + for ; iter.Valid() && !stop; iter.Next() { + bz := iter.Value() + var feeGrant types.FeeAllowanceGrant + k.cdc.MustUnmarshalBinaryBare(bz, &feeGrant) + + stop = cb(feeGrant) + } + + return nil +} + +// UseGrantedFees will try to pay the given fee from the granter's account as requested by the grantee +func (k Keeper) UseGrantedFees(ctx sdk.Context, granter, grantee sdk.AccAddress, fee sdk.Coins) error { + grant, found := k.GetFeeGrant(ctx, granter, grantee) + if !found || grant.GetFeeGrant() == nil { + return sdkerrors.Wrapf(types.ErrNoAllowance, "grant missing") + } + + remove, err := grant.GetFeeGrant().Accept(fee, ctx.BlockTime(), ctx.BlockHeight()) + if err == nil { + ctx.EventManager().EmitEvent( + sdk.NewEvent( + types.EventTypeUseFeeGrant, + sdk.NewAttribute(types.AttributeKeyGranter, granter.String()), + sdk.NewAttribute(types.AttributeKeyGrantee, grantee.String()), + ), + ) + } + + if remove { + k.RevokeFeeAllowance(ctx, granter, grantee) + // note this returns nil if err == nil + return sdkerrors.Wrap(err, "removed grant") + } + + if err != nil { + return sdkerrors.Wrap(err, "invalid grant") + } + + // if we accepted, store the updated state of the allowance + return k.GrantFeeAllowance(ctx, granter, grantee, grant.GetFeeGrant()) +} diff --git a/x/feegrant/keeper/keeper_test.go b/x/feegrant/keeper/keeper_test.go new file mode 100644 index 000000000..c14e141d3 --- /dev/null +++ b/x/feegrant/keeper/keeper_test.go @@ -0,0 +1,257 @@ +package keeper_test + +import ( + "testing" + + "github.com/stretchr/testify/suite" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/feegrant/types" +) + +type KeeperTestSuite struct { + suite.Suite + + app *simapp.SimApp + ctx sdk.Context + addrs []sdk.AccAddress +} + +func TestKeeperTestSuite(t *testing.T) { + suite.Run(t, new(KeeperTestSuite)) +} + +func (suite *KeeperTestSuite) SetupTest() { + app := simapp.Setup(false) + ctx := app.BaseApp.NewContext(false, tmproto.Header{}) + + suite.app = app + suite.ctx = ctx + suite.addrs = simapp.AddTestAddrsIncremental(app, ctx, 4, sdk.NewInt(30000000)) +} + +func (suite *KeeperTestSuite) TestKeeperCrud() { + ctx := suite.ctx + k := suite.app.FeeGrantKeeper + + // some helpers + atom := sdk.NewCoins(sdk.NewInt64Coin("atom", 555)) + eth := sdk.NewCoins(sdk.NewInt64Coin("eth", 123)) + basic := &types.BasicFeeAllowance{ + SpendLimit: atom, + Expiration: types.ExpiresAtHeight(334455), + } + + basic2 := &types.BasicFeeAllowance{ + SpendLimit: eth, + Expiration: types.ExpiresAtHeight(172436), + } + + // let's set up some initial state here + err := k.GrantFeeAllowance(ctx, suite.addrs[0], suite.addrs[1], basic) + suite.Require().NoError(err) + + err = k.GrantFeeAllowance(ctx, suite.addrs[0], suite.addrs[2], basic2) + suite.Require().NoError(err) + + err = k.GrantFeeAllowance(ctx, suite.addrs[1], suite.addrs[2], basic) + suite.Require().NoError(err) + + err = k.GrantFeeAllowance(ctx, suite.addrs[1], suite.addrs[3], basic) + suite.Require().NoError(err) + + err = k.GrantFeeAllowance(ctx, suite.addrs[3], suite.addrs[0], basic2) + suite.Require().NoError(err) + + // remove some, overwrite other + k.RevokeFeeAllowance(ctx, suite.addrs[0], suite.addrs[1]) + k.RevokeFeeAllowance(ctx, suite.addrs[0], suite.addrs[2]) + + err = k.GrantFeeAllowance(ctx, suite.addrs[0], suite.addrs[2], basic) + suite.Require().NoError(err) + + err = k.GrantFeeAllowance(ctx, suite.addrs[1], suite.addrs[2], basic2) + suite.Require().NoError(err) + + // end state: + // addr -> addr3 (basic) + // addr2 -> addr3 (basic2), addr4(basic) + // addr4 -> addr (basic2) + + // then lots of queries + cases := map[string]struct { + grantee sdk.AccAddress + granter sdk.AccAddress + allowance types.FeeAllowanceI + }{ + "addr revoked": { + granter: suite.addrs[0], + grantee: suite.addrs[1], + }, + "addr revoked and added": { + granter: suite.addrs[0], + grantee: suite.addrs[2], + allowance: basic, + }, + "addr never there": { + granter: suite.addrs[0], + grantee: suite.addrs[3], + }, + "addr modified": { + granter: suite.addrs[1], + grantee: suite.addrs[2], + allowance: basic2, + }, + } + + for name, tc := range cases { + tc := tc + suite.Run(name, func() { + allow := k.GetFeeAllowance(ctx, tc.granter, tc.grantee) + if tc.allowance == nil { + suite.Nil(allow) + return + } + suite.NotNil(allow) + suite.Equal(tc.allowance, allow) + }) + } + + grant1, err := types.NewFeeAllowanceGrant(suite.addrs[3], suite.addrs[0], basic2) + suite.NoError(err) + + grant2, err := types.NewFeeAllowanceGrant(suite.addrs[1], suite.addrs[2], basic2) + suite.NoError(err) + + grant3, err := types.NewFeeAllowanceGrant(suite.addrs[0], suite.addrs[2], basic) + suite.NoError(err) + + allCases := map[string]struct { + grantee sdk.AccAddress + grants []types.FeeAllowanceGrant + }{ + "addr2 has none": { + grantee: suite.addrs[1], + }, + "addr has one": { + grantee: suite.addrs[0], + grants: []types.FeeAllowanceGrant{ + grant1, + }, + }, + "addr3 has two": { + grantee: suite.addrs[2], + grants: []types.FeeAllowanceGrant{ + grant3, + grant2, + }, + }, + } + + for name, tc := range allCases { + tc := tc + suite.Run(name, func() { + var grants []types.FeeAllowanceGrant + err := k.IterateAllGranteeFeeAllowances(ctx, tc.grantee, func(grant types.FeeAllowanceGrant) bool { + grants = append(grants, grant) + return false + }) + suite.NoError(err) + suite.Equal(tc.grants, grants) + }) + } +} + +func (suite *KeeperTestSuite) TestUseGrantedFee() { + ctx := suite.ctx + k := suite.app.FeeGrantKeeper + + // some helpers + atom := sdk.NewCoins(sdk.NewInt64Coin("atom", 555)) + eth := sdk.NewCoins(sdk.NewInt64Coin("eth", 123)) + future := &types.BasicFeeAllowance{ + SpendLimit: atom, + Expiration: types.ExpiresAtHeight(5678), + } + + expired := &types.BasicFeeAllowance{ + SpendLimit: eth, + Expiration: types.ExpiresAtHeight(55), + } + + // for testing limits of the contract + hugeAtom := sdk.NewCoins(sdk.NewInt64Coin("atom", 9999)) + _ = hugeAtom + smallAtom := sdk.NewCoins(sdk.NewInt64Coin("atom", 1)) + _ = smallAtom + futureAfterSmall := &types.BasicFeeAllowance{ + SpendLimit: sdk.NewCoins(sdk.NewInt64Coin("atom", 554)), + Expiration: types.ExpiresAtHeight(5678), + } + + // then lots of queries + cases := map[string]struct { + grantee sdk.AccAddress + granter sdk.AccAddress + fee sdk.Coins + allowed bool + final types.FeeAllowanceI + }{ + "use entire pot": { + granter: suite.addrs[0], + grantee: suite.addrs[1], + fee: atom, + allowed: true, + final: nil, + }, + "expired and removed": { + granter: suite.addrs[0], + grantee: suite.addrs[2], + fee: eth, + allowed: false, + final: nil, + }, + "too high": { + granter: suite.addrs[0], + grantee: suite.addrs[1], + fee: hugeAtom, + allowed: false, + final: future, + }, + "use a little": { + granter: suite.addrs[0], + grantee: suite.addrs[1], + fee: smallAtom, + allowed: true, + final: futureAfterSmall, + }, + } + + for name, tc := range cases { + tc := tc + suite.Run(name, func() { + // let's set up some initial state here + // addr -> addr2 (future) + // addr -> addr3 (expired) + + err := k.GrantFeeAllowance(ctx, suite.addrs[0], suite.addrs[1], future) + suite.Require().NoError(err) + + err = k.GrantFeeAllowance(ctx, suite.addrs[0], suite.addrs[3], expired) + suite.Require().NoError(err) + + err = k.UseGrantedFees(ctx, tc.granter, tc.grantee, tc.fee) + if tc.allowed { + suite.NoError(err) + } else { + suite.Error(err) + } + + loaded := k.GetFeeAllowance(ctx, tc.granter, tc.grantee) + + suite.Equal(tc.final, loaded) + }) + } +} diff --git a/x/feegrant/keeper/msg_server.go b/x/feegrant/keeper/msg_server.go new file mode 100644 index 000000000..3cd96e79b --- /dev/null +++ b/x/feegrant/keeper/msg_server.go @@ -0,0 +1,72 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/feegrant/types" +) + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the feegrant MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(k Keeper) types.MsgServer { + return &msgServer{ + Keeper: k, + } +} + +var _ types.MsgServer = msgServer{} + +func (k msgServer) GrantFeeAllowance(goCtx context.Context, msg *types.MsgGrantFeeAllowance) (*types.MsgGrantFeeAllowanceResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + grantee, err := sdk.AccAddressFromBech32(msg.Grantee) + if err != nil { + return nil, err + } + + granter, err := sdk.AccAddressFromBech32(msg.Granter) + if err != nil { + return nil, err + } + + // Checking for duplicate entry + f := k.Keeper.GetFeeAllowance(ctx, granter, grantee) + if f != nil { + return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "fee allowance already exists") + } + + err = k.Keeper.GrantFeeAllowance(ctx, granter, grantee, msg.GetFeeAllowanceI()) + if err != nil { + return nil, err + } + + return &types.MsgGrantFeeAllowanceResponse{}, nil +} + +func (k msgServer) RevokeFeeAllowance(goCtx context.Context, msg *types.MsgRevokeFeeAllowance) (*types.MsgRevokeFeeAllowanceResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + grantee, err := sdk.AccAddressFromBech32(msg.Grantee) + if err != nil { + return nil, err + } + + granter, err := sdk.AccAddressFromBech32(msg.Granter) + if err != nil { + return nil, err + } + + err = k.Keeper.RevokeFeeAllowance(ctx, granter, grantee) + if err != nil { + return nil, err + } + + return &types.MsgRevokeFeeAllowanceResponse{}, nil +} diff --git a/x/feegrant/module.go b/x/feegrant/module.go new file mode 100644 index 000000000..5f4ba807d --- /dev/null +++ b/x/feegrant/module.go @@ -0,0 +1,210 @@ +package feegrant + +import ( + "context" + "encoding/json" + "math/rand" + + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + abci "github.com/tendermint/tendermint/abci/types" + + sdkclient "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/feegrant/client/cli" + "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" + "github.com/cosmos/cosmos-sdk/x/feegrant/simulation" + "github.com/cosmos/cosmos-sdk/x/feegrant/types" +) + +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} + _ module.AppModuleSimulation = AppModule{} +) + +// ---------------------------------------------------------------------------- +// AppModuleBasic +// ---------------------------------------------------------------------------- + +// AppModuleBasic defines the basic application module used by the feegrant module. +type AppModuleBasic struct { + cdc codec.Marshaler +} + +// Name returns the feegrant module's name. +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +// RegisterServices registers a gRPC query service to respond to the +// module-specific gRPC queries. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) +} + +// RegisterLegacyAminoCodec registers the feegrant module's types for the given codec. +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { +} + +// RegisterInterfaces registers the feegrant module's interface types +func (AppModuleBasic) RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(registry) +} + +// LegacyQuerierHandler returns the feegrant module sdk.Querier. +func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { + return nil +} + +// DefaultGenesis returns default genesis state as raw bytes for the feegrant +// module. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONMarshaler) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesisState()) +} + +// ValidateGenesis performs genesis state validation for the feegrant module. +func (a AppModuleBasic) ValidateGenesis(cdc codec.JSONMarshaler, config sdkclient.TxEncodingConfig, bz json.RawMessage) error { + var data types.GenesisState + if err := cdc.UnmarshalJSON(bz, &data); err != nil { + sdkerrors.Wrapf(err, "failed to unmarshal %s genesis state", types.ModuleName) + } + + return types.ValidateGenesis(data) +} + +// RegisterRESTRoutes registers the REST routes for the feegrant module. +func (AppModuleBasic) RegisterRESTRoutes(ctx sdkclient.Context, rtr *mux.Router) {} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the feegrant module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx sdkclient.Context, mux *runtime.ServeMux) { + types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) +} + +// GetTxCmd returns the root tx command for the feegrant module. +func (AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.GetTxCmd() +} + +// GetQueryCmd returns no root query command for the feegrant module. +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd() +} + +// ---------------------------------------------------------------------------- +// AppModule +// ---------------------------------------------------------------------------- + +// AppModule implements an application module for the feegrant module. +type AppModule struct { + AppModuleBasic + keeper keeper.Keeper + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper + registry cdctypes.InterfaceRegistry +} + +// NewAppModule creates a new AppModule object +func NewAppModule(cdc codec.Marshaler, ak types.AccountKeeper, bk types.BankKeeper, keeper keeper.Keeper, registry cdctypes.InterfaceRegistry) AppModule { + return AppModule{ + AppModuleBasic: AppModuleBasic{cdc: cdc}, + keeper: keeper, + accountKeeper: ak, + bankKeeper: bk, + registry: registry, + } +} + +// Name returns the feegrant module's name. +func (AppModule) Name() string { + return types.ModuleName +} + +// RegisterInvariants registers the feegrant module invariants. +func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {} + +// Route returns the message routing key for the feegrant module. +func (am AppModule) Route() sdk.Route { + return sdk.NewRoute(types.RouterKey, nil) +} + +// NewHandler returns an sdk.Handler for the feegrant module. +func (am AppModule) NewHandler() sdk.Handler { + return nil +} + +// QuerierRoute returns the feegrant module's querier route name. +func (AppModule) QuerierRoute() string { + return "" +} + +// InitGenesis performs genesis initialization for the feegrant module. It returns +// no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONMarshaler, bz json.RawMessage) []abci.ValidatorUpdate { + var gs types.GenesisState + cdc.MustUnmarshalJSON(bz, &gs) + + InitGenesis(ctx, am.keeper, &gs) + return []abci.ValidatorUpdate{} +} + +// ExportGenesis returns the exported genesis state as raw bytes for the feegrant +// module. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONMarshaler) json.RawMessage { + gs, err := ExportGenesis(ctx, am.keeper) + if err != nil { + panic(err) + } + + return cdc.MustMarshalJSON(gs) +} + +// BeginBlock returns the begin blocker for the feegrant module. +func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} + +// EndBlock returns the end blocker for the feegrant module. It returns no validator +// updates. +func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + return []abci.ValidatorUpdate{} +} + +//____________________________________________________________________________ + +// AppModuleSimulation functions + +// GenerateGenesisState creates a randomized GenState of the feegrant module. +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + simulation.RandomizedGenState(simState) +} + +// ProposalContents returns all the feegrant content functions used to +// simulate governance proposals. +func (AppModule) ProposalContents(simState module.SimulationState) []simtypes.WeightedProposalContent { + return nil +} + +// RandomizedParams creates randomized feegrant param changes for the simulator. +func (AppModule) RandomizedParams(r *rand.Rand) []simtypes.ParamChange { + return nil +} + +// RegisterStoreDecoder registers a decoder for feegrant module's types +func (am AppModule) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { + sdr[types.StoreKey] = simulation.NewDecodeStore(am.cdc) +} + +// WeightedOperations returns all the feegrant module operations with their respective weights. +func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { + protoCdc := codec.NewProtoCodec(am.registry) + return simulation.WeightedOperations( + simState.AppParams, simState.Cdc, am.accountKeeper, am.bankKeeper, am.keeper, protoCdc, + ) +} diff --git a/x/feegrant/simulation/decoder.go b/x/feegrant/simulation/decoder.go new file mode 100644 index 000000000..46e35594f --- /dev/null +++ b/x/feegrant/simulation/decoder.go @@ -0,0 +1,26 @@ +package simulation + +import ( + "bytes" + "fmt" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/types/kv" + "github.com/cosmos/cosmos-sdk/x/feegrant/types" +) + +// NewDecodeStore returns a decoder function closure that unmarshals the KVPair's +// Value to the corresponding feegrant type. +func NewDecodeStore(cdc codec.Marshaler) func(kvA, kvB kv.Pair) string { + return func(kvA, kvB kv.Pair) string { + switch { + case bytes.Equal(kvA.Key[:1], types.FeeAllowanceKeyPrefix): + var grantA, grantB types.FeeAllowanceGrant + cdc.MustUnmarshalBinaryBare(kvA.Value, &grantA) + cdc.MustUnmarshalBinaryBare(kvB.Value, &grantB) + return fmt.Sprintf("%v\n%v", grantA, grantB) + default: + panic(fmt.Sprintf("invalid feegrant key %X", kvA.Key)) + } + } +} diff --git a/x/feegrant/simulation/decoder_test.go b/x/feegrant/simulation/decoder_test.go new file mode 100644 index 000000000..0087e5eba --- /dev/null +++ b/x/feegrant/simulation/decoder_test.go @@ -0,0 +1,62 @@ +package simulation_test + +import ( + "fmt" + "testing" + + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/kv" + "github.com/cosmos/cosmos-sdk/x/feegrant/simulation" + "github.com/cosmos/cosmos-sdk/x/feegrant/types" + "github.com/stretchr/testify/require" +) + +var ( + granterPk = ed25519.GenPrivKey().PubKey() + granterAddr = sdk.AccAddress(granterPk.Address()) + granteePk = ed25519.GenPrivKey().PubKey() + granteeAddr = sdk.AccAddress(granterPk.Address()) +) + +func TestDecodeStore(t *testing.T) { + cdc := simapp.MakeTestEncodingConfig().Marshaler + dec := simulation.NewDecodeStore(cdc) + + grant, err := types.NewFeeAllowanceGrant(granterAddr, granteeAddr, &types.BasicFeeAllowance{ + SpendLimit: sdk.NewCoins(sdk.NewCoin("foo", sdk.NewInt(100))), + }) + + require.NoError(t, err) + + grantBz, err := cdc.MarshalBinaryBare(&grant) + require.NoError(t, err) + + kvPairs := kv.Pairs{ + Pairs: []kv.Pair{ + {Key: []byte(types.FeeAllowanceKeyPrefix), Value: grantBz}, + {Key: []byte{0x99}, Value: []byte{0x99}}, + }, + } + + tests := []struct { + name string + expectedLog string + }{ + {"Grant", fmt.Sprintf("%v\n%v", grant, grant)}, + {"other", ""}, + } + + for i, tt := range tests { + i, tt := i, tt + t.Run(tt.name, func(t *testing.T) { + switch i { + case len(tests) - 1: + require.Panics(t, func() { dec(kvPairs.Pairs[i], kvPairs.Pairs[i]) }, tt.name) + default: + require.Equal(t, tt.expectedLog, dec(kvPairs.Pairs[i], kvPairs.Pairs[i]), tt.name) + } + }) + } +} diff --git a/x/feegrant/simulation/genesis.go b/x/feegrant/simulation/genesis.go new file mode 100644 index 000000000..f9f4c7e12 --- /dev/null +++ b/x/feegrant/simulation/genesis.go @@ -0,0 +1,38 @@ +package simulation + +import ( + "encoding/json" + "fmt" + "math/rand" + + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/feegrant/types" +) + +// Simulation parameter constants +const feegrant = "feegrant" + +// GenFeeGrants returns an empty slice of evidences. +func GenFeeGrants(_ *rand.Rand, _ []simtypes.Account) []types.FeeAllowanceGrant { + return []types.FeeAllowanceGrant{} +} + +// RandomizedGenState generates a random GenesisState for feegrant +func RandomizedGenState(simState *module.SimulationState) { + var feegrants []types.FeeAllowanceGrant + + simState.AppParams.GetOrGenerate( + simState.Cdc, feegrant, &feegrants, simState.Rand, + func(r *rand.Rand) { feegrants = GenFeeGrants(r, simState.Accounts) }, + ) + feegrantGenesis := types.NewGenesisState(feegrants) + + bz, err := json.MarshalIndent(&feegrantGenesis, "", " ") + if err != nil { + panic(err) + } + + fmt.Printf("Selected randomly generated %s parameters:\n%s\n", types.ModuleName, bz) + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(feegrantGenesis) +} diff --git a/x/feegrant/simulation/genesis_test.go b/x/feegrant/simulation/genesis_test.go new file mode 100644 index 000000000..4f3ae74b5 --- /dev/null +++ b/x/feegrant/simulation/genesis_test.go @@ -0,0 +1,39 @@ +package simulation_test + +import ( + "encoding/json" + "math/rand" + "testing" + + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/types/module" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/feegrant/simulation" + "github.com/cosmos/cosmos-sdk/x/feegrant/types" + "github.com/stretchr/testify/require" +) + +func TestRandomizedGenState(t *testing.T) { + interfaceRegistry := codectypes.NewInterfaceRegistry() + cdc := codec.NewProtoCodec(interfaceRegistry) + + s := rand.NewSource(1) + r := rand.New(s) + + simState := module.SimulationState{ + AppParams: make(simtypes.AppParams), + Cdc: cdc, + Rand: r, + NumBonded: 3, + Accounts: simtypes.RandomAccounts(r, 3), + InitialStake: 1000, + GenState: make(map[string]json.RawMessage), + } + + simulation.RandomizedGenState(&simState) + var feegrantGenesis types.GenesisState + simState.Cdc.MustUnmarshalJSON(simState.GenState[types.ModuleName], &feegrantGenesis) + + require.Len(t, feegrantGenesis.FeeAllowances, 0) +} diff --git a/x/feegrant/simulation/operations.go b/x/feegrant/simulation/operations.go new file mode 100644 index 000000000..54821873b --- /dev/null +++ b/x/feegrant/simulation/operations.go @@ -0,0 +1,200 @@ +package simulation + +import ( + "context" + "math/rand" + "time" + + "github.com/cosmos/cosmos-sdk/baseapp" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/simapp/helpers" + simappparams "github.com/cosmos/cosmos-sdk/simapp/params" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/feegrant/keeper" + "github.com/cosmos/cosmos-sdk/x/feegrant/types" + "github.com/cosmos/cosmos-sdk/x/simulation" +) + +// Simulation operation weights constants +const ( + OpWeightMsgGrantFeeAllowance = "op_weight_msg_grant_fee_allowance" + OpWeightMsgRevokeFeeAllowance = "op_weight_msg_grant_revoke_allowance" + TypeMsgGrantFeeAllowance = "/cosmos.feegrant.v1beta1.Msg/GrantFeeAllowance" + TypeMsgRevokeFeeAllowance = "/cosmos.feegrant.v1beta1.Msg/RevokeFeeAllowance" +) + +func WeightedOperations( + appParams simtypes.AppParams, cdc codec.JSONMarshaler, + ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper, + protoCdc *codec.ProtoCodec, +) simulation.WeightedOperations { + + var ( + weightMsgGrantFeeAllowance int + weightMsgRevokeFeeAllowance int + ) + + appParams.GetOrGenerate(cdc, OpWeightMsgGrantFeeAllowance, &weightMsgGrantFeeAllowance, nil, + func(_ *rand.Rand) { + weightMsgGrantFeeAllowance = simappparams.DefaultWeightGrantFeeAllowance + }, + ) + + appParams.GetOrGenerate(cdc, OpWeightMsgRevokeFeeAllowance, &weightMsgRevokeFeeAllowance, nil, + func(_ *rand.Rand) { + weightMsgRevokeFeeAllowance = simappparams.DefaultWeightRevokeFeeAllowance + }, + ) + + return simulation.WeightedOperations{ + simulation.NewWeightedOperation( + weightMsgGrantFeeAllowance, + SimulateMsgGrantFeeAllowance(ak, bk, k, protoCdc), + ), + simulation.NewWeightedOperation( + weightMsgRevokeFeeAllowance, + SimulateMsgRevokeFeeAllowance(ak, bk, k, protoCdc), + ), + } +} + +// SimulateMsgGrantFeeAllowance generates MsgGrantFeeAllowance with random values. +func SimulateMsgGrantFeeAllowance(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper, protoCdc *codec.ProtoCodec) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + granter, _ := simtypes.RandomAcc(r, accs) + grantee, _ := simtypes.RandomAcc(r, accs) + if grantee.Address.String() == granter.Address.String() { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgGrantFeeAllowance, "grantee and granter cannot be same"), nil, nil + } + + f := k.GetFeeAllowance(ctx, granter.Address, grantee.Address) + if f != nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgGrantFeeAllowance, "fee allowance exists"), nil, nil + } + + account := ak.GetAccount(ctx, granter.Address) + + spendableCoins := bk.SpendableCoins(ctx, account.GetAddress()) + fees, err := simtypes.RandomFees(r, ctx, spendableCoins) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgGrantFeeAllowance, err.Error()), nil, err + } + + spendableCoins = spendableCoins.Sub(fees) + if spendableCoins.Empty() { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgGrantFeeAllowance, "unable to grant empty coins as SpendLimit"), nil, nil + } + + msg, err := types.NewMsgGrantFeeAllowance(&types.BasicFeeAllowance{ + SpendLimit: spendableCoins, + Expiration: types.ExpiresAtTime(ctx.BlockTime().Add(30 * time.Hour)), + }, granter.Address, grantee.Address) + + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgGrantFeeAllowance, err.Error()), nil, err + } + txGen := simappparams.MakeTestEncodingConfig().TxConfig + svcMsgClientConn := &msgservice.ServiceMsgClientConn{} + feegrantMsgClient := types.NewMsgClient(svcMsgClientConn) + _, err = feegrantMsgClient.GrantFeeAllowance(context.Background(), msg) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgGrantFeeAllowance, err.Error()), nil, err + } + tx, err := helpers.GenTx( + txGen, + svcMsgClientConn.GetMsgs(), + fees, + helpers.DefaultGenTxGas, + chainID, + []uint64{account.GetAccountNumber()}, + []uint64{account.GetSequence()}, + granter.PrivKey, + ) + + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, TypeMsgGrantFeeAllowance, "unable to generate mock tx"), nil, err + } + + _, _, err = app.Deliver(txGen.TxEncoder(), tx) + + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, svcMsgClientConn.GetMsgs()[0].Type(), "unable to deliver tx"), nil, err + } + return simtypes.NewOperationMsg(svcMsgClientConn.GetMsgs()[0], true, "", protoCdc), nil, err + } +} + +// SimulateMsgRevokeFeeAllowance generates a MsgRevokeFeeAllowance with random values. +func SimulateMsgRevokeFeeAllowance(ak types.AccountKeeper, bk types.BankKeeper, k keeper.Keeper, protoCdc *codec.ProtoCodec) simtypes.Operation { + return func( + r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + + hasGrant := false + var granterAddr sdk.AccAddress + var granteeAddr sdk.AccAddress + k.IterateAllFeeAllowances(ctx, func(grant types.FeeAllowanceGrant) bool { + + granter, err := sdk.AccAddressFromBech32(grant.Granter) + if err != nil { + panic(err) + } + grantee, err := sdk.AccAddressFromBech32(grant.Grantee) + if err != nil { + panic(err) + } + granterAddr = granter + granteeAddr = grantee + hasGrant = true + return true + }) + + if !hasGrant { + return simtypes.NoOpMsg(types.ModuleName, TypeMsgRevokeFeeAllowance, "no grants"), nil, nil + } + granter, ok := simtypes.FindAccount(accs, granterAddr) + + if !ok { + return simtypes.NoOpMsg(types.ModuleName, TypeMsgRevokeFeeAllowance, "Account not found"), nil, nil + } + + account := ak.GetAccount(ctx, granter.Address) + spendableCoins := bk.SpendableCoins(ctx, account.GetAddress()) + fees, err := simtypes.RandomFees(r, ctx, spendableCoins) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, TypeMsgRevokeFeeAllowance, err.Error()), nil, err + } + + msg := types.NewMsgRevokeFeeAllowance(granterAddr, granteeAddr) + + txGen := simappparams.MakeTestEncodingConfig().TxConfig + svcMsgClientConn := &msgservice.ServiceMsgClientConn{} + feegrantMsgClient := types.NewMsgClient(svcMsgClientConn) + _, err = feegrantMsgClient.RevokeFeeAllowance(context.Background(), &msg) + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, types.TypeMsgGrantFeeAllowance, err.Error()), nil, err + } + + tx, err := helpers.GenTx( + txGen, + svcMsgClientConn.GetMsgs(), + fees, + helpers.DefaultGenTxGas, + chainID, + []uint64{account.GetAccountNumber()}, + []uint64{account.GetSequence()}, + granter.PrivKey, + ) + + if err != nil { + return simtypes.NoOpMsg(types.ModuleName, TypeMsgRevokeFeeAllowance, err.Error()), nil, err + } + + _, _, err = app.Deliver(txGen.TxEncoder(), tx) + return simtypes.NewOperationMsg(svcMsgClientConn.GetMsgs()[0], true, "", protoCdc), nil, err + } +} diff --git a/x/feegrant/simulation/operations_test.go b/x/feegrant/simulation/operations_test.go new file mode 100644 index 000000000..7c2593a53 --- /dev/null +++ b/x/feegrant/simulation/operations_test.go @@ -0,0 +1,173 @@ +package simulation_test + +import ( + "math/rand" + "testing" + "time" + + "github.com/stretchr/testify/suite" + + abci "github.com/tendermint/tendermint/abci/types" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/simapp" + simappparams "github.com/cosmos/cosmos-sdk/simapp/params" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + "github.com/cosmos/cosmos-sdk/x/feegrant/simulation" + "github.com/cosmos/cosmos-sdk/x/feegrant/types" +) + +type SimTestSuite struct { + suite.Suite + + ctx sdk.Context + app *simapp.SimApp + protoCdc *codec.ProtoCodec +} + +func (suite *SimTestSuite) SetupTest() { + checkTx := false + app := simapp.Setup(checkTx) + suite.app = app + suite.ctx = app.BaseApp.NewContext(checkTx, tmproto.Header{}) + suite.protoCdc = codec.NewProtoCodec(suite.app.InterfaceRegistry()) + +} + +func (suite *SimTestSuite) getTestingAccounts(r *rand.Rand, n int) []simtypes.Account { + app, ctx := suite.app, suite.ctx + accounts := simtypes.RandomAccounts(r, n) + require := suite.Require() + + initAmt := sdk.TokensFromConsensusPower(200) + initCoins := sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, initAmt)) + + // add coins to the accounts + for _, account := range accounts { + acc := app.AccountKeeper.NewAccountWithAddress(ctx, account.Address) + app.AccountKeeper.SetAccount(ctx, acc) + err := app.BankKeeper.SetBalances(ctx, account.Address, initCoins) + require.NoError(err) + } + + return accounts +} + +func (suite *SimTestSuite) TestWeightedOperations() { + app, ctx := suite.app, suite.ctx + require := suite.Require() + + ctx.WithChainID("test-chain") + + cdc := app.AppCodec() + appParams := make(simtypes.AppParams) + + weightesOps := simulation.WeightedOperations( + appParams, cdc, app.AccountKeeper, + app.BankKeeper, app.FeeGrantKeeper, + suite.protoCdc, + ) + + s := rand.NewSource(1) + r := rand.New(s) + accs := suite.getTestingAccounts(r, 3) + + expected := []struct { + weight int + opMsgRoute string + opMsgName string + }{ + { + simappparams.DefaultWeightGrantFeeAllowance, + types.ModuleName, + simulation.TypeMsgGrantFeeAllowance, + }, + { + simappparams.DefaultWeightRevokeFeeAllowance, + types.ModuleName, + simulation.TypeMsgRevokeFeeAllowance, + }, + } + + for i, w := range weightesOps { + operationMsg, _, _ := w.Op()(r, app.BaseApp, ctx, accs, ctx.ChainID()) + // the following checks are very much dependent from the ordering of the output given + // by WeightedOperations. if the ordering in WeightedOperations changes some tests + // will fail + require.Equal(expected[i].weight, w.Weight(), "weight should be the same") + require.Equal(expected[i].opMsgRoute, operationMsg.Route, "route should be the same") + require.Equal(expected[i].opMsgName, operationMsg.Name, "operation Msg name should be the same") + } +} + +func (suite *SimTestSuite) TestSimulateMsgGrantFeeAllowance() { + app, ctx := suite.app, suite.ctx + require := suite.Require() + + s := rand.NewSource(1) + r := rand.New(s) + accounts := suite.getTestingAccounts(r, 3) + + // begin a new block + app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: app.LastBlockHeight() + 1, AppHash: app.LastCommitID().Hash}}) + + // execute operation + op := simulation.SimulateMsgGrantFeeAllowance(app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, suite.protoCdc) + operationMsg, futureOperations, err := op(r, app.BaseApp, ctx, accounts, "") + require.NoError(err) + + var msg types.MsgGrantFeeAllowance + suite.app.AppCodec().UnmarshalJSON(operationMsg.Msg, &msg) + + require.True(operationMsg.OK) + require.Equal("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r", msg.Granter) + require.Equal("cosmos1p8wcgrjr4pjju90xg6u9cgq55dxwq8j7u4x9a0", msg.Grantee) + require.Len(futureOperations, 0) +} + +func (suite *SimTestSuite) TestSimulateMsgRevokeFeeAllowance() { + app, ctx := suite.app, suite.ctx + require := suite.Require() + + s := rand.NewSource(1) + r := rand.New(s) + accounts := suite.getTestingAccounts(r, 3) + + // begin a new block + app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{Height: suite.app.LastBlockHeight() + 1, AppHash: suite.app.LastCommitID().Hash}}) + + feeAmt := sdk.TokensFromConsensusPower(200000) + feeCoins := sdk.NewCoins(sdk.NewCoin("foo", feeAmt)) + + granter, grantee := accounts[0], accounts[1] + + err := app.FeeGrantKeeper.GrantFeeAllowance( + ctx, + granter.Address, + grantee.Address, + &types.BasicFeeAllowance{ + SpendLimit: feeCoins, + Expiration: types.ExpiresAtTime(ctx.BlockTime().Add(30 * time.Hour)), + }, + ) + require.NoError(err) + + // execute operation + op := simulation.SimulateMsgRevokeFeeAllowance(app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, suite.protoCdc) + operationMsg, futureOperations, err := op(r, app.BaseApp, ctx, accounts, "") + require.NoError(err) + + var msg types.MsgRevokeFeeAllowance + suite.app.AppCodec().UnmarshalJSON(operationMsg.Msg, &msg) + + require.True(operationMsg.OK) + require.Equal(granter.Address.String(), msg.Granter) + require.Equal(grantee.Address.String(), msg.Grantee) + require.Len(futureOperations, 0) +} + +func TestSimTestSuite(t *testing.T) { + suite.Run(t, new(SimTestSuite)) +} diff --git a/x/feegrant/types/basic_fee.go b/x/feegrant/types/basic_fee.go new file mode 100644 index 000000000..6d9706805 --- /dev/null +++ b/x/feegrant/types/basic_fee.go @@ -0,0 +1,61 @@ +package types + +import ( + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ FeeAllowanceI = (*BasicFeeAllowance)(nil) + +// Accept can use fee payment requested as well as timestamp/height of the current block +// to determine whether or not to process this. This is checked in +// Keeper.UseGrantedFees and the return values should match how it is handled there. +// +// If it returns an error, the fee payment is rejected, otherwise it is accepted. +// The FeeAllowance implementation is expected to update it's internal state +// and will be saved again after an acceptance. +// +// If remove is true (regardless of the error), the FeeAllowance will be deleted from storage +// (eg. when it is used up). (See call to RevokeFeeAllowance in Keeper.UseGrantedFees) +func (a *BasicFeeAllowance) Accept(fee sdk.Coins, blockTime time.Time, blockHeight int64) (bool, error) { + if a.Expiration.IsExpired(&blockTime, blockHeight) { + return true, sdkerrors.Wrap(ErrFeeLimitExpired, "basic allowance") + } + + if a.SpendLimit != nil { + left, invalid := a.SpendLimit.SafeSub(fee) + if invalid { + return false, sdkerrors.Wrap(ErrFeeLimitExceeded, "basic allowance") + } + + a.SpendLimit = left + return left.IsZero(), nil + } + + return false, nil +} + +// PrepareForExport will adjust the expiration based on export time. In particular, +// it will subtract the dumpHeight from any height-based expiration to ensure that +// the elapsed number of blocks this allowance is valid for is fixed. +func (a *BasicFeeAllowance) PrepareForExport(dumpTime time.Time, dumpHeight int64) FeeAllowanceI { + return &BasicFeeAllowance{ + SpendLimit: a.SpendLimit, + Expiration: a.Expiration.PrepareForExport(dumpTime, dumpHeight), + } +} + +// ValidateBasic implements FeeAllowance and enforces basic sanity checks +func (a BasicFeeAllowance) ValidateBasic() error { + if a.SpendLimit != nil { + if !a.SpendLimit.IsValid() { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidCoins, "send amount is invalid: %s", a.SpendLimit) + } + if !a.SpendLimit.IsAllPositive() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, "spend limit must be positive") + } + } + return a.Expiration.ValidateBasic() +} diff --git a/x/feegrant/types/basic_fee_test.go b/x/feegrant/types/basic_fee_test.go new file mode 100644 index 000000000..a5669e99a --- /dev/null +++ b/x/feegrant/types/basic_fee_test.go @@ -0,0 +1,140 @@ +package types_test + +import ( + "testing" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/feegrant/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestBasicFeeValidAllow(t *testing.T) { + eth := sdk.NewCoins(sdk.NewInt64Coin("eth", 10)) + atom := sdk.NewCoins(sdk.NewInt64Coin("atom", 555)) + smallAtom := sdk.NewCoins(sdk.NewInt64Coin("atom", 43)) + bigAtom := sdk.NewCoins(sdk.NewInt64Coin("atom", 1000)) + leftAtom := sdk.NewCoins(sdk.NewInt64Coin("atom", 512)) + + cases := map[string]struct { + allow *types.BasicFeeAllowance + // all other checks are ignored if valid=false + fee sdk.Coins + blockTime time.Time + blockHeight int64 + valid bool + accept bool + remove bool + remains sdk.Coins + }{ + "empty": { + allow: &types.BasicFeeAllowance{}, + valid: true, + accept: true, + }, + "small fee without expire": { + allow: &types.BasicFeeAllowance{ + SpendLimit: atom, + }, + valid: true, + fee: smallAtom, + accept: true, + remove: false, + remains: leftAtom, + }, + "all fee without expire": { + allow: &types.BasicFeeAllowance{ + SpendLimit: smallAtom, + }, + valid: true, + fee: smallAtom, + accept: true, + remove: true, + }, + "wrong fee": { + allow: &types.BasicFeeAllowance{ + SpendLimit: smallAtom, + }, + valid: true, + fee: eth, + accept: false, + }, + "non-expired": { + allow: &types.BasicFeeAllowance{ + SpendLimit: atom, + Expiration: types.ExpiresAtHeight(100), + }, + valid: true, + fee: smallAtom, + blockHeight: 85, + accept: true, + remove: false, + remains: leftAtom, + }, + "expired": { + allow: &types.BasicFeeAllowance{ + SpendLimit: atom, + Expiration: types.ExpiresAtHeight(100), + }, + valid: true, + fee: smallAtom, + blockHeight: 121, + accept: false, + remove: true, + }, + "fee more than allowed": { + allow: &types.BasicFeeAllowance{ + SpendLimit: atom, + Expiration: types.ExpiresAtHeight(100), + }, + valid: true, + fee: bigAtom, + blockHeight: 85, + accept: false, + }, + "with out spend limit": { + allow: &types.BasicFeeAllowance{ + Expiration: types.ExpiresAtHeight(100), + }, + valid: true, + fee: bigAtom, + blockHeight: 85, + accept: true, + }, + "expired no spend limit": { + allow: &types.BasicFeeAllowance{ + Expiration: types.ExpiresAtHeight(100), + }, + valid: true, + fee: bigAtom, + blockHeight: 120, + accept: false, + }, + } + + for name, stc := range cases { + tc := stc // to make scopelint happy + t.Run(name, func(t *testing.T) { + err := tc.allow.ValidateBasic() + if !tc.valid { + require.Error(t, err) + return + } + require.NoError(t, err) + + // now try to deduct + remove, err := tc.allow.Accept(tc.fee, tc.blockTime, tc.blockHeight) + if !tc.accept { + require.Error(t, err) + return + } + require.NoError(t, err) + + require.Equal(t, tc.remove, remove) + if !remove { + assert.Equal(t, tc.allow.SpendLimit, tc.remains) + } + }) + } +} diff --git a/x/feegrant/types/codec.go b/x/feegrant/types/codec.go new file mode 100644 index 000000000..686187cd7 --- /dev/null +++ b/x/feegrant/types/codec.go @@ -0,0 +1,24 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +// RegisterInterfaces registers the interfaces types with the interface registry +func RegisterInterfaces(registry types.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.MsgRequest)(nil), + &MsgGrantFeeAllowance{}, + &MsgRevokeFeeAllowance{}, + ) + + registry.RegisterInterface( + "cosmos.feegrant.v1beta1.FeeAllowanceI", + (*FeeAllowanceI)(nil), + &BasicFeeAllowance{}, + &PeriodicFeeAllowance{}, + ) + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} diff --git a/x/feegrant/types/errors.go b/x/feegrant/types/errors.go new file mode 100644 index 000000000..183f681ca --- /dev/null +++ b/x/feegrant/types/errors.go @@ -0,0 +1,21 @@ +package types + +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// Codes for governance errors +const ( + DefaultCodespace = ModuleName +) + +var ( + // ErrFeeLimitExceeded error if there are not enough allowance to cover the fees + ErrFeeLimitExceeded = sdkerrors.Register(DefaultCodespace, 2, "fee limit exceeded") + // ErrFeeLimitExpired error if the allowance has expired + ErrFeeLimitExpired = sdkerrors.Register(DefaultCodespace, 3, "fee allowance expired") + // ErrInvalidDuration error if the Duration is invalid or doesn't match the expiration + ErrInvalidDuration = sdkerrors.Register(DefaultCodespace, 4, "invalid duration") + // ErrNoAllowance error if there is no allowance for that pair + ErrNoAllowance = sdkerrors.Register(DefaultCodespace, 5, "no allowance") +) diff --git a/x/feegrant/types/events.go b/x/feegrant/types/events.go new file mode 100644 index 000000000..b82ccb7b1 --- /dev/null +++ b/x/feegrant/types/events.go @@ -0,0 +1,13 @@ +package types + +// evidence module events +const ( + EventTypeUseFeeGrant = "use_feegrant" + EventTypeRevokeFeeGrant = "revoke_feegrant" + EventTypeSetFeeGrant = "set_feegrant" + + AttributeKeyGranter = "granter" + AttributeKeyGrantee = "grantee" + + AttributeValueCategory = ModuleName +) diff --git a/x/feegrant/types/expected_keepers.go b/x/feegrant/types/expected_keepers.go new file mode 100644 index 000000000..40966b06d --- /dev/null +++ b/x/feegrant/types/expected_keepers.go @@ -0,0 +1,23 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + auth "github.com/cosmos/cosmos-sdk/x/auth/types" + // supply "github.com/cosmos/cosmos-sdk/x/supply/exported" +) + +// AccountKeeper defines the expected auth Account Keeper (noalias) +type AccountKeeper interface { + GetModuleAddress(moduleName string) sdk.AccAddress + GetModuleAccount(ctx sdk.Context, moduleName string) auth.ModuleAccountI + + NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) auth.AccountI + GetAccount(ctx sdk.Context, addr sdk.AccAddress) auth.AccountI + SetAccount(ctx sdk.Context, acc auth.AccountI) +} + +// BankKeeper defines the expected supply Keeper (noalias) +type BankKeeper interface { + SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error +} diff --git a/x/feegrant/types/expiration.go b/x/feegrant/types/expiration.go new file mode 100644 index 000000000..4922b6d48 --- /dev/null +++ b/x/feegrant/types/expiration.go @@ -0,0 +1,138 @@ +package types + +import ( + "time" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// ExpiresAtTime creates an expiration at the given time +func ExpiresAtTime(t time.Time) ExpiresAt { + return ExpiresAt{ + Sum: &ExpiresAt_Time{ + Time: &t, + }, + } +} + +// ExpiresAtHeight creates an expiration at the given height +func ExpiresAtHeight(h int64) ExpiresAt { + return ExpiresAt{ + &ExpiresAt_Height{ + Height: h, + }, + } +} + +// ValidateBasic performs basic sanity checks. +// Note that empty expiration is allowed +func (e ExpiresAt) ValidateBasic() error { + if e.HasDefinedTime() && e.GetHeight() != 0 { + return sdkerrors.Wrap(ErrInvalidDuration, "both time and height are set") + } + if e.GetHeight() < 0 { + return sdkerrors.Wrap(ErrInvalidDuration, "negative height") + } + return nil +} + +// Undefined returns true for an uninitialized struct +func (e ExpiresAt) Undefined() bool { + return (e.GetTime() == nil || e.GetTime().Unix() <= 0) && e.GetHeight() == 0 +} + +// HasDefinedTime returns true if `ExpiresAt` has valid time +func (e ExpiresAt) HasDefinedTime() bool { + t := e.GetTime() + return t != nil && t.Unix() > 0 +} + +// FastForward produces a new Expiration with the time or height set to the +// new value, depending on what was set on the original expiration +func (e ExpiresAt) FastForward(t time.Time, h int64) ExpiresAt { + if e.HasDefinedTime() { + return ExpiresAtTime(t) + } + return ExpiresAtHeight(h) +} + +// IsExpired returns if the time or height is *equal to* or greater +// than the defined expiration point. Note that it is expired upon +// an exact match. +// +// Note a "zero" ExpiresAt is never expired +func (e ExpiresAt) IsExpired(t *time.Time, h int64) bool { + if e.HasDefinedTime() && t.After(*e.GetTime()) { + return true + } + + return e.GetHeight() != 0 && h >= e.GetHeight() +} + +// IsCompatible returns true iff the two use the same units. +// If false, they cannot be added. +func (e ExpiresAt) IsCompatible(d Duration) bool { + if e.HasDefinedTime() { + return d.GetDuration() != nil && d.GetDuration().Seconds() > float64(0) + } + return d.GetBlocks() > 0 +} + +// Step will increase the expiration point by one Duration +// It returns an error if the Duration is incompatible +func (e ExpiresAt) Step(d Duration) (ExpiresAt, error) { + if !e.IsCompatible(d) { + return ExpiresAt{}, sdkerrors.Wrap(ErrInvalidDuration, "expiration time and provided duration have different units") + } + if e.HasDefinedTime() { + return ExpiresAtTime(e.GetTime().Add(*d.GetDuration())), nil + } + return ExpiresAtHeight(e.GetHeight() + int64(d.GetBlocks())), nil +} + +// MustStep is like Step, but panics on error +func (e ExpiresAt) MustStep(d Duration) ExpiresAt { + res, err := e.Step(d) + if err != nil { + panic(err) + } + return res +} + +// PrepareForExport will deduct the dumpHeight from the expiration, so when this is +// reloaded after a hard fork, the actual number of allowed blocks is constant +func (e ExpiresAt) PrepareForExport(dumpTime time.Time, dumpHeight int64) ExpiresAt { + if e.GetHeight() != 0 { + return ExpiresAtHeight(e.GetHeight() - dumpHeight) + } + return ExpiresAt{} +} + +// ClockDuration creates an Duration by clock time +func ClockDuration(d time.Duration) Duration { + return Duration{Sum: &Duration_Duration{ + Duration: &d, + }} +} + +// BlockDuration creates an Duration by block height +func BlockDuration(h uint64) Duration { + return Duration{Sum: &Duration_Blocks{ + Blocks: h, + }} +} + +// ValidateBasic performs basic sanity checks +// Note that exactly one must be set and it must be positive +func (d Duration) ValidateBasic() error { + if d.GetBlocks() == 0 && d.GetDuration() == nil { + return sdkerrors.Wrap(ErrInvalidDuration, "neither time and height are set") + } + if d.GetBlocks() != 0 && d.GetDuration() != nil && d.GetDuration().Seconds() != float64(0) { + return sdkerrors.Wrap(ErrInvalidDuration, "both time and height are set") + } + if d.GetDuration() != nil && d.GetDuration().Seconds() < 0 { + return sdkerrors.Wrap(ErrInvalidDuration, "negative clock step") + } + return nil +} diff --git a/x/feegrant/types/expiration_test.go b/x/feegrant/types/expiration_test.go new file mode 100644 index 000000000..60b1753bc --- /dev/null +++ b/x/feegrant/types/expiration_test.go @@ -0,0 +1,161 @@ +package types_test + +import ( + "testing" + "time" + + "github.com/cosmos/cosmos-sdk/x/feegrant/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestExpiresAt(t *testing.T) { + now := time.Now() + + cases := map[string]struct { + example types.ExpiresAt + valid bool + zero bool + before types.ExpiresAt + after types.ExpiresAt + }{ + "basic": { + example: types.ExpiresAtHeight(100), + valid: true, + before: types.ExpiresAtHeight(50), + after: types.ExpiresAtHeight(122), + }, + "zero": { + example: types.ExpiresAt{}, + zero: true, + valid: true, + before: types.ExpiresAtHeight(1), + }, + "match height": { + example: types.ExpiresAtHeight(1000), + valid: true, + before: types.ExpiresAtHeight(999), + after: types.ExpiresAtHeight(1000), + }, + "match time": { + example: types.ExpiresAtTime(now), + valid: true, + before: types.ExpiresAtTime(now.Add(-1 * time.Second)), + after: types.ExpiresAtTime(now.Add(1 * time.Second)), + }, + } + + for name, stc := range cases { + tc := stc // to make scopelint happy + t.Run(name, func(t *testing.T) { + err := tc.example.ValidateBasic() + assert.Equal(t, tc.zero, tc.example.Undefined()) + if !tc.valid { + require.Error(t, err) + return + } + require.NoError(t, err) + + if !tc.before.Undefined() { + assert.Equal(t, false, tc.example.IsExpired(tc.before.GetTime(), tc.before.GetHeight())) + } + if !tc.after.Undefined() { + assert.Equal(t, true, tc.example.IsExpired(tc.after.GetTime(), tc.after.GetHeight())) + } + }) + } +} + +func TestDurationValid(t *testing.T) { + now := time.Now() + + cases := map[string]struct { + period types.Duration + valid bool + compatible types.ExpiresAt + incompatible types.ExpiresAt + }{ + "basic height": { + period: types.BlockDuration(100), + valid: true, + compatible: types.ExpiresAtHeight(50), + incompatible: types.ExpiresAtTime(now), + }, + "basic time": { + period: types.ClockDuration(time.Hour), + valid: true, + compatible: types.ExpiresAtTime(now), + incompatible: types.ExpiresAtHeight(50), + }, + "zero": { + period: types.Duration{}, + valid: false, + }, + "negative clock": { + period: types.ClockDuration(-1 * time.Hour), + valid: false, + }, + } + + for name, stc := range cases { + tc := stc // to make scopelint happy + t.Run(name, func(t *testing.T) { + err := tc.period.ValidateBasic() + if !tc.valid { + require.Error(t, err) + return + } + require.NoError(t, err) + + assert.Equal(t, true, tc.compatible.IsCompatible(tc.period)) + assert.Equal(t, false, tc.incompatible.IsCompatible(tc.period)) + }) + } +} + +func TestDurationStep(t *testing.T) { + now := time.Now() + + cases := map[string]struct { + expires types.ExpiresAt + period types.Duration + valid bool + result types.ExpiresAt + }{ + "add height": { + expires: types.ExpiresAtHeight(789), + period: types.BlockDuration(100), + valid: true, + result: types.ExpiresAtHeight(889), + }, + "add time": { + expires: types.ExpiresAtTime(now), + period: types.ClockDuration(time.Hour), + valid: true, + result: types.ExpiresAtTime(now.Add(time.Hour)), + }, + "mismatch": { + expires: types.ExpiresAtHeight(789), + period: types.ClockDuration(time.Hour), + valid: false, + }, + } + + for name, stc := range cases { + tc := stc // to make scopelint happy + t.Run(name, func(t *testing.T) { + err := tc.period.ValidateBasic() + require.NoError(t, err) + err = tc.expires.ValidateBasic() + require.NoError(t, err) + + next, err := tc.expires.Step(tc.period) + if !tc.valid { + require.Error(t, err) + return + } + require.NoError(t, err) + require.Equal(t, tc.result, next) + }) + } +} diff --git a/x/feegrant/types/feegrant.pb.go b/x/feegrant/types/feegrant.pb.go new file mode 100644 index 000000000..2897bcc39 --- /dev/null +++ b/x/feegrant/types/feegrant.pb.go @@ -0,0 +1,1701 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/feegrant/v1beta1/feegrant.proto + +package types + +import ( + fmt "fmt" + types1 "github.com/cosmos/cosmos-sdk/codec/types" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "github.com/golang/protobuf/ptypes/duration" + _ "github.com/golang/protobuf/ptypes/timestamp" + _ "github.com/regen-network/cosmos-proto" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// BasicFeeAllowance implements FeeAllowance with a one-time grant of tokens +// that optionally expires. The delegatee can use up to SpendLimit to cover fees. +type BasicFeeAllowance struct { + // 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. + SpendLimit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=spend_limit,json=spendLimit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"spend_limit"` + // expiration specifies an optional time when this allowance expires + Expiration ExpiresAt `protobuf:"bytes,2,opt,name=expiration,proto3" json:"expiration"` +} + +func (m *BasicFeeAllowance) Reset() { *m = BasicFeeAllowance{} } +func (m *BasicFeeAllowance) String() string { return proto.CompactTextString(m) } +func (*BasicFeeAllowance) ProtoMessage() {} +func (*BasicFeeAllowance) Descriptor() ([]byte, []int) { + return fileDescriptor_7279582900c30aea, []int{0} +} +func (m *BasicFeeAllowance) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BasicFeeAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BasicFeeAllowance.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BasicFeeAllowance) XXX_Merge(src proto.Message) { + xxx_messageInfo_BasicFeeAllowance.Merge(m, src) +} +func (m *BasicFeeAllowance) XXX_Size() int { + return m.Size() +} +func (m *BasicFeeAllowance) XXX_DiscardUnknown() { + xxx_messageInfo_BasicFeeAllowance.DiscardUnknown(m) +} + +var xxx_messageInfo_BasicFeeAllowance proto.InternalMessageInfo + +func (m *BasicFeeAllowance) GetSpendLimit() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.SpendLimit + } + return nil +} + +func (m *BasicFeeAllowance) GetExpiration() ExpiresAt { + if m != nil { + return m.Expiration + } + return ExpiresAt{} +} + +// PeriodicFeeAllowance extends FeeAllowance to allow for both a maximum cap, +// as well as a limit per time period. +type PeriodicFeeAllowance struct { + // basic specifies a struct of `BasicFeeAllowance` + Basic BasicFeeAllowance `protobuf:"bytes,1,opt,name=basic,proto3" json:"basic"` + // period specifies the time duration in which period_spend_limit coins can + // be spent before that allowance is reset + Period Duration `protobuf:"bytes,2,opt,name=period,proto3" json:"period"` + // period_spend_limit specifies the maximum number of coins that can be spent + // in the period + PeriodSpendLimit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=period_spend_limit,json=periodSpendLimit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"period_spend_limit"` + // period_can_spend is the number of coins left to be spent before the period_reset time + PeriodCanSpend github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,4,rep,name=period_can_spend,json=periodCanSpend,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"period_can_spend"` + // 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 + PeriodReset ExpiresAt `protobuf:"bytes,5,opt,name=period_reset,json=periodReset,proto3" json:"period_reset"` +} + +func (m *PeriodicFeeAllowance) Reset() { *m = PeriodicFeeAllowance{} } +func (m *PeriodicFeeAllowance) String() string { return proto.CompactTextString(m) } +func (*PeriodicFeeAllowance) ProtoMessage() {} +func (*PeriodicFeeAllowance) Descriptor() ([]byte, []int) { + return fileDescriptor_7279582900c30aea, []int{1} +} +func (m *PeriodicFeeAllowance) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PeriodicFeeAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PeriodicFeeAllowance.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PeriodicFeeAllowance) XXX_Merge(src proto.Message) { + xxx_messageInfo_PeriodicFeeAllowance.Merge(m, src) +} +func (m *PeriodicFeeAllowance) XXX_Size() int { + return m.Size() +} +func (m *PeriodicFeeAllowance) XXX_DiscardUnknown() { + xxx_messageInfo_PeriodicFeeAllowance.DiscardUnknown(m) +} + +var xxx_messageInfo_PeriodicFeeAllowance proto.InternalMessageInfo + +func (m *PeriodicFeeAllowance) GetBasic() BasicFeeAllowance { + if m != nil { + return m.Basic + } + return BasicFeeAllowance{} +} + +func (m *PeriodicFeeAllowance) GetPeriod() Duration { + if m != nil { + return m.Period + } + return Duration{} +} + +func (m *PeriodicFeeAllowance) GetPeriodSpendLimit() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.PeriodSpendLimit + } + return nil +} + +func (m *PeriodicFeeAllowance) GetPeriodCanSpend() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.PeriodCanSpend + } + return nil +} + +func (m *PeriodicFeeAllowance) GetPeriodReset() ExpiresAt { + if m != nil { + return m.PeriodReset + } + return ExpiresAt{} +} + +// Duration is a span of a clock time or number of blocks. +// This is designed to be added to an ExpiresAt struct. +type Duration struct { + // sum is the oneof that represents either duration or block + // + // Types that are valid to be assigned to Sum: + // *Duration_Duration + // *Duration_Blocks + Sum isDuration_Sum `protobuf_oneof:"sum"` +} + +func (m *Duration) Reset() { *m = Duration{} } +func (m *Duration) String() string { return proto.CompactTextString(m) } +func (*Duration) ProtoMessage() {} +func (*Duration) Descriptor() ([]byte, []int) { + return fileDescriptor_7279582900c30aea, []int{2} +} +func (m *Duration) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Duration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Duration.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Duration) XXX_Merge(src proto.Message) { + xxx_messageInfo_Duration.Merge(m, src) +} +func (m *Duration) XXX_Size() int { + return m.Size() +} +func (m *Duration) XXX_DiscardUnknown() { + xxx_messageInfo_Duration.DiscardUnknown(m) +} + +var xxx_messageInfo_Duration proto.InternalMessageInfo + +type isDuration_Sum interface { + isDuration_Sum() + MarshalTo([]byte) (int, error) + Size() int +} + +type Duration_Duration struct { + Duration *time.Duration `protobuf:"bytes,1,opt,name=duration,proto3,oneof,stdduration" json:"duration,omitempty"` +} +type Duration_Blocks struct { + Blocks uint64 `protobuf:"varint,2,opt,name=blocks,proto3,oneof" json:"blocks,omitempty"` +} + +func (*Duration_Duration) isDuration_Sum() {} +func (*Duration_Blocks) isDuration_Sum() {} + +func (m *Duration) GetSum() isDuration_Sum { + if m != nil { + return m.Sum + } + return nil +} + +func (m *Duration) GetDuration() *time.Duration { + if x, ok := m.GetSum().(*Duration_Duration); ok { + return x.Duration + } + return nil +} + +func (m *Duration) GetBlocks() uint64 { + if x, ok := m.GetSum().(*Duration_Blocks); ok { + return x.Blocks + } + return 0 +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Duration) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Duration_Duration)(nil), + (*Duration_Blocks)(nil), + } +} + +// ExpiresAt is a point in time where something expires. +// It may be *either* block time or block height +type ExpiresAt struct { + // sum is the oneof that represents either time or height + // + // Types that are valid to be assigned to Sum: + // *ExpiresAt_Time + // *ExpiresAt_Height + Sum isExpiresAt_Sum `protobuf_oneof:"sum"` +} + +func (m *ExpiresAt) Reset() { *m = ExpiresAt{} } +func (m *ExpiresAt) String() string { return proto.CompactTextString(m) } +func (*ExpiresAt) ProtoMessage() {} +func (*ExpiresAt) Descriptor() ([]byte, []int) { + return fileDescriptor_7279582900c30aea, []int{3} +} +func (m *ExpiresAt) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExpiresAt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ExpiresAt.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ExpiresAt) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExpiresAt.Merge(m, src) +} +func (m *ExpiresAt) XXX_Size() int { + return m.Size() +} +func (m *ExpiresAt) XXX_DiscardUnknown() { + xxx_messageInfo_ExpiresAt.DiscardUnknown(m) +} + +var xxx_messageInfo_ExpiresAt proto.InternalMessageInfo + +type isExpiresAt_Sum interface { + isExpiresAt_Sum() + MarshalTo([]byte) (int, error) + Size() int +} + +type ExpiresAt_Time struct { + Time *time.Time `protobuf:"bytes,1,opt,name=time,proto3,oneof,stdtime" json:"time,omitempty"` +} +type ExpiresAt_Height struct { + Height int64 `protobuf:"varint,2,opt,name=height,proto3,oneof" json:"height,omitempty"` +} + +func (*ExpiresAt_Time) isExpiresAt_Sum() {} +func (*ExpiresAt_Height) isExpiresAt_Sum() {} + +func (m *ExpiresAt) GetSum() isExpiresAt_Sum { + if m != nil { + return m.Sum + } + return nil +} + +func (m *ExpiresAt) GetTime() *time.Time { + if x, ok := m.GetSum().(*ExpiresAt_Time); ok { + return x.Time + } + return nil +} + +func (m *ExpiresAt) GetHeight() int64 { + if x, ok := m.GetSum().(*ExpiresAt_Height); ok { + return x.Height + } + return 0 +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*ExpiresAt) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*ExpiresAt_Time)(nil), + (*ExpiresAt_Height)(nil), + } +} + +// FeeAllowanceGrant is stored in the KVStore to record a grant with full context +type FeeAllowanceGrant struct { + Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` + Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` + Allowance *types1.Any `protobuf:"bytes,3,opt,name=allowance,proto3" json:"allowance,omitempty"` +} + +func (m *FeeAllowanceGrant) Reset() { *m = FeeAllowanceGrant{} } +func (m *FeeAllowanceGrant) String() string { return proto.CompactTextString(m) } +func (*FeeAllowanceGrant) ProtoMessage() {} +func (*FeeAllowanceGrant) Descriptor() ([]byte, []int) { + return fileDescriptor_7279582900c30aea, []int{4} +} +func (m *FeeAllowanceGrant) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FeeAllowanceGrant) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FeeAllowanceGrant.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *FeeAllowanceGrant) XXX_Merge(src proto.Message) { + xxx_messageInfo_FeeAllowanceGrant.Merge(m, src) +} +func (m *FeeAllowanceGrant) XXX_Size() int { + return m.Size() +} +func (m *FeeAllowanceGrant) XXX_DiscardUnknown() { + xxx_messageInfo_FeeAllowanceGrant.DiscardUnknown(m) +} + +var xxx_messageInfo_FeeAllowanceGrant proto.InternalMessageInfo + +func (m *FeeAllowanceGrant) GetGranter() string { + if m != nil { + return m.Granter + } + return "" +} + +func (m *FeeAllowanceGrant) GetGrantee() string { + if m != nil { + return m.Grantee + } + return "" +} + +func (m *FeeAllowanceGrant) GetAllowance() *types1.Any { + if m != nil { + return m.Allowance + } + return nil +} + +func init() { + proto.RegisterType((*BasicFeeAllowance)(nil), "cosmos.feegrant.v1beta1.BasicFeeAllowance") + proto.RegisterType((*PeriodicFeeAllowance)(nil), "cosmos.feegrant.v1beta1.PeriodicFeeAllowance") + proto.RegisterType((*Duration)(nil), "cosmos.feegrant.v1beta1.Duration") + proto.RegisterType((*ExpiresAt)(nil), "cosmos.feegrant.v1beta1.ExpiresAt") + proto.RegisterType((*FeeAllowanceGrant)(nil), "cosmos.feegrant.v1beta1.FeeAllowanceGrant") +} + +func init() { + proto.RegisterFile("cosmos/feegrant/v1beta1/feegrant.proto", fileDescriptor_7279582900c30aea) +} + +var fileDescriptor_7279582900c30aea = []byte{ + // 599 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0x4f, 0x6e, 0xd3, 0x40, + 0x14, 0xc6, 0x6d, 0x9c, 0x96, 0x76, 0x02, 0x88, 0x8c, 0x22, 0xe1, 0x64, 0xe1, 0x94, 0x2c, 0x50, + 0x84, 0x14, 0x9b, 0x16, 0x89, 0x05, 0x12, 0x42, 0x71, 0x69, 0x1b, 0x04, 0x0b, 0x64, 0x58, 0xb1, + 0x89, 0x6c, 0x67, 0xea, 0x0c, 0xb5, 0x3d, 0x96, 0x67, 0x02, 0xcd, 0x25, 0x50, 0x97, 0x9c, 0x81, + 0x35, 0x87, 0xa8, 0x58, 0x55, 0xac, 0x58, 0xb5, 0x28, 0x39, 0x01, 0x37, 0x40, 0xf3, 0xc7, 0x4e, + 0x94, 0x10, 0x24, 0xa4, 0xae, 0xe2, 0x99, 0x79, 0xef, 0xfb, 0xbd, 0xf7, 0xbd, 0x99, 0x80, 0x07, + 0x21, 0xa1, 0x09, 0xa1, 0xce, 0x31, 0x42, 0x51, 0xee, 0xa7, 0xcc, 0xf9, 0xb8, 0x1b, 0x20, 0xe6, + 0xef, 0x96, 0x1b, 0x76, 0x96, 0x13, 0x46, 0xe0, 0x3d, 0x19, 0x67, 0x97, 0xdb, 0x2a, 0xae, 0x59, + 0x8f, 0x48, 0x44, 0x44, 0x8c, 0xc3, 0xbf, 0x64, 0x78, 0xb3, 0x11, 0x11, 0x12, 0xc5, 0xc8, 0x11, + 0xab, 0x60, 0x7c, 0xec, 0xf8, 0xe9, 0xa4, 0x38, 0x92, 0x4a, 0x03, 0x99, 0xa3, 0x64, 0xe5, 0x91, + 0xa5, 0x8a, 0x09, 0x7c, 0x8a, 0xca, 0x42, 0x42, 0x82, 0x53, 0x75, 0xde, 0x5a, 0x56, 0x65, 0x38, + 0x41, 0x94, 0xf9, 0x49, 0x56, 0x08, 0x2c, 0x07, 0x0c, 0xc7, 0xb9, 0xcf, 0x30, 0x51, 0x02, 0xed, + 0x4b, 0x1d, 0xd4, 0x5c, 0x9f, 0xe2, 0xf0, 0x10, 0xa1, 0x5e, 0x1c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, 0x31, 0xb3, 0xb4, 0x9f, 0x33, 0x4b, 0x7b, 0xdf, 0xfd, 0xe7, 0xb5, 0x38, 0x9d, + 0xff, 0xaf, 0x8a, 0x1b, 0x12, 0x6c, 0x0a, 0xe8, 0xe3, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x74, + 0x27, 0xe6, 0x00, 0x77, 0x05, 0x00, 0x00, +} + +func (m *BasicFeeAllowance) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BasicFeeAllowance) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BasicFeeAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Expiration.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFeegrant(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.SpendLimit) > 0 { + for iNdEx := len(m.SpendLimit) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SpendLimit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFeegrant(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *PeriodicFeeAllowance) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PeriodicFeeAllowance) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PeriodicFeeAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.PeriodReset.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFeegrant(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + if len(m.PeriodCanSpend) > 0 { + for iNdEx := len(m.PeriodCanSpend) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PeriodCanSpend[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFeegrant(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.PeriodSpendLimit) > 0 { + for iNdEx := len(m.PeriodSpendLimit) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PeriodSpendLimit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFeegrant(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + { + size, err := m.Period.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFeegrant(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + { + size, err := m.Basic.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFeegrant(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Duration) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Duration) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Duration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *Duration_Duration) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Duration_Duration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Duration != nil { + n5, err5 := github_com_gogo_protobuf_types.StdDurationMarshalTo(*m.Duration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(*m.Duration):]) + if err5 != nil { + return 0, err5 + } + i -= n5 + i = encodeVarintFeegrant(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *Duration_Blocks) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Duration_Blocks) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintFeegrant(dAtA, i, uint64(m.Blocks)) + i-- + dAtA[i] = 0x10 + return len(dAtA) - i, nil +} +func (m *ExpiresAt) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ExpiresAt) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExpiresAt) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Sum != nil { + { + size := m.Sum.Size() + i -= size + if _, err := m.Sum.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *ExpiresAt_Time) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExpiresAt_Time) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Time != nil { + n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Time, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.Time):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintFeegrant(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *ExpiresAt_Height) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExpiresAt_Height) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintFeegrant(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x10 + return len(dAtA) - i, nil +} +func (m *FeeAllowanceGrant) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FeeAllowanceGrant) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FeeAllowanceGrant) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Allowance != nil { + { + size, err := m.Allowance.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFeegrant(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Grantee) > 0 { + i -= len(m.Grantee) + copy(dAtA[i:], m.Grantee) + i = encodeVarintFeegrant(dAtA, i, uint64(len(m.Grantee))) + i-- + dAtA[i] = 0x12 + } + if len(m.Granter) > 0 { + i -= len(m.Granter) + copy(dAtA[i:], m.Granter) + i = encodeVarintFeegrant(dAtA, i, uint64(len(m.Granter))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintFeegrant(dAtA []byte, offset int, v uint64) int { + offset -= sovFeegrant(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *BasicFeeAllowance) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.SpendLimit) > 0 { + for _, e := range m.SpendLimit { + l = e.Size() + n += 1 + l + sovFeegrant(uint64(l)) + } + } + l = m.Expiration.Size() + n += 1 + l + sovFeegrant(uint64(l)) + return n +} + +func (m *PeriodicFeeAllowance) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Basic.Size() + n += 1 + l + sovFeegrant(uint64(l)) + l = m.Period.Size() + n += 1 + l + sovFeegrant(uint64(l)) + if len(m.PeriodSpendLimit) > 0 { + for _, e := range m.PeriodSpendLimit { + l = e.Size() + n += 1 + l + sovFeegrant(uint64(l)) + } + } + if len(m.PeriodCanSpend) > 0 { + for _, e := range m.PeriodCanSpend { + l = e.Size() + n += 1 + l + sovFeegrant(uint64(l)) + } + } + l = m.PeriodReset.Size() + n += 1 + l + sovFeegrant(uint64(l)) + return n +} + +func (m *Duration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sum != nil { + n += m.Sum.Size() + } + return n +} + +func (m *Duration_Duration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Duration != nil { + l = github_com_gogo_protobuf_types.SizeOfStdDuration(*m.Duration) + n += 1 + l + sovFeegrant(uint64(l)) + } + return n +} +func (m *Duration_Blocks) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovFeegrant(uint64(m.Blocks)) + return n +} +func (m *ExpiresAt) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Sum != nil { + n += m.Sum.Size() + } + return n +} + +func (m *ExpiresAt_Time) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Time != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.Time) + n += 1 + l + sovFeegrant(uint64(l)) + } + return n +} +func (m *ExpiresAt_Height) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovFeegrant(uint64(m.Height)) + return n +} +func (m *FeeAllowanceGrant) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Granter) + if l > 0 { + n += 1 + l + sovFeegrant(uint64(l)) + } + l = len(m.Grantee) + if l > 0 { + n += 1 + l + sovFeegrant(uint64(l)) + } + if m.Allowance != nil { + l = m.Allowance.Size() + n += 1 + l + sovFeegrant(uint64(l)) + } + return n +} + +func sovFeegrant(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozFeegrant(x uint64) (n int) { + return sovFeegrant(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *BasicFeeAllowance) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BasicFeeAllowance: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BasicFeeAllowance: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpendLimit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFeegrant + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SpendLimit = append(m.SpendLimit, types.Coin{}) + if err := m.SpendLimit[len(m.SpendLimit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFeegrant + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Expiration.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipFeegrant(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFeegrant + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PeriodicFeeAllowance) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PeriodicFeeAllowance: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PeriodicFeeAllowance: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Basic", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFeegrant + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Basic.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Period", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFeegrant + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Period.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PeriodSpendLimit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFeegrant + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PeriodSpendLimit = append(m.PeriodSpendLimit, types.Coin{}) + if err := m.PeriodSpendLimit[len(m.PeriodSpendLimit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PeriodCanSpend", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFeegrant + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PeriodCanSpend = append(m.PeriodCanSpend, types.Coin{}) + if err := m.PeriodCanSpend[len(m.PeriodCanSpend)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PeriodReset", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFeegrant + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PeriodReset.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipFeegrant(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFeegrant + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Duration) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Duration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Duration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFeegrant + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := new(time.Duration) + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(v, dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &Duration_Duration{v} + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Blocks", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Sum = &Duration_Blocks{v} + default: + iNdEx = preIndex + skippy, err := skipFeegrant(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFeegrant + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ExpiresAt) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ExpiresAt: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExpiresAt: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFeegrant + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := new(time.Time) + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(v, dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Sum = &ExpiresAt_Time{v} + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Sum = &ExpiresAt_Height{v} + default: + iNdEx = preIndex + skippy, err := skipFeegrant(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFeegrant + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FeeAllowanceGrant) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FeeAllowanceGrant: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FeeAllowanceGrant: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Granter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthFeegrant + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Granter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grantee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthFeegrant + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Grantee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Allowance", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFeegrant + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFeegrant + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFeegrant + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Allowance == nil { + m.Allowance = &types1.Any{} + } + if err := m.Allowance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipFeegrant(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFeegrant + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipFeegrant(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowFeegrant + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowFeegrant + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowFeegrant + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthFeegrant + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupFeegrant + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthFeegrant + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthFeegrant = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowFeegrant = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupFeegrant = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/feegrant/types/fees.go b/x/feegrant/types/fees.go new file mode 100644 index 000000000..cc526628f --- /dev/null +++ b/x/feegrant/types/fees.go @@ -0,0 +1,32 @@ +package types + +import ( + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// FeeAllowance implementations are tied to a given fee delegator and delegatee, +// and are used to enforce fee grant limits. +type FeeAllowanceI interface { + // Accept can use fee payment requested as well as timestamp/height of the current block + // to determine whether or not to process this. This is checked in + // Keeper.UseGrantedFees and the return values should match how it is handled there. + // + // If it returns an error, the fee payment is rejected, otherwise it is accepted. + // The FeeAllowance implementation is expected to update it's internal state + // and will be saved again after an acceptance. + // + // If remove is true (regardless of the error), the FeeAllowance will be deleted from storage + // (eg. when it is used up). (See call to RevokeFeeAllowance in Keeper.UseGrantedFees) + Accept(fee sdk.Coins, blockTime time.Time, blockHeight int64) (remove bool, err error) + + // If we export fee allowances the timing info will be quite off (eg. go from height 100000 to 0) + // This callback allows the fee-allowance to change it's state and return a copy that is adjusted + // given the time and height of the actual dump (may safely return self if no changes needed) + PrepareForExport(dumpTime time.Time, dumpHeight int64) FeeAllowanceI + + // ValidateBasic should evaluate this FeeAllowance for internal consistency. + // Don't allow negative amounts, or negative periods for example. + ValidateBasic() error +} diff --git a/x/feegrant/types/genesis.go b/x/feegrant/types/genesis.go new file mode 100644 index 000000000..57ade9b43 --- /dev/null +++ b/x/feegrant/types/genesis.go @@ -0,0 +1,40 @@ +package types + +import "github.com/cosmos/cosmos-sdk/codec/types" + +var _ types.UnpackInterfacesMessage = GenesisState{} + +// NewGenesisState creates new GenesisState object +func NewGenesisState(entries []FeeAllowanceGrant) *GenesisState { + return &GenesisState{ + FeeAllowances: entries, + } +} + +// ValidateGenesis ensures all grants in the genesis state are valid +func ValidateGenesis(data GenesisState) error { + for _, f := range data.FeeAllowances { + err := f.GetFeeGrant().ValidateBasic() + if err != nil { + return err + } + } + return nil +} + +// DefaultGenesisState returns default state for feegrant module. +func DefaultGenesisState() *GenesisState { + return &GenesisState{} +} + +// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces +func (data GenesisState) UnpackInterfaces(unpacker types.AnyUnpacker) error { + for _, f := range data.FeeAllowances { + err := f.UnpackInterfaces(unpacker) + if err != nil { + return err + } + } + + return nil +} diff --git a/x/feegrant/types/genesis.pb.go b/x/feegrant/types/genesis.pb.go new file mode 100644 index 000000000..499f57d62 --- /dev/null +++ b/x/feegrant/types/genesis.pb.go @@ -0,0 +1,333 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/feegrant/v1beta1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState contains a set of fee allowances, persisted from the store +type GenesisState struct { + FeeAllowances []FeeAllowanceGrant `protobuf:"bytes,1,rep,name=fee_allowances,json=feeAllowances,proto3" json:"fee_allowances"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_ac719d2d0954d1bf, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetFeeAllowances() []FeeAllowanceGrant { + if m != nil { + return m.FeeAllowances + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "cosmos.feegrant.v1beta1.GenesisState") +} + +func init() { + proto.RegisterFile("cosmos/feegrant/v1beta1/genesis.proto", fileDescriptor_ac719d2d0954d1bf) +} + +var fileDescriptor_ac719d2d0954d1bf = []byte{ + // 221 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 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f0, 0x42, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0xd8, 0xe1, 0xc6, 0x80, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xaf, 0x53, 0x6e, 0xc5, 0x38, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.FeeAllowances) > 0 { + for iNdEx := len(m.FeeAllowances) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FeeAllowances[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.FeeAllowances) > 0 { + for _, e := range m.FeeAllowances { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeAllowances", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeeAllowances = append(m.FeeAllowances, FeeAllowanceGrant{}) + if err := m.FeeAllowances[len(m.FeeAllowances)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/feegrant/types/grant.go b/x/feegrant/types/grant.go new file mode 100644 index 000000000..ca2c93d9e --- /dev/null +++ b/x/feegrant/types/grant.go @@ -0,0 +1,92 @@ +package types + +import ( + "time" + + "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + proto "github.com/gogo/protobuf/proto" +) + +var ( + _ types.UnpackInterfacesMessage = &FeeAllowanceGrant{} +) + +// NewFeeAllowanceGrant creates a new FeeAllowanceGrant. +//nolint:interfacer +func NewFeeAllowanceGrant(granter, grantee sdk.AccAddress, feeAllowance FeeAllowanceI) (FeeAllowanceGrant, error) { + msg, ok := feeAllowance.(proto.Message) + if !ok { + return FeeAllowanceGrant{}, sdkerrors.Wrapf(sdkerrors.ErrPackAny, "cannot proto marshal %T", feeAllowance) + } + + any, err := types.NewAnyWithValue(msg) + if err != nil { + return FeeAllowanceGrant{}, err + } + + return FeeAllowanceGrant{ + Granter: granter.String(), + Grantee: grantee.String(), + Allowance: any, + }, nil +} + +// ValidateBasic performs basic validation on +// FeeAllowanceGrant +func (a FeeAllowanceGrant) ValidateBasic() error { + if a.Granter == "" { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "missing granter address") + } + if a.Grantee == "" { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "missing grantee address") + } + if a.Grantee == a.Granter { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "cannot self-grant fee authorization") + } + + return a.GetFeeGrant().ValidateBasic() +} + +// GetFeeGrant unpacks allowance +func (a FeeAllowanceGrant) GetFeeGrant() FeeAllowanceI { + allowance, ok := a.Allowance.GetCachedValue().(FeeAllowanceI) + if !ok { + return nil + } + + return allowance +} + +// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces +func (a FeeAllowanceGrant) UnpackInterfaces(unpacker types.AnyUnpacker) error { + var allowance FeeAllowanceI + return unpacker.UnpackAny(a.Allowance, &allowance) +} + +// PrepareForExport will make all needed changes to the allowance to prepare to be +// re-imported at height 0, and return a copy of this grant. +func (a FeeAllowanceGrant) PrepareForExport(dumpTime time.Time, dumpHeight int64) FeeAllowanceGrant { + feegrant := a.GetFeeGrant().PrepareForExport(dumpTime, dumpHeight) + if feegrant == nil { + return FeeAllowanceGrant{} + } + + granter, err := sdk.AccAddressFromBech32(a.Granter) + if err != nil { + return FeeAllowanceGrant{} + } + + grantee, err := sdk.AccAddressFromBech32(a.Grantee) + if err != nil { + return FeeAllowanceGrant{} + } + + grant, err := NewFeeAllowanceGrant(granter, grantee, feegrant) + if err != nil { + return FeeAllowanceGrant{} + } + + return grant +} diff --git a/x/feegrant/types/grant_test.go b/x/feegrant/types/grant_test.go new file mode 100644 index 000000000..a4819b102 --- /dev/null +++ b/x/feegrant/types/grant_test.go @@ -0,0 +1,99 @@ +package types_test + +import ( + "testing" + + "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/feegrant/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestGrant(t *testing.T) { + app := simapp.Setup(false) + addr, err := sdk.AccAddressFromBech32("cosmos1qk93t4j0yyzgqgt6k5qf8deh8fq6smpn3ntu3x") + require.NoError(t, err) + addr2, err := sdk.AccAddressFromBech32("cosmos1p9qh4ldfd6n0qehujsal4k7g0e37kel90rc4ts") + require.NoError(t, err) + atom := sdk.NewCoins(sdk.NewInt64Coin("atom", 555)) + + goodGrant, err := types.NewFeeAllowanceGrant(addr2, addr, &types.BasicFeeAllowance{ + SpendLimit: atom, + Expiration: types.ExpiresAtHeight(100), + }) + require.NoError(t, err) + + noGranteeGrant, err := types.NewFeeAllowanceGrant(addr2, nil, &types.BasicFeeAllowance{ + SpendLimit: atom, + Expiration: types.ExpiresAtHeight(100), + }) + require.NoError(t, err) + + noGranterGrant, err := types.NewFeeAllowanceGrant(nil, addr, &types.BasicFeeAllowance{ + SpendLimit: atom, + Expiration: types.ExpiresAtHeight(100), + }) + require.NoError(t, err) + + selfGrant, err := types.NewFeeAllowanceGrant(addr2, addr2, &types.BasicFeeAllowance{ + SpendLimit: atom, + Expiration: types.ExpiresAtHeight(100), + }) + require.NoError(t, err) + + badAllowanceGrant, err := types.NewFeeAllowanceGrant(addr2, addr, &types.BasicFeeAllowance{ + SpendLimit: atom, + Expiration: types.ExpiresAtHeight(-1), + }) + require.NoError(t, err) + + cdc := app.AppCodec() + // RegisterLegacyAminoCodec(cdc) + + cases := map[string]struct { + grant types.FeeAllowanceGrant + valid bool + }{ + "good": { + grant: goodGrant, + valid: true, + }, + "no grantee": { + grant: noGranteeGrant, + }, + "no granter": { + grant: noGranterGrant, + }, + "self-grant": { + grant: selfGrant, + }, + "bad allowance": { + grant: badAllowanceGrant, + }, + } + + for name, tc := range cases { + tc := tc + t.Run(name, func(t *testing.T) { + err := tc.grant.ValidateBasic() + if !tc.valid { + require.Error(t, err) + return + } + require.NoError(t, err) + + // if it is valid, let's try to serialize, deserialize, and make sure it matches + bz, err := cdc.MarshalBinaryBare(&tc.grant) + require.NoError(t, err) + var loaded types.FeeAllowanceGrant + err = cdc.UnmarshalBinaryBare(bz, &loaded) + require.NoError(t, err) + + err = loaded.ValidateBasic() + require.NoError(t, err) + + assert.Equal(t, tc.grant, loaded) + }) + } +} diff --git a/x/feegrant/types/key.go b/x/feegrant/types/key.go new file mode 100644 index 000000000..e30427b13 --- /dev/null +++ b/x/feegrant/types/key.go @@ -0,0 +1,35 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +const ( + // ModuleName is the module name constant used in many places + ModuleName = "feegrant" + + // StoreKey is the store key string for supply + StoreKey = ModuleName + + // RouterKey is the message route for supply + RouterKey = ModuleName + + // QuerierRoute is the querier route for supply + QuerierRoute = ModuleName +) + +var ( + // FeeAllowanceKeyPrefix is the set of the kvstore for fee allowance data + FeeAllowanceKeyPrefix = []byte{0x00} +) + +// FeeAllowanceKey is the canonical key to store a grant from granter to grantee +// We store by grantee first to allow searching by everyone who granted to you +func FeeAllowanceKey(granter sdk.AccAddress, grantee sdk.AccAddress) []byte { + return append(append(FeeAllowanceKeyPrefix, grantee.Bytes()...), granter.Bytes()...) +} + +// FeeAllowancePrefixByGrantee returns a prefix to scan for all grants to this given address. +func FeeAllowancePrefixByGrantee(grantee sdk.AccAddress) []byte { + return append(FeeAllowanceKeyPrefix, grantee.Bytes()...) +} diff --git a/x/feegrant/types/msgs.go b/x/feegrant/types/msgs.go new file mode 100644 index 000000000..5a25016f8 --- /dev/null +++ b/x/feegrant/types/msgs.go @@ -0,0 +1,101 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/gogo/protobuf/proto" +) + +var ( + _, _ sdk.MsgRequest = &MsgGrantFeeAllowance{}, &MsgRevokeFeeAllowance{} + _ types.UnpackInterfacesMessage = &MsgGrantFeeAllowance{} +) + +// feegrant message types +const ( + TypeMsgGrantFeeAllowance = "grant_fee_allowance" + TypeMsgRevokeFeeAllowance = "revoke_fee_allowance" +) + +// NewMsgGrantFeeAllowance creates a new MsgGrantFeeAllowance. +//nolint:interfacer +func NewMsgGrantFeeAllowance(feeAllowance FeeAllowanceI, granter, grantee sdk.AccAddress) (*MsgGrantFeeAllowance, error) { + msg, ok := feeAllowance.(proto.Message) + if !ok { + return nil, sdkerrors.Wrapf(sdkerrors.ErrPackAny, "cannot proto marshal %T", msg) + } + any, err := types.NewAnyWithValue(msg) + if err != nil { + return nil, err + } + + return &MsgGrantFeeAllowance{ + Granter: granter.String(), + Grantee: grantee.String(), + Allowance: any, + }, nil +} + +// ValidateBasic implements the sdk.Msg interface. +func (msg MsgGrantFeeAllowance) ValidateBasic() error { + if msg.Granter == "" { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "missing granter address") + } + if msg.Grantee == "" { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "missing grantee address") + } + if msg.Grantee == msg.Granter { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "cannot self-grant fee authorization") + } + + return msg.GetFeeAllowanceI().ValidateBasic() +} + +func (msg MsgGrantFeeAllowance) GetSigners() []sdk.AccAddress { + granter, err := sdk.AccAddressFromBech32(msg.Granter) + if err != nil { + panic(err) + } + return []sdk.AccAddress{granter} +} + +// GetFeeAllowanceI returns unpacked FeeAllowance +func (msg MsgGrantFeeAllowance) GetFeeAllowanceI() FeeAllowanceI { + allowance, ok := msg.Allowance.GetCachedValue().(FeeAllowanceI) + if !ok { + return nil + } + + return allowance +} + +// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces +func (msg MsgGrantFeeAllowance) UnpackInterfaces(unpacker types.AnyUnpacker) error { + var allowance FeeAllowanceI + return unpacker.UnpackAny(msg.Allowance, &allowance) +} + +//nolint:interfacer +func NewMsgRevokeFeeAllowance(granter sdk.AccAddress, grantee sdk.AccAddress) MsgRevokeFeeAllowance { + return MsgRevokeFeeAllowance{Granter: granter.String(), Grantee: grantee.String()} +} + +func (msg MsgRevokeFeeAllowance) ValidateBasic() error { + if msg.Granter == "" { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "missing granter address") + } + if msg.Grantee == "" { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "missing grantee address") + } + + return nil +} + +func (msg MsgRevokeFeeAllowance) GetSigners() []sdk.AccAddress { + granter, err := sdk.AccAddressFromBech32(msg.Granter) + if err != nil { + panic(err) + } + return []sdk.AccAddress{granter} +} diff --git a/x/feegrant/types/periodic_fee.go b/x/feegrant/types/periodic_fee.go new file mode 100644 index 000000000..61c9ba2ff --- /dev/null +++ b/x/feegrant/types/periodic_fee.go @@ -0,0 +1,120 @@ +package types + +import ( + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ FeeAllowanceI = (*PeriodicFeeAllowance)(nil) + +// Accept can use fee payment requested as well as timestamp/height of the current block +// to determine whether or not to process this. This is checked in +// Keeper.UseGrantedFees and the return values should match how it is handled there. +// +// If it returns an error, the fee payment is rejected, otherwise it is accepted. +// The FeeAllowance implementation is expected to update it's internal state +// and will be saved again after an acceptance. +// +// If remove is true (regardless of the error), the FeeAllowance will be deleted from storage +// (eg. when it is used up). (See call to RevokeFeeAllowance in Keeper.UseGrantedFees) +func (a *PeriodicFeeAllowance) Accept(fee sdk.Coins, blockTime time.Time, blockHeight int64) (bool, error) { + if a.Basic.Expiration.IsExpired(&blockTime, blockHeight) { + return true, sdkerrors.Wrap(ErrFeeLimitExpired, "absolute limit") + } + + a.tryResetPeriod(blockTime, blockHeight) + + // deduct from both the current period and the max amount + var isNeg bool + a.PeriodCanSpend, isNeg = a.PeriodCanSpend.SafeSub(fee) + if isNeg { + return false, sdkerrors.Wrap(ErrFeeLimitExceeded, "period limit") + } + + if a.Basic.SpendLimit != nil { + a.Basic.SpendLimit, isNeg = a.Basic.SpendLimit.SafeSub(fee) + if isNeg { + return false, sdkerrors.Wrap(ErrFeeLimitExceeded, "absolute limit") + } + + return a.Basic.SpendLimit.IsZero(), nil + } + + return false, nil +} + +// tryResetPeriod will check if the PeriodReset has been hit. If not, it is a no-op. +// If we hit the reset period, it will top up the PeriodCanSpend amount to +// min(PeriodicSpendLimit, a.Basic.SpendLimit) so it is never more than the maximum allowed. +// It will also update the PeriodReset. If we are within one Period, it will update from the +// last PeriodReset (eg. if you always do one tx per day, it will always reset the same time) +// If we are more then one period out (eg. no activity in a week), reset is one Period from the execution of this method +func (a *PeriodicFeeAllowance) tryResetPeriod(blockTime time.Time, blockHeight int64) { + if !a.PeriodReset.Undefined() && !a.PeriodReset.IsExpired(&blockTime, blockHeight) { + return + } + // set CanSpend to the lesser of PeriodSpendLimit and the TotalLimit + if _, isNeg := a.Basic.SpendLimit.SafeSub(a.PeriodSpendLimit); isNeg { + a.PeriodCanSpend = a.Basic.SpendLimit + } else { + a.PeriodCanSpend = a.PeriodSpendLimit + } + + // If we are within the period, step from expiration (eg. if you always do one tx per day, it will always reset the same time) + // If we are more then one period out (eg. no activity in a week), reset is one period from this time + a.PeriodReset = a.PeriodReset.MustStep(a.Period) + if a.PeriodReset.IsExpired(&blockTime, blockHeight) { + a.PeriodReset = a.PeriodReset.FastForward(blockTime, blockHeight).MustStep(a.Period) + } +} + +// PrepareForExport will adjust the expiration based on export time. In particular, +// it will subtract the dumpHeight from any height-based expiration to ensure that +// the elapsed number of blocks this allowance is valid for is fixed. +// (For PeriodReset and Basic.Expiration) +func (a *PeriodicFeeAllowance) PrepareForExport(dumpTime time.Time, dumpHeight int64) FeeAllowanceI { + return &PeriodicFeeAllowance{ + Basic: BasicFeeAllowance{ + SpendLimit: a.Basic.SpendLimit, + Expiration: a.Basic.Expiration.PrepareForExport(dumpTime, dumpHeight), + }, + PeriodSpendLimit: a.PeriodSpendLimit, + PeriodCanSpend: a.PeriodCanSpend, + Period: a.Period, + PeriodReset: a.PeriodReset.PrepareForExport(dumpTime, dumpHeight), + } +} + +// ValidateBasic implements FeeAllowance and enforces basic sanity checks +func (a PeriodicFeeAllowance) ValidateBasic() error { + if err := a.Basic.ValidateBasic(); err != nil { + return err + } + + if !a.PeriodSpendLimit.IsValid() { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidCoins, "spend amount is invalid: %s", a.PeriodSpendLimit) + } + if !a.PeriodSpendLimit.IsAllPositive() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, "spend limit must be positive") + } + if !a.PeriodCanSpend.IsValid() { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidCoins, "can spend amount is invalid: %s", a.PeriodCanSpend) + } + // We allow 0 for CanSpend + if a.PeriodCanSpend.IsAnyNegative() { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, "can spend must not be negative") + } + + // ensure PeriodSpendLimit can be subtracted from total (same coin types) + if a.Basic.SpendLimit != nil && !a.PeriodSpendLimit.DenomsSubsetOf(a.Basic.SpendLimit) { + return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, "period spend limit has different currency than basic spend limit") + } + + // check times + if err := a.Period.ValidateBasic(); err != nil { + return err + } + return a.PeriodReset.ValidateBasic() +} diff --git a/x/feegrant/types/periodic_fee_test.go b/x/feegrant/types/periodic_fee_test.go new file mode 100644 index 000000000..cc54f4080 --- /dev/null +++ b/x/feegrant/types/periodic_fee_test.go @@ -0,0 +1,205 @@ +package types_test + +import ( + "testing" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/feegrant/types" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestPeriodicFeeValidAllow(t *testing.T) { + atom := sdk.NewCoins(sdk.NewInt64Coin("atom", 555)) + smallAtom := sdk.NewCoins(sdk.NewInt64Coin("atom", 43)) + leftAtom := sdk.NewCoins(sdk.NewInt64Coin("atom", 512)) + oneAtom := sdk.NewCoins(sdk.NewInt64Coin("atom", 1)) + eth := sdk.NewCoins(sdk.NewInt64Coin("eth", 1)) + + cases := map[string]struct { + allow types.PeriodicFeeAllowance + // all other checks are ignored if valid=false + fee sdk.Coins + blockTime time.Time + blockHeight int64 + valid bool + accept bool + remove bool + remains sdk.Coins + remainsPeriod sdk.Coins + periodReset types.ExpiresAt + }{ + "empty": { + allow: types.PeriodicFeeAllowance{}, + valid: false, + }, + "only basic": { + allow: types.PeriodicFeeAllowance{ + Basic: types.BasicFeeAllowance{ + SpendLimit: atom, + Expiration: types.ExpiresAtHeight(100), + }, + }, + valid: false, + }, + "empty basic": { + allow: types.PeriodicFeeAllowance{ + Period: types.BlockDuration(10), + PeriodSpendLimit: smallAtom, + PeriodReset: types.ExpiresAtHeight(70), + }, + blockHeight: 75, + valid: true, + accept: true, + remove: false, + periodReset: types.ExpiresAtHeight(80), + }, + "mismatched currencies": { + allow: types.PeriodicFeeAllowance{ + Basic: types.BasicFeeAllowance{ + SpendLimit: atom, + Expiration: types.ExpiresAtHeight(100), + }, + Period: types.BlockDuration(10), + PeriodSpendLimit: eth, + }, + valid: false, + }, + "first time": { + allow: types.PeriodicFeeAllowance{ + Basic: types.BasicFeeAllowance{ + SpendLimit: atom, + Expiration: types.ExpiresAtHeight(100), + }, + Period: types.BlockDuration(10), + PeriodSpendLimit: smallAtom, + }, + valid: true, + fee: smallAtom, + blockHeight: 75, + accept: true, + remove: false, + remainsPeriod: nil, + remains: leftAtom, + periodReset: types.ExpiresAtHeight(85), + }, + "same period": { + allow: types.PeriodicFeeAllowance{ + Basic: types.BasicFeeAllowance{ + SpendLimit: atom, + Expiration: types.ExpiresAtHeight(100), + }, + Period: types.BlockDuration(10), + PeriodReset: types.ExpiresAtHeight(80), + PeriodSpendLimit: leftAtom, + PeriodCanSpend: smallAtom, + }, + valid: true, + fee: smallAtom, + blockHeight: 75, + accept: true, + remove: false, + remainsPeriod: nil, + remains: leftAtom, + periodReset: types.ExpiresAtHeight(80), + }, + "step one period": { + allow: types.PeriodicFeeAllowance{ + Basic: types.BasicFeeAllowance{ + SpendLimit: atom, + Expiration: types.ExpiresAtHeight(100), + }, + Period: types.BlockDuration(10), + PeriodReset: types.ExpiresAtHeight(70), + PeriodSpendLimit: leftAtom, + }, + valid: true, + fee: leftAtom, + blockHeight: 75, + accept: true, + remove: false, + remainsPeriod: nil, + remains: smallAtom, + periodReset: types.ExpiresAtHeight(80), // one step from last reset, not now + }, + "step limited by global allowance": { + allow: types.PeriodicFeeAllowance{ + Basic: types.BasicFeeAllowance{ + SpendLimit: smallAtom, + Expiration: types.ExpiresAtHeight(100), + }, + Period: types.BlockDuration(10), + PeriodReset: types.ExpiresAtHeight(70), + PeriodSpendLimit: atom, + }, + valid: true, + fee: oneAtom, + blockHeight: 75, + accept: true, + remove: false, + remainsPeriod: smallAtom.Sub(oneAtom), + remains: smallAtom.Sub(oneAtom), + periodReset: types.ExpiresAtHeight(80), // one step from last reset, not now + }, + "expired": { + allow: types.PeriodicFeeAllowance{ + Basic: types.BasicFeeAllowance{ + SpendLimit: atom, + Expiration: types.ExpiresAtHeight(100), + }, + Period: types.BlockDuration(10), + PeriodSpendLimit: smallAtom, + }, + valid: true, + fee: smallAtom, + blockHeight: 101, + accept: false, + remove: true, + }, + "over period limit": { + allow: types.PeriodicFeeAllowance{ + Basic: types.BasicFeeAllowance{ + SpendLimit: atom, + Expiration: types.ExpiresAtHeight(100), + }, + Period: types.BlockDuration(10), + PeriodReset: types.ExpiresAtHeight(80), + PeriodSpendLimit: leftAtom, + PeriodCanSpend: smallAtom, + }, + valid: true, + fee: leftAtom, + blockHeight: 70, + accept: false, + remove: true, + }, + } + + for name, stc := range cases { + tc := stc // to make scopelint happy + t.Run(name, func(t *testing.T) { + err := tc.allow.ValidateBasic() + if !tc.valid { + require.Error(t, err) + return + } + require.NoError(t, err) + + // now try to deduct + remove, err := tc.allow.Accept(tc.fee, tc.blockTime, tc.blockHeight) + if !tc.accept { + require.Error(t, err) + return + } + require.NoError(t, err) + + require.Equal(t, tc.remove, remove) + if !remove { + assert.Equal(t, tc.remains, tc.allow.Basic.SpendLimit) + assert.Equal(t, tc.remainsPeriod, tc.allow.PeriodCanSpend) + assert.Equal(t, tc.periodReset, tc.allow.PeriodReset) + } + }) + } +} diff --git a/x/feegrant/types/query.pb.go b/x/feegrant/types/query.pb.go new file mode 100644 index 000000000..e2597c3bc --- /dev/null +++ b/x/feegrant/types/query.pb.go @@ -0,0 +1,1172 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/feegrant/v1beta1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryFeeAllowanceRequest is the request type for the Query/FeeAllowance RPC method. +type QueryFeeAllowanceRequest struct { + Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` + Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` +} + +func (m *QueryFeeAllowanceRequest) Reset() { *m = QueryFeeAllowanceRequest{} } +func (m *QueryFeeAllowanceRequest) String() string { return proto.CompactTextString(m) } +func (*QueryFeeAllowanceRequest) ProtoMessage() {} +func (*QueryFeeAllowanceRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_59efc303945de53f, []int{0} +} +func (m *QueryFeeAllowanceRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryFeeAllowanceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryFeeAllowanceRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryFeeAllowanceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFeeAllowanceRequest.Merge(m, src) +} +func (m *QueryFeeAllowanceRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryFeeAllowanceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFeeAllowanceRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryFeeAllowanceRequest proto.InternalMessageInfo + +func (m *QueryFeeAllowanceRequest) GetGranter() string { + if m != nil { + return m.Granter + } + return "" +} + +func (m *QueryFeeAllowanceRequest) GetGrantee() string { + if m != nil { + return m.Grantee + } + return "" +} + +// QueryFeeAllowanceResponse is the response type for the Query/FeeAllowance RPC method. +type QueryFeeAllowanceResponse struct { + // fee_allowance is a fee_allowance granted for grantee by granter. + FeeAllowance *FeeAllowanceGrant `protobuf:"bytes,1,opt,name=fee_allowance,json=feeAllowance,proto3" json:"fee_allowance,omitempty"` +} + +func (m *QueryFeeAllowanceResponse) Reset() { *m = QueryFeeAllowanceResponse{} } +func (m *QueryFeeAllowanceResponse) String() string { return proto.CompactTextString(m) } +func (*QueryFeeAllowanceResponse) ProtoMessage() {} +func (*QueryFeeAllowanceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_59efc303945de53f, []int{1} +} +func (m *QueryFeeAllowanceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryFeeAllowanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryFeeAllowanceResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryFeeAllowanceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFeeAllowanceResponse.Merge(m, src) +} +func (m *QueryFeeAllowanceResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryFeeAllowanceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFeeAllowanceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryFeeAllowanceResponse proto.InternalMessageInfo + +func (m *QueryFeeAllowanceResponse) GetFeeAllowance() *FeeAllowanceGrant { + if m != nil { + return m.FeeAllowance + } + return nil +} + +// QueryFeeAllowancesRequest is the request type for the Query/FeeAllowances RPC method. +type QueryFeeAllowancesRequest struct { + Grantee string `protobuf:"bytes,1,opt,name=grantee,proto3" json:"grantee,omitempty"` + // pagination defines an pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryFeeAllowancesRequest) Reset() { *m = QueryFeeAllowancesRequest{} } +func (m *QueryFeeAllowancesRequest) String() string { return proto.CompactTextString(m) } +func (*QueryFeeAllowancesRequest) ProtoMessage() {} +func (*QueryFeeAllowancesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_59efc303945de53f, []int{2} +} +func (m *QueryFeeAllowancesRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryFeeAllowancesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryFeeAllowancesRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryFeeAllowancesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFeeAllowancesRequest.Merge(m, src) +} +func (m *QueryFeeAllowancesRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryFeeAllowancesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFeeAllowancesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryFeeAllowancesRequest proto.InternalMessageInfo + +func (m *QueryFeeAllowancesRequest) GetGrantee() string { + if m != nil { + return m.Grantee + } + return "" +} + +func (m *QueryFeeAllowancesRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryFeeAllowancesResponse is the response type for the Query/FeeAllowances RPC method. +type QueryFeeAllowancesResponse struct { + // fee_allowances are fee_allowance's granted for grantee by granter. + FeeAllowances []*FeeAllowanceGrant `protobuf:"bytes,1,rep,name=fee_allowances,json=feeAllowances,proto3" json:"fee_allowances,omitempty"` + // pagination defines an pagination for the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryFeeAllowancesResponse) Reset() { *m = QueryFeeAllowancesResponse{} } +func (m *QueryFeeAllowancesResponse) String() string { return proto.CompactTextString(m) } +func (*QueryFeeAllowancesResponse) ProtoMessage() {} +func (*QueryFeeAllowancesResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_59efc303945de53f, []int{3} +} +func (m *QueryFeeAllowancesResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryFeeAllowancesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryFeeAllowancesResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryFeeAllowancesResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryFeeAllowancesResponse.Merge(m, src) +} +func (m *QueryFeeAllowancesResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryFeeAllowancesResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryFeeAllowancesResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryFeeAllowancesResponse proto.InternalMessageInfo + +func (m *QueryFeeAllowancesResponse) GetFeeAllowances() []*FeeAllowanceGrant { + if m != nil { + return m.FeeAllowances + } + return nil +} + +func (m *QueryFeeAllowancesResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +func init() { + proto.RegisterType((*QueryFeeAllowanceRequest)(nil), "cosmos.feegrant.v1beta1.QueryFeeAllowanceRequest") + proto.RegisterType((*QueryFeeAllowanceResponse)(nil), "cosmos.feegrant.v1beta1.QueryFeeAllowanceResponse") + proto.RegisterType((*QueryFeeAllowancesRequest)(nil), "cosmos.feegrant.v1beta1.QueryFeeAllowancesRequest") + proto.RegisterType((*QueryFeeAllowancesResponse)(nil), "cosmos.feegrant.v1beta1.QueryFeeAllowancesResponse") +} + +func init() { + proto.RegisterFile("cosmos/feegrant/v1beta1/query.proto", fileDescriptor_59efc303945de53f) +} + +var fileDescriptor_59efc303945de53f = []byte{ + // 455 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0x31, 0x8f, 0xd3, 0x30, + 0x14, 0xc7, 0xeb, 0x22, 0x40, 0xf8, 0xae, 0x0c, 0x16, 0x12, 0x21, 0x42, 0xd1, 0x29, 0x48, 0x07, + 0x3a, 0xe9, 0x62, 0x35, 0x9d, 0x40, 0x2c, 0xdc, 0x70, 0xdd, 0x80, 0xcb, 0xc8, 0x82, 0x9c, 0xf2, + 0x6a, 0x22, 0x72, 0x71, 0x2e, 0x76, 0x81, 0x13, 0xea, 0xc2, 0x27, 0x40, 0xe2, 0xa3, 0xb0, 0xc0, + 0x37, 0x60, 0x3c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a2, 0x6f, 0xeb, + 0x1e, 0xea, 0x3c, 0x07, 0x19, 0x5f, 0xd1, 0x77, 0x78, 0xf2, 0x3b, 0x00, 0x00, 0xff, 0xff, 0xb8, + 0x46, 0x4c, 0xba, 0x8b, 0x04, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // FeeAllowance returns fee granted to the grantee by the granter. + FeeAllowance(ctx context.Context, in *QueryFeeAllowanceRequest, opts ...grpc.CallOption) (*QueryFeeAllowanceResponse, error) + // FeeAllowances returns all the grants for address. + FeeAllowances(ctx context.Context, in *QueryFeeAllowancesRequest, opts ...grpc.CallOption) (*QueryFeeAllowancesResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) FeeAllowance(ctx context.Context, in *QueryFeeAllowanceRequest, opts ...grpc.CallOption) (*QueryFeeAllowanceResponse, error) { + out := new(QueryFeeAllowanceResponse) + err := c.cc.Invoke(ctx, "/cosmos.feegrant.v1beta1.Query/FeeAllowance", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) FeeAllowances(ctx context.Context, in *QueryFeeAllowancesRequest, opts ...grpc.CallOption) (*QueryFeeAllowancesResponse, error) { + out := new(QueryFeeAllowancesResponse) + err := c.cc.Invoke(ctx, "/cosmos.feegrant.v1beta1.Query/FeeAllowances", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // FeeAllowance returns fee granted to the grantee by the granter. + FeeAllowance(context.Context, *QueryFeeAllowanceRequest) (*QueryFeeAllowanceResponse, error) + // FeeAllowances returns all the grants for address. + FeeAllowances(context.Context, *QueryFeeAllowancesRequest) (*QueryFeeAllowancesResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) FeeAllowance(ctx context.Context, req *QueryFeeAllowanceRequest) (*QueryFeeAllowanceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FeeAllowance not implemented") +} +func (*UnimplementedQueryServer) FeeAllowances(ctx context.Context, req *QueryFeeAllowancesRequest) (*QueryFeeAllowancesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FeeAllowances not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_FeeAllowance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryFeeAllowanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).FeeAllowance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.feegrant.v1beta1.Query/FeeAllowance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).FeeAllowance(ctx, req.(*QueryFeeAllowanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_FeeAllowances_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryFeeAllowancesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).FeeAllowances(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.feegrant.v1beta1.Query/FeeAllowances", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).FeeAllowances(ctx, req.(*QueryFeeAllowancesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.feegrant.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "FeeAllowance", + Handler: _Query_FeeAllowance_Handler, + }, + { + MethodName: "FeeAllowances", + Handler: _Query_FeeAllowances_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/feegrant/v1beta1/query.proto", +} + +func (m *QueryFeeAllowanceRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryFeeAllowanceRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryFeeAllowanceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Grantee) > 0 { + i -= len(m.Grantee) + copy(dAtA[i:], m.Grantee) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Grantee))) + i-- + dAtA[i] = 0x12 + } + if len(m.Granter) > 0 { + i -= len(m.Granter) + copy(dAtA[i:], m.Granter) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Granter))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryFeeAllowanceResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryFeeAllowanceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryFeeAllowanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.FeeAllowance != nil { + { + size, err := m.FeeAllowance.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryFeeAllowancesRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryFeeAllowancesRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryFeeAllowancesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Grantee) > 0 { + i -= len(m.Grantee) + copy(dAtA[i:], m.Grantee) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Grantee))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryFeeAllowancesResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryFeeAllowancesResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryFeeAllowancesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.FeeAllowances) > 0 { + for iNdEx := len(m.FeeAllowances) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FeeAllowances[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryFeeAllowanceRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Granter) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Grantee) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryFeeAllowanceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.FeeAllowance != nil { + l = m.FeeAllowance.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryFeeAllowancesRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Grantee) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryFeeAllowancesResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.FeeAllowances) > 0 { + for _, e := range m.FeeAllowances { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryFeeAllowanceRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryFeeAllowanceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFeeAllowanceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Granter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Granter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grantee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Grantee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryFeeAllowanceResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryFeeAllowanceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFeeAllowanceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeAllowance", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FeeAllowance == nil { + m.FeeAllowance = &FeeAllowanceGrant{} + } + if err := m.FeeAllowance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryFeeAllowancesRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryFeeAllowancesRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFeeAllowancesRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grantee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Grantee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryFeeAllowancesResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryFeeAllowancesResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryFeeAllowancesResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FeeAllowances", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FeeAllowances = append(m.FeeAllowances, &FeeAllowanceGrant{}) + if err := m.FeeAllowances[len(m.FeeAllowances)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/feegrant/types/query.pb.gw.go b/x/feegrant/types/query.pb.gw.go new file mode 100644 index 000000000..499e4a441 --- /dev/null +++ b/x/feegrant/types/query.pb.gw.go @@ -0,0 +1,322 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: cosmos/feegrant/v1beta1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage + +func request_Query_FeeAllowance_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryFeeAllowanceRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["granter"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "granter") + } + + protoReq.Granter, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "granter", err) + } + + val, ok = pathParams["grantee"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "grantee") + } + + protoReq.Grantee, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "grantee", err) + } + + msg, err := client.FeeAllowance(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_FeeAllowance_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryFeeAllowanceRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["granter"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "granter") + } + + protoReq.Granter, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "granter", err) + } + + val, ok = pathParams["grantee"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "grantee") + } + + protoReq.Grantee, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "grantee", err) + } + + msg, err := server.FeeAllowance(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_FeeAllowances_0 = &utilities.DoubleArray{Encoding: map[string]int{"grantee": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_FeeAllowances_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryFeeAllowancesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["grantee"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "grantee") + } + + protoReq.Grantee, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "grantee", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_FeeAllowances_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.FeeAllowances(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_FeeAllowances_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryFeeAllowancesRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["grantee"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "grantee") + } + + protoReq.Grantee, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "grantee", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_FeeAllowances_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.FeeAllowances(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_FeeAllowance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_FeeAllowance_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_FeeAllowance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_FeeAllowances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_FeeAllowances_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_FeeAllowances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_FeeAllowance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_FeeAllowance_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_FeeAllowance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_FeeAllowances_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_FeeAllowances_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_FeeAllowances_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_FeeAllowance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"cosmos", "feegrant", "v1beta1", "fee_allowance", "granter", "grantee"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_FeeAllowances_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"cosmos", "feegrant", "v1beta1", "fee_allowances", "grantee"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_Query_FeeAllowance_0 = runtime.ForwardResponseMessage + + forward_Query_FeeAllowances_0 = runtime.ForwardResponseMessage +) diff --git a/x/feegrant/types/tx.pb.go b/x/feegrant/types/tx.pb.go new file mode 100644 index 000000000..d3080f10e --- /dev/null +++ b/x/feegrant/types/tx.pb.go @@ -0,0 +1,1033 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: cosmos/feegrant/v1beta1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/codec/types" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + _ "github.com/regen-network/cosmos-proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgGrantFeeAllowance adds permission for Grantee to spend up to Allowance +// of fees from the account of Granter. +type MsgGrantFeeAllowance struct { + Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` + Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` + Allowance *types.Any `protobuf:"bytes,3,opt,name=allowance,proto3" json:"allowance,omitempty"` +} + +func (m *MsgGrantFeeAllowance) Reset() { *m = MsgGrantFeeAllowance{} } +func (m *MsgGrantFeeAllowance) String() string { return proto.CompactTextString(m) } +func (*MsgGrantFeeAllowance) ProtoMessage() {} +func (*MsgGrantFeeAllowance) Descriptor() ([]byte, []int) { + return fileDescriptor_dd44ad7946dad783, []int{0} +} +func (m *MsgGrantFeeAllowance) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgGrantFeeAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgGrantFeeAllowance.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgGrantFeeAllowance) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgGrantFeeAllowance.Merge(m, src) +} +func (m *MsgGrantFeeAllowance) XXX_Size() int { + return m.Size() +} +func (m *MsgGrantFeeAllowance) XXX_DiscardUnknown() { + xxx_messageInfo_MsgGrantFeeAllowance.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgGrantFeeAllowance proto.InternalMessageInfo + +func (m *MsgGrantFeeAllowance) GetGranter() string { + if m != nil { + return m.Granter + } + return "" +} + +func (m *MsgGrantFeeAllowance) GetGrantee() string { + if m != nil { + return m.Grantee + } + return "" +} + +func (m *MsgGrantFeeAllowance) GetAllowance() *types.Any { + if m != nil { + return m.Allowance + } + return nil +} + +// MsgGrantFeeAllowanceResponse defines the Msg/GrantFeeAllowanceResponse response type. +type MsgGrantFeeAllowanceResponse struct { +} + +func (m *MsgGrantFeeAllowanceResponse) Reset() { *m = MsgGrantFeeAllowanceResponse{} } +func (m *MsgGrantFeeAllowanceResponse) String() string { return proto.CompactTextString(m) } +func (*MsgGrantFeeAllowanceResponse) ProtoMessage() {} +func (*MsgGrantFeeAllowanceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_dd44ad7946dad783, []int{1} +} +func (m *MsgGrantFeeAllowanceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgGrantFeeAllowanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgGrantFeeAllowanceResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgGrantFeeAllowanceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgGrantFeeAllowanceResponse.Merge(m, src) +} +func (m *MsgGrantFeeAllowanceResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgGrantFeeAllowanceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgGrantFeeAllowanceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgGrantFeeAllowanceResponse proto.InternalMessageInfo + +// MsgRevokeFeeAllowance removes any existing FeeAllowance from Granter to Grantee. +type MsgRevokeFeeAllowance struct { + Granter string `protobuf:"bytes,1,opt,name=granter,proto3" json:"granter,omitempty"` + Grantee string `protobuf:"bytes,2,opt,name=grantee,proto3" json:"grantee,omitempty"` +} + +func (m *MsgRevokeFeeAllowance) Reset() { *m = MsgRevokeFeeAllowance{} } +func (m *MsgRevokeFeeAllowance) String() string { return proto.CompactTextString(m) } +func (*MsgRevokeFeeAllowance) ProtoMessage() {} +func (*MsgRevokeFeeAllowance) Descriptor() ([]byte, []int) { + return fileDescriptor_dd44ad7946dad783, []int{2} +} +func (m *MsgRevokeFeeAllowance) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRevokeFeeAllowance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRevokeFeeAllowance.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgRevokeFeeAllowance) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRevokeFeeAllowance.Merge(m, src) +} +func (m *MsgRevokeFeeAllowance) XXX_Size() int { + return m.Size() +} +func (m *MsgRevokeFeeAllowance) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRevokeFeeAllowance.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRevokeFeeAllowance proto.InternalMessageInfo + +func (m *MsgRevokeFeeAllowance) GetGranter() string { + if m != nil { + return m.Granter + } + return "" +} + +func (m *MsgRevokeFeeAllowance) GetGrantee() string { + if m != nil { + return m.Grantee + } + return "" +} + +// MsgRevokeFeeAllowanceResponse defines the Msg/RevokeFeeAllowanceResponse response type. +type MsgRevokeFeeAllowanceResponse struct { +} + +func (m *MsgRevokeFeeAllowanceResponse) Reset() { *m = MsgRevokeFeeAllowanceResponse{} } +func (m *MsgRevokeFeeAllowanceResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRevokeFeeAllowanceResponse) ProtoMessage() {} +func (*MsgRevokeFeeAllowanceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_dd44ad7946dad783, []int{3} +} +func (m *MsgRevokeFeeAllowanceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRevokeFeeAllowanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRevokeFeeAllowanceResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgRevokeFeeAllowanceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRevokeFeeAllowanceResponse.Merge(m, src) +} +func (m *MsgRevokeFeeAllowanceResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRevokeFeeAllowanceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRevokeFeeAllowanceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRevokeFeeAllowanceResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgGrantFeeAllowance)(nil), "cosmos.feegrant.v1beta1.MsgGrantFeeAllowance") + proto.RegisterType((*MsgGrantFeeAllowanceResponse)(nil), "cosmos.feegrant.v1beta1.MsgGrantFeeAllowanceResponse") + proto.RegisterType((*MsgRevokeFeeAllowance)(nil), "cosmos.feegrant.v1beta1.MsgRevokeFeeAllowance") + proto.RegisterType((*MsgRevokeFeeAllowanceResponse)(nil), "cosmos.feegrant.v1beta1.MsgRevokeFeeAllowanceResponse") +} + +func init() { proto.RegisterFile("cosmos/feegrant/v1beta1/tx.proto", fileDescriptor_dd44ad7946dad783) } + +var fileDescriptor_dd44ad7946dad783 = []byte{ + // 345 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x48, 0xce, 0x2f, 0xce, + 0xcd, 0x2f, 0xd6, 0x4f, 0x4b, 0x4d, 0x4d, 0x2f, 0x4a, 0xcc, 0x2b, 0xd1, 0x2f, 0x33, 0x4c, 0x4a, + 0x2d, 0x49, 0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58, 0x0d, 0x83, 0xd9, 0x66, 0xf4, 0x8f, 0x91, + 0x8b, 0xd9, 0xb7, 0x38, 0x5d, 0xa8, 0x92, 0x4b, 0x10, 0x33, 0x94, 0x74, 0xf5, 0x70, 0x44, 0x92, + 0x1e, 0x36, 0x1f, 0x48, 0x99, 0x92, 0xa4, 0x1c, 0xe6, 0x04, 0xa1, 0x1a, 0x2e, 0x21, 0x2c, 0xbe, + 0xd5, 0xc3, 0x67, 0x18, 0xa6, 0x7a, 0x29, 0x33, 0xd2, 0xd4, 0xc3, 0x6c, 0x77, 0x72, 0x3f, 0xf1, + 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, + 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xdd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, + 0xbd, 0xe4, 0xfc, 0x5c, 0x68, 0xaa, 0x82, 0x52, 0xba, 0xc5, 0x29, 0xd9, 0xfa, 0x15, 0x88, 0xb4, + 0x5d, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x4e, 0x03, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, + 0xff, 0x7b, 0xbe, 0x24, 0x15, 0xfb, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // GrantFeeAllowance grants fee allowance to the grantee on the granter's + // account with the provided expiration time. + GrantFeeAllowance(ctx context.Context, in *MsgGrantFeeAllowance, opts ...grpc.CallOption) (*MsgGrantFeeAllowanceResponse, error) + // RevokeFeeAllowance revokes any fee allowance of granter's account that + // has been granted to the grantee. + RevokeFeeAllowance(ctx context.Context, in *MsgRevokeFeeAllowance, opts ...grpc.CallOption) (*MsgRevokeFeeAllowanceResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) GrantFeeAllowance(ctx context.Context, in *MsgGrantFeeAllowance, opts ...grpc.CallOption) (*MsgGrantFeeAllowanceResponse, error) { + out := new(MsgGrantFeeAllowanceResponse) + err := c.cc.Invoke(ctx, "/cosmos.feegrant.v1beta1.Msg/GrantFeeAllowance", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) RevokeFeeAllowance(ctx context.Context, in *MsgRevokeFeeAllowance, opts ...grpc.CallOption) (*MsgRevokeFeeAllowanceResponse, error) { + out := new(MsgRevokeFeeAllowanceResponse) + err := c.cc.Invoke(ctx, "/cosmos.feegrant.v1beta1.Msg/RevokeFeeAllowance", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // GrantFeeAllowance grants fee allowance to the grantee on the granter's + // account with the provided expiration time. + GrantFeeAllowance(context.Context, *MsgGrantFeeAllowance) (*MsgGrantFeeAllowanceResponse, error) + // RevokeFeeAllowance revokes any fee allowance of granter's account that + // has been granted to the grantee. + RevokeFeeAllowance(context.Context, *MsgRevokeFeeAllowance) (*MsgRevokeFeeAllowanceResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) GrantFeeAllowance(ctx context.Context, req *MsgGrantFeeAllowance) (*MsgGrantFeeAllowanceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GrantFeeAllowance not implemented") +} +func (*UnimplementedMsgServer) RevokeFeeAllowance(ctx context.Context, req *MsgRevokeFeeAllowance) (*MsgRevokeFeeAllowanceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RevokeFeeAllowance not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_GrantFeeAllowance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgGrantFeeAllowance) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).GrantFeeAllowance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.feegrant.v1beta1.Msg/GrantFeeAllowance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).GrantFeeAllowance(ctx, req.(*MsgGrantFeeAllowance)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_RevokeFeeAllowance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRevokeFeeAllowance) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RevokeFeeAllowance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.feegrant.v1beta1.Msg/RevokeFeeAllowance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RevokeFeeAllowance(ctx, req.(*MsgRevokeFeeAllowance)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "cosmos.feegrant.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GrantFeeAllowance", + Handler: _Msg_GrantFeeAllowance_Handler, + }, + { + MethodName: "RevokeFeeAllowance", + Handler: _Msg_RevokeFeeAllowance_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "cosmos/feegrant/v1beta1/tx.proto", +} + +func (m *MsgGrantFeeAllowance) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgGrantFeeAllowance) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgGrantFeeAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Allowance != nil { + { + size, err := m.Allowance.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Grantee) > 0 { + i -= len(m.Grantee) + copy(dAtA[i:], m.Grantee) + i = encodeVarintTx(dAtA, i, uint64(len(m.Grantee))) + i-- + dAtA[i] = 0x12 + } + if len(m.Granter) > 0 { + i -= len(m.Granter) + copy(dAtA[i:], m.Granter) + i = encodeVarintTx(dAtA, i, uint64(len(m.Granter))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgGrantFeeAllowanceResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgGrantFeeAllowanceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgGrantFeeAllowanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgRevokeFeeAllowance) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgRevokeFeeAllowance) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRevokeFeeAllowance) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Grantee) > 0 { + i -= len(m.Grantee) + copy(dAtA[i:], m.Grantee) + i = encodeVarintTx(dAtA, i, uint64(len(m.Grantee))) + i-- + dAtA[i] = 0x12 + } + if len(m.Granter) > 0 { + i -= len(m.Granter) + copy(dAtA[i:], m.Granter) + i = encodeVarintTx(dAtA, i, uint64(len(m.Granter))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRevokeFeeAllowanceResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgRevokeFeeAllowanceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRevokeFeeAllowanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgGrantFeeAllowance) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Granter) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Grantee) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Allowance != nil { + l = m.Allowance.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgGrantFeeAllowanceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRevokeFeeAllowance) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Granter) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Grantee) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRevokeFeeAllowanceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgGrantFeeAllowance) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgGrantFeeAllowance: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgGrantFeeAllowance: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Granter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Granter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grantee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Grantee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Allowance", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Allowance == nil { + m.Allowance = &types.Any{} + } + if err := m.Allowance.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgGrantFeeAllowanceResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgGrantFeeAllowanceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgGrantFeeAllowanceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRevokeFeeAllowance) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRevokeFeeAllowance: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRevokeFeeAllowance: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Granter", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Granter = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Grantee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Grantee = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRevokeFeeAllowanceResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRevokeFeeAllowanceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRevokeFeeAllowanceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/mint/simulation/decoder.go b/x/mint/simulation/decoder.go index 37d9930f7..f0a89be43 100644 --- a/x/mint/simulation/decoder.go +++ b/x/mint/simulation/decoder.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/mint/types" ) -// NewDecodeStore returns a decoder function closure that umarshals the KVPair's +// NewDecodeStore returns a decoder function closure that unmarshals the KVPair's // Value to the corresponding mint type. func NewDecodeStore(cdc codec.Marshaler) func(kvA, kvB kv.Pair) string { return func(kvA, kvB kv.Pair) string { From d6e4a2e9bcd9eff87d6f4b43ae13378e2ba6ac63 Mon Sep 17 00:00:00 2001 From: yihuang Date: Sat, 30 Jan 2021 04:05:24 +0800 Subject: [PATCH 10/19] fix bech32 prefix in evidence (#8461) Co-authored-by: Tomas Tauber <2410580+tomtau@users.noreply.github.com> Co-authored-by: Tomas Tauber <2410580+tomtau@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- CHANGELOG.md | 1 + x/evidence/types/evidence.go | 3 ++- x/evidence/types/evidence_test.go | 20 ++++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ea84cb34..6bfebd9d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes +* (x/evidence) [#8461](https://github.com/cosmos/cosmos-sdk/pull/8461) Fix bech32 prefix in evidence validator address conversion * (x/slashing) [\#8427](https://github.com/cosmos/cosmos-sdk/pull/8427) Fix query signing infos command * (simapp) [\#8418](https://github.com/cosmos/cosmos-sdk/pull/8418) Add balance coin to supply when adding a new genesis account * (x/bank) [\#8417](https://github.com/cosmos/cosmos-sdk/pull/8417) Validate balances and coin denom metadata on genesis diff --git a/x/evidence/types/evidence.go b/x/evidence/types/evidence.go index 95705cc5b..fca6126ec 100644 --- a/x/evidence/types/evidence.go +++ b/x/evidence/types/evidence.go @@ -88,7 +88,8 @@ func (e Equivocation) GetTotalPower() int64 { return 0 } // FromABCIEvidence converts a Tendermint concrete Evidence type to // SDK Evidence using Equivocation as the concrete type. func FromABCIEvidence(e abci.Evidence) exported.Evidence { - consAddr, err := sdk.Bech32ifyAddressBytes(sdk.Bech32PrefixConsAddr, e.Validator.Address) + bech32PrefixConsAddr := sdk.GetConfig().GetBech32ConsensusAddrPrefix() + consAddr, err := sdk.Bech32ifyAddressBytes(bech32PrefixConsAddr, e.Validator.Address) if err != nil { panic(err) } diff --git a/x/evidence/types/evidence_test.go b/x/evidence/types/evidence_test.go index 07b9352f5..c78f0b059 100644 --- a/x/evidence/types/evidence_test.go +++ b/x/evidence/types/evidence_test.go @@ -5,6 +5,7 @@ import ( "time" "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/evidence/types" @@ -57,3 +58,22 @@ func TestEquivocationValidateBasic(t *testing.T) { }) } } + +func TestEvidenceAddressConversion(t *testing.T) { + sdk.GetConfig().SetBech32PrefixForConsensusNode("testcnclcons", "testcnclconspub") + tmEvidence := abci.Evidence{ + Type: abci.EvidenceType_DUPLICATE_VOTE, + Validator: abci.Validator{ + Address: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + Power: 100, + }, + Height: 1, + Time: time.Now(), + TotalVotingPower: 100, + } + evidence := types.FromABCIEvidence(tmEvidence).(*types.Equivocation) + consAddr := evidence.GetConsensusAddress() + // Check the address is the same after conversion + require.Equal(t, tmEvidence.Validator.Address, consAddr.Bytes()) + sdk.GetConfig().SetBech32PrefixForConsensusNode(sdk.Bech32PrefixConsAddr, sdk.Bech32PrefixConsPub) +} From 1d75e0e984e7132efd54c3526e36b3585e2d91c0 Mon Sep 17 00:00:00 2001 From: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Date: Fri, 29 Jan 2021 23:48:26 -0300 Subject: [PATCH 11/19] bank: additional client metadata validation (#8479) * bank: additional client metadata validation * changelog and comment * fix tab --- CHANGELOG.md | 1 + x/bank/types/metadata.go | 39 +++++++++++++++++++++++-- x/bank/types/metadata_test.go | 55 ++++++++++++++++++++++++++++++++++- 3 files changed, 92 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bfebd9d2..5bcb99bd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* (x/bank) [\#8479](https://github.com/cosmos/cosmos-sdk/pull/8479) Adittional client denom metadata validation for `base` and `display` denoms. * (x/ibc) [\#8404](https://github.com/cosmos/cosmos-sdk/pull/8404) Reorder IBC `ChanOpenAck` and `ChanOpenConfirm` handler execution to perform core handler first, followed by application callbacks. * [\#8396](https://github.com/cosmos/cosmos-sdk/pull/8396) Add support for ARM platform diff --git a/x/bank/types/metadata.go b/x/bank/types/metadata.go index 5106964e9..ce7794053 100644 --- a/x/bank/types/metadata.go +++ b/x/bank/types/metadata.go @@ -1,13 +1,19 @@ package types import ( + "errors" "fmt" "strings" sdk "github.com/cosmos/cosmos-sdk/types" ) -// Validate performs a basic validation of the coin metadata fields +// Validate performs a basic validation of the coin metadata fields. It checks: +// - Base and Display denominations are valid coin denominations +// - Base and Display denominations are present in the DenomUnit slice +// - Base denomination has exponent 0 +// - Denomination units are sorted in ascending order +// - Denomination units not duplicated func (m Metadata) Validate() error { if err := sdk.ValidateDenom(m.Base); err != nil { return fmt.Errorf("invalid metadata base denom: %w", err) @@ -17,12 +23,37 @@ func (m Metadata) Validate() error { return fmt.Errorf("invalid metadata display denom: %w", err) } + var ( + hasDisplay bool + currentExponent uint32 // check that the exponents are increasing + ) + seenUnits := make(map[string]bool) - for _, denomUnit := range m.DenomUnits { + + for i, denomUnit := range m.DenomUnits { + // The first denomination unit MUST be the base + if i == 0 { + // validate denomination and exponent + if denomUnit.Denom != m.Base { + return fmt.Errorf("metadata's first denomination unit must be the one with base denom '%s'", m.Base) + } + if denomUnit.Exponent != 0 { + return fmt.Errorf("the exponent for base denomination unit %s must be 0", m.Base) + } + } else if currentExponent >= denomUnit.Exponent { + return errors.New("denom units should be sorted asc by exponent") + } + + currentExponent = denomUnit.Exponent + if seenUnits[denomUnit.Denom] { return fmt.Errorf("duplicate denomination unit %s", denomUnit.Denom) } + if denomUnit.Denom == m.Display { + hasDisplay = true + } + if err := denomUnit.Validate(); err != nil { return err } @@ -30,6 +61,10 @@ func (m Metadata) Validate() error { seenUnits[denomUnit.Denom] = true } + if !hasDisplay { + return fmt.Errorf("metadata must contain a denomination unit with display denom '%s'", m.Display) + } + return nil } diff --git a/x/bank/types/metadata_test.go b/x/bank/types/metadata_test.go index 29f4d220f..64241e609 100644 --- a/x/bank/types/metadata_test.go +++ b/x/bank/types/metadata_test.go @@ -51,7 +51,7 @@ func TestMetadataValidate(t *testing.T) { Description: "The native staking token of the Cosmos Hub.", DenomUnits: []*types.DenomUnit{ {"uatom", uint32(0), []string{"microatom"}}, - {"uatom", uint32(0), []string{"microatom"}}, + {"uatom", uint32(1), []string{"microatom"}}, }, Base: "uatom", Display: "atom", @@ -94,6 +94,59 @@ func TestMetadataValidate(t *testing.T) { }, true, }, + { + "no base denom unit", + types.Metadata{ + Description: "The native staking token of the Cosmos Hub.", + DenomUnits: []*types.DenomUnit{ + {"matom", uint32(3), []string{"milliatom"}}, + {"atom", uint32(6), nil}, + }, + Base: "uatom", + Display: "atom", + }, + true, + }, + { + "base denom exponent not zero", + types.Metadata{ + Description: "The native staking token of the Cosmos Hub.", + DenomUnits: []*types.DenomUnit{ + {"uatom", uint32(1), []string{"microatom"}}, + {"matom", uint32(3), []string{"milliatom"}}, + {"atom", uint32(6), nil}, + }, + Base: "uatom", + Display: "atom", + }, + true, + }, + { + "no display denom unit", + types.Metadata{ + Description: "The native staking token of the Cosmos Hub.", + DenomUnits: []*types.DenomUnit{ + {"uatom", uint32(0), []string{"microatom"}}, + }, + Base: "uatom", + Display: "atom", + }, + true, + }, + { + "denom units not sorted", + types.Metadata{ + Description: "The native staking token of the Cosmos Hub.", + DenomUnits: []*types.DenomUnit{ + {"uatom", uint32(0), []string{"microatom"}}, + {"atom", uint32(6), nil}, + {"matom", uint32(3), []string{"milliatom"}}, + }, + Base: "uatom", + Display: "atom", + }, + true, + }, } for _, tc := range testCases { From 812835795693bd6202a5c19d5f37724e69e204b2 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Mon, 1 Feb 2021 10:48:32 +0000 Subject: [PATCH 12/19] snapshots: fix flaky tests (#8475) The use testing.T.TempDir() seems to cause test failures in CI environvements in those cases where temporary directories' subdirs are created with permissions that are different from the defaults used by testing.T.TempDir(). The snapshots package's tests seem to be heavily affected, thus this replaces testing.T.TempDir() occurrences with ioutil.TempDir() calls. Related upstream issue: - https://github.com/golang/go/issues/40853 Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- snapshots/helpers_test.go | 6 +++++- snapshots/store_test.go | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/snapshots/helpers_test.go b/snapshots/helpers_test.go index 5dbdd3175..751ac212d 100644 --- a/snapshots/helpers_test.go +++ b/snapshots/helpers_test.go @@ -6,6 +6,7 @@ import ( "errors" "io" "io/ioutil" + "os" "testing" "time" @@ -100,7 +101,10 @@ func (m *mockSnapshotter) Snapshot(height uint64, format uint32) (<-chan io.Read // setupBusyManager creates a manager with an empty store that is busy creating a snapshot at height 1. // The snapshot will complete when the returned closer is called. func setupBusyManager(t *testing.T) *snapshots.Manager { - tempdir := t.TempDir() + tempdir, err := ioutil.TempDir("", "") + require.NoError(t, err) + t.Cleanup(func() { _ = os.RemoveAll(tempdir) }) + store, err := snapshots.NewStore(db.NewMemDB(), tempdir) require.NoError(t, err) hung := newHungSnapshotter() diff --git a/snapshots/store_test.go b/snapshots/store_test.go index 1a04a393c..325fd3410 100644 --- a/snapshots/store_test.go +++ b/snapshots/store_test.go @@ -5,6 +5,7 @@ import ( "errors" "io" "io/ioutil" + "os" "path/filepath" "testing" "time" @@ -19,7 +20,10 @@ import ( ) func setupStore(t *testing.T) *snapshots.Store { - tempdir := t.TempDir() + tempdir, err := ioutil.TempDir("", "") + require.NoError(t, err) + t.Cleanup(func() { _ = os.RemoveAll(tempdir) }) + store, err := snapshots.NewStore(db.NewMemDB(), tempdir) require.NoError(t, err) From 896eee213ae39a327826000f5ef87f251789fbaf Mon Sep 17 00:00:00 2001 From: Amaury Date: Mon, 1 Feb 2021 13:35:18 +0100 Subject: [PATCH 13/19] docs: Update x/staking spec (#8395) * Finish updating state * Add messages * Update events * proto-gen * Update proto/cosmos/staking/v1beta1/staking.proto Co-authored-by: Anil Kumar Kammari * progo-gen * Update Msg with slash * Rerun proto docs Co-authored-by: Anil Kumar Kammari Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- docs/core/proto-docs.md | 9390 ++++++++++---------- proto/cosmos/staking/v1beta1/staking.proto | 44 + x/staking/spec/01_state.md | 142 +- x/staking/spec/02_state_transitions.md | 25 +- x/staking/spec/03_messages.md | 101 +- x/staking/spec/07_events.md | 16 +- x/staking/spec/README.md | 18 +- x/staking/types/staking.pb.go | 120 +- 8 files changed, 4921 insertions(+), 4935 deletions(-) diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 6b5909a3d..b06aaf246 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -4,116 +4,70 @@ ## Table of Contents -- [cosmos/tx/v1beta1/tx.proto](#cosmos/tx/v1beta1/tx.proto) - - [AuthInfo](#cosmos.tx.v1beta1.AuthInfo) - - [Fee](#cosmos.tx.v1beta1.Fee) - - [ModeInfo](#cosmos.tx.v1beta1.ModeInfo) - - [ModeInfo.Multi](#cosmos.tx.v1beta1.ModeInfo.Multi) - - [ModeInfo.Single](#cosmos.tx.v1beta1.ModeInfo.Single) - - [SignDoc](#cosmos.tx.v1beta1.SignDoc) - - [SignerInfo](#cosmos.tx.v1beta1.SignerInfo) - - [Tx](#cosmos.tx.v1beta1.Tx) - - [TxBody](#cosmos.tx.v1beta1.TxBody) - - [TxRaw](#cosmos.tx.v1beta1.TxRaw) +- [cosmos/auth/v1beta1/auth.proto](#cosmos/auth/v1beta1/auth.proto) + - [BaseAccount](#cosmos.auth.v1beta1.BaseAccount) + - [ModuleAccount](#cosmos.auth.v1beta1.ModuleAccount) + - [Params](#cosmos.auth.v1beta1.Params) -- [cosmos/tx/v1beta1/service.proto](#cosmos/tx/v1beta1/service.proto) - - [BroadcastTxRequest](#cosmos.tx.v1beta1.BroadcastTxRequest) - - [BroadcastTxResponse](#cosmos.tx.v1beta1.BroadcastTxResponse) - - [GetTxRequest](#cosmos.tx.v1beta1.GetTxRequest) - - [GetTxResponse](#cosmos.tx.v1beta1.GetTxResponse) - - [GetTxsEventRequest](#cosmos.tx.v1beta1.GetTxsEventRequest) - - [GetTxsEventResponse](#cosmos.tx.v1beta1.GetTxsEventResponse) - - [SimulateRequest](#cosmos.tx.v1beta1.SimulateRequest) - - [SimulateResponse](#cosmos.tx.v1beta1.SimulateResponse) +- [cosmos/auth/v1beta1/genesis.proto](#cosmos/auth/v1beta1/genesis.proto) + - [GenesisState](#cosmos.auth.v1beta1.GenesisState) - - [BroadcastMode](#cosmos.tx.v1beta1.BroadcastMode) +- [cosmos/auth/v1beta1/query.proto](#cosmos/auth/v1beta1/query.proto) + - [QueryAccountRequest](#cosmos.auth.v1beta1.QueryAccountRequest) + - [QueryAccountResponse](#cosmos.auth.v1beta1.QueryAccountResponse) + - [QueryParamsRequest](#cosmos.auth.v1beta1.QueryParamsRequest) + - [QueryParamsResponse](#cosmos.auth.v1beta1.QueryParamsResponse) - - [Service](#cosmos.tx.v1beta1.Service) + - [Query](#cosmos.auth.v1beta1.Query) -- [cosmos/tx/signing/v1beta1/signing.proto](#cosmos/tx/signing/v1beta1/signing.proto) - - [SignatureDescriptor](#cosmos.tx.signing.v1beta1.SignatureDescriptor) - - [SignatureDescriptor.Data](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data) - - [SignatureDescriptor.Data.Multi](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi) - - [SignatureDescriptor.Data.Single](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single) - - [SignatureDescriptors](#cosmos.tx.signing.v1beta1.SignatureDescriptors) +- [cosmos/base/v1beta1/coin.proto](#cosmos/base/v1beta1/coin.proto) + - [Coin](#cosmos.base.v1beta1.Coin) + - [DecCoin](#cosmos.base.v1beta1.DecCoin) + - [DecProto](#cosmos.base.v1beta1.DecProto) + - [IntProto](#cosmos.base.v1beta1.IntProto) - - [SignMode](#cosmos.tx.signing.v1beta1.SignMode) +- [cosmos/authz/v1beta1/authz.proto](#cosmos/authz/v1beta1/authz.proto) + - [AuthorizationGrant](#cosmos.authz.v1beta1.AuthorizationGrant) + - [GenericAuthorization](#cosmos.authz.v1beta1.GenericAuthorization) + - [SendAuthorization](#cosmos.authz.v1beta1.SendAuthorization) -- [cosmos/crisis/v1beta1/tx.proto](#cosmos/crisis/v1beta1/tx.proto) - - [MsgVerifyInvariant](#cosmos.crisis.v1beta1.MsgVerifyInvariant) - - [MsgVerifyInvariantResponse](#cosmos.crisis.v1beta1.MsgVerifyInvariantResponse) +- [cosmos/base/abci/v1beta1/abci.proto](#cosmos/base/abci/v1beta1/abci.proto) + - [ABCIMessageLog](#cosmos.base.abci.v1beta1.ABCIMessageLog) + - [Attribute](#cosmos.base.abci.v1beta1.Attribute) + - [GasInfo](#cosmos.base.abci.v1beta1.GasInfo) + - [MsgData](#cosmos.base.abci.v1beta1.MsgData) + - [Result](#cosmos.base.abci.v1beta1.Result) + - [SearchTxsResult](#cosmos.base.abci.v1beta1.SearchTxsResult) + - [SimulationResponse](#cosmos.base.abci.v1beta1.SimulationResponse) + - [StringEvent](#cosmos.base.abci.v1beta1.StringEvent) + - [TxMsgData](#cosmos.base.abci.v1beta1.TxMsgData) + - [TxResponse](#cosmos.base.abci.v1beta1.TxResponse) - - [Msg](#cosmos.crisis.v1beta1.Msg) +- [cosmos/authz/v1beta1/tx.proto](#cosmos/authz/v1beta1/tx.proto) + - [MsgExecAuthorizedRequest](#cosmos.authz.v1beta1.MsgExecAuthorizedRequest) + - [MsgExecAuthorizedResponse](#cosmos.authz.v1beta1.MsgExecAuthorizedResponse) + - [MsgGrantAuthorizationRequest](#cosmos.authz.v1beta1.MsgGrantAuthorizationRequest) + - [MsgGrantAuthorizationResponse](#cosmos.authz.v1beta1.MsgGrantAuthorizationResponse) + - [MsgRevokeAuthorizationRequest](#cosmos.authz.v1beta1.MsgRevokeAuthorizationRequest) + - [MsgRevokeAuthorizationResponse](#cosmos.authz.v1beta1.MsgRevokeAuthorizationResponse) -- [cosmos/crisis/v1beta1/genesis.proto](#cosmos/crisis/v1beta1/genesis.proto) - - [GenesisState](#cosmos.crisis.v1beta1.GenesisState) + - [Msg](#cosmos.authz.v1beta1.Msg) -- [cosmos/crypto/multisig/keys.proto](#cosmos/crypto/multisig/keys.proto) - - [LegacyAminoPubKey](#cosmos.crypto.multisig.LegacyAminoPubKey) +- [cosmos/authz/v1beta1/genesis.proto](#cosmos/authz/v1beta1/genesis.proto) + - [GenesisState](#cosmos.authz.v1beta1.GenesisState) + - [GrantAuthorization](#cosmos.authz.v1beta1.GrantAuthorization) -- [cosmos/crypto/multisig/v1beta1/multisig.proto](#cosmos/crypto/multisig/v1beta1/multisig.proto) - - [CompactBitArray](#cosmos.crypto.multisig.v1beta1.CompactBitArray) - - [MultiSignature](#cosmos.crypto.multisig.v1beta1.MultiSignature) +- [cosmos/base/query/v1beta1/pagination.proto](#cosmos/base/query/v1beta1/pagination.proto) + - [PageRequest](#cosmos.base.query.v1beta1.PageRequest) + - [PageResponse](#cosmos.base.query.v1beta1.PageResponse) -- [cosmos/crypto/secp256k1/keys.proto](#cosmos/crypto/secp256k1/keys.proto) - - [PrivKey](#cosmos.crypto.secp256k1.PrivKey) - - [PubKey](#cosmos.crypto.secp256k1.PubKey) +- [cosmos/authz/v1beta1/query.proto](#cosmos/authz/v1beta1/query.proto) + - [QueryAuthorizationRequest](#cosmos.authz.v1beta1.QueryAuthorizationRequest) + - [QueryAuthorizationResponse](#cosmos.authz.v1beta1.QueryAuthorizationResponse) + - [QueryAuthorizationsRequest](#cosmos.authz.v1beta1.QueryAuthorizationsRequest) + - [QueryAuthorizationsResponse](#cosmos.authz.v1beta1.QueryAuthorizationsResponse) -- [cosmos/crypto/ed25519/keys.proto](#cosmos/crypto/ed25519/keys.proto) - - [PrivKey](#cosmos.crypto.ed25519.PrivKey) - - [PubKey](#cosmos.crypto.ed25519.PubKey) - -- [cosmos/mint/v1beta1/query.proto](#cosmos/mint/v1beta1/query.proto) - - [QueryAnnualProvisionsRequest](#cosmos.mint.v1beta1.QueryAnnualProvisionsRequest) - - [QueryAnnualProvisionsResponse](#cosmos.mint.v1beta1.QueryAnnualProvisionsResponse) - - [QueryInflationRequest](#cosmos.mint.v1beta1.QueryInflationRequest) - - [QueryInflationResponse](#cosmos.mint.v1beta1.QueryInflationResponse) - - [QueryParamsRequest](#cosmos.mint.v1beta1.QueryParamsRequest) - - [QueryParamsResponse](#cosmos.mint.v1beta1.QueryParamsResponse) - - - [Query](#cosmos.mint.v1beta1.Query) - -- [cosmos/mint/v1beta1/genesis.proto](#cosmos/mint/v1beta1/genesis.proto) - - [GenesisState](#cosmos.mint.v1beta1.GenesisState) - -- [cosmos/mint/v1beta1/mint.proto](#cosmos/mint/v1beta1/mint.proto) - - [Minter](#cosmos.mint.v1beta1.Minter) - - [Params](#cosmos.mint.v1beta1.Params) - -- [cosmos/feegrant/v1beta1/feegrant.proto](#cosmos/feegrant/v1beta1/feegrant.proto) - - [BasicFeeAllowance](#cosmos.feegrant.v1beta1.BasicFeeAllowance) - - [Duration](#cosmos.feegrant.v1beta1.Duration) - - [ExpiresAt](#cosmos.feegrant.v1beta1.ExpiresAt) - - [FeeAllowanceGrant](#cosmos.feegrant.v1beta1.FeeAllowanceGrant) - - [PeriodicFeeAllowance](#cosmos.feegrant.v1beta1.PeriodicFeeAllowance) - -- [cosmos/feegrant/v1beta1/query.proto](#cosmos/feegrant/v1beta1/query.proto) - - [QueryFeeAllowanceRequest](#cosmos.feegrant.v1beta1.QueryFeeAllowanceRequest) - - [QueryFeeAllowanceResponse](#cosmos.feegrant.v1beta1.QueryFeeAllowanceResponse) - - [QueryFeeAllowancesRequest](#cosmos.feegrant.v1beta1.QueryFeeAllowancesRequest) - - [QueryFeeAllowancesResponse](#cosmos.feegrant.v1beta1.QueryFeeAllowancesResponse) - - - [Query](#cosmos.feegrant.v1beta1.Query) - -- [cosmos/feegrant/v1beta1/tx.proto](#cosmos/feegrant/v1beta1/tx.proto) - - [MsgGrantFeeAllowance](#cosmos.feegrant.v1beta1.MsgGrantFeeAllowance) - - [MsgGrantFeeAllowanceResponse](#cosmos.feegrant.v1beta1.MsgGrantFeeAllowanceResponse) - - [MsgRevokeFeeAllowance](#cosmos.feegrant.v1beta1.MsgRevokeFeeAllowance) - - [MsgRevokeFeeAllowanceResponse](#cosmos.feegrant.v1beta1.MsgRevokeFeeAllowanceResponse) - - - [Msg](#cosmos.feegrant.v1beta1.Msg) - -- [cosmos/feegrant/v1beta1/genesis.proto](#cosmos/feegrant/v1beta1/genesis.proto) - - [GenesisState](#cosmos.feegrant.v1beta1.GenesisState) - -- [cosmos/capability/v1beta1/capability.proto](#cosmos/capability/v1beta1/capability.proto) - - [Capability](#cosmos.capability.v1beta1.Capability) - - [CapabilityOwners](#cosmos.capability.v1beta1.CapabilityOwners) - - [Owner](#cosmos.capability.v1beta1.Owner) - -- [cosmos/capability/v1beta1/genesis.proto](#cosmos/capability/v1beta1/genesis.proto) - - [GenesisOwners](#cosmos.capability.v1beta1.GenesisOwners) - - [GenesisState](#cosmos.capability.v1beta1.GenesisState) + - [Query](#cosmos.authz.v1beta1.Query) - [cosmos/bank/v1beta1/bank.proto](#cosmos/bank/v1beta1/bank.proto) - [DenomUnit](#cosmos.bank.v1beta1.DenomUnit) @@ -124,6 +78,10 @@ - [SendEnabled](#cosmos.bank.v1beta1.SendEnabled) - [Supply](#cosmos.bank.v1beta1.Supply) +- [cosmos/bank/v1beta1/genesis.proto](#cosmos/bank/v1beta1/genesis.proto) + - [Balance](#cosmos.bank.v1beta1.Balance) + - [GenesisState](#cosmos.bank.v1beta1.GenesisState) + - [cosmos/bank/v1beta1/query.proto](#cosmos/bank/v1beta1/query.proto) - [QueryAllBalancesRequest](#cosmos.bank.v1beta1.QueryAllBalancesRequest) - [QueryAllBalancesResponse](#cosmos.bank.v1beta1.QueryAllBalancesResponse) @@ -150,85 +108,107 @@ - [Msg](#cosmos.bank.v1beta1.Msg) -- [cosmos/bank/v1beta1/genesis.proto](#cosmos/bank/v1beta1/genesis.proto) - - [Balance](#cosmos.bank.v1beta1.Balance) - - [GenesisState](#cosmos.bank.v1beta1.GenesisState) +- [cosmos/base/kv/v1beta1/kv.proto](#cosmos/base/kv/v1beta1/kv.proto) + - [Pair](#cosmos.base.kv.v1beta1.Pair) + - [Pairs](#cosmos.base.kv.v1beta1.Pairs) -- [cosmos/authz/v1beta1/authz.proto](#cosmos/authz/v1beta1/authz.proto) - - [AuthorizationGrant](#cosmos.authz.v1beta1.AuthorizationGrant) - - [GenericAuthorization](#cosmos.authz.v1beta1.GenericAuthorization) - - [SendAuthorization](#cosmos.authz.v1beta1.SendAuthorization) +- [cosmos/base/reflection/v1beta1/reflection.proto](#cosmos/base/reflection/v1beta1/reflection.proto) + - [ListAllInterfacesRequest](#cosmos.base.reflection.v1beta1.ListAllInterfacesRequest) + - [ListAllInterfacesResponse](#cosmos.base.reflection.v1beta1.ListAllInterfacesResponse) + - [ListImplementationsRequest](#cosmos.base.reflection.v1beta1.ListImplementationsRequest) + - [ListImplementationsResponse](#cosmos.base.reflection.v1beta1.ListImplementationsResponse) -- [cosmos/authz/v1beta1/query.proto](#cosmos/authz/v1beta1/query.proto) - - [QueryAuthorizationRequest](#cosmos.authz.v1beta1.QueryAuthorizationRequest) - - [QueryAuthorizationResponse](#cosmos.authz.v1beta1.QueryAuthorizationResponse) - - [QueryAuthorizationsRequest](#cosmos.authz.v1beta1.QueryAuthorizationsRequest) - - [QueryAuthorizationsResponse](#cosmos.authz.v1beta1.QueryAuthorizationsResponse) + - [ReflectionService](#cosmos.base.reflection.v1beta1.ReflectionService) - - [Query](#cosmos.authz.v1beta1.Query) +- [cosmos/base/snapshots/v1beta1/snapshot.proto](#cosmos/base/snapshots/v1beta1/snapshot.proto) + - [Metadata](#cosmos.base.snapshots.v1beta1.Metadata) + - [Snapshot](#cosmos.base.snapshots.v1beta1.Snapshot) -- [cosmos/authz/v1beta1/tx.proto](#cosmos/authz/v1beta1/tx.proto) - - [MsgExecAuthorizedRequest](#cosmos.authz.v1beta1.MsgExecAuthorizedRequest) - - [MsgExecAuthorizedResponse](#cosmos.authz.v1beta1.MsgExecAuthorizedResponse) - - [MsgGrantAuthorizationRequest](#cosmos.authz.v1beta1.MsgGrantAuthorizationRequest) - - [MsgGrantAuthorizationResponse](#cosmos.authz.v1beta1.MsgGrantAuthorizationResponse) - - [MsgRevokeAuthorizationRequest](#cosmos.authz.v1beta1.MsgRevokeAuthorizationRequest) - - [MsgRevokeAuthorizationResponse](#cosmos.authz.v1beta1.MsgRevokeAuthorizationResponse) +- [cosmos/base/store/v1beta1/commit_info.proto](#cosmos/base/store/v1beta1/commit_info.proto) + - [CommitID](#cosmos.base.store.v1beta1.CommitID) + - [CommitInfo](#cosmos.base.store.v1beta1.CommitInfo) + - [StoreInfo](#cosmos.base.store.v1beta1.StoreInfo) - - [Msg](#cosmos.authz.v1beta1.Msg) +- [cosmos/base/store/v1beta1/snapshot.proto](#cosmos/base/store/v1beta1/snapshot.proto) + - [SnapshotIAVLItem](#cosmos.base.store.v1beta1.SnapshotIAVLItem) + - [SnapshotItem](#cosmos.base.store.v1beta1.SnapshotItem) + - [SnapshotStoreItem](#cosmos.base.store.v1beta1.SnapshotStoreItem) -- [cosmos/authz/v1beta1/genesis.proto](#cosmos/authz/v1beta1/genesis.proto) - - [GenesisState](#cosmos.authz.v1beta1.GenesisState) - - [GrantAuthorization](#cosmos.authz.v1beta1.GrantAuthorization) +- [cosmos/base/tendermint/v1beta1/query.proto](#cosmos/base/tendermint/v1beta1/query.proto) + - [GetBlockByHeightRequest](#cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest) + - [GetBlockByHeightResponse](#cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse) + - [GetLatestBlockRequest](#cosmos.base.tendermint.v1beta1.GetLatestBlockRequest) + - [GetLatestBlockResponse](#cosmos.base.tendermint.v1beta1.GetLatestBlockResponse) + - [GetLatestValidatorSetRequest](#cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest) + - [GetLatestValidatorSetResponse](#cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse) + - [GetNodeInfoRequest](#cosmos.base.tendermint.v1beta1.GetNodeInfoRequest) + - [GetNodeInfoResponse](#cosmos.base.tendermint.v1beta1.GetNodeInfoResponse) + - [GetSyncingRequest](#cosmos.base.tendermint.v1beta1.GetSyncingRequest) + - [GetSyncingResponse](#cosmos.base.tendermint.v1beta1.GetSyncingResponse) + - [GetValidatorSetByHeightRequest](#cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest) + - [GetValidatorSetByHeightResponse](#cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse) + - [Module](#cosmos.base.tendermint.v1beta1.Module) + - [Validator](#cosmos.base.tendermint.v1beta1.Validator) + - [VersionInfo](#cosmos.base.tendermint.v1beta1.VersionInfo) -- [cosmos/gov/v1beta1/gov.proto](#cosmos/gov/v1beta1/gov.proto) - - [Deposit](#cosmos.gov.v1beta1.Deposit) - - [DepositParams](#cosmos.gov.v1beta1.DepositParams) - - [Proposal](#cosmos.gov.v1beta1.Proposal) - - [TallyParams](#cosmos.gov.v1beta1.TallyParams) - - [TallyResult](#cosmos.gov.v1beta1.TallyResult) - - [TextProposal](#cosmos.gov.v1beta1.TextProposal) - - [Vote](#cosmos.gov.v1beta1.Vote) - - [VotingParams](#cosmos.gov.v1beta1.VotingParams) + - [Service](#cosmos.base.tendermint.v1beta1.Service) - - [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) - - [VoteOption](#cosmos.gov.v1beta1.VoteOption) +- [cosmos/capability/v1beta1/capability.proto](#cosmos/capability/v1beta1/capability.proto) + - [Capability](#cosmos.capability.v1beta1.Capability) + - [CapabilityOwners](#cosmos.capability.v1beta1.CapabilityOwners) + - [Owner](#cosmos.capability.v1beta1.Owner) -- [cosmos/gov/v1beta1/query.proto](#cosmos/gov/v1beta1/query.proto) - - [QueryDepositRequest](#cosmos.gov.v1beta1.QueryDepositRequest) - - [QueryDepositResponse](#cosmos.gov.v1beta1.QueryDepositResponse) - - [QueryDepositsRequest](#cosmos.gov.v1beta1.QueryDepositsRequest) - - [QueryDepositsResponse](#cosmos.gov.v1beta1.QueryDepositsResponse) - - [QueryParamsRequest](#cosmos.gov.v1beta1.QueryParamsRequest) - - [QueryParamsResponse](#cosmos.gov.v1beta1.QueryParamsResponse) - - [QueryProposalRequest](#cosmos.gov.v1beta1.QueryProposalRequest) - - [QueryProposalResponse](#cosmos.gov.v1beta1.QueryProposalResponse) - - [QueryProposalsRequest](#cosmos.gov.v1beta1.QueryProposalsRequest) - - [QueryProposalsResponse](#cosmos.gov.v1beta1.QueryProposalsResponse) - - [QueryTallyResultRequest](#cosmos.gov.v1beta1.QueryTallyResultRequest) - - [QueryTallyResultResponse](#cosmos.gov.v1beta1.QueryTallyResultResponse) - - [QueryVoteRequest](#cosmos.gov.v1beta1.QueryVoteRequest) - - [QueryVoteResponse](#cosmos.gov.v1beta1.QueryVoteResponse) - - [QueryVotesRequest](#cosmos.gov.v1beta1.QueryVotesRequest) - - [QueryVotesResponse](#cosmos.gov.v1beta1.QueryVotesResponse) +- [cosmos/capability/v1beta1/genesis.proto](#cosmos/capability/v1beta1/genesis.proto) + - [GenesisOwners](#cosmos.capability.v1beta1.GenesisOwners) + - [GenesisState](#cosmos.capability.v1beta1.GenesisState) - - [Query](#cosmos.gov.v1beta1.Query) +- [cosmos/crisis/v1beta1/genesis.proto](#cosmos/crisis/v1beta1/genesis.proto) + - [GenesisState](#cosmos.crisis.v1beta1.GenesisState) -- [cosmos/gov/v1beta1/tx.proto](#cosmos/gov/v1beta1/tx.proto) - - [MsgDeposit](#cosmos.gov.v1beta1.MsgDeposit) - - [MsgDepositResponse](#cosmos.gov.v1beta1.MsgDepositResponse) - - [MsgSubmitProposal](#cosmos.gov.v1beta1.MsgSubmitProposal) - - [MsgSubmitProposalResponse](#cosmos.gov.v1beta1.MsgSubmitProposalResponse) - - [MsgVote](#cosmos.gov.v1beta1.MsgVote) - - [MsgVoteResponse](#cosmos.gov.v1beta1.MsgVoteResponse) +- [cosmos/crisis/v1beta1/tx.proto](#cosmos/crisis/v1beta1/tx.proto) + - [MsgVerifyInvariant](#cosmos.crisis.v1beta1.MsgVerifyInvariant) + - [MsgVerifyInvariantResponse](#cosmos.crisis.v1beta1.MsgVerifyInvariantResponse) - - [Msg](#cosmos.gov.v1beta1.Msg) + - [Msg](#cosmos.crisis.v1beta1.Msg) -- [cosmos/gov/v1beta1/genesis.proto](#cosmos/gov/v1beta1/genesis.proto) - - [GenesisState](#cosmos.gov.v1beta1.GenesisState) +- [cosmos/crypto/ed25519/keys.proto](#cosmos/crypto/ed25519/keys.proto) + - [PrivKey](#cosmos.crypto.ed25519.PrivKey) + - [PubKey](#cosmos.crypto.ed25519.PubKey) -- [cosmos/genutil/v1beta1/genesis.proto](#cosmos/genutil/v1beta1/genesis.proto) - - [GenesisState](#cosmos.genutil.v1beta1.GenesisState) +- [cosmos/crypto/multisig/keys.proto](#cosmos/crypto/multisig/keys.proto) + - [LegacyAminoPubKey](#cosmos.crypto.multisig.LegacyAminoPubKey) + +- [cosmos/crypto/multisig/v1beta1/multisig.proto](#cosmos/crypto/multisig/v1beta1/multisig.proto) + - [CompactBitArray](#cosmos.crypto.multisig.v1beta1.CompactBitArray) + - [MultiSignature](#cosmos.crypto.multisig.v1beta1.MultiSignature) + +- [cosmos/crypto/secp256k1/keys.proto](#cosmos/crypto/secp256k1/keys.proto) + - [PrivKey](#cosmos.crypto.secp256k1.PrivKey) + - [PubKey](#cosmos.crypto.secp256k1.PubKey) + +- [cosmos/distribution/v1beta1/distribution.proto](#cosmos/distribution/v1beta1/distribution.proto) + - [CommunityPoolSpendProposal](#cosmos.distribution.v1beta1.CommunityPoolSpendProposal) + - [CommunityPoolSpendProposalWithDeposit](#cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit) + - [DelegationDelegatorReward](#cosmos.distribution.v1beta1.DelegationDelegatorReward) + - [DelegatorStartingInfo](#cosmos.distribution.v1beta1.DelegatorStartingInfo) + - [FeePool](#cosmos.distribution.v1beta1.FeePool) + - [Params](#cosmos.distribution.v1beta1.Params) + - [ValidatorAccumulatedCommission](#cosmos.distribution.v1beta1.ValidatorAccumulatedCommission) + - [ValidatorCurrentRewards](#cosmos.distribution.v1beta1.ValidatorCurrentRewards) + - [ValidatorHistoricalRewards](#cosmos.distribution.v1beta1.ValidatorHistoricalRewards) + - [ValidatorOutstandingRewards](#cosmos.distribution.v1beta1.ValidatorOutstandingRewards) + - [ValidatorSlashEvent](#cosmos.distribution.v1beta1.ValidatorSlashEvent) + - [ValidatorSlashEvents](#cosmos.distribution.v1beta1.ValidatorSlashEvents) + +- [cosmos/distribution/v1beta1/genesis.proto](#cosmos/distribution/v1beta1/genesis.proto) + - [DelegatorStartingInfoRecord](#cosmos.distribution.v1beta1.DelegatorStartingInfoRecord) + - [DelegatorWithdrawInfo](#cosmos.distribution.v1beta1.DelegatorWithdrawInfo) + - [GenesisState](#cosmos.distribution.v1beta1.GenesisState) + - [ValidatorAccumulatedCommissionRecord](#cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord) + - [ValidatorCurrentRewardsRecord](#cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord) + - [ValidatorHistoricalRewardsRecord](#cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord) + - [ValidatorOutstandingRewardsRecord](#cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord) + - [ValidatorSlashEventRecord](#cosmos.distribution.v1beta1.ValidatorSlashEventRecord) - [cosmos/distribution/v1beta1/query.proto](#cosmos/distribution/v1beta1/query.proto) - [QueryCommunityPoolRequest](#cosmos.distribution.v1beta1.QueryCommunityPoolRequest) @@ -264,116 +244,138 @@ - [Msg](#cosmos.distribution.v1beta1.Msg) -- [cosmos/distribution/v1beta1/genesis.proto](#cosmos/distribution/v1beta1/genesis.proto) - - [DelegatorStartingInfoRecord](#cosmos.distribution.v1beta1.DelegatorStartingInfoRecord) - - [DelegatorWithdrawInfo](#cosmos.distribution.v1beta1.DelegatorWithdrawInfo) - - [GenesisState](#cosmos.distribution.v1beta1.GenesisState) - - [ValidatorAccumulatedCommissionRecord](#cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord) - - [ValidatorCurrentRewardsRecord](#cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord) - - [ValidatorHistoricalRewardsRecord](#cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord) - - [ValidatorOutstandingRewardsRecord](#cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord) - - [ValidatorSlashEventRecord](#cosmos.distribution.v1beta1.ValidatorSlashEventRecord) +- [cosmos/evidence/v1beta1/evidence.proto](#cosmos/evidence/v1beta1/evidence.proto) + - [Equivocation](#cosmos.evidence.v1beta1.Equivocation) -- [cosmos/distribution/v1beta1/distribution.proto](#cosmos/distribution/v1beta1/distribution.proto) - - [CommunityPoolSpendProposal](#cosmos.distribution.v1beta1.CommunityPoolSpendProposal) - - [CommunityPoolSpendProposalWithDeposit](#cosmos.distribution.v1beta1.CommunityPoolSpendProposalWithDeposit) - - [DelegationDelegatorReward](#cosmos.distribution.v1beta1.DelegationDelegatorReward) - - [DelegatorStartingInfo](#cosmos.distribution.v1beta1.DelegatorStartingInfo) - - [FeePool](#cosmos.distribution.v1beta1.FeePool) - - [Params](#cosmos.distribution.v1beta1.Params) - - [ValidatorAccumulatedCommission](#cosmos.distribution.v1beta1.ValidatorAccumulatedCommission) - - [ValidatorCurrentRewards](#cosmos.distribution.v1beta1.ValidatorCurrentRewards) - - [ValidatorHistoricalRewards](#cosmos.distribution.v1beta1.ValidatorHistoricalRewards) - - [ValidatorOutstandingRewards](#cosmos.distribution.v1beta1.ValidatorOutstandingRewards) - - [ValidatorSlashEvent](#cosmos.distribution.v1beta1.ValidatorSlashEvent) - - [ValidatorSlashEvents](#cosmos.distribution.v1beta1.ValidatorSlashEvents) +- [cosmos/evidence/v1beta1/genesis.proto](#cosmos/evidence/v1beta1/genesis.proto) + - [GenesisState](#cosmos.evidence.v1beta1.GenesisState) -- [cosmos/upgrade/v1beta1/query.proto](#cosmos/upgrade/v1beta1/query.proto) - - [QueryAppliedPlanRequest](#cosmos.upgrade.v1beta1.QueryAppliedPlanRequest) - - [QueryAppliedPlanResponse](#cosmos.upgrade.v1beta1.QueryAppliedPlanResponse) - - [QueryCurrentPlanRequest](#cosmos.upgrade.v1beta1.QueryCurrentPlanRequest) - - [QueryCurrentPlanResponse](#cosmos.upgrade.v1beta1.QueryCurrentPlanResponse) - - [QueryUpgradedConsensusStateRequest](#cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest) - - [QueryUpgradedConsensusStateResponse](#cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse) +- [cosmos/evidence/v1beta1/query.proto](#cosmos/evidence/v1beta1/query.proto) + - [QueryAllEvidenceRequest](#cosmos.evidence.v1beta1.QueryAllEvidenceRequest) + - [QueryAllEvidenceResponse](#cosmos.evidence.v1beta1.QueryAllEvidenceResponse) + - [QueryEvidenceRequest](#cosmos.evidence.v1beta1.QueryEvidenceRequest) + - [QueryEvidenceResponse](#cosmos.evidence.v1beta1.QueryEvidenceResponse) - - [Query](#cosmos.upgrade.v1beta1.Query) + - [Query](#cosmos.evidence.v1beta1.Query) -- [cosmos/upgrade/v1beta1/upgrade.proto](#cosmos/upgrade/v1beta1/upgrade.proto) - - [CancelSoftwareUpgradeProposal](#cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal) - - [Plan](#cosmos.upgrade.v1beta1.Plan) - - [SoftwareUpgradeProposal](#cosmos.upgrade.v1beta1.SoftwareUpgradeProposal) +- [cosmos/evidence/v1beta1/tx.proto](#cosmos/evidence/v1beta1/tx.proto) + - [MsgSubmitEvidence](#cosmos.evidence.v1beta1.MsgSubmitEvidence) + - [MsgSubmitEvidenceResponse](#cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse) -- [cosmos/base/kv/v1beta1/kv.proto](#cosmos/base/kv/v1beta1/kv.proto) - - [Pair](#cosmos.base.kv.v1beta1.Pair) - - [Pairs](#cosmos.base.kv.v1beta1.Pairs) + - [Msg](#cosmos.evidence.v1beta1.Msg) -- [cosmos/base/abci/v1beta1/abci.proto](#cosmos/base/abci/v1beta1/abci.proto) - - [ABCIMessageLog](#cosmos.base.abci.v1beta1.ABCIMessageLog) - - [Attribute](#cosmos.base.abci.v1beta1.Attribute) - - [GasInfo](#cosmos.base.abci.v1beta1.GasInfo) - - [MsgData](#cosmos.base.abci.v1beta1.MsgData) - - [Result](#cosmos.base.abci.v1beta1.Result) - - [SearchTxsResult](#cosmos.base.abci.v1beta1.SearchTxsResult) - - [SimulationResponse](#cosmos.base.abci.v1beta1.SimulationResponse) - - [StringEvent](#cosmos.base.abci.v1beta1.StringEvent) - - [TxMsgData](#cosmos.base.abci.v1beta1.TxMsgData) - - [TxResponse](#cosmos.base.abci.v1beta1.TxResponse) +- [cosmos/feegrant/v1beta1/feegrant.proto](#cosmos/feegrant/v1beta1/feegrant.proto) + - [BasicFeeAllowance](#cosmos.feegrant.v1beta1.BasicFeeAllowance) + - [Duration](#cosmos.feegrant.v1beta1.Duration) + - [ExpiresAt](#cosmos.feegrant.v1beta1.ExpiresAt) + - [FeeAllowanceGrant](#cosmos.feegrant.v1beta1.FeeAllowanceGrant) + - [PeriodicFeeAllowance](#cosmos.feegrant.v1beta1.PeriodicFeeAllowance) -- [cosmos/base/query/v1beta1/pagination.proto](#cosmos/base/query/v1beta1/pagination.proto) - - [PageRequest](#cosmos.base.query.v1beta1.PageRequest) - - [PageResponse](#cosmos.base.query.v1beta1.PageResponse) +- [cosmos/feegrant/v1beta1/genesis.proto](#cosmos/feegrant/v1beta1/genesis.proto) + - [GenesisState](#cosmos.feegrant.v1beta1.GenesisState) -- [cosmos/base/store/v1beta1/snapshot.proto](#cosmos/base/store/v1beta1/snapshot.proto) - - [SnapshotIAVLItem](#cosmos.base.store.v1beta1.SnapshotIAVLItem) - - [SnapshotItem](#cosmos.base.store.v1beta1.SnapshotItem) - - [SnapshotStoreItem](#cosmos.base.store.v1beta1.SnapshotStoreItem) +- [cosmos/feegrant/v1beta1/query.proto](#cosmos/feegrant/v1beta1/query.proto) + - [QueryFeeAllowanceRequest](#cosmos.feegrant.v1beta1.QueryFeeAllowanceRequest) + - [QueryFeeAllowanceResponse](#cosmos.feegrant.v1beta1.QueryFeeAllowanceResponse) + - [QueryFeeAllowancesRequest](#cosmos.feegrant.v1beta1.QueryFeeAllowancesRequest) + - [QueryFeeAllowancesResponse](#cosmos.feegrant.v1beta1.QueryFeeAllowancesResponse) -- [cosmos/base/store/v1beta1/commit_info.proto](#cosmos/base/store/v1beta1/commit_info.proto) - - [CommitID](#cosmos.base.store.v1beta1.CommitID) - - [CommitInfo](#cosmos.base.store.v1beta1.CommitInfo) - - [StoreInfo](#cosmos.base.store.v1beta1.StoreInfo) + - [Query](#cosmos.feegrant.v1beta1.Query) -- [cosmos/base/v1beta1/coin.proto](#cosmos/base/v1beta1/coin.proto) - - [Coin](#cosmos.base.v1beta1.Coin) - - [DecCoin](#cosmos.base.v1beta1.DecCoin) - - [DecProto](#cosmos.base.v1beta1.DecProto) - - [IntProto](#cosmos.base.v1beta1.IntProto) +- [cosmos/feegrant/v1beta1/tx.proto](#cosmos/feegrant/v1beta1/tx.proto) + - [MsgGrantFeeAllowance](#cosmos.feegrant.v1beta1.MsgGrantFeeAllowance) + - [MsgGrantFeeAllowanceResponse](#cosmos.feegrant.v1beta1.MsgGrantFeeAllowanceResponse) + - [MsgRevokeFeeAllowance](#cosmos.feegrant.v1beta1.MsgRevokeFeeAllowance) + - [MsgRevokeFeeAllowanceResponse](#cosmos.feegrant.v1beta1.MsgRevokeFeeAllowanceResponse) -- [cosmos/base/tendermint/v1beta1/query.proto](#cosmos/base/tendermint/v1beta1/query.proto) - - [GetBlockByHeightRequest](#cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest) - - [GetBlockByHeightResponse](#cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse) - - [GetLatestBlockRequest](#cosmos.base.tendermint.v1beta1.GetLatestBlockRequest) - - [GetLatestBlockResponse](#cosmos.base.tendermint.v1beta1.GetLatestBlockResponse) - - [GetLatestValidatorSetRequest](#cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest) - - [GetLatestValidatorSetResponse](#cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse) - - [GetNodeInfoRequest](#cosmos.base.tendermint.v1beta1.GetNodeInfoRequest) - - [GetNodeInfoResponse](#cosmos.base.tendermint.v1beta1.GetNodeInfoResponse) - - [GetSyncingRequest](#cosmos.base.tendermint.v1beta1.GetSyncingRequest) - - [GetSyncingResponse](#cosmos.base.tendermint.v1beta1.GetSyncingResponse) - - [GetValidatorSetByHeightRequest](#cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest) - - [GetValidatorSetByHeightResponse](#cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse) - - [Module](#cosmos.base.tendermint.v1beta1.Module) - - [Validator](#cosmos.base.tendermint.v1beta1.Validator) - - [VersionInfo](#cosmos.base.tendermint.v1beta1.VersionInfo) + - [Msg](#cosmos.feegrant.v1beta1.Msg) - - [Service](#cosmos.base.tendermint.v1beta1.Service) +- [cosmos/genutil/v1beta1/genesis.proto](#cosmos/genutil/v1beta1/genesis.proto) + - [GenesisState](#cosmos.genutil.v1beta1.GenesisState) -- [cosmos/base/snapshots/v1beta1/snapshot.proto](#cosmos/base/snapshots/v1beta1/snapshot.proto) - - [Metadata](#cosmos.base.snapshots.v1beta1.Metadata) - - [Snapshot](#cosmos.base.snapshots.v1beta1.Snapshot) +- [cosmos/gov/v1beta1/gov.proto](#cosmos/gov/v1beta1/gov.proto) + - [Deposit](#cosmos.gov.v1beta1.Deposit) + - [DepositParams](#cosmos.gov.v1beta1.DepositParams) + - [Proposal](#cosmos.gov.v1beta1.Proposal) + - [TallyParams](#cosmos.gov.v1beta1.TallyParams) + - [TallyResult](#cosmos.gov.v1beta1.TallyResult) + - [TextProposal](#cosmos.gov.v1beta1.TextProposal) + - [Vote](#cosmos.gov.v1beta1.Vote) + - [VotingParams](#cosmos.gov.v1beta1.VotingParams) -- [cosmos/base/reflection/v1beta1/reflection.proto](#cosmos/base/reflection/v1beta1/reflection.proto) - - [ListAllInterfacesRequest](#cosmos.base.reflection.v1beta1.ListAllInterfacesRequest) - - [ListAllInterfacesResponse](#cosmos.base.reflection.v1beta1.ListAllInterfacesResponse) - - [ListImplementationsRequest](#cosmos.base.reflection.v1beta1.ListImplementationsRequest) - - [ListImplementationsResponse](#cosmos.base.reflection.v1beta1.ListImplementationsResponse) + - [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) + - [VoteOption](#cosmos.gov.v1beta1.VoteOption) - - [ReflectionService](#cosmos.base.reflection.v1beta1.ReflectionService) +- [cosmos/gov/v1beta1/genesis.proto](#cosmos/gov/v1beta1/genesis.proto) + - [GenesisState](#cosmos.gov.v1beta1.GenesisState) + +- [cosmos/gov/v1beta1/query.proto](#cosmos/gov/v1beta1/query.proto) + - [QueryDepositRequest](#cosmos.gov.v1beta1.QueryDepositRequest) + - [QueryDepositResponse](#cosmos.gov.v1beta1.QueryDepositResponse) + - [QueryDepositsRequest](#cosmos.gov.v1beta1.QueryDepositsRequest) + - [QueryDepositsResponse](#cosmos.gov.v1beta1.QueryDepositsResponse) + - [QueryParamsRequest](#cosmos.gov.v1beta1.QueryParamsRequest) + - [QueryParamsResponse](#cosmos.gov.v1beta1.QueryParamsResponse) + - [QueryProposalRequest](#cosmos.gov.v1beta1.QueryProposalRequest) + - [QueryProposalResponse](#cosmos.gov.v1beta1.QueryProposalResponse) + - [QueryProposalsRequest](#cosmos.gov.v1beta1.QueryProposalsRequest) + - [QueryProposalsResponse](#cosmos.gov.v1beta1.QueryProposalsResponse) + - [QueryTallyResultRequest](#cosmos.gov.v1beta1.QueryTallyResultRequest) + - [QueryTallyResultResponse](#cosmos.gov.v1beta1.QueryTallyResultResponse) + - [QueryVoteRequest](#cosmos.gov.v1beta1.QueryVoteRequest) + - [QueryVoteResponse](#cosmos.gov.v1beta1.QueryVoteResponse) + - [QueryVotesRequest](#cosmos.gov.v1beta1.QueryVotesRequest) + - [QueryVotesResponse](#cosmos.gov.v1beta1.QueryVotesResponse) + + - [Query](#cosmos.gov.v1beta1.Query) + +- [cosmos/gov/v1beta1/tx.proto](#cosmos/gov/v1beta1/tx.proto) + - [MsgDeposit](#cosmos.gov.v1beta1.MsgDeposit) + - [MsgDepositResponse](#cosmos.gov.v1beta1.MsgDepositResponse) + - [MsgSubmitProposal](#cosmos.gov.v1beta1.MsgSubmitProposal) + - [MsgSubmitProposalResponse](#cosmos.gov.v1beta1.MsgSubmitProposalResponse) + - [MsgVote](#cosmos.gov.v1beta1.MsgVote) + - [MsgVoteResponse](#cosmos.gov.v1beta1.MsgVoteResponse) + + - [Msg](#cosmos.gov.v1beta1.Msg) + +- [cosmos/mint/v1beta1/mint.proto](#cosmos/mint/v1beta1/mint.proto) + - [Minter](#cosmos.mint.v1beta1.Minter) + - [Params](#cosmos.mint.v1beta1.Params) + +- [cosmos/mint/v1beta1/genesis.proto](#cosmos/mint/v1beta1/genesis.proto) + - [GenesisState](#cosmos.mint.v1beta1.GenesisState) + +- [cosmos/mint/v1beta1/query.proto](#cosmos/mint/v1beta1/query.proto) + - [QueryAnnualProvisionsRequest](#cosmos.mint.v1beta1.QueryAnnualProvisionsRequest) + - [QueryAnnualProvisionsResponse](#cosmos.mint.v1beta1.QueryAnnualProvisionsResponse) + - [QueryInflationRequest](#cosmos.mint.v1beta1.QueryInflationRequest) + - [QueryInflationResponse](#cosmos.mint.v1beta1.QueryInflationResponse) + - [QueryParamsRequest](#cosmos.mint.v1beta1.QueryParamsRequest) + - [QueryParamsResponse](#cosmos.mint.v1beta1.QueryParamsResponse) + + - [Query](#cosmos.mint.v1beta1.Query) + +- [cosmos/params/v1beta1/params.proto](#cosmos/params/v1beta1/params.proto) + - [ParamChange](#cosmos.params.v1beta1.ParamChange) + - [ParameterChangeProposal](#cosmos.params.v1beta1.ParameterChangeProposal) + +- [cosmos/params/v1beta1/query.proto](#cosmos/params/v1beta1/query.proto) + - [QueryParamsRequest](#cosmos.params.v1beta1.QueryParamsRequest) + - [QueryParamsResponse](#cosmos.params.v1beta1.QueryParamsResponse) + + - [Query](#cosmos.params.v1beta1.Query) - [cosmos/slashing/v1beta1/slashing.proto](#cosmos/slashing/v1beta1/slashing.proto) - [Params](#cosmos.slashing.v1beta1.Params) - [ValidatorSigningInfo](#cosmos.slashing.v1beta1.ValidatorSigningInfo) +- [cosmos/slashing/v1beta1/genesis.proto](#cosmos/slashing/v1beta1/genesis.proto) + - [GenesisState](#cosmos.slashing.v1beta1.GenesisState) + - [MissedBlock](#cosmos.slashing.v1beta1.MissedBlock) + - [SigningInfo](#cosmos.slashing.v1beta1.SigningInfo) + - [ValidatorMissedBlocks](#cosmos.slashing.v1beta1.ValidatorMissedBlocks) + - [cosmos/slashing/v1beta1/query.proto](#cosmos/slashing/v1beta1/query.proto) - [QueryParamsRequest](#cosmos.slashing.v1beta1.QueryParamsRequest) - [QueryParamsResponse](#cosmos.slashing.v1beta1.QueryParamsResponse) @@ -390,47 +392,33 @@ - [Msg](#cosmos.slashing.v1beta1.Msg) -- [cosmos/slashing/v1beta1/genesis.proto](#cosmos/slashing/v1beta1/genesis.proto) - - [GenesisState](#cosmos.slashing.v1beta1.GenesisState) - - [MissedBlock](#cosmos.slashing.v1beta1.MissedBlock) - - [SigningInfo](#cosmos.slashing.v1beta1.SigningInfo) - - [ValidatorMissedBlocks](#cosmos.slashing.v1beta1.ValidatorMissedBlocks) +- [cosmos/staking/v1beta1/staking.proto](#cosmos/staking/v1beta1/staking.proto) + - [Commission](#cosmos.staking.v1beta1.Commission) + - [CommissionRates](#cosmos.staking.v1beta1.CommissionRates) + - [DVPair](#cosmos.staking.v1beta1.DVPair) + - [DVPairs](#cosmos.staking.v1beta1.DVPairs) + - [DVVTriplet](#cosmos.staking.v1beta1.DVVTriplet) + - [DVVTriplets](#cosmos.staking.v1beta1.DVVTriplets) + - [Delegation](#cosmos.staking.v1beta1.Delegation) + - [DelegationResponse](#cosmos.staking.v1beta1.DelegationResponse) + - [Description](#cosmos.staking.v1beta1.Description) + - [HistoricalInfo](#cosmos.staking.v1beta1.HistoricalInfo) + - [Params](#cosmos.staking.v1beta1.Params) + - [Pool](#cosmos.staking.v1beta1.Pool) + - [Redelegation](#cosmos.staking.v1beta1.Redelegation) + - [RedelegationEntry](#cosmos.staking.v1beta1.RedelegationEntry) + - [RedelegationEntryResponse](#cosmos.staking.v1beta1.RedelegationEntryResponse) + - [RedelegationResponse](#cosmos.staking.v1beta1.RedelegationResponse) + - [UnbondingDelegation](#cosmos.staking.v1beta1.UnbondingDelegation) + - [UnbondingDelegationEntry](#cosmos.staking.v1beta1.UnbondingDelegationEntry) + - [ValAddresses](#cosmos.staking.v1beta1.ValAddresses) + - [Validator](#cosmos.staking.v1beta1.Validator) -- [cosmos/evidence/v1beta1/evidence.proto](#cosmos/evidence/v1beta1/evidence.proto) - - [Equivocation](#cosmos.evidence.v1beta1.Equivocation) + - [BondStatus](#cosmos.staking.v1beta1.BondStatus) -- [cosmos/evidence/v1beta1/query.proto](#cosmos/evidence/v1beta1/query.proto) - - [QueryAllEvidenceRequest](#cosmos.evidence.v1beta1.QueryAllEvidenceRequest) - - [QueryAllEvidenceResponse](#cosmos.evidence.v1beta1.QueryAllEvidenceResponse) - - [QueryEvidenceRequest](#cosmos.evidence.v1beta1.QueryEvidenceRequest) - - [QueryEvidenceResponse](#cosmos.evidence.v1beta1.QueryEvidenceResponse) - - - [Query](#cosmos.evidence.v1beta1.Query) - -- [cosmos/evidence/v1beta1/tx.proto](#cosmos/evidence/v1beta1/tx.proto) - - [MsgSubmitEvidence](#cosmos.evidence.v1beta1.MsgSubmitEvidence) - - [MsgSubmitEvidenceResponse](#cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse) - - - [Msg](#cosmos.evidence.v1beta1.Msg) - -- [cosmos/evidence/v1beta1/genesis.proto](#cosmos/evidence/v1beta1/genesis.proto) - - [GenesisState](#cosmos.evidence.v1beta1.GenesisState) - -- [cosmos/auth/v1beta1/auth.proto](#cosmos/auth/v1beta1/auth.proto) - - [BaseAccount](#cosmos.auth.v1beta1.BaseAccount) - - [ModuleAccount](#cosmos.auth.v1beta1.ModuleAccount) - - [Params](#cosmos.auth.v1beta1.Params) - -- [cosmos/auth/v1beta1/query.proto](#cosmos/auth/v1beta1/query.proto) - - [QueryAccountRequest](#cosmos.auth.v1beta1.QueryAccountRequest) - - [QueryAccountResponse](#cosmos.auth.v1beta1.QueryAccountResponse) - - [QueryParamsRequest](#cosmos.auth.v1beta1.QueryParamsRequest) - - [QueryParamsResponse](#cosmos.auth.v1beta1.QueryParamsResponse) - - - [Query](#cosmos.auth.v1beta1.Query) - -- [cosmos/auth/v1beta1/genesis.proto](#cosmos/auth/v1beta1/genesis.proto) - - [GenesisState](#cosmos.auth.v1beta1.GenesisState) +- [cosmos/staking/v1beta1/genesis.proto](#cosmos/staking/v1beta1/genesis.proto) + - [GenesisState](#cosmos.staking.v1beta1.GenesisState) + - [LastValidatorPower](#cosmos.staking.v1beta1.LastValidatorPower) - [cosmos/staking/v1beta1/query.proto](#cosmos/staking/v1beta1/query.proto) - [QueryDelegationRequest](#cosmos.staking.v1beta1.QueryDelegationRequest) @@ -478,33 +466,55 @@ - [Msg](#cosmos.staking.v1beta1.Msg) -- [cosmos/staking/v1beta1/genesis.proto](#cosmos/staking/v1beta1/genesis.proto) - - [GenesisState](#cosmos.staking.v1beta1.GenesisState) - - [LastValidatorPower](#cosmos.staking.v1beta1.LastValidatorPower) +- [cosmos/tx/signing/v1beta1/signing.proto](#cosmos/tx/signing/v1beta1/signing.proto) + - [SignatureDescriptor](#cosmos.tx.signing.v1beta1.SignatureDescriptor) + - [SignatureDescriptor.Data](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data) + - [SignatureDescriptor.Data.Multi](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi) + - [SignatureDescriptor.Data.Single](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single) + - [SignatureDescriptors](#cosmos.tx.signing.v1beta1.SignatureDescriptors) -- [cosmos/staking/v1beta1/staking.proto](#cosmos/staking/v1beta1/staking.proto) - - [Commission](#cosmos.staking.v1beta1.Commission) - - [CommissionRates](#cosmos.staking.v1beta1.CommissionRates) - - [DVPair](#cosmos.staking.v1beta1.DVPair) - - [DVPairs](#cosmos.staking.v1beta1.DVPairs) - - [DVVTriplet](#cosmos.staking.v1beta1.DVVTriplet) - - [DVVTriplets](#cosmos.staking.v1beta1.DVVTriplets) - - [Delegation](#cosmos.staking.v1beta1.Delegation) - - [DelegationResponse](#cosmos.staking.v1beta1.DelegationResponse) - - [Description](#cosmos.staking.v1beta1.Description) - - [HistoricalInfo](#cosmos.staking.v1beta1.HistoricalInfo) - - [Params](#cosmos.staking.v1beta1.Params) - - [Pool](#cosmos.staking.v1beta1.Pool) - - [Redelegation](#cosmos.staking.v1beta1.Redelegation) - - [RedelegationEntry](#cosmos.staking.v1beta1.RedelegationEntry) - - [RedelegationEntryResponse](#cosmos.staking.v1beta1.RedelegationEntryResponse) - - [RedelegationResponse](#cosmos.staking.v1beta1.RedelegationResponse) - - [UnbondingDelegation](#cosmos.staking.v1beta1.UnbondingDelegation) - - [UnbondingDelegationEntry](#cosmos.staking.v1beta1.UnbondingDelegationEntry) - - [ValAddresses](#cosmos.staking.v1beta1.ValAddresses) - - [Validator](#cosmos.staking.v1beta1.Validator) + - [SignMode](#cosmos.tx.signing.v1beta1.SignMode) - - [BondStatus](#cosmos.staking.v1beta1.BondStatus) +- [cosmos/tx/v1beta1/tx.proto](#cosmos/tx/v1beta1/tx.proto) + - [AuthInfo](#cosmos.tx.v1beta1.AuthInfo) + - [Fee](#cosmos.tx.v1beta1.Fee) + - [ModeInfo](#cosmos.tx.v1beta1.ModeInfo) + - [ModeInfo.Multi](#cosmos.tx.v1beta1.ModeInfo.Multi) + - [ModeInfo.Single](#cosmos.tx.v1beta1.ModeInfo.Single) + - [SignDoc](#cosmos.tx.v1beta1.SignDoc) + - [SignerInfo](#cosmos.tx.v1beta1.SignerInfo) + - [Tx](#cosmos.tx.v1beta1.Tx) + - [TxBody](#cosmos.tx.v1beta1.TxBody) + - [TxRaw](#cosmos.tx.v1beta1.TxRaw) + +- [cosmos/tx/v1beta1/service.proto](#cosmos/tx/v1beta1/service.proto) + - [BroadcastTxRequest](#cosmos.tx.v1beta1.BroadcastTxRequest) + - [BroadcastTxResponse](#cosmos.tx.v1beta1.BroadcastTxResponse) + - [GetTxRequest](#cosmos.tx.v1beta1.GetTxRequest) + - [GetTxResponse](#cosmos.tx.v1beta1.GetTxResponse) + - [GetTxsEventRequest](#cosmos.tx.v1beta1.GetTxsEventRequest) + - [GetTxsEventResponse](#cosmos.tx.v1beta1.GetTxsEventResponse) + - [SimulateRequest](#cosmos.tx.v1beta1.SimulateRequest) + - [SimulateResponse](#cosmos.tx.v1beta1.SimulateResponse) + + - [BroadcastMode](#cosmos.tx.v1beta1.BroadcastMode) + + - [Service](#cosmos.tx.v1beta1.Service) + +- [cosmos/upgrade/v1beta1/upgrade.proto](#cosmos/upgrade/v1beta1/upgrade.proto) + - [CancelSoftwareUpgradeProposal](#cosmos.upgrade.v1beta1.CancelSoftwareUpgradeProposal) + - [Plan](#cosmos.upgrade.v1beta1.Plan) + - [SoftwareUpgradeProposal](#cosmos.upgrade.v1beta1.SoftwareUpgradeProposal) + +- [cosmos/upgrade/v1beta1/query.proto](#cosmos/upgrade/v1beta1/query.proto) + - [QueryAppliedPlanRequest](#cosmos.upgrade.v1beta1.QueryAppliedPlanRequest) + - [QueryAppliedPlanResponse](#cosmos.upgrade.v1beta1.QueryAppliedPlanResponse) + - [QueryCurrentPlanRequest](#cosmos.upgrade.v1beta1.QueryCurrentPlanRequest) + - [QueryCurrentPlanResponse](#cosmos.upgrade.v1beta1.QueryCurrentPlanResponse) + - [QueryUpgradedConsensusStateRequest](#cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest) + - [QueryUpgradedConsensusStateResponse](#cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse) + + - [Query](#cosmos.upgrade.v1beta1.Query) - [cosmos/vesting/v1beta1/tx.proto](#cosmos/vesting/v1beta1/tx.proto) - [MsgCreateVestingAccount](#cosmos.vesting.v1beta1.MsgCreateVestingAccount) @@ -519,15 +529,13 @@ - [Period](#cosmos.vesting.v1beta1.Period) - [PeriodicVestingAccount](#cosmos.vesting.v1beta1.PeriodicVestingAccount) -- [cosmos/params/v1beta1/query.proto](#cosmos/params/v1beta1/query.proto) - - [QueryParamsRequest](#cosmos.params.v1beta1.QueryParamsRequest) - - [QueryParamsResponse](#cosmos.params.v1beta1.QueryParamsResponse) +- [ibc/applications/transfer/v1/transfer.proto](#ibc/applications/transfer/v1/transfer.proto) + - [DenomTrace](#ibc.applications.transfer.v1.DenomTrace) + - [FungibleTokenPacketData](#ibc.applications.transfer.v1.FungibleTokenPacketData) + - [Params](#ibc.applications.transfer.v1.Params) - - [Query](#cosmos.params.v1beta1.Query) - -- [cosmos/params/v1beta1/params.proto](#cosmos/params/v1beta1/params.proto) - - [ParamChange](#cosmos.params.v1beta1.ParamChange) - - [ParameterChangeProposal](#cosmos.params.v1beta1.ParameterChangeProposal) +- [ibc/applications/transfer/v1/genesis.proto](#ibc/applications/transfer/v1/genesis.proto) + - [GenesisState](#ibc.applications.transfer.v1.GenesisState) - [ibc/applications/transfer/v1/query.proto](#ibc/applications/transfer/v1/query.proto) - [QueryDenomTraceRequest](#ibc.applications.transfer.v1.QueryDenomTraceRequest) @@ -539,20 +547,6 @@ - [Query](#ibc.applications.transfer.v1.Query) -- [ibc/applications/transfer/v1/tx.proto](#ibc/applications/transfer/v1/tx.proto) - - [MsgTransfer](#ibc.applications.transfer.v1.MsgTransfer) - - [MsgTransferResponse](#ibc.applications.transfer.v1.MsgTransferResponse) - - - [Msg](#ibc.applications.transfer.v1.Msg) - -- [ibc/applications/transfer/v1/transfer.proto](#ibc/applications/transfer/v1/transfer.proto) - - [DenomTrace](#ibc.applications.transfer.v1.DenomTrace) - - [FungibleTokenPacketData](#ibc.applications.transfer.v1.FungibleTokenPacketData) - - [Params](#ibc.applications.transfer.v1.Params) - -- [ibc/applications/transfer/v1/genesis.proto](#ibc/applications/transfer/v1/genesis.proto) - - [GenesisState](#ibc.applications.transfer.v1.GenesisState) - - [ibc/core/client/v1/client.proto](#ibc/core/client/v1/client.proto) - [ClientConsensusStates](#ibc.core.client.v1.ClientConsensusStates) - [ClientUpdateProposal](#ibc.core.client.v1.ClientUpdateProposal) @@ -561,36 +555,11 @@ - [IdentifiedClientState](#ibc.core.client.v1.IdentifiedClientState) - [Params](#ibc.core.client.v1.Params) -- [ibc/core/client/v1/query.proto](#ibc/core/client/v1/query.proto) - - [QueryClientParamsRequest](#ibc.core.client.v1.QueryClientParamsRequest) - - [QueryClientParamsResponse](#ibc.core.client.v1.QueryClientParamsResponse) - - [QueryClientStateRequest](#ibc.core.client.v1.QueryClientStateRequest) - - [QueryClientStateResponse](#ibc.core.client.v1.QueryClientStateResponse) - - [QueryClientStatesRequest](#ibc.core.client.v1.QueryClientStatesRequest) - - [QueryClientStatesResponse](#ibc.core.client.v1.QueryClientStatesResponse) - - [QueryConsensusStateRequest](#ibc.core.client.v1.QueryConsensusStateRequest) - - [QueryConsensusStateResponse](#ibc.core.client.v1.QueryConsensusStateResponse) - - [QueryConsensusStatesRequest](#ibc.core.client.v1.QueryConsensusStatesRequest) - - [QueryConsensusStatesResponse](#ibc.core.client.v1.QueryConsensusStatesResponse) +- [ibc/applications/transfer/v1/tx.proto](#ibc/applications/transfer/v1/tx.proto) + - [MsgTransfer](#ibc.applications.transfer.v1.MsgTransfer) + - [MsgTransferResponse](#ibc.applications.transfer.v1.MsgTransferResponse) - - [Query](#ibc.core.client.v1.Query) - -- [ibc/core/client/v1/tx.proto](#ibc/core/client/v1/tx.proto) - - [MsgCreateClient](#ibc.core.client.v1.MsgCreateClient) - - [MsgCreateClientResponse](#ibc.core.client.v1.MsgCreateClientResponse) - - [MsgSubmitMisbehaviour](#ibc.core.client.v1.MsgSubmitMisbehaviour) - - [MsgSubmitMisbehaviourResponse](#ibc.core.client.v1.MsgSubmitMisbehaviourResponse) - - [MsgUpdateClient](#ibc.core.client.v1.MsgUpdateClient) - - [MsgUpdateClientResponse](#ibc.core.client.v1.MsgUpdateClientResponse) - - [MsgUpgradeClient](#ibc.core.client.v1.MsgUpgradeClient) - - [MsgUpgradeClientResponse](#ibc.core.client.v1.MsgUpgradeClientResponse) - - - [Msg](#ibc.core.client.v1.Msg) - -- [ibc/core/client/v1/genesis.proto](#ibc/core/client/v1/genesis.proto) - - [GenesisMetadata](#ibc.core.client.v1.GenesisMetadata) - - [GenesisState](#ibc.core.client.v1.GenesisState) - - [IdentifiedGenesisMetadata](#ibc.core.client.v1.IdentifiedGenesisMetadata) + - [Msg](#ibc.applications.transfer.v1.Msg) - [ibc/core/channel/v1/channel.proto](#ibc/core/channel/v1/channel.proto) - [Acknowledgement](#ibc.core.channel.v1.Acknowledgement) @@ -603,6 +572,10 @@ - [Order](#ibc.core.channel.v1.Order) - [State](#ibc.core.channel.v1.State) +- [ibc/core/channel/v1/genesis.proto](#ibc/core/channel/v1/genesis.proto) + - [GenesisState](#ibc.core.channel.v1.GenesisState) + - [PacketSequence](#ibc.core.channel.v1.PacketSequence) + - [ibc/core/channel/v1/query.proto](#ibc/core/channel/v1/query.proto) - [QueryChannelClientStateRequest](#ibc.core.channel.v1.QueryChannelClientStateRequest) - [QueryChannelClientStateResponse](#ibc.core.channel.v1.QueryChannelClientStateResponse) @@ -657,9 +630,36 @@ - [Msg](#ibc.core.channel.v1.Msg) -- [ibc/core/channel/v1/genesis.proto](#ibc/core/channel/v1/genesis.proto) - - [GenesisState](#ibc.core.channel.v1.GenesisState) - - [PacketSequence](#ibc.core.channel.v1.PacketSequence) +- [ibc/core/client/v1/genesis.proto](#ibc/core/client/v1/genesis.proto) + - [GenesisMetadata](#ibc.core.client.v1.GenesisMetadata) + - [GenesisState](#ibc.core.client.v1.GenesisState) + - [IdentifiedGenesisMetadata](#ibc.core.client.v1.IdentifiedGenesisMetadata) + +- [ibc/core/client/v1/query.proto](#ibc/core/client/v1/query.proto) + - [QueryClientParamsRequest](#ibc.core.client.v1.QueryClientParamsRequest) + - [QueryClientParamsResponse](#ibc.core.client.v1.QueryClientParamsResponse) + - [QueryClientStateRequest](#ibc.core.client.v1.QueryClientStateRequest) + - [QueryClientStateResponse](#ibc.core.client.v1.QueryClientStateResponse) + - [QueryClientStatesRequest](#ibc.core.client.v1.QueryClientStatesRequest) + - [QueryClientStatesResponse](#ibc.core.client.v1.QueryClientStatesResponse) + - [QueryConsensusStateRequest](#ibc.core.client.v1.QueryConsensusStateRequest) + - [QueryConsensusStateResponse](#ibc.core.client.v1.QueryConsensusStateResponse) + - [QueryConsensusStatesRequest](#ibc.core.client.v1.QueryConsensusStatesRequest) + - [QueryConsensusStatesResponse](#ibc.core.client.v1.QueryConsensusStatesResponse) + + - [Query](#ibc.core.client.v1.Query) + +- [ibc/core/client/v1/tx.proto](#ibc/core/client/v1/tx.proto) + - [MsgCreateClient](#ibc.core.client.v1.MsgCreateClient) + - [MsgCreateClientResponse](#ibc.core.client.v1.MsgCreateClientResponse) + - [MsgSubmitMisbehaviour](#ibc.core.client.v1.MsgSubmitMisbehaviour) + - [MsgSubmitMisbehaviourResponse](#ibc.core.client.v1.MsgSubmitMisbehaviourResponse) + - [MsgUpdateClient](#ibc.core.client.v1.MsgUpdateClient) + - [MsgUpdateClientResponse](#ibc.core.client.v1.MsgUpdateClientResponse) + - [MsgUpgradeClient](#ibc.core.client.v1.MsgUpgradeClient) + - [MsgUpgradeClientResponse](#ibc.core.client.v1.MsgUpgradeClientResponse) + + - [Msg](#ibc.core.client.v1.Msg) - [ibc/core/commitment/v1/commitment.proto](#ibc/core/commitment/v1/commitment.proto) - [MerklePath](#ibc.core.commitment.v1.MerklePath) @@ -677,6 +677,9 @@ - [State](#ibc.core.connection.v1.State) +- [ibc/core/connection/v1/genesis.proto](#ibc/core/connection/v1/genesis.proto) + - [GenesisState](#ibc.core.connection.v1.GenesisState) + - [ibc/core/connection/v1/query.proto](#ibc/core/connection/v1/query.proto) - [QueryClientConnectionsRequest](#ibc.core.connection.v1.QueryClientConnectionsRequest) - [QueryClientConnectionsResponse](#ibc.core.connection.v1.QueryClientConnectionsResponse) @@ -703,22 +706,12 @@ - [Msg](#ibc.core.connection.v1.Msg) -- [ibc/core/connection/v1/genesis.proto](#ibc/core/connection/v1/genesis.proto) - - [GenesisState](#ibc.core.connection.v1.GenesisState) - - [ibc/core/types/v1/genesis.proto](#ibc/core/types/v1/genesis.proto) - [GenesisState](#ibc.core.types.v1.GenesisState) - [ibc/lightclients/localhost/v1/localhost.proto](#ibc/lightclients/localhost/v1/localhost.proto) - [ClientState](#ibc.lightclients.localhost.v1.ClientState) -- [ibc/lightclients/tendermint/v1/tendermint.proto](#ibc/lightclients/tendermint/v1/tendermint.proto) - - [ClientState](#ibc.lightclients.tendermint.v1.ClientState) - - [ConsensusState](#ibc.lightclients.tendermint.v1.ConsensusState) - - [Fraction](#ibc.lightclients.tendermint.v1.Fraction) - - [Header](#ibc.lightclients.tendermint.v1.Header) - - [Misbehaviour](#ibc.lightclients.tendermint.v1.Misbehaviour) - - [ibc/lightclients/solomachine/v1/solomachine.proto](#ibc/lightclients/solomachine/v1/solomachine.proto) - [ChannelStateData](#ibc.lightclients.solomachine.v1.ChannelStateData) - [ClientState](#ibc.lightclients.solomachine.v1.ClientState) @@ -739,190 +732,74 @@ - [DataType](#ibc.lightclients.solomachine.v1.DataType) +- [ibc/lightclients/tendermint/v1/tendermint.proto](#ibc/lightclients/tendermint/v1/tendermint.proto) + - [ClientState](#ibc.lightclients.tendermint.v1.ClientState) + - [ConsensusState](#ibc.lightclients.tendermint.v1.ConsensusState) + - [Fraction](#ibc.lightclients.tendermint.v1.Fraction) + - [Header](#ibc.lightclients.tendermint.v1.Header) + - [Misbehaviour](#ibc.lightclients.tendermint.v1.Misbehaviour) + - [Scalar Value Types](#scalar-value-types) - +

Top

-## cosmos/tx/v1beta1/tx.proto +## cosmos/auth/v1beta1/auth.proto - + -### AuthInfo -AuthInfo describes the fee and signer modes that are used to sign a -transaction. +### BaseAccount +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). | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `signer_infos` | [SignerInfo](#cosmos.tx.v1beta1.SignerInfo) | repeated | 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. | -| `fee` | [Fee](#cosmos.tx.v1beta1.Fee) | | 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. | +| `address` | [string](#string) | | | +| `pub_key` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `account_number` | [uint64](#uint64) | | | +| `sequence` | [uint64](#uint64) | | | - + -### Fee -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. +### ModuleAccount +ModuleAccount defines an account for modules that holds coins on a pool. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | amount is the amount of coins to be paid as a fee | -| `gas_limit` | [uint64](#uint64) | | gas_limit is the maximum gas that can be used in transaction processing before an out of gas error occurs | -| `payer` | [string](#string) | | 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. | -| `granter` | [string](#string) | | 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 | +| `base_account` | [BaseAccount](#cosmos.auth.v1beta1.BaseAccount) | | | +| `name` | [string](#string) | | | +| `permissions` | [string](#string) | repeated | | - + -### ModeInfo -ModeInfo describes the signing mode of a single or nested multisig signer. +### Params +Params defines the parameters for the auth module. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `single` | [ModeInfo.Single](#cosmos.tx.v1beta1.ModeInfo.Single) | | single represents a single signer | -| `multi` | [ModeInfo.Multi](#cosmos.tx.v1beta1.ModeInfo.Multi) | | multi represents a nested multisig signer | - - - - - - - - -### ModeInfo.Multi -Multi is the mode info for a multisig public key - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `bitarray` | [cosmos.crypto.multisig.v1beta1.CompactBitArray](#cosmos.crypto.multisig.v1beta1.CompactBitArray) | | bitarray specifies which keys within the multisig are signing | -| `mode_infos` | [ModeInfo](#cosmos.tx.v1beta1.ModeInfo) | repeated | mode_infos is the corresponding modes of the signers of the multisig which could include nested multisig public keys | - - - - - - - - -### ModeInfo.Single -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 - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `mode` | [cosmos.tx.signing.v1beta1.SignMode](#cosmos.tx.signing.v1beta1.SignMode) | | mode is the signing mode of the single signer | - - - - - - - - -### SignDoc -SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `body_bytes` | [bytes](#bytes) | | body_bytes is protobuf serialization of a TxBody that matches the representation in TxRaw. | -| `auth_info_bytes` | [bytes](#bytes) | | auth_info_bytes is a protobuf serialization of an AuthInfo that matches the representation in TxRaw. | -| `chain_id` | [string](#string) | | 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 | -| `account_number` | [uint64](#uint64) | | account_number is the account number of the account in state | - - - - - - - - -### SignerInfo -SignerInfo describes the public key and signing mode of a single top-level -signer. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `public_key` | [google.protobuf.Any](#google.protobuf.Any) | | 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. | -| `mode_info` | [ModeInfo](#cosmos.tx.v1beta1.ModeInfo) | | mode_info describes the signing mode of the signer and is a nested structure to support nested multisig pubkey's | -| `sequence` | [uint64](#uint64) | | 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. | - - - - - - - - -### Tx -Tx is the standard type used for broadcasting transactions. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `body` | [TxBody](#cosmos.tx.v1beta1.TxBody) | | body is the processable content of the transaction | -| `auth_info` | [AuthInfo](#cosmos.tx.v1beta1.AuthInfo) | | auth_info is the authorization related content of the transaction, specifically signers, signer modes and fee | -| `signatures` | [bytes](#bytes) | repeated | 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. | - - - - - - - - -### TxBody -TxBody is the body of a transaction that all signers sign over. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | 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. | -| `memo` | [string](#string) | | memo is any arbitrary memo to be added to the transaction | -| `timeout_height` | [uint64](#uint64) | | timeout is the block height after which this transaction will not be processed by the chain | -| `extension_options` | [google.protobuf.Any](#google.protobuf.Any) | repeated | 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 | -| `non_critical_extension_options` | [google.protobuf.Any](#google.protobuf.Any) | repeated | 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 | - - - - - - - - -### TxRaw -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `body_bytes` | [bytes](#bytes) | | body_bytes is a protobuf serialization of a TxBody that matches the representation in SignDoc. | -| `auth_info_bytes` | [bytes](#bytes) | | auth_info_bytes is a protobuf serialization of an AuthInfo that matches the representation in SignDoc. | -| `signatures` | [bytes](#bytes) | repeated | 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. | +| `max_memo_characters` | [uint64](#uint64) | | | +| `tx_sig_limit` | [uint64](#uint64) | | | +| `tx_size_cost_per_byte` | [uint64](#uint64) | | | +| `sig_verify_cost_ed25519` | [uint64](#uint64) | | | +| `sig_verify_cost_secp256k1` | [uint64](#uint64) | | | @@ -938,364 +815,23 @@ as the transaction ID. - +

Top

-## cosmos/tx/v1beta1/service.proto +## cosmos/auth/v1beta1/genesis.proto - - -### BroadcastTxRequest -BroadcastTxRequest is the request type for the Service.BroadcastTxRequest -RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `tx_bytes` | [bytes](#bytes) | | tx_bytes is the raw transaction. | -| `mode` | [BroadcastMode](#cosmos.tx.v1beta1.BroadcastMode) | | | - - - - - - - - -### BroadcastTxResponse -BroadcastTxResponse is the response type for the -Service.BroadcastTx method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `tx_response` | [cosmos.base.abci.v1beta1.TxResponse](#cosmos.base.abci.v1beta1.TxResponse) | | tx_response is the queried TxResponses. | - - - - - - - - -### GetTxRequest -GetTxRequest is the request type for the Service.GetTx -RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `hash` | [string](#string) | | hash is the tx hash to query, encoded as a hex string. | - - - - - - - - -### GetTxResponse -GetTxResponse is the response type for the Service.GetTx method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `tx` | [Tx](#cosmos.tx.v1beta1.Tx) | | tx is the queried transaction. | -| `tx_response` | [cosmos.base.abci.v1beta1.TxResponse](#cosmos.base.abci.v1beta1.TxResponse) | | tx_response is the queried TxResponses. | - - - - - - - - -### GetTxsEventRequest -GetTxsEventRequest is the request type for the Service.TxsByEvents -RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `events` | [string](#string) | repeated | events is the list of transaction event type. | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an pagination for the request. | - - - - - - - - -### GetTxsEventResponse -GetTxsEventResponse is the response type for the Service.TxsByEvents -RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `txs` | [Tx](#cosmos.tx.v1beta1.Tx) | repeated | txs is the list of queried transactions. | -| `tx_responses` | [cosmos.base.abci.v1beta1.TxResponse](#cosmos.base.abci.v1beta1.TxResponse) | repeated | tx_responses is the list of queried TxResponses. | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines an pagination for the response. | - - - - - - - - -### SimulateRequest -SimulateRequest is the request type for the Service.Simulate -RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `tx` | [Tx](#cosmos.tx.v1beta1.Tx) | | tx is the transaction to simulate. | - - - - - - - - -### SimulateResponse -SimulateResponse is the response type for the -Service.SimulateRPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `gas_info` | [cosmos.base.abci.v1beta1.GasInfo](#cosmos.base.abci.v1beta1.GasInfo) | | gas_info is the information about gas used in the simulation. | -| `result` | [cosmos.base.abci.v1beta1.Result](#cosmos.base.abci.v1beta1.Result) | | result is the result of the simulation. | - - - - - - - - - - -### BroadcastMode -BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. - -| Name | Number | Description | -| ---- | ------ | ----------- | -| BROADCAST_MODE_UNSPECIFIED | 0 | zero-value for mode ordering | -| BROADCAST_MODE_BLOCK | 1 | BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for the tx to be committed in a block. | -| BROADCAST_MODE_SYNC | 2 | BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for a CheckTx execution response only. | -| BROADCAST_MODE_ASYNC | 3 | BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns immediately. | - - - - - - - - - -### Service -Service defines a gRPC service for interacting with transactions. - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Simulate` | [SimulateRequest](#cosmos.tx.v1beta1.SimulateRequest) | [SimulateResponse](#cosmos.tx.v1beta1.SimulateResponse) | Simulate simulates executing a transaction for estimating gas usage. | POST|/cosmos/tx/v1beta1/simulate| -| `GetTx` | [GetTxRequest](#cosmos.tx.v1beta1.GetTxRequest) | [GetTxResponse](#cosmos.tx.v1beta1.GetTxResponse) | GetTx fetches a tx by hash. | GET|/cosmos/tx/v1beta1/txs/{hash}| -| `BroadcastTx` | [BroadcastTxRequest](#cosmos.tx.v1beta1.BroadcastTxRequest) | [BroadcastTxResponse](#cosmos.tx.v1beta1.BroadcastTxResponse) | BroadcastTx broadcast transaction. | POST|/cosmos/tx/v1beta1/txs| -| `GetTxsEvent` | [GetTxsEventRequest](#cosmos.tx.v1beta1.GetTxsEventRequest) | [GetTxsEventResponse](#cosmos.tx.v1beta1.GetTxsEventResponse) | GetTxsEvent fetches txs by event. | GET|/cosmos/tx/v1beta1/txs| - - - - - - -

Top

- -## cosmos/tx/signing/v1beta1/signing.proto - - - - - -### SignatureDescriptor -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `public_key` | [google.protobuf.Any](#google.protobuf.Any) | | public_key is the public key of the signer | -| `data` | [SignatureDescriptor.Data](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data) | | | -| `sequence` | [uint64](#uint64) | | 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. | - - - - - - - - -### SignatureDescriptor.Data -Data represents signature data - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `single` | [SignatureDescriptor.Data.Single](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single) | | single represents a single signer | -| `multi` | [SignatureDescriptor.Data.Multi](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi) | | multi represents a multisig signer | - - - - - - - - -### SignatureDescriptor.Data.Multi -Multi is the signature data for a multisig public key - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `bitarray` | [cosmos.crypto.multisig.v1beta1.CompactBitArray](#cosmos.crypto.multisig.v1beta1.CompactBitArray) | | bitarray specifies which keys within the multisig are signing | -| `signatures` | [SignatureDescriptor.Data](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data) | repeated | signatures is the signatures of the multi-signature | - - - - - - - - -### SignatureDescriptor.Data.Single -Single is the signature data for a single signer - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `mode` | [SignMode](#cosmos.tx.signing.v1beta1.SignMode) | | mode is the signing mode of the single signer | -| `signature` | [bytes](#bytes) | | signature is the raw signature bytes | - - - - - - - - -### SignatureDescriptors -SignatureDescriptors wraps multiple SignatureDescriptor's. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `signatures` | [SignatureDescriptor](#cosmos.tx.signing.v1beta1.SignatureDescriptor) | repeated | signatures are the signature descriptors | - - - - - - - - - - -### SignMode -SignMode represents a signing mode with its own security guarantees. - -| Name | Number | Description | -| ---- | ------ | ----------- | -| SIGN_MODE_UNSPECIFIED | 0 | SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be rejected | -| SIGN_MODE_DIRECT | 1 | SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is verified with raw bytes from Tx | -| SIGN_MODE_TEXTUAL | 2 | 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_LEGACY_AMINO_JSON | 127 | SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses Amino JSON and will be removed in the future | - - - - - - - - - - - -

Top

- -## cosmos/crisis/v1beta1/tx.proto - - - - - -### MsgVerifyInvariant -MsgVerifyInvariant represents a message to verify a particular invariance. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `sender` | [string](#string) | | | -| `invariant_module_name` | [string](#string) | | | -| `invariant_route` | [string](#string) | | | - - - - - - - - -### MsgVerifyInvariantResponse -MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. - - - - - - - - - - - - - - -### Msg -Msg defines the bank Msg service. - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `VerifyInvariant` | [MsgVerifyInvariant](#cosmos.crisis.v1beta1.MsgVerifyInvariant) | [MsgVerifyInvariantResponse](#cosmos.crisis.v1beta1.MsgVerifyInvariantResponse) | VerifyInvariant defines a method to verify a particular invariance. | | - - - - - - -

Top

- -## cosmos/crisis/v1beta1/genesis.proto - - - - + ### GenesisState -GenesisState defines the crisis module's genesis state. +GenesisState defines the auth module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `constant_fee` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | constant_fee is the fee used to verify the invariant in the crisis module. | +| `params` | [Params](#cosmos.auth.v1beta1.Params) | | params defines all the paramaters of the module. | +| `accounts` | [google.protobuf.Any](#google.protobuf.Any) | repeated | accounts are the accounts present at genesis. | @@ -1311,253 +847,44 @@ GenesisState defines the crisis module's genesis state. - +

Top

-## cosmos/crypto/multisig/keys.proto +## cosmos/auth/v1beta1/query.proto - + -### LegacyAminoPubKey -LegacyAminoPubKey specifies a public key type -which nests multiple public keys and a threshold, -it uses legacy amino address rules. +### QueryAccountRequest +QueryAccountRequest is the request type for the Query/Account RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `threshold` | [uint32](#uint32) | | | -| `public_keys` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | +| `address` | [string](#string) | | address defines the address to query for. | - - + - - - - - - - -

Top

- -## cosmos/crypto/multisig/v1beta1/multisig.proto - - - - - -### CompactBitArray -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. +### QueryAccountResponse +QueryAccountResponse is the response type for the Query/Account RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `extra_bits_stored` | [uint32](#uint32) | | | -| `elems` | [bytes](#bytes) | | | +| `account` | [google.protobuf.Any](#google.protobuf.Any) | | account defines the account of the corresponding address. | - - -### MultiSignature -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `signatures` | [bytes](#bytes) | repeated | | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/crypto/secp256k1/keys.proto - - - - - -### PrivKey -PrivKey defines a secp256k1 private key. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `key` | [bytes](#bytes) | | | - - - - - - - - -### PubKey -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `key` | [bytes](#bytes) | | | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/crypto/ed25519/keys.proto - - - - - -### PrivKey -PrivKey defines a ed25519 private key. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `key` | [bytes](#bytes) | | | - - - - - - - - -### PubKey -PubKey defines a ed25519 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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `key` | [bytes](#bytes) | | | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/mint/v1beta1/query.proto - - - - - -### QueryAnnualProvisionsRequest -QueryAnnualProvisionsRequest is the request type for the -Query/AnnualProvisions RPC method. - - - - - - - - -### QueryAnnualProvisionsResponse -QueryAnnualProvisionsResponse is the response type for the -Query/AnnualProvisions RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `annual_provisions` | [bytes](#bytes) | | annual_provisions is the current minting annual provisions value. | - - - - - - - - -### QueryInflationRequest -QueryInflationRequest is the request type for the Query/Inflation RPC method. - - - - - - - - -### QueryInflationResponse -QueryInflationResponse is the response type for the Query/Inflation RPC -method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `inflation` | [bytes](#bytes) | | inflation is the current minting inflation value. | - - - - - - - + ### QueryParamsRequest QueryParamsRequest is the request type for the Query/Params RPC method. @@ -1567,7 +894,7 @@ QueryParamsRequest is the request type for the Query/Params RPC method. - + ### QueryParamsResponse QueryParamsResponse is the response type for the Query/Params RPC method. @@ -1575,7 +902,7 @@ QueryParamsResponse is the response type for the Query/Params RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `params` | [Params](#cosmos.mint.v1beta1.Params) | | params defines the parameters of the module. | +| `params` | [Params](#cosmos.auth.v1beta1.Params) | | params defines the parameters of the module. | @@ -1588,38 +915,89 @@ QueryParamsResponse is the response type for the Query/Params RPC method. - + ### Query -Query provides defines the gRPC querier service. +Query defines the gRPC querier service. | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Params` | [QueryParamsRequest](#cosmos.mint.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.mint.v1beta1.QueryParamsResponse) | Params returns the total set of minting parameters. | GET|/cosmos/mint/v1beta1/params| -| `Inflation` | [QueryInflationRequest](#cosmos.mint.v1beta1.QueryInflationRequest) | [QueryInflationResponse](#cosmos.mint.v1beta1.QueryInflationResponse) | Inflation returns the current minting inflation value. | GET|/cosmos/mint/v1beta1/inflation| -| `AnnualProvisions` | [QueryAnnualProvisionsRequest](#cosmos.mint.v1beta1.QueryAnnualProvisionsRequest) | [QueryAnnualProvisionsResponse](#cosmos.mint.v1beta1.QueryAnnualProvisionsResponse) | AnnualProvisions current minting annual provisions value. | GET|/cosmos/mint/v1beta1/annual_provisions| +| `Account` | [QueryAccountRequest](#cosmos.auth.v1beta1.QueryAccountRequest) | [QueryAccountResponse](#cosmos.auth.v1beta1.QueryAccountResponse) | Account returns account details based on address. | GET|/cosmos/auth/v1beta1/accounts/{address}| +| `Params` | [QueryParamsRequest](#cosmos.auth.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.auth.v1beta1.QueryParamsResponse) | Params queries all parameters. | GET|/cosmos/auth/v1beta1/params| - +

Top

-## cosmos/mint/v1beta1/genesis.proto +## cosmos/base/v1beta1/coin.proto - + -### GenesisState -GenesisState defines the mint module's genesis state. +### Coin +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. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `minter` | [Minter](#cosmos.mint.v1beta1.Minter) | | minter is a space for holding current inflation information. | -| `params` | [Params](#cosmos.mint.v1beta1.Params) | | params defines all the paramaters of the module. | +| `denom` | [string](#string) | | | +| `amount` | [string](#string) | | | + + + + + + + + +### DecCoin +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `denom` | [string](#string) | | | +| `amount` | [string](#string) | | | + + + + + + + + +### DecProto +DecProto defines a Protobuf wrapper around a Dec object. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `dec` | [string](#string) | | | + + + + + + + + +### IntProto +IntProto defines a Protobuf wrapper around an Int object. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `int` | [string](#string) | | | @@ -1635,147 +1013,56 @@ GenesisState defines the mint module's genesis state. - +

Top

-## cosmos/mint/v1beta1/mint.proto +## cosmos/authz/v1beta1/authz.proto - + -### Minter -Minter represents the minting state. +### AuthorizationGrant +AuthorizationGrant gives permissions to execute +the provide method with expiration time. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `inflation` | [string](#string) | | current annual inflation rate | -| `annual_provisions` | [string](#string) | | current annual expected provisions | +| `authorization` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `expiration` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | - + -### Params -Params holds parameters for the mint module. +### GenericAuthorization +GenericAuthorization gives the grantee unrestricted permissions to execute +the provided method on behalf of the granter's account. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `mint_denom` | [string](#string) | | type of coin to mint | -| `inflation_rate_change` | [string](#string) | | maximum annual change in inflation rate | -| `inflation_max` | [string](#string) | | maximum inflation rate | -| `inflation_min` | [string](#string) | | minimum inflation rate | -| `goal_bonded` | [string](#string) | | goal of percent bonded atoms | -| `blocks_per_year` | [uint64](#uint64) | | expected blocks per year | +| `method_name` | [string](#string) | | method name to grant unrestricted permissions to execute Note: MethodName() is already a method on `GenericAuthorization` type, we need some custom naming here so using `MessageName` | - - + - - - - - - - -

Top

- -## cosmos/feegrant/v1beta1/feegrant.proto - - - - - -### BasicFeeAllowance -BasicFeeAllowance implements FeeAllowance with a one-time grant of tokens -that optionally expires. The delegatee can use up to SpendLimit to cover fees. +### SendAuthorization +SendAuthorization allows the grantee to spend up to spend_limit coins from +the granter's account. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `spend_limit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | -| `expiration` | [ExpiresAt](#cosmos.feegrant.v1beta1.ExpiresAt) | | | - - - - - - - - -### Duration -Duration is a span of a clock time or number of blocks. -This is designed to be added to an ExpiresAt struct. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `duration` | [google.protobuf.Duration](#google.protobuf.Duration) | | | -| `blocks` | [uint64](#uint64) | | | - - - - - - - - -### ExpiresAt -ExpiresAt is a point in time where something expires. -It may be *either* block time or block height - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `height` | [int64](#int64) | | | - - - - - - - - -### FeeAllowanceGrant -FeeAllowanceGrant is stored in the KVStore to record a grant with full context - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `granter` | [string](#string) | | | -| `grantee` | [string](#string) | | | -| `allowance` | [google.protobuf.Any](#google.protobuf.Any) | | | - - - - - - - - -### PeriodicFeeAllowance -PeriodicFeeAllowance extends FeeAllowance to allow for both a maximum cap, -as well as a limit per time period. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `basic` | [BasicFeeAllowance](#cosmos.feegrant.v1beta1.BasicFeeAllowance) | | | -| `period` | [Duration](#cosmos.feegrant.v1beta1.Duration) | | | -| `period_spend_limit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | -| `period_can_spend` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | -| `period_reset` | [ExpiresAt](#cosmos.feegrant.v1beta1.ExpiresAt) | | | @@ -1791,52 +1078,480 @@ as well as a limit per time period. - +

Top

-## cosmos/feegrant/v1beta1/query.proto +## cosmos/base/abci/v1beta1/abci.proto - + -### QueryFeeAllowanceRequest -QueryFeeAllowanceRequest is the request type for the Query/FeeAllowance RPC method. +### ABCIMessageLog +ABCIMessageLog defines a structure containing an indexed tx ABCI message log. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `msg_index` | [uint32](#uint32) | | | +| `log` | [string](#string) | | | +| `events` | [StringEvent](#cosmos.base.abci.v1beta1.StringEvent) | repeated | Events contains a slice of Event objects that were emitted during some execution. | + + + + + + + + +### Attribute +Attribute defines an attribute wrapper where the key and value are +strings instead of raw bytes. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `key` | [string](#string) | | | +| `value` | [string](#string) | | | + + + + + + + + +### GasInfo +GasInfo defines tx execution gas context. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `gas_wanted` | [uint64](#uint64) | | GasWanted is the maximum units of work we allow this tx to perform. | +| `gas_used` | [uint64](#uint64) | | GasUsed is the amount of gas actually consumed. | + + + + + + + + +### MsgData +MsgData defines the data returned in a Result object during message +execution. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `msg_type` | [string](#string) | | | +| `data` | [bytes](#bytes) | | | + + + + + + + + +### Result +Result is the union of ResponseFormat and ResponseCheckTx. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `data` | [bytes](#bytes) | | Data is any data returned from message or handler execution. It MUST be length prefixed in order to separate data from multiple message executions. | +| `log` | [string](#string) | | Log contains the log information from message or handler execution. | +| `events` | [tendermint.abci.Event](#tendermint.abci.Event) | repeated | Events contains a slice of Event objects that were emitted during message or handler execution. | + + + + + + + + +### SearchTxsResult +SearchTxsResult defines a structure for querying txs pageable + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `total_count` | [uint64](#uint64) | | Count of all txs | +| `count` | [uint64](#uint64) | | Count of txs in current page | +| `page_number` | [uint64](#uint64) | | Index of current page, start from 1 | +| `page_total` | [uint64](#uint64) | | Count of total pages | +| `limit` | [uint64](#uint64) | | Max count txs per page | +| `txs` | [TxResponse](#cosmos.base.abci.v1beta1.TxResponse) | repeated | List of txs in current page | + + + + + + + + +### SimulationResponse +SimulationResponse defines the response generated when a transaction is +successfully simulated. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `gas_info` | [GasInfo](#cosmos.base.abci.v1beta1.GasInfo) | | | +| `result` | [Result](#cosmos.base.abci.v1beta1.Result) | | | + + + + + + + + +### StringEvent +StringEvent defines en Event object wrapper where all the attributes +contain key/value pairs that are strings instead of raw bytes. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `type` | [string](#string) | | | +| `attributes` | [Attribute](#cosmos.base.abci.v1beta1.Attribute) | repeated | | + + + + + + + + +### TxMsgData +TxMsgData defines a list of MsgData. A transaction will have a MsgData object +for each message. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `data` | [MsgData](#cosmos.base.abci.v1beta1.MsgData) | repeated | | + + + + + + + + +### TxResponse +TxResponse defines a structure containing relevant tx data and metadata. The +tags are stringified and the log is JSON decoded. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `height` | [int64](#int64) | | The block height | +| `txhash` | [string](#string) | | The transaction hash. | +| `codespace` | [string](#string) | | Namespace for the Code | +| `code` | [uint32](#uint32) | | Response code. | +| `data` | [string](#string) | | Result bytes, if any. | +| `raw_log` | [string](#string) | | The output of the application's logger (raw string). May be non-deterministic. | +| `logs` | [ABCIMessageLog](#cosmos.base.abci.v1beta1.ABCIMessageLog) | repeated | The output of the application's logger (typed). May be non-deterministic. | +| `info` | [string](#string) | | Additional information. May be non-deterministic. | +| `gas_wanted` | [int64](#int64) | | Amount of gas requested for transaction. | +| `gas_used` | [int64](#int64) | | Amount of gas consumed by transaction. | +| `tx` | [google.protobuf.Any](#google.protobuf.Any) | | The request transaction bytes. | +| `timestamp` | [string](#string) | | 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. | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/authz/v1beta1/tx.proto + + + + + +### MsgExecAuthorizedRequest +MsgExecAuthorizedRequest 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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `grantee` | [string](#string) | | | +| `msgs` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | + + + + + + + + +### MsgExecAuthorizedResponse +MsgExecAuthorizedResponse defines the Msg/MsgExecAuthorizedResponse response type. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `result` | [cosmos.base.abci.v1beta1.Result](#cosmos.base.abci.v1beta1.Result) | | | + + + + + + + + +### MsgGrantAuthorizationRequest +MsgGrantAuthorizationRequest grants the provided authorization to the grantee on the granter's +account with the provided expiration time. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `granter` | [string](#string) | | | | `grantee` | [string](#string) | | | +| `authorization` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `expiration` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | - + -### QueryFeeAllowanceResponse -QueryFeeAllowanceResponse is the response type for the Query/FeeAllowance RPC method. +### MsgGrantAuthorizationResponse +MsgGrantAuthorizationResponse defines the Msg/MsgGrantAuthorization response type. + + + + + + + + +### MsgRevokeAuthorizationRequest +MsgRevokeAuthorizationRequest revokes any authorization with the provided sdk.Msg type on the +granter's account with that has been granted to the grantee. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `fee_allowance` | [FeeAllowanceGrant](#cosmos.feegrant.v1beta1.FeeAllowanceGrant) | | fee_allowance is a fee_allowance granted for grantee by granter. | +| `granter` | [string](#string) | | | +| `grantee` | [string](#string) | | | +| `method_name` | [string](#string) | | | - + -### QueryFeeAllowancesRequest -QueryFeeAllowancesRequest is the request type for the Query/FeeAllowances RPC method. +### MsgRevokeAuthorizationResponse +MsgRevokeAuthorizationResponse defines the Msg/MsgRevokeAuthorizationResponse response type. + + + + + + + + + + + + + + +### Msg +Msg defines the authz Msg service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `GrantAuthorization` | [MsgGrantAuthorizationRequest](#cosmos.authz.v1beta1.MsgGrantAuthorizationRequest) | [MsgGrantAuthorizationResponse](#cosmos.authz.v1beta1.MsgGrantAuthorizationResponse) | GrantAuthorization grants the provided authorization to the grantee on the granter's account with the provided expiration time. | | +| `ExecAuthorized` | [MsgExecAuthorizedRequest](#cosmos.authz.v1beta1.MsgExecAuthorizedRequest) | [MsgExecAuthorizedResponse](#cosmos.authz.v1beta1.MsgExecAuthorizedResponse) | ExecAuthorized 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. | | +| `RevokeAuthorization` | [MsgRevokeAuthorizationRequest](#cosmos.authz.v1beta1.MsgRevokeAuthorizationRequest) | [MsgRevokeAuthorizationResponse](#cosmos.authz.v1beta1.MsgRevokeAuthorizationResponse) | RevokeAuthorization revokes any authorization corresponding to the provided method name on the granter's account that has been granted to the grantee. | | + + + + + + +

Top

+ +## cosmos/authz/v1beta1/genesis.proto + + + + + +### GenesisState +GenesisState defines the authz module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | +| `authorization` | [GrantAuthorization](#cosmos.authz.v1beta1.GrantAuthorization) | repeated | | + + + + + + + + +### GrantAuthorization +GrantAuthorization defines the GenesisState/GrantAuthorization type. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `granter` | [string](#string) | | | +| `grantee` | [string](#string) | | | +| `authorization` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `expiration` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/base/query/v1beta1/pagination.proto + + + + + +### PageRequest +PageRequest is to be embedded in gRPC request messages for efficient +pagination. Ex: + + message SomeRequest { + Foo some_parameter = 1; + PageRequest pagination = 2; + } + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `key` | [bytes](#bytes) | | key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set. | +| `offset` | [uint64](#uint64) | | offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set. | +| `limit` | [uint64](#uint64) | | limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app. | +| `count_total` | [bool](#bool) | | 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. | + + + + + + + + +### PageResponse +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; + } + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `next_key` | [bytes](#bytes) | | next_key is the key to be passed to PageRequest.key to query the next page most efficiently | +| `total` | [uint64](#uint64) | | total is total number of results available if PageRequest.count_total was set, its value is undefined otherwise | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/authz/v1beta1/query.proto + + + + + +### QueryAuthorizationRequest +QueryAuthorizationRequest is the request type for the Query/Authorization RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `granter` | [string](#string) | | | +| `grantee` | [string](#string) | | | +| `method_name` | [string](#string) | | | + + + + + + + + +### QueryAuthorizationResponse +QueryAuthorizationResponse is the response type for the Query/Authorization RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `authorization` | [AuthorizationGrant](#cosmos.authz.v1beta1.AuthorizationGrant) | | authorization is a authorization granted for grantee by granter. | + + + + + + + + +### QueryAuthorizationsRequest +QueryAuthorizationsRequest is the request type for the Query/Authorizations RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `granter` | [string](#string) | | | | `grantee` | [string](#string) | | | | `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an pagination for the request. | @@ -1845,15 +1560,15 @@ QueryFeeAllowancesRequest is the request type for the Query/FeeAllowances RPC me - + -### QueryFeeAllowancesResponse -QueryFeeAllowancesResponse is the response type for the Query/FeeAllowances RPC method. +### QueryAuthorizationsResponse +QueryAuthorizationsResponse is the response type for the Query/Authorizations RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `fee_allowances` | [FeeAllowanceGrant](#cosmos.feegrant.v1beta1.FeeAllowanceGrant) | repeated | fee_allowances are fee_allowance's granted for grantee by granter. | +| `authorizations` | [AuthorizationGrant](#cosmos.authz.v1beta1.AuthorizationGrant) | repeated | authorizations is a list of grants granted for grantee by granter. | | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines an pagination for the response. | @@ -1867,240 +1582,15 @@ QueryFeeAllowancesResponse is the response type for the Query/FeeAllowances RPC - + ### Query Query defines the gRPC querier service. | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `FeeAllowance` | [QueryFeeAllowanceRequest](#cosmos.feegrant.v1beta1.QueryFeeAllowanceRequest) | [QueryFeeAllowanceResponse](#cosmos.feegrant.v1beta1.QueryFeeAllowanceResponse) | FeeAllowance returns fee granted to the grantee by the granter. | GET|/cosmos/feegrant/v1beta1/fee_allowance/{granter}/{grantee}| -| `FeeAllowances` | [QueryFeeAllowancesRequest](#cosmos.feegrant.v1beta1.QueryFeeAllowancesRequest) | [QueryFeeAllowancesResponse](#cosmos.feegrant.v1beta1.QueryFeeAllowancesResponse) | FeeAllowances returns all the grants for address. | GET|/cosmos/feegrant/v1beta1/fee_allowances/{grantee}| - - - - - - -

Top

- -## cosmos/feegrant/v1beta1/tx.proto - - - - - -### MsgGrantFeeAllowance -MsgGrantFeeAllowance adds permission for Grantee to spend up to Allowance -of fees from the account of Granter. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `granter` | [string](#string) | | | -| `grantee` | [string](#string) | | | -| `allowance` | [google.protobuf.Any](#google.protobuf.Any) | | | - - - - - - - - -### MsgGrantFeeAllowanceResponse -MsgGrantFeeAllowanceResponse defines the Msg/GrantFeeAllowanceResponse response type. - - - - - - - - -### MsgRevokeFeeAllowance -MsgRevokeFeeAllowance removes any existing FeeAllowance from Granter to Grantee. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `granter` | [string](#string) | | | -| `grantee` | [string](#string) | | | - - - - - - - - -### MsgRevokeFeeAllowanceResponse -MsgRevokeFeeAllowanceResponse defines the Msg/RevokeFeeAllowanceResponse response type. - - - - - - - - - - - - - - -### Msg -Msg defines the feegrant msg service. - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `GrantFeeAllowance` | [MsgGrantFeeAllowance](#cosmos.feegrant.v1beta1.MsgGrantFeeAllowance) | [MsgGrantFeeAllowanceResponse](#cosmos.feegrant.v1beta1.MsgGrantFeeAllowanceResponse) | GrantFeeAllowance grants fee allowance to the grantee on the granter's account with the provided expiration time. | | -| `RevokeFeeAllowance` | [MsgRevokeFeeAllowance](#cosmos.feegrant.v1beta1.MsgRevokeFeeAllowance) | [MsgRevokeFeeAllowanceResponse](#cosmos.feegrant.v1beta1.MsgRevokeFeeAllowanceResponse) | RevokeFeeAllowance revokes any fee allowance of granter's account that has been granted to the grantee. | | - - - - - - -

Top

- -## cosmos/feegrant/v1beta1/genesis.proto - - - - - -### GenesisState -GenesisState contains a set of fee allowances, persisted from the store - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `fee_allowances` | [FeeAllowanceGrant](#cosmos.feegrant.v1beta1.FeeAllowanceGrant) | repeated | | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/capability/v1beta1/capability.proto - - - - - -### Capability -Capability defines an implementation of an object capability. The index -provided to a Capability must be globally unique. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `index` | [uint64](#uint64) | | | - - - - - - - - -### CapabilityOwners -CapabilityOwners defines a set of owners of a single Capability. The set of -owners must be unique. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `owners` | [Owner](#cosmos.capability.v1beta1.Owner) | repeated | | - - - - - - - - -### Owner -Owner defines a single capability owner. An owner is defined by the name of -capability and the module name. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `module` | [string](#string) | | | -| `name` | [string](#string) | | | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/capability/v1beta1/genesis.proto - - - - - -### GenesisOwners -GenesisOwners defines the capability owners with their corresponding index. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `index` | [uint64](#uint64) | | index is the index of the capability owner. | -| `index_owners` | [CapabilityOwners](#cosmos.capability.v1beta1.CapabilityOwners) | | index_owners are the owners at the given index. | - - - - - - - - -### GenesisState -GenesisState defines the capability module's genesis state. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `index` | [uint64](#uint64) | | index is the capability global index. | -| `owners` | [GenesisOwners](#cosmos.capability.v1beta1.GenesisOwners) | repeated | owners represents a map from index to owners of the capability index index key is string to allow amino marshalling. | - - - - - - - - - - +| `Authorization` | [QueryAuthorizationRequest](#cosmos.authz.v1beta1.QueryAuthorizationRequest) | [QueryAuthorizationResponse](#cosmos.authz.v1beta1.QueryAuthorizationResponse) | Returns any `Authorization` (or `nil`), with the expiration time, granted to the grantee by the granter for the provided msg type. | GET|/cosmos/authz/v1beta1/granters/{granter}/grantees/{grantee}/grant| +| `Authorizations` | [QueryAuthorizationsRequest](#cosmos.authz.v1beta1.QueryAuthorizationsRequest) | [QueryAuthorizationsResponse](#cosmos.authz.v1beta1.QueryAuthorizationsResponse) | Returns list of `Authorization`, granted to the grantee by the granter. | GET|/cosmos/authz/v1beta1/granters/{granter}/grantees/{grantee}/grants| @@ -2230,6 +1720,57 @@ amounts in the network. + + + + + + + + + + + +

Top

+ +## cosmos/bank/v1beta1/genesis.proto + + + + + +### Balance +Balance defines an account address and balance pair used in the bank module's +genesis state. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `address` | [string](#string) | | address is the address of the balance holder. | +| `coins` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | coins defines the different coins this balance holds. | + + + + + + + + +### GenesisState +GenesisState defines the bank module's genesis state. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `params` | [Params](#cosmos.bank.v1beta1.Params) | | params defines all the paramaters of the module. | +| `balances` | [Balance](#cosmos.bank.v1beta1.Balance) | repeated | balances is an array containing the balances of all the accounts. | +| `supply` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | supply represents the total supply. | +| `denom_metadata` | [Metadata](#cosmos.bank.v1beta1.Metadata) | repeated | denom_metadata defines the metadata of the differents coins. | + + + + + @@ -2561,42 +2102,38 @@ Msg defines the bank Msg service. - +

Top

-## cosmos/bank/v1beta1/genesis.proto +## cosmos/base/kv/v1beta1/kv.proto - + -### Balance -Balance defines an account address and balance pair used in the bank module's -genesis state. +### Pair +Pair defines a key/value bytes tuple. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | address is the address of the balance holder. | -| `coins` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | coins defines the different coins this balance holds. | +| `key` | [bytes](#bytes) | | | +| `value` | [bytes](#bytes) | | | - + -### GenesisState -GenesisState defines the bank module's genesis state. +### Pairs +Pairs defines a repeated slice of Pair objects. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `params` | [Params](#cosmos.bank.v1beta1.Params) | | params defines all the paramaters of the module. | -| `balances` | [Balance](#cosmos.bank.v1beta1.Balance) | repeated | balances is an array containing the balances of all the accounts. | -| `supply` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | supply represents the total supply. | -| `denom_metadata` | [Metadata](#cosmos.bank.v1beta1.Metadata) | repeated | denom_metadata defines the metadata of the differents coins. | +| `pairs` | [Pair](#cosmos.base.kv.v1beta1.Pair) | repeated | | @@ -2612,56 +2149,125 @@ GenesisState defines the bank module's genesis state. - +

Top

-## cosmos/authz/v1beta1/authz.proto +## cosmos/base/reflection/v1beta1/reflection.proto - + -### AuthorizationGrant -AuthorizationGrant gives permissions to execute -the provide method with expiration time. +### ListAllInterfacesRequest +ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. + + + + + + + + +### ListAllInterfacesResponse +ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `authorization` | [google.protobuf.Any](#google.protobuf.Any) | | | -| `expiration` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `interface_names` | [string](#string) | repeated | interface_names is an array of all the registered interfaces. | - + -### GenericAuthorization -GenericAuthorization gives the grantee unrestricted permissions to execute -the provided method on behalf of the granter's account. +### ListImplementationsRequest +ListImplementationsRequest is the request type of the ListImplementations +RPC. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `method_name` | [string](#string) | | method name to grant unrestricted permissions to execute Note: MethodName() is already a method on `GenericAuthorization` type, we need some custom naming here so using `MessageName` | +| `interface_name` | [string](#string) | | interface_name defines the interface to query the implementations for. | - + -### SendAuthorization -SendAuthorization allows the grantee to spend up to spend_limit coins from -the granter's account. +### ListImplementationsResponse +ListImplementationsResponse is the response type of the ListImplementations +RPC. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `spend_limit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | +| `implementation_message_names` | [string](#string) | repeated | | + + + + + + + + + + + + + + +### ReflectionService +ReflectionService defines a service for interface reflection. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `ListAllInterfaces` | [ListAllInterfacesRequest](#cosmos.base.reflection.v1beta1.ListAllInterfacesRequest) | [ListAllInterfacesResponse](#cosmos.base.reflection.v1beta1.ListAllInterfacesResponse) | ListAllInterfaces lists all the interfaces registered in the interface registry. | GET|/cosmos/base/reflection/v1beta1/interfaces| +| `ListImplementations` | [ListImplementationsRequest](#cosmos.base.reflection.v1beta1.ListImplementationsRequest) | [ListImplementationsResponse](#cosmos.base.reflection.v1beta1.ListImplementationsResponse) | ListImplementations list all the concrete types that implement a given interface. | GET|/cosmos/base/reflection/v1beta1/interfaces/{interface_name}/implementations| + + + + + + +

Top

+ +## cosmos/base/snapshots/v1beta1/snapshot.proto + + + + + +### Metadata +Metadata contains SDK-specific snapshot metadata. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `chunk_hashes` | [bytes](#bytes) | repeated | SHA-256 chunk hashes | + + + + + + + + +### Snapshot +Snapshot contains Tendermint state sync snapshot info. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `height` | [uint64](#uint64) | | | +| `format` | [uint32](#uint32) | | | +| `chunks` | [uint32](#uint32) | | | +| `hash` | [bytes](#bytes) | | | +| `metadata` | [Metadata](#cosmos.base.snapshots.v1beta1.Metadata) | | | @@ -2677,55 +2283,210 @@ the granter's account. - +

Top

-## cosmos/authz/v1beta1/query.proto +## cosmos/base/store/v1beta1/commit_info.proto - + -### QueryAuthorizationRequest -QueryAuthorizationRequest is the request type for the Query/Authorization RPC method. +### CommitID +CommitID defines the committment information when a specific store is +committed. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `granter` | [string](#string) | | | -| `grantee` | [string](#string) | | | -| `method_name` | [string](#string) | | | +| `version` | [int64](#int64) | | | +| `hash` | [bytes](#bytes) | | | - + -### QueryAuthorizationResponse -QueryAuthorizationResponse is the response type for the Query/Authorization RPC method. +### CommitInfo +CommitInfo defines commit information used by the multi-store when committing +a version/height. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `authorization` | [AuthorizationGrant](#cosmos.authz.v1beta1.AuthorizationGrant) | | authorization is a authorization granted for grantee by granter. | +| `version` | [int64](#int64) | | | +| `store_infos` | [StoreInfo](#cosmos.base.store.v1beta1.StoreInfo) | repeated | | - + -### QueryAuthorizationsRequest -QueryAuthorizationsRequest is the request type for the Query/Authorizations RPC method. +### StoreInfo +StoreInfo defines store-specific commit information. It contains a reference +between a store name and the commit ID. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `name` | [string](#string) | | | +| `commit_id` | [CommitID](#cosmos.base.store.v1beta1.CommitID) | | | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/base/store/v1beta1/snapshot.proto + + + + + +### SnapshotIAVLItem +SnapshotIAVLItem is an exported IAVL node. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `key` | [bytes](#bytes) | | | +| `value` | [bytes](#bytes) | | | +| `version` | [int64](#int64) | | | +| `height` | [int32](#int32) | | | + + + + + + + + +### SnapshotItem +SnapshotItem is an item contained in a rootmulti.Store snapshot. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `store` | [SnapshotStoreItem](#cosmos.base.store.v1beta1.SnapshotStoreItem) | | | +| `iavl` | [SnapshotIAVLItem](#cosmos.base.store.v1beta1.SnapshotIAVLItem) | | | + + + + + + + + +### SnapshotStoreItem +SnapshotStoreItem contains metadata about a snapshotted store. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `name` | [string](#string) | | | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/base/tendermint/v1beta1/query.proto + + + + + +### GetBlockByHeightRequest +GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `height` | [int64](#int64) | | | + + + + + + + + +### GetBlockByHeightResponse +GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `block_id` | [tendermint.types.BlockID](#tendermint.types.BlockID) | | | +| `block` | [tendermint.types.Block](#tendermint.types.Block) | | | + + + + + + + + +### GetLatestBlockRequest +GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. + + + + + + + + +### GetLatestBlockResponse +GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `block_id` | [tendermint.types.BlockID](#tendermint.types.BlockID) | | | +| `block` | [tendermint.types.Block](#tendermint.types.Block) | | | + + + + + + + + +### GetLatestValidatorSetRequest +GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `granter` | [string](#string) | | | -| `grantee` | [string](#string) | | | | `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an pagination for the request. | @@ -2733,133 +2494,157 @@ QueryAuthorizationsRequest is the request type for the Query/Authorizations RPC - + -### QueryAuthorizationsResponse -QueryAuthorizationsResponse is the response type for the Query/Authorizations RPC method. +### GetLatestValidatorSetResponse +GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `authorizations` | [AuthorizationGrant](#cosmos.authz.v1beta1.AuthorizationGrant) | repeated | authorizations is a list of grants granted for grantee by granter. | +| `block_height` | [int64](#int64) | | | +| `validators` | [Validator](#cosmos.base.tendermint.v1beta1.Validator) | repeated | | | `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines an pagination for the response. | - - + - - - - - -### Query -Query defines the gRPC querier service. - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Authorization` | [QueryAuthorizationRequest](#cosmos.authz.v1beta1.QueryAuthorizationRequest) | [QueryAuthorizationResponse](#cosmos.authz.v1beta1.QueryAuthorizationResponse) | Returns any `Authorization` (or `nil`), with the expiration time, granted to the grantee by the granter for the provided msg type. | GET|/cosmos/authz/v1beta1/granters/{granter}/grantees/{grantee}/grant| -| `Authorizations` | [QueryAuthorizationsRequest](#cosmos.authz.v1beta1.QueryAuthorizationsRequest) | [QueryAuthorizationsResponse](#cosmos.authz.v1beta1.QueryAuthorizationsResponse) | Returns list of `Authorization`, granted to the grantee by the granter. | GET|/cosmos/authz/v1beta1/granters/{granter}/grantees/{grantee}/grants| - - +### GetNodeInfoRequest +GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. - -

Top

- -## cosmos/authz/v1beta1/tx.proto - + -### MsgExecAuthorizedRequest -MsgExecAuthorizedRequest 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. +### GetNodeInfoResponse +GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `grantee` | [string](#string) | | | -| `msgs` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | +| `default_node_info` | [tendermint.p2p.DefaultNodeInfo](#tendermint.p2p.DefaultNodeInfo) | | | +| `application_version` | [VersionInfo](#cosmos.base.tendermint.v1beta1.VersionInfo) | | | - + -### MsgExecAuthorizedResponse -MsgExecAuthorizedResponse defines the Msg/MsgExecAuthorizedResponse response type. +### GetSyncingRequest +GetSyncingRequest is the request type for the Query/GetSyncing RPC method. + + + + + + + + +### GetSyncingResponse +GetSyncingResponse is the response type for the Query/GetSyncing RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `result` | [cosmos.base.abci.v1beta1.Result](#cosmos.base.abci.v1beta1.Result) | | | +| `syncing` | [bool](#bool) | | | - + -### MsgGrantAuthorizationRequest -MsgGrantAuthorizationRequest grants the provided authorization to the grantee on the granter's -account with the provided expiration time. +### GetValidatorSetByHeightRequest +GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `granter` | [string](#string) | | | -| `grantee` | [string](#string) | | | -| `authorization` | [google.protobuf.Any](#google.protobuf.Any) | | | -| `expiration` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `height` | [int64](#int64) | | | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an pagination for the request. | - + -### MsgGrantAuthorizationResponse -MsgGrantAuthorizationResponse defines the Msg/MsgGrantAuthorization response type. - - - - - - - - -### MsgRevokeAuthorizationRequest -MsgRevokeAuthorizationRequest revokes any authorization with the provided sdk.Msg type on the -granter's account with that has been granted to the grantee. +### GetValidatorSetByHeightResponse +GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `granter` | [string](#string) | | | -| `grantee` | [string](#string) | | | -| `method_name` | [string](#string) | | | +| `block_height` | [int64](#int64) | | | +| `validators` | [Validator](#cosmos.base.tendermint.v1beta1.Validator) | repeated | | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines an pagination for the response. | - + -### MsgRevokeAuthorizationResponse -MsgRevokeAuthorizationResponse defines the Msg/MsgRevokeAuthorizationResponse response type. +### Module +Module is the type for VersionInfo + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `path` | [string](#string) | | module path | +| `version` | [string](#string) | | module version | +| `sum` | [string](#string) | | checksum | + + + + + + + + +### Validator +Validator is the type for the validator-set. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `address` | [string](#string) | | | +| `pub_key` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `voting_power` | [int64](#int64) | | | +| `proposer_priority` | [int64](#int64) | | | + + + + + + + + +### VersionInfo +VersionInfo is the type for the GetNodeInfoResponse message. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `name` | [string](#string) | | | +| `app_name` | [string](#string) | | | +| `version` | [string](#string) | | | +| `git_commit` | [string](#string) | | | +| `build_tags` | [string](#string) | | | +| `go_version` | [string](#string) | | | +| `build_deps` | [Module](#cosmos.base.tendermint.v1beta1.Module) | repeated | | @@ -2872,55 +2657,122 @@ MsgRevokeAuthorizationResponse defines the Msg/MsgRevokeAuthorizationResponse re - + -### Msg -Msg defines the authz Msg service. +### Service +Service defines the gRPC querier service for tendermint queries. | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `GrantAuthorization` | [MsgGrantAuthorizationRequest](#cosmos.authz.v1beta1.MsgGrantAuthorizationRequest) | [MsgGrantAuthorizationResponse](#cosmos.authz.v1beta1.MsgGrantAuthorizationResponse) | GrantAuthorization grants the provided authorization to the grantee on the granter's account with the provided expiration time. | | -| `ExecAuthorized` | [MsgExecAuthorizedRequest](#cosmos.authz.v1beta1.MsgExecAuthorizedRequest) | [MsgExecAuthorizedResponse](#cosmos.authz.v1beta1.MsgExecAuthorizedResponse) | ExecAuthorized 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. | | -| `RevokeAuthorization` | [MsgRevokeAuthorizationRequest](#cosmos.authz.v1beta1.MsgRevokeAuthorizationRequest) | [MsgRevokeAuthorizationResponse](#cosmos.authz.v1beta1.MsgRevokeAuthorizationResponse) | RevokeAuthorization revokes any authorization corresponding to the provided method name on the granter's account that has been granted to the grantee. | | +| `GetNodeInfo` | [GetNodeInfoRequest](#cosmos.base.tendermint.v1beta1.GetNodeInfoRequest) | [GetNodeInfoResponse](#cosmos.base.tendermint.v1beta1.GetNodeInfoResponse) | GetNodeInfo queries the current node info. | GET|/cosmos/base/tendermint/v1beta1/node_info| +| `GetSyncing` | [GetSyncingRequest](#cosmos.base.tendermint.v1beta1.GetSyncingRequest) | [GetSyncingResponse](#cosmos.base.tendermint.v1beta1.GetSyncingResponse) | GetSyncing queries node syncing. | GET|/cosmos/base/tendermint/v1beta1/syncing| +| `GetLatestBlock` | [GetLatestBlockRequest](#cosmos.base.tendermint.v1beta1.GetLatestBlockRequest) | [GetLatestBlockResponse](#cosmos.base.tendermint.v1beta1.GetLatestBlockResponse) | GetLatestBlock returns the latest block. | GET|/cosmos/base/tendermint/v1beta1/blocks/latest| +| `GetBlockByHeight` | [GetBlockByHeightRequest](#cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest) | [GetBlockByHeightResponse](#cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse) | GetBlockByHeight queries block for given height. | GET|/cosmos/base/tendermint/v1beta1/blocks/{height}| +| `GetLatestValidatorSet` | [GetLatestValidatorSetRequest](#cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest) | [GetLatestValidatorSetResponse](#cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse) | GetLatestValidatorSet queries latest validator-set. | GET|/cosmos/base/tendermint/v1beta1/validatorsets/latest| +| `GetValidatorSetByHeight` | [GetValidatorSetByHeightRequest](#cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest) | [GetValidatorSetByHeightResponse](#cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse) | GetValidatorSetByHeight queries validator-set at a given height. | GET|/cosmos/base/tendermint/v1beta1/validatorsets/{height}| - +

Top

-## cosmos/authz/v1beta1/genesis.proto +## cosmos/capability/v1beta1/capability.proto - + + +### Capability +Capability defines an implementation of an object capability. The index +provided to a Capability must be globally unique. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `index` | [uint64](#uint64) | | | + + + + + + + + +### CapabilityOwners +CapabilityOwners defines a set of owners of a single Capability. The set of +owners must be unique. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `owners` | [Owner](#cosmos.capability.v1beta1.Owner) | repeated | | + + + + + + + + +### Owner +Owner defines a single capability owner. An owner is defined by the name of +capability and the module name. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `module` | [string](#string) | | | +| `name` | [string](#string) | | | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/capability/v1beta1/genesis.proto + + + + + +### GenesisOwners +GenesisOwners defines the capability owners with their corresponding index. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `index` | [uint64](#uint64) | | index is the index of the capability owner. | +| `index_owners` | [CapabilityOwners](#cosmos.capability.v1beta1.CapabilityOwners) | | index_owners are the owners at the given index. | + + + + + + + ### GenesisState -GenesisState defines the authz module's genesis state. +GenesisState defines the capability module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `authorization` | [GrantAuthorization](#cosmos.authz.v1beta1.GrantAuthorization) | repeated | | - - - - - - - - -### GrantAuthorization -GrantAuthorization defines the GenesisState/GrantAuthorization type. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `granter` | [string](#string) | | | -| `grantee` | [string](#string) | | | -| `authorization` | [google.protobuf.Any](#google.protobuf.Any) | | | -| `expiration` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `index` | [uint64](#uint64) | | index is the capability global index. | +| `owners` | [GenesisOwners](#cosmos.capability.v1beta1.GenesisOwners) | repeated | owners represents a map from index to owners of the capability index index key is string to allow amino marshalling. | @@ -2936,149 +2788,22 @@ GrantAuthorization defines the GenesisState/GrantAuthorization type. - +

Top

-## cosmos/gov/v1beta1/gov.proto +## cosmos/crisis/v1beta1/genesis.proto - + -### Deposit -Deposit defines an amount deposited by an account address to an active -proposal. +### GenesisState +GenesisState defines the crisis module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | | -| `depositor` | [string](#string) | | | -| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | - - - - - - - - -### DepositParams -DepositParams defines the params for deposits on governance proposals. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `min_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Minimum deposit for a proposal to enter voting period. | -| `max_deposit_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | Maximum period for Atom holders to deposit on a proposal. Initial value: 2 months. | - - - - - - - - -### Proposal -Proposal defines the core field members of a governance proposal. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | | -| `content` | [google.protobuf.Any](#google.protobuf.Any) | | | -| `status` | [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) | | | -| `final_tally_result` | [TallyResult](#cosmos.gov.v1beta1.TallyResult) | | | -| `submit_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `deposit_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `total_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | -| `voting_start_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `voting_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | - - - - - - - - -### TallyParams -TallyParams defines the params for tallying votes on governance proposals. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `quorum` | [bytes](#bytes) | | Minimum percentage of total stake needed to vote for a result to be considered valid. | -| `threshold` | [bytes](#bytes) | | Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. | -| `veto_threshold` | [bytes](#bytes) | | Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Default value: 1/3. | - - - - - - - - -### TallyResult -TallyResult defines a standard tally for a governance proposal. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `yes` | [string](#string) | | | -| `abstain` | [string](#string) | | | -| `no` | [string](#string) | | | -| `no_with_veto` | [string](#string) | | | - - - - - - - - -### TextProposal -TextProposal defines a standard text proposal whose changes need to be -manually updated in case of approval. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `title` | [string](#string) | | | -| `description` | [string](#string) | | | - - - - - - - - -### Vote -Vote defines a vote on a governance proposal. -A Vote consists of a proposal ID, the voter, and the vote option. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | | -| `voter` | [string](#string) | | | -| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | | - - - - - - - - -### VotingParams -VotingParams defines the params for voting on governance proposals. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `voting_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | Length of the voting period. | +| `constant_fee` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | constant_fee is the fee used to verify the invariant in the crisis module. | @@ -3086,37 +2811,6 @@ VotingParams defines the params for voting on governance proposals. - - - -### ProposalStatus -ProposalStatus enumerates the valid statuses of a proposal. - -| Name | Number | Description | -| ---- | ------ | ----------- | -| PROPOSAL_STATUS_UNSPECIFIED | 0 | PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. | -| PROPOSAL_STATUS_DEPOSIT_PERIOD | 1 | PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit period. | -| PROPOSAL_STATUS_VOTING_PERIOD | 2 | PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting period. | -| PROPOSAL_STATUS_PASSED | 3 | PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has passed. | -| PROPOSAL_STATUS_REJECTED | 4 | PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has been rejected. | -| PROPOSAL_STATUS_FAILED | 5 | PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has failed. | - - - - - -### VoteOption -VoteOption enumerates the valid vote options for a given governance proposal. - -| Name | Number | Description | -| ---- | ------ | ----------- | -| VOTE_OPTION_UNSPECIFIED | 0 | VOTE_OPTION_UNSPECIFIED defines a no-op vote option. | -| VOTE_OPTION_YES | 1 | VOTE_OPTION_YES defines a yes vote option. | -| VOTE_OPTION_ABSTAIN | 2 | VOTE_OPTION_ABSTAIN defines an abstain vote option. | -| VOTE_OPTION_NO | 3 | VOTE_OPTION_NO defines a no vote option. | -| VOTE_OPTION_NO_WITH_VETO | 4 | VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. | - - @@ -3125,260 +2819,34 @@ VoteOption enumerates the valid vote options for a given governance proposal. - +

Top

-## cosmos/gov/v1beta1/query.proto +## cosmos/crisis/v1beta1/tx.proto - + -### QueryDepositRequest -QueryDepositRequest is the request type for the Query/Deposit RPC method. +### MsgVerifyInvariant +MsgVerifyInvariant represents a message to verify a particular invariance. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | -| `depositor` | [string](#string) | | depositor defines the deposit addresses from the proposals. | +| `sender` | [string](#string) | | | +| `invariant_module_name` | [string](#string) | | | +| `invariant_route` | [string](#string) | | | - + -### QueryDepositResponse -QueryDepositResponse is the response type for the Query/Deposit RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `deposit` | [Deposit](#cosmos.gov.v1beta1.Deposit) | | deposit defines the requested deposit. | - - - - - - - - -### QueryDepositsRequest -QueryDepositsRequest is the request type for the Query/Deposits RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | - - - - - - - - -### QueryDepositsResponse -QueryDepositsResponse is the response type for the Query/Deposits RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `deposits` | [Deposit](#cosmos.gov.v1beta1.Deposit) | repeated | | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | - - - - - - - - -### QueryParamsRequest -QueryParamsRequest is the request type for the Query/Params RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `params_type` | [string](#string) | | params_type defines which parameters to query for, can be one of "voting", "tallying" or "deposit". | - - - - - - - - -### QueryParamsResponse -QueryParamsResponse is the response type for the Query/Params RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `voting_params` | [VotingParams](#cosmos.gov.v1beta1.VotingParams) | | voting_params defines the parameters related to voting. | -| `deposit_params` | [DepositParams](#cosmos.gov.v1beta1.DepositParams) | | deposit_params defines the parameters related to deposit. | -| `tally_params` | [TallyParams](#cosmos.gov.v1beta1.TallyParams) | | tally_params defines the parameters related to tally. | - - - - - - - - -### QueryProposalRequest -QueryProposalRequest is the request type for the Query/Proposal RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | - - - - - - - - -### QueryProposalResponse -QueryProposalResponse is the response type for the Query/Proposal RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal` | [Proposal](#cosmos.gov.v1beta1.Proposal) | | | - - - - - - - - -### QueryProposalsRequest -QueryProposalsRequest is the request type for the Query/Proposals RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_status` | [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) | | proposal_status defines the status of the proposals. | -| `voter` | [string](#string) | | voter defines the voter address for the proposals. | -| `depositor` | [string](#string) | | depositor defines the deposit addresses from the proposals. | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | - - - - - - - - -### QueryProposalsResponse -QueryProposalsResponse is the response type for the Query/Proposals RPC -method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposals` | [Proposal](#cosmos.gov.v1beta1.Proposal) | repeated | | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | - - - - - - - - -### QueryTallyResultRequest -QueryTallyResultRequest is the request type for the Query/Tally RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | - - - - - - - - -### QueryTallyResultResponse -QueryTallyResultResponse is the response type for the Query/Tally RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `tally` | [TallyResult](#cosmos.gov.v1beta1.TallyResult) | | tally defines the requested tally. | - - - - - - - - -### QueryVoteRequest -QueryVoteRequest is the request type for the Query/Vote RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | -| `voter` | [string](#string) | | voter defines the oter address for the proposals. | - - - - - - - - -### QueryVoteResponse -QueryVoteResponse is the response type for the Query/Vote RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `vote` | [Vote](#cosmos.gov.v1beta1.Vote) | | vote defined the queried vote. | - - - - - - - - -### QueryVotesRequest -QueryVotesRequest is the request type for the Query/Votes RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | - - - - - - - - -### QueryVotesResponse -QueryVotesResponse is the response type for the Query/Votes RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `votes` | [Vote](#cosmos.gov.v1beta1.Vote) | repeated | votes defined the queried votes. | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | +### MsgVerifyInvariantResponse +MsgVerifyInvariantResponse defines the Msg/VerifyInvariant response type. @@ -3391,163 +2859,54 @@ QueryVotesResponse is the response type for the Query/Votes RPC method. - - -### Query -Query defines the gRPC querier service for gov module - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Proposal` | [QueryProposalRequest](#cosmos.gov.v1beta1.QueryProposalRequest) | [QueryProposalResponse](#cosmos.gov.v1beta1.QueryProposalResponse) | Proposal queries proposal details based on ProposalID. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}| -| `Proposals` | [QueryProposalsRequest](#cosmos.gov.v1beta1.QueryProposalsRequest) | [QueryProposalsResponse](#cosmos.gov.v1beta1.QueryProposalsResponse) | Proposals queries all proposals based on given status. | GET|/cosmos/gov/v1beta1/proposals| -| `Vote` | [QueryVoteRequest](#cosmos.gov.v1beta1.QueryVoteRequest) | [QueryVoteResponse](#cosmos.gov.v1beta1.QueryVoteResponse) | Vote queries voted information based on proposalID, voterAddr. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}| -| `Votes` | [QueryVotesRequest](#cosmos.gov.v1beta1.QueryVotesRequest) | [QueryVotesResponse](#cosmos.gov.v1beta1.QueryVotesResponse) | Votes queries votes of a given proposal. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/votes| -| `Params` | [QueryParamsRequest](#cosmos.gov.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.gov.v1beta1.QueryParamsResponse) | Params queries all parameters of the gov module. | GET|/cosmos/gov/v1beta1/params/{params_type}| -| `Deposit` | [QueryDepositRequest](#cosmos.gov.v1beta1.QueryDepositRequest) | [QueryDepositResponse](#cosmos.gov.v1beta1.QueryDepositResponse) | Deposit queries single deposit information based proposalID, depositAddr. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}| -| `Deposits` | [QueryDepositsRequest](#cosmos.gov.v1beta1.QueryDepositsRequest) | [QueryDepositsResponse](#cosmos.gov.v1beta1.QueryDepositsResponse) | Deposits queries all deposits of a single proposal. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits| -| `TallyResult` | [QueryTallyResultRequest](#cosmos.gov.v1beta1.QueryTallyResultRequest) | [QueryTallyResultResponse](#cosmos.gov.v1beta1.QueryTallyResultResponse) | TallyResult queries the tally of a proposal vote. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/tally| - - - - - - -

Top

- -## cosmos/gov/v1beta1/tx.proto - - - - - -### MsgDeposit -MsgDeposit defines a message to submit a deposit to an existing proposal. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | | -| `depositor` | [string](#string) | | | -| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | - - - - - - - - -### MsgDepositResponse -MsgDepositResponse defines the Msg/Deposit response type. - - - - - - - - -### MsgSubmitProposal -MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary -proposal Content. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `content` | [google.protobuf.Any](#google.protobuf.Any) | | | -| `initial_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | -| `proposer` | [string](#string) | | | - - - - - - - - -### MsgSubmitProposalResponse -MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | | - - - - - - - - -### MsgVote -MsgVote defines a message to cast a vote. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `proposal_id` | [uint64](#uint64) | | | -| `voter` | [string](#string) | | | -| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | | - - - - - - - - -### MsgVoteResponse -MsgVoteResponse defines the Msg/Vote response type. - - - - - - - - - - - - - + ### Msg Msg defines the bank Msg service. | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `SubmitProposal` | [MsgSubmitProposal](#cosmos.gov.v1beta1.MsgSubmitProposal) | [MsgSubmitProposalResponse](#cosmos.gov.v1beta1.MsgSubmitProposalResponse) | SubmitProposal defines a method to create new proposal given a content. | | -| `Vote` | [MsgVote](#cosmos.gov.v1beta1.MsgVote) | [MsgVoteResponse](#cosmos.gov.v1beta1.MsgVoteResponse) | Vote defines a method to add a vote on a specific proposal. | | -| `Deposit` | [MsgDeposit](#cosmos.gov.v1beta1.MsgDeposit) | [MsgDepositResponse](#cosmos.gov.v1beta1.MsgDepositResponse) | Deposit defines a method to add deposit on a specific proposal. | | +| `VerifyInvariant` | [MsgVerifyInvariant](#cosmos.crisis.v1beta1.MsgVerifyInvariant) | [MsgVerifyInvariantResponse](#cosmos.crisis.v1beta1.MsgVerifyInvariantResponse) | VerifyInvariant defines a method to verify a particular invariance. | | - +

Top

-## cosmos/gov/v1beta1/genesis.proto +## cosmos/crypto/ed25519/keys.proto - + -### GenesisState -GenesisState defines the gov module's genesis state. +### PrivKey +PrivKey defines a ed25519 private key. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `starting_proposal_id` | [uint64](#uint64) | | starting_proposal_id is the ID of the starting proposal. | -| `deposits` | [Deposit](#cosmos.gov.v1beta1.Deposit) | repeated | deposits defines all the deposits present at genesis. | -| `votes` | [Vote](#cosmos.gov.v1beta1.Vote) | repeated | votes defines all the votes present at genesis. | -| `proposals` | [Proposal](#cosmos.gov.v1beta1.Proposal) | repeated | proposals defines all the proposals present at genesis. | -| `deposit_params` | [DepositParams](#cosmos.gov.v1beta1.DepositParams) | | params defines all the paramaters of related to deposit. | -| `voting_params` | [VotingParams](#cosmos.gov.v1beta1.VotingParams) | | params defines all the paramaters of related to voting. | -| `tally_params` | [TallyParams](#cosmos.gov.v1beta1.TallyParams) | | params defines all the paramaters of related to tally. | +| `key` | [bytes](#bytes) | | | + + + + + + + + +### PubKey +PubKey defines a ed25519 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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `key` | [bytes](#bytes) | | | @@ -3563,22 +2922,526 @@ GenesisState defines the gov module's genesis state. - +

Top

-## cosmos/genutil/v1beta1/genesis.proto +## cosmos/crypto/multisig/keys.proto - + -### GenesisState -GenesisState defines the raw genesis transaction in JSON. +### LegacyAminoPubKey +LegacyAminoPubKey specifies a public key type +which nests multiple public keys and a threshold, +it uses legacy amino address rules. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `gen_txs` | [bytes](#bytes) | repeated | gen_txs defines the genesis transactions. | +| `threshold` | [uint32](#uint32) | | | +| `public_keys` | [google.protobuf.Any](#google.protobuf.Any) | repeated | | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/crypto/multisig/v1beta1/multisig.proto + + + + + +### CompactBitArray +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `extra_bits_stored` | [uint32](#uint32) | | | +| `elems` | [bytes](#bytes) | | | + + + + + + + + +### MultiSignature +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `signatures` | [bytes](#bytes) | repeated | | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/crypto/secp256k1/keys.proto + + + + + +### PrivKey +PrivKey defines a secp256k1 private key. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `key` | [bytes](#bytes) | | | + + + + + + + + +### PubKey +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `key` | [bytes](#bytes) | | | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/distribution/v1beta1/distribution.proto + + + + + +### CommunityPoolSpendProposal +CommunityPoolSpendProposal details a proposal for use of community funds, +together with how many coins are proposed to be spent, and to which +recipient account. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `recipient` | [string](#string) | | | +| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | + + + + + + + + +### CommunityPoolSpendProposalWithDeposit +CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal +with a deposit + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `recipient` | [string](#string) | | | +| `amount` | [string](#string) | | | +| `deposit` | [string](#string) | | | + + + + + + + + +### DelegationDelegatorReward +DelegationDelegatorReward represents the properties +of a delegator's delegation reward. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `validator_address` | [string](#string) | | | +| `reward` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | + + + + + + + + +### DelegatorStartingInfo +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `previous_period` | [uint64](#uint64) | | | +| `stake` | [string](#string) | | | +| `height` | [uint64](#uint64) | | | + + + + + + + + +### FeePool +FeePool is the global fee pool for distribution. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `community_pool` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | + + + + + + + + +### Params +Params defines the set of params for the distribution module. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `community_tax` | [string](#string) | | | +| `base_proposer_reward` | [string](#string) | | | +| `bonus_proposer_reward` | [string](#string) | | | +| `withdraw_addr_enabled` | [bool](#bool) | | | + + + + + + + + +### ValidatorAccumulatedCommission +ValidatorAccumulatedCommission represents accumulated commission +for a validator kept as a running counter, can be withdrawn at any time. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `commission` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | + + + + + + + + +### ValidatorCurrentRewards +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `rewards` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | +| `period` | [uint64](#uint64) | | | + + + + + + + + +### ValidatorHistoricalRewards +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 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `cumulative_reward_ratio` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | +| `reference_count` | [uint32](#uint32) | | | + + + + + + + + +### ValidatorOutstandingRewards +ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards +for a validator inexpensive to track, allows simple sanity checks. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `rewards` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | + + + + + + + + +### ValidatorSlashEvent +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `validator_period` | [uint64](#uint64) | | | +| `fraction` | [string](#string) | | | + + + + + + + + +### ValidatorSlashEvents +ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `validator_slash_events` | [ValidatorSlashEvent](#cosmos.distribution.v1beta1.ValidatorSlashEvent) | repeated | | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/distribution/v1beta1/genesis.proto + + + + + +### DelegatorStartingInfoRecord +DelegatorStartingInfoRecord used for import / export via genesis json. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `delegator_address` | [string](#string) | | delegator_address is the address of the delegator. | +| `validator_address` | [string](#string) | | validator_address is the address of the validator. | +| `starting_info` | [DelegatorStartingInfo](#cosmos.distribution.v1beta1.DelegatorStartingInfo) | | starting_info defines the starting info of a delegator. | + + + + + + + + +### DelegatorWithdrawInfo +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `delegator_address` | [string](#string) | | delegator_address is the address of the delegator. | +| `withdraw_address` | [string](#string) | | withdraw_address is the address to withdraw the delegation rewards to. | + + + + + + + + +### GenesisState +GenesisState defines the distribution module's genesis state. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `params` | [Params](#cosmos.distribution.v1beta1.Params) | | params defines all the paramaters of the module. | +| `fee_pool` | [FeePool](#cosmos.distribution.v1beta1.FeePool) | | fee_pool defines the fee pool at genesis. | +| `delegator_withdraw_infos` | [DelegatorWithdrawInfo](#cosmos.distribution.v1beta1.DelegatorWithdrawInfo) | repeated | fee_pool defines the delegator withdraw infos at genesis. | +| `previous_proposer` | [string](#string) | | fee_pool defines the previous proposer at genesis. | +| `outstanding_rewards` | [ValidatorOutstandingRewardsRecord](#cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord) | repeated | fee_pool defines the outstanding rewards of all validators at genesis. | +| `validator_accumulated_commissions` | [ValidatorAccumulatedCommissionRecord](#cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord) | repeated | fee_pool defines the accumulated commisions of all validators at genesis. | +| `validator_historical_rewards` | [ValidatorHistoricalRewardsRecord](#cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord) | repeated | fee_pool defines the historical rewards of all validators at genesis. | +| `validator_current_rewards` | [ValidatorCurrentRewardsRecord](#cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord) | repeated | fee_pool defines the current rewards of all validators at genesis. | +| `delegator_starting_infos` | [DelegatorStartingInfoRecord](#cosmos.distribution.v1beta1.DelegatorStartingInfoRecord) | repeated | fee_pool defines the delegator starting infos at genesis. | +| `validator_slash_events` | [ValidatorSlashEventRecord](#cosmos.distribution.v1beta1.ValidatorSlashEventRecord) | repeated | fee_pool defines the validator slash events at genesis. | + + + + + + + + +### ValidatorAccumulatedCommissionRecord +ValidatorAccumulatedCommissionRecord is used for import / export via genesis +json. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `validator_address` | [string](#string) | | validator_address is the address of the validator. | +| `accumulated` | [ValidatorAccumulatedCommission](#cosmos.distribution.v1beta1.ValidatorAccumulatedCommission) | | accumulated is the accumulated commission of a validator. | + + + + + + + + +### ValidatorCurrentRewardsRecord +ValidatorCurrentRewardsRecord is used for import / export via genesis json. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `validator_address` | [string](#string) | | validator_address is the address of the validator. | +| `rewards` | [ValidatorCurrentRewards](#cosmos.distribution.v1beta1.ValidatorCurrentRewards) | | rewards defines the current rewards of a validator. | + + + + + + + + +### ValidatorHistoricalRewardsRecord +ValidatorHistoricalRewardsRecord is used for import / export via genesis +json. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `validator_address` | [string](#string) | | validator_address is the address of the validator. | +| `period` | [uint64](#uint64) | | period defines the period the historical rewards apply to. | +| `rewards` | [ValidatorHistoricalRewards](#cosmos.distribution.v1beta1.ValidatorHistoricalRewards) | | rewards defines the historical rewards of a validator. | + + + + + + + + +### ValidatorOutstandingRewardsRecord +ValidatorOutstandingRewardsRecord is used for import/export via genesis json. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `validator_address` | [string](#string) | | validator_address is the address of the validator. | +| `outstanding_rewards` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | outstanding_rewards represents the oustanding rewards of a validator. | + + + + + + + + +### ValidatorSlashEventRecord +ValidatorSlashEventRecord is used for import / export via genesis json. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `validator_address` | [string](#string) | | validator_address is the address of the validator. | +| `height` | [uint64](#uint64) | | height defines the block height at which the slash event occured. | +| `period` | [uint64](#uint64) | | period is the period of the slash event. | +| `validator_slash_event` | [ValidatorSlashEvent](#cosmos.distribution.v1beta1.ValidatorSlashEvent) | | validator_slash_event describes the slash event. | @@ -4046,151 +3909,26 @@ Msg defines the distribution Msg service. - +

Top

-## cosmos/distribution/v1beta1/genesis.proto +## cosmos/evidence/v1beta1/evidence.proto - + -### DelegatorStartingInfoRecord -DelegatorStartingInfoRecord used for import / export via genesis json. +### Equivocation +Equivocation implements the Evidence interface and defines evidence of double +signing misbehavior. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `delegator_address` | [string](#string) | | delegator_address is the address of the delegator. | -| `validator_address` | [string](#string) | | validator_address is the address of the validator. | -| `starting_info` | [DelegatorStartingInfo](#cosmos.distribution.v1beta1.DelegatorStartingInfo) | | starting_info defines the starting info of a delegator. | - - - - - - - - -### DelegatorWithdrawInfo -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `delegator_address` | [string](#string) | | delegator_address is the address of the delegator. | -| `withdraw_address` | [string](#string) | | withdraw_address is the address to withdraw the delegation rewards to. | - - - - - - - - -### GenesisState -GenesisState defines the distribution module's genesis state. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `params` | [Params](#cosmos.distribution.v1beta1.Params) | | params defines all the paramaters of the module. | -| `fee_pool` | [FeePool](#cosmos.distribution.v1beta1.FeePool) | | fee_pool defines the fee pool at genesis. | -| `delegator_withdraw_infos` | [DelegatorWithdrawInfo](#cosmos.distribution.v1beta1.DelegatorWithdrawInfo) | repeated | fee_pool defines the delegator withdraw infos at genesis. | -| `previous_proposer` | [string](#string) | | fee_pool defines the previous proposer at genesis. | -| `outstanding_rewards` | [ValidatorOutstandingRewardsRecord](#cosmos.distribution.v1beta1.ValidatorOutstandingRewardsRecord) | repeated | fee_pool defines the outstanding rewards of all validators at genesis. | -| `validator_accumulated_commissions` | [ValidatorAccumulatedCommissionRecord](#cosmos.distribution.v1beta1.ValidatorAccumulatedCommissionRecord) | repeated | fee_pool defines the accumulated commisions of all validators at genesis. | -| `validator_historical_rewards` | [ValidatorHistoricalRewardsRecord](#cosmos.distribution.v1beta1.ValidatorHistoricalRewardsRecord) | repeated | fee_pool defines the historical rewards of all validators at genesis. | -| `validator_current_rewards` | [ValidatorCurrentRewardsRecord](#cosmos.distribution.v1beta1.ValidatorCurrentRewardsRecord) | repeated | fee_pool defines the current rewards of all validators at genesis. | -| `delegator_starting_infos` | [DelegatorStartingInfoRecord](#cosmos.distribution.v1beta1.DelegatorStartingInfoRecord) | repeated | fee_pool defines the delegator starting infos at genesis. | -| `validator_slash_events` | [ValidatorSlashEventRecord](#cosmos.distribution.v1beta1.ValidatorSlashEventRecord) | repeated | fee_pool defines the validator slash events at genesis. | - - - - - - - - -### ValidatorAccumulatedCommissionRecord -ValidatorAccumulatedCommissionRecord is used for import / export via genesis -json. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `validator_address` | [string](#string) | | validator_address is the address of the validator. | -| `accumulated` | [ValidatorAccumulatedCommission](#cosmos.distribution.v1beta1.ValidatorAccumulatedCommission) | | accumulated is the accumulated commission of a validator. | - - - - - - - - -### ValidatorCurrentRewardsRecord -ValidatorCurrentRewardsRecord is used for import / export via genesis json. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `validator_address` | [string](#string) | | validator_address is the address of the validator. | -| `rewards` | [ValidatorCurrentRewards](#cosmos.distribution.v1beta1.ValidatorCurrentRewards) | | rewards defines the current rewards of a validator. | - - - - - - - - -### ValidatorHistoricalRewardsRecord -ValidatorHistoricalRewardsRecord is used for import / export via genesis -json. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `validator_address` | [string](#string) | | validator_address is the address of the validator. | -| `period` | [uint64](#uint64) | | period defines the period the historical rewards apply to. | -| `rewards` | [ValidatorHistoricalRewards](#cosmos.distribution.v1beta1.ValidatorHistoricalRewards) | | rewards defines the historical rewards of a validator. | - - - - - - - - -### ValidatorOutstandingRewardsRecord -ValidatorOutstandingRewardsRecord is used for import/export via genesis json. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `validator_address` | [string](#string) | | validator_address is the address of the validator. | -| `outstanding_rewards` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | outstanding_rewards represents the oustanding rewards of a validator. | - - - - - - - - -### ValidatorSlashEventRecord -ValidatorSlashEventRecord is used for import / export via genesis json. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `validator_address` | [string](#string) | | validator_address is the address of the validator. | -| `height` | [uint64](#uint64) | | height defines the block height at which the slash event occured. | -| `period` | [uint64](#uint64) | | period is the period of the slash event. | -| `validator_slash_event` | [ValidatorSlashEvent](#cosmos.distribution.v1beta1.ValidatorSlashEvent) | | validator_slash_event describes the slash event. | +| `height` | [int64](#int64) | | | +| `time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `power` | [int64](#int64) | | | +| `consensus_address` | [string](#string) | | | @@ -4206,26 +3944,540 @@ ValidatorSlashEventRecord is used for import / export via genesis json. - +

Top

-## cosmos/distribution/v1beta1/distribution.proto +## cosmos/evidence/v1beta1/genesis.proto - + -### CommunityPoolSpendProposal -CommunityPoolSpendProposal details a proposal for use of community funds, -together with how many coins are proposed to be spent, and to which -recipient account. +### GenesisState +GenesisState defines the evidence module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `title` | [string](#string) | | | -| `description` | [string](#string) | | | -| `recipient` | [string](#string) | | | +| `evidence` | [google.protobuf.Any](#google.protobuf.Any) | repeated | evidence defines all the evidence at genesis. | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/evidence/v1beta1/query.proto + + + + + +### QueryAllEvidenceRequest +QueryEvidenceRequest is the request type for the Query/AllEvidence RPC +method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | + + + + + + + + +### QueryAllEvidenceResponse +QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC +method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `evidence` | [google.protobuf.Any](#google.protobuf.Any) | repeated | evidence returns all evidences. | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | + + + + + + + + +### QueryEvidenceRequest +QueryEvidenceRequest is the request type for the Query/Evidence RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `evidence_hash` | [bytes](#bytes) | | evidence_hash defines the hash of the requested evidence. | + + + + + + + + +### QueryEvidenceResponse +QueryEvidenceResponse is the response type for the Query/Evidence RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `evidence` | [google.protobuf.Any](#google.protobuf.Any) | | evidence returns the requested evidence. | + + + + + + + + + + + + + + +### Query +Query defines the gRPC querier service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `Evidence` | [QueryEvidenceRequest](#cosmos.evidence.v1beta1.QueryEvidenceRequest) | [QueryEvidenceResponse](#cosmos.evidence.v1beta1.QueryEvidenceResponse) | Evidence queries evidence based on evidence hash. | GET|/cosmos/evidence/v1beta1/evidence/{evidence_hash}| +| `AllEvidence` | [QueryAllEvidenceRequest](#cosmos.evidence.v1beta1.QueryAllEvidenceRequest) | [QueryAllEvidenceResponse](#cosmos.evidence.v1beta1.QueryAllEvidenceResponse) | AllEvidence queries all evidence. | GET|/cosmos/evidence/v1beta1/evidence| + + + + + + +

Top

+ +## cosmos/evidence/v1beta1/tx.proto + + + + + +### MsgSubmitEvidence +MsgSubmitEvidence represents a message that supports submitting arbitrary +Evidence of misbehavior such as equivocation or counterfactual signing. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `submitter` | [string](#string) | | | +| `evidence` | [google.protobuf.Any](#google.protobuf.Any) | | | + + + + + + + + +### MsgSubmitEvidenceResponse +MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `hash` | [bytes](#bytes) | | hash defines the hash of the evidence. | + + + + + + + + + + + + + + +### Msg +Msg defines the evidence Msg service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `SubmitEvidence` | [MsgSubmitEvidence](#cosmos.evidence.v1beta1.MsgSubmitEvidence) | [MsgSubmitEvidenceResponse](#cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse) | SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or counterfactual signing. | | + + + + + + +

Top

+ +## cosmos/feegrant/v1beta1/feegrant.proto + + + + + +### BasicFeeAllowance +BasicFeeAllowance implements FeeAllowance with a one-time grant of tokens +that optionally expires. The delegatee can use up to SpendLimit to cover fees. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `spend_limit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | 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. | +| `expiration` | [ExpiresAt](#cosmos.feegrant.v1beta1.ExpiresAt) | | expiration specifies an optional time when this allowance expires | + + + + + + + + +### Duration +Duration is a span of a clock time or number of blocks. +This is designed to be added to an ExpiresAt struct. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `duration` | [google.protobuf.Duration](#google.protobuf.Duration) | | | +| `blocks` | [uint64](#uint64) | | | + + + + + + + + +### ExpiresAt +ExpiresAt is a point in time where something expires. +It may be *either* block time or block height + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `height` | [int64](#int64) | | | + + + + + + + + +### FeeAllowanceGrant +FeeAllowanceGrant is stored in the KVStore to record a grant with full context + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `granter` | [string](#string) | | | +| `grantee` | [string](#string) | | | +| `allowance` | [google.protobuf.Any](#google.protobuf.Any) | | | + + + + + + + + +### PeriodicFeeAllowance +PeriodicFeeAllowance extends FeeAllowance to allow for both a maximum cap, +as well as a limit per time period. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `basic` | [BasicFeeAllowance](#cosmos.feegrant.v1beta1.BasicFeeAllowance) | | basic specifies a struct of `BasicFeeAllowance` | +| `period` | [Duration](#cosmos.feegrant.v1beta1.Duration) | | period specifies the time duration in which period_spend_limit coins can be spent before that allowance is reset | +| `period_spend_limit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | period_spend_limit specifies the maximum number of coins that can be spent in the period | +| `period_can_spend` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | period_can_spend is the number of coins left to be spent before the period_reset time | +| `period_reset` | [ExpiresAt](#cosmos.feegrant.v1beta1.ExpiresAt) | | 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 | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/feegrant/v1beta1/genesis.proto + + + + + +### GenesisState +GenesisState contains a set of fee allowances, persisted from the store + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `fee_allowances` | [FeeAllowanceGrant](#cosmos.feegrant.v1beta1.FeeAllowanceGrant) | repeated | | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/feegrant/v1beta1/query.proto + + + + + +### QueryFeeAllowanceRequest +QueryFeeAllowanceRequest is the request type for the Query/FeeAllowance RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `granter` | [string](#string) | | | +| `grantee` | [string](#string) | | | + + + + + + + + +### QueryFeeAllowanceResponse +QueryFeeAllowanceResponse is the response type for the Query/FeeAllowance RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `fee_allowance` | [FeeAllowanceGrant](#cosmos.feegrant.v1beta1.FeeAllowanceGrant) | | fee_allowance is a fee_allowance granted for grantee by granter. | + + + + + + + + +### QueryFeeAllowancesRequest +QueryFeeAllowancesRequest is the request type for the Query/FeeAllowances RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `grantee` | [string](#string) | | | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an pagination for the request. | + + + + + + + + +### QueryFeeAllowancesResponse +QueryFeeAllowancesResponse is the response type for the Query/FeeAllowances RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `fee_allowances` | [FeeAllowanceGrant](#cosmos.feegrant.v1beta1.FeeAllowanceGrant) | repeated | fee_allowances are fee_allowance's granted for grantee by granter. | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines an pagination for the response. | + + + + + + + + + + + + + + +### Query +Query defines the gRPC querier service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `FeeAllowance` | [QueryFeeAllowanceRequest](#cosmos.feegrant.v1beta1.QueryFeeAllowanceRequest) | [QueryFeeAllowanceResponse](#cosmos.feegrant.v1beta1.QueryFeeAllowanceResponse) | FeeAllowance returns fee granted to the grantee by the granter. | GET|/cosmos/feegrant/v1beta1/fee_allowance/{granter}/{grantee}| +| `FeeAllowances` | [QueryFeeAllowancesRequest](#cosmos.feegrant.v1beta1.QueryFeeAllowancesRequest) | [QueryFeeAllowancesResponse](#cosmos.feegrant.v1beta1.QueryFeeAllowancesResponse) | FeeAllowances returns all the grants for address. | GET|/cosmos/feegrant/v1beta1/fee_allowances/{grantee}| + + + + + + +

Top

+ +## cosmos/feegrant/v1beta1/tx.proto + + + + + +### MsgGrantFeeAllowance +MsgGrantFeeAllowance adds permission for Grantee to spend up to Allowance +of fees from the account of Granter. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `granter` | [string](#string) | | | +| `grantee` | [string](#string) | | | +| `allowance` | [google.protobuf.Any](#google.protobuf.Any) | | | + + + + + + + + +### MsgGrantFeeAllowanceResponse +MsgGrantFeeAllowanceResponse defines the Msg/GrantFeeAllowanceResponse response type. + + + + + + + + +### MsgRevokeFeeAllowance +MsgRevokeFeeAllowance removes any existing FeeAllowance from Granter to Grantee. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `granter` | [string](#string) | | | +| `grantee` | [string](#string) | | | + + + + + + + + +### MsgRevokeFeeAllowanceResponse +MsgRevokeFeeAllowanceResponse defines the Msg/RevokeFeeAllowanceResponse response type. + + + + + + + + + + + + + + +### Msg +Msg defines the feegrant msg service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `GrantFeeAllowance` | [MsgGrantFeeAllowance](#cosmos.feegrant.v1beta1.MsgGrantFeeAllowance) | [MsgGrantFeeAllowanceResponse](#cosmos.feegrant.v1beta1.MsgGrantFeeAllowanceResponse) | GrantFeeAllowance grants fee allowance to the grantee on the granter's account with the provided expiration time. | | +| `RevokeFeeAllowance` | [MsgRevokeFeeAllowance](#cosmos.feegrant.v1beta1.MsgRevokeFeeAllowance) | [MsgRevokeFeeAllowanceResponse](#cosmos.feegrant.v1beta1.MsgRevokeFeeAllowanceResponse) | RevokeFeeAllowance revokes any fee allowance of granter's account that has been granted to the grantee. | | + + + + + + +

Top

+ +## cosmos/genutil/v1beta1/genesis.proto + + + + + +### GenesisState +GenesisState defines the raw genesis transaction in JSON. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `gen_txs` | [bytes](#bytes) | repeated | gen_txs defines the genesis transactions. | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/gov/v1beta1/gov.proto + + + + + +### Deposit +Deposit defines an amount deposited by an account address to an active +proposal. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposal_id` | [uint64](#uint64) | | | +| `depositor` | [string](#string) | | | | `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | @@ -4233,203 +4485,192 @@ recipient account. - + -### CommunityPoolSpendProposalWithDeposit -CommunityPoolSpendProposalWithDeposit defines a CommunityPoolSpendProposal -with a deposit +### DepositParams +DepositParams defines the params for deposits on governance proposals. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `min_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | Minimum deposit for a proposal to enter voting period. | +| `max_deposit_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | Maximum period for Atom holders to deposit on a proposal. Initial value: 2 months. | + + + + + + + + +### Proposal +Proposal defines the core field members of a governance proposal. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposal_id` | [uint64](#uint64) | | | +| `content` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `status` | [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) | | | +| `final_tally_result` | [TallyResult](#cosmos.gov.v1beta1.TallyResult) | | | +| `submit_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `deposit_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `total_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | +| `voting_start_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `voting_end_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | + + + + + + + + +### TallyParams +TallyParams defines the params for tallying votes on governance proposals. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `quorum` | [bytes](#bytes) | | Minimum percentage of total stake needed to vote for a result to be considered valid. | +| `threshold` | [bytes](#bytes) | | Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. | +| `veto_threshold` | [bytes](#bytes) | | Minimum value of Veto votes to Total votes ratio for proposal to be vetoed. Default value: 1/3. | + + + + + + + + +### TallyResult +TallyResult defines a standard tally for a governance proposal. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `yes` | [string](#string) | | | +| `abstain` | [string](#string) | | | +| `no` | [string](#string) | | | +| `no_with_veto` | [string](#string) | | | + + + + + + + + +### TextProposal +TextProposal defines a standard text proposal whose changes need to be +manually updated in case of approval. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | `title` | [string](#string) | | | | `description` | [string](#string) | | | -| `recipient` | [string](#string) | | | -| `amount` | [string](#string) | | | -| `deposit` | [string](#string) | | | - + -### DelegationDelegatorReward -DelegationDelegatorReward represents the properties -of a delegator's delegation reward. +### Vote +Vote defines a vote on a governance proposal. +A Vote consists of a proposal ID, the voter, and the vote option. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `validator_address` | [string](#string) | | | -| `reward` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | +| `proposal_id` | [uint64](#uint64) | | | +| `voter` | [string](#string) | | | +| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | | - + -### DelegatorStartingInfo -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. +### VotingParams +VotingParams defines the params for voting on governance proposals. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `previous_period` | [uint64](#uint64) | | | -| `stake` | [string](#string) | | | -| `height` | [uint64](#uint64) | | | +| `voting_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | Length of the voting period. | + - -### FeePool -FeePool is the global fee pool for distribution. + + +### ProposalStatus +ProposalStatus enumerates the valid statuses of a proposal. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| PROPOSAL_STATUS_UNSPECIFIED | 0 | PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. | +| PROPOSAL_STATUS_DEPOSIT_PERIOD | 1 | PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit period. | +| PROPOSAL_STATUS_VOTING_PERIOD | 2 | PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting period. | +| PROPOSAL_STATUS_PASSED | 3 | PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has passed. | +| PROPOSAL_STATUS_REJECTED | 4 | PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has been rejected. | +| PROPOSAL_STATUS_FAILED | 5 | PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has failed. | + + + + + +### VoteOption +VoteOption enumerates the valid vote options for a given governance proposal. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| VOTE_OPTION_UNSPECIFIED | 0 | VOTE_OPTION_UNSPECIFIED defines a no-op vote option. | +| VOTE_OPTION_YES | 1 | VOTE_OPTION_YES defines a yes vote option. | +| VOTE_OPTION_ABSTAIN | 2 | VOTE_OPTION_ABSTAIN defines an abstain vote option. | +| VOTE_OPTION_NO | 3 | VOTE_OPTION_NO defines a no vote option. | +| VOTE_OPTION_NO_WITH_VETO | 4 | VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. | + + + + + + + + + + + +

Top

+ +## cosmos/gov/v1beta1/genesis.proto + + + + + +### GenesisState +GenesisState defines the gov module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `community_pool` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | - - - - - - - - -### Params -Params defines the set of params for the distribution module. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `community_tax` | [string](#string) | | | -| `base_proposer_reward` | [string](#string) | | | -| `bonus_proposer_reward` | [string](#string) | | | -| `withdraw_addr_enabled` | [bool](#bool) | | | - - - - - - - - -### ValidatorAccumulatedCommission -ValidatorAccumulatedCommission represents accumulated commission -for a validator kept as a running counter, can be withdrawn at any time. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `commission` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | - - - - - - - - -### ValidatorCurrentRewards -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `rewards` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | -| `period` | [uint64](#uint64) | | | - - - - - - - - -### ValidatorHistoricalRewards -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 - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `cumulative_reward_ratio` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | -| `reference_count` | [uint32](#uint32) | | | - - - - - - - - -### ValidatorOutstandingRewards -ValidatorOutstandingRewards represents outstanding (un-withdrawn) rewards -for a validator inexpensive to track, allows simple sanity checks. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `rewards` | [cosmos.base.v1beta1.DecCoin](#cosmos.base.v1beta1.DecCoin) | repeated | | - - - - - - - - -### ValidatorSlashEvent -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `validator_period` | [uint64](#uint64) | | | -| `fraction` | [string](#string) | | | - - - - - - - - -### ValidatorSlashEvents -ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `validator_slash_events` | [ValidatorSlashEvent](#cosmos.distribution.v1beta1.ValidatorSlashEvent) | repeated | | +| `starting_proposal_id` | [uint64](#uint64) | | starting_proposal_id is the ID of the starting proposal. | +| `deposits` | [Deposit](#cosmos.gov.v1beta1.Deposit) | repeated | deposits defines all the deposits present at genesis. | +| `votes` | [Vote](#cosmos.gov.v1beta1.Vote) | repeated | votes defines all the votes present at genesis. | +| `proposals` | [Proposal](#cosmos.gov.v1beta1.Proposal) | repeated | proposals defines all the proposals present at genesis. | +| `deposit_params` | [DepositParams](#cosmos.gov.v1beta1.DepositParams) | | params defines all the paramaters of related to deposit. | +| `voting_params` | [VotingParams](#cosmos.gov.v1beta1.VotingParams) | | params defines all the paramaters of related to voting. | +| `tally_params` | [TallyParams](#cosmos.gov.v1beta1.TallyParams) | | params defines all the paramaters of related to tally. | @@ -4445,98 +4686,260 @@ ValidatorSlashEvents is a collection of ValidatorSlashEvent messages. - +

Top

-## cosmos/upgrade/v1beta1/query.proto +## cosmos/gov/v1beta1/query.proto - + -### QueryAppliedPlanRequest -QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC +### QueryDepositRequest +QueryDepositRequest is the request type for the Query/Deposit RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | +| `depositor` | [string](#string) | | depositor defines the deposit addresses from the proposals. | + + + + + + + + +### QueryDepositResponse +QueryDepositResponse is the response type for the Query/Deposit RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `deposit` | [Deposit](#cosmos.gov.v1beta1.Deposit) | | deposit defines the requested deposit. | + + + + + + + + +### QueryDepositsRequest +QueryDepositsRequest is the request type for the Query/Deposits RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | + + + + + + + + +### QueryDepositsResponse +QueryDepositsResponse is the response type for the Query/Deposits RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `deposits` | [Deposit](#cosmos.gov.v1beta1.Deposit) | repeated | | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | + + + + + + + + +### QueryParamsRequest +QueryParamsRequest is the request type for the Query/Params RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `params_type` | [string](#string) | | params_type defines which parameters to query for, can be one of "voting", "tallying" or "deposit". | + + + + + + + + +### QueryParamsResponse +QueryParamsResponse is the response type for the Query/Params RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `voting_params` | [VotingParams](#cosmos.gov.v1beta1.VotingParams) | | voting_params defines the parameters related to voting. | +| `deposit_params` | [DepositParams](#cosmos.gov.v1beta1.DepositParams) | | deposit_params defines the parameters related to deposit. | +| `tally_params` | [TallyParams](#cosmos.gov.v1beta1.TallyParams) | | tally_params defines the parameters related to tally. | + + + + + + + + +### QueryProposalRequest +QueryProposalRequest is the request type for the Query/Proposal RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | + + + + + + + + +### QueryProposalResponse +QueryProposalResponse is the response type for the Query/Proposal RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposal` | [Proposal](#cosmos.gov.v1beta1.Proposal) | | | + + + + + + + + +### QueryProposalsRequest +QueryProposalsRequest is the request type for the Query/Proposals RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposal_status` | [ProposalStatus](#cosmos.gov.v1beta1.ProposalStatus) | | proposal_status defines the status of the proposals. | +| `voter` | [string](#string) | | voter defines the voter address for the proposals. | +| `depositor` | [string](#string) | | depositor defines the deposit addresses from the proposals. | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | + + + + + + + + +### QueryProposalsResponse +QueryProposalsResponse is the response type for the Query/Proposals RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `name` | [string](#string) | | name is the name of the applied plan to query for. | +| `proposals` | [Proposal](#cosmos.gov.v1beta1.Proposal) | repeated | | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | - + -### QueryAppliedPlanResponse -QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC -method. +### QueryTallyResultRequest +QueryTallyResultRequest is the request type for the Query/Tally RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `height` | [int64](#int64) | | height is the block height at which the plan was applied. | +| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | - + -### QueryCurrentPlanRequest -QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC -method. - - - - - - - - -### QueryCurrentPlanResponse -QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC -method. +### QueryTallyResultResponse +QueryTallyResultResponse is the response type for the Query/Tally RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `plan` | [Plan](#cosmos.upgrade.v1beta1.Plan) | | plan is the current upgrade plan. | +| `tally` | [TallyResult](#cosmos.gov.v1beta1.TallyResult) | | tally defines the requested tally. | - + -### QueryUpgradedConsensusStateRequest -QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState -RPC method. +### QueryVoteRequest +QueryVoteRequest is the request type for the Query/Vote RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `last_height` | [int64](#int64) | | last height of the current chain must be sent in request as this is the height under which next consensus state is stored | +| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | +| `voter` | [string](#string) | | voter defines the oter address for the proposals. | - + -### QueryUpgradedConsensusStateResponse -QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState -RPC method. +### QueryVoteResponse +QueryVoteResponse is the response type for the Query/Vote RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `upgraded_consensus_state` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `vote` | [Vote](#cosmos.gov.v1beta1.Vote) | | vote defined the queried vote. | + + + + + + + + +### QueryVotesRequest +QueryVotesRequest is the request type for the Query/Votes RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposal_id` | [uint64](#uint64) | | proposal_id defines the unique id of the proposal. | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | + + + + + + + + +### QueryVotesResponse +QueryVotesResponse is the response type for the Query/Votes RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `votes` | [Vote](#cosmos.gov.v1beta1.Vote) | repeated | votes defined the queried votes. | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | @@ -4549,76 +4952,178 @@ RPC method. - + ### Query -Query defines the gRPC upgrade querier service. +Query defines the gRPC querier service for gov module | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `CurrentPlan` | [QueryCurrentPlanRequest](#cosmos.upgrade.v1beta1.QueryCurrentPlanRequest) | [QueryCurrentPlanResponse](#cosmos.upgrade.v1beta1.QueryCurrentPlanResponse) | CurrentPlan queries the current upgrade plan. | GET|/cosmos/upgrade/v1beta1/current_plan| -| `AppliedPlan` | [QueryAppliedPlanRequest](#cosmos.upgrade.v1beta1.QueryAppliedPlanRequest) | [QueryAppliedPlanResponse](#cosmos.upgrade.v1beta1.QueryAppliedPlanResponse) | AppliedPlan queries a previously applied upgrade plan by its name. | GET|/cosmos/upgrade/v1beta1/applied_plan/{name}| -| `UpgradedConsensusState` | [QueryUpgradedConsensusStateRequest](#cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest) | [QueryUpgradedConsensusStateResponse](#cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse) | 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 | GET|/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}| +| `Proposal` | [QueryProposalRequest](#cosmos.gov.v1beta1.QueryProposalRequest) | [QueryProposalResponse](#cosmos.gov.v1beta1.QueryProposalResponse) | Proposal queries proposal details based on ProposalID. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}| +| `Proposals` | [QueryProposalsRequest](#cosmos.gov.v1beta1.QueryProposalsRequest) | [QueryProposalsResponse](#cosmos.gov.v1beta1.QueryProposalsResponse) | Proposals queries all proposals based on given status. | GET|/cosmos/gov/v1beta1/proposals| +| `Vote` | [QueryVoteRequest](#cosmos.gov.v1beta1.QueryVoteRequest) | [QueryVoteResponse](#cosmos.gov.v1beta1.QueryVoteResponse) | Vote queries voted information based on proposalID, voterAddr. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/votes/{voter}| +| `Votes` | [QueryVotesRequest](#cosmos.gov.v1beta1.QueryVotesRequest) | [QueryVotesResponse](#cosmos.gov.v1beta1.QueryVotesResponse) | Votes queries votes of a given proposal. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/votes| +| `Params` | [QueryParamsRequest](#cosmos.gov.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.gov.v1beta1.QueryParamsResponse) | Params queries all parameters of the gov module. | GET|/cosmos/gov/v1beta1/params/{params_type}| +| `Deposit` | [QueryDepositRequest](#cosmos.gov.v1beta1.QueryDepositRequest) | [QueryDepositResponse](#cosmos.gov.v1beta1.QueryDepositResponse) | Deposit queries single deposit information based proposalID, depositAddr. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits/{depositor}| +| `Deposits` | [QueryDepositsRequest](#cosmos.gov.v1beta1.QueryDepositsRequest) | [QueryDepositsResponse](#cosmos.gov.v1beta1.QueryDepositsResponse) | Deposits queries all deposits of a single proposal. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/deposits| +| `TallyResult` | [QueryTallyResultRequest](#cosmos.gov.v1beta1.QueryTallyResultRequest) | [QueryTallyResultResponse](#cosmos.gov.v1beta1.QueryTallyResultResponse) | TallyResult queries the tally of a proposal vote. | GET|/cosmos/gov/v1beta1/proposals/{proposal_id}/tally| - +

Top

-## cosmos/upgrade/v1beta1/upgrade.proto +## cosmos/gov/v1beta1/tx.proto - + -### CancelSoftwareUpgradeProposal -CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software -upgrade. +### MsgDeposit +MsgDeposit defines a message to submit a deposit to an existing proposal. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `title` | [string](#string) | | | -| `description` | [string](#string) | | | +| `proposal_id` | [uint64](#uint64) | | | +| `depositor` | [string](#string) | | | +| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | - + -### Plan -Plan specifies information about a planned upgrade and when it should occur. +### MsgDepositResponse +MsgDepositResponse defines the Msg/Deposit response type. + + + + + + + + +### MsgSubmitProposal +MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary +proposal Content. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `name` | [string](#string) | | 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. | -| `time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | The time after which the upgrade must be performed. Leave set to its zero value to use a pre-defined Height instead. | -| `height` | [int64](#int64) | | The height at which the upgrade must be performed. Only used if Time is not set. | -| `info` | [string](#string) | | Any application specific upgrade info to be included on-chain such as a git commit that validators could automatically upgrade to | -| `upgraded_client_state` | [google.protobuf.Any](#google.protobuf.Any) | | IBC-enabled chains can opt-in to including the upgraded client state in its upgrade plan 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 | +| `content` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `initial_deposit` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | +| `proposer` | [string](#string) | | | - + -### SoftwareUpgradeProposal -SoftwareUpgradeProposal is a gov Content type for initiating a software -upgrade. +### MsgSubmitProposalResponse +MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `title` | [string](#string) | | | -| `description` | [string](#string) | | | -| `plan` | [Plan](#cosmos.upgrade.v1beta1.Plan) | | | +| `proposal_id` | [uint64](#uint64) | | | + + + + + + + + +### MsgVote +MsgVote defines a message to cast a vote. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `proposal_id` | [uint64](#uint64) | | | +| `voter` | [string](#string) | | | +| `option` | [VoteOption](#cosmos.gov.v1beta1.VoteOption) | | | + + + + + + + + +### MsgVoteResponse +MsgVoteResponse defines the Msg/Vote response type. + + + + + + + + + + + + + + +### Msg +Msg defines the bank Msg service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `SubmitProposal` | [MsgSubmitProposal](#cosmos.gov.v1beta1.MsgSubmitProposal) | [MsgSubmitProposalResponse](#cosmos.gov.v1beta1.MsgSubmitProposalResponse) | SubmitProposal defines a method to create new proposal given a content. | | +| `Vote` | [MsgVote](#cosmos.gov.v1beta1.MsgVote) | [MsgVoteResponse](#cosmos.gov.v1beta1.MsgVoteResponse) | Vote defines a method to add a vote on a specific proposal. | | +| `Deposit` | [MsgDeposit](#cosmos.gov.v1beta1.MsgDeposit) | [MsgDepositResponse](#cosmos.gov.v1beta1.MsgDepositResponse) | Deposit defines a method to add deposit on a specific proposal. | | + + + + + + +

Top

+ +## cosmos/mint/v1beta1/mint.proto + + + + + +### Minter +Minter represents the minting state. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `inflation` | [string](#string) | | current annual inflation rate | +| `annual_provisions` | [string](#string) | | current annual expected provisions | + + + + + + + + +### Params +Params holds parameters for the mint module. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `mint_denom` | [string](#string) | | type of coin to mint | +| `inflation_rate_change` | [string](#string) | | maximum annual change in inflation rate | +| `inflation_max` | [string](#string) | | maximum inflation rate | +| `inflation_min` | [string](#string) | | minimum inflation rate | +| `goal_bonded` | [string](#string) | | goal of percent bonded atoms | +| `blocks_per_year` | [uint64](#uint64) | | expected blocks per year | @@ -4634,38 +5139,23 @@ upgrade. - +

Top

-## cosmos/base/kv/v1beta1/kv.proto +## cosmos/mint/v1beta1/genesis.proto - + -### Pair -Pair defines a key/value bytes tuple. +### GenesisState +GenesisState defines the mint module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `key` | [bytes](#bytes) | | | -| `value` | [bytes](#bytes) | | | - - - - - - - - -### Pairs -Pairs defines a repeated slice of Pair objects. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `pairs` | [Pair](#cosmos.base.kv.v1beta1.Pair) | repeated | | +| `minter` | [Minter](#cosmos.mint.v1beta1.Minter) | | minter is a space for holding current inflation information. | +| `params` | [Params](#cosmos.mint.v1beta1.Params) | | params defines all the paramaters of the module. | @@ -4681,39 +5171,129 @@ Pairs defines a repeated slice of Pair objects. - +

Top

-## cosmos/base/abci/v1beta1/abci.proto +## cosmos/mint/v1beta1/query.proto - + -### ABCIMessageLog -ABCIMessageLog defines a structure containing an indexed tx ABCI message log. +### QueryAnnualProvisionsRequest +QueryAnnualProvisionsRequest is the request type for the +Query/AnnualProvisions RPC method. + + + + + + + + +### QueryAnnualProvisionsResponse +QueryAnnualProvisionsResponse is the response type for the +Query/AnnualProvisions RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `msg_index` | [uint32](#uint32) | | | -| `log` | [string](#string) | | | -| `events` | [StringEvent](#cosmos.base.abci.v1beta1.StringEvent) | repeated | Events contains a slice of Event objects that were emitted during some execution. | +| `annual_provisions` | [bytes](#bytes) | | annual_provisions is the current minting annual provisions value. | - + -### Attribute -Attribute defines an attribute wrapper where the key and value are -strings instead of raw bytes. +### QueryInflationRequest +QueryInflationRequest is the request type for the Query/Inflation RPC method. + + + + + + + + +### QueryInflationResponse +QueryInflationResponse is the response type for the Query/Inflation RPC +method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | +| `inflation` | [bytes](#bytes) | | inflation is the current minting inflation value. | + + + + + + + + +### QueryParamsRequest +QueryParamsRequest is the request type for the Query/Params RPC method. + + + + + + + + +### QueryParamsResponse +QueryParamsResponse is the response type for the Query/Params RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `params` | [Params](#cosmos.mint.v1beta1.Params) | | params defines the parameters of the module. | + + + + + + + + + + + + + + +### Query +Query provides defines the gRPC querier service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `Params` | [QueryParamsRequest](#cosmos.mint.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.mint.v1beta1.QueryParamsResponse) | Params returns the total set of minting parameters. | GET|/cosmos/mint/v1beta1/params| +| `Inflation` | [QueryInflationRequest](#cosmos.mint.v1beta1.QueryInflationRequest) | [QueryInflationResponse](#cosmos.mint.v1beta1.QueryInflationResponse) | Inflation returns the current minting inflation value. | GET|/cosmos/mint/v1beta1/inflation| +| `AnnualProvisions` | [QueryAnnualProvisionsRequest](#cosmos.mint.v1beta1.QueryAnnualProvisionsRequest) | [QueryAnnualProvisionsResponse](#cosmos.mint.v1beta1.QueryAnnualProvisionsResponse) | AnnualProvisions current minting annual provisions value. | GET|/cosmos/mint/v1beta1/annual_provisions| + + + + + + +

Top

+ +## cosmos/params/v1beta1/params.proto + + + + + +### ParamChange +ParamChange defines an individual parameter change, for use in +ParameterChangeProposal. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `subspace` | [string](#string) | | | | `key` | [string](#string) | | | | `value` | [string](#string) | | | @@ -4722,147 +5302,17 @@ strings instead of raw bytes. - + -### GasInfo -GasInfo defines tx execution gas context. +### ParameterChangeProposal +ParameterChangeProposal defines a proposal to change one or more parameters. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `gas_wanted` | [uint64](#uint64) | | GasWanted is the maximum units of work we allow this tx to perform. | -| `gas_used` | [uint64](#uint64) | | GasUsed is the amount of gas actually consumed. | - - - - - - - - -### MsgData -MsgData defines the data returned in a Result object during message -execution. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `msg_type` | [string](#string) | | | -| `data` | [bytes](#bytes) | | | - - - - - - - - -### Result -Result is the union of ResponseFormat and ResponseCheckTx. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `data` | [bytes](#bytes) | | Data is any data returned from message or handler execution. It MUST be length prefixed in order to separate data from multiple message executions. | -| `log` | [string](#string) | | Log contains the log information from message or handler execution. | -| `events` | [tendermint.abci.Event](#tendermint.abci.Event) | repeated | Events contains a slice of Event objects that were emitted during message or handler execution. | - - - - - - - - -### SearchTxsResult -SearchTxsResult defines a structure for querying txs pageable - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `total_count` | [uint64](#uint64) | | Count of all txs | -| `count` | [uint64](#uint64) | | Count of txs in current page | -| `page_number` | [uint64](#uint64) | | Index of current page, start from 1 | -| `page_total` | [uint64](#uint64) | | Count of total pages | -| `limit` | [uint64](#uint64) | | Max count txs per page | -| `txs` | [TxResponse](#cosmos.base.abci.v1beta1.TxResponse) | repeated | List of txs in current page | - - - - - - - - -### SimulationResponse -SimulationResponse defines the response generated when a transaction is -successfully simulated. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `gas_info` | [GasInfo](#cosmos.base.abci.v1beta1.GasInfo) | | | -| `result` | [Result](#cosmos.base.abci.v1beta1.Result) | | | - - - - - - - - -### StringEvent -StringEvent defines en Event object wrapper where all the attributes -contain key/value pairs that are strings instead of raw bytes. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `type` | [string](#string) | | | -| `attributes` | [Attribute](#cosmos.base.abci.v1beta1.Attribute) | repeated | | - - - - - - - - -### TxMsgData -TxMsgData defines a list of MsgData. A transaction will have a MsgData object -for each message. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `data` | [MsgData](#cosmos.base.abci.v1beta1.MsgData) | repeated | | - - - - - - - - -### TxResponse -TxResponse defines a structure containing relevant tx data and metadata. The -tags are stringified and the log is JSON decoded. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `height` | [int64](#int64) | | The block height | -| `txhash` | [string](#string) | | The transaction hash. | -| `codespace` | [string](#string) | | Namespace for the Code | -| `code` | [uint32](#uint32) | | Response code. | -| `data` | [string](#string) | | Result bytes, if any. | -| `raw_log` | [string](#string) | | The output of the application's logger (raw string). May be non-deterministic. | -| `logs` | [ABCIMessageLog](#cosmos.base.abci.v1beta1.ABCIMessageLog) | repeated | The output of the application's logger (typed). May be non-deterministic. | -| `info` | [string](#string) | | Additional information. May be non-deterministic. | -| `gas_wanted` | [int64](#int64) | | Amount of gas requested for transaction. | -| `gas_used` | [int64](#int64) | | Amount of gas consumed by transaction. | -| `tx` | [google.protobuf.Any](#google.protobuf.Any) | | The request transaction bytes. | -| `timestamp` | [string](#string) | | 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. | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `changes` | [ParamChange](#cosmos.params.v1beta1.ParamChange) | repeated | | @@ -4878,514 +5328,38 @@ tags are stringified and the log is JSON decoded. - +

Top

-## cosmos/base/query/v1beta1/pagination.proto +## cosmos/params/v1beta1/query.proto - + -### PageRequest -PageRequest is to be embedded in gRPC request messages for efficient -pagination. Ex: - - message SomeRequest { - Foo some_parameter = 1; - PageRequest pagination = 2; - } +### QueryParamsRequest +QueryParamsRequest is request type for the Query/Params RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `key` | [bytes](#bytes) | | key is a value returned in PageResponse.next_key to begin querying the next page most efficiently. Only one of offset or key should be set. | -| `offset` | [uint64](#uint64) | | offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set. | -| `limit` | [uint64](#uint64) | | limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app. | -| `count_total` | [bool](#bool) | | 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. | +| `subspace` | [string](#string) | | subspace defines the module to query the parameter for. | +| `key` | [string](#string) | | key defines the key of the parameter in the subspace. | - + -### PageResponse -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; - } +### QueryParamsResponse +QueryParamsResponse is response type for the Query/Params RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `next_key` | [bytes](#bytes) | | next_key is the key to be passed to PageRequest.key to query the next page most efficiently | -| `total` | [uint64](#uint64) | | total is total number of results available if PageRequest.count_total was set, its value is undefined otherwise | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/base/store/v1beta1/snapshot.proto - - - - - -### SnapshotIAVLItem -SnapshotIAVLItem is an exported IAVL node. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `key` | [bytes](#bytes) | | | -| `value` | [bytes](#bytes) | | | -| `version` | [int64](#int64) | | | -| `height` | [int32](#int32) | | | - - - - - - - - -### SnapshotItem -SnapshotItem is an item contained in a rootmulti.Store snapshot. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `store` | [SnapshotStoreItem](#cosmos.base.store.v1beta1.SnapshotStoreItem) | | | -| `iavl` | [SnapshotIAVLItem](#cosmos.base.store.v1beta1.SnapshotIAVLItem) | | | - - - - - - - - -### SnapshotStoreItem -SnapshotStoreItem contains metadata about a snapshotted store. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `name` | [string](#string) | | | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/base/store/v1beta1/commit_info.proto - - - - - -### CommitID -CommitID defines the committment information when a specific store is -committed. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `version` | [int64](#int64) | | | -| `hash` | [bytes](#bytes) | | | - - - - - - - - -### CommitInfo -CommitInfo defines commit information used by the multi-store when committing -a version/height. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `version` | [int64](#int64) | | | -| `store_infos` | [StoreInfo](#cosmos.base.store.v1beta1.StoreInfo) | repeated | | - - - - - - - - -### StoreInfo -StoreInfo defines store-specific commit information. It contains a reference -between a store name and the commit ID. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `name` | [string](#string) | | | -| `commit_id` | [CommitID](#cosmos.base.store.v1beta1.CommitID) | | | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/base/v1beta1/coin.proto - - - - - -### Coin -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `denom` | [string](#string) | | | -| `amount` | [string](#string) | | | - - - - - - - - -### DecCoin -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `denom` | [string](#string) | | | -| `amount` | [string](#string) | | | - - - - - - - - -### DecProto -DecProto defines a Protobuf wrapper around a Dec object. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `dec` | [string](#string) | | | - - - - - - - - -### IntProto -IntProto defines a Protobuf wrapper around an Int object. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `int` | [string](#string) | | | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/base/tendermint/v1beta1/query.proto - - - - - -### GetBlockByHeightRequest -GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `height` | [int64](#int64) | | | - - - - - - - - -### GetBlockByHeightResponse -GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `block_id` | [tendermint.types.BlockID](#tendermint.types.BlockID) | | | -| `block` | [tendermint.types.Block](#tendermint.types.Block) | | | - - - - - - - - -### GetLatestBlockRequest -GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. - - - - - - - - -### GetLatestBlockResponse -GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `block_id` | [tendermint.types.BlockID](#tendermint.types.BlockID) | | | -| `block` | [tendermint.types.Block](#tendermint.types.Block) | | | - - - - - - - - -### GetLatestValidatorSetRequest -GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an pagination for the request. | - - - - - - - - -### GetLatestValidatorSetResponse -GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `block_height` | [int64](#int64) | | | -| `validators` | [Validator](#cosmos.base.tendermint.v1beta1.Validator) | repeated | | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines an pagination for the response. | - - - - - - - - -### GetNodeInfoRequest -GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. - - - - - - - - -### GetNodeInfoResponse -GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `default_node_info` | [tendermint.p2p.DefaultNodeInfo](#tendermint.p2p.DefaultNodeInfo) | | | -| `application_version` | [VersionInfo](#cosmos.base.tendermint.v1beta1.VersionInfo) | | | - - - - - - - - -### GetSyncingRequest -GetSyncingRequest is the request type for the Query/GetSyncing RPC method. - - - - - - - - -### GetSyncingResponse -GetSyncingResponse is the response type for the Query/GetSyncing RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `syncing` | [bool](#bool) | | | - - - - - - - - -### GetValidatorSetByHeightRequest -GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `height` | [int64](#int64) | | | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an pagination for the request. | - - - - - - - - -### GetValidatorSetByHeightResponse -GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `block_height` | [int64](#int64) | | | -| `validators` | [Validator](#cosmos.base.tendermint.v1beta1.Validator) | repeated | | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines an pagination for the response. | - - - - - - - - -### Module -Module is the type for VersionInfo - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `path` | [string](#string) | | module path | -| `version` | [string](#string) | | module version | -| `sum` | [string](#string) | | checksum | - - - - - - - - -### Validator -Validator is the type for the validator-set. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | | -| `pub_key` | [google.protobuf.Any](#google.protobuf.Any) | | | -| `voting_power` | [int64](#int64) | | | -| `proposer_priority` | [int64](#int64) | | | - - - - - - - - -### VersionInfo -VersionInfo is the type for the GetNodeInfoResponse message. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `name` | [string](#string) | | | -| `app_name` | [string](#string) | | | -| `version` | [string](#string) | | | -| `git_commit` | [string](#string) | | | -| `build_tags` | [string](#string) | | | -| `go_version` | [string](#string) | | | -| `build_deps` | [Module](#cosmos.base.tendermint.v1beta1.Module) | repeated | | +| `param` | [ParamChange](#cosmos.params.v1beta1.ParamChange) | | param defines the queried parameter. | @@ -5398,153 +5372,14 @@ VersionInfo is the type for the GetNodeInfoResponse message. - + -### Service -Service defines the gRPC querier service for tendermint queries. +### Query +Query defines the gRPC querier service. | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `GetNodeInfo` | [GetNodeInfoRequest](#cosmos.base.tendermint.v1beta1.GetNodeInfoRequest) | [GetNodeInfoResponse](#cosmos.base.tendermint.v1beta1.GetNodeInfoResponse) | GetNodeInfo queries the current node info. | GET|/cosmos/base/tendermint/v1beta1/node_info| -| `GetSyncing` | [GetSyncingRequest](#cosmos.base.tendermint.v1beta1.GetSyncingRequest) | [GetSyncingResponse](#cosmos.base.tendermint.v1beta1.GetSyncingResponse) | GetSyncing queries node syncing. | GET|/cosmos/base/tendermint/v1beta1/syncing| -| `GetLatestBlock` | [GetLatestBlockRequest](#cosmos.base.tendermint.v1beta1.GetLatestBlockRequest) | [GetLatestBlockResponse](#cosmos.base.tendermint.v1beta1.GetLatestBlockResponse) | GetLatestBlock returns the latest block. | GET|/cosmos/base/tendermint/v1beta1/blocks/latest| -| `GetBlockByHeight` | [GetBlockByHeightRequest](#cosmos.base.tendermint.v1beta1.GetBlockByHeightRequest) | [GetBlockByHeightResponse](#cosmos.base.tendermint.v1beta1.GetBlockByHeightResponse) | GetBlockByHeight queries block for given height. | GET|/cosmos/base/tendermint/v1beta1/blocks/{height}| -| `GetLatestValidatorSet` | [GetLatestValidatorSetRequest](#cosmos.base.tendermint.v1beta1.GetLatestValidatorSetRequest) | [GetLatestValidatorSetResponse](#cosmos.base.tendermint.v1beta1.GetLatestValidatorSetResponse) | GetLatestValidatorSet queries latest validator-set. | GET|/cosmos/base/tendermint/v1beta1/validatorsets/latest| -| `GetValidatorSetByHeight` | [GetValidatorSetByHeightRequest](#cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightRequest) | [GetValidatorSetByHeightResponse](#cosmos.base.tendermint.v1beta1.GetValidatorSetByHeightResponse) | GetValidatorSetByHeight queries validator-set at a given height. | GET|/cosmos/base/tendermint/v1beta1/validatorsets/{height}| - - - - - - -

Top

- -## cosmos/base/snapshots/v1beta1/snapshot.proto - - - - - -### Metadata -Metadata contains SDK-specific snapshot metadata. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `chunk_hashes` | [bytes](#bytes) | repeated | SHA-256 chunk hashes | - - - - - - - - -### Snapshot -Snapshot contains Tendermint state sync snapshot info. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `height` | [uint64](#uint64) | | | -| `format` | [uint32](#uint32) | | | -| `chunks` | [uint32](#uint32) | | | -| `hash` | [bytes](#bytes) | | | -| `metadata` | [Metadata](#cosmos.base.snapshots.v1beta1.Metadata) | | | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/base/reflection/v1beta1/reflection.proto - - - - - -### ListAllInterfacesRequest -ListAllInterfacesRequest is the request type of the ListAllInterfaces RPC. - - - - - - - - -### ListAllInterfacesResponse -ListAllInterfacesResponse is the response type of the ListAllInterfaces RPC. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `interface_names` | [string](#string) | repeated | interface_names is an array of all the registered interfaces. | - - - - - - - - -### ListImplementationsRequest -ListImplementationsRequest is the request type of the ListImplementations -RPC. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `interface_name` | [string](#string) | | interface_name defines the interface to query the implementations for. | - - - - - - - - -### ListImplementationsResponse -ListImplementationsResponse is the response type of the ListImplementations -RPC. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `implementation_message_names` | [string](#string) | repeated | | - - - - - - - - - - - - - - -### ReflectionService -ReflectionService defines a service for interface reflection. - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `ListAllInterfaces` | [ListAllInterfacesRequest](#cosmos.base.reflection.v1beta1.ListAllInterfacesRequest) | [ListAllInterfacesResponse](#cosmos.base.reflection.v1beta1.ListAllInterfacesResponse) | ListAllInterfaces lists all the interfaces registered in the interface registry. | GET|/cosmos/base/reflection/v1beta1/interfaces| -| `ListImplementations` | [ListImplementationsRequest](#cosmos.base.reflection.v1beta1.ListImplementationsRequest) | [ListImplementationsResponse](#cosmos.base.reflection.v1beta1.ListImplementationsResponse) | ListImplementations list all the concrete types that implement a given interface. | GET|/cosmos/base/reflection/v1beta1/interfaces/{interface_name}/implementations| +| `Params` | [QueryParamsRequest](#cosmos.params.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.params.v1beta1.QueryParamsResponse) | Params queries a specific parameter of a module, given its subspace and key. | GET|/cosmos/params/v1beta1/params| @@ -5596,6 +5431,88 @@ liveness activity. + + + + + + + + + + + +

Top

+ +## cosmos/slashing/v1beta1/genesis.proto + + + + + +### GenesisState +GenesisState defines the slashing module's genesis state. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `params` | [Params](#cosmos.slashing.v1beta1.Params) | | params defines all the paramaters of related to deposit. | +| `signing_infos` | [SigningInfo](#cosmos.slashing.v1beta1.SigningInfo) | repeated | signing_infos represents a map between validator addresses and their signing infos. | +| `missed_blocks` | [ValidatorMissedBlocks](#cosmos.slashing.v1beta1.ValidatorMissedBlocks) | repeated | signing_infos represents a map between validator addresses and their missed blocks. | + + + + + + + + +### MissedBlock +MissedBlock contains height and missed status as boolean. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `index` | [int64](#int64) | | index is the height at which the block was missed. | +| `missed` | [bool](#bool) | | missed is the missed status. | + + + + + + + + +### SigningInfo +SigningInfo stores validator signing info of corresponding address. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `address` | [string](#string) | | address is the validator address. | +| `validator_signing_info` | [ValidatorSigningInfo](#cosmos.slashing.v1beta1.ValidatorSigningInfo) | | validator_signing_info represents the signing info of this validator. | + + + + + + + + +### ValidatorMissedBlocks +ValidatorMissedBlocks contains array of missed blocks of corresponding +address. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `address` | [string](#string) | | address is the validator address. | +| `missed_blocks` | [MissedBlock](#cosmos.slashing.v1beta1.MissedBlock) | repeated | missed_blocks is an array of missed blocks by the validator. | + + + + + @@ -5775,359 +5692,379 @@ Msg defines the slashing Msg service. - +

Top

-## cosmos/slashing/v1beta1/genesis.proto +## cosmos/staking/v1beta1/staking.proto - + -### GenesisState -GenesisState defines the slashing module's genesis state. +### Commission +Commission defines commission parameters for a given validator. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `params` | [Params](#cosmos.slashing.v1beta1.Params) | | params defines all the paramaters of related to deposit. | -| `signing_infos` | [SigningInfo](#cosmos.slashing.v1beta1.SigningInfo) | repeated | signing_infos represents a map between validator addresses and their signing infos. | -| `missed_blocks` | [ValidatorMissedBlocks](#cosmos.slashing.v1beta1.ValidatorMissedBlocks) | repeated | signing_infos represents a map between validator addresses and their missed blocks. | +| `commission_rates` | [CommissionRates](#cosmos.staking.v1beta1.CommissionRates) | | commission_rates defines the initial commission rates to be used for creating a validator. | +| `update_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | update_time is the last time the commission rate was changed. | - + -### MissedBlock -MissedBlock contains height and missed status as boolean. +### CommissionRates +CommissionRates defines the initial commission rates to be used for creating +a validator. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `index` | [int64](#int64) | | index is the height at which the block was missed. | -| `missed` | [bool](#bool) | | missed is the missed status. | +| `rate` | [string](#string) | | rate is the commission rate charged to delegators, as a fraction. | +| `max_rate` | [string](#string) | | max_rate defines the maximum commission rate which validator can ever charge, as a fraction. | +| `max_change_rate` | [string](#string) | | max_change_rate defines the maximum daily increase of the validator commission, as a fraction. | - + -### SigningInfo -SigningInfo stores validator signing info of corresponding address. +### DVPair +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. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | address is the validator address. | -| `validator_signing_info` | [ValidatorSigningInfo](#cosmos.slashing.v1beta1.ValidatorSigningInfo) | | validator_signing_info represents the signing info of this validator. | +| `delegator_address` | [string](#string) | | | +| `validator_address` | [string](#string) | | | - + -### ValidatorMissedBlocks -ValidatorMissedBlocks contains array of missed blocks of corresponding -address. +### DVPairs +DVPairs defines an array of DVPair objects. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | address is the validator address. | -| `missed_blocks` | [MissedBlock](#cosmos.slashing.v1beta1.MissedBlock) | repeated | missed_blocks is an array of missed blocks by the validator. | +| `pairs` | [DVPair](#cosmos.staking.v1beta1.DVPair) | repeated | | - - + - - - - - - - -

Top

- -## cosmos/evidence/v1beta1/evidence.proto - - - - - -### Equivocation -Equivocation implements the Evidence interface and defines evidence of double -signing misbehavior. +### DVVTriplet +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. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `height` | [int64](#int64) | | | -| `time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `power` | [int64](#int64) | | | -| `consensus_address` | [string](#string) | | | +| `delegator_address` | [string](#string) | | | +| `validator_src_address` | [string](#string) | | | +| `validator_dst_address` | [string](#string) | | | - - + - - - - - - - -

Top

- -## cosmos/evidence/v1beta1/query.proto - - - - - -### QueryAllEvidenceRequest -QueryEvidenceRequest is the request type for the Query/AllEvidence RPC -method. +### DVVTriplets +DVVTriplets defines an array of DVVTriplet objects. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | +| `triplets` | [DVVTriplet](#cosmos.staking.v1beta1.DVVTriplet) | repeated | | - + -### QueryAllEvidenceResponse -QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC -method. +### Delegation +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. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `evidence` | [google.protobuf.Any](#google.protobuf.Any) | repeated | evidence returns all evidences. | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | +| `delegator_address` | [string](#string) | | delegator_address is the bech32-encoded address of the delegator. | +| `validator_address` | [string](#string) | | validator_address is the bech32-encoded address of the validator. | +| `shares` | [string](#string) | | shares define the delegation shares received. | - + -### QueryEvidenceRequest -QueryEvidenceRequest is the request type for the Query/Evidence RPC method. +### DelegationResponse +DelegationResponse is equivalent to Delegation except that it contains a +balance in addition to shares which is more suitable for client responses. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `evidence_hash` | [bytes](#bytes) | | evidence_hash defines the hash of the requested evidence. | +| `delegation` | [Delegation](#cosmos.staking.v1beta1.Delegation) | | | +| `balance` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | | - + -### QueryEvidenceResponse -QueryEvidenceResponse is the response type for the Query/Evidence RPC method. +### Description +Description defines a validator description. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `evidence` | [google.protobuf.Any](#google.protobuf.Any) | | evidence returns the requested evidence. | +| `moniker` | [string](#string) | | moniker defines a human-readable name for the validator. | +| `identity` | [string](#string) | | identity defines an optional identity signature (ex. UPort or Keybase). | +| `website` | [string](#string) | | website defines an optional website link. | +| `security_contact` | [string](#string) | | security_contact defines an optional email for security contact. | +| `details` | [string](#string) | | details define other optional details. | - - + - - - - - -### Query -Query defines the gRPC querier service. - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Evidence` | [QueryEvidenceRequest](#cosmos.evidence.v1beta1.QueryEvidenceRequest) | [QueryEvidenceResponse](#cosmos.evidence.v1beta1.QueryEvidenceResponse) | Evidence queries evidence based on evidence hash. | GET|/cosmos/evidence/v1beta1/evidence/{evidence_hash}| -| `AllEvidence` | [QueryAllEvidenceRequest](#cosmos.evidence.v1beta1.QueryAllEvidenceRequest) | [QueryAllEvidenceResponse](#cosmos.evidence.v1beta1.QueryAllEvidenceResponse) | AllEvidence queries all evidence. | GET|/cosmos/evidence/v1beta1/evidence| - - - - - - -

Top

- -## cosmos/evidence/v1beta1/tx.proto - - - - - -### MsgSubmitEvidence -MsgSubmitEvidence represents a message that supports submitting arbitrary -Evidence of misbehavior such as equivocation or counterfactual signing. +### HistoricalInfo +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). | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `submitter` | [string](#string) | | | -| `evidence` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `header` | [tendermint.types.Header](#tendermint.types.Header) | | | +| `valset` | [Validator](#cosmos.staking.v1beta1.Validator) | repeated | | - - -### MsgSubmitEvidenceResponse -MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `hash` | [bytes](#bytes) | | hash defines the hash of the evidence. | - - - - - - - - - - - - - - -### Msg -Msg defines the evidence Msg service. - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `SubmitEvidence` | [MsgSubmitEvidence](#cosmos.evidence.v1beta1.MsgSubmitEvidence) | [MsgSubmitEvidenceResponse](#cosmos.evidence.v1beta1.MsgSubmitEvidenceResponse) | SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or counterfactual signing. | | - - - - - - -

Top

- -## cosmos/evidence/v1beta1/genesis.proto - - - - - -### GenesisState -GenesisState defines the evidence module's genesis state. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `evidence` | [google.protobuf.Any](#google.protobuf.Any) | repeated | evidence defines all the evidence at genesis. | - - - - - - - - - - - - - - - - -

Top

- -## cosmos/auth/v1beta1/auth.proto - - - - - -### BaseAccount -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). - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | | -| `pub_key` | [google.protobuf.Any](#google.protobuf.Any) | | | -| `account_number` | [uint64](#uint64) | | | -| `sequence` | [uint64](#uint64) | | | - - - - - - - - -### ModuleAccount -ModuleAccount defines an account for modules that holds coins on a pool. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `base_account` | [BaseAccount](#cosmos.auth.v1beta1.BaseAccount) | | | -| `name` | [string](#string) | | | -| `permissions` | [string](#string) | repeated | | - - - - - - - + ### Params -Params defines the parameters for the auth module. +Params defines the parameters for the staking module. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `max_memo_characters` | [uint64](#uint64) | | | -| `tx_sig_limit` | [uint64](#uint64) | | | -| `tx_size_cost_per_byte` | [uint64](#uint64) | | | -| `sig_verify_cost_ed25519` | [uint64](#uint64) | | | -| `sig_verify_cost_secp256k1` | [uint64](#uint64) | | | +| `unbonding_time` | [google.protobuf.Duration](#google.protobuf.Duration) | | unbonding_time is the time duration of unbonding. | +| `max_validators` | [uint32](#uint32) | | max_validators is the maximum number of validators. | +| `max_entries` | [uint32](#uint32) | | max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). | +| `historical_entries` | [uint32](#uint32) | | historical_entries is the number of historical entries to persist. | +| `bond_denom` | [string](#string) | | bond_denom defines the bondable coin denomination. | + + + + + + + + +### Pool +Pool is used for tracking bonded and not-bonded token supply of the bond +denomination. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `not_bonded_tokens` | [string](#string) | | | +| `bonded_tokens` | [string](#string) | | | + + + + + + + + +### Redelegation +Redelegation contains the list of a particular delegator's redelegating bonds +from a particular source validator to a particular destination validator. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `delegator_address` | [string](#string) | | delegator_address is the bech32-encoded address of the delegator. | +| `validator_src_address` | [string](#string) | | validator_src_address is the validator redelegation source operator address. | +| `validator_dst_address` | [string](#string) | | validator_dst_address is the validator redelegation destination operator address. | +| `entries` | [RedelegationEntry](#cosmos.staking.v1beta1.RedelegationEntry) | repeated | entries are the redelegation entries. + +redelegation entries | + + + + + + + + +### RedelegationEntry +RedelegationEntry defines a redelegation object with relevant metadata. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `creation_height` | [int64](#int64) | | creation_height defines the height which the redelegation took place. | +| `completion_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | completion_time defines the unix time for redelegation completion. | +| `initial_balance` | [string](#string) | | initial_balance defines the initial balance when redelegation started. | +| `shares_dst` | [string](#string) | | shares_dst is the amount of destination-validator shares created by redelegation. | + + + + + + + + +### RedelegationEntryResponse +RedelegationEntryResponse is equivalent to a RedelegationEntry except that it +contains a balance in addition to shares which is more suitable for client +responses. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `redelegation_entry` | [RedelegationEntry](#cosmos.staking.v1beta1.RedelegationEntry) | | | +| `balance` | [string](#string) | | | + + + + + + + + +### RedelegationResponse +RedelegationResponse is equivalent to a Redelegation except that its entries +contain a balance in addition to shares which is more suitable for client +responses. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `redelegation` | [Redelegation](#cosmos.staking.v1beta1.Redelegation) | | | +| `entries` | [RedelegationEntryResponse](#cosmos.staking.v1beta1.RedelegationEntryResponse) | repeated | | + + + + + + + + +### UnbondingDelegation +UnbondingDelegation stores all of a single delegator's unbonding bonds +for a single validator in an time-ordered list. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `delegator_address` | [string](#string) | | delegator_address is the bech32-encoded address of the delegator. | +| `validator_address` | [string](#string) | | validator_address is the bech32-encoded address of the validator. | +| `entries` | [UnbondingDelegationEntry](#cosmos.staking.v1beta1.UnbondingDelegationEntry) | repeated | entries are the unbonding delegation entries. + +unbonding delegation entries | + + + + + + + + +### UnbondingDelegationEntry +UnbondingDelegationEntry defines an unbonding object with relevant metadata. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `creation_height` | [int64](#int64) | | creation_height is the height which the unbonding took place. | +| `completion_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | completion_time is the unix time for unbonding completion. | +| `initial_balance` | [string](#string) | | initial_balance defines the tokens initially scheduled to receive at completion. | +| `balance` | [string](#string) | | balance defines the tokens to receive at completion. | + + + + + + + + +### ValAddresses +ValAddresses defines a repeated set of validator addresses. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `addresses` | [string](#string) | repeated | | + + + + + + + + +### Validator +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `operator_address` | [string](#string) | | operator_address defines the address of the validator's operator; bech encoded in JSON. | +| `consensus_pubkey` | [google.protobuf.Any](#google.protobuf.Any) | | consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. | +| `jailed` | [bool](#bool) | | jailed defined whether the validator has been jailed from bonded status or not. | +| `status` | [BondStatus](#cosmos.staking.v1beta1.BondStatus) | | status is the validator status (bonded/unbonding/unbonded). | +| `tokens` | [string](#string) | | tokens define the delegated tokens (incl. self-delegation). | +| `delegator_shares` | [string](#string) | | delegator_shares defines total shares issued to a validator's delegators. | +| `description` | [Description](#cosmos.staking.v1beta1.Description) | | description defines the description terms for the validator. | +| `unbonding_height` | [int64](#int64) | | unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. | +| `unbonding_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. | +| `commission` | [Commission](#cosmos.staking.v1beta1.Commission) | | commission defines the commission parameters. | +| `min_self_delegation` | [string](#string) | | min_self_delegation is the validator's self declared minimum self delegation. | @@ -6135,6 +6072,20 @@ Params defines the parameters for the auth module. + + + +### BondStatus +BondStatus is the status of a validator. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| BOND_STATUS_UNSPECIFIED | 0 | UNSPECIFIED defines an invalid validator status. | +| BOND_STATUS_UNBONDED | 1 | UNBONDED defines a validator that is not bonded. | +| BOND_STATUS_UNBONDING | 2 | UNBONDING defines a validator that is unbonding. | +| BOND_STATUS_BONDED | 3 | BONDED defines a validator that is bonded. | + + @@ -6143,105 +6094,45 @@ Params defines the parameters for the auth module. - +

Top

-## cosmos/auth/v1beta1/query.proto +## cosmos/staking/v1beta1/genesis.proto - - -### QueryAccountRequest -QueryAccountRequest is the request type for the Query/Account RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | address defines the address to query for. | - - - - - - - - -### QueryAccountResponse -QueryAccountResponse is the response type for the Query/Account RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `account` | [google.protobuf.Any](#google.protobuf.Any) | | account defines the account of the corresponding address. | - - - - - - - - -### QueryParamsRequest -QueryParamsRequest is the request type for the Query/Params RPC method. - - - - - - - - -### QueryParamsResponse -QueryParamsResponse is the response type for the Query/Params RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `params` | [Params](#cosmos.auth.v1beta1.Params) | | params defines the parameters of the module. | - - - - - - - - - - - - - - -### Query -Query defines the gRPC querier service. - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Account` | [QueryAccountRequest](#cosmos.auth.v1beta1.QueryAccountRequest) | [QueryAccountResponse](#cosmos.auth.v1beta1.QueryAccountResponse) | Account returns account details based on address. | GET|/cosmos/auth/v1beta1/accounts/{address}| -| `Params` | [QueryParamsRequest](#cosmos.auth.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.auth.v1beta1.QueryParamsResponse) | Params queries all parameters. | GET|/cosmos/auth/v1beta1/params| - - - - - - -

Top

- -## cosmos/auth/v1beta1/genesis.proto - - - - + ### GenesisState -GenesisState defines the auth module's genesis state. +GenesisState defines the staking module's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `params` | [Params](#cosmos.auth.v1beta1.Params) | | params defines all the paramaters of the module. | -| `accounts` | [google.protobuf.Any](#google.protobuf.Any) | repeated | accounts are the accounts present at genesis. | +| `params` | [Params](#cosmos.staking.v1beta1.Params) | | params defines all the paramaters of related to deposit. | +| `last_total_power` | [bytes](#bytes) | | last_total_power tracks the total amounts of bonded tokens recorded during the previous end block. | +| `last_validator_powers` | [LastValidatorPower](#cosmos.staking.v1beta1.LastValidatorPower) | repeated | last_validator_powers is a special index that provides a historical list of the last-block's bonded validators. | +| `validators` | [Validator](#cosmos.staking.v1beta1.Validator) | repeated | delegations defines the validator set at genesis. | +| `delegations` | [Delegation](#cosmos.staking.v1beta1.Delegation) | repeated | delegations defines the delegations active at genesis. | +| `unbonding_delegations` | [UnbondingDelegation](#cosmos.staking.v1beta1.UnbondingDelegation) | repeated | unbonding_delegations defines the unbonding delegations active at genesis. | +| `redelegations` | [Redelegation](#cosmos.staking.v1beta1.Redelegation) | repeated | redelegations defines the redelegations active at genesis. | +| `exported` | [bool](#bool) | | | + + + + + + + + +### LastValidatorPower +LastValidatorPower required for validator set update logic. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `address` | [string](#string) | | address is the address of the validator. | +| `power` | [int64](#int64) | | power defines the power of the validator. | @@ -6927,45 +6818,299 @@ Msg defines the staking Msg service. - +

Top

-## cosmos/staking/v1beta1/genesis.proto +## cosmos/tx/signing/v1beta1/signing.proto - + -### GenesisState -GenesisState defines the staking module's genesis state. +### SignatureDescriptor +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. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `params` | [Params](#cosmos.staking.v1beta1.Params) | | params defines all the paramaters of related to deposit. | -| `last_total_power` | [bytes](#bytes) | | last_total_power tracks the total amounts of bonded tokens recorded during the previous end block. | -| `last_validator_powers` | [LastValidatorPower](#cosmos.staking.v1beta1.LastValidatorPower) | repeated | last_validator_powers is a special index that provides a historical list of the last-block's bonded validators. | -| `validators` | [Validator](#cosmos.staking.v1beta1.Validator) | repeated | delegations defines the validator set at genesis. | -| `delegations` | [Delegation](#cosmos.staking.v1beta1.Delegation) | repeated | delegations defines the delegations active at genesis. | -| `unbonding_delegations` | [UnbondingDelegation](#cosmos.staking.v1beta1.UnbondingDelegation) | repeated | unbonding_delegations defines the unbonding delegations active at genesis. | -| `redelegations` | [Redelegation](#cosmos.staking.v1beta1.Redelegation) | repeated | redelegations defines the redelegations active at genesis. | -| `exported` | [bool](#bool) | | | +| `public_key` | [google.protobuf.Any](#google.protobuf.Any) | | public_key is the public key of the signer | +| `data` | [SignatureDescriptor.Data](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data) | | | +| `sequence` | [uint64](#uint64) | | 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. | - + -### LastValidatorPower -LastValidatorPower required for validator set update logic. +### SignatureDescriptor.Data +Data represents signature data | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `address` | [string](#string) | | address is the address of the validator. | -| `power` | [int64](#int64) | | power defines the power of the validator. | +| `single` | [SignatureDescriptor.Data.Single](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Single) | | single represents a single signer | +| `multi` | [SignatureDescriptor.Data.Multi](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data.Multi) | | multi represents a multisig signer | + + + + + + + + +### SignatureDescriptor.Data.Multi +Multi is the signature data for a multisig public key + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `bitarray` | [cosmos.crypto.multisig.v1beta1.CompactBitArray](#cosmos.crypto.multisig.v1beta1.CompactBitArray) | | bitarray specifies which keys within the multisig are signing | +| `signatures` | [SignatureDescriptor.Data](#cosmos.tx.signing.v1beta1.SignatureDescriptor.Data) | repeated | signatures is the signatures of the multi-signature | + + + + + + + + +### SignatureDescriptor.Data.Single +Single is the signature data for a single signer + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `mode` | [SignMode](#cosmos.tx.signing.v1beta1.SignMode) | | mode is the signing mode of the single signer | +| `signature` | [bytes](#bytes) | | signature is the raw signature bytes | + + + + + + + + +### SignatureDescriptors +SignatureDescriptors wraps multiple SignatureDescriptor's. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `signatures` | [SignatureDescriptor](#cosmos.tx.signing.v1beta1.SignatureDescriptor) | repeated | signatures are the signature descriptors | + + + + + + + + + + +### SignMode +SignMode represents a signing mode with its own security guarantees. + +| Name | Number | Description | +| ---- | ------ | ----------- | +| SIGN_MODE_UNSPECIFIED | 0 | SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be rejected | +| SIGN_MODE_DIRECT | 1 | SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is verified with raw bytes from Tx | +| SIGN_MODE_TEXTUAL | 2 | 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_LEGACY_AMINO_JSON | 127 | SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses Amino JSON and will be removed in the future | + + + + + + + + + + + +

Top

+ +## cosmos/tx/v1beta1/tx.proto + + + + + +### AuthInfo +AuthInfo describes the fee and signer modes that are used to sign a +transaction. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `signer_infos` | [SignerInfo](#cosmos.tx.v1beta1.SignerInfo) | repeated | 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. | +| `fee` | [Fee](#cosmos.tx.v1beta1.Fee) | | 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 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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | amount is the amount of coins to be paid as a fee | +| `gas_limit` | [uint64](#uint64) | | gas_limit is the maximum gas that can be used in transaction processing before an out of gas error occurs | +| `payer` | [string](#string) | | 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. | +| `granter` | [string](#string) | | 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 | + + + + + + + + +### ModeInfo +ModeInfo describes the signing mode of a single or nested multisig signer. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `single` | [ModeInfo.Single](#cosmos.tx.v1beta1.ModeInfo.Single) | | single represents a single signer | +| `multi` | [ModeInfo.Multi](#cosmos.tx.v1beta1.ModeInfo.Multi) | | multi represents a nested multisig signer | + + + + + + + + +### ModeInfo.Multi +Multi is the mode info for a multisig public key + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `bitarray` | [cosmos.crypto.multisig.v1beta1.CompactBitArray](#cosmos.crypto.multisig.v1beta1.CompactBitArray) | | bitarray specifies which keys within the multisig are signing | +| `mode_infos` | [ModeInfo](#cosmos.tx.v1beta1.ModeInfo) | repeated | mode_infos is the corresponding modes of the signers of the multisig which could include nested multisig public keys | + + + + + + + + +### ModeInfo.Single +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 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `mode` | [cosmos.tx.signing.v1beta1.SignMode](#cosmos.tx.signing.v1beta1.SignMode) | | mode is the signing mode of the single signer | + + + + + + + + +### SignDoc +SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `body_bytes` | [bytes](#bytes) | | body_bytes is protobuf serialization of a TxBody that matches the representation in TxRaw. | +| `auth_info_bytes` | [bytes](#bytes) | | auth_info_bytes is a protobuf serialization of an AuthInfo that matches the representation in TxRaw. | +| `chain_id` | [string](#string) | | 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 | +| `account_number` | [uint64](#uint64) | | account_number is the account number of the account in state | + + + + + + + + +### SignerInfo +SignerInfo describes the public key and signing mode of a single top-level +signer. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `public_key` | [google.protobuf.Any](#google.protobuf.Any) | | 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. | +| `mode_info` | [ModeInfo](#cosmos.tx.v1beta1.ModeInfo) | | mode_info describes the signing mode of the signer and is a nested structure to support nested multisig pubkey's | +| `sequence` | [uint64](#uint64) | | 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. | + + + + + + + + +### Tx +Tx is the standard type used for broadcasting transactions. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `body` | [TxBody](#cosmos.tx.v1beta1.TxBody) | | body is the processable content of the transaction | +| `auth_info` | [AuthInfo](#cosmos.tx.v1beta1.AuthInfo) | | auth_info is the authorization related content of the transaction, specifically signers, signer modes and fee | +| `signatures` | [bytes](#bytes) | repeated | 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. | + + + + + + + + +### TxBody +TxBody is the body of a transaction that all signers sign over. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `messages` | [google.protobuf.Any](#google.protobuf.Any) | repeated | 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. | +| `memo` | [string](#string) | | memo is any arbitrary memo to be added to the transaction | +| `timeout_height` | [uint64](#uint64) | | timeout is the block height after which this transaction will not be processed by the chain | +| `extension_options` | [google.protobuf.Any](#google.protobuf.Any) | repeated | 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 | +| `non_critical_extension_options` | [google.protobuf.Any](#google.protobuf.Any) | repeated | 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 | + + + + + + + + +### TxRaw +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `body_bytes` | [bytes](#bytes) | | body_bytes is a protobuf serialization of a TxBody that matches the representation in SignDoc. | +| `auth_info_bytes` | [bytes](#bytes) | | auth_info_bytes is a protobuf serialization of an AuthInfo that matches the representation in SignDoc. | +| `signatures` | [bytes](#bytes) | repeated | 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. | @@ -6981,375 +7126,140 @@ LastValidatorPower required for validator set update logic. - +

Top

-## cosmos/staking/v1beta1/staking.proto +## cosmos/tx/v1beta1/service.proto - + -### Commission -Commission defines commission parameters for a given validator. +### BroadcastTxRequest +BroadcastTxRequest is the request type for the Service.BroadcastTxRequest +RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `commission_rates` | [CommissionRates](#cosmos.staking.v1beta1.CommissionRates) | | | -| `update_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `tx_bytes` | [bytes](#bytes) | | tx_bytes is the raw transaction. | +| `mode` | [BroadcastMode](#cosmos.tx.v1beta1.BroadcastMode) | | | - + -### CommissionRates -CommissionRates defines the initial commission rates to be used for creating -a validator. +### BroadcastTxResponse +BroadcastTxResponse is the response type for the +Service.BroadcastTx method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `rate` | [string](#string) | | | -| `max_rate` | [string](#string) | | | -| `max_change_rate` | [string](#string) | | | +| `tx_response` | [cosmos.base.abci.v1beta1.TxResponse](#cosmos.base.abci.v1beta1.TxResponse) | | tx_response is the queried TxResponses. | - + -### DVPair -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. +### GetTxRequest +GetTxRequest is the request type for the Service.GetTx +RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `delegator_address` | [string](#string) | | | -| `validator_address` | [string](#string) | | | +| `hash` | [string](#string) | | hash is the tx hash to query, encoded as a hex string. | - + -### DVPairs -DVPairs defines an array of DVPair objects. +### GetTxResponse +GetTxResponse is the response type for the Service.GetTx method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `pairs` | [DVPair](#cosmos.staking.v1beta1.DVPair) | repeated | | +| `tx` | [Tx](#cosmos.tx.v1beta1.Tx) | | tx is the queried transaction. | +| `tx_response` | [cosmos.base.abci.v1beta1.TxResponse](#cosmos.base.abci.v1beta1.TxResponse) | | tx_response is the queried TxResponses. | - + -### DVVTriplet -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. +### GetTxsEventRequest +GetTxsEventRequest is the request type for the Service.TxsByEvents +RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `delegator_address` | [string](#string) | | | -| `validator_src_address` | [string](#string) | | | -| `validator_dst_address` | [string](#string) | | | +| `events` | [string](#string) | repeated | events is the list of transaction event type. | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an pagination for the request. | - + -### DVVTriplets -DVVTriplets defines an array of DVVTriplet objects. +### GetTxsEventResponse +GetTxsEventResponse is the response type for the Service.TxsByEvents +RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `triplets` | [DVVTriplet](#cosmos.staking.v1beta1.DVVTriplet) | repeated | | +| `txs` | [Tx](#cosmos.tx.v1beta1.Tx) | repeated | txs is the list of queried transactions. | +| `tx_responses` | [cosmos.base.abci.v1beta1.TxResponse](#cosmos.base.abci.v1beta1.TxResponse) | repeated | tx_responses is the list of queried TxResponses. | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines an pagination for the response. | - + -### Delegation -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. +### SimulateRequest +SimulateRequest is the request type for the Service.Simulate +RPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `delegator_address` | [string](#string) | | | -| `validator_address` | [string](#string) | | | -| `shares` | [string](#string) | | | +| `tx` | [Tx](#cosmos.tx.v1beta1.Tx) | | tx is the transaction to simulate. | - + -### DelegationResponse -DelegationResponse is equivalent to Delegation except that it contains a -balance in addition to shares which is more suitable for client responses. +### SimulateResponse +SimulateResponse is the response type for the +Service.SimulateRPC method. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `delegation` | [Delegation](#cosmos.staking.v1beta1.Delegation) | | | -| `balance` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | | - - - - - - - - -### Description -Description defines a validator description. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `moniker` | [string](#string) | | | -| `identity` | [string](#string) | | | -| `website` | [string](#string) | | | -| `security_contact` | [string](#string) | | | -| `details` | [string](#string) | | | - - - - - - - - -### HistoricalInfo -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). - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `header` | [tendermint.types.Header](#tendermint.types.Header) | | | -| `valset` | [Validator](#cosmos.staking.v1beta1.Validator) | repeated | | - - - - - - - - -### Params -Params defines the parameters for the staking module. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `unbonding_time` | [google.protobuf.Duration](#google.protobuf.Duration) | | | -| `max_validators` | [uint32](#uint32) | | | -| `max_entries` | [uint32](#uint32) | | | -| `historical_entries` | [uint32](#uint32) | | | -| `bond_denom` | [string](#string) | | | - - - - - - - - -### Pool -Pool is used for tracking bonded and not-bonded token supply of the bond -denomination. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `not_bonded_tokens` | [string](#string) | | | -| `bonded_tokens` | [string](#string) | | | - - - - - - - - -### Redelegation -Redelegation contains the list of a particular delegator's redelegating bonds -from a particular source validator to a particular destination validator. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `delegator_address` | [string](#string) | | | -| `validator_src_address` | [string](#string) | | | -| `validator_dst_address` | [string](#string) | | | -| `entries` | [RedelegationEntry](#cosmos.staking.v1beta1.RedelegationEntry) | repeated | redelegation entries | - - - - - - - - -### RedelegationEntry -RedelegationEntry defines a redelegation object with relevant metadata. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `creation_height` | [int64](#int64) | | | -| `completion_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `initial_balance` | [string](#string) | | | -| `shares_dst` | [string](#string) | | | - - - - - - - - -### RedelegationEntryResponse -RedelegationEntryResponse is equivalent to a RedelegationEntry except that it -contains a balance in addition to shares which is more suitable for client -responses. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `redelegation_entry` | [RedelegationEntry](#cosmos.staking.v1beta1.RedelegationEntry) | | | -| `balance` | [string](#string) | | | - - - - - - - - -### RedelegationResponse -RedelegationResponse is equivalent to a Redelegation except that its entries -contain a balance in addition to shares which is more suitable for client -responses. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `redelegation` | [Redelegation](#cosmos.staking.v1beta1.Redelegation) | | | -| `entries` | [RedelegationEntryResponse](#cosmos.staking.v1beta1.RedelegationEntryResponse) | repeated | | - - - - - - - - -### UnbondingDelegation -UnbondingDelegation stores all of a single delegator's unbonding bonds -for a single validator in an time-ordered list. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `delegator_address` | [string](#string) | | | -| `validator_address` | [string](#string) | | | -| `entries` | [UnbondingDelegationEntry](#cosmos.staking.v1beta1.UnbondingDelegationEntry) | repeated | unbonding delegation entries | - - - - - - - - -### UnbondingDelegationEntry -UnbondingDelegationEntry defines an unbonding object with relevant metadata. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `creation_height` | [int64](#int64) | | | -| `completion_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `initial_balance` | [string](#string) | | | -| `balance` | [string](#string) | | | - - - - - - - - -### ValAddresses -ValAddresses defines a repeated set of validator addresses. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `addresses` | [string](#string) | repeated | | - - - - - - - - -### Validator -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `operator_address` | [string](#string) | | | -| `consensus_pubkey` | [google.protobuf.Any](#google.protobuf.Any) | | | -| `jailed` | [bool](#bool) | | | -| `status` | [BondStatus](#cosmos.staking.v1beta1.BondStatus) | | | -| `tokens` | [string](#string) | | | -| `delegator_shares` | [string](#string) | | | -| `description` | [Description](#cosmos.staking.v1beta1.Description) | | | -| `unbonding_height` | [int64](#int64) | | | -| `unbonding_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `commission` | [Commission](#cosmos.staking.v1beta1.Commission) | | | -| `min_self_delegation` | [string](#string) | | | +| `gas_info` | [cosmos.base.abci.v1beta1.GasInfo](#cosmos.base.abci.v1beta1.GasInfo) | | gas_info is the information about gas used in the simulation. | +| `result` | [cosmos.base.abci.v1beta1.Result](#cosmos.base.abci.v1beta1.Result) | | result is the result of the simulation. | @@ -7358,23 +7268,225 @@ multiplied by exchange rate. - + -### BondStatus -BondStatus is the status of a validator. +### BroadcastMode +BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. | Name | Number | Description | | ---- | ------ | ----------- | -| BOND_STATUS_UNSPECIFIED | 0 | UNSPECIFIED defines an invalid validator status. | -| BOND_STATUS_UNBONDED | 1 | UNBONDED defines a validator that is not bonded. | -| BOND_STATUS_UNBONDING | 2 | UNBONDING defines a validator that is unbonding. | -| BOND_STATUS_BONDED | 3 | BONDED defines a validator that is bonded. | +| BROADCAST_MODE_UNSPECIFIED | 0 | zero-value for mode ordering | +| BROADCAST_MODE_BLOCK | 1 | BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for the tx to be committed in a block. | +| BROADCAST_MODE_SYNC | 2 | BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for a CheckTx execution response only. | +| BROADCAST_MODE_ASYNC | 3 | BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns immediately. | + + + +### Service +Service defines a gRPC service for interacting with transactions. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `Simulate` | [SimulateRequest](#cosmos.tx.v1beta1.SimulateRequest) | [SimulateResponse](#cosmos.tx.v1beta1.SimulateResponse) | Simulate simulates executing a transaction for estimating gas usage. | POST|/cosmos/tx/v1beta1/simulate| +| `GetTx` | [GetTxRequest](#cosmos.tx.v1beta1.GetTxRequest) | [GetTxResponse](#cosmos.tx.v1beta1.GetTxResponse) | GetTx fetches a tx by hash. | GET|/cosmos/tx/v1beta1/txs/{hash}| +| `BroadcastTx` | [BroadcastTxRequest](#cosmos.tx.v1beta1.BroadcastTxRequest) | [BroadcastTxResponse](#cosmos.tx.v1beta1.BroadcastTxResponse) | BroadcastTx broadcast transaction. | POST|/cosmos/tx/v1beta1/txs| +| `GetTxsEvent` | [GetTxsEventRequest](#cosmos.tx.v1beta1.GetTxsEventRequest) | [GetTxsEventResponse](#cosmos.tx.v1beta1.GetTxsEventResponse) | GetTxsEvent fetches txs by event. | GET|/cosmos/tx/v1beta1/txs| + + + + + + +

Top

+ +## cosmos/upgrade/v1beta1/upgrade.proto + + + + + +### CancelSoftwareUpgradeProposal +CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software +upgrade. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | + + + + + + + + +### Plan +Plan specifies information about a planned upgrade and when it should occur. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `name` | [string](#string) | | 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. | +| `time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | The time after which the upgrade must be performed. Leave set to its zero value to use a pre-defined Height instead. | +| `height` | [int64](#int64) | | The height at which the upgrade must be performed. Only used if Time is not set. | +| `info` | [string](#string) | | Any application specific upgrade info to be included on-chain such as a git commit that validators could automatically upgrade to | +| `upgraded_client_state` | [google.protobuf.Any](#google.protobuf.Any) | | IBC-enabled chains can opt-in to including the upgraded client state in its upgrade plan 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 | + + + + + + + + +### SoftwareUpgradeProposal +SoftwareUpgradeProposal is a gov Content type for initiating a software +upgrade. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `title` | [string](#string) | | | +| `description` | [string](#string) | | | +| `plan` | [Plan](#cosmos.upgrade.v1beta1.Plan) | | | + + + + + + + + + + + + + + + + +

Top

+ +## cosmos/upgrade/v1beta1/query.proto + + + + + +### QueryAppliedPlanRequest +QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC +method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `name` | [string](#string) | | name is the name of the applied plan to query for. | + + + + + + + + +### QueryAppliedPlanResponse +QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC +method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `height` | [int64](#int64) | | height is the block height at which the plan was applied. | + + + + + + + + +### QueryCurrentPlanRequest +QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC +method. + + + + + + + + +### QueryCurrentPlanResponse +QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC +method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `plan` | [Plan](#cosmos.upgrade.v1beta1.Plan) | | plan is the current upgrade plan. | + + + + + + + + +### QueryUpgradedConsensusStateRequest +QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState +RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `last_height` | [int64](#int64) | | last height of the current chain must be sent in request as this is the height under which next consensus state is stored | + + + + + + + + +### QueryUpgradedConsensusStateResponse +QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState +RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `upgraded_consensus_state` | [google.protobuf.Any](#google.protobuf.Any) | | | + + + + + + + + + + + + + + +### Query +Query defines the gRPC upgrade querier service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `CurrentPlan` | [QueryCurrentPlanRequest](#cosmos.upgrade.v1beta1.QueryCurrentPlanRequest) | [QueryCurrentPlanResponse](#cosmos.upgrade.v1beta1.QueryCurrentPlanResponse) | CurrentPlan queries the current upgrade plan. | GET|/cosmos/upgrade/v1beta1/current_plan| +| `AppliedPlan` | [QueryAppliedPlanRequest](#cosmos.upgrade.v1beta1.QueryAppliedPlanRequest) | [QueryAppliedPlanResponse](#cosmos.upgrade.v1beta1.QueryAppliedPlanResponse) | AppliedPlan queries a previously applied upgrade plan by its name. | GET|/cosmos/upgrade/v1beta1/applied_plan/{name}| +| `UpgradedConsensusState` | [QueryUpgradedConsensusStateRequest](#cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateRequest) | [QueryUpgradedConsensusStateResponse](#cosmos.upgrade.v1beta1.QueryUpgradedConsensusStateResponse) | 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 | GET|/cosmos/upgrade/v1beta1/upgraded_consensus_state/{last_height}| + @@ -7539,38 +7651,63 @@ periodically vests by unlocking coins during each specified period. - +

Top

-## cosmos/params/v1beta1/query.proto +## ibc/applications/transfer/v1/transfer.proto - + -### QueryParamsRequest -QueryParamsRequest is request type for the Query/Params RPC method. +### DenomTrace +DenomTrace contains the base denomination for ICS20 fungible tokens and the +source tracing information path. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `subspace` | [string](#string) | | subspace defines the module to query the parameter for. | -| `key` | [string](#string) | | key defines the key of the parameter in the subspace. | +| `path` | [string](#string) | | path defines the chain of port/channel identifiers used for tracing the source of the fungible token. | +| `base_denom` | [string](#string) | | base denomination of the relayed fungible token. | - + -### QueryParamsResponse -QueryParamsResponse is response type for the Query/Params RPC method. +### FungibleTokenPacketData +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 | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `param` | [ParamChange](#cosmos.params.v1beta1.ParamChange) | | param defines the queried parameter. | +| `denom` | [string](#string) | | the token denomination to be transferred | +| `amount` | [uint64](#uint64) | | the token amount to be transferred | +| `sender` | [string](#string) | | the sender address | +| `receiver` | [string](#string) | | the recipient address on the destination chain | + + + + + + + + +### Params +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `send_enabled` | [bool](#bool) | | send_enabled enables or disables all cross-chain token transfers from this chain. | +| `receive_enabled` | [bool](#bool) | | receive_enabled enables or disables all cross-chain token transfers to this chain. | @@ -7582,56 +7719,28 @@ QueryParamsResponse is response type for the Query/Params RPC method. - - - -### Query -Query defines the gRPC querier service. - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Params` | [QueryParamsRequest](#cosmos.params.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#cosmos.params.v1beta1.QueryParamsResponse) | Params queries a specific parameter of a module, given its subspace and key. | GET|/cosmos/params/v1beta1/params| - - +

Top

-## cosmos/params/v1beta1/params.proto +## ibc/applications/transfer/v1/genesis.proto - + -### ParamChange -ParamChange defines an individual parameter change, for use in -ParameterChangeProposal. +### GenesisState +GenesisState defines the ibc-transfer genesis state | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `subspace` | [string](#string) | | | -| `key` | [string](#string) | | | -| `value` | [string](#string) | | | - - - - - - - - -### ParameterChangeProposal -ParameterChangeProposal defines a proposal to change one or more parameters. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `title` | [string](#string) | | | -| `description` | [string](#string) | | | -| `changes` | [ParamChange](#cosmos.params.v1beta1.ParamChange) | repeated | | +| `port_id` | [string](#string) | | | +| `denom_traces` | [DenomTrace](#ibc.applications.transfer.v1.DenomTrace) | repeated | | +| `params` | [Params](#ibc.applications.transfer.v1.Params) | | | @@ -7765,170 +7874,6 @@ Query provides defines the gRPC querier service. - -

Top

- -## ibc/applications/transfer/v1/tx.proto - - - - - -### MsgTransfer -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 - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `source_port` | [string](#string) | | the port on which the packet will be sent | -| `source_channel` | [string](#string) | | the channel by which the packet will be sent | -| `token` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | the tokens to be transferred | -| `sender` | [string](#string) | | the sender address | -| `receiver` | [string](#string) | | the recipient address on the destination chain | -| `timeout_height` | [ibc.core.client.v1.Height](#ibc.core.client.v1.Height) | | Timeout height relative to the current block height. The timeout is disabled when set to 0. | -| `timeout_timestamp` | [uint64](#uint64) | | Timeout timestamp (in nanoseconds) relative to the current block timestamp. The timeout is disabled when set to 0. | - - - - - - - - -### MsgTransferResponse -MsgTransferResponse defines the Msg/Transfer response type. - - - - - - - - - - - - - - -### Msg -Msg defines the ibc/transfer Msg service. - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `Transfer` | [MsgTransfer](#ibc.applications.transfer.v1.MsgTransfer) | [MsgTransferResponse](#ibc.applications.transfer.v1.MsgTransferResponse) | Transfer defines a rpc handler method for MsgTransfer. | | - - - - - - -

Top

- -## ibc/applications/transfer/v1/transfer.proto - - - - - -### DenomTrace -DenomTrace contains the base denomination for ICS20 fungible tokens and the -source tracing information path. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `path` | [string](#string) | | path defines the chain of port/channel identifiers used for tracing the source of the fungible token. | -| `base_denom` | [string](#string) | | base denomination of the relayed fungible token. | - - - - - - - - -### FungibleTokenPacketData -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 - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `denom` | [string](#string) | | the token denomination to be transferred | -| `amount` | [uint64](#uint64) | | the token amount to be transferred | -| `sender` | [string](#string) | | the sender address | -| `receiver` | [string](#string) | | the recipient address on the destination chain | - - - - - - - - -### Params -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `send_enabled` | [bool](#bool) | | send_enabled enables or disables all cross-chain token transfers from this chain. | -| `receive_enabled` | [bool](#bool) | | receive_enabled enables or disables all cross-chain token transfers to this chain. | - - - - - - - - - - - - - - - - -

Top

- -## ibc/applications/transfer/v1/genesis.proto - - - - - -### GenesisState -GenesisState defines the ibc-transfer genesis state - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `port_id` | [string](#string) | | | -| `denom_traces` | [DenomTrace](#ibc.applications.transfer.v1.DenomTrace) | repeated | | -| `params` | [Params](#ibc.applications.transfer.v1.Params) | | | - - - - - - - - - - - - - - -

Top

@@ -8054,172 +7999,40 @@ Params defines the set of IBC light client parameters. - +

Top

-## ibc/core/client/v1/query.proto +## ibc/applications/transfer/v1/tx.proto - + -### QueryClientParamsRequest -QueryClientParamsRequest is the request type for the Query/ClientParams RPC method. - - - - - - - - -### QueryClientParamsResponse -QueryClientParamsResponse is the response type for the Query/ClientParams RPC method. +### MsgTransfer +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 | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `params` | [Params](#ibc.core.client.v1.Params) | | params defines the parameters of the module. | +| `source_port` | [string](#string) | | the port on which the packet will be sent | +| `source_channel` | [string](#string) | | the channel by which the packet will be sent | +| `token` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | the tokens to be transferred | +| `sender` | [string](#string) | | the sender address | +| `receiver` | [string](#string) | | the recipient address on the destination chain | +| `timeout_height` | [ibc.core.client.v1.Height](#ibc.core.client.v1.Height) | | Timeout height relative to the current block height. The timeout is disabled when set to 0. | +| `timeout_timestamp` | [uint64](#uint64) | | Timeout timestamp (in nanoseconds) relative to the current block timestamp. The timeout is disabled when set to 0. | - + -### QueryClientStateRequest -QueryClientStateRequest is the request type for the Query/ClientState RPC -method - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `client_id` | [string](#string) | | client state unique identifier | - - - - - - - - -### QueryClientStateResponse -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `client_state` | [google.protobuf.Any](#google.protobuf.Any) | | client state associated with the request identifier | -| `proof` | [bytes](#bytes) | | merkle proof of existence | -| `proof_height` | [Height](#ibc.core.client.v1.Height) | | height at which the proof was retrieved | - - - - - - - - -### QueryClientStatesRequest -QueryClientStatesRequest is the request type for the Query/ClientStates RPC -method - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination request | - - - - - - - - -### QueryClientStatesResponse -QueryClientStatesResponse is the response type for the Query/ClientStates RPC -method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `client_states` | [IdentifiedClientState](#ibc.core.client.v1.IdentifiedClientState) | repeated | list of stored ClientStates of the chain. | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination response | - - - - - - - - -### QueryConsensusStateRequest -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `client_id` | [string](#string) | | client identifier | -| `revision_number` | [uint64](#uint64) | | consensus state revision number | -| `revision_height` | [uint64](#uint64) | | consensus state revision height | -| `latest_height` | [bool](#bool) | | latest_height overrrides the height field and queries the latest stored ConsensusState | - - - - - - - - -### QueryConsensusStateResponse -QueryConsensusStateResponse is the response type for the Query/ConsensusState -RPC method - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `consensus_state` | [google.protobuf.Any](#google.protobuf.Any) | | consensus state associated with the client identifier at the given height | -| `proof` | [bytes](#bytes) | | merkle proof of existence | -| `proof_height` | [Height](#ibc.core.client.v1.Height) | | height at which the proof was retrieved | - - - - - - - - -### QueryConsensusStatesRequest -QueryConsensusStatesRequest is the request type for the Query/ConsensusStates -RPC method. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `client_id` | [string](#string) | | client identifier | -| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination request | - - - - - - - - -### QueryConsensusStatesResponse -QueryConsensusStatesResponse is the response type for the -Query/ConsensusStates RPC method - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `consensus_states` | [ConsensusStateWithHeight](#ibc.core.client.v1.ConsensusStateWithHeight) | repeated | consensus states associated with the identifier | -| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination response | +### MsgTransferResponse +MsgTransferResponse defines the Msg/Transfer response type. @@ -8232,229 +8045,14 @@ Query/ConsensusStates RPC method - - -### Query -Query provides defines the gRPC querier service - -| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | -| ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `ClientState` | [QueryClientStateRequest](#ibc.core.client.v1.QueryClientStateRequest) | [QueryClientStateResponse](#ibc.core.client.v1.QueryClientStateResponse) | ClientState queries an IBC light client. | GET|/ibc/core/client/v1beta1/client_states/{client_id}| -| `ClientStates` | [QueryClientStatesRequest](#ibc.core.client.v1.QueryClientStatesRequest) | [QueryClientStatesResponse](#ibc.core.client.v1.QueryClientStatesResponse) | ClientStates queries all the IBC light clients of a chain. | GET|/ibc/core/client/v1beta1/client_states| -| `ConsensusState` | [QueryConsensusStateRequest](#ibc.core.client.v1.QueryConsensusStateRequest) | [QueryConsensusStateResponse](#ibc.core.client.v1.QueryConsensusStateResponse) | ConsensusState queries a consensus state associated with a client state at a given height. | GET|/ibc/core/client/v1beta1/consensus_states/{client_id}/revision/{revision_number}/height/{revision_height}| -| `ConsensusStates` | [QueryConsensusStatesRequest](#ibc.core.client.v1.QueryConsensusStatesRequest) | [QueryConsensusStatesResponse](#ibc.core.client.v1.QueryConsensusStatesResponse) | ConsensusStates queries all the consensus state associated with a given client. | GET|/ibc/core/client/v1beta1/consensus_states/{client_id}| -| `ClientParams` | [QueryClientParamsRequest](#ibc.core.client.v1.QueryClientParamsRequest) | [QueryClientParamsResponse](#ibc.core.client.v1.QueryClientParamsResponse) | ClientParams queries all parameters of the ibc client. | GET|/ibc/client/v1beta1/params| - - - - - - -

Top

- -## ibc/core/client/v1/tx.proto - - - - - -### MsgCreateClient -MsgCreateClient defines a message to create an IBC client - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `client_state` | [google.protobuf.Any](#google.protobuf.Any) | | light client state | -| `consensus_state` | [google.protobuf.Any](#google.protobuf.Any) | | consensus state associated with the client that corresponds to a given height. | -| `signer` | [string](#string) | | signer address | - - - - - - - - -### MsgCreateClientResponse -MsgCreateClientResponse defines the Msg/CreateClient response type. - - - - - - - - -### MsgSubmitMisbehaviour -MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for -light client misbehaviour. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `client_id` | [string](#string) | | client unique identifier | -| `misbehaviour` | [google.protobuf.Any](#google.protobuf.Any) | | misbehaviour used for freezing the light client | -| `signer` | [string](#string) | | signer address | - - - - - - - - -### MsgSubmitMisbehaviourResponse -MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response type. - - - - - - - - -### MsgUpdateClient -MsgUpdateClient defines an sdk.Msg to update a IBC client state using -the given header. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `client_id` | [string](#string) | | client unique identifier | -| `header` | [google.protobuf.Any](#google.protobuf.Any) | | header to update the light client | -| `signer` | [string](#string) | | signer address | - - - - - - - - -### MsgUpdateClientResponse -MsgUpdateClientResponse defines the Msg/UpdateClient response type. - - - - - - - - -### MsgUpgradeClient -MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client state - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `client_id` | [string](#string) | | client unique identifier | -| `client_state` | [google.protobuf.Any](#google.protobuf.Any) | | upgraded client state | -| `consensus_state` | [google.protobuf.Any](#google.protobuf.Any) | | upgraded consensus state, only contains enough information to serve as a basis of trust in update logic | -| `proof_upgrade_client` | [bytes](#bytes) | | proof that old chain committed to new client | -| `proof_upgrade_consensus_state` | [bytes](#bytes) | | proof that old chain committed to new consensus state | -| `signer` | [string](#string) | | signer address | - - - - - - - - -### MsgUpgradeClientResponse -MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. - - - - - - - - - - - - - + ### Msg -Msg defines the ibc/client Msg service. +Msg defines the ibc/transfer Msg service. | Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | | ----------- | ------------ | ------------- | ------------| ------- | -------- | -| `CreateClient` | [MsgCreateClient](#ibc.core.client.v1.MsgCreateClient) | [MsgCreateClientResponse](#ibc.core.client.v1.MsgCreateClientResponse) | CreateClient defines a rpc handler method for MsgCreateClient. | | -| `UpdateClient` | [MsgUpdateClient](#ibc.core.client.v1.MsgUpdateClient) | [MsgUpdateClientResponse](#ibc.core.client.v1.MsgUpdateClientResponse) | UpdateClient defines a rpc handler method for MsgUpdateClient. | | -| `UpgradeClient` | [MsgUpgradeClient](#ibc.core.client.v1.MsgUpgradeClient) | [MsgUpgradeClientResponse](#ibc.core.client.v1.MsgUpgradeClientResponse) | UpgradeClient defines a rpc handler method for MsgUpgradeClient. | | -| `SubmitMisbehaviour` | [MsgSubmitMisbehaviour](#ibc.core.client.v1.MsgSubmitMisbehaviour) | [MsgSubmitMisbehaviourResponse](#ibc.core.client.v1.MsgSubmitMisbehaviourResponse) | SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. | | - - - - - - -

Top

- -## ibc/core/client/v1/genesis.proto - - - - - -### GenesisMetadata -GenesisMetadata defines the genesis type for metadata that clients may return -with ExportMetadata - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `key` | [bytes](#bytes) | | store key of metadata without clientID-prefix | -| `value` | [bytes](#bytes) | | metadata value | - - - - - - - - -### GenesisState -GenesisState defines the ibc client submodule's genesis state. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `clients` | [IdentifiedClientState](#ibc.core.client.v1.IdentifiedClientState) | repeated | client states with their corresponding identifiers | -| `clients_consensus` | [ClientConsensusStates](#ibc.core.client.v1.ClientConsensusStates) | repeated | consensus states from each client | -| `clients_metadata` | [IdentifiedGenesisMetadata](#ibc.core.client.v1.IdentifiedGenesisMetadata) | repeated | metadata from each client | -| `params` | [Params](#ibc.core.client.v1.Params) | | | -| `create_localhost` | [bool](#bool) | | create localhost on initialization | -| `next_client_sequence` | [uint64](#uint64) | | the sequence for the next generated client identifier | - - - - - - - - -### IdentifiedGenesisMetadata -IdentifiedGenesisMetadata has the client metadata with the corresponding client id. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `client_id` | [string](#string) | | | -| `client_metadata` | [GenesisMetadata](#ibc.core.client.v1.GenesisMetadata) | repeated | | - - - - - - - - - - +| `Transfer` | [MsgTransfer](#ibc.applications.transfer.v1.MsgTransfer) | [MsgTransferResponse](#ibc.applications.transfer.v1.MsgTransferResponse) | Transfer defines a rpc handler method for MsgTransfer. | | @@ -8629,6 +8227,62 @@ CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. + +

Top

+ +## ibc/core/channel/v1/genesis.proto + + + + + +### GenesisState +GenesisState defines the ibc channel submodule's genesis state. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `channels` | [IdentifiedChannel](#ibc.core.channel.v1.IdentifiedChannel) | repeated | | +| `acknowledgements` | [PacketState](#ibc.core.channel.v1.PacketState) | repeated | | +| `commitments` | [PacketState](#ibc.core.channel.v1.PacketState) | repeated | | +| `receipts` | [PacketState](#ibc.core.channel.v1.PacketState) | repeated | | +| `send_sequences` | [PacketSequence](#ibc.core.channel.v1.PacketSequence) | repeated | | +| `recv_sequences` | [PacketSequence](#ibc.core.channel.v1.PacketSequence) | repeated | | +| `ack_sequences` | [PacketSequence](#ibc.core.channel.v1.PacketSequence) | repeated | | +| `next_channel_sequence` | [uint64](#uint64) | | the sequence for the next generated channel identifier | + + + + + + + + +### PacketSequence +PacketSequence defines the genesis type necessary to retrieve and store +next send and receive sequences. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `port_id` | [string](#string) | | | +| `channel_id` | [string](#string) | | | +| `sequence` | [uint64](#uint64) | | | + + + + + + + + + + + + + + +

Top

@@ -9461,47 +9115,60 @@ Msg defines the ibc/channel Msg service. - +

Top

-## ibc/core/channel/v1/genesis.proto +## ibc/core/client/v1/genesis.proto - + + +### GenesisMetadata +GenesisMetadata defines the genesis type for metadata that clients may return +with ExportMetadata + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `key` | [bytes](#bytes) | | store key of metadata without clientID-prefix | +| `value` | [bytes](#bytes) | | metadata value | + + + + + + + ### GenesisState -GenesisState defines the ibc channel submodule's genesis state. +GenesisState defines the ibc client submodule's genesis state. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `channels` | [IdentifiedChannel](#ibc.core.channel.v1.IdentifiedChannel) | repeated | | -| `acknowledgements` | [PacketState](#ibc.core.channel.v1.PacketState) | repeated | | -| `commitments` | [PacketState](#ibc.core.channel.v1.PacketState) | repeated | | -| `receipts` | [PacketState](#ibc.core.channel.v1.PacketState) | repeated | | -| `send_sequences` | [PacketSequence](#ibc.core.channel.v1.PacketSequence) | repeated | | -| `recv_sequences` | [PacketSequence](#ibc.core.channel.v1.PacketSequence) | repeated | | -| `ack_sequences` | [PacketSequence](#ibc.core.channel.v1.PacketSequence) | repeated | | -| `next_channel_sequence` | [uint64](#uint64) | | the sequence for the next generated channel identifier | +| `clients` | [IdentifiedClientState](#ibc.core.client.v1.IdentifiedClientState) | repeated | client states with their corresponding identifiers | +| `clients_consensus` | [ClientConsensusStates](#ibc.core.client.v1.ClientConsensusStates) | repeated | consensus states from each client | +| `clients_metadata` | [IdentifiedGenesisMetadata](#ibc.core.client.v1.IdentifiedGenesisMetadata) | repeated | metadata from each client | +| `params` | [Params](#ibc.core.client.v1.Params) | | | +| `create_localhost` | [bool](#bool) | | create localhost on initialization | +| `next_client_sequence` | [uint64](#uint64) | | the sequence for the next generated client identifier | - + -### PacketSequence -PacketSequence defines the genesis type necessary to retrieve and store -next send and receive sequences. +### IdentifiedGenesisMetadata +IdentifiedGenesisMetadata has the client metadata with the corresponding client id. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `port_id` | [string](#string) | | | -| `channel_id` | [string](#string) | | | -| `sequence` | [uint64](#uint64) | | | +| `client_id` | [string](#string) | | | +| `client_metadata` | [GenesisMetadata](#ibc.core.client.v1.GenesisMetadata) | repeated | | @@ -9517,6 +9184,343 @@ next send and receive sequences. + +

Top

+ +## ibc/core/client/v1/query.proto + + + + + +### QueryClientParamsRequest +QueryClientParamsRequest is the request type for the Query/ClientParams RPC method. + + + + + + + + +### QueryClientParamsResponse +QueryClientParamsResponse is the response type for the Query/ClientParams RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `params` | [Params](#ibc.core.client.v1.Params) | | params defines the parameters of the module. | + + + + + + + + +### QueryClientStateRequest +QueryClientStateRequest is the request type for the Query/ClientState RPC +method + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `client_id` | [string](#string) | | client state unique identifier | + + + + + + + + +### QueryClientStateResponse +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `client_state` | [google.protobuf.Any](#google.protobuf.Any) | | client state associated with the request identifier | +| `proof` | [bytes](#bytes) | | merkle proof of existence | +| `proof_height` | [Height](#ibc.core.client.v1.Height) | | height at which the proof was retrieved | + + + + + + + + +### QueryClientStatesRequest +QueryClientStatesRequest is the request type for the Query/ClientStates RPC +method + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination request | + + + + + + + + +### QueryClientStatesResponse +QueryClientStatesResponse is the response type for the Query/ClientStates RPC +method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `client_states` | [IdentifiedClientState](#ibc.core.client.v1.IdentifiedClientState) | repeated | list of stored ClientStates of the chain. | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination response | + + + + + + + + +### QueryConsensusStateRequest +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `client_id` | [string](#string) | | client identifier | +| `revision_number` | [uint64](#uint64) | | consensus state revision number | +| `revision_height` | [uint64](#uint64) | | consensus state revision height | +| `latest_height` | [bool](#bool) | | latest_height overrrides the height field and queries the latest stored ConsensusState | + + + + + + + + +### QueryConsensusStateResponse +QueryConsensusStateResponse is the response type for the Query/ConsensusState +RPC method + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `consensus_state` | [google.protobuf.Any](#google.protobuf.Any) | | consensus state associated with the client identifier at the given height | +| `proof` | [bytes](#bytes) | | merkle proof of existence | +| `proof_height` | [Height](#ibc.core.client.v1.Height) | | height at which the proof was retrieved | + + + + + + + + +### QueryConsensusStatesRequest +QueryConsensusStatesRequest is the request type for the Query/ConsensusStates +RPC method. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `client_id` | [string](#string) | | client identifier | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination request | + + + + + + + + +### QueryConsensusStatesResponse +QueryConsensusStatesResponse is the response type for the +Query/ConsensusStates RPC method + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `consensus_states` | [ConsensusStateWithHeight](#ibc.core.client.v1.ConsensusStateWithHeight) | repeated | consensus states associated with the identifier | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination response | + + + + + + + + + + + + + + +### Query +Query provides defines the gRPC querier service + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `ClientState` | [QueryClientStateRequest](#ibc.core.client.v1.QueryClientStateRequest) | [QueryClientStateResponse](#ibc.core.client.v1.QueryClientStateResponse) | ClientState queries an IBC light client. | GET|/ibc/core/client/v1beta1/client_states/{client_id}| +| `ClientStates` | [QueryClientStatesRequest](#ibc.core.client.v1.QueryClientStatesRequest) | [QueryClientStatesResponse](#ibc.core.client.v1.QueryClientStatesResponse) | ClientStates queries all the IBC light clients of a chain. | GET|/ibc/core/client/v1beta1/client_states| +| `ConsensusState` | [QueryConsensusStateRequest](#ibc.core.client.v1.QueryConsensusStateRequest) | [QueryConsensusStateResponse](#ibc.core.client.v1.QueryConsensusStateResponse) | ConsensusState queries a consensus state associated with a client state at a given height. | GET|/ibc/core/client/v1beta1/consensus_states/{client_id}/revision/{revision_number}/height/{revision_height}| +| `ConsensusStates` | [QueryConsensusStatesRequest](#ibc.core.client.v1.QueryConsensusStatesRequest) | [QueryConsensusStatesResponse](#ibc.core.client.v1.QueryConsensusStatesResponse) | ConsensusStates queries all the consensus state associated with a given client. | GET|/ibc/core/client/v1beta1/consensus_states/{client_id}| +| `ClientParams` | [QueryClientParamsRequest](#ibc.core.client.v1.QueryClientParamsRequest) | [QueryClientParamsResponse](#ibc.core.client.v1.QueryClientParamsResponse) | ClientParams queries all parameters of the ibc client. | GET|/ibc/client/v1beta1/params| + + + + + + +

Top

+ +## ibc/core/client/v1/tx.proto + + + + + +### MsgCreateClient +MsgCreateClient defines a message to create an IBC client + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `client_state` | [google.protobuf.Any](#google.protobuf.Any) | | light client state | +| `consensus_state` | [google.protobuf.Any](#google.protobuf.Any) | | consensus state associated with the client that corresponds to a given height. | +| `signer` | [string](#string) | | signer address | + + + + + + + + +### MsgCreateClientResponse +MsgCreateClientResponse defines the Msg/CreateClient response type. + + + + + + + + +### MsgSubmitMisbehaviour +MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for +light client misbehaviour. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `client_id` | [string](#string) | | client unique identifier | +| `misbehaviour` | [google.protobuf.Any](#google.protobuf.Any) | | misbehaviour used for freezing the light client | +| `signer` | [string](#string) | | signer address | + + + + + + + + +### MsgSubmitMisbehaviourResponse +MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response type. + + + + + + + + +### MsgUpdateClient +MsgUpdateClient defines an sdk.Msg to update a IBC client state using +the given header. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `client_id` | [string](#string) | | client unique identifier | +| `header` | [google.protobuf.Any](#google.protobuf.Any) | | header to update the light client | +| `signer` | [string](#string) | | signer address | + + + + + + + + +### MsgUpdateClientResponse +MsgUpdateClientResponse defines the Msg/UpdateClient response type. + + + + + + + + +### MsgUpgradeClient +MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client state + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `client_id` | [string](#string) | | client unique identifier | +| `client_state` | [google.protobuf.Any](#google.protobuf.Any) | | upgraded client state | +| `consensus_state` | [google.protobuf.Any](#google.protobuf.Any) | | upgraded consensus state, only contains enough information to serve as a basis of trust in update logic | +| `proof_upgrade_client` | [bytes](#bytes) | | proof that old chain committed to new client | +| `proof_upgrade_consensus_state` | [bytes](#bytes) | | proof that old chain committed to new consensus state | +| `signer` | [string](#string) | | signer address | + + + + + + + + +### MsgUpgradeClientResponse +MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. + + + + + + + + + + + + + + +### Msg +Msg defines the ibc/client Msg service. + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `CreateClient` | [MsgCreateClient](#ibc.core.client.v1.MsgCreateClient) | [MsgCreateClientResponse](#ibc.core.client.v1.MsgCreateClientResponse) | CreateClient defines a rpc handler method for MsgCreateClient. | | +| `UpdateClient` | [MsgUpdateClient](#ibc.core.client.v1.MsgUpdateClient) | [MsgUpdateClientResponse](#ibc.core.client.v1.MsgUpdateClientResponse) | UpdateClient defines a rpc handler method for MsgUpdateClient. | | +| `UpgradeClient` | [MsgUpgradeClient](#ibc.core.client.v1.MsgUpgradeClient) | [MsgUpgradeClientResponse](#ibc.core.client.v1.MsgUpgradeClientResponse) | UpgradeClient defines a rpc handler method for MsgUpgradeClient. | | +| `SubmitMisbehaviour` | [MsgSubmitMisbehaviour](#ibc.core.client.v1.MsgSubmitMisbehaviour) | [MsgSubmitMisbehaviourResponse](#ibc.core.client.v1.MsgSubmitMisbehaviourResponse) | SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. | | + + + + +

Top

@@ -9741,6 +9745,39 @@ INIT, TRYOPEN, OPEN or UNINITIALIZED. + +

Top

+ +## ibc/core/connection/v1/genesis.proto + + + + + +### GenesisState +GenesisState defines the ibc connection submodule's genesis state. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `connections` | [IdentifiedConnection](#ibc.core.connection.v1.IdentifiedConnection) | repeated | | +| `client_connection_paths` | [ConnectionPaths](#ibc.core.connection.v1.ConnectionPaths) | repeated | | +| `next_connection_sequence` | [uint64](#uint64) | | the sequence for the next generated connection identifier | + + + + + + + + + + + + + + +

Top

@@ -10105,39 +10142,6 @@ Msg defines the ibc/connection Msg service. - -

Top

- -## ibc/core/connection/v1/genesis.proto - - - - - -### GenesisState -GenesisState defines the ibc connection submodule's genesis state. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `connections` | [IdentifiedConnection](#ibc.core.connection.v1.IdentifiedConnection) | repeated | | -| `client_connection_paths` | [ConnectionPaths](#ibc.core.connection.v1.ConnectionPaths) | repeated | | -| `next_connection_sequence` | [uint64](#uint64) | | the sequence for the next generated connection identifier | - - - - - - - - - - - - - - -

Top

@@ -10194,128 +10198,6 @@ access to keys outside the client prefix. - - - - - - - - - - - -

Top

- -## ibc/lightclients/tendermint/v1/tendermint.proto - - - - - -### ClientState -ClientState from Tendermint tracks the current validator set, latest height, -and a possible frozen height. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `chain_id` | [string](#string) | | | -| `trust_level` | [Fraction](#ibc.lightclients.tendermint.v1.Fraction) | | | -| `trusting_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | duration of the period since the LastestTimestamp during which the submitted headers are valid for upgrade | -| `unbonding_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | duration of the staking unbonding period | -| `max_clock_drift` | [google.protobuf.Duration](#google.protobuf.Duration) | | defines how much new (untrusted) header's Time can drift into the future. | -| `frozen_height` | [ibc.core.client.v1.Height](#ibc.core.client.v1.Height) | | Block height when the client was frozen due to a misbehaviour | -| `latest_height` | [ibc.core.client.v1.Height](#ibc.core.client.v1.Height) | | Latest height the client was updated to | -| `proof_specs` | [ics23.ProofSpec](#ics23.ProofSpec) | repeated | Proof specifications used in verifying counterparty state | -| `upgrade_path` | [string](#string) | repeated | 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"}` | -| `allow_update_after_expiry` | [bool](#bool) | | This flag, when set to true, will allow governance to recover a client which has expired | -| `allow_update_after_misbehaviour` | [bool](#bool) | | This flag, when set to true, will allow governance to unfreeze a client whose chain has experienced a misbehaviour event | - - - - - - - - -### ConsensusState -ConsensusState defines the consensus state from Tendermint. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `timestamp` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | timestamp that corresponds to the block height in which the ConsensusState was stored. | -| `root` | [ibc.core.commitment.v1.MerkleRoot](#ibc.core.commitment.v1.MerkleRoot) | | commitment root (i.e app hash) | -| `next_validators_hash` | [bytes](#bytes) | | | - - - - - - - - -### Fraction -Fraction defines the protobuf message type for tmmath.Fraction that only supports positive values. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `numerator` | [uint64](#uint64) | | | -| `denominator` | [uint64](#uint64) | | | - - - - - - - - -### Header -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. - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `signed_header` | [tendermint.types.SignedHeader](#tendermint.types.SignedHeader) | | | -| `validator_set` | [tendermint.types.ValidatorSet](#tendermint.types.ValidatorSet) | | | -| `trusted_height` | [ibc.core.client.v1.Height](#ibc.core.client.v1.Height) | | | -| `trusted_validators` | [tendermint.types.ValidatorSet](#tendermint.types.ValidatorSet) | | | - - - - - - - - -### Misbehaviour -Misbehaviour is a wrapper over two conflicting Headers -that implements Misbehaviour interface expected by ICS-02 - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| `client_id` | [string](#string) | | | -| `header_1` | [Header](#ibc.lightclients.tendermint.v1.Header) | | | -| `header_2` | [Header](#ibc.lightclients.tendermint.v1.Header) | | | - - - - - @@ -10643,6 +10525,128 @@ data sign byte encodings. + +

Top

+ +## ibc/lightclients/tendermint/v1/tendermint.proto + + + + + +### ClientState +ClientState from Tendermint tracks the current validator set, latest height, +and a possible frozen height. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `chain_id` | [string](#string) | | | +| `trust_level` | [Fraction](#ibc.lightclients.tendermint.v1.Fraction) | | | +| `trusting_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | duration of the period since the LastestTimestamp during which the submitted headers are valid for upgrade | +| `unbonding_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | duration of the staking unbonding period | +| `max_clock_drift` | [google.protobuf.Duration](#google.protobuf.Duration) | | defines how much new (untrusted) header's Time can drift into the future. | +| `frozen_height` | [ibc.core.client.v1.Height](#ibc.core.client.v1.Height) | | Block height when the client was frozen due to a misbehaviour | +| `latest_height` | [ibc.core.client.v1.Height](#ibc.core.client.v1.Height) | | Latest height the client was updated to | +| `proof_specs` | [ics23.ProofSpec](#ics23.ProofSpec) | repeated | Proof specifications used in verifying counterparty state | +| `upgrade_path` | [string](#string) | repeated | 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"}` | +| `allow_update_after_expiry` | [bool](#bool) | | This flag, when set to true, will allow governance to recover a client which has expired | +| `allow_update_after_misbehaviour` | [bool](#bool) | | This flag, when set to true, will allow governance to unfreeze a client whose chain has experienced a misbehaviour event | + + + + + + + + +### ConsensusState +ConsensusState defines the consensus state from Tendermint. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `timestamp` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | timestamp that corresponds to the block height in which the ConsensusState was stored. | +| `root` | [ibc.core.commitment.v1.MerkleRoot](#ibc.core.commitment.v1.MerkleRoot) | | commitment root (i.e app hash) | +| `next_validators_hash` | [bytes](#bytes) | | | + + + + + + + + +### Fraction +Fraction defines the protobuf message type for tmmath.Fraction that only supports positive values. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `numerator` | [uint64](#uint64) | | | +| `denominator` | [uint64](#uint64) | | | + + + + + + + + +### Header +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. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `signed_header` | [tendermint.types.SignedHeader](#tendermint.types.SignedHeader) | | | +| `validator_set` | [tendermint.types.ValidatorSet](#tendermint.types.ValidatorSet) | | | +| `trusted_height` | [ibc.core.client.v1.Height](#ibc.core.client.v1.Height) | | | +| `trusted_validators` | [tendermint.types.ValidatorSet](#tendermint.types.ValidatorSet) | | | + + + + + + + + +### Misbehaviour +Misbehaviour is a wrapper over two conflicting Headers +that implements Misbehaviour interface expected by ICS-02 + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `client_id` | [string](#string) | | | +| `header_1` | [Header](#ibc.lightclients.tendermint.v1.Header) | | | +| `header_2` | [Header](#ibc.lightclients.tendermint.v1.Header) | | | + + + + + + + + + + + + + + + ## Scalar Value Types | .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | diff --git a/proto/cosmos/staking/v1beta1/staking.proto b/proto/cosmos/staking/v1beta1/staking.proto index eadc86e9d..e37b28b6d 100644 --- a/proto/cosmos/staking/v1beta1/staking.proto +++ b/proto/cosmos/staking/v1beta1/staking.proto @@ -27,12 +27,15 @@ 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", @@ -45,7 +48,9 @@ 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\""]; } @@ -55,10 +60,15 @@ 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; } @@ -75,22 +85,33 @@ message Validator { 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", @@ -164,8 +185,11 @@ message Delegation { 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]; } @@ -176,8 +200,11 @@ message UnbondingDelegation { 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 } @@ -186,14 +213,18 @@ 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]; } @@ -202,14 +233,18 @@ 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]; } @@ -221,9 +256,13 @@ message Redelegation { 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 } @@ -232,11 +271,16 @@ 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\""]; } diff --git a/x/staking/spec/01_state.md b/x/staking/spec/01_state.md index c5f7376d7..e090acb01 100644 --- a/x/staking/spec/01_state.md +++ b/x/staking/spec/01_state.md @@ -8,23 +8,16 @@ order: 1 LastTotalPower tracks the total amounts of bonded tokens recorded during the previous end block. -- LastTotalPower: `0x12 -> amino(sdk.Int)` +- LastTotalPower: `0x12 -> ProtocolBuffer(sdk.Int)` ## Params Params is a module-wide configuration structure that stores system parameters and defines overall functioning of the staking module. -- Params: `Paramsspace("staking") -> amino(params)` +- Params: `Paramsspace("staking") -> legacy_amino(params)` -```go -type Params struct { - UnbondingTime time.Duration // time duration of unbonding - MaxValidators uint16 // maximum number of validators - MaxEntries uint16 // max entries for either unbonding delegation or redelegation (per pair/trio) - BondDenom string // bondable coin denomination -} -``` ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.1/proto/cosmos/staking/v1beta1/staking.proto#L230-L241 ## Validator @@ -37,8 +30,8 @@ Validators can have one of three statuses They are signing blocks and receiving rewards. They can receive further delegations. They can be slashed for misbehavior. Delegators to this validator who unbond their delegation must wait the duration of the UnbondingTime, a chain-specific param. during which time - they are still slashable for offences of the source validator if those offences were committed - during the period of time that the tokens were bonded. + they are still slashable for offences of the source validator if those offences were committed + during the period of time that the tokens were bonded. - `Unbonding`: When a validator leaves the active set, either by choice or due to slashing or tombstoning, an unbonding of all their delegations begins. All delegations must then wait the UnbondingTime before moving receiving their tokens to their accounts from the `BondedPool`. @@ -51,10 +44,10 @@ required lookups for slashing and validator-set updates. A third special index throughout each block, unlike the first two indices which mirror the validator records within a block. -- Validators: `0x21 | OperatorAddr -> amino(validator)` +- Validators: `0x21 | OperatorAddr -> ProtocolBuffer(validator)` - ValidatorsByConsAddr: `0x22 | ConsAddr -> OperatorAddr` - ValidatorsByPower: `0x23 | BigEndian(ConsensusPower) | OperatorAddr -> OperatorAddr` -- LastValidatorsPower: `0x11 OperatorAddr -> amino(ConsensusPower)` +- LastValidatorsPower: `0x11 OperatorAddr -> ProtocolBuffer(ConsensusPower)` `Validators` is the primary index - it ensures that each operator can have only one associated validator, where the public key of that validator can change in the @@ -68,7 +61,7 @@ address which can be derived from the validator's `ConsPubKey`. `ValidatorsByPower` is an additional index that provides a sorted list o potential validators to quickly determine the current active set. Here -ConsensusPower is validator.Tokens/10^6. Note that all validators where +ConsensusPower is validator.Tokens/10^6. Note that all validators where `Jailed` is true are not stored within this index. `LastValidatorsPower` is a special index that provides a historical list of the @@ -77,60 +70,23 @@ is updated during the validator set update process which takes place in [`EndBlo Each validator's state is stored in a `Validator` struct: -```go -type Validator struct { - OperatorAddress sdk.ValAddress // address of the validator's operator; bech encoded in JSON - ConsPubKey crypto.PubKey // the consensus public key of the validator; bech encoded in JSON - Jailed bool // has the validator been jailed from bonded status? - Status sdk.BondStatus // validator status (bonded/unbonding/unbonded) - Tokens sdk.Int // delegated tokens (incl. self-delegation) - DelegatorShares sdk.Dec // total shares issued to a validator's delegators - Description Description // description terms for the validator - UnbondingHeight int64 // if unbonding, height at which this validator has begun unbonding - UnbondingCompletionTime time.Time // if unbonding, min time for the validator to complete unbonding - Commission Commission // commission parameters - MinSelfDelegation sdk.Int // validator's self declared minimum self delegation -} ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L65-L99 -type Commission struct { - CommissionRates - UpdateTime time.Time // the last time the commission rate was changed -} - -CommissionRates struct { - Rate sdk.Dec // the commission rate charged to delegators, as a fraction - MaxRate sdk.Dec // maximum commission rate which validator can ever charge, as a fraction - MaxChangeRate sdk.Dec // maximum daily increase of the validator commission, as a fraction -} - -type Description struct { - Moniker string // name - Identity string // optional identity signature (ex. UPort or Keybase) - Website string // optional website link - SecurityContact string // optional email for security contact - Details string // optional details -} -``` ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L24-L63 ## Delegation Delegations are identified by combining `DelegatorAddr` (the address of the delegator) with the `ValidatorAddr` Delegators are indexed in the store as follows: -- Delegation: `0x31 | DelegatorAddr | ValidatorAddr -> amino(delegation)` +- Delegation: `0x31 | DelegatorAddr | ValidatorAddr -> ProtocolBuffer(delegation)` Stake holders may delegate coins to validators; under this circumstance their funds are held in a `Delegation` data structure. It is owned by one delegator, and is associated with the shares for one validator. The sender of the transaction is the owner of the bond. -```go -type Delegation struct { - DelegatorAddr sdk.AccAddress - ValidatorAddr sdk.ValAddress - Shares sdk.Dec // delegation shares received -} -``` ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L159-L170 ### Delegator Shares @@ -159,10 +115,8 @@ detected. `UnbondingDelegation` are indexed in the store as: -- UnbondingDelegation: `0x32 | DelegatorAddr | ValidatorAddr -> - amino(unbondingDelegation)` -- UnbondingDelegationsFromValidator: `0x33 | ValidatorAddr | DelegatorAddr -> - nil` +- UnbondingDelegation: `0x32 | DelegatorAddr | ValidatorAddr -> ProtocolBuffer(unbondingDelegation)` +- UnbondingDelegationsFromValidator: `0x33 | ValidatorAddr | DelegatorAddr -> nil` The first map here is used in queries, to lookup all unbonding delegations for a given delegator, while the second map is used in slashing, to lookup all @@ -171,20 +125,7 @@ slashed. A UnbondingDelegation object is created every time an unbonding is initiated. -```go -type UnbondingDelegation struct { - DelegatorAddr sdk.AccAddress // delegator - ValidatorAddr sdk.ValAddress // validator unbonding from operator addr - Entries []UnbondingDelegationEntry // unbonding delegation entries -} - -type UnbondingDelegationEntry struct { - CreationHeight int64 // height which the unbonding took place - CompletionTime time.Time // unix time for unbonding completion - InitialBalance sdk.Coin // atoms initially scheduled to receive at completion - Balance sdk.Coin // atoms to receive at completion -} -``` ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L172-L198 ## Redelegation @@ -196,7 +137,7 @@ committed by the source validator. `Redelegation` are indexed in the store as: -- Redelegations: `0x34 | DelegatorAddr | ValidatorSrcAddr | ValidatorDstAddr -> amino(redelegation)` +- Redelegations: `0x34 | DelegatorAddr | ValidatorSrcAddr | ValidatorDstAddr -> ProtocolBuffer(redelegation)` - RedelegationsBySrc: `0x35 | ValidatorSrcAddr | ValidatorDstAddr | DelegatorAddr -> nil` - RedelegationsByDst: `0x36 | ValidatorDstAddr | ValidatorSrcAddr | DelegatorAddr -> nil` @@ -204,30 +145,15 @@ The first map here is used for queries, to lookup all redelegations for a given delegator. The second map is used for slashing based on the `ValidatorSrcAddr`, while the third map is for slashing based on the `ValidatorDstAddr`. -A redelegation object is created every time a redelegation occurs. To prevent +A redelegation object is created every time a redelegation occurs. To prevent "redelegation hopping" redelegations may not occur under the situation that: - the (re)delegator already has another immature redelegation in progress -with a destination to a validator (let's call it `Validator X`) + with a destination to a validator (let's call it `Validator X`) - and, the (re)delegator is attempting to create a _new_ redelegation -where the source validator for this new redelegation is `Validator-X`. + where the source validator for this new redelegation is `Validator-X`. -```go -type Redelegation struct { - DelegatorAddr sdk.AccAddress // delegator - ValidatorSrcAddr sdk.ValAddress // validator redelegation source operator addr - ValidatorDstAddr sdk.ValAddress // validator redelegation destination operator addr - Entries []RedelegationEntry // redelegation entries -} - -type RedelegationEntry struct { - CreationHeight int64 // height which the redelegation took place - CompletionTime time.Time // unix time for redelegation completion - InitialBalance sdk.Coin // initial balance when redelegation started - Balance sdk.Coin // current balance (current value held in destination validator) - SharesDst sdk.Dec // amount of destination-validator shares created by redelegation -} -``` ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L200-L228 ## Queues @@ -249,12 +175,7 @@ delegations queue is kept. - UnbondingDelegation: `0x41 | format(time) -> []DVPair` -```go -type DVPair struct { - DelegatorAddr sdk.AccAddress - ValidatorAddr sdk.ValAddress -} -``` ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L123-L133 ### RedelegationQueue @@ -263,13 +184,7 @@ kept. - UnbondingDelegation: `0x42 | format(time) -> []DVVTriplet` -```go -type DVVTriplet struct { - DelegatorAddr sdk.AccAddress - ValidatorSrcAddr sdk.ValAddress - ValidatorDstAddr sdk.ValAddress -} -``` ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L140-L152 ### ValidatorQueue @@ -279,7 +194,7 @@ queue is kept. - ValidatorQueueTime: `0x43 | format(time) -> []sdk.ValAddress` The stored object as each key is an array of validator operator addresses from -which the validator object can be accessed. Typically it is expected that only +which the validator object can be accessed. Typically it is expected that only a single validator record will be associated with a given timestamp however it is possible that multiple validators exist in the queue at the same location. @@ -288,15 +203,10 @@ that multiple validators exist in the queue at the same location. HistoricalInfo objects are stored and pruned at each block such that the staking keeper persists the `n` most recent historical info defined by staking module parameter: `HistoricalEntries`. -```go -type HistoricalInfo struct { - Header tmproto.Header - ValSet []types.Validator -} -``` ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L15-L22 At each BeginBlock, the staking keeper will persist the current Header and the Validators that committed -the current block in a `HistoricalInfo` object. The Validators are sorted on their address to ensure that +the current block in a `HistoricalInfo` object. The Validators are sorted on their address to ensure that they are in a determisnistic order. -The oldest HistoricalEntries will be pruned to ensure that there only exist the parameter-defined number of +The oldest HistoricalEntries will be pruned to ensure that there only exist the parameter-defined number of historical entries. diff --git a/x/staking/spec/02_state_transitions.md b/x/staking/spec/02_state_transitions.md index c2766aa43..9e245719c 100644 --- a/x/staking/spec/02_state_transitions.md +++ b/x/staking/spec/02_state_transitions.md @@ -11,12 +11,13 @@ This document describes the state transition operations pertaining to: 3. [Slashing](./02_state_transitions.md#slashing) ## Validators -State transitions in validators are performed on every [`EndBlock`](./05_end_block.md#validator-set-changes) + +State transitions in validators are performed on every [`EndBlock`](./05_end_block.md#validator-set-changes) in order to check for changes in the active `ValidatorSet`. ### Unbonded to Bonded -The following transition occurs when a validator's ranking in the `ValidatorPowerIndex` surpasses +The following transition occurs when a validator's ranking in the `ValidatorPowerIndex` surpasses that of the `LastValidator`. - set `validator.Status` to `Bonded` @@ -98,9 +99,9 @@ Redelegations affect the delegation, source and destination validators. - perform an `unbond` delegation from the source validator to retrieve the tokens worth of the unbonded shares - using the unbonded tokens, `Delegate` them to the destination validator -- if the `sourceValidator.Status` is `Bonded`, and the `destinationValidator` is not, +- if the `sourceValidator.Status` is `Bonded`, and the `destinationValidator` is not, transfer the newly delegated tokens from the `BondedPool` to the `NotBondedPool` `ModuleAccount` -- otherwise, if the `sourceValidator.Status` is not `Bonded`, and the `destinationValidator` +- otherwise, if the `sourceValidator.Status` is not `Bonded`, and the `destinationValidator` is `Bonded`, transfer the newly delegated tokens from the `NotBondedPool` to the `BondedPool` `ModuleAccount` - record the token amount in an new entry in the relevant `Redelegation` @@ -116,20 +117,20 @@ When a redelegations complete the following occurs: When a Validator is slashed, the following occurs: -- The total `slashAmount` is calculated as the `slashFactor` (a chain parameter) * `TokensFromConsensusPower`, -the total number of tokens bonded to the validator at the time of the infraction. +- The total `slashAmount` is calculated as the `slashFactor` (a chain parameter) \* `TokensFromConsensusPower`, + the total number of tokens bonded to the validator at the time of the infraction. - Every unbonding delegation and redelegation from the validator are slashed by the `slashFactor` -percentage of the initialBalance. + percentage of the initialBalance. - Each amount slashed from redelegations and unbonding delegations is subtracted from the -total slash amount. + total slash amount. - The `remaingSlashAmount` is then slashed from the validator's tokens in the `BondedPool` or -`NonBondedPool` depending on the validator's status. This reduces the total supply of tokens. + `NonBondedPool` depending on the validator's status. This reduces the total supply of tokens. ### Slash Unbonding Delegation -When a validator is slashed, so are those unbonding delegations from the validator that began unbonding -after the time of the infraction. Every entry in every unbonding delegation from the validator -is slashed by `slashFactor`. The amount slashed is calculated from the `InitialBalance` of the +When a validator is slashed, so are those unbonding delegations from the validator that began unbonding +after the time of the infraction. Every entry in every unbonding delegation from the validator +is slashed by `slashFactor`. The amount slashed is calculated from the `InitialBalance` of the delegation and is capped to prevent a resulting negative balance. Completed (or mature) unbondings are not slashed. ### Slash Redelegation diff --git a/x/staking/spec/03_messages.md b/x/staking/spec/03_messages.md index bd9f21e2c..1155da93d 100644 --- a/x/staking/spec/03_messages.md +++ b/x/staking/spec/03_messages.md @@ -6,23 +6,15 @@ order: 3 In this section we describe the processing of the staking messages and the corresponding updates to the state. All created/modified state objects specified by each message are defined within the [state](./02_state_transitions.md) section. -## MsgCreateValidator +## Msg/CreateValidator -A validator is created using the `MsgCreateValidator` message. +A validator is created using the `Msg/CreateValidator` service message. -```go -type MsgCreateValidator struct { - Description Description - Commission Commission ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L16-L17 - DelegatorAddr sdk.AccAddress - ValidatorAddr sdk.ValAddress - PubKey crypto.PubKey - Delegation sdk.Coin -} -``` ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L35-L51 -This message is expected to fail if: +This service message is expected to fail if: - another validator with this operator address is already registered - another validator with this pubkey is already registered @@ -33,71 +25,63 @@ This message is expected to fail if: - the initial `MaxChangeRate` is either negative or > `MaxRate` - the description fields are too large -This message creates and stores the `Validator` object at appropriate indexes. +This service message creates and stores the `Validator` object at appropriate indexes. Additionally a self-delegation is made with the initial tokens delegation tokens `Delegation`. The validator always starts as unbonded but may be bonded in the first end-block. -## MsgEditValidator +## Msg/EditValidator The `Description`, `CommissionRate` of a validator can be updated using the -`MsgEditCandidacy`. +`Msg/EditCandidacy` service message. -```go -type MsgEditCandidacy struct { - Description Description - ValidatorAddr sdk.ValAddress - CommissionRate sdk.Dec -} -``` ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L19-L20 -This message is expected to fail if: ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L56-L76 + +This service message is expected to fail if: - the initial `CommissionRate` is either negative or > `MaxRate` - the `CommissionRate` has already been updated within the previous 24 hours - the `CommissionRate` is > `MaxChangeRate` - the description fields are too large -This message stores the updated `Validator` object. +This service message stores the updated `Validator` object. -## MsgDelegate +## Msg/Delegate -Within this message the delegator provides coins, and in return receives +Within this service message the delegator provides coins, and in return receives some amount of their validator's (newly created) delegator-shares that are assigned to `Delegation.Shares`. -```go -type MsgDelegate struct { - DelegatorAddr sdk.AccAddress - ValidatorAddr sdk.ValAddress - Amount sdk.Coin -} -``` ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L22-L24 -This message is expected to fail if: ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L81-L90 + +This service message is expected to fail if: - the validator is does not exist - the validator is jailed - the `Amount` `Coin` has a denomination different than one defined by `params.BondDenom` If an existing `Delegation` object for provided addresses does not already -exist than it is created as part of this message otherwise the existing +exist than it is created as part of this service message otherwise the existing `Delegation` is updated to include the newly received shares. -## MsgBeginUnbonding +## Msg/Undelegate -The begin unbonding message allows delegators to undelegate their tokens from +The `Msg/Undelegate` service message allows delegators to undelegate their tokens from validator. -```go -type MsgBeginUnbonding struct { - DelegatorAddr sdk.AccAddress - ValidatorAddr sdk.ValAddress - Amount sdk.Coin -} -``` ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L30-L32 -This message is expected to fail if: ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L112-L121 + +This service message returns a response containing the completion time of the undelegation: + ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L123-L126 + +This service message is expected to fail if: - the delegation doesn't exist - the validator doesn't exist @@ -105,7 +89,7 @@ This message is expected to fail if: - existing `UnbondingDelegation` has maximum entries as defined by `params.MaxEntries` - the `Amount` has a denomination different than one defined by `params.BondDenom` -When this message is processed the following actions occur: +When this service message is processed the following actions occur: - validator's `DelegatorShares` and the delegation's `Shares` are both reduced by the message `SharesAmount` - calculate the token worth of the shares remove that amount tokens held within the validator @@ -116,22 +100,21 @@ When this message is processed the following actions occur: - if there are no more `Shares` in the delegation, then the delegation object is removed from the store - under this situation if the delegation is the validator's self-delegation then also jail the validator. -## MsgBeginRedelegate +## Msg/BeginRedelegate The redelegation command allows delegators to instantly switch validators. Once the unbonding period has passed, the redelegation is automatically completed in the EndBlocker. -```go -type MsgBeginRedelegate struct { - DelegatorAddr sdk.AccAddress - ValidatorSrcAddr sdk.ValAddress - ValidatorDstAddr sdk.ValAddress - Amount sdk.Coin -} -``` ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L26-L28 -This message is expected to fail if: ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105 + +This service message returns a response containing the completion time of the redelegation: + ++++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L107-L110 + +This service message is expected to fail if: - the delegation doesn't exist - the source or destination validators don't exist @@ -140,7 +123,7 @@ This message is expected to fail if: - existing `Redelegation` has maximum entries as defined by `params.MaxEntries` - the `Amount` `Coin` has a denomination different than one defined by `params.BondDenom` -When this message is processed the following actions occur: +When this service message is processed the following actions occur: - the source validator's `DelegatorShares` and the delegations `Shares` are both reduced by the message `SharesAmount` - calculate the token worth of the shares remove that amount tokens held within the source validator. @@ -148,6 +131,6 @@ When this message is processed the following actions occur: - `Bonded` - add an entry to the `Redelegation` (create `Redelegation` if it doesn't exist) with a completion time a full unbonding period from the current time. Update pool shares to reduce BondedTokens and increase NotBondedTokens by token worth of the shares (this may be effectively reversed in the next step however). - `Unbonding` - add an entry to the `Redelegation` (create `Redelegation` if it doesn't exist) with the same completion time as the validator (`UnbondingMinTime`). - `Unbonded` - no action required in this step -- Delegate the token worth to the destination validator, possibly moving tokens back to the bonded state. +- Delegate the token worth to the destination validator, possibly moving tokens back to the bonded state. - if there are no more `Shares` in the source delegation, then the source delegation object is removed from the store - under this situation if the delegation is the validator's self-delegation then also jail the validator. diff --git a/x/staking/spec/07_events.md b/x/staking/spec/07_events.md index d8255ca92..660319b3c 100644 --- a/x/staking/spec/07_events.md +++ b/x/staking/spec/07_events.md @@ -18,9 +18,9 @@ The staking module emits the following events: | complete_redelegation | destination_validator | {dstValidatorAddress} | | complete_redelegation | delegator | {delegatorAddress} | -## Handlers +## Service Messages -### MsgCreateValidator +### Msg/CreateValidator | Type | Attribute Key | Attribute Value | | ---------------- | ------------- | ------------------ | @@ -30,7 +30,7 @@ The staking module emits the following events: | message | action | create_validator | | message | sender | {senderAddress} | -### MsgEditValidator +### Msg/EditValidator | Type | Attribute Key | Attribute Value | | -------------- | ------------------- | ------------------- | @@ -40,7 +40,7 @@ The staking module emits the following events: | message | action | edit_validator | | message | sender | {senderAddress} | -### MsgDelegate +### Msg/Delegate | Type | Attribute Key | Attribute Value | | -------- | ------------- | ------------------ | @@ -50,7 +50,7 @@ The staking module emits the following events: | message | action | delegate | | message | sender | {senderAddress} | -### MsgUndelegate +### Msg/Undelegate | Type | Attribute Key | Attribute Value | | ------- | ------------------- | ------------------ | @@ -61,9 +61,9 @@ The staking module emits the following events: | message | action | begin_unbonding | | message | sender | {senderAddress} | -* [0] Time is formatted in the RFC3339 standard +- [0] Time is formatted in the RFC3339 standard -### MsgBeginRedelegate +### Msg/BeginRedelegate | Type | Attribute Key | Attribute Value | | ---------- | --------------------- | --------------------- | @@ -75,4 +75,4 @@ The staking module emits the following events: | message | action | begin_redelegate | | message | sender | {senderAddress} | -* [0] Time is formatted in the RFC3339 standard +- [0] Time is formatted in the RFC3339 standard diff --git a/x/staking/spec/README.md b/x/staking/spec/README.md index 0005088ae..a2cb7cf3a 100644 --- a/x/staking/spec/README.md +++ b/x/staking/spec/README.md @@ -38,18 +38,18 @@ network. - [Delegations](02_state_transitions.md#delegations) - [Slashing](02_state_transitions.md#slashing) 3. **[Messages](03_messages.md)** - - [MsgCreateValidator](03_messages.md#msgcreatevalidator) - - [MsgEditValidator](03_messages.md#msgeditvalidator) - - [MsgDelegate](03_messages.md#msgdelegate) - - [MsgBeginUnbonding](03_messages.md#msgbeginunbonding) - - [MsgBeginRedelegate](03_messages.md#msgbeginredelegate) + - [Msg/CreateValidator](03_messages.md#msgcreatevalidator) + - [Msg/EditValidator](03_messages.md#msgeditvalidator) + - [Msg/Delegate](03_messages.md#msgdelegate) + - [Msg/BeginUnbonding](03_messages.md#msgbeginunbonding) + - [Msg/BeginRedelegate](03_messages.md#msgbeginredelegate) 4. **[Begin-Block](04_begin_block.md)** - [Historical Info Tracking](04_begin_block.md#historical-info-tracking) -4. **[End-Block ](05_end_block.md)** +5. **[End-Block ](05_end_block.md)** - [Validator Set Changes](05_end_block.md#validator-set-changes) - [Queues ](05_end_block.md#queues-) -5. **[Hooks](06_hooks.md)** -6. **[Events](07_events.md)** +6. **[Hooks](06_hooks.md)** +7. **[Events](07_events.md)** - [EndBlocker](07_events.md#endblocker) - [Handlers](07_events.md#handlers) -7. **[Parameters](08_params.md)** +8. **[Parameters](08_params.md)** diff --git a/x/staking/types/staking.pb.go b/x/staking/types/staking.pb.go index b97e1224c..45b30b7a0 100644 --- a/x/staking/types/staking.pb.go +++ b/x/staking/types/staking.pb.go @@ -135,8 +135,11 @@ func (m *HistoricalInfo) GetValset() []Validator { // CommissionRates defines the initial commission rates to be used for creating // a validator. type CommissionRates struct { - Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate"` - MaxRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=max_rate,json=maxRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_rate" yaml:"max_rate"` + // rate is the commission rate charged to delegators, as a fraction. + Rate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=rate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rate"` + // max_rate defines the maximum commission rate which validator can ever charge, as a fraction. + MaxRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=max_rate,json=maxRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_rate" yaml:"max_rate"` + // max_change_rate defines the maximum daily increase of the validator commission, as a fraction. MaxChangeRate github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=max_change_rate,json=maxChangeRate,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"max_change_rate" yaml:"max_change_rate"` } @@ -174,8 +177,10 @@ var xxx_messageInfo_CommissionRates proto.InternalMessageInfo // Commission defines commission parameters for a given validator. type Commission struct { + // commission_rates defines the initial commission rates to be used for creating a validator. CommissionRates `protobuf:"bytes,1,opt,name=commission_rates,json=commissionRates,proto3,embedded=commission_rates" json:"commission_rates"` - UpdateTime time.Time `protobuf:"bytes,2,opt,name=update_time,json=updateTime,proto3,stdtime" json:"update_time" yaml:"update_time"` + // update_time is the last time the commission rate was changed. + UpdateTime time.Time `protobuf:"bytes,2,opt,name=update_time,json=updateTime,proto3,stdtime" json:"update_time" yaml:"update_time"` } func (m *Commission) Reset() { *m = Commission{} } @@ -219,11 +224,16 @@ func (m *Commission) GetUpdateTime() time.Time { // Description defines a validator description. type Description struct { - Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"` - Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` - Website string `protobuf:"bytes,3,opt,name=website,proto3" json:"website,omitempty"` + // moniker defines a human-readable name for the validator. + Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"` + // identity defines an optional identity signature (ex. UPort or Keybase). + Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` + // website defines an optional website link. + Website string `protobuf:"bytes,3,opt,name=website,proto3" json:"website,omitempty"` + // security_contact defines an optional email for security contact. SecurityContact string `protobuf:"bytes,4,opt,name=security_contact,json=securityContact,proto3" json:"security_contact,omitempty" yaml:"security_contact"` - Details string `protobuf:"bytes,5,opt,name=details,proto3" json:"details,omitempty"` + // details define other optional details. + Details string `protobuf:"bytes,5,opt,name=details,proto3" json:"details,omitempty"` } func (m *Description) Reset() { *m = Description{} } @@ -302,16 +312,27 @@ func (m *Description) GetDetails() string { // exchange rate. Voting power can be calculated as total bonded shares // multiplied by exchange rate. type Validator struct { - OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty" yaml:"operator_address"` - ConsensusPubkey *types1.Any `protobuf:"bytes,2,opt,name=consensus_pubkey,json=consensusPubkey,proto3" json:"consensus_pubkey,omitempty" yaml:"consensus_pubkey"` - Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` - Status BondStatus `protobuf:"varint,4,opt,name=status,proto3,enum=cosmos.staking.v1beta1.BondStatus" json:"status,omitempty"` - Tokens github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=tokens,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"tokens"` - DelegatorShares github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=delegator_shares,json=delegatorShares,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"delegator_shares" yaml:"delegator_shares"` - Description Description `protobuf:"bytes,7,opt,name=description,proto3" json:"description"` - UnbondingHeight int64 `protobuf:"varint,8,opt,name=unbonding_height,json=unbondingHeight,proto3" json:"unbonding_height,omitempty" yaml:"unbonding_height"` - UnbondingTime time.Time `protobuf:"bytes,9,opt,name=unbonding_time,json=unbondingTime,proto3,stdtime" json:"unbonding_time" yaml:"unbonding_time"` - Commission Commission `protobuf:"bytes,10,opt,name=commission,proto3" json:"commission"` + // operator_address defines the address of the validator's operator; bech encoded in JSON. + OperatorAddress string `protobuf:"bytes,1,opt,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty" yaml:"operator_address"` + // consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. + ConsensusPubkey *types1.Any `protobuf:"bytes,2,opt,name=consensus_pubkey,json=consensusPubkey,proto3" json:"consensus_pubkey,omitempty" yaml:"consensus_pubkey"` + // jailed defined whether the validator has been jailed from bonded status or not. + Jailed bool `protobuf:"varint,3,opt,name=jailed,proto3" json:"jailed,omitempty"` + // status is the validator status (bonded/unbonding/unbonded). + Status BondStatus `protobuf:"varint,4,opt,name=status,proto3,enum=cosmos.staking.v1beta1.BondStatus" json:"status,omitempty"` + // tokens define the delegated tokens (incl. self-delegation). + Tokens github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=tokens,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"tokens"` + // delegator_shares defines total shares issued to a validator's delegators. + DelegatorShares github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=delegator_shares,json=delegatorShares,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"delegator_shares" yaml:"delegator_shares"` + // description defines the description terms for the validator. + Description Description `protobuf:"bytes,7,opt,name=description,proto3" json:"description"` + // unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. + UnbondingHeight int64 `protobuf:"varint,8,opt,name=unbonding_height,json=unbondingHeight,proto3" json:"unbonding_height,omitempty" yaml:"unbonding_height"` + // unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. + UnbondingTime time.Time `protobuf:"bytes,9,opt,name=unbonding_time,json=unbondingTime,proto3,stdtime" json:"unbonding_time" yaml:"unbonding_time"` + // commission defines the commission parameters. + Commission Commission `protobuf:"bytes,10,opt,name=commission,proto3" json:"commission"` + // min_self_delegation is the validator's self declared minimum self delegation. MinSelfDelegation github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,11,opt,name=min_self_delegation,json=minSelfDelegation,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_self_delegation" yaml:"min_self_delegation"` } @@ -567,9 +588,12 @@ func (m *DVVTriplets) GetTriplets() []DVVTriplet { // owned by one delegator, and is associated with the voting power of one // validator. type Delegation struct { - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` - ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` - Shares github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=shares,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"shares"` + // delegator_address is the bech32-encoded address of the delegator. + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` + // validator_address is the bech32-encoded address of the validator. + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` + // shares define the delegation shares received. + Shares github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=shares,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"shares"` } func (m *Delegation) Reset() { *m = Delegation{} } @@ -607,9 +631,12 @@ var xxx_messageInfo_Delegation proto.InternalMessageInfo // UnbondingDelegation stores all of a single delegator's unbonding bonds // for a single validator in an time-ordered list. type UnbondingDelegation struct { - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` - ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` - Entries []UnbondingDelegationEntry `protobuf:"bytes,3,rep,name=entries,proto3" json:"entries"` + // delegator_address is the bech32-encoded address of the delegator. + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` + // validator_address is the bech32-encoded address of the validator. + ValidatorAddress string `protobuf:"bytes,2,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty" yaml:"validator_address"` + // entries are the unbonding delegation entries. + Entries []UnbondingDelegationEntry `protobuf:"bytes,3,rep,name=entries,proto3" json:"entries"` } func (m *UnbondingDelegation) Reset() { *m = UnbondingDelegation{} } @@ -646,10 +673,14 @@ var xxx_messageInfo_UnbondingDelegation proto.InternalMessageInfo // UnbondingDelegationEntry defines an unbonding object with relevant metadata. type UnbondingDelegationEntry struct { - CreationHeight int64 `protobuf:"varint,1,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height,omitempty" yaml:"creation_height"` - CompletionTime time.Time `protobuf:"bytes,2,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time" yaml:"completion_time"` + // creation_height is the height which the unbonding took place. + CreationHeight int64 `protobuf:"varint,1,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height,omitempty" yaml:"creation_height"` + // completion_time is the unix time for unbonding completion. + CompletionTime time.Time `protobuf:"bytes,2,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time" yaml:"completion_time"` + // initial_balance defines the tokens initially scheduled to receive at completion. InitialBalance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=initial_balance,json=initialBalance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"initial_balance" yaml:"initial_balance"` - Balance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=balance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"balance"` + // balance defines the tokens to receive at completion. + Balance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=balance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"balance"` } func (m *UnbondingDelegationEntry) Reset() { *m = UnbondingDelegationEntry{} } @@ -700,10 +731,14 @@ func (m *UnbondingDelegationEntry) GetCompletionTime() time.Time { // RedelegationEntry defines a redelegation object with relevant metadata. type RedelegationEntry struct { - CreationHeight int64 `protobuf:"varint,1,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height,omitempty" yaml:"creation_height"` - CompletionTime time.Time `protobuf:"bytes,2,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time" yaml:"completion_time"` + // creation_height defines the height which the redelegation took place. + CreationHeight int64 `protobuf:"varint,1,opt,name=creation_height,json=creationHeight,proto3" json:"creation_height,omitempty" yaml:"creation_height"` + // completion_time defines the unix time for redelegation completion. + CompletionTime time.Time `protobuf:"bytes,2,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time" yaml:"completion_time"` + // initial_balance defines the initial balance when redelegation started. InitialBalance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=initial_balance,json=initialBalance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"initial_balance" yaml:"initial_balance"` - SharesDst github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=shares_dst,json=sharesDst,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"shares_dst"` + // shares_dst is the amount of destination-validator shares created by redelegation. + SharesDst github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=shares_dst,json=sharesDst,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"shares_dst"` } func (m *RedelegationEntry) Reset() { *m = RedelegationEntry{} } @@ -755,10 +790,14 @@ func (m *RedelegationEntry) GetCompletionTime() time.Time { // Redelegation contains the list of a particular delegator's redelegating bonds // from a particular source validator to a particular destination validator. type Redelegation struct { - DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` - ValidatorSrcAddress string `protobuf:"bytes,2,opt,name=validator_src_address,json=validatorSrcAddress,proto3" json:"validator_src_address,omitempty" yaml:"validator_src_address"` - ValidatorDstAddress string `protobuf:"bytes,3,opt,name=validator_dst_address,json=validatorDstAddress,proto3" json:"validator_dst_address,omitempty" yaml:"validator_dst_address"` - Entries []RedelegationEntry `protobuf:"bytes,4,rep,name=entries,proto3" json:"entries"` + // delegator_address is the bech32-encoded address of the delegator. + DelegatorAddress string `protobuf:"bytes,1,opt,name=delegator_address,json=delegatorAddress,proto3" json:"delegator_address,omitempty" yaml:"delegator_address"` + // validator_src_address is the validator redelegation source operator address. + ValidatorSrcAddress string `protobuf:"bytes,2,opt,name=validator_src_address,json=validatorSrcAddress,proto3" json:"validator_src_address,omitempty" yaml:"validator_src_address"` + // validator_dst_address is the validator redelegation destination operator address. + ValidatorDstAddress string `protobuf:"bytes,3,opt,name=validator_dst_address,json=validatorDstAddress,proto3" json:"validator_dst_address,omitempty" yaml:"validator_dst_address"` + // entries are the redelegation entries. + Entries []RedelegationEntry `protobuf:"bytes,4,rep,name=entries,proto3" json:"entries"` } func (m *Redelegation) Reset() { *m = Redelegation{} } @@ -795,11 +834,16 @@ var xxx_messageInfo_Redelegation proto.InternalMessageInfo // Params defines the parameters for the staking module. type Params struct { - UnbondingTime time.Duration `protobuf:"bytes,1,opt,name=unbonding_time,json=unbondingTime,proto3,stdduration" json:"unbonding_time" yaml:"unbonding_time"` - MaxValidators uint32 `protobuf:"varint,2,opt,name=max_validators,json=maxValidators,proto3" json:"max_validators,omitempty" yaml:"max_validators"` - MaxEntries uint32 `protobuf:"varint,3,opt,name=max_entries,json=maxEntries,proto3" json:"max_entries,omitempty" yaml:"max_entries"` - HistoricalEntries uint32 `protobuf:"varint,4,opt,name=historical_entries,json=historicalEntries,proto3" json:"historical_entries,omitempty" yaml:"historical_entries"` - BondDenom string `protobuf:"bytes,5,opt,name=bond_denom,json=bondDenom,proto3" json:"bond_denom,omitempty" yaml:"bond_denom"` + // unbonding_time is the time duration of unbonding. + UnbondingTime time.Duration `protobuf:"bytes,1,opt,name=unbonding_time,json=unbondingTime,proto3,stdduration" json:"unbonding_time" yaml:"unbonding_time"` + // max_validators is the maximum number of validators. + MaxValidators uint32 `protobuf:"varint,2,opt,name=max_validators,json=maxValidators,proto3" json:"max_validators,omitempty" yaml:"max_validators"` + // max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). + MaxEntries uint32 `protobuf:"varint,3,opt,name=max_entries,json=maxEntries,proto3" json:"max_entries,omitempty" yaml:"max_entries"` + // historical_entries is the number of historical entries to persist. + HistoricalEntries uint32 `protobuf:"varint,4,opt,name=historical_entries,json=historicalEntries,proto3" json:"historical_entries,omitempty" yaml:"historical_entries"` + // bond_denom defines the bondable coin denomination. + BondDenom string `protobuf:"bytes,5,opt,name=bond_denom,json=bondDenom,proto3" json:"bond_denom,omitempty" yaml:"bond_denom"` } func (m *Params) Reset() { *m = Params{} } From 17d7e9a8d51e11340aab1705a3d47b6f98abff6f Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Mon, 1 Feb 2021 14:01:53 +0100 Subject: [PATCH 14/19] Add packet_connection attribute to packet lifecycle methods (#8458) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add packet_connection attribute to packet lifecycle methods Added to: * SendPacket * ReceivePacket * WriteAcknowledgement * AcknowledgePacket * Add CHANGELOG * Update CHANGELOG.md Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com> --- CHANGELOG.md | 1 + x/ibc/core/04-channel/keeper/packet.go | 12 ++++++++++++ x/ibc/core/04-channel/types/events.go | 1 + 3 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bcb99bd8..12f0ff2d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* (x/ibc) [\#8458](https://github.com/cosmos/cosmos-sdk/pull/8458) Add `packet_connection` attribute to ibc events to enable relayer filtering * (x/bank) [\#8479](https://github.com/cosmos/cosmos-sdk/pull/8479) Adittional client denom metadata validation for `base` and `display` denoms. * (x/ibc) [\#8404](https://github.com/cosmos/cosmos-sdk/pull/8404) Reorder IBC `ChanOpenAck` and `ChanOpenConfirm` handler execution to perform core handler first, followed by application callbacks. * [\#8396](https://github.com/cosmos/cosmos-sdk/pull/8396) Add support for ARM platform diff --git a/x/ibc/core/04-channel/keeper/packet.go b/x/ibc/core/04-channel/keeper/packet.go index 9af59745d..49b59733c 100644 --- a/x/ibc/core/04-channel/keeper/packet.go +++ b/x/ibc/core/04-channel/keeper/packet.go @@ -129,6 +129,9 @@ func (k Keeper) SendPacket( sdk.NewAttribute(types.AttributeKeyDstPort, packet.GetDestPort()), sdk.NewAttribute(types.AttributeKeyDstChannel, packet.GetDestChannel()), sdk.NewAttribute(types.AttributeKeyChannelOrdering, channel.Ordering.String()), + // we only support 1-hop packets now, and that is the most important hop for a relayer + // (is it going to a chain I am connected to) + sdk.NewAttribute(types.AttributeKeyConnection, channel.ConnectionHops[0]), ), sdk.NewEvent( sdk.EventTypeMessage, @@ -289,6 +292,9 @@ func (k Keeper) RecvPacket( sdk.NewAttribute(types.AttributeKeyDstPort, packet.GetDestPort()), sdk.NewAttribute(types.AttributeKeyDstChannel, packet.GetDestChannel()), sdk.NewAttribute(types.AttributeKeyChannelOrdering, channel.Ordering.String()), + // we only support 1-hop packets now, and that is the most important hop for a relayer + // (is it going to a chain I am connected to) + sdk.NewAttribute(types.AttributeKeyConnection, channel.ConnectionHops[0]), ), sdk.NewEvent( sdk.EventTypeMessage, @@ -370,6 +376,9 @@ func (k Keeper) WriteAcknowledgement( sdk.NewAttribute(types.AttributeKeyDstPort, packet.GetDestPort()), sdk.NewAttribute(types.AttributeKeyDstChannel, packet.GetDestChannel()), sdk.NewAttribute(types.AttributeKeyAck, string(acknowledgement)), + // we only support 1-hop packets now, and that is the most important hop for a relayer + // (is it going to a chain I am connected to) + sdk.NewAttribute(types.AttributeKeyConnection, channel.ConnectionHops[0]), ), sdk.NewEvent( sdk.EventTypeMessage, @@ -505,6 +514,9 @@ func (k Keeper) AcknowledgePacket( sdk.NewAttribute(types.AttributeKeyDstPort, packet.GetDestPort()), sdk.NewAttribute(types.AttributeKeyDstChannel, packet.GetDestChannel()), sdk.NewAttribute(types.AttributeKeyChannelOrdering, channel.Ordering.String()), + // we only support 1-hop packets now, and that is the most important hop for a relayer + // (is it going to a chain I am connected to) + sdk.NewAttribute(types.AttributeKeyConnection, channel.ConnectionHops[0]), ), sdk.NewEvent( sdk.EventTypeMessage, diff --git a/x/ibc/core/04-channel/types/events.go b/x/ibc/core/04-channel/types/events.go index 923587d43..b9ddb3052 100644 --- a/x/ibc/core/04-channel/types/events.go +++ b/x/ibc/core/04-channel/types/events.go @@ -30,6 +30,7 @@ const ( AttributeKeyDstPort = "packet_dst_port" AttributeKeyDstChannel = "packet_dst_channel" AttributeKeyChannelOrdering = "packet_channel_ordering" + AttributeKeyConnection = "packet_connection" ) // IBC channel events vars From c1b567f44c093ae68c551dc88b0e4886a187c213 Mon Sep 17 00:00:00 2001 From: Amaury Date: Mon, 1 Feb 2021 14:17:44 +0100 Subject: [PATCH 15/19] Refactor store keys for variable-length addresses (#8363) * Change account store key in x/bank * Fix pagination test * Fix merge master * Fix staking keys.go * Use bech32 in val state change map * Fix sortNoLongerBonded * Use length-prefix function * Use length prefix function * Fix test accountStore * Fix ExamplePaginate * Fix staking keys * Use shorter balances prefix * Do slashing keys * Fix gov keys * Fix x/gov tests * Fix x/distrib * Address reviews * add change log entry * Add changelog * Fix failing tests * Fix sim tests * fix after-export sim * Fix lint * Address review * Fix x/authz * Fix global config in test * Update x/staking/keeper/val_state_change.go Co-authored-by: Robert Zaremba * Address comments * Fix comments * Address review * Fix authz test * Update comment * Rename to LengthPrefixedAddressStoreKey * Use variable * Rename function * Fix test build * chore: update rosetta CI (#8453) * Rename again * Rename yet again * Update feegrant keys * Add function to create prefix Co-authored-by: Robert Zaremba Co-authored-by: Frojdi Dymylja <33157909+fdymylja@users.noreply.github.com> Co-authored-by: Aaron Craelius Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- CHANGELOG.md | 5 + contrib/rosetta/configuration/bootstrap.json | 4 +- contrib/rosetta/configuration/data.sh | 5 +- contrib/rosetta/configuration/staking.ros | 4 +- contrib/rosetta/node/data.tar.gz | Bin 34626 -> 36558 bytes simapp/export.go | 2 +- types/address.go | 14 +- types/address/store_key.go | 33 ++++ types/address/store_key_test.go | 38 +++++ types/address_test.go | 40 +++-- types/query/filtered_pagination_test.go | 5 +- types/query/pagination_test.go | 3 +- x/authz/types/keys.go | 19 ++- x/bank/keeper/grpc_query.go | 4 +- x/bank/keeper/send.go | 9 +- x/bank/keeper/view.go | 15 +- x/bank/types/key.go | 18 ++- x/bank/types/key_test.go | 5 +- x/bank/types/msgs_test.go | 21 ++- x/distribution/types/keys.go | 143 +++++++++-------- x/feegrant/types/key.go | 5 +- x/gov/types/keys.go | 17 +- x/gov/types/keys_test.go | 10 -- x/slashing/types/keys.go | 23 +-- x/staking/keeper/val_state_change.go | 63 +++++--- x/staking/keeper/validator.go | 2 +- x/staking/types/keys.go | 155 ++++++++++--------- x/staking/types/keys_test.go | 20 +-- 28 files changed, 411 insertions(+), 271 deletions(-) create mode 100644 types/address/store_key.go create mode 100644 types/address/store_key_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 12f0ff2d3..1a5fa8365 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,8 +36,13 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### Client Breaking Changes + +* [\#8363](https://github.com/cosmos/cosmos-sdk/issues/8363) Addresses no longer have a fixed 20-byte length. From the SDK modules' point of view, any 1-255 bytes-long byte array is a valid address. + ### State Machine Breaking +* (x/{bank,distrib,gov,slashing,staking}) [\#8363](https://github.com/cosmos/cosmos-sdk/issues/8363) Store keys have been modified to allow for variable-length addresses. * (x/ibc) [\#8266](https://github.com/cosmos/cosmos-sdk/issues/8266) Add amino JSON for IBC messages in order to support Ledger text signing. ### Improvements diff --git a/contrib/rosetta/configuration/bootstrap.json b/contrib/rosetta/configuration/bootstrap.json index 15b75b550..1793988f3 100644 --- a/contrib/rosetta/configuration/bootstrap.json +++ b/contrib/rosetta/configuration/bootstrap.json @@ -1,12 +1,12 @@ [ { "account_identifier": { - "address":"cosmos1hdmjfmqmf8ck4pv4evu0s3up0ucm0yjjqfl87e" + "address":"cosmos158nkd0l9tyemv2crp579rmj8dg37qty8lzff88" }, "currency":{ "symbol":"stake", "decimals":0 }, - "value": "999900000000" + "value": "999990000000" } ] \ No newline at end of file diff --git a/contrib/rosetta/configuration/data.sh b/contrib/rosetta/configuration/data.sh index dc4f2cb59..45297d5a2 100644 --- a/contrib/rosetta/configuration/data.sh +++ b/contrib/rosetta/configuration/data.sh @@ -16,12 +16,13 @@ simd init simd --chain-id testing simd keys add fd --keyring-backend=test addr=$(simd keys show fd -a --keyring-backend=test) +val_addr=$(simd keys show fd --keyring-backend=test --bech val -a) # give the accounts some money simd add-genesis-account "$addr" 1000000000000stake --keyring-backend=test # save configs for the daemon -simd gentx fd --chain-id testing --keyring-backend=test +simd gentx fd 10000000stake --chain-id testing --keyring-backend=test # input genTx to the genesis file simd collect-gentxs @@ -55,4 +56,4 @@ echo zipping data dir and saving to /tmp/data.tar.gz tar -czvf /tmp/data.tar.gz /root/.simapp -echo new address for bootstrap.json "$addr" +echo new address for bootstrap.json "$addr" "$val_addr" diff --git a/contrib/rosetta/configuration/staking.ros b/contrib/rosetta/configuration/staking.ros index 1d9de1d18..4f89a43b9 100644 --- a/contrib/rosetta/configuration/staking.ros +++ b/contrib/rosetta/configuration/staking.ros @@ -94,7 +94,7 @@ staking(1){ "account": { "address": "staking_account", "sub_account": { - "address" : "cosmosvaloper1hdmjfmqmf8ck4pv4evu0s3up0ucm0yjj9atjj2" + "address" : "cosmosvaloper158nkd0l9tyemv2crp579rmj8dg37qty86kaut5" } }, "amount":{ @@ -134,7 +134,7 @@ staking(1){ "account": { "address": "staking_account", "sub_account": { - "address" : "cosmosvaloper1hdmjfmqmf8ck4pv4evu0s3up0ucm0yjj9atjj2" + "address" : "cosmosvaloper158nkd0l9tyemv2crp579rmj8dg37qty86kaut5" } }, "amount":{ diff --git a/contrib/rosetta/node/data.tar.gz b/contrib/rosetta/node/data.tar.gz index a7bed60579ea098baa390af3a29e05b08d16dcc8..ad285ac62e75198c4945859e12ccf7b563c7c29b 100644 GIT binary patch literal 36558 zcmV)BK*PTuiwFP!000001MFN2coS8=@1%u>ft4Crw_9Y5kyV5?op+M1d=i7UZd*E1=-xipuAeRd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export.go index 887308d30..8d09e333a 100644 --- a/simapp/export.go +++ b/simapp/export.go @@ -157,7 +157,7 @@ func (app *SimApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [] counter := int16(0) for ; iter.Valid(); iter.Next() { - addr := sdk.ValAddress(iter.Key()[1:]) + addr := sdk.ValAddress(stakingtypes.AddressFromValidatorsKey(iter.Key())) validator, found := app.StakingKeeper.GetValidator(ctx, addr) if !found { panic("expected validator, not found") diff --git a/types/address.go b/types/address.go index ba9e5b303..eabff6fa9 100644 --- a/types/address.go +++ b/types/address.go @@ -12,7 +12,9 @@ import ( "github.com/cosmos/cosmos-sdk/codec/legacy" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/types/address" "github.com/cosmos/cosmos-sdk/types/bech32" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) const ( @@ -28,8 +30,6 @@ const ( // config.SetFullFundraiserPath(yourFullFundraiserPath) // config.Seal() - // AddrLen defines a valid address length - AddrLen = 20 // Bech32MainPrefix defines the main SDK Bech32 prefix of an account's address Bech32MainPrefix = "cosmos" @@ -110,9 +110,15 @@ func VerifyAddressFormat(bz []byte) error { if verifier != nil { return verifier(bz) } - if len(bz) != AddrLen { - return fmt.Errorf("incorrect address length (expected: %d, actual: %d)", AddrLen, len(bz)) + + if len(bz) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrUnknownAddress, "addresses cannot be empty") } + + if len(bz) > address.MaxAddrLen { + return sdkerrors.Wrapf(sdkerrors.ErrUnknownAddress, "address max length is %d, got %d", address.MaxAddrLen, len(bz)) + } + return nil } diff --git a/types/address/store_key.go b/types/address/store_key.go new file mode 100644 index 000000000..948491972 --- /dev/null +++ b/types/address/store_key.go @@ -0,0 +1,33 @@ +package address + +import ( + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// MaxAddrLen is the maximum allowed length (in bytes) for an address. +const MaxAddrLen = 255 + +// LengthPrefix prefixes the address bytes with its length, this is used +// for example for variable-length components in store keys. +func LengthPrefix(bz []byte) ([]byte, error) { + bzLen := len(bz) + if bzLen == 0 { + return bz, nil + } + + if bzLen > MaxAddrLen { + return nil, sdkerrors.Wrapf(sdkerrors.ErrUnknownAddress, "address length should be max %d bytes, got %d", MaxAddrLen, bzLen) + } + + return append([]byte{byte(bzLen)}, bz...), nil +} + +// MustLengthPrefix is LengthPrefix with panic on error. +func MustLengthPrefix(bz []byte) []byte { + res, err := LengthPrefix(bz) + if err != nil { + panic(err) + } + + return res +} diff --git a/types/address/store_key_test.go b/types/address/store_key_test.go new file mode 100644 index 000000000..3bb00bd02 --- /dev/null +++ b/types/address/store_key_test.go @@ -0,0 +1,38 @@ +package address_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "github.com/cosmos/cosmos-sdk/types/address" +) + +func TestLengthPrefixedAddressStoreKey(t *testing.T) { + addr10byte := []byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9} + addr20byte := []byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19} + addr256byte := make([]byte, 256) + + tests := []struct { + name string + addr []byte + expStoreKey []byte + expErr bool + }{ + {"10-byte address", addr10byte, append([]byte{byte(10)}, addr10byte...), false}, + {"20-byte address", addr20byte, append([]byte{byte(20)}, addr20byte...), false}, + {"256-byte address (too long)", addr256byte, nil, true}, + } + for _, tt := range tests { + tt := tt + t.Run(tt.name, func(t *testing.T) { + storeKey, err := address.LengthPrefix(tt.addr) + if tt.expErr { + require.Error(t, err) + } else { + require.NoError(t, err) + require.Equal(t, tt.expStoreKey, storeKey) + } + }) + } +} diff --git a/types/address_test.go b/types/address_test.go index 5796c891a..b9bc0c3c5 100644 --- a/types/address_test.go +++ b/types/address_test.go @@ -347,15 +347,18 @@ func (s *addressTestSuite) TestVerifyAddressFormat() { addr5 := make([]byte, 5) addr20 := make([]byte, 20) addr32 := make([]byte, 32) + addr256 := make([]byte, 256) err := types.VerifyAddressFormat(addr0) - s.Require().EqualError(err, "incorrect address length 0") + s.Require().EqualError(err, "addresses cannot be empty: unknown address") err = types.VerifyAddressFormat(addr5) - s.Require().EqualError(err, "incorrect address length 5") + s.Require().NoError(err) err = types.VerifyAddressFormat(addr20) - s.Require().Nil(err) + s.Require().NoError(err) err = types.VerifyAddressFormat(addr32) - s.Require().EqualError(err, "incorrect address length 32") + s.Require().NoError(err) + err = types.VerifyAddressFormat(addr256) + s.Require().EqualError(err, "address max length is 255, got 256: unknown address") } func (s *addressTestSuite) TestCustomAddressVerifier() { @@ -364,34 +367,39 @@ func (s *addressTestSuite) TestCustomAddressVerifier() { accBech := types.AccAddress(addr).String() valBech := types.ValAddress(addr).String() consBech := types.ConsAddress(addr).String() - // Verifiy that the default logic rejects this 10 byte address + // Verify that the default logic doesn't reject this 10 byte address + // The default verifier is nil, we're only checking address length is + // between 1-255 bytes. err := types.VerifyAddressFormat(addr) - s.Require().NotNil(err) + s.Require().Nil(err) _, err = types.AccAddressFromBech32(accBech) - s.Require().NotNil(err) + s.Require().Nil(err) _, err = types.ValAddressFromBech32(valBech) - s.Require().NotNil(err) + s.Require().Nil(err) _, err = types.ConsAddressFromBech32(consBech) - s.Require().NotNil(err) + s.Require().Nil(err) - // Set a custom address verifier that accepts 10 or 20 byte addresses + // Set a custom address verifier only accepts 20 byte addresses types.GetConfig().SetAddressVerifier(func(bz []byte) error { n := len(bz) - if n == 10 || n == types.AddrLen { + if n == 20 { return nil } return fmt.Errorf("incorrect address length %d", n) }) - // Verifiy that the custom logic accepts this 10 byte address + // Verifiy that the custom logic rejects this 10 byte address err = types.VerifyAddressFormat(addr) - s.Require().Nil(err) + s.Require().NotNil(err) _, err = types.AccAddressFromBech32(accBech) - s.Require().Nil(err) + s.Require().NotNil(err) _, err = types.ValAddressFromBech32(valBech) - s.Require().Nil(err) + s.Require().NotNil(err) _, err = types.ConsAddressFromBech32(consBech) - s.Require().Nil(err) + s.Require().NotNil(err) + + // Reinitialize the global config to default address verifier (nil) + types.GetConfig().SetAddressVerifier(nil) } func (s *addressTestSuite) TestBech32ifyAddressBytes() { diff --git a/types/query/filtered_pagination_test.go b/types/query/filtered_pagination_test.go index dbd2057da..2622f7b8e 100644 --- a/types/query/filtered_pagination_test.go +++ b/types/query/filtered_pagination_test.go @@ -6,6 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" "github.com/cosmos/cosmos-sdk/types/query" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -111,7 +112,7 @@ func ExampleFilteredPaginate() { pageReq := &query.PageRequest{Key: nil, Limit: 1, CountTotal: true} store := ctx.KVStore(app.GetKey(authtypes.StoreKey)) balancesStore := prefix.NewStore(store, types.BalancesPrefix) - accountStore := prefix.NewStore(balancesStore, addr1.Bytes()) + accountStore := prefix.NewStore(balancesStore, address.MustLengthPrefix(addr1)) var balResult sdk.Coins pageRes, err := query.FilteredPaginate(accountStore, pageReq, func(key []byte, value []byte, accumulate bool) (bool, error) { @@ -143,7 +144,7 @@ func ExampleFilteredPaginate() { func execFilterPaginate(store sdk.KVStore, pageReq *query.PageRequest, appCodec codec.Marshaler) (balances sdk.Coins, res *query.PageResponse, err error) { balancesStore := prefix.NewStore(store, types.BalancesPrefix) - accountStore := prefix.NewStore(balancesStore, addr1.Bytes()) + accountStore := prefix.NewStore(balancesStore, address.MustLengthPrefix(addr1)) var balResult sdk.Coins res, err = query.FilteredPaginate(accountStore, pageReq, func(key []byte, value []byte, accumulate bool) (bool, error) { diff --git a/types/query/pagination_test.go b/types/query/pagination_test.go index f0e1377a1..18853e97c 100644 --- a/types/query/pagination_test.go +++ b/types/query/pagination_test.go @@ -17,6 +17,7 @@ import ( "github.com/cosmos/cosmos-sdk/store" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" "github.com/cosmos/cosmos-sdk/types/query" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -193,7 +194,7 @@ func ExamplePaginate() { balResult := sdk.NewCoins() authStore := ctx.KVStore(app.GetKey(authtypes.StoreKey)) balancesStore := prefix.NewStore(authStore, types.BalancesPrefix) - accountStore := prefix.NewStore(balancesStore, addr1.Bytes()) + accountStore := prefix.NewStore(balancesStore, address.MustLengthPrefix(addr1)) pageRes, err := query.Paginate(accountStore, request.Pagination, func(key []byte, value []byte) error { var tempRes sdk.Coin err := app.AppCodec().UnmarshalBinaryBare(value, &tempRes) diff --git a/x/authz/types/keys.go b/x/authz/types/keys.go index 3be659c5a..7ee571b27 100644 --- a/x/authz/types/keys.go +++ b/x/authz/types/keys.go @@ -2,6 +2,7 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" ) const ( @@ -21,7 +22,7 @@ const ( // Keys for authz store // Items are stored with the following key: values // -// - 0x01: Grant +// - 0x01: Grant var ( // Keys for store prefixes @@ -30,12 +31,22 @@ var ( // GetAuthorizationStoreKey - return authorization store key func GetAuthorizationStoreKey(grantee sdk.AccAddress, granter sdk.AccAddress, msgType string) []byte { - return append(append(append(GrantKey, granter.Bytes()...), grantee.Bytes()...), []byte(msgType)...) + return append(append(append( + GrantKey, + address.MustLengthPrefix(granter)...), + address.MustLengthPrefix(grantee)...), + []byte(msgType)..., + ) } // ExtractAddressesFromGrantKey - split granter & grantee address from the authorization key func ExtractAddressesFromGrantKey(key []byte) (granterAddr, granteeAddr sdk.AccAddress) { - granterAddr = sdk.AccAddress(key[1 : sdk.AddrLen+1]) - granteeAddr = sdk.AccAddress(key[sdk.AddrLen+1 : sdk.AddrLen*2+1]) + // key if of format: + // 0x01 + granterAddrLen := key[1] // remove prefix key + granterAddr = sdk.AccAddress(key[2 : 2+granterAddrLen]) + granteeAddrLen := int(key[2+granterAddrLen]) + granteeAddr = sdk.AccAddress(key[3+granterAddrLen : 3+granterAddrLen+byte(granteeAddrLen)]) + return granterAddr, granteeAddr } diff --git a/x/bank/keeper/grpc_query.go b/x/bank/keeper/grpc_query.go index ae00d1b87..b8f69ef12 100644 --- a/x/bank/keeper/grpc_query.go +++ b/x/bank/keeper/grpc_query.go @@ -57,9 +57,7 @@ func (k BaseKeeper) AllBalances(ctx context.Context, req *types.QueryAllBalances sdkCtx := sdk.UnwrapSDKContext(ctx) balances := sdk.NewCoins() - store := sdkCtx.KVStore(k.storeKey) - balancesStore := prefix.NewStore(store, types.BalancesPrefix) - accountStore := prefix.NewStore(balancesStore, addr.Bytes()) + accountStore := k.getAccountStore(sdkCtx, addr) pageRes, err := query.Paginate(accountStore, req.Pagination, func(_, value []byte) error { var result sdk.Coin diff --git a/x/bank/keeper/send.go b/x/bank/keeper/send.go index c1000b7d3..694c43211 100644 --- a/x/bank/keeper/send.go +++ b/x/bank/keeper/send.go @@ -2,7 +2,6 @@ package keeper import ( "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/store/prefix" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -233,9 +232,7 @@ func (k BaseSendKeeper) ClearBalances(ctx sdk.Context, addr sdk.AccAddress) { return false }) - store := ctx.KVStore(k.storeKey) - balancesStore := prefix.NewStore(store, types.BalancesPrefix) - accountStore := prefix.NewStore(balancesStore, addr.Bytes()) + accountStore := k.getAccountStore(ctx, addr) for _, key := range keys { accountStore.Delete(key) @@ -264,9 +261,7 @@ func (k BaseSendKeeper) SetBalance(ctx sdk.Context, addr sdk.AccAddress, balance return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, balance.String()) } - store := ctx.KVStore(k.storeKey) - balancesStore := prefix.NewStore(store, types.BalancesPrefix) - accountStore := prefix.NewStore(balancesStore, addr.Bytes()) + accountStore := k.getAccountStore(ctx, addr) bz := k.cdc.MustMarshalBinaryBare(&balance) accountStore.Set([]byte(balance.Denom), bz) diff --git a/x/bank/keeper/view.go b/x/bank/keeper/view.go index d4bcabad2..1b50fb81d 100644 --- a/x/bank/keeper/view.go +++ b/x/bank/keeper/view.go @@ -97,9 +97,7 @@ func (k BaseViewKeeper) GetAccountsBalances(ctx sdk.Context) []types.Balance { // GetBalance returns the balance of a specific denomination for a given account // by address. func (k BaseViewKeeper) GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin { - store := ctx.KVStore(k.storeKey) - balancesStore := prefix.NewStore(store, types.BalancesPrefix) - accountStore := prefix.NewStore(balancesStore, addr.Bytes()) + accountStore := k.getAccountStore(ctx, addr) bz := accountStore.Get([]byte(denom)) if bz == nil { @@ -116,9 +114,7 @@ func (k BaseViewKeeper) GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom s // provides the token balance to a callback. If true is returned from the // callback, iteration is halted. func (k BaseViewKeeper) IterateAccountBalances(ctx sdk.Context, addr sdk.AccAddress, cb func(sdk.Coin) bool) { - store := ctx.KVStore(k.storeKey) - balancesStore := prefix.NewStore(store, types.BalancesPrefix) - accountStore := prefix.NewStore(balancesStore, addr.Bytes()) + accountStore := k.getAccountStore(ctx, addr) iterator := accountStore.Iterator(nil, nil) defer iterator.Close() @@ -214,3 +210,10 @@ func (k BaseViewKeeper) ValidateBalance(ctx sdk.Context, addr sdk.AccAddress) er return nil } + +// getAccountStore gets the account store of the given address. +func (k BaseViewKeeper) getAccountStore(ctx sdk.Context, addr sdk.AccAddress) prefix.Store { + store := ctx.KVStore(k.storeKey) + + return prefix.NewStore(store, types.CreateAccountBalancesPrefix(addr)) +} diff --git a/x/bank/types/key.go b/x/bank/types/key.go index ec8619d00..858fd2480 100644 --- a/x/bank/types/key.go +++ b/x/bank/types/key.go @@ -1,9 +1,8 @@ package types import ( - "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" ) const ( @@ -22,7 +21,9 @@ const ( // KVStore keys var ( - BalancesPrefix = []byte("balances") + // BalancesPrefix is the for the account balances store. We use a byte + // (instead of say `[]]byte("balances")` to save some disk space). + BalancesPrefix = []byte{0x02} SupplyKey = []byte{0x00} DenomMetadataPrefix = []byte{0x1} ) @@ -37,10 +38,13 @@ func DenomMetadataKey(denom string) []byte { // store. The key must not contain the perfix BalancesPrefix as the prefix store // iterator discards the actual prefix. func AddressFromBalancesStore(key []byte) sdk.AccAddress { - addr := key[:sdk.AddrLen] - if len(addr) != sdk.AddrLen { - panic(fmt.Sprintf("unexpected account address key length; got: %d, expected: %d", len(addr), sdk.AddrLen)) - } + addrLen := key[0] + addr := key[1 : addrLen+1] return sdk.AccAddress(addr) } + +// CreateAccountBalancesPrefix creates the prefix for an account's balances. +func CreateAccountBalancesPrefix(addr []byte) []byte { + return append(BalancesPrefix, address.MustLengthPrefix(addr)...) +} diff --git a/x/bank/types/key_test.go b/x/bank/types/key_test.go index f3b5717fb..206ef8335 100644 --- a/x/bank/types/key_test.go +++ b/x/bank/types/key_test.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" "github.com/cosmos/cosmos-sdk/x/bank/types" ) @@ -19,8 +20,10 @@ func cloneAppend(bz []byte, tail []byte) (res []byte) { func TestAddressFromBalancesStore(t *testing.T) { addr, err := sdk.AccAddressFromBech32("cosmos1n88uc38xhjgxzw9nwre4ep2c8ga4fjxcar6mn7") require.NoError(t, err) + addrLen := len(addr) + require.Equal(t, 20, addrLen) - key := cloneAppend(addr.Bytes(), []byte("stake")) + key := cloneAppend(address.MustLengthPrefix(addr), []byte("stake")) res := types.AddressFromBalancesStore(key) require.Equal(t, res, addr) } diff --git a/x/bank/types/msgs_test.go b/x/bank/types/msgs_test.go index 96132150a..334d72c13 100644 --- a/x/bank/types/msgs_test.go +++ b/x/bank/types/msgs_test.go @@ -23,7 +23,7 @@ func TestMsgSendValidation(t *testing.T) { addr1 := sdk.AccAddress([]byte("from________________")) addr2 := sdk.AccAddress([]byte("to__________________")) addrEmpty := sdk.AccAddress([]byte("")) - addrTooLong := sdk.AccAddress([]byte("Accidentally used 33 bytes pubkey")) + addrLong := sdk.AccAddress([]byte("Purposefully long address")) atom123 := sdk.NewCoins(sdk.NewInt64Coin("atom", 123)) atom0 := sdk.NewCoins(sdk.NewInt64Coin("atom", 0)) @@ -36,12 +36,12 @@ func TestMsgSendValidation(t *testing.T) { }{ {"", NewMsgSend(addr1, addr2, atom123)}, // valid send {"", NewMsgSend(addr1, addr2, atom123eth123)}, // valid send with multiple coins + {"", NewMsgSend(addrLong, addr2, atom123)}, // valid send with long addr sender + {"", NewMsgSend(addr1, addrLong, atom123)}, // valid send with long addr recipient {": invalid coins", NewMsgSend(addr1, addr2, atom0)}, // non positive coin {"123atom,0eth: invalid coins", NewMsgSend(addr1, addr2, atom123eth0)}, // non positive coin in multicoins {"Invalid sender address (empty address string is not allowed): invalid address", NewMsgSend(addrEmpty, addr2, atom123)}, - {"Invalid sender address (incorrect address length (expected: 20, actual: 33)): invalid address", NewMsgSend(addrTooLong, addr2, atom123)}, {"Invalid recipient address (empty address string is not allowed): invalid address", NewMsgSend(addr1, addrEmpty, atom123)}, - {"Invalid recipient address (incorrect address length (expected: 20, actual: 33)): invalid address", NewMsgSend(addr1, addrTooLong, atom123)}, } for _, tc := range cases { @@ -91,7 +91,7 @@ func TestInputValidation(t *testing.T) { addr1 := sdk.AccAddress([]byte("_______alice________")) addr2 := sdk.AccAddress([]byte("________bob_________")) addrEmpty := sdk.AccAddress([]byte("")) - addrTooLong := sdk.AccAddress([]byte("Accidentally used 33 bytes pubkey")) + addrLong := sdk.AccAddress([]byte("Purposefully long address")) someCoins := sdk.NewCoins(sdk.NewInt64Coin("atom", 123)) multiCoins := sdk.NewCoins(sdk.NewInt64Coin("atom", 123), sdk.NewInt64Coin("eth", 20)) @@ -109,9 +109,9 @@ func TestInputValidation(t *testing.T) { {"", NewInput(addr1, someCoins)}, {"", NewInput(addr2, someCoins)}, {"", NewInput(addr2, multiCoins)}, + {"", NewInput(addrLong, someCoins)}, {"empty address string is not allowed", NewInput(addrEmpty, someCoins)}, - {"incorrect address length (expected: 20, actual: 33)", NewInput(addrTooLong, someCoins)}, {": invalid coins", NewInput(addr1, emptyCoins)}, // invalid coins {": invalid coins", NewInput(addr1, emptyCoins2)}, // invalid coins {"10eth,0atom: invalid coins", NewInput(addr1, someEmptyCoins)}, // invalid coins @@ -132,7 +132,7 @@ func TestOutputValidation(t *testing.T) { addr1 := sdk.AccAddress([]byte("_______alice________")) addr2 := sdk.AccAddress([]byte("________bob_________")) addrEmpty := sdk.AccAddress([]byte("")) - addrTooLong := sdk.AccAddress([]byte("Accidentally used 33 bytes pubkey")) + addrLong := sdk.AccAddress([]byte("Purposefully long address")) someCoins := sdk.NewCoins(sdk.NewInt64Coin("atom", 123)) multiCoins := sdk.NewCoins(sdk.NewInt64Coin("atom", 123), sdk.NewInt64Coin("eth", 20)) @@ -150,9 +150,9 @@ func TestOutputValidation(t *testing.T) { {"", NewOutput(addr1, someCoins)}, {"", NewOutput(addr2, someCoins)}, {"", NewOutput(addr2, multiCoins)}, + {"", NewOutput(addrLong, someCoins)}, {"Invalid output address (empty address string is not allowed): invalid address", NewOutput(addrEmpty, someCoins)}, - {"Invalid output address (incorrect address length (expected: 20, actual: 33)): invalid address", NewOutput(addrTooLong, someCoins)}, {": invalid coins", NewOutput(addr1, emptyCoins)}, // invalid coins {": invalid coins", NewOutput(addr1, emptyCoins2)}, // invalid coins {"10eth,0atom: invalid coins", NewOutput(addr1, someEmptyCoins)}, // invalid coins @@ -251,8 +251,6 @@ func TestMsgMultiSendGetSigners(t *testing.T) { require.Equal(t, "[696E707574313131313131313131313131313131 696E707574323232323232323232323232323232 696E707574333333333333333333333333333333]", fmt.Sprintf("%v", res)) } -/* -// what to do w/ this test? func TestMsgSendSigners(t *testing.T) { signers := []sdk.AccAddress{ {1, 2, 3}, @@ -265,8 +263,7 @@ func TestMsgSendSigners(t *testing.T) { for i, signer := range signers { inputs[i] = NewInput(signer, someCoins) } - tx := NewMsgSend(inputs, nil) + tx := NewMsgMultiSend(inputs, nil) - require.Equal(t, signers, tx.Signers()) + require.Equal(t, signers, tx.GetSigners()) } -*/ diff --git a/x/distribution/types/keys.go b/x/distribution/types/keys.go index 12fe9b17b..4f0f37f82 100644 --- a/x/distribution/types/keys.go +++ b/x/distribution/types/keys.go @@ -4,6 +4,7 @@ import ( "encoding/binary" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" ) const ( @@ -27,19 +28,19 @@ const ( // // - 0x01: sdk.ConsAddress // -// - 0x02: ValidatorOutstandingRewards +// - 0x02: ValidatorOutstandingRewards // -// - 0x03: sdk.AccAddress +// - 0x03: sdk.AccAddress // -// - 0x04: DelegatorStartingInfo +// - 0x04: DelegatorStartingInfo // -// - 0x05: ValidatorHistoricalRewards +// - 0x05: ValidatorHistoricalRewards // -// - 0x06: ValidatorCurrentRewards +// - 0x06: ValidatorCurrentRewards // -// - 0x07: ValidatorCurrentRewards +// - 0x07: ValidatorCurrentRewards // -// - 0x08: ValidatorSlashEvent +// - 0x08: ValidatorSlashEvent var ( FeePoolKey = []byte{0x00} // key for global distribution state ProposerKey = []byte{0x01} // key for the proposer operator address @@ -53,47 +54,56 @@ var ( ValidatorSlashEventPrefix = []byte{0x08} // key for validator slash fraction ) -// gets an address from a validator's outstanding rewards key +// GetValidatorOutstandingRewardsAddress creates an address from a validator's outstanding rewards key. func GetValidatorOutstandingRewardsAddress(key []byte) (valAddr sdk.ValAddress) { - addr := key[1:] - if len(addr) != sdk.AddrLen { + // key is in the format: + // 0x02 + + // Remove prefix and address length. + addr := key[2:] + if len(addr) != int(key[1]) { panic("unexpected key length") } + return sdk.ValAddress(addr) } -// gets an address from a delegator's withdraw info key +// GetDelegatorWithdrawInfoAddress creates an address from a delegator's withdraw info key. func GetDelegatorWithdrawInfoAddress(key []byte) (delAddr sdk.AccAddress) { - addr := key[1:] - if len(addr) != sdk.AddrLen { + // key is in the format: + // 0x03 + + // Remove prefix and address length. + addr := key[2:] + if len(addr) != int(key[1]) { panic("unexpected key length") } + return sdk.AccAddress(addr) } -// gets the addresses from a delegator starting info key +// GetDelegatorStartingInfoAddresses creates the addresses from a delegator starting info key. func GetDelegatorStartingInfoAddresses(key []byte) (valAddr sdk.ValAddress, delAddr sdk.AccAddress) { - addr := key[1 : 1+sdk.AddrLen] - if len(addr) != sdk.AddrLen { + // key is in the format: + // 0x04 + valAddrLen := int(key[1]) + valAddr = sdk.ValAddress(key[2 : 2+valAddrLen]) + delAddrLen := int(key[2+valAddrLen]) + delAddr = sdk.AccAddress(key[3+valAddrLen:]) + if len(delAddr.Bytes()) != delAddrLen { panic("unexpected key length") } - valAddr = sdk.ValAddress(addr) - addr = key[1+sdk.AddrLen:] - if len(addr) != sdk.AddrLen { - panic("unexpected key length") - } - delAddr = sdk.AccAddress(addr) + return } -// gets the address & period from a validator's historical rewards key +// GetValidatorHistoricalRewardsAddressPeriod creates the address & period from a validator's historical rewards key. func GetValidatorHistoricalRewardsAddressPeriod(key []byte) (valAddr sdk.ValAddress, period uint64) { - addr := key[1 : 1+sdk.AddrLen] - if len(addr) != sdk.AddrLen { - panic("unexpected key length") - } - valAddr = sdk.ValAddress(addr) - b := key[1+sdk.AddrLen:] + // key is in the format: + // 0x05 + valAddrLen := int(key[1]) + valAddr = sdk.ValAddress(key[2 : 2+valAddrLen]) + b := key[2+valAddrLen:] if len(b) != 8 { panic("unexpected key length") } @@ -101,93 +111,104 @@ func GetValidatorHistoricalRewardsAddressPeriod(key []byte) (valAddr sdk.ValAddr return } -// gets the address from a validator's current rewards key +// GetValidatorCurrentRewardsAddress creates the address from a validator's current rewards key. func GetValidatorCurrentRewardsAddress(key []byte) (valAddr sdk.ValAddress) { - addr := key[1:] - if len(addr) != sdk.AddrLen { + // key is in the format: + // 0x06: ValidatorCurrentRewards + + // Remove prefix and address length. + addr := key[2:] + if len(addr) != int(key[1]) { panic("unexpected key length") } + return sdk.ValAddress(addr) } -// gets the address from a validator's accumulated commission key +// GetValidatorAccumulatedCommissionAddress creates the address from a validator's accumulated commission key. func GetValidatorAccumulatedCommissionAddress(key []byte) (valAddr sdk.ValAddress) { - addr := key[1:] - if len(addr) != sdk.AddrLen { + // key is in the format: + // 0x07: ValidatorCurrentRewards + + // Remove prefix and address length. + addr := key[2:] + if len(addr) != int(key[1]) { panic("unexpected key length") } + return sdk.ValAddress(addr) } -// gets the height from a validator's slash event key +// GetValidatorSlashEventAddressHeight creates the height from a validator's slash event key. func GetValidatorSlashEventAddressHeight(key []byte) (valAddr sdk.ValAddress, height uint64) { - addr := key[1 : 1+sdk.AddrLen] - if len(addr) != sdk.AddrLen { - panic("unexpected key length") - } - valAddr = sdk.ValAddress(addr) - startB := 1 + sdk.AddrLen + // key is in the format: + // 0x08: ValidatorSlashEvent + valAddrLen := int(key[1]) + valAddr = key[2 : 2+valAddrLen] + startB := 2 + valAddrLen b := key[startB : startB+8] // the next 8 bytes represent the height height = binary.BigEndian.Uint64(b) return } -// gets the outstanding rewards key for a validator +// GetValidatorOutstandingRewardsKey creates the outstanding rewards key for a validator. func GetValidatorOutstandingRewardsKey(valAddr sdk.ValAddress) []byte { - return append(ValidatorOutstandingRewardsPrefix, valAddr.Bytes()...) + return append(ValidatorOutstandingRewardsPrefix, address.MustLengthPrefix(valAddr.Bytes())...) } -// gets the key for a delegator's withdraw addr +// GetDelegatorWithdrawAddrKey creates the key for a delegator's withdraw addr. func GetDelegatorWithdrawAddrKey(delAddr sdk.AccAddress) []byte { - return append(DelegatorWithdrawAddrPrefix, delAddr.Bytes()...) + return append(DelegatorWithdrawAddrPrefix, address.MustLengthPrefix(delAddr.Bytes())...) } -// gets the key for a delegator's starting info +// GetDelegatorStartingInfoKey creates the key for a delegator's starting info. func GetDelegatorStartingInfoKey(v sdk.ValAddress, d sdk.AccAddress) []byte { - return append(append(DelegatorStartingInfoPrefix, v.Bytes()...), d.Bytes()...) + return append(append(DelegatorStartingInfoPrefix, address.MustLengthPrefix(v.Bytes())...), address.MustLengthPrefix(d.Bytes())...) } -// gets the prefix key for a validator's historical rewards +// GetValidatorHistoricalRewardsPrefix creates the prefix key for a validator's historical rewards. func GetValidatorHistoricalRewardsPrefix(v sdk.ValAddress) []byte { - return append(ValidatorHistoricalRewardsPrefix, v.Bytes()...) + return append(ValidatorHistoricalRewardsPrefix, address.MustLengthPrefix(v.Bytes())...) } -// gets the key for a validator's historical rewards +// GetValidatorHistoricalRewardsKey creates the key for a validator's historical rewards. func GetValidatorHistoricalRewardsKey(v sdk.ValAddress, k uint64) []byte { b := make([]byte, 8) binary.LittleEndian.PutUint64(b, k) - return append(append(ValidatorHistoricalRewardsPrefix, v.Bytes()...), b...) + return append(append(ValidatorHistoricalRewardsPrefix, address.MustLengthPrefix(v.Bytes())...), b...) } -// gets the key for a validator's current rewards +// GetValidatorCurrentRewardsKey creates the key for a validator's current rewards. func GetValidatorCurrentRewardsKey(v sdk.ValAddress) []byte { - return append(ValidatorCurrentRewardsPrefix, v.Bytes()...) + return append(ValidatorCurrentRewardsPrefix, address.MustLengthPrefix(v.Bytes())...) } -// gets the key for a validator's current commission +// GetValidatorAccumulatedCommissionKey creates the key for a validator's current commission. func GetValidatorAccumulatedCommissionKey(v sdk.ValAddress) []byte { - return append(ValidatorAccumulatedCommissionPrefix, v.Bytes()...) + return append(ValidatorAccumulatedCommissionPrefix, address.MustLengthPrefix(v.Bytes())...) } -// gets the prefix key for a validator's slash fractions +// GetValidatorSlashEventPrefix creates the prefix key for a validator's slash fractions. func GetValidatorSlashEventPrefix(v sdk.ValAddress) []byte { - return append(ValidatorSlashEventPrefix, v.Bytes()...) + return append(ValidatorSlashEventPrefix, address.MustLengthPrefix(v.Bytes())...) } -// gets the prefix key for a validator's slash fraction (ValidatorSlashEventPrefix + height) +// GetValidatorSlashEventKeyPrefix creates the prefix key for a validator's slash fraction (ValidatorSlashEventPrefix + height). func GetValidatorSlashEventKeyPrefix(v sdk.ValAddress, height uint64) []byte { heightBz := make([]byte, 8) binary.BigEndian.PutUint64(heightBz, height) + return append( ValidatorSlashEventPrefix, - append(v.Bytes(), heightBz...)..., + append(address.MustLengthPrefix(v.Bytes()), heightBz...)..., ) } -// gets the key for a validator's slash fraction +// GetValidatorSlashEventKey creates the key for a validator's slash fraction. func GetValidatorSlashEventKey(v sdk.ValAddress, height, period uint64) []byte { periodBz := make([]byte, 8) binary.BigEndian.PutUint64(periodBz, period) prefix := GetValidatorSlashEventKeyPrefix(v, height) + return append(prefix, periodBz...) } diff --git a/x/feegrant/types/key.go b/x/feegrant/types/key.go index e30427b13..7cd1ce4f8 100644 --- a/x/feegrant/types/key.go +++ b/x/feegrant/types/key.go @@ -2,6 +2,7 @@ package types import ( sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" ) const ( @@ -26,10 +27,10 @@ var ( // FeeAllowanceKey is the canonical key to store a grant from granter to grantee // We store by grantee first to allow searching by everyone who granted to you func FeeAllowanceKey(granter sdk.AccAddress, grantee sdk.AccAddress) []byte { - return append(append(FeeAllowanceKeyPrefix, grantee.Bytes()...), granter.Bytes()...) + return append(FeeAllowancePrefixByGrantee(grantee), address.MustLengthPrefix(granter.Bytes())...) } // FeeAllowancePrefixByGrantee returns a prefix to scan for all grants to this given address. func FeeAllowancePrefixByGrantee(grantee sdk.AccAddress) []byte { - return append(FeeAllowanceKeyPrefix, grantee.Bytes()...) + return append(FeeAllowanceKeyPrefix, address.MustLengthPrefix(grantee.Bytes())...) } diff --git a/x/gov/types/keys.go b/x/gov/types/keys.go index 7681116fc..fe98bcbf8 100644 --- a/x/gov/types/keys.go +++ b/x/gov/types/keys.go @@ -6,6 +6,7 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" ) const ( @@ -33,9 +34,9 @@ const ( // // - 0x03: nextProposalID // -// - 0x10: Deposit +// - 0x10: Deposit // -// - 0x20: Voter +// - 0x20: Voter var ( ProposalsKeyPrefix = []byte{0x00} ActiveProposalQueuePrefix = []byte{0x01} @@ -93,7 +94,7 @@ func DepositsKey(proposalID uint64) []byte { // DepositKey key of a specific deposit from the store func DepositKey(proposalID uint64, depositorAddr sdk.AccAddress) []byte { - return append(DepositsKey(proposalID), depositorAddr.Bytes()...) + return append(DepositsKey(proposalID), address.MustLengthPrefix(depositorAddr.Bytes())...) } // VotesKey gets the first part of the votes key based on the proposalID @@ -103,7 +104,7 @@ func VotesKey(proposalID uint64) []byte { // VoteKey key of a specific vote from the store func VoteKey(proposalID uint64, voterAddr sdk.AccAddress) []byte { - return append(VotesKey(proposalID), voterAddr.Bytes()...) + return append(VotesKey(proposalID), address.MustLengthPrefix(voterAddr.Bytes())...) } // Split keys function; used for iterators @@ -154,11 +155,9 @@ func splitKeyWithTime(key []byte) (proposalID uint64, endTime time.Time) { } func splitKeyWithAddress(key []byte) (proposalID uint64, addr sdk.AccAddress) { - if len(key[1:]) != 8+sdk.AddrLen { - panic(fmt.Sprintf("unexpected key length (%d ≠ %d)", len(key), 8+sdk.AddrLen)) - } - + // Both Vote and Deposit store keys are of format: + // proposalID = GetProposalIDFromBytes(key[1:9]) - addr = sdk.AccAddress(key[9:]) + addr = sdk.AccAddress(key[10:]) return } diff --git a/x/gov/types/keys_test.go b/x/gov/types/keys_test.go index 80dfa7d20..30266f8f4 100644 --- a/x/gov/types/keys_test.go +++ b/x/gov/types/keys_test.go @@ -46,11 +46,6 @@ func TestDepositKeys(t *testing.T) { proposalID, depositorAddr := SplitKeyDeposit(key) require.Equal(t, int(proposalID), 2) require.Equal(t, addr, depositorAddr) - - // invalid key - addr2 := sdk.AccAddress("test1") - key = DepositKey(5, addr2) - require.Panics(t, func() { SplitKeyDeposit(key) }) } func TestVoteKeys(t *testing.T) { @@ -63,9 +58,4 @@ func TestVoteKeys(t *testing.T) { proposalID, voterAddr := SplitKeyDeposit(key) require.Equal(t, int(proposalID), 2) require.Equal(t, addr, voterAddr) - - // invalid key - addr2 := sdk.AccAddress("test1") - key = VoteKey(5, addr2) - require.Panics(t, func() { SplitKeyVote(key) }) } diff --git a/x/slashing/types/keys.go b/x/slashing/types/keys.go index c9792d220..f0049760f 100644 --- a/x/slashing/types/keys.go +++ b/x/slashing/types/keys.go @@ -4,6 +4,7 @@ import ( "encoding/binary" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" ) const ( @@ -23,11 +24,11 @@ const ( // Keys for slashing store // Items are stored with the following key: values // -// - 0x01: ValidatorSigningInfo +// - 0x01: ValidatorSigningInfo // -// - 0x02: bool +// - 0x02: bool // -// - 0x03: crypto.PubKey +// - 0x03: cryptotypes.PubKey var ( ValidatorSigningInfoKeyPrefix = []byte{0x01} // Prefix for signing info ValidatorMissedBlockBitArrayKeyPrefix = []byte{0x02} // Prefix for missed block bit array @@ -36,31 +37,31 @@ var ( // ValidatorSigningInfoKey - stored by *Consensus* address (not operator address) func ValidatorSigningInfoKey(v sdk.ConsAddress) []byte { - return append(ValidatorSigningInfoKeyPrefix, v.Bytes()...) + return append(ValidatorSigningInfoKeyPrefix, address.MustLengthPrefix(v.Bytes())...) } // ValidatorSigningInfoAddress - extract the address from a validator signing info key func ValidatorSigningInfoAddress(key []byte) (v sdk.ConsAddress) { - addr := key[1:] - if len(addr) != sdk.AddrLen { - panic("unexpected key length") - } + // Remove prefix and address length. + addr := key[2:] + return sdk.ConsAddress(addr) } // ValidatorMissedBlockBitArrayPrefixKey - stored by *Consensus* address (not operator address) func ValidatorMissedBlockBitArrayPrefixKey(v sdk.ConsAddress) []byte { - return append(ValidatorMissedBlockBitArrayKeyPrefix, v.Bytes()...) + return append(ValidatorMissedBlockBitArrayKeyPrefix, address.MustLengthPrefix(v.Bytes())...) } // ValidatorMissedBlockBitArrayKey - stored by *Consensus* address (not operator address) func ValidatorMissedBlockBitArrayKey(v sdk.ConsAddress, i int64) []byte { b := make([]byte, 8) binary.LittleEndian.PutUint64(b, uint64(i)) + return append(ValidatorMissedBlockBitArrayPrefixKey(v), b...) } // AddrPubkeyRelationKey gets pubkey relation key used to get the pubkey from the address -func AddrPubkeyRelationKey(address []byte) []byte { - return append(AddrPubkeyRelationKeyPrefix, address...) +func AddrPubkeyRelationKey(addr []byte) []byte { + return append(AddrPubkeyRelationKeyPrefix, address.MustLengthPrefix(addr)...) } diff --git a/x/staking/keeper/val_state_change.go b/x/staking/keeper/val_state_change.go index f06994f44..52b739230 100644 --- a/x/staking/keeper/val_state_change.go +++ b/x/staking/keeper/val_state_change.go @@ -12,7 +12,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking/types" ) -// Calculate the ValidatorUpdates for the current block +// BlockValidatorUpdates calculates the ValidatorUpdates for the current block // Called in each EndBlock func (k Keeper) BlockValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate { // Calculate validator set changes. @@ -97,7 +97,7 @@ func (k Keeper) BlockValidatorUpdates(ctx sdk.Context) []abci.ValidatorUpdate { return validatorUpdates } -// Apply and return accumulated updates to the bonded validator set. Also, +// ApplyAndReturnValidatorSetUpdates applies and return accumulated updates to the bonded validator set. Also, // * Updates the active valset as keyed by LastValidatorPowerKey. // * Updates the total power as keyed by LastTotalPowerKey. // * Updates validator status' according to updated powers. @@ -117,7 +117,10 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []ab // Retrieve the last validator set. // The persistent set is updated later in this function. // (see LastValidatorPowerKey). - last := k.getLastValidatorsByAddr(ctx) + last, err := k.getLastValidatorsByAddr(ctx) + if err != nil { + return nil, err + } // Iterate over validators, highest power to lowest. iterator := k.ValidatorsPowerStoreIterator(ctx) @@ -160,10 +163,11 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []ab } // fetch the old power bytes - var valAddrBytes [sdk.AddrLen]byte - - copy(valAddrBytes[:], valAddr[:]) - oldPowerBytes, found := last[valAddrBytes] + valAddrStr, err := sdk.Bech32ifyAddressBytes(sdk.Bech32PrefixValAddr, valAddr) + if err != nil { + return nil, err + } + oldPowerBytes, found := last[valAddrStr] newPower := validator.ConsensusPower() newPowerBytes := k.cdc.MustMarshalBinaryBare(&gogotypes.Int64Value{Value: newPower}) @@ -174,13 +178,17 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx sdk.Context) (updates []ab k.SetLastValidatorPower(ctx, valAddr, newPower) } - delete(last, valAddrBytes) + delete(last, valAddrStr) count++ totalPower = totalPower.Add(sdk.NewInt(newPower)) } - noLongerBonded := sortNoLongerBonded(last) + noLongerBonded, err := sortNoLongerBonded(last) + if err != nil { + return nil, err + } + for _, valAddrBytes := range noLongerBonded { validator := k.mustGetValidator(ctx, sdk.ValAddress(valAddrBytes)) validator, err = k.bondedToUnbonding(ctx, validator) @@ -339,39 +347,46 @@ func (k Keeper) completeUnbondingValidator(ctx sdk.Context, validator types.Vali return validator } -// map of operator addresses to serialized power -type validatorsByAddr map[[sdk.AddrLen]byte][]byte +// map of operator bech32-addresses to serialized power +// We use bech32 strings here, because we can't have slices as keys: map[[]byte][]byte +type validatorsByAddr map[string][]byte // get the last validator set -func (k Keeper) getLastValidatorsByAddr(ctx sdk.Context) validatorsByAddr { +func (k Keeper) getLastValidatorsByAddr(ctx sdk.Context) (validatorsByAddr, error) { last := make(validatorsByAddr) iterator := k.LastValidatorsIterator(ctx) defer iterator.Close() for ; iterator.Valid(); iterator.Next() { - var valAddr [sdk.AddrLen]byte - // extract the validator address from the key (prefix is 1-byte) - copy(valAddr[:], iterator.Key()[1:]) + // extract the validator address from the key (prefix is 1-byte, addrLen is 1-byte) + valAddr := types.AddressFromLastValidatorPowerKey(iterator.Key()) + valAddrStr, err := sdk.Bech32ifyAddressBytes(sdk.Bech32PrefixValAddr, valAddr) + if err != nil { + return nil, err + } + powerBytes := iterator.Value() - last[valAddr] = make([]byte, len(powerBytes)) - copy(last[valAddr], powerBytes) + last[valAddrStr] = make([]byte, len(powerBytes)) + copy(last[valAddrStr], powerBytes) } - return last + return last, nil } // given a map of remaining validators to previous bonded power // returns the list of validators to be unbonded, sorted by operator address -func sortNoLongerBonded(last validatorsByAddr) [][]byte { +func sortNoLongerBonded(last validatorsByAddr) ([][]byte, error) { // sort the map keys for determinism noLongerBonded := make([][]byte, len(last)) index := 0 - for valAddrBytes := range last { - valAddr := make([]byte, sdk.AddrLen) - copy(valAddr, valAddrBytes[:]) - noLongerBonded[index] = valAddr + for valAddrStr := range last { + valAddrBytes, err := sdk.ValAddressFromBech32(valAddrStr) + if err != nil { + return nil, err + } + noLongerBonded[index] = valAddrBytes index++ } // sorted by address - order doesn't matter @@ -380,5 +395,5 @@ func sortNoLongerBonded(last validatorsByAddr) [][]byte { return bytes.Compare(noLongerBonded[i], noLongerBonded[j]) == -1 }) - return noLongerBonded + return noLongerBonded, nil } diff --git a/x/staking/keeper/validator.go b/x/staking/keeper/validator.go index edb00ddba..9fa6a0ca0 100644 --- a/x/staking/keeper/validator.go +++ b/x/staking/keeper/validator.go @@ -327,7 +327,7 @@ func (k Keeper) IterateLastValidatorPowers(ctx sdk.Context, handler func(operato defer iter.Close() for ; iter.Valid(); iter.Next() { - addr := sdk.ValAddress(iter.Key()[len(types.LastValidatorPowerKey):]) + addr := sdk.ValAddress(types.AddressFromLastValidatorPowerKey(iter.Key())) intV := &gogotypes.Int64Value{} k.cdc.MustUnmarshalBinaryBare(iter.Value(), intV) diff --git a/x/staking/types/keys.go b/x/staking/types/keys.go index 40d62244a..1854ddac6 100644 --- a/x/staking/types/keys.go +++ b/x/staking/types/keys.go @@ -8,6 +8,7 @@ import ( "time" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/address" ) const ( @@ -48,24 +49,29 @@ var ( HistoricalInfoKey = []byte{0x50} // prefix for the historical info ) -// gets the key for the validator with address +// GetValidatorKey creates the key for the validator with address // VALUE: staking/Validator func GetValidatorKey(operatorAddr sdk.ValAddress) []byte { - return append(ValidatorsKey, operatorAddr.Bytes()...) + return append(ValidatorsKey, address.MustLengthPrefix(operatorAddr)...) } -// gets the key for the validator with pubkey +// GetValidatorByConsAddrKey creates the key for the validator with pubkey // VALUE: validator operator address ([]byte) func GetValidatorByConsAddrKey(addr sdk.ConsAddress) []byte { - return append(ValidatorsByConsAddrKey, addr.Bytes()...) + return append(ValidatorsByConsAddrKey, address.MustLengthPrefix(addr)...) } -// Get the validator operator address from LastValidatorPowerKey +// AddressFromValidatorsKey creates the validator operator address from ValidatorsKey +func AddressFromValidatorsKey(key []byte) []byte { + return key[2:] // remove prefix bytes and address length +} + +// AddressFromLastValidatorPowerKey creates the validator operator address from LastValidatorPowerKey func AddressFromLastValidatorPowerKey(key []byte) []byte { - return key[1:] // remove prefix bytes + return key[2:] // remove prefix bytes and address length } -// get the validator by power index. +// GetValidatorsByPowerIndexKey creates the validator by power index. // Power index is the key used in the power-store, and represents the relative // power ranking of the validator. // VALUE: validator operator address ([]byte) @@ -80,39 +86,39 @@ func GetValidatorsByPowerIndexKey(validator Validator) []byte { powerBytes := consensusPowerBytes powerBytesLen := len(powerBytes) // 8 - // key is of format prefix || powerbytes || addrBytes - key := make([]byte, 1+powerBytesLen+sdk.AddrLen) - - key[0] = ValidatorsByPowerIndexKey[0] - copy(key[1:powerBytesLen+1], powerBytes) addr, err := sdk.ValAddressFromBech32(validator.OperatorAddress) if err != nil { panic(err) } operAddrInvr := sdk.CopyBytes(addr) + addrLen := len(operAddrInvr) for i, b := range operAddrInvr { operAddrInvr[i] = ^b } - copy(key[powerBytesLen+1:], operAddrInvr) + // key is of format prefix || powerbytes || addrLen (1byte) || addrBytes + key := make([]byte, 1+powerBytesLen+1+addrLen) + + key[0] = ValidatorsByPowerIndexKey[0] + copy(key[1:powerBytesLen+1], powerBytes) + key[powerBytesLen+1] = byte(addrLen) + copy(key[powerBytesLen+2:], operAddrInvr) return key } -// get the bonded validator index key for an operator address +// GetLastValidatorPowerKey creates the bonded validator index key for an operator address func GetLastValidatorPowerKey(operator sdk.ValAddress) []byte { - return append(LastValidatorPowerKey, operator...) + return append(LastValidatorPowerKey, address.MustLengthPrefix(operator)...) } -// parse the validators operator address from power rank key +// ParseValidatorPowerRankKey parses the validators operator address from power rank key func ParseValidatorPowerRankKey(key []byte) (operAddr []byte) { powerBytesLen := 8 - if len(key) != 1+powerBytesLen+sdk.AddrLen { - panic("Invalid validator power rank key length") - } - operAddr = sdk.CopyBytes(key[powerBytesLen+1:]) + // key is of format prefix (1 byte) || powerbytes || addrLen (1byte) || addrBytes + operAddr = sdk.CopyBytes(key[powerBytesLen+2:]) for i, b := range operAddr { operAddr[i] = ^b @@ -165,55 +171,51 @@ func ParseValidatorQueueKey(bz []byte) (time.Time, int64, error) { return ts, int64(height), nil } -// gets the key for delegator bond with validator +// GetDelegationKey creates the key for delegator bond with validator // VALUE: staking/Delegation func GetDelegationKey(delAddr sdk.AccAddress, valAddr sdk.ValAddress) []byte { - return append(GetDelegationsKey(delAddr), valAddr.Bytes()...) + return append(GetDelegationsKey(delAddr), address.MustLengthPrefix(valAddr)...) } -// gets the prefix for a delegator for all validators +// GetDelegationsKey creates the prefix for a delegator for all validators func GetDelegationsKey(delAddr sdk.AccAddress) []byte { - return append(DelegationKey, delAddr.Bytes()...) + return append(DelegationKey, address.MustLengthPrefix(delAddr)...) } -// gets the key for an unbonding delegation by delegator and validator addr +// GetUBDKey creates the key for an unbonding delegation by delegator and validator addr // VALUE: staking/UnbondingDelegation func GetUBDKey(delAddr sdk.AccAddress, valAddr sdk.ValAddress) []byte { - return append( - GetUBDsKey(delAddr.Bytes()), - valAddr.Bytes()...) + return append(GetUBDsKey(delAddr.Bytes()), address.MustLengthPrefix(valAddr)...) } -// gets the index-key for an unbonding delegation, stored by validator-index +// GetUBDByValIndexKey creates the index-key for an unbonding delegation, stored by validator-index // VALUE: none (key rearrangement used) func GetUBDByValIndexKey(delAddr sdk.AccAddress, valAddr sdk.ValAddress) []byte { - return append(GetUBDsByValIndexKey(valAddr), delAddr.Bytes()...) + return append(GetUBDsByValIndexKey(valAddr), address.MustLengthPrefix(delAddr)...) } -// rearranges the ValIndexKey to get the UBDKey +// GetUBDKeyFromValIndexKey rearranges the ValIndexKey to get the UBDKey func GetUBDKeyFromValIndexKey(indexKey []byte) []byte { addrs := indexKey[1:] // remove prefix bytes - if len(addrs) != 2*sdk.AddrLen { - panic("unexpected key length") - } - valAddr := addrs[:sdk.AddrLen] - delAddr := addrs[sdk.AddrLen:] + valAddrLen := addrs[0] + valAddr := addrs[1 : 1+valAddrLen] + delAddr := addrs[valAddrLen+2:] return GetUBDKey(delAddr, valAddr) } -// gets the prefix for all unbonding delegations from a delegator +// GetUBDsKey creates the prefix for all unbonding delegations from a delegator func GetUBDsKey(delAddr sdk.AccAddress) []byte { - return append(UnbondingDelegationKey, delAddr.Bytes()...) + return append(UnbondingDelegationKey, address.MustLengthPrefix(delAddr)...) } -// gets the prefix keyspace for the indexes of unbonding delegations for a validator +// GetUBDsByValIndexKey creates the prefix keyspace for the indexes of unbonding delegations for a validator func GetUBDsByValIndexKey(valAddr sdk.ValAddress) []byte { - return append(UnbondingDelegationByValIndexKey, valAddr.Bytes()...) + return append(UnbondingDelegationByValIndexKey, address.MustLengthPrefix(valAddr)...) } -// gets the prefix for all unbonding delegations from a delegator +// GetUnbondingDelegationTimeKey creates the prefix for all unbonding delegations from a delegator func GetUnbondingDelegationTimeKey(timestamp time.Time) []byte { bz := sdk.FormatTimeBytes(timestamp) return append(UnbondingQueueKey, bz...) @@ -222,69 +224,76 @@ func GetUnbondingDelegationTimeKey(timestamp time.Time) []byte { // GetREDKey returns a key prefix for indexing a redelegation from a delegator // and source validator to a destination validator. func GetREDKey(delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) []byte { - key := make([]byte, 1+sdk.AddrLen*3) + // key is of the form GetREDsKey || valSrcAddrLen (1 byte) || valSrcAddr || valDstAddrLen (1 byte) || valDstAddr + key := make([]byte, 1+3+len(delAddr)+len(valSrcAddr)+len(valDstAddr)) - copy(key[0:sdk.AddrLen+1], GetREDsKey(delAddr.Bytes())) - copy(key[sdk.AddrLen+1:2*sdk.AddrLen+1], valSrcAddr.Bytes()) - copy(key[2*sdk.AddrLen+1:3*sdk.AddrLen+1], valDstAddr.Bytes()) + copy(key[0:2+len(delAddr)], GetREDsKey(delAddr.Bytes())) + key[2+len(delAddr)] = byte(len(valSrcAddr)) + copy(key[3+len(delAddr):3+len(delAddr)+len(valSrcAddr)], valSrcAddr.Bytes()) + key[3+len(delAddr)+len(valSrcAddr)] = byte(len(valDstAddr)) + copy(key[4+len(delAddr)+len(valSrcAddr):], valDstAddr.Bytes()) return key } -// gets the index-key for a redelegation, stored by source-validator-index +// GetREDByValSrcIndexKey creates the index-key for a redelegation, stored by source-validator-index // VALUE: none (key rearrangement used) func GetREDByValSrcIndexKey(delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) []byte { REDSFromValsSrcKey := GetREDsFromValSrcIndexKey(valSrcAddr) offset := len(REDSFromValsSrcKey) - // key is of the form REDSFromValsSrcKey || delAddr || valDstAddr - key := make([]byte, len(REDSFromValsSrcKey)+2*sdk.AddrLen) + // key is of the form REDSFromValsSrcKey || delAddrLen (1 byte) || delAddr || valDstAddrLen (1 byte) || valDstAddr + key := make([]byte, offset+2+len(delAddr)+len(valDstAddr)) copy(key[0:offset], REDSFromValsSrcKey) - copy(key[offset:offset+sdk.AddrLen], delAddr.Bytes()) - copy(key[offset+sdk.AddrLen:offset+2*sdk.AddrLen], valDstAddr.Bytes()) + key[offset] = byte(len(delAddr)) + copy(key[offset+1:offset+1+len(delAddr)], delAddr.Bytes()) + key[offset+1+len(delAddr)] = byte(len(valDstAddr)) + copy(key[offset+2+len(delAddr):], valDstAddr.Bytes()) return key } -// gets the index-key for a redelegation, stored by destination-validator-index +// GetREDByValDstIndexKey creates the index-key for a redelegation, stored by destination-validator-index // VALUE: none (key rearrangement used) func GetREDByValDstIndexKey(delAddr sdk.AccAddress, valSrcAddr, valDstAddr sdk.ValAddress) []byte { REDSToValsDstKey := GetREDsToValDstIndexKey(valDstAddr) offset := len(REDSToValsDstKey) - // key is of the form REDSToValsDstKey || delAddr || valSrcAddr - key := make([]byte, len(REDSToValsDstKey)+2*sdk.AddrLen) + // key is of the form REDSToValsDstKey || delAddrLen (1 byte) || delAddr || valSrcAddrLen (1 byte) || valSrcAddr + key := make([]byte, offset+2+len(delAddr)+len(valSrcAddr)) copy(key[0:offset], REDSToValsDstKey) - copy(key[offset:offset+sdk.AddrLen], delAddr.Bytes()) - copy(key[offset+sdk.AddrLen:offset+2*sdk.AddrLen], valSrcAddr.Bytes()) + key[offset] = byte(len(delAddr)) + copy(key[offset+1:offset+1+len(delAddr)], delAddr.Bytes()) + key[offset+1+len(delAddr)] = byte(len(valSrcAddr)) + copy(key[offset+2+len(delAddr):], valSrcAddr.Bytes()) return key } // GetREDKeyFromValSrcIndexKey rearranges the ValSrcIndexKey to get the REDKey func GetREDKeyFromValSrcIndexKey(indexKey []byte) []byte { - // note that first byte is prefix byte - if len(indexKey) != 3*sdk.AddrLen+1 { - panic("unexpected key length") - } + // note that first byte is prefix byte, which we remove + addrs := indexKey[1:] - valSrcAddr := indexKey[1 : sdk.AddrLen+1] - delAddr := indexKey[sdk.AddrLen+1 : 2*sdk.AddrLen+1] - valDstAddr := indexKey[2*sdk.AddrLen+1 : 3*sdk.AddrLen+1] + valSrcAddrLen := addrs[0] + valSrcAddr := addrs[1 : valSrcAddrLen+1] + delAddrLen := addrs[valSrcAddrLen+1] + delAddr := addrs[valSrcAddrLen+2 : valSrcAddrLen+2+delAddrLen] + valDstAddr := addrs[valSrcAddrLen+delAddrLen+3:] return GetREDKey(delAddr, valSrcAddr, valDstAddr) } // GetREDKeyFromValDstIndexKey rearranges the ValDstIndexKey to get the REDKey func GetREDKeyFromValDstIndexKey(indexKey []byte) []byte { - // note that first byte is prefix byte - if len(indexKey) != 3*sdk.AddrLen+1 { - panic("unexpected key length") - } + // note that first byte is prefix byte, which we remove + addrs := indexKey[1:] - valDstAddr := indexKey[1 : sdk.AddrLen+1] - delAddr := indexKey[sdk.AddrLen+1 : 2*sdk.AddrLen+1] - valSrcAddr := indexKey[2*sdk.AddrLen+1 : 3*sdk.AddrLen+1] + valDstAddrLen := addrs[0] + valDstAddr := addrs[1 : valDstAddrLen+1] + delAddrLen := addrs[valDstAddrLen+1] + delAddr := addrs[valDstAddrLen+2 : valDstAddrLen+2+delAddrLen] + valSrcAddr := addrs[valDstAddrLen+delAddrLen+3:] return GetREDKey(delAddr, valSrcAddr, valDstAddr) } @@ -299,25 +308,25 @@ func GetRedelegationTimeKey(timestamp time.Time) []byte { // GetREDsKey returns a key prefix for indexing a redelegation from a delegator // address. func GetREDsKey(delAddr sdk.AccAddress) []byte { - return append(RedelegationKey, delAddr.Bytes()...) + return append(RedelegationKey, address.MustLengthPrefix(delAddr)...) } // GetREDsFromValSrcIndexKey returns a key prefix for indexing a redelegation to // a source validator. func GetREDsFromValSrcIndexKey(valSrcAddr sdk.ValAddress) []byte { - return append(RedelegationByValSrcIndexKey, valSrcAddr.Bytes()...) + return append(RedelegationByValSrcIndexKey, address.MustLengthPrefix(valSrcAddr)...) } // GetREDsToValDstIndexKey returns a key prefix for indexing a redelegation to a // destination (target) validator. func GetREDsToValDstIndexKey(valDstAddr sdk.ValAddress) []byte { - return append(RedelegationByValDstIndexKey, valDstAddr.Bytes()...) + return append(RedelegationByValDstIndexKey, address.MustLengthPrefix(valDstAddr)...) } // GetREDsByDelToValDstIndexKey returns a key prefix for indexing a redelegation // from an address to a source validator. func GetREDsByDelToValDstIndexKey(delAddr sdk.AccAddress, valDstAddr sdk.ValAddress) []byte { - return append(GetREDsToValDstIndexKey(valDstAddr), delAddr.Bytes()...) + return append(GetREDsToValDstIndexKey(valDstAddr), address.MustLengthPrefix(delAddr)...) } // GetHistoricalInfoKey returns a key prefix for indexing HistoricalInfo objects. diff --git a/x/staking/types/keys_test.go b/x/staking/types/keys_test.go index 0f63617f2..949c7caed 100644 --- a/x/staking/types/keys_test.go +++ b/x/staking/types/keys_test.go @@ -37,10 +37,10 @@ func TestGetValidatorPowerRank(t *testing.T) { validator types.Validator wantHex string }{ - {val1, "2300000000000000009c288ede7df62742fc3b7d0962045a8cef0f79f6"}, - {val2, "2300000000000000019c288ede7df62742fc3b7d0962045a8cef0f79f6"}, - {val3, "23000000000000000a9c288ede7df62742fc3b7d0962045a8cef0f79f6"}, - {val4, "2300000100000000009c288ede7df62742fc3b7d0962045a8cef0f79f6"}, + {val1, "230000000000000000149c288ede7df62742fc3b7d0962045a8cef0f79f6"}, + {val2, "230000000000000001149c288ede7df62742fc3b7d0962045a8cef0f79f6"}, + {val3, "23000000000000000a149c288ede7df62742fc3b7d0962045a8cef0f79f6"}, + {val4, "230000010000000000149c288ede7df62742fc3b7d0962045a8cef0f79f6"}, } for i, tt := range tests { got := hex.EncodeToString(types.GetValidatorsByPowerIndexKey(tt.validator)) @@ -57,11 +57,11 @@ func TestGetREDByValDstIndexKey(t *testing.T) { wantHex string }{ {sdk.AccAddress(keysAddr1), sdk.ValAddress(keysAddr1), sdk.ValAddress(keysAddr1), - "3663d771218209d8bd03c482f69dfba57310f0860963d771218209d8bd03c482f69dfba57310f0860963d771218209d8bd03c482f69dfba57310f08609"}, + "361463d771218209d8bd03c482f69dfba57310f086091463d771218209d8bd03c482f69dfba57310f086091463d771218209d8bd03c482f69dfba57310f08609"}, {sdk.AccAddress(keysAddr1), sdk.ValAddress(keysAddr2), sdk.ValAddress(keysAddr3), - "363ab62f0d93849be495e21e3e9013a517038f45bd63d771218209d8bd03c482f69dfba57310f086095ef3b5f25c54946d4a89fc0d09d2f126614540f2"}, + "36143ab62f0d93849be495e21e3e9013a517038f45bd1463d771218209d8bd03c482f69dfba57310f08609145ef3b5f25c54946d4a89fc0d09d2f126614540f2"}, {sdk.AccAddress(keysAddr2), sdk.ValAddress(keysAddr1), sdk.ValAddress(keysAddr3), - "363ab62f0d93849be495e21e3e9013a517038f45bd5ef3b5f25c54946d4a89fc0d09d2f126614540f263d771218209d8bd03c482f69dfba57310f08609"}, + "36143ab62f0d93849be495e21e3e9013a517038f45bd145ef3b5f25c54946d4a89fc0d09d2f126614540f21463d771218209d8bd03c482f69dfba57310f08609"}, } for i, tt := range tests { got := hex.EncodeToString(types.GetREDByValDstIndexKey(tt.delAddr, tt.valSrcAddr, tt.valDstAddr)) @@ -78,11 +78,11 @@ func TestGetREDByValSrcIndexKey(t *testing.T) { wantHex string }{ {sdk.AccAddress(keysAddr1), sdk.ValAddress(keysAddr1), sdk.ValAddress(keysAddr1), - "3563d771218209d8bd03c482f69dfba57310f0860963d771218209d8bd03c482f69dfba57310f0860963d771218209d8bd03c482f69dfba57310f08609"}, + "351463d771218209d8bd03c482f69dfba57310f086091463d771218209d8bd03c482f69dfba57310f086091463d771218209d8bd03c482f69dfba57310f08609"}, {sdk.AccAddress(keysAddr1), sdk.ValAddress(keysAddr2), sdk.ValAddress(keysAddr3), - "355ef3b5f25c54946d4a89fc0d09d2f126614540f263d771218209d8bd03c482f69dfba57310f086093ab62f0d93849be495e21e3e9013a517038f45bd"}, + "35145ef3b5f25c54946d4a89fc0d09d2f126614540f21463d771218209d8bd03c482f69dfba57310f08609143ab62f0d93849be495e21e3e9013a517038f45bd"}, {sdk.AccAddress(keysAddr2), sdk.ValAddress(keysAddr1), sdk.ValAddress(keysAddr3), - "3563d771218209d8bd03c482f69dfba57310f086095ef3b5f25c54946d4a89fc0d09d2f126614540f23ab62f0d93849be495e21e3e9013a517038f45bd"}, + "351463d771218209d8bd03c482f69dfba57310f08609145ef3b5f25c54946d4a89fc0d09d2f126614540f2143ab62f0d93849be495e21e3e9013a517038f45bd"}, } for i, tt := range tests { got := hex.EncodeToString(types.GetREDByValSrcIndexKey(tt.delAddr, tt.valSrcAddr, tt.valDstAddr)) From f9da95ad0952b6800e707aeb8ba008427798781b Mon Sep 17 00:00:00 2001 From: Jonathan Gimeno Date: Tue, 2 Feb 2021 10:59:25 +0100 Subject: [PATCH 16/19] Fix keyring import from older versions. (#8436) Co-authored-by: Alessio Treglia Co-authored-by: sahith-narahari --- client/keys/migrate.go | 26 ++++++---- client/keys/testdata/keys/keys.db/000002.ldb | Bin 391 -> 0 bytes client/keys/testdata/keys/keys.db/CURRENT | 2 +- client/keys/testdata/keys/keys.db/CURRENT.bak | 2 +- client/keys/testdata/keys/keys.db/LOG | 48 +++++++++++------- .../testdata/keys/keys.db/MANIFEST-000004 | Bin 237 -> 0 bytes .../testdata/keys/keys.db/MANIFEST-000005 | Bin 0 -> 41 bytes crypto/keyring/keyring.go | 1 + 8 files changed, 49 insertions(+), 30 deletions(-) delete mode 100644 client/keys/testdata/keys/keys.db/000002.ldb delete mode 100644 client/keys/testdata/keys/keys.db/MANIFEST-000004 create mode 100644 client/keys/testdata/keys/keys.db/MANIFEST-000005 diff --git a/client/keys/migrate.go b/client/keys/migrate.go index d80bbe163..836a2655b 100644 --- a/client/keys/migrate.go +++ b/client/keys/migrate.go @@ -62,7 +62,7 @@ func runMigrateCmd(cmd *cobra.Command, args []string) error { var ( tmpDir string - migrator keyring.InfoImporter + migrator keyring.Importer ) if dryRun, _ := cmd.Flags().GetBool(flags.FlagDryRun); dryRun { @@ -73,10 +73,10 @@ func runMigrateCmd(cmd *cobra.Command, args []string) error { defer os.RemoveAll(tmpDir) - migrator, err = keyring.NewInfoImporter(keyringServiceName, "test", tmpDir, buf) + migrator, err = keyring.New(keyringServiceName, keyring.BackendTest, tmpDir, buf) } else { backend, _ := cmd.Flags().GetString(flags.FlagKeyringBackend) - migrator, err = keyring.NewInfoImporter(keyringServiceName, backend, rootDir, buf) + migrator, err = keyring.New(keyringServiceName, backend, rootDir, buf) } if err != nil { @@ -86,12 +86,12 @@ func runMigrateCmd(cmd *cobra.Command, args []string) error { )) } - for _, key := range oldKeys { - legKeyInfo, err := legacyKb.Export(key.GetName()) - if err != nil { - return err - } + if len(oldKeys) == 0 { + cmd.Print("Migration Aborted: no keys to migrate") + return nil + } + for _, key := range oldKeys { keyName := key.GetName() keyType := key.GetType() @@ -107,7 +107,12 @@ func runMigrateCmd(cmd *cobra.Command, args []string) error { } if keyType != keyring.TypeLocal { - if err := migrator.Import(keyName, legKeyInfo); err != nil { + pubkeyArmor, err := legacyKb.ExportPubKey(keyName) + if err != nil { + return err + } + + if err := migrator.ImportPubKey(keyName, pubkeyArmor); err != nil { return err } @@ -127,10 +132,11 @@ func runMigrateCmd(cmd *cobra.Command, args []string) error { return err } - if err := migrator.Import(keyName, armoredPriv); err != nil { + if err := migrator.ImportPrivKey(keyName, armoredPriv, migratePassphrase); err != nil { return err } } + cmd.Print("Migration Complete") return err } diff --git a/client/keys/testdata/keys/keys.db/000002.ldb b/client/keys/testdata/keys/keys.db/000002.ldb deleted file mode 100644 index b36586df3626e4a01631c987005dd5b167ff1da2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 391 zcmey$^r4Z#RxCNcI5)r8Fr~Dl+#<2KsJx`KtSZ&C+#n^bq%tF`u)-ugH7~cY)V$I% zr?5&dF(suawYZp(g#iqTO7lVsQW8s2opV#-y;CcV^fL3(^4ZPAathMRi}EtE%8be? z%1q6&N-NC^O3Kqxat-nfiYqI#QcBBG%aVb{ar!ebvHCgrGpHDX^)kqL7g=R6a7wZ; zGIE+rc**mTQf0Uyr1m=MWxFC%+6+;l*L&_w+s))UMK~hzht#w>p1XUJc$A%Z zPwESPNR;9%PE9T_GBwLK6yWnVVl8E1WG;$fU@+p1Im5hYq0HxtQ@kC!+?#3MRPJ a`@iD$YnizAFo}VL@PqK*4c#iG?zaJJVsO>~ diff --git a/client/keys/testdata/keys/keys.db/CURRENT b/client/keys/testdata/keys/keys.db/CURRENT index cacca7574..aa5bb8ea5 100644 --- a/client/keys/testdata/keys/keys.db/CURRENT +++ b/client/keys/testdata/keys/keys.db/CURRENT @@ -1 +1 @@ -MANIFEST-000004 +MANIFEST-000005 diff --git a/client/keys/testdata/keys/keys.db/CURRENT.bak b/client/keys/testdata/keys/keys.db/CURRENT.bak index feda7d6b2..4fb1dad19 100644 --- a/client/keys/testdata/keys/keys.db/CURRENT.bak +++ b/client/keys/testdata/keys/keys.db/CURRENT.bak @@ -1 +1 @@ -MANIFEST-000000 +MANIFEST-000003 diff --git a/client/keys/testdata/keys/keys.db/LOG b/client/keys/testdata/keys/keys.db/LOG index 386101e4f..e37648b85 100644 --- a/client/keys/testdata/keys/keys.db/LOG +++ b/client/keys/testdata/keys/keys.db/LOG @@ -1,18 +1,30 @@ -=============== Mar 30, 2020 (CEST) =============== -02:07:34.137606 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -02:07:34.144547 db@open opening -02:07:34.144770 version@stat F·[] S·0B[] Sc·[] -02:07:34.145843 db@janitor F·2 G·0 -02:07:34.145875 db@open done T·1.315251ms -02:07:34.335635 db@close closing -02:07:34.335736 db@close done T·98.95µs -=============== Mar 30, 2020 (CEST) =============== -02:08:33.239115 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed -02:08:33.239264 version@stat F·[] S·0B[] Sc·[] -02:08:33.239281 db@open opening -02:08:33.239310 journal@recovery F·1 -02:08:33.239398 journal@recovery recovering @1 -02:08:33.322008 memdb@flush created L0@2 N·4 S·391B "cos..ess,v4":"run..nfo,v3" -02:08:33.323091 version@stat F·[1] S·391B[391B] Sc·[0.25] -02:08:33.421979 db@janitor F·3 G·0 -02:08:33.422153 db@open done T·182.707962ms +=============== Feb 2, 2021 (IST) =============== +00:03:25.348369 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +00:03:25.350695 db@open opening +00:03:25.350888 version@stat F·[] S·0B[] Sc·[] +00:03:25.351864 db@janitor F·2 G·0 +00:03:25.351881 db@open done T·1.169825ms +00:03:25.351895 db@close closing +00:03:25.351929 db@close done T·33.042µs +=============== Feb 2, 2021 (IST) =============== +00:03:34.450638 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +00:03:34.450722 version@stat F·[] S·0B[] Sc·[] +00:03:34.450737 db@open opening +00:03:34.450765 journal@recovery F·1 +00:03:34.450851 journal@recovery recovering @1 +00:03:34.451173 version@stat F·[] S·0B[] Sc·[] +00:03:34.454278 db@janitor F·2 G·0 +00:03:34.454298 db@open done T·3.548046ms +00:03:34.454307 db@close closing +00:03:34.454327 db@close done T·19.017µs +=============== Feb 2, 2021 (IST) =============== +00:03:42.025705 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed +00:03:42.025892 version@stat F·[] S·0B[] Sc·[] +00:03:42.025907 db@open opening +00:03:42.025943 journal@recovery F·1 +00:03:42.026790 journal@recovery recovering @2 +00:03:42.026946 version@stat F·[] S·0B[] Sc·[] +00:03:42.031645 db@janitor F·2 G·0 +00:03:42.031661 db@open done T·5.750008ms +00:03:42.283102 db@close closing +00:03:42.283162 db@close done T·58.775µs diff --git a/client/keys/testdata/keys/keys.db/MANIFEST-000004 b/client/keys/testdata/keys/keys.db/MANIFEST-000004 deleted file mode 100644 index 557b4bdbbc93fd41441cfe30d1ca16f08f47f344..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 237 zcmeykNagJ_21Z7yoYb<^oRlOzr^=Gl^338?=ltA)#G=HK{30f1W>ywfb_S+)X4~Za z;@tdV!<5pJa*M>`qVkf`vZ_?ma)Xq#lFE#%!U~i0)V$onQu9j7oWd%-#FUhx)Z$`B l76veoD=N(kEl5c$Np;RmiT6&eG}6n=OUq|uhDg)i1^~DrOBnzF diff --git a/client/keys/testdata/keys/keys.db/MANIFEST-000005 b/client/keys/testdata/keys/keys.db/MANIFEST-000005 new file mode 100644 index 0000000000000000000000000000000000000000..a9e8a261c7882e802f65360dc49782db7df6fb77 GIT binary patch literal 41 wcmYcef4W17fss)vC$%g!CnZVGsj?)sJhM2}IX|}`u_&=5zle#2nT>@304?eb82|tP literal 0 HcmV?d00001 diff --git a/crypto/keyring/keyring.go b/crypto/keyring/keyring.go index f88ffdc37..164e6bfc1 100644 --- a/crypto/keyring/keyring.go +++ b/crypto/keyring/keyring.go @@ -108,6 +108,7 @@ type Signer interface { type Importer interface { // ImportPrivKey imports ASCII armored passphrase-encrypted private keys. ImportPrivKey(uid, armor, passphrase string) error + // ImportPubKey imports ASCII armored public keys. ImportPubKey(uid string, armor string) error } From 15d83f5dac95f4afeb9e266d14f044258e4d5744 Mon Sep 17 00:00:00 2001 From: SaReN Date: Tue, 2 Feb 2021 17:04:23 +0530 Subject: [PATCH 17/19] Add changelog (#8490) --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a5fa8365..6c0234946 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (simapp) [\#8418](https://github.com/cosmos/cosmos-sdk/pull/8418) Add balance coin to supply when adding a new genesis account * (x/bank) [\#8417](https://github.com/cosmos/cosmos-sdk/pull/8417) Validate balances and coin denom metadata on genesis * (server) [\#8399](https://github.com/cosmos/cosmos-sdk/pull/8399) fix gRPC-web flag default value +* (client/keys) [\#8436](https://github.com/cosmos/cosmos-sdk/pull/8436) Fix key migration issue ## [v0.40.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.40.1) - 2021-01-19 From ce161c4f0c52689f199e3d0376b41f581394861e Mon Sep 17 00:00:00 2001 From: Michael FIG Date: Tue, 2 Feb 2021 10:57:58 -0600 Subject: [PATCH 18/19] fix: tendermint subcommands should not create missing files (#8481) If the user specifies an incorrect `--home`, then the old behaviour would automatically populate it with fresh values, but we should fail instead. --- CHANGELOG.md | 2 ++ server/tm_cmds.go | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c0234946..73b4ff3ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/bank) [\#8417](https://github.com/cosmos/cosmos-sdk/pull/8417) Validate balances and coin denom metadata on genesis * (server) [\#8399](https://github.com/cosmos/cosmos-sdk/pull/8399) fix gRPC-web flag default value * (client/keys) [\#8436](https://github.com/cosmos/cosmos-sdk/pull/8436) Fix key migration issue +* (server) [\#8481](https://github.com/cosmos/cosmos-sdk/pull/8481) Don't create + files when running `{appd} tendermint show-*` subcommands ## [v0.40.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.40.1) - 2021-01-19 diff --git a/server/tm_cmds.go b/server/tm_cmds.go index b05a88f79..854d4597f 100644 --- a/server/tm_cmds.go +++ b/server/tm_cmds.go @@ -28,7 +28,7 @@ func ShowNodeIDCmd() *cobra.Command { serverCtx := GetServerContextFromCmd(cmd) cfg := serverCtx.Config - nodeKey, err := p2p.LoadOrGenNodeKey(cfg.NodeKeyFile()) + nodeKey, err := p2p.LoadNodeKey(cfg.NodeKeyFile()) if err != nil { return err } @@ -48,7 +48,7 @@ func ShowValidatorCmd() *cobra.Command { serverCtx := GetServerContextFromCmd(cmd) cfg := serverCtx.Config - privValidator := pvm.LoadOrGenFilePV(cfg.PrivValidatorKeyFile(), cfg.PrivValidatorStateFile()) + privValidator := pvm.LoadFilePV(cfg.PrivValidatorKeyFile(), cfg.PrivValidatorStateFile()) valPubKey, err := privValidator.GetPubKey() if err != nil { return err @@ -86,7 +86,7 @@ func ShowAddressCmd() *cobra.Command { serverCtx := GetServerContextFromCmd(cmd) cfg := serverCtx.Config - privValidator := pvm.LoadOrGenFilePV(cfg.PrivValidatorKeyFile(), cfg.PrivValidatorStateFile()) + privValidator := pvm.LoadFilePV(cfg.PrivValidatorKeyFile(), cfg.PrivValidatorStateFile()) valConsAddr := (sdk.ConsAddress)(privValidator.GetAddress()) output, _ := cmd.Flags().GetString(cli.OutputFlag) From d37c590e90cff8e04592bf8b2c63f31f4191a3b3 Mon Sep 17 00:00:00 2001 From: Andrei Ivasko Date: Wed, 3 Feb 2021 01:47:25 -0800 Subject: [PATCH 19/19] Limit context background (#8093) * limit context background * update * fixed minor issues * fixed TestStatusCommand * Fix keyring import from older versions. (#8436) Co-authored-by: Alessio Treglia Co-authored-by: sahith-narahari * Add changelog (#8490) * fix: tendermint subcommands should not create missing files (#8481) If the user specifies an incorrect `--home`, then the old behaviour would automatically populate it with fresh values, but we should fail instead. * limit context background * update * fixed minor issues * fixed TestStatusCommand * statik.go * replaced static.go Co-authored-by: Jonathan Gimeno Co-authored-by: Alessio Treglia Co-authored-by: sahith-narahari Co-authored-by: Michael FIG --- client/cmd_test.go | 3 +- client/grpc/tmservice/block.go | 4 +- client/grpc/tmservice/service.go | 18 ++++----- client/grpc/tmservice/status.go | 4 +- client/keys/parse.go | 3 +- client/rpc/validators.go | 10 ++--- x/auth/client/cli/query.go | 5 +-- x/bank/client/cli/query.go | 13 +++---- x/bank/client/testutil/cli_helpers.go | 3 +- x/distribution/client/cli/query.go | 16 ++++---- x/distribution/client/cli/tx.go | 3 +- x/gov/client/cli/query.go | 39 +++++++++++-------- .../applications/transfer/client/cli/query.go | 7 ++-- x/ibc/core/02-client/client/cli/query.go | 7 ++-- x/ibc/core/03-connection/client/cli/query.go | 3 +- x/ibc/core/04-channel/client/cli/query.go | 11 +++--- x/mint/client/cli/query.go | 7 ++-- x/params/client/cli/query.go | 4 +- x/slashing/client/cli/query.go | 7 ++-- x/staking/client/cli/query.go | 27 +++++++------ x/upgrade/client/cli/query.go | 9 ++--- 21 files changed, 96 insertions(+), 107 deletions(-) diff --git a/client/cmd_test.go b/client/cmd_test.go index 02e2c414f..65161fe47 100644 --- a/client/cmd_test.go +++ b/client/cmd_test.go @@ -97,8 +97,7 @@ func TestSetCmdClientContextHandler(t *testing.T) { tc := tc t.Run(tc.name, func(t *testing.T) { - ctx := context.Background() - ctx = context.WithValue(ctx, client.ClientContextKey, &client.Context{}) + ctx := context.WithValue(context.Background(), client.ClientContextKey, &client.Context{}) cmd := newCmd() _ = testutil.ApplyMockIODiscardOutErr(cmd) diff --git a/client/grpc/tmservice/block.go b/client/grpc/tmservice/block.go index e92fbec72..554156982 100644 --- a/client/grpc/tmservice/block.go +++ b/client/grpc/tmservice/block.go @@ -8,12 +8,12 @@ import ( "github.com/cosmos/cosmos-sdk/client" ) -func getBlock(clientCtx client.Context, height *int64) (*ctypes.ResultBlock, error) { +func getBlock(ctx context.Context, clientCtx client.Context, height *int64) (*ctypes.ResultBlock, error) { // get the node node, err := clientCtx.GetNode() if err != nil { return nil, err } - return node.Block(context.Background(), height) + return node.Block(ctx, height) } diff --git a/client/grpc/tmservice/service.go b/client/grpc/tmservice/service.go index 58d44af57..b621dff57 100644 --- a/client/grpc/tmservice/service.go +++ b/client/grpc/tmservice/service.go @@ -34,8 +34,8 @@ func NewQueryServer(clientCtx client.Context, interfaceRegistry codectypes.Inter } // GetSyncing implements ServiceServer.GetSyncing -func (s queryServer) GetSyncing(_ context.Context, _ *GetSyncingRequest) (*GetSyncingResponse, error) { - status, err := getNodeStatus(s.clientCtx) +func (s queryServer) GetSyncing(ctx context.Context, _ *GetSyncingRequest) (*GetSyncingResponse, error) { + status, err := getNodeStatus(ctx, s.clientCtx) if err != nil { return nil, err } @@ -45,8 +45,8 @@ func (s queryServer) GetSyncing(_ context.Context, _ *GetSyncingRequest) (*GetSy } // GetLatestBlock implements ServiceServer.GetLatestBlock -func (s queryServer) GetLatestBlock(context.Context, *GetLatestBlockRequest) (*GetLatestBlockResponse, error) { - status, err := getBlock(s.clientCtx, nil) +func (s queryServer) GetLatestBlock(ctx context.Context, _ *GetLatestBlockRequest) (*GetLatestBlockResponse, error) { + status, err := getBlock(ctx, s.clientCtx, nil) if err != nil { return nil, err } @@ -64,7 +64,7 @@ func (s queryServer) GetLatestBlock(context.Context, *GetLatestBlockRequest) (*G } // GetBlockByHeight implements ServiceServer.GetBlockByHeight -func (s queryServer) GetBlockByHeight(_ context.Context, req *GetBlockByHeightRequest) (*GetBlockByHeightResponse, error) { +func (s queryServer) GetBlockByHeight(ctx context.Context, req *GetBlockByHeightRequest) (*GetBlockByHeightResponse, error) { chainHeight, err := rpc.GetChainHeight(s.clientCtx) if err != nil { return nil, err @@ -74,7 +74,7 @@ func (s queryServer) GetBlockByHeight(_ context.Context, req *GetBlockByHeightRe return nil, status.Error(codes.InvalidArgument, "requested block height is bigger then the chain length") } - res, err := getBlock(s.clientCtx, &req.Height) + res, err := getBlock(ctx, s.clientCtx, &req.Height) if err != nil { return nil, err } @@ -96,7 +96,7 @@ func (s queryServer) GetLatestValidatorSet(ctx context.Context, req *GetLatestVa return nil, err } - validatorsRes, err := rpc.GetValidators(s.clientCtx, nil, &page, &limit) + validatorsRes, err := rpc.GetValidators(ctx, s.clientCtx, nil, &page, &limit) if err != nil { return nil, err } @@ -147,7 +147,7 @@ func (s queryServer) GetValidatorSetByHeight(ctx context.Context, req *GetValida return nil, status.Error(codes.InvalidArgument, "requested block height is bigger then the chain length") } - validatorsRes, err := rpc.GetValidators(s.clientCtx, &req.Height, &page, &limit) + validatorsRes, err := rpc.GetValidators(ctx, s.clientCtx, &req.Height, &page, &limit) if err != nil { return nil, err @@ -175,7 +175,7 @@ func (s queryServer) GetValidatorSetByHeight(ctx context.Context, req *GetValida // GetNodeInfo implements ServiceServer.GetNodeInfo func (s queryServer) GetNodeInfo(ctx context.Context, req *GetNodeInfoRequest) (*GetNodeInfoResponse, error) { - status, err := getNodeStatus(s.clientCtx) + status, err := getNodeStatus(ctx, s.clientCtx) if err != nil { return nil, err } diff --git a/client/grpc/tmservice/status.go b/client/grpc/tmservice/status.go index f1a8da8e8..9e9c3d200 100644 --- a/client/grpc/tmservice/status.go +++ b/client/grpc/tmservice/status.go @@ -8,10 +8,10 @@ import ( "github.com/cosmos/cosmos-sdk/client" ) -func getNodeStatus(clientCtx client.Context) (*ctypes.ResultStatus, error) { +func getNodeStatus(ctx context.Context, clientCtx client.Context) (*ctypes.ResultStatus, error) { node, err := clientCtx.GetNode() if err != nil { return &ctypes.ResultStatus{}, err } - return node.Status(context.Background()) + return node.Status(ctx) } diff --git a/client/keys/parse.go b/client/keys/parse.go index 2af792c03..b1169d68c 100644 --- a/client/keys/parse.go +++ b/client/keys/parse.go @@ -1,7 +1,6 @@ package keys import ( - "context" "encoding/hex" "errors" "fmt" @@ -86,7 +85,7 @@ hexadecimal into bech32 cosmos prefixed format and vice versa. } func parseKey(cmd *cobra.Command, args []string) error { - config, _ := sdk.GetSealedConfig(context.Background()) + config, _ := sdk.GetSealedConfig(cmd.Context()) return doParseKey(cmd, config, args) } diff --git a/client/rpc/validators.go b/client/rpc/validators.go index 66c594966..175e7ff91 100644 --- a/client/rpc/validators.go +++ b/client/rpc/validators.go @@ -50,7 +50,7 @@ func ValidatorCommand() *cobra.Command { page, _ := cmd.Flags().GetInt(flags.FlagPage) limit, _ := cmd.Flags().GetInt(flags.FlagLimit) - result, err := GetValidators(clientCtx, height, &page, &limit) + result, err := GetValidators(cmd.Context(), clientCtx, height, &page, &limit) if err != nil { return err } @@ -117,14 +117,14 @@ func validatorOutput(validator *tmtypes.Validator) (ValidatorOutput, error) { } // GetValidators from client -func GetValidators(clientCtx client.Context, height *int64, page, limit *int) (ResultValidatorsOutput, error) { +func GetValidators(ctx context.Context, clientCtx client.Context, height *int64, page, limit *int) (ResultValidatorsOutput, error) { // get the node node, err := clientCtx.GetNode() if err != nil { return ResultValidatorsOutput{}, err } - validatorsRes, err := node.Validators(context.Background(), height, page, limit) + validatorsRes, err := node.Validators(ctx, height, page, limit) if err != nil { return ResultValidatorsOutput{}, err } @@ -172,7 +172,7 @@ func ValidatorSetRequestHandlerFn(clientCtx client.Context) http.HandlerFunc { return } - output, err := GetValidators(clientCtx, &height, &page, &limit) + output, err := GetValidators(r.Context(), clientCtx, &height, &page, &limit) if rest.CheckInternalServerError(w, err) { return } @@ -189,7 +189,7 @@ func LatestValidatorSetRequestHandlerFn(clientCtx client.Context) http.HandlerFu return } - output, err := GetValidators(clientCtx, nil, &page, &limit) + output, err := GetValidators(r.Context(), clientCtx, nil, &page, &limit) if rest.CheckInternalServerError(w, err) { return } diff --git a/x/auth/client/cli/query.go b/x/auth/client/cli/query.go index 2590858b4..a236e900f 100644 --- a/x/auth/client/cli/query.go +++ b/x/auth/client/cli/query.go @@ -1,7 +1,6 @@ package cli import ( - "context" "fmt" "strings" @@ -58,7 +57,7 @@ $ query auth params } queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.Params(context.Background(), &types.QueryParamsRequest{}) + res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) if err != nil { return err } @@ -90,7 +89,7 @@ func GetAccountCmd() *cobra.Command { } queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.Account(context.Background(), &types.QueryAccountRequest{Address: key.String()}) + res, err := queryClient.Account(cmd.Context(), &types.QueryAccountRequest{Address: key.String()}) if err != nil { return err } diff --git a/x/bank/client/cli/query.go b/x/bank/client/cli/query.go index fbb9ba438..a192c8deb 100644 --- a/x/bank/client/cli/query.go +++ b/x/bank/client/cli/query.go @@ -74,11 +74,10 @@ Example: if err != nil { return err } - + ctx := cmd.Context() if denom == "" { params := types.NewQueryAllBalancesRequest(addr, pageReq) - - res, err := queryClient.AllBalances(cmd.Context(), params) + res, err := queryClient.AllBalances(ctx, params) if err != nil { return err } @@ -86,7 +85,7 @@ Example: } params := types.NewQueryBalanceRequest(addr, denom) - res, err := queryClient.Balance(cmd.Context(), params) + res, err := queryClient.Balance(ctx, params) if err != nil { return err } @@ -183,9 +182,9 @@ To query for the total supply of a specific coin denomination use: } queryClient := types.NewQueryClient(clientCtx) - + ctx := cmd.Context() if denom == "" { - res, err := queryClient.TotalSupply(cmd.Context(), &types.QueryTotalSupplyRequest{}) + res, err := queryClient.TotalSupply(ctx, &types.QueryTotalSupplyRequest{}) if err != nil { return err } @@ -193,7 +192,7 @@ To query for the total supply of a specific coin denomination use: return clientCtx.PrintProto(res) } - res, err := queryClient.SupplyOf(cmd.Context(), &types.QuerySupplyOfRequest{Denom: denom}) + res, err := queryClient.SupplyOf(ctx, &types.QuerySupplyOfRequest{Denom: denom}) if err != nil { return err } diff --git a/x/bank/client/testutil/cli_helpers.go b/x/bank/client/testutil/cli_helpers.go index 0f1b848cb..e36f3744a 100644 --- a/x/bank/client/testutil/cli_helpers.go +++ b/x/bank/client/testutil/cli_helpers.go @@ -1,7 +1,6 @@ package testutil import ( - "context" "fmt" "github.com/spf13/cobra" @@ -59,7 +58,7 @@ ignored as it is implied from [from_key_or_address].`, msg := types.NewMsgSend(clientCtx.GetFromAddress(), toAddr, coins) svcMsgClientConn := &msgservice.ServiceMsgClientConn{} bankMsgClient := types.NewMsgClient(svcMsgClientConn) - _, err = bankMsgClient.Send(context.Background(), msg) + _, err = bankMsgClient.Send(cmd.Context(), msg) if err != nil { return err } diff --git a/x/distribution/client/cli/query.go b/x/distribution/client/cli/query.go index 3b6032ce7..aa087f5f8 100644 --- a/x/distribution/client/cli/query.go +++ b/x/distribution/client/cli/query.go @@ -1,7 +1,6 @@ package cli import ( - "context" "fmt" "strconv" "strings" @@ -50,7 +49,7 @@ func GetCmdQueryParams() *cobra.Command { } queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.Params(context.Background(), &types.QueryParamsRequest{}) + res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) if err != nil { return err } @@ -94,7 +93,7 @@ $ %s query distribution validator-outstanding-rewards %s1lwjmdnks33xwnmfayc64ycp } res, err := queryClient.ValidatorOutstandingRewards( - context.Background(), + cmd.Context(), &types.QueryValidatorOutstandingRewardsRequest{ValidatorAddress: validatorAddr.String()}, ) if err != nil { @@ -139,7 +138,7 @@ $ %s query distribution commission %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj } res, err := queryClient.ValidatorCommission( - context.Background(), + cmd.Context(), &types.QueryValidatorCommissionRequest{ValidatorAddress: validatorAddr.String()}, ) if err != nil { @@ -199,7 +198,7 @@ $ %s query distribution slashes %svaloper1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj } res, err := queryClient.ValidatorSlashes( - context.Background(), + cmd.Context(), &types.QueryValidatorSlashesRequest{ ValidatorAddress: validatorAddr.String(), StartingHeight: startHeight, @@ -252,6 +251,7 @@ $ %s query distribution rewards %s1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p %s1ggh } // query for rewards from a particular delegation + ctx := cmd.Context() if len(args) == 2 { validatorAddr, err := sdk.ValAddressFromBech32(args[1]) if err != nil { @@ -259,7 +259,7 @@ $ %s query distribution rewards %s1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p %s1ggh } res, err := queryClient.DelegationRewards( - context.Background(), + ctx, &types.QueryDelegationRewardsRequest{DelegatorAddress: delegatorAddr.String(), ValidatorAddress: validatorAddr.String()}, ) if err != nil { @@ -270,7 +270,7 @@ $ %s query distribution rewards %s1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p %s1ggh } res, err := queryClient.DelegationTotalRewards( - context.Background(), + ctx, &types.QueryDelegationTotalRewardsRequest{DelegatorAddress: delegatorAddr.String()}, ) if err != nil { @@ -307,7 +307,7 @@ $ %s query distribution community-pool } queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.CommunityPool(context.Background(), &types.QueryCommunityPoolRequest{}) + res, err := queryClient.CommunityPool(cmd.Context(), &types.QueryCommunityPoolRequest{}) if err != nil { return err } diff --git a/x/distribution/client/cli/tx.go b/x/distribution/client/cli/tx.go index d62bcd21f..dcf5a3b05 100644 --- a/x/distribution/client/cli/tx.go +++ b/x/distribution/client/cli/tx.go @@ -1,7 +1,6 @@ package cli import ( - "context" "fmt" "strings" @@ -155,7 +154,7 @@ $ %s tx distribution withdraw-all-rewards --from mykey } queryClient := types.NewQueryClient(clientCtx) - delValsRes, err := queryClient.DelegatorValidators(context.Background(), &types.QueryDelegatorValidatorsRequest{DelegatorAddress: delAddr.String()}) + delValsRes, err := queryClient.DelegatorValidators(cmd.Context(), &types.QueryDelegatorValidatorsRequest{DelegatorAddress: delAddr.String()}) if err != nil { return err } diff --git a/x/gov/client/cli/query.go b/x/gov/client/cli/query.go index 8c67cd96e..b382f540e 100644 --- a/x/gov/client/cli/query.go +++ b/x/gov/client/cli/query.go @@ -1,7 +1,6 @@ package cli import ( - "context" "fmt" "strconv" "strings" @@ -74,7 +73,7 @@ $ %s query gov proposal 1 // Query the proposal res, err := queryClient.Proposal( - context.Background(), + cmd.Context(), &types.QueryProposalRequest{ProposalId: proposalID}, ) if err != nil { @@ -149,7 +148,7 @@ $ %s query gov proposals --page=2 --limit=100 } res, err := queryClient.Proposals( - context.Background(), + cmd.Context(), &types.QueryProposalsRequest{ ProposalStatus: proposalStatus, Voter: bechVoterAddr, @@ -208,8 +207,9 @@ $ %s query gov vote 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk } // check to see if the proposal is in the store + ctx := cmd.Context() _, err = queryClient.Proposal( - context.Background(), + ctx, &types.QueryProposalRequest{ProposalId: proposalID}, ) if err != nil { @@ -222,7 +222,7 @@ $ %s query gov vote 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk } res, err := queryClient.Vote( - context.Background(), + ctx, &types.QueryVoteRequest{ProposalId: proposalID, Voter: args[1]}, ) if err != nil { @@ -282,8 +282,9 @@ $ %[1]s query gov votes 1 --page=2 --limit=100 } // check to see if the proposal is in the store + ctx := cmd.Context() proposalRes, err := queryClient.Proposal( - context.Background(), + ctx, &types.QueryProposalRequest{ProposalId: proposalID}, ) if err != nil { @@ -315,7 +316,7 @@ $ %[1]s query gov votes 1 --page=2 --limit=100 } res, err := queryClient.Votes( - context.Background(), + ctx, &types.QueryVotesRequest{ProposalId: proposalID, Pagination: pageReq}, ) @@ -364,8 +365,9 @@ $ %s query gov deposit 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk } // check to see if the proposal is in the store + ctx := cmd.Context() _, err = queryClient.Proposal( - context.Background(), + ctx, &types.QueryProposalRequest{ProposalId: proposalID}, ) if err != nil { @@ -378,7 +380,7 @@ $ %s query gov deposit 1 cosmos1skjwj5whet0lpe65qaq4rpq03hjxlwd9nf39lk } res, err := queryClient.Deposit( - context.Background(), + ctx, &types.QueryDepositRequest{ProposalId: proposalID, Depositor: args[1]}, ) if err != nil { @@ -434,8 +436,9 @@ $ %s query gov deposits 1 } // check to see if the proposal is in the store + ctx := cmd.Context() proposalRes, err := queryClient.Proposal( - context.Background(), + ctx, &types.QueryProposalRequest{ProposalId: proposalID}, ) if err != nil { @@ -464,7 +467,7 @@ $ %s query gov deposits 1 } res, err := queryClient.Deposits( - context.Background(), + ctx, &types.QueryDepositsRequest{ProposalId: proposalID, Pagination: pageReq}, ) @@ -512,8 +515,9 @@ $ %s query gov tally 1 } // check to see if the proposal is in the store + ctx := cmd.Context() _, err = queryClient.Proposal( - context.Background(), + ctx, &types.QueryProposalRequest{ProposalId: proposalID}, ) if err != nil { @@ -522,7 +526,7 @@ $ %s query gov tally 1 // Query store res, err := queryClient.TallyResult( - context.Background(), + ctx, &types.QueryTallyResultRequest{ProposalId: proposalID}, ) if err != nil { @@ -561,8 +565,9 @@ $ %s query gov params queryClient := types.NewQueryClient(clientCtx) // Query store for all 3 params + ctx := cmd.Context() votingRes, err := queryClient.Params( - context.Background(), + ctx, &types.QueryParamsRequest{ParamsType: "voting"}, ) if err != nil { @@ -570,7 +575,7 @@ $ %s query gov params } tallyRes, err := queryClient.Params( - context.Background(), + ctx, &types.QueryParamsRequest{ParamsType: "tallying"}, ) if err != nil { @@ -578,7 +583,7 @@ $ %s query gov params } depositRes, err := queryClient.Params( - context.Background(), + ctx, &types.QueryParamsRequest{ParamsType: "deposit"}, ) if err != nil { @@ -626,7 +631,7 @@ $ %s query gov param deposit // Query store res, err := queryClient.Params( - context.Background(), + cmd.Context(), &types.QueryParamsRequest{ParamsType: args[0]}, ) if err != nil { diff --git a/x/ibc/applications/transfer/client/cli/query.go b/x/ibc/applications/transfer/client/cli/query.go index 7d281bb41..b9658e05a 100644 --- a/x/ibc/applications/transfer/client/cli/query.go +++ b/x/ibc/applications/transfer/client/cli/query.go @@ -1,7 +1,6 @@ package cli import ( - "context" "fmt" "github.com/spf13/cobra" @@ -31,7 +30,7 @@ func GetCmdQueryDenomTrace() *cobra.Command { Hash: args[0], } - res, err := queryClient.DenomTrace(context.Background(), req) + res, err := queryClient.DenomTrace(cmd.Context(), req) if err != nil { return err } @@ -69,7 +68,7 @@ func GetCmdQueryDenomTraces() *cobra.Command { Pagination: pageReq, } - res, err := queryClient.DenomTraces(context.Background(), req) + res, err := queryClient.DenomTraces(cmd.Context(), req) if err != nil { return err } @@ -98,7 +97,7 @@ func GetCmdParams() *cobra.Command { } queryClient := types.NewQueryClient(clientCtx) - res, _ := queryClient.Params(context.Background(), &types.QueryParamsRequest{}) + res, _ := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) return clientCtx.PrintProto(res.Params) }, } diff --git a/x/ibc/core/02-client/client/cli/query.go b/x/ibc/core/02-client/client/cli/query.go index 7c49b12e0..c1b5e51a0 100644 --- a/x/ibc/core/02-client/client/cli/query.go +++ b/x/ibc/core/02-client/client/cli/query.go @@ -1,7 +1,6 @@ package cli import ( - "context" "errors" "fmt" @@ -44,7 +43,7 @@ func GetCmdQueryClientStates() *cobra.Command { Pagination: pageReq, } - res, err := queryClient.ClientStates(context.Background(), req) + res, err := queryClient.ClientStates(cmd.Context(), req) if err != nil { return err } @@ -118,7 +117,7 @@ func GetCmdQueryConsensusStates() *cobra.Command { Pagination: pageReq, } - res, err := queryClient.ConsensusStates(context.Background(), req) + res, err := queryClient.ConsensusStates(cmd.Context(), req) if err != nil { return err } @@ -250,7 +249,7 @@ func GetCmdParams() *cobra.Command { } queryClient := types.NewQueryClient(clientCtx) - res, _ := queryClient.ClientParams(context.Background(), &types.QueryClientParamsRequest{}) + res, _ := queryClient.ClientParams(cmd.Context(), &types.QueryClientParamsRequest{}) return clientCtx.PrintProto(res.Params) }, } diff --git a/x/ibc/core/03-connection/client/cli/query.go b/x/ibc/core/03-connection/client/cli/query.go index 071410398..21c4bd8f5 100644 --- a/x/ibc/core/03-connection/client/cli/query.go +++ b/x/ibc/core/03-connection/client/cli/query.go @@ -1,7 +1,6 @@ package cli import ( - "context" "fmt" "github.com/spf13/cobra" @@ -39,7 +38,7 @@ func GetCmdQueryConnections() *cobra.Command { Pagination: pageReq, } - res, err := queryClient.Connections(context.Background(), req) + res, err := queryClient.Connections(cmd.Context(), req) if err != nil { return err } diff --git a/x/ibc/core/04-channel/client/cli/query.go b/x/ibc/core/04-channel/client/cli/query.go index 5d059c08c..03df474f1 100644 --- a/x/ibc/core/04-channel/client/cli/query.go +++ b/x/ibc/core/04-channel/client/cli/query.go @@ -1,7 +1,6 @@ package cli import ( - "context" "fmt" "strconv" @@ -44,7 +43,7 @@ func GetCmdQueryChannels() *cobra.Command { Pagination: pageReq, } - res, err := queryClient.Channels(context.Background(), req) + res, err := queryClient.Channels(cmd.Context(), req) if err != nil { return err } @@ -118,7 +117,7 @@ func GetCmdQueryConnectionChannels() *cobra.Command { Pagination: pageReq, } - res, err := queryClient.ConnectionChannels(context.Background(), req) + res, err := queryClient.ConnectionChannels(cmd.Context(), req) if err != nil { return err } @@ -189,7 +188,7 @@ func GetCmdQueryPacketCommitments() *cobra.Command { Pagination: pageReq, } - res, err := queryClient.PacketCommitments(context.Background(), req) + res, err := queryClient.PacketCommitments(cmd.Context(), req) if err != nil { return err } @@ -357,7 +356,7 @@ The return value represents: PacketCommitmentSequences: seqs, } - res, err := queryClient.UnreceivedPackets(context.Background(), req) + res, err := queryClient.UnreceivedPackets(cmd.Context(), req) if err != nil { return err } @@ -407,7 +406,7 @@ The return value represents: PacketAckSequences: seqs, } - res, err := queryClient.UnreceivedAcks(context.Background(), req) + res, err := queryClient.UnreceivedAcks(cmd.Context(), req) if err != nil { return err } diff --git a/x/mint/client/cli/query.go b/x/mint/client/cli/query.go index cce0d7c12..792fa8a67 100644 --- a/x/mint/client/cli/query.go +++ b/x/mint/client/cli/query.go @@ -1,7 +1,6 @@ package cli import ( - "context" "fmt" "github.com/spf13/cobra" @@ -45,7 +44,7 @@ func GetCmdQueryParams() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) params := &types.QueryParamsRequest{} - res, err := queryClient.Params(context.Background(), params) + res, err := queryClient.Params(cmd.Context(), params) if err != nil { return err @@ -75,7 +74,7 @@ func GetCmdQueryInflation() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) params := &types.QueryInflationRequest{} - res, err := queryClient.Inflation(context.Background(), params) + res, err := queryClient.Inflation(cmd.Context(), params) if err != nil { return err @@ -105,7 +104,7 @@ func GetCmdQueryAnnualProvisions() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) params := &types.QueryAnnualProvisionsRequest{} - res, err := queryClient.AnnualProvisions(context.Background(), params) + res, err := queryClient.AnnualProvisions(cmd.Context(), params) if err != nil { return err diff --git a/x/params/client/cli/query.go b/x/params/client/cli/query.go index 516ff3b6b..ce7b45d06 100644 --- a/x/params/client/cli/query.go +++ b/x/params/client/cli/query.go @@ -1,8 +1,6 @@ package cli import ( - "context" - "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" @@ -41,7 +39,7 @@ func NewQuerySubspaceParamsCmd() *cobra.Command { queryClient := proposal.NewQueryClient(clientCtx) params := proposal.QueryParamsRequest{Subspace: args[0], Key: args[1]} - res, err := queryClient.Params(context.Background(), ¶ms) + res, err := queryClient.Params(cmd.Context(), ¶ms) if err != nil { return err } diff --git a/x/slashing/client/cli/query.go b/x/slashing/client/cli/query.go index d55b33201..6cb2f803d 100644 --- a/x/slashing/client/cli/query.go +++ b/x/slashing/client/cli/query.go @@ -1,7 +1,6 @@ package cli import ( - "context" "strings" "github.com/spf13/cobra" @@ -58,7 +57,7 @@ $ query slashing signing-info cosmosvalconspub1zcjduepqfhvwcmt7p06fvdgexx consAddr := sdk.ConsAddress(pk.Address()) params := &types.QuerySigningInfoRequest{ConsAddress: consAddr.String()} - res, err := queryClient.SigningInfo(context.Background(), params) + res, err := queryClient.SigningInfo(cmd.Context(), params) if err != nil { return err } @@ -95,7 +94,7 @@ $ query slashing signing-infos } params := &types.QuerySigningInfosRequest{Pagination: pageReq} - res, err := queryClient.SigningInfos(context.Background(), params) + res, err := queryClient.SigningInfos(cmd.Context(), params) if err != nil { return err } @@ -128,7 +127,7 @@ $ query slashing params queryClient := types.NewQueryClient(clientCtx) params := &types.QueryParamsRequest{} - res, err := queryClient.Params(context.Background(), params) + res, err := queryClient.Params(cmd.Context(), params) if err != nil { return err } diff --git a/x/staking/client/cli/query.go b/x/staking/client/cli/query.go index 1e8b0a5c5..7bf3ae41c 100644 --- a/x/staking/client/cli/query.go +++ b/x/staking/client/cli/query.go @@ -1,7 +1,6 @@ package cli import ( - "context" "fmt" "strconv" "strings" @@ -115,7 +114,7 @@ $ %s query staking validators return err } - result, err := queryClient.Validators(context.Background(), &types.QueryValidatorsRequest{ + result, err := queryClient.Validators(cmd.Context(), &types.QueryValidatorsRequest{ // Leaving status empty on purpose to query all validators. Pagination: pageReq, }) @@ -172,7 +171,7 @@ $ %s query staking unbonding-delegations-from %s1gghjut3ccd8ay0zduzj64hwre2fxs9l Pagination: pageReq, } - res, err := queryClient.ValidatorUnbondingDelegations(context.Background(), params) + res, err := queryClient.ValidatorUnbondingDelegations(cmd.Context(), params) if err != nil { return err } @@ -227,7 +226,7 @@ $ %s query staking redelegations-from %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj Pagination: pageReq, } - res, err := queryClient.Redelegations(context.Background(), params) + res, err := queryClient.Redelegations(cmd.Context(), params) if err != nil { return err } @@ -282,7 +281,7 @@ $ %s query staking delegation %s1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p %s1gghju ValidatorAddr: valAddr.String(), } - res, err := queryClient.Delegation(context.Background(), params) + res, err := queryClient.Delegation(cmd.Context(), params) if err != nil { return err } @@ -336,7 +335,7 @@ $ %s query staking delegations %s1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p Pagination: pageReq, } - res, err := queryClient.DelegatorDelegations(context.Background(), params) + res, err := queryClient.DelegatorDelegations(cmd.Context(), params) if err != nil { return err } @@ -391,7 +390,7 @@ $ %s query staking delegations-to %s1gghjut3ccd8ay0zduzj64hwre2fxs9ldmqhffj Pagination: pageReq, } - res, err := queryClient.ValidatorDelegations(context.Background(), params) + res, err := queryClient.ValidatorDelegations(cmd.Context(), params) if err != nil { return err } @@ -447,7 +446,7 @@ $ %s query staking unbonding-delegation %s1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9 ValidatorAddr: valAddr.String(), } - res, err := queryClient.UnbondingDelegation(context.Background(), params) + res, err := queryClient.UnbondingDelegation(cmd.Context(), params) if err != nil { return err } @@ -501,7 +500,7 @@ $ %s query staking unbonding-delegations %s1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru Pagination: pageReq, } - res, err := queryClient.DelegatorUnbondingDelegations(context.Background(), params) + res, err := queryClient.DelegatorUnbondingDelegations(cmd.Context(), params) if err != nil { return err } @@ -563,7 +562,7 @@ $ %s query staking redelegation %s1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p %s1l2r SrcValidatorAddr: valSrcAddr.String(), } - res, err := queryClient.Redelegations(context.Background(), params) + res, err := queryClient.Redelegations(cmd.Context(), params) if err != nil { return err } @@ -617,7 +616,7 @@ $ %s query staking redelegation %s1gghjut3ccd8ay0zduzj64hwre2fxs9ld75ru9p Pagination: pageReq, } - res, err := queryClient.Redelegations(context.Background(), params) + res, err := queryClient.Redelegations(cmd.Context(), params) if err != nil { return err } @@ -660,7 +659,7 @@ $ %s query staking historical-info 5 } params := &types.QueryHistoricalInfoRequest{Height: height} - res, err := queryClient.HistoricalInfo(context.Background(), params) + res, err := queryClient.HistoricalInfo(cmd.Context(), params) if err != nil { return err @@ -697,7 +696,7 @@ $ %s query staking pool } queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.Pool(context.Background(), &types.QueryPoolRequest{}) + res, err := queryClient.Pool(cmd.Context(), &types.QueryPoolRequest{}) if err != nil { return err } @@ -733,7 +732,7 @@ $ %s query staking params } queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.Params(context.Background(), &types.QueryParamsRequest{}) + res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) if err != nil { return err } diff --git a/x/upgrade/client/cli/query.go b/x/upgrade/client/cli/query.go index 675dba3a9..39674cbc7 100644 --- a/x/upgrade/client/cli/query.go +++ b/x/upgrade/client/cli/query.go @@ -1,7 +1,6 @@ package cli import ( - "context" "fmt" "github.com/spf13/cobra" @@ -41,7 +40,7 @@ func GetCurrentPlanCmd() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) params := types.QueryCurrentPlanRequest{} - res, err := queryClient.CurrentPlan(context.Background(), ¶ms) + res, err := queryClient.CurrentPlan(cmd.Context(), ¶ms) if err != nil { return err } @@ -74,9 +73,9 @@ func GetAppliedPlanCmd() *cobra.Command { return err } queryClient := types.NewQueryClient(clientCtx) - + ctx := cmd.Context() params := types.QueryAppliedPlanRequest{Name: args[0]} - res, err := queryClient.AppliedPlan(context.Background(), ¶ms) + res, err := queryClient.AppliedPlan(ctx, ¶ms) if err != nil { return err } @@ -90,7 +89,7 @@ func GetAppliedPlanCmd() *cobra.Command { if err != nil { return err } - headers, err := node.BlockchainInfo(context.Background(), res.Height, res.Height) + headers, err := node.BlockchainInfo(ctx, res.Height, res.Height) if err != nil { return err }