-
Notifications
You must be signed in to change notification settings - Fork 92
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
filter-plugin: Inner Txn support. #1487
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1487 +/- ##
===========================================
+ Coverage 65.39% 66.28% +0.89%
===========================================
Files 82 81 -1
Lines 11458 11260 -198
===========================================
- Hits 7493 7464 -29
+ Misses 3393 3226 -167
+ Partials 572 570 -2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Benchmark results
|
type stringEqualExpression struct { | ||
Str string | ||
} | ||
|
||
func (e *stringEqualExpression) Match(input interface{}) (bool, error) { | ||
switch v := input.(type) { | ||
case string: | ||
return e.Str == v, nil | ||
default: | ||
return false, fmt.Errorf("unexpected regex search input type (%T)", v) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously this was using a special regex expression. In benchmarks using string equals was 8-12% faster.
fields, errors := getFields(sdk.SignedTxnInBlock{}, ignoreTags) | ||
fields, errors := getFields(sdk.SignedTxnWithAD{}, ignoreTags) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched to SignedTxnWithAD
because that is the type used for inner transactions. This way the same lookup function is used for the root transaction and the inner transactions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Summary
SignedTxnWithAD
instead ofSignedTxnInBlock
.matches
function from SearchAndFilter to avoid duplicate code for operation types (any/all/none).Search
toMatch
for lowest level expressions.FilterType
toType
.Filter
from theFilter
constants, it is in their type.search
function in theSearcher
type. It now has an option to recursively search inner transactions for a match.Test Plan
New unit test.
Updated benchmarks.