-
Notifications
You must be signed in to change notification settings - Fork 46
Handle parsing and serialization of etherscan api version #83
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
Handle parsing and serialization of etherscan api version #83
Conversation
|
the |
mattsse
left a comment
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.
makes sense,
a few nits
| pub enum EtherscanApiVersion { | ||
| #[default] | ||
| V1, | ||
| #[default] |
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.
@grandizzy can we make this default already?
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.
Another option would be to not specify a default here and specify a default on the forge library.
| /// 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.
can we keep this so that this doesn't break?
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.
Sure — it only makes sense imo if the default is V1 and maybe it should still be. Not sure about other tools using this package.
| .with_api_key(api_key) | ||
| .chain(chain)? | ||
| .build() | ||
| pub fn new_with_api_version( |
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 needs a one liner doc
To add Etherscan API Version types for reasonable parsing and serialization into the toml configuration files, these functions were added to block_explorers.
See: foundry-rs/foundry#10298