From e92895bdcc061213ea832a79f9d9bb86f3fa440c Mon Sep 17 00:00:00 2001
From: Dariusz Rybicki <dariusz@elixxir.io>
Date: Fri, 28 Oct 2022 10:44:38 +0200
Subject: [PATCH] Add CMixPauseNodeRegistrations

---
 Sources/XXClient/CMix/CMix.swift              |  3 +++
 .../CMixPauseNodeRegistrations.swift          | 24 +++++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 Sources/XXClient/CMix/Functions/CMixPauseNodeRegistrations.swift

diff --git a/Sources/XXClient/CMix/CMix.swift b/Sources/XXClient/CMix/CMix.swift
index 3b9940fb..2a04a2d8 100644
--- a/Sources/XXClient/CMix/CMix.swift
+++ b/Sources/XXClient/CMix/CMix.swift
@@ -7,6 +7,7 @@ public struct CMix {
   public var isHealthy: CMixIsHealthy
   public var getNodeRegistrationStatus: CMixGetNodeRegistrationStatus
   public var changeNumberOfNodeRegistrations: CMixChangeNumberOfNodeRegistrations
+  public var pauseNodeRegistrations: CMixPauseNodeRegistrations
   public var hasRunningProcesses: CMixHasRunningProcesses
   public var getRunningProcesses: CMixGetRunningProcesses
   public var networkFollowerStatus: CMixNetworkFollowerStatus
@@ -28,6 +29,7 @@ extension CMix {
       isHealthy: .live(bindingsCMix),
       getNodeRegistrationStatus: .live(bindingsCMix),
       changeNumberOfNodeRegistrations: .live(bindingsCMix),
+      pauseNodeRegistrations: .live(bindingsCMix),
       hasRunningProcesses: .live(bindingsCMix),
       getRunningProcesses: .live(bindingsCMix),
       networkFollowerStatus: .live(bindingsCMix),
@@ -50,6 +52,7 @@ extension CMix {
     isHealthy: .unimplemented,
     getNodeRegistrationStatus: .unimplemented,
     changeNumberOfNodeRegistrations: .unimplemented,
+    pauseNodeRegistrations: .unimplemented,
     hasRunningProcesses: .unimplemented,
     getRunningProcesses: .unimplemented,
     networkFollowerStatus: .unimplemented,
diff --git a/Sources/XXClient/CMix/Functions/CMixPauseNodeRegistrations.swift b/Sources/XXClient/CMix/Functions/CMixPauseNodeRegistrations.swift
new file mode 100644
index 00000000..59772c06
--- /dev/null
+++ b/Sources/XXClient/CMix/Functions/CMixPauseNodeRegistrations.swift
@@ -0,0 +1,24 @@
+import Bindings
+import XCTestDynamicOverlay
+
+public struct CMixPauseNodeRegistrations {
+  public var run: (Int) throws -> Void
+
+  public func callAsFunction(timeoutMS: Int) throws -> Void {
+    try run(timeoutMS)
+  }
+}
+
+extension CMixPauseNodeRegistrations {
+  public static func live(_ bindingsCMix: BindingsCmix) -> CMixPauseNodeRegistrations {
+    CMixPauseNodeRegistrations(
+      run: bindingsCMix.pauseNodeRegistrations
+    )
+  }
+}
+
+extension CMixPauseNodeRegistrations {
+  public static let unimplemented = CMixPauseNodeRegistrations(
+    run: XCTUnimplemented("\(Self.self)")
+  )
+}
-- 
GitLab