Fix BondStatusString values

This commit is contained in:
Simon Warta 2022-06-13 12:02:45 +02:00
parent 06a16dea03
commit 24f6c0f5f0
2 changed files with 15 additions and 1 deletions

View File

@ -6,6 +6,13 @@ and this project adheres to
## [Unreleased] ## [Unreleased]
### Fixed
- @cosmjs/stargate: Fix valid values of `BondStatusString` for `validators`
query ([#1170]).
[#1170]: https://github.com/cosmos/cosmjs/issues/1170
## [0.28.6] - 2022-06-08 ## [0.28.6] - 2022-06-08
## [0.28.5] - 2022-06-08 ## [0.28.5] - 2022-06-08

View File

@ -21,7 +21,14 @@ import Long from "long";
import { createPagination, createProtobufRpcClient, QueryClient } from "../../queryclient"; import { createPagination, createProtobufRpcClient, QueryClient } from "../../queryclient";
export type BondStatusString = Exclude<keyof typeof BondStatus, "BOND_STATUS_UNSPECIFIED">; // It's an enum in Go and a string in the protobuf API. "BOND_STATUS_UNSPECIFIED"
// is excluded and "" is supported instead 🤷.
//
// String values: https://github.com/cosmos/cosmos-sdk/blob/v0.45.5/x/staking/types/staking.pb.go#L57-L62
// Validation: https://github.com/cosmos/cosmos-sdk/blob/v0.45.5/x/staking/keeper/grpc_query.go#L29-L32
export type BondStatusString =
| keyof Pick<typeof BondStatus, "BOND_STATUS_BONDED" | "BOND_STATUS_UNBONDED" | "BOND_STATUS_UNBONDING">
| "";
export interface StakingExtension { export interface StakingExtension {
readonly staking: { readonly staking: {