2019-09-14 07:29:08 +00:00
|
|
|
package storage
|
|
|
|
|
|
|
|
import (
|
2021-11-17 11:14:22 +00:00
|
|
|
"path/filepath"
|
2019-09-14 07:29:08 +00:00
|
|
|
"testing"
|
|
|
|
|
2022-07-08 16:42:06 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/pkg/core/storage/dbconfig"
|
2019-09-14 07:29:08 +00:00
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
2021-10-05 12:13:19 +00:00
|
|
|
func newBoltStoreForTesting(t testing.TB) Store {
|
2021-08-25 19:17:37 +00:00
|
|
|
d := t.TempDir()
|
2021-11-17 11:14:22 +00:00
|
|
|
testFileName := filepath.Join(d, "test_bolt_db")
|
2022-07-08 16:42:06 +00:00
|
|
|
boltDBStore, err := NewBoltDBStore(dbconfig.BoltDBOptions{FilePath: testFileName})
|
2019-09-14 07:29:08 +00:00
|
|
|
require.NoError(t, err)
|
|
|
|
return boltDBStore
|
|
|
|
}
|