Skip to content

Commit

Permalink
fix(xcm): use single encoding for XCM messages (#2278)
Browse files Browse the repository at this point in the history
* fix(xcm): use single encoding for XCM messages

* update changelog

---------

Co-authored-by: Michael Mueller <[email protected]>
  • Loading branch information
peterwht and cmichi authored Nov 6, 2024
1 parent 5ec034c commit 09c41ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit 09c41ce

Please sign in to comment.