Skip to content

Commit 5ebb1d9

Browse files
author
YS
committed
Make -createNewAccount- an internal function and remove -password- argument
1 parent cdfb984 commit 5ebb1d9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/Web3Core/KeystoreManager/BIP32Keystore.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public class BIP32Keystore: AbstractKeystore {
111111
addressStorage = PathAddressStorage()
112112
guard let rootNode = HDNode(seed: seed)?.derive(path: prefixPath, derivePrivateKey: true) else { return nil }
113113
self.rootPrefix = prefixPath
114-
try createNewAccount(parentNode: rootNode, password: password)
114+
try createNewAccount(parentNode: rootNode)
115115
guard let serializedRootNode = rootNode.serialize(serializePublic: false) else {
116116
throw AbstractKeystoreError.keyDerivationError
117117
}
@@ -129,14 +129,14 @@ public class BIP32Keystore: AbstractKeystore {
129129
guard rootNode.depth == prefixPath.components(separatedBy: "/").count - 1 else {
130130
throw AbstractKeystoreError.encryptionError("Derivation depth mismatch")
131131
}
132-
try createNewAccount(parentNode: rootNode, password: password)
132+
try createNewAccount(parentNode: rootNode)
133133
guard let serializedRootNode = rootNode.serialize(serializePublic: false) else {
134134
throw AbstractKeystoreError.keyDerivationError
135135
}
136136
try encryptDataToStorage(password, data: serializedRootNode, aesMode: self.keystoreParams!.crypto.cipher)
137137
}
138138

139-
func createNewAccount(parentNode: HDNode, password: String = "web3swift") throws {
139+
internal func createNewAccount(parentNode: HDNode) throws {
140140
let maxIndex = addressStorage.paths
141141
.compactMap { $0.components(separatedBy: "/").last }
142142
.compactMap { UInt32($0) }

0 commit comments

Comments
 (0)