-
Notifications
You must be signed in to change notification settings - Fork 57
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
feat: account ID refactor additional methods #1039
Conversation
objects/src/block/header.rs
Outdated
@@ -186,6 +186,11 @@ impl BlockHeader { | |||
self.timestamp | |||
} | |||
|
|||
/// Returns the block number of the epoch block to which this block belongs. | |||
pub fn get_epoch_block_num(&self) -> u32 { |
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 I'd just name this epoch_block_num()
since it's a very basic computation over the block num (and also it would be analogous to BlockHeader::block_epoch()
).
EDIT: Just saw that the original comment suggested the current naming. If we follow that maybe block_epoch
could also have get_
as a prefix? It's a minor detail so no worries either way.
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 first suggestion matches better with the rest of the methods in BlockHeader
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! Left a minor comment, but feel free to disregard.
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.
Looks good! Thank you!
@tomyrd - could you also add a changelog entry? |
This PR adds two small quality of life methods to
AccountIdPrefix
andBlockHeader
. Both stemming from comments in this review.