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

Should we add an empty MA to the failure test? #85

Open
diegomrsantos opened this issue Mar 22, 2023 · 5 comments
Open

Should we add an empty MA to the failure test? #85

diegomrsantos opened this issue Mar 22, 2023 · 5 comments

Comments

@diegomrsantos
Copy link

Seems that the spec doesn't allow an empty MA.

Human-readable multiaddr: (/<protoName string>/<value string>)+
Example: /ip4/127.0.0.1/udp/1234
Machine-readable multiaddr: (<protoCode uvarint><value []byte>)+
Same example: 0x4 0x7f 0x0 0x0 0x1 0x91 0x2 0x4 0xd2
Values are usually length-prefixed with a uvarint
@thomaseizinger
Copy link
Contributor

Where in the provided snippet do you read that an empty address is not allowed?

@diegomrsantos
Copy link
Author

Doesn't "+" mean 1 or more?

@Menduist
Copy link

Also see multiformats/go-multiaddr#104

@thomaseizinger
Copy link
Contributor

Doesn't "+" mean 1 or more?

Ah yes, I didn't realize that was actually a regular expression.

@thomaseizinger
Copy link
Contributor

We could deprecate the Multiaddr::empty function and replace it with a Multiaddr::new(Protocol) one.

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

No branches or pull requests

3 participants