From 30008a842c02741b9e214b1e746b226f1edaaedd Mon Sep 17 00:00:00 2001 From: Evgeny Ukhanov Date: Thu, 26 Dec 2024 13:21:27 +0100 Subject: [PATCH] Small fixes after review --- engine-precompiles/src/modexp.rs | 2 -- engine-precompiles/src/native.rs | 10 +++++----- engine-tests-connector/src/connector.rs | 4 ++-- engine/src/contract_methods/connector/mod.rs | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/engine-precompiles/src/modexp.rs b/engine-precompiles/src/modexp.rs index c1e2b5a8c..542aa6454 100644 --- a/engine-precompiles/src/modexp.rs +++ b/engine-precompiles/src/modexp.rs @@ -28,7 +28,6 @@ impl ModExp { bytes, start.saturating_add(96), core::cmp::min(32, exp_len), - // I don't understand why I need a closure here, but doesn't compile without one U256::from_big_endian, ); @@ -225,7 +224,6 @@ fn saturating_round(x: U256) -> u64 { fn parse_lengths(input: &[u8]) -> (u64, u64, u64) { let parse = |start: usize| -> u64 { - // I don't understand why I need a closure here, but doesn't compile without one saturating_round(parse_bytes(input, start, 32, U256::from_big_endian)) }; let base_len = parse(0); diff --git a/engine-precompiles/src/native.rs b/engine-precompiles/src/native.rs index c6cb63423..922351af0 100644 --- a/engine-precompiles/src/native.rs +++ b/engine-precompiles/src/native.rs @@ -131,10 +131,10 @@ pub mod events { self.amount.to_big_endian(), ))]); let topics = vec![ - ethabi::Hash::from(EXIT_TO_ETH_SIGNATURE.0), - ethabi::Hash::from(encode_address(self.sender).0), - ethabi::Hash::from(encode_address(self.erc20_address).0), - ethabi::Hash::from(encode_address(self.dest).0), + EXIT_TO_ETH_SIGNATURE.0.into(), + encode_address(self.sender).0.into(), + encode_address(self.erc20_address).0.into(), + encode_address(self.dest).0.into(), ]; ethabi::RawLog { topics, data } @@ -518,7 +518,7 @@ impl Precompile for ExitToNear { address: exit_to_near::ADDRESS.raw(), topics: exit_event_log .topics - .iter() + .into_iter() .map(|h| H256::from(h.0)) .collect(), data: exit_event_log.data, diff --git a/engine-tests-connector/src/connector.rs b/engine-tests-connector/src/connector.rs index 0e92e45d6..fee40b1dd 100644 --- a/engine-tests-connector/src/connector.rs +++ b/engine-tests-connector/src/connector.rs @@ -509,8 +509,8 @@ async fn test_deposit_with_0x_prefix() -> anyhow::Result<()> { ], data: ethabi::encode(&[ ethabi::Token::String(message), - ethabi::Token::Uint(ethabi::Uint::from(deposit_event.amount.as_u128())), - ethabi::Token::Uint(ethabi::Uint::from(deposit_event.fee.as_u128())), + ethabi::Token::Uint(deposit_event.amount.as_u128().into()), + ethabi::Token::Uint(deposit_event.fee.as_u128().into()), ]), }; let proof = Proof { diff --git a/engine/src/contract_methods/connector/mod.rs b/engine/src/contract_methods/connector/mod.rs index 11c16e329..d0fd94312 100644 --- a/engine/src/contract_methods/connector/mod.rs +++ b/engine/src/contract_methods/connector/mod.rs @@ -569,7 +569,7 @@ fn get_contract_data( #[cfg(any(not(feature = "ext-connector"), test))] #[must_use] -fn proof_key(proof: &aurora_engine_types::parameters::connector::Proof) -> String { +fn proof_key(proof: &aurora_engine_types::parameters::connector::Proof) -> crate::prelude::String { let mut data = borsh::to_vec(&proof.log_index).unwrap(); data.extend(borsh::to_vec(&proof.receipt_index).unwrap()); data.extend(proof.header_data.clone());