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

Function postgres_gets_event

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected