Skip to content

Commit

Permalink
add some extra tests
Browse files Browse the repository at this point in the history
  • Loading branch information
simonmcl committed May 28, 2024
1 parent 69c5d6f commit 757c197
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Tests/KukaiCryptoSwiftTests/KeyPairTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 757c197

Please sign in to comment.