Test against the first 20 mainnet blocks

This commit is contained in:
Jack Grigg
2019-05-14 15:18:15 +01:00
committed by George Tankersley
parent 0e4add3950
commit bb62739502
2 changed files with 24 additions and 3 deletions

View File

@@ -50,6 +50,7 @@ func TestBlockParser(t *testing.T) {
}
}
// Checks on the first 20 blocks from mainnet genesis.
func TestGenesisBlockParser(t *testing.T) {
blockFile, err := os.Open("../testdata/mainnet_genesis")
if err != nil {
@@ -79,8 +80,8 @@ func TestGenesisBlockParser(t *testing.T) {
break
}
if block.GetHeight() != 0 {
t.Errorf("Got wrong height for genesis block: %d", block.GetHeight())
if block.GetHeight() != i {
t.Errorf("Got wrong height for block %d: %d", i, block.GetHeight())
}
}
}