Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
execute queue when new token is registered
Browse files Browse the repository at this point in the history
lambda-0x committed Oct 2, 2024
1 parent a7e55ce commit a903bdb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crates/torii/core/src/sql/erc.rs
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@ impl Sql {

if !token_exists {
self.register_erc20_token_metadata(contract_address, &token_id, provider).await?;
self.query_queue.execute_all().await?;

Check warning on line 33 in crates/torii/core/src/sql/erc.rs

Codecov / codecov/patch

crates/torii/core/src/sql/erc.rs#L33

Added line #L33 was not covered by tests
}

self.store_erc_transfer_event(
@@ -82,6 +83,7 @@ impl Sql {

if !token_exists {
self.register_erc721_token_metadata(contract_address, &token_id, provider).await?;
self.query_queue.execute_all().await?;

Check warning on line 86 in crates/torii/core/src/sql/erc.rs

Codecov / codecov/patch

crates/torii/core/src/sql/erc.rs#L86

Added line #L86 was not covered by tests
}

self.store_erc_transfer_event(
@@ -329,9 +331,6 @@ impl Sql {
}

pub async fn apply_cache_diff(&mut self) -> Result<()> {
// execute the query queue to apply any queries registering token metadata
self.query_queue.execute_all().await?;

for ((contract_type, id_str), balance) in self.local_cache.erc_cache.iter() {

Check warning on line 334 in crates/torii/core/src/sql/erc.rs

Codecov / codecov/patch

crates/torii/core/src/sql/erc.rs#L333-L334

Added lines #L333 - L334 were not covered by tests
let id = id_str.split(FELT_DELIMITER).collect::<Vec<&str>>();
match contract_type {

0 comments on commit a903bdb

Please sign in to comment.