Skip to content

Commit 492b577

Browse files
committed
comments
1 parent 80f8a54 commit 492b577

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

crates/common/src/config/mux.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl PbsMuxes {
4141

4242
let mut configs = HashMap::new();
4343
// fill the configs using the default pbs config and relay entries
44-
for mux in self.muxes.into_iter() {
44+
for mux in self.muxes {
4545
ensure!(!mux.relays.is_empty(), "mux config must have at least one relay");
4646
ensure!(
4747
!mux.validator_pubkeys.is_empty(),

crates/common/src/config/pbs.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,11 @@ pub fn load_pbs_config() -> Result<PbsModuleConfig> {
181181
SocketAddr::from((config.pbs.pbs_config.host, config.pbs.pbs_config.port))
182182
};
183183

184-
let muxes = match config.muxes {
185-
Some(muxes) => Some(muxes.validate_and_fill(&config.pbs.pbs_config, &config.relays)?),
186-
None => None,
187-
};
184+
let muxes = config
185+
.muxes
186+
.map(|muxes| muxes.validate_and_fill(&config.pbs.pbs_config, &config.relays))
187+
.transpose()?;
188+
188189
let relay_clients =
189190
config.relays.into_iter().map(RelayClient::new).collect::<Result<Vec<_>>>()?;
190191
let maybe_publiher = BuilderEventPublisher::new_from_env()?;

0 commit comments

Comments
 (0)