@@ -11,8 +11,8 @@ use tracing::info;
1111use url:: Url ;
1212
1313use crate :: {
14- FlashblocksConfig ,
15- extensions:: { FlashblocksCell , OpBuilder } ,
14+ BaseNodeConfig , FlashblocksConfig ,
15+ extensions:: { BaseNodeExtension , ConfigurableBaseNodeExtension , FlashblocksCell , OpBuilder } ,
1616} ;
1717
1818/// Helper struct that wires the custom RPC modules into the node builder.
@@ -30,17 +30,19 @@ pub struct BaseRpcExtension {
3030
3131impl BaseRpcExtension {
3232 /// Creates a new RPC extension helper.
33- pub const fn new (
34- flashblocks_cell : FlashblocksCell ,
35- flashblocks : Option < FlashblocksConfig > ,
36- metering_enabled : bool ,
37- sequencer_rpc : Option < String > ,
38- ) -> Self {
39- Self { flashblocks_cell , flashblocks , metering_enabled , sequencer_rpc }
33+ pub fn new ( config : & BaseNodeConfig ) -> Self {
34+ Self {
35+ flashblocks_cell : config . flashblocks_cell . clone ( ) ,
36+ flashblocks : config . flashblocks . clone ( ) ,
37+ metering_enabled : config . metering_enabled ,
38+ sequencer_rpc : config . rollup_args . sequencer . clone ( ) ,
39+ }
4040 }
41+ }
4142
43+ impl BaseNodeExtension for BaseRpcExtension {
4244 /// Applies the extension to the supplied builder.
43- pub fn apply ( & self , builder : OpBuilder ) -> OpBuilder {
45+ fn apply ( & self , builder : OpBuilder ) -> OpBuilder {
4446 let flashblocks_cell = self . flashblocks_cell . clone ( ) ;
4547 let flashblocks = self . flashblocks . clone ( ) ;
4648 let metering_enabled = self . metering_enabled ;
@@ -93,3 +95,9 @@ impl BaseRpcExtension {
9395 } )
9496 }
9597}
98+
99+ impl ConfigurableBaseNodeExtension for BaseRpcExtension {
100+ fn build ( config : & BaseNodeConfig ) -> eyre:: Result < Self > {
101+ Ok ( Self :: new ( config) )
102+ }
103+ }
0 commit comments