File tree Expand file tree Collapse file tree
aggregation_mode/payments_poller/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ async fn main() {
3333 let payments_poller = match PaymentsPoller :: new ( db, config) {
3434 Ok ( poller) => poller,
3535 Err ( err) => {
36- tracing:: error!( "Failed to create Payments Poller: {err}" ) ;
36+ tracing:: error!( "Failed to create Payments Poller: {err:? }" ) ;
3737 return ;
3838 }
3939 } ;
Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ use alloy::{
1111} ;
1212use sqlx:: types:: BigDecimal ;
1313
14+ #[ derive( Debug , Clone ) ]
15+ pub enum PaymentsPollerError {
16+ ReadLastBlockError ( String ) ,
17+ }
18+
1419pub struct PaymentsPoller {
1520 db : Db ,
1621 proof_aggregation_service : AggregationModePaymentServiceContract ,
@@ -19,7 +24,7 @@ pub struct PaymentsPoller {
1924}
2025
2126impl PaymentsPoller {
22- pub fn new ( db : Db , config : Config ) -> Result < Self , Box < dyn std :: error :: Error > > {
27+ pub fn new ( db : Db , config : Config ) -> Result < Self , PaymentsPollerError > {
2328 let rpc_url = config. eth_rpc_url . parse ( ) . expect ( "RPC URL should be valid" ) ;
2429 let rpc_provider = ProviderBuilder :: new ( ) . connect_http ( rpc_url) ;
2530 let proof_aggregation_service = AggregationModePaymentService :: new (
@@ -29,7 +34,9 @@ impl PaymentsPoller {
2934 ) ;
3035
3136 // This check is here to catch early failures on last block fetching
32- let _ = config. get_last_block_fetched ( ) ?;
37+ let _ = config
38+ . get_last_block_fetched ( )
39+ . map_err ( |err| PaymentsPollerError :: ReadLastBlockError ( err. to_string ( ) ) ) ;
3340
3441 Ok ( Self {
3542 db,
You can’t perform that action at this time.
0 commit comments