Merge pull request #1664 from cosmos/ResultBlockResults-comet0.38

[Bugfix] replace comet38 begin/end_block_events with finalize_block_events (2)
This commit is contained in:
Simon Warta 2025-06-12 15:22:59 +02:00 committed by GitHub
commit 04fc4ff39c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 11 additions and 9 deletions

View File

@ -6,8 +6,14 @@ and this project adheres to
## [Unreleased]
- Replaxe axios with cross-fetch ([#1645])
### Changed
- Replaxe axios with cross-fetch ([#1645])
- Fix block events in CometBFT 0.38 API (`begin_block_events`/`end_block_events`
-> `finalize_block_events`) in `RpcBlockResultsResponse` and
`BlockResultsResponse` ([#1612])
[#1612]: https://github.com/cosmos/cosmjs/pull/1612
[#1645]: https://github.com/cosmos/cosmjs/pull/1645
## [0.33.1] - 2025-03-12

View File

@ -287,8 +287,7 @@ export function decodeValidatorUpdate(data: RpcValidatorUpdate): responses.Valid
interface RpcBlockResultsResponse {
readonly height: string;
readonly txs_results: readonly RpcTxData[] | null;
readonly begin_block_events: readonly RpcEvent[] | null;
readonly end_block_events: readonly RpcEvent[] | null;
readonly finalize_block_events: readonly RpcEvent[] | null;
readonly validator_updates: readonly RpcValidatorUpdate[] | null;
readonly consensus_param_updates: RpcConsensusParams | null;
}
@ -299,8 +298,7 @@ function decodeBlockResults(data: RpcBlockResultsResponse): responses.BlockResul
results: (data.txs_results || []).map(decodeTxData),
validatorUpdates: (data.validator_updates || []).map(decodeValidatorUpdate),
consensusUpdates: may(decodeConsensusParams, data.consensus_param_updates),
beginBlockEvents: decodeEvents(data.begin_block_events || []),
endBlockEvents: decodeEvents(data.end_block_events || []),
finalizeBlockEvents: decodeEvents(data.finalize_block_events || []),
};
}

View File

@ -261,8 +261,7 @@ function defaultTestSuite(rpcFactory: () => RpcClient, expected: ExpectedValues)
const results = await client.blockResults(height);
expect(results.height).toEqual(height);
expect(results.results).toEqual([]);
expect(results.beginBlockEvents).toEqual([]);
expect(results.endBlockEvents).toEqual([]);
expect(results.finalizeBlockEvents).toEqual([]);
client.disconnect();
});

View File

@ -60,8 +60,7 @@ export interface BlockResultsResponse {
readonly results: readonly TxData[];
readonly validatorUpdates: readonly ValidatorUpdate[];
readonly consensusUpdates?: ConsensusParams;
readonly beginBlockEvents: readonly Event[];
readonly endBlockEvents: readonly Event[];
readonly finalizeBlockEvents: readonly Event[];
}
export interface BlockSearchResponse {