Browse Source

remove unused 'votes' parameter from CreateProposalBlock

wb/txrset
William Banfield 3 years ago
parent
commit
3ae7382ed0
No known key found for this signature in database GPG Key ID: EFAD3442BF29E3AC
5 changed files with 3 additions and 10 deletions
  1. +1
    -2
      internal/consensus/byzantine_test.go
  2. +1
    -3
      internal/consensus/state.go
  3. +0
    -1
      internal/state/execution.go
  4. +1
    -1
      internal/state/execution_test.go
  5. +0
    -3
      node/node_test.go

+ 1
- 2
internal/consensus/byzantine_test.go 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
internal/consensus/state.go 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.


+ 0
- 1
internal/state/execution.go 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
internal/state/execution_test.go 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)
}


+ 0
- 3
node/node_test.go 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)


Loading…
Cancel
Save