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

chore: remove unused Account#freshAddresses field #6523

Merged
merged 1 commit into from
Apr 26, 2024
Merged

chore: remove unused Account#freshAddresses field #6523

merged 1 commit into from
Apr 26, 2024

Conversation

gre
Copy link
Contributor

@gre gre commented Mar 22, 2024

βœ… Checklist

  • npx changeset was attached. (no need)
  • Covered by automatic tests. if it builds, it's good. the field is not used.
  • Impact of the changes: no changes

πŸ“ Description

freshAddresses field on Account is not used today nor planned by product anytime soon, so we can completely drop the feature for now. this work is part of Account model simplification.

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

@gre gre requested review from a team as code owners March 22, 2024 13:58
Copy link

vercel bot commented Mar 22, 2024

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

Name Status Preview Comments Updated (UTC)
web-tools βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Apr 25, 2024 2:18pm
4 Ignored Deployments
Name Status Preview Comments Updated (UTC)
ledger-live-docs ⬜️ Ignored (Inspect) Visit Preview Apr 25, 2024 2:18pm
ledger-live-github-bot ⬜️ Ignored (Inspect) Visit Preview Apr 25, 2024 2:18pm
native-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Apr 25, 2024 2:18pm
react-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Apr 25, 2024 2:18pm

Copy link
Member

@KVNLS KVNLS left a comment

Choose a reason for hiding this comment

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

@gre do you know if integration tests are failing following your changes?

Copy link
Contributor

@sprohaszka-ledger sprohaszka-ledger left a comment

Choose a reason for hiding this comment

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

There are some strange modification in the snapshots file.

I wonder if it can be interesting to keep the Account type to put together the freshAddress and freshAddressPath together, as some functions return this type.

@gre
Copy link
Contributor Author

gre commented Mar 26, 2024

in this PR, i have huge changes due to re-running the tests to have up to date snapshots.
the problem is that, many of these snapshots are already outdated on develop.
so maybe, i will change a bit the strategy on this and first send a PR that just update the snapshot against current's develop?

as reminder, live-common's "integration tests" are defective on develop as of today, they just don't always run. So maybe, i could try to send a PR that restore them / disable the broken ones?

that might highlights the PR feebacks from you both @sprohaszka-ledger @KVNLS because some of these changes actually are not related to the field removal.

@gre gre marked this pull request as draft March 26, 2024 17:06
@gre
Copy link
Contributor Author

gre commented Mar 29, 2024

^FYI this PR is in standby until we solve this. i think we should fix the tests on develop?

Copy link

There as been no activity on this PR for the last 14 days. Please consider closing this PR.

@ledger-wiz-cspm-secret-detection
Copy link

ledger-wiz-cspm-secret-detection bot commented Apr 25, 2024

Wiz Scan Summary

IaC Misconfigurations 0C 0H 0M 0L 0I
Sensitive Data 0C 0H 0M 0L 6I
Total 0C 0H 0M 0L 6I
Secrets 0πŸ”‘

@gre gre marked this pull request as ready for review April 25, 2024 14:14
@gre
Copy link
Contributor Author

gre commented Apr 25, 2024

This PR is ready again, develop is up to date with integration tests 🀞

Copy link
Member

@KVNLS KVNLS left a comment

Choose a reason for hiding this comment

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

LGTM πŸš€ Nice cleanup!

@github-actions github-actions bot removed the Stale label Apr 26, 2024
Copy link
Contributor

@sprohaszka-ledger sprohaszka-ledger left a comment

Choose a reason for hiding this comment

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

One quick last comment

@@ -1,6 +1,6 @@
import { BigNumber } from "bignumber.js";
import flatMap from "lodash/flatMap";
import { Account, Address, Operation, OperationType } from "@ledgerhq/types-live";
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove it and change the signature of the getAddress method? It is more synthetic

Copy link
Contributor Author

@gre gre Apr 26, 2024

Choose a reason for hiding this comment

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

this type { freshAddress, freshAddressPath } and getAddress function is now strictly internal to the coin, i didn't want to change it too much, but it's possible that coin could simplify even further this: there is no need to return Address anymore there, maybe getAddress(account) usages could just be replaced by account.freshAddress , like we don't even need this indirection anymore since there is no ambiguity on where to look for the address/path, since we don't have to push them into a freshAddresses array.
Anyway as it is not used externally, on types-live perspective there are no need to have this concept of 'Address' pair, so indeed took a direction to remove what's not useful from the type side.
we could always reintroduce the concept if we want in future, like if we want to reorganize the field together, but today in the Account type, they are just nested as part of Account.
also to be clear: there is no type regression on this, we still have the same type safety, it allows coins to do the type they want.

@gre gre merged commit 8f22da4 into develop Apr 26, 2024
57 of 60 checks passed
@gre gre deleted the live-11772 branch April 26, 2024 10:30
valber-ledger pushed a commit that referenced this pull request May 3, 2024
chore: remove unused Account#freshAddresses
valber-ledger pushed a commit that referenced this pull request May 6, 2024
chore: remove unused Account#freshAddresses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli common Has changes in live-common desktop Has changes in LLD ledgerjs Has changes in the ledgerjs open source libs mobile Has changes in LLM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants