mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
plugin: Pass the full raw_payload including realm to htlc_accepted
So far we've only handled legacy payloads, which meant we could drop the realm byte since it was always 0x00. Once we start handling TLV payloads the first byte, i.e., the former realm byte, is important since it gives us the length of the payload. This is a breaking change, however I don't think there's anyone using the `raw_payload` as of yet. Changelog-Changed: JSON-RPC: the `raw_payload` now includes the first byte, i.e., the realm byte, of the payload as well. This allows correct decoding of a TLV payload in the plugins.
This commit is contained in:
@@ -538,8 +538,8 @@ def test_htlc_accepted_hook_forward_restart(node_factory, executor):
|
||||
assert re.match(r'^020203e80401..0608................$', onion['payload'])
|
||||
else:
|
||||
assert onion['type'] == 'legacy'
|
||||
assert re.match(r'^00006700000.000100000000000003e8000000..000000000000000000000000$', onion['payload'])
|
||||
assert len(onion['payload']) == 64
|
||||
assert re.match(r'^0000006700000.000100000000000003e8000000..000000000000000000000000$', onion['payload'])
|
||||
assert len(onion['payload']) == 66
|
||||
assert len(onion['shared_secret']) == 64
|
||||
assert onion['forward_amount'] == '1000msat'
|
||||
assert len(onion['next_onion']) == 2 * (1300 + 32 + 33 + 1)
|
||||
|
||||
Reference in New Issue
Block a user