MCPcopy Create free account
hub / github.com/cowprotocol/services / postgres_limit_order_executed

Function postgres_limit_order_executed

crates/database/src/orders.rs:2584–2629  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2582 #[tokio::test]
2583 #[ignore]
2584 async fn postgres_limit_order_executed() {
2585 let mut db = PgConnection::connect("postgresql://").await.unwrap();
2586 let mut db = db.begin().await.unwrap();
2587 crate::clear_DANGER_(&mut db).await.unwrap();
2588
2589 let order_uid = ByteArray([1; 56]);
2590 insert_order(
2591 &mut db,
2592 &Order {
2593 uid: order_uid,
2594 ..Default::default()
2595 },
2596 )
2597 .await
2598 .unwrap();
2599
2600 let fee: BigDecimal = 0.into();
2601 let order = single_full_order_with_quote(&mut db, &order_uid)
2602 .await
2603 .unwrap()
2604 .unwrap()
2605 .full_order;
2606 assert_eq!(order.executed_fee, fee);
2607
2608 let fee: BigDecimal = 1.into();
2609 crate::order_execution::save(
2610 &mut db,
2611 &order_uid,
2612 1,
2613 0,
2614 Asset {
2615 amount: fee.clone(),
2616 token: Default::default(),
2617 },
2618 &[],
2619 )
2620 .await
2621 .unwrap();
2622
2623 let order = single_full_order_with_quote(&mut db, &order_uid)
2624 .await
2625 .unwrap()
2626 .unwrap()
2627 .full_order;
2628 assert_eq!(order.executed_fee, fee);
2629 }
2630
2631 #[tokio::test]
2632 #[ignore]

Callers

nothing calls this directly

Calls 9

clear_DANGER_Function · 0.85
ByteArrayClass · 0.85
unwrapMethod · 0.80
insert_orderFunction · 0.70
saveFunction · 0.70
connectFunction · 0.50
intoMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected