-
Notifications
You must be signed in to change notification settings - Fork 14
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
Fix: Fixes for fetchDomainBalance lambda edge cases #3665
Conversation
Fix: Fixes for fetchDomainBalance lambda edge cases
aedb9c9
to
f6ca765
Compare
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.
const periodForTimeframe = getPeriodFor( | ||
timeframePeriod, | ||
timeframeType, | ||
timeframePeriodEndDate, | ||
); | ||
|
||
console.log( |
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.
Intentional or a leftover 👀 ?
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.
Intentional, so we can get some more information if there is an error in a specific call
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.
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
getTotalFiatAmountFor
- for this I have actually added a filter for the actions before reaching this step as it doesn't make sense to include the actions that don't have atoken
and anamount
/networkFee
NetworkConfig
- actually for this one I added a fallback to thenetwork
env var if the colony js mapping does not existday
/month
/week
/year
Testing
TODO: Please test the fetchDomainBalance lambda and check these edge cases are covered.
Don't know how to easily do this on
DEV
without actually changing directly into code the used values as in for eg. adding anull
token or usingarbitrumOne
as a value for thenetwork
env var etc. So let's do this 🦾Important
To check the values returned or logged in a lambda, you need to always run the
getDomainBalance
query and then check theamplify
logsStep 1. Let's make sure the query runs as expected first
Step 2. Now let's try to break it by using a negative or 0
timeframePeriod
Step 3. For the next queries please change back the
timeframePeriod
to a value> 0
Step 4. Go to
amplify/backend/function/fetchDomainBalance/src/config/envVars.js
and replacelet network = Network.Custom;
withlet network = 'arbitrumOne'
Step 5. Now in
amplify/backend/function/fetchDomainBalance/src/config/networkConfig.js
check theDEFAULT_NETWORK_TOKEN
andDEFAULT_NETWORK_INFO
Step 6. Go to
amplify/backend/function/fetchDomainBalance/src/utils.js
go togetFormattedActions
and replace the code withStep 7. Go to
amplify/backend/function/fetchDomainBalance/src/index.js
and checkinOutActions
don't contain the regular actions (Simple payments
orTransfer funds
)Resolves #3658