Token-swap-over-bridge pallet (#944)

* token swap pallet

* token swap type (replay protection)

* post-merge fixes

* post-merge fix

* Update modules/token-swap/src/lib.rs

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* Update modules/token-swap/src/lib.rs

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* add missing comment part

* Update modules/token-swap/src/lib.rs

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>

* starting claim after lock period is over is forbidden

* move spec_version and weight to arguments

Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
This commit is contained in:
Svyatoslav Nikolsky
2021-08-02 14:42:14 +03:00
committed by Bastian Köcher
parent f86d101d7c
commit eba80f42a9
6 changed files with 1356 additions and 0 deletions
@@ -135,6 +135,22 @@ pub trait MessageDeliveryAndDispatchPayment<AccountId, Balance> {
}
}
/// Messages bridge API to be used from other pallets.
pub trait MessagesBridge<AccountId, Balance, Payload> {
/// Error type.
type Error: Debug;
/// Send message over the bridge.
///
/// Returns unique message nonce or error if send has failed.
fn send_message(
sender: AccountId,
lane: LaneId,
message: Payload,
delivery_and_dispatch_fee: Balance,
) -> Result<MessageNonce, Self::Error>;
}
/// Handler for messages delivery confirmation.
pub trait OnDeliveryConfirmed {
/// Called when we receive confirmation that our messages have been delivered to the