@@ -36,7 +36,7 @@ use warp::Filter;
36
36
37
37
use crate :: {
38
38
configuration:: { ExecutionEnvironment , LIST_SNAPSHOTS_MAX_ITEMS } ,
39
- database:: provider:: StakePoolStore ,
39
+ database:: provider:: { EpochSettingStore , StakePoolStore } ,
40
40
event_store:: { EventMessage , EventStore , TransmitterService } ,
41
41
http_server:: routes:: router,
42
42
stake_distribution_service:: { MithrilStakeDistributionService , StakeDistributionService } ,
@@ -495,32 +495,24 @@ impl DependenciesBuilder {
495
495
}
496
496
497
497
async fn build_protocol_parameters_store ( & mut self ) -> Result < Arc < ProtocolParametersStore > > {
498
- let adapter: Box < dyn StoreAdapter < Key = Epoch , Record = ProtocolParameters > > = match self
499
- . configuration
500
- . environment
501
- {
502
- ExecutionEnvironment :: Production => {
503
- let adapter =
504
- SQLiteAdapter :: new ( "protocol_parameters" , self . get_sqlite_connection ( ) . await ?)
505
- . map_err ( |e| DependenciesBuilderError :: Initialization {
506
- message : "Cannot create SQLite adapter for ProtocolParametersStore."
498
+ let adapter: Box < dyn StoreAdapter < Key = Epoch , Record = ProtocolParameters > > =
499
+ match self . configuration . environment {
500
+ ExecutionEnvironment :: Production => {
501
+ let adapter = EpochSettingStore :: new ( self . get_sqlite_connection ( ) . await ?) ;
502
+
503
+ Box :: new ( adapter)
504
+ }
505
+ _ => {
506
+ let adapter = MemoryAdapter :: new ( None ) . map_err ( |e| {
507
+ DependenciesBuilderError :: Initialization {
508
+ message : "Cannot create Memory adapter for ProtocolParametersStore."
507
509
. to_string ( ) ,
508
510
error : Some ( e. into ( ) ) ,
509
- } ) ?;
510
-
511
- Box :: new ( adapter)
512
- }
513
- _ => {
514
- let adapter = MemoryAdapter :: new ( None ) . map_err ( |e| {
515
- DependenciesBuilderError :: Initialization {
516
- message : "Cannot create Memory adapter for ProtocolParametersStore."
517
- . to_string ( ) ,
518
- error : Some ( e. into ( ) ) ,
519
- }
520
- } ) ?;
521
- Box :: new ( adapter)
522
- }
523
- } ;
511
+ }
512
+ } ) ?;
513
+ Box :: new ( adapter)
514
+ }
515
+ } ;
524
516
525
517
Ok ( Arc :: new ( ProtocolParametersStore :: new (
526
518
adapter,
0 commit comments