Skip to content

Commit

Permalink
pyln.proto.message: add new BOLT12 fundamental types.
Browse files Browse the repository at this point in the history
Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and cdecker committed Jul 30, 2021
1 parent 85b4400 commit c0eba75
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions contrib/pyln-proto/pyln/proto/message/fundamental_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ def fundamental_types() -> List[FieldType]:
ShortChannelIDType('short_channel_id'),
FundamentalHexType('signature', 64),
BigSizeType('bigsize'),
# Extra types added in offers draft:
IntegerType('utf8', 1, 'B'),
FundamentalHexType('bip340sig', 64),
FundamentalHexType('point32', 32),
]


Expand Down
11 changes: 11 additions & 0 deletions contrib/pyln-proto/tests/test_fundamental_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ def test_fundamental_types():
['65536', bytes([254, 0, 1, 0, 0])],
['4294967295', bytes([254, 255, 255, 255, 255])],
['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()
Expand Down

0 comments on commit c0eba75

Please sign in to comment.