mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 11:41:02 +00:00
read latest_generated_nonce directly from storage (#1260)
This commit is contained in:
committed by
Bastian Köcher
parent
741484214e
commit
c21217a282
@@ -768,10 +768,6 @@ impl_runtime_apis! {
|
|||||||
fn latest_received_nonce(lane: bp_messages::LaneId) -> bp_messages::MessageNonce {
|
fn latest_received_nonce(lane: bp_messages::LaneId) -> bp_messages::MessageNonce {
|
||||||
BridgeRialtoMessages::outbound_latest_received_nonce(lane)
|
BridgeRialtoMessages::outbound_latest_received_nonce(lane)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn latest_generated_nonce(lane: bp_messages::LaneId) -> bp_messages::MessageNonce {
|
|
||||||
BridgeRialtoMessages::outbound_latest_generated_nonce(lane)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl bp_rialto::FromRialtoInboundLaneApi<Block> for Runtime {
|
impl bp_rialto::FromRialtoInboundLaneApi<Block> for Runtime {
|
||||||
|
|||||||
@@ -916,10 +916,6 @@ impl_runtime_apis! {
|
|||||||
fn latest_received_nonce(lane: bp_messages::LaneId) -> bp_messages::MessageNonce {
|
fn latest_received_nonce(lane: bp_messages::LaneId) -> bp_messages::MessageNonce {
|
||||||
BridgeMillauMessages::outbound_latest_received_nonce(lane)
|
BridgeMillauMessages::outbound_latest_received_nonce(lane)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn latest_generated_nonce(lane: bp_messages::LaneId) -> bp_messages::MessageNonce {
|
|
||||||
BridgeMillauMessages::outbound_latest_generated_nonce(lane)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl bp_millau::FromMillauInboundLaneApi<Block> for Runtime {
|
impl bp_millau::FromMillauInboundLaneApi<Block> for Runtime {
|
||||||
|
|||||||
@@ -98,9 +98,6 @@ pub const TO_KUSAMA_ESTIMATE_MESSAGE_FEE_METHOD: &str =
|
|||||||
"ToKusamaOutboundLaneApi_estimate_message_delivery_and_dispatch_fee";
|
"ToKusamaOutboundLaneApi_estimate_message_delivery_and_dispatch_fee";
|
||||||
/// Name of the `ToKusamaOutboundLaneApi::message_details` runtime method.
|
/// Name of the `ToKusamaOutboundLaneApi::message_details` runtime method.
|
||||||
pub const TO_KUSAMA_MESSAGE_DETAILS_METHOD: &str = "ToKusamaOutboundLaneApi_message_details";
|
pub const TO_KUSAMA_MESSAGE_DETAILS_METHOD: &str = "ToKusamaOutboundLaneApi_message_details";
|
||||||
/// Name of the `ToKusamaOutboundLaneApi::latest_generated_nonce` runtime method.
|
|
||||||
pub const TO_KUSAMA_LATEST_GENERATED_NONCE_METHOD: &str =
|
|
||||||
"ToKusamaOutboundLaneApi_latest_generated_nonce";
|
|
||||||
/// Name of the `ToKusamaOutboundLaneApi::latest_received_nonce` runtime method.
|
/// Name of the `ToKusamaOutboundLaneApi::latest_received_nonce` runtime method.
|
||||||
pub const TO_KUSAMA_LATEST_RECEIVED_NONCE_METHOD: &str =
|
pub const TO_KUSAMA_LATEST_RECEIVED_NONCE_METHOD: &str =
|
||||||
"ToKusamaOutboundLaneApi_latest_received_nonce";
|
"ToKusamaOutboundLaneApi_latest_received_nonce";
|
||||||
@@ -156,8 +153,6 @@ sp_api::decl_runtime_apis! {
|
|||||||
) -> Vec<MessageDetails<OutboundMessageFee>>;
|
) -> Vec<MessageDetails<OutboundMessageFee>>;
|
||||||
/// Returns nonce of the latest message, received by bridged chain.
|
/// Returns nonce of the latest message, received by bridged chain.
|
||||||
fn latest_received_nonce(lane: LaneId) -> MessageNonce;
|
fn latest_received_nonce(lane: LaneId) -> MessageNonce;
|
||||||
/// Returns nonce of the latest message, generated by given lane.
|
|
||||||
fn latest_generated_nonce(lane: LaneId) -> MessageNonce;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Inbound message lane API for messages sent by Kusama chain.
|
/// Inbound message lane API for messages sent by Kusama chain.
|
||||||
|
|||||||
@@ -278,9 +278,6 @@ pub const TO_MILLAU_MESSAGE_DETAILS_METHOD: &str = "ToMillauOutboundLaneApi_mess
|
|||||||
/// Name of the `ToMillauOutboundLaneApi::latest_received_nonce` runtime method.
|
/// Name of the `ToMillauOutboundLaneApi::latest_received_nonce` runtime method.
|
||||||
pub const TO_MILLAU_LATEST_RECEIVED_NONCE_METHOD: &str =
|
pub const TO_MILLAU_LATEST_RECEIVED_NONCE_METHOD: &str =
|
||||||
"ToMillauOutboundLaneApi_latest_received_nonce";
|
"ToMillauOutboundLaneApi_latest_received_nonce";
|
||||||
/// Name of the `ToMillauOutboundLaneApi::latest_generated_nonce` runtime method.
|
|
||||||
pub const TO_MILLAU_LATEST_GENERATED_NONCE_METHOD: &str =
|
|
||||||
"ToMillauOutboundLaneApi_latest_generated_nonce";
|
|
||||||
|
|
||||||
/// Name of the `FromMillauInboundLaneApi::latest_received_nonce` runtime method.
|
/// Name of the `FromMillauInboundLaneApi::latest_received_nonce` runtime method.
|
||||||
pub const FROM_MILLAU_LATEST_RECEIVED_NONCE_METHOD: &str =
|
pub const FROM_MILLAU_LATEST_RECEIVED_NONCE_METHOD: &str =
|
||||||
@@ -333,8 +330,6 @@ sp_api::decl_runtime_apis! {
|
|||||||
) -> Vec<MessageDetails<OutboundMessageFee>>;
|
) -> Vec<MessageDetails<OutboundMessageFee>>;
|
||||||
/// Returns nonce of the latest message, received by bridged chain.
|
/// Returns nonce of the latest message, received by bridged chain.
|
||||||
fn latest_received_nonce(lane: LaneId) -> MessageNonce;
|
fn latest_received_nonce(lane: LaneId) -> MessageNonce;
|
||||||
/// Returns nonce of the latest message, generated by given lane.
|
|
||||||
fn latest_generated_nonce(lane: LaneId) -> MessageNonce;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Inbound message lane API for messages sent by Millau chain.
|
/// Inbound message lane API for messages sent by Millau chain.
|
||||||
|
|||||||
@@ -98,9 +98,6 @@ pub const TO_POLKADOT_ESTIMATE_MESSAGE_FEE_METHOD: &str =
|
|||||||
"ToPolkadotOutboundLaneApi_estimate_message_delivery_and_dispatch_fee";
|
"ToPolkadotOutboundLaneApi_estimate_message_delivery_and_dispatch_fee";
|
||||||
/// Name of the `ToPolkadotOutboundLaneApi::message_details` runtime method.
|
/// Name of the `ToPolkadotOutboundLaneApi::message_details` runtime method.
|
||||||
pub const TO_POLKADOT_MESSAGE_DETAILS_METHOD: &str = "ToPolkadotOutboundLaneApi_message_details";
|
pub const TO_POLKADOT_MESSAGE_DETAILS_METHOD: &str = "ToPolkadotOutboundLaneApi_message_details";
|
||||||
/// Name of the `ToPolkadotOutboundLaneApi::latest_generated_nonce` runtime method.
|
|
||||||
pub const TO_POLKADOT_LATEST_GENERATED_NONCE_METHOD: &str =
|
|
||||||
"ToPolkadotOutboundLaneApi_latest_generated_nonce";
|
|
||||||
/// Name of the `ToPolkadotOutboundLaneApi::latest_received_nonce` runtime method.
|
/// Name of the `ToPolkadotOutboundLaneApi::latest_received_nonce` runtime method.
|
||||||
pub const TO_POLKADOT_LATEST_RECEIVED_NONCE_METHOD: &str =
|
pub const TO_POLKADOT_LATEST_RECEIVED_NONCE_METHOD: &str =
|
||||||
"ToPolkadotOutboundLaneApi_latest_received_nonce";
|
"ToPolkadotOutboundLaneApi_latest_received_nonce";
|
||||||
@@ -156,8 +153,6 @@ sp_api::decl_runtime_apis! {
|
|||||||
) -> Vec<MessageDetails<OutboundMessageFee>>;
|
) -> Vec<MessageDetails<OutboundMessageFee>>;
|
||||||
/// Returns nonce of the latest message, received by bridged chain.
|
/// Returns nonce of the latest message, received by bridged chain.
|
||||||
fn latest_received_nonce(lane: LaneId) -> MessageNonce;
|
fn latest_received_nonce(lane: LaneId) -> MessageNonce;
|
||||||
/// Returns nonce of the latest message, generated by given lane.
|
|
||||||
fn latest_generated_nonce(lane: LaneId) -> MessageNonce;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Inbound message lane API for messages sent by Polkadot chain.
|
/// Inbound message lane API for messages sent by Polkadot chain.
|
||||||
|
|||||||
@@ -247,9 +247,6 @@ pub const TO_RIALTO_ESTIMATE_MESSAGE_FEE_METHOD: &str =
|
|||||||
"ToRialtoOutboundLaneApi_estimate_message_delivery_and_dispatch_fee";
|
"ToRialtoOutboundLaneApi_estimate_message_delivery_and_dispatch_fee";
|
||||||
/// Name of the `ToRialtoOutboundLaneApi::message_details` runtime method.
|
/// Name of the `ToRialtoOutboundLaneApi::message_details` runtime method.
|
||||||
pub const TO_RIALTO_MESSAGE_DETAILS_METHOD: &str = "ToRialtoOutboundLaneApi_message_details";
|
pub const TO_RIALTO_MESSAGE_DETAILS_METHOD: &str = "ToRialtoOutboundLaneApi_message_details";
|
||||||
/// Name of the `ToRialtoOutboundLaneApi::latest_generated_nonce` runtime method.
|
|
||||||
pub const TO_RIALTO_LATEST_GENERATED_NONCE_METHOD: &str =
|
|
||||||
"ToRialtoOutboundLaneApi_latest_generated_nonce";
|
|
||||||
/// Name of the `ToRialtoOutboundLaneApi::latest_received_nonce` runtime method.
|
/// Name of the `ToRialtoOutboundLaneApi::latest_received_nonce` runtime method.
|
||||||
pub const TO_RIALTO_LATEST_RECEIVED_NONCE_METHOD: &str =
|
pub const TO_RIALTO_LATEST_RECEIVED_NONCE_METHOD: &str =
|
||||||
"ToRialtoOutboundLaneApi_latest_received_nonce";
|
"ToRialtoOutboundLaneApi_latest_received_nonce";
|
||||||
@@ -305,8 +302,6 @@ sp_api::decl_runtime_apis! {
|
|||||||
) -> Vec<MessageDetails<OutboundMessageFee>>;
|
) -> Vec<MessageDetails<OutboundMessageFee>>;
|
||||||
/// Returns nonce of the latest message, received by bridged chain.
|
/// Returns nonce of the latest message, received by bridged chain.
|
||||||
fn latest_received_nonce(lane: LaneId) -> MessageNonce;
|
fn latest_received_nonce(lane: LaneId) -> MessageNonce;
|
||||||
/// Returns nonce of the latest message, generated by given lane.
|
|
||||||
fn latest_generated_nonce(lane: LaneId) -> MessageNonce;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Inbound message lane API for messages sent by Rialto chain.
|
/// Inbound message lane API for messages sent by Rialto chain.
|
||||||
|
|||||||
@@ -87,9 +87,6 @@ pub const TO_ROCOCO_ESTIMATE_MESSAGE_FEE_METHOD: &str =
|
|||||||
"ToRococoOutboundLaneApi_estimate_message_delivery_and_dispatch_fee";
|
"ToRococoOutboundLaneApi_estimate_message_delivery_and_dispatch_fee";
|
||||||
/// Name of the `ToRococoOutboundLaneApi::message_details` runtime method.
|
/// Name of the `ToRococoOutboundLaneApi::message_details` runtime method.
|
||||||
pub const TO_ROCOCO_MESSAGE_DETAILS_METHOD: &str = "ToRococoOutboundLaneApi_message_details";
|
pub const TO_ROCOCO_MESSAGE_DETAILS_METHOD: &str = "ToRococoOutboundLaneApi_message_details";
|
||||||
/// Name of the `ToRococoOutboundLaneApi::latest_generated_nonce` runtime method.
|
|
||||||
pub const TO_ROCOCO_LATEST_GENERATED_NONCE_METHOD: &str =
|
|
||||||
"ToRococoOutboundLaneApi_latest_generated_nonce";
|
|
||||||
/// Name of the `ToRococoOutboundLaneApi::latest_received_nonce` runtime method.
|
/// Name of the `ToRococoOutboundLaneApi::latest_received_nonce` runtime method.
|
||||||
pub const TO_ROCOCO_LATEST_RECEIVED_NONCE_METHOD: &str =
|
pub const TO_ROCOCO_LATEST_RECEIVED_NONCE_METHOD: &str =
|
||||||
"ToRococoOutboundLaneApi_latest_received_nonce";
|
"ToRococoOutboundLaneApi_latest_received_nonce";
|
||||||
@@ -157,8 +154,6 @@ sp_api::decl_runtime_apis! {
|
|||||||
) -> Vec<MessageDetails<OutboundMessageFee>>;
|
) -> Vec<MessageDetails<OutboundMessageFee>>;
|
||||||
/// Returns nonce of the latest message, received by bridged chain.
|
/// Returns nonce of the latest message, received by bridged chain.
|
||||||
fn latest_received_nonce(lane: LaneId) -> MessageNonce;
|
fn latest_received_nonce(lane: LaneId) -> MessageNonce;
|
||||||
/// Returns nonce of the latest message, generated by given lane.
|
|
||||||
fn latest_generated_nonce(lane: LaneId) -> MessageNonce;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Inbound message lane API for messages sent by Rococo chain.
|
/// Inbound message lane API for messages sent by Rococo chain.
|
||||||
|
|||||||
@@ -90,29 +90,6 @@ pub fn derive_account_from_rococo_id(id: bp_runtime::SourceAccount<AccountId>) -
|
|||||||
/// Name of the `WestendFinalityApi::best_finalized` runtime method.
|
/// Name of the `WestendFinalityApi::best_finalized` runtime method.
|
||||||
pub const BEST_FINALIZED_WESTEND_HEADER_METHOD: &str = "WestendFinalityApi_best_finalized";
|
pub const BEST_FINALIZED_WESTEND_HEADER_METHOD: &str = "WestendFinalityApi_best_finalized";
|
||||||
|
|
||||||
/// Name of the `ToWestendOutboundLaneApi::estimate_message_delivery_and_dispatch_fee` runtime
|
|
||||||
/// method.
|
|
||||||
pub const TO_WESTEND_ESTIMATE_MESSAGE_FEE_METHOD: &str =
|
|
||||||
"ToWestendOutboundLaneApi_estimate_message_delivery_and_dispatch_fee";
|
|
||||||
/// Name of the `ToWestendOutboundLaneApi::message_details` runtime method.
|
|
||||||
pub const TO_WESTEND_MESSAGE_DETAILS_METHOD: &str = "ToWestendOutboundLaneApi_message_details";
|
|
||||||
/// Name of the `ToWestendOutboundLaneApi::latest_generated_nonce` runtime method.
|
|
||||||
pub const TO_WESTEND_LATEST_GENERATED_NONCE_METHOD: &str =
|
|
||||||
"ToWestendOutboundLaneApi_latest_generated_nonce";
|
|
||||||
/// Name of the `ToWestendOutboundLaneApi::latest_received_nonce` runtime method.
|
|
||||||
pub const TO_WESTEND_LATEST_RECEIVED_NONCE_METHOD: &str =
|
|
||||||
"ToWestendOutboundLaneApi_latest_received_nonce";
|
|
||||||
|
|
||||||
/// Name of the `FromWestendInboundLaneApi::latest_received_nonce` runtime method.
|
|
||||||
pub const FROM_WESTEND_LATEST_RECEIVED_NONCE_METHOD: &str =
|
|
||||||
"FromWestendInboundLaneApi_latest_received_nonce";
|
|
||||||
/// Name of the `FromWestendInboundLaneApi::latest_onfirmed_nonce` runtime method.
|
|
||||||
pub const FROM_WESTEND_LATEST_CONFIRMED_NONCE_METHOD: &str =
|
|
||||||
"FromWestendInboundLaneApi_latest_confirmed_nonce";
|
|
||||||
/// Name of the `FromWestendInboundLaneApi::unrewarded_relayers_state` runtime method.
|
|
||||||
pub const FROM_WESTEND_UNREWARDED_RELAYERS_STATE: &str =
|
|
||||||
"FromWestendInboundLaneApi_unrewarded_relayers_state";
|
|
||||||
|
|
||||||
/// The target length of a session (how often authorities change) on Westend measured in of number
|
/// The target length of a session (how often authorities change) on Westend measured in of number
|
||||||
/// of blocks.
|
/// of blocks.
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -52,9 +52,6 @@ pub const TO_WOCOCO_ESTIMATE_MESSAGE_FEE_METHOD: &str =
|
|||||||
"ToWococoOutboundLaneApi_estimate_message_delivery_and_dispatch_fee";
|
"ToWococoOutboundLaneApi_estimate_message_delivery_and_dispatch_fee";
|
||||||
/// Name of the `ToWococoOutboundLaneApi::message_details` runtime method.
|
/// Name of the `ToWococoOutboundLaneApi::message_details` runtime method.
|
||||||
pub const TO_WOCOCO_MESSAGE_DETAILS_METHOD: &str = "ToWococoOutboundLaneApi_message_details";
|
pub const TO_WOCOCO_MESSAGE_DETAILS_METHOD: &str = "ToWococoOutboundLaneApi_message_details";
|
||||||
/// Name of the `ToWococoOutboundLaneApi::latest_generated_nonce` runtime method.
|
|
||||||
pub const TO_WOCOCO_LATEST_GENERATED_NONCE_METHOD: &str =
|
|
||||||
"ToWococoOutboundLaneApi_latest_generated_nonce";
|
|
||||||
/// Name of the `ToWococoOutboundLaneApi::latest_received_nonce` runtime method.
|
/// Name of the `ToWococoOutboundLaneApi::latest_received_nonce` runtime method.
|
||||||
pub const TO_WOCOCO_LATEST_RECEIVED_NONCE_METHOD: &str =
|
pub const TO_WOCOCO_LATEST_RECEIVED_NONCE_METHOD: &str =
|
||||||
"ToWococoOutboundLaneApi_latest_received_nonce";
|
"ToWococoOutboundLaneApi_latest_received_nonce";
|
||||||
@@ -110,8 +107,6 @@ sp_api::decl_runtime_apis! {
|
|||||||
) -> Vec<MessageDetails<OutboundMessageFee>>;
|
) -> Vec<MessageDetails<OutboundMessageFee>>;
|
||||||
/// Returns nonce of the latest message, received by bridged chain.
|
/// Returns nonce of the latest message, received by bridged chain.
|
||||||
fn latest_received_nonce(lane: LaneId) -> MessageNonce;
|
fn latest_received_nonce(lane: LaneId) -> MessageNonce;
|
||||||
/// Returns nonce of the latest message, generated by given lane.
|
|
||||||
fn latest_generated_nonce(lane: LaneId) -> MessageNonce;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Inbound message lane API for messages sent by Wococo chain.
|
/// Inbound message lane API for messages sent by Wococo chain.
|
||||||
|
|||||||
@@ -75,8 +75,6 @@ impl ChainWithMessages for Kusama {
|
|||||||
bp_kusama::WITH_KUSAMA_MESSAGES_PALLET_NAME;
|
bp_kusama::WITH_KUSAMA_MESSAGES_PALLET_NAME;
|
||||||
const TO_CHAIN_MESSAGE_DETAILS_METHOD: &'static str =
|
const TO_CHAIN_MESSAGE_DETAILS_METHOD: &'static str =
|
||||||
bp_kusama::TO_KUSAMA_MESSAGE_DETAILS_METHOD;
|
bp_kusama::TO_KUSAMA_MESSAGE_DETAILS_METHOD;
|
||||||
const TO_CHAIN_LATEST_GENERATED_NONCE_METHOD: &'static str =
|
|
||||||
bp_kusama::TO_KUSAMA_LATEST_GENERATED_NONCE_METHOD;
|
|
||||||
const TO_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
const TO_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
||||||
bp_kusama::TO_KUSAMA_LATEST_RECEIVED_NONCE_METHOD;
|
bp_kusama::TO_KUSAMA_LATEST_RECEIVED_NONCE_METHOD;
|
||||||
const FROM_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
const FROM_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
||||||
|
|||||||
@@ -59,8 +59,6 @@ impl ChainWithMessages for Millau {
|
|||||||
bp_millau::WITH_MILLAU_MESSAGES_PALLET_NAME;
|
bp_millau::WITH_MILLAU_MESSAGES_PALLET_NAME;
|
||||||
const TO_CHAIN_MESSAGE_DETAILS_METHOD: &'static str =
|
const TO_CHAIN_MESSAGE_DETAILS_METHOD: &'static str =
|
||||||
bp_millau::TO_MILLAU_MESSAGE_DETAILS_METHOD;
|
bp_millau::TO_MILLAU_MESSAGE_DETAILS_METHOD;
|
||||||
const TO_CHAIN_LATEST_GENERATED_NONCE_METHOD: &'static str =
|
|
||||||
bp_millau::TO_MILLAU_LATEST_GENERATED_NONCE_METHOD;
|
|
||||||
const TO_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
const TO_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
||||||
bp_millau::TO_MILLAU_LATEST_RECEIVED_NONCE_METHOD;
|
bp_millau::TO_MILLAU_LATEST_RECEIVED_NONCE_METHOD;
|
||||||
const FROM_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
const FROM_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
||||||
|
|||||||
@@ -75,8 +75,6 @@ impl ChainWithMessages for Polkadot {
|
|||||||
bp_polkadot::WITH_POLKADOT_MESSAGES_PALLET_NAME;
|
bp_polkadot::WITH_POLKADOT_MESSAGES_PALLET_NAME;
|
||||||
const TO_CHAIN_MESSAGE_DETAILS_METHOD: &'static str =
|
const TO_CHAIN_MESSAGE_DETAILS_METHOD: &'static str =
|
||||||
bp_polkadot::TO_POLKADOT_MESSAGE_DETAILS_METHOD;
|
bp_polkadot::TO_POLKADOT_MESSAGE_DETAILS_METHOD;
|
||||||
const TO_CHAIN_LATEST_GENERATED_NONCE_METHOD: &'static str =
|
|
||||||
bp_polkadot::TO_POLKADOT_LATEST_GENERATED_NONCE_METHOD;
|
|
||||||
const TO_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
const TO_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
||||||
bp_polkadot::TO_POLKADOT_LATEST_RECEIVED_NONCE_METHOD;
|
bp_polkadot::TO_POLKADOT_LATEST_RECEIVED_NONCE_METHOD;
|
||||||
const FROM_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
const FROM_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
||||||
|
|||||||
@@ -74,8 +74,6 @@ impl ChainWithMessages for Rialto {
|
|||||||
bp_rialto::WITH_RIALTO_MESSAGES_PALLET_NAME;
|
bp_rialto::WITH_RIALTO_MESSAGES_PALLET_NAME;
|
||||||
const TO_CHAIN_MESSAGE_DETAILS_METHOD: &'static str =
|
const TO_CHAIN_MESSAGE_DETAILS_METHOD: &'static str =
|
||||||
bp_rialto::TO_RIALTO_MESSAGE_DETAILS_METHOD;
|
bp_rialto::TO_RIALTO_MESSAGE_DETAILS_METHOD;
|
||||||
const TO_CHAIN_LATEST_GENERATED_NONCE_METHOD: &'static str =
|
|
||||||
bp_rialto::TO_RIALTO_LATEST_GENERATED_NONCE_METHOD;
|
|
||||||
const TO_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
const TO_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
||||||
bp_rialto::TO_RIALTO_LATEST_RECEIVED_NONCE_METHOD;
|
bp_rialto::TO_RIALTO_LATEST_RECEIVED_NONCE_METHOD;
|
||||||
const FROM_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
const FROM_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
||||||
|
|||||||
@@ -78,8 +78,6 @@ impl ChainWithMessages for Rococo {
|
|||||||
bp_rococo::WITH_ROCOCO_MESSAGES_PALLET_NAME;
|
bp_rococo::WITH_ROCOCO_MESSAGES_PALLET_NAME;
|
||||||
const TO_CHAIN_MESSAGE_DETAILS_METHOD: &'static str =
|
const TO_CHAIN_MESSAGE_DETAILS_METHOD: &'static str =
|
||||||
bp_rococo::TO_ROCOCO_MESSAGE_DETAILS_METHOD;
|
bp_rococo::TO_ROCOCO_MESSAGE_DETAILS_METHOD;
|
||||||
const TO_CHAIN_LATEST_GENERATED_NONCE_METHOD: &'static str =
|
|
||||||
bp_rococo::TO_ROCOCO_LATEST_GENERATED_NONCE_METHOD;
|
|
||||||
const TO_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
const TO_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
||||||
bp_rococo::TO_ROCOCO_LATEST_RECEIVED_NONCE_METHOD;
|
bp_rococo::TO_ROCOCO_LATEST_RECEIVED_NONCE_METHOD;
|
||||||
const FROM_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
const FROM_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
||||||
|
|||||||
@@ -76,9 +76,6 @@ pub trait ChainWithMessages: Chain {
|
|||||||
/// Name of the `To<ChainWithMessages>OutboundLaneApi::message_details` runtime API method.
|
/// Name of the `To<ChainWithMessages>OutboundLaneApi::message_details` runtime API method.
|
||||||
/// The method is provided by the runtime that is bridged with this `ChainWithMessages`.
|
/// The method is provided by the runtime that is bridged with this `ChainWithMessages`.
|
||||||
const TO_CHAIN_MESSAGE_DETAILS_METHOD: &'static str;
|
const TO_CHAIN_MESSAGE_DETAILS_METHOD: &'static str;
|
||||||
/// Name of the `To<ChainWithMessages>OutboundLaneApi::latest_generated_nonce` runtime API
|
|
||||||
/// method. The method is provided by the runtime that is bridged with this `ChainWithMessages`.
|
|
||||||
const TO_CHAIN_LATEST_GENERATED_NONCE_METHOD: &'static str;
|
|
||||||
/// Name of the `To<ChainWithMessages>OutboundLaneApi::latest_received_nonce` runtime API
|
/// Name of the `To<ChainWithMessages>OutboundLaneApi::latest_received_nonce` runtime API
|
||||||
/// method. The method is provided by the runtime that is bridged with this `ChainWithMessages`.
|
/// method. The method is provided by the runtime that is bridged with this `ChainWithMessages`.
|
||||||
const TO_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str;
|
const TO_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str;
|
||||||
|
|||||||
@@ -78,8 +78,6 @@ impl ChainWithMessages for Wococo {
|
|||||||
bp_wococo::WITH_WOCOCO_MESSAGES_PALLET_NAME;
|
bp_wococo::WITH_WOCOCO_MESSAGES_PALLET_NAME;
|
||||||
const TO_CHAIN_MESSAGE_DETAILS_METHOD: &'static str =
|
const TO_CHAIN_MESSAGE_DETAILS_METHOD: &'static str =
|
||||||
bp_wococo::TO_WOCOCO_MESSAGE_DETAILS_METHOD;
|
bp_wococo::TO_WOCOCO_MESSAGE_DETAILS_METHOD;
|
||||||
const TO_CHAIN_LATEST_GENERATED_NONCE_METHOD: &'static str =
|
|
||||||
bp_wococo::TO_WOCOCO_LATEST_GENERATED_NONCE_METHOD;
|
|
||||||
const TO_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
const TO_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
||||||
bp_wococo::TO_WOCOCO_LATEST_RECEIVED_NONCE_METHOD;
|
bp_wococo::TO_WOCOCO_LATEST_RECEIVED_NONCE_METHOD;
|
||||||
const FROM_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
const FROM_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
|
||||||
|
|||||||
@@ -28,7 +28,10 @@ use crate::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use bp_messages::{LaneId, MessageNonce, UnrewardedRelayersState};
|
use bp_messages::{
|
||||||
|
storage_keys::outbound_lane_data_key, LaneId, MessageNonce, OutboundLaneData,
|
||||||
|
UnrewardedRelayersState,
|
||||||
|
};
|
||||||
use bridge_runtime_common::messages::{
|
use bridge_runtime_common::messages::{
|
||||||
source::FromBridgedChainMessagesDeliveryProof, target::FromBridgedChainMessagesProof,
|
source::FromBridgedChainMessagesDeliveryProof, target::FromBridgedChainMessagesProof,
|
||||||
};
|
};
|
||||||
@@ -126,16 +129,19 @@ where
|
|||||||
&self,
|
&self,
|
||||||
id: SourceHeaderIdOf<MessageLaneAdapter<P>>,
|
id: SourceHeaderIdOf<MessageLaneAdapter<P>>,
|
||||||
) -> Result<(SourceHeaderIdOf<MessageLaneAdapter<P>>, MessageNonce), SubstrateError> {
|
) -> Result<(SourceHeaderIdOf<MessageLaneAdapter<P>>, MessageNonce), SubstrateError> {
|
||||||
let encoded_response = self
|
let outbound_lane_data: Option<OutboundLaneData> = self
|
||||||
.client
|
.client
|
||||||
.state_call(
|
.storage_value(
|
||||||
P::TargetChain::TO_CHAIN_LATEST_GENERATED_NONCE_METHOD.into(),
|
outbound_lane_data_key(
|
||||||
Bytes(self.lane_id.encode()),
|
P::TargetChain::WITH_CHAIN_MESSAGES_PALLET_NAME,
|
||||||
|
&self.lane_id,
|
||||||
|
),
|
||||||
Some(id.1),
|
Some(id.1),
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
let latest_generated_nonce: MessageNonce = Decode::decode(&mut &encoded_response.0[..])
|
// lane data missing from the storage is fine until first message is sent
|
||||||
.map_err(SubstrateError::ResponseParseFailed)?;
|
let latest_generated_nonce =
|
||||||
|
outbound_lane_data.map(|data| data.latest_generated_nonce).unwrap_or(0);
|
||||||
Ok((id, latest_generated_nonce))
|
Ok((id, latest_generated_nonce))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user