Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger committed Oct 6, 2024
1 parent f30002b commit 469861b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/models/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::providers::eth_provider::{
utils::split_u256,
};
use alloy_rlp::Encodable;
use reth_primitives::{Transaction, TransactionSigned};
use reth_primitives::{transaction::legacy_parity, Transaction, TransactionSigned};
use starknet::core::types::Felt;
#[cfg(not(feature = "hive"))]
use {
Expand All @@ -27,8 +27,8 @@ pub(crate) fn transaction_signature_to_field_elements(transaction_signed: &Trans
// or {0, 1} + 27 for pre EIP-155 transactions.
// Else, it is odd_y_parity
if let Transaction::Legacy(_) = transaction_signed.transaction {
let chain_id = transaction_signed.chain_id().unwrap();
signature.push(transaction_signature.with_chain_id(chain_id).v().to_u64().into());
let chain_id = transaction_signed.chain_id();
signature.push(legacy_parity(&transaction_signature, chain_id).to_u64().into());
} else {
signature.push(transaction_signature.v().to_u64().into());
}
Expand Down
8 changes: 2 additions & 6 deletions src/providers/eth_provider/database/filter.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::providers::eth_provider::constant::{
ADDRESS_HEX_STRING_LEN, BLOCK_NUMBER_HEX_STRING_LEN, HASH_HEX_STRING_LEN, LOGS_TOPICS_HEX_STRING_LEN,
U64_HEX_STRING_LEN,
BLOCK_NUMBER_HEX_STRING_LEN, HASH_HEX_STRING_LEN, LOGS_TOPICS_HEX_STRING_LEN, U64_HEX_STRING_LEN,
};
use alloy_primitives::{Address, B256};
use alloy_rpc_types::{BlockHashOrNumber, Index, Topic};
Expand Down Expand Up @@ -201,10 +200,7 @@ impl<T: LogFiltering + BlockFiltering + Display + Default> EthDatabaseFilterBuil
return self;
}
let key = format!("{}.{}", self.target, self.target.address());
self.filter.insert(
key,
doc! {"$in": addresses.iter().map(|a| format_hex(a, ADDRESS_HEX_STRING_LEN)).collect::<Vec<_>>()},
);
self.filter.insert(key, doc! {"$in": addresses.iter().map(|a| a.to_string()).collect::<Vec<_>>()});
self
}

Expand Down
4 changes: 3 additions & 1 deletion tests/tests/tracer.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![allow(clippy::used_underscore_binding)]
#![cfg(feature = "testing")]
use alloy_dyn_abi::DynSolValue;
use alloy_primitives::{Address, Bytes, B256, U256};
use alloy_primitives::{Address, Bytes, B256, B64, U256};
use alloy_rpc_types_trace::{
geth::{GethDebugTracingOptions, GethTrace, TraceResult},
parity::{Action, CallAction, CallOutput, CallType, TraceOutput, TransactionTrace},
Expand Down Expand Up @@ -36,6 +36,8 @@ fn header(block_number: u64, hash: B256, parent_hash: B256, base_fee: u64) -> al
parent_hash,
gas_limit: u64::MAX,
base_fee_per_gas: Some(base_fee),
mix_hash: Some(B256::ZERO),
nonce: Some(B64::ZERO),
..Default::default()
}
}
Expand Down

0 comments on commit 469861b

Please sign in to comment.