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

Function postgres_read_quotes_roundtrip

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

Source from the content-addressed store, hash-verified

1558 #[tokio::test]
1559 #[ignore]
1560 async fn postgres_read_quotes_roundtrip() {
1561 let mut db = PgConnection::connect("postgresql://").await.unwrap();
1562 let mut db = db.begin().await.unwrap();
1563 crate::clear_DANGER_(&mut db).await.unwrap();
1564
1565 for i in 0..10 {
1566 let quote = Quote {
1567 order_uid: ByteArray([i; 56]),
1568 ..Default::default()
1569 };
1570 insert_quote(&mut db, &quote).await.unwrap();
1571 }
1572 let quote_ids = (0..20) // add some non-existing ids
1573 .map(|i| ByteArray([i; 56]))
1574 .collect::<Vec<_>>();
1575
1576 let quotes = read_quotes(&mut db, &quote_ids).await.unwrap();
1577
1578 assert_eq!(quotes.len(), 10);
1579 }
1580
1581 #[tokio::test]
1582 #[ignore]

Callers

nothing calls this directly

Calls 6

connectFunction · 0.85
clear_DANGER_Function · 0.85
ByteArrayClass · 0.85
insert_quoteFunction · 0.85
read_quotesFunction · 0.85
unwrapMethod · 0.80

Tested by

no test coverage detected