diff --git a/CHANGELOG.md b/CHANGELOG.md index 544af38bef46..5fcd2a9310fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -312,6 +312,7 @@ extension interfaces. `module.Manager.Modules` is now of type `map[string]interf * (server) [#13778](https://github.com/cosmos/cosmos-sdk/pull/13778) Set Cosmos SDK default endpoints to localhost to avoid unknown exposure of endpoints. * (x/auth) [#13877](https://github.com/cosmos/cosmos-sdk/pull/13877) Fix account number handling during `InitGenesis`. * (cli) [#14509](https://github.com/cosmos/cosmos-sdk/pull/14509) Added missing options to keyring-backend flag usage +* [#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 ### Deprecated diff --git a/client/grpc/cmtservice/util.go b/client/grpc/cmtservice/util.go index cabde56b08ce..3572a6218533 100644 --- a/client/grpc/cmtservice/util.go +++ b/client/grpc/cmtservice/util.go @@ -21,18 +21,18 @@ func convertHeader(h cmtprototypes.Header) Header { EvidenceHash: h.EvidenceHash, LastResultsHash: h.LastResultsHash, LastCommitHash: h.LastCommitHash, - ProposerAddress: sdk.ValAddress(h.ProposerAddress).String(), + ProposerAddress: sdk.ConsAddress(h.ProposerAddress).String(), } } // convertBlock converts CometBFT block to sdk block -func convertBlock(tmblock *cmtprototypes.Block) *Block { +func convertBlock(cmtblock *cmtprototypes.Block) *Block { b := new(Block) - b.Header = convertHeader(tmblock.Header) - b.LastCommit = tmblock.LastCommit - b.Data = tmblock.Data - b.Evidence = tmblock.Evidence + b.Header = convertHeader(cmtblock.Header) + b.LastCommit = cmtblock.LastCommit + b.Data = cmtblock.Data + b.Evidence = cmtblock.Evidence return b } diff --git a/tests/e2e/client/grpc/cmtservice/service_test.go b/tests/e2e/client/grpc/cmtservice/service_test.go index 7f181cfb9ccc..48010f625b5a 100644 --- a/tests/e2e/client/grpc/cmtservice/service_test.go +++ b/tests/e2e/client/grpc/cmtservice/service_test.go @@ -92,8 +92,8 @@ func (s *E2ETestSuite) TestQueryLatestBlock() { s.Require().NoError(err) var blockInfoRes cmtservice.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 *E2ETestSuite) TestQueryBlockByHeight() { @@ -105,7 +105,7 @@ func (s *E2ETestSuite) TestQueryBlockByHeight() { s.Require().NoError(err) var blockInfoRes cmtservice.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 *E2ETestSuite) TestQueryLatestValidatorSet() {