Skip to content

Commit

Permalink
chore(l2): Remove index slicing usage: minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dsocolobsky committed Nov 28, 2024
1 parent ba6f33b commit bec1413
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions crates/l2/proposer/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ pub enum CommitterError {
FailedToReExecuteBlock(#[from] EvmError),
#[error("Committer failed to send transaction: {0}")]
FailedToSendCommitment(String),
#[error("Commiter failed to decode deposit hash")]
#[error("Committer failed to decode deposit hash")]
FailedToDecodeDepositHash,
#[error("Commiter failed to merkelize: {0}")]
#[error("Committer failed to merkelize: {0}")]
FailedToMerkelize(#[from] MerkleError),
#[error("Withdrawal transaction was invalid")]
InvalidWithdrawalTransaction,
Expand Down
4 changes: 2 additions & 2 deletions crates/l2/proposer/l1_watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl L1Watcher {
{
Ok(logs) => logs,
Err(error) => {
warn!("Error when getting logs from L1: {}", error);
warn!("Error when getting logs from L1: {error}");
vec![]
}
};
Expand Down Expand Up @@ -191,7 +191,7 @@ impl L1Watcher {
"Failed to parse beneficiary from log: log.topics[2] out of bounds".to_owned(),
))?
.into_uint();
let beneficiary = format!("{:#x}", beneficiary_uint)
let beneficiary = format!("{beneficiary_uint:#x}")
.parse::<Address>()
.map_err(|e| {
L1WatcherError::FailedToDeserializeLog(format!(
Expand Down
2 changes: 1 addition & 1 deletion crates/l2/utils/eth_client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ impl EthClient {
// Add the nonce just if present, otherwise the RPC will use the latest nonce
if let Some(nonce) = transaction.nonce {
if let Value::Object(ref mut map) = data {
map.insert("nonce".to_owned(), json!(format!("{:#x}", nonce)));
map.insert("nonce".to_owned(), json!(format!("{nonce:#x}")));
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/l2/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub fn get_address_from_secret_key(secret_key: &SecretKey) -> Result<Address, Et
.serialize_uncompressed();
let hash = keccak(&public_key[1..]);

// Get the lat 20 bytes of the hash
// Get the last 20 bytes of the hash
let address_bytes: [u8; 20] = hash
.as_ref()
.get(12..32)
Expand Down

0 comments on commit bec1413

Please sign in to comment.