Skip to content

Commit

Permalink
chore(derive): Sources Touchups (#266)
Browse files Browse the repository at this point in the history
* chore(derive): sources touchups

* fix: lints
  • Loading branch information
refcell authored Jun 16, 2024
1 parent c38d4ea commit 1b5b2ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions crates/derive/src/sources/blobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{
use alloc::{boxed::Box, vec::Vec};
use alloy_consensus::{Transaction, TxEip4844Variant, TxEnvelope, TxType};
use alloy_primitives::{Address, Bytes, TxKind};
use anyhow::Result;
use anyhow::{anyhow, Result};
use async_trait::async_trait;
use tracing::warn;

Expand Down Expand Up @@ -101,7 +101,7 @@ where
TxEnvelope::Eip4844(blob_tx_wrapper) => Some(blob_tx_wrapper.hash()),
_ => None,
};
warn!("Blob tx has calldata, which will be ignored: {hash:?}");
warn!(target: "blob-source", "Blob tx has calldata, which will be ignored: {hash:?}");
}
let blob_hashes = if let Some(b) = blob_hashes {
b
Expand Down Expand Up @@ -138,8 +138,8 @@ where

let blobs =
self.blob_fetcher.get_blobs(&self.block_ref, &blob_hashes).await.map_err(|e| {
warn!("Failed to fetch blobs: {e}");
anyhow::anyhow!("Failed to fetch blobs: {e}")
warn!(target: "blob-source", "Failed to fetch blobs: {e}");
anyhow!("Failed to fetch blobs: {e}")
})?;

// Fill the blob pointers.
Expand Down Expand Up @@ -196,7 +196,7 @@ where
match next_data.decode() {
Ok(d) => Some(Ok(d)),
Err(_) => {
warn!("Failed to decode blob data, skipping");
warn!(target: "blob-source", "Failed to decode blob data, skipping");
self.next().await
}
}
Expand Down
3 changes: 2 additions & 1 deletion crates/derive/src/sources/calldata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::{
use alloc::{boxed::Box, collections::VecDeque};
use alloy_consensus::{Transaction, TxEnvelope};
use alloy_primitives::{Address, Bytes, TxKind};
use anyhow::Result;
use async_trait::async_trait;

/// A data iterator that reads from calldata.
Expand Down Expand Up @@ -48,7 +49,7 @@ impl<CP: ChainProvider + Send> CalldataSource<CP> {
}

/// Loads the calldata into the source if it is not open.
async fn load_calldata(&mut self) -> anyhow::Result<()> {
async fn load_calldata(&mut self) -> Result<()> {
if self.open {
return Ok(());
}
Expand Down

0 comments on commit 1b5b2ea

Please sign in to comment.