Skip to content

Commit

Permalink
fix: testutil/configurator: correctly create fresh copy of defaultCon…
Browse files Browse the repository at this point in the history
…fig (backport #17089) (#17091)
  • Loading branch information
mergify[bot] authored Jul 22, 2023
1 parent 923af36 commit 35492de
Showing 1 changed file with 69 additions and 67 deletions.
136 changes: 69 additions & 67 deletions testutil/configurator/configurator.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,72 +34,74 @@ type Config struct {
setInitGenesis bool
}

var defaultConfig = &Config{
ModuleConfigs: make(map[string]*appv1alpha1.ModuleConfig),
BeginBlockersOrder: []string{
"upgrade",
"mint",
"distribution",
"slashing",
"evidence",
"staking",
"auth",
"bank",
"gov",
"crisis",
"genutil",
"authz",
"feegrant",
"nft",
"group",
"params",
"consensus",
"vesting",
"circuit",
},
EndBlockersOrder: []string{
"crisis",
"gov",
"staking",
"auth",
"bank",
"distribution",
"slashing",
"mint",
"genutil",
"evidence",
"authz",
"feegrant",
"nft",
"group",
"params",
"consensus",
"upgrade",
"vesting",
"circuit",
},
InitGenesisOrder: []string{
"auth",
"bank",
"distribution",
"staking",
"slashing",
"gov",
"mint",
"crisis",
"genutil",
"evidence",
"authz",
"feegrant",
"nft",
"group",
"params",
"consensus",
"upgrade",
"vesting",
"circuit",
},
setInitGenesis: true,
func defaultConfig() *Config {
return &Config{
ModuleConfigs: make(map[string]*appv1alpha1.ModuleConfig),
BeginBlockersOrder: []string{
"upgrade",
"mint",
"distribution",
"slashing",
"evidence",
"staking",
"auth",
"bank",
"gov",
"crisis",
"genutil",
"authz",
"feegrant",
"nft",
"group",
"params",
"consensus",
"vesting",
"circuit",
},
EndBlockersOrder: []string{
"crisis",
"gov",
"staking",
"auth",
"bank",
"distribution",
"slashing",
"mint",
"genutil",
"evidence",
"authz",
"feegrant",
"nft",
"group",
"params",
"consensus",
"upgrade",
"vesting",
"circuit",
},
InitGenesisOrder: []string{
"auth",
"bank",
"distribution",
"staking",
"slashing",
"gov",
"mint",
"crisis",
"genutil",
"evidence",
"authz",
"feegrant",
"nft",
"group",
"params",
"consensus",
"upgrade",
"vesting",
"circuit",
},
setInitGenesis: true,
}
}

type ModuleOption func(config *Config)
Expand Down Expand Up @@ -308,7 +310,7 @@ func OmitInitGenesis() ModuleOption {
}

func NewAppConfig(opts ...ModuleOption) depinject.Config {
cfg := defaultConfig
cfg := defaultConfig()
for _, opt := range opts {
opt(cfg)
}
Expand Down

0 comments on commit 35492de

Please sign in to comment.