Skip to content

Commit

Permalink
fix: adding token balance changes to tx changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ignazio-bovo committed Jan 31, 2025
1 parent 74402a8 commit 957f4ed
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion substreams/crates/tycho-substreams/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use crate::{
};
use substreams_ethereum::pb::eth::{
self,
v2::{block::DetailLevel, BigInt, CallType, TransactionTrace},
v2::{block::DetailLevel, CallType, TransactionTrace},
};

/// Extracts and aggregates contract changes from a block.
Expand Down
4 changes: 4 additions & 0 deletions substreams/crates/tycho-substreams/src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ impl TransactionChangesBuilder {
if !change.code.is_empty() {
c.set_code(&change.code)
}
if !change.token_balances.is_empty() {
c.upsert_token_balances(&change.token_balances)
}
})
.or_insert_with(|| {
let mut c = InterimContractChange::new(
Expand All @@ -61,6 +64,7 @@ impl TransactionChangesBuilder {
c.upsert_slots(&change.slots);
c.set_code(&change.code);
c.set_balance(&change.balance);
c.upsert_token_balances(&change.token_balances);
c
});
}
Expand Down
20 changes: 12 additions & 8 deletions substreams/ethereum-balancer-v3/integration_test.tycho.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ tests:
- "0x0FE906e030a44eF24CA8c7dC7B7c53A6C4F00ce9"
- "0x775F661b0bD1739349b9A2A3EF60be277c5d2D29"
static_attributes:
fee: "0x5af3107a4000"
manual_updates: "0x01"
pool_type: "0x537461626c65506f6f6c466163746f7279"
bpt: "0xc4ce391d82d164c166df9c8336ddf84206b2f812"
manual_updates: "0x01"
erc4626: "0x01"
fee: "0x5af3107a4000"
skip_simulation: true
creation_tx: "0xecfe638ea155e78ca2698bea0bee5f86c2f77abe3e9dc93ed19ab6e674165b95"

Expand All @@ -39,10 +40,11 @@ tests:
- "0x249ca82617ec3dfb2589c4c17ab7ec9765350a18"
- "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
static_attributes:
normalized_weights: "0x5b22307830623161326263326563353030303030222c22307830326336386166306262313430303030225d"
manual_updates: "0x01"
pool_type: "0x5765696768746564506f6f6c466163746f7279"
erc4626: "0x00"
normalized_weights: "0x5b22307830623161326263326563353030303030222c22307830326336386166306262313430303030225d"
fee: "0x038d7ea4c68000"
pool_type: "0x5765696768746564506f6f6c466163746f7279"
skip_simulation: true
creation_tx: "0xaf0f8da4b7b148f156605673c6ac56657f67c47001aadd5b3b64d6cb787daad4"

Expand All @@ -55,9 +57,10 @@ tests:
- "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
- "0x440017A1b021006d556d7fc06A54c32E42Eb745B"
static_attributes:
normalized_weights: "0x5b22307830366630356235396433623230303030222c22307830366630356235396433623230303030225d"
manual_updates: "0x01"
pool_type: "0x5765696768746564506f6f6c466163746f7279"
erc4626: "0x00"
manual_updates: "0x01"
normalized_weights: "0x5b22307830366630356235396433623230303030222c22307830366630356235396433623230303030225d"
fee: "0x0aa87bee538000"
skip_simulation: false
creation_tx: "0x50a58ca41af90029a67bc7f4305cceb1e85800246f9c559fa74d8625ddfe14ed"
Expand All @@ -73,9 +76,10 @@ tests:
- "0x0bfc9d54Fc184518A81162F8fB99c2eACa081202"
- "0xA35b1B31Ce002FBF2058D22F30f95D405200A15b"
static_attributes:
bpt: "0x4ab7ab316d43345009b2140e0580b072eec7df16"
pool_type: "0x537461626c65506f6f6c466163746f7279"
fee: "0x016bcc41e90000"
manual_updates: "0x01"
erc4626: "0x01"
pool_type: "0x537461626c65506f6f6c466163746f7279"
bpt: "0x4ab7ab316d43345009b2140e0580b072eec7df16"
skip_simulation: false
creation_tx: "0x6e8aea6ed4e566709c35cbb4298f89eac74ba5c39f64927a47b07de204dc8c9a"

0 comments on commit 957f4ed

Please sign in to comment.