Skip to content

Commit

Permalink
Small fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
mrLSD committed Dec 26, 2024
1 parent 0f0198c commit 30008a8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 0 additions & 2 deletions engine-precompiles/src/modexp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ impl<HF: HardFork, M: ModExpAlgorithm> ModExp<HF, M> {
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,
);

Expand Down Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions engine-precompiles/src/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -518,7 +518,7 @@ impl<I: IO> Precompile for ExitToNear<I> {
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,
Expand Down
4 changes: 2 additions & 2 deletions engine-tests-connector/src/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion engine/src/contract_methods/connector/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ fn get_contract_data<T: BorshDeserialize, I: IO>(

#[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());
Expand Down

0 comments on commit 30008a8

Please sign in to comment.