diff --git a/bridges/modules/message-lane/rpc/src/lib.rs b/bridges/modules/message-lane/rpc/src/lib.rs index 28aeb66ab1..61a82eae7f 100644 --- a/bridges/modules/message-lane/rpc/src/lib.rs +++ b/bridges/modules/message-lane/rpc/src/lib.rs @@ -45,6 +45,8 @@ pub type MessagesDeliveryProof = Bytes; pub trait Runtime: Send + Sync + 'static { /// Return runtime storage key for given message. May return None if instance is unknown. fn message_key(&self, instance: &InstanceId, lane: &LaneId, nonce: MessageNonce) -> Option; + /// Return runtime storage key for outbound lane state. May return None if instance is unknown. + fn outbound_lane_data_key(&self, instance: &InstanceId, lane: &LaneId) -> Option; /// Return runtime storage key for inbound lane state. May return None if instance is unknown. fn inbound_lane_data_key(&self, instance: &InstanceId, lane: &LaneId) -> Option; } @@ -60,6 +62,7 @@ pub trait MessageLaneApi { lane: LaneId, begin: MessageNonce, end: MessageNonce, + include_outbound_lane_state: bool, block: Option, ) -> FutureResult; @@ -103,14 +106,22 @@ where lane: LaneId, begin: MessageNonce, end: MessageNonce, + include_outbound_lane_state: bool, block: Option, ) -> FutureResult { let runtime = self.runtime.clone(); + let outbound_lane_data_key = if include_outbound_lane_state { + Some(runtime.inbound_lane_data_key(&instance, &lane)) + } else { + None + }; Box::new( prove_keys_read( self.backend.clone(), block, - (begin..=end).map(move |nonce| runtime.message_key(&instance, &lane, nonce)), + (begin..=end) + .map(move |nonce| runtime.message_key(&instance, &lane, nonce)) + .chain(outbound_lane_data_key.into_iter()), ) .boxed() .compat()