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

[LIVE-8890] remove ethereum family code #4336

Conversation

chabroA
Copy link
Contributor

@chabroA chabroA commented Aug 11, 2023

📝 Description

Remove all ethereum family related code from live, including:

  • ethereum family folder under LLD
  • ethereum family folder under LLM
  • ethereum family folder under LLC
  • and all direct import or reference to ethereum family code in other files

For easier review, it is recommended to review commit by commit.
Commits have been broken down atomically and ordered and a sensible way.

The biggest commit is a72bfd8 that include the removal of the ethereum family folder from LLD, LLM and LLC. Feels free to skip it or just glance over the list of removed files.

FYI this commit's changes (aec91bd) are not critical since this is just an update of some legacy code that will be removed by #4317 (but it still works as expected)

I smoked tested the PR by launching LLD and LLM in dev, both apps starts without issue and I can navigate to ethereum currencies.
A full non reg test will be performed on the main PR #4285 after this one is merged. This does not make sense to do it at this stage.

This PR also includes changes related to https://ledgerhq.atlassian.net/browse/LIVE-8188 (in this commit 2629450) since this logic was not present in the evm family.


Note 📝:

  • Speed up / cancel tx
    Some logic related to speed up / cancel tx has been commented out instead of removed (cf. b9a7b56) to keep a framework that can be used for the integration of this feature on evm, which should be done shortly.
    Also to keep this very PR specific to ethereum code removal and not scope creep it by adding removal of speed up / cancel feature.
    We could decide to remove all the speed up / cancel related code present in non family specific code, until we re-integrate the feature within the evm family (which should be done right after this ethereum / evm migration anyway), but then it should be done in it's own dedicated PR.

  • Evm bridge mock
    A test-suite has been 59f99ce voluntarily (instead of removed) until the evm bridge mock is available. cf. Support/LIVE-7931 Evm mock test #4353

❓ Context

✅ Checklist

  • Test coverage
  • Atomic delivery
  • No breaking changes Well, we are removing a full family so... 🤷‍♂️

📸 Demo

🚀 Expectations to reach

Please make sure you follow these Important Steps.

Pull Requests must pass the CI and be internally validated in order to be merged.

@changeset-bot
Copy link

changeset-bot bot commented Aug 11, 2023

⚠️ No Changeset found

Latest commit: 90d7feb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Aug 11, 2023

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

Name Status Preview Comments Updated (UTC)
ledger-live-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 16, 2023 2:12pm
live-common-tools ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 16, 2023 2:12pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
ledger-live-github-bot ⬜️ Ignored (Inspect) Visit Preview Aug 16, 2023 2:12pm
native-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Aug 16, 2023 2:12pm
react-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Aug 16, 2023 2:12pm

@github-actions github-actions bot added desktop Has changes in LLD mobile Has changes in LLM common Has changes in live-common labels Aug 11, 2023
transactionHash: operation.hash,
}),
);
// dispatch(
Copy link
Contributor

Choose a reason for hiding this comment

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

There's an other draft PR with edit evm transaction right ? If yes we can delete this instead of commenting

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is indeed a draft attempt to port this feature to evm here -> #4217

But since the changes commented out as part of this commit b9a7b56 are not necessarily ethereum (or evm) specific (because present in non ethereum / evm family folders) I decided to only comment them as part of this PR.
Because these changes present in non family specific folders might not be present in the draft PR above (that only port the ethereum family logic to evm).

We could decide to remove all of the speed up / cancel tx code for now, until it's added back again in the evm family, but it should be done in it's own dedicated PR to allow easier revert and since it's outside the scope of this one (and also to avoid growing this already massive PR with even more code removal).
But removing all this code might not be strategically wise since the work to integrate speed up / cancel tx to evm should be (will be) done juste after this evm / ethereum family migration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Description updated 👍

@@ -125,16 +125,15 @@ const baseMockTransaction: Transaction = {
recipient: "",
Copy link
Contributor

Choose a reason for hiding this comment

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

Not related to PR but .react.test.tsx is a bit weird
.tsx already means it's a react file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No strong opinion on that.
But I think this is a convention chosen to differentiate "dom" related tests from non "dom" related tests.

cf. this config for example -> https://github.com/LedgerHQ/ledger-live/blob/develop/libs/domain-service/jest.config.js#L38-L51

But yes, outside of the scope of this PR so won't touch it here / now

@chabroA chabroA force-pushed the feat/live-8890-remove-ethereum-family-code branch from fed5759 to fde4aff Compare August 16, 2023 11:33
_transactionRaw: unknown,
_transactionHash: unknown,
) => {};

Copy link
Contributor

Choose a reason for hiding this comment

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

line 402-423 in this file, we should remove the alert message for editable operation since we remove the edit tx feature.

@@ -1,9 +1,11 @@
// FIXME: to update when implementing edit transaction on evm

Copy link
Contributor

Choose a reason for hiding this comment

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

if you want to remove the edit tx feature temporarily. you can remove this file completely or just return null.
it is not a major issue. It is up to you to keep it here or not.

transaction = bridge.updateTransaction(defaultTransaction, {
tokenIds: [nft?.tokenId],
const transaction = bridge.updateTransaction(defaultTransaction, {
mode: nft.standard.toLowerCase() as EvmNftTransaction["mode"],
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see a real good reason for NFTStandard and EvmNftTransaction["mode"] to be 2 different types. From what I see everytime we use NFTStandard we end up lowering the case so I think we can just use the same type for both

type EvmNftTransaction = {
  mode: NFTStandard;
  ...
}

and then lowering the case of NFTStandard, or do vice verse doing

type NFTStandard = EvmNftTransaction["mode"]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems to make sense, will take a look at it in a dedicated / independent PR 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lvndry cf. #4363 (PS: a lot of changes for a little update 🤷)

@@ -1,8 +1,9 @@
// FIXME: to update when implementing edit transaction on evm

import React from "react";
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 you should remove the following code in
/ledger-live-desktop/src/renderer/modals/Send/steps/StepRecipient.tsx

{stuckAccountAndOperation ? (
        <EditOperationPanel
          operation={stuckAccountAndOperation.operation}
          account={stuckAccountAndOperation.account}
          parentAccount={stuckAccountAndOperation.parentAccount}
        />
      ) : null}

@chabroA
Copy link
Contributor Author

chabroA commented Aug 16, 2023

Merging this PR with the speed up / cancel code commented (and not fully removed) in the feature branch for better topic segregation. If needed, a new branch starting from the feature branch will be created to remove this code

@chabroA chabroA merged commit 0cae97c into feat/live-5135-merge-ethereum-in-evm-family Aug 16, 2023
@chabroA chabroA deleted the feat/live-8890-remove-ethereum-family-code branch August 16, 2023 16:18
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 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.

3 participants