Skip to content
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: check allowedList size in StakeAuthorization.Accept #726

Merged
merged 3 commits into from
Oct 18, 2022

Conversation

dudong2
Copy link
Contributor

@dudong2 dudong2 commented Oct 17, 2022

Description

Currently, only one of AllowedList and DenyList can be set in the structure of StakeAuthorization.
There is a structural problem that causes Accept func to always fail when DenyList is set.
Check the size of the AllowedList together with the isValidatorExists check.

ref. cosmos/cosmos-sdk#11391

closes: #725

Motivation and context

How has this been tested?

Screenshots (if appropriate):

Checklist:

  • I followed the contributing guidelines and code of conduct.
  • I have added a relevant changelog to CHANGELOG.md
  • I have added tests to cover my changes.
  • I have updated the documentation accordingly.
  • I have updated API documentation client/docs/swagger-ui/swagger.yaml

@dudong2 dudong2 added the A: bug Something isn't working label Oct 17, 2022
@dudong2 dudong2 self-assigned this Oct 17, 2022
@codecov
Copy link

codecov bot commented Oct 17, 2022

Codecov Report

Merging #726 (06964c1) into main (00ab960) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #726   +/-   ##
=======================================
  Coverage   61.89%   61.89%           
=======================================
  Files         874      874           
  Lines       98638    98638           
=======================================
+ Hits        61048    61053    +5     
+ Misses      33966    33957    -9     
- Partials     3624     3628    +4     
Impacted Files Coverage Δ
x/staking/types/authz.go 87.00% <100.00%> (ø)
x/collection/msgs.go 35.37% <0.00%> (-1.30%) ⬇️
x/token/msgs.go 34.51% <0.00%> (+6.09%) ⬆️

@dudong2 dudong2 merged commit 502bfd7 into Finschia:main Oct 18, 2022
@dudong2 dudong2 deleted the dudong2/fix/AUT01 branch October 18, 2022 03:04
@zemyblue zemyblue mentioned this pull request Oct 27, 2022
5 tasks
@zemyblue zemyblue mentioned this pull request Nov 28, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check allowedList size in StakeAuthorization.Accept
3 participants