Skip to content

Commit

Permalink
short hash code display collision
Browse files Browse the repository at this point in the history
  • Loading branch information
0o-de-lally committed Nov 16, 2024
1 parent 933d229 commit 97ceee7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
21 changes: 15 additions & 6 deletions warehouse/src/load_tx_cypher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,22 @@ pub async fn impl_batch_tx_insert(

// Execute the query
let cypher_query = query(&cypher_string);
let mut res = pool.execute(cypher_query).await?;
let mut res = pool
.execute(cypher_query)
.await
.context("execute query error")?;

let row = res.next().await?.unwrap();
let created_accounts: u64 = row.get("created_accounts").unwrap();
let modified_accounts: u64 = row.get("modified_accounts").unwrap();
let unchanged_accounts: u64 = row.get("unchanged_accounts").unwrap();
let created_tx: u64 = row.get("created_tx").unwrap();
let row = res.next().await?.context("no row returned")?;
let created_accounts: u64 = row
.get("created_accounts")
.context("no created_accounts field")?;
let modified_accounts: u64 = row
.get("modified_accounts")
.context("no modified_accounts field")?;
let unchanged_accounts: u64 = row
.get("unchanged_accounts")
.context("no unchanged_accounts field")?;
let created_tx: u64 = row.get("created_tx").context("no created_tx field")?;

Ok(BatchTxReturn {
created_accounts,
Expand Down
2 changes: 1 addition & 1 deletion warehouse/src/table_structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl WarehouseTxMaster {

format!(
r#"{{tx_hash: "{}", block_datetime: datetime("{}"), block_timestamp: {}, relation: "{:?}", function: "{}", sender: "{}", args: {}, recipient: "{}"}}"#,
self.tx_hash, self.block_datetime.to_rfc3339(), self.block_timestamp, self.relation_label, self.function, self.sender, tx_args, recipient,
self.tx_hash.to_hex_literal(), self.block_datetime.to_rfc3339(), self.block_timestamp, self.relation_label, self.function, self.sender, tx_args, recipient,
)
}

Expand Down

0 comments on commit 97ceee7

Please sign in to comment.