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

Resolving Env which is set by vm.setEnv #2514

Closed
wiasliaw opened this issue Jul 29, 2022 · 1 comment · Fixed by #2516
Closed

Resolving Env which is set by vm.setEnv #2514

wiasliaw opened this issue Jul 29, 2022 · 1 comment · Fixed by #2516
Labels
T-feature Type: feature

Comments

@wiasliaw
Copy link

Component

Forge

Describe the feature you would like

In config reference, rpc_endpoints is enable to take environment variable, like mainnet = "${RPC_MAINNET}".

However, it only available when env is exist or provide in command, i.e. RPC_MAINNET=https://... forge ..... It cannot take env which is set by cheatcode setEnv.

Use case is that: Read Alchemy API key through vm.setEnv and resolve in config for multiple fork.

[rpc_endpoints]
optimism = "https://optimism.alchemyapi.io/v2/${ALCHEMY_KEY}"
goerli = "https://eth-goerli.g.alchemy.com/v2/${ALCHEMY_KEY}"

Additional context

No response

@wiasliaw wiasliaw added the T-feature Type: feature label Jul 29, 2022
@mattsse
Copy link
Member

mattsse commented Jul 29, 2022

I see, yeah, so basically what happens is that we try to resolve all of them when the test are started, I guess in this scenario we simply should try again when it is requested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-feature Type: feature
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants