1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-10 18:10:49 +09:00

Fix liststorage tests

This commit is contained in:
mcrakhman 2023-07-04 14:04:14 +02:00
parent 1f940c727a
commit a332c0b68f
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B
2 changed files with 6 additions and 6 deletions

View file

@ -2,15 +2,15 @@ package storage
import (
"context"
"github.com/anyproto/any-sync/consensus/consensusproto"
"testing"
"github.com/anyproto/any-sync/commonspace/object/acl/aclrecordproto"
"github.com/anyproto/any-sync/commonspace/object/acl/liststorage"
"github.com/dgraph-io/badger/v3"
"github.com/stretchr/testify/require"
)
func testList(t *testing.T, store liststorage.ListStorage, root *aclrecordproto.RawAclRecordWithId, head string) {
func testList(t *testing.T, store liststorage.ListStorage, root *consensusproto.RawRecordWithId, head string) {
require.Equal(t, store.Id(), root.Id)
aclRoot, err := store.Root()
@ -27,7 +27,7 @@ func TestListStorage(t *testing.T) {
fx.open(t)
defer fx.stop(t)
spaceId := "spaceId"
aclRoot := &aclrecordproto.RawAclRecordWithId{Payload: []byte("root"), Id: "someRootId"}
aclRoot := &consensusproto.RawRecordWithId{Payload: []byte("root"), Id: "someRootId"}
fx.db.Update(func(txn *badger.Txn) error {
_, err := createListStorage(spaceId, fx.db, txn, aclRoot)
@ -64,7 +64,7 @@ func TestListStorage(t *testing.T) {
})
t.Run("add raw record and get raw record", func(t *testing.T) {
newRec := &aclrecordproto.RawAclRecordWithId{Payload: []byte("rec"), Id: "someRecId"}
newRec := &consensusproto.RawRecordWithId{Payload: []byte("rec"), Id: "someRecId"}
require.NoError(t, listStore.AddRawRecord(context.Background(), newRec))
aclRec, err := listStore.GetRawRecord(context.Background(), newRec.Id)
require.NoError(t, err)

View file

@ -2,11 +2,11 @@ package storage
import (
"context"
"github.com/anyproto/any-sync/consensus/consensusproto"
"sort"
"strconv"
"testing"
"github.com/anyproto/any-sync/commonspace/object/acl/aclrecordproto"
"github.com/anyproto/any-sync/commonspace/object/tree/treechangeproto"
spacestorage "github.com/anyproto/any-sync/commonspace/spacestorage"
"github.com/anyproto/any-sync/commonspace/spacesyncproto"
@ -20,7 +20,7 @@ func spaceTestPayload() spacestorage.SpaceStorageCreatePayload {
RawHeader: []byte("header"),
Id: "headerId",
}
aclRoot := &aclrecordproto.RawAclRecordWithId{
aclRoot := &consensusproto.RawRecordWithId{
Payload: []byte("aclRoot"),
Id: "aclRootId",
}