-
Notifications
You must be signed in to change notification settings - Fork 362
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ
4 Ignored Deployments
|
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.
@gre do you know if integration tests are failing following your changes?
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.
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.
libs/ledger-live-common/src/families/near/__snapshots__/bridge.integration.test.ts.snap
Outdated
Show resolved
Hide resolved
...edger-live-common/src/families/cosmos/datasets/__snapshots__/coreum.integration.test.ts.snap
Outdated
Show resolved
Hide resolved
in this PR, i have huge changes due to re-running the tests to have up to date snapshots. 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. |
^FYI this PR is in standby until we solve this. i think we should fix the tests on develop? |
There as been no activity on this PR for the last 14 days. Please consider closing this PR. |
Wiz Scan Summary
|
This PR is ready again, develop is up to date with integration tests π€ |
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.
LGTM π Nice cleanup!
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.
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"; |
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.
Why remove it and change the signature of the getAddress
method? It is more synthetic
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.
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.
chore: remove unused Account#freshAddresses
chore: remove unused Account#freshAddresses
β Checklist
npx changeset
was attached. (no need)π 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