@@ -10,32 +10,13 @@ final class OfflineWalletTests: XCTestCase {
10
10
descriptor: " wpkh(tprv8ZgxMBicQKsPf2qfrEygW6fdYseJDDrVnDv26PH5BHdvSuG6ecCbHqLVof9yZcMoM31z9ur3tTYbSnr1WBqbGX97CbXcmp5H6qeMpyvx35B/84h/1h/0h/1/*) " ,
11
11
network: Network . signet
12
12
)
13
- var dbFilePath : URL !
14
-
15
- override func setUpWithError( ) throws {
16
- super. setUp ( )
17
- let fileManager = FileManager . default
18
- let documentDirectory = fileManager. urls ( for: . documentDirectory, in: . userDomainMask) . first!
19
- let uniqueDbFileName = " bdk_persistence_ \( UUID ( ) . uuidString) .sqlite "
20
- dbFilePath = documentDirectory. appendingPathComponent ( uniqueDbFileName)
21
-
22
- if fileManager. fileExists ( atPath: dbFilePath. path) {
23
- try fileManager. removeItem ( at: dbFilePath)
24
- }
25
- }
26
-
27
- override func tearDownWithError( ) throws {
28
- let fileManager = FileManager . default
29
- if fileManager. fileExists ( atPath: dbFilePath. path) {
30
- try fileManager. removeItem ( at: dbFilePath)
31
- }
32
- }
33
-
13
+
34
14
func testNewAddress( ) throws {
35
- let connection = try Connection ( path : dbFilePath . path )
36
- let wallet = try Wallet . load (
15
+ let connection = try Connection . newInMemory ( )
16
+ let wallet = try Wallet (
37
17
descriptor: descriptor,
38
18
changeDescriptor: changeDescriptor,
19
+ network: . signet,
39
20
connection: connection
40
21
)
41
22
let addressInfo : AddressInfo = wallet. revealNextAddress ( keychain: KeychainKind . external)
@@ -53,10 +34,11 @@ final class OfflineWalletTests: XCTestCase {
53
34
}
54
35
55
36
func testBalance( ) throws {
56
- let connection = try Connection ( path : dbFilePath . path )
57
- let wallet = try Wallet . load (
37
+ let connection = try Connection . newInMemory ( )
38
+ let wallet = try Wallet (
58
39
descriptor: descriptor,
59
40
changeDescriptor: changeDescriptor,
41
+ network: . signet,
60
42
connection: connection
61
43
)
62
44
0 commit comments