add proposer address to block's Header

Refs #1134

Validation:

- ignored in block.ValidateBasic since it's stateful information
- checked in blockExec.ValidateBlock
This commit is contained in:
Anton Kaliaev
2018-07-30 12:59:16 +04:00
committed by Ethan Buchman
parent 06a157ad06
commit bec9d5cba9
12 changed files with 319 additions and 226 deletions

View File

@@ -4,6 +4,7 @@ import (
"testing"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/crypto/ed25519"
dbm "github.com/tendermint/tendermint/libs/db"
"github.com/tendermint/tendermint/libs/log"
)
@@ -65,4 +66,10 @@ func TestValidateBlock(t *testing.T) {
block.ValidatorsHash = []byte("wrong validators hash")
err = blockExec.ValidateBlock(state, block)
require.Error(t, err)
// wrong proposer address
block = makeBlock(state, 1)
block.ProposerAddress = ed25519.GenPrivKey().PubKey().Address()
err = blockExec.ValidateBlock(state, block)
require.Error(t, err)
}