From 2af0c711f7b3852046f4d436cd55a8a85dd89315 Mon Sep 17 00:00:00 2001 From: 6od9i <6od911@gmail.com> Date: Thu, 29 Jun 2023 11:01:07 +0400 Subject: [PATCH] Addresses generator (#1) - Generation amount of addresses added - Generation wallet with index > 9 fixed - Test generation addresses added --- .../KeystoreManager/BIP32Keystore.swift | 53 +++++++++++++++++- .../localTests/BIP32KeystoreTests.swift | 54 +++++++++++++++++++ 2 files changed, 105 insertions(+), 2 deletions(-) create mode 100644 Tests/web3swiftTests/localTests/BIP32KeystoreTests.swift diff --git a/Sources/Web3Core/KeystoreManager/BIP32Keystore.swift b/Sources/Web3Core/KeystoreManager/BIP32Keystore.swift index 4277cca61..003ba7fd5 100755 --- a/Sources/Web3Core/KeystoreManager/BIP32Keystore.swift +++ b/Sources/Web3Core/KeystoreManager/BIP32Keystore.swift @@ -177,7 +177,7 @@ public class BIP32Keystore: AbstractKeystore { if path.hasPrefix(prefixPath) { let upperIndex = (path.range(of: prefixPath)?.upperBound)! if upperIndex < path.endIndex { - pathAppendix = String(path[path.index(after: upperIndex)]) + pathAppendix = String(path[path.index(after: upperIndex).. [EthereumAddress] { + guard let decryptedRootNode = try? getPrefixNodeData(password) else { + return [] + } + guard let rootNode = HDNode(decryptedRootNode) else { + return [] + } + let prefixPath = self.rootPrefix + var pathAppendix: String? + + return [Int](0..