-
Notifications
You must be signed in to change notification settings - Fork 198
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
Fix validation (supports v0-2 in v0.8) #2539
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2539 +/- ##
==========================================
+ Coverage 73.49% 73.51% +0.02%
==========================================
Files 136 136
Lines 16657 16661 +4
==========================================
+ Hits 12242 12249 +7
+ Misses 3547 3544 -3
Partials 868 868 ☔ View full report in Codecov by Sentry. |
Which issue? |
|
||
// Only enforce resource bounds validation for version 0x3 | ||
if version == "0x3" || version == "0x100000000000000000000000000000003" { | ||
return req.ResourceBounds != nil && len(*req.ResourceBounds) == 3 | ||
} | ||
|
||
// Allow earlier versions without resource bounds | ||
return true | ||
} |
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.
Nitpick: Return the condition instantly:
// Only enforce resource bounds validation for version 0x3 | |
if version == "0x3" || version == "0x100000000000000000000000000000003" { | |
return req.ResourceBounds != nil && len(*req.ResourceBounds) == 3 | |
} | |
// Allow earlier versions without resource bounds | |
return true | |
} | |
// Only enforce resource bounds validation for version 0x3 | |
return version != "0x3" && version != "0x100000000000000000000000000000003" || | |
(req.ResourceBounds != nil && len(*req.ResourceBounds) == 3) |
This PR resolves an issue in which the
resource_bounds_required
validation was misapplied to v0-2 transactions.