11use std:: any:: type_name;
2+ use std:: fmt:: Debug ;
23use std:: future:: Future ;
34use std:: sync:: Arc ;
45
@@ -37,7 +38,7 @@ type L1ScraperResult<T, B> = Result<T, L1ScraperError<B>>;
3738// Sensible lower bound.
3839const L1_BLOCK_TIME : u64 = 10 ;
3940
40- pub struct L1Scraper < BaseLayerType : BaseLayerContract > {
41+ pub struct L1Scraper < BaseLayerType : BaseLayerContract + Send + Sync + Debug > {
4142 pub config : L1ScraperConfig ,
4243 pub base_layer : BaseLayerType ,
4344 pub scrape_from_this_l1_block : Option < L1BlockReference > ,
@@ -46,7 +47,7 @@ pub struct L1Scraper<BaseLayerType: BaseLayerContract> {
4647 pub clock : Arc < dyn Clock > ,
4748}
4849
49- impl < BaseLayerType : BaseLayerContract + Send + Sync > L1Scraper < BaseLayerType > {
50+ impl < BaseLayerType : BaseLayerContract + Send + Sync + Debug > L1Scraper < BaseLayerType > {
5051 pub async fn new (
5152 config : L1ScraperConfig ,
5253 l1_provider_client : SharedL1ProviderClient ,
@@ -391,7 +392,9 @@ impl<BaseLayerType: BaseLayerContract + Send + Sync> L1Scraper<BaseLayerType> {
391392}
392393
393394#[ async_trait]
394- impl < BaseLayerType : BaseLayerContract + Send + Sync > ComponentStarter for L1Scraper < BaseLayerType > {
395+ impl < BaseLayerType : BaseLayerContract + Send + Sync + Debug > ComponentStarter
396+ for L1Scraper < BaseLayerType >
397+ {
395398 async fn start ( & mut self ) {
396399 info ! ( "Starting component {}." , type_name:: <Self >( ) ) ;
397400 register_scraper_metrics ( ) ;
@@ -400,7 +403,7 @@ impl<BaseLayerType: BaseLayerContract + Send + Sync> ComponentStarter for L1Scra
400403}
401404
402405#[ derive( Error , Debug ) ]
403- pub enum L1ScraperError < BaseLayerType : BaseLayerContract + Send + Sync > {
406+ pub enum L1ScraperError < BaseLayerType : BaseLayerContract + Send + Sync + Debug > {
404407 #[ error( "Base layer error: {0}" ) ]
405408 BaseLayerError ( BaseLayerType :: Error ) ,
406409 #[ error(
@@ -421,7 +424,9 @@ pub enum L1ScraperError<BaseLayerType: BaseLayerContract + Send + Sync> {
421424 NeedsRestart ,
422425}
423426
424- impl < BaseLayerType : BaseLayerContract + Send + Sync > PartialEq for L1ScraperError < BaseLayerType > {
427+ impl < BaseLayerType : BaseLayerContract + Send + Sync + Debug > PartialEq
428+ for L1ScraperError < BaseLayerType >
429+ {
425430 fn eq ( & self , other : & Self ) -> bool {
426431 match ( self , other) {
427432 ( Self :: BaseLayerError ( e1) , Self :: BaseLayerError ( e2) ) => e1 == e2,
@@ -440,7 +445,7 @@ impl<BaseLayerType: BaseLayerContract + Send + Sync> PartialEq for L1ScraperErro
440445}
441446
442447// TODO(guyn): get rid of finality_too_high, use a better error.
443- impl < BaseLayerType : BaseLayerContract + Send + Sync > L1ScraperError < BaseLayerType > {
448+ impl < BaseLayerType : BaseLayerContract + Send + Sync + Debug > L1ScraperError < BaseLayerType > {
444449 /// Pass any base layer errors. In the rare case that the finality is bigger than the latest L1
445450 /// block number, return FinalityTooHigh.
446451 pub async fn finality_too_high (
@@ -458,7 +463,7 @@ impl<BaseLayerType: BaseLayerContract + Send + Sync> L1ScraperError<BaseLayerTyp
458463 }
459464}
460465
461- fn handle_client_error < BaseLayerType : BaseLayerContract + Send + Sync > (
466+ fn handle_client_error < BaseLayerType : BaseLayerContract + Send + Sync + Debug > (
462467 client_result : Result < ( ) , L1ProviderClientError > ,
463468) -> Result < ( ) , L1ScraperError < BaseLayerType > > {
464469 let Err ( error) = client_result else {
0 commit comments