Skip to content

Commit

Permalink
fix: change to btfs
Browse files Browse the repository at this point in the history
  • Loading branch information
Shawn-Huang-Tron committed May 19, 2023
1 parent 8bd8c38 commit 3596540
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions path.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
)

// A Path represents an btfs content path:
// * /<cid>/path/to/file
// * /btfs/<cid>
// * /btns/<cid>/path/to/folder
// * etc
// - /<cid>/path/to/file
// - /btfs/<cid>
// - /btns/<cid>/path/to/folder
// - etc
type Path string

// ^^^
Expand Down
6 changes: 3 additions & 3 deletions path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ func TestNoComponents(t *testing.T) {

func TestInvalidPaths(t *testing.T) {
for _, s := range []string{
"/ipfs",
"/btfs",
"/testfs",
"/",
} {
_, err := ParsePath(s)
if err == nil || !strings.Contains(err.Error(), "invalid ipfs path") || !strings.Contains(err.Error(), s) {
if err == nil || !strings.Contains(err.Error(), "invalid btfs path") || !strings.Contains(err.Error(), s) {
t.Error("wrong error")
}
}
Expand Down Expand Up @@ -117,7 +117,7 @@ func TestPopLastSegment(t *testing.T) {
}

func TestV0ErrorDueToLowercase(t *testing.T) {
badb58 := "/ipfs/qmbwqxbekc3p8tqskc98xmwnzrzdtrlmimpl8wbutgsmnr"
badb58 := "/btfs/qmbwqxbekc3p8tqskc98xmwnzrzdtrlmimpl8wbutgsmnr"
_, err := ParsePath(badb58)
if err == nil {
t.Fatal("should have failed to decode")
Expand Down
4 changes: 2 additions & 2 deletions resolver/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func TestResolveToLastNode_ErrNoLink(t *testing.T) {

// test missing link intermediate segment
segments := []string{aKey.String(), "cheese", "time"}
p, err := path.FromSegments("/ipfs/", segments...)
p, err := path.FromSegments("/btfs/", segments...)
require.NoError(t, err)

_, _, err = r.ResolveToLastNode(ctx, p)
Expand All @@ -180,7 +180,7 @@ func TestResolveToLastNode_ErrNoLink(t *testing.T) {
// test missing link at end
bKey := b.Cid()
segments = []string{aKey.String(), "child", "apples"}
p, err = path.FromSegments("/ipfs/", segments...)
p, err = path.FromSegments("/btfs/", segments...)
require.NoError(t, err)

_, _, err = r.ResolveToLastNode(ctx, p)
Expand Down

0 comments on commit 3596540

Please sign in to comment.