Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(torii-sqlite): erc721 tokens upsert do nothing #2986

Merged
merged 3 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
) -> 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
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
Loading