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 (#17089)
  • Loading branch information
odeke-em authored Jul 22, 2023
1 parent e3482f2 commit 0fa85b7
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 0fa85b7

Please sign in to comment.