Skip to content

Commit

Permalink
Remove some code
Browse files Browse the repository at this point in the history
  • Loading branch information
bkchr committed Dec 20, 2023
1 parent b80adc6 commit 2f97551
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions polkadot/runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1638,26 +1638,6 @@ pub mod migrations {
}
}

pub struct GetLegacyLeaseImpl;
impl coretime::migration::GetLegacyLease<BlockNumber> for GetLegacyLeaseImpl {
fn get_parachain_lease_in_blocks(para: ParaId) -> Option<BlockNumber> {
let now = frame_system::Pallet::<Runtime>::block_number();
let mut leases = slots::Pallet::<Runtime>::lease(para).into_iter();
let Some(Some(_)) = leases.next() else { return None };

let (_, progress) = slots::Pallet::<Runtime>::lease_period_index_plus_progress(now)?;
let initial_sum =
<Runtime as slots::Config>::LeasePeriod::get().saturating_sub(progress);

leases.into_iter().fold(Some(initial_sum), |sum, lease| {
if lease.is_none() {
return None
};
Some(sum? + <Runtime as slots::Config>::LeasePeriod::get())
})
}
}

/// Unreleased migrations. Add new ones here:
pub type Unreleased = (
parachains_configuration::migration::v7::MigrateToV7<Runtime>,
Expand Down

0 comments on commit 2f97551

Please sign in to comment.