Skip to content
This repository was archived by the owner on May 21, 2024. It is now read-only.
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
10 changes: 0 additions & 10 deletions runtime/trappist/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,4 @@ pub mod fee {
}]
}
}

pub fn base_tx_fee() -> Balance {
CENTS / 10
}

pub fn default_fee_per_second() -> u128 {
let base_weight = Balance::from(ExtrinsicBaseWeight::get().ref_time());
let base_tx_per_second = (WEIGHT_REF_TIME_PER_SECOND as u128) / base_weight;
base_tx_per_second * base_tx_fee()
}
}
25 changes: 7 additions & 18 deletions runtime/trappist/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use crate::{
constants::fee::default_fee_per_second, impls::ToAuthor, weights::TrappistDropAssetsWeigher,
};
use crate::{impls::ToAuthor, weights::TrappistDropAssetsWeigher};

use super::{
AccountId, AssetRegistry, Assets, Balance, Balances, ParachainInfo, ParachainSystem,
Expand Down Expand Up @@ -43,11 +41,11 @@ use xcm::latest::{prelude::*, Fungibility::Fungible, MultiAsset, MultiLocation};
use xcm_builder::{
AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom,
AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, AsPrefixedGeneralIndex,
ConvertedConcreteAssetId, CurrencyAdapter, EnsureXcmOrigin, FixedRateOfFungible,
FungiblesAdapter, IsConcrete, LocationInverter, NativeAsset, ParentAsSuperuser, ParentIsPreset,
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
UsingComponents, WeightInfoBounds,
ConvertedConcreteAssetId, CurrencyAdapter, EnsureXcmOrigin, FungiblesAdapter, IsConcrete,
LocationInverter, NativeAsset, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative,
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents,
WeightInfoBounds,
};
use xcm_executor::XcmExecutor;

Expand Down Expand Up @@ -198,7 +196,6 @@ pub type Barrier = DenyThenTry<
AllowTopLevelPaidExecutionFrom<Everything>,
// Parent and its exec plurality get free execution
AllowUnpaidExecutionFrom<ParentOrParentsExecutivePlurality>,
AllowUnpaidExecutionFrom<Rockmine>,
// Expected responses are OK.
AllowKnownQueryResponses<PolkadotXcm>,
// Subscriptions for version tracking are OK.
Expand All @@ -212,11 +209,6 @@ parameter_types! {
// Rockmine's Assets pallet index
pub RockmineAssetsPalletLocation: MultiLocation =
MultiLocation::new(1, X2(Parachain(1000), PalletInstance(50)));

pub XUsdPerSecond: (xcm::v1::AssetId, u128) = (
MultiLocation::new(1, X3(Parachain(1000), PalletInstance(50), GeneralIndex(1))).into(),
default_fee_per_second() * 10
);
}

//- From PR https://github.com/paritytech/cumulus/pull/936
Expand Down Expand Up @@ -262,10 +254,7 @@ impl xcm_executor::Config for XcmConfig {
RuntimeCall,
MaxInstructions,
>;
type Trader = (
FixedRateOfFungible<XUsdPerSecond, ()>,
UsingComponents<WeightToFee, SelfReserve, AccountId, Balances, ToAuthor<Runtime>>,
);
type Trader = UsingComponents<WeightToFee, SelfReserve, AccountId, Balances, ToAuthor<Runtime>>;
type ResponseHandler = PolkadotXcm;
type AssetTrap = TrappistDropAssets<
AssetId,
Expand Down