Unverified Commit a5c5512e authored by Shaun Wang's avatar Shaun Wang Committed by GitHub
Browse files

Companion for #8372 (Replace 'Module' with 'Pallet' in construct_runtime macro) (#2629)



* Replace 'Module' with 'Pallet'.

* "Update Substrate"

* fix babe usage

* fix benchmark

Co-authored-by: parity-processbot <>
Co-authored-by: thiolliere's avatarthiolliere <gui.thiolliere@gmail.com>
parent 134090c2
Pipeline #129267 passed with stages
in 36 minutes and 26 seconds
This diff is collapsed.
......@@ -354,7 +354,7 @@ impl pallet_message_lane::Config for Runtime {
type LaneMessageVerifier = crate::rialto_messages::ToRialtoMessageVerifier;
type MessageDeliveryAndDispatchPayment = pallet_message_lane::instant_payments::InstantCurrencyPayments<
Runtime,
pallet_balances::Module<Runtime>,
pallet_balances::Pallet<Runtime>,
GetDeliveryConfirmationTransactionFee,
RootAccountForPayments,
>;
......@@ -369,20 +369,20 @@ construct_runtime!(
NodeBlock = opaque::Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
BridgeRialto: pallet_substrate_bridge::{Module, Call, Storage, Config<T>},
BridgeRialtoMessageLane: pallet_message_lane::{Module, Call, Storage, Event<T>},
BridgeCallDispatch: pallet_bridge_call_dispatch::{Module, Event<T>},
BridgeFinalityVerifier: pallet_finality_verifier::{Module, Call},
System: frame_system::{Module, Call, Config, Storage, Event<T>},
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage},
Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},
Aura: pallet_aura::{Module, Config<T>},
Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event},
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
TransactionPayment: pallet_transaction_payment::{Module, Storage},
Sudo: pallet_sudo::{Module, Call, Config<T>, Storage, Event<T>},
Session: pallet_session::{Module, Call, Storage, Event, Config<T>},
ShiftSessionManager: pallet_shift_session_manager::{Module},
BridgeRialto: pallet_substrate_bridge::{Pallet, Call, Storage, Config<T>},
BridgeRialtoMessageLane: pallet_message_lane::{Pallet, Call, Storage, Event<T>},
BridgeCallDispatch: pallet_bridge_call_dispatch::{Pallet, Event<T>},
BridgeFinalityVerifier: pallet_finality_verifier::{Pallet, Call},
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Call, Storage},
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent},
Aura: pallet_aura::{Pallet, Config<T>},
Grandpa: pallet_grandpa::{Pallet, Call, Storage, Config, Event},
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
TransactionPayment: pallet_transaction_payment::{Pallet, Storage},
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>},
Session: pallet_session::{Pallet, Call, Storage, Event, Config<T>},
ShiftSessionManager: pallet_shift_session_manager::{Pallet},
}
);
......@@ -414,7 +414,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signatu
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Call, SignedExtra>;
/// Executive: handles dispatch to the various modules.
pub type Executive =
frame_executive::Executive<Runtime, Block, frame_system::ChainContext<Runtime>, Runtime, AllModules>;
frame_executive::Executive<Runtime, Block, frame_system::ChainContext<Runtime>, Runtime, AllPallets>;
impl_runtime_apis! {
impl sp_api::Core<Block> for Runtime {
......
......@@ -276,7 +276,7 @@ impl bp_currency_exchange::DepositInto for DepositInto {
fn deposit_into(recipient: Self::Recipient, amount: Self::Amount) -> bp_currency_exchange::Result<()> {
// let balances module make all checks for us (it won't allow depositing lower than existential
// deposit, balance overflow, ...)
let deposited = <pallet_balances::Module<Runtime> as Currency<AccountId>>::deposit_creating(&recipient, amount);
let deposited = <pallet_balances::Pallet<Runtime> as Currency<AccountId>>::deposit_creating(&recipient, amount);
// I'm dropping deposited here explicitly to illustrate the fact that it'll update `TotalIssuance`
// on drop
......@@ -461,7 +461,7 @@ impl pallet_message_lane::Config for Runtime {
type LaneMessageVerifier = crate::millau_messages::ToMillauMessageVerifier;
type MessageDeliveryAndDispatchPayment = pallet_message_lane::instant_payments::InstantCurrencyPayments<
Runtime,
pallet_balances::Module<Runtime>,
pallet_balances::Pallet<Runtime>,
GetDeliveryConfirmationTransactionFee,
RootAccountForPayments,
>;
......@@ -476,24 +476,24 @@ construct_runtime!(
NodeBlock = opaque::Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
BridgeRialtoPoA: pallet_bridge_eth_poa::<Instance1>::{Module, Call, Config, Storage, ValidateUnsigned},
BridgeKovan: pallet_bridge_eth_poa::<Instance2>::{Module, Call, Config, Storage, ValidateUnsigned},
BridgeRialtoCurrencyExchange: pallet_bridge_currency_exchange::<Instance1>::{Module, Call},
BridgeKovanCurrencyExchange: pallet_bridge_currency_exchange::<Instance2>::{Module, Call},
BridgeMillau: pallet_substrate_bridge::{Module, Call, Storage, Config<T>},
BridgeFinalityVerifier: pallet_finality_verifier::{Module, Call},
BridgeCallDispatch: pallet_bridge_call_dispatch::{Module, Event<T>},
BridgeMillauMessageLane: pallet_message_lane::{Module, Call, Storage, Event<T>},
System: frame_system::{Module, Call, Config, Storage, Event<T>},
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Module, Call, Storage},
Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},
Aura: pallet_aura::{Module, Config<T>},
Grandpa: pallet_grandpa::{Module, Call, Storage, Config, Event},
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
TransactionPayment: pallet_transaction_payment::{Module, Storage},
Sudo: pallet_sudo::{Module, Call, Config<T>, Storage, Event<T>},
Session: pallet_session::{Module, Call, Storage, Event, Config<T>},
ShiftSessionManager: pallet_shift_session_manager::{Module},
BridgeRialtoPoA: pallet_bridge_eth_poa::<Instance1>::{Pallet, Call, Config, Storage, ValidateUnsigned},
BridgeKovan: pallet_bridge_eth_poa::<Instance2>::{Pallet, Call, Config, Storage, ValidateUnsigned},
BridgeRialtoCurrencyExchange: pallet_bridge_currency_exchange::<Instance1>::{Pallet, Call},
BridgeKovanCurrencyExchange: pallet_bridge_currency_exchange::<Instance2>::{Pallet, Call},
BridgeMillau: pallet_substrate_bridge::{Pallet, Call, Storage, Config<T>},
BridgeFinalityVerifier: pallet_finality_verifier::{Pallet, Call},
BridgeCallDispatch: pallet_bridge_call_dispatch::{Pallet, Event<T>},
BridgeMillauMessageLane: pallet_message_lane::{Pallet, Call, Storage, Event<T>},
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Call, Storage},
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent},
Aura: pallet_aura::{Pallet, Config<T>},
Grandpa: pallet_grandpa::{Pallet, Call, Storage, Config, Event},
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
TransactionPayment: pallet_transaction_payment::{Pallet, Storage},
Sudo: pallet_sudo::{Pallet, Call, Config<T>, Storage, Event<T>},
Session: pallet_session::{Pallet, Call, Storage, Event, Config<T>},
ShiftSessionManager: pallet_shift_session_manager::{Pallet},
}
);
......@@ -525,7 +525,7 @@ pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signatu
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, Call, SignedExtra>;
/// Executive: handles dispatch to the various modules.
pub type Executive =
frame_executive::Executive<Runtime, Block, frame_system::ChainContext<Runtime>, Runtime, AllModules>;
frame_executive::Executive<Runtime, Block, frame_system::ChainContext<Runtime>, Runtime, AllPallets>;
impl_runtime_apis! {
impl sp_api::Core<Block> for Runtime {
......@@ -854,11 +854,11 @@ impl_runtime_apis! {
}
fn account_balance(account: &Self::AccountId) -> Self::OutboundMessageFee {
pallet_balances::Module::<Runtime>::free_balance(account)
pallet_balances::Pallet::<Runtime>::free_balance(account)
}
fn endow_account(account: &Self::AccountId) {
pallet_balances::Module::<Runtime>::make_free_balance_be(
pallet_balances::Pallet::<Runtime>::make_free_balance_be(
account,
Balance::MAX / 100,
);
......@@ -1037,7 +1037,7 @@ mod tests {
ext.execute_with(|| {
// initially issuance is zero
assert_eq!(
<pallet_balances::Module<Runtime> as Currency<AccountId>>::total_issuance(),
<pallet_balances::Pallet<Runtime> as Currency<AccountId>>::total_issuance(),
0,
);
......@@ -1045,14 +1045,14 @@ mod tests {
let account: AccountId = [1u8; 32].into();
let initial_amount = ExistentialDeposit::get();
let deposited =
<pallet_balances::Module<Runtime> as Currency<AccountId>>::deposit_creating(&account, initial_amount);
<pallet_balances::Pallet<Runtime> as Currency<AccountId>>::deposit_creating(&account, initial_amount);
drop(deposited);
assert_eq!(
<pallet_balances::Module<Runtime> as Currency<AccountId>>::total_issuance(),
<pallet_balances::Pallet<Runtime> as Currency<AccountId>>::total_issuance(),
initial_amount,
);
assert_eq!(
<pallet_balances::Module<Runtime> as Currency<AccountId>>::free_balance(&account),
<pallet_balances::Pallet<Runtime> as Currency<AccountId>>::free_balance(&account),
initial_amount,
);
......@@ -1061,7 +1061,7 @@ mod tests {
// check that total issuance has changed by `run_deposit_into_test`
assert_eq!(
<pallet_balances::Module<Runtime> as Currency<AccountId>>::total_issuance(),
<pallet_balances::Pallet<Runtime> as Currency<AccountId>>::total_issuance(),
initial_amount + total_issuance_change,
);
});
......@@ -1115,7 +1115,7 @@ mod tests {
fn deposit_into_existing_account_works() {
run_deposit_into_test(|existing_account| {
let initial_amount =
<pallet_balances::Module<Runtime> as Currency<AccountId>>::free_balance(&existing_account);
<pallet_balances::Pallet<Runtime> as Currency<AccountId>>::free_balance(&existing_account);
let additional_amount = 10_000;
<Runtime as pallet_bridge_currency_exchange::Config<KovanCurrencyExchange>>::DepositInto::deposit_into(
existing_account.clone(),
......@@ -1123,7 +1123,7 @@ mod tests {
)
.unwrap();
assert_eq!(
<pallet_balances::Module<Runtime> as Currency<AccountId>>::free_balance(&existing_account),
<pallet_balances::Pallet<Runtime> as Currency<AccountId>>::free_balance(&existing_account),
initial_amount + additional_amount,
);
additional_amount
......@@ -1142,7 +1142,7 @@ mod tests {
)
.unwrap();
assert_eq!(
<pallet_balances::Module<Runtime> as Currency<AccountId>>::free_balance(&new_account),
<pallet_balances::Pallet<Runtime> as Currency<AccountId>>::free_balance(&new_account),
initial_amount + additional_amount,
);
additional_amount
......
......@@ -451,8 +451,8 @@ mod tests {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Module, Call, Config, Storage, Event<T>},
CallDispatch: call_dispatch::{Module, Call, Event<T>},
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
CallDispatch: call_dispatch::{Pallet, Call, Event<T>},
}
}
......
......@@ -326,8 +326,8 @@ mod tests {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Module, Call, Config, Storage, Event<T>},
Exchange: pallet_bridge_currency_exchange::{Module},
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Exchange: pallet_bridge_currency_exchange::{Pallet},
}
}
......
......@@ -44,8 +44,8 @@ frame_support::construct_runtime! {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Module, Call, Config, Storage, Event<T>},
Ethereum: pallet_ethereum::{Module, Call},
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Ethereum: pallet_ethereum::{Pallet, Call},
}
}
......
......@@ -215,8 +215,8 @@ mod tests {
fn next_block() {
use frame_support::traits::OnInitialize;
let current_number = frame_system::Module::<TestRuntime>::block_number();
frame_system::Module::<TestRuntime>::set_block_number(current_number + 1);
let current_number = frame_system::Pallet::<TestRuntime>::block_number();
frame_system::Pallet::<TestRuntime>::set_block_number(current_number + 1);
let _ = Module::<TestRuntime>::on_initialize(current_number);
}
......
......@@ -41,9 +41,9 @@ construct_runtime! {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Module, Call, Config, Storage, Event<T>},
Bridge: pallet_substrate_bridge::{Module},
FinalityVerifier: finality_verifier::{Module},
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Bridge: pallet_substrate_bridge::{Pallet},
FinalityVerifier: finality_verifier::{Pallet},
}
}
......
......@@ -59,7 +59,7 @@ where
fn initialize(relayer_fund_account: &T::AccountId) -> usize {
assert!(
frame_system::Module::<T>::account_exists(relayer_fund_account),
frame_system::Pallet::<T>::account_exists(relayer_fund_account),
"The relayer fund account ({:?}) must exist for the message lanes pallet to work correctly.",
relayer_fund_account,
);
......@@ -189,7 +189,7 @@ mod tests {
use crate::mock::{run_test, AccountId as TestAccountId, Balance as TestBalance, TestRuntime};
use bp_message_lane::source_chain::RelayerRewards;
type Balances = pallet_balances::Module<TestRuntime>;
type Balances = pallet_balances::Pallet<TestRuntime>;
const RELAYER_1: TestAccountId = 1;
const RELAYER_2: TestAccountId = 2;
......
......@@ -64,9 +64,9 @@ frame_support::construct_runtime! {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Module, Call, Config, Storage, Event<T>},
Balances: pallet_balances::{Module, Call, Event<T>},
MessageLane: pallet_message_lane::{Module, Call, Event<T>},
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Balances: pallet_balances::{Pallet, Call, Event<T>},
MessageLane: pallet_message_lane::{Pallet, Call, Event<T>},
}
}
......@@ -112,7 +112,7 @@ impl pallet_balances::Config for TestRuntime {
type DustRemoval = ();
type Event = Event;
type ExistentialDeposit = ExistentialDeposit;
type AccountStore = frame_system::Module<TestRuntime>;
type AccountStore = frame_system::Pallet<TestRuntime>;
type WeightInfo = ();
}
......
......@@ -110,8 +110,8 @@ mod tests {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Module, Call, Config, Storage, Event<T>},
Session: pallet_session::{Module},
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Session: pallet_session::{Pallet},
}
}
......@@ -193,7 +193,7 @@ mod tests {
BasicExternalities::execute_with_storage(&mut t, || {
for (ref k, ..) in &keys {
frame_system::Module::<TestRuntime>::inc_providers(k);
frame_system::Pallet::<TestRuntime>::inc_providers(k);
}
});
......
......@@ -47,8 +47,8 @@ frame_support::construct_runtime! {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Module, Call, Config, Storage, Event<T>},
Substrate: pallet_substrate::{Module, Call},
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Substrate: pallet_substrate::{Pallet, Call},
}
}
......
......@@ -231,7 +231,7 @@ decl_module! {
let n = AuctionCounter::mutate(|n| { *n += 1; *n });
// Set the information.
let ending = frame_system::Module::<T>::block_number().saturating_add(duration);
let ending = frame_system::Pallet::<T>::block_number().saturating_add(duration);
AuctionInfo::<T>::put((lease_period_index, ending));
Self::deposit_event(RawEvent::AuctionStarted(n, lease_period_index, ending))
......@@ -313,7 +313,7 @@ impl<T: Config> Module<T> {
let late_end = early_end.saturating_add(T::EndingPeriod::get());
// We need to check that the auction isn't in the period where it has definitely ended, but yeah we keep the
// info around because we haven't yet decided *exactly* when in the `EndingPeriod` that it ended.
let now = frame_system::Module::<T>::block_number();
let now = frame_system::Pallet::<T>::block_number();
now < late_end
})
}
......@@ -334,7 +334,7 @@ impl<T: Config> Module<T> {
let n = AuctionCounter::mutate(|n| { *n += 1; *n });
// Set the information.
let ending = frame_system::Module::<T>::block_number().saturating_add(duration);
let ending = frame_system::Pallet::<T>::block_number().saturating_add(duration);
AuctionInfo::<T>::put((lease_period_index, ending));
Self::deposit_event(RawEvent::AuctionStarted(n, lease_period_index, ending));
......@@ -365,7 +365,7 @@ impl<T: Config> Module<T> {
// We need to check that the auction isn't in the period where it has definitely ended, but yeah we keep the
// info around because we haven't yet decided *exactly* when in the `EndingPeriod` that it ended.
let now = frame_system::Module::<T>::block_number();
let now = frame_system::Pallet::<T>::block_number();
ensure!(now < late_end, Error::<T>::AuctionEnded);
// Our range.
......@@ -373,7 +373,7 @@ impl<T: Config> Module<T> {
// Range as an array index.
let range_index = range as u8 as usize;
// The offset into the auction ending set.
let offset = Self::is_ending(frame_system::Module::<T>::block_number()).unwrap_or_default();
let offset = Self::is_ending(frame_system::Pallet::<T>::block_number()).unwrap_or_default();
// The current winning ranges.
let mut current_winning = Winning::<T>::get(offset)
.or_else(|| offset.checked_sub(&One::one()).and_then(Winning::<T>::get))
......@@ -601,9 +601,9 @@ mod tests {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Module, Call, Config, Storage, Event<T>},
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
Auctions: auctions::{Module, Call, Storage, Event<T>},
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
Auctions: auctions::{Pallet, Call, Storage, Event<T>},
}
);
......@@ -737,7 +737,7 @@ mod tests {
if let Some((output, known_since)) = &*p.borrow() {
(*output, *known_since)
} else {
(H256::zero(), frame_system::Module::<Test>::block_number())
(H256::zero(), frame_system::Pallet::<Test>::block_number())
}
})
}
......@@ -1323,7 +1323,7 @@ mod benchmarking {
use frame_benchmarking::{benchmarks, whitelisted_caller, account, impl_benchmark_test_suite};
fn assert_last_event<T: Config>(generic_event: <T as Config>::Event) {
let events = frame_system::Module::<T>::events();
let events = frame_system::Pallet::<T>::events();
let system_event: <T as frame_system::Config>::Event = generic_event.into();
// compare to the last event record
let frame_system::EventRecord { event, .. } = &events[events.len() - 1];
......@@ -1386,7 +1386,7 @@ mod benchmarking {
// Create a new auction
let duration: T::BlockNumber = 99u32.into();
let lease_period_index = LeasePeriodOf::<T>::zero();
let now = frame_system::Module::<T>::block_number();
let now = frame_system::Pallet::<T>::block_number();
Auctions::<T>::new_auction(RawOrigin::Root.into(), duration, lease_period_index)?;
let auction_index = AuctionCounter::get();
......@@ -1425,14 +1425,14 @@ mod benchmarking {
}
// Move ahead to the block we want to initialize
frame_system::Module::<T>::set_block_number(duration + now + T::EndingPeriod::get());
frame_system::Pallet::<T>::set_block_number(duration + now + T::EndingPeriod::get());
// Trigger epoch change for new random number value:
{
pallet_babe::Module::<T>::on_initialize(duration + now + T::EndingPeriod::get());
let authorities = pallet_babe::Module::<T>::authorities();
pallet_babe::Pallet::<T>::on_initialize(duration + now + T::EndingPeriod::get());
let authorities = pallet_babe::Pallet::<T>::authorities();
let next_authorities = authorities.clone();
pallet_babe::Module::<T>::enact_epoch_change(authorities, next_authorities);
pallet_babe::Pallet::<T>::enact_epoch_change(authorities, next_authorities);
}
}: {
......
......@@ -624,10 +624,10 @@ mod tests {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Module, Call, Config, Storage, Event<T>},
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
Vesting: pallet_vesting::{Module, Call, Storage, Config<T>, Event<T>},
Claims: claims::{Module, Call, Storage, Config<T>, Event<T>, ValidateUnsigned},
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
Vesting: pallet_vesting::{Pallet, Call, Storage, Config<T>, Event<T>},
Claims: claims::{Pallet, Call, Storage, Config<T>, Event<T>, ValidateUnsigned},
}
);
......
......@@ -312,7 +312,7 @@ decl_module! {
ensure!(first_slot <= last_slot, Error::<T>::LastSlotBeforeFirstSlot);
let last_slot_limit = first_slot.checked_add(&3u32.into()).ok_or(Error::<T>::FirstSlotTooFarInFuture)?;
ensure!(last_slot <= last_slot_limit, Error::<T>::LastSlotTooFarInFuture);
ensure!(end > <frame_system::Module<T>>::block_number(), Error::<T>::CannotEndInPast);
ensure!(end > <frame_system::Pallet<T>>::block_number(), Error::<T>::CannotEndInPast);
// There should not be an existing fund.
ensure!(!Funds::<T>::contains_key(index), Error::<T>::FundNotEnded);
......@@ -363,7 +363,7 @@ decl_module! {
ensure!(fund.raised <= fund.cap, Error::<T>::CapExceeded);
// Make sure crowdloan has not ended
let now = <frame_system::Module<T>>::block_number();
let now = <frame_system::Pallet<T>>::block_number();
ensure!(now < fund.end, Error::<T>::ContributionPeriodOver);
let old_balance = Self::contribution_get(fund.trie_index, &who);
......@@ -437,7 +437,7 @@ decl_module! {
let mut fund = Self::funds(index).ok_or(Error::<T>::InvalidParaId)?;
// `fund.end` can represent the end of a failed crowdsale or the beginning of retirement
let now = frame_system::Module::<T>::block_number();
let now = frame_system::Pallet::<T>::block_number();
let current_lease_period = T::Auctioneer::lease_period_index();
ensure!(now >= fund.end || current_lease_period > fund.last_slot, Error::<T>::FundNotEnded);
......@@ -471,7 +471,7 @@ decl_module! {
ensure_signed(origin)?;
let fund = Self::funds(index).ok_or(Error::<T>::InvalidParaId)?;
let now = frame_system::Module::<T>::block_number();
let now = frame_system::Pallet::<T>::block_number();
let dissolution = fund.end.saturating_add(T::RetirementPeriod::get());
ensure!((fund.retiring && now >= dissolution) || fund.raised.is_zero(), Error::<T>::NotReadyToDissolve);
......@@ -626,9 +626,9 @@ mod tests {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Module, Call, Config, Storage, Event<T>},
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
Crowdloan: crowdloan::{Module, Call, Storage, Event<T>},
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
Crowdloan: crowdloan::{Pallet, Call, Storage, Event<T>},
}
);
......@@ -1256,7 +1256,7 @@ mod benchmarking {
use frame_benchmarking::{benchmarks, whitelisted_caller, account, impl_benchmark_test_suite};
fn assert_last_event<T: Config>(generic_event: <T as Config>::Event) {
let events = frame_system::Module::<T>::events();
let events = frame_system::Pallet::<T>::events();
let system_event: <T as frame_system::Config>::Event = generic_event.into();
// compare to the last event record
let frame_system::EventRecord { event, .. } = &events[events.len() - 1];
......@@ -1350,7 +1350,7 @@ mod benchmarking {
let caller: T::AccountId = whitelisted_caller();
let contributor = account("contributor", 0, 0);
contribute_fund::<T>(&contributor, fund_index);
frame_system::Module::<T>::set_block_number(200u32.into());
frame_system::Pallet::<T>::set_block_number(200u32.into());
}: _(RawOrigin::Signed(caller), contributor.clone(), fund_index)
verify {
assert_last_event::<T>(RawEvent::Withdrew(contributor, fund_index, T::MinContribution::get()).into());
......@@ -1370,7 +1370,7 @@ mod benchmarking {
contribute_fund::<T>(&account("last_contributor", 0, 0), fund_index);
let caller: T::AccountId = whitelisted_caller();
frame_system::Module::<T>::set_block_number(T::BlockNumber::max_value());
frame_system::Pallet::<T>::set_block_number(T::BlockNumber::max_value());
Crowdloan::<T>::withdraw(
RawOrigin::Signed(caller.clone()).into(),
account("last_contributor", 0, 0),
......@@ -1404,7 +1404,7 @@ mod benchmarking {
let lease_period_index = T::Auctioneer::lease_period_index();
let duration = end_block
.checked_sub(&frame_system::Module::<T>::block_number())
.checked_sub(&frame_system::Pallet::<T>::block_number())
.ok_or("duration of auction less than zero")?;
T::Auctioneer::new_auction(duration, lease_period_index)?;
......
......@@ -31,8 +31,8 @@ where
fn on_nonzero_unbalanced(amount: NegativeImbalance<R>) {
let numeric_amount = amount.peek();
let author = <pallet_authorship::Module<R>>::author();
<pallet_balances::Module<R>>::resolve_creating(&<pallet_authorship::Module<R>>::author(), amount);
<frame_system::Module<R>>::deposit_event(pallet_balances::Event::Deposit(author, numeric_amount));
<pallet_balances::Pallet<R>>::resolve_creating(&<pallet_authorship::Module<R>>::author(), amount);
<frame_system::Pallet<R>>::deposit_event(pallet_balances::Event::Deposit(author, numeric_amount));
}
}
......@@ -84,9 +84,9 @@ mod tests {
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic,
{
System: frame_system::{Module, Call, Config, Storage, Event<T>},
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
Treasury: pallet_treasury::{Module, Call, Storage, Config, Event<T>},
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>},
}
);
......@@ -144,7 +144,7 @@ mod tests {
}
impl pallet_treasury::Config for Test {
type Currency = pallet_balances::Module<Test>;
type Currency = pallet_balances::Pallet<Test>;
type ApproveOrigin = frame_system::EnsureRoot<AccountId>;
type RejectOrigin = frame_system::EnsureRoot<AccountId>;
type Event = Event;
......
......@@ -59,19 +59,19 @@ frame_support::construct_runtime!(