Skip to content
This repository was archived by the owner on Oct 5, 2023. It is now read-only.

Commit e7332a8

Browse files
authored
Merge pull request #97 from ipfs/fix/decode
IDB58Decode -> Decode
2 parents 67f034a + b0549d8 commit e7332a8

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

key.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"errors"
66

7-
"github.com/ipfs/interface-go-ipfs-core"
7+
iface "github.com/ipfs/interface-go-ipfs-core"
88
caopts "github.com/ipfs/interface-go-ipfs-core/options"
99
"github.com/ipfs/interface-go-ipfs-core/path"
1010
"github.com/libp2p/go-libp2p-core/peer"
@@ -45,7 +45,7 @@ func (api *KeyAPI) Generate(ctx context.Context, name string, opts ...caopts.Key
4545
if err != nil {
4646
return nil, err
4747
}
48-
out.pid, err = peer.IDB58Decode(out.Id)
48+
out.pid, err = peer.Decode(out.Id)
4949
return &out, err
5050
}
5151

@@ -69,7 +69,7 @@ func (api *KeyAPI) Rename(ctx context.Context, oldName string, newName string, o
6969
}
7070

7171
id := &keyOutput{JName: out.Now, Id: out.Id}
72-
id.pid, err = peer.IDB58Decode(id.Id)
72+
id.pid, err = peer.Decode(id.Id)
7373
return id, out.Overwrite, err
7474
}
7575

@@ -82,7 +82,7 @@ func (api *KeyAPI) List(ctx context.Context) ([]iface.Key, error) {
8282
res := make([]iface.Key, len(out.Keys))
8383
for i, k := range out.Keys {
8484
var err error
85-
k.pid, err = peer.IDB58Decode(k.Id)
85+
k.pid, err = peer.Decode(k.Id)
8686
if err != nil {
8787
return nil, err
8888
}
@@ -100,7 +100,7 @@ func (api *KeyAPI) Self(ctx context.Context) (iface.Key, error) {
100100

101101
var err error
102102
out := keyOutput{JName: "self", Id: id.ID}
103-
out.pid, err = peer.IDB58Decode(out.Id)
103+
out.pid, err = peer.Decode(out.Id)
104104
return &out, err
105105
}
106106

@@ -114,7 +114,7 @@ func (api *KeyAPI) Remove(ctx context.Context, name string) (iface.Key, error) {
114114
}
115115

116116
var err error
117-
out.Keys[0].pid, err = peer.IDB58Decode(out.Keys[0].Id)
117+
out.Keys[0].pid, err = peer.Decode(out.Keys[0].Id)
118118
return &out.Keys[0], err
119119
}
120120

pubsub.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"encoding/json"
77
"io"
88

9-
"github.com/ipfs/interface-go-ipfs-core"
9+
iface "github.com/ipfs/interface-go-ipfs-core"
1010
caopts "github.com/ipfs/interface-go-ipfs-core/options"
1111
"github.com/libp2p/go-libp2p-core/peer"
1212
)
@@ -41,7 +41,7 @@ func (api *PubsubAPI) Peers(ctx context.Context, opts ...caopts.PubSubPeersOptio
4141

4242
res := make([]peer.ID, len(out.Strings))
4343
for i, sid := range out.Strings {
44-
id, err := peer.IDB58Decode(sid)
44+
id, err := peer.Decode(sid)
4545
if err != nil {
4646
return nil, err
4747
}

swarm.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"time"
66

7-
"github.com/ipfs/interface-go-ipfs-core"
7+
iface "github.com/ipfs/interface-go-ipfs-core"
88
"github.com/libp2p/go-libp2p-core/network"
99
"github.com/libp2p/go-libp2p-core/peer"
1010
"github.com/libp2p/go-libp2p-core/protocol"
@@ -91,7 +91,7 @@ func (api *SwarmAPI) Peers(ctx context.Context) ([]iface.ConnectionInfo, error)
9191
direction: conn.Direction,
9292
}
9393

94-
out.peer, err = peer.IDB58Decode(conn.Peer)
94+
out.peer, err = peer.Decode(conn.Peer)
9595
if err != nil {
9696
return nil, err
9797
}
@@ -131,7 +131,7 @@ func (api *SwarmAPI) KnownAddrs(ctx context.Context) (map[peer.ID][]multiaddr.Mu
131131
addrs[i] = a
132132
}
133133

134-
pid, err := peer.IDB58Decode(spid)
134+
pid, err := peer.Decode(spid)
135135
if err != nil {
136136
return nil, err
137137
}

0 commit comments

Comments
 (0)