Skip to content

fix: improve accuracy of vanity wallet function comments #11145

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions crates/cast/src/cmd/wallet/vanity.rs

Choose a reason for hiding this comment

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

updates

Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,16 @@ pub fn find_vanity_address_with_nonce<T: VanityMatcher>(
wallet_generator().find_any(create_nonce_matcher(matcher, nonce)).map(|(key, _)| key.into())
}

/// Creates a nonce matcher function, which takes a reference to a [GeneratedWallet] and returns
/// Creates a matcher function, which takes a reference to a [GeneratedWallet] and returns
/// whether it found a match or not by using `matcher`.
#[inline]
pub fn create_matcher<T: VanityMatcher>(matcher: T) -> impl Fn(&GeneratedWallet) -> bool {
move |(_, addr)| matcher.is_match(addr)
}

/// Creates a nonce matcher function, which takes a reference to a [GeneratedWallet] and a nonce and
/// returns whether it found a match or not by using `matcher`.
/// Creates a contract address matcher function that uses the specified nonce.
/// The returned function takes a reference to a [GeneratedWallet] and returns
/// whether the contract address created with the nonce matches using `matcher`.
#[inline]
pub fn create_nonce_matcher<T: VanityMatcher>(
matcher: T,
Expand Down
Loading