19
19
#![ cfg_attr( not( feature = "std" ) , no_std) ]
20
20
21
21
use codec:: { Decode , Encode } ;
22
- use frame_support:: weights:: Weight ;
23
22
use sp_runtime:: { traits:: Block as BlockT , RuntimeDebug } ;
24
23
use sp_std:: prelude:: * ;
25
24
26
25
pub use polkadot_core_primitives:: InboundDownwardMessage ;
27
- pub use polkadot_parachain:: primitives:: { Id as ParaId , UpwardMessage , ValidationParams } ;
26
+ pub use polkadot_parachain:: primitives:: {
27
+ DmpMessageHandler , Id as ParaId , UpwardMessage , ValidationParams , XcmpMessageFormat ,
28
+ XcmpMessageHandler ,
29
+ } ;
28
30
pub use polkadot_primitives:: v1:: {
29
31
AbridgedHostConfiguration , AbridgedHrmpChannel , PersistedValidationData ,
30
32
} ;
@@ -34,7 +36,6 @@ pub mod relay_chain {
34
36
pub use polkadot_core_primitives:: * ;
35
37
pub use polkadot_primitives:: { v1, v1:: well_known_keys} ;
36
38
}
37
- use relay_chain:: BlockNumber as RelayBlockNumber ;
38
39
39
40
/// An inbound HRMP message.
40
41
pub type InboundHrmpMessage = polkadot_primitives:: v1:: InboundHrmpMessage < relay_chain:: BlockNumber > ;
@@ -88,47 +89,6 @@ pub trait GetChannelInfo {
88
89
fn get_channel_max ( id : ParaId ) -> Option < usize > ;
89
90
}
90
91
91
- /// Something that should be called when a downward message is received.
92
- pub trait DmpMessageHandler {
93
- /// Handle some incoming DMP messages (note these are individual XCM messages).
94
- ///
95
- /// Also, process messages up to some `max_weight`.
96
- fn handle_dmp_messages (
97
- iter : impl Iterator < Item = ( RelayBlockNumber , Vec < u8 > ) > ,
98
- max_weight : Weight ,
99
- ) -> Weight ;
100
- }
101
- impl DmpMessageHandler for ( ) {
102
- fn handle_dmp_messages (
103
- iter : impl Iterator < Item = ( RelayBlockNumber , Vec < u8 > ) > ,
104
- _max_weight : Weight ,
105
- ) -> Weight {
106
- iter. for_each ( drop) ;
107
- 0
108
- }
109
- }
110
-
111
- /// Something that should be called for each batch of messages received over XCMP.
112
- pub trait XcmpMessageHandler {
113
- /// Handle some incoming XCMP messages (note these are the big one-per-block aggregate
114
- /// messages).
115
- ///
116
- /// Also, process messages up to some `max_weight`.
117
- fn handle_xcmp_messages < ' a , I : Iterator < Item = ( ParaId , RelayBlockNumber , & ' a [ u8 ] ) > > (
118
- iter : I ,
119
- max_weight : Weight ,
120
- ) -> Weight ;
121
- }
122
- impl XcmpMessageHandler for ( ) {
123
- fn handle_xcmp_messages < ' a , I : Iterator < Item = ( ParaId , RelayBlockNumber , & ' a [ u8 ] ) > > (
124
- iter : I ,
125
- _max_weight : Weight ,
126
- ) -> Weight {
127
- for _ in iter { }
128
- 0
129
- }
130
- }
131
-
132
92
/// Something that should be called when sending an upward message.
133
93
pub trait UpwardMessageSender {
134
94
/// Send the given UMP message; return the expected number of blocks before the message will
0 commit comments