33use std:: {
44 collections:: HashMap ,
55 net:: { Ipv4Addr , SocketAddr } ,
6+ path:: PathBuf ,
67 sync:: Arc ,
78} ;
89
@@ -242,8 +243,8 @@ fn default_pbs() -> String {
242243}
243244
244245/// Loads the default pbs config, i.e. with no signer client or custom data
245- pub async fn load_pbs_config ( ) -> Result < PbsModuleConfig > {
246- let config = CommitBoostConfig :: from_env_path ( ) ?;
246+ pub async fn load_pbs_config ( ) -> Result < ( PbsModuleConfig , PathBuf ) > {
247+ let ( config, config_path ) = CommitBoostConfig :: from_env_path ( ) ?;
247248 config. validate ( ) . await ?;
248249
249250 // Make sure relays isn't empty - since the config is still technically valid if
@@ -295,16 +296,19 @@ pub async fn load_pbs_config() -> Result<PbsModuleConfig> {
295296
296297 let all_relays = all_relays. into_values ( ) . collect ( ) ;
297298
298- Ok ( PbsModuleConfig {
299- chain : config. chain ,
300- endpoint,
301- pbs_config : Arc :: new ( config. pbs . pbs_config ) ,
302- relays : relay_clients,
303- all_relays,
304- signer_client : None ,
305- registry_muxes,
306- mux_lookup,
307- } )
299+ Ok ( (
300+ PbsModuleConfig {
301+ chain : config. chain ,
302+ endpoint,
303+ pbs_config : Arc :: new ( config. pbs . pbs_config ) ,
304+ relays : relay_clients,
305+ all_relays,
306+ signer_client : None ,
307+ registry_muxes,
308+ mux_lookup,
309+ } ,
310+ config_path,
311+ ) )
308312}
309313
310314/// Loads a custom pbs config, i.e. with signer client and/or custom data
@@ -326,7 +330,7 @@ pub async fn load_pbs_custom_config<T: DeserializeOwned>() -> Result<(PbsModuleC
326330 }
327331
328332 // load module config including the extra data (if any)
329- let cb_config: StubConfig < T > = load_file_from_env ( CONFIG_ENV ) ?;
333+ let ( cb_config, _ ) : ( StubConfig < T > , _ ) = load_file_from_env ( CONFIG_ENV ) ?;
330334 cb_config. pbs . static_config . pbs_config . validate ( cb_config. chain ) . await ?;
331335
332336 // use endpoint from env if set, otherwise use default host and port
0 commit comments