Skip to content
Snippets Groups Projects
Select Git revision
  • 4838dfdd91f142f06aa5d2d2402505fd61df672d
  • main default protected
  • development
  • integration
  • v1.1.5
  • v1.1.4
  • v1.1.3
  • v1.1.2
  • v1.1.1
  • v1.1.0
  • v1.0.0
11 results

Connection.swift

Blame
  • NewCMix.swift 834 B
    import Bindings
    import XCTestDynamicOverlay
    
    public struct NewCMix {
      public var run: (String, String, Data, String?) throws -> Void
    
      public func callAsFunction(
        ndfJSON: String,
        storageDir: String,
        password: Data,
        registrationCode: String?
      ) throws {
        try run(ndfJSON, storageDir, password, registrationCode)
      }
    }
    
    extension NewCMix {
      public static let live = NewCMix { ndfJSON, storageDir, password, registrationCode in
        var error: NSError?
        let result = BindingsNewCmix(ndfJSON, storageDir, password, registrationCode, &error)
        if let error = error {
          throw error
        }
        if !result {
          fatalError("BindingsNewCMix returned `false` without providing error")
        }
      }
    }
    
    extension NewCMix {
      public static let unimplemented = NewCMix(
        run: XCTUnimplemented("\(Self.self)")
      )
    }