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

set-to-jail-from-inactive #2322

Merged
merged 3 commits into from
Sep 26, 2020
Merged

Conversation

sasurobert
Copy link
Contributor

set to jailed when account is inactive and with infinite unstaked epoch after jailing is enabled.

}

if peerAccount.GetUnStakedEpoch() == core.DefaultUnstakedEpoch && peerAccount.GetList() == string(core.InactiveList) {
peerAccount.SetListAndIndex(validator.ShardId, string(core.JailedList), validator.Index)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same set here and in line 669. Why not extract both conditions in shouldBeJailed variable and reduce the code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not exactly the same. Would leave as it is

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is only 1 line of code.

return
}

if peerAccount.GetUnStakedEpoch() == core.DefaultUnstakedEpoch && peerAccount.GetList() == string(core.InactiveList) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for the validator.List == string (core.JailedList) ? Could it be not jailed in validator.List and still want to set it to jailed based on the new condition?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for the scenario when in old code it was set to inactive, and should have been set to jailed

Copy link
Contributor

@LucianMincu LucianMincu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

System tests passed.

@LucianMincu LucianMincu merged commit 17109e1 into development Sep 26, 2020
@LucianMincu LucianMincu deleted the set-to-jail-from-inactive branch September 26, 2020 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants