fix deps to make compile

This commit is contained in:
joepetrowski
2022-11-18 20:35:00 +01:00
parent 35d1e577ae
commit 362a9078df
4 changed files with 20 additions and 28 deletions
Generated
+1 -1
View File
@@ -5310,7 +5310,7 @@ dependencies = [
[[package]]
name = "pallet-assets"
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#4e1e17cccd499dfe49e8c1bed01957953aa4c839"
source = "git+https://github.com/paritytech/substrate?branch=master#087ec5a5b2c9a960fe0f8dc658ab5b21fe8199b3"
dependencies = [
"frame-benchmarking",
"frame-support",
+6 -7
View File
@@ -82,25 +82,24 @@ pub struct AssetFeeAsExistentialDepositMultiplier<Runtime, WeightToFee, BalanceC
impl<CurrencyBalance, Runtime, WeightToFee, BalanceConverter>
cumulus_primitives_utility::ChargeWeightInFungibles<
AccountIdOf<Runtime>,
// todo: I don't understand why `frame_support` is the instance here??? but it compiles...
pallet_assets::Pallet<Runtime, frame_support::instances::Instance1>,
pallet_assets::Pallet<Runtime, pallet_assets::Instance1>,
> for AssetFeeAsExistentialDepositMultiplier<Runtime, WeightToFee, BalanceConverter>
where
Runtime: pallet_assets::Config<frame_support::instances::Instance1>,
Runtime: pallet_assets::Config<pallet_assets::Instance1>,
WeightToFee: WeightToFeePolynomial<Balance = CurrencyBalance>,
BalanceConverter: BalanceConversion<
CurrencyBalance,
<Runtime as pallet_assets::Config<frame_support::instances::Instance1>>::AssetId,
<Runtime as pallet_assets::Config<frame_support::instances::Instance1>>::Balance,
<Runtime as pallet_assets::Config<pallet_assets::Instance1>>::AssetId,
<Runtime as pallet_assets::Config<pallet_assets::Instance1>>::Balance,
>,
AccountIdOf<Runtime>:
From<polkadot_primitives::v2::AccountId> + Into<polkadot_primitives::v2::AccountId>,
{
fn charge_weight_in_fungibles(
asset_id: <pallet_assets::Pallet<Runtime, frame_support::instances::Instance1> as Inspect<AccountIdOf<Runtime>>>::AssetId,
asset_id: <pallet_assets::Pallet<Runtime, pallet_assets::Instance1> as Inspect<AccountIdOf<Runtime>>>::AssetId,
weight: Weight,
) -> Result<
<pallet_assets::Pallet<Runtime, frame_support::instances::Instance1> as Inspect<
<pallet_assets::Pallet<Runtime, pallet_assets::Instance1> as Inspect<
AccountIdOf<Runtime>,
>>::Balance,
XcmError,
@@ -234,6 +234,7 @@ impl pallet_assets::Config<TrustBackedAssetsInstance> for Runtime {
type Balance = Balance;
type AssetId = AssetId;
type Currency = Balances;
type CreateOrigin = AsEnsureOriginWithArg<EnsureSigned<AccountId>>;
type ForceOrigin = AssetsForceOrigin;
type AssetDeposit = AssetDeposit;
type MetadataDepositBase = MetadataDepositBase;
@@ -251,8 +252,7 @@ type ForeignAssetsInstance = pallet_assets::Instance2;
impl pallet_assets::Config<ForeignAssetsInstance> for Runtime {
type RuntimeEvent = RuntimeEvent;
type Balance = Balance;
// TODO: impl Copy for MultiLocation or relax AssetId to Clone?
// https://github.com/paritytech/substrate/pull/12731
// TODO: need HasCompact for MultiLocation
type AssetId = AssetId; // MultiLocationForAssetId;
type Currency = Balances;
type CreateOrigin = AsEnsureOriginWithArg<EnsureSigned<AccountId>>; // ForeignCreators;
@@ -266,7 +266,6 @@ impl pallet_assets::Config<ForeignAssetsInstance> for Runtime {
type Extra = ();
type WeightInfo = weights::pallet_assets::WeightInfo<Runtime>;
type AssetAccountDeposit = AssetAccountDeposit;
type RemoveItemsLimit = frame_support::traits::ConstU32<1000>;
}
parameter_types! {
@@ -369,12 +368,12 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
},
ProxyType::AssetOwner => matches!(
c,
RuntimeCall::Assets(TrustBackedAssetsCall::create { .. }) |
RuntimeCall::Assets(TrustBackedAssetsCall::destroy { .. }) |
RuntimeCall::Assets(TrustBackedAssetsCall::transfer_ownership { .. }) |
RuntimeCall::Assets(TrustBackedAssetsCall::set_team { .. }) |
RuntimeCall::Assets(TrustBackedAssetsCall::set_metadata { .. }) |
RuntimeCall::Assets(TrustBackedAssetsCall::clear_metadata { .. }) |
RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::create { .. }) |
RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::destroy { .. }) |
RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::transfer_ownership { .. }) |
RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::set_team { .. }) |
RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::set_metadata { .. }) |
RuntimeCall::TrustBackedAssets(TrustBackedAssetsCall::clear_metadata { .. }) |
RuntimeCall::Uniques(pallet_uniques::Call::create { .. }) |
RuntimeCall::Uniques(pallet_uniques::Call::destroy { .. }) |
RuntimeCall::Uniques(pallet_uniques::Call::transfer_ownership { .. }) |
@@ -14,7 +14,7 @@
// limitations under the License.
use super::{
AccountId, AllPalletsWithSystem, AssetId, Assets, Authorship, Balance, Balances, ParachainInfo,
AccountId, AllPalletsWithSystem, AssetId, Authorship, Balance, Balances, ParachainInfo,
ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin,
TrustBackedAssets, TrustBackedAssetsInstance, WeightToFee, XcmpQueue,
};
@@ -52,7 +52,7 @@ parameter_types! {
pub UniversalLocation: InteriorMultiLocation = Parachain(ParachainInfo::parachain_id().into()).into();
pub const Local: MultiLocation = Here.into_location();
// todo: accept all instances, perhaps need a type for each instance?
pub AssetsPalletLocation: MultiLocation =
pub TrustBackedAssetsPalletLocation: MultiLocation =
PalletInstance(<TrustBackedAssets as PalletInfoAccess>::index() as u8).into();
pub CheckingAccount: AccountId = PolkadotXcm::check_account();
}
@@ -91,7 +91,7 @@ pub type FungiblesTransactor = FungiblesAdapter<
ConvertedConcreteId<
AssetId,
Balance,
AsPrefixedGeneralIndex<AssetsPalletLocation, AssetId, JustTry>, // todo: accept all instances
AsPrefixedGeneralIndex<TrustBackedAssetsPalletLocation, AssetId, JustTry>, // todo: accept all instances
JustTry,
>,
// Convert an XCM MultiLocation into a local account id:
@@ -193,7 +193,7 @@ impl xcm_executor::Config for XcmConfig {
ConvertedConcreteId<
AssetId,
Balance,
AsPrefixedGeneralIndex<AssetsPalletLocation, AssetId, JustTry>, // todo: accept all instances
AsPrefixedGeneralIndex<TrustBackedAssetsPalletLocation, AssetId, JustTry>, // todo: accept all instances
JustTry,
>,
TrustBackedAssets, // todo: accept all instances
@@ -280,13 +280,7 @@ impl EnsureOriginWithArg<RuntimeOrigin, MultiLocation> for ForeignCreators {
a: &MultiLocation,
) -> sp_std::result::Result<Self::Success, RuntimeOrigin> {
let origin_location = EnsureXcm::<Everything>::try_origin(o.clone())?;
// dirty hack, should port vvv into master and use `starts_with`
// https://github.com/paritytech/polkadot/commit/e640d826513c45a0452138c8908a699e19ac0143
if a.parents != origin_location.parents ||
a.interior.len() < origin_location.interior.len() ||
!origin_location.interior.iter().zip(a.interior.iter()).all(|(l, r)| l == r)
{
if !a.starts_with(&origin_location) {
return Err(o)
}
SovereignAccountOf::convert(origin_location).map_err(|_| o)