mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 14:01:02 +00:00
This reverts commit ad4299f6c91ce4c50cb6fbc739a0c788e2920956.
This commit is contained in:
committed by
Bastian Köcher
parent
a88207876c
commit
eb5a3eecd2
@@ -14,6 +14,7 @@ smallvec = "1.7"
|
||||
# Bridge Dependencies
|
||||
|
||||
bp-header-chain = { path = "../header-chain", default-features = false }
|
||||
bp-messages = { path = "../messages", default-features = false }
|
||||
bp-polkadot-core = { path = "../polkadot-core", default-features = false }
|
||||
bp-runtime = { path = "../runtime", default-features = false }
|
||||
|
||||
@@ -29,6 +30,7 @@ sp-version = { git = "https://github.com/paritytech/substrate", branch = "master
|
||||
default = ["std"]
|
||||
std = [
|
||||
"bp-header-chain/std",
|
||||
"bp-messages/std",
|
||||
"bp-polkadot-core/std",
|
||||
"bp-runtime/std",
|
||||
"frame-support/std",
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
// 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,
|
||||
};
|
||||
@@ -109,4 +110,51 @@ 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