feat(substreams): add substreams for Uniswap v2 and v3
This commit is contained in:
14
substreams/crates/substreams-helper/src/storage_change.rs
Normal file
14
substreams/crates/substreams-helper/src/storage_change.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
use substreams_ethereum::pb::eth::v2::StorageChange;
|
||||
|
||||
pub trait StorageChangesFilter {
|
||||
fn filter_by_address(&self, contract_addr: &[u8; 20]) -> Vec<&StorageChange>;
|
||||
}
|
||||
|
||||
impl StorageChangesFilter for Vec<StorageChange> {
|
||||
fn filter_by_address(&self, contract_addr: &[u8; 20]) -> Vec<&StorageChange> {
|
||||
return self
|
||||
.iter()
|
||||
.filter(|change| change.address == contract_addr)
|
||||
.collect();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user