Refactor Noise: Extract files and remove dead code (#806)

* Extract each type to a separate file

* NoiseSessionManager: Remove unused functions

---------

Co-authored-by: jack <212554440+jackjackbits@users.noreply.github.com>
This commit is contained in:
Islam
2025-10-15 00:33:35 +01:00
committed by islam
co-authored by jack
parent 3479c7d5df
commit 790dcda8e5
9 changed files with 259 additions and 267 deletions
+4 -4
View File
@@ -166,14 +166,14 @@ final class NoiseProtocolTests: XCTestCase {
func testSessionManagerBasicOperations() throws {
let manager = NoiseSessionManager(localStaticKey: aliceKey, keychain: mockKeychain)
// Create session
let session = manager.createSession(for: TestConstants.testPeerID2, role: .initiator)
XCTAssertNotNil(session)
XCTAssertNil(manager.getSession(for: TestConstants.testPeerID2))
_ = try manager.initiateHandshake(with: TestConstants.testPeerID2)
XCTAssertNotNil(manager.getSession(for: TestConstants.testPeerID2))
// Get session
let retrieved = manager.getSession(for: TestConstants.testPeerID2)
XCTAssertNotNil(retrieved)
XCTAssertTrue(session === retrieved)
// Remove session
manager.removeSession(for: TestConstants.testPeerID2)