Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: memory multiaddrs #256

Merged
merged 2 commits into from
Oct 28, 2024
Merged

feat: memory multiaddrs #256

merged 2 commits into from
Oct 28, 2024

Conversation

pyropy
Copy link
Contributor

@pyropy pyropy commented Oct 9, 2024

This PR is a "revisit" of #106.

I have just rebased the old branch feat/memory with the current upstream. This PR also relates to other issue I've picked up on libp2p side libp2p/go-libp2p#2293

@lidel lidel requested a review from MarcoPolo October 25, 2024 14:13
@lidel lidel changed the title Implement memory multiaddrs feat: memory multiaddrs Oct 25, 2024
transcoders.go Outdated
@@ -489,3 +489,23 @@ func validateHTTPPath(b []byte) error {
}
return nil // We can represent any byte slice when we escape it.
}

var TranscoderMemory = NewTranscoderFromFunctions(memoryStB, memoryBtS, nil)
Copy link
Contributor

Choose a reason for hiding this comment

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

We should define and use a validation function

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 have added a validation function. It validates that byte slice is 8 bytes long so it can be converted to uint64 using big endian.

@pyropy pyropy requested a review from MarcoPolo October 28, 2024 21:37
@MarcoPolo MarcoPolo merged commit 04c33d5 into multiformats:master Oct 28, 2024
9 checks passed
@pyropy pyropy deleted the feat/memory branch October 29, 2024 07:14
@dhuseby
Copy link

dhuseby commented Oct 31, 2024

🚀

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.

4 participants