Skip to content

Commit 1345fcd

Browse files
committed
Rename multihash codec to p2p and drop all references to the old name
1 parent ace4440 commit 1345fcd

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

multiaddr/codecs/multihash.py renamed to multiaddr/codecs/p2p.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99

1010
def to_bytes(proto, string):
11-
# the address is a varint prefixed multihash string representation
11+
# the address is a base58-encoded string
1212
try:
1313
if six.PY2 and isinstance(string, unicode):
1414
string = string.encode("ascii")
@@ -17,7 +17,6 @@ def to_bytes(proto, string):
1717
raise ValueError("failed to parse p2p addr: %s %s" % (string, str(ex)))
1818
size = varint.encode(len(mm))
1919
if len(mm) < 5:
20-
# TODO - port go-multihash so we can do this correctly
2120
raise ValueError("invalid P2P multihash: %s" % mm)
2221
return b''.join([size, mm])
2322

multiaddr/protocols.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def read_varint_code(buf):
160160
Protocol(P_SCTP, 16, 'sctp', 'uint16be'),
161161
Protocol(P_UDT, 0, 'udt'),
162162
Protocol(P_UTP, 0, 'utp'),
163-
Protocol(P_P2P, LENGTH_PREFIXED_VAR_SIZE, 'p2p', 'multihash'),
163+
Protocol(P_P2P, LENGTH_PREFIXED_VAR_SIZE, 'p2p', 'p2p'),
164164
Protocol(P_ONION, 96, 'onion', 'onion'),
165165
Protocol(P_QUIC, 0, 'quic'),
166166
Protocol(P_HTTP, 0, 'http'),

0 commit comments

Comments
 (0)