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-5986 Validate derivation for edslip #2920

Merged
merged 3 commits into from
Mar 7, 2024

Conversation

tureck1y
Copy link
Collaborator

@tureck1y tureck1y commented Mar 4, 2024

Добавил валидацию деривации для edslip. В идеале надо валидировать инпут, но это уже можно будет сделать отдельно на новом кастом менедж токенс, если захочется. Сейчас закрываю такую возможность на более низком уровне

TODO: поднять тэг сдк с игнорированием ошибок tangem/tangem-sdk-ios#341

@tureck1y tureck1y requested review from ba1ashov and megakoko March 4, 2024 17:23
@tureck1y tureck1y added the blocked Awaiting other tasks label Mar 4, 2024
@tureck1y tureck1y marked this pull request as ready for review March 4, 2024 17:24
@tureck1y tureck1y requested a review from a team as a code owner March 4, 2024 17:24
@tureck1y tureck1y requested review from skibinalexander and removed request for megakoko March 5, 2024 14:50
ba1ashov
ba1ashov previously approved these changes Mar 5, 2024
@@ -93,6 +94,14 @@ class CommonUserTokensManager {
let tokenItems = converter.convertToTokenItem(nonCustomTokens)
swapAvailabilityController.loadSwapAvailability(for: tokenItems, forceReload: forceReload, userWalletId: userWalletId.stringValue)
}

private func validateDerivation(for tokenItem: TokenItem) throws {
Copy link
Contributor

Choose a reason for hiding this comment

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

В целом был еще вот такой метод:

addTokenItemPrecondition

Copy link
Contributor

Choose a reason for hiding this comment

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

возможно я по flow путаю где надо ошибку кинуть, но там метод как раз на проверки добавления

Copy link
Contributor

Choose a reason for hiding this comment

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

И тогда возможно не придется тянуть throws, но throws я бы оставил конечно

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Не очень понял что ты имеешь в виду. Внутри addTokenItemPrecondition тоже вызывается validateDerivation

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Тут я сделал так, чтобы не было возможности добавить токен с неправильной деривацией, поэтому throws нужен

skibinalexander
skibinalexander previously approved these changes Mar 5, 2024
@tureck1y tureck1y dismissed stale reviews from skibinalexander and ba1ashov via 6feb50e March 6, 2024 18:09
@tureck1y tureck1y removed the blocked Awaiting other tasks label Mar 6, 2024
@tureck1y
Copy link
Collaborator Author

tureck1y commented Mar 6, 2024

обновил тэг и починил конфликты в подфайле

@tureck1y tureck1y enabled auto-merge March 6, 2024 18:15
@tureck1y tureck1y merged commit 6087024 into develop Mar 7, 2024
3 checks passed
@tureck1y tureck1y deleted the IOS-5986_validate_derivation branch March 7, 2024 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants