File tree 4 files changed +22
-12
lines changed
4 files changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ mod tests {
95
95
96
96
use alloy_eips:: eip4844:: Blob ;
97
97
use alloy_primitives:: { address, b256, bytes, U256 } ;
98
- use rollup_node_providers:: { L1MessageProvider , L1ProviderError } ;
98
+ use rollup_node_providers:: { L1BlobProvider , L1MessageProvider , L1ProviderError } ;
99
99
use scroll_alloy_consensus:: TxL1Message ;
100
100
use scroll_codec:: decoding:: test_utils:: read_to_bytes;
101
101
use tokio:: sync:: Mutex ;
Original file line number Diff line number Diff line change
1
+ use crate :: L1ProviderError ;
2
+ use alloy_eips:: eip4844:: Blob ;
3
+ use alloy_primitives:: B256 ;
4
+ use std:: sync:: Arc ;
5
+
6
+ /// An instance of the trait can be used to fetch L1 blob data.
7
+ #[ async_trait:: async_trait]
8
+ pub trait L1BlobProvider {
9
+ /// Returns corresponding blob data for the provided hash.
10
+ async fn blob (
11
+ & self ,
12
+ block_timestamp : u64 ,
13
+ hash : B256 ,
14
+ ) -> Result < Option < Arc < Blob > > , L1ProviderError > ;
15
+ }
Original file line number Diff line number Diff line change
1
+ pub ( crate ) mod blob;
1
2
pub ( crate ) mod message;
2
3
3
- use crate :: { beacon_client:: OnlineBeaconClient , l1:: message:: L1MessageProvider } ;
4
+ use crate :: { beacon_client:: OnlineBeaconClient , l1:: message:: L1MessageProvider , L1BlobProvider } ;
4
5
use std:: { num:: NonZeroUsize , sync:: Arc } ;
5
6
6
7
use alloy_eips:: eip4844:: { Blob , BlobTransactionSidecarItem } ;
@@ -11,15 +12,8 @@ use scroll_db::DatabaseError;
11
12
use tokio:: sync:: Mutex ;
12
13
13
14
/// An instance of the trait can be used to provide L1 data.
14
- #[ async_trait:: async_trait]
15
- pub trait L1Provider : L1MessageProvider {
16
- /// Returns corresponding blob data for the provided hash.
17
- async fn blob (
18
- & self ,
19
- block_timestamp : u64 ,
20
- hash : B256 ,
21
- ) -> Result < Option < Arc < Blob > > , L1ProviderError > ;
22
- }
15
+ pub trait L1Provider : L1BlobProvider + L1MessageProvider { }
16
+ impl < T > L1Provider for T where T : L1BlobProvider + L1MessageProvider { }
23
17
24
18
/// An error occurring at the [`L1Provider`].
25
19
#[ derive( Debug , thiserror:: Error ) ]
@@ -91,7 +85,7 @@ impl<P> OnlineL1Provider<P> {
91
85
}
92
86
93
87
#[ async_trait:: async_trait]
94
- impl < P : L1MessageProvider + Sync > L1Provider for OnlineL1Provider < P > {
88
+ impl < P : L1MessageProvider + Sync > L1BlobProvider for OnlineL1Provider < P > {
95
89
/// Returns the requested blob corresponding to the passed hash.
96
90
async fn blob (
97
91
& self ,
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ pub use execution_payload::ExecutionPayloadProvider;
8
8
mod execution_payload;
9
9
10
10
pub use l1:: {
11
+ blob:: L1BlobProvider ,
11
12
message:: { DatabaseL1MessageProvider , L1MessageProvider } ,
12
13
L1Provider , L1ProviderError , OnlineL1Provider ,
13
14
} ;
You can’t perform that action at this time.
0 commit comments