Skip to content

Commit

Permalink
feat(sana): insert currency_address into token_event table (#484)
Browse files Browse the repository at this point in the history
  • Loading branch information
remiroyc authored Oct 10, 2024
1 parent 4a33a1f commit be81aff
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/sana/src/storage/sqlx/default_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ impl Storage for PostgresStorage {
return Ok(());
}

let q = "INSERT INTO token_event (token_event_id, contract_address, chain_id, token_id, token_id_hex, event_type, block_timestamp, transaction_hash, to_address, from_address, amount)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11) ON CONFLICT (token_event_id) DO NOTHING";
let q = "INSERT INTO token_event (token_event_id, contract_address, chain_id, token_id, token_id_hex, event_type, block_timestamp, transaction_hash, to_address, from_address, amount, currency_address)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) ON CONFLICT (token_event_id) DO NOTHING";

let event_type = self.to_title_case(&event.event_type.to_string().to_lowercase());

Expand All @@ -285,6 +285,7 @@ impl Storage for PostgresStorage {
.bind(event.to_address.clone())
.bind(event.from_address.clone())
.bind(event.price.clone())
.bind(event.currency_address.clone())
.execute(&self.pool)
.await?;

Expand Down

0 comments on commit be81aff

Please sign in to comment.