Skip to content

Commit

Permalink
register wasm queriers after staking keeper initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
yun-yeo committed Nov 10, 2020
1 parent 4ae926c commit 82923ae
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,20 +245,6 @@ func NewTerraApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest
// create wasm keeper with msg parser & querier
app.wasmKeeper = wasm.NewKeeper(app.cdc, keys[wasm.StoreKey], app.subspaces[wasm.ModuleName],
app.accountKeeper, app.bankKeeper, app.supplyKeeper, app.treasuryKeeper, bApp.Router(), wasm.DefaultFeatures, wasmConfig)
app.wasmKeeper.RegisterMsgParsers(map[string]wasm.WasmMsgParserInterface{
wasm.WasmMsgParserRouteBank: bankwasm.NewWasmMsgParser(),
wasm.WasmMsgParserRouteStaking: stakingwasm.NewWasmMsgParser(),
wasm.WasmMsgParserRouteMarket: marketwasm.NewWasmMsgParser(),
wasm.WasmMsgParserRouteWasm: wasm.NewWasmMsgParser(),
})
app.wasmKeeper.RegisterQueriers(map[string]wasm.WasmQuerierInterface{
wasm.WasmQueryRouteBank: bankwasm.NewWasmQuerier(app.bankKeeper),
wasm.WasmQueryRouteStaking: stakingwasm.NewWasmQuerier(app.stakingKeeper),
wasm.WasmQueryRouteMarket: marketwasm.NewWasmQuerier(app.marketKeeper),
wasm.WasmQueryRouteOracle: oraclewasm.NewWasmQuerier(app.oracleKeeper),
wasm.WasmQueryRouteTreasury: treasurywasm.NewWasmQuerier(app.treasuryKeeper),
wasm.WasmQueryRouteWasm: wasm.NewWasmQuerier(app.wasmKeeper),
})

// register the proposal types
govRouter := gov.NewRouter()
Expand All @@ -275,6 +261,21 @@ func NewTerraApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest
app.stakingKeeper = *stakingKeeper.SetHooks(
staking.NewMultiStakingHooks(app.distrKeeper.Hooks(), app.slashingKeeper.Hooks()))

app.wasmKeeper.RegisterMsgParsers(map[string]wasm.WasmMsgParserInterface{
wasm.WasmMsgParserRouteBank: bankwasm.NewWasmMsgParser(),
wasm.WasmMsgParserRouteStaking: stakingwasm.NewWasmMsgParser(),
wasm.WasmMsgParserRouteMarket: marketwasm.NewWasmMsgParser(),
wasm.WasmMsgParserRouteWasm: wasm.NewWasmMsgParser(),
})
app.wasmKeeper.RegisterQueriers(map[string]wasm.WasmQuerierInterface{
wasm.WasmQueryRouteBank: bankwasm.NewWasmQuerier(app.bankKeeper),
wasm.WasmQueryRouteStaking: stakingwasm.NewWasmQuerier(app.stakingKeeper),
wasm.WasmQueryRouteMarket: marketwasm.NewWasmQuerier(app.marketKeeper),
wasm.WasmQueryRouteOracle: oraclewasm.NewWasmQuerier(app.oracleKeeper),
wasm.WasmQueryRouteTreasury: treasurywasm.NewWasmQuerier(app.treasuryKeeper),
wasm.WasmQueryRouteWasm: wasm.NewWasmQuerier(app.wasmKeeper),
})

app.mm = module.NewManager(
genutil.NewAppModule(app.accountKeeper, app.stakingKeeper, app.BaseApp.DeliverTx),
auth.NewAppModule(app.accountKeeper),
Expand Down

0 comments on commit 82923ae

Please sign in to comment.