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

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

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.4: QmVUhfewLZpSaAiBYCpw2krYMaiVmFuhr2iurQLuRoU6sD
0.1.0: QmVkMRSkXrpjqrroEXWuYBvDBnXCdMMY6gsKicBGVGUqKT
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
},
{
"author": "whyrusleeping",
"hash": "QmZFbDTY9jfSBms2MchvYM9oYRbAF19K7Pby47yDBfpPrb",
"hash": "QmPSQnBKM9g7BaUcZCvswUJVscQ1ipjmwxN5PXCjkp9EQ7",
"name": "go-cid",
"version": "0.8.0"
"version": "0.9.0"
}
],
"gxVersion": "0.12.1",
"language": "go",
"license": "",
"name": "go-verifcid",
"releaseCmd": "git commit -a -m \"gx publish $VERSION\"",
"version": "0.0.4"
"version": "0.1.0"
}

2 changes: 1 addition & 1 deletion validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func IsGoodHash(code uint64) bool {
return false
}

func ValidateCid(c *cid.Cid) error {
func ValidateCid(c cid.Cid) error {
pref := c.Prefix()
if !IsGoodHash(pref.MhType) {
return ErrPossiblyInsecureHashFunction
Expand Down
4 changes: 2 additions & 2 deletions validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestValidateCids(t *testing.T) {

assertFalse(IsGoodHash(mh.BLAKE2B_MIN + 5))

mhcid := func(code uint64, length int) *cid.Cid {
mhcid := func(code uint64, length int) cid.Cid {
mhash, err := mh.Sum([]byte{}, code, length)
if err != nil {
t.Fatal(err)
Expand All @@ -41,7 +41,7 @@ func TestValidateCids(t *testing.T) {
}

cases := []struct {
cid *cid.Cid
cid cid.Cid
err error
}{
{mhcid(mh.SHA2_256, 32), nil},
Expand Down