1919use crate :: Runtime ;
2020
2121use bp_messages:: {
22- source_chain:: { SenderOrigin , TargetHeaderChain } ,
22+ source_chain:: TargetHeaderChain ,
2323 target_chain:: { ProvedMessages , SourceHeaderChain } ,
2424 InboundLaneData , LaneId , Message , MessageNonce , Parameter as MessagesParameter ,
2525} ;
@@ -36,13 +36,6 @@ use scale_info::TypeInfo;
3636use sp_runtime:: { traits:: Saturating , FixedPointNumber , FixedU128 } ;
3737use sp_std:: convert:: TryFrom ;
3838
39- /// Identifier of RialtoParachain in the Rialto relay chain.
40- ///
41- /// This identifier is not something that is declared either by Rialto or RialtoParachain. This
42- /// is an identifier of registration. So in theory it may be changed. But since bridge is going
43- /// to be deployed after parachain registration AND since parachain de-registration is highly
44- /// likely impossible, it is fine to declare this constant here.
45- pub const RIALTO_PARACHAIN_ID : u32 = 2000 ;
4639/// Weight of 2 XCM instructions is for simple `Trap(42)` program, coming through bridge
4740/// (it is prepended with `UniversalOrigin` instruction). It is used just for simplest manual
4841/// tests, confirming that we don't break encoding somewhere between.
@@ -109,7 +102,7 @@ impl MessageBridge for WithRialtoParachainMessageBridge {
109102 bridged_to_this_conversion_rate_override : Option < FixedU128 > ,
110103 ) -> bp_millau:: Balance {
111104 let conversion_rate = bridged_to_this_conversion_rate_override
112- . unwrap_or_else ( || RialtoParachainToMillauConversionRate :: get ( ) ) ;
105+ . unwrap_or_else ( RialtoParachainToMillauConversionRate :: get) ;
113106 bp_millau:: Balance :: try_from ( conversion_rate. saturating_mul_int ( bridged_balance) )
114107 . unwrap_or ( bp_millau:: Balance :: MAX )
115108 }
@@ -132,8 +125,8 @@ impl messages::ThisChainWithMessages for Millau {
132125 type Call = crate :: Call ;
133126 type Origin = crate :: Origin ;
134127
135- fn is_message_accepted ( send_origin : & Self :: Origin , lane : & LaneId ) -> bool {
136- ( * lane == [ 0 , 0 , 0 , 0 ] || * lane == [ 0 , 0 , 0 , 1 ] ) && send_origin . linked_account ( ) . is_some ( )
128+ fn is_message_accepted ( _send_origin : & Self :: Origin , lane : & LaneId ) -> bool {
129+ * lane == [ 0 , 0 , 0 , 0 ] || * lane == [ 0 , 0 , 0 , 1 ]
137130 }
138131
139132 fn maximal_pending_messages_at_outbound_lane ( ) -> MessageNonce {
@@ -260,7 +253,7 @@ impl TargetHeaderChain<ToRialtoParachainMessagePayload, bp_rialto_parachain::Acc
260253 bp_rialto_parachain:: Header ,
261254 Runtime ,
262255 crate :: WitRialtoParachainsInstance ,
263- > ( ParaId ( RIALTO_PARACHAIN_ID ) , proof)
256+ > ( ParaId ( bp_rialto_parachain :: RIALTO_PARACHAIN_ID ) , proof)
264257 }
265258}
266259
@@ -282,7 +275,7 @@ impl SourceHeaderChain<bp_rialto_parachain::Balance> for RialtoParachain {
282275 bp_rialto_parachain:: Header ,
283276 Runtime ,
284277 crate :: WitRialtoParachainsInstance ,
285- > ( ParaId ( RIALTO_PARACHAIN_ID ) , proof, messages_count)
278+ > ( ParaId ( bp_rialto_parachain :: RIALTO_PARACHAIN_ID ) , proof, messages_count)
286279 }
287280}
288281
0 commit comments