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

refactor: params/extras (coreth a7f7061) #1430

Open
wants to merge 1 commit into
base: libevm
Choose a base branch
from
Open

Conversation

darioush
Copy link
Collaborator

@darioush darioush commented Jan 22, 2025

Applies the same changes as were applied to coreth here: ava-labs/coreth@a7f7061

I realized we could import most of these types back to params if we wanted, but explicit seems clearer + it's already like this in coreth.

@@ -15,8 +16,7 @@ import (

func TestVerifyUpgradeConfig(t *testing.T) {
admins := []common.Address{{1}}
chainConfigCpy := Copy(TestChainConfig)
chainConfig := GetExtra(&chainConfigCpy)
chainConfig := &ChainConfig{}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

note I tried to use the empty ChainConfig (former ChainConfigExtra) where possible
We can switch back to TestChainConfig if others prefer.
Less test setup seems preferred to me, but we could keep it to avoid any risk here.

)

var (
DefaultFeeConfig = commontype.FeeConfig{
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I moved this so it can be used in tests, but also put it back in it's original location to avoid having to change all params.DefaultFeeConfig's in the code.

AvalancheContext: AvalancheContext{utils.TestSnowContext()},
FeeConfig: DefaultFeeConfig,
AllowFeeRecipients: false,
NetworkUpgrades: GetDefaultNetworkUpgrades(upgrade.GetConfig(constants.UnitTestID)), // This can be changed to correct network (local, test) via VM.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

note we could unexport this GetDefaultNetworkUpgrades if we had something like GetDefaultExtras(networkID), but seems mostly the same to me.

@darioush darioush marked this pull request as ready for review January 22, 2025 23:07
@darioush darioush requested review from ceyonur and a team as code owners January 22, 2025 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant