mirror of
https://github.com/tendermint/tendermint.git
synced 2026-09-18 22:14:35 +00:00
types: Remove NewCommit constructor
Signed-off-by: Thane Thomson <connect@thanethomson.com>
This commit is contained in:
+6
-11
@@ -896,16 +896,6 @@ type Commit struct {
|
||||
hash tmbytes.HexBytes
|
||||
}
|
||||
|
||||
// NewCommit returns a new Commit.
|
||||
func NewCommit(height int64, round int32, blockID BlockID, commitSigs []CommitSig) *Commit {
|
||||
return &Commit{
|
||||
Height: height,
|
||||
Round: round,
|
||||
BlockID: blockID,
|
||||
Signatures: commitSigs,
|
||||
}
|
||||
}
|
||||
|
||||
// GetVote converts the CommitSig for the given valIdx to a Vote. Commits do
|
||||
// not contain vote extensions, so the vote extension and vote extension
|
||||
// signature will not be present in the returned vote.
|
||||
@@ -1122,7 +1112,12 @@ func (extCommit *ExtendedCommit) StripExtensions() *Commit {
|
||||
Signature: extCommitSig.Signature,
|
||||
}
|
||||
}
|
||||
return NewCommit(extCommit.Height, extCommit.Round, extCommit.BlockID, commitSigs)
|
||||
return &Commit{
|
||||
Height: extCommit.Height,
|
||||
Round: extCommit.Round,
|
||||
BlockID: extCommit.BlockID,
|
||||
Signatures: commitSigs,
|
||||
}
|
||||
}
|
||||
|
||||
// GetExtendedVote converts the ExtendedCommitSig for the given valIdx to a
|
||||
|
||||
+4
-1
@@ -104,7 +104,10 @@ func TestBlockValidateBasic(t *testing.T) {
|
||||
blk.LastCommit = nil
|
||||
}, true},
|
||||
{"Invalid LastCommit", func(blk *Block) {
|
||||
blk.LastCommit = NewCommit(-1, 0, *voteSet.maj23, nil)
|
||||
blk.LastCommit = &Commit{
|
||||
Height: -1,
|
||||
BlockID: *voteSet.maj23,
|
||||
}
|
||||
}, true},
|
||||
{"Invalid Evidence", func(blk *Block) {
|
||||
emptyEv := &DuplicateVoteEvidence{}
|
||||
|
||||
@@ -99,7 +99,12 @@ func TestValidatorSet_VerifyCommit_All(t *testing.T) {
|
||||
|
||||
vi++
|
||||
}
|
||||
commit := NewCommit(tc.height, round, tc.blockID, sigs)
|
||||
commit := &Commit{
|
||||
Height: tc.height,
|
||||
Round: round,
|
||||
BlockID: tc.blockID,
|
||||
Signatures: sigs,
|
||||
}
|
||||
|
||||
err := valSet.VerifyCommit(chainID, blockID, height, commit)
|
||||
if tc.expErr {
|
||||
|
||||
Reference in New Issue
Block a user