@@ -52,6 +52,7 @@ impl<S> PayloadDisperser<S> {
52
52
where
53
53
S : Sign + Clone ,
54
54
{
55
+ eigensdk:: logging:: init_logger ( eigensdk:: logging:: log_level:: LogLevel :: Info ) ;
55
56
let disperser_config = DisperserClientConfig {
56
57
disperser_rpc : payload_config. disperser_rpc . clone ( ) ,
57
58
signer : signer. clone ( ) ,
@@ -156,20 +157,34 @@ impl<S> PayloadDisperser<S> {
156
157
where
157
158
S : Sign ,
158
159
{
159
- // todo error handling
160
160
let blob_quorum_numbers = status
161
161
. clone ( )
162
162
. blob_inclusion_info
163
- . unwrap ( )
163
+ . ok_or ( ConversionError :: BlobInclusion (
164
+ "BlobInclusionInfo not present" . to_string ( ) ,
165
+ ) ) ?
164
166
. blob_certificate
165
- . unwrap ( )
167
+ . ok_or ( ConversionError :: BlobCertificate (
168
+ "BlobCertificate not present" . to_string ( ) ,
169
+ ) ) ?
166
170
. blob_header
167
- . unwrap ( )
171
+ . ok_or ( ConversionError :: BlobHeader (
172
+ "BlobHeader not present" . to_string ( ) ,
173
+ ) ) ?
168
174
. quorum_numbers ;
169
175
if blob_quorum_numbers. is_empty ( ) {
170
176
return Err ( PayloadDisperserError :: NoQuorumNumbers ) ;
171
177
}
172
- let attestation = status. signed_batch . clone ( ) . unwrap ( ) . attestation . unwrap ( ) ;
178
+ let attestation = status
179
+ . signed_batch
180
+ . clone ( )
181
+ . ok_or ( ConversionError :: SignedBatch (
182
+ "SignedBatch not present" . to_string ( ) ,
183
+ ) ) ?
184
+ . attestation
185
+ . ok_or ( ConversionError :: Attestation (
186
+ "Attestation not present" . to_string ( ) ,
187
+ ) ) ?;
173
188
let batch_quorum_numbers = attestation. quorum_numbers ;
174
189
let batch_signed_percentages = attestation. quorum_signed_percentages ;
175
190
@@ -186,7 +201,13 @@ impl<S> PayloadDisperser<S> {
186
201
signed_percentages_map. insert ( quorum_id, * signed_percentage) ;
187
202
}
188
203
189
- let batch_header = status. clone ( ) . signed_batch . unwrap ( ) . header ;
204
+ let batch_header = status
205
+ . clone ( )
206
+ . signed_batch
207
+ . ok_or ( ConversionError :: SignedBatch (
208
+ "SignedBatch not present" . to_string ( ) ,
209
+ ) ) ?
210
+ . header ;
190
211
if batch_header. is_none ( ) {
191
212
return Err ( PayloadDisperserError :: BatchHeaderNotPresent ) ;
192
213
}
@@ -270,16 +291,15 @@ impl<S> PayloadDisperser<S> {
270
291
271
292
let reference_block_number = signed_batch. header . reference_block_number ;
272
293
273
- eigensdk:: logging:: init_logger ( eigensdk:: logging:: log_level:: LogLevel :: Info ) ;
274
294
let avs_registry_chain_reader =
275
295
eigensdk:: client_avsregistry:: reader:: AvsRegistryChainReader :: new (
276
296
eigensdk:: logging:: get_logger ( ) ,
277
297
self . config . registry_coordinator_addr ,
278
298
self . config . operator_state_retriever_addr ,
279
- self . config . eth_rpc_url . clone ( ) . try_into ( ) . unwrap ( ) ,
299
+ self . config . eth_rpc_url . clone ( ) . try_into ( ) ? ,
280
300
)
281
301
. await
282
- . unwrap ( ) ;
302
+ . map_err ( |_| PayloadDisperserError :: EigenSDKNotInitialized ) ? ;
283
303
284
304
let check_sig_indices = avs_registry_chain_reader
285
305
. get_check_signatures_indices (
@@ -288,7 +308,7 @@ impl<S> PayloadDisperser<S> {
288
308
non_signer_operator_ids,
289
309
)
290
310
. await
291
- . unwrap ( ) ;
311
+ . map_err ( |_| PayloadDisperserError :: GetCheckSignaturesIndices ) ? ;
292
312
293
313
Ok ( NonSignerStakesAndSignature {
294
314
non_signer_quorum_bitmap_indices : check_sig_indices. nonSignerQuorumBitmapIndices ,
0 commit comments