@@ -91,15 +91,16 @@ var initGenesisOrder = []string{
91
91
"circuit" ,
92
92
}
93
93
94
- type appConfig struct {
94
+ // Config should never need to be instantiated manually and is solely used for ModuleOption.
95
+ type Config struct {
95
96
moduleConfigs map [string ]* appv1alpha1.ModuleConfig
96
97
setInitGenesis bool
97
98
}
98
99
99
- type ModuleOption func (config * appConfig )
100
+ type ModuleOption func (config * Config )
100
101
101
102
func BankModule () ModuleOption {
102
- return func (config * appConfig ) {
103
+ return func (config * Config ) {
103
104
config .moduleConfigs ["bank" ] = & appv1alpha1.ModuleConfig {
104
105
Name : "bank" ,
105
106
Config : appconfig .WrapAny (& bankmodulev1.Module {}),
@@ -108,7 +109,7 @@ func BankModule() ModuleOption {
108
109
}
109
110
110
111
func AuthModule () ModuleOption {
111
- return func (config * appConfig ) {
112
+ return func (config * Config ) {
112
113
config .moduleConfigs ["auth" ] = & appv1alpha1.ModuleConfig {
113
114
Name : "auth" ,
114
115
Config : appconfig .WrapAny (& authmodulev1.Module {
@@ -128,7 +129,7 @@ func AuthModule() ModuleOption {
128
129
}
129
130
130
131
func ParamsModule () ModuleOption {
131
- return func (config * appConfig ) {
132
+ return func (config * Config ) {
132
133
config .moduleConfigs ["params" ] = & appv1alpha1.ModuleConfig {
133
134
Name : "params" ,
134
135
Config : appconfig .WrapAny (& paramsmodulev1.Module {}),
@@ -137,7 +138,7 @@ func ParamsModule() ModuleOption {
137
138
}
138
139
139
140
func TxModule () ModuleOption {
140
- return func (config * appConfig ) {
141
+ return func (config * Config ) {
141
142
config .moduleConfigs ["tx" ] = & appv1alpha1.ModuleConfig {
142
143
Name : "tx" ,
143
144
Config : appconfig .WrapAny (& txconfigv1.Config {}),
@@ -146,7 +147,7 @@ func TxModule() ModuleOption {
146
147
}
147
148
148
149
func StakingModule () ModuleOption {
149
- return func (config * appConfig ) {
150
+ return func (config * Config ) {
150
151
config .moduleConfigs ["staking" ] = & appv1alpha1.ModuleConfig {
151
152
Name : "staking" ,
152
153
Config : appconfig .WrapAny (& stakingmodulev1.Module {}),
@@ -155,7 +156,7 @@ func StakingModule() ModuleOption {
155
156
}
156
157
157
158
func SlashingModule () ModuleOption {
158
- return func (config * appConfig ) {
159
+ return func (config * Config ) {
159
160
config .moduleConfigs ["slashing" ] = & appv1alpha1.ModuleConfig {
160
161
Name : "slashing" ,
161
162
Config : appconfig .WrapAny (& slashingmodulev1.Module {}),
@@ -164,7 +165,7 @@ func SlashingModule() ModuleOption {
164
165
}
165
166
166
167
func GenutilModule () ModuleOption {
167
- return func (config * appConfig ) {
168
+ return func (config * Config ) {
168
169
config .moduleConfigs ["genutil" ] = & appv1alpha1.ModuleConfig {
169
170
Name : "genutil" ,
170
171
Config : appconfig .WrapAny (& genutilmodulev1.Module {}),
@@ -173,7 +174,7 @@ func GenutilModule() ModuleOption {
173
174
}
174
175
175
176
func DistributionModule () ModuleOption {
176
- return func (config * appConfig ) {
177
+ return func (config * Config ) {
177
178
config .moduleConfigs ["distribution" ] = & appv1alpha1.ModuleConfig {
178
179
Name : "distribution" ,
179
180
Config : appconfig .WrapAny (& distrmodulev1.Module {}),
@@ -182,7 +183,7 @@ func DistributionModule() ModuleOption {
182
183
}
183
184
184
185
func FeegrantModule () ModuleOption {
185
- return func (config * appConfig ) {
186
+ return func (config * Config ) {
186
187
config .moduleConfigs ["feegrant" ] = & appv1alpha1.ModuleConfig {
187
188
Name : "feegrant" ,
188
189
Config : appconfig .WrapAny (& feegrantmodulev1.Module {}),
@@ -191,7 +192,7 @@ func FeegrantModule() ModuleOption {
191
192
}
192
193
193
194
func VestingModule () ModuleOption {
194
- return func (config * appConfig ) {
195
+ return func (config * Config ) {
195
196
config .moduleConfigs ["vesting" ] = & appv1alpha1.ModuleConfig {
196
197
Name : "vesting" ,
197
198
Config : appconfig .WrapAny (& vestingmodulev1.Module {}),
@@ -200,7 +201,7 @@ func VestingModule() ModuleOption {
200
201
}
201
202
202
203
func GovModule () ModuleOption {
203
- return func (config * appConfig ) {
204
+ return func (config * Config ) {
204
205
config .moduleConfigs ["gov" ] = & appv1alpha1.ModuleConfig {
205
206
Name : "gov" ,
206
207
Config : appconfig .WrapAny (& govmodulev1.Module {}),
@@ -209,7 +210,7 @@ func GovModule() ModuleOption {
209
210
}
210
211
211
212
func ConsensusModule () ModuleOption {
212
- return func (config * appConfig ) {
213
+ return func (config * Config ) {
213
214
config .moduleConfigs ["consensus" ] = & appv1alpha1.ModuleConfig {
214
215
Name : "consensus" ,
215
216
Config : appconfig .WrapAny (& consensusmodulev1.Module {}),
@@ -218,7 +219,7 @@ func ConsensusModule() ModuleOption {
218
219
}
219
220
220
221
func MintModule () ModuleOption {
221
- return func (config * appConfig ) {
222
+ return func (config * Config ) {
222
223
config .moduleConfigs ["mint" ] = & appv1alpha1.ModuleConfig {
223
224
Name : "mint" ,
224
225
Config : appconfig .WrapAny (& mintmodulev1.Module {}),
@@ -233,7 +234,7 @@ func MintModule() ModuleOption {
233
234
}
234
235
235
236
func EvidenceModule () ModuleOption {
236
- return func (config * appConfig ) {
237
+ return func (config * Config ) {
237
238
config .moduleConfigs ["evidence" ] = & appv1alpha1.ModuleConfig {
238
239
Name : "evidence" ,
239
240
Config : appconfig .WrapAny (& evidencemodulev1.Module {}),
@@ -242,7 +243,7 @@ func EvidenceModule() ModuleOption {
242
243
}
243
244
244
245
func AuthzModule () ModuleOption {
245
- return func (config * appConfig ) {
246
+ return func (config * Config ) {
246
247
config .moduleConfigs ["authz" ] = & appv1alpha1.ModuleConfig {
247
248
Name : "authz" ,
248
249
Config : appconfig .WrapAny (& authzmodulev1.Module {}),
@@ -251,7 +252,7 @@ func AuthzModule() ModuleOption {
251
252
}
252
253
253
254
func GroupModule () ModuleOption {
254
- return func (config * appConfig ) {
255
+ return func (config * Config ) {
255
256
config .moduleConfigs ["group" ] = & appv1alpha1.ModuleConfig {
256
257
Name : "group" ,
257
258
Config : appconfig .WrapAny (& groupmodulev1.Module {}),
@@ -260,7 +261,7 @@ func GroupModule() ModuleOption {
260
261
}
261
262
262
263
func NFTModule () ModuleOption {
263
- return func (config * appConfig ) {
264
+ return func (config * Config ) {
264
265
config .moduleConfigs ["nft" ] = & appv1alpha1.ModuleConfig {
265
266
Name : "nft" ,
266
267
Config : appconfig .WrapAny (& nftmodulev1.Module {}),
@@ -269,7 +270,7 @@ func NFTModule() ModuleOption {
269
270
}
270
271
271
272
func CircuitModule () ModuleOption {
272
- return func (config * appConfig ) {
273
+ return func (config * Config ) {
273
274
config .moduleConfigs ["circuit" ] = & appv1alpha1.ModuleConfig {
274
275
Name : "circuit" ,
275
276
Config : appconfig .WrapAny (& circuitmodulev1.Module {}),
@@ -278,13 +279,13 @@ func CircuitModule() ModuleOption {
278
279
}
279
280
280
281
func OmitInitGenesis () ModuleOption {
281
- return func (config * appConfig ) {
282
+ return func (config * Config ) {
282
283
config .setInitGenesis = false
283
284
}
284
285
}
285
286
286
287
func NewAppConfig (opts ... ModuleOption ) depinject.Config {
287
- cfg := & appConfig {
288
+ cfg := & Config {
288
289
moduleConfigs : make (map [string ]* appv1alpha1.ModuleConfig ),
289
290
setInitGenesis : true ,
290
291
}
0 commit comments