@@ -103,7 +103,9 @@ type Balance = U256;
103103/// Information for Ravs that are abstracted away from the SignedRav itself
104104#[ derive( Debug , Default , PartialEq , Eq ) ]
105105pub struct RavInformation {
106+ /// Allocation Id of a Rav
106107 pub allocation_id : Address ,
108+ /// Value Aggregate of a Rav
107109 pub value_aggregate : u128 ,
108110}
109111
@@ -160,7 +162,7 @@ pub enum ReceiptFees {
160162 Retry ,
161163}
162164
163- /// Enum containing all types of messages that a SenderAccount can receive
165+ /// Enum containing all types of messages that a [ SenderAccount] can receive
164166#[ derive( Debug ) ]
165167pub enum SenderAccountMessage {
166168 /// Updates the sender balance and
@@ -205,6 +207,7 @@ pub struct SenderAccount;
205207
206208/// Arguments received in startup while spawing [SenderAccount] actor
207209pub struct SenderAccountArgs {
210+ /// Configuration derived from config.toml
208211 pub config : & ' static SenderAccountConfig ,
209212
210213 /// Connection to database
@@ -318,20 +321,32 @@ pub struct State {
318321 config : & ' static SenderAccountConfig ,
319322}
320323
324+ /// Configuration derived from config.toml
321325pub struct SenderAccountConfig {
326+ /// Buffer used for the receipts
322327 pub rav_request_buffer : Duration ,
328+ /// Maximum amount is willing to lose
323329 pub max_amount_willing_to_lose_grt : u128 ,
330+ /// What value triggers a new Rav request
324331 pub trigger_value : u128 ,
325332
326333 // allocation config
334+ /// Timeout config for rav requests
327335 pub rav_request_timeout : Duration ,
336+ /// Limit of receipts sent in a Rav Request
328337 pub rav_request_receipt_limit : u64 ,
338+ /// Current indexer address
329339 pub indexer_address : Address ,
340+ /// Polling interval for escrow subgraph
330341 pub escrow_polling_interval : Duration ,
342+ /// Timeout used while creating [SenderAccount]
343+ ///
344+ /// This is reached if the database is too slow
331345 pub tap_sender_timeout : Duration ,
332346}
333347
334348impl SenderAccountConfig {
349+ /// Creates a [SenderAccountConfig] by getting a reference of [indexer_config::Config]
335350 pub fn from_config ( config : & indexer_config:: Config ) -> Self {
336351 Self {
337352 rav_request_buffer : config. tap . rav_request . timestamp_buffer_secs ,
@@ -1232,6 +1247,7 @@ impl Actor for SenderAccount {
12321247}
12331248
12341249impl SenderAccount {
1250+ /// Deny sender by giving `sender` [Address]
12351251 pub async fn deny_sender ( pool : & PgPool , sender : Address ) {
12361252 sqlx:: query!(
12371253 r#"
@@ -1248,6 +1264,7 @@ impl SenderAccount {
12481264
12491265#[ cfg( test) ]
12501266pub mod tests {
1267+ #![ allow( missing_docs) ]
12511268 use std:: {
12521269 collections:: { HashMap , HashSet } ,
12531270 sync:: atomic:: AtomicU32 ,
@@ -1326,6 +1343,7 @@ pub mod tests {
13261343 }
13271344 }
13281345
1346+ /// Prefix shared between tests so we don't have conflicts in the global registry
13291347 pub static PREFIX_ID : AtomicU32 = AtomicU32 :: new ( 0 ) ;
13301348 const ESCROW_VALUE : u128 = 1000 ;
13311349 const BUFFER_DURATION : Duration = Duration :: from_millis ( 100 ) ;
0 commit comments