This repository has been archived by the owner on Jun 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
solana: add backbone for opt in flow
- Loading branch information
Showing
8 changed files
with
643 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,207 @@ | ||
// @flow | ||
import invariant from "invariant"; | ||
import React, { useState, useCallback } from "react"; | ||
import { compose } from "redux"; | ||
import { connect, useDispatch } from "react-redux"; | ||
import { Trans, withTranslation } from "react-i18next"; | ||
import { createStructuredSelector } from "reselect"; | ||
import { SyncSkipUnderPriority } from "@ledgerhq/live-common/lib/bridge/react"; | ||
import Track from "~/renderer/analytics/Track"; | ||
|
||
import { UserRefusedOnDevice } from "@ledgerhq/errors"; | ||
|
||
import { getAccountBridge } from "@ledgerhq/live-common/lib/bridge"; | ||
import useBridgeTransaction from "@ledgerhq/live-common/lib/bridge/useBridgeTransaction"; | ||
|
||
import type { StepId, StepProps, St } from "./types"; | ||
import type { Account, Operation } from "@ledgerhq/live-common/lib/types"; | ||
import type { TFunction } from "react-i18next"; | ||
import type { Device } from "@ledgerhq/live-common/lib/hw/actions/types"; | ||
|
||
import { addPendingOperation } from "@ledgerhq/live-common/lib/account"; | ||
import { updateAccountWithUpdater } from "~/renderer/actions/accounts"; | ||
|
||
import { getCurrentDevice } from "~/renderer/reducers/devices"; | ||
import { closeModal, openModal } from "~/renderer/actions/modals"; | ||
|
||
import Stepper from "~/renderer/components/Stepper"; | ||
import StepAsset, { StepAssetFooter } from "./steps/StepAsset"; | ||
import GenericStepConnectDevice from "~/renderer/modals/Send/steps/GenericStepConnectDevice"; | ||
import StepConfirmation, { StepConfirmationFooter } from "./steps/StepConfirmation"; | ||
import logger from "~/logger/logger"; | ||
|
||
type OwnProps = {| | ||
stepId: StepId, | ||
onClose: () => void, | ||
onChangeStepId: StepId => void, | ||
params: { | ||
account: Account, | ||
parentAccount: ?Account, | ||
}, | ||
name: string, | ||
|}; | ||
|
||
type StateProps = {| | ||
t: TFunction, | ||
device: ?Device, | ||
accounts: Account[], | ||
device: ?Device, | ||
closeModal: string => void, | ||
openModal: string => void, | ||
|}; | ||
|
||
type Props = OwnProps & StateProps; | ||
|
||
const steps: Array<St> = [ | ||
{ | ||
id: "assets", | ||
label: <Trans i18nKey="solana.optIn.flow.steps.assets.title" />, | ||
component: StepAsset, | ||
noScroll: true, | ||
footer: StepAssetFooter, | ||
}, | ||
{ | ||
id: "connectDevice", | ||
label: <Trans i18nKey="solana.optIn.flow.steps.connectDevice.title" />, | ||
component: GenericStepConnectDevice, | ||
onBack: ({ transitionTo }: StepProps) => transitionTo("assets"), | ||
}, | ||
{ | ||
id: "confirmation", | ||
label: <Trans i18nKey="solana.optIn.flow.steps.confirmation.title" />, | ||
component: StepConfirmation, | ||
footer: StepConfirmationFooter, | ||
}, | ||
]; | ||
|
||
const mapStateToProps = createStructuredSelector({ | ||
device: getCurrentDevice, | ||
}); | ||
|
||
const mapDispatchToProps = { | ||
closeModal, | ||
openModal, | ||
}; | ||
|
||
const Body = ({ | ||
t, | ||
stepId, | ||
device, | ||
closeModal, | ||
openModal, | ||
onChangeStepId, | ||
params, | ||
name, | ||
}: Props) => { | ||
const [optimisticOperation, setOptimisticOperation] = useState(null); | ||
const [transactionError, setTransactionError] = useState(null); | ||
const [signed, setSigned] = useState(false); | ||
const dispatch = useDispatch(); | ||
|
||
const { | ||
transaction, | ||
setTransaction, | ||
updateTransaction, | ||
account, | ||
parentAccount, | ||
status, | ||
bridgeError, | ||
bridgePending, | ||
} = useBridgeTransaction(() => { | ||
const { account } = params; | ||
|
||
invariant(account, "solana: account required"); | ||
|
||
const bridge = getAccountBridge(account, undefined); | ||
|
||
const transaction = bridge.createTransaction(account); | ||
|
||
return { account, parentAccount: undefined, transaction }; | ||
}); | ||
|
||
const handleCloseModal = useCallback(() => { | ||
closeModal(name); | ||
}, [closeModal, name]); | ||
|
||
const handleStepChange = useCallback(e => onChangeStepId(e.id), [onChangeStepId]); | ||
|
||
const handleRetry = useCallback(() => { | ||
setTransactionError(null); | ||
onChangeStepId("assets"); | ||
}, [onChangeStepId]); | ||
|
||
const handleTransactionError = useCallback((error: Error) => { | ||
if (!(error instanceof UserRefusedOnDevice)) { | ||
logger.critical(error); | ||
} | ||
setTransactionError(error); | ||
}, []); | ||
|
||
const handleOperationBroadcasted = useCallback( | ||
(optimisticOperation: Operation) => { | ||
if (!account) return; | ||
dispatch( | ||
updateAccountWithUpdater(account.id, account => | ||
addPendingOperation(account, optimisticOperation), | ||
), | ||
); | ||
setOptimisticOperation(optimisticOperation); | ||
setTransactionError(null); | ||
}, | ||
[account, dispatch], | ||
); | ||
|
||
const error = transactionError || bridgeError || status.errors.amount; | ||
const warning = status.warnings ? Object.values(status.warnings)[0] : null; | ||
|
||
const errorSteps = []; | ||
|
||
if (transactionError) { | ||
errorSteps.push(2); | ||
} else if (bridgeError) { | ||
errorSteps.push(0); | ||
} | ||
|
||
const stepperProps = { | ||
title: t("solana.optIn.flow.title"), | ||
device, | ||
account, | ||
parentAccount, | ||
transaction, | ||
signed, | ||
stepId, | ||
steps, | ||
errorSteps, | ||
disabledSteps: [], | ||
hideBreadcrumb: !!error || !!warning, | ||
onRetry: handleRetry, | ||
onStepChange: handleStepChange, | ||
onClose: handleCloseModal, | ||
error, | ||
warning, | ||
status, | ||
optimisticOperation, | ||
openModal, | ||
setSigned, | ||
onChangeTransaction: setTransaction, | ||
onUpdateTransaction: updateTransaction, | ||
onOperationBroadcasted: handleOperationBroadcasted, | ||
onTransactionError: handleTransactionError, | ||
t, | ||
bridgePending, | ||
}; | ||
|
||
return ( | ||
<Stepper {...stepperProps}> | ||
<SyncSkipUnderPriority priority={100} /> | ||
<Track onUnmount event="CloseModalOptIn" /> | ||
</Stepper> | ||
); | ||
}; | ||
|
||
const C: React$ComponentType<OwnProps> = compose( | ||
connect(mapStateToProps, mapDispatchToProps), | ||
withTranslation(), | ||
)(Body); | ||
|
||
export default C; |
83 changes: 83 additions & 0 deletions
83
src/renderer/families/solana/OptInFlowModal/fields/SplTokenSelector.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
// @flow | ||
import React, { useState, useMemo } from "react"; | ||
import { Trans } from "react-i18next"; | ||
|
||
import type { TokenCurrency } from "@ledgerhq/live-common/lib/types"; | ||
|
||
import { listTokensForCryptoCurrency } from "@ledgerhq/live-common/lib/currencies"; | ||
|
||
import Box from "~/renderer/components/Box"; | ||
import FirstLetterIcon from "~/renderer/components/FirstLetterIcon"; | ||
import Select from "~/renderer/components/Select"; | ||
import Text from "~/renderer/components/Text"; | ||
import ToolTip from "~/renderer/components/Tooltip"; | ||
import ExclamationCircleThin from "~/renderer/icons/ExclamationCircleThin"; | ||
|
||
const renderItem = ({ | ||
data: { id, name }, | ||
isDisabled, | ||
data, | ||
}: { | ||
data: TokenCurrency, | ||
isDisabled: boolean, | ||
}) => { | ||
// TODO: make a function for that in common | ||
const tokenParts = id.split("/"); | ||
const mintAddress = tokenParts[2]; | ||
return ( | ||
<Box | ||
key={id} | ||
horizontal | ||
alignItems="center" | ||
color={isDisabled ? "palette.text.shade40" : "palette.text.shade100"} | ||
justifyContent="space-between" | ||
> | ||
<Box horizontal alignItems="center" justifyContent="flex-start"> | ||
<FirstLetterIcon | ||
color={isDisabled ? "palette.text.shade40" : "palette.text.shade100"} | ||
label={name} | ||
mr={2} | ||
/> | ||
<Text ff="Inter|Medium">{name}</Text> | ||
<Text fontSize={3} color="palette.text.shade40"> | ||
- Token {mintAddress} | ||
</Text> | ||
</Box> | ||
{isDisabled && ( | ||
<ToolTip content={<Trans i18nKey="solana.optIn.flow.steps.assets.disabledTooltip" />}> | ||
<Box color="warning"> | ||
<ExclamationCircleThin size={16} /> | ||
</Box> | ||
</ToolTip> | ||
)} | ||
</Box> | ||
); | ||
}; | ||
|
||
export default function DelegationSelectorField({ account, transaction, t, onChange }: *) { | ||
const [query, setQuery] = useState(""); | ||
const subAccounts = account.subAccounts; | ||
const options = listTokensForCryptoCurrency(account.currency); | ||
const value = useMemo(() => options.find(({ id }) => id === transaction.assetId), [ | ||
options, | ||
transaction, | ||
]); | ||
|
||
return ( | ||
<Box flow={1} mb={4}> | ||
<Select | ||
value={value} | ||
options={options} | ||
getOptionValue={({ name }) => name} | ||
isOptionDisabled={({ id }) => subAccounts.some(({ token }) => token.id === id)} | ||
renderValue={renderItem} | ||
renderOption={renderItem} | ||
onInputChange={setQuery} | ||
inputValue={query} | ||
placeholder={t("solana.optIn.flow.steps.assets.selectLabel")} | ||
noOptionsMessage={({ inputValue }) => t("common.selectNoResults", { query: inputValue })} | ||
onChange={onChange} | ||
/> | ||
</Box> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// @flow | ||
|
||
import React, { PureComponent } from "react"; | ||
import Modal from "~/renderer/components/Modal"; | ||
import Body from "./Body"; | ||
import type { StepId } from "./types"; | ||
type State = { | ||
stepId: StepId, | ||
}; | ||
|
||
const INITIAL_STATE = { | ||
stepId: "assets", | ||
}; | ||
|
||
class OptInModal extends PureComponent<{ name: string }, State> { | ||
state = INITIAL_STATE; | ||
|
||
handleReset = () => this.setState({ ...INITIAL_STATE }); | ||
|
||
handleStepChange = (stepId: StepId) => this.setState({ stepId }); | ||
|
||
render() { | ||
const { stepId } = this.state; | ||
const { name } = this.props; | ||
|
||
const isModalLocked = ["connectDevice", "confirmation"].includes(stepId); | ||
|
||
return ( | ||
<Modal | ||
name={name} | ||
centered | ||
refocusWhenChange={stepId} | ||
onHide={this.handleReset} | ||
preventBackdropClick={isModalLocked} | ||
render={({ onClose, data }) => ( | ||
<Body | ||
stepId={stepId} | ||
name={name} | ||
onClose={onClose} | ||
onChangeStepId={this.handleStepChange} | ||
params={data || {}} | ||
/> | ||
)} | ||
/> | ||
); | ||
} | ||
} | ||
|
||
export default OptInModal; |
Oops, something went wrong.
e911736
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.
cc @konoart
Lint outputs ❌
Command failed with exit code 2: yarn flow
Launching Flow server for /home/runner/work/ledger-live-desktop/ledger-live-desktop
Spawned flow server (pid=37274)
Logs will go to /tmp/flow/zShomezSrunnerzSworkzSledger-live-desktopzSledger-live-desktop.log
Monitor logs will go to /tmp/flow/zShomezSrunnerzSworkzSledger-live-desktopzSledger-live-desktop.monitor_log
Started a new flow server: -Please wait. Server is starting up
Please wait. Server is initializing (starting up)
Please wait. Server is initializing (parsed files 0)
Please wait. Server is initializing (parsed files 1000)
Please wait. Server is initializing (parsed files 2000)
Please wait. Server is initializing (parsed files 2000)
Please wait. Server is initializing (parsed files 3000)
Please wait. Server is initializing (parsed files 3000)
Please wait. Server is initializing (parsed files 3000)
Please wait. Server is initializing (parsed files 4000)
Please wait. Server is initializing (parsed files 4000)
Please wait. Server is initializing (parsed files 5000)
Please wait. Server is initializing (parsed files 5000)
Please wait. Server is initializing (parsed files 6000)
Please wait. Server is initializing (parsed files 6000)
Please wait. Server is initializing (parsed files 8000)
Please wait. Server is initializing (parsed files 9000)
Please wait. Server is initializing (parsed files 11000)
Please wait. Server is initializing (parsed files 11000)
Please wait. Server is initializing (parsed files 11000)
Please wait. Server is initializing (parsed files 11000)
Please wait. Server is initializing (parsed files 11000)
Please wait. Server is initializing (parsed files 13000)
Please wait. Server is initializing (parsed files 13000)
Please wait. Server is initializing (parsed files 14000)
Please wait. Server is initializing (parsed files 15000)
Please wait. Server is initializing (parsed files 15000)
Please wait. Server is initializing (parsed files 16000)
Please wait. Server is initializing (parsed files 16000)
Please wait. Server is initializing (parsed files 17000)
Please wait. Server is initializing (parsed files 17000)
Please wait. Server is initializing (parsed files 17000)
Please wait. Server is initializing (parsed files 19000)
Please wait. Server is initializing (parsed files 20000)
Please wait. Server is initializing (parsed files 20000)
Please wait. Server is initializing (parsed files 20000)
Please wait. Server is initializing (parsed files 21000)
Please wait. Server is initializing (parsed files 23000)
Please wait. Server is initializing (parsed files 23000)
Please wait. Server is initializing (parsed files 23000)
Please wait. Server is initializing (parsed files 23000)
Please wait. Server is initializing (parsed files 26000)
Please wait. Server is initializing (parsed files 28000)
Please wait. Server is initializing (parsed files 28000)
Please wait. Server is initializing (parsed files 30000)
Please wait. Server is initializing (parsed files 31000)
Please wait. Server is initializing (parsed files 31000)
Please wait. Server is initializing (parsed files 31000)
Please wait. Server is initializing (parsed files 32000)
Please wait. Server is initializing (parsed files 32000)
Please wait. Server is initializing (parsed files 32000)
Please wait. Server is initializing (parsed files 33000)
Please wait. Server is initializing (parsed files 33000)
Please wait. Server is initializing (parsed files 34000)
Please wait. Server is initializing (parsed files 35000)
Please wait. Server is initializing (parsed files 36000)
Please wait. Server is initializing (parsed files 38000)
Please wait. Server is initializing (parsed files 38000)
Please wait. Server is initializing (parsed files 39000)
Please wait. Server is initializing (parsed files 39000)
Please wait. Server is initializing (parsed files 43000)
Please wait. Server is initializing (parsed files 46000)
Please wait. Server is initializing (parsed files 46000)
Please wait. Server is initializing (parsed files 47000)
Please wait. Server is initializing (parsed files 47000)
Please wait. Server is initializing (parsed files 48000)
Please wait. Server is initializing (parsed files 48000)
Please wait. Server is initializing (parsed files 50000)
Please wait. Server is initializing (parsed files 50000)
Please wait. Server is initializing (parsed files 52000)
Please wait. Server is initializing (parsed files 52000)
Please wait. Server is initializing (parsed files 53000)
Please wait. Server is initializing (parsed files 53000)
Please wait. Server is initializing (parsed files 53000)
Please wait. Server is initializing (parsed files 54000)
Please wait. Server is initializing (parsed files 54000)
Please wait. Server is initializing (parsed files 55000)
Please wait. Server is initializing (parsed files 55000)
Please wait. Server is initializing (parsed files 56000)
Please wait. Server is initializing (parsed files 56000)
Please wait. Server is initializing (parsed files 57000)
Please wait. Server is initializing (parsed files 57000)
Please wait. Server is initializing (parsed files 57000)
Please wait. Server is initializing (parsed files 57000)
Please wait. Server is initializing (parsed files 57000)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (parsed files 57266)
Please wait. Server is initializing (resolving dependencies)
Please wait. Server is initializing (resolving dependencies)
Please wait. Server is initializing (resolving dependencies)
Please wait. Server is initializing (resolving dependencies)
Please wait. Server is initializing (resolving dependencies)
Please wait. Server is initializing (waiting for Watchman - giving up in 119 seconds)
Please wait. Server is initializing (waiting for Watchman - giving up in 119 seconds)
Please wait. Server is initializing (parsed files 0/0 (0.0%))
Please wait. Server is initializing (calculating dependencies)
Please wait. Server is initializing (merged files 0/1231 (0.0%))
Please wait. Server is initializing (merged files 137/1231 (11.1%))
Please wait. Server is initializing (merged files 350/1231 (28.4%))
Please wait. Server is initializing (merged files 373/1231 (30.3%))
Please wait. Server is initializing (merged files 373/1231 (30.3%))
Please wait. Server is initializing (merged files 387/1231 (31.4%))
Please wait. Server is initializing (merged files 427/1231 (34.7%))
Please wait. Server is initializing (merged files 455/1231 (37.0%))
Please wait. Server is initializing (merged files 498/1231 (40.5%))
Please wait. Server is initializing (merged files 509/1231 (41.3%))
Please wait. Server is initializing (merged files 509/1231 (41.3%))
Please wait. Server is initializing (merged files 529/1231 (43.0%))
Please wait. Server is initializing (merged files 529/1231 (43.0%))
Please wait. Server is initializing (merged files 588/1231 (47.8%))
Please wait. Server is initializing (merged files 588/1231 (47.8%))
Please wait. Server is initializing (merged files 633/1231 (51.4%))
Please wait. Server is initializing (merged files 633/1231 (51.4%))
Please wait. Server is initializing (merged files 649/1231 (52.7%))
Please wait. Server is initializing (merged files 681/1231 (55.3%))
Please wait. Server is initializing (merged files 681/1231 (55.3%))
Please wait. Server is initializing (merged files 681/1231 (55.3%))
Please wait. Server is initializing (merged files 681/1231 (55.3%))
Please wait. Server is initializing (merged files 681/1231 (55.3%))
Please wait. Server is initializing (merged files 747/1231 (60.7%))
Please wait. Server is initializing (merged files 796/1231 (64.7%))
Please wait. Server is initializing (merged files 796/1231 (64.7%))
Please wait. Server is initializing (merged files 796/1231 (64.7%))
Please wait. Server is initializing (merged files 836/1231 (67.9%))
Please wait. Server is initializing (merged files 872/1231 (70.8%))
Please wait. Server is initializing (merged files 902/1231 (73.3%))
Please wait. Server is initializing (merged files 943/1231 (76.6%))
Please wait. Server is initializing (merged files 943/1231 (76.6%))
Please wait. Server is initializing (merged files 971/1231 (78.9%))
Please wait. Server is initializing (merged files 971/1231 (78.9%))
Please wait. Server is initializing (merged files 1018/1231 (82.7%))
Please wait. Server is initializing (merged files 1030/1231 (83.7%))
Please wait. Server is initializing (merged files 1053/1231 (85.5%))
Please wait. Server is initializing (merged files 1078/1231 (87.6%))
Please wait. Server is initializing (merged files 1089/1231 (88.5%))
Please wait. Server is initializing (merged files 1096/1231 (89.0%))
Please wait. Server is initializing (merged files 1114/1231 (90.5%))
Please wait. Server is initializing (merged files 1123/1231 (91.2%))
Please wait. Server is initializing (merged files 1147/1231 (93.2%))
Please wait. Server is initializing (merged files 1175/1231 (95.5%))
Please wait. Server is initializing (merged files 1200/1231 (97.5%))
Please wait. Server is initializing (merged files 1224/1231 (99.4%))
Please wait. Server is initializing (finishing up)
Please wait. Server is handling a request (starting up)
Please wait. Server is handling a request (collating errors)
error Command failed with exit code 2.
$ /home/runner/work/ledger-live-desktop/ledger-live-desktop/node_modules/.bin/flow
Error -------------------------------------------------------- src/renderer/families/solana/OptInFlowModal/types.js:8:34
Cannot resolve module
@ledgerhq/live-common/lib/families/solana/types
.8| import type { Transaction } from "@ledgerhq/live-common/lib/families/solana/types";
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Found 1 error
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.Command failed with exit code 1: yarn lint
error Command failed with exit code 1.
$ eslint src tools
/home/runner/work/ledger-live-desktop/ledger-live-desktop/src/main/updater/updater.spec.js
12:1 warning Skipped test suite jest/no-disabled-tests
/home/runner/work/ledger-live-desktop/ledger-live-desktop/src/renderer/components/SelectAccountAndCurrency.js
110:6 warning React Hook useCallback has a missing dependency: 'flow'. Either include it or remove the dependency array react-hooks/exhaustive-deps
/home/runner/work/ledger-live-desktop/ledger-live-desktop/src/renderer/components/ToastOverlay/index.js
29:5 warning React Hook useCallback has a missing dependency: 'dispatch'. Either include it or remove the dependency array react-hooks/exhaustive-deps
/home/runner/work/ledger-live-desktop/ledger-live-desktop/src/renderer/families/solana/SendRecipientFields.js
4:10 error 'BigNumber' is defined but never used no-unused-vars
5:10 error 'Trans' is defined but never used no-unused-vars
6:15 error 'TFunction' is defined but never used no-unused-vars
7:43 error '/home/runner/work/ledger-live-desktop/ledger-live-desktop/node_modules/@ledgerhq/live-common/lib/types/index.js' imported multiple times import/no-duplicates
12:40 error '/home/runner/work/ledger-live-desktop/ledger-live-desktop/node_modules/@ledgerhq/live-common/lib/types/index.js' imported multiple times import/no-duplicates
✖ 8 problems (5 errors, 3 warnings)
1 error and 0 warnings potentially fixable with the
--fix
option.info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.error Command failed with exit code 255.
Tests outputs ❌
FAIL src/generate-cryptoassets-md.test.js
● generate cryptoassets.md
Test Suites: 1 failed, 1 skipped, 1 of 2 total
Tests: 1 failed, 5 skipped, 6 total
Snapshots: 0 total
Time: 1.885 s
Ran all test suites matching /src/i.
error Command failed with exit code 1.
Tests outputs ❌
PASS tests/specs/firmwareupdate.spec.js (104.061 s)
PASS tests/specs/updater.spec.js (138.657 s)
PASS tests/specs/global.spec.js (161.97 s)
PASS tests/specs/accounts/subaccount.spec.js (245.137 s)
PASS tests/specs/settings/passwordlock.spec.js (150.637 s)
PASS tests/specs/walletconnect.spec.js (119.808 s)
PASS tests/specs/manager.spec.js (97.106 s)
PASS tests/specs/swap.spec.js (72.482 s)
PASS tests/specs/settings/settings.spec.js (81.118 s)
PASS tests/specs/settings/developermode.spec.js (368.146 s)
PASS tests/specs/accounts/ethereum.spec.js (391.228 s)
PASS tests/specs/accounts/bitcoin.spec.js (355.404 s)
PASS tests/specs/accounts/cosmos.spec.js (363.607 s)
FAIL tests/specs/USBTroubleshooting/windows.spec.js (146.154 s)
● USBTroubleshooting-windows › goes to USBTroubleshooting screen from manager
› 1 snapshot failed.
FAIL tests/specs/USBTroubleshooting/linux.spec.js (143.866 s)
● USBTroubleshooting-linux › access the USBTroubleshooting solutions
› 1 snapshot failed.
PASS tests/specs/USBTroubleshooting/mac.spec.js (162.009 s)
PASS tests/specs/accounts/tezos.spec.js (391.829 s)
PASS tests/specs/accounts/xrp.spec.js (384.929 s)
PASS tests/specs/accounts/global.spec.js (331.909 s)
PASS tests/specs/onboarding/nanoX.spec.js (349.458 s)
PASS tests/specs/onboarding/nanoS.spec.js (334.61 s)
PASS tests/specs/onboarding/blue.spec.js (296.429 s)
Summary of all failing tests
FAIL tests/specs/USBTroubleshooting/windows.spec.js (146.154 s)
● USBTroubleshooting-windows › goes to USBTroubleshooting screen from manager
FAIL tests/specs/USBTroubleshooting/linux.spec.js (143.866 s)
● USBTroubleshooting-linux › access the USBTroubleshooting solutions
Snapshot Summary
› 2 snapshots failed from 2 test suites. Inspect your code changes or run
yarn run spectron -u
to update them.Test Suites: 2 failed, 20 passed, 22 total
Tests: 2 failed, 415 passed, 417 total
Snapshots: 2 failed, 349 passed, 351 total
Time: 1371.41 s
Ran all test suites matching /tests/specs/.*.spec.js/i.
error Command failed with exit code 1.
Diff output ❌
USBTroubleshooting-linux-solution-6
USBTroubleshooting-windows-noHelpPopup
Suggested snapshots to update