Skip to content

Commit

Permalink
fix(registry): schema conformance
Browse files Browse the repository at this point in the history
Fix the usage of `exclusiveMinimum`:

Ffor the “chainId”, “blocks.estimateBlockTime”, “grpcUrls.concurrency”, “retry.maxRequests”, and “retry.baseRetryMs”), the keyword `exclusiveMinimum` is given a numeric value. In JSON Schema draft‑07 the `exclusiveMinimum` keyword is of type boolean, and is used with a separate `minimum` value as this enforces a strict inequality.
  • Loading branch information
sambacha authored Feb 6, 2025
1 parent f68c693 commit d766279
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions chains/schema.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$ref": "#/definitions/hyperlaneChainMetadata",
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"hyperlaneChainMetadata": {
"type": "object",
Expand Down Expand Up @@ -63,7 +63,8 @@
"anyOf": [
{
"type": "integer",
"minimum": 0
"minimum": 0,
"description": "A number of blocks before a transaction has a near-zero chance of reverting or block tag."
},
{
"type": "string"
Expand All @@ -73,7 +74,8 @@
},
"estimateBlockTime": {
"type": "number",
"exclusiveMinimum": 0,
"minimum": 0,
"exclusiveMinimum": true,
"description": "Rough estimate of time per block in seconds."
}
},
Expand All @@ -87,7 +89,9 @@
"anyOf": [
{
"type": "integer",
"exclusiveMinimum": 0
"minimum": 0,
"exclusiveMinimum": true,
"description": "Integer chainId must be greater than 0."
},
{
"type": "string"
Expand Down Expand Up @@ -133,7 +137,8 @@
},
"domainId": {
"type": "integer",
"exclusiveMinimum": 0,
"minimum": 0,
"exclusiveMinimum": true,
"description": "The domainId of the chain, should generally default to `chainId`. Consumer of `ChainMetadata` should use this value or `name` as a unique identifier."
},
"gasCurrencyCoinGeckoId": {
Expand All @@ -156,7 +161,8 @@
},
"concurrency": {
"type": "integer",
"exclusiveMinimum": 0,
"minimum": 0,
"exclusiveMinimum": true,
"description": "Maximum number of concurrent RPC requests."
},
"webSocket": {
Expand All @@ -176,7 +182,7 @@
},
"maxBlockAge": {
"$ref": "#/definitions/hyperlaneChainMetadata/properties/chainId/anyOf/0",
"description": "The relative different from latest block that this RPC supports."
"description": "The relative difference from latest block that this RPC supports."
}
},
"additionalProperties": false,
Expand All @@ -187,12 +193,14 @@
"properties": {
"maxRequests": {
"type": "integer",
"exclusiveMinimum": 0,
"minimum": 0,
"exclusiveMinimum": true,
"description": "The maximum number of requests to attempt before failing."
},
"baseRetryMs": {
"type": "integer",
"exclusiveMinimum": 0,
"minimum": 0,
"exclusiveMinimum": true,
"description": "The base retry delay in milliseconds."
}
},
Expand Down Expand Up @@ -247,7 +255,9 @@
"decimals": {
"type": "integer",
"minimum": 0,
"exclusiveMaximum": 256
"maximum": 256,
"exclusiveMaximum": true,
"description": "The number of decimals (must be less than 256)."
},
"denom": {
"type": "string"
Expand Down Expand Up @@ -317,5 +327,9 @@
"additionalProperties": false
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}
"allOf": [
{
"$ref": "#/definitions/hyperlaneChainMetadata"
}
]
}

0 comments on commit d766279

Please sign in to comment.