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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions rpc/tests/support/block_results.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@
"pub_key": {
"type": "ed25519",
"data": "AmPqEmF5YNmlv2vu8lEcDeQ3hyR+lymnqx2VixdMEzA="
},
"power": "12681"
}
}
],
"consensus_param_updates": null
Expand Down
1 change: 1 addition & 0 deletions tendermint/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

pub power: vote::Power,
}

Expand Down