Skip to content

Commit 4c3fad9

Browse files
chore: merge latest agglayer & fix clippy errors
1 parent 6d4d247 commit 4c3fad9

File tree

21 files changed

+53
-70
lines changed

21 files changed

+53
-70
lines changed

bin/bench-transaction/src/time_counting_benchmarks/prove.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ fn core_benchmarks(c: &mut Criterion) {
221221
.await
222222
.expect("execution of the CLAIM note (L1) consumption tx failed"),
223223
))
224+
.await
224225
},
225226
BatchSize::SmallInput,
226227
);
@@ -245,6 +246,7 @@ fn core_benchmarks(c: &mut Criterion) {
245246
.await
246247
.expect("execution of the CLAIM note (L2) consumption tx failed"),
247248
))
249+
.await
248250
},
249251
BatchSize::SmallInput,
250252
);
@@ -269,6 +271,7 @@ fn core_benchmarks(c: &mut Criterion) {
269271
.await
270272
.expect("execution of the B2AGG note consumption tx failed"),
271273
))
274+
.await
272275
},
273276
BatchSize::SmallInput,
274277
);

crates/miden-agglayer/src/eth_types/eth_address.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl EthAddress {
5555
let prefixed_hex = if hex_str.starts_with("0x") {
5656
hex_str.to_string()
5757
} else {
58-
format!("0x{}", hex_str)
58+
format!("0x{hex_str}")
5959
};
6060

6161
let bytes: [u8; 20] = hex_to_bytes(&prefixed_hex)?;
@@ -138,7 +138,7 @@ impl fmt::Display for AddressConversionError {
138138
AddressConversionError::InvalidHexLength => {
139139
write!(f, "invalid hex length (expected 40 hex chars)")
140140
},
141-
AddressConversionError::InvalidHexChar(c) => write!(f, "invalid hex character: {}", c),
141+
AddressConversionError::InvalidHexChar(c) => write!(f, "invalid hex character: {c}"),
142142
AddressConversionError::HexParseError => write!(f, "hex parse error"),
143143
AddressConversionError::FeltOutOfField => {
144144
write!(f, "packed 64-bit word does not fit in the field")

crates/miden-protocol/src/account/component/storage/schema/parse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ fn parse_simple_word_value(
4747
SCHEMA_TYPE_REGISTRY.try_parse_word(schema_type, value).map_err(|err| {
4848
ComponentMetadataError::InvalidInitStorageValue(
4949
slot_prefix.clone(),
50-
format!("failed to parse value as `{}`: {err}", schema_type),
50+
format!("failed to parse value as `{schema_type}`: {err}"),
5151
)
5252
})
5353
},

crates/miden-protocol/src/account/component/storage/schema/word.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ impl WordSchema {
210210
SCHEMA_TYPE_REGISTRY.validate_word_value(r#type, word).map_err(|err| {
211211
ComponentMetadataError::InvalidInitStorageValue(
212212
slot_prefix.clone(),
213-
format!("{label} does not match `{}`: {err}", r#type),
213+
format!("{label} does not match `{type}`: {err}"),
214214
)
215215
})
216216
},

crates/miden-protocol/src/account/component/storage/type_registry.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ impl FeltType for u8 {
364364

365365
fn display_felt(value: Felt) -> Result<String, SchemaTypeError> {
366366
let native = u8::try_from(value.as_canonical_u64()).map_err(|_| {
367-
SchemaTypeError::ConversionError(format!("value `{}` is out of range for u8", value))
367+
SchemaTypeError::ConversionError(format!("value `{value}` is out of range for u8"))
368368
})?;
369369
Ok(native.to_string())
370370
}
@@ -391,8 +391,7 @@ impl FeltType for AuthScheme {
391391
fn display_felt(value: Felt) -> Result<String, SchemaTypeError> {
392392
let scheme_id = u8::try_from(value.as_canonical_u64()).map_err(|_| {
393393
SchemaTypeError::ConversionError(format!(
394-
"value `{}` is out of range for auth scheme id",
395-
value
394+
"value `{value}` is out of range for auth scheme id"
396395
))
397396
})?;
398397

@@ -418,7 +417,7 @@ impl FeltType for u16 {
418417

419418
fn display_felt(value: Felt) -> Result<String, SchemaTypeError> {
420419
let native = u16::try_from(value.as_canonical_u64()).map_err(|_| {
421-
SchemaTypeError::ConversionError(format!("value `{}` is out of range for u16", value))
420+
SchemaTypeError::ConversionError(format!("value `{value}` is out of range for u16"))
422421
})?;
423422
Ok(native.to_string())
424423
}
@@ -438,7 +437,7 @@ impl FeltType for u32 {
438437

439438
fn display_felt(value: Felt) -> Result<String, SchemaTypeError> {
440439
let native = u32::try_from(value.as_canonical_u64()).map_err(|_| {
441-
SchemaTypeError::ConversionError(format!("value `{}` is out of range for u32", value))
440+
SchemaTypeError::ConversionError(format!("value `{value}` is out of range for u32"))
442441
})?;
443442
Ok(native.to_string())
444443
}
@@ -504,7 +503,7 @@ fn pad_hex_string(input: &str) -> String {
504503
// 66 = "0x" + 64 hex chars
505504
let hex_part = &input[2..];
506505
let padding = "0".repeat(64 - hex_part.len());
507-
format!("0x{}{}", padding, hex_part)
506+
format!("0x{padding}{hex_part}")
508507
} else {
509508
input.to_string()
510509
}

crates/miden-protocol/src/account/delta/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ impl SequentialCommit for AccountDelta {
420420
self.storage.append_delta_elements(&mut elements);
421421

422422
debug_assert!(
423-
elements.len() % (2 * crate::WORD_SIZE) == 0,
423+
elements.len().is_multiple_of(2 * crate::WORD_SIZE),
424424
"expected elements to contain an even number of words, but it contained {} elements",
425425
elements.len()
426426
);

crates/miden-protocol/src/account/storage/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ impl AccountStorageHeader {
180180

181181
// Retrieve slot name from the map.
182182
let slot_name = slot_names.get(&parsed_slot_id).cloned().ok_or(AccountError::other(
183-
format!("slot name not found for slot ID {}", parsed_slot_id),
183+
format!("slot name not found for slot ID {parsed_slot_id}"),
184184
))?;
185185

186186
// Parse slot value from last 4 elements.

crates/miden-protocol/src/address/routing_parameters.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ fn decode_receiver_profile(
294294
ABSENT_NOTE_TAG_LEN => None,
295295
0..=32 => Some(tag_len),
296296
_ => {
297-
return Err(AddressError::decode_error(format!("invalid note tag length {}", tag_len)));
297+
return Err(AddressError::decode_error(format!("invalid note tag length {tag_len}")));
298298
},
299299
};
300300

@@ -355,8 +355,7 @@ fn decode_encryption_key(
355355
},
356356
other => {
357357
return Err(AddressError::decode_error(format!(
358-
"unknown encryption key variant: {}",
359-
other
358+
"unknown encryption key variant: {other}"
360359
)));
361360
},
362361
};
@@ -369,8 +368,7 @@ fn read_x25519_pub_key(
369368
) -> Result<eddsa_25519_sha512::PublicKey, AddressError> {
370369
if byte_iter.len() < X25519_PUBLIC_KEY_LENGTH {
371370
return Err(AddressError::decode_error(format!(
372-
"expected {} bytes to decode X25519 public key",
373-
X25519_PUBLIC_KEY_LENGTH
371+
"expected {X25519_PUBLIC_KEY_LENGTH} bytes to decode X25519 public key"
374372
)));
375373
}
376374
let key_bytes: [u8; X25519_PUBLIC_KEY_LENGTH] = read_byte_array(byte_iter);
@@ -384,8 +382,7 @@ fn read_k256_pub_key(
384382
) -> Result<ecdsa_k256_keccak::PublicKey, AddressError> {
385383
if byte_iter.len() < K256_PUBLIC_KEY_LENGTH {
386384
return Err(AddressError::decode_error(format!(
387-
"expected {} bytes to decode K256 public key",
388-
K256_PUBLIC_KEY_LENGTH
385+
"expected {K256_PUBLIC_KEY_LENGTH} bytes to decode K256 public key"
389386
)));
390387
}
391388
let key_bytes: [u8; K256_PUBLIC_KEY_LENGTH] = read_byte_array(byte_iter);

crates/miden-protocol/src/asset/token_symbol.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ mod test {
270270
for symbol in symbols {
271271
let from_new = TokenSymbol::new(symbol).unwrap();
272272
let from_static = TokenSymbol::new_unchecked(symbol);
273-
assert_eq!(from_new, from_static, "Mismatch for symbol: {}", symbol);
273+
assert_eq!(from_new, from_static, "Mismatch for symbol: {symbol}");
274274
}
275275
}
276276

crates/miden-standards/src/code_builder/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,11 +687,11 @@ mod tests {
687687
let static_lib = temp_assembler
688688
.clone()
689689
.assemble_library([NamedSource::new("contracts::static_contract", account_code_1)])
690-
.map_err(|e| anyhow::anyhow!("failed to assemble static library: {}", e))?;
690+
.map_err(|e| anyhow::anyhow!("failed to assemble static library: {e}"))?;
691691

692692
let dynamic_lib = temp_assembler
693693
.assemble_library([NamedSource::new("contracts::dynamic_contract", account_code_2)])
694-
.map_err(|e| anyhow::anyhow!("failed to assemble dynamic library: {}", e))?;
694+
.map_err(|e| anyhow::anyhow!("failed to assemble dynamic library: {e}"))?;
695695

696696
// Test linking both static and dynamic libraries
697697
let builder = CodeBuilder::default()

0 commit comments

Comments
 (0)