-
Notifications
You must be signed in to change notification settings - Fork 249
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
syncing: refactor with tuple type #298
Conversation
this allows to get rid of the pairs of fields, and just have three fields in syncing::Status. found out that one cannot use deny_unknown_fields within an untagged tree, but the syncing::Status is only needs deserialize for testing.
this should make it less stressful not to have the deny_unknown_fields.
not really sure if this is a good idea. but we cannot have the flattened fields with deny_extra_fields.
a9f3424
to
6b37f81
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.
Great, it's much more expressive this way!
(TIL: serde_with::with_prefix! )
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.
LGTM
(though I haven't built/run myself)
let latest_num = block.block_number.unwrap(); | ||
let latest = { | ||
let latest_hash = block.block_hash.unwrap(); | ||
let latest_num = block.block_number.unwrap(); |
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 cannot see any regression test for the latest_num
being updated. I know it seems a bit silly because that was an easy fix, but we still don't have an automated way of making sure it won't happen again in the future.
Generally I recall seeing at least another fix in the past to a regression that was not accompanied by a respective test, however now I don't remember which concrete fix it was. I think we should put more stress on tests when regressions pop up.
Refactor avoid another field modified issues in the future.