data_types: move shortchanid and nodeid

This commit is contained in:
bitromortac 2022-05-06 15:17:23 +02:00
parent b2f9df0ce7
commit cbce73a67d
No known key found for this signature in database
GPG key ID: 1965063FC13BEBE2
2 changed files with 11 additions and 8 deletions

View file

@ -59,3 +59,11 @@ class NodePair(tuple):
seq = (keys[1], keys[0])
return super().__new__(cls, seq)
class NodeID(str):
pass
class ShortChannelID(int):
pass

View file

@ -5,6 +5,9 @@ from typing import Set, Dict
from math import inf, log
import logging
from lib.data_types import NodeID, ShortChannelID
logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())
@ -17,14 +20,6 @@ TIME_PENALTY_RATE = 0.000_010 # the default penalty for reaction time
TIME_NODE_IS_SLOW_SEC = 5 # the time a node is viewed as slow
class ShortChannelID(int):
pass
class NodeID(str):
pass
class LiquidityHint:
"""Encodes the amounts that can and cannot be sent over the direction of a
channel and whether the channel is blacklisted.