|
1 | 1 | import XCTest |
2 | 2 | @testable import BitcoinDevKit |
3 | 3 |
|
4 | | -final class LiveKyotoTests: XCTestCase { |
5 | | - private let descriptor = try! Descriptor( |
6 | | - descriptor: "wpkh(tprv8ZgxMBicQKsPf2qfrEygW6fdYseJDDrVnDv26PH5BHdvSuG6ecCbHqLVof9yZcMoM31z9ur3tTYbSnr1WBqbGX97CbXcmp5H6qeMpyvx35B/84h/1h/1h/0/*)", |
7 | | - network: Network.signet |
8 | | - ) |
9 | | - private let changeDescriptor = try! Descriptor( |
10 | | - descriptor: "wpkh(tprv8ZgxMBicQKsPf2qfrEygW6fdYseJDDrVnDv26PH5BHdvSuG6ecCbHqLVof9yZcMoM31z9ur3tTYbSnr1WBqbGX97CbXcmp5H6qeMpyvx35B/84h/1h/1h/1/*)", |
11 | | - network: Network.signet |
12 | | - ) |
13 | | - private let peer = IpAddress.fromIpv4(q1: 68, q2: 47, q3: 229, q4: 218) |
14 | | - private let cwd = FileManager.default.currentDirectoryPath.appending("/temp") |
15 | | - |
16 | | - override func tearDownWithError() throws { |
17 | | - let fileManager = FileManager.default |
18 | | - if fileManager.fileExists(atPath: cwd) { |
19 | | - try fileManager.removeItem(atPath: cwd) |
20 | | - } |
21 | | - } |
22 | | - |
23 | | - // See: https://github.com/bitcoindevkit/bdk-ffi/issues/842 |
24 | | - /* |
25 | | - func testSuccessfullySyncs() async throws { |
26 | | - let persister = try Persister.newInMemory() |
27 | | - let wallet = try Wallet( |
28 | | - descriptor: descriptor, |
29 | | - changeDescriptor: changeDescriptor, |
30 | | - network: Network.signet, |
31 | | - persister: persister |
32 | | - ) |
33 | | - let trustedPeer = Peer(address: peer, port: nil, v2Transport: false) |
34 | | - let lightClient = try CbfBuilder() |
35 | | - .peers(peers: [trustedPeer]) |
36 | | - .connections(connections: 1) |
37 | | - .scanType(scanType: ScanType.new) |
38 | | - .dataDir(dataDir: cwd) |
39 | | - .build(wallet: wallet) |
40 | | - let client = lightClient.client |
41 | | - let node = lightClient.node |
42 | | - node.run() |
43 | | - Task { |
44 | | - while true { |
45 | | - if let log = try? await client.nextLog() { |
46 | | - print("\(log)") |
47 | | - } |
48 | | - } |
49 | | - } |
50 | | - let update = try await client.update() |
51 | | - try wallet.applyUpdate(update: update) |
52 | | - let address = wallet.revealNextAddress(keychain: KeychainKind.external).address.description |
53 | | - XCTAssertGreaterThan( |
54 | | - wallet.balance().total.toSat(), |
55 | | - UInt64(0), |
56 | | - "Wallet must have positive balance, please send funds to \(address)" |
57 | | - ) |
58 | | - print("Update applied correctly") |
59 | | - try client.shutdown() |
60 | | - } |
61 | | - */ |
62 | | -} |
| 4 | +//final class LiveKyotoTests: XCTestCase { |
| 5 | +// private let descriptor = try! Descriptor( |
| 6 | +// descriptor: "wpkh(tprv8ZgxMBicQKsPf2qfrEygW6fdYseJDDrVnDv26PH5BHdvSuG6ecCbHqLVof9yZcMoM31z9ur3tTYbSnr1WBqbGX97CbXcmp5H6qeMpyvx35B/84h/1h/1h/0/*)", |
| 7 | +// network: Network.signet |
| 8 | +// ) |
| 9 | +// private let changeDescriptor = try! Descriptor( |
| 10 | +// descriptor: "wpkh(tprv8ZgxMBicQKsPf2qfrEygW6fdYseJDDrVnDv26PH5BHdvSuG6ecCbHqLVof9yZcMoM31z9ur3tTYbSnr1WBqbGX97CbXcmp5H6qeMpyvx35B/84h/1h/1h/1/*)", |
| 11 | +// network: Network.signet |
| 12 | +// ) |
| 13 | +// private let peer = IpAddress.fromIpv4(q1: 68, q2: 47, q3: 229, q4: 218) |
| 14 | +// private let cwd = FileManager.default.currentDirectoryPath.appending("/temp") |
| 15 | +// |
| 16 | +// override func tearDownWithError() throws { |
| 17 | +// let fileManager = FileManager.default |
| 18 | +// if fileManager.fileExists(atPath: cwd) { |
| 19 | +// try fileManager.removeItem(atPath: cwd) |
| 20 | +// } |
| 21 | +// } |
| 22 | +// |
| 23 | +// // See: https://github.com/bitcoindevkit/bdk-ffi/issues/842 |
| 24 | +// /* |
| 25 | +// func testSuccessfullySyncs() async throws { |
| 26 | +// let persister = try Persister.newInMemory() |
| 27 | +// let wallet = try Wallet( |
| 28 | +// descriptor: descriptor, |
| 29 | +// changeDescriptor: changeDescriptor, |
| 30 | +// network: Network.signet, |
| 31 | +// persister: persister |
| 32 | +// ) |
| 33 | +// let trustedPeer = Peer(address: peer, port: nil, v2Transport: false) |
| 34 | +// let lightClient = try CbfBuilder() |
| 35 | +// .peers(peers: [trustedPeer]) |
| 36 | +// .connections(connections: 1) |
| 37 | +// .scanType(scanType: ScanType.new) |
| 38 | +// .dataDir(dataDir: cwd) |
| 39 | +// .build(wallet: wallet) |
| 40 | +// let client = lightClient.client |
| 41 | +// let node = lightClient.node |
| 42 | +// node.run() |
| 43 | +// Task { |
| 44 | +// while true { |
| 45 | +// if let log = try? await client.nextLog() { |
| 46 | +// print("\(log)") |
| 47 | +// } |
| 48 | +// } |
| 49 | +// } |
| 50 | +// let update = try await client.update() |
| 51 | +// try wallet.applyUpdate(update: update) |
| 52 | +// let address = wallet.revealNextAddress(keychain: KeychainKind.external).address.description |
| 53 | +// XCTAssertGreaterThan( |
| 54 | +// wallet.balance().total.toSat(), |
| 55 | +// UInt64(0), |
| 56 | +// "Wallet must have positive balance, please send funds to \(address)" |
| 57 | +// ) |
| 58 | +// print("Update applied correctly") |
| 59 | +// try client.shutdown() |
| 60 | +// } |
| 61 | +// */ |
| 62 | +//} |
0 commit comments