fix: testutil/configurator: correctly create fresh copy of defaultConfig (#17089)
This commit is contained in:
parent
e3482f2d41
commit
0fa85b7a42
@ -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)
|
||||
@ -308,7 +310,7 @@ func OmitInitGenesis() ModuleOption {
|
||||
}
|
||||
|
||||
func NewAppConfig(opts ...ModuleOption) depinject.Config {
|
||||
cfg := defaultConfig
|
||||
cfg := defaultConfig()
|
||||
for _, opt := range opts {
|
||||
opt(cfg)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user