From 18e0061a045b2f3bb19b0b231725adfadb41a6d3 Mon Sep 17 00:00:00 2001 From: 0o-de-lally <1364012+0o-de-lally@users.noreply.github.com> Date: Fri, 6 Dec 2024 14:03:00 -0500 Subject: [PATCH] add entrypoint test for exchange --- src/analytics/enrich_account_funding.rs | 2 +- tests/test_enrich_exchange.rs | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/analytics/enrich_account_funding.rs b/src/analytics/enrich_account_funding.rs index 5702908..d75522c 100644 --- a/src/analytics/enrich_account_funding.rs +++ b/src/analytics/enrich_account_funding.rs @@ -223,7 +223,7 @@ pub fn generate_cypher_query(map: String) -> String { ul.total_outflows = account.total_outflows, ul.daily_funding = account.daily_funding, ul.daily_inflows = account.daily_inflows, - ul.daily_outflows = account.daily_outflows, + ul.daily_outflows = account.daily_outflows MERGE (sa)-[r:DailyLedger]->(ul) SET r.date = datetime(account.date) RETURN COUNT(r) as merged_relations diff --git a/tests/test_enrich_exchange.rs b/tests/test_enrich_exchange.rs index 22c17ec..8772f19 100644 --- a/tests/test_enrich_exchange.rs +++ b/tests/test_enrich_exchange.rs @@ -174,3 +174,16 @@ async fn e2e_swap_data() -> Result<()> { Ok(()) } + +#[tokio::test] +async fn test_entry_point_exchange_load() -> Result<()>{ + let c = start_neo4j_container(); + let port = c.get_host_port_ipv4(7687); + let graph = get_neo4j_localhost_pool(port).await?; + maybe_create_indexes(&graph).await?; + + let path = env!("CARGO_MANIFEST_DIR"); + let buf = PathBuf::from(path).join("tests/fixtures/savedOlOrders2.json"); + load_exchange_orders::load_from_json(&buf, &graph, 250).await?; + Ok(()) +}