From 0aced99dafe850d130ca80579fa3625d17433899 Mon Sep 17 00:00:00 2001 From: Peter White Date: Tue, 27 Aug 2024 15:24:03 -0600 Subject: [PATCH 1/2] fix(xcm): use single encoding for XCM messages --- crates/env/src/engine/on_chain/impls.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/env/src/engine/on_chain/impls.rs b/crates/env/src/engine/on_chain/impls.rs index aaf35f50e1..bf3fea473f 100644 --- a/crates/env/src/engine/on_chain/impls.rs +++ b/crates/env/src/engine/on_chain/impls.rs @@ -735,8 +735,8 @@ impl TypedEnvBackend for EnvInstance { { let mut scope = self.scoped_buffer(); - // Double encoding the message as the host fn expects an encoded message. - let enc_msg = scope.take_encoded(&scale::Encode::encode(msg)); + let enc_msg = scope.take_encoded(msg); + #[allow(deprecated)] ext::xcm_execute(enc_msg).map_err(Into::into) } @@ -755,8 +755,7 @@ impl TypedEnvBackend for EnvInstance { scope.append_encoded(dest); let enc_dest = scope.take_appended(); - // Double encoding the message as the host fn expects an encoded message. - scope.append_encoded(&scale::Encode::encode(msg)); + scope.append_encoded(msg); let enc_msg = scope.take_appended(); #[allow(deprecated)] ext::xcm_send(enc_dest, enc_msg, output.try_into().unwrap())?; From 5af1d75472c16bc7175788fa9050edcde2369599 Mon Sep 17 00:00:00 2001 From: Peter White Date: Tue, 27 Aug 2024 16:05:41 -0600 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3003444997..2e5806c956 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - [E2E] Update `subxt` and `polkadot-sdk` dependencies ‒ [#2174](https://github.com/use-ink/ink/pull/2174) - Update repository URLs & references from `paritytech` GitHub organization to new `use-ink` one ‒ [#2220](https://github.com/use-ink/ink/pull/2220) and [#2248](https://github.com/use-ink/ink/pull/2248) +- Fix XCM-support to single encode the XCM message [#2278](https://github.com/use-ink/ink/pull/2278) ### Fixed - Fix outdated docs for `[ink_e2e::test]` ‒ [#2162](https://github.com/use-ink/ink/pull/2162)