Closed ShadowJonathan closed 4 years ago
Merging #57 into master will increase coverage by
<.01%
. The diff coverage is100%
.
@@ Coverage Diff @@
## master #57 +/- ##
==========================================
+ Coverage 99.59% 99.59% +<.01%
==========================================
Files 15 15
Lines 488 490 +2
Branches 66 66
==========================================
+ Hits 486 488 +2
Misses 2 2
Multiaddr
is currently unhashable, that means that it cannot be used in sets, dicts (as keys), frozentuples, tuples, and with much more internal logic that all depend on__hash__
functions.Internally,
Multiaddr
uses a bytes variable for it's internal state, which can be hashed.This PR adds a simple hash function that uses the hash function of those bytes, effectively making
Multiaddr
hashable.Example of where this would be useful: