fix(runtime): fix option order (backport #21769) (#21770)

Co-authored-by: Julien Robert <julien@rbrt.fr>
This commit is contained in:
mergify[bot] 2024-09-17 10:13:17 +00:00 committed by GitHub
parent 73eea7c93a
commit e9aece088d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,9 +39,18 @@ func (a *AppBuilder) Build(db corestore.KVStoreWithBatch, traceStore io.Writer,
baseAppOptions = append(baseAppOptions, option)
}
// set routers first in case they get modified by other options
baseAppOptions = append(
[]func(*baseapp.BaseApp){
func(bApp *baseapp.BaseApp) {
bApp.SetMsgServiceRouter(a.app.msgServiceRouter)
bApp.SetGRPCQueryRouter(a.app.grpcQueryRouter)
},
},
baseAppOptions...,
)
bApp := baseapp.NewBaseApp(a.app.config.AppName, a.app.logger, db, nil, baseAppOptions...)
bApp.SetMsgServiceRouter(a.app.msgServiceRouter)
bApp.SetGRPCQueryRouter(a.app.grpcQueryRouter)
bApp.SetCommitMultiStoreTracer(traceStore)
bApp.SetVersion(version.Version)
bApp.SetInterfaceRegistry(a.app.interfaceRegistry)