fix baseapp tests

This commit is contained in:
rigelrozanski 2018-11-14 14:07:46 -05:00
parent 68e3b9a559
commit 0d4dd8762b
2 changed files with 9 additions and 17 deletions

View File

@ -264,15 +264,6 @@ func (app *BaseApp) InitChain(req abci.RequestInitChain) (res abci.ResponseInitC
}
res = app.initChainer(app.deliverState.ctx, req)
// add block gas meter
if app.maximumBlockGas > 0 {
app.deliverState.ctx = app.deliverState.ctx.
WithBlockGasMeter(sdk.NewGasMeter(app.maximumBlockGas))
} else {
app.deliverState.ctx = app.deliverState.ctx.
WithBlockGasMeter(sdk.NewInfiniteGasMeter())
}
// NOTE: we don't commit, but BeginBlock for block 1
// starts from this deliverState
return
@ -443,15 +434,15 @@ func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeg
app.deliverState.ctx = app.deliverState.ctx.
WithBlockHeader(req.Header).
WithBlockHeight(req.Header.Height)
}
// add block gas meter
if app.maximumBlockGas > 0 {
app.deliverState.ctx = app.deliverState.ctx.
WithBlockGasMeter(sdk.NewGasMeter(app.maximumBlockGas))
} else {
app.deliverState.ctx = app.deliverState.ctx.
WithBlockGasMeter(sdk.NewInfiniteGasMeter())
}
// add block gas meter
if app.maximumBlockGas > 0 {
app.deliverState.ctx = app.deliverState.ctx.
WithBlockGasMeter(sdk.NewGasMeter(app.maximumBlockGas))
} else {
app.deliverState.ctx = app.deliverState.ctx.
WithBlockGasMeter(sdk.NewInfiniteGasMeter())
}
if app.beginBlocker != nil {

View File

@ -491,6 +491,7 @@ func TestDeliverTx(t *testing.T) {
}
app := setupBaseApp(t, anteOpt, routerOpt)
app.InitChain(abci.RequestInitChain{})
// Create same codec used in txDecoder
codec := codec.New()