Skip to content

Commit

Permalink
Removed unused param (#9394)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergio-mena committed Sep 8, 2022
1 parent 5a50158 commit 48ebd22
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion consensus/byzantine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func TestByzantinePrevoteEquivocation(t *testing.T) {
proposerAddr := lazyProposer.privValidatorPubKey.Address()

block, err := lazyProposer.blockExec.CreateProposalBlock(
lazyProposer.Height, lazyProposer.state, commit, proposerAddr, nil)
lazyProposer.Height, lazyProposer.state, commit, proposerAddr)
require.NoError(t, err)
blockParts, err := block.MakePartSet(types.BlockPartSizeBytes)
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion consensus/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@ func (cs *State) createProposalBlock() (*types.Block, error) {

proposerAddr := cs.privValidatorPubKey.Address()

ret, err := cs.blockExec.CreateProposalBlock(cs.Height, cs.state, commit, proposerAddr, cs.LastCommit.GetVotes())
ret, err := cs.blockExec.CreateProposalBlock(cs.Height, cs.state, commit, proposerAddr)
if err != nil {
panic(err)
}
Expand Down
2 changes: 0 additions & 2 deletions node/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ func TestCreateProposalBlock(t *testing.T) {
height,
state, commit,
proposerAddr,
nil,
)
require.NoError(t, err)

Expand Down Expand Up @@ -395,7 +394,6 @@ func TestMaxProposalBlockSize(t *testing.T) {
height,
state, commit,
proposerAddr,
nil,
)
require.NoError(t, err)

Expand Down
5 changes: 2 additions & 3 deletions state/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ func (blockExec *BlockExecutor) CreateProposalBlock(
state State,
commit *types.Commit,
proposerAddr []byte,
votes []*types.Vote,
) (*types.Block, error) {

maxBytes := state.ConsensusParams.Block.MaxBytes
Expand All @@ -116,7 +115,7 @@ func (blockExec *BlockExecutor) CreateProposalBlock(
abci.RequestPrepareProposal{
MaxTxBytes: maxDataBytes,
Txs: block.Txs.ToSliceOfBytes(),
LocalLastCommit: extendedCommitInfo(localLastCommit, votes),
LocalLastCommit: extendedCommitInfo(localLastCommit),
Misbehavior: block.Evidence.Evidence.ToABCI(),
Height: block.Height,
Time: block.Time,
Expand Down Expand Up @@ -432,7 +431,7 @@ func buildLastCommitInfo(block *types.Block, store Store, initialHeight int64) a
}
}

func extendedCommitInfo(c abci.CommitInfo, votes []*types.Vote) abci.ExtendedCommitInfo {
func extendedCommitInfo(c abci.CommitInfo) abci.ExtendedCommitInfo {
vs := make([]abci.ExtendedVoteInfo, len(c.Votes))
for i := range vs {
vs[i] = abci.ExtendedVoteInfo{
Expand Down
10 changes: 5 additions & 5 deletions state/execution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ func TestEmptyPrepareProposal(t *testing.T) {
pa, _ := state.Validators.GetByIndex(0)
commit, err := makeValidCommit(height, types.BlockID{}, state.Validators, privVals)
require.NoError(t, err)
_, err = blockExec.CreateProposalBlock(height, state, commit, pa, nil)
_, err = blockExec.CreateProposalBlock(height, state, commit, pa)
require.NoError(t, err)
}

Expand Down Expand Up @@ -665,7 +665,7 @@ func TestPrepareProposalTxsAllIncluded(t *testing.T) {
pa, _ := state.Validators.GetByIndex(0)
commit, err := makeValidCommit(height, types.BlockID{}, state.Validators, privVals)
require.NoError(t, err)
block, err := blockExec.CreateProposalBlock(height, state, commit, pa, nil)
block, err := blockExec.CreateProposalBlock(height, state, commit, pa)
require.NoError(t, err)

for i, tx := range block.Data.Txs {
Expand Down Expand Up @@ -716,7 +716,7 @@ func TestPrepareProposalReorderTxs(t *testing.T) {
pa, _ := state.Validators.GetByIndex(0)
commit, err := makeValidCommit(height, types.BlockID{}, state.Validators, privVals)
require.NoError(t, err)
block, err := blockExec.CreateProposalBlock(height, state, commit, pa, nil)
block, err := blockExec.CreateProposalBlock(height, state, commit, pa)
require.NoError(t, err)
for i, tx := range block.Data.Txs {
require.Equal(t, txs[i], tx)
Expand Down Expand Up @@ -770,7 +770,7 @@ func TestPrepareProposalErrorOnTooManyTxs(t *testing.T) {
commit, err := makeValidCommit(height, types.BlockID{}, state.Validators, privVals)
require.NoError(t, err)

block, err := blockExec.CreateProposalBlock(height, state, commit, pa, nil)
block, err := blockExec.CreateProposalBlock(height, state, commit, pa)
require.Nil(t, block)
require.ErrorContains(t, err, "transaction data size exceeds maximum")

Expand Down Expand Up @@ -818,7 +818,7 @@ func TestPrepareProposalErrorOnPrepareProposalError(t *testing.T) {
commit, err := makeValidCommit(height, types.BlockID{}, state.Validators, privVals)
require.NoError(t, err)

block, err := blockExec.CreateProposalBlock(height, state, commit, pa, nil)
block, err := blockExec.CreateProposalBlock(height, state, commit, pa)
require.Nil(t, block)
require.ErrorContains(t, err, "an injected error")

Expand Down

0 comments on commit 48ebd22

Please sign in to comment.