mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-04 04:04:00 +00:00
abci: update evidence (#5324)
This commit is contained in:
@@ -14,10 +14,6 @@ import (
|
||||
//-------------------------------------------------------
|
||||
// Use strings to distinguish types in ABCI messages
|
||||
|
||||
const (
|
||||
ABCIEvidenceTypeDuplicateVote = "duplicate/vote"
|
||||
)
|
||||
|
||||
const (
|
||||
ABCIPubKeyTypeEd25519 = "ed25519"
|
||||
)
|
||||
@@ -124,10 +120,10 @@ func (tm2pb) Evidence(ev Evidence, valSet *ValidatorSet) abci.Evidence {
|
||||
}
|
||||
|
||||
// set type
|
||||
var evType string
|
||||
var evType abci.EvidenceType
|
||||
switch ev.(type) {
|
||||
case *DuplicateVoteEvidence:
|
||||
evType = ABCIEvidenceTypeDuplicateVote
|
||||
evType = abci.EvidenceType_DUPLICATE_VOTE
|
||||
default:
|
||||
panic(fmt.Sprintf("unknown evidence type: %v %v", ev, reflect.TypeOf(ev)))
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ func TestABCIEvidence(t *testing.T) {
|
||||
NewValidatorSet([]*Validator{NewValidator(pubKey, 10)}),
|
||||
)
|
||||
|
||||
assert.Equal(t, ABCIEvidenceTypeDuplicateVote, abciEv.Type)
|
||||
assert.Equal(t, abci.EvidenceType_DUPLICATE_VOTE, abciEv.Type)
|
||||
assert.Equal(t, ev.Time(), abciEv.GetTime())
|
||||
assert.Equal(t, ev.Address(), abciEv.Validator.GetAddress())
|
||||
assert.Equal(t, ev.Height(), abciEv.GetHeight())
|
||||
|
||||
Reference in New Issue
Block a user