From 26c5a35d7a68b5c636303df1cbb676d7d866bf11 Mon Sep 17 00:00:00 2001 From: fewensa <37804932+fewensa@users.noreply.github.com> Date: Tue, 30 Nov 2021 19:47:25 +0800 Subject: [PATCH] Add mut support (#1232) --- bridges/relays/messages/src/message_race_delivery.rs | 2 +- .../relays/messages/src/relay_strategy/altruistic_strategy.rs | 2 +- .../relays/messages/src/relay_strategy/enforcement_strategy.rs | 2 +- bridges/relays/messages/src/relay_strategy/mix_strategy.rs | 2 +- bridges/relays/messages/src/relay_strategy/mod.rs | 2 +- bridges/relays/messages/src/relay_strategy/rational_strategy.rs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bridges/relays/messages/src/message_race_delivery.rs b/bridges/relays/messages/src/message_race_delivery.rs index 1cd2cbd26718..dc994364f178 100644 --- a/bridges/relays/messages/src/message_race_delivery.rs +++ b/bridges/relays/messages/src/message_race_delivery.rs @@ -521,7 +521,7 @@ where nonces_queue_range: 0..maximal_source_queue_index + 1, }; - let strategy = EnforcementStrategy::new(self.relay_strategy.clone()); + let mut strategy = EnforcementStrategy::new(self.relay_strategy.clone()); let range_end = strategy.decide(reference).await?; let range_begin = source_queue[0].1.begin(); diff --git a/bridges/relays/messages/src/relay_strategy/altruistic_strategy.rs b/bridges/relays/messages/src/relay_strategy/altruistic_strategy.rs index f932b796b0de..d6fec7f1297b 100644 --- a/bridges/relays/messages/src/relay_strategy/altruistic_strategy.rs +++ b/bridges/relays/messages/src/relay_strategy/altruistic_strategy.rs @@ -37,7 +37,7 @@ impl RelayStrategy for AltruisticStrategy { SourceClient: MessageLaneSourceClient
, TargetClient: MessageLaneTargetClient
, >( - &self, + &mut self, _reference: &mut RelayReference
,
) -> bool {
true
diff --git a/bridges/relays/messages/src/relay_strategy/enforcement_strategy.rs b/bridges/relays/messages/src/relay_strategy/enforcement_strategy.rs
index 042c05bec00a..1e9ef5bdbf81 100644
--- a/bridges/relays/messages/src/relay_strategy/enforcement_strategy.rs
+++ b/bridges/relays/messages/src/relay_strategy/enforcement_strategy.rs
@@ -49,7 +49,7 @@ impl ,
TargetClient: MessageLaneTargetClient ,
>(
- &self,
+ &mut self,
reference: RelayMessagesBatchReference ,
) -> Option ,
TargetClient: MessageLaneTargetClient ,
>(
- &self,
+ &mut self,
reference: &mut RelayReference ,
) -> bool {
match self.relayer_mode {
diff --git a/bridges/relays/messages/src/relay_strategy/mod.rs b/bridges/relays/messages/src/relay_strategy/mod.rs
index 3e4eef8975dd..d902bd93e5cf 100644
--- a/bridges/relays/messages/src/relay_strategy/mod.rs
+++ b/bridges/relays/messages/src/relay_strategy/mod.rs
@@ -52,7 +52,7 @@ pub trait RelayStrategy: 'static + Clone + Send + Sync {
SourceClient: MessageLaneSourceClient ,
TargetClient: MessageLaneTargetClient ,
>(
- &self,
+ &mut self,
reference: &mut RelayReference ,
) -> bool;
}
diff --git a/bridges/relays/messages/src/relay_strategy/rational_strategy.rs b/bridges/relays/messages/src/relay_strategy/rational_strategy.rs
index dc408ffd49e2..fd0a1ffafc8b 100644
--- a/bridges/relays/messages/src/relay_strategy/rational_strategy.rs
+++ b/bridges/relays/messages/src/relay_strategy/rational_strategy.rs
@@ -41,7 +41,7 @@ impl RelayStrategy for RationalStrategy {
SourceClient: MessageLaneSourceClient ,
TargetClient: MessageLaneTargetClient ,
>(
- &self,
+ &mut self,
reference: &mut RelayReference ,
) -> bool {
// technically, multiple confirmations will be delivered in a single transaction,