@@ -6,7 +6,6 @@ use super::{
66 mailbox:: { CommitmentFallback , Mailbox , Message } ,
77 stream:: Stream ,
88 subscriptions:: { Key as SubscriptionKey , KeyFor as SubscriptionKeyFor , Subscriptions } ,
9- variant:: OptionalBuffer ,
109 Buffer , Variant ,
1110} ;
1211use crate :: {
@@ -296,7 +295,7 @@ where
296295 pub fn start < R , Buf > (
297296 mut self ,
298297 application : impl Reporter < Activity = Update < V :: ApplicationBlock , A > > ,
299- buffer : Option < Buf > ,
298+ buffer : Buf ,
300299 resolver : ( handler:: Receiver < V :: Commitment > , R ) ,
301300 ) -> Handle < ( ) >
302301 where
@@ -307,15 +306,14 @@ where
307306 > ,
308307 Buf : Buffer < V , PublicKey = <P :: Scheme as CertificateScheme >:: PublicKey > ,
309308 {
310- let buffer = OptionalBuffer :: new ( buffer) ;
311309 spawn_cell ! ( self . context, self . run( application, buffer, resolver) )
312310 }
313311
314312 /// Run the application actor.
315313 async fn run < R , Buf > (
316314 mut self ,
317315 mut application : impl Reporter < Activity = Update < V :: ApplicationBlock , A > > ,
318- mut buffer : OptionalBuffer < V , Buf > ,
316+ mut buffer : Buf ,
319317 ( mut resolver_rx, mut resolver) : ( handler:: Receiver < V :: Commitment > , R ) ,
320318 ) where
321319 R : Resolver <
@@ -436,7 +434,7 @@ where
436434 & mut self ,
437435 result : <A :: Waiter as Future >:: Output ,
438436 application : & mut impl Reporter < Activity = Update < V :: ApplicationBlock , A > > ,
439- buffer : & mut OptionalBuffer < V , Buf > ,
437+ buffer : & mut Buf ,
440438 resolver : & mut R ,
441439 ) where
442440 Buf : Buffer < V > ,
@@ -491,7 +489,7 @@ where
491489 message : Message < P :: Scheme , V > ,
492490 resolver : & mut R ,
493491 waiters : & mut AbortablePool < Result < V :: Block , SubscriptionKeyFor < V > > > ,
494- buffer : & mut OptionalBuffer < V , Buf > ,
492+ buffer : & mut Buf ,
495493 application : & mut impl Reporter < Activity = Update < V :: ApplicationBlock , A > > ,
496494 ) where
497495 Buf : Buffer < V , PublicKey = <P :: Scheme as CertificateScheme >:: PublicKey > ,
@@ -764,7 +762,7 @@ where
764762 message : handler:: Message < V :: Commitment > ,
765763 resolver_rx : & mut handler:: Receiver < V :: Commitment > ,
766764 resolver : & mut R ,
767- buffer : & mut OptionalBuffer < V , Buf > ,
765+ buffer : & mut Buf ,
768766 application : & mut impl Reporter < Activity = Update < V :: ApplicationBlock , A > > ,
769767 ) where
770768 Buf : Buffer < V , PublicKey = <P :: Scheme as CertificateScheme >:: PublicKey > ,
@@ -850,7 +848,7 @@ where
850848 & self ,
851849 key : ResolverRequestFor < V > ,
852850 response : oneshot:: Sender < Bytes > ,
853- buffer : & OptionalBuffer < V , Buf > ,
851+ buffer : & Buf ,
854852 ) {
855853 match key {
856854 Key :: Block ( commitment) => {
@@ -898,7 +896,7 @@ where
898896 PublicKey = <P :: Scheme as CertificateScheme >:: PublicKey ,
899897 > ,
900898 waiters : & mut AbortablePool < Result < V :: Block , SubscriptionKeyFor < V > > > ,
901- buffer : & mut OptionalBuffer < V , Buf > ,
899+ buffer : & mut Buf ,
902900 ) {
903901 let digest = match key {
904902 SubscriptionKey :: Digest ( digest) => digest,
@@ -985,7 +983,7 @@ where
985983 finalization : Finalization < P :: Scheme , V :: Commitment > ,
986984 skip_if_superseded : bool ,
987985 resolver : & mut R ,
988- buffer : & mut OptionalBuffer < V , Buf > ,
986+ buffer : & mut Buf ,
989987 application : & mut impl Reporter < Activity = Update < V :: ApplicationBlock , A > > ,
990988 ) where
991989 Buf : Buffer < V , PublicKey = <P :: Scheme as CertificateScheme >:: PublicKey > ,
@@ -1052,7 +1050,7 @@ where
10521050 async fn apply_floor_anchor < Buf : Buffer < V > > (
10531051 & mut self ,
10541052 block : & V :: Block ,
1055- buffer : & mut OptionalBuffer < V , Buf > ,
1053+ buffer : & mut Buf ,
10561054 application : & mut impl Reporter < Activity = Update < V :: ApplicationBlock , A > > ,
10571055 resolver : & mut impl Resolver <
10581056 Key = ResolverRequestFor < V > ,
@@ -1171,7 +1169,7 @@ where
11711169 & mut self ,
11721170 message : ResolverDelivery < V > ,
11731171 delivers : & mut Vec < PendingVerification < P :: Scheme , V > > ,
1174- buffer : & mut OptionalBuffer < V , Buf > ,
1172+ buffer : & mut Buf ,
11751173 application : & mut impl Reporter < Activity = Update < V :: ApplicationBlock , A > > ,
11761174 resolver : & mut impl Resolver <
11771175 Key = ResolverRequestFor < V > ,
@@ -1349,7 +1347,7 @@ where
13491347 async fn verify_delivered < Buf : Buffer < V > > (
13501348 & mut self ,
13511349 mut delivers : Vec < PendingVerification < P :: Scheme , V > > ,
1352- buffer : & mut OptionalBuffer < V , Buf > ,
1350+ buffer : & mut Buf ,
13531351 application : & mut impl Reporter < Activity = Update < V :: ApplicationBlock , A > > ,
13541352 resolver : & mut impl Resolver <
13551353 Key = ResolverRequestFor < V > ,
@@ -1848,7 +1846,7 @@ where
18481846 /// parent links).
18491847 async fn find_block_by_digest < Buf : Buffer < V > > (
18501848 & self ,
1851- buffer : & OptionalBuffer < V , Buf > ,
1849+ buffer : & Buf ,
18521850 digest : <V :: Block as Digestible >:: Digest ,
18531851 ) -> Option < V :: Block > {
18541852 if let Some ( block) = buffer. find_by_digest ( digest) . await {
@@ -1863,7 +1861,7 @@ where
18631861 /// Having the full commitment may enable additional retrieval mechanisms.
18641862 async fn find_block_by_commitment < Buf : Buffer < V > > (
18651863 & self ,
1866- buffer : & OptionalBuffer < V , Buf > ,
1864+ buffer : & Buf ,
18671865 commitment : V :: Commitment ,
18681866 ) -> Option < V :: Block > {
18691867 if let Some ( block) = buffer. find_by_commitment ( commitment) . await {
@@ -1888,7 +1886,7 @@ where
18881886 /// needs a subsequent [`sync_finalized`](Self::sync_finalized).
18891887 async fn try_repair_gaps < Buf : Buffer < V > > (
18901888 & mut self ,
1891- buffer : & mut OptionalBuffer < V , Buf > ,
1889+ buffer : & mut Buf ,
18921890 resolver : & mut impl Resolver <
18931891 Key = ResolverRequestFor < V > ,
18941892 Subscriber = Annotation ,
0 commit comments