fix: dht findprovs unable to handle /ipfs/hash

License: MIT
Signed-off-by: Xiaoyi Wang <wangxiaoyi@hyperchain.cn>
This commit is contained in:
Xiaoyi Wang 2018-08-02 11:24:15 +08:00
parent 83f22d5d81
commit 664d881b89
2 changed files with 5 additions and 1 deletions

View File

@ -176,8 +176,8 @@ var findProvidersDhtCmd = &cmds.Command{
events := make(chan *notif.QueryEvent)
ctx := notif.RegisterForQueryEvents(req.Context(), events)
c, err := cid.Parse(req.Arguments()[0])
c, err := cid.Decode(req.Arguments()[0])
if err != nil {
res.SetError(err, cmdkit.ErrNormal)
return

View File

@ -145,5 +145,9 @@ findprovs_empty '$HASH_0'
reprovide
findprovs_expect '$HASH_0' '$PEERID_0'
test_expect_success 'resolve object $HASH_0' '
HASH_WITH_PREFIX=$(ipfsi 1 resolve $HASH_0)
'
findprovs_expect '$HASH_WITH_PREFIX' '$PEERID_0'
test_done