|
|
@ -566,6 +566,35 @@ func TestFinalizeBlockValidatorUpdatesResultingInEmptySet(t *testing.T) { |
|
|
|
assert.NotEmpty(t, state.NextValidators.Validators) |
|
|
|
} |
|
|
|
|
|
|
|
func TestEmptyPrepareProposal(t *testing.T) { |
|
|
|
const height = 2 |
|
|
|
ctx, cancel := context.WithCancel(context.Background()) |
|
|
|
defer cancel() |
|
|
|
|
|
|
|
app := abcimocks.NewBaseMock() |
|
|
|
cc := abciclient.NewLocalCreator(app) |
|
|
|
logger := log.TestingLogger() |
|
|
|
proxyApp := proxy.NewAppConns(cc, logger, proxy.NopMetrics()) |
|
|
|
err := proxyApp.Start(ctx) |
|
|
|
require.NoError(t, err) |
|
|
|
|
|
|
|
state, stateDB, privVals := makeState(t, 1, height) |
|
|
|
stateStore := sm.NewStore(stateDB) |
|
|
|
|
|
|
|
blockExec := sm.NewBlockExecutor( |
|
|
|
stateStore, |
|
|
|
logger, |
|
|
|
proxyApp.Consensus(), |
|
|
|
mmock.Mempool{}, |
|
|
|
sm.EmptyEvidencePool{}, |
|
|
|
nil, |
|
|
|
) |
|
|
|
pa, _ := state.Validators.GetByIndex(0) |
|
|
|
commit := makeValidCommit(ctx, t, height, types.BlockID{}, state.Validators, privVals) |
|
|
|
_, err = blockExec.CreateProposalBlock(ctx, height, state, commit, pa, nil) |
|
|
|
require.NoError(t, err) |
|
|
|
} |
|
|
|
|
|
|
|
func makeBlockID(hash []byte, partSetSize uint32, partSetHash []byte) types.BlockID { |
|
|
|
var ( |
|
|
|
h = make([]byte, tmhash.Size) |
|
|
|