mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 02:25:20 +00:00
Refactor Nostr ID Bridge & Keychain Helper (#796)
* Extract each type to a separate file * Nostr ID Bridge: Convert static func/vars to instance * `KeychainHelper` behind a protocol to easily mock * Update tests with ID Bridge and MockKeychainHelper --------- Co-authored-by: jack <212554440+jackjackbits@users.noreply.github.com>
This commit is contained in:
@@ -37,9 +37,10 @@ final class LocationChannelsTests: XCTestCase {
|
||||
|
||||
func testPerGeohashIdentityDeterministic() throws {
|
||||
// Derive twice for same geohash; should be identical
|
||||
let idBridge = NostrIdentityBridge(keychain: MockKeychainHelper())
|
||||
let gh = "u4pruy"
|
||||
let id1 = try NostrIdentityBridge.deriveIdentity(forGeohash: gh)
|
||||
let id2 = try NostrIdentityBridge.deriveIdentity(forGeohash: gh)
|
||||
let id1 = try idBridge.deriveIdentity(forGeohash: gh)
|
||||
let id2 = try idBridge.deriveIdentity(forGeohash: gh)
|
||||
XCTAssertEqual(id1.publicKeyHex, id2.publicKeyHex)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user