mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 18:41:03 +00:00
Migrate some Pallets to Named Events (#5423)
* auctions * claims * registrar * Update purchase.rs * crowdloan * slots * comma
This commit is contained in:
@@ -122,19 +122,18 @@ pub mod pallet {
|
||||
#[pallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
pub enum Event<T: Config> {
|
||||
/// A new `[lease_period]` is beginning.
|
||||
NewLeasePeriod(LeasePeriodOf<T>),
|
||||
NewLeasePeriod { lease_period: LeasePeriodOf<T> },
|
||||
/// A para has won the right to a continuous set of lease periods as a parachain.
|
||||
/// First balance is any extra amount reserved on top of the para's existing deposit.
|
||||
/// Second balance is the total amount reserved.
|
||||
/// `[parachain_id, leaser, period_begin, period_count, extra_reserved, total_amount]`
|
||||
Leased(
|
||||
ParaId,
|
||||
T::AccountId,
|
||||
LeasePeriodOf<T>,
|
||||
LeasePeriodOf<T>,
|
||||
BalanceOf<T>,
|
||||
BalanceOf<T>,
|
||||
),
|
||||
Leased {
|
||||
para_id: ParaId,
|
||||
leaser: T::AccountId,
|
||||
period_begin: LeasePeriodOf<T>,
|
||||
period_count: LeasePeriodOf<T>,
|
||||
extra_reserved: BalanceOf<T>,
|
||||
total_amount: BalanceOf<T>,
|
||||
},
|
||||
}
|
||||
|
||||
#[pallet::error]
|
||||
@@ -228,7 +227,7 @@ impl<T: Config> Pallet<T> {
|
||||
/// We need to on-board and off-board parachains as needed. We should also handle reducing/
|
||||
/// returning deposits.
|
||||
fn manage_lease_period_start(lease_period_index: LeasePeriodOf<T>) -> Weight {
|
||||
Self::deposit_event(Event::<T>::NewLeasePeriod(lease_period_index));
|
||||
Self::deposit_event(Event::<T>::NewLeasePeriod { lease_period: lease_period_index });
|
||||
|
||||
let old_parachains = T::Registrar::parachains();
|
||||
|
||||
@@ -408,14 +407,14 @@ impl<T: Config> Leaser<T::BlockNumber> for Pallet<T> {
|
||||
let _ = T::Registrar::make_parachain(para);
|
||||
}
|
||||
|
||||
Self::deposit_event(Event::<T>::Leased(
|
||||
para,
|
||||
leaser.clone(),
|
||||
Self::deposit_event(Event::<T>::Leased {
|
||||
para_id: para,
|
||||
leaser: leaser.clone(),
|
||||
period_begin,
|
||||
period_count,
|
||||
reserved,
|
||||
amount,
|
||||
));
|
||||
extra_reserved: reserved,
|
||||
total_amount: amount,
|
||||
});
|
||||
|
||||
Ok(())
|
||||
})
|
||||
@@ -1027,7 +1026,13 @@ mod benchmarking {
|
||||
let period_count = 3u32.into();
|
||||
}: _(RawOrigin::Root, para, leaser.clone(), amount, period_begin, period_count)
|
||||
verify {
|
||||
assert_last_event::<T>(Event::<T>::Leased(para, leaser, period_begin, period_count, amount, amount).into());
|
||||
assert_last_event::<T>(Event::<T>::Leased {
|
||||
para_id: para,
|
||||
leaser, period_begin,
|
||||
period_count,
|
||||
extra_reserved: amount,
|
||||
total_amount: amount,
|
||||
}.into());
|
||||
}
|
||||
|
||||
// Worst case scenario, T parathreads onboard, and C parachains offboard.
|
||||
|
||||
Reference in New Issue
Block a user