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

refactor: expose get_epoch_id as a method of EpochManagerAdapter #7666

Merged
merged 1 commit into from
Sep 22, 2022

Conversation

matklad
Copy link
Contributor

@matklad matklad commented Sep 22, 2022

Part of #6910, depends on #7665

Previously, this was only available on NightshadeRuntime, but seems fine
to expose everywhere.

@@ -50,7 +50,10 @@ pub trait EpochManagerAdapter: Send + Sync {
fn get_next_epoch_id_from_prev_block(&self, parent_hash: &CryptoHash)
-> Result<EpochId, Error>;

/// Get epoch start for given block hash.
/// Get [`EpochId`] from a block belonging to the epoch.
fn get_epoch_id(&self, hash: &CryptoHash) -> Result<EpochId, Error>;
Copy link
Contributor

Choose a reason for hiding this comment

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

should we call the argument 'block_hash' rather than hash ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! I specifically wanted to make this consistent, but fixed only one of the three places!

Previously, this was only available on NightshadeRuntime, but seems fine
to expose everywhere.
@near-bulldozer near-bulldozer bot merged commit 9aa06b9 into near:master Sep 22, 2022
@matklad matklad deleted the m/em-7 branch September 22, 2022 17:26
nikurt pushed a commit that referenced this pull request Sep 26, 2022
Part of #6910, depends on #7665

Previously, this was only available on NightshadeRuntime, but seems fine
to expose everywhere.
nikurt pushed a commit that referenced this pull request Nov 9, 2022
Part of #6910, depends on #7665

Previously, this was only available on NightshadeRuntime, but seems fine
to expose everywhere.
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