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

feat: add __experimental_info export to core #2529

Merged
merged 5 commits into from
Apr 28, 2022
Merged

Conversation

davidmurdoch
Copy link
Member

@davidmurdoch davidmurdoch commented Mar 4, 2022

This is an internal and private feature for Truffle. Truffle needed a way to programmatically get the list of chains Ganache fully supports in order to enable the dry-run feature for those chains.

This introduces a new experimental and private (this will likely change in a future release!) __experimental_info export:

Readonly<{
  version: string,
  fork: Readonly<{
    /**
     * Chains Ganache is known to be compatible with. Operations performed
     * locally at historic block numbers will use the Ethereum Virtual Machine
     * OPCODEs, gas prices, and EIPs that were active at the time the historic
     * block originally took place.
     */
    knownChainIds: number[],
  }>
}>

return {
version,
fork: {
knownChainIds: Array.from(KNOWN_CHAINIDS)
Copy link
Contributor

Choose a reason for hiding this comment

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

The method seems good enough for me! Earlier you made it sound like there might be a more expansive thing with more info about the various chains, which might be nice for later, but if that's a bunch more work, well, knownChainIds does the job! :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh yeah, we could potentially stuff a whole bunch of interesting stuff in here in the future.

@davidmurdoch davidmurdoch force-pushed the develop branch 3 times, most recently from 96d6c7f to 47d583d Compare April 8, 2022 17:42
@davidmurdoch davidmurdoch force-pushed the develop branch 5 times, most recently from 892c68f to 0e9642f Compare April 22, 2022 19:52
Copy link
Contributor

@haltman-at haltman-at left a comment

Choose a reason for hiding this comment

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

Seems good to me! Maybe more can go here in the future, but this should be good enough for now.

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.

None yet

3 participants