-
Notifications
You must be signed in to change notification settings - Fork 649
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
Require voted entity exists (issue #143) #348
Require voted entity exists (issue #143) #348
Conversation
const auto& committee_idx = db.get_index_type<committee_member_index>().indices().get<by_vote_id>(); | ||
const auto& witness_idx = db.get_index_type<witness_index>().indices().get<by_vote_id>(); | ||
for ( auto id : options.votes ) { | ||
switch ( id ) { |
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.
I think the switch should operate on id.type()
Of course you may. Thank for taking up the task! |
I've modified!
Tested by using original func and vote for non-exist entities as follows.
|
Good job, thanks! |
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.
Please rename the constant to HARDFORK_CORE_143_TIME to make it clear that the number refers to the bitshares-core issue.
I'm sorry for being too late. I've fixed it. |
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.
No worries - thanks!
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.
sorry for the delay. everything looks good, code looks good, test cases also good.
made the same tests as @pmconrad and getting the same results. approved.
This PR is work in progress, compilable but have not yet been tested.
I think this simple validation may prevent voting for non-existent entity. (#143)
And also we should check that all votes are unique.(account_options.votes
is aflat_set
so uniqueness check is unnecessary. )May I go on with this plan?