From 9e33df16966602e98feacf0ddaf5d9fc3cfe3e1a Mon Sep 17 00:00:00 2001 From: Ron Date: Thu, 21 Dec 2023 13:04:28 +0800 Subject: [PATCH] Specify index of digest item (#1078) * Test for encode digest_item * Update sdk * Update sdk * Update sdk --- parachain/pallets/outbound-queue/src/test.rs | 19 ++++++++++++++++++- polkadot-sdk | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/parachain/pallets/outbound-queue/src/test.rs b/parachain/pallets/outbound-queue/src/test.rs index 6f1d65b92e..0028d75e7b 100644 --- a/parachain/pallets/outbound-queue/src/test.rs +++ b/parachain/pallets/outbound-queue/src/test.rs @@ -239,7 +239,7 @@ fn convert_local_currency() { } #[test] -fn encode_digest_item() { +fn encode_digest_item_with_correct_index() { new_tester().execute_with(|| { let digest_item: DigestItem = CustomDigestItem::Snowbridge(H256::default()).into(); let enum_prefix = match digest_item { @@ -249,3 +249,20 @@ fn encode_digest_item() { assert_eq!(enum_prefix, 0); }); } + +#[test] +fn encode_digest_item() { + new_tester().execute_with(|| { + let digest_item: DigestItem = CustomDigestItem::Snowbridge([5u8; 32].into()).into(); + let digest_item_raw = digest_item.encode(); + assert_eq!(digest_item_raw[0], 0); // DigestItem::Other + assert_eq!(digest_item_raw[2], 0); // CustomDigestItem::Snowbridge + assert_eq!( + digest_item_raw, + [ + 0, 132, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5 + ] + ); + }); +} diff --git a/polkadot-sdk b/polkadot-sdk index 89a79f5183..c9f98b41af 160000 --- a/polkadot-sdk +++ b/polkadot-sdk @@ -1 +1 @@ -Subproject commit 89a79f518380c55a9dadf3098a025daadb37c08c +Subproject commit c9f98b41afb61a7c4b6e8945dfe884010a1a3205