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

use xcm::v3 instead of latest #889

Merged
merged 1 commit into from
Mar 2, 2023
Merged
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
2 changes: 1 addition & 1 deletion asset-registry/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use sp_runtime::{
ArithmeticError, FixedU128,
};
use sp_std::prelude::*;
use xcm::latest::{prelude::*, Weight as XcmWeight};
use xcm::v3::{prelude::*, Weight as XcmWeight};
use xcm::VersionedMultiLocation;
use xcm_builder::TakeRevenue;
use xcm_executor::{traits::WeightTrader, Assets};
Expand Down
2 changes: 1 addition & 1 deletion asset-registry/src/mock/para.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use sp_runtime::{
traits::{AccountIdConversion, Convert, IdentityLookup},
AccountId32,
};
use xcm::latest::{prelude::*, Weight};
use xcm::v3::{prelude::*, Weight};
use xcm_builder::{
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, EnsureXcmOrigin, FixedWeightBounds, ParentIsPreset,
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
Expand Down
2 changes: 1 addition & 1 deletion asset-registry/src/mock/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use frame_system::EnsureRoot;
use polkadot_runtime_parachains::{configuration, origin, shared, ump};
use sp_core::H256;
use sp_runtime::{testing::Header, traits::IdentityLookup, AccountId32};
use xcm::latest::prelude::*;
use xcm::v3::prelude::*;
use xcm_builder::{
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative, ChildParachainConvertsVia,
CurrencyAdapter as XcmCurrencyAdapter, FixedWeightBounds, IsConcrete, SignedAccountId32AsNative,
Expand Down
2 changes: 1 addition & 1 deletion traits/src/asset_registry.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use frame_support::pallet_prelude::*;
use sp_runtime::DispatchResult;
use sp_std::vec::Vec;
use xcm::latest::prelude::*;
use xcm::v3::prelude::*;
use xcm::VersionedMultiLocation;

pub trait WeightToFeeConverter {
Expand Down
2 changes: 1 addition & 1 deletion traits/src/location.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use sp_core::{bounded::BoundedVec, ConstU32};
use xcm::latest::prelude::*;
use xcm::v3::prelude::*;

pub trait Parse {
/// Returns the "chain" location part. It could be parent, sibling
Expand Down
2 changes: 1 addition & 1 deletion traits/src/multi_asset.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use sp_core::{bounded::BoundedVec, ConstU32};
use xcm::latest::prelude::*;
use xcm::v3::prelude::*;

use crate::location::RelativeLocations;

Expand Down
2 changes: 1 addition & 1 deletion traits/src/xcm_transfer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use frame_support::dispatch::DispatchResult;
use xcm::latest::prelude::*;
use xcm::v3::prelude::*;

/// Abstraction over cross-chain token transfers.
pub trait XcmTransfer<AccountId, Balance, CurrencyId> {
Expand Down
2 changes: 1 addition & 1 deletion unknown-tokens/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use frame_support::pallet_prelude::*;
use sp_std::vec::Vec;
use xcm::latest::prelude::*;
use xcm::v3::prelude::*;

use orml_xcm_support::UnknownAsset;

Expand Down
2 changes: 1 addition & 1 deletion xcm-support/src/currency_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use sp_std::{
result,
};

use xcm::latest::{prelude::*, Error as XcmError, MultiAsset, MultiLocation, Result};
use xcm::v3::{prelude::*, Error as XcmError, MultiAsset, MultiLocation, Result};
use xcm_executor::{
traits::{Convert as MoreConvert, MatchesFungible, TransactAsset},
Assets,
Expand Down
2 changes: 1 addition & 1 deletion xcm-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use frame_support::{
use sp_runtime::traits::{CheckedConversion, Convert};
use sp_std::marker::PhantomData;

use xcm::latest::prelude::*;
use xcm::v3::prelude::*;
use xcm_executor::traits::MatchesFungible;

use orml_traits::{location::Reserve, GetByKey};
Expand Down
2 changes: 1 addition & 1 deletion xcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use frame_support::{pallet_prelude::*, traits::EnsureOrigin};
use frame_system::pallet_prelude::*;
use sp_std::boxed::Box;
use xcm::{latest::prelude::*, VersionedMultiLocation, VersionedXcm};
use xcm::{v3::prelude::*, VersionedMultiLocation, VersionedXcm};

pub use module::*;

Expand Down
5 changes: 4 additions & 1 deletion xtokens/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ use sp_runtime::{
};
use sp_std::{prelude::*, result::Result};

use xcm::{latest::Weight, prelude::*};
use xcm::{
v3::{prelude::*, Weight},
VersionedMultiAsset, VersionedMultiAssets, VersionedMultiLocation,
};
use xcm_executor::traits::WeightBounds;

pub use module::*;
Expand Down
2 changes: 1 addition & 1 deletion xtokens/src/mock/para.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use sp_runtime::{
use cumulus_primitives_core::{ChannelStatus, GetChannelInfo, ParaId};
use pallet_xcm::XcmPassthrough;
use polkadot_parachain::primitives::Sibling;
use xcm::latest::{prelude::*, Weight};
use xcm::v3::{prelude::*, Weight};
use xcm_builder::{
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, EnsureXcmOrigin, FixedWeightBounds, NativeAsset,
ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
Expand Down
2 changes: 1 addition & 1 deletion xtokens/src/mock/para_relative_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use sp_runtime::{
use cumulus_primitives_core::{ChannelStatus, GetChannelInfo, ParaId};
use pallet_xcm::XcmPassthrough;
use polkadot_parachain::primitives::Sibling;
use xcm::latest::{prelude::*, Weight};
use xcm::v3::{prelude::*, Weight};
use xcm_builder::{
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, EnsureXcmOrigin, FixedWeightBounds, ParentIsPreset,
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
Expand Down
2 changes: 1 addition & 1 deletion xtokens/src/mock/para_teleport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use sp_runtime::{
use cumulus_primitives_core::{ChannelStatus, GetChannelInfo, ParaId};
use pallet_xcm::XcmPassthrough;
use polkadot_parachain::primitives::Sibling;
use xcm::latest::{prelude::*, Weight};
use xcm::v3::{prelude::*, Weight};
use xcm_builder::{
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, EnsureXcmOrigin, FixedWeightBounds, NativeAsset,
ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
Expand Down
2 changes: 1 addition & 1 deletion xtokens/src/mock/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use sp_runtime::{testing::Header, traits::IdentityLookup, AccountId32};
use crate::Weight;
use cumulus_primitives_core::ParaId;
use polkadot_runtime_parachains::{configuration, origin, shared, ump};
use xcm::latest::prelude::*;
use xcm::v3::prelude::*;
use xcm_builder::{
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, ChildParachainAsNative, ChildParachainConvertsVia,
CurrencyAdapter as XcmCurrencyAdapter, FixedWeightBounds, IsConcrete, SignedAccountId32AsNative,
Expand Down
2 changes: 1 addition & 1 deletion xtokens/src/mock/teleport_currency_adapter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use sp_std::{
};

use orml_xcm_support::{OnDepositFail, UnknownAsset as UnknownAssetT};
use xcm::latest::{prelude::*, Error as XcmError, MultiAsset, MultiLocation, Result};
use xcm::v3::{prelude::*, Error as XcmError, MultiAsset, MultiLocation, Result};
use xcm_executor::{
traits::{Convert as MoreConvert, MatchesFungible, TransactAsset},
Assets,
Expand Down
5 changes: 1 addition & 4 deletions xtokens/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use mock::*;
use orml_traits::{ConcreteFungibleAsset, MultiCurrency};
use polkadot_parachain::primitives::Sibling;
use sp_runtime::{traits::AccountIdConversion, AccountId32};
use xcm::{v3::OriginKind::SovereignAccount, VersionedXcm};
use xcm_simulator::TestExt;

fn para_a_account() -> AccountId32 {
Expand Down Expand Up @@ -1028,8 +1029,6 @@ fn send_as_sovereign() {
});

ParaA::execute_with(|| {
use xcm::latest::OriginKind::SovereignAccount;

let call = relay::RuntimeCall::System(frame_system::Call::<relay::Runtime>::remark_with_event {
remark: vec![1, 1, 1],
});
Expand Down Expand Up @@ -1071,8 +1070,6 @@ fn send_as_sovereign_fails_if_bad_origin() {
});

ParaA::execute_with(|| {
use xcm::latest::OriginKind::SovereignAccount;

let call = relay::RuntimeCall::System(frame_system::Call::<relay::Runtime>::remark_with_event {
remark: vec![1, 1, 1],
});
Expand Down