Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fmt
  • Loading branch information
svyatonik committed Dec 12, 2023
commit 355006707fde95561179d5ddadde5472783d201c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fn construct_extrinsic(
frame_system::CheckGenesis::<Runtime>::new(),
frame_system::CheckEra::<Runtime>::from(Era::immortal()),
frame_system::CheckNonce::<Runtime>::from(
frame_system::Pallet::<Runtime>::account(&account_id).nonce
frame_system::Pallet::<Runtime>::account(&account_id).nonce,
),
frame_system::CheckWeight::<Runtime>::new(),
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ fn construct_extrinsic(
frame_system::CheckGenesis::<Runtime>::new(),
frame_system::CheckEra::<Runtime>::from(Era::immortal()),
frame_system::CheckNonce::<Runtime>::from(
frame_system::Pallet::<Runtime>::account(&account_id).nonce
frame_system::Pallet::<Runtime>::account(&account_id).nonce,
),
frame_system::CheckWeight::<Runtime>::new(),
pallet_transaction_payment::ChargeTransactionPayment::<Runtime>::from(0),
Expand Down Expand Up @@ -235,7 +235,7 @@ fn relayed_incoming_message_works() {
Westend,
XCM_LANE_FOR_ASSET_HUB_WESTEND_TO_ASSET_HUB_ROCOCO,
|| (),
construct_and_apply_extrinsic
construct_and_apply_extrinsic,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,9 @@ pub fn complex_relay_extrinsic_works<
Call = cumulus_pallet_parachain_system::Call<Runtime>,
>,
ValidatorIdOf<Runtime>: From<AccountIdOf<Runtime>>,
<Runtime as pallet_bridge_messages::Config<MPI>>::SourceHeaderChain:
SourceHeaderChain<MessagesProof = FromBridgedChainMessagesProof<HashOf<MessageBridgedChain<MB>>>>,
<Runtime as pallet_bridge_messages::Config<MPI>>::SourceHeaderChain: SourceHeaderChain<
MessagesProof = FromBridgedChainMessagesProof<HashOf<MessageBridgedChain<MB>>>,
>,
<Runtime as frame_system::Config>::AccountId:
Into<<<Runtime as frame_system::Config>::RuntimeOrigin as OriginTrait>::AccountId>,
<Runtime as frame_system::Config>::AccountId: From<AccountId32>,
Expand Down
42 changes: 20 additions & 22 deletions cumulus/parachains/runtimes/test-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,30 +114,34 @@ impl<Runtime: frame_system::Config + pallet_balances::Config + pallet_session::C
}
}

/// A set of traits for a minimal parachain runtime, that may be used in conjunction with the `ExtBuilder` and the `RuntimeHelper`.
pub trait BasicParachainRuntime: frame_system::Config
/// A set of traits for a minimal parachain runtime, that may be used in conjunction with the
/// `ExtBuilder` and the `RuntimeHelper`.
pub trait BasicParachainRuntime:
frame_system::Config
+ pallet_balances::Config
+ pallet_session::Config
+ pallet_xcm::Config
+ parachain_info::Config
+ pallet_collator_selection::Config
+ cumulus_pallet_parachain_system::Config
{}
{
}

impl<T> BasicParachainRuntime for T where T: frame_system::Config
+ pallet_balances::Config
+ pallet_session::Config
+ pallet_xcm::Config
+ parachain_info::Config
+ pallet_collator_selection::Config
+ cumulus_pallet_parachain_system::Config,
impl<T> BasicParachainRuntime for T
where
T: frame_system::Config
+ pallet_balances::Config
+ pallet_session::Config
+ pallet_xcm::Config
+ parachain_info::Config
+ pallet_collator_selection::Config
+ cumulus_pallet_parachain_system::Config,
ValidatorIdOf<T>: From<AccountIdOf<T>>,
{}
{
}

/// Basic builder based on balances, collators and pallet_session.
pub struct ExtBuilder<
Runtime: BasicParachainRuntime,
> {
pub struct ExtBuilder<Runtime: BasicParachainRuntime> {
// endowed accounts with balances
balances: Vec<(AccountIdOf<Runtime>, BalanceOf<Runtime>)>,
// collators to test block prod
Expand All @@ -151,10 +155,7 @@ pub struct ExtBuilder<
_runtime: PhantomData<Runtime>,
}

impl<
Runtime: BasicParachainRuntime,
> Default for ExtBuilder<Runtime>
{
impl<Runtime: BasicParachainRuntime> Default for ExtBuilder<Runtime> {
fn default() -> ExtBuilder<Runtime> {
ExtBuilder {
balances: vec![],
Expand All @@ -167,10 +168,7 @@ impl<
}
}

impl<
Runtime: BasicParachainRuntime,
> ExtBuilder<Runtime>
{
impl<Runtime: BasicParachainRuntime> ExtBuilder<Runtime> {
pub fn with_balances(
mut self,
balances: Vec<(AccountIdOf<Runtime>, BalanceOf<Runtime>)>,
Expand Down