mirror of
https://github.com/tendermint/tendermint.git
synced 2026-07-07 08:36:38 +00:00
Set evidence.Type
This commit is contained in:
@@ -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(),
|
||||
}
|
||||
|
||||
@@ -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
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user