Skip to content

Commit

Permalink
Follow-up on #1068 (#1567)
Browse files Browse the repository at this point in the history
* BestParaHead small changes

Signed-off-by: Serban Iorga <serban@parity.io>

* Renamings

Signed-off-by: Serban Iorga <serban@parity.io>

* Use ParaInfo in parachains loop

Signed-off-by: Serban Iorga <serban@parity.io>

* Define StorageMapKeyProvider

Signed-off-by: Serban Iorga <serban@parity.io>

* CR fixes

Signed-off-by: Serban Iorga <serban@parity.io>
  • Loading branch information
serban300 authored and bkchr committed Apr 10, 2024
1 parent 1c94fbe commit ad38cdb
Show file tree
Hide file tree
Showing 6 changed files with 188 additions and 111 deletions.
15 changes: 9 additions & 6 deletions bridges/modules/parachains/src/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ where
_ => return Ok(ValidTransaction::default()),
};

let maybe_stored_best_head = crate::BestParaHeads::<T, I>::get(parachain);
let maybe_stored_best_head = crate::ParasInfo::<T, I>::get(parachain);
Self::validate_updated_parachain_head(
parachain,
&maybe_stored_best_head,
Expand All @@ -72,8 +72,9 @@ mod tests {
use crate::{
extension::FilterCall,
mock::{run_test, Call, TestRuntime},
BestParaHead, BestParaHeads, RelayBlockNumber,
ParaInfo, ParasInfo, RelayBlockNumber,
};
use bp_parachains::BestParaHeadHash;
use bp_polkadot_core::parachains::{ParaHash, ParaHeadsProof, ParaId};

fn validate_submit_parachain_heads(
Expand All @@ -91,11 +92,13 @@ mod tests {
}

fn sync_to_relay_header_10() {
BestParaHeads::<TestRuntime, ()>::insert(
ParasInfo::<TestRuntime, ()>::insert(
ParaId(1),
BestParaHead {
at_relay_block_number: 10,
head_hash: [1u8; 32].into(),
ParaInfo {
best_head_hash: BestParaHeadHash {
at_relay_block_number: 10,
head_hash: [1u8; 32].into(),
},
next_imported_hash_position: 0,
},
);
Expand Down
Loading

0 comments on commit ad38cdb

Please sign in to comment.