diff --git a/src/l1/mod.rs b/src/l1/mod.rs index 330fc412..ad738e08 100644 --- a/src/l1/mod.rs +++ b/src/l1/mod.rs @@ -231,7 +231,7 @@ impl InnerWatcher { let input = &block .transactions - .get(0) + .first() .expect( "Could not find the L1 attributes deposited transaction in the parent L2 block", ) diff --git a/src/types/attributes.rs b/src/types/attributes.rs index b348959c..5683d556 100644 --- a/src/types/attributes.rs +++ b/src/types/attributes.rs @@ -24,7 +24,7 @@ impl RawTransaction { pub fn derive_unsafe_epoch(&self) -> Result<(Epoch, u64)> { let rlp = Rlp::new(self.0.as_slice()); let tx = rlp.as_val::()?; - let calldata = Bytes::try_from(tx.data)?; + let calldata = Bytes::from(tx.data); let attr = AttributesDepositedCall::try_from(calldata)?; let epoch = Epoch::from(&attr); @@ -335,8 +335,8 @@ impl TryFrom for UserDeposited { .into_bytes() .unwrap(); - let from = Address::try_from(log.topics[1])?; - let to = Address::try_from(log.topics[2])?; + let from = Address::from(log.topics[1]); + let to = Address::from(log.topics[2]); let mint = U256::from_big_endian(&opaque_data[0..32]); let value = U256::from_big_endian(&opaque_data[32..64]); let gas = u64::from_be_bytes(opaque_data[64..72].try_into()?); diff --git a/src/types/common.rs b/src/types/common.rs index 87186637..a6a94e94 100644 --- a/src/types/common.rs +++ b/src/types/common.rs @@ -117,7 +117,7 @@ impl TryFrom> for HeadInfo { fn try_from(block: Block) -> std::result::Result { let tx_calldata = block .transactions - .get(0) + .first() .ok_or(eyre::eyre!( "Could not find the L1 attributes deposited transaction" ))?