Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
ec96a21d
Commit
ec96a21d
authored
Sep 18, 2018
by
Łukasz Magiera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
resolve: use unixfs ResolveOnce
License: MIT Signed-off-by:
Łukasz Magiera
<
magik6k@gmail.com
>
parent
99628170
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
core/commands/resolve.go
core/commands/resolve.go
+8
-1
test/sharness/t0260-sharding.sh
test/sharness/t0260-sharding.sh
+6
-0
No files found.
core/commands/resolve.go
View file @
ec96a21d
...
...
@@ -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
...
...
test/sharness/t0260-sharding.sh
View file @
ec96a21d
...
...
@@ -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
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment