Skip to content

Commit

Permalink
Merge branch 'fix-BondStatusString-0.28' into 0.28
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaster128 committed Jun 14, 2022
2 parents 9f4eca3 + 24f6c0f commit c613490
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ and this project adheres to

## [Unreleased]

### Fixed

- @cosmjs/stargate: Fix valid values of `BondStatusString` for `validators`
query ([#1170]).

[#1170]: https://github.com/cosmos/cosmjs/issues/1170

### Changed

- @cosmjs/proto-signing, @cosmjs/cosmwasm-stargate: Turn `protobufjs` into a
Expand Down
9 changes: 8 additions & 1 deletion packages/stargate/src/modules/staking/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ import Long from "long";

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 {
readonly staking: {
Expand Down

0 comments on commit c613490

Please sign in to comment.