-
Notifications
You must be signed in to change notification settings - Fork 106
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
Update multi wallet balance #1315
Conversation
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.
looks good
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.
Looks great!
balance = token_contract.functions.balanceOf(wallet).call() | ||
delegation_balance = delegate_manager_contract.functions.getTotalDelegatorStake(wallet).call() | ||
stake_balance = staking_contract.functions.totalStakedFor(wallet).call() | ||
associated_balance += balance + delegation_balance + stake_balance |
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.
So these are definitely safe to just add together, yeah?
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.
yeah!
Description
Adds support for updating the user's audio balance in discovery with multiple wallets
Changes
associated_wallets_balance
to theuser_balances
table.populate_user_metadata
function to add a fieldassociated_wallets_balance
, so that the client can sum the totals to calculate the user's badge.Tests
I ran the system locally, added associated wallets, and staked and delegated with those wallets. I checked that the balances were updated in the Discovery DB and that the correct amounts were passed back when querying for the user.