types: Remove NewExtendedCommit constructor

Signed-off-by: Thane Thomson <connect@thanethomson.com>
This commit is contained in:
Thane Thomson
2022-05-04 17:18:41 -04:00
parent a3b3415a3a
commit b5a94bba16
11 changed files with 46 additions and 40 deletions
+3 -3
View File
@@ -43,9 +43,9 @@ func (p testPeer) runInputRoutine() {
// Request desired, pretend like we got the block immediately.
func (p testPeer) simulateInput(input inputData) {
block := &types.Block{Header: types.Header{Height: input.request.Height}}
var blockID types.BlockID
var extCommitSigs []types.ExtendedCommitSig
extCommit := types.NewExtendedCommit(input.request.Height, 0, blockID, extCommitSigs)
extCommit := &types.ExtendedCommit{
Height: input.request.Height,
}
_ = input.pool.AddBlock(input.request.PeerID, block, extCommit, 123)
// TODO: uncommenting this creates a race which is detected by:
// https://github.com/golang/go/blob/2bd767b1022dd3254bcec469f0ee164024726486/src/testing/testing.go#L854-L856
+7 -7
View File
@@ -150,7 +150,7 @@ func (rts *reactorTestSuite) addNode(
var lastExtCommit *types.ExtendedCommit
// The commit we are building for the current height.
seenExtCommit := types.NewExtendedCommit(0, 0, types.BlockID{}, nil)
seenExtCommit := &types.ExtendedCommit{}
for blockHeight := int64(1); blockHeight <= maxBlockHeight; blockHeight++ {
lastExtCommit = seenExtCommit.Copy()
@@ -173,12 +173,12 @@ func (rts *reactorTestSuite) addNode(
time.Now(),
)
require.NoError(t, err)
seenExtCommit = types.NewExtendedCommit(
vote.Height,
vote.Round,
blockID,
[]types.ExtendedCommitSig{vote.ExtendedCommitSig()},
)
seenExtCommit = &types.ExtendedCommit{
Height: vote.Height,
Round: vote.Round,
BlockID: blockID,
ExtendedSignatures: []types.ExtendedCommitSig{vote.ExtendedCommitSig()},
}
state, err = blockExec.ApplyBlock(ctx, state, blockID, thisBlock)
require.NoError(t, err)