Skip to content

chore: clearer error message when function signature does not contain parentheses #9478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/cli/src/utils/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ pub async fn parse_function_args<P: Provider<AnyNetwork>>(
// a regular function signature with parentheses
get_func(sig)?
} else {
info!("function signature does not contain parentheses, fetching function data from Etherscan");
let etherscan_api_key = etherscan_api_key.ok_or_eyre(
"If you wish to fetch function data from Etherscan, please provide an Etherscan API key.",
"Function signature does not contain parentheses. If you wish to fetch function data from Etherscan, please provide an API key.",
)?;
let to = to.ok_or_eyre("A 'to' address must be provided to fetch function data.")?;
get_func_etherscan(sig, to, &args, chain, etherscan_api_key).await?
Expand Down
Loading