add schema validation for call-block-logs and zora #281
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR validates schema for call-block-logs, zora-call-tokenuri, zora-call-tokenmetadatauri, and zora-get-tokenuri. If a
schema
property is provided in message then theresult
is validated against the providedschema
. In case the schema isn't valid the message gets logged and ignored by the lifecycle.For json-rpc calls the schema has been taken from ethereum-json-rpc-specification. For zora-get-tokenuri I have created the schema by looking at the response and tested it against the existing data of music-os-accumulator.
The schema for zora-get-tokenuri is not strict i.e. it can have new fields not mentioned in the schema and there won't be an error. The schema mainly checks if a property is present then it should be of correct type. For example,
body.artwork.info
is not required but if it is present then it should contain auri
field with a valid URI.I wanted to test schemas in the wild before adding them to all the strategies. Hence, this PR excludes sound.
Note to self:
schema
property to message neume-network/schema