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

tmpnet: Use AvalancheLocalChainConfig for cchain genesis #2583

Merged
merged 3 commits into from
Jan 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions tests/fixture/tmpnet/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,7 @@ func NewTestGenesis(

// Define C-Chain genesis
cChainGenesis := &core.Genesis{
Config: &params.ChainConfig{
ChainID: big.NewInt(43112), // Arbitrary chain ID is arbitrary
},
Config: params.AvalancheLocalChainConfig,
Copy link
Contributor

@darioush darioush Jan 5, 2024

Choose a reason for hiding this comment

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

tbh it's a little awkward that avalanchego takes dependencies on coreth/params and and coreth/core in this file, but this is not made worse by this PR so I'm approving it.
In the long run coreth should probably provide a better method to create the genesis for external users.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Happier to have a simpler way to do this, but depending on coreth for the configuration rather than using some arbitrary value seemed like a win.

Difficulty: big.NewInt(0), // Difficulty is a mandatory field
GasLimit: defaultGasLimit,
Alloc: cChainBalances,
Expand Down
Loading