Skip to content

Commit 2991942

Browse files
Update undying collator to send valid PeerId in ApprovedPeer UMP signal
Signed-off-by: Alexandru Cihodaru <[email protected]>
1 parent f8eaa63 commit 2991942

File tree

1 file changed

+5
-1
lines changed
  • polkadot/parachain/test-parachains/undying/src

1 file changed

+5
-1
lines changed

polkadot/parachain/test-parachains/undying/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,12 @@ pub fn execute(
166166
);
167167

168168
if block_data.experimental_send_approved_peer {
169+
// Create a valid PeerId in multihash format: [hash_code, digest_size, ...digest_bytes]
170+
// Using multihash code 0x0 (identity hash) with 32 bytes of data
171+
let mut peer_id_bytes = alloc::vec![0x0, 32]; // hash code 0x0, size 32
172+
peer_id_bytes.extend_from_slice(&[1u8; 32]); // 32 bytes of data
169173
upward_messages
170-
.force_push(UMPSignal::ApprovedPeer(alloc::vec![1, 2, 3].try_into().unwrap()).encode());
174+
.force_push(UMPSignal::ApprovedPeer(peer_id_bytes.try_into().unwrap()).encode());
171175
}
172176

173177
// We need to clone the block data as the fn will mutate it's state.

0 commit comments

Comments
 (0)