core: move write caching layer into MemCacheStore

Simplify Blockchain and associated functions, deduplicate code, fix Get() and
Seek() implementations.
This commit is contained in:
Roman Khimov 2019-10-16 16:41:50 +03:00
parent 4822c736bb
commit fc0031e5aa
10 changed files with 283 additions and 197 deletions

View file

@ -57,7 +57,7 @@ func TestAddBlock(t *testing.T) {
for _, block := range blocks {
key := storage.AppendPrefix(storage.DataBlock, block.Hash().BytesReverse())
if _, err := bc.Get(key); err != nil {
if _, err := bc.store.Get(key); err != nil {
t.Fatalf("block %s not persisted", block.Hash())
}
}