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

Source from the content-addressed store, hash-verified

1244 #[tokio::test]
1245 #[ignore]
1246 async fn postgres_ethflow_data_order_roundtrip() {
1247 let mut db = PgConnection::connect("postgresql://").await.unwrap();
1248 let mut db = db.begin().await.unwrap();
1249 crate::clear_DANGER_(&mut db).await.unwrap();
1250
1251 let order = Order::default();
1252 let user_valid_to = 4i64;
1253 insert_or_overwrite_ethflow_order(
1254 &mut db,
1255 &EthOrderPlacement {
1256 uid: OrderUid::default(),
1257 valid_to: user_valid_to,
1258 },
1259 )
1260 .await
1261 .unwrap();
1262 insert_order(&mut db, &order).await.unwrap();
1263 insert_refund_tx_hash(
1264 &mut db,
1265 &Refund {
1266 order_uid: order.uid,
1267 ..Default::default()
1268 },
1269 )
1270 .await
1271 .unwrap();
1272 let order_ = single_full_order_with_quote(&mut db, &order.uid)
1273 .await
1274 .unwrap()
1275 .unwrap()
1276 .full_order;
1277 assert_eq!(
1278 Some((Some(Default::default()), user_valid_to)),
1279 order_.ethflow_data
1280 );
1281 }
1282
1283 #[tokio::test]
1284 #[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