File tree 4 files changed +8
-6
lines changed
4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,15 @@ pub struct Cache {
14
14
store : Arc < RwLock < HashMap < String , CacheEntry < Vec < u8 > > > > > ,
15
15
}
16
16
17
- impl Cache {
18
- pub fn new ( ) -> Self {
17
+ impl Default for Cache {
18
+ fn default ( ) -> Self {
19
19
Self {
20
20
store : Arc :: new ( RwLock :: new ( HashMap :: new ( ) ) ) ,
21
21
}
22
22
}
23
+ }
23
24
25
+ impl Cache {
24
26
pub fn set < T : Serialize > (
25
27
& self ,
26
28
key : & str ,
Original file line number Diff line number Diff line change @@ -550,7 +550,7 @@ mod tests {
550
550
551
551
#[ test]
552
552
fn test_process_payload ( ) {
553
- let cache = Arc :: new ( Cache :: new ( ) ) ;
553
+ let cache = Arc :: new ( Cache :: default ( ) ) ;
554
554
555
555
let payload = create_first_payload ( ) ;
556
556
@@ -593,7 +593,7 @@ mod tests {
593
593
594
594
#[ test]
595
595
fn test_skip_initial_non_zero_index_payload ( ) {
596
- let cache = Arc :: new ( Cache :: new ( ) ) ;
596
+ let cache = Arc :: new ( Cache :: default ( ) ) ;
597
597
598
598
let metadata = Metadata {
599
599
block_number : 1 ,
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ fn main() {
28
28
Cli :: < OpChainSpecParser , FlashblocksRollupArgs > :: parse ( )
29
29
. run ( |builder, flashblocks_rollup_args| async move {
30
30
info ! ( "Starting custom Base node" ) ;
31
- let cache = Arc :: new ( Cache :: new ( ) ) ;
31
+ let cache = Arc :: new ( Cache :: default ( ) ) ;
32
32
let op_node = OpNode :: new ( flashblocks_rollup_args. rollup_args . clone ( ) ) ;
33
33
let mut flashblocks_client = FlashblocksClient :: new ( Arc :: clone ( & cache) ) ;
34
34
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ check: check-format check-clippy test
6
6
fix : fix-format fix-clippy
7
7
8
8
test :
9
- cargo test --all-features
9
+ cargo test --workspace -- all-features
10
10
11
11
check-format :
12
12
cargo fmt --all -- --check
You can’t perform that action at this time.
0 commit comments