Revert "chore: update format! macro use to satisfy latest clippy version (#194)" (#196)

This reverts commit f29de67f1f.
This commit is contained in:
Louise Poole
2025-04-25 18:09:38 +02:00
committed by GitHub
parent f29de67f1f
commit 409cf15864
38 changed files with 1680 additions and 1361 deletions

View File

@@ -39,7 +39,7 @@ fn address_to_bytes_with_0x(address: &[u8; 20]) -> Vec<u8> {
/// Converts address bytes into a string containing a leading `0x`.
fn address_to_string_with_0x(address: &[u8]) -> String {
format!("0x{encoded}", encoded = hex::encode(address))
format!("0x{}", hex::encode(address))
}
/// Function that swaps `WETH` addresses for `ETH` address for specific factory types that decide
@@ -499,8 +499,8 @@ pub fn address_map(
name: "stateless_contract_addr_0".into(),
// Call views_implementation() on CRYPTO_SWAP_NG_FACTORY
value: format!(
"call:0x{factory}:views_implementation()",
factory = hex::encode(CRYPTO_SWAP_NG_FACTORY)
"call:0x{}:views_implementation()",
hex::encode(CRYPTO_SWAP_NG_FACTORY)
)
.into(),
change: ChangeType::Creation.into(),
@@ -579,8 +579,8 @@ pub fn address_map(
name: "stateless_contract_addr_0".into(),
// Call views_implementation() on CRYPTO_SWAP_NG_FACTORY
value: format!(
"call:0x{factory}:views_implementation()",
factory = hex::encode(CRYPTO_SWAP_NG_FACTORY)
"call:0x{}:views_implementation()",
hex::encode(CRYPTO_SWAP_NG_FACTORY)
)
.into(),
change: ChangeType::Creation.into(),
@@ -589,8 +589,8 @@ pub fn address_map(
name: "stateless_contract_addr_1".into(),
// Call math_implementation() on CRYPTO_SWAP_NG_FACTORY
value: format!(
"call:0x{factory}:math_implementation()",
factory = hex::encode(CRYPTO_SWAP_NG_FACTORY)
"call:0x{}:math_implementation()",
hex::encode(CRYPTO_SWAP_NG_FACTORY)
)
.into(),
change: ChangeType::Creation.into(),
@@ -651,14 +651,14 @@ pub fn address_map(
}),
},
vec![EntityChanges {
component_id: format!("0x{id}"),
component_id: format!("0x{}", id),
attributes: vec![
Attribute {
name: "stateless_contract_addr_0".into(),
// Call views_implementation() on TRICRYPTO_FACTORY
value: format!(
"call:0x{factory}:views_implementation()",
factory = hex::encode(TRICRYPTO_FACTORY)
"call:0x{}:views_implementation()",
hex::encode(TRICRYPTO_FACTORY)
)
.into(),
change: ChangeType::Creation.into(),
@@ -667,8 +667,8 @@ pub fn address_map(
name: "stateless_contract_addr_1".into(),
// Call math_implementation() on TRICRYPTO_FACTORY
value: format!(
"call:0x{factory}:math_implementation()",
factory = hex::encode(TRICRYPTO_FACTORY)
"call:0x{}:math_implementation()",
hex::encode(TRICRYPTO_FACTORY)
)
.into(),
change: ChangeType::Creation.into(),
@@ -907,14 +907,14 @@ pub fn address_map(
}),
},
vec![EntityChanges {
component_id: format!("0x{id}"),
component_id: format!("0x{}", id),
attributes: vec![
Attribute {
name: "stateless_contract_addr_0".into(),
// Call views_implementation() on TWOCRYPTO_FACTORY
value: format!(
"call:0x{factory}:views_implementation()",
factory = hex::encode(TWOCRYPTO_FACTORY)
"call:0x{}:views_implementation()",
hex::encode(TWOCRYPTO_FACTORY)
)
.into(),
change: ChangeType::Creation.into(),

View File

@@ -99,7 +99,7 @@ fn create_component(
}),
},
vec![EntityChanges {
component_id: format!("0x{pool_address}", pool_address = pool.address.clone()),
component_id: format!("0x{}", pool.address.clone()),
attributes: zip(
pool.attribute_keys
.clone()
@@ -127,7 +127,7 @@ fn parse_params(params: &str) -> Result<HashMap<String, PoolQueryParams>, anyhow
.split(PARAMS_SEPERATOR)
.map(|param| {
let pool: PoolQueryParams = serde_qs::from_str(param)
.with_context(|| format!("Failed to parse pool query params: {param}"))?;
.with_context(|| format!("Failed to parse pool query params: {0}", param))?;
Ok((pool.tx_hash.clone(), pool))
})
.collect::<Result<HashMap<_, _>>>()