Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkooo committed Feb 4, 2025
1 parent b7ac26d commit 4ee95eb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
2 changes: 1 addition & 1 deletion crates/torii/sqlite/src/executor/erc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ impl<'c, P: Provider + Sync + Send + 'static> Executor<'c, P> {
) -> Result<()> {
let query = sqlx::query(
"INSERT INTO tokens (id, contract_address, name, symbol, decimals, metadata) VALUES \
(?, ?, ?, ?, ?, ?)",
(?, ?, ?, ?, ?, ?) ON CONFLICT DO NOTHING",

Check warning on line 343 in crates/torii/sqlite/src/executor/erc.rs

View check run for this annotation

Codecov / codecov/patch

crates/torii/sqlite/src/executor/erc.rs#L343

Added line #L343 was not covered by tests
)
.bind(&result.query.token_id)
.bind(felt_to_sql_string(&result.query.contract_address))
Expand Down
10 changes: 0 additions & 10 deletions crates/torii/sqlite/src/executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,16 +621,6 @@ impl<'c, P: Provider + Sync + Send + 'static> Executor<'c, P> {
let semaphore = self.semaphore.clone();
let provider = self.provider.clone();

let token_exists =
sqlx::query_scalar::<_, i64>("SELECT COUNT(*) FROM tokens WHERE id = ?")
.bind(register_erc721_token.id.to_string())
.fetch_one(&mut **tx)
.await?;

if token_exists > 0 {
return Ok(());
}

let res = sqlx::query_as::<_, (String, String)>(&format!(
"SELECT name, symbol FROM {TOKENS_TABLE} WHERE id = ? LIMIT 1"

Check warning on line 625 in crates/torii/sqlite/src/executor/mod.rs

View check run for this annotation

Codecov / codecov/patch

crates/torii/sqlite/src/executor/mod.rs#L625

Added line #L625 was not covered by tests
))
Expand Down

0 comments on commit 4ee95eb

Please sign in to comment.