fix(balancer_v2): skip adding zero address rate_provider entrypoints (#224)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "ethereum-balancer-v2"
|
||||
version = "0.3.1"
|
||||
version = "0.3.2"
|
||||
edition = "2021"
|
||||
|
||||
[lib]
|
||||
@@ -15,7 +15,7 @@ hex = "0.4.3"
|
||||
anyhow = "1.0.75"
|
||||
num-bigint = "0.4.4"
|
||||
itertools = "0.12.0"
|
||||
tycho-substreams = { git = "https://github.com/propeller-heads/tycho-protocol-sdk.git", rev = "51995f9" }
|
||||
tycho-substreams = { git = "https://github.com/propeller-heads/tycho-protocol-sdk.git", tag = "0.4.0" }
|
||||
|
||||
[build-dependencies]
|
||||
anyhow = "1"
|
||||
|
||||
@@ -15,6 +15,7 @@ use tycho_substreams::{
|
||||
};
|
||||
|
||||
pub const VAULT_ADDRESS: &[u8] = &hex!("BA12222222228d8Ba445958a75a0704d566BF2C8");
|
||||
pub const ZERO_ADDRESS: &[u8] = &[0u8; 20];
|
||||
|
||||
#[substreams::handlers::map]
|
||||
pub fn map_components(block: eth::v2::Block) -> Result<BlockTransactionProtocolComponents> {
|
||||
@@ -214,6 +215,11 @@ pub fn map_protocol_changes(
|
||||
|
||||
if let Some(rate_providers) = rate_providers {
|
||||
for rate_provider in rate_providers {
|
||||
if rate_provider == ZERO_ADDRESS {
|
||||
// Skipped: is not a rate provider
|
||||
continue;
|
||||
}
|
||||
|
||||
let trace_data = TraceData::Rpc(RpcTraceData {
|
||||
caller: None,
|
||||
calldata: hex::decode("679aefce").unwrap(), // getRate()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
specVersion: v0.1.0
|
||||
package:
|
||||
name: "ethereum_balancer_v2"
|
||||
version: v0.3.1
|
||||
version: v0.3.2
|
||||
url: "https://github.com/propeller-heads/tycho-protocol-sdk/tree/main/substreams/ethereum-balancer-v2"
|
||||
|
||||
protobuf:
|
||||
|
||||
Reference in New Issue
Block a user