mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-01-20 03:18:05 -05:00
26 lines
568 B
Go
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))
|
|
}
|