You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
session-ios/SessionMessagingKitTests/_TestUtilities/TestSign.swift

31 lines
661 B
Swift

// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
import Foundation
import PromiseKit
import Sodium
@testable import SessionMessagingKit
class TestSign: SignType, Mockable {
// MARK: - Mockable
enum DataKey: Hashable {
case signature
case verify
}
typealias Key = DataKey
var mockData: [DataKey: Any] = [:]
// MARK: - SignType
func signature(message: Bytes, secretKey: Bytes) -> Bytes? {
return (mockData[.signature] as? Bytes)
}
func verify(message: Bytes, publicKey: Bytes, signature: Bytes) -> Bool {
return (mockData[.verify] as! Bool)
}
}