Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Fix BridgePalletIsNotInitialized
Browse files Browse the repository at this point in the history
  • Loading branch information
serban300 committed Jan 19, 2023
1 parent 30f2866 commit 279baaf
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ mod weights;
pub mod xcm_config;

use bridge_common_config::*;
use codec::Decode;
use constants::currency::*;
use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases;
use sp_api::impl_runtime_apis;
Expand Down Expand Up @@ -64,7 +63,7 @@ pub use sp_runtime::{MultiAddress, Perbill, Permill};
use xcm_config::{XcmConfig, XcmOriginToTransactDispatchOrigin};

use bp_parachains::SingleParaStoredHeaderDataBuilder;
use bp_runtime::{HeaderId, HeaderIdProvider};
use bp_runtime::HeaderId;

#[cfg(any(feature = "std", test))]
pub use sp_runtime::BuildStorage;
Expand Down Expand Up @@ -722,17 +721,17 @@ impl_runtime_apis! {

impl bp_bridge_hub_rococo::BridgeHubRococoFinalityApi<Block> for Runtime {
fn best_finalized() -> Option<HeaderId<Hash, BlockNumber>> {
let encoded_head = BridgeRococoParachain::best_parachain_head(bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_PARACHAIN_ID.into())?;
let head = bp_bridge_hub_rococo::Header::decode(&mut &encoded_head.0[..]).ok()?;
Some(head.id())
BridgeRococoParachain::best_parachain_head_id::<
bp_bridge_hub_rococo::BridgeHubRococo
>().unwrap_or(None)
}
}

impl bp_bridge_hub_wococo::BridgeHubWococoFinalityApi<Block> for Runtime {
fn best_finalized() -> Option<HeaderId<Hash, BlockNumber>> {
let encoded_head = BridgeWococoParachain::best_parachain_head(bp_bridge_hub_wococo::BRIDGE_HUB_WOCOCO_PARACHAIN_ID.into())?;
let head = bp_bridge_hub_wococo::Header::decode(&mut &encoded_head.0[..]).ok()?;
Some(head.id())
BridgeWococoParachain::best_parachain_head_id::<
bp_bridge_hub_wococo::BridgeHubWococo
>().unwrap_or(None)
}
}

Expand Down

0 comments on commit 279baaf

Please sign in to comment.