-
Notifications
You must be signed in to change notification settings - Fork 85
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
feat: earn asset details for aaveUSDC #5403
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5403 +/- ##
==========================================
+ Coverage 86.12% 86.14% +0.01%
==========================================
Files 744 744
Lines 30267 30291 +24
Branches 5171 5181 +10
==========================================
+ Hits 26068 26093 +25
+ Misses 3971 3970 -1
Partials 228 228
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
# Conflicts: # src/earn/EarnActivePool.tsx
# Conflicts: # locales/base/translation.json
# Conflicts: # src/earn/EarnActivePool.tsx
src/earn/EarnActivePool.tsx
Outdated
return fetchAavePoolInfo({ | ||
assetAddress: depositToken.address, | ||
contractAddress: networkConfig.arbAavePoolV3ContractAddress, | ||
network: Network.Arbitrum, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be inferred from the depositToken
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in f9cc578. I wonder if all the type guards for fetchAavePoolInfo
are a bit overkill instead of typecasting and using optional chaining having fetchAavePoolInfo
throw instead. Now whenever someone wants to use fetchAavePoolInfo
they'll need to use about ~25 lines of type guards to use this function. It might make sense to make these guards reusable the next time we use fetchAavePoolInfo
somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made these top checks a bit shorter in 27c08ed. It might be worthwhile to create a isValidToken
util function to cover the remaining checks if we are finding we are reusing them frequently.
<View style={styles.buttonContainer}> | ||
<Button | ||
onPress={() => { | ||
navigate(Screens.TabDiscover) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add an analytics event here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### Description Expands on the work in valora-inc#5400 to allow the multiple button types and pools in `EarnCard.tsx`. This abstraction should now work for any Aave v3 pools on any network and sets up the ability to handle multiple pools with only layout changes needed when designs are ready. ### Test plan - [x] Tested locally on iOS - [x] Tested locally on Android - [x] Unit tests added and updated ### Related issues - Fixes ACT-1185 ### Backwards compatibility Yes ### Network scalability If a new NetworkId and/or Network are added in the future, the changes in this PR will: - [x] Continue to work without code changes, OR trigger a compilation error (guaranteeing we find it when a new network is added)
Description
Expands on the work in #5400 to allow the multiple button types and pools in
EarnCard.tsx
. This abstraction should now work for any Aave v3 pools on any network and sets up the ability to handle multiple pools with only layout changes needed when designs are ready.Test plan
Related issues
Backwards compatibility
Yes
Network scalability
If a new NetworkId and/or Network are added in the future, the changes in this PR will: