diff --git a/parachains/runtimes/bridge-hubs/README.md b/parachains/runtimes/bridge-hubs/README.md index a39d6e8dc91..f6adc67dabe 100644 --- a/parachains/runtimes/bridge-hubs/README.md +++ b/parachains/runtimes/bridge-hubs/README.md @@ -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 \ diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 12dbd4f869a..3609585c827 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -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; @@ -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; @@ -722,17 +721,17 @@ impl_runtime_apis! { impl bp_bridge_hub_rococo::BridgeHubRococoFinalityApi for Runtime { fn best_finalized() -> Option> { - 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 for Runtime { fn best_finalized() -> Option> { - 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) } }