Skip to content

Commit

Permalink
fix: Change proposer address cast for sdk_block conversion (backport
Browse files Browse the repository at this point in the history
…#15243) (#15245)

Co-authored-by: Maksym Hontar <99190705+max-hontar@users.noreply.github.com>
Co-authored-by: Julien Robert <julien@rbrt.fr>
  • Loading branch information
3 people authored Mar 2, 2023
1 parent f1ec5fe commit 1229bd1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Bug Fixes

* [#15243](https://github.com/cosmos/cosmos-sdk/pull/15243) `LatestBlockResponse` & `BlockByHeightResponse` types' field `sdk_block` was incorrectly cast `proposer_address` bytes to validator operator address, now to consensus address.
* (snapshot) [#13400](https://github.com/cosmos/cosmos-sdk/pull/13400) Fix snapshot checksum issue in Go 1.19.

## [v0.46.10](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.10) - 2022-02-16
Expand Down
6 changes: 3 additions & 3 deletions client/grpc/tmservice/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ func (s *IntegrationTestSuite) TestQueryLatestBlock() {
s.Require().NoError(err)
var blockInfoRes tmservice.GetLatestBlockResponse
s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(restRes, &blockInfoRes))
s.Require().Equal(types.ValAddress(blockInfoRes.Block.Header.ProposerAddress).String(), blockInfoRes.SdkBlock.Header.ProposerAddress)
s.Require().Contains(blockInfoRes.SdkBlock.Header.ProposerAddress, "cosmosvaloper")
s.Require().Equal(types.ConsAddress(blockInfoRes.Block.Header.ProposerAddress).String(), blockInfoRes.SdkBlock.Header.ProposerAddress)
s.Require().Contains(blockInfoRes.SdkBlock.Header.ProposerAddress, "cosmosvalcons")
}

func (s *IntegrationTestSuite) TestQueryBlockByHeight() {
Expand All @@ -101,7 +101,7 @@ func (s *IntegrationTestSuite) TestQueryBlockByHeight() {
s.Require().NoError(err)
var blockInfoRes tmservice.GetBlockByHeightResponse
s.Require().NoError(val.ClientCtx.Codec.UnmarshalJSON(restRes, &blockInfoRes))
s.Require().Contains(blockInfoRes.SdkBlock.Header.ProposerAddress, "cosmosvaloper")
s.Require().Contains(blockInfoRes.SdkBlock.Header.ProposerAddress, "cosmosvalcons")
}

func (s *IntegrationTestSuite) TestQueryLatestValidatorSet() {
Expand Down
2 changes: 1 addition & 1 deletion client/grpc/tmservice/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func convertHeader(h tmprototypes.Header) Header {
EvidenceHash: h.EvidenceHash,
LastResultsHash: h.LastResultsHash,
LastCommitHash: h.LastCommitHash,
ProposerAddress: sdk.ValAddress(h.ProposerAddress).String(),
ProposerAddress: sdk.ConsAddress(h.ProposerAddress).String(),
}
}

Expand Down

0 comments on commit 1229bd1

Please sign in to comment.