mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
f9c2655df4
Fixed an issue where messages where signed incorrectly when blinding wasn't enabled on a SOGS Fixed an issue where a single invalid message would result in all messages in that request being dropped Updated the final legacy endpoint (ban and delete all messages) Moved the OpenGroupManager poller values into the 'Cache' (so they are thread safe) Started adding unit tests for the OpenGroupManager Removed some redundant parameters from the 'Request' type
32 lines
846 B
Swift
32 lines
846 B
Swift
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
|
|
|
|
import Foundation
|
|
import YapDatabase
|
|
|
|
// FIXME: Turn this into a protocol to make mocking possible
|
|
final class TestTransaction: YapDatabaseReadWriteTransaction, Mockable {
|
|
// MARK: - Mockable
|
|
|
|
enum DataKey: Hashable {
|
|
case objectForKey
|
|
}
|
|
|
|
typealias Key = DataKey
|
|
|
|
var mockData: [DataKey: Any] = [:]
|
|
|
|
// MARK: - YapDatabaseReadWriteTransaction
|
|
|
|
override func object(forKey key: String, inCollection collection: String?) -> Any? {
|
|
return mockData[.objectForKey]
|
|
}
|
|
|
|
override func addCompletionQueue(_ completionQueue: DispatchQueue?, completionBlock: @escaping () -> Void) {
|
|
completionBlock()
|
|
}
|
|
}
|
|
|
|
extension TestTransaction: Mocked {
|
|
static var mockValue: TestTransaction = TestTransaction()
|
|
}
|