From 757c1975adb830d158eb50afa3776cf2c5eb7245 Mon Sep 17 00:00:00 2001 From: Simon McLoughlin Date: Tue, 28 May 2024 14:45:18 +0100 Subject: [PATCH] add some extra tests --- Tests/KukaiCryptoSwiftTests/KeyPairTests.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tests/KukaiCryptoSwiftTests/KeyPairTests.swift b/Tests/KukaiCryptoSwiftTests/KeyPairTests.swift index dec436c..8ea4895 100644 --- a/Tests/KukaiCryptoSwiftTests/KeyPairTests.swift +++ b/Tests/KukaiCryptoSwiftTests/KeyPairTests.swift @@ -205,18 +205,23 @@ final class KeyPairTests: XCTestCase { func testImportingWalletFromPrivateKey() { let tz1UnencryptedSeed = KeyPair.regular(fromSecretKey: "edsk3KvXD8SVD9GCyU4jbzaFba2HZRad5pQ7ajL79n7rUoc3nfHv5t", andPassphrase: nil) XCTAssert(tz1UnencryptedSeed?.publicKey.publicKeyHash == "tz1Qvpsq7UZWyQ4yabf9wGpG97testZCjoCH", tz1UnencryptedSeed?.publicKey.publicKeyHash ?? "-") + XCTAssert(tz1UnencryptedSeed?.publicKey.signingCurve == .ed25519, tz1UnencryptedSeed?.publicKey.signingCurve.rawValue ?? "-") let tz1UnencryptedPk = KeyPair.regular(fromSecretKey: "edskRgQqEw17KMib89AzChu8DiJjmVeDfGmbCMpp7MpmhgTdNVvZ3TTaLfwNoux4hDDVeLxmEJxKiYE1cYp1Vgj6QATKaJa58L", andPassphrase: nil) XCTAssert(tz1UnencryptedPk?.publicKey.publicKeyHash == "tz1Ue76bLW7boAcJEZf2kSGcamdBKVi4Kpss", tz1UnencryptedPk?.publicKey.publicKeyHash ?? "-") + XCTAssert(tz1UnencryptedPk?.publicKey.signingCurve == .ed25519, tz1UnencryptedPk?.publicKey.signingCurve.rawValue ?? "-") let tz1Encrypted = KeyPair.regular(fromSecretKey: "edesk1L8uVSYd3aug7jbeynzErQTnBxq6G6hJwmeue3yUBt11wp3ULXvcLwYRzDp4LWWvRFNJXRi3LaN7WGiEGhh", andPassphrase: "pa55word") XCTAssert(tz1Encrypted?.publicKey.publicKeyHash == "tz1XztestvvcXSQZUbZav5YgVLRQbxC4GuMF", tz1Encrypted?.publicKey.publicKeyHash ?? "-") + XCTAssert(tz1Encrypted?.publicKey.signingCurve == .ed25519, tz1Encrypted?.publicKey.signingCurve.rawValue ?? "-") let tz2Unencrypted = KeyPair.regular(fromSecretKey: "spsk29hF9oJ6koNnnJMs1rXz4ynBs8hL8FyubTNPCu2tCVP5beGDbw", andPassphrase: nil) XCTAssert(tz2Unencrypted?.publicKey.publicKeyHash == "tz2RbUirt95UQHa9YyxcLj9GusNctxwn3Xi1", tz2Unencrypted?.publicKey.publicKeyHash ?? "-") + XCTAssert(tz2Unencrypted?.publicKey.signingCurve == .secp256k1, tz2Unencrypted?.publicKey.signingCurve.rawValue ?? "-") let tz2Encrypted = KeyPair.regular(fromSecretKey: "spesk1S5bMTCyH9z4mHSpnbn6DBY831DD6Rxgq7ANfEKkngoHSwy6B5odh942TKL6DtLbfTkpTHfSTAQu2d72Qd6", andPassphrase: "pa55word") XCTAssert(tz2Encrypted?.publicKey.publicKeyHash == "tz2C8APAjnQfffdkHssxdFRctkD1iPLGaGEg", tz2Encrypted?.publicKey.publicKeyHash ?? "-") + XCTAssert(tz2Encrypted?.publicKey.signingCurve == .secp256k1, tz2Encrypted?.publicKey.signingCurve.rawValue ?? "-") } func testIsEncrypted() {