From d8fd1d3a273c85624c5bb4716be758aa59ae3683 Mon Sep 17 00:00:00 2001 From: fewensa <37804932+fewensa@users.noreply.github.com> Date: Thu, 11 Nov 2021 21:29:22 +0800 Subject: [PATCH] Add `AtLeast32BitUnsigned` for MessageLance::SourceChainBalance (#1207) --- bridges/relays/messages/Cargo.toml | 2 ++ bridges/relays/messages/src/message_lane.rs | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bridges/relays/messages/Cargo.toml b/bridges/relays/messages/Cargo.toml index ea5d46845c5a3..b11f00b957a42 100644 --- a/bridges/relays/messages/Cargo.toml +++ b/bridges/relays/messages/Cargo.toml @@ -19,3 +19,5 @@ parking_lot = "0.11.0" bp-messages = { path = "../../primitives/messages" } bp-runtime = { path = "../../primitives/runtime" } relay-utils = { path = "../utils" } + +sp-arithmetic = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/bridges/relays/messages/src/message_lane.rs b/bridges/relays/messages/src/message_lane.rs index 2b2d8029fc74b..5c9728ad93abd 100644 --- a/bridges/relays/messages/src/message_lane.rs +++ b/bridges/relays/messages/src/message_lane.rs @@ -21,6 +21,7 @@ use num_traits::{SaturatingAdd, Zero}; use relay_utils::{BlockNumberBase, HeaderId}; +use sp_arithmetic::traits::AtLeast32BitUnsigned; use std::{fmt::Debug, ops::Sub}; /// One-way message lane. @@ -40,7 +41,8 @@ pub trait MessageLane: 'static + Clone + Send + Sync { /// 1) pay transaction fees; /// 2) pay message delivery and dispatch fee; /// 3) pay relayer rewards. - type SourceChainBalance: Clone + type SourceChainBalance: AtLeast32BitUnsigned + + Clone + Copy + Debug + PartialOrd