@@ -30,7 +30,6 @@ mod weights;
30
30
pub mod xcm_config;
31
31
32
32
use bridge_common_config:: * ;
33
- use codec:: Decode ;
34
33
use constants:: currency:: * ;
35
34
use cumulus_pallet_parachain_system:: RelayNumberStrictlyIncreases ;
36
35
use sp_api:: impl_runtime_apis;
@@ -64,7 +63,7 @@ pub use sp_runtime::{MultiAddress, Perbill, Permill};
64
63
use xcm_config:: { XcmConfig , XcmOriginToTransactDispatchOrigin } ;
65
64
66
65
use bp_parachains:: SingleParaStoredHeaderDataBuilder ;
67
- use bp_runtime:: { HeaderId , HeaderIdProvider } ;
66
+ use bp_runtime:: HeaderId ;
68
67
69
68
#[ cfg( any( feature = "std" , test) ) ]
70
69
pub use sp_runtime:: BuildStorage ;
@@ -722,17 +721,17 @@ impl_runtime_apis! {
722
721
723
722
impl bp_bridge_hub_rococo:: BridgeHubRococoFinalityApi <Block > for Runtime {
724
723
fn best_finalized( ) -> Option <HeaderId <Hash , BlockNumber >> {
725
- let encoded_head = BridgeRococoParachain :: best_parachain_head ( bp_bridge_hub_rococo :: BRIDGE_HUB_ROCOCO_PARACHAIN_ID . into ( ) ) ? ;
726
- let head = bp_bridge_hub_rococo:: Header :: decode ( & mut & encoded_head . 0 [ .. ] ) . ok ( ) ? ;
727
- Some ( head . id ( ) )
724
+ BridgeRococoParachain :: best_parachain_head_id :: <
725
+ bp_bridge_hub_rococo:: BridgeHubRococo
726
+ > ( ) . unwrap_or ( None )
728
727
}
729
728
}
730
729
731
730
impl bp_bridge_hub_wococo:: BridgeHubWococoFinalityApi <Block > for Runtime {
732
731
fn best_finalized( ) -> Option <HeaderId <Hash , BlockNumber >> {
733
- let encoded_head = BridgeWococoParachain :: best_parachain_head ( bp_bridge_hub_wococo :: BRIDGE_HUB_WOCOCO_PARACHAIN_ID . into ( ) ) ? ;
734
- let head = bp_bridge_hub_wococo:: Header :: decode ( & mut & encoded_head . 0 [ .. ] ) . ok ( ) ? ;
735
- Some ( head . id ( ) )
732
+ BridgeWococoParachain :: best_parachain_head_id :: <
733
+ bp_bridge_hub_wococo:: BridgeHubWococo
734
+ > ( ) . unwrap_or ( None )
736
735
}
737
736
}
738
737
0 commit comments