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 deserialize power field in validator_update #451

Merged
merged 1 commit into from
Jul 17, 2020

Conversation

yihuang
Copy link
Contributor

@yihuang yihuang commented Jul 17, 2020

When removing validator, the power field is set to zero and ignored in json format.

@@ -192,6 +192,7 @@ pub struct Update {
pub pub_key: PublicKey,

/// New voting power
#[serde(default)]
Copy link
Member

Choose a reason for hiding this comment

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

Ouch, thanks! I'm wondering if there shouldn't be two test cases (one with power and one without) instead of one. This is all so brittle :-/ We do not test all edge cases well. ref #303

Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

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

Thanks!

@liamsi liamsi merged commit d541e5c into informalsystems:master Jul 17, 2020
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.

2 participants