Skip to content

Commit

Permalink
fix: support cometbft v0.38 block_results schema
Browse files Browse the repository at this point in the history
  • Loading branch information
troykessler committed Apr 16, 2024
1 parent 783e9b8 commit 10f4d44
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 5 deletions.
8 changes: 6 additions & 2 deletions integrations/tendermint/src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ export default class Tendermint implements IRuntime {

if (!block_validate(item.value.block)) {
throw new Error(
`Block schema validation failed: ${block_validate.errors}`
`Block schema validation failed: ${JSON.stringify(
block_validate.errors
)}`
);
}

Expand All @@ -114,7 +116,9 @@ export default class Tendermint implements IRuntime {

if (!block_results_validate(item.value.block_results)) {
throw new Error(
`Block results schema validation failed: ${block_results_validate.errors}`
`Block results schema validation failed: ${JSON.stringify(
block_results_validate.errors
)}`
);
}

Expand Down
38 changes: 35 additions & 3 deletions integrations/tendermint/src/schemas/block_result.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,40 @@
}
]
},
"finalize_block_events": {
"type": ["array", "null"],
"items": [
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"attributes": {
"type": "array",
"items": [
{
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": ["string", "null"]
},
"index": {
"type": "boolean"
}
},
"required": ["key", "value", "index"]
}
]
}
},
"required": ["type", "attributes"]
}
]
},
"validator_updates": {
"type": ["array", "null"],
"items": [
Expand Down Expand Up @@ -236,10 +270,8 @@
"required": [
"height",
"txs_results",
"begin_block_events",
"end_block_events",
"validator_updates",
"consensus_param_updates"
],
"additionalProperties": false
"additionalProperties": true
}

0 comments on commit 10f4d44

Please sign in to comment.