Test NewestSha()
This commit is contained in:
parent
f205ff5ac0
commit
b46d53c18e
1 changed files with 14 additions and 0 deletions
|
@ -140,6 +140,20 @@ out:
|
|||
t.Errorf("height mismatch expect %v returned %v", height, newheight)
|
||||
break out
|
||||
}
|
||||
|
||||
newSha, blkid, err := db.NewestSha()
|
||||
if err != nil {
|
||||
t.Errorf("failed to obtain latest sha %v %v", height, err)
|
||||
}
|
||||
|
||||
if blkid != height {
|
||||
t.Errorf("height doe not match latest block height %v %v", blkid, height, err)
|
||||
}
|
||||
|
||||
blkSha, _ := block.Sha()
|
||||
if *newSha != *blkSha {
|
||||
t.Errorf("Newest block sha does not match freshly inserted one %v %v ", newSha, blkSha, err)
|
||||
}
|
||||
}
|
||||
|
||||
switch mode {
|
||||
|
|
Loading…
Reference in a new issue