Skip to content

Commit 09c41ce

Browse files
peterwhtcmichi
andauthored
fix(xcm): use single encoding for XCM messages (#2278)
* fix(xcm): use single encoding for XCM messages * update changelog --------- Co-authored-by: Michael Mueller <mich@elmueller.net>
1 parent 5ec034c commit 09c41ce

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
### Changed
1515
- [E2E] Update `subxt` and `polkadot-sdk` dependencies ‒ [#2174](https://github.com/use-ink/ink/pull/2174)
1616
- 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)
17+
- Fix XCM-support to single encode the XCM message [#2278](https://github.com/use-ink/ink/pull/2278)
1718

1819
### Fixed
1920
- Fix outdated docs for `[ink_e2e::test]`[#2162](https://github.com/use-ink/ink/pull/2162)

crates/env/src/engine/on_chain/impls.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -735,8 +735,8 @@ impl TypedEnvBackend for EnvInstance {
735735
{
736736
let mut scope = self.scoped_buffer();
737737

738-
// Double encoding the message as the host fn expects an encoded message.
739-
let enc_msg = scope.take_encoded(&scale::Encode::encode(msg));
738+
let enc_msg = scope.take_encoded(msg);
739+
740740
#[allow(deprecated)]
741741
ext::xcm_execute(enc_msg).map_err(Into::into)
742742
}
@@ -755,8 +755,7 @@ impl TypedEnvBackend for EnvInstance {
755755
scope.append_encoded(dest);
756756
let enc_dest = scope.take_appended();
757757

758-
// Double encoding the message as the host fn expects an encoded message.
759-
scope.append_encoded(&scale::Encode::encode(msg));
758+
scope.append_encoded(msg);
760759
let enc_msg = scope.take_appended();
761760
#[allow(deprecated)]
762761
ext::xcm_send(enc_dest, enc_msg, output.try_into().unwrap())?;

0 commit comments

Comments
 (0)