Commit ec96a21d authored by Łukasz Magiera's avatar Łukasz Magiera

resolve: use unixfs ResolveOnce

License: MIT
Signed-off-by: default avatarŁukasz Magiera <magik6k@gmail.com>
parent 99628170
......@@ -14,7 +14,9 @@ import (
nsopts "github.com/ipfs/go-ipfs/namesys/opts"
path "gx/ipfs/QmX7uSbkNz76yNwBhuwYwRbhihLnJqM73VTCjS3UMJud9A/go-path"
uio "gx/ipfs/QmPL8bYtbACcSFFiSr4s2du7Na382NxRADR8hC7D9FkEA2/go-unixfs/io"
"gx/ipfs/QmSP88ryZkHSRn1fnngAaV2Vcn63WUJzAavnRM9CVdU1Ky/go-ipfs-cmdkit"
resolver "gx/ipfs/QmX7uSbkNz76yNwBhuwYwRbhihLnJqM73VTCjS3UMJud9A/go-path/resolver"
)
var ResolveCmd = &cmds.Command{
......@@ -121,7 +123,12 @@ Resolve the value of an IPFS DAG path:
return
}
node, err := core.Resolve(req.Context(), n.Namesys, n.Resolver, p)
r := &resolver.Resolver{
DAG: n.DAG,
ResolveOnce: uio.ResolveUnixfsOnce,
}
node, err := core.Resolve(req.Context(), n.Namesys, r, p)
if err != nil {
res.SetError(err, cmdkit.ErrNormal)
return
......
......@@ -84,6 +84,12 @@ test_expect_success "gateway can resolve sharded dirs" '
test_cmp expected actual
'
test_expect_success "'ipfs resolve' can resolve sharded dirs" '
echo /ipfs/QmZ3RfWk1u5LEGYLHA633B5TNJy3Du27K6Fny9wcxpowGS > expected &&
ipfs resolve "/ipfs/$SHARDED/file100" > actual &&
test_cmp expected actual
'
test_kill_ipfs_daemon
test_add_large_dir_v1() {
......
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