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:
parent
258f397b9a
commit
16bc5296cb
3 changed files with 14 additions and 10 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue