mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-09 17:46:07 +00:00
apply the renames to LastCommitInfo
This commit is contained in:
@@ -162,7 +162,7 @@ func (blockExec *BlockExecutor) ProcessProposal(
|
||||
Hash: block.Header.Hash(),
|
||||
Header: *block.Header.ToProto(),
|
||||
Txs: block.Data.Txs.ToSliceOfBytes(),
|
||||
LastCommitInfo: buildLastCommitInfo(block, blockExec.store, state.InitialHeight),
|
||||
ProposedLastCommit: buildLastCommitInfo(block, blockExec.store, state.InitialHeight),
|
||||
ByzantineValidators: block.Evidence.ToABCI(),
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ func (blockExec *BlockExecutor) ApplyBlock(
|
||||
Hash: block.Hash(),
|
||||
Header: *pbh,
|
||||
Txs: block.Txs.ToSliceOfBytes(),
|
||||
LastCommitInfo: buildLastCommitInfo(block, blockExec.store, state.InitialHeight),
|
||||
DecidedLastCommit: buildLastCommitInfo(block, blockExec.store, state.InitialHeight),
|
||||
ByzantineValidators: block.Evidence.ToABCI(),
|
||||
},
|
||||
)
|
||||
@@ -374,11 +374,11 @@ func (blockExec *BlockExecutor) Commit(
|
||||
return res.Data, res.RetainHeight, err
|
||||
}
|
||||
|
||||
func buildLastCommitInfo(block *types.Block, store Store, initialHeight int64) abci.LastCommitInfo {
|
||||
func buildLastCommitInfo(block *types.Block, store Store, initialHeight int64) abci.CommitInfo {
|
||||
if block.Height == initialHeight {
|
||||
// there is no last commmit for the initial height.
|
||||
// return an empty value.
|
||||
return abci.LastCommitInfo{}
|
||||
return abci.CommitInfo{}
|
||||
}
|
||||
|
||||
lastValSet, err := store.LoadValidators(block.Height - 1)
|
||||
@@ -409,7 +409,7 @@ func buildLastCommitInfo(block *types.Block, store Store, initialHeight int64) a
|
||||
}
|
||||
}
|
||||
|
||||
return abci.LastCommitInfo{
|
||||
return abci.CommitInfo{
|
||||
Round: block.LastCommit.Round,
|
||||
Votes: votes,
|
||||
}
|
||||
@@ -594,7 +594,7 @@ func ExecCommitBlock(
|
||||
Hash: block.Hash(),
|
||||
Header: *pbh,
|
||||
Txs: block.Txs.ToSliceOfBytes(),
|
||||
LastCommitInfo: buildLastCommitInfo(block, store, initialHeight),
|
||||
DecidedLastCommit: buildLastCommitInfo(block, store, initialHeight),
|
||||
ByzantineValidators: block.Evidence.ToABCI(),
|
||||
},
|
||||
)
|
||||
|
||||
@@ -67,10 +67,10 @@ func TestApplyBlock(t *testing.T) {
|
||||
assert.EqualValues(t, 1, state.Version.Consensus.App, "App version wasn't updated")
|
||||
}
|
||||
|
||||
// TestFinalizeBlockLastCommitInfo ensures we correctly send the LastCommitInfo to the
|
||||
// application. The test ensures that the LastCommitInfo properly reflects
|
||||
// TestFinalizeBlockDecidedLastCommit ensures we correctly send the DecidedLastCommit to the
|
||||
// application. The test ensures that the DecidedLastCommit properly reflects
|
||||
// which validators signed the preceding block.
|
||||
func TestFinalizeBlockLastCommitInfo(t *testing.T) {
|
||||
func TestFinalizeBlockDecidedLastCommit(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
@@ -291,7 +291,7 @@ func TestProcessProposal(t *testing.T) {
|
||||
Header: *block1.Header.ToProto(),
|
||||
Txs: block1.Txs.ToSliceOfBytes(),
|
||||
ByzantineValidators: block1.Evidence.ToABCI(),
|
||||
LastCommitInfo: abci.LastCommitInfo{
|
||||
ProposedLastCommit: abci.CommitInfo{
|
||||
Round: 0,
|
||||
Votes: voteInfos,
|
||||
},
|
||||
|
||||
@@ -293,7 +293,7 @@ func (app *testApp) Info(req abci.RequestInfo) (resInfo abci.ResponseInfo) {
|
||||
}
|
||||
|
||||
func (app *testApp) FinalizeBlock(req abci.RequestFinalizeBlock) abci.ResponseFinalizeBlock {
|
||||
app.CommitVotes = req.LastCommitInfo.Votes
|
||||
app.CommitVotes = req.DecidedLastCommit.Votes
|
||||
app.ByzantineValidators = req.ByzantineValidators
|
||||
|
||||
resTxs := make([]*abci.ExecTxResult, len(req.Txs))
|
||||
|
||||
Reference in New Issue
Block a user