Skip to content
Merged
Show file tree
Hide file tree
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
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
3 changes: 3 additions & 0 deletions crates/common/src/provider/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,9 @@ impl ProviderBuilder {
client.set_poll_interval(
chain
.average_blocktime_hint()
// we cap the poll interval because if not provided, chain would default to
// mainnet
.map(|hint| hint.min(DEFAULT_UNKNOWN_CHAIN_BLOCK_TIME))
.unwrap_or(DEFAULT_UNKNOWN_CHAIN_BLOCK_TIME)
.mul_f32(POLL_INTERVAL_BLOCK_TIME_SCALE_FACTOR),
);
Expand Down
2 changes: 1 addition & 1 deletion crates/forge/tests/cli/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ Ran 1 test suite [ELAPSED]: 1 tests passed, 0 failed, 0 skipped (1 total tests)

// test that `forge build` does not print `(with warnings)` if file path is ignored
forgetest!(can_compile_without_warnings_ignored_file_paths, |prj, cmd| {
// Ignoring path and setting empty error_codes as default would set would set some error codes
// Ignoring path and setting empty error_codes as default would set some error codes
prj.update_config(|config| {
config.ignored_file_paths = vec![Path::new("src").to_path_buf()];
config.ignored_error_codes = vec![];
Expand Down
2 changes: 1 addition & 1 deletion crates/script/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ impl PreprocessedState {

let mut target_id: Option<ArtifactId> = None;

// Find target artfifact id by name and path in compilation artifacts.
// Find target artifact id by name and path in compilation artifacts.
for (id, contract) in output.artifact_ids().filter(|(id, _)| id.source == target_path) {
if let Some(name) = &target_name {
if id.name != *name {
Expand Down
2 changes: 1 addition & 1 deletion crates/script/src/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl VerifyBundle {
.to_string(),
};

// We strip the build metadadata information, since it can lead to
// We strip the build metadata information, since it can lead to
// etherscan not identifying it correctly. eg:
// `v0.8.10+commit.fc410830.Linux.gcc` != `v0.8.10+commit.fc410830`
let version = Version::new(
Expand Down
2 changes: 1 addition & 1 deletion crates/sol-macro-gen/src/sol_macro_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl MultiSolMacroGen {

pub fn populate_expansion(&mut self, bindings_path: &Path) -> Result<()> {
for instance in &mut self.instances {
let path = bindings_path.join(format!("{}.rs", instance.name.to_lowercase()));
let path = bindings_path.join(format!("{}.rs", instance.name.to_snake_case()));
let expansion = fs::read_to_string(path).wrap_err("Failed to read file")?;

let tokens = TokenStream::from_str(&expansion)
Expand Down
2 changes: 1 addition & 1 deletion crates/wallets/src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl WalletOpts {
let key_name = get_env("GCP_NAME")?;
let key_version = get_env("GCP_KEY_VERSION")?
.parse()
.map_err(|_| eyre::eyre!("GCP_KEY_VERSION could not be be parsed into u64"))?;
.map_err(|_| eyre::eyre!("GCP_KEY_VERSION could not be parsed into u64"))?;
WalletSigner::from_gcp(project_id, location, keyring, key_name, key_version).await?
} else if let Some(raw_wallet) = self.raw.signer()? {
raw_wallet
Expand Down
Loading