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

πŸ›(lld) hedera split address #8381

Merged
merged 1 commit into from
Dec 23, 2024
Merged

πŸ›(lld) hedera split address #8381

merged 1 commit into from
Dec 23, 2024

Conversation

LucasWerey
Copy link
Contributor

@LucasWerey LucasWerey commented Nov 15, 2024

βœ… Checklist

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • split address

πŸ“ Description

Split address didn't consider special characters that's why hedera address was strangely displayed. The bug was surely with all other coin with address containing special chars
All other addresses won't be affected since we now use a condition

This may change the splitting since we are based on the dots but Hedera might be the only to have addresses with special char in it

Note

The behaviour has been validated by Product since the split with dots of an Hedera address should be rare. And there is no other addresses like this AFAWK

Before After
image image

❓ 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)

@LucasWerey LucasWerey requested a review from a team as a code owner November 15, 2024 17:48
Copy link

vercel bot commented Nov 15, 2024

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
ledger-live-github-bot ⬜️ Ignored (Inspect) Visit Preview Dec 23, 2024 1:49pm
native-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Dec 23, 2024 1:49pm
react-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Dec 23, 2024 1:49pm
web-tools ⬜️ Ignored (Inspect) Visit Preview Dec 23, 2024 1:49pm

@live-github-bot live-github-bot bot added the desktop Has changes in LLD label Nov 15, 2024
KVNLS
KVNLS previously requested changes Nov 20, 2024

// FIXME why not using CSS for this? meaning we might be able to have a left & right which both take 50% & play with overflow & text-align
const left = value.slice(0, third);
const right = value.slice(third, value.length);
let left, right;
Copy link
Member

Choose a reason for hiding this comment

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

We need a unit test here. Please extract this into a dedicated function that returns left and right and we can check all possibilities.

Comment on lines 27 to 41
let left, right;
if (value.includes(".")) {
const parts = value.split(".");
left = parts[0] + ".";
right = parts.slice(1).join(".");
} else {
const third = Math.round(value.length / 3);
left = value.slice(0, third);
right = value.slice(third, value.length);
}

Copy link
Contributor

@mcayuelas-ledger mcayuelas-ledger Nov 27, 2024

Choose a reason for hiding this comment

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

You should put this part outside your component, and add unit test :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I will I just did a rebase

@LucasWerey LucasWerey dismissed KVNLS’s stale review December 23, 2024 14:01

Dismissed because of days off

@LucasWerey LucasWerey merged commit 80f5a8f into develop Dec 23, 2024
40 of 41 checks passed
@LucasWerey LucasWerey deleted the fix/LIVE-14751 branch December 23, 2024 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
desktop Has changes in LLD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants