Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR FIXUP - Rename Append to NewDelta
Browse files Browse the repository at this point in the history
AndrewSisley committed Nov 8, 2024
1 parent d05f74a commit 3d2ee10
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/core/crdt/collection.go
Original file line number Diff line number Diff line change
@@ -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,
}
2 changes: 1 addition & 1 deletion internal/core/crdt/composite.go
Original file line number Diff line number Diff line change
@@ -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,
2 changes: 1 addition & 1 deletion internal/merkle/crdt/collection.go
Original file line number Diff line number Diff line change
@@ -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...)
}
4 changes: 2 additions & 2 deletions internal/merkle/crdt/composite.go
Original file line number Diff line number Diff line change
@@ -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...)
}

0 comments on commit 3d2ee10

Please sign in to comment.