-
Notifications
You must be signed in to change notification settings - Fork 345
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
Changes from all commits
2629450
b88d7ca
d46bbec
2625aeb
f8c97d9
743fd85
c2bda62
5cc509b
1d965f3
79d728c
90d7feb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
// FIXME: to update when implementing edit transaction on evm | ||
|
||
import React, { useCallback, memo } from "react"; | ||
import { AccountLike, Account, Operation } from "@ledgerhq/types-live"; | ||
import { Trans } from "react-i18next"; | ||
import Alert from "~/renderer/components/Alert"; | ||
import Link from "~/renderer/components/Link"; | ||
import { openModal, closeModal } from "~/renderer/actions/modals"; | ||
import { closeModal } from "~/renderer/actions/modals"; | ||
import { useDispatch } from "react-redux"; | ||
import { useFeature } from "@ledgerhq/live-common/featureFlags/index"; | ||
import invariant from "invariant"; | ||
|
@@ -21,14 +23,15 @@ const EditOperationPanel = (props: Props) => { | |
const handleOpenEditModal = useCallback(() => { | ||
invariant(operation.transactionRaw, "operation.transactionRaw is required"); | ||
dispatch(closeModal("MODAL_SEND")); | ||
dispatch( | ||
openModal("MODAL_EDIT_TRANSACTION", { | ||
account, | ||
parentAccount, | ||
transactionRaw: operation.transactionRaw, | ||
transactionHash: operation.hash, | ||
}), | ||
); | ||
// dispatch( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 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). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Description updated 👍 |
||
// openModal("MODAL_EDIT_TRANSACTION", { | ||
// account, | ||
// parentAccount, | ||
// transactionRaw: operation.transactionRaw, | ||
// transactionHash: operation.hash, | ||
// }), | ||
// ); | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [parentAccount, account, operation, dispatch]); | ||
|
||
if (!editEthTx?.enabled) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
// FIXME: to update when implementing edit transaction on evm | ||
|
||
import React, { useMemo, Component, useCallback } from "react"; | ||
import { connect, useDispatch } from "react-redux"; | ||
import { connect } from "react-redux"; | ||
import { useHistory, useLocation } from "react-router-dom"; | ||
import { Trans, TFunction, useTranslation } from "react-i18next"; | ||
import styled from "styled-components"; | ||
|
@@ -70,7 +72,7 @@ import CryptoCurrencyIcon from "~/renderer/components/CryptoCurrencyIcon"; | |
import AmountDetails from "./AmountDetails"; | ||
import NFTOperationDetails from "./NFTOperationDetails"; | ||
import { State } from "~/renderer/reducers"; | ||
import { openModal } from "~/renderer/actions/modals"; | ||
// import { openModal } from "~/renderer/actions/modals"; | ||
import { getLLDCoinFamily } from "~/renderer/families"; | ||
|
||
const mapStateToProps = ( | ||
|
@@ -244,34 +246,42 @@ const OperationD = (props: Props) => { | |
: undefined; | ||
const editEthTx = useFeature("editEthTx"); | ||
const editable = editEthTx?.enabled && isEditableOperation(mainAccount, operation); | ||
const dispatch = useDispatch(); | ||
const handleOpenEditModal = useCallback( | ||
(account, parentAccount, transactionRaw, transactionHash) => { | ||
setDrawer(undefined); | ||
if (subOperations.length > 0 && isToken) { | ||
// if the operation is a token operation,(ERC-20 send), in order to speedup/cancel we need to find the subAccount | ||
const opAccount = findSubAccountById(account, subOperations[0].accountId); | ||
dispatch( | ||
openModal("MODAL_EDIT_TRANSACTION", { | ||
account: opAccount, | ||
parentAccount: account, | ||
transactionRaw, | ||
transactionHash, | ||
}), | ||
); | ||
} else { | ||
dispatch( | ||
openModal("MODAL_EDIT_TRANSACTION", { | ||
account, | ||
parentAccount, | ||
transactionRaw, | ||
transactionHash, | ||
}), | ||
); | ||
} | ||
}, | ||
[dispatch, isToken, subOperations], | ||
); | ||
// const dispatch = useDispatch(); | ||
// const handleOpenEditModal = useCallback( | ||
// (account, parentAccount, transactionRaw, transactionHash) => { | ||
// setDrawer(undefined); | ||
// if (subOperations.length > 0 && isToken) { | ||
// // if the operation is a token operation,(ERC-20 send), in order to speedup/cancel we need to find the subAccount | ||
// const opAccount = findSubAccountById(account, subOperations[0].accountId); | ||
// dispatch( | ||
// openModal("MODAL_EDIT_TRANSACTION", { | ||
// account: opAccount, | ||
// parentAccount: account, | ||
// transactionRaw, | ||
// transactionHash, | ||
// }), | ||
// ); | ||
// } else { | ||
// dispatch( | ||
// openModal("MODAL_EDIT_TRANSACTION", { | ||
// account, | ||
// parentAccount, | ||
// transactionRaw, | ||
// transactionHash, | ||
// }), | ||
// ); | ||
// } | ||
// }, | ||
// [dispatch, isToken, subOperations], | ||
// ); | ||
|
||
const handleOpenEditModal = ( | ||
_account: unknown, | ||
_parentAccount: unknown, | ||
_transactionRaw: unknown, | ||
_transactionHash: unknown, | ||
) => {}; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
// pending transactions that exceeds 5 minutes are considered as stuck transactions | ||
const isStuck = | ||
new Date().getTime() - operation.date.getTime() > getEnv("ETHEREUM_STUCK_TRANSACTION_TIMEOUT"); | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
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.
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.