From 2a594fe3381b3b990c08da91fa2848f7f71a5845 Mon Sep 17 00:00:00 2001 From: rigelrozanski Date: Thu, 15 Nov 2018 11:13:18 -0500 Subject: [PATCH] basic cwgoes comments --- baseapp/baseapp.go | 10 +++++----- docs/spec/baseapp/WIP_abci_application.md | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 7e35fb5f6e..2cd7f562b3 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -253,7 +253,7 @@ func (app *BaseApp) SetOption(req abci.RequestSetOption) (res abci.ResponseSetOp } // Implements ABCI -// InitChain runs the initialization logic directly on the CommitMultiStore and commits it. +// InitChain runs the initialization logic directly on the CommitMultiStore. func (app *BaseApp) InitChain(req abci.RequestInitChain) (res abci.ResponseInitChain) { // Initialize the deliver state and check state with ChainID and run initChain app.setDeliverState(abci.Header{ChainID: req.ChainId}) @@ -442,13 +442,13 @@ func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeg } // add block gas meter + var gasMeter sdk.GasMeter if app.maximumBlockGas > 0 { - app.deliverState.ctx = app.deliverState.ctx. - WithBlockGasMeter(sdk.NewGasMeter(app.maximumBlockGas)) + gasMeter = sdk.NewGasMeter(app.maximumBlockGas) } else { - app.deliverState.ctx = app.deliverState.ctx. - WithBlockGasMeter(sdk.NewInfiniteGasMeter()) + gasMeter = sdk.NewInfiniteGasMeter() } + app.deliverState.ctx = app.deliverState.ctx.WithBlockGasMeter(gasMeter) if app.beginBlocker != nil { res = app.beginBlocker(app.deliverState.ctx, req) diff --git a/docs/spec/baseapp/WIP_abci_application.md b/docs/spec/baseapp/WIP_abci_application.md index 52f0ab18dd..7baadccee4 100644 --- a/docs/spec/baseapp/WIP_abci_application.md +++ b/docs/spec/baseapp/WIP_abci_application.md @@ -14,9 +14,9 @@ The `BaseApp` struct fulfills the tendermint-abci `Application` interface. TODO pseudo code During chain initialization InitChain runs the initialization logic directly on -the CommitMultiStore and commits it. The deliver and check states are -initialized with the ChainID. Additionally the Block gas meter is initialized -with an infinite amount of gas to run any genesis transactions. +the CommitMultiStore. The deliver and check states are initialized with the +ChainID. Additionally the block gas meter is initialized with an infinite +amount of gas to run any genesis transactions. Note that we do not `Commit` during `InitChain` however BeginBlock for block 1 starts from this deliverState.