-
Notifications
You must be signed in to change notification settings - Fork 65
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
feat: predicate validation #611
Conversation
removed - `cache_path`, `data_handler_tx`, and`ingestion_port` renamed - `display_logs` -> `display_stacks_ingestion_logs`
`*ChainhookFullSpecification` => `*ChainhookSpecificationNetworkMap` `*ChainhookNetworkSpecification` => `*ChainhookSpecification` `*ChainhookSpecification` => `*ChainhookInstance`
remove unnecessary wrapper around ChainhookStore
Looks to me like this fixes #610 |
@tippenein Not quite. The validation function for the regex does generate the regex, but we aren't actually mutating the original struct. We'd have to add another field to store the computed regex, and we'd also have to update this validate function to mutate the predicate to store this struct. I think where this gets tricky is that we also have to propagate this change from the This approach feels a bit messy to me, especially considering we'd be doing these mutations on a function called Maybe for #610 we can add a function like |
Description
This PR adds validation for predicates. The
ChainhookSpecificationNetworkMap::validate(&self)
method will now check each of the fields in a predicate that could have invalid data and return a string with all of the errors separated by a"\n"
.I'm open to other ways of formatting the returned errors, but I think it will be nice for users to see everything that is wrong with their spec in the first use rather than being given just the first error.
Example
Here is an example result:
Checklist