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

Function postgres_gets_event

crates/database/src/settlements.rs:133–185  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

131 #[tokio::test]
132 #[ignore]
133 async fn postgres_gets_event() {
134 let mut db = PgConnection::connect("postgresql://").await.unwrap();
135 let mut db = db.begin().await.unwrap();
136 crate::clear_DANGER_(&mut db).await.unwrap();
137
138 crate::events::append(
139 &mut db,
140 &[
141 (
142 EventIndex {
143 block_number: 0,
144 log_index: 0,
145 },
146 Event::Settlement(Settlement {
147 solver: Default::default(),
148 transaction_hash: ByteArray([0u8; 32]),
149 }),
150 ),
151 (
152 EventIndex {
153 block_number: 1,
154 log_index: 0,
155 },
156 Event::Settlement(Settlement {
157 solver: Default::default(),
158 transaction_hash: ByteArray([1u8; 32]),
159 }),
160 ),
161 (
162 EventIndex {
163 block_number: 2,
164 log_index: 0,
165 },
166 Event::Settlement(Settlement {
167 solver: Default::default(),
168 transaction_hash: ByteArray([2u8; 32]),
169 }),
170 ),
171 ],
172 )
173 .await
174 .unwrap();
175
176 let results = all_settlement_tx_hashes(&mut db).await.unwrap();
177 assert_eq!(
178 results,
179 &[
180 ByteArray([0u8; 32]),
181 ByteArray([1u8; 32]),
182 ByteArray([2u8; 32])
183 ]
184 );
185 }
186
187 #[tokio::test]
188 #[ignore]

Callers

nothing calls this directly

Calls 7

connectFunction · 0.85
clear_DANGER_Function · 0.85
ByteArrayClass · 0.85
all_settlement_tx_hashesFunction · 0.85
unwrapMethod · 0.80
appendFunction · 0.70
SettlementClass · 0.70

Tested by

no test coverage detected