From 12b9a6bbf9927e9ed145c99cd82d1a48d8912563 Mon Sep 17 00:00:00 2001 From: meriadec Date: Fri, 13 Jul 2018 10:15:39 +0200 Subject: [PATCH 1/3] Bump @ledgerhq/hw-app-btc --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index f08e1aab..447b7302 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/yarn.lock b/yarn.lock index 0e40cc7f..0ef4da30 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" From 0931477234d6d11a81e67ab0f7c3d0d53c8a5c5e Mon Sep 17 00:00:00 2001 From: meriadec Date: Mon, 16 Jul 2018 18:46:28 +0200 Subject: [PATCH 2/3] Zcash overwinter support closes #904 --- src/commands/libcoreSignAndBroadcast.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/commands/libcoreSignAndBroadcast.js b/src/commands/libcoreSignAndBroadcast.js index 8b8e6bb2..14a8f063 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,7 +121,7 @@ async function signTransaction({ const changePath = output ? output.getDerivationPath().toString() : undefined const outputScriptHex = Buffer.from(transaction.serializeOutputs()).toString('hex') - const lockTime = transaction.getLockTime() + const lockTime = undefined // TODO: transaction.getLockTime() const initialTimestamp = hasTimestamp ? transaction.getTimestamp() : undefined const signedTransaction = await hwApp.createPaymentTransactionNew( @@ -132,6 +134,7 @@ async function signTransaction({ isSegwit, initialTimestamp, additionals, + expiryHeight, ) return signedTransaction From fc463da721be514711c1a7317c7b2e852ec2cf03 Mon Sep 17 00:00:00 2001 From: meriadec Date: Tue, 17 Jul 2018 10:45:02 +0200 Subject: [PATCH 3/3] Document locktime temporary disable --- src/commands/libcoreSignAndBroadcast.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/commands/libcoreSignAndBroadcast.js b/src/commands/libcoreSignAndBroadcast.js index 14a8f063..07f36f7a 100644 --- a/src/commands/libcoreSignAndBroadcast.js +++ b/src/commands/libcoreSignAndBroadcast.js @@ -121,9 +121,14 @@ async function signTransaction({ const changePath = output ? output.getDerivationPath().toString() : undefined const outputScriptHex = Buffer.from(transaction.serializeOutputs()).toString('hex') - const lockTime = undefined // TODO: 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,