Removed pallet::getter usage from Polkadot Runtime pallets (#3660)

Part of #3326 

@kianenigma @ggwpez 

polkadot address: 12poSUQPtcF1HUPQGY3zZu2P8emuW9YnsPduA4XG3oCEfJVp

---------

Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
Co-authored-by: ordian <write@reusable.software>
This commit is contained in:
Matteo Muraca
2024-04-10 10:35:10 +02:00
committed by GitHub
parent d96a97526e
commit 92e142555d
58 changed files with 834 additions and 820 deletions
+5 -3
View File
@@ -1199,9 +1199,11 @@ parameter_types! {
pub struct ParaHeadsRootProvider;
impl BeefyDataProvider<H256> for ParaHeadsRootProvider {
fn extra_data() -> H256 {
let mut para_heads: Vec<(u32, Vec<u8>)> = Paras::parachains()
let mut para_heads: Vec<(u32, Vec<u8>)> = parachains_paras::Parachains::<Runtime>::get()
.into_iter()
.filter_map(|id| Paras::para_head(&id).map(|head| (id.into(), head.0)))
.filter_map(|id| {
parachains_paras::Heads::<Runtime>::get(&id).map(|head| (id.into(), head.0))
})
.collect();
para_heads.sort();
binary_merkle_tree::merkle_root::<mmr::Hashing, _>(
@@ -1446,7 +1448,7 @@ pub mod migrations {
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 lease = slots::Pallet::<Runtime>::lease(para);
let lease = slots::Leases::<Runtime>::get(para);
if lease.is_empty() {
return None;
}