Skip to content

Commit e2f4f11

Browse files
committed
fix api version parsing
1 parent 735212e commit e2f4f11

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/config/src/etherscan.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,14 +330,16 @@ impl ResolvedEtherscanConfig {
330330
}
331331

332332
let api_url = into_url(&api_url)?;
333-
let parsed_api_version = EtherscanApiVersion::try_from(api_version.unwrap_or_default())?;
333+
let parsed_api_version = api_version
334+
.map(EtherscanApiVersion::try_from)
335+
.transpose()?;
334336
let client = reqwest::Client::builder()
335337
.user_agent(ETHERSCAN_USER_AGENT)
336338
.tls_built_in_root_certs(api_url.scheme() == "https")
337339
.build()?;
338340
foundry_block_explorers::Client::builder()
339341
.with_client(client)
340-
.with_api_version(parsed_api_version)
342+
.with_api_version(parsed_api_version.unwrap_or_default())
341343
.with_api_key(api_key)
342344
.with_api_url(api_url)?
343345
// the browser url is not used/required by the client so we can simply set the

0 commit comments

Comments
 (0)