Skip to content

Commit

Permalink
names
Browse files Browse the repository at this point in the history
  • Loading branch information
0o-de-lally committed Dec 14, 2024
1 parent 00df737 commit 03df6b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/load_exchange_orders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::{
schema_exchange_orders::ExchangeOrder,
};

pub async fn swap_batch(
pub async fn exchange_txs_batch(
txs: &[ExchangeOrder],
pool: &Graph,
batch_size: usize,
Expand Down Expand Up @@ -99,7 +99,7 @@ pub async fn load_from_json(path: &Path, pool: &Graph, batch_size: usize) -> Res
let mut balances = BalanceTracker::new();
balances.replay_transactions(&mut orders)?;
let ledger_inserts = balances.submit_ledger(pool).await?;
info!("exchange ledger relations inserted: {}", ledger_inserts);
info!("exchange UserLedger relations inserted: {}", ledger_inserts);

swap_batch(&orders, pool, batch_size).await
exchange_txs_batch(&orders, pool, batch_size).await
}
6 changes: 3 additions & 3 deletions tests/test_analytics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async fn test_rms_single() -> Result<()> {
assert!(orders.len() == 25450);

// load 1000 orders
load_exchange_orders::swap_batch(&orders[..1000], &graph, 1000).await?;
load_exchange_orders::exchange_txs_batch(&orders[..1000], &graph, 1000).await?;

// get just one analytics result, never more than one (but can be empty)
let list = analytics::exchange_stats::query_rms_analytics_chunk(&graph, 900, 1, false).await?;
Expand Down Expand Up @@ -60,7 +60,7 @@ async fn test_rms_single_persist() -> Result<()> {
assert!(orders.len() == 25450);

// load 1000 orders
load_exchange_orders::swap_batch(&orders[..1000], &graph, 1000).await?;
load_exchange_orders::exchange_txs_batch(&orders[..1000], &graph, 1000).await?;

// get just one analytics result, never more than one (but can be empty)
let list = analytics::exchange_stats::query_rms_analytics_chunk(&graph, 900, 1, true).await?;
Expand Down Expand Up @@ -90,7 +90,7 @@ async fn test_rms_batch() -> Result<()> {
assert!(orders.len() == 25450);

// load 1000 orders
load_exchange_orders::swap_batch(&orders[..1000], &graph, 1000).await?;
load_exchange_orders::exchange_txs_batch(&orders[..1000], &graph, 1000).await?;

let list = analytics::exchange_stats::query_rms_analytics_concurrent(&graph, None, None, false)
.await?;
Expand Down
2 changes: 1 addition & 1 deletion tests/test_enrich_exchange.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ async fn e2e_swap_data() -> Result<()> {
assert!(orders.len() == 25450);

// load 1000 orders
load_exchange_orders::swap_batch(&orders[..1000], &graph, 1000).await?;
load_exchange_orders::exchange_txs_batch(&orders[..1000], &graph, 1000).await?;

// now check data was loaded
let mut result = graph
Expand Down

0 comments on commit 03df6b8

Please sign in to comment.