From b4882b76007f79297915cb395542bf10cca2b917 Mon Sep 17 00:00:00 2001 From: Troy Kessler Date: Tue, 15 Oct 2024 08:56:56 +0200 Subject: [PATCH] fix: remove index in finalize block events --- integrations/tendermint/src/runtime.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/integrations/tendermint/src/runtime.ts b/integrations/tendermint/src/runtime.ts index 4b43bc55..89343bc9 100644 --- a/integrations/tendermint/src/runtime.ts +++ b/integrations/tendermint/src/runtime.ts @@ -192,6 +192,17 @@ export default class Tendermint implements IRuntime { }); } + // sort attributes and remove index in finalize_block_events + if (item.value.block_results.finalize_block_events) { + item.value.block_results.finalize_block_events = + item.value.block_results.finalize_block_events.map((event: IEvent) => { + event.attributes = (event.attributes || []) + .sort(compareEventAttribute) + .map(({ index, ...attribute }: IAttribute) => attribute); + return event; + }); + } + if (item.value.block_results.txs_results) { item.value.block_results.txs_results = item.value.block_results.txs_results.map((tx_result: any) => {