Skip to content

Commit 68fcf88

Browse files
authored
Merge pull request #341 from tangem/IOS-5986_skip_derivation_errors
IOS-5986 Skip derivation errors
2 parents 94c1a69 + a205aca commit 68fcf88

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

TangemSdk/TangemSdk/Operations/Derivation/DeriveWalletPublicKeysTask.swift

+11-3
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,22 @@ public class DeriveWalletPublicKeysTask: CardSessionRunnable {
3939
let path = derivationPaths[index]
4040
let task = DeriveWalletPublicKeyTask(walletPublicKey: walletPublicKey, derivationPath: path)
4141
task.run(in: session) { result in
42+
var keys = keys
43+
4244
switch result {
4345
case .success(let key):
44-
var keys = keys
4546
keys[path] = key
46-
self.runDerivation(at: index + 1, keys: keys, in: session, completion: completion)
4747
case .failure(let error):
48-
completion(.failure(error))
48+
switch error {
49+
case .nonHardenedDerivationNotSupported, .walletNotFound, .unsupportedCurve:
50+
Log.error(error)
51+
default:
52+
completion(.failure(error))
53+
return
54+
}
4955
}
56+
57+
self.runDerivation(at: index + 1, keys: keys, in: session, completion: completion)
5058
}
5159
}
5260
}

0 commit comments

Comments
 (0)