Files
scroll/database/cache/fastcache_test.go
2023-01-31 14:10:01 +08:00

26 lines
568 B
Go

package cache_test
import (
"context"
"encoding/json"
"github.com/scroll-tech/go-ethereum/core/types"
"github.com/stretchr/testify/assert"
"os"
"scroll-tech/database/cache"
"testing"
)
func TestFastCache(t *testing.T) {
fdb := cache.NewFastCache(context.Background(), &cache.FastConfig{})
var (
data []byte
trace = &types.BlockTrace{}
)
data, err := os.ReadFile("../../common/testdata/blockTrace_02.json")
assert.NoError(t, err)
assert.NoError(t, json.Unmarshal(data, &trace))
assert.NoError(t, fdb.SetBlockTrace(context.Background(), trace))
}