Skip to content

Commit

Permalink
patch tests
Browse files Browse the repository at this point in the history
  • Loading branch information
0o-de-lally committed Dec 13, 2024
1 parent 387b892 commit 3e9ef4a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
1 change: 0 additions & 1 deletion src/analytics/enrich_rms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ pub fn process_shill(all_transactions: &mut [ExchangeOrder]) {
}
OrderType::Sell => {
if comp.within_amount_lower_price > 0 {
dbg!(&comp);
current_order.accepter_shill_up = true
}
}
Expand Down
19 changes: 5 additions & 14 deletions tests/test_enrich_exchange.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn test_enrich_rms() {
}

#[test]
fn test_sell_order_shill() {
fn test_sell_shill_up() {
let path = env!("CARGO_MANIFEST_DIR");
let buf = PathBuf::from(path).join("tests/fixtures/savedOlOrders2.json");
let mut orders = extract_exchange_orders::read_orders_from_file(buf).unwrap();
Expand All @@ -53,9 +53,7 @@ fn test_sell_order_shill() {

let count_shill: Vec<_> = orders.iter().filter(|el| el.accepter_shill_up).collect();

dbg!(&count_shill.len());

// assert!(count_shill == 13723);
assert!(count_shill.len() == 6039);
assert!(orders.len() == 25450);
}

Expand All @@ -72,24 +70,17 @@ fn test_enrich_account_funding() {
}

#[test]
fn test_enrich_buy_shill() {
fn test_enrich_shill_down() {
let path = env!("CARGO_MANIFEST_DIR");
let buf = PathBuf::from(path).join("tests/fixtures/savedOlOrders2.json");
let mut orders = extract_exchange_orders::read_orders_from_file(buf).unwrap();
assert!(orders.len() == 25450);

enrich_rms::process_shill(&mut orders);

let count_shill = orders.iter().fold(0, |mut acc, el| {
if el.accepter_shill_down {
acc += 1
}
acc
});

dbg!(&count_shill);
let count_shill_down: Vec<_> = orders.iter().filter(|el| el.accepter_shill_down).collect();

// assert!(count_shill == 13723);
assert!(count_shill_down.len() == 2319);
assert!(orders.len() == 25450);
}

Expand Down

0 comments on commit 3e9ef4a

Please sign in to comment.