Skip to content

Commit

Permalink
chore: update tendermint schema (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
troykessler authored Sep 13, 2024
1 parent 87aadf0 commit 39ce37f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions integrations/tendermint/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface IAttribute {

interface IEvent {
type: string;
attributes: IAttribute[];
attributes?: IAttribute[];
}

export default class Tendermint implements IRuntime {
Expand Down Expand Up @@ -174,7 +174,7 @@ export default class Tendermint implements IRuntime {
if (item.value.block_results.begin_block_events) {
item.value.block_results.begin_block_events =
item.value.block_results.begin_block_events.map((event: IEvent) => {
event.attributes = event.attributes
event.attributes = (event.attributes || [])
.sort(compareEventAttribute)
.map(({ index, ...attribute }: IAttribute) => attribute);
return event;
Expand All @@ -185,7 +185,7 @@ export default class Tendermint implements IRuntime {
if (item.value.block_results.end_block_events) {
item.value.block_results.end_block_events =
item.value.block_results.end_block_events.map((event: IEvent) => {
event.attributes = event.attributes
event.attributes = (event.attributes || [])
.sort(compareEventAttribute)
.map(({ index, ...attribute }: IAttribute) => attribute);
return event;
Expand All @@ -201,7 +201,7 @@ export default class Tendermint implements IRuntime {
if (tx_result.events) {
tx_result.events = tx_result.events.map((event: IEvent) => {
// sort attributes in txs_results
event.attributes = event.attributes
event.attributes = (event.attributes || [])
.sort(compareEventAttribute)
.map(({ index, ...attribute }: IAttribute) => attribute);

Expand Down
6 changes: 3 additions & 3 deletions integrations/tendermint/src/schemas/block_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
]
}
},
"required": ["type", "attributes"]
"required": ["type"]
}
]
},
Expand Down Expand Up @@ -109,7 +109,7 @@
]
}
},
"required": ["type", "attributes"]
"required": ["type"]
}
]
},
Expand Down Expand Up @@ -143,7 +143,7 @@
]
}
},
"required": ["type", "attributes"]
"required": ["type"]
}
]
},
Expand Down

0 comments on commit 39ce37f

Please sign in to comment.