Skip to content

Commit 342b01d

Browse files
committed
refactor: remove unused types.CID
1 parent 2862dc2 commit 342b01d

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

routing/http/types/ipfs.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,9 @@ package types
33
import (
44
"encoding/json"
55

6-
"github.com/ipfs/boxo/routing/http/internal/drjson"
7-
"github.com/ipfs/go-cid"
86
"github.com/multiformats/go-multiaddr"
97
)
108

11-
type CID struct{ cid.Cid }
12-
13-
func (c *CID) MarshalJSON() ([]byte, error) { return drjson.MarshalJSONBytes(c.String()) }
14-
func (c *CID) UnmarshalJSON(b []byte) error {
15-
var s string
16-
err := json.Unmarshal(b, &s)
17-
if err != nil {
18-
return err
19-
}
20-
decodedCID, err := cid.Decode(s)
21-
if err != nil {
22-
return err
23-
}
24-
c.Cid = decodedCID
25-
return nil
26-
}
27-
289
type Multiaddr struct{ multiaddr.Multiaddr }
2910

3011
func (m *Multiaddr) UnmarshalJSON(b []byte) error {

0 commit comments

Comments
 (0)