mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-12 12:51:22 +00:00
Merge branch 'develop' into jae/aminoify
This commit is contained in:
@ -3,7 +3,9 @@ package types
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
crypto "github.com/tendermint/go-crypto"
|
||||
cmn "github.com/tendermint/tmlibs/common"
|
||||
)
|
||||
@ -26,7 +28,7 @@ func TestValidateBlock(t *testing.T) {
|
||||
|
||||
// tamper with NumTxs
|
||||
block = MakeBlock(h, txs, commit)
|
||||
block.NumTxs += 1
|
||||
block.NumTxs++
|
||||
err = block.ValidateBasic()
|
||||
require.Error(t, err)
|
||||
|
||||
@ -72,3 +74,15 @@ func makeBlockID(hash string, partSetSize int, partSetHash string) BlockID {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
var nilBytes []byte
|
||||
|
||||
func TestNilHeaderHashDoesntCrash(t *testing.T) {
|
||||
assert.Equal(t, []byte((*Header)(nil).Hash()), nilBytes)
|
||||
assert.Equal(t, []byte((new(Header)).Hash()), nilBytes)
|
||||
}
|
||||
|
||||
func TestNilDataHashDoesntCrash(t *testing.T) {
|
||||
assert.Equal(t, []byte((*Data)(nil).Hash()), nilBytes)
|
||||
assert.Equal(t, []byte(new(Data).Hash()), nilBytes)
|
||||
}
|
||||
|
Reference in New Issue
Block a user