|
23 | 23 | use bp_header_chain::HeaderChain; |
24 | 24 | use bp_messages::{ |
25 | 25 | source_chain::{FromBridgedChainMessagesDeliveryProof, TargetHeaderChain}, |
26 | | - target_chain::{ProvedLaneMessages, ProvedMessages, SourceHeaderChain}, |
| 26 | + target_chain::{ |
| 27 | + FromBridgedChainMessagesProof, ProvedLaneMessages, ProvedMessages, SourceHeaderChain, |
| 28 | + }, |
27 | 29 | InboundLaneData, LaneId, Message, MessageKey, MessageNonce, MessagePayload, OutboundLaneData, |
28 | 30 | VerificationError, |
29 | 31 | }; |
30 | 32 | pub use bp_runtime::{ |
31 | 33 | Chain, RangeInclusiveExt, RawStorageProof, Size, TrustedVecDb, UnderlyingChainOf, |
32 | 34 | UnderlyingChainProvider, UntrustedVecDb, |
33 | 35 | }; |
34 | | -use codec::{Decode, Encode}; |
35 | 36 | use frame_support::{traits::Get, weights::Weight}; |
36 | | -use scale_info::TypeInfo; |
37 | | -use sp_runtime::RuntimeDebug; |
38 | 37 | use sp_std::{marker::PhantomData, vec::Vec}; |
39 | 38 |
|
40 | 39 | /// Bidirectional message bridge. |
@@ -190,32 +189,6 @@ pub mod target { |
190 | 189 | /// Decoded Bridged -> This message payload. |
191 | 190 | pub type FromBridgedChainMessagePayload = crate::messages_xcm_extension::XcmAsPlainPayload; |
192 | 191 |
|
193 | | - /// Messages proof from bridged chain: |
194 | | - /// |
195 | | - /// - hash of finalized header; |
196 | | - /// - storage proof of messages and (optionally) outbound lane state; |
197 | | - /// - lane id; |
198 | | - /// - nonces (inclusive range) of messages which are included in this proof. |
199 | | - #[derive(Clone, Decode, Encode, Eq, PartialEq, RuntimeDebug, TypeInfo)] |
200 | | - pub struct FromBridgedChainMessagesProof<BridgedHeaderHash> { |
201 | | - /// Hash of the finalized bridged header the proof is for. |
202 | | - pub bridged_header_hash: BridgedHeaderHash, |
203 | | - /// The proved storage containing the messages being delivered. |
204 | | - pub storage: UntrustedVecDb, |
205 | | - /// Messages in this proof are sent over this lane. |
206 | | - pub lane: LaneId, |
207 | | - /// Nonce of the first message being delivered. |
208 | | - pub nonces_start: MessageNonce, |
209 | | - /// Nonce of the last message being delivered. |
210 | | - pub nonces_end: MessageNonce, |
211 | | - } |
212 | | - |
213 | | - impl<BridgedHeaderHash> Size for FromBridgedChainMessagesProof<BridgedHeaderHash> { |
214 | | - fn size(&self) -> u32 { |
215 | | - self.storage.size() |
216 | | - } |
217 | | - } |
218 | | - |
219 | 192 | /// Return maximal dispatch weight of the message we're able to receive. |
220 | 193 | pub fn maximal_incoming_message_dispatch_weight(maximal_extrinsic_weight: Weight) -> Weight { |
221 | 194 | maximal_extrinsic_weight / 2 |
@@ -342,7 +315,7 @@ pub mod target { |
342 | 315 | /// The `BridgeMessagesCall` used by a chain. |
343 | 316 | pub type BridgeMessagesCallOf<C> = bp_messages::BridgeMessagesCall< |
344 | 317 | bp_runtime::AccountIdOf<C>, |
345 | | - target::FromBridgedChainMessagesProof<bp_runtime::HashOf<C>>, |
| 318 | + FromBridgedChainMessagesProof<bp_runtime::HashOf<C>>, |
346 | 319 | bp_messages::source_chain::FromBridgedChainMessagesDeliveryProof<bp_runtime::HashOf<C>>, |
347 | 320 | >; |
348 | 321 |
|
@@ -400,7 +373,7 @@ mod tests { |
400 | 373 | encode_outbound_lane_data: impl Fn(&OutboundLaneData) -> Vec<u8>, |
401 | 374 | add_duplicate_key: bool, |
402 | 375 | add_unused_key: bool, |
403 | | - test: impl Fn(target::FromBridgedChainMessagesProof<H256>) -> R, |
| 376 | + test: impl Fn(FromBridgedChainMessagesProof<H256>) -> R, |
404 | 377 | ) -> R { |
405 | 378 | let (state_root, storage) = prepare_messages_storage_proof::<OnThisChainBridge>( |
406 | 379 | TEST_LANE_ID, |
@@ -432,7 +405,7 @@ mod tests { |
432 | 405 | bridged_header_hash, |
433 | 406 | bridged_header.build(), |
434 | 407 | ); |
435 | | - test(target::FromBridgedChainMessagesProof { |
| 408 | + test(FromBridgedChainMessagesProof { |
436 | 409 | bridged_header_hash, |
437 | 410 | storage, |
438 | 411 | lane: TEST_LANE_ID, |
|
0 commit comments