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

Commit

Permalink
Fix BridgePalletIsNotInitialized (#2114)
Browse files Browse the repository at this point in the history
  • Loading branch information
serban300 authored Jan 19, 2023
1 parent b743f6c commit 7c1752c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
8 changes: 4 additions & 4 deletions parachains/runtimes/bridge-hubs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,20 @@ RUST_LOG=runtime=trace,rpc=trace,bridge=trace \
~/local_bridge_testing/bin/substrate-relay relay-headers-and-messages bridge-hub-rococo-bridge-hub-wococo \
--rococo-host localhost \
--rococo-port 9942 \
--rococo-version-mode Auto \
--rococo-version-mode Auto \
--bridge-hub-rococo-host localhost \
--bridge-hub-rococo-port 8943 \
--bridge-hub-rococo-version-mode Auto \
--bridge-hub-rococo-version-mode Auto \
--bridge-hub-rococo-signer //Charlie \
--wococo-headers-to-bridge-hub-rococo-signer //Bob \
--wococo-parachains-to-bridge-hub-rococo-signer //Bob \
--bridge-hub-rococo-transactions-mortality 4 \
--wococo-host localhost \
--wococo-port 9945 \
--wococo-version-mode Auto \
--wococo-version-mode Auto \
--bridge-hub-wococo-host localhost \
--bridge-hub-wococo-port 8945 \
--bridge-hub-wococo-version-mode Auto \
--bridge-hub-wococo-version-mode Auto \
--bridge-hub-wococo-signer //Charlie \
--rococo-headers-to-bridge-hub-wococo-signer //Bob \
--rococo-parachains-to-bridge-hub-wococo-signer //Bob \
Expand Down
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 7c1752c

Please sign in to comment.