From 0cb82d5c399cd50f08ddd3d312a8f51a940be618 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Fri, 8 Feb 2019 17:58:56 +0100 Subject: [PATCH 1/3] coreapi: cleanup coredag references in interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/interface/tests/dag.go | 53 ++++++++++++++-------------- core/coreapi/interface/tests/path.go | 32 +++++++++-------- core/coreapi/interface/tests/pin.go | 22 ++++++------ 3 files changed, 56 insertions(+), 51 deletions(-) diff --git a/core/coreapi/interface/tests/dag.go b/core/coreapi/interface/tests/dag.go index 10fab125a22..4decfebb4b7 100644 --- a/core/coreapi/interface/tests/dag.go +++ b/core/coreapi/interface/tests/dag.go @@ -8,8 +8,9 @@ import ( "testing" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" - coredag "github.com/ipfs/go-ipfs/core/coredag" + ipld "gx/ipfs/QmRL22E4paat7ky7vx9MLpR97JHHbFPrg3ytFQw6qp1y1s/go-ipld-format" + ipldcbor "gx/ipfs/QmRZxJ7oybgnnwriuRub9JXp5YdFM9wiGSyRq38QC7swpS/go-ipld-cbor" mh "gx/ipfs/QmerPMzPk1mJVowm8KgmoknWa4yCYvvugMPsgWmDNUvDLW/go-multihash" ) @@ -46,18 +47,18 @@ func (tp *provider) TestPut(t *testing.T) { t.Error(err) } - nds, err := coredag.ParseInputs("json", "dag-cbor", strings.NewReader(`"Hello"`), math.MaxUint64, -1) + nd, err := ipldcbor.FromJSON(strings.NewReader(`"Hello"`), math.MaxUint64, -1) if err != nil { t.Error(err) } - err = api.Dag().Add(ctx, nds[0]) + err = api.Dag().Add(ctx, nd) if err != nil { t.Fatal(err) } - if nds[0].Cid().String() != "zdpuAqckYF3ToF3gcJNxPZXmnmGuXd3gxHCXhq81HGxBejEvv" { - t.Errorf("got wrong cid: %s", nds[0].Cid().String()) + if nd.Cid().String() != "zdpuAqckYF3ToF3gcJNxPZXmnmGuXd3gxHCXhq81HGxBejEvv" { + t.Errorf("got wrong cid: %s", nd.Cid().String()) } } @@ -69,18 +70,18 @@ func (tp *provider) TestPutWithHash(t *testing.T) { t.Error(err) } - nds, err := coredag.ParseInputs("json", "dag-cbor", strings.NewReader(`"Hello"`), mh.ID, -1) + nd, err := ipldcbor.FromJSON(strings.NewReader(`"Hello"`), mh.ID, -1) if err != nil { t.Error(err) } - err = api.Dag().Add(ctx, nds[0]) + err = api.Dag().Add(ctx, nd) if err != nil { t.Fatal(err) } - if nds[0].Cid().String() != "z5hRLNd2sv4z1c" { - t.Errorf("got wrong cid: %s", nds[0].Cid().String()) + if nd.Cid().String() != "z5hRLNd2sv4z1c" { + t.Errorf("got wrong cid: %s", nd.Cid().String()) } } @@ -92,27 +93,27 @@ func (tp *provider) TestDagPath(t *testing.T) { t.Error(err) } - snds, err := coredag.ParseInputs("json", "dag-cbor", strings.NewReader(`"foo"`), math.MaxUint64, -1) + snd, err := ipldcbor.FromJSON(strings.NewReader(`"foo"`), math.MaxUint64, -1) if err != nil { t.Error(err) } - err = api.Dag().Add(ctx, snds[0]) + err = api.Dag().Add(ctx, snd) if err != nil { t.Fatal(err) } - nds, err := coredag.ParseInputs("json", "dag-cbor", strings.NewReader(`{"lnk": {"/": "`+snds[0].Cid().String()+`"}}`), math.MaxUint64, -1) + nd, err := ipldcbor.FromJSON(strings.NewReader(`{"lnk": {"/": "`+snd.Cid().String()+`"}}`), math.MaxUint64, -1) if err != nil { t.Error(err) } - err = api.Dag().Add(ctx, nds[0]) + err = api.Dag().Add(ctx, nd) if err != nil { t.Fatal(err) } - p, err := coreiface.ParsePath(path.Join(nds[0].Cid().String(), "lnk")) + p, err := coreiface.ParsePath(path.Join(nd.Cid().String(), "lnk")) if err != nil { t.Error(err) } @@ -122,13 +123,13 @@ func (tp *provider) TestDagPath(t *testing.T) { t.Error(err) } - nd, err := api.Dag().Get(ctx, rp.Cid()) + ndd, err := api.Dag().Get(ctx, rp.Cid()) if err != nil { t.Error(err) } - if nd.Cid().String() != snds[0].Cid().String() { - t.Errorf("got unexpected cid %s, expected %s", nd.Cid().String(), snds[0].Cid().String()) + if nd.Cid().String() != snd.Cid().String() { + t.Errorf("got unexpected cid %s, expected %s", ndd.Cid().String(), snd.Cid().String()) } } @@ -140,17 +141,17 @@ func (tp *provider) TestTree(t *testing.T) { t.Error(err) } - nds, err := coredag.ParseInputs("json", "dag-cbor", strings.NewReader(`{"a": 123, "b": "foo", "c": {"d": 321, "e": 111}}`), math.MaxUint64, -1) + nd, err := ipldcbor.FromJSON(strings.NewReader(`{"a": 123, "b": "foo", "c": {"d": 321, "e": 111}}`), math.MaxUint64, -1) if err != nil { t.Error(err) } - err = api.Dag().Add(ctx, nds[0]) + err = api.Dag().Add(ctx, nd) if err != nil { t.Fatal(err) } - res, err := api.Dag().Get(ctx, nds[0].Cid()) + res, err := api.Dag().Get(ctx, nd.Cid()) if err != nil { t.Error(err) } @@ -175,25 +176,25 @@ func (tp *provider) TestBatch(t *testing.T) { t.Error(err) } - nds, err := coredag.ParseInputs("json", "dag-cbor", strings.NewReader(`"Hello"`), math.MaxUint64, -1) + nd, err := ipldcbor.FromJSON(strings.NewReader(`"Hello"`), math.MaxUint64, -1) if err != nil { t.Error(err) } - if nds[0].Cid().String() != "zdpuAqckYF3ToF3gcJNxPZXmnmGuXd3gxHCXhq81HGxBejEvv" { - t.Errorf("got wrong cid: %s", nds[0].Cid().String()) + if nd.Cid().String() != "zdpuAqckYF3ToF3gcJNxPZXmnmGuXd3gxHCXhq81HGxBejEvv" { + t.Errorf("got wrong cid: %s", nd.Cid().String()) } - _, err = api.Dag().Get(ctx, nds[0].Cid()) + _, err = api.Dag().Get(ctx, nd.Cid()) if err == nil || !strings.Contains(err.Error(), "not found") { t.Error(err) } - if err := api.Dag().AddMany(ctx, nds); err != nil { + if err := api.Dag().AddMany(ctx, []ipld.Node{nd}); err != nil { t.Error(err) } - _, err = api.Dag().Get(ctx, nds[0].Cid()) + _, err = api.Dag().Get(ctx, nd.Cid()) if err != nil { t.Error(err) } diff --git a/core/coreapi/interface/tests/path.go b/core/coreapi/interface/tests/path.go index e7df6f1fb7c..5594cf0da51 100644 --- a/core/coreapi/interface/tests/path.go +++ b/core/coreapi/interface/tests/path.go @@ -8,7 +8,8 @@ import ( coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" "github.com/ipfs/go-ipfs/core/coreapi/interface/options" - "github.com/ipfs/go-ipfs/core/coredag" + + ipldcbor "gx/ipfs/QmRZxJ7oybgnnwriuRub9JXp5YdFM9wiGSyRq38QC7swpS/go-ipld-cbor" ) func (tp *provider) TestPath(t *testing.T) { @@ -37,7 +38,8 @@ func (tp *provider) TestMutablePath(t *testing.T) { t.Error("expected /ipld path to be immutable") } - // get self /ipns path + // get self /ipns path ipldcbor "gx/ipfs/QmRZxJ7oybgnnwriuRub9JXp5YdFM9wiGSyRq38QC7swpS/go-ipld-cbor" + if api.Key() == nil { t.Fatal(".Key not implemented") } @@ -64,16 +66,16 @@ func (tp *provider) TestPathRemainder(t *testing.T) { t.Fatal(".Dag not implemented") } - nds, err := coredag.ParseInputs("json", "dag-cbor", strings.NewReader(`{"foo": {"bar": "baz"}}`), math.MaxUint64, -1) + nd, err := ipldcbor.FromJSON(strings.NewReader(`{"foo": {"bar": "baz"}}`), math.MaxUint64, -1) if err != nil { t.Error(err) } - if err := api.Dag().AddMany(ctx, nds); err != nil { + if err := api.Dag().Add(ctx, nd); err != nil { t.Fatal(err) } - p1, err := coreiface.ParsePath(nds[0].String() + "/foo/bar") + p1, err := coreiface.ParsePath(nd.String() + "/foo/bar") if err != nil { t.Error(err) } @@ -100,16 +102,16 @@ func (tp *provider) TestEmptyPathRemainder(t *testing.T) { t.Fatal(".Dag not implemented") } - nds, err := coredag.ParseInputs("json", "dag-cbor", strings.NewReader(`{"foo": {"bar": "baz"}}`), math.MaxUint64, -1) + nd, err := ipldcbor.FromJSON(strings.NewReader(`{"foo": {"bar": "baz"}}`), math.MaxUint64, -1) if err != nil { t.Error(err) } - if err := api.Dag().AddMany(ctx, nds); err != nil { + if err := api.Dag().Add(ctx, nd); err != nil { t.Fatal(err) } - p1, err := coreiface.ParsePath(nds[0].Cid().String()) + p1, err := coreiface.ParsePath(nd.Cid().String()) if err != nil { t.Error(err) } @@ -136,16 +138,16 @@ func (tp *provider) TestInvalidPathRemainder(t *testing.T) { t.Fatal(".Dag not implemented") } - nds, err := coredag.ParseInputs("json", "dag-cbor", strings.NewReader(`{"foo": {"bar": "baz"}}`), math.MaxUint64, -1) + nd, err := ipldcbor.FromJSON(strings.NewReader(`{"foo": {"bar": "baz"}}`), math.MaxUint64, -1) if err != nil { t.Error(err) } - if err := api.Dag().AddMany(ctx, nds); err != nil { + if err := api.Dag().Add(ctx, nd); err != nil { t.Fatal(err) } - p1, err := coreiface.ParsePath("/ipld/" + nds[0].Cid().String() + "/bar/baz") + p1, err := coreiface.ParsePath("/ipld/" + nd.Cid().String() + "/bar/baz") if err != nil { t.Error(err) } @@ -177,16 +179,16 @@ func (tp *provider) TestPathRoot(t *testing.T) { t.Fatal(".Dag not implemented") } - nds, err := coredag.ParseInputs("json", "dag-cbor", strings.NewReader(`{"foo": {"/": "`+blk.Path().Cid().String()+`"}}`), math.MaxUint64, -1) + nd, err := ipldcbor.FromJSON(strings.NewReader(`{"foo": {"/": "`+blk.Path().Cid().String()+`"}}`), math.MaxUint64, -1) if err != nil { t.Error(err) } - if err := api.Dag().AddMany(ctx, nds); err != nil { + if err := api.Dag().Add(ctx, nd); err != nil { t.Fatal(err) } - p1, err := coreiface.ParsePath("/ipld/" + nds[0].Cid().String() + "/foo") + p1, err := coreiface.ParsePath("/ipld/" + nd.Cid().String() + "/foo") if err != nil { t.Error(err) } @@ -196,7 +198,7 @@ func (tp *provider) TestPathRoot(t *testing.T) { t.Fatal(err) } - if rp.Root().String() != nds[0].Cid().String() { + if rp.Root().String() != nd.Cid().String() { t.Error("unexpected path root") } diff --git a/core/coreapi/interface/tests/pin.go b/core/coreapi/interface/tests/pin.go index 25079922226..35c9136187c 100644 --- a/core/coreapi/interface/tests/pin.go +++ b/core/coreapi/interface/tests/pin.go @@ -8,7 +8,9 @@ import ( "github.com/ipfs/go-ipfs/core/coreapi/interface" opt "github.com/ipfs/go-ipfs/core/coreapi/interface/options" - "github.com/ipfs/go-ipfs/core/coredag" + + ipld "gx/ipfs/QmRL22E4paat7ky7vx9MLpR97JHHbFPrg3ytFQw6qp1y1s/go-ipld-format" + ipldcbor "gx/ipfs/QmRZxJ7oybgnnwriuRub9JXp5YdFM9wiGSyRq38QC7swpS/go-ipld-cbor" ) func (tp *provider) TestPin(t *testing.T) { @@ -111,26 +113,26 @@ func (tp *provider) TestPinRecursive(t *testing.T) { t.Error(err) } - nd2, err := coredag.ParseInputs("json", "dag-cbor", strings.NewReader(`{"lnk": {"/": "`+p0.Cid().String()+`"}}`), math.MaxUint64, -1) + nd2, err := ipldcbor.FromJSON(strings.NewReader(`{"lnk": {"/": "`+p0.Cid().String()+`"}}`), math.MaxUint64, -1) if err != nil { t.Error(err) } - nd3, err := coredag.ParseInputs("json", "dag-cbor", strings.NewReader(`{"lnk": {"/": "`+p1.Cid().String()+`"}}`), math.MaxUint64, -1) + nd3, err := ipldcbor.FromJSON(strings.NewReader(`{"lnk": {"/": "`+p1.Cid().String()+`"}}`), math.MaxUint64, -1) if err != nil { t.Error(err) } - if err := api.Dag().AddMany(ctx, append(nd2, nd3...)); err != nil { + if err := api.Dag().AddMany(ctx, []ipld.Node{nd2, nd3}); err != nil { t.Fatal(err) } - err = api.Pin().Add(ctx, iface.IpldPath(nd2[0].Cid())) + err = api.Pin().Add(ctx, iface.IpldPath(nd2.Cid())) if err != nil { t.Error(err) } - err = api.Pin().Add(ctx, iface.IpldPath(nd3[0].Cid()), opt.Pin.Recursive(false)) + err = api.Pin().Add(ctx, iface.IpldPath(nd3.Cid()), opt.Pin.Recursive(false)) if err != nil { t.Error(err) } @@ -153,8 +155,8 @@ func (tp *provider) TestPinRecursive(t *testing.T) { t.Errorf("unexpected pin list len: %d", len(list)) } - if list[0].Path().String() != iface.IpldPath(nd3[0].Cid()).String() { - t.Errorf("unexpected path, %s != %s", list[0].Path().String(), iface.IpfsPath(nd2[0].Cid()).String()) + if list[0].Path().String() != iface.IpldPath(nd3.Cid()).String() { + t.Errorf("unexpected path, %s != %s", list[0].Path().String(), iface.IpfsPath(nd2.Cid()).String()) } list, err = api.Pin().Ls(ctx, opt.Pin.Type.Recursive()) @@ -166,8 +168,8 @@ func (tp *provider) TestPinRecursive(t *testing.T) { t.Errorf("unexpected pin list len: %d", len(list)) } - if list[0].Path().String() != iface.IpldPath(nd2[0].Cid()).String() { - t.Errorf("unexpected path, %s != %s", list[0].Path().String(), iface.IpldPath(nd3[0].Cid()).String()) + if list[0].Path().String() != iface.IpldPath(nd2.Cid()).String() { + t.Errorf("unexpected path, %s != %s", list[0].Path().String(), iface.IpldPath(nd3.Cid()).String()) } list, err = api.Pin().Ls(ctx, opt.Pin.Type.Indirect()) From 1ff6349729e4a04242714e13e469c0434d681505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Fri, 8 Feb 2019 19:23:01 +0100 Subject: [PATCH 2/3] coreapi: move namesys options to coreapi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/commands/dns.go | 2 +- core/commands/name/ipns.go | 2 +- core/commands/resolve.go | 2 +- core/coreapi/interface/options/name.go | 2 +- .../opts => core/coreapi/interface/options/namesys}/opts.go | 0 core/corehttp/gateway_test.go | 2 +- core/corehttp/ipns_hostname.go | 2 +- namesys/base.go | 2 +- namesys/dns.go | 2 +- namesys/dns_test.go | 2 +- namesys/interface.go | 2 +- namesys/ipns_resolver_validation_test.go | 2 +- namesys/namesys.go | 2 +- namesys/namesys_test.go | 2 +- namesys/proquint.go | 2 +- namesys/routing.go | 2 +- 16 files changed, 15 insertions(+), 15 deletions(-) rename {namesys/opts => core/coreapi/interface/options/namesys}/opts.go (100%) diff --git a/core/commands/dns.go b/core/commands/dns.go index 124e97f33eb..9c3cceda274 100644 --- a/core/commands/dns.go +++ b/core/commands/dns.go @@ -5,8 +5,8 @@ import ( "io" ncmd "github.com/ipfs/go-ipfs/core/commands/name" + nsopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options/namesys" namesys "github.com/ipfs/go-ipfs/namesys" - nsopts "github.com/ipfs/go-ipfs/namesys/opts" cmds "gx/ipfs/QmR77mMvvh8mJBBWQmBfQBu8oD38NUN4KE9SL2gDgAQNc6/go-ipfs-cmds" cmdkit "gx/ipfs/Qmde5VP1qUkyQXKCfmEUA7bP64V2HAptbJ7phuPp7jXWwg/go-ipfs-cmdkit" diff --git a/core/commands/name/ipns.go b/core/commands/name/ipns.go index 6d2491d1add..6ec2fce6b60 100644 --- a/core/commands/name/ipns.go +++ b/core/commands/name/ipns.go @@ -9,7 +9,7 @@ import ( cmdenv "github.com/ipfs/go-ipfs/core/commands/cmdenv" options "github.com/ipfs/go-ipfs/core/coreapi/interface/options" - nsopts "github.com/ipfs/go-ipfs/namesys/opts" + nsopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options/namesys" path "gx/ipfs/QmQ3YSqfxunT5QBg6KBVskKyRE26q6hjSMyhpxchpm7jEN/go-path" cmds "gx/ipfs/QmR77mMvvh8mJBBWQmBfQBu8oD38NUN4KE9SL2gDgAQNc6/go-ipfs-cmds" diff --git a/core/commands/resolve.go b/core/commands/resolve.go index 2a54d47187c..7e0a72a2fa4 100644 --- a/core/commands/resolve.go +++ b/core/commands/resolve.go @@ -11,8 +11,8 @@ import ( ncmd "github.com/ipfs/go-ipfs/core/commands/name" coreiface "github.com/ipfs/go-ipfs/core/coreapi/interface" options "github.com/ipfs/go-ipfs/core/coreapi/interface/options" + nsopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options/namesys" ns "github.com/ipfs/go-ipfs/namesys" - nsopts "github.com/ipfs/go-ipfs/namesys/opts" path "gx/ipfs/QmQ3YSqfxunT5QBg6KBVskKyRE26q6hjSMyhpxchpm7jEN/go-path" cmds "gx/ipfs/QmR77mMvvh8mJBBWQmBfQBu8oD38NUN4KE9SL2gDgAQNc6/go-ipfs-cmds" diff --git a/core/coreapi/interface/options/name.go b/core/coreapi/interface/options/name.go index e2a0fc16498..e07ef8a595e 100644 --- a/core/coreapi/interface/options/name.go +++ b/core/coreapi/interface/options/name.go @@ -3,7 +3,7 @@ package options import ( "time" - ropts "github.com/ipfs/go-ipfs/namesys/opts" + ropts "github.com/ipfs/go-ipfs/core/coreapi/interface/options/namesys" ) const ( diff --git a/namesys/opts/opts.go b/core/coreapi/interface/options/namesys/opts.go similarity index 100% rename from namesys/opts/opts.go rename to core/coreapi/interface/options/namesys/opts.go diff --git a/core/corehttp/gateway_test.go b/core/corehttp/gateway_test.go index e580d094575..2000945c01f 100644 --- a/core/corehttp/gateway_test.go +++ b/core/corehttp/gateway_test.go @@ -16,8 +16,8 @@ import ( "github.com/ipfs/go-ipfs/core/coreapi" "github.com/ipfs/go-ipfs/core/coreapi/interface" "github.com/ipfs/go-ipfs/core/coreapi/interface/options" + nsopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options/namesys" namesys "github.com/ipfs/go-ipfs/namesys" - nsopts "github.com/ipfs/go-ipfs/namesys/opts" repo "github.com/ipfs/go-ipfs/repo" ci "gx/ipfs/QmNiJiXwWE3kRhZrC5ej3kSjWHm337pYfhjLGSCDNKJP2s/go-libp2p-crypto" diff --git a/core/corehttp/ipns_hostname.go b/core/corehttp/ipns_hostname.go index 346acc6c3e6..dedf886277d 100644 --- a/core/corehttp/ipns_hostname.go +++ b/core/corehttp/ipns_hostname.go @@ -7,8 +7,8 @@ import ( "strings" core "github.com/ipfs/go-ipfs/core" + nsopts "github.com/ipfs/go-ipfs/core/coreapi/interface/options/namesys" namesys "github.com/ipfs/go-ipfs/namesys" - nsopts "github.com/ipfs/go-ipfs/namesys/opts" isd "gx/ipfs/QmZmmuAXgX73UQmX1jRKjTGmjzq24Jinqkq8vzkBtno4uX/go-is-domain" ) diff --git a/namesys/base.go b/namesys/base.go index de71ff34527..79cb65be9b8 100644 --- a/namesys/base.go +++ b/namesys/base.go @@ -5,7 +5,7 @@ import ( "strings" "time" - opts "github.com/ipfs/go-ipfs/namesys/opts" + opts "github.com/ipfs/go-ipfs/core/coreapi/interface/options/namesys" path "gx/ipfs/QmQ3YSqfxunT5QBg6KBVskKyRE26q6hjSMyhpxchpm7jEN/go-path" ) diff --git a/namesys/dns.go b/namesys/dns.go index 6eb08ed80db..5a34d5e2501 100644 --- a/namesys/dns.go +++ b/namesys/dns.go @@ -6,7 +6,7 @@ import ( "net" "strings" - opts "github.com/ipfs/go-ipfs/namesys/opts" + opts "github.com/ipfs/go-ipfs/core/coreapi/interface/options/namesys" path "gx/ipfs/QmQ3YSqfxunT5QBg6KBVskKyRE26q6hjSMyhpxchpm7jEN/go-path" isd "gx/ipfs/QmZmmuAXgX73UQmX1jRKjTGmjzq24Jinqkq8vzkBtno4uX/go-is-domain" diff --git a/namesys/dns_test.go b/namesys/dns_test.go index ed28aa94592..e434e19f802 100644 --- a/namesys/dns_test.go +++ b/namesys/dns_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - opts "github.com/ipfs/go-ipfs/namesys/opts" + opts "github.com/ipfs/go-ipfs/core/coreapi/interface/options/namesys" ) type mockDNS struct { diff --git a/namesys/interface.go b/namesys/interface.go index 88c48efd85f..96fbb35b386 100644 --- a/namesys/interface.go +++ b/namesys/interface.go @@ -35,7 +35,7 @@ import ( context "context" - opts "github.com/ipfs/go-ipfs/namesys/opts" + opts "github.com/ipfs/go-ipfs/core/coreapi/interface/options/namesys" path "gx/ipfs/QmQ3YSqfxunT5QBg6KBVskKyRE26q6hjSMyhpxchpm7jEN/go-path" ci "gx/ipfs/QmNiJiXwWE3kRhZrC5ej3kSjWHm337pYfhjLGSCDNKJP2s/go-libp2p-crypto" diff --git a/namesys/ipns_resolver_validation_test.go b/namesys/ipns_resolver_validation_test.go index 0a9e3163412..1e5c0d04cee 100644 --- a/namesys/ipns_resolver_validation_test.go +++ b/namesys/ipns_resolver_validation_test.go @@ -7,7 +7,7 @@ import ( path "gx/ipfs/QmQ3YSqfxunT5QBg6KBVskKyRE26q6hjSMyhpxchpm7jEN/go-path" - opts "github.com/ipfs/go-ipfs/namesys/opts" + opts "github.com/ipfs/go-ipfs/core/coreapi/interface/options/namesys" ci "gx/ipfs/QmNiJiXwWE3kRhZrC5ej3kSjWHm337pYfhjLGSCDNKJP2s/go-libp2p-crypto" u "gx/ipfs/QmNohiVssaPw3KVLZik59DBVGTSm2dGvYT9eoXt5DQ36Yz/go-ipfs-util" diff --git a/namesys/namesys.go b/namesys/namesys.go index a16cf1388b3..6a1a495aeaf 100644 --- a/namesys/namesys.go +++ b/namesys/namesys.go @@ -7,7 +7,7 @@ import ( path "gx/ipfs/QmQ3YSqfxunT5QBg6KBVskKyRE26q6hjSMyhpxchpm7jEN/go-path" - opts "github.com/ipfs/go-ipfs/namesys/opts" + opts "github.com/ipfs/go-ipfs/core/coreapi/interface/options/namesys" ci "gx/ipfs/QmNiJiXwWE3kRhZrC5ej3kSjWHm337pYfhjLGSCDNKJP2s/go-libp2p-crypto" peer "gx/ipfs/QmPJxxDsX2UbchSHobbYuvz7qnyJTFKvaKMzE2rZWJ4x5B/go-libp2p-peer" diff --git a/namesys/namesys_test.go b/namesys/namesys_test.go index 3b3c1e255b6..1e0c173b661 100644 --- a/namesys/namesys_test.go +++ b/namesys/namesys_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - opts "github.com/ipfs/go-ipfs/namesys/opts" + opts "github.com/ipfs/go-ipfs/core/coreapi/interface/options/namesys" ci "gx/ipfs/QmNiJiXwWE3kRhZrC5ej3kSjWHm337pYfhjLGSCDNKJP2s/go-libp2p-crypto" peer "gx/ipfs/QmPJxxDsX2UbchSHobbYuvz7qnyJTFKvaKMzE2rZWJ4x5B/go-libp2p-peer" diff --git a/namesys/proquint.go b/namesys/proquint.go index 75d56c80fdd..850eb398e24 100644 --- a/namesys/proquint.go +++ b/namesys/proquint.go @@ -7,7 +7,7 @@ import ( path "gx/ipfs/QmQ3YSqfxunT5QBg6KBVskKyRE26q6hjSMyhpxchpm7jEN/go-path" proquint "gx/ipfs/QmYnf27kzqR2cxt6LFZdrAFJuQd6785fTkBvMuEj9EeRxM/proquint" - opts "github.com/ipfs/go-ipfs/namesys/opts" + opts "github.com/ipfs/go-ipfs/core/coreapi/interface/options/namesys" ) type ProquintResolver struct{} diff --git a/namesys/routing.go b/namesys/routing.go index bfe1520e723..66220aba931 100644 --- a/namesys/routing.go +++ b/namesys/routing.go @@ -7,7 +7,7 @@ import ( path "gx/ipfs/QmQ3YSqfxunT5QBg6KBVskKyRE26q6hjSMyhpxchpm7jEN/go-path" - opts "github.com/ipfs/go-ipfs/namesys/opts" + opts "github.com/ipfs/go-ipfs/core/coreapi/interface/options/namesys" peer "gx/ipfs/QmPJxxDsX2UbchSHobbYuvz7qnyJTFKvaKMzE2rZWJ4x5B/go-libp2p-peer" cid "gx/ipfs/QmR8BauakNcBa3RbE4nbQu76PDiJgoQgz8AJdhJuiU4TAw/go-cid" From 6ed9f1c1ddbec83706118b52af098b21c1592fa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Fri, 8 Feb 2019 20:38:21 +0100 Subject: [PATCH 3/3] coreapi: fix failing dag test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit License: MIT Signed-off-by: Łukasz Magiera --- core/coreapi/interface/tests/dag.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/coreapi/interface/tests/dag.go b/core/coreapi/interface/tests/dag.go index 4decfebb4b7..cf332027c88 100644 --- a/core/coreapi/interface/tests/dag.go +++ b/core/coreapi/interface/tests/dag.go @@ -128,7 +128,7 @@ func (tp *provider) TestDagPath(t *testing.T) { t.Error(err) } - if nd.Cid().String() != snd.Cid().String() { + if ndd.Cid().String() != snd.Cid().String() { t.Errorf("got unexpected cid %s, expected %s", ndd.Cid().String(), snd.Cid().String()) } }