Skip to content

Commit

Permalink
fix: remove index in finalize block events (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
troykessler authored Oct 21, 2024
1 parent 7692633 commit 2fb33c2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions integrations/tendermint/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 2fb33c2

Please sign in to comment.