Skip to content

Commit b82e347

Browse files
authored
Merge pull request #2 from JeneaVranceanu/develop-6od9i
fix: createNewAccount always non-hardened derivation
2 parents 7876390 + a9ed5cd commit b82e347

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

Sources/Web3Core/KeystoreManager/BIP32Keystore.swift

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,7 @@ public class BIP32Keystore: AbstractKeystore {
156156
guard let newAddress = Utilities.publicToAddress(newNode.publicKey) else {
157157
throw AbstractKeystoreError.keyDerivationError
158158
}
159-
160-
let prefixPath = self.rootPrefix
161-
var newPath: String
162-
163-
if newNode.isHardened {
164-
newPath = prefixPath + "/" + String(newNode.index % HDNode.hardenedIndexPrefix) + "'"
165-
} else {
166-
newPath = prefixPath + "/" + String(newNode.index)
167-
}
159+
let newPath = rootPrefix + "/" + String(newNode.index)
168160
addressStorage.add(address: newAddress, for: newPath)
169161
}
170162

0 commit comments

Comments
 (0)