File: discovery.py

package info (click to toggle)
python-eth-typing 5.2.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 324 kB
  • sloc: python: 1,968; makefile: 234
file content (18 lines) | stat: -rw-r--r-- 395 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""
Types for the Discovery Protocol.
"""

from typing import (
    NewType,
)

NodeID = NewType("NodeID", bytes)
r"""
A 32-byte identifier for a node in the Discovery DHT.

.. doctest::

    >>> from eth_typing import NodeID
    >>> NodeID(b'\x01' * 32)
    b'\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01\x01'
"""