Skip to content
Snippets Groups Projects
Commit 831771f7 authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Add E2EVerifyOwnership functor

parent 1f05f91e
No related branches found
No related tags found
2 merge requests!102Release 1.0.0,!18Update Bindings
......@@ -18,6 +18,7 @@ public struct E2E {
public var callAllReceivedRequests: E2ECallAllReceivedRequests
public var getReceivedRequest: E2EGetReceivedRequest
public var deleteRequest: E2EDeleteRequest
public var verifyOwnership: E2EVerifyOwnership
public var send: E2ESend
// TODO:
......@@ -43,6 +44,7 @@ extension E2E {
callAllReceivedRequests: .live(bindingsE2E),
getReceivedRequest: .live(bindingsE2E),
deleteRequest: .live(bindingsE2E),
verifyOwnership: .live(bindingsE2E),
send: .live(bindingsE2E)
)
}
......@@ -67,6 +69,7 @@ extension E2E {
callAllReceivedRequests: .unimplemented,
getReceivedRequest: .unimplemented,
deleteRequest: .unimplemented,
verifyOwnership: .unimplemented,
send: .unimplemented
)
}
import Bindings
import XCTestDynamicOverlay
public struct E2EVerifyOwnership {
public var run: (Data, Data, Int) throws -> Bool
public func callAsFunction(
receivedContact: Data,
verifiedContact: Data,
e2eId: Int
) throws -> Bool {
try run(receivedContact, verifiedContact, e2eId)
}
}
extension E2EVerifyOwnership {
public static func live(_ bindingsE2E: BindingsE2e) -> E2EVerifyOwnership {
E2EVerifyOwnership { receivedContact, verifiedContact, e2eId in
var result: ObjCBool = false
try bindingsE2E.verifyOwnership(
receivedContact,
verifiedContact: verifiedContact,
e2eId: e2eId,
ret0_: &result
)
return result.boolValue
}
}
}
extension E2EVerifyOwnership {
public static let unimplemented = E2EVerifyOwnership(
run: XCTUnimplemented("\(Self.self)")
)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment