remove unused 'votes' parameter from CreateProposalBlock

This commit is contained in:
William Banfield
2022-03-08 17:37:16 -05:00
parent d796d3f103
commit 3ae7382ed0
5 changed files with 3 additions and 10 deletions
+1 -2
View File
@@ -203,8 +203,7 @@ func TestByzantinePrevoteEquivocation(t *testing.T) {
proposerAddr := lazyNodeState.privValidatorPubKey.Address()
block, err := lazyNodeState.blockExec.CreateProposalBlock(
ctx, lazyNodeState.Height, lazyNodeState.state, commit, proposerAddr, votes,
)
ctx, lazyNodeState.Height, lazyNodeState.state, commit, proposerAddr)
require.NoError(t, err)
blockParts, err := block.MakePartSet(types.BlockPartSizeBytes)
require.NoError(t, err)
+1 -3
View File
@@ -1363,7 +1363,6 @@ func (cs *State) createProposalBlock(ctx context.Context) (block *types.Block, e
}
var commit *types.Commit
var votes []*types.Vote
switch {
case cs.Height == cs.state.InitialHeight:
// We're creating a proposal for the first block.
@@ -1373,7 +1372,6 @@ func (cs *State) createProposalBlock(ctx context.Context) (block *types.Block, e
case cs.LastCommit.HasTwoThirdsMajority():
// Make the commit from LastCommit
commit = cs.LastCommit.MakeCommit()
votes = cs.LastCommit.GetVotes()
default: // This shouldn't happen.
cs.logger.Error("propose step; cannot propose anything without commit for the previous block")
@@ -1389,7 +1387,7 @@ func (cs *State) createProposalBlock(ctx context.Context) (block *types.Block, e
proposerAddr := cs.privValidatorPubKey.Address()
return cs.blockExec.CreateProposalBlock(ctx, cs.Height, cs.state, commit, proposerAddr, votes)
return cs.blockExec.CreateProposalBlock(ctx, cs.Height, cs.state, commit, proposerAddr)
}
// Enter: `timeoutPropose` after entering Propose.
-1
View File
@@ -102,7 +102,6 @@ func (blockExec *BlockExecutor) CreateProposalBlock(
state State,
commit *types.Commit,
proposerAddr []byte,
votes []*types.Vote,
) (*types.Block, error) {
maxBytes := state.ConsensusParams.Block.MaxBytes
+1 -1
View File
@@ -653,7 +653,7 @@ func TestEmptyPrepareProposal(t *testing.T) {
)
pa, _ := state.Validators.GetByIndex(0)
commit := makeValidCommit(ctx, t, height, types.BlockID{}, state.Validators, privVals)
_, err = blockExec.CreateProposalBlock(ctx, height, state, commit, pa, nil)
_, err = blockExec.CreateProposalBlock(ctx, height, state, commit, pa)
require.NoError(t, err)
}
-3
View File
@@ -341,7 +341,6 @@ func TestCreateProposalBlock(t *testing.T) {
height,
state, commit,
proposerAddr,
nil,
)
require.NoError(t, err)
@@ -420,7 +419,6 @@ func TestMaxTxsProposalBlockSize(t *testing.T) {
height,
state, commit,
proposerAddr,
nil,
)
require.NoError(t, err)
@@ -535,7 +533,6 @@ func TestMaxProposalBlockSize(t *testing.T) {
math.MaxInt64,
state, commit,
proposerAddr,
nil,
)
require.NoError(t, err)
partSet, err := block.MakePartSet(types.BlockPartSizeBytes)