Skip to content

Commit

Permalink
- remove lowercasing from word retrieval to prevent masking of an iss…
Browse files Browse the repository at this point in the history
…ue tied to passing in words in the wrong case

- update tests to check for uppercase correctly failing tests
  • Loading branch information
simonmcl committed Apr 30, 2024
1 parent baba23d commit 8afd803
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/KukaiCryptoSwift/Mnemonic/Mnemonic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public struct Mnemonic: Equatable, Codable {

/// The list of words.
public var words: [String] {
phrase.lowercased().split(separator: " ").map(String.init)
phrase.split(separator: " ").map(String.init)
}

/**
Expand Down
3 changes: 3 additions & 0 deletions Tests/KukaiCryptoSwiftTests/MnemonicTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,8 @@ final class MnemonicTests: XCTestCase {

let mnemonic7 = try Mnemonic(seedPhrase: "kit trigger pledge excess payment sentence dutch mandate start sense seed kit")
XCTAssert(mnemonic7.isValid() == false)

let mnemonic8 = try Mnemonic(seedPhrase: "Kit trigger pledge excess payment sentence dutch mandate start sense seed venture")
XCTAssert(mnemonic8.isValid() == false)
}
}

0 comments on commit 8afd803

Please sign in to comment.