Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
kobayurii committed Oct 24, 2023
1 parent b1c2383 commit e5fecf4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
3 changes: 0 additions & 3 deletions database/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,6 @@ pub trait ScyllaStorageManager {
mut query: scylla::statement::query::Query,
consistency: Option<scylla::frame::types::Consistency>,
) -> anyhow::Result<PreparedStatement> {

// let mut query = scylla::statement::query::Query::new(query_text);

if let Some(consistency) = consistency {
query.set_consistency(consistency);
} else {
Expand Down
2 changes: 1 addition & 1 deletion readnode-primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use borsh::{BorshDeserialize, BorshSerialize};
use near_indexer_primitives::{views, CryptoHash, IndexerTransactionWithOutcome};
use serde::{Deserialize, Serialize};

#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Clone)]
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Debug)]
pub struct TransactionKey {
pub transaction_hash: String,
pub block_height: u64,
Expand Down
13 changes: 10 additions & 3 deletions tx-indexer/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,15 +351,15 @@ impl ScyllaStorageManager for ScyllaDBManager {
&scylla_db_session,
scylla::statement::query::Query::new(
"SELECT transaction_details FROM tx_indexer_cache.transactions WHERE block_height <= ? ALLOW FILTERING"
).with_page_size(10),
).with_page_size(1),
Some(scylla::frame::types::Consistency::LocalOne)
).await?,

cache_get_receipts: Self::prepare_query(
&scylla_db_session,
scylla::statement::query::Query::new(
"SELECT receipt, outcome FROM tx_indexer_cache.receipts_outcomes WHERE transaction_hash = ? AND block_height = ?"
).with_page_size(10),
).with_page_size(1),
Some(scylla::frame::types::Consistency::LocalOne)
).await?,

Expand Down Expand Up @@ -534,7 +534,14 @@ impl ScyllaDBManager {
readnode_primitives::CollectingTransactionDetails::try_from_slice(
&transaction_details,
)?;
result.insert(transaction_details.transaction_key(), transaction_details);
let transaction_key = transaction_details.transaction_key();
result.insert(transaction_key.clone(), transaction_details);
tracing::info!(
target: crate::storage::STORAGE,
"Transaction uploaded from db {} - {}",
transaction_key.transaction_hash,
transaction_key.block_height
);
}
Ok(result)
}
Expand Down
2 changes: 1 addition & 1 deletion tx-indexer/src/storage/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl HashStorageWithDB {
}
tracing::info!(
target: crate::storage::STORAGE,
"Transaction uploaded from storage {}",
"Transaction collected from db {}",
transaction_key.transaction_hash,
);
}
Expand Down

0 comments on commit e5fecf4

Please sign in to comment.