block: return error from Verify

Don't hide real problem behind the bool value. Makes it easier to identify
problems when looking at log messages.
This commit is contained in:
Roman Khimov 2019-10-11 11:40:54 +03:00
parent 258f397b9a
commit 16bc5296cb
3 changed files with 14 additions and 10 deletions

View file

@ -87,19 +87,19 @@ func TestBlockVerify(t *testing.T) {
newMinerTX(),
newIssueTX(),
)
assert.True(t, block.Verify(false))
assert.Nil(t, block.Verify(false))
block.Transactions = []*transaction.Transaction{
{Type: transaction.IssueType},
{Type: transaction.MinerType},
}
assert.False(t, block.Verify(false))
assert.NotNil(t, block.Verify(false))
block.Transactions = []*transaction.Transaction{
{Type: transaction.MinerType},
{Type: transaction.MinerType},
}
assert.False(t, block.Verify(false))
assert.NotNil(t, block.Verify(false))
}
func TestBinBlockDecodeEncode(t *testing.T) {