mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 17:57:56 +00:00
Token swap pallet benchmarks (#1174)
* token swap benchmarks * spellcheck
This commit is contained in:
committed by
Bastian Köcher
parent
c0df990b90
commit
4b525f4fe1
@@ -135,6 +135,15 @@ pub trait MessageDeliveryAndDispatchPayment<AccountId, Balance> {
|
||||
);
|
||||
}
|
||||
|
||||
/// Send message artifacts.
|
||||
#[derive(RuntimeDebug, PartialEq)]
|
||||
pub struct SendMessageArtifacts {
|
||||
/// Nonce of the message.
|
||||
pub nonce: MessageNonce,
|
||||
/// Actual weight of send message call.
|
||||
pub weight: Weight,
|
||||
}
|
||||
|
||||
/// Messages bridge API to be used from other pallets.
|
||||
pub trait MessagesBridge<AccountId, Balance, Payload> {
|
||||
/// Error type.
|
||||
@@ -148,7 +157,26 @@ pub trait MessagesBridge<AccountId, Balance, Payload> {
|
||||
lane: LaneId,
|
||||
message: Payload,
|
||||
delivery_and_dispatch_fee: Balance,
|
||||
) -> Result<MessageNonce, Self::Error>;
|
||||
) -> Result<SendMessageArtifacts, Self::Error>;
|
||||
}
|
||||
|
||||
/// Bridge that does nothing when message is being sent.
|
||||
#[derive(RuntimeDebug, PartialEq)]
|
||||
pub struct NoopMessagesBridge;
|
||||
|
||||
impl<AccountId, Balance, Payload> MessagesBridge<AccountId, Balance, Payload>
|
||||
for NoopMessagesBridge
|
||||
{
|
||||
type Error = &'static str;
|
||||
|
||||
fn send_message(
|
||||
_sender: Sender<AccountId>,
|
||||
_lane: LaneId,
|
||||
_message: Payload,
|
||||
_delivery_and_dispatch_fee: Balance,
|
||||
) -> Result<SendMessageArtifacts, Self::Error> {
|
||||
Ok(SendMessageArtifacts { nonce: 0, weight: 0 })
|
||||
}
|
||||
}
|
||||
|
||||
/// Handler for messages delivery confirmation.
|
||||
|
||||
Reference in New Issue
Block a user