Commit 7b1fa213 authored by Kejie Zhang's avatar Kejie Zhang

add daghelpers test and format code

parent 80c1eb3e
package format
import (
"context"
"github.com/ipfs/go-cid"
mh "github.com/multiformats/go-multihash"
"testing"
)
func TestCopy(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
from := newTestDag()
if err := from.Add(ctx, new(EmptyNode)); err != nil {
t.Fatal(err)
}
to := newTestDag()
id, err := cid.Prefix{
Version: 1,
Codec: cid.Raw,
MhType: mh.ID,
MhLength: 0,
}.Sum(nil)
err = Copy(ctx, from, to, id)
if err != nil {
t.Error(err)
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment