Apply suggestions from code review

Co-authored-by: M. J. Fromberger <fromberger@interchain.io>
This commit is contained in:
Thane Thomson
2022-05-09 06:32:53 -04:00
committed by GitHub
co-authored by M. J. Fromberger
parent 9483b42f0b
commit b1896ebca6
7 changed files with 17 additions and 22 deletions
+7 -5
View File
@@ -414,11 +414,13 @@ func buildLastCommitInfo(block *types.Block, store Store, initialHeight int64) a
}
}
// buildLastExtendedCommitInfo expects an ExtendedCommitInfo, which includes
// the original precommit votes along with their vote extensions from the last
// commit. It populates the corresponding ABCI protobuf structures using the
// validator set obtained from the store at the height of the last extended
// commit.
// buildLastExtendedCommitInfo populates an ABCI extended commit from the
// corresponding Tendermint extended commit ec, using the stored validator set from
// ec. It requires ec to include the original precommit votes along
// with the vote extensions from the last commit.
//
// For heights below the initial height, for which we do not have the
// required data, it returns an empty record.
func buildLastExtendedCommitInfo(ec *types.ExtendedCommit, store Store, initialHeight int64) abci.ExtendedCommitInfo {
// We assume the current height is ec.Height + 1.
if ec.Height < initialHeight {
+2 -3
View File
@@ -328,11 +328,10 @@ func TestProcessProposal(t *testing.T) {
lastCommitSig = append(lastCommitSig, vote.CommitSig())
}
lastCommit := &types.Commit{
block1 := sf.MakeBlock(state, height, &types.Commit{
Height: height - 1,
Signatures: lastCommitSig,
}
block1 := sf.MakeBlock(state, height, lastCommit)
})
block1.Txs = txs
expectedRpp := &abci.RequestProcessProposal{