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

Logging: Typo in try_from_magic #404

Closed
4TT1L4 opened this issue Aug 30, 2022 · 0 comments · Fixed by #405
Closed

Logging: Typo in try_from_magic #404

4TT1L4 opened this issue Aug 30, 2022 · 0 comments · Fixed by #405

Comments

@4TT1L4
Copy link
Contributor

4TT1L4 commented Aug 30, 2022

Problem:

  • The error message has a typo in the try_from_magic function in the Pipeline-wide utilities (mod.rs).
  • The rustdoc of the method is also out-dated.

The following error is logged, when the chain could not be identified based on the provided magic value:
ERROR: "can't infer well-known chain infro from specified magic"

Please notice the typo: infro instead of info.

Solution:

  • Fix the error message.
  • Update the rustdoc of the try_from_magic function.

Version:
67b01e8 (main)

Code snippet with the described issues:

oura/src/utils/mod.rs

Lines 155 to 166 in 4de19ee

/// Uses the value of the magic to return either mainnet or testnet
/// hardcoded values.
pub fn try_from_magic(magic: u64) -> Result<ChainWellKnownInfo, Error> {
match magic {
MAINNET_MAGIC => Ok(Self::mainnet()),
TESTNET_MAGIC => Ok(Self::testnet()),
PREVIEW_MAGIC => Ok(Self::preview()),
PREPROD_MAGIC => Ok(Self::preprod()),
_ => Err("can't infer well-known chain infro from specified magic".into()),
}
}
}

4TT1L4 added a commit to 4TT1L4/oura that referenced this issue Aug 30, 2022
4TT1L4 added a commit to 4TT1L4/oura that referenced this issue Aug 30, 2022
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 a pull request may close this issue.

1 participant