-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add v2 verify routes #73
base: main
Are you sure you want to change the base?
Conversation
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.
ty, smol nits and suggestions
@mattsse updated with suggestions |
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.
sorry for the delay, last nits
@@ -99,6 +115,16 @@ impl Client { | |||
Client::builder().with_api_key(api_key).chain(chain)?.build() | |||
} | |||
|
|||
/// Create a new client with the correct endpoint with the chain and chosen API v2 version | |||
pub fn new_v2_from_env(chain: Chain) -> Result<Self> { |
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.
I think we also want a way to set the version, like
fn with_version(self, v) -> Self
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.
This already exists:
/// Configures the etherscan api version
pub fn with_api_version(mut self, api_version: EtherscanApiVersion) -> Self {
self.etherscan_api_version = api_version;
self
}
let api_key = std::env::var("ETHERSCAN_API_KEY")?; | ||
Client::builder() | ||
.with_api_version(EtherscanApiVersion::V2) | ||
.with_api_key(api_key) | ||
.chain(chain)? | ||
.build() |
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.
then this can just call new ad with_version(v2)
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.
A little confused as to where this would be called -- within the builder or skip the builder entirely and use with_version()
rather than new_v2_from_env
?
standard-json-input
integration testsThis is a prerequisite PR for foundry-rs/foundry#9196
Notes: