Skip to content

Commit

Permalink
resolve: kill off buggy resolve function
Browse files Browse the repository at this point in the history
This resolve function assumed that all paths were of the same type (ipfs, ipld,
etc.). The CoreAPI does a much better job.
  • Loading branch information
Stebalien committed Mar 2, 2020
1 parent 8643d94 commit 97bc89d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 47 deletions.
32 changes: 0 additions & 32 deletions namesys/resolve/pathresolver_test.go

This file was deleted.

15 changes: 0 additions & 15 deletions namesys/resolve/resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import (
"fmt"
"strings"

"github.com/ipfs/go-ipld-format"
"github.com/ipfs/go-path"
"github.com/ipfs/go-path/resolver"

"github.com/ipfs/go-ipfs/namesys"
)
Expand Down Expand Up @@ -52,16 +50,3 @@ func ResolveIPNS(ctx context.Context, nsys namesys.NameSystem, p path.Path) (pat
}
return p, nil
}

// Resolve resolves the given path by parsing out protocol-specific
// entries (e.g. /ipns/<node-key>) and then going through the /ipfs/
// entries and returning the final node.
func Resolve(ctx context.Context, nsys namesys.NameSystem, r *resolver.Resolver, p path.Path) (format.Node, error) {
p, err := ResolveIPNS(ctx, nsys, p)
if err != nil {
return nil, err
}

// ok, we have an IPFS path now (or what we'll treat as one)
return r.ResolvePath(ctx, p)
}

0 comments on commit 97bc89d

Please sign in to comment.