Skip to main content

tycho_simulation/evm/protocol/
mod.rs

1pub mod aerodrome_slipstreams;
2pub mod aerodrome_v1;
3mod clmm;
4pub mod cowamm;
5mod cpmm;
6pub mod ekubo;
7pub mod ekubo_v3;
8pub mod erc4626;
9pub mod etherfi;
10pub mod filters;
11pub mod fluid;
12pub mod native_wrapper;
13pub mod pancakeswap_v2;
14pub mod rocketpool;
15pub mod safe_math;
16pub mod u256_num;
17pub mod uniswap_v2;
18pub mod uniswap_v3;
19pub mod uniswap_v4;
20pub mod utils;
21pub mod velodrome_slipstreams;
22pub mod vm;
23
24#[cfg(test)]
25mod test_utils {
26    use std::collections::HashMap;
27
28    use tycho_client::feed::{synchronizer::ComponentWithState, BlockHeader};
29
30    use crate::protocol::models::TryFromWithBlock;
31
32    pub(super) async fn try_decode_snapshot_with_defaults<
33        T: TryFromWithBlock<ComponentWithState, BlockHeader>,
34    >(
35        snapshot: ComponentWithState,
36    ) -> Result<T, T::Error> {
37        T::try_from_with_header(
38            snapshot,
39            Default::default(),
40            &HashMap::default(),
41            &HashMap::default(),
42            &Default::default(),
43        )
44        .await
45    }
46}