Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IOS-7043 Return partial response #367

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ public class DeriveMultipleWalletPublicKeysTask: CardSessionRunnable {
self.response[derivation.0] = derivedKeys
self.derive(index: index + 1, in: session, completion: completion)
case .failure(let error):
completion(.failure(error))
if self.response.isEmpty {
completion(.failure(error))
} else {
// return partial response
completion(.success(self.response))
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,16 @@ public class DeriveWalletPublicKeysTask: CardSessionRunnable {
case .failure(let error):
switch error {
case .nonHardenedDerivationNotSupported, .walletNotFound, .unsupportedCurve:
// continue derivation
Log.error(error)
default:
completion(.failure(error))
if keys.keys.isEmpty {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А тут точно ок? keys.keys я сам по коду не смотрел, просто обращу внимание

completion(.failure(error))
} else {
Log.error(error)
// return partial response
completion(.success(keys))
}
return
}
}
Expand Down
Loading