Skip to content

Commit a05eec0

Browse files
committed
[fix](network): remove unwrap
1 parent a633353 commit a05eec0

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/network.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -257,15 +257,18 @@ impl<'a> Network<'a> {
257257

258258
let blocks = join_all(blocks).await;
259259

260-
let mut res = vec![];
260+
let mut latest_blocks = vec![];
261261
for block in blocks {
262-
//TODO
263-
res.push(BlockWithTransactionReceipts {
264-
block: block.unwrap().unwrap(),
265-
transaction_receipts: None,
266-
});
262+
if let Ok(block) = block {
263+
if let Some(block) = block {
264+
latest_blocks.push(BlockWithTransactionReceipts {
265+
block,
266+
transaction_receipts: None,
267+
});
268+
}
269+
}
267270
}
268-
Ok(res)
271+
Ok(latest_blocks)
269272
}
270273

271274
async fn get_latest_transactions(

0 commit comments

Comments
 (0)