@@ -9,7 +9,7 @@ use sc_client_api::backend::Backend;
9
9
use sc_service:: { BasePath , Configuration } ;
10
10
11
11
use super :: { FrontierBackend , FullClient } ;
12
- use crate :: configuration:: { EthereumRpc , FrontierBackendType } ;
12
+ use crate :: configuration:: { self , FrontierBackendType } ;
13
13
14
14
/// Create frontier dir.
15
15
fn db_config_dir ( config : & sc_service:: Configuration ) -> std:: path:: PathBuf {
@@ -27,7 +27,7 @@ fn db_config_dir(config: &sc_service::Configuration) -> std::path::PathBuf {
27
27
pub fn frontier_backend (
28
28
config : & Configuration ,
29
29
client : Arc < FullClient > ,
30
- eth_rpc : & Option < EthereumRpc > ,
30
+ frontier_backend : & Option < configuration :: FrontierBackend > ,
31
31
eth_overrides : Arc < OverrideHandle < Block > > ,
32
32
) -> FrontierBackend {
33
33
let key_value_frontier_backend = FrontierBackend :: KeyValue (
@@ -39,8 +39,8 @@ pub fn frontier_backend(
39
39
. unwrap ( ) ,
40
40
) ;
41
41
42
- if let Some ( eth_rpc ) = eth_rpc {
43
- match eth_rpc . frontier_backend_type {
42
+ if let Some ( fb ) = frontier_backend {
43
+ match fb . frontier_backend_type {
44
44
FrontierBackendType :: KeyValue => key_value_frontier_backend,
45
45
FrontierBackendType :: Sql => {
46
46
let db_path = db_config_dir ( config) . join ( "sql" ) ;
@@ -53,11 +53,11 @@ pub fn frontier_backend(
53
53
. to_str ( )
54
54
. unwrap ( ) ,
55
55
create_if_missing : true ,
56
- thread_count : eth_rpc . frontier_sql_backend_thread_count ,
57
- cache_size : eth_rpc . frontier_sql_backend_cache_size ,
56
+ thread_count : fb . frontier_sql_backend_thread_count ,
57
+ cache_size : fb . frontier_sql_backend_cache_size ,
58
58
} ) ,
59
- eth_rpc . frontier_sql_backend_pool_size ,
60
- std:: num:: NonZeroU32 :: new ( eth_rpc . frontier_sql_backend_num_ops_timeout ) ,
59
+ fb . frontier_sql_backend_pool_size ,
60
+ std:: num:: NonZeroU32 :: new ( fb . frontier_sql_backend_num_ops_timeout ) ,
61
61
Arc :: clone ( & eth_overrides) ,
62
62
) )
63
63
. unwrap_or_else ( |err| panic ! ( "failed creating sql backend: {:?}" , err) ) ;
0 commit comments