Skip to content

Commit 09ac821

Browse files
committed
Cleaned up signer config loading from feedback
1 parent 7afb763 commit 09ac821

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

crates/common/src/config/signer.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,20 +109,17 @@ impl StartSignerConfig {
109109

110110
let jwts = load_jwt_secrets()?;
111111

112-
// Load the server endpoint first from the env var, then the config, and finally
113-
// the defaults
112+
let signer_config = config.signer.ok_or_eyre("Signer config is missing")?;
113+
114+
// Load the server endpoint first from the env var if present, otherwise the
115+
// config
114116
let endpoint = if let Some(endpoint) = load_optional_env_var(SIGNER_ENDPOINT_ENV) {
115117
endpoint.parse()?
116118
} else {
117-
match config.signer {
118-
Some(ref signer) => SocketAddr::from((signer.host, signer.port)),
119-
None => SocketAddr::from((default_host(), DEFAULT_SIGNER_PORT)),
120-
}
119+
SocketAddr::from((signer_config.host, signer_config.port))
121120
};
122121

123-
let signer = config.signer.ok_or_eyre("Signer config is missing")?.inner;
124-
125-
match signer {
122+
match signer_config.inner {
126123
SignerType::Local { loader, store, .. } => Ok(StartSignerConfig {
127124
chain: config.chain,
128125
loader: Some(loader),

0 commit comments

Comments
 (0)