-
Notifications
You must be signed in to change notification settings - Fork 690
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 spam prevention antehandler #2262
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2262 +/- ##
==========================================
- Coverage 84.76% 83.83% -0.93%
==========================================
Files 21 22 +1
Lines 1483 1540 +57
==========================================
+ Hits 1257 1291 +34
- Misses 181 201 +20
- Partials 45 48 +3
|
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.
Nice work @MSalopek! LGTM
Done, tests are up to date. |
* add spam prevention antehandler * sort imports * run make format * fix misleading var names * update wrong test cases * fix failing gov tests * fix linter errors * uncomment e2e gov steps logs (cherry picked from commit 23d9f67)
* add spam prevention antehandler * sort imports * run make format * fix misleading var names * update wrong test cases * fix failing gov tests * fix linter errors * uncomment e2e gov steps logs (cherry picked from commit 23d9f67) Co-authored-by: MSalopek <[email protected]>
for _, v := range execMsg.Msgs { | ||
var innerMsg sdk.Msg | ||
if err := g.cdc.UnpackAny(v, &innerMsg); err != nil { | ||
return sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "cannot unmarshal authz exec msgs") | ||
} |
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.
@MSalopek Sorry to ask after the merge, but couldn't this code be simplified by calling MsgExec.GetMessages()
?
This PR adds governance spam prevention antehandler and minimal testing.
Earlier, a github member opened a PR which they closed after receiving feedback:
The changes were modelled after:
Closes: #2246