From 3d2ee10fa57ac8b4212857e27ce3dc65914116b7 Mon Sep 17 00:00:00 2001 From: Andrew Sisley Date: Fri, 8 Nov 2024 15:07:57 -0500 Subject: [PATCH] PR FIXUP - Rename Append to NewDelta --- internal/core/crdt/collection.go | 2 +- internal/core/crdt/composite.go | 2 +- internal/merkle/crdt/collection.go | 2 +- internal/merkle/crdt/composite.go | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/core/crdt/collection.go b/internal/core/crdt/collection.go index 2ce773c951..4cf7ebf62d 100644 --- a/internal/core/crdt/collection.go +++ b/internal/core/crdt/collection.go @@ -41,7 +41,7 @@ func (c *Collection) Merge(ctx context.Context, other core.Delta) error { return nil } -func (c *Collection) Append() *CollectionDelta { +func (c *Collection) NewDelta() *CollectionDelta { return &CollectionDelta{ SchemaVersionID: c.schemaVersionKey.SchemaVersionID, } diff --git a/internal/core/crdt/composite.go b/internal/core/crdt/composite.go index 213c0828e0..7fed96873c 100644 --- a/internal/core/crdt/composite.go +++ b/internal/core/crdt/composite.go @@ -101,7 +101,7 @@ func NewCompositeDAG( } // Set returns a new composite DAG delta CRDT with the given status. -func (c CompositeDAG) Append(status client.DocumentStatus) *CompositeDAGDelta { +func (c CompositeDAG) NewDelta(status client.DocumentStatus) *CompositeDAGDelta { return &CompositeDAGDelta{ DocID: []byte(c.key.DocID), SchemaVersionID: c.schemaVersionKey.SchemaVersionID, diff --git a/internal/merkle/crdt/collection.go b/internal/merkle/crdt/collection.go index 3bc43f67d6..976135ca5c 100644 --- a/internal/merkle/crdt/collection.go +++ b/internal/merkle/crdt/collection.go @@ -48,6 +48,6 @@ func (m *MerkleCollection) Clock() *clock.MerkleClock { } func (m *MerkleCollection) Save(ctx context.Context, links []coreblock.DAGLink) (cidlink.Link, []byte, error) { - delta := m.reg.Append() + delta := m.reg.NewDelta() return m.clock.AddDelta(ctx, delta, links...) } diff --git a/internal/merkle/crdt/composite.go b/internal/merkle/crdt/composite.go index 6bbbf029c5..c6224c3862 100644 --- a/internal/merkle/crdt/composite.go +++ b/internal/merkle/crdt/composite.go @@ -61,12 +61,12 @@ func (m *MerkleCompositeDAG) Clock() *clock.MerkleClock { func (m *MerkleCompositeDAG) Delete( ctx context.Context, ) (cidlink.Link, []byte, error) { - delta := m.reg.Append(client.Deleted) + delta := m.reg.NewDelta(client.Deleted) return m.clock.AddDelta(ctx, delta) } // Save the value of the composite CRDT to DAG. func (m *MerkleCompositeDAG) Save(ctx context.Context, links []coreblock.DAGLink) (cidlink.Link, []byte, error) { - delta := m.reg.Append(client.Active) + delta := m.reg.NewDelta(client.Active) return m.clock.AddDelta(ctx, delta, links...) }