|
5 | 5 | use alloy::{ |
6 | 6 | eips::BlockNumberOrTag, |
7 | 7 | network::Ethereum, |
8 | | - primitives::U256, |
9 | 8 | providers::{Provider, ProviderBuilder, RootProvider}, |
10 | 9 | sol, |
11 | 10 | sol_types::SolEvent, |
12 | 11 | }; |
13 | 12 | use alloy_node_bindings::{Anvil, AnvilInstance}; |
14 | 13 | use event_scanner::{ |
15 | 14 | EventFilter, EventScanner, EventScannerBuilder, Historic, LatestEvents, Live, Message, |
16 | | - SyncFromBlock, SyncFromLatestEvents, test_utils::LogMetadata, |
| 15 | + SyncFromBlock, SyncFromLatestEvents, |
17 | 16 | }; |
18 | 17 | use tokio_stream::wrappers::ReceiverStream; |
19 | 18 |
|
@@ -197,41 +196,3 @@ where |
197 | 196 | let contract = TestCounter::deploy(provider).await?; |
198 | 197 | Ok(contract) |
199 | 198 | } |
200 | | - |
201 | | -#[allow(dead_code)] |
202 | | -pub(crate) trait TestCounterExt { |
203 | | - async fn increase_and_get_meta( |
204 | | - &self, |
205 | | - ) -> anyhow::Result<LogMetadata<TestCounter::CountIncreased>>; |
206 | | - async fn decrease_and_get_meta( |
207 | | - &self, |
208 | | - ) -> anyhow::Result<LogMetadata<TestCounter::CountDecreased>>; |
209 | | -} |
210 | | - |
211 | | -impl<P: Provider + Clone> TestCounterExt for TestCounter::TestCounterInstance<P> { |
212 | | - async fn increase_and_get_meta( |
213 | | - &self, |
214 | | - ) -> anyhow::Result<LogMetadata<TestCounter::CountIncreased>> { |
215 | | - let receipt = self.increase().send().await?.get_receipt().await?; |
216 | | - let tx_hash = receipt.transaction_hash; |
217 | | - let new_count = receipt.decoded_log::<TestCounter::CountIncreased>().unwrap().data.newCount; |
218 | | - Ok(LogMetadata { |
219 | | - event: TestCounter::CountIncreased { newCount: U256::from(new_count) }, |
220 | | - address: *self.address(), |
221 | | - tx_hash, |
222 | | - }) |
223 | | - } |
224 | | - |
225 | | - async fn decrease_and_get_meta( |
226 | | - &self, |
227 | | - ) -> anyhow::Result<LogMetadata<TestCounter::CountDecreased>> { |
228 | | - let receipt = self.decrease().send().await?.get_receipt().await?; |
229 | | - let tx_hash = receipt.transaction_hash; |
230 | | - let new_count = receipt.decoded_log::<TestCounter::CountDecreased>().unwrap().data.newCount; |
231 | | - Ok(LogMetadata { |
232 | | - event: TestCounter::CountDecreased { newCount: U256::from(new_count) }, |
233 | | - address: *self.address(), |
234 | | - tx_hash, |
235 | | - }) |
236 | | - } |
237 | | -} |
0 commit comments