blockchain: make scriptval_test fail more nicely
Return early when failing on len(blocks) > 1. Check for len(blocks) == 0 so we can fail on that condition with an error message instead of a panic.
This commit is contained in:
parent
fb90c334df
commit
c20db1cf14
1 changed files with 5 additions and 0 deletions
|
@ -27,6 +27,11 @@ func TestCheckBlockScripts(t *testing.T) {
|
||||||
}
|
}
|
||||||
if len(blocks) > 1 {
|
if len(blocks) > 1 {
|
||||||
t.Errorf("The test block file must only have one block in it")
|
t.Errorf("The test block file must only have one block in it")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if len(blocks) == 0 {
|
||||||
|
t.Errorf("The test block file may not be empty")
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
storeDataFile := fmt.Sprintf("%d.utxostore.bz2", testBlockNum)
|
storeDataFile := fmt.Sprintf("%d.utxostore.bz2", testBlockNum)
|
||||||
|
|
Loading…
Reference in a new issue