@@ -204,6 +204,7 @@ impl ClientBuilder {
204204 ///
205205 /// Use [ClientBuilder::aggregator] if you don't need to set a custom [AggregatorClient]
206206 /// to request data from the aggregator.
207+ #[ deprecated( since = "0.12.33" , note = "Will be removed in 0.13.0" ) ]
207208 pub fn new ( genesis_verification_key : & str ) -> ClientBuilder {
208209 Self {
209210 aggregator_endpoint : None ,
@@ -382,6 +383,7 @@ impl ClientBuilder {
382383 }
383384
384385 /// Set the [AggregatorClient] that will be used to request data to the aggregator.
386+ #[ deprecated( since = "0.12.33" , note = "Will be removed in 0.13.0" ) ]
385387 pub fn with_aggregator_client (
386388 mut self ,
387389 aggregator_client : Arc < dyn AggregatorClient > ,
@@ -485,7 +487,7 @@ mod tests {
485487 #[ tokio:: test]
486488 async fn compute_http_headers_returns_options_http_headers ( ) {
487489 let http_headers = default_headers ( ) ;
488- let client_builder = ClientBuilder :: new ( "" ) . with_options ( ClientOptions {
490+ let client_builder = ClientBuilder :: aggregator ( "" , "" ) . with_options ( ClientOptions {
489491 http_headers : Some ( http_headers. clone ( ) ) ,
490492 } ) ;
491493
@@ -497,7 +499,7 @@ mod tests {
497499 #[ tokio:: test]
498500 async fn compute_http_headers_with_origin_tag_returns_options_http_headers_with_origin_tag ( ) {
499501 let http_headers = default_headers ( ) ;
500- let client_builder = ClientBuilder :: new ( "" )
502+ let client_builder = ClientBuilder :: aggregator ( "" , "" )
501503 . with_options ( ClientOptions {
502504 http_headers : Some ( http_headers. clone ( ) ) ,
503505 } )
@@ -514,14 +516,14 @@ mod tests {
514516
515517 #[ tokio:: test]
516518 async fn test_with_origin_tag_not_overwrite_other_client_options_attributes ( ) {
517- let builder = ClientBuilder :: new ( "" )
519+ let builder = ClientBuilder :: aggregator ( "" , "" )
518520 . with_options ( ClientOptions { http_headers : None } )
519521 . with_origin_tag ( Some ( "TEST" . to_string ( ) ) ) ;
520522 assert_eq ! ( None , builder. options. http_headers) ;
521523 assert_eq ! ( Some ( "TEST" . to_string( ) ) , builder. origin_tag) ;
522524
523525 let http_headers = HashMap :: from ( [ ( "Key" . to_string ( ) , "Value" . to_string ( ) ) ] ) ;
524- let builder = ClientBuilder :: new ( "" )
526+ let builder = ClientBuilder :: aggregator ( "" , "" )
525527 . with_options ( ClientOptions {
526528 http_headers : Some ( http_headers. clone ( ) ) ,
527529 } )
@@ -536,7 +538,7 @@ mod tests {
536538 let client_options = ClientOptions {
537539 http_headers : Some ( http_headers. clone ( ) ) ,
538540 } ;
539- let builder = ClientBuilder :: new ( "" )
541+ let builder = ClientBuilder :: aggregator ( "" , "" )
540542 . with_options ( client_options)
541543 . with_origin_tag ( None ) ;
542544
@@ -547,7 +549,7 @@ mod tests {
547549 #[ tokio:: test]
548550 async fn compute_http_headers_with_client_type_returns_options_http_headers_with_client_type ( ) {
549551 let http_headers = HashMap :: from ( [ ( "Key" . to_string ( ) , "Value" . to_string ( ) ) ] ) ;
550- let client_builder = ClientBuilder :: new ( "" )
552+ let client_builder = ClientBuilder :: aggregator ( "" , "" )
551553 . with_options ( ClientOptions {
552554 http_headers : Some ( http_headers. clone ( ) ) ,
553555 } )
@@ -573,7 +575,7 @@ mod tests {
573575 MITHRIL_CLIENT_TYPE_HEADER . to_string ( ) ,
574576 "client type from options" . to_string ( ) ,
575577 ) ] ) ;
576- let client_builder = ClientBuilder :: new ( "" ) . with_options ( ClientOptions {
578+ let client_builder = ClientBuilder :: aggregator ( "" , "" ) . with_options ( ClientOptions {
577579 http_headers : Some ( http_headers. clone ( ) ) ,
578580 } ) ;
579581
@@ -584,14 +586,14 @@ mod tests {
584586
585587 #[ tokio:: test]
586588 async fn test_with_client_type_not_overwrite_other_client_options_attributes ( ) {
587- let builder = ClientBuilder :: new ( "" )
589+ let builder = ClientBuilder :: aggregator ( "" , "" )
588590 . with_options ( ClientOptions { http_headers : None } )
589591 . with_client_type ( Some ( "TEST" . to_string ( ) ) ) ;
590592 assert_eq ! ( None , builder. options. http_headers) ;
591593 assert_eq ! ( Some ( "TEST" . to_string( ) ) , builder. client_type) ;
592594
593595 let http_headers = HashMap :: from ( [ ( "Key" . to_string ( ) , "Value" . to_string ( ) ) ] ) ;
594- let builder = ClientBuilder :: new ( "" )
596+ let builder = ClientBuilder :: aggregator ( "" , "" )
595597 . with_options ( ClientOptions {
596598 http_headers : Some ( http_headers. clone ( ) ) ,
597599 } )
@@ -603,7 +605,7 @@ mod tests {
603605 #[ tokio:: test]
604606 async fn test_given_a_none_client_type_compute_http_headers_will_set_client_type_to_default_value ( )
605607 {
606- let builder_without_client_type = ClientBuilder :: new ( "" ) ;
608+ let builder_without_client_type = ClientBuilder :: aggregator ( "" , "" ) ;
607609 let computed_headers = builder_without_client_type. compute_http_headers ( ) ;
608610
609611 assert_eq ! (
@@ -614,7 +616,8 @@ mod tests {
614616 ) ] )
615617 ) ;
616618
617- let builder_with_none_client_type = ClientBuilder :: new ( "" ) . with_client_type ( None ) ;
619+ let builder_with_none_client_type =
620+ ClientBuilder :: aggregator ( "" , "" ) . with_client_type ( None ) ;
618621 let computed_headers = builder_with_none_client_type. compute_http_headers ( ) ;
619622
620623 assert_eq ! (
@@ -633,7 +636,7 @@ mod tests {
633636 MITHRIL_CLIENT_TYPE_HEADER . to_string ( ) ,
634637 "client type from options" . to_string ( ) ,
635638 ) ] ) ;
636- let client_builder = ClientBuilder :: new ( "" )
639+ let client_builder = ClientBuilder :: aggregator ( "" , "" )
637640 . with_options ( ClientOptions {
638641 http_headers : Some ( http_headers. clone ( ) ) ,
639642 } )
0 commit comments