-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix(forge
): fix cache search for verification
#7053
Conversation
forge
): fix cache search for verification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
pedantic style nit
let path = match args.contract.path.as_ref() { | ||
Some(path) => project.root().join(path), | ||
None => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while we're at it, let's also do if let some else for this
path.clone(), | ||
cache | ||
.entry(&path) | ||
.ok_or_eyre(format!("Cache entry not found for {}", path.display()))? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL ok_or_eyre
path.clone(), | ||
cache | ||
.entry(&path) | ||
.ok_or_eyre(format!("Cache entry not found for {}", path.display()))? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.ok_or_eyre(format!("Cache entry not found for {}", path.display()))? | |
.ok_or_else(|| eyre::eyre!("Cache entry not found for {}", path.display()))? |
Motivation
Closes #7042
Solution
Current
EtherscanVerificationProvider::cache_entry
always looks for contract in cache by name, even if path present, this PR fixes it and uses path where possible.