Skip to content
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

feat(client): try get evm network from env by default on client::init… #2613

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mickvandijke
Copy link
Contributor

Adjusts the default for ClientConfig to first try getting the EVM network from ENV before falling back to the default network option:

impl Default for ClientConfig {
    fn default() -> Self {
        Self {
            ...
            evm_network: EvmNetwork::try_from_env().unwrap_or_default(),
        }
    }
}

This makes it easier to create a client without manually having to specify the EVM network. This also fixes a problem in our tests where Client::init_local would select the default EVM network instead of the one specified in the ENV: "EVM_NETWORK=local".

@mickvandijke mickvandijke force-pushed the fix-client-init-local-evm-network branch from 38b90c8 to 152601f Compare January 9, 2025 10:45
Copy link
Member

@grumbach grumbach left a comment

Choose a reason for hiding this comment

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

LGTM

@mickvandijke mickvandijke force-pushed the fix-client-init-local-evm-network branch from 112ebf3 to a67dafa Compare January 9, 2025 14:36
@mickvandijke mickvandijke force-pushed the fix-client-init-local-evm-network branch from a67dafa to 2360b17 Compare January 9, 2025 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants