Skip to content

Commit

Permalink
custom: track new varint error
Browse files Browse the repository at this point in the history
Signed-off-by: Sander Pick <[email protected]>
  • Loading branch information
sanderpick committed Feb 7, 2020
1 parent 720d00e commit 5b3d35f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ require (
github.com/multiformats/go-multiaddr v0.2.0
github.com/multiformats/go-multibase v0.0.1
github.com/multiformats/go-multihash v0.0.13
github.com/multiformats/go-varint v0.0.5
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
github.com/namsral/flag v1.7.4-pre
github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2
Expand Down
3 changes: 2 additions & 1 deletion service/pb/custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
pt "github.com/libp2p/go-libp2p-core/test"
ma "github.com/multiformats/go-multiaddr"
mh "github.com/multiformats/go-multihash"
varint "github.com/multiformats/go-varint"
"github.com/textileio/go-threads/core/thread"
"github.com/textileio/go-threads/crypto/symmetric"
)
Expand Down Expand Up @@ -123,7 +124,7 @@ func (c ProtoCid) MarshalJSON() ([]byte, error) {

func (c *ProtoCid) Unmarshal(data []byte) (err error) {
c.Cid, err = cid.Cast(data)
if err == cid.ErrCidTooShort {
if err == varint.ErrUnderflow {
c.Cid = cid.Undef
return nil
}
Expand Down

0 comments on commit 5b3d35f

Please sign in to comment.