Our Forest node leverages RPC types for building a JSON-RPC API. To improve the robustness and clarity of these types, we propose adding decorators that enforce additional constraints on their format.
For instance, an EthHash type should be represented as a string containing 40 hexadecimal characters, prefixed with "0x", matching a given regex pattern (e.g., ^0x[a-fA-F0-9]{40}$). This would ensure consistency and help prevent incorrect data.
Acceptance Criteria
Following Forest types are making use of constraints and forest-tool shed openrpc can generate them:
EthInt64
EthHash
BlockHash
EthBytes
Bloom
EthAddress
Resources
https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-00#rfc.section.6.3
https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-00#numeric
Our Forest node leverages RPC types for building a JSON-RPC API. To improve the robustness and clarity of these types, we propose adding decorators that enforce additional constraints on their format.
For instance, an
EthHashtype should be represented as a string containing 40 hexadecimal characters, prefixed with "0x", matching a given regex pattern (e.g.,^0x[a-fA-F0-9]{40}$). This would ensure consistency and help prevent incorrect data.Acceptance Criteria
Following Forest types are making use of constraints and
forest-tool shed openrpccan generate them:EthInt64EthHashBlockHashEthBytesBloomEthAddressResources
https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-00#rfc.section.6.3
https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-validation-00#numeric