Implement NostrNetworkManager and UserRelayListManager
This commit implements a new layer called NostrNetworkManager, responsible for managing interactions with the Nostr network, and providing a higher level API that is easier and more secure to use for the layer above it. It also integrates it with the rest of the app, by moving RelayPool and PostBox into NostrNetworkManager, along with all their usages. Changelog-Added: Added NIP-65 relay list support Changelog-Changed: Improved robustness of relay list handling Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
This commit is contained in:
@@ -98,7 +98,7 @@ final class AuthIntegrationTests: XCTestCase {
|
||||
sent_messages.append(str)
|
||||
}
|
||||
XCTAssertEqual(pool.relays.count, 0)
|
||||
let relay_descriptor = RelayPool.RelayDescriptor.init(url: relay_url, info: .rw)
|
||||
let relay_descriptor = RelayPool.RelayDescriptor.init(url: relay_url, info: .readWrite)
|
||||
try! pool.add_relay(relay_descriptor)
|
||||
XCTAssertEqual(pool.relays.count, 1)
|
||||
let connection_expectation = XCTestExpectation(description: "Waiting for connection")
|
||||
@@ -142,7 +142,7 @@ final class AuthIntegrationTests: XCTestCase {
|
||||
sent_messages.append(str)
|
||||
}
|
||||
XCTAssertEqual(pool.relays.count, 0)
|
||||
let relay_descriptor = RelayPool.RelayDescriptor.init(url: relay_url, info: .rw)
|
||||
let relay_descriptor = RelayPool.RelayDescriptor.init(url: relay_url, info: .readWrite)
|
||||
try! pool.add_relay(relay_descriptor)
|
||||
XCTAssertEqual(pool.relays.count, 1)
|
||||
let connection_expectation = XCTestExpectation(description: "Waiting for connection")
|
||||
|
||||
Reference in New Issue
Block a user