fix(balancer): Ignore PoolBalanceManaged for not indexed pools (#106)

Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
This commit is contained in:
Zizou
2024-11-01 11:13:56 +07:00
committed by GitHub
parent eea8b27112
commit baadd0212d
4 changed files with 15 additions and 10 deletions

2
substreams/Cargo.lock generated
View File

@@ -222,7 +222,7 @@ dependencies = [
[[package]] [[package]]
name = "ethereum-balancer-v2" name = "ethereum-balancer-v2"
version = "0.2.3" version = "0.2.4"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bytes", "bytes",

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "ethereum-balancer-v2" name = "ethereum-balancer-v2"
version = "0.2.3" version = "0.2.4"
edition = "2021" edition = "2021"
[lib] [lib]

View File

@@ -122,13 +122,18 @@ pub fn map_relative_balances(
abi::vault::events::PoolBalanceManaged::match_and_decode(vault_log.log) abi::vault::events::PoolBalanceManaged::match_and_decode(vault_log.log)
{ {
let component_id = format!("0x{}", hex::encode(ev.pool_id)); let component_id = format!("0x{}", hex::encode(ev.pool_id));
deltas.extend_from_slice(&[BalanceDelta { if store
ord: vault_log.ordinal(), .get_last(format!("pool:{}", &component_id[..42]))
tx: Some(vault_log.receipt.transaction.into()), .is_some()
token: ev.token.to_vec(), {
delta: ev.cash_delta.to_signed_bytes_be(), deltas.extend_from_slice(&[BalanceDelta {
component_id: component_id.as_bytes().to_vec(), ord: vault_log.ordinal(),
}]); tx: Some(vault_log.receipt.transaction.into()),
token: ev.token.to_vec(),
delta: ev.cash_delta.to_signed_bytes_be(),
component_id: component_id.as_bytes().to_vec(),
}]);
}
} }
deltas deltas

View File

@@ -1,7 +1,7 @@
specVersion: v0.1.0 specVersion: v0.1.0
package: package:
name: "ethereum_balancer_v2" name: "ethereum_balancer_v2"
version: v0.2.3 version: v0.2.4
protobuf: protobuf:
files: files: