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

Function postgres_ethflow_data_order_roundtrip

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

Source from the content-addressed store, hash-verified

1314 #[tokio::test]
1315 #[ignore]
1316 async fn postgres_ethflow_data_order_roundtrip() {
1317 let mut db = PgConnection::connect("postgresql://").await.unwrap();
1318 let mut db = db.begin().await.unwrap();
1319 crate::clear_DANGER_(&mut db).await.unwrap();
1320
1321 let order = Order::default();
1322 let user_valid_to = 4i64;
1323 insert_or_overwrite_ethflow_order(
1324 &mut db,
1325 &EthOrderPlacement {
1326 uid: OrderUid::default(),
1327 valid_to: user_valid_to,
1328 },
1329 )
1330 .await
1331 .unwrap();
1332 insert_order(&mut db, &order).await.unwrap();
1333 insert_refund_tx_hash(
1334 &mut db,
1335 &Refund {
1336 order_uid: order.uid,
1337 ..Default::default()
1338 },
1339 )
1340 .await
1341 .unwrap();
1342 let order_ = single_full_order_with_quote(&mut db, &order.uid)
1343 .await
1344 .unwrap()
1345 .unwrap()
1346 .full_order;
1347 assert_eq!(
1348 Some((Some(Default::default()), user_valid_to)),
1349 order_.ethflow_data
1350 );
1351 }
1352
1353 #[tokio::test]
1354 #[ignore]

Callers

nothing calls this directly

Calls 7

clear_DANGER_Function · 0.85
insert_refund_tx_hashFunction · 0.85
unwrapMethod · 0.80
insert_orderFunction · 0.70
connectFunction · 0.50

Tested by

no test coverage detected