Skip to content

Commit 2af2f02

Browse files
authored
chore: aggregate PRs (#11384)
* chore: aggregate PRs This PR aggregates changes from the following PRs: - Closes #11145 by @\Galoretka - Closes #11320 by @\ANtutov - Closes #11379 by @\bethoffman * pr 11294
1 parent e1d12ce commit 2af2f02

File tree

7 files changed

+12
-8
lines changed

7 files changed

+12
-8
lines changed

crates/cast/src/cmd/wallet/vanity.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,15 +193,16 @@ pub fn find_vanity_address_with_nonce<T: VanityMatcher>(
193193
wallet_generator().find_any(create_nonce_matcher(matcher, nonce)).map(|(key, _)| key.into())
194194
}
195195

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

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

crates/common/src/provider/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,9 @@ impl ProviderBuilder {
328328
client.set_poll_interval(
329329
chain
330330
.average_blocktime_hint()
331+
// we cap the poll interval because if not provided, chain would default to
332+
// mainnet
333+
.map(|hint| hint.min(DEFAULT_UNKNOWN_CHAIN_BLOCK_TIME))
331334
.unwrap_or(DEFAULT_UNKNOWN_CHAIN_BLOCK_TIME)
332335
.mul_f32(POLL_INTERVAL_BLOCK_TIME_SCALE_FACTOR),
333336
);

crates/forge/tests/cli/cmd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,7 @@ Ran 1 test suite [ELAPSED]: 1 tests passed, 0 failed, 0 skipped (1 total tests)
11141114

11151115
// test that `forge build` does not print `(with warnings)` if file path is ignored
11161116
forgetest!(can_compile_without_warnings_ignored_file_paths, |prj, cmd| {
1117-
// Ignoring path and setting empty error_codes as default would set would set some error codes
1117+
// Ignoring path and setting empty error_codes as default would set some error codes
11181118
prj.update_config(|config| {
11191119
config.ignored_file_paths = vec![Path::new("src").to_path_buf()];
11201120
config.ignored_error_codes = vec![];

crates/script/src/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ impl PreprocessedState {
193193

194194
let mut target_id: Option<ArtifactId> = None;
195195

196-
// Find target artfifact id by name and path in compilation artifacts.
196+
// Find target artifact id by name and path in compilation artifacts.
197197
for (id, contract) in output.artifact_ids().filter(|(id, _)| id.source == target_path) {
198198
if let Some(name) = &target_name {
199199
if id.name != *name {

crates/script/src/verify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ impl VerifyBundle {
131131
.to_string(),
132132
};
133133

134-
// We strip the build metadadata information, since it can lead to
134+
// We strip the build metadata information, since it can lead to
135135
// etherscan not identifying it correctly. eg:
136136
// `v0.8.10+commit.fc410830.Linux.gcc` != `v0.8.10+commit.fc410830`
137137
let version = Version::new(

crates/sol-macro-gen/src/sol_macro_gen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl MultiSolMacroGen {
6060

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

6666
let tokens = TokenStream::from_str(&expansion)

crates/wallets/src/wallet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl WalletOpts {
111111
let key_name = get_env("GCP_NAME")?;
112112
let key_version = get_env("GCP_KEY_VERSION")?
113113
.parse()
114-
.map_err(|_| eyre::eyre!("GCP_KEY_VERSION could not be be parsed into u64"))?;
114+
.map_err(|_| eyre::eyre!("GCP_KEY_VERSION could not be parsed into u64"))?;
115115
WalletSigner::from_gcp(project_id, location, keyring, key_name, key_version).await?
116116
} else if let Some(raw_wallet) = self.raw.signer()? {
117117
raw_wallet

0 commit comments

Comments
 (0)