Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

gx update and fix code to use new Cid type #6

Merged
merged 2 commits into from
Sep 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gx/lastpubver
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.10: Qmf1xGr3SyBpiPp3ZDuKkYMh4gnRk9K4QnbL17kstnf35h
0.1.0: QmXejiSr776HgKLEGSs7unW7GT82AgfMbQX5crfSybGU8b
6 changes: 3 additions & 3 deletions key.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ func BinaryFromDsKey(k datastore.Key) ([]byte, error) {
}

// CidToDsKey creates a Key from the given Cid.
func CidToDsKey(k *cid.Cid) datastore.Key {
func CidToDsKey(k cid.Cid) datastore.Key {
return NewKeyFromBinary(k.Bytes())
}

// DsKeyToCid converts the given Key to its corresponding Cid.
func DsKeyToCid(dsKey datastore.Key) (*cid.Cid, error) {
func DsKeyToCid(dsKey datastore.Key) (cid.Cid, error) {
kb, err := BinaryFromDsKey(dsKey)
if err != nil {
return nil, err
return cid.Cid{}, err
}
return cid.Cast(kb)
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
},
{
"author": "whyrusleeping",
"hash": "QmZFbDTY9jfSBms2MchvYM9oYRbAF19K7Pby47yDBfpPrb",
"hash": "QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7",
"name": "go-cid",
"version": "0.8.0"
"version": "0.9.0"
},
{
"author": "whyrusleeping",
Expand All @@ -31,6 +31,6 @@
"license": "",
"name": "go-ipfs-ds-help",
"releaseCmd": "git commit -a -m \"gx publish $VERSION\"",
"version": "0.0.10"
"version": "0.1.0"
}