-
Notifications
You must be signed in to change notification settings - Fork 14
feat: Enhance filter expression parsing and evaluation #222
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: Enhance filter expression parsing and evaluation #222
Conversation
…logical conditions, etc.
…g and case insensitivity
…ralValue for clarity, update parsing methods, move expression module to service folder
…or contains operators
…rely on alt order
…mproved expression handling
…Path for improved expression handling
…tional trait methods
@isSerge I'm thinking would it make sense to start the work on the follow-up PRs and review them individually but merge them all into this one before we merge into main? We're mainly just waiting for:
However, I think the latter you've already integrated, right? Btw, we're just waiting for @KitHat's review some time next week normally. |
@shahnami yes, Stellar key access is already there. Let me submit the rest |
@shahnami the thing is these are all implemented in my forked repo branches. I can consolidate all changes within my fork and include here, or can submit separate stacked PRs to the |
I see, okay, let's add them to this PR then |
…eppelin-monitor into enhance-filter-expr-parser
@shahnami I have included changes to handle array types, direct object (map) comparisons and return There are some integration tests failing occasionally: |
Hi @isSerge , can you check if this combination of expressions works for you on Stellar mainnet? For some reason, I am not able to test this specific case. event: Thanks! |
@NicoMolinaOZ I suspect the problem is this expression: |
Thanks for the response. I saw that we are having some issues parsing complex types for EVM functions and events. When you have an object like this: Thanks! |
Summary
This PR is an attempt to address issues discussed in #204
Key changes:
Introduction of
Expression
sub-module responsible for:winnow
crate)ConditionEvaluator
trait, evaluation errors, helpers)EVM and Stellar both have implementations of
ConditionEvaluator
(evaluator.rs
) responsible for:evaluate_expression
method in chain filters now only delegates parsing and evaluation to dedicated modulesBreaking changes:
"input contains '567890'"
RHS now has to be in single quotes to let parser now it's a string, otherwise it result in type mismatch errorarguments[0][1] == 20
is no longer valid. LHS has to be an identifier (can introduce keyword if this is crucial)Next steps:
evaluate_expression
to returnResult<bool, EvaluationError>
uint8[]
"1,2,3"
)0.2
If any of these is critical - let me know and I will include here. Otherwise I think there are already a lot of changes to review.
I haven't updated Antora docs yet, will add a commit once we discuss and confirm implementation.
Testing Process
Checklist