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

Extract swap app allowance into helper #1738

Merged
merged 5 commits into from
Jul 11, 2024
Merged

Extract swap app allowance into helper #1738

merged 5 commits into from
Jul 11, 2024

Conversation

iamacook
Copy link
Member

@iamacook iamacook commented Jul 8, 2024

Summary

Swap decoded is restricted to certain allowed apps. Now that we are decoding swap orders/transfers and TWAP orders, this check occurs in several places. There are dedicated isAppAllowed methods for both swap and TWAPs.

This extracts the multiple methods in a new SwapApps helper, calling it in every places instead.

Changes

  • Create and import SwapAppsHelper
  • Replace all calls to isAppAllowed with that from the above helper
  • Add/update tests accordingly

@iamacook iamacook self-assigned this Jul 8, 2024
@iamacook iamacook requested a review from a team as a code owner July 8, 2024 15:54
@coveralls
Copy link

coveralls commented Jul 8, 2024

Pull Request Test Coverage Report for Build 9877926707

Details

  • 19 of 31 (61.29%) changed or added relevant lines in 8 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.09%) to 48.279%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/routes/transactions/mappers/common/swap-order.mapper.ts 2 3 66.67%
src/routes/transactions/mappers/transfers/swap-transfer-info.mapper.ts 2 3 66.67%
src/routes/transactions/mappers/common/twap-order.mapper.ts 2 5 40.0%
src/routes/transactions/transactions-view.service.ts 1 4 25.0%
src/routes/transactions/helpers/swap-apps.helper.ts 9 13 69.23%
Totals Coverage Status
Change from base Build 9877650171: 0.09%
Covered Lines: 4258
Relevant Lines: 7090

💛 - Coveralls

Base automatically changed from transaction-data-finder to main July 10, 2024 16:06
Copy link
Member

@hectorgomezv hectorgomezv left a comment

Choose a reason for hiding this comment

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

LGTM 👏🏻 But I think a rebase is needed to solve the conflicts.

@iamacook iamacook merged commit c601615 into main Jul 11, 2024
16 checks passed
@iamacook iamacook deleted the swap-apps-helper branch July 11, 2024 07:06
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