@@ -18,7 +18,9 @@ use timeboost_types::{BlockNumber, CertifiedBlock};
18
18
use tokio:: time:: sleep;
19
19
use tracing:: { debug, warn} ;
20
20
21
- use crate :: types:: { RecvBody , SendBody , TaggedBase64 , TransactionsWithProof , VidCommonResponse , TX } ;
21
+ use crate :: types:: {
22
+ RecvBody , SendBody , TX , TaggedBase64 , TransactionsWithProof , VidCommonResponse ,
23
+ } ;
22
24
23
25
pub use crate :: multiwatcher:: Multiwatcher ;
24
26
pub use crate :: types:: Height ;
@@ -58,7 +60,11 @@ impl Client {
58
60
self . get_with_retry ( u) . await
59
61
}
60
62
61
- pub async fn submit < N > ( & self , nsid : N , blocks : & [ CertifiedBlock < Validated > ] ) -> Result < ( ) , Error >
63
+ pub async fn submit < N > (
64
+ & self ,
65
+ nsid : N ,
66
+ blocks : & [ CertifiedBlock < Validated > ] ,
67
+ ) -> Result < ( ) , Error >
62
68
where
63
69
N : Into < NamespaceId > ,
64
70
{
@@ -104,25 +110,23 @@ impl Client {
104
110
}
105
111
Either :: Right ( trxs. into_iter ( ) . flat_map ( move |t| {
106
112
match minicbor:: decode :: < RecvBody > ( t. payload ( ) ) {
107
- Ok ( body) => {
108
- Either :: Right ( body. blocks . into_iter ( ) . filter_map ( |b| {
109
- let Some ( c) = cvec. get ( b. committee ( ) ) else {
110
- warn ! (
111
- node = %self . config. label,
112
- height = %hdr. height( ) ,
113
- committee = %b. committee( ) ,
114
- "unknown committee"
115
- ) ;
116
- return None ;
117
- } ;
118
- if let Some ( b) = b. validated ( c) {
119
- Some ( b. cert ( ) . data ( ) . num ( ) )
120
- } else {
121
- warn ! ( node = %self . config. label, height = %hdr. height( ) , "invalid block" ) ;
122
- None
123
- }
124
- } ) )
125
- }
113
+ Ok ( body) => Either :: Right ( body. blocks . into_iter ( ) . filter_map ( |b| {
114
+ let Some ( c) = cvec. get ( b. committee ( ) ) else {
115
+ warn ! (
116
+ node = %self . config. label,
117
+ height = %hdr. height( ) ,
118
+ committee = %b. committee( ) ,
119
+ "unknown committee"
120
+ ) ;
121
+ return None ;
122
+ } ;
123
+ if let Some ( b) = b. validated ( c) {
124
+ Some ( b. cert ( ) . data ( ) . num ( ) )
125
+ } else {
126
+ warn ! ( node = %self . config. label, height = %hdr. height( ) , "invalid block" ) ;
127
+ None
128
+ }
129
+ } ) ) ,
126
130
Err ( err) => {
127
131
warn ! (
128
132
node = %self . config. label,
0 commit comments