pyln.proto.message: add new BOLT12 fundamental types.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
85b4400d8d
commit
c0eba75b1d
|
@ -294,6 +294,10 @@ def fundamental_types() -> List[FieldType]:
|
||||||
ShortChannelIDType('short_channel_id'),
|
ShortChannelIDType('short_channel_id'),
|
||||||
FundamentalHexType('signature', 64),
|
FundamentalHexType('signature', 64),
|
||||||
BigSizeType('bigsize'),
|
BigSizeType('bigsize'),
|
||||||
|
# Extra types added in offers draft:
|
||||||
|
IntegerType('utf8', 1, 'B'),
|
||||||
|
FundamentalHexType('bip340sig', 64),
|
||||||
|
FundamentalHexType('point32', 32),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,17 @@ def test_fundamental_types():
|
||||||
['65536', bytes([254, 0, 1, 0, 0])],
|
['65536', bytes([254, 0, 1, 0, 0])],
|
||||||
['4294967295', bytes([254, 255, 255, 255, 255])],
|
['4294967295', bytes([254, 255, 255, 255, 255])],
|
||||||
['4294967296', bytes([255, 0, 0, 0, 1, 0, 0, 0, 0])]],
|
['4294967296', bytes([255, 0, 0, 0, 1, 0, 0, 0, 0])]],
|
||||||
|
'utf8': [['97', b'\x61'],
|
||||||
|
['0', b'\x00']],
|
||||||
|
'bip340sig': [['0102030405060708090a0b0c0d0e0f10'
|
||||||
|
'1112131415161718191a1b1c1d1e1f20'
|
||||||
|
'2122232425262728292a2b2c2d2e2f30'
|
||||||
|
'3132333435363738393a3b3c3d3e3f40',
|
||||||
|
bytes(range(1, 65))]],
|
||||||
|
'point32': [['02030405060708090a0b0c0d0e0f10'
|
||||||
|
'1112131415161718191a1b1c1d1e1f20'
|
||||||
|
'21',
|
||||||
|
bytes(range(2, 34))]],
|
||||||
}
|
}
|
||||||
|
|
||||||
untested = set()
|
untested = set()
|
||||||
|
|
Loading…
Reference in New Issue