Skip to content

Commit 47b17bb

Browse files
authored
chore: update toolchain (#7326)
1 parent 8d5187f commit 47b17bb

File tree

99 files changed

+273
-323
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+273
-323
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ concurrency:
1818
env:
1919
CARGO_TERM_COLOR: always
2020
RUST_BACKTRACE: full
21-
MIN_LANDERCOVERAGE_PERCENTAGE: 19
21+
MIN_LANDERCOVERAGE_PERCENTAGE: 15
2222
RUSTC_WRAPPER: sccache
2323

2424
jobs:

rust/main/agents/relayer/src/msg/message_processor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ async fn prepare_op(
702702
use PendingOperationStatus::Retry;
703703

704704
let status = Retry(reason.clone());
705-
let result = op.on_reprepare(Some(format!("{:?}", err)), reason);
705+
let result = op.on_reprepare(Some(format!("{err:?}")), reason);
706706
warn!(?err, ?status, ?result, msg);
707707
prepare_queue.push(op, Some(status)).await;
708708
}

rust/main/agents/relayer/src/msg/metadata/base.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,8 @@ where
246246
let nums: Vec<u8> = Vec::deserialize(deserializer)?;
247247
let mut set = HashSet::new();
248248
for num in nums {
249-
let module = ModuleType::from_u8(num).ok_or_else(|| {
250-
serde::de::Error::custom(format!("Invalid module type value: {}", num))
251-
})?;
249+
let module = ModuleType::from_u8(num)
250+
.ok_or_else(|| serde::de::Error::custom(format!("Invalid module type value: {num}")))?;
252251
set.insert(module);
253252
}
254253
Ok(set)
@@ -334,11 +333,11 @@ mod tests {
334333
cache_policy: IsmCachePolicy::IsmSpecific,
335334
};
336335

337-
assert_eq!(config.matches_chain("foochain"), true);
338-
assert_eq!(config.matches_chain("barchain"), false);
336+
assert!(config.matches_chain("foochain"));
337+
assert!(!config.matches_chain("barchain"));
339338

340-
assert_eq!(config.matches_module_type(ModuleType::Aggregation), true);
341-
assert_eq!(config.matches_module_type(ModuleType::Routing), false);
339+
assert!(config.matches_module_type(ModuleType::Aggregation));
340+
assert!(!config.matches_module_type(ModuleType::Routing));
342341
}
343342

344343
#[test]

rust/main/agents/relayer/src/msg/metadata/base_builder/validator_announced_storages.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ pub async fn fetch_storage_locations_helper(
6767

6868
/// Generates a cache key for a given validator.
6969
fn generate_cache_key(validator: &H256) -> String {
70-
format!("storage_location:{:?}", validator)
70+
format!("storage_location:{validator:?}")
7171
}
7272

7373
#[cfg(test)]

rust/main/agents/relayer/src/msg/metadata/base_builder/validator_announced_storages/tests.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ async fn test_fetch_storage_locations_helper_with_cache_hit() {
5757
let location1 = vec!["location1".to_string()];
5858
let location2 = vec!["location2".to_string()];
5959
cache
60-
.cache_call_result(&origin.name(), METHOD_NAME, &key1, &location1)
60+
.cache_call_result(origin.name(), METHOD_NAME, &key1, &location1)
6161
.await
6262
.unwrap();
6363
cache
64-
.cache_call_result(&origin.name(), METHOD_NAME, &key2, &location2)
64+
.cache_call_result(origin.name(), METHOD_NAME, &key2, &location2)
6565
.await
6666
.unwrap();
6767

@@ -145,11 +145,11 @@ async fn test_fetch_storage_locations_helper_with_partial_cache_hit() {
145145
let location1 = vec!["location1".to_string()];
146146
let location2 = vec!["location2".to_string()];
147147
cache
148-
.cache_call_result(&origin.name(), METHOD_NAME, &key1, &location1)
148+
.cache_call_result(origin.name(), METHOD_NAME, &key1, &location1)
149149
.await
150150
.unwrap();
151151
cache
152-
.cache_call_result(&origin.name(), METHOD_NAME, &key2, &location2)
152+
.cache_call_result(origin.name(), METHOD_NAME, &key2, &location2)
153153
.await
154154
.unwrap();
155155

@@ -194,14 +194,14 @@ async fn test_fetch_storage_locations_helper_with_different_domains() {
194194
// Prepopulate the cache with storage locations for origin1
195195
let location1 = vec!["location1_origin1".to_string()];
196196
cache
197-
.cache_call_result(&origin1.name(), METHOD_NAME, &key, &location1)
197+
.cache_call_result(origin1.name(), METHOD_NAME, &key, &location1)
198198
.await
199199
.unwrap();
200200

201201
// Prepopulate the cache with storage locations for origin2
202202
let location2 = vec!["location1_origin2".to_string()];
203203
cache
204-
.cache_call_result(&origin2.name(), METHOD_NAME, &key, &location2)
204+
.cache_call_result(origin2.name(), METHOD_NAME, &key, &location2)
205205
.await
206206
.unwrap();
207207

rust/main/agents/relayer/src/msg/metadata/ccip_read/mod.rs

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -138,18 +138,16 @@ impl CcipReadIsmMetadataBuilder {
138138
}
139139
Err(raw_error) => {
140140
let matching_regex = Regex::new(r"0x[[:xdigit:]]+").map_err(|err| {
141-
let msg = format!("Failed to parse regex: {}", err);
141+
let msg = format!("Failed to parse regex: {err}");
142142
MetadataBuildError::FailedToBuild(msg)
143143
})?;
144144
if let Some(matching) = &matching_regex.captures(&raw_error.to_string()) {
145145
let hex_val = hex_decode(&matching[0][2..]).map_err(|err| {
146-
let msg =
147-
format!("Failed to decode hex from ISM response: {}", err);
146+
let msg = format!("Failed to decode hex from ISM response: {err}");
148147
MetadataBuildError::FailedToBuild(msg)
149148
})?;
150149
OffchainLookup::decode(hex_val).map_err(|err| {
151-
let msg =
152-
format!("Failed to decode offchain lookup struct: {}", err);
150+
let msg = format!("Failed to decode offchain lookup struct: {err}");
153151
MetadataBuildError::FailedToBuild(msg)
154152
})?
155153
} else {
@@ -217,7 +215,7 @@ async fn metadata_build(
217215
.build_ccip_read_ism(ism_address)
218216
.await
219217
.map_err(|err| {
220-
let msg = format!("Failed to build CCIP read ISM: {}", err);
218+
let msg = format!("Failed to build CCIP read ISM: {err}");
221219
MetadataBuildError::FailedToBuild(msg)
222220
})?;
223221

@@ -282,10 +280,8 @@ async fn fetch_offchain_data(
282280
.send()
283281
.await
284282
.map_err(|err| {
285-
let msg = format!(
286-
"Failed to request offchain lookup server with post method: {}",
287-
err
288-
);
283+
let msg =
284+
format!("Failed to request offchain lookup server with post method: {err}");
289285
MetadataBuildError::FailedToBuild(msg)
290286
})?
291287
} else {
@@ -295,19 +291,14 @@ async fn fetch_offchain_data(
295291
.send()
296292
.await
297293
.map_err(|err| {
298-
let msg = format!(
299-
"Failed to request offchain lookup server with get method: {}",
300-
err
301-
);
294+
let msg =
295+
format!("Failed to request offchain lookup server with get method: {err}");
302296
MetadataBuildError::FailedToBuild(msg)
303297
})?
304298
};
305299

306300
let json: OffchainResponse = res.json().await.map_err(|err| {
307-
let error_msg = format!(
308-
"Failed to parse offchain lookup server json response: ({})",
309-
err
310-
);
301+
let error_msg = format!("Failed to parse offchain lookup server json response: ({err})");
311302
MetadataBuildError::FailedToBuild(error_msg)
312303
})?;
313304

rust/main/agents/relayer/src/msg/metadata/multisig/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ async fn metadata_build<T: MultisigIsmMetadataBuilder>(
239239
Ok(syncer) => syncer,
240240
Err(CheckpointSyncerBuildError::ReorgEvent(reorg_event)) => {
241241
let err =
242-
MetadataBuildError::Refused(format!("A reorg event occurred {:?}", reorg_event));
242+
MetadataBuildError::Refused(format!("A reorg event occurred {reorg_event:?}"));
243243
return Err(err);
244244
}
245245
Err(e) => {

rust/main/agents/relayer/src/msg/metadata/multisig/merkle_root_multisig.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,13 @@ mod tests {
121121

122122
let mut validators: Vec<_> = dummy_validators().drain(..).take(5).collect();
123123
validators[0].latest_index = Some(1010);
124-
validators[0].fetch_checkpoint = Some(checkpoint.clone());
124+
validators[0].fetch_checkpoint = Some(checkpoint);
125125
validators[1].latest_index = Some(1008);
126126
validators[2].latest_index = Some(1006);
127127
validators[3].latest_index = Some(1004);
128-
validators[3].fetch_checkpoint = Some(checkpoint.clone());
128+
validators[3].fetch_checkpoint = Some(checkpoint);
129129
validators[4].latest_index = Some(1002);
130-
validators[4].fetch_checkpoint = Some(checkpoint.clone());
130+
validators[4].fetch_checkpoint = Some(checkpoint);
131131

132132
let syncers = build_mock_checkpoint_syncs(&validators).await;
133133
let validator_addresses = validators
@@ -171,7 +171,7 @@ mod tests {
171171
.get_proof
172172
.lock()
173173
.unwrap()
174-
.push_back(Ok(proof.clone()));
174+
.push_back(Ok(proof));
175175

176176
let ism_address = H256::zero();
177177
let message = HyperlaneMessage::default();

rust/main/agents/relayer/src/msg/metadata/multisig/message_id_multisig.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,13 @@ mod tests {
153153

154154
let mut validators: Vec<_> = dummy_validators().drain(..).take(5).collect();
155155
validators[0].latest_index = Some(1010);
156-
validators[0].fetch_checkpoint = Some(checkpoint.clone());
156+
validators[0].fetch_checkpoint = Some(checkpoint);
157157
validators[1].latest_index = Some(1008);
158158
validators[2].latest_index = Some(1006);
159159
validators[3].latest_index = Some(1004);
160-
validators[3].fetch_checkpoint = Some(checkpoint.clone());
160+
validators[3].fetch_checkpoint = Some(checkpoint);
161161
validators[4].latest_index = Some(1002);
162-
validators[4].fetch_checkpoint = Some(checkpoint.clone());
162+
validators[4].fetch_checkpoint = Some(checkpoint);
163163

164164
let syncers = build_mock_checkpoint_syncs(&validators).await;
165165

@@ -242,7 +242,7 @@ mod tests {
242242

243243
let mut validators: Vec<_> = dummy_validators().drain(..).take(1).collect();
244244
validators[0].latest_index = Some(1010);
245-
validators[0].fetch_checkpoint = Some(checkpoint.clone());
245+
validators[0].fetch_checkpoint = Some(checkpoint);
246246

247247
let validator_addresses = validators
248248
.iter()

rust/main/agents/relayer/src/msg/op_batch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ mod tests {
429429
message.clone(),
430430
message_context.clone(),
431431
PendingOperationStatus::FirstPrepareAttempt,
432-
Some(format!("test-{}", b)),
432+
Some(format!("test-{b}")),
433433
attempts,
434434
);
435435
pending_message.submission_data = Some(Box::new(MessageSubmissionData {

0 commit comments

Comments
 (0)