Skip to content

Commit b5fb56a

Browse files
chore: dropped extra line; avoiding convertion from error to optional
Instead of calling `try? getPrefixNodeData(password)` in a function that is able to throw we must call `try getPrefixNodeData(password)`.
1 parent 5937537 commit b5fb56a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Sources/Web3Core/KeystoreManager/BIP32Keystore.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ public class BIP32Keystore: AbstractKeystore {
137137
}
138138

139139
func createNewAccount(parentNode: HDNode, password: String = "web3swift") throws {
140-
141140
let maxIndex = addressStorage.paths
142141
.compactMap { $0.components(separatedBy: "/").last }
143142
.compactMap { UInt32($0) }
@@ -167,7 +166,7 @@ public class BIP32Keystore: AbstractKeystore {
167166
}
168167

169168
public func createNewCustomChildAccount(password: String, path: String) throws {
170-
guard let decryptedRootNode = try? getPrefixNodeData(password) else {
169+
guard let decryptedRootNode = try getPrefixNodeData(password) else {
171170
throw AbstractKeystoreError.encryptionError("Failed to decrypt a keystore")
172171
}
173172
guard let rootNode = HDNode(decryptedRootNode) else {

0 commit comments

Comments
 (0)