提交 5ba2efc2 作者: Jeromy

make tests pass

上级 bdaee9bc
......@@ -17,12 +17,7 @@ func TestBlocks(t *testing.T) {
return
}
b, err := blocks.NewBlock([]byte("beep boop"))
if err != nil {
t.Error("failed to construct block", err)
return
}
b := blocks.NewBlock([]byte("beep boop"))
h := u.Hash([]byte("beep boop"))
if !bytes.Equal(b.Multihash, h) {
t.Error("Block Multihash and data multihash not equal")
......
......@@ -24,9 +24,9 @@ func TestGetWhenKeyNotPresent(t *testing.T) {
func TestPutThenGetBlock(t *testing.T) {
bs := NewBlockstore(ds.NewMapDatastore())
block := blocks.NewBlock("some data")
block := blocks.NewBlock([]byte("some data"))
err := bs.Put(block)
err := bs.Put(*block)
if err != nil {
t.Fatal(err)
}
......@@ -41,7 +41,7 @@ func TestPutThenGetBlock(t *testing.T) {
}
func TestValueTypeMismatch(t *testing.T) {
block := blocks.NewBlock("some data")
block := blocks.NewBlock([]byte("some data"))
datastore := ds.NewMapDatastore()
datastore.Put(block.Key().DsKey(), "data that isn't a block!")
......
......@@ -78,6 +78,9 @@ func mountIpfs(node *core.IpfsNode, fsdir string) <-chan error {
}
func mountIpns(node *core.IpfsNode, nsdir, fsdir string) <-chan error {
if nsdir == "" {
return nil
}
done := make(chan error)
fmt.Printf("mounting ipns at %s\n", nsdir)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论