feat!: return errors in module manager ABCI methods (#14847)
This commit is contained in:
+3
-3
@@ -116,17 +116,17 @@ func (a *App) Load(loadLatest bool) error {
|
||||
}
|
||||
|
||||
// BeginBlocker application updates every begin block
|
||||
func (a *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {
|
||||
func (a *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) (abci.ResponseBeginBlock, error) {
|
||||
return a.ModuleManager.BeginBlock(ctx, req)
|
||||
}
|
||||
|
||||
// EndBlocker application updates every end block
|
||||
func (a *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock {
|
||||
func (a *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) (abci.ResponseEndBlock, error) {
|
||||
return a.ModuleManager.EndBlock(ctx, req)
|
||||
}
|
||||
|
||||
// InitChainer initializes the chain.
|
||||
func (a *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain {
|
||||
func (a *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) (abci.ResponseInitChain, error) {
|
||||
var genesisState map[string]json.RawMessage
|
||||
if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
|
||||
panic(err)
|
||||
|
||||
+3
-3
@@ -22,13 +22,13 @@ type AppI interface {
|
||||
LegacyAmino() *codec.LegacyAmino
|
||||
|
||||
// Application updates every begin block.
|
||||
BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock
|
||||
BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) (abci.ResponseBeginBlock, error)
|
||||
|
||||
// Application updates every end block.
|
||||
EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock
|
||||
EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) (abci.ResponseEndBlock, error)
|
||||
|
||||
// Application update at chain (i.e app) initialization.
|
||||
InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain
|
||||
InitChainer(ctx sdk.Context, req abci.RequestInitChain) (abci.ResponseInitChain, error)
|
||||
|
||||
// Loads the app at a given height.
|
||||
LoadHeight(height int64) error
|
||||
|
||||
Reference in New Issue
Block a user