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:1206–1241  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1204 #[tokio::test]
1205 #[ignore]
1206 async fn postgres_ethflow_data_order_roundtrip() {
1207 let mut db = PgConnection::connect("postgresql://").await.unwrap();
1208 let mut db = db.begin().await.unwrap();
1209 crate::clear_DANGER_(&mut db).await.unwrap();
1210
1211 let order = Order::default();
1212 let user_valid_to = 4i64;
1213 insert_or_overwrite_ethflow_order(
1214 &mut db,
1215 &EthOrderPlacement {
1216 uid: OrderUid::default(),
1217 valid_to: user_valid_to,
1218 },
1219 )
1220 .await
1221 .unwrap();
1222 insert_order(&mut db, &order).await.unwrap();
1223 insert_refund_tx_hash(
1224 &mut db,
1225 &Refund {
1226 order_uid: order.uid,
1227 ..Default::default()
1228 },
1229 )
1230 .await
1231 .unwrap();
1232 let order_ = single_full_order_with_quote(&mut db, &order.uid)
1233 .await
1234 .unwrap()
1235 .unwrap()
1236 .full_order;
1237 assert_eq!(
1238 Some((Some(Default::default()), user_valid_to)),
1239 order_.ethflow_data
1240 );
1241 }
1242
1243 #[tokio::test]
1244 #[ignore]

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected