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

Function postgres_onchain_invalidated_orders

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

Source from the content-addressed store, hash-verified

1877 #[tokio::test]
1878 #[ignore]
1879 async fn postgres_onchain_invalidated_orders() {
1880 let mut db = PgConnection::connect("postgresql://").await.unwrap();
1881 let mut db = db.begin().await.unwrap();
1882 crate::clear_DANGER_(&mut db).await.unwrap();
1883
1884 let order = Order {
1885 uid: ByteArray([2u8; 56]),
1886 kind: OrderKind::Sell,
1887 sell_amount: 10.into(),
1888 buy_amount: 100.into(),
1889 valid_to: 3,
1890 partially_fillable: true,
1891 ..Default::default()
1892 };
1893 insert_order(&mut db, &order).await.unwrap();
1894 let result = single_full_order_with_quote(&mut db, &order.uid)
1895 .await
1896 .unwrap()
1897 .unwrap()
1898 .full_order;
1899 assert!(!result.invalidated);
1900 insert_onchain_invalidation(&mut db, &EventIndex::default(), &order.uid)
1901 .await
1902 .unwrap();
1903 let result = single_full_order_with_quote(&mut db, &order.uid)
1904 .await
1905 .unwrap()
1906 .unwrap()
1907 .full_order;
1908 assert!(result.invalidated);
1909 }
1910
1911 #[tokio::test]
1912 #[ignore]

Callers

nothing calls this directly

Calls 8

connectFunction · 0.85
clear_DANGER_Function · 0.85
ByteArrayClass · 0.85
unwrapMethod · 0.80
insert_orderFunction · 0.70
intoMethod · 0.45

Tested by

no test coverage detected