Skip to content

Commit c21217a

Browse files
svyatonikbkchr
authored andcommitted
read latest_generated_nonce directly from storage (#1260)
1 parent 7414842 commit c21217a

File tree

17 files changed

+13
-83
lines changed

17 files changed

+13
-83
lines changed

bridges/bin/millau/runtime/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -768,10 +768,6 @@ impl_runtime_apis! {
768768
fn latest_received_nonce(lane: bp_messages::LaneId) -> bp_messages::MessageNonce {
769769
BridgeRialtoMessages::outbound_latest_received_nonce(lane)
770770
}
771-
772-
fn latest_generated_nonce(lane: bp_messages::LaneId) -> bp_messages::MessageNonce {
773-
BridgeRialtoMessages::outbound_latest_generated_nonce(lane)
774-
}
775771
}
776772

777773
impl bp_rialto::FromRialtoInboundLaneApi<Block> for Runtime {

bridges/bin/rialto/runtime/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -916,10 +916,6 @@ impl_runtime_apis! {
916916
fn latest_received_nonce(lane: bp_messages::LaneId) -> bp_messages::MessageNonce {
917917
BridgeMillauMessages::outbound_latest_received_nonce(lane)
918918
}
919-
920-
fn latest_generated_nonce(lane: bp_messages::LaneId) -> bp_messages::MessageNonce {
921-
BridgeMillauMessages::outbound_latest_generated_nonce(lane)
922-
}
923919
}
924920

925921
impl bp_millau::FromMillauInboundLaneApi<Block> for Runtime {

bridges/primitives/chain-kusama/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ pub const TO_KUSAMA_ESTIMATE_MESSAGE_FEE_METHOD: &str =
9898
"ToKusamaOutboundLaneApi_estimate_message_delivery_and_dispatch_fee";
9999
/// Name of the `ToKusamaOutboundLaneApi::message_details` runtime method.
100100
pub const TO_KUSAMA_MESSAGE_DETAILS_METHOD: &str = "ToKusamaOutboundLaneApi_message_details";
101-
/// Name of the `ToKusamaOutboundLaneApi::latest_generated_nonce` runtime method.
102-
pub const TO_KUSAMA_LATEST_GENERATED_NONCE_METHOD: &str =
103-
"ToKusamaOutboundLaneApi_latest_generated_nonce";
104101
/// Name of the `ToKusamaOutboundLaneApi::latest_received_nonce` runtime method.
105102
pub const TO_KUSAMA_LATEST_RECEIVED_NONCE_METHOD: &str =
106103
"ToKusamaOutboundLaneApi_latest_received_nonce";
@@ -156,8 +153,6 @@ sp_api::decl_runtime_apis! {
156153
) -> Vec<MessageDetails<OutboundMessageFee>>;
157154
/// Returns nonce of the latest message, received by bridged chain.
158155
fn latest_received_nonce(lane: LaneId) -> MessageNonce;
159-
/// Returns nonce of the latest message, generated by given lane.
160-
fn latest_generated_nonce(lane: LaneId) -> MessageNonce;
161156
}
162157

163158
/// Inbound message lane API for messages sent by Kusama chain.

bridges/primitives/chain-millau/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,6 @@ pub const TO_MILLAU_MESSAGE_DETAILS_METHOD: &str = "ToMillauOutboundLaneApi_mess
278278
/// Name of the `ToMillauOutboundLaneApi::latest_received_nonce` runtime method.
279279
pub const TO_MILLAU_LATEST_RECEIVED_NONCE_METHOD: &str =
280280
"ToMillauOutboundLaneApi_latest_received_nonce";
281-
/// Name of the `ToMillauOutboundLaneApi::latest_generated_nonce` runtime method.
282-
pub const TO_MILLAU_LATEST_GENERATED_NONCE_METHOD: &str =
283-
"ToMillauOutboundLaneApi_latest_generated_nonce";
284281

285282
/// Name of the `FromMillauInboundLaneApi::latest_received_nonce` runtime method.
286283
pub const FROM_MILLAU_LATEST_RECEIVED_NONCE_METHOD: &str =
@@ -333,8 +330,6 @@ sp_api::decl_runtime_apis! {
333330
) -> Vec<MessageDetails<OutboundMessageFee>>;
334331
/// Returns nonce of the latest message, received by bridged chain.
335332
fn latest_received_nonce(lane: LaneId) -> MessageNonce;
336-
/// Returns nonce of the latest message, generated by given lane.
337-
fn latest_generated_nonce(lane: LaneId) -> MessageNonce;
338333
}
339334

340335
/// Inbound message lane API for messages sent by Millau chain.

bridges/primitives/chain-polkadot/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ pub const TO_POLKADOT_ESTIMATE_MESSAGE_FEE_METHOD: &str =
9898
"ToPolkadotOutboundLaneApi_estimate_message_delivery_and_dispatch_fee";
9999
/// Name of the `ToPolkadotOutboundLaneApi::message_details` runtime method.
100100
pub const TO_POLKADOT_MESSAGE_DETAILS_METHOD: &str = "ToPolkadotOutboundLaneApi_message_details";
101-
/// Name of the `ToPolkadotOutboundLaneApi::latest_generated_nonce` runtime method.
102-
pub const TO_POLKADOT_LATEST_GENERATED_NONCE_METHOD: &str =
103-
"ToPolkadotOutboundLaneApi_latest_generated_nonce";
104101
/// Name of the `ToPolkadotOutboundLaneApi::latest_received_nonce` runtime method.
105102
pub const TO_POLKADOT_LATEST_RECEIVED_NONCE_METHOD: &str =
106103
"ToPolkadotOutboundLaneApi_latest_received_nonce";
@@ -156,8 +153,6 @@ sp_api::decl_runtime_apis! {
156153
) -> Vec<MessageDetails<OutboundMessageFee>>;
157154
/// Returns nonce of the latest message, received by bridged chain.
158155
fn latest_received_nonce(lane: LaneId) -> MessageNonce;
159-
/// Returns nonce of the latest message, generated by given lane.
160-
fn latest_generated_nonce(lane: LaneId) -> MessageNonce;
161156
}
162157

163158
/// Inbound message lane API for messages sent by Polkadot chain.

bridges/primitives/chain-rialto/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,6 @@ pub const TO_RIALTO_ESTIMATE_MESSAGE_FEE_METHOD: &str =
247247
"ToRialtoOutboundLaneApi_estimate_message_delivery_and_dispatch_fee";
248248
/// Name of the `ToRialtoOutboundLaneApi::message_details` runtime method.
249249
pub const TO_RIALTO_MESSAGE_DETAILS_METHOD: &str = "ToRialtoOutboundLaneApi_message_details";
250-
/// Name of the `ToRialtoOutboundLaneApi::latest_generated_nonce` runtime method.
251-
pub const TO_RIALTO_LATEST_GENERATED_NONCE_METHOD: &str =
252-
"ToRialtoOutboundLaneApi_latest_generated_nonce";
253250
/// Name of the `ToRialtoOutboundLaneApi::latest_received_nonce` runtime method.
254251
pub const TO_RIALTO_LATEST_RECEIVED_NONCE_METHOD: &str =
255252
"ToRialtoOutboundLaneApi_latest_received_nonce";
@@ -305,8 +302,6 @@ sp_api::decl_runtime_apis! {
305302
) -> Vec<MessageDetails<OutboundMessageFee>>;
306303
/// Returns nonce of the latest message, received by bridged chain.
307304
fn latest_received_nonce(lane: LaneId) -> MessageNonce;
308-
/// Returns nonce of the latest message, generated by given lane.
309-
fn latest_generated_nonce(lane: LaneId) -> MessageNonce;
310305
}
311306

312307
/// Inbound message lane API for messages sent by Rialto chain.

bridges/primitives/chain-rococo/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ pub const TO_ROCOCO_ESTIMATE_MESSAGE_FEE_METHOD: &str =
8787
"ToRococoOutboundLaneApi_estimate_message_delivery_and_dispatch_fee";
8888
/// Name of the `ToRococoOutboundLaneApi::message_details` runtime method.
8989
pub const TO_ROCOCO_MESSAGE_DETAILS_METHOD: &str = "ToRococoOutboundLaneApi_message_details";
90-
/// Name of the `ToRococoOutboundLaneApi::latest_generated_nonce` runtime method.
91-
pub const TO_ROCOCO_LATEST_GENERATED_NONCE_METHOD: &str =
92-
"ToRococoOutboundLaneApi_latest_generated_nonce";
9390
/// Name of the `ToRococoOutboundLaneApi::latest_received_nonce` runtime method.
9491
pub const TO_ROCOCO_LATEST_RECEIVED_NONCE_METHOD: &str =
9592
"ToRococoOutboundLaneApi_latest_received_nonce";
@@ -157,8 +154,6 @@ sp_api::decl_runtime_apis! {
157154
) -> Vec<MessageDetails<OutboundMessageFee>>;
158155
/// Returns nonce of the latest message, received by bridged chain.
159156
fn latest_received_nonce(lane: LaneId) -> MessageNonce;
160-
/// Returns nonce of the latest message, generated by given lane.
161-
fn latest_generated_nonce(lane: LaneId) -> MessageNonce;
162157
}
163158

164159
/// Inbound message lane API for messages sent by Rococo chain.

bridges/primitives/chain-westend/src/lib.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -90,29 +90,6 @@ pub fn derive_account_from_rococo_id(id: bp_runtime::SourceAccount<AccountId>) -
9090
/// Name of the `WestendFinalityApi::best_finalized` runtime method.
9191
pub const BEST_FINALIZED_WESTEND_HEADER_METHOD: &str = "WestendFinalityApi_best_finalized";
9292

93-
/// Name of the `ToWestendOutboundLaneApi::estimate_message_delivery_and_dispatch_fee` runtime
94-
/// method.
95-
pub const TO_WESTEND_ESTIMATE_MESSAGE_FEE_METHOD: &str =
96-
"ToWestendOutboundLaneApi_estimate_message_delivery_and_dispatch_fee";
97-
/// Name of the `ToWestendOutboundLaneApi::message_details` runtime method.
98-
pub const TO_WESTEND_MESSAGE_DETAILS_METHOD: &str = "ToWestendOutboundLaneApi_message_details";
99-
/// Name of the `ToWestendOutboundLaneApi::latest_generated_nonce` runtime method.
100-
pub const TO_WESTEND_LATEST_GENERATED_NONCE_METHOD: &str =
101-
"ToWestendOutboundLaneApi_latest_generated_nonce";
102-
/// Name of the `ToWestendOutboundLaneApi::latest_received_nonce` runtime method.
103-
pub const TO_WESTEND_LATEST_RECEIVED_NONCE_METHOD: &str =
104-
"ToWestendOutboundLaneApi_latest_received_nonce";
105-
106-
/// Name of the `FromWestendInboundLaneApi::latest_received_nonce` runtime method.
107-
pub const FROM_WESTEND_LATEST_RECEIVED_NONCE_METHOD: &str =
108-
"FromWestendInboundLaneApi_latest_received_nonce";
109-
/// Name of the `FromWestendInboundLaneApi::latest_onfirmed_nonce` runtime method.
110-
pub const FROM_WESTEND_LATEST_CONFIRMED_NONCE_METHOD: &str =
111-
"FromWestendInboundLaneApi_latest_confirmed_nonce";
112-
/// Name of the `FromWestendInboundLaneApi::unrewarded_relayers_state` runtime method.
113-
pub const FROM_WESTEND_UNREWARDED_RELAYERS_STATE: &str =
114-
"FromWestendInboundLaneApi_unrewarded_relayers_state";
115-
11693
/// The target length of a session (how often authorities change) on Westend measured in of number
11794
/// of blocks.
11895
///

bridges/primitives/chain-wococo/src/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ pub const TO_WOCOCO_ESTIMATE_MESSAGE_FEE_METHOD: &str =
5252
"ToWococoOutboundLaneApi_estimate_message_delivery_and_dispatch_fee";
5353
/// Name of the `ToWococoOutboundLaneApi::message_details` runtime method.
5454
pub const TO_WOCOCO_MESSAGE_DETAILS_METHOD: &str = "ToWococoOutboundLaneApi_message_details";
55-
/// Name of the `ToWococoOutboundLaneApi::latest_generated_nonce` runtime method.
56-
pub const TO_WOCOCO_LATEST_GENERATED_NONCE_METHOD: &str =
57-
"ToWococoOutboundLaneApi_latest_generated_nonce";
5855
/// Name of the `ToWococoOutboundLaneApi::latest_received_nonce` runtime method.
5956
pub const TO_WOCOCO_LATEST_RECEIVED_NONCE_METHOD: &str =
6057
"ToWococoOutboundLaneApi_latest_received_nonce";
@@ -110,8 +107,6 @@ sp_api::decl_runtime_apis! {
110107
) -> Vec<MessageDetails<OutboundMessageFee>>;
111108
/// Returns nonce of the latest message, received by bridged chain.
112109
fn latest_received_nonce(lane: LaneId) -> MessageNonce;
113-
/// Returns nonce of the latest message, generated by given lane.
114-
fn latest_generated_nonce(lane: LaneId) -> MessageNonce;
115110
}
116111

117112
/// Inbound message lane API for messages sent by Wococo chain.

bridges/relays/client-kusama/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ impl ChainWithMessages for Kusama {
7575
bp_kusama::WITH_KUSAMA_MESSAGES_PALLET_NAME;
7676
const TO_CHAIN_MESSAGE_DETAILS_METHOD: &'static str =
7777
bp_kusama::TO_KUSAMA_MESSAGE_DETAILS_METHOD;
78-
const TO_CHAIN_LATEST_GENERATED_NONCE_METHOD: &'static str =
79-
bp_kusama::TO_KUSAMA_LATEST_GENERATED_NONCE_METHOD;
8078
const TO_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =
8179
bp_kusama::TO_KUSAMA_LATEST_RECEIVED_NONCE_METHOD;
8280
const FROM_CHAIN_LATEST_RECEIVED_NONCE_METHOD: &'static str =

0 commit comments

Comments
 (0)