Skip to content

Commit

Permalink
PR FIXUP - Rename composite.Set to Append
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSisley committed Nov 8, 2024
1 parent c3eb3f3 commit cf03cdf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/core/crdt/composite.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func NewCompositeDAG(
}

// Set returns a new composite DAG delta CRDT with the given status.
func (c CompositeDAG) Set(status client.DocumentStatus) *CompositeDAGDelta {
func (c CompositeDAG) Append(status client.DocumentStatus) *CompositeDAGDelta {
return &CompositeDAGDelta{
DocID: []byte(c.key.DocID),
SchemaVersionID: c.schemaVersionKey.SchemaVersionID,
Expand Down
4 changes: 2 additions & 2 deletions internal/merkle/crdt/composite.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ func (m *MerkleCompositeDAG) Clock() *clock.MerkleClock {
func (m *MerkleCompositeDAG) Delete(
ctx context.Context,
) (cidlink.Link, []byte, error) {
delta := m.reg.Set(client.Deleted)
delta := m.reg.Append(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.Set(client.Active)
delta := m.reg.Append(client.Active)
return m.clock.AddDelta(ctx, delta, links...)
}

0 comments on commit cf03cdf

Please sign in to comment.