Skip to content

Commit

Permalink
change table schema and core implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
lambda-0x committed Aug 18, 2024
1 parent 705b55a commit 1436ca7
Show file tree
Hide file tree
Showing 6 changed files with 256 additions and 89 deletions.
4 changes: 2 additions & 2 deletions crates/torii/core/src/processors/erc20_legacy_transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ where

async fn process(
&self,
_world: &WorldContractReader<P>,
world: &WorldContractReader<P>,
db: &mut Sql,
_block_number: u64,
_block_timestamp: u64,
Expand All @@ -50,7 +50,7 @@ where
let value = U256Cainome::cairo_deserialize(&event.data, 2)?;
let value = U256::from_words(value.low, value.high);

db.handle_erc20_transfer(token_address, from, to, value).await?;
db.handle_erc20_transfer(token_address, from, to, value, world.provider()).await?;
info!(target: LOG_TARGET,from = ?from, to = ?to, value = ?value, "Legacy ERC20 Transfer");

Ok(())
Expand Down
4 changes: 2 additions & 2 deletions crates/torii/core/src/processors/erc20_transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ where

async fn process(
&self,
_world: &WorldContractReader<P>,
world: &WorldContractReader<P>,
db: &mut Sql,
_block_number: u64,
_block_timestamp: u64,
Expand All @@ -50,7 +50,7 @@ where
let value = U256Cainome::cairo_deserialize(&event.data, 0)?;
let value = U256::from_words(value.low, value.high);

db.handle_erc20_transfer(token_address, from, to, value).await?;
db.handle_erc20_transfer(token_address, from, to, value, world.provider()).await?;
info!(target: LOG_TARGET,from = ?from, to = ?to, value = ?value, "ERC20 Transfer");

Ok(())
Expand Down
4 changes: 2 additions & 2 deletions crates/torii/core/src/processors/erc721_transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ where

async fn process(
&self,
_world: &WorldContractReader<P>,
world: &WorldContractReader<P>,
db: &mut Sql,
_block_number: u64,
_block_timestamp: u64,
Expand All @@ -51,7 +51,7 @@ where
let token_id = U256Cainome::cairo_deserialize(&event.keys, 3)?;
let token_id = U256::from_words(token_id.low, token_id.high);

db.handle_erc721_transfer(token_address, from, to, token_id).await?;
db.handle_erc721_transfer(token_address, from, to, token_id, world.provider()).await?;
info!(target: LOG_TARGET, from = ?from, to = ?to, token_id = ?token_id, "ERC721 Transfer");

Ok(())
Expand Down
Loading

0 comments on commit 1436ca7

Please sign in to comment.