bonomat
3 years ago
No known key found for this signature in database
GPG Key ID: E5F8E74C672BC666
1 changed files with
0 additions and
26 deletions
-
daemon/src/db.rs
|
|
@ -564,32 +564,6 @@ mod tests { |
|
|
|
assert_eq!(vec![cfd], loaded); |
|
|
|
} |
|
|
|
|
|
|
|
#[tokio::test] |
|
|
|
async fn test_insert_like_cfd_actor() { |
|
|
|
let mut conn = setup_test_db().await; |
|
|
|
|
|
|
|
let cfds = load_all_cfds(&mut conn).await.unwrap(); |
|
|
|
|
|
|
|
let (cfd_feed_sender, cfd_feed_receiver) = watch::channel(cfds.clone()); |
|
|
|
|
|
|
|
assert_eq!(cfd_feed_receiver.borrow().clone(), vec![]); |
|
|
|
|
|
|
|
let cfd_1 = Cfd::dummy(); |
|
|
|
db::insert_order(&cfd_1.order, &mut conn).await.unwrap(); |
|
|
|
cfd_actors::insert_cfd_and_send_to_feed(&cfd_1, &mut conn, &cfd_feed_sender) |
|
|
|
.await |
|
|
|
.unwrap(); |
|
|
|
|
|
|
|
assert_eq!(cfd_feed_receiver.borrow().clone(), vec![cfd_1.clone()]); |
|
|
|
|
|
|
|
let cfd_2 = Cfd::dummy(); |
|
|
|
db::insert_order(&cfd_2.order, &mut conn).await.unwrap(); |
|
|
|
cfd_actors::insert_cfd_and_send_to_feed(&cfd_2, &mut conn, &cfd_feed_sender) |
|
|
|
.await |
|
|
|
.unwrap(); |
|
|
|
assert_eq!(cfd_feed_receiver.borrow().clone(), vec![cfd_1, cfd_2]); |
|
|
|
} |
|
|
|
|
|
|
|
#[tokio::test] |
|
|
|
async fn test_insert_and_load_cfd_by_order_id() { |
|
|
|
let mut conn = setup_test_db().await; |
|
|
|