Skip to content

Commit 12b781f

Browse files
committed
- Grammar fixed
- Removed prefix path from address generation
1 parent 2af0c71 commit 12b781f

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

Sources/Web3Core/KeystoreManager/BIP32Keystore.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,12 @@ public class BIP32Keystore: AbstractKeystore {
217217
}
218218

219219
/// Fast generation addresses for current account
220-
/// used for shows wich address user wiil get when changed number of his wallet
220+
/// used for shows which address user will get when changed number of his wallet
221221
/// - Parameters:
222222
/// - password: password of seed storage
223-
/// - preffixPath: preffix of Derivation Path without account number
224-
/// - number: number of wallets adresses needed to generate from 0 to number-1
223+
/// - number: number of wallets addresses needed to generate from 0 to number-1
225224
/// - Returns: Array of addresses generated from 0 to number bound, or empty array in case of error
226-
public func getAddressForAccount(password: String, preffixPath: String, number: Int) -> [EthereumAddress] {
225+
public func getAddressForAccount(password: String, number: Int) -> [EthereumAddress] {
227226
guard let decryptedRootNode = try? getPrefixNodeData(password) else {
228227
return []
229228
}
@@ -235,7 +234,7 @@ public class BIP32Keystore: AbstractKeystore {
235234

236235
return [Int](0..<number).compactMap({ number in
237236
pathAppendix = nil
238-
let path = preffixPath + "/\(number)"
237+
let path = prefixPath + "/\(number)"
239238
if path.hasPrefix(prefixPath) {
240239
let upperIndex = (path.range(of: prefixPath)?.upperBound)!
241240
if upperIndex < path.endIndex {

Tests/web3swiftTests/localTests/BIP32KeystoreTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ class BIP32KeystoreTests: XCTestCase {
3030
}
3131

3232
let addresses = keystore.getAddressForAccount(password: password,
33-
preffixPath: HDNode.defaultPathMetamaskPrefix,
3433
number: addressesCount)
3534
XCTAssertEqual(addresses.count, addressesCount)
3635
XCTAssertNotEqual(addresses[11], addresses[1])

0 commit comments

Comments
 (0)