Skip to content

Commit 9a7dfcd

Browse files
committed
refactor: make lido_module_id argument mandatory
1 parent 4a40bb5 commit 9a7dfcd

File tree

1 file changed

+5
-5
lines changed
  • crates/common/src/config

1 file changed

+5
-5
lines changed

crates/common/src/config/mux.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ impl MuxKeysLoader {
222222
rpc_url,
223223
chain,
224224
U256::from(*node_operator_id),
225-
*lido_module_id,
225+
lido_module_id.unwrap_or(1),
226226
http_timeout,
227227
)
228228
.await
@@ -295,23 +295,23 @@ fn lido_registry_addresses_by_module() -> HashMap<Chain, HashMap<u8, Address>> {
295295
}
296296

297297
// Fetching appropiate registry address
298-
fn lido_registry_address(chain: Chain, maybe_module: Option<u8>) -> eyre::Result<Address> {
298+
fn lido_registry_address(chain: Chain, lido_module_id: u8) -> eyre::Result<Address> {
299299
lido_registry_addresses_by_module()
300300
.get(&chain)
301301
.ok_or_else(|| eyre::eyre!("Lido registry not supported for chain: {chain:?}"))?
302-
.get(&maybe_module.unwrap_or(1))
302+
.get(&lido_module_id)
303303
.copied()
304304
.ok_or_else(|| eyre::eyre!(
305305
"Lido module id {:?} not found for chain: {chain:?}",
306-
maybe_module.unwrap_or(1)
306+
lido_module_id
307307
))
308308
}
309309

310310
async fn fetch_lido_registry_keys(
311311
rpc_url: Url,
312312
chain: Chain,
313313
node_operator_id: U256,
314-
lido_module_id: Option<u8>,
314+
lido_module_id: u8,
315315
http_timeout: Duration,
316316
) -> eyre::Result<Vec<BlsPublicKey>> {
317317
debug!(?chain, %node_operator_id, ?lido_module_id, "loading operator keys from Lido registry");

0 commit comments

Comments
 (0)