Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Companion for #11981 #1563

Merged
merged 36 commits into from
Sep 12, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
97982f0
Companion for #11981
Szegoo Aug 22, 2022
0c01783
rename
Szegoo Aug 22, 2022
ec86a04
Event to RuntimeEvent in imports
Szegoo Aug 22, 2022
805fbe7
missed rename
Szegoo Aug 22, 2022
01c035c
undo
Szegoo Aug 25, 2022
9386892
revert
Szegoo Aug 25, 2022
b631a12
rename type Call & Event
Szegoo Aug 25, 2022
3d65710
commit
Szegoo Aug 26, 2022
e300434
...
Szegoo Aug 26, 2022
ebc13dc
fix
Szegoo Aug 27, 2022
8f9d7e9
fix errors
Szegoo Aug 28, 2022
9b656e2
fixes
Szegoo Aug 28, 2022
1e29e52
fmt
Szegoo Aug 28, 2022
a0146d6
fix imports
Szegoo Aug 28, 2022
8f616c1
final fix?
Szegoo Aug 28, 2022
6e69cb5
fmt
Szegoo Aug 28, 2022
c02134b
Merge branch 'paritytech:master' into rename-outer-enum
Szegoo Aug 29, 2022
ee5fc1d
fix?
Szegoo Aug 29, 2022
8713d1b
Merge branch 'master' into rename-outer-enum
Szegoo Aug 31, 2022
46a7093
fixes after merge
Szegoo Aug 31, 2022
e515a4d
Merge branch 'master' into rename-outer-enum
Szegoo Sep 1, 2022
cc1c5e3
small fix
Szegoo Sep 1, 2022
33f80de
Merge branch 'paritytech:master' into rename-outer-enum
Szegoo Sep 2, 2022
482ea43
Merge branch 'paritytech:master' into rename-outer-enum
Szegoo Sep 2, 2022
a969ac8
Merge branch 'paritytech:master' into rename-outer-enum
Szegoo Sep 3, 2022
7479d5a
Merge branch 'paritytech:master' into rename-outer-enum
Szegoo Sep 5, 2022
a5568b1
Merge branch 'paritytech:master' into rename-outer-enum
Szegoo Sep 5, 2022
5e84d47
Merge branch 'paritytech:master' into rename-outer-enum
Szegoo Sep 6, 2022
dd0c175
Merge branch 'paritytech:master' into rename-outer-enum
Szegoo Sep 7, 2022
4321830
Merge branch 'paritytech:master' into rename-outer-enum
Szegoo Sep 8, 2022
d05045f
Merge branch 'paritytech:master' into rename-outer-enum
Szegoo Sep 11, 2022
292e213
Merge branch 'paritytech:master' into rename-outer-enum
Szegoo Sep 12, 2022
be366e4
cargo update -p polkadot-runtime-common
shawntabrizi Sep 12, 2022
954b824
cargo +nightly fmt
shawntabrizi Sep 12, 2022
a690841
update lockfile for {"polkadot", "substrate"}
Sep 12, 2022
18965e2
fix
shawntabrizi Sep 12, 2022
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
Prev Previous commit
Next Next commit
fix errors
  • Loading branch information
Szegoo committed Aug 28, 2022
commit 8f9d7e9dec12330dd90b23080d1bcca6ce548dc5
16 changes: 9 additions & 7 deletions pallets/dmp-queue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub mod pallet {
/// The overarching event type.
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;

type XcmExecutor: ExecuteXcm<Self::Call>;
type XcmExecutor: ExecuteXcm<Self::RuntimeCall>;

/// Origin which is allowed to execute overweight messages.
type ExecuteOverweightOrigin: EnsureOrigin<Self::Origin>;
Expand Down Expand Up @@ -224,11 +224,11 @@ pub mod pallet {
mut data: &[u8],
) -> Result<Weight, (MessageId, Weight)> {
let message_id = sp_io::hashing::blake2_256(data);
let maybe_msg = VersionedXcm::<T::Call>::decode_all_with_depth_limit(
let maybe_msg = VersionedXcm::<T::RuntimeCall>::decode_all_with_depth_limit(
MAX_XCM_DECODE_DEPTH,
&mut data,
)
.map(Xcm::<T::Call>::try_from);
.map(Xcm::<T::RuntimeCall>::try_from);
match maybe_msg {
Err(_) => {
Self::deposit_event(Event::InvalidFormat { message_id });
Expand Down Expand Up @@ -353,7 +353,7 @@ mod tests {

type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
type Block = frame_system::mocking::MockBlock<Test>;
type Xcm = xcm::latest::Xcm<Call>;
type Xcm = xcm::latest::Xcm<RuntimeCall>;

frame_support::construct_runtime!(
pub enum Test where
Expand Down Expand Up @@ -425,7 +425,7 @@ mod tests {
}

pub struct MockExec;
impl ExecuteXcm<Call> for MockExec {
impl ExecuteXcm<RuntimeCall> for MockExec {
fn execute_xcm_in_credit(
_origin: impl Into<MultiLocation>,
message: Xcm,
Expand Down Expand Up @@ -465,7 +465,7 @@ mod tests {
index.end_used,
enqueued
.iter()
.map(|m| (0, VersionedXcm::<Call>::from(m.clone()).encode()))
.map(|m| (0, VersionedXcm::<RuntimeCall>::from(m.clone()).encode()))
.collect::<Vec<_>>(),
);
index.end_used += 1;
Expand All @@ -474,7 +474,9 @@ mod tests {
}

fn handle_messages(incoming: &[Xcm], limit: Weight) -> Weight {
let iter = incoming.iter().map(|m| (0, VersionedXcm::<Call>::from(m.clone()).encode()));
let iter = incoming
.iter()
.map(|m| (0, VersionedXcm::<RuntimeCall>::from(m.clone()).encode()));
DmpQueue::handle_dmp_messages(iter, limit)
}

Expand Down
10 changes: 5 additions & 5 deletions pallets/xcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub mod pallet {
/// The overarching event type.
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;

type XcmExecutor: ExecuteXcm<Self::Call>;
type XcmExecutor: ExecuteXcm<Self::RuntimeCall>;
}

#[pallet::error]
Expand Down Expand Up @@ -114,11 +114,11 @@ impl<T: Config> DmpMessageHandler for UnlimitedDmpExecution<T> {
let mut used = 0;
for (_sent_at, data) in iter {
let id = sp_io::hashing::twox_64(&data[..]);
let msg = VersionedXcm::<T::Call>::decode_all_with_depth_limit(
let msg = VersionedXcm::<T::RuntimeCall>::decode_all_with_depth_limit(
MAX_XCM_DECODE_DEPTH,
&mut data.as_slice(),
)
.map(Xcm::<T::Call>::try_from);
.map(Xcm::<T::RuntimeCall>::try_from);
match msg {
Err(_) => Pallet::<T>::deposit_event(Event::InvalidFormat(id)),
Ok(Err(())) => Pallet::<T>::deposit_event(Event::UnsupportedVersion(id)),
Expand Down Expand Up @@ -147,11 +147,11 @@ impl<T: Config> DmpMessageHandler for LimitAndDropDmpExecution<T> {
let mut used = 0;
for (_sent_at, data) in iter {
let id = sp_io::hashing::twox_64(&data[..]);
let msg = VersionedXcm::<T::Call>::decode_all_with_depth_limit(
let msg = VersionedXcm::<T::RuntimeCall>::decode_all_with_depth_limit(
MAX_XCM_DECODE_DEPTH,
&mut data.as_slice(),
)
.map(Xcm::<T::Call>::try_from);
.map(Xcm::<T::RuntimeCall>::try_from);
match msg {
Err(_) => Pallet::<T>::deposit_event(Event::InvalidFormat(id)),
Ok(Err(())) => Pallet::<T>::deposit_event(Event::UnsupportedVersion(id)),
Expand Down
10 changes: 5 additions & 5 deletions pallets/xcmp-queue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub mod pallet {
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;

/// Something to execute an XCM message. We need this to service the XCMoXCMP queue.
type XcmExecutor: ExecuteXcm<Self::Call>;
type XcmExecutor: ExecuteXcm<Self::RuntimeCall>;

/// Information on the avaialble XCMP channels.
type ChannelInfo: GetChannelInfo;
Expand Down Expand Up @@ -140,7 +140,7 @@ pub mod pallet {

let (sender, sent_at, data) =
Overweight::<T>::get(index).ok_or(Error::<T>::BadOverweightIndex)?;
let xcm = VersionedXcm::<T::Call>::decode_all_with_depth_limit(
let xcm = VersionedXcm::<T::RuntimeCall>::decode_all_with_depth_limit(
MAX_XCM_DECODE_DEPTH,
&mut data.as_slice(),
)
Expand Down Expand Up @@ -596,12 +596,12 @@ impl<T: Config> Pallet<T> {
fn handle_xcm_message(
sender: ParaId,
_sent_at: RelayBlockNumber,
xcm: VersionedXcm<T::Call>,
xcm: VersionedXcm<T::RuntimeCall>,
max_weight: Weight,
) -> Result<Weight, XcmError> {
let hash = Encode::using_encoded(&xcm, T::Hashing::hash);
log::debug!("Processing XCMP-XCM: {:?}", &hash);
let (result, event) = match Xcm::<T::Call>::try_from(xcm) {
let (result, event) = match Xcm::<T::RuntimeCall>::try_from(xcm) {
Ok(xcm) => {
let location = (1, Parachain(sender.into()));

Expand Down Expand Up @@ -637,7 +637,7 @@ impl<T: Config> Pallet<T> {
XcmpMessageFormat::ConcatenatedVersionedXcm => {
while !remaining_fragments.is_empty() {
last_remaining_fragments = remaining_fragments;
if let Ok(xcm) = VersionedXcm::<T::Call>::decode_with_depth_limit(
if let Ok(xcm) = VersionedXcm::<T::RuntimeCall>::decode_with_depth_limit(
MAX_XCM_DECODE_DEPTH,
&mut remaining_fragments,
) {
Expand Down
8 changes: 4 additions & 4 deletions parachain-template/runtime/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ where
Deny: ShouldExecute,
Allow: ShouldExecute,
{
fn should_execute<Call>(
fn should_execute<RuntimeCall>(
origin: &MultiLocation,
message: &mut Xcm<Call>,
message: &mut Xcm<RuntimeCall>,
max_weight: Weight,
weight_credit: &mut Weight,
) -> Result<(), ()> {
Expand All @@ -115,9 +115,9 @@ where
// See issue #5233
pub struct DenyReserveTransferToRelayChain;
impl ShouldExecute for DenyReserveTransferToRelayChain {
fn should_execute<Call>(
fn should_execute<RuntimeCall>(
origin: &MultiLocation,
message: &mut Xcm<Call>,
message: &mut Xcm<RuntimeCall>,
_max_weight: Weight,
_weight_credit: &mut Weight,
) -> Result<(), ()> {
Expand Down
8 changes: 4 additions & 4 deletions parachains/common/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ where
Deny: ShouldExecute,
Allow: ShouldExecute,
{
fn should_execute<Call>(
fn should_execute<RuntimeCall>(
origin: &MultiLocation,
message: &mut Xcm<Call>,
message: &mut Xcm<RuntimeCall>,
max_weight: Weight,
weight_credit: &mut Weight,
) -> Result<(), ()> {
Expand All @@ -35,9 +35,9 @@ where
// See issue #5233
pub struct DenyReserveTransferToRelayChain;
impl ShouldExecute for DenyReserveTransferToRelayChain {
fn should_execute<Call>(
fn should_execute<RuntimeCall>(
origin: &MultiLocation,
message: &mut Xcm<Call>,
message: &mut Xcm<RuntimeCall>,
_max_weight: Weight,
_weight_credit: &mut Weight,
) -> Result<(), ()> {
Expand Down
82 changes: 43 additions & 39 deletions parachains/runtimes/assets/statemint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ impl Default for ProxyType {
Self::Any
}
}
impl InstanceFilter<Call> for ProxyType {
fn filter(&self, c: &Call) -> bool {
impl InstanceFilter<RuntimeCall> for ProxyType {
fn filter(&self, c: &RuntimeCall) -> bool {
match self {
ProxyType::Any => true,
ProxyType::NonTransfer => !matches!(
Expand All @@ -357,57 +357,61 @@ impl InstanceFilter<Call> for ProxyType {
),
ProxyType::CancelProxy => matches!(
c,
Call::Proxy(pallet_proxy::Call::reject_announcement { .. }) |
Call::Utility { .. } | RuntimeCall::Multisig { .. }
RuntimeCall::Proxy(pallet_proxy::Call::reject_announcement { .. }) |
RuntimeCall::Utility { .. } |
RuntimeCall::Multisig { .. }
),
ProxyType::Assets => {
matches!(
c,
Call::Assets { .. } |
Call::Utility { .. } | RuntimeCall::Multisig { .. } |
Call::Uniques { .. }
RuntimeCall::Assets { .. } |
RuntimeCall::Utility { .. } |
RuntimeCall::Multisig { .. } |
RuntimeCall::Uniques { .. }
)
},
ProxyType::AssetOwner => matches!(
c,
Call::Assets(pallet_assets::Call::create { .. }) |
Call::Assets(pallet_assets::Call::destroy { .. }) |
Call::Assets(pallet_assets::Call::transfer_ownership { .. }) |
Call::Assets(pallet_assets::Call::set_team { .. }) |
Call::Assets(pallet_assets::Call::set_metadata { .. }) |
Call::Assets(pallet_assets::Call::clear_metadata { .. }) |
Call::Uniques(pallet_uniques::Call::create { .. }) |
Call::Uniques(pallet_uniques::Call::destroy { .. }) |
Call::Uniques(pallet_uniques::Call::transfer_ownership { .. }) |
Call::Uniques(pallet_uniques::Call::set_team { .. }) |
Call::Uniques(pallet_uniques::Call::set_metadata { .. }) |
Call::Uniques(pallet_uniques::Call::set_attribute { .. }) |
Call::Uniques(pallet_uniques::Call::set_collection_metadata { .. }) |
Call::Uniques(pallet_uniques::Call::clear_metadata { .. }) |
Call::Uniques(pallet_uniques::Call::clear_attribute { .. }) |
Call::Uniques(pallet_uniques::Call::clear_collection_metadata { .. }) |
Call::Uniques(pallet_uniques::Call::set_collection_max_supply { .. }) |
Call::Utility { .. } | RuntimeCall::Multisig { .. }
RuntimeCall::Assets(pallet_assets::Call::create { .. }) |
RuntimeCall::Assets(pallet_assets::Call::destroy { .. }) |
RuntimeCall::Assets(pallet_assets::Call::transfer_ownership { .. }) |
RuntimeCall::Assets(pallet_assets::Call::set_team { .. }) |
RuntimeCall::Assets(pallet_assets::Call::set_metadata { .. }) |
RuntimeCall::Assets(pallet_assets::Call::clear_metadata { .. }) |
RuntimeCall::Uniques(pallet_uniques::Call::create { .. }) |
RuntimeCall::Uniques(pallet_uniques::Call::destroy { .. }) |
RuntimeCall::Uniques(pallet_uniques::Call::transfer_ownership { .. }) |
RuntimeCall::Uniques(pallet_uniques::Call::set_team { .. }) |
RuntimeCall::Uniques(pallet_uniques::Call::set_metadata { .. }) |
RuntimeCall::Uniques(pallet_uniques::Call::set_attribute { .. }) |
RuntimeCall::Uniques(pallet_uniques::Call::set_collection_metadata { .. }) |
RuntimeCall::Uniques(pallet_uniques::Call::clear_metadata { .. }) |
RuntimeCall::Uniques(pallet_uniques::Call::clear_attribute { .. }) |
RuntimeCall::Uniques(pallet_uniques::Call::clear_collection_metadata { .. }) |
RuntimeCall::Uniques(pallet_uniques::Call::set_collection_max_supply { .. }) |
RuntimeCall::Utility { .. } |
RuntimeCall::Multisig { .. }
),
ProxyType::AssetManager => matches!(
c,
Call::Assets(pallet_assets::Call::mint { .. }) |
Call::Assets(pallet_assets::Call::burn { .. }) |
Call::Assets(pallet_assets::Call::freeze { .. }) |
Call::Assets(pallet_assets::Call::thaw { .. }) |
Call::Assets(pallet_assets::Call::freeze_asset { .. }) |
Call::Assets(pallet_assets::Call::thaw_asset { .. }) |
Call::Uniques(pallet_uniques::Call::mint { .. }) |
Call::Uniques(pallet_uniques::Call::burn { .. }) |
Call::Uniques(pallet_uniques::Call::freeze { .. }) |
Call::Uniques(pallet_uniques::Call::thaw { .. }) |
Call::Uniques(pallet_uniques::Call::freeze_collection { .. }) |
Call::Uniques(pallet_uniques::Call::thaw_collection { .. }) |
Call::Utility { .. } | RuntimeCall::Multisig { .. }
RuntimeCall::Assets(pallet_assets::Call::mint { .. }) |
RuntimeCall::Assets(pallet_assets::Call::burn { .. }) |
RuntimeCall::Assets(pallet_assets::Call::freeze { .. }) |
RuntimeCall::Assets(pallet_assets::Call::thaw { .. }) |
RuntimeCall::Assets(pallet_assets::Call::freeze_asset { .. }) |
RuntimeCall::Assets(pallet_assets::Call::thaw_asset { .. }) |
RuntimeCall::Uniques(pallet_uniques::Call::mint { .. }) |
RuntimeCall::Uniques(pallet_uniques::Call::burn { .. }) |
RuntimeCall::Uniques(pallet_uniques::Call::freeze { .. }) |
RuntimeCall::Uniques(pallet_uniques::Call::thaw { .. }) |
RuntimeCall::Uniques(pallet_uniques::Call::freeze_collection { .. }) |
RuntimeCall::Uniques(pallet_uniques::Call::thaw_collection { .. }) |
RuntimeCall::Utility { .. } |
RuntimeCall::Multisig { .. }
),
ProxyType::Collator => matches!(
c,
Call::CollatorSelection { .. } |
RuntimeCall::CollatorSelection { .. } |
RuntimeCall::Utility { .. } |
RuntimeCall::Multisig { .. }
),
Expand Down
Loading