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

feat: account ID refactor additional methods #1039

Merged
merged 4 commits into from
Dec 26, 2024
Merged

Conversation

tomyrd
Copy link
Collaborator

@tomyrd tomyrd commented Dec 26, 2024

This PR adds two small quality of life methods to AccountIdPrefix and BlockHeader. Both stemming from comments in this review.

@@ -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 {
Copy link
Collaborator

@igamigo igamigo Dec 26, 2024

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.

Copy link
Collaborator Author

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

Copy link
Collaborator

@igamigo igamigo left a 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.

Copy link
Contributor

@bobbinth bobbinth left a 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!

@bobbinth
Copy link
Contributor

@tomyrd - could you also add a changelog entry?

@bobbinth bobbinth merged commit 487e8b9 into next Dec 26, 2024
9 checks passed
@bobbinth bobbinth deleted the tomyrd-account-id-followup branch December 26, 2024 19:35
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.

3 participants