mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-23 17:14:22 +01:00
pyln-proto: expose ShortChannelId and PublicKey.
They're generally useful. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -85,6 +85,9 @@ class ShortChannelId(object):
|
||||
and self.outnum == other.outnum
|
||||
)
|
||||
|
||||
def __hash__(self):
|
||||
return self.to_int().__hash__()
|
||||
|
||||
|
||||
class Secret(object):
|
||||
def __init__(self, data: bytes) -> None:
|
||||
@@ -147,6 +150,15 @@ class PublicKey(object):
|
||||
self.serializeCompressed().hex()
|
||||
)
|
||||
|
||||
def __eq__(self, other: object) -> bool:
|
||||
if not isinstance(other, PublicKey):
|
||||
return False
|
||||
|
||||
return self.key == other.key
|
||||
|
||||
def __hash__(self):
|
||||
return self.to_bytes().__hash__()
|
||||
|
||||
|
||||
def Keypair(object):
|
||||
def __init__(self, priv, pub):
|
||||
|
||||
Reference in New Issue
Block a user