Skip to content

Commit 24b4005

Browse files
authored
* BestParaHead small changes Signed-off-by: Serban Iorga <[email protected]> * Renamings Signed-off-by: Serban Iorga <[email protected]> * Use ParaInfo in parachains loop Signed-off-by: Serban Iorga <[email protected]> * Define StorageMapKeyProvider Signed-off-by: Serban Iorga <[email protected]> * CR fixes Signed-off-by: Serban Iorga <[email protected]>
1 parent db8d635 commit 24b4005

6 files changed

Lines changed: 188 additions & 111 deletions

File tree

modules/parachains/src/extension.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ where
5656
_ => return Ok(ValidTransaction::default()),
5757
};
5858

59-
let maybe_stored_best_head = crate::BestParaHeads::<T, I>::get(parachain);
59+
let maybe_stored_best_head = crate::ParasInfo::<T, I>::get(parachain);
6060
Self::validate_updated_parachain_head(
6161
parachain,
6262
&maybe_stored_best_head,
@@ -72,8 +72,9 @@ mod tests {
7272
use crate::{
7373
extension::FilterCall,
7474
mock::{run_test, Call, TestRuntime},
75-
BestParaHead, BestParaHeads, RelayBlockNumber,
75+
ParaInfo, ParasInfo, RelayBlockNumber,
7676
};
77+
use bp_parachains::BestParaHeadHash;
7778
use bp_polkadot_core::parachains::{ParaHash, ParaHeadsProof, ParaId};
7879

7980
fn validate_submit_parachain_heads(
@@ -91,11 +92,13 @@ mod tests {
9192
}
9293

9394
fn sync_to_relay_header_10() {
94-
BestParaHeads::<TestRuntime, ()>::insert(
95+
ParasInfo::<TestRuntime, ()>::insert(
9596
ParaId(1),
96-
BestParaHead {
97-
at_relay_block_number: 10,
98-
head_hash: [1u8; 32].into(),
97+
ParaInfo {
98+
best_head_hash: BestParaHeadHash {
99+
at_relay_block_number: 10,
100+
head_hash: [1u8; 32].into(),
101+
},
99102
next_imported_hash_position: 0,
100103
},
101104
);

0 commit comments

Comments
 (0)