-
Notifications
You must be signed in to change notification settings - Fork 740
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
[pallet-revive] fix xcm tests #5684
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Schema: Polkadot SDK PRDoc Schema (prdoc) v1.0.0 | ||
# See doc at https://raw.githubusercontent.com/paritytech/polkadot-sdk/master/prdoc/schema_user.json | ||
|
||
title: "[pallet-revive]" | ||
|
||
doc: | ||
- audience: Runtime Devs | ||
description: | | ||
Update xcm runtime api, and fix pallet-revive xcm tests | ||
|
||
crates: | ||
- name: pallet-revive | ||
bump: patch | ||
- name: pallet-revive-fixtures | ||
bump: patch | ||
- name: pallet-revive-mock-network | ||
bump: patch | ||
- name: polkadot-sdk | ||
bump: patch |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1790,17 +1790,20 @@ pub mod env { | |
&mut self, | ||
memory: &mut M, | ||
dest_ptr: u32, | ||
dest_len: u32, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's just so annoying that we don't have a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I was thinking the same, this can probably be added to parity-scale-codec later on to make it a bit safer |
||
msg_ptr: u32, | ||
msg_len: u32, | ||
output_ptr: u32, | ||
) -> Result<ReturnErrorCode, TrapReason> { | ||
use xcm::{VersionedLocation, VersionedXcm}; | ||
use xcm_builder::{SendController, SendControllerWeightInfo}; | ||
|
||
self.charge_gas(RuntimeCosts::CopyFromContract(msg_len))?; | ||
let dest: VersionedLocation = memory.read_as(dest_ptr)?; | ||
self.charge_gas(RuntimeCosts::CopyFromContract(dest_len))?; | ||
let dest: VersionedLocation = memory.read_as_unbounded(dest_ptr, dest_len)?; | ||
|
||
self.charge_gas(RuntimeCosts::CopyFromContract(msg_len))?; | ||
let message: VersionedXcm<()> = memory.read_as_unbounded(msg_ptr, msg_len)?; | ||
|
||
let weight = <<E::T as Config>::Xcm as SendController<_>>::WeightInfo::send(); | ||
self.charge_gas(RuntimeCosts::CallRuntime(weight))?; | ||
let origin = crate::RawOrigin::Signed(self.ext.account_id().clone()).into(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover or on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oups left over , but I guess it's handy when you want to grab the path of a fixture ¯_(ツ)_/¯