Skip to content

Commit 8afd803

Browse files
committed
- remove lowercasing from word retrieval to prevent masking of an issue tied to passing in words in the wrong case
- update tests to check for uppercase correctly failing tests
1 parent baba23d commit 8afd803

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Sources/KukaiCryptoSwift/Mnemonic/Mnemonic.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public struct Mnemonic: Equatable, Codable {
3030

3131
/// The list of words.
3232
public var words: [String] {
33-
phrase.lowercased().split(separator: " ").map(String.init)
33+
phrase.split(separator: " ").map(String.init)
3434
}
3535

3636
/**

Tests/KukaiCryptoSwiftTests/MnemonicTests.swift

+3
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,8 @@ final class MnemonicTests: XCTestCase {
7878

7979
let mnemonic7 = try Mnemonic(seedPhrase: "kit trigger pledge excess payment sentence dutch mandate start sense seed kit")
8080
XCTAssert(mnemonic7.isValid() == false)
81+
82+
let mnemonic8 = try Mnemonic(seedPhrase: "Kit trigger pledge excess payment sentence dutch mandate start sense seed venture")
83+
XCTAssert(mnemonic8.isValid() == false)
8184
}
8285
}

0 commit comments

Comments
 (0)