refactor: replace comet38 begin/end_block_events with finalize_block_events

This commit is contained in:
Bryan White 2024-10-18 21:54:27 +02:00 committed by Simon Warta
parent fcd79e92c5
commit 6c3c873635
No known key found for this signature in database
3 changed files with 4 additions and 8 deletions

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 {