1
+ //! Logic and types for checkpoint specification
1
2
use std:: { path:: Path , sync:: Arc } ;
2
3
3
4
use alloy:: primitives:: { Address , BlockNumber } ;
@@ -14,8 +15,10 @@ use serde::{Deserialize, Serialize};
14
15
15
16
use crate :: variant:: AmmVariant ;
16
17
18
+ /// Default fee for AMM pools
17
19
pub const DEFAULT_FEE : u32 = 300 ;
18
20
21
+ /// Represents a single row of CSV
19
22
#[ derive( Clone , Debug , Deserialize , Serialize ) ]
20
23
pub struct SpecificationEntry {
21
24
pub variant : AmmVariant ,
@@ -25,6 +28,7 @@ pub struct SpecificationEntry {
25
28
}
26
29
27
30
impl SpecificationEntry {
31
+ /// Retrieves both the associated AMM factory and pool for this [`SpecificationEntry`]
28
32
async fn fetch (
29
33
& self ,
30
34
provider : Arc < ReqwestProvider > ,
@@ -63,10 +67,12 @@ impl SpecificationEntry {
63
67
}
64
68
}
65
69
70
+ /// Represents a sequence of CSV rows
66
71
#[ derive( Clone , Debug , Deserialize , Serialize ) ]
67
72
pub struct CheckpointSpecification ( pub Vec < SpecificationEntry > ) ;
68
73
69
74
impl CheckpointSpecification {
75
+ /// Reads a [`CheckpointSpecification`] from disk
70
76
pub fn load < P > ( path : P ) -> eyre:: Result < Self >
71
77
where
72
78
P : AsRef < Path > ,
@@ -78,6 +84,8 @@ impl CheckpointSpecification {
78
84
) )
79
85
}
80
86
87
+ /// Retrieves the entire set of AMM factories and pools specified in this
88
+ /// [`CheckpointSpecification`]
81
89
pub async fn fetch (
82
90
& self ,
83
91
provider : Arc < ReqwestProvider > ,
0 commit comments