@@ -447,7 +447,7 @@ impl<P: Poll, CL: ChainListener> MicroSPVClient<P, CL> {
447
447
/// useful when you have a block source which is more censorship-resistant than others but
448
448
/// which only provides headers. In this case, we can use such source(s) to learn of a censorship
449
449
/// attack without giving up privacy by querying a privacy-losing block sources.
450
- pub fn init ( chain_tip : ValidatedBlockHeader , chain_poller : P , chain_listener : CL ) -> Self {
450
+ pub fn new ( chain_tip : ValidatedBlockHeader , chain_poller : P , chain_listener : CL ) -> Self {
451
451
let header_cache = HeaderCache :: new ( ) ;
452
452
let chain_notifier = ChainNotifier { header_cache } ;
453
453
Self { chain_tip, chain_poller, chain_notifier, chain_listener }
@@ -503,7 +503,7 @@ mod spv_client_tests {
503
503
let best_tip = chain. at_height ( 1 ) ;
504
504
505
505
let poller = poller:: ChainPoller :: new ( & mut chain as & mut dyn BlockSource , Network :: Testnet ) ;
506
- let mut client = MicroSPVClient :: init ( best_tip, poller, NullChainListener { } ) ;
506
+ let mut client = MicroSPVClient :: new ( best_tip, poller, NullChainListener { } ) ;
507
507
match client. poll_best_tip ( ) . await {
508
508
Err ( e) => assert_eq ! ( e, BlockSourceError :: Persistent ) ,
509
509
Ok ( _) => panic ! ( "Expected error" ) ,
@@ -517,7 +517,7 @@ mod spv_client_tests {
517
517
let common_tip = chain. tip ( ) ;
518
518
519
519
let poller = poller:: ChainPoller :: new ( & mut chain as & mut dyn BlockSource , Network :: Testnet ) ;
520
- let mut client = MicroSPVClient :: init ( common_tip, poller, NullChainListener { } ) ;
520
+ let mut client = MicroSPVClient :: new ( common_tip, poller, NullChainListener { } ) ;
521
521
match client. poll_best_tip ( ) . await {
522
522
Err ( e) => panic ! ( "Unexpected error: {:?}" , e) ,
523
523
Ok ( ( chain_tip, blocks_connected) ) => {
@@ -535,7 +535,7 @@ mod spv_client_tests {
535
535
let old_tip = chain. at_height ( 1 ) ;
536
536
537
537
let poller = poller:: ChainPoller :: new ( & mut chain as & mut dyn BlockSource , Network :: Testnet ) ;
538
- let mut client = MicroSPVClient :: init ( old_tip, poller, NullChainListener { } ) ;
538
+ let mut client = MicroSPVClient :: new ( old_tip, poller, NullChainListener { } ) ;
539
539
match client. poll_best_tip ( ) . await {
540
540
Err ( e) => panic ! ( "Unexpected error: {:?}" , e) ,
541
541
Ok ( ( chain_tip, blocks_connected) ) => {
@@ -553,7 +553,7 @@ mod spv_client_tests {
553
553
let old_tip = chain. at_height ( 1 ) ;
554
554
555
555
let poller = poller:: ChainPoller :: new ( & mut chain as & mut dyn BlockSource , Network :: Testnet ) ;
556
- let mut client = MicroSPVClient :: init ( old_tip, poller, NullChainListener { } ) ;
556
+ let mut client = MicroSPVClient :: new ( old_tip, poller, NullChainListener { } ) ;
557
557
match client. poll_best_tip ( ) . await {
558
558
Err ( e) => panic ! ( "Unexpected error: {:?}" , e) ,
559
559
Ok ( ( chain_tip, blocks_connected) ) => {
@@ -571,7 +571,7 @@ mod spv_client_tests {
571
571
let old_tip = chain. at_height ( 1 ) ;
572
572
573
573
let poller = poller:: ChainPoller :: new ( & mut chain as & mut dyn BlockSource , Network :: Testnet ) ;
574
- let mut client = MicroSPVClient :: init ( old_tip, poller, NullChainListener { } ) ;
574
+ let mut client = MicroSPVClient :: new ( old_tip, poller, NullChainListener { } ) ;
575
575
match client. poll_best_tip ( ) . await {
576
576
Err ( e) => panic ! ( "Unexpected error: {:?}" , e) ,
577
577
Ok ( ( chain_tip, blocks_connected) ) => {
@@ -590,7 +590,7 @@ mod spv_client_tests {
590
590
let worse_tip = chain. tip ( ) ;
591
591
592
592
let poller = poller:: ChainPoller :: new ( & mut chain as & mut dyn BlockSource , Network :: Testnet ) ;
593
- let mut client = MicroSPVClient :: init ( best_tip, poller, NullChainListener { } ) ;
593
+ let mut client = MicroSPVClient :: new ( best_tip, poller, NullChainListener { } ) ;
594
594
match client. poll_best_tip ( ) . await {
595
595
Err ( e) => panic ! ( "Unexpected error: {:?}" , e) ,
596
596
Ok ( ( chain_tip, blocks_connected) ) => {
@@ -999,7 +999,7 @@ mod tests {
999
999
let mut source_two = & chain_two;
1000
1000
let mut source_three = & header_chain;
1001
1001
let mut source_four = & backup_chain;
1002
- let mut client = MicroSPVClient :: init (
1002
+ let mut client = MicroSPVClient :: new (
1003
1003
( & chain_one) . get_header ( & block_1a_hash, Some ( 1 ) ) . await . unwrap ( ) . validate ( block_1a_hash) . unwrap ( ) ,
1004
1004
poller:: ChainMultiplexer :: new (
1005
1005
vec ! [ & mut source_one as & mut dyn BlockSource , & mut source_two as & mut dyn BlockSource , & mut source_three as & mut dyn BlockSource ] ,
0 commit comments