From 1bb752a987646c661bb1d59f83c2cc4a5f7d7e0f Mon Sep 17 00:00:00 2001 From: Kiril Mihaylov <80464733+KirilMihaylov@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:31:01 +0300 Subject: [PATCH] refactor(chain-ops): Reuse `new` constructor method for `ProtocolWatcher`. --- chain-ops/src/task/protocol_watcher.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/chain-ops/src/task/protocol_watcher.rs b/chain-ops/src/task/protocol_watcher.rs index 96519a8..4f6d1c8 100644 --- a/chain-ops/src/task/protocol_watcher.rs +++ b/chain-ops/src/task/protocol_watcher.rs @@ -93,9 +93,9 @@ impl super::ProtocolWatcher for ProtocolWatcher { where ApplicationDefined: application_defined::Id, { - Self { - admin_contract: service_configuration.admin_contract().clone(), - protocol_tasks: task_states + Self::new( + service_configuration.admin_contract().clone(), + task_states .keys() .filter_map(|id| { if let task::Id::ApplicationDefined(id) = id { @@ -106,7 +106,7 @@ impl super::ProtocolWatcher for ProtocolWatcher { }) .collect(), command_tx, - } + ) } }