Browse Source

Merge branch 'develop' into UpdateYourApp-6b00

gre-patch-1
Gaëtan Renaudeau 6 years ago
parent
commit
d76ccc0706
No known key found for this signature in database GPG Key ID: 7B66B85F042E5451
  1. 4
      package.json
  2. 1
      src/bridge/LibcoreBridge.js
  3. 26
      src/commands/libcoreSignAndBroadcast.js
  4. 4
      src/components/modals/AddAccounts/steps/03-step-import.js
  5. 16
      yarn.lock

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",

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,

26
src/commands/libcoreSignAndBroadcast.js

@ -28,6 +28,7 @@ type BitcoinLikeTransaction = {
type Input = {
accountId: string,
blockHeight: number,
currencyId: string,
derivationMode: string,
seedIdentifier: string,
@ -43,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)
@ -52,6 +63,7 @@ const cmd: Command<Input, Result> = createCommand(
doSignAndBroadcast({
accountId,
currency,
blockHeight,
derivationMode,
seedIdentifier,
xpub,
@ -81,6 +93,7 @@ const cmd: Command<Input, Result> = createCommand(
async function signTransaction({
hwApp,
currency,
blockHeight,
transaction,
derivationMode,
sigHashType,
@ -88,6 +101,7 @@ async function signTransaction({
}: {
hwApp: Btc,
currency: CryptoCurrency,
blockHeight: number,
transaction: *,
derivationMode: string,
sigHashType: number,
@ -96,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'
@ -168,6 +187,7 @@ async function signTransaction({
export async function doSignAndBroadcast({
accountId,
derivationMode,
blockHeight,
seedIdentifier,
currency,
xpub,
@ -182,6 +202,7 @@ export async function doSignAndBroadcast({
accountId: string,
derivationMode: string,
seedIdentifier: string,
blockHeight: number,
currency: CryptoCurrency,
xpub: string,
index: number,
@ -224,6 +245,7 @@ export async function doSignAndBroadcast({
signTransaction({
hwApp: new Btc(transport),
currency,
blockHeight,
transaction: builded,
sigHashType: parseInt(sigHashType, 16),
hasTimestamp,

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)

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