PrepareProposal-VoteExtension integration (#6915)

This commit is contained in:
mconcat
2022-02-02 11:51:13 +01:00
committed by Sergio Mena
parent d2afb91e99
commit 39ffa80ae7
8 changed files with 281 additions and 188 deletions
+6 -2
View File
@@ -105,6 +105,7 @@ func (blockExec *BlockExecutor) CreateProposalBlock(
height int64,
state State, commit *types.Commit,
proposerAddr []byte,
votes []*types.Vote,
) (*types.Block, *types.PartSet, error) {
maxBytes := state.ConsensusParams.Block.MaxBytes
@@ -119,7 +120,11 @@ func (blockExec *BlockExecutor) CreateProposalBlock(
preparedProposal, err := blockExec.proxyApp.PrepareProposal(
context.Background(),
abci.RequestPrepareProposal{BlockData: txs.ToSliceOfBytes(), BlockDataSize: maxDataBytes},
abci.RequestPrepareProposal{
BlockData: txs.ToSliceOfBytes(),
BlockDataSize: maxDataBytes,
Votes: types.VotesToProto(votes),
},
)
if err != nil {
// The App MUST ensure that only valid (and hence 'processable') transactions
@@ -270,7 +275,6 @@ func (blockExec *BlockExecutor) ExtendVote(vote *types.Vote) (types.VoteExtensio
if err != nil {
return types.VoteExtension{}, err
}
return types.VoteExtensionFromProto(resp.VoteExtension), nil
}