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 equihash code #1357

Merged
merged 2 commits into from
Apr 19, 2024
Merged

Refactor equihash code #1357

merged 2 commits into from
Apr 19, 2024

Conversation

str4d
Copy link
Contributor

@str4d str4d commented Apr 18, 2024

Move-only; my main motivation is moving the minimal-encoding functions into a separate submodule, so that the inverse functions introduced in #1083 can also be placed there (with round-trip tests and proptests).

Copy link

@arya2 arya2 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!

}

impl Params {
/// Returns `None` if the parameters are invalid.
Copy link

@arya2 arya2 Apr 19, 2024

Choose a reason for hiding this comment

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

Optional/Nitpick: Could the docs be more verbose, maybe with a reference to where and/or how the parameters are used?

Suggested change
/// Returns `None` if the parameters are invalid.
/// Accepts `n` and `k` values to use as Equihash parameters.
///
/// Returns a new instance of [`Params`] if the provided values are valid, or
/// `None` if the parameters are invalid.

Copy link
Contributor Author

@str4d str4d Apr 19, 2024

Choose a reason for hiding this comment

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

The doc change here was just to clarify the change from Error (there is only one "error" case here, and Error is about verification errors, so I transitioned these to Option). I've opened #1358 for the general case of documenting the crate-private methods.

@str4d str4d merged commit 5df164b into main Apr 19, 2024
24 checks passed
@str4d str4d deleted the equihash-refactor-code branch April 19, 2024 01:59
Copy link
Contributor

@daira daira left a comment

Choose a reason for hiding this comment

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

Post-hoc ACK

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.

4 participants