generated privValidator for testing uses tmp files

PrivValidator.Sign*() and .Save() lock on a mutex
This commit is contained in:
Jae Kwon
2014-12-22 18:49:37 -08:00
parent 383335d93c
commit 403d24a4b2
5 changed files with 43 additions and 29 deletions

View File

@ -8,7 +8,7 @@ import (
)
func TestSetupRound(t *testing.T) {
cs, privValidators := makeConsensusState()
cs, privValidators := randConsensusState()
val0 := privValidators[0]
// Add a vote, precommit, and commit by val0.
@ -50,7 +50,7 @@ func TestSetupRound(t *testing.T) {
}
func TestRunActionProposeNoPrivValidator(t *testing.T) {
cs, _ := makeConsensusState()
cs, _ := randConsensusState()
cs.RunActionPropose(1, 0)
rs := cs.GetRoundState()
if rs.Proposal != nil {
@ -59,7 +59,7 @@ func TestRunActionProposeNoPrivValidator(t *testing.T) {
}
func TestRunActionPropose(t *testing.T) {
cs, privValidators := makeConsensusState()
cs, privValidators := randConsensusState()
val0 := privValidators[0]
cs.SetPrivValidator(val0)
@ -92,7 +92,7 @@ func checkRoundState(t *testing.T, rs *RoundState,
}
func TestRunActionPrecommitCommitFinalize(t *testing.T) {
cs, privValidators := makeConsensusState()
cs, privValidators := randConsensusState()
val0 := privValidators[0]
cs.SetPrivValidator(val0)