Skip to content

Commit 04fc4ff

Browse files
authored
Merge pull request #1664 from cosmos/ResultBlockResults-comet0.38
[Bugfix] replace comet38 begin/end_block_events with finalize_block_events (2)
2 parents fcd79e9 + f1478f7 commit 04fc4ff

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ and this project adheres to
66

77
## [Unreleased]
88

9+
### Changed
10+
911
- Replaxe axios with cross-fetch ([#1645])
12+
- Fix block events in CometBFT 0.38 API (`begin_block_events`/`end_block_events`
13+
-> `finalize_block_events`) in `RpcBlockResultsResponse` and
14+
`BlockResultsResponse` ([#1612])
1015

16+
[#1612]: https://github.com/cosmos/cosmjs/pull/1612
1117
[#1645]: https://github.com/cosmos/cosmjs/pull/1645
1218

1319
## [0.33.1] - 2025-03-12

packages/tendermint-rpc/src/comet38/adaptor/responses.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,7 @@ export function decodeValidatorUpdate(data: RpcValidatorUpdate): responses.Valid
287287
interface RpcBlockResultsResponse {
288288
readonly height: string;
289289
readonly txs_results: readonly RpcTxData[] | null;
290-
readonly begin_block_events: readonly RpcEvent[] | null;
291-
readonly end_block_events: readonly RpcEvent[] | null;
290+
readonly finalize_block_events: readonly RpcEvent[] | null;
292291
readonly validator_updates: readonly RpcValidatorUpdate[] | null;
293292
readonly consensus_param_updates: RpcConsensusParams | null;
294293
}
@@ -299,8 +298,7 @@ function decodeBlockResults(data: RpcBlockResultsResponse): responses.BlockResul
299298
results: (data.txs_results || []).map(decodeTxData),
300299
validatorUpdates: (data.validator_updates || []).map(decodeValidatorUpdate),
301300
consensusUpdates: may(decodeConsensusParams, data.consensus_param_updates),
302-
beginBlockEvents: decodeEvents(data.begin_block_events || []),
303-
endBlockEvents: decodeEvents(data.end_block_events || []),
301+
finalizeBlockEvents: decodeEvents(data.finalize_block_events || []),
304302
};
305303
}
306304

packages/tendermint-rpc/src/comet38/comet38client.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,7 @@ function defaultTestSuite(rpcFactory: () => RpcClient, expected: ExpectedValues)
261261
const results = await client.blockResults(height);
262262
expect(results.height).toEqual(height);
263263
expect(results.results).toEqual([]);
264-
expect(results.beginBlockEvents).toEqual([]);
265-
expect(results.endBlockEvents).toEqual([]);
264+
expect(results.finalizeBlockEvents).toEqual([]);
266265

267266
client.disconnect();
268267
});

packages/tendermint-rpc/src/comet38/responses.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ export interface BlockResultsResponse {
6060
readonly results: readonly TxData[];
6161
readonly validatorUpdates: readonly ValidatorUpdate[];
6262
readonly consensusUpdates?: ConsensusParams;
63-
readonly beginBlockEvents: readonly Event[];
64-
readonly endBlockEvents: readonly Event[];
63+
readonly finalizeBlockEvents: readonly Event[];
6564
}
6665

6766
export interface BlockSearchResponse {

0 commit comments

Comments
 (0)