mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 10:31:03 +00:00
replace latest_confirmed_nonce runtime APIs with direct storage reads (#1282)
This commit is contained in:
committed by
Bastian Köcher
parent
fd816b60e3
commit
1d99ad3619
@@ -20,7 +20,6 @@
|
||||
// Runtime-generated DecodeLimit::decode_all_with_depth_limit
|
||||
#![allow(clippy::unnecessary_mut_passed)]
|
||||
|
||||
use bp_messages::{LaneId, MessageDetails, MessageNonce, UnrewardedRelayersState};
|
||||
use frame_support::weights::{
|
||||
WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial,
|
||||
};
|
||||
@@ -110,51 +109,4 @@ sp_api::decl_runtime_apis! {
|
||||
/// Returns number and hash of the best finalized header known to the bridge module.
|
||||
fn best_finalized() -> (BlockNumber, Hash);
|
||||
}
|
||||
|
||||
/// Outbound message lane API for messages that are sent to Westend chain.
|
||||
///
|
||||
/// This API is implemented by runtimes that are sending messages to Westend chain, not the
|
||||
/// Westend runtime itself.
|
||||
pub trait ToWestendOutboundLaneApi<OutboundMessageFee: Parameter, OutboundPayload: Parameter> {
|
||||
/// Estimate message delivery and dispatch fee that needs to be paid by the sender on
|
||||
/// this chain.
|
||||
///
|
||||
/// Returns `None` if message is too expensive to be sent to Westend from this chain.
|
||||
///
|
||||
/// Please keep in mind that this method returns the lowest message fee required for message
|
||||
/// to be accepted to the lane. It may be good idea to pay a bit over this price to account
|
||||
/// future exchange rate changes and guarantee that relayer would deliver your message
|
||||
/// to the target chain.
|
||||
fn estimate_message_delivery_and_dispatch_fee(
|
||||
lane_id: LaneId,
|
||||
payload: OutboundPayload,
|
||||
) -> Option<OutboundMessageFee>;
|
||||
/// Returns dispatch weight, encoded payload size and delivery+dispatch fee of all
|
||||
/// messages in given inclusive range.
|
||||
///
|
||||
/// If some (or all) messages are missing from the storage, they'll also will
|
||||
/// be missing from the resulting vector. The vector is ordered by the nonce.
|
||||
fn message_details(
|
||||
lane: LaneId,
|
||||
begin: MessageNonce,
|
||||
end: MessageNonce,
|
||||
) -> Vec<MessageDetails<OutboundMessageFee>>;
|
||||
/// Returns nonce of the latest message, received by bridged chain.
|
||||
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 Westend chain.
|
||||
///
|
||||
/// This API is implemented by runtimes that are receiving messages from Westend chain, not the
|
||||
/// Westend runtime itself.
|
||||
pub trait FromWestendInboundLaneApi {
|
||||
/// Returns nonce of the latest message, received by given lane.
|
||||
fn latest_received_nonce(lane: LaneId) -> MessageNonce;
|
||||
/// Nonce of the latest message that has been confirmed to the bridged chain.
|
||||
fn latest_confirmed_nonce(lane: LaneId) -> MessageNonce;
|
||||
/// State of the unrewarded relayers set at given lane.
|
||||
fn unrewarded_relayers_state(lane: LaneId) -> UnrewardedRelayersState;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user