Skip to content

Commit

Permalink
fix(runtime): fix option order (backport #21769) (#21770)
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Robert <julien@rbrt.fr>
  • Loading branch information
mergify[bot] and julienrbrt authored Sep 17, 2024
1 parent 73eea7c commit e9aece0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions runtime/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e9aece0

Please sign in to comment.