2023-10-27 14:13:44 -04:00
|
|
|
import XCTest
|
|
|
|
@testable import BitcoinDevKit
|
|
|
|
|
|
|
|
final class OfflineDescriptorTests: XCTestCase {
|
|
|
|
func testDescriptorBip86() throws {
|
|
|
|
let mnemonic: Mnemonic = try Mnemonic.fromString(mnemonic: "space echo position wrist orient erupt relief museum myself grain wisdom tumble")
|
|
|
|
let descriptorSecretKey: DescriptorSecretKey = DescriptorSecretKey(
|
|
|
|
network: Network.testnet,
|
|
|
|
mnemonic: mnemonic,
|
|
|
|
password: nil
|
|
|
|
)
|
|
|
|
let descriptor: Descriptor = Descriptor.newBip86(
|
|
|
|
secretKey: descriptorSecretKey,
|
|
|
|
keychain: KeychainKind.external,
|
|
|
|
network: Network.testnet
|
|
|
|
)
|
|
|
|
|
2024-06-12 20:08:14 -05:00
|
|
|
XCTAssertEqual(descriptor.description, "tr([be1eec8f/86'/1'/0']tpubDCTtszwSxPx3tATqDrsSyqScPNnUChwQAVAkanuDUCJQESGBbkt68nXXKRDifYSDbeMa2Xg2euKbXaU3YphvGWftDE7ozRKPriT6vAo3xsc/0/*)#m7puekcx")
|
2023-10-27 14:13:44 -04:00
|
|
|
}
|
|
|
|
}
|