mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-13 05:11:21 +00:00
Dot import -> named import
Changed modulename_ to short module names Also removed Unreader, replaced with PrefixdReader in select locations
This commit is contained in:
@ -4,7 +4,7 @@ import (
|
||||
"bytes"
|
||||
"testing"
|
||||
|
||||
. "github.com/tendermint/tendermint/block"
|
||||
"github.com/tendermint/tendermint/block"
|
||||
)
|
||||
|
||||
func TestSetupRound(t *testing.T) {
|
||||
@ -12,9 +12,9 @@ func TestSetupRound(t *testing.T) {
|
||||
val0 := privValidators[0]
|
||||
|
||||
// Add a vote, precommit, and commit by val0.
|
||||
voteTypes := []byte{VoteTypePrevote, VoteTypePrecommit, VoteTypeCommit}
|
||||
voteTypes := []byte{block.VoteTypePrevote, block.VoteTypePrecommit, block.VoteTypeCommit}
|
||||
for _, voteType := range voteTypes {
|
||||
vote := &Vote{Height: 1, Round: 0, Type: voteType} // nil vote
|
||||
vote := &block.Vote{Height: 1, Round: 0, Type: voteType} // nil vote
|
||||
err := val0.SignVote(vote)
|
||||
if err != nil {
|
||||
t.Error("Error signing vote: %v", err)
|
||||
@ -24,13 +24,13 @@ func TestSetupRound(t *testing.T) {
|
||||
|
||||
// Ensure that vote appears in RoundState.
|
||||
rs0 := cs.GetRoundState()
|
||||
if vote := rs0.Prevotes.GetByAddress(val0.Address); vote == nil || vote.Type != VoteTypePrevote {
|
||||
if vote := rs0.Prevotes.GetByAddress(val0.Address); vote == nil || vote.Type != block.VoteTypePrevote {
|
||||
t.Errorf("Expected to find prevote but got %v", vote)
|
||||
}
|
||||
if vote := rs0.Precommits.GetByAddress(val0.Address); vote == nil || vote.Type != VoteTypePrecommit {
|
||||
if vote := rs0.Precommits.GetByAddress(val0.Address); vote == nil || vote.Type != block.VoteTypePrecommit {
|
||||
t.Errorf("Expected to find precommit but got %v", vote)
|
||||
}
|
||||
if vote := rs0.Commits.GetByAddress(val0.Address); vote == nil || vote.Type != VoteTypeCommit {
|
||||
if vote := rs0.Commits.GetByAddress(val0.Address); vote == nil || vote.Type != block.VoteTypeCommit {
|
||||
t.Errorf("Expected to find commit but got %v", vote)
|
||||
}
|
||||
|
||||
@ -40,13 +40,13 @@ func TestSetupRound(t *testing.T) {
|
||||
|
||||
// Now the commit should be copied over to prevotes and precommits.
|
||||
rs1 := cs.GetRoundState()
|
||||
if vote := rs1.Prevotes.GetByAddress(val0.Address); vote == nil || vote.Type != VoteTypeCommit {
|
||||
if vote := rs1.Prevotes.GetByAddress(val0.Address); vote == nil || vote.Type != block.VoteTypeCommit {
|
||||
t.Errorf("Expected to find commit but got %v", vote)
|
||||
}
|
||||
if vote := rs1.Precommits.GetByAddress(val0.Address); vote == nil || vote.Type != VoteTypeCommit {
|
||||
if vote := rs1.Precommits.GetByAddress(val0.Address); vote == nil || vote.Type != block.VoteTypeCommit {
|
||||
t.Errorf("Expected to find commit but got %v", vote)
|
||||
}
|
||||
if vote := rs1.Commits.GetByAddress(val0.Address); vote == nil || vote.Type != VoteTypeCommit {
|
||||
if vote := rs1.Commits.GetByAddress(val0.Address); vote == nil || vote.Type != block.VoteTypeCommit {
|
||||
t.Errorf("Expected to find commit but got %v", vote)
|
||||
}
|
||||
|
||||
@ -116,10 +116,10 @@ func TestRunActionPrecommitCommitFinalize(t *testing.T) {
|
||||
|
||||
// Add at least +2/3 prevotes.
|
||||
for i := 0; i < 7; i++ {
|
||||
vote := &Vote{
|
||||
vote := &block.Vote{
|
||||
Height: 1,
|
||||
Round: 0,
|
||||
Type: VoteTypePrevote,
|
||||
Type: block.VoteTypePrevote,
|
||||
BlockHash: cs.ProposalBlock.Hash(),
|
||||
BlockParts: cs.ProposalBlockParts.Header(),
|
||||
}
|
||||
@ -146,10 +146,10 @@ func TestRunActionPrecommitCommitFinalize(t *testing.T) {
|
||||
}
|
||||
continue
|
||||
}
|
||||
vote := &Vote{
|
||||
vote := &block.Vote{
|
||||
Height: 1,
|
||||
Round: 0,
|
||||
Type: VoteTypePrecommit,
|
||||
Type: block.VoteTypePrecommit,
|
||||
BlockHash: cs.ProposalBlock.Hash(),
|
||||
BlockParts: cs.ProposalBlockParts.Header(),
|
||||
}
|
||||
@ -184,10 +184,10 @@ func TestRunActionPrecommitCommitFinalize(t *testing.T) {
|
||||
}
|
||||
continue
|
||||
}
|
||||
vote := &Vote{
|
||||
vote := &block.Vote{
|
||||
Height: 1,
|
||||
Round: uint(i), // Doesn't matter what round
|
||||
Type: VoteTypeCommit,
|
||||
Type: block.VoteTypeCommit,
|
||||
BlockHash: cs.ProposalBlock.Hash(),
|
||||
BlockParts: cs.ProposalBlockParts.Header(),
|
||||
}
|
||||
|
Reference in New Issue
Block a user