Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add schema validation for call-block-logs and zora #281

Merged
merged 4 commits into from
Sep 19, 2022
Merged

Conversation

il3ven
Copy link
Contributor

@il3ven il3ven commented Sep 17, 2022

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 the result is validated against the provided schema. 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 a uri 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:

  • Add schema property to message neume-network/schema

@TimDaub
Copy link
Collaborator

TimDaub commented Sep 19, 2022

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.

I wonder if we should put all of these separate in a sem versioned repository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants