Skip to content

Commit

Permalink
fix(xcm): use single encoding for XCM messages
Browse files Browse the repository at this point in the history
  • Loading branch information
peterwht committed Aug 27, 2024
1 parent 0cd2b89 commit 0aced99
Showing 1 changed file with 3 additions and 4 deletions.
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 0aced99

Please sign in to comment.