Skip to content

Commit

Permalink
Rename listenerAddrs property to mirror upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
za-creature committed Feb 2, 2025
1 parent 7fe9fc0 commit 32448a5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions bindings/swift/Ouisync/Sources/Ouisync.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public extension Client {
"local_discovery_enabled": .bool(localDiscovery)])
}

var listenerAddrs: [String] { get async throws {
try await invoke("network_get_listener_addrs").arrayValue.orThrow.map {
var localListenerAddrs: [String] { get async throws {
try await invoke("network_get_local_listener_addrs").arrayValue.orThrow.map {
try $0.stringValue.orThrow
}
} }
Expand Down
8 changes: 4 additions & 4 deletions bindings/swift/Ouisync/Tests/MultipleNodesTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import XCTest
import Ouisync


final class MultiplenodesTests: XCTestCase {
final class MultipleNodesTests: XCTestCase {
var server1: Server!, client1: Client!, temp1: String!
var server2: Server!, client2: Client!, temp2: String!
var repo1, repo2: Repository!
Expand Down Expand Up @@ -34,13 +34,13 @@ final class MultiplenodesTests: XCTestCase {
if count == 2 { break }
}
}
try await client2.addUserProvidedPeers(from: client1.listenerAddrs)
try await client2.addUserProvidedPeers(from: client1.localListenerAddrs)
_ = try await repo1.createFile(at: "file.txt")
try await stream.value
}

func testNotificationOnPeersChange() async throws {
let addr = try await client1.listenerAddrs[0]
let addr = try await client1.localListenerAddrs[0]
let stream = Task {
for try await _ in client2.networkEvents {
for peer in try await client2.peers {
Expand All @@ -56,7 +56,7 @@ final class MultiplenodesTests: XCTestCase {
}

func testNetworkStats() async throws {
let addr = try await client1.listenerAddrs[0]
let addr = try await client1.localListenerAddrs[0]
try await client2.addUserProvidedPeers(from: [addr])
try await repo1.createFile(at: "file.txt").flush()

Expand Down

0 comments on commit 32448a5

Please sign in to comment.