diff --git a/package.json b/package.json index 26933bda..75b27855 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "webpack-sources": "1.0.1" }, "dependencies": { - "@ledgerhq/hw-app-btc": "^4.13.0", + "@ledgerhq/hw-app-btc": "4.20.0", "@ledgerhq/hw-app-eth": "^4.14.0", "@ledgerhq/hw-app-xrp": "^4.13.0", "@ledgerhq/hw-transport": "^4.13.0", diff --git a/src/commands/libcoreSignAndBroadcast.js b/src/commands/libcoreSignAndBroadcast.js index 8b8e6bb2..07f36f7a 100644 --- a/src/commands/libcoreSignAndBroadcast.js +++ b/src/commands/libcoreSignAndBroadcast.js @@ -77,7 +77,9 @@ async function signTransaction({ hasTimestamp: boolean, }) { const additionals = [] + let expiryHeight if (currencyId === 'bitcoin_cash' || currencyId === 'bitcoin_gold') additionals.push('bip143') + if (currencyId === 'zcash') expiryHeight = Buffer.from([0x00, 0x00, 0x00, 0x00]) const rawInputs = transaction.getInputs() const inputs = await Promise.all( @@ -119,9 +121,14 @@ async function signTransaction({ const changePath = output ? output.getDerivationPath().toString() : undefined const outputScriptHex = Buffer.from(transaction.serializeOutputs()).toString('hex') - const lockTime = transaction.getLockTime() const initialTimestamp = hasTimestamp ? transaction.getTimestamp() : undefined + // FIXME + // should be `transaction.getLockTime()` as soon as lock time is + // handled by libcore (actually: it always returns a default value + // and that caused issue with zcash (see #904)) + const lockTime = undefined + const signedTransaction = await hwApp.createPaymentTransactionNew( inputs, associatedKeysets, @@ -132,6 +139,7 @@ async function signTransaction({ isSegwit, initialTimestamp, additionals, + expiryHeight, ) return signedTransaction diff --git a/yarn.lock b/yarn.lock index 6a500c91..a7acbc9c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1474,9 +1474,9 @@ version "0.7.1" resolved "https://registry.yarnpkg.com/@emotion/utils/-/utils-0.7.1.tgz#e44e596d03c9f16ba3b127ad333a8a072bcb5a0a" -"@ledgerhq/hw-app-btc@^4.13.0": - version "4.19.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-btc/-/hw-app-btc-4.19.0.tgz#0fdce47ad71df7783c6bf881e6a9bc8b4c84de52" +"@ledgerhq/hw-app-btc@4.20.0": + version "4.20.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-btc/-/hw-app-btc-4.20.0.tgz#116f841932c199c3a286563831154207a5aa656f" dependencies: "@ledgerhq/hw-transport" "^4.19.0" create-hash "^1.1.3"