Set evidence.Type

This commit is contained in:
Christopher Goes
2018-05-31 05:32:01 +02:00
parent 2046b346a1
commit 73de99ecab
3 changed files with 5 additions and 4 deletions
+1
View File
@@ -199,6 +199,7 @@ func execBlockOnProxyApp(logger log.Logger, proxyAppConn proxy.AppConnConsensus,
byzantineVals := make([]abci.Evidence, len(block.Evidence.Evidence))
for i, ev := range block.Evidence.Evidence {
byzantineVals[i] = abci.Evidence{
Type: []byte(ev.String()),
PubKey: ev.Address(), // XXX
Height: ev.Height(),
}
+3 -3
View File
@@ -110,10 +110,10 @@ func TestBeginBlockByzantineValidators(t *testing.T) {
expectedByzantineValidators []abci.Evidence
}{
{"none byzantine", []types.Evidence{}, []abci.Evidence{}},
{"one byzantine", []types.Evidence{ev1}, []abci.Evidence{{nil, ev1.Address(), ev1.Height(), int64(0)}}},
{"one byzantine", []types.Evidence{ev1}, []abci.Evidence{{[]byte(ev1.String()), ev1.Address(), ev1.Height(), int64(0)}}},
{"multiple byzantine", []types.Evidence{ev1, ev2}, []abci.Evidence{
{nil, ev1.Address(), ev1.Height(), int64(0)},
{nil, ev2.Address(), ev2.Height(), int64(0)}}},
{[]byte(ev1.String()), ev1.Address(), ev1.Height(), int64(0)},
{[]byte(ev2.String()), ev2.Address(), ev2.Height(), int64(0)}}},
}
for _, tc := range testCases {
+1 -1
View File
@@ -40,7 +40,7 @@ type Evidence interface {
Verify(chainID string) error // verify the evidence
Equal(Evidence) bool // check equality of evidence
String() string
String() string // used as type in abci.Evidence
}
func RegisterEvidences(cdc *amino.Codec) {