OSDN Git Service

fix test
[bytom/vapor.git] / database / cache_test.go
index 673ab7d..f49ce59 100644 (file)
@@ -21,14 +21,14 @@ func TestBlockCache(t *testing.T) {
                blocks[block.Hash()] = block
        }
 
-       cache := newBlockCache(func(hash *bc.Hash) (*types.Block, error) {
+       cache := newBlockCache(func(hash *bc.Hash, height uint64) (*types.Block, error) {
                return blocks[*hash], nil
        })
 
        for i := 0; i < maxCachedBlocks+10; i++ {
                block := newBlock(uint64(i))
                hash := block.Hash()
-               cache.lookup(&hash)
+               cache.lookup(&hash, block.Height)
        }
 
        for i := 0; i < 10; i++ {