Skip to content

Commit

Permalink
Merge pull request #341 from tangem/IOS-5986_skip_derivation_errors
Browse files Browse the repository at this point in the history
IOS-5986 Skip derivation errors
  • Loading branch information
tureck1y authored Mar 6, 2024
2 parents 94c1a69 + a205aca commit 68fcf88
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,22 @@ public class DeriveWalletPublicKeysTask: CardSessionRunnable {
let path = derivationPaths[index]
let task = DeriveWalletPublicKeyTask(walletPublicKey: walletPublicKey, derivationPath: path)
task.run(in: session) { result in
var keys = keys

switch result {
case .success(let key):
var keys = keys
keys[path] = key
self.runDerivation(at: index + 1, keys: keys, in: session, completion: completion)
case .failure(let error):
completion(.failure(error))
switch error {
case .nonHardenedDerivationNotSupported, .walletNotFound, .unsupportedCurve:
Log.error(error)
default:
completion(.failure(error))
return
}
}

self.runDerivation(at: index + 1, keys: keys, in: session, completion: completion)
}
}
}

0 comments on commit 68fcf88

Please sign in to comment.