mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
plugin: Fix the custommsg hook not to include the internal prefix
We were always prefixing the `message` field with the internal type prefix 0x0407, followed by the length prefix. Neither is needed since the type being constant is of no interest to the plugin and the length being implicit due to the JSON-encoding. Reported-by: Ilya Evdokimov Changelog-Fixed: plugin: The `custommsg` hook no longer includes the internal type prefix and length prefix in its `payload` Changelog-Deprecated: plugin: The `message` field on the `custommsg` hook is deprecated in favor of the `payload` field, which skips the internal prefix.
This commit is contained in:
committed by
Rusty Russell
parent
804c2c2c20
commit
ebb1b19c65
@@ -2284,10 +2284,10 @@ def test_sendcustommsg(node_factory):
|
||||
)
|
||||
l1.daemon.wait_for_log(r'\[IN\] {}'.format(serialized))
|
||||
l1.daemon.wait_for_logs([
|
||||
r'Got custommessage_a {serialized} from peer {peer_id}'.format(
|
||||
serialized=serialized, peer_id=l2.info['id']),
|
||||
r'Got custommessage_b {serialized} from peer {peer_id}'.format(
|
||||
serialized=serialized, peer_id=l2.info['id'])
|
||||
r'Got custommessage_a {msg} from peer {peer_id}'.format(
|
||||
msg=msg, peer_id=l2.info['id']),
|
||||
r'Got custommessage_b {msg} from peer {peer_id}'.format(
|
||||
msg=msg, peer_id=l2.info['id'])
|
||||
])
|
||||
|
||||
# This should work since the peer is currently owned by `openingd`
|
||||
@@ -2299,10 +2299,10 @@ def test_sendcustommsg(node_factory):
|
||||
)
|
||||
l4.daemon.wait_for_log(r'\[IN\] {}'.format(serialized))
|
||||
l4.daemon.wait_for_logs([
|
||||
r'Got custommessage_a {serialized} from peer {peer_id}'.format(
|
||||
serialized=serialized, peer_id=l2.info['id']),
|
||||
r'Got custommessage_b {serialized} from peer {peer_id}'.format(
|
||||
serialized=serialized, peer_id=l2.info['id']),
|
||||
r'Got custommessage_a {msg} from peer {peer_id}'.format(
|
||||
msg=msg, peer_id=l2.info['id']),
|
||||
r'Got custommessage_b {msg} from peer {peer_id}'.format(
|
||||
msg=msg, peer_id=l2.info['id']),
|
||||
])
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user