diff --git a/bdk-swift/Tests/BitcoinDevKitTests/BitcoinDevKitTests.swift b/bdk-swift/Tests/BitcoinDevKitTests/BitcoinDevKitTests.swift index d4dcbe1e..c83c5774 100644 --- a/bdk-swift/Tests/BitcoinDevKitTests/BitcoinDevKitTests.swift +++ b/bdk-swift/Tests/BitcoinDevKitTests/BitcoinDevKitTests.swift @@ -25,4 +25,17 @@ final class BitcoinDevKitTests: XCTestCase { let descriptorSecretKey = DescriptorSecretKey(network: Network.testnet, mnemonic: mnemonic, password: nil) let descriptor = Descriptor.newBip86(secretKey: descriptorSecretKey, keychain: KeychainKind.external, network: Network.testnet) } + func testWallet() { + do { + let descriptor1 = try Descriptor( + descriptor: "wpkh(tprv8ZgxMBicQKsPf2qfrEygW6fdYseJDDrVnDv26PH5BHdvSuG6ecCbHqLVof9yZcMoM31z9ur3tTYbSnr1WBqbGX97CbXcmp5H6qeMpyvx35B/84h/1h/0h/0/*)", + network: Network.testnet + ) + let wallet = try Wallet(descriptor: descriptor1, changeDescriptor: nil, network: .testnet, walletType: .memory) + let addressInfo = wallet.getAddress(addressIndex: .lastUnused) + print("Address \(addressInfo.address.asString()) at index \(addressInfo.index)") + } catch { + print("testWallet error") + } + } }