Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

feat: add FromStr impl for Chain #756

Merged
merged 2 commits into from
Jan 3, 2022

Conversation

odyslam
Copy link
Contributor

@odyslam odyslam commented Jan 3, 2022

Enables foundry-rs/foundry#357

Ideally, I would prefer that the default case of the match statement is sth like Chain::UnknownChain, but I added mainnet for compatibility.

Should we add that to the enum?

Copy link
Owner

@gakonst gakonst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Used thiserror::Error for the error generation and made the function return an error when string not found

@gakonst gakonst merged commit 96ef787 into gakonst:master Jan 3, 2022
@odyslam odyslam deleted the feat/chains-fromstr branch January 5, 2022 09:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants