diff --git a/core/crdt/composite.go b/core/crdt/composite.go index 837ee7de64..548ca3f1b9 100644 --- a/core/crdt/composite.go +++ b/core/crdt/composite.go @@ -133,6 +133,7 @@ func (c CompositeDAG) DeltaDecode(node ipld.Node) (core.Delta, error) { return nil, errors.New("Failed to cast ipld.Node to ProtoNode") } data := pbNode.Data() + // fmt.Println(data) h := &codec.CborHandle{} dec := codec.NewDecoderBytes(data, h) err := dec.Decode(delta) diff --git a/core/crdt/lwwreg.go b/core/crdt/lwwreg.go index d90b0b1f42..d7877c4f1d 100644 --- a/core/crdt/lwwreg.go +++ b/core/crdt/lwwreg.go @@ -180,6 +180,7 @@ func (reg LWWRegister) DeltaDecode(node ipld.Node) (core.Delta, error) { return nil, errors.New("Failed to cast ipld.Node to ProtoNode") } data := pbNode.Data() + // fmt.Println(data) h := &codec.CborHandle{} dec := codec.NewDecoderBytes(data, h) err := dec.Decode(delta) diff --git a/core/crdt/lwwreg_test.go b/core/crdt/lwwreg_test.go index fc7ee159d4..24c8c8818c 100644 --- a/core/crdt/lwwreg_test.go +++ b/core/crdt/lwwreg_test.go @@ -157,6 +157,8 @@ func TestLWWRegisterDeltaMarshal(t *testing.T) { return } + // fmt.Println(bytes) + h := &codec.CborHandle{} dec := codec.NewDecoderBytes(bytes, h) unmarshaledDelta := &LWWRegDelta{} @@ -185,7 +187,8 @@ func makeNode(delta core.Delta, heads []cid.Cid) (ipld.Node, error) { return nil, err } } - + // data = []byte("test") + // fmt.Println("PRE", data) nd := dag.NodeWithData(data) // The cid builder defaults to v0, we want to be using v1 CIDs nd.SetCidBuilder( @@ -201,7 +204,8 @@ func makeNode(delta core.Delta, heads []cid.Cid) (ipld.Node, error) { return nil, err } } - + // data2 := nd.Data() + // fmt.Println("POST", data2) return nd, nil } diff --git a/core/key.go b/core/key.go index 08cbde06fa..909838d636 100644 --- a/core/key.go +++ b/core/key.go @@ -59,6 +59,7 @@ func (k Key) PrefixEnd() Key { // An error is returned if it can't correct convert the // field to a uint32. func (k Key) FieldID() (uint32, error) { + // fmt.Println(k.String()) fieldIDStr := k.Type() fieldID, err := strconv.Atoi(fieldIDStr) if err != nil { diff --git a/document/document.go b/document/document.go index 8db8a3c791..e7d5d0e8b9 100644 --- a/document/document.go +++ b/document/document.go @@ -141,6 +141,7 @@ func NewFromMap(data map[string]interface{}, schema ...base.SchemaDescription) ( if err != nil { return nil, err } + // fmt.Println(c) doc.key = key.NewDocKeyV0(c) } @@ -229,7 +230,8 @@ func (doc *Document) SetWithJSON(patch []byte) error { } for k, v := range patchObj { - if v == nil { + fmt.Println(k, v) + if v == nil { // needs deletion err = doc.Delete(k) } else { err = doc.Set(k, v)