Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1684 from LedgerHQ/develop
Browse files Browse the repository at this point in the history
Prepare 1.2.7
  • Loading branch information
gre authored Dec 4, 2018
2 parents 9e5cad5 + bdbaa70 commit 1deda9b
Show file tree
Hide file tree
Showing 36 changed files with 599 additions and 314 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
build:
<<: *defaults
steps:
- run: sudo apt-get install -y libudev-dev libfuse-dev
- run: sudo apt-get update
- run: sudo apt-get install -y libudev-dev
- run:
name: Install latest yarn
command: |
Expand All @@ -20,14 +21,13 @@ jobs:
- checkout
- restore_cache:
keys:
- v11-yarn-packages-{{ checksum "yarn.lock" }}
- v12-yarn-packages-{{ checksum "yarn.lock" }}
- run: yarn install
- save_cache:
key: v11-yarn-packages-{{ checksum "yarn.lock" }}
key: v12-yarn-packages-{{ checksum "yarn.lock" }}
paths:
- node_modules
- run: yarn lint
- run: ./node_modules/.bin/prettier -l "{src,webpack,.storybook,static/i18n}/**/*.js"
- run: yarn flow --quiet
- run: yarn test
- run: yarn release
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
}
},
"dependencies": {
"@ledgerhq/hw-app-btc": "^4.27.0",
"@ledgerhq/hw-app-btc": "^v4.30.0",
"@ledgerhq/hw-app-eth": "^4.24.0",
"@ledgerhq/hw-app-xrp": "^4.25.0",
"@ledgerhq/hw-transport": "^4.24.0",
"@ledgerhq/hw-transport-node-hid": "4.24.0",
"@ledgerhq/ledger-core": "2.0.0-rc.11",
"@ledgerhq/live-common": "4.4.2",
"@ledgerhq/ledger-core": "2.0.0-rc.12",
"@ledgerhq/live-common": "4.6.0",
"animated": "^0.2.2",
"async": "^2.6.1",
"axios": "^0.18.0",
Expand Down
2 changes: 1 addition & 1 deletion scripts/cli/cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export LEDGER_LOGS_DIRECTORY="$LEDGER_DATA_DIR/logs"
export LEDGER_LIVE_SQLITE_PATH="$LEDGER_DATA_DIR/sqlite"
export CLI=1

node -r @babel/register scripts/cli/txBetweenAccounts.js
node -r @babel/register -r @babel/polyfill scripts/cli/txBetweenAccounts.js
6 changes: 2 additions & 4 deletions scripts/cli/txBetweenAccounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@ import chalk from 'chalk'
import path from 'path'
import fs from 'fs'
import inquirer from 'inquirer'
import { createAccountModel } from '@ledgerhq/live-common/lib/models/account'
import { formatCurrencyUnit } from '@ledgerhq/live-common/lib/helpers/currencies'
import { formatCurrencyUnit } from '@ledgerhq/live-common/lib/currencies'

import 'globals'
import withLibcore from 'helpers/withLibcore'
import accountModel from 'helpers/accountModel'
import { doSignAndBroadcast } from 'commands/libcoreSignAndBroadcast'

import getDevice from './getDevice'

const accountModel = createAccountModel()

async function main() {
try {
// GET ACCOUNTS
Expand Down
1 change: 1 addition & 0 deletions src/actions/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const setDeveloperMode = (developerMode: boolean) => saveSettings({ devel
export const setSentryLogs = (sentryLogs: boolean) => saveSettings({ sentryLogs })
export const setShareAnalytics = (shareAnalytics: boolean) => saveSettings({ shareAnalytics })
export const setMarketIndicator = (marketIndicator: *) => saveSettings({ marketIndicator })
export const setAutoLockTimeout = (autoLockTimeout: *) => saveSettings({ autoLockTimeout })
export const setCounterValue = (counterValue: string) =>
saveSettings({
counterValue,
Expand Down
4 changes: 4 additions & 0 deletions src/commands/libcoreSignAndBroadcast.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ async function signTransaction({
if (blockHeight >= 419200) {
additionals.push('sapling')
}
} else if (currency.id === 'decred') {
expiryHeight = Buffer.from([0x00, 0x00, 0x00, 0x00])
additionals.push('decred')
}
const rawInputs = transaction.getInputs()

Expand All @@ -129,6 +132,7 @@ async function signTransaction({
true, // set to true allow both segwit AND non-segwit
hasTimestamp,
hasExtraData,
additionals,
)
const outputIndex = input.getPreviousOutputIndex()
const sequence = input.getSequence()
Expand Down
1 change: 0 additions & 1 deletion src/components/CurrencyDownStatusAlert.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { translate } from 'react-i18next'
import styled from 'styled-components'
import { connect } from 'react-redux'
import { createStructuredSelector } from 'reselect'
import type { CryptoCurrency } from '@ledgerhq/live-common/lib/types'

import type { CurrencyStatus } from 'reducers/currenciesStatus'
import { currencyDownStatus } from 'reducers/currenciesStatus'
Expand Down
4 changes: 2 additions & 2 deletions src/components/EnsureDeviceApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class EnsureDeviceApp extends Component<{
const cur = account ? account.currency : currency
invariant(cur, 'No currency given')
return (
<Trans i18nKey="deviceConnect.step2.open" parent="div">
<Trans i18nKey="deviceConnect.step2" parent="div">
{'Open the '}
<Bold>{cur.managerAppName}</Bold>
{' app on your device'}
Expand All @@ -97,7 +97,7 @@ class EnsureDeviceApp extends Component<{
{
id: 'device',
title: (
<Trans i18nKey="deviceConnect.step1.connect" parent="div">
<Trans i18nKey="deviceConnect.step1" parent="div">
{'Connect and unlock your '}
<Bold>{'Ledger device'}</Bold>
</Trans>
Expand Down
8 changes: 4 additions & 4 deletions src/components/GenuineCheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class GenuineCheck extends PureComponent<Props> {
{
id: 'device',
title: (
<Trans i18nKey="deviceConnect.step1.connect" parent="div">
<Trans i18nKey="deviceConnect.step1" parent="div">
{'Connect and unlock your '}
<Bold>{'Ledger device'}</Bold>
</Trans>
Expand All @@ -135,10 +135,10 @@ class GenuineCheck extends PureComponent<Props> {
{
id: 'deviceInfo',
title: (
<Trans i18nKey="deviceConnect:dashboard.open" parent="div">
<Trans i18nKey="deviceConnect.step2" parent="div">
{'Navigate to the '}
<Bold>{'dashboard'}</Bold>
{' on your device'}
{' app on your device'}
</Trans>
),
icon: homeIcon,
Expand All @@ -147,7 +147,7 @@ class GenuineCheck extends PureComponent<Props> {
{
id: 'isGenuine',
title: (
<Trans i18nKey="deviceConnect:stepGenuine.open" parent="div">
<Trans i18nKey="deviceConnect.step3" parent="div">
{'Allow '}
<Bold>{'Ledger Manager'}</Bold>
{' on your device'}
Expand Down
66 changes: 66 additions & 0 deletions src/components/Idler.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// @flow

import { PureComponent } from 'react'
import { createStructuredSelector } from 'reselect'
import { connect } from 'react-redux'
import { hasPasswordSelector, autoLockTimeoutSelector } from 'reducers/settings'
import debounce from 'lodash/debounce'
import { lock } from 'reducers/application'

type Props = {
autoLockTimeout: number,
hasPassword: boolean,
lock: Function,
}

const mapStateToProps = createStructuredSelector({
autoLockTimeout: autoLockTimeoutSelector,
hasPassword: hasPasswordSelector,
})

const mapDispatchToProps = {
lock,
}

class Idler extends PureComponent<Props> {
componentDidMount() {
window.addEventListener('keydown', this.debounceOnChange)
window.addEventListener('mouseover', this.debounceOnChange)
this.interval = setInterval(this.checkForAutoLock, 10000)
}

componentWillUnmount() {
window.removeEventListener('keydown', this.debounceOnChange)
window.removeEventListener('mouseover', this.debounceOnChange)
clearInterval(this.interval)
this.debounceOnChange.cancel()
}

interval: IntervalID

lastAction: number = -1

debounceOnChange = debounce(_ => this.idleTimeHandler(), 1000)

checkForAutoLock = _ => {
const timeout = this.props.autoLockTimeout
if (this.props.hasPassword && timeout && timeout !== -1) {
if (Date.now() - (this.lastAction + timeout * 60000) > 0) {
this.props.lock()
}
}
}

idleTimeHandler = _ => {
this.lastAction = Date.now()
}

render() {
return null
}
}

export default connect(
mapStateToProps,
mapDispatchToProps,
)(Idler)
18 changes: 9 additions & 9 deletions src/components/MainSideBar/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow

import React, { PureComponent } from 'react'
import { translate } from 'react-i18next'
import { Trans, translate } from 'react-i18next'
import { connect } from 'react-redux'
import { compose } from 'redux'
import { withRouter } from 'react-router'
Expand Down Expand Up @@ -87,13 +87,6 @@ class MainSideBar extends PureComponent<Props> {
push(to)
}

ADD_ACCOUNT_EMPTY_STATE = (
<Box relative pr={3}>
<img style={{ position: 'absolute', top: -10, right: 5 }} alt="" src={i('arrow-add.svg')} />
{this.props.t('emptyState.sidebar.text')}
</Box>
)

handleClickDashboard = () => this.push('/')
handleOpenSendModal = () => this.props.openModal(MODAL_SEND)
handleOpenReceiveModal = () => this.props.openModal(MODAL_RECEIVE)
Expand All @@ -110,6 +103,13 @@ class MainSideBar extends PureComponent<Props> {
<AddAccountButton tooltipText={t('addAccounts.title')} onClick={this.handleOpenImportModal} />
)

const emptyState = (
<Box relative pr={3}>
<img style={{ position: 'absolute', top: -10, right: 5 }} alt="" src={i('arrow-add.svg')} />
<Trans i18nKey="emptyState.sidebar.text" />
</Box>
)

return (
<Box relative bg="white" style={{ width: 230 }}>
<TopGradient />
Expand Down Expand Up @@ -168,7 +168,7 @@ class MainSideBar extends PureComponent<Props> {
<SideBarList
title={t('sidebar.accounts', { count: accounts.length })}
titleRight={addAccountButton}
emptyState={this.ADD_ACCOUNT_EMPTY_STATE}
emptyState={emptyState}
>
{accounts.map(account => (
<AccountListItem
Expand Down
13 changes: 13 additions & 0 deletions src/components/Onboarding/helperComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,19 @@ export function OptionRow({ step, ...p }: { step: StepType }) {
</Box>
)
}
export function BulletRow({ step, ...p }: { step: StepType }) {
const { icon, desc } = step
return (
<Box horizontal my="7px">
<Box {...p} mr="7px">
{icon}
</Box>
<Box justify="center" shrink>
<OptionRowDesc>{desc}</OptionRowDesc>
</Box>
</Box>
)
}
export const OptionRowDesc = styled(Box).attrs({
ff: 'Open Sans|Regular',
fontSize: 4,
Expand Down
12 changes: 6 additions & 6 deletions src/components/Onboarding/steps/SelectPIN/SelectPINnano.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,9 @@ class SelectPINnano extends PureComponent<Props, *> {
{
key: 'step2',
icon: <IconOptionRow>{'2.'}</IconOptionRow>,
desc: t('onboarding.selectPIN.initialize.instructions.nano.step2'),
},
{
key: 'step3',
icon: <IconOptionRow>{'3.'}</IconOptionRow>,
desc: (
<Box style={{ display: 'block' }}>
<Trans i18nKey="onboarding.selectPIN.initialize.instructions.nano.step3">
<Trans i18nKey="onboarding.selectPIN.initialize.instructions.nano.step2">
{'Press the right button to select'}
<Text ff="Open Sans|SemiBold" color="dark">
{'Configure as new device'}
Expand All @@ -46,6 +41,11 @@ class SelectPINnano extends PureComponent<Props, *> {
</Box>
),
},
{
key: 'step3',
icon: <IconOptionRow>{'3.'}</IconOptionRow>,
desc: t('onboarding.selectPIN.initialize.instructions.nano.step3'),
},
{
key: 'step4',
icon: <IconOptionRow>{'4.'}</IconOptionRow>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,26 @@ class SelectPINrestoreNano extends PureComponent<Props, *> {
{
key: 'step2',
icon: <IconOptionRow>{'2.'}</IconOptionRow>,
desc: t('onboarding.selectPIN.restore.instructions.nano.step2'),
},
{
key: 'step3',
icon: <IconOptionRow>{'3.'}</IconOptionRow>,
desc: (
<Box style={{ display: 'block' }}>
<Trans i18nKey="onboarding.selectPIN.restore.instructions.nano.step3">
<Trans i18nKey="onboarding.selectPIN.restore.instructions.nano.step2">
{'Press the left button to cancel'}
<Text ff="Open Sans|SemiBold" color="dark">
{'Initialize as new device?'}
</Text>
{'Press the right button to select'}
{'Then press the right button to select'}
<Text ff="Open Sans|SemiBold" color="dark">
{'Restore configuration?'}
</Text>
</Trans>
</Box>
),
},
{
key: 'step3',
icon: <IconOptionRow>{'3.'}</IconOptionRow>,
desc: t('onboarding.selectPIN.restore.instructions.nano.step3'),
},
{
key: 'step4',
icon: <IconOptionRow>{'4.'}</IconOptionRow>,
Expand Down
2 changes: 1 addition & 1 deletion src/components/PillsDaysCount.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Track from 'analytics/Track'

type Props = {
selected: string,
onChange: ({ key: string, value: *, label: string }) => *,
onChange: ({ key: string, value: *, label: React$Node }) => *,
t: T,
}

Expand Down
Loading

0 comments on commit 1deda9b

Please sign in to comment.