From 35abb4df926d3d9c10b9caf9645d61097a936f32 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Fri, 4 Dec 2015 00:59:02 -0800 Subject: [PATCH] Allow for test apps to return nil hashes --- consensus/state_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/consensus/state_test.go b/consensus/state_test.go index ca12cbf1b..a61577587 100644 --- a/consensus/state_test.go +++ b/consensus/state_test.go @@ -192,6 +192,9 @@ func TestBadProposal(t *testing.T) { // make the block bad by tampering with statehash stateHash := propBlock.AppHash + if len(stateHash) == 0 { + stateHash = make([]byte, 32) + } stateHash[0] = byte((stateHash[0] + 1) % 255) propBlock.AppHash = stateHash propBlockParts := propBlock.MakePartSet()