Skip to content

feat: add vm.getChain cheatcodes to get chain info #10198

@grandizzy

Description

@grandizzy

Component

Forge

Describe the feature you would like

forge-std's StdChains provides a way to retrieve chain info for a chain id or chain alias: https://github.com/foundry-rs/forge-std/blob/6853b9ec7df5dc0c213b05ae67785ad4f4baa0ea/src/StdChains.sol#L69

However this can get easily out of sync when support for new chains is added. We can fix this by providing native cheatcodes vm.getChain(alias) and vm.getChain(chainId) that returns a Chain struct as https://github.com/foundry-rs/forge-std/blob/6853b9ec7df5dc0c213b05ae67785ad4f4baa0ea/src/StdChains.sol#L45

Additional context

No response

Metadata

Metadata

Assignees

Labels

C-forgeCommand: forgeT-featureType: featurefirst issueA good way to start contributing

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions