Browse Source

Merge pull request #1603 from LedgerHQ/develop

Prepare 1.2.2
master
Gaëtan Renaudeau 6 years ago
committed by GitHub
parent
commit
9a9ce8a46d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .circleci/config.yml
  2. 4
      package.json
  3. 100
      scripts/release.sh
  4. 1
      src/bridge/LibcoreBridge.js
  5. 35
      src/commands/libcoreSignAndBroadcast.js
  6. 4
      src/components/modals/AddAccounts/steps/03-step-import.js
  7. 4
      static/i18n/en/app.json
  8. 16
      yarn.lock

2
.circleci/config.yml

@ -9,7 +9,7 @@ jobs:
build:
<<: *defaults
steps:
- run: sudo apt-get install -y libudev-dev
- run: sudo apt-get install -y libudev-dev libfuse-dev
- run:
name: Install latest yarn
command: |

4
package.json

@ -35,12 +35,12 @@
}
},
"dependencies": {
"@ledgerhq/hw-app-btc": "4.24.0",
"@ledgerhq/hw-app-btc": "^4.27.0",
"@ledgerhq/hw-app-eth": "^4.24.0",
"@ledgerhq/hw-app-xrp": "^4.24.0",
"@ledgerhq/hw-transport": "^4.24.0",
"@ledgerhq/hw-transport-node-hid": "4.24.0",
"@ledgerhq/ledger-core": "2.0.0-rc.8",
"@ledgerhq/ledger-core": "2.0.0-rc.9",
"@ledgerhq/live-common": "4.0.0-beta.1",
"animated": "^0.2.2",
"async": "^2.6.1",

100
scripts/release.sh

@ -69,48 +69,58 @@ fi
runJob "yarn compile" "compiling..." "compiled" "failed to compile" "verbose"
# --------------------------------------------------------------------
# Linux: Internal process error (null)
#
# context: https://github.com/LedgerHQ/ledger-live-desktop/issues/1010
# Linux: Internal process error (null)
#
# The "fix" is not optimal, as it doesn't really solve the problem
# (electron loading system openssl before we can load our embedded one)
# Quick summary:
#
# - build without publishing
# - unpack the .AppImage
# - download reported working libs from ubuntu mirrors, put it inside
# - re-pack the .AppImage
# - checksum stuff
# - upload to gh
runJob \
"DEBUG=electron-builder electron-builder build --publish never" \
"building and packaging app..." \
"app built and packaged successfully" \
"failed to build app" \
"verbose"
runJob \
"scripts/patch-appimage.sh" \
"patching AppImage..." \
"AppImage patched successfully" \
"failed to patch AppImage"
LEDGER_LIVE_VERSION=$(grep version package.json | sed -E 's/.*: "(.*)",/\1/g')
scripts/upload-github-release-asset.sh \
github_api_token="$GH_TOKEN" \
owner=LedgerHQ \
repo=ledger-live-desktop \
tag="$GH_TAG" \
filename="dist/ledger-live-desktop-$LEDGER_LIVE_VERSION-linux-x86_64.AppImage"
scripts/upload-github-release-asset.sh \
github_api_token="$GH_TOKEN" \
owner=LedgerHQ \
repo=ledger-live-desktop \
tag="$GH_TAG" \
filename="dist/latest-linux.yml"
if [[ $(uname) == 'Linux' ]]; then
# --------------------------------------------------------------------
# Linux: Internal process error (null)
#
# context: https://github.com/LedgerHQ/ledger-live-desktop/issues/1010
# Linux: Internal process error (null)
#
# The "fix" is not optimal, as it doesn't really solve the problem
# (electron loading system openssl before we can load our embedded one)
# Quick summary:
#
# - build without publishing
# - unpack the .AppImage
# - download reported working libs from ubuntu mirrors, put it inside
# - re-pack the .AppImage
# - checksum stuff
# - upload to gh
runJob \
"DEBUG=electron-builder electron-builder build --publish never" \
"building and packaging app..." \
"app built and packaged successfully" \
"failed to build app" \
"verbose"
runJob \
"scripts/patch-appimage.sh" \
"patching AppImage..." \
"AppImage patched successfully" \
"failed to patch AppImage"
LEDGER_LIVE_VERSION=$(grep version package.json | sed -E 's/.*: "(.*)",/\1/g')
scripts/upload-github-release-asset.sh \
github_api_token="$GH_TOKEN" \
owner=LedgerHQ \
repo=ledger-live-desktop \
tag="$GH_TAG" \
filename="dist/ledger-live-desktop-$LEDGER_LIVE_VERSION-linux-x86_64.AppImage"
scripts/upload-github-release-asset.sh \
github_api_token="$GH_TOKEN" \
owner=LedgerHQ \
repo=ledger-live-desktop \
tag="$GH_TAG" \
filename="dist/latest-linux.yml"
else
runJob \
"DEBUG=electron-builder electron-builder build --publish always" \
"building and packaging app..." \
"app built and packaged successfully" \
"failed to build app" \
"verbose"
fi

1
src/bridge/LibcoreBridge.js

@ -220,6 +220,7 @@ const LibcoreBridge: WalletBridge<Transaction> = {
.send({
accountId: account.id,
currencyId: account.currency.id,
blockHeight: account.blockHeight,
xpub: account.xpub || '', // FIXME only reason is to build the op id. we need to consider another id for making op id.
derivationMode: account.derivationMode,
seedIdentifier: account.seedIdentifier,

35
src/commands/libcoreSignAndBroadcast.js

@ -2,6 +2,7 @@
import logger from 'logger'
import { BigNumber } from 'bignumber.js'
import { StatusCodes } from '@ledgerhq/hw-transport'
import Btc from '@ledgerhq/hw-app-btc'
import { Observable } from 'rxjs'
import { isSegwitDerivationMode } from '@ledgerhq/live-common/lib/derivation'
@ -13,6 +14,7 @@ import {
bigNumberToLibcoreAmount,
getOrCreateWallet,
} from 'helpers/libcore'
import { UpdateYourApp } from 'config/errors'
import withLibcore from 'helpers/withLibcore'
import { createCommand, Command } from 'helpers/ipc'
@ -26,6 +28,7 @@ type BitcoinLikeTransaction = {
type Input = {
accountId: string,
blockHeight: number,
currencyId: string,
derivationMode: string,
seedIdentifier: string,
@ -41,7 +44,17 @@ type Result = { type: 'signed' } | { type: 'broadcasted', operation: OperationRa
const cmd: Command<Input, Result> = createCommand(
'libcoreSignAndBroadcast',
({ accountId, currencyId, derivationMode, seedIdentifier, xpub, index, transaction, deviceId }) =>
({
accountId,
blockHeight,
currencyId,
derivationMode,
seedIdentifier,
xpub,
index,
transaction,
deviceId,
}) =>
Observable.create(o => {
let unsubscribed = false
const currency = getCryptoCurrencyById(currencyId)
@ -50,6 +63,7 @@ const cmd: Command<Input, Result> = createCommand(
doSignAndBroadcast({
accountId,
currency,
blockHeight,
derivationMode,
seedIdentifier,
xpub,
@ -79,6 +93,7 @@ const cmd: Command<Input, Result> = createCommand(
async function signTransaction({
hwApp,
currency,
blockHeight,
transaction,
derivationMode,
sigHashType,
@ -86,6 +101,7 @@ async function signTransaction({
}: {
hwApp: Btc,
currency: CryptoCurrency,
blockHeight: number,
transaction: *,
derivationMode: string,
sigHashType: number,
@ -94,7 +110,12 @@ async function signTransaction({
const additionals = []
let expiryHeight
if (currency.id === 'bitcoin_cash' || currency.id === 'bitcoin_gold') additionals.push('bip143')
if (currency.id === 'zcash') expiryHeight = Buffer.from([0x00, 0x00, 0x00, 0x00])
if (currency.id === 'zcash') {
expiryHeight = Buffer.from([0x00, 0x00, 0x00, 0x00])
if (blockHeight >= 419200) {
additionals.push('sapling')
}
}
const rawInputs = transaction.getInputs()
const hasExtraData = currency.id === 'zcash'
@ -166,6 +187,7 @@ async function signTransaction({
export async function doSignAndBroadcast({
accountId,
derivationMode,
blockHeight,
seedIdentifier,
currency,
xpub,
@ -180,6 +202,7 @@ export async function doSignAndBroadcast({
accountId: string,
derivationMode: string,
seedIdentifier: string,
blockHeight: number,
currency: CryptoCurrency,
xpub: string,
index: number,
@ -222,12 +245,18 @@ export async function doSignAndBroadcast({
signTransaction({
hwApp: new Btc(transport),
currency,
blockHeight,
transaction: builded,
sigHashType: parseInt(sigHashType, 16),
hasTimestamp,
derivationMode,
}),
)
).catch(e => {
if (e && e.statusCode === StatusCodes.INCORRECT_P1_P2) {
throw new UpdateYourApp(`UpdateYourApp ${currency.id}`, currency)
}
throw e
})
if (!signedTransaction || isCancelled() || !njsAccount) return
onSigned()

4
src/components/modals/AddAccounts/steps/03-step-import.js

@ -144,7 +144,9 @@ class StepImport extends PureComponent<StepProps> {
})
}
},
complete: () => setScanStatus('finished'),
complete: () => {
setScanStatus('finished')
},
error: err => {
logger.critical(err)
setScanStatus('error', err)

4
static/i18n/en/app.json

@ -826,8 +826,8 @@
"description": "Please try again or contact Ledger Support"
},
"UpdateYourApp": {
"title": "App update required. Uninstall and reinstall the {{managerAppName}} app in the Manager",
"description": null
"title": "App update required",
"description": "Uninstall and reinstall the {{managerAppName}} app in the Manager"
},
"WebsocketConnectionError": {
"title": "Sorry, try again (websocket error).",

16
yarn.lock

@ -1670,10 +1670,10 @@
camelcase "^5.0.0"
prettier "^1.13.7"
"@ledgerhq/hw-app-btc@4.24.0":
version "4.24.0"
resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-btc/-/hw-app-btc-4.24.0.tgz#8889b2bc9b9583209ed24f832c96ea8d23e1dc74"
integrity sha512-OEc8UCcdAWp10PPM9Keoh8imuusmNVe2o/89ujMT5UIWOGCu7duezpsnCY11jGNxf2hyos6lezUMlUAOHBuISQ==
"@ledgerhq/hw-app-btc@^4.27.0":
version "4.27.0"
resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-btc/-/hw-app-btc-4.27.0.tgz#11fc822bd34a47a39b1a7ae03ced69cf1d432796"
integrity sha512-7Ck48wCBb6nd9UXarNeGOsOqbOTi2cs4AxFhbDNrVLvPiBSH0yEiNQEF95J6u5BxKkAdM1GV9LoRumR4KhZGqQ==
dependencies:
"@ledgerhq/hw-transport" "^4.24.0"
create-hash "^1.1.3"
@ -1733,10 +1733,10 @@
dependencies:
events "^3.0.0"
"@ledgerhq/ledger-core@2.0.0-rc.8":
version "2.0.0-rc.8"
resolved "https://registry.yarnpkg.com/@ledgerhq/ledger-core/-/ledger-core-2.0.0-rc.8.tgz#618ff2ca091464c71890678d3912921ee46f98af"
integrity sha512-UYEwlw7+JfRCPw1z2kw9EGs88wsk5XBGxMPpNPF1cdpE7extEL63Gr+4h4ibU6kXEeEIpfI0lZ2l/6HwzMw6EQ==
"@ledgerhq/ledger-core@2.0.0-rc.9":
version "2.0.0-rc.9"
resolved "https://registry.yarnpkg.com/@ledgerhq/ledger-core/-/ledger-core-2.0.0-rc.9.tgz#f478f52fac0ecace8842df430bc83fa60e14483f"
integrity sha512-wd+w4W/8IfhX2a4h1sM9rkKD0vfcixkbrvKa+SmKzv0WtiUx1i94rHlPLX08tbP2ubaAv/LufeT2DwFz+EcssA==
dependencies:
"@ledgerhq/hw-app-btc" "^4.7.3"
"@ledgerhq/hw-transport-node-hid" "^4.7.6"

Loading…
Cancel
Save