-
Notifications
You must be signed in to change notification settings - Fork 0
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
[MTG-758] [MTG-802] Rectify close_voter ix #41
Conversation
4bf71b5
to
da0769f
Compare
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.
With this change we definitely need to document, what should be sent. It's quite counterintuitive to pass in all the possible associated token accounts. Also extending the number of voting mints might make closing the registrar nearly impossible, but that's smth we should just write in comments. Also I'd say we should restrict the positions of the accounts being closed. So we have several voting mints that are not zeroed. And the first remaining account should be for the first non-zeroed voting mint. The second - for the second and so on. This way may have a linear complexity instead of quadratic.
… reduce computations complexity
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.
Great job! Looks like some redundant checks are there.
|
||
for (index, calculated_ata_to_close) in calculated_atas_to_close.enumerate() { | ||
require!( |
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.
We've already checked this before. What might have changed?
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.
Tunnel vision. Thanks!
To close
voter
and itsATA
an end-user need to pass in allATA
gathered from mints of aRegistrar
; even if thoseATA
don't exist, their addresses may still be calculated.