|
|
@ -107,23 +107,23 @@ func (pv *MockPV) DisableChecks() { |
|
|
|
// as MockPV has no safety checks at all.
|
|
|
|
} |
|
|
|
|
|
|
|
type erroringMockPV struct { |
|
|
|
type ErroringMockPV struct { |
|
|
|
*MockPV |
|
|
|
} |
|
|
|
|
|
|
|
var ErroringMockPVErr = errors.New("erroringMockPV always returns an error") |
|
|
|
|
|
|
|
// Implements PrivValidator.
|
|
|
|
func (pv *erroringMockPV) SignVote(chainID string, vote *Vote) error { |
|
|
|
func (pv *ErroringMockPV) SignVote(chainID string, vote *Vote) error { |
|
|
|
return ErroringMockPVErr |
|
|
|
} |
|
|
|
|
|
|
|
// Implements PrivValidator.
|
|
|
|
func (pv *erroringMockPV) SignProposal(chainID string, proposal *Proposal) error { |
|
|
|
func (pv *ErroringMockPV) SignProposal(chainID string, proposal *Proposal) error { |
|
|
|
return ErroringMockPVErr |
|
|
|
} |
|
|
|
|
|
|
|
// NewErroringMockPV returns a MockPV that fails on each signing request. Again, for testing only.
|
|
|
|
func NewErroringMockPV() *erroringMockPV { |
|
|
|
return &erroringMockPV{&MockPV{ed25519.GenPrivKey(), false, false}} |
|
|
|
func NewErroringMockPV() *ErroringMockPV { |
|
|
|
return &ErroringMockPV{&MockPV{ed25519.GenPrivKey(), false, false}} |
|
|
|
} |