Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(xcm): use single encoding for XCM messages #2278

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 3 additions & 4 deletions crates/env/src/engine/on_chain/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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())?;
Expand Down
Loading