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: LIVE-15628: Convert account address to wallet api id which is the value expected by the dapp browser V2 #8858

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

adammino-ledger
Copy link
Contributor

@adammino-ledger adammino-ledger commented Jan 9, 2025

✅ Checklist

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • The Wallet API account is passed now as a parameter to the eth staking modal rather than the LL Account

📝 Description

This PR converts the account address selected on LL to the wallet api id which is the value expected by the dapp browser V2

❓ Context


🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.
  • Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)

@adammino-ledger adammino-ledger requested review from a team as code owners January 9, 2025 17:02
Copy link

vercel bot commented Jan 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
native-ui-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 10, 2025 2:03pm
react-ui-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 10, 2025 2:03pm
web-tools ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 10, 2025 2:03pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
ledger-live-github-bot ⬜️ Ignored (Inspect) Visit Preview Jan 10, 2025 2:03pm

@live-github-bot live-github-bot bot added desktop Has changes in LLD common Has changes in live-common labels Jan 9, 2025
@adammino-ledger adammino-ledger requested a review from a team as a code owner January 10, 2025 11:22
@adammino-ledger adammino-ledger requested a review from a team as a code owner January 10, 2025 12:07
@@ -87,13 +87,13 @@ export function EthStakingModalBody({

const checkBoxOnChange = useCallback(() => {
const value = !doNotShowAgain;
global.localStorage.setItem(`${LOCAL_STORAGE_KEY_PREFIX}${account?.currency?.id}`, `${value}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's important to use the currency id here and not account id as we want the checkBox to work on all accounts for a given currency
I think you should be able to use account?.currency for this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a deprecated file, i checked on the codebase, it's not actually used anywhere. However I changed to account id as it's a key to store something on the local storage so it should in theory be unique, account?.currency wouldn't be unique as more accounts can be having the same currency. But let me know if you still want me to do the change, i don't mind

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure why we still have it then but I would prefer to keep it correct for the logic

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah but then "However I changed to account id as it's a key to store something on the local storage so it should in theory be unique, account?.currency wouldn't be unique as more accounts can be having the same currency. But let me know if you still want me to do the change, i don't mind" ? if i change it to currency is it not gonna be unique i guess ? it's just a key for the local storage

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can revert the changes (or most of them) in this file too now that we only use accountToWalletAPIAccount

Copy link
Contributor Author

@adammino-ledger adammino-ledger Jan 10, 2025

Choose a reason for hiding this comment

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

I thought the function wouldn't hurt. I used it on the same file, and it could be useful for that conversion on the outside. Do you still want me to revert it ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose we could keep it

@adammino-ledger
Copy link
Contributor Author

adammino-ledger commented Jan 10, 2025

@adammino-ledger

Generating screenshots: workflow ended

Jobs status:
❌ - generate-screenshots-linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common Has changes in live-common desktop Has changes in LLD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants