Revert "Return errors instead of panic (#3782)" (#4054)

This reverts commit 985aae5575.
This commit is contained in:
frog power 4000
2019-04-05 16:20:58 -04:00
committed by GitHub
parent 055d219301
commit cec3065a36
28 changed files with 135 additions and 296 deletions
+2 -10
View File
@@ -538,7 +538,6 @@ func (app *BaseApp) validateHeight(req abci.RequestBeginBlock) error {
// BeginBlock implements the ABCI application interface.
func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeginBlock) {
var err error
if app.cms.TracingEnabled() {
app.cms.SetTracingContext(sdk.TraceContext(
map[string]interface{}{"blockHeight": req.Header.Height},
@@ -573,10 +572,7 @@ func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeg
app.deliverState.ctx = app.deliverState.ctx.WithBlockGasMeter(gasMeter)
if app.beginBlocker != nil {
res, err = app.beginBlocker(app.deliverState.ctx, req)
if err != nil {
panic(err)
}
res = app.beginBlocker(app.deliverState.ctx, req)
}
// set the signed validators for addition to context in deliverTx
@@ -878,16 +874,12 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte, tx sdk.Tx) (result sdk
// EndBlock implements the ABCI interface.
func (app *BaseApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndBlock) {
var err error
if app.deliverState.ms.TracingEnabled() {
app.deliverState.ms = app.deliverState.ms.SetTracingContext(nil).(sdk.CacheMultiStore)
}
if app.endBlocker != nil {
res, err = app.endBlocker(app.deliverState.ctx, req)
if err != nil {
panic(err)
}
res = app.endBlocker(app.deliverState.ctx, req)
}
return