mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 03:31:10 +00:00
fix clippy (#1698)
This commit is contained in:
committed by
Bastian Köcher
parent
3eb24d4515
commit
66dfd2dcae
@@ -199,8 +199,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
|
|||||||
Ok(k) => keystore_container.set_remote_keystore(k),
|
Ok(k) => keystore_container.set_remote_keystore(k),
|
||||||
Err(e) =>
|
Err(e) =>
|
||||||
return Err(ServiceError::Other(format!(
|
return Err(ServiceError::Other(format!(
|
||||||
"Error hooking up remote keystore for {}: {}",
|
"Error hooking up remote keystore for {url}: {e}"
|
||||||
url, e
|
|
||||||
))),
|
))),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,10 +59,7 @@ pub fn ensure_able_to_receive_message<W: WeightInfoExt>(
|
|||||||
max_incoming_message_proof_size.saturating_add(SIGNED_EXTENSIONS_SIZE);
|
max_incoming_message_proof_size.saturating_add(SIGNED_EXTENSIONS_SIZE);
|
||||||
assert!(
|
assert!(
|
||||||
max_delivery_transaction_size <= max_extrinsic_size,
|
max_delivery_transaction_size <= max_extrinsic_size,
|
||||||
"Size of maximal message delivery transaction {} + {} is larger than maximal possible transaction size {}",
|
"Size of maximal message delivery transaction {max_incoming_message_proof_size} + {SIGNED_EXTENSIONS_SIZE} is larger than maximal possible transaction size {max_extrinsic_size}",
|
||||||
max_incoming_message_proof_size,
|
|
||||||
SIGNED_EXTENSIONS_SIZE,
|
|
||||||
max_extrinsic_size,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// verify that we're able to receive proof of maximal-size message with maximal dispatch weight
|
// verify that we're able to receive proof of maximal-size message with maximal dispatch weight
|
||||||
@@ -75,9 +72,7 @@ pub fn ensure_able_to_receive_message<W: WeightInfoExt>(
|
|||||||
);
|
);
|
||||||
assert!(
|
assert!(
|
||||||
max_delivery_transaction_dispatch_weight.all_lte(max_extrinsic_weight),
|
max_delivery_transaction_dispatch_weight.all_lte(max_extrinsic_weight),
|
||||||
"Weight of maximal message delivery transaction + {} is larger than maximal possible transaction weight {}",
|
"Weight of maximal message delivery transaction + {max_delivery_transaction_dispatch_weight} is larger than maximal possible transaction weight {max_extrinsic_weight}",
|
||||||
max_delivery_transaction_dispatch_weight,
|
|
||||||
max_extrinsic_weight,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,10 +89,7 @@ pub fn ensure_able_to_receive_confirmation<W: WeightInfoExt>(
|
|||||||
max_inbound_lane_data_proof_size_from_peer_chain.saturating_add(SIGNED_EXTENSIONS_SIZE);
|
max_inbound_lane_data_proof_size_from_peer_chain.saturating_add(SIGNED_EXTENSIONS_SIZE);
|
||||||
assert!(
|
assert!(
|
||||||
max_confirmation_transaction_size <= max_extrinsic_size,
|
max_confirmation_transaction_size <= max_extrinsic_size,
|
||||||
"Size of maximal message delivery confirmation transaction {} + {} is larger than maximal possible transaction size {}",
|
"Size of maximal message delivery confirmation transaction {max_inbound_lane_data_proof_size_from_peer_chain} + {SIGNED_EXTENSIONS_SIZE} is larger than maximal possible transaction size {max_extrinsic_size}",
|
||||||
max_inbound_lane_data_proof_size_from_peer_chain,
|
|
||||||
SIGNED_EXTENSIONS_SIZE,
|
|
||||||
max_extrinsic_size,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// verify that we're able to reward maximal number of relayers that have delivered maximal
|
// verify that we're able to reward maximal number of relayers that have delivered maximal
|
||||||
@@ -112,9 +104,7 @@ pub fn ensure_able_to_receive_confirmation<W: WeightInfoExt>(
|
|||||||
);
|
);
|
||||||
assert!(
|
assert!(
|
||||||
max_confirmation_transaction_dispatch_weight.all_lte(max_extrinsic_weight),
|
max_confirmation_transaction_dispatch_weight.all_lte(max_extrinsic_weight),
|
||||||
"Weight of maximal confirmation transaction {} is larger than maximal possible transaction weight {}",
|
"Weight of maximal confirmation transaction {max_confirmation_transaction_dispatch_weight} is larger than maximal possible transaction weight {max_extrinsic_weight}",
|
||||||
max_confirmation_transaction_dispatch_weight,
|
|
||||||
max_extrinsic_weight,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -408,11 +408,7 @@ mod tests {
|
|||||||
let difference = (expected_size.unwrap() as f64 - actual_size as f64).abs();
|
let difference = (expected_size.unwrap() as f64 - actual_size as f64).abs();
|
||||||
assert!(
|
assert!(
|
||||||
difference / (std::cmp::min(actual_size, expected_size.unwrap()) as f64) < 0.1,
|
difference / (std::cmp::min(actual_size, expected_size.unwrap()) as f64) < 0.1,
|
||||||
"Too large difference between actual ({}) and expected ({:?}) inbound lane data size. Test case: {}+{}",
|
"Too large difference between actual ({actual_size}) and expected ({expected_size:?}) inbound lane data size. Test case: {relayer_entries}+{messages_count}",
|
||||||
actual_size,
|
|
||||||
expected_size,
|
|
||||||
relayer_entries,
|
|
||||||
messages_count,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ mod tests {
|
|||||||
|
|
||||||
fn print_xcm<RuntimeCall>(xcm: &VersionedXcm<RuntimeCall>) {
|
fn print_xcm<RuntimeCall>(xcm: &VersionedXcm<RuntimeCall>) {
|
||||||
println!("-----------------");
|
println!("-----------------");
|
||||||
println!("xcm (plain): {:?}", xcm);
|
println!("xcm (plain): {xcm:?}");
|
||||||
println!("xcm (bytes): {:?}", xcm.encode());
|
println!("xcm (bytes): {:?}", xcm.encode());
|
||||||
println!("xcm (hex): {:?}", hexdisplay::HexDisplay::from(&xcm.encode()));
|
println!("xcm (hex): {:?}", hexdisplay::HexDisplay::from(&xcm.encode()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -495,8 +495,7 @@ fn validate_out_msgs_details<C: Chain>(
|
|||||||
) -> Result<(), SubstrateError> {
|
) -> Result<(), SubstrateError> {
|
||||||
let make_missing_nonce_error = |expected_nonce| {
|
let make_missing_nonce_error = |expected_nonce| {
|
||||||
Err(SubstrateError::Custom(format!(
|
Err(SubstrateError::Custom(format!(
|
||||||
"Missing nonce {} in message_details call result. Expected all nonces from {:?}",
|
"Missing nonce {expected_nonce} in message_details call result. Expected all nonces from {nonces:?}",
|
||||||
expected_nonce, nonces,
|
|
||||||
)))
|
)))
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -147,8 +147,7 @@ where
|
|||||||
let parachain = ParaId(P::SOURCE_PARACHAIN_PARA_ID);
|
let parachain = ParaId(P::SOURCE_PARACHAIN_PARA_ID);
|
||||||
if parachains != [parachain] {
|
if parachains != [parachain] {
|
||||||
return Err(SubstrateError::Custom(format!(
|
return Err(SubstrateError::Custom(format!(
|
||||||
"Trying to prove unexpected parachains {:?}. Expected {:?}",
|
"Trying to prove unexpected parachains {parachains:?}. Expected {parachain:?}",
|
||||||
parachains, parachain,
|
|
||||||
)))
|
)))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,8 +176,7 @@ where
|
|||||||
.transpose()?
|
.transpose()?
|
||||||
.ok_or_else(|| {
|
.ok_or_else(|| {
|
||||||
SubstrateError::Custom(format!(
|
SubstrateError::Custom(format!(
|
||||||
"Failed to read expected parachain {:?} head at {:?}",
|
"Failed to read expected parachain {parachain:?} head at {at_block:?}"
|
||||||
parachain, at_block
|
|
||||||
))
|
))
|
||||||
})?;
|
})?;
|
||||||
let parachain_head_hash = parachain_head.hash();
|
let parachain_head_hash = parachain_head.hash();
|
||||||
|
|||||||
Reference in New Issue
Block a user