Skip to content

Commit

Permalink
fix(torii-sqlite): erc721 tokens upsert do nothing (#2986)
Browse files Browse the repository at this point in the history
* fix(torii-sqlite): erc721 tokens check both cache + db for write

* fix
  • Loading branch information
Larkooo authored Feb 5, 2025
1 parent 870087b commit 378b782
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
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",
)
.bind(&result.query.token_id)
.bind(felt_to_sql_string(&result.query.contract_address))
Expand Down
1 change: 1 addition & 0 deletions crates/torii/sqlite/src/executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ impl<'c, P: Provider + Sync + Send + 'static> Executor<'c, P> {
QueryType::RegisterErc721Token(register_erc721_token) => {
let semaphore = self.semaphore.clone();
let provider = self.provider.clone();

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

0 comments on commit 378b782

Please sign in to comment.