@@ -7,8 +7,7 @@ use graph::data_source::common::ContractCall;
7
7
use graph:: firehose:: CallToFilter ;
8
8
use graph:: firehose:: CombinedFilter ;
9
9
use graph:: firehose:: LogFilter ;
10
- use graph:: prelude:: alloy:: primitives:: Address ;
11
- use graph:: prelude:: alloy:: primitives:: B256 ;
10
+ use graph:: prelude:: alloy:: primitives:: { Address , B256 } ;
12
11
use graph:: prelude:: alloy:: rpc:: types:: Block as AlloyBlock ;
13
12
use graph:: prelude:: alloy:: rpc:: types:: Log ;
14
13
use graph:: prelude:: alloy:: transports:: { RpcError , TransportErrorKind } ;
@@ -1239,7 +1238,7 @@ mod tests {
1239
1238
use graph:: blockchain:: TriggerFilter as _;
1240
1239
use graph:: firehose:: { CallToFilter , CombinedFilter , LogFilter , MultiLogFilter } ;
1241
1240
use graph:: petgraph:: graphmap:: GraphMap ;
1242
- use graph:: prelude:: alloy:: primitives:: { Address , Bytes , B256 } ;
1241
+ use graph:: prelude:: alloy:: primitives:: { Address , Bytes , B256 , U256 } ;
1243
1242
use graph:: prelude:: EthereumCall ;
1244
1243
use hex:: ToHex ;
1245
1244
use itertools:: Itertools ;
@@ -1324,7 +1323,7 @@ mod tests {
1324
1323
1325
1324
#[ test]
1326
1325
fn ethereum_trigger_filter_to_firehose ( ) {
1327
- let sig = |value : u64 | B256 :: from_slice ( & value . to_le_bytes ( ) ) ;
1326
+ let sig = |value : u64 | B256 :: from ( U256 :: from ( value ) ) ;
1328
1327
let mut filter = TriggerFilter {
1329
1328
log : EthereumLogFilter {
1330
1329
contracts_and_events_graph : GraphMap :: new ( ) ,
@@ -1446,8 +1445,8 @@ mod tests {
1446
1445
1447
1446
#[ test]
1448
1447
fn ethereum_trigger_filter_to_firehose_every_block_plus_logfilter ( ) {
1449
- let address = |value : u64 | Address :: from_slice ( & value. to_le_bytes ( ) ) ;
1450
- let sig = |value : u64 | B256 :: from_slice ( & value. to_le_bytes ( ) ) ;
1448
+ let address = |value : u64 | Address :: left_padding_from ( & value. to_le_bytes ( ) ) ;
1449
+ let sig = |value : u64 | B256 :: left_padding_from ( & value. to_le_bytes ( ) ) ;
1451
1450
let mut filter = TriggerFilter {
1452
1451
log : EthereumLogFilter {
1453
1452
contracts_and_events_graph : GraphMap :: new ( ) ,
@@ -1792,7 +1791,7 @@ mod tests {
1792
1791
}
1793
1792
1794
1793
fn address ( value : u64 ) -> Address {
1795
- Address :: from_slice ( & value. to_le_bytes ( ) )
1794
+ Address :: left_padding_from ( & value. to_be_bytes ( ) )
1796
1795
}
1797
1796
1798
1797
fn bytes ( value : Vec < u8 > ) -> Bytes {
@@ -1866,8 +1865,8 @@ fn complete_log_filter() {
1866
1865
1867
1866
#[ test]
1868
1867
fn log_filter_require_transacion_receipt_method ( ) {
1869
- let address = |value : u64 | Address :: from_slice ( & value. to_le_bytes ( ) ) ;
1870
- let b256 = |value : u64 | B256 :: from_slice ( & value. to_le_bytes ( ) ) ;
1868
+ let address = |value : u64 | Address :: left_padding_from ( & value. to_be_bytes ( ) ) ;
1869
+ let b256 = |value : u64 | B256 :: left_padding_from ( & value. to_be_bytes ( ) ) ;
1871
1870
1872
1871
// test data
1873
1872
let event_signature_a = b256 ( 0 ) ;
0 commit comments