Skip to content

Support /p2p addresses encoded as CIDs#130

Merged
aschmahmann merged 2 commits intomasterfrom
feat/parse-peerids-from-cids
Aug 17, 2020
Merged

Support /p2p addresses encoded as CIDs#130
aschmahmann merged 2 commits intomasterfrom
feat/parse-peerids-from-cids

Conversation

@aschmahmann
Copy link
Contributor

@aschmahmann aschmahmann commented Aug 11, 2020

This adds go-cid as a dependency of this library. If adding go-cid is contentious lmk and I can try and copy-paste the parts we need.

Not sure why codecov says the new code isn't tested. Pretty sure I've added enough new test cases. Extra eyes appreciated though.

@aschmahmann aschmahmann requested a review from Stebalien August 11, 2020 18:56
@aschmahmann aschmahmann force-pushed the feat/parse-peerids-from-cids branch from 218e2d0 to 1db2c4a Compare August 12, 2020 04:14
@aschmahmann aschmahmann force-pushed the feat/parse-peerids-from-cids branch 3 times, most recently from 48c8403 to 30a809b Compare August 12, 2020 05:26
@aschmahmann aschmahmann requested a review from Stebalien August 12, 2020 06:08
transcoders.go Outdated
Comment on lines +319 to +322
codecStr := cid.CodecToStr[ty]
if codecStr == "" {
codecStr = fmt.Sprintf("[unknown multicodec %d]", ty)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied this from go-libp2p-core, but is this overkill?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this seems like overkill. We can just fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed, look good?

@aschmahmann aschmahmann force-pushed the feat/parse-peerids-from-cids branch from 30a809b to 9eb5a88 Compare August 12, 2020 06:26
@aschmahmann
Copy link
Contributor Author

aschmahmann commented Aug 12, 2020

btw @Stebalien any idea how I managed to decrease code coverage in this one area https://codecov.io/gh/multiformats/go-multiaddr/compare/2da13ecd1ade1ef08fc453f1b2527bd4edb5ec98...9eb5a88b0945beda7cee97da5086e82acd1a21ef/changes?

When we had the extra error message for unknown codecs in 30a809b it didn't show that. Perhaps it's just a false signal 🤷‍♀️

@Stebalien
Copy link
Member

I have no idea. Codecov is weird.

@aschmahmann aschmahmann merged commit 26a85b9 into master Aug 17, 2020
@aschmahmann aschmahmann mentioned this pull request Sep 22, 2020
72 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants