pyln-proto: shorten ShortChannelId.from_str()

This commit is contained in:
Michael Schmoock
2023-02-16 16:25:23 +01:00
committed by Rusty Russell
parent 5787e18e69
commit f4b8a401cd

View File

@@ -62,9 +62,7 @@ class ShortChannelId(object):
@classmethod
def from_str(self, s):
block, txnum, outnum = s.split('x')
return ShortChannelId(block=int(block), txnum=int(txnum),
outnum=int(outnum))
return ShortChannelId(*map(int, s.split('x')))
def to_int(self):
return self.block << 40 | self.txnum << 16 | self.outnum