diff --git a/types/validation.go b/types/validation.go index 5734a636e..0d0c7a1ed 100644 --- a/types/validation.go +++ b/types/validation.go @@ -78,8 +78,8 @@ func (b *Block) ValidateWithState(state *State) error { } proposerHash := state.GetProposerHash() - if !bytes.Equal(b.Header.NextSequencersHash[:], proposerHash) { - return NewErrInvalidNextSequencersHashFraud([32]byte(proposerHash), b.Header.NextSequencersHash) + if !bytes.Equal(b.Header.SequencerHash[:], proposerHash) { + return NewErrInvalidSequencerHashFraud([32]byte(proposerHash), b.Header.SequencerHash[:]) } if !bytes.Equal(b.Header.AppHash[:], state.AppHash[:]) { @@ -152,7 +152,7 @@ func (c *Commit) ValidateWithHeader(proposerPubKey tmcrypto.PubKey, header *Head } if !bytes.Equal(header.SequencerHash[:], proposerHash) { - return NewErrInvalidSequencerHashFraud(header.SequencerHash, proposerHash) + return NewErrInvalidSequencerHashFraud(header.SequencerHash, proposerHash[:]) } if c.HeaderHash != header.Hash() { diff --git a/types/validation_test.go b/types/validation_test.go index c95ae9d68..14af79dd9 100644 --- a/types/validation_test.go +++ b/types/validation_test.go @@ -42,15 +42,15 @@ func TestBlock_ValidateWithState(t *testing.T) { Block: 1, App: 1, }, - Height: 10, - Time: uint64(currentTime.UnixNano()), - AppHash: [32]byte{1, 2, 3}, - LastResultsHash: [32]byte{4, 5, 6}, - ProposerAddress: []byte("proposer"), - DataHash: [32]byte{}, - LastHeaderHash: [32]byte{7, 8, 9}, - ChainID: "chainID", - NextSequencersHash: [32]byte(proposerHash), + Height: 10, + Time: uint64(currentTime.UnixNano()), + AppHash: [32]byte{1, 2, 3}, + LastResultsHash: [32]byte{4, 5, 6}, + ProposerAddress: []byte("proposer"), + DataHash: [32]byte{}, + LastHeaderHash: [32]byte{7, 8, 9}, + ChainID: "chainID", + SequencerHash: [32]byte(proposerHash), }, Data: Data{}, LastCommit: Commit{},