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

fix: balance fetching bugs #10936

Merged
merged 4 commits into from
Sep 11, 2024
Merged

fix: balance fetching bugs #10936

merged 4 commits into from
Sep 11, 2024

Conversation

hassnian
Copy link
Contributor

@hassnian hassnian commented Sep 5, 2024

PR Type

  • Bugfix
  • Feature
  • Refactoring

Context

CleanShot.2024-09-06.at.12.10.40.mp4
  • Fixes: wallet vm and chain vm mismatch balance fetch using identityStore.fetchBalance

covers case where wallet vm and current chain's vm do not match, since prefix is unknown at that moment we are resorting to a fallbacks instate of not making a balance fetch

Example

evm wallet is connected , chain is ahp , navbar makes a balance fetch

this happens in the navbar and sidebar, in these scenarios what prefix should be fetched ?

@kodadot/internal-dev pls feel free to suggest any other solution.

Screenshot 📸

  • My fix has changed something on UI;
CleanShot.2024-09-06.at.12.05.08.mp4

Copy link

netlify bot commented Sep 5, 2024

Deploy Preview for koda-canary ready!

Name Link
🔨 Latest commit b27f782
🔍 Latest deploy log https://app.netlify.com/sites/koda-canary/deploys/66dea440f8144200088c912a
😎 Deploy Preview https://deploy-preview-10936--koda-canary.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@hassnian hassnian changed the title fix: Sub wallet balance not loading when evm chain is selected fix: balance fetching bugs Sep 5, 2024
@Jarsen136
Copy link
Contributor

evm wallet is connected , chain is ahp , navbar makes a balance fetch

this happens in the navbar and sidebar, in these scenarios what prefix should be fetched ?

IMO, the balance should always match the current connect wallet.
For example:
Connect with EVM wallet: fetch balance on base \ mantle etc.
Connect with SUB wallet: fetch balance on ahp\ahk\dot etc.

@hassnian
Copy link
Contributor Author

hassnian commented Sep 6, 2024

evm wallet is connected , chain is ahp , navbar makes a balance fetch
this happens in the navbar and sidebar, in these scenarios what prefix should be fetched ?

IMO, the balance should always match the current connect wallet. For example: Connect with EVM wallet: fetch balance on base \ mantle etc. Connect with SUB wallet: fetch balance on ahp\ahk\dot etc.

method: identityStore.fetchBalance

if evm wallet is connected and you are on ahp chain what chain should the balance to be fetched, 'base', 'imx' , etc
same when a sub wallet is connected and you are on evm chain.

let me know if it makes sense.

@Jarsen136
Copy link
Contributor

if evm wallet is connected and you are on ahp chain what chain should the balance to be fetched, 'base', 'imx' , etc

It's also what I want.

same when a sub wallet is connected and you are on evm chain.

I'm not sure what you mean by the same. In this case, it should shows all the balance on sub, dot ahp ahk etc.

In short, the balances should always correspond to the type of wallet, regardless of the network prefix.

hassnian and others added 2 commits September 9, 2024 12:25
covers case where wallet is disconnected and fetch is still in progress
Copy link

sonarcloud bot commented Sep 9, 2024

@hassnian hassnian marked this pull request as ready for review September 9, 2024 12:11
@hassnian hassnian requested a review from a team as a code owner September 9, 2024 12:11
@hassnian hassnian requested review from preschian and removed request for a team September 9, 2024 12:11
@vikiival
Copy link
Member

vikiival commented Sep 9, 2024

pls @kodadot/internal-dev waiting for review 🥺

Copy link
Contributor

@Jarsen136 Jarsen136 left a comment

Choose a reason for hiding this comment

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

work for me

@hassnian hassnian added the S-code-lgtm-✅ code review guild has reviewed this PR and it's code is approved label Sep 10, 2024
@vikiival vikiival added this pull request to the merge queue Sep 11, 2024
Merged via the queue into kodadot:main with commit d650adf Sep 11, 2024
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-code-lgtm-✅ code review guild has reviewed this PR and it's code is approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sub wallet balance not loading when evm chain is selected
4 participants