1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-11 18:20:28 +09:00

Expose storagechangebuilder

This commit is contained in:
Mikhail Rakhmanov 2025-03-04 21:24:34 +01:00
parent 742e87cb79
commit b1e153d574
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B
2 changed files with 3 additions and 3 deletions

View file

@ -74,7 +74,7 @@ type storage struct {
root StorageChange
}
var storageChangeBuilder = NewChangeBuilder
var StorageChangeBuilder = NewChangeBuilder
func CreateStorage(ctx context.Context, root *treechangeproto.RawTreeChangeWithId, headStorage headstorage.HeadStorage, store anystore.DB) (Storage, error) {
st := &storage{
@ -82,7 +82,7 @@ func CreateStorage(ctx context.Context, root *treechangeproto.RawTreeChangeWithI
store: store,
headStorage: headStorage,
}
builder := storageChangeBuilder(crypto.NewKeyStorage(), root)
builder := StorageChangeBuilder(crypto.NewKeyStorage(), root)
unmarshalled, err := builder.Unmarshall(root, true)
if err != nil {
return nil, err

View file

@ -164,7 +164,7 @@ func (c *MockChangeCreator) CreateRawWithData(id, aclId, snapshotId string, isSn
func (c *MockChangeCreator) CreateNewTreeStorage(t *testing.T, treeId, aclHeadId string, isDerived bool) Storage {
root := c.CreateRoot(treeId, aclHeadId)
storageChangeBuilder = func(keys crypto.KeyStorage, rootChange *treechangeproto.RawTreeChangeWithId) ChangeBuilder {
StorageChangeBuilder = func(keys crypto.KeyStorage, rootChange *treechangeproto.RawTreeChangeWithId) ChangeBuilder {
return &nonVerifiableChangeBuilder{
ChangeBuilder: NewChangeBuilder(newMockKeyStorage(), rootChange),
}