From e08777f58ec63b1d7420176b773bdd87ea41465c Mon Sep 17 00:00:00 2001 From: KhalilBellakrid Date: Fri, 9 Nov 2018 10:21:48 +0100 Subject: [PATCH 1/5] Decred Integration --- src/commands/libcoreSignAndBroadcast.js | 7 +++++++ src/config/cryptocurrencies.js | 1 + 2 files changed, 8 insertions(+) diff --git a/src/commands/libcoreSignAndBroadcast.js b/src/commands/libcoreSignAndBroadcast.js index 79cdaed5..542fb715 100644 --- a/src/commands/libcoreSignAndBroadcast.js +++ b/src/commands/libcoreSignAndBroadcast.js @@ -115,6 +115,8 @@ async function signTransaction({ if (blockHeight >= 419200) { additionals.push('sapling') } + } else if (currency.id === 'decred') { + expiryHeight = Buffer.from([0x00, 0x00, 0x00, 0x00]) } const rawInputs = transaction.getInputs() @@ -122,6 +124,10 @@ async function signTransaction({ const inputs = await Promise.all( rawInputs.map(async input => { + const additionals = [] + if (currency.id === 'decred') { + additionals.push('decred') + } const rawPreviousTransaction = await input.getPreviousTransaction() const hexPreviousTransaction = Buffer.from(rawPreviousTransaction).toString('hex') const previousTransaction = hwApp.splitTransaction( @@ -129,6 +135,7 @@ async function signTransaction({ currency.supportsSegwit, hasTimestamp, hasExtraData, + additionals, ) const outputIndex = input.getPreviousOutputIndex() const sequence = input.getSequence() diff --git a/src/config/cryptocurrencies.js b/src/config/cryptocurrencies.js index 4c6d1ea5..c29ccbc7 100644 --- a/src/config/cryptocurrencies.js +++ b/src/config/cryptocurrencies.js @@ -27,6 +27,7 @@ const supported: CryptoCurrencyIds[] = [ 'stealthcoin', 'poswallet', 'clubcoin', + 'decred', 'bitcoin_testnet', ] From 4936cbc08c688606c287c63d5a2271d6cd8d1e08 Mon Sep 17 00:00:00 2001 From: KhalilBellakrid Date: Thu, 15 Nov 2018 11:58:28 +0100 Subject: [PATCH 2/5] Bump binding and hw-app-btc versions for Decred integration --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b986fa88..c277c001 100644 --- a/package.json +++ b/package.json @@ -35,12 +35,12 @@ } }, "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/ledger-core": "2.0.0-rc.12", "@ledgerhq/live-common": "4.4.2", "animated": "^0.2.2", "async": "^2.6.1", From ab2f8dfef21a64f858a321386c90f15a77571962 Mon Sep 17 00:00:00 2001 From: meriadec Date: Thu, 15 Nov 2018 15:22:46 +0100 Subject: [PATCH 3/5] Update yarn.lock --- yarn.lock | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index 5a71aaaf..b4c70957 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1670,7 +1670,7 @@ camelcase "^5.0.0" prettier "^1.13.7" -"@ledgerhq/hw-app-btc@^4.24.0", "@ledgerhq/hw-app-btc@^4.27.0": +"@ledgerhq/hw-app-btc@^4.24.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== @@ -1686,6 +1686,14 @@ "@ledgerhq/hw-transport" "^4.15.0" create-hash "^1.1.3" +"@ledgerhq/hw-app-btc@^v4.30.0": + version "4.30.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-btc/-/hw-app-btc-4.30.0.tgz#50cef544c361072ce12b12b1e8166d7a8b0d9dbd" + integrity sha512-xVXcI4cvBZiqx2o6fB+3tt0HhzJwGH17EoGP3PRJoFvIRi3Mnf3R0CU5k8Y7xFzISvmBEO2GKcetjg4dfgqDKw== + dependencies: + "@ledgerhq/hw-transport" "^4.24.0" + create-hash "^1.1.3" + "@ledgerhq/hw-app-eth@^4.24.0": version "4.24.0" resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-4.24.0.tgz#b62514e0d18672d6d35d76dfbeaf93b67d2e5324" @@ -1741,10 +1749,10 @@ dependencies: events "^3.0.0" -"@ledgerhq/ledger-core@2.0.0-rc.11": - version "2.0.0-rc.11" - resolved "https://registry.yarnpkg.com/@ledgerhq/ledger-core/-/ledger-core-2.0.0-rc.11.tgz#5b314e222f487dfa8f525ba1ef008ae30b289339" - integrity sha512-HmtUd3WrVhJQtjNe6qO/hGrnzrE2YbdaTQnLhsQyD3qN1vUwHmanHjqOqVLFRI8a3KqVdMFqYMvn3N5c0hsLuQ== +"@ledgerhq/ledger-core@2.0.0-rc.12": + version "2.0.0-rc.12" + resolved "https://registry.yarnpkg.com/@ledgerhq/ledger-core/-/ledger-core-2.0.0-rc.12.tgz#bdd3e4b601acb0c74c640f40bea2609bb5e4b0f4" + integrity sha512-nwPAmDlGGSx/nRzwxKodmN1KBKtFmElE0FkbbAn1s0xiX6C8wMPRWPtD7oTufJ5MsfSfJg4ELsscEiaHFbZFKA== dependencies: "@ledgerhq/hw-app-btc" "^4.7.3" "@ledgerhq/hw-transport-node-hid" "^4.7.6" From b00325b5fc9caa8ef216fe49b1d652e946f8b6c8 Mon Sep 17 00:00:00 2001 From: meriadec Date: Thu, 15 Nov 2018 17:26:28 +0100 Subject: [PATCH 4/5] Correctly build additionals for decred --- src/commands/libcoreSignAndBroadcast.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/commands/libcoreSignAndBroadcast.js b/src/commands/libcoreSignAndBroadcast.js index 542fb715..e907faf1 100644 --- a/src/commands/libcoreSignAndBroadcast.js +++ b/src/commands/libcoreSignAndBroadcast.js @@ -117,6 +117,7 @@ async function signTransaction({ } } else if (currency.id === 'decred') { expiryHeight = Buffer.from([0x00, 0x00, 0x00, 0x00]) + additionals.push('decred') } const rawInputs = transaction.getInputs() @@ -124,10 +125,6 @@ async function signTransaction({ const inputs = await Promise.all( rawInputs.map(async input => { - const additionals = [] - if (currency.id === 'decred') { - additionals.push('decred') - } const rawPreviousTransaction = await input.getPreviousTransaction() const hexPreviousTransaction = Buffer.from(rawPreviousTransaction).toString('hex') const previousTransaction = hwApp.splitTransaction( From 63a529a87e831689a3b930c66af1ed0c9ffde10a Mon Sep 17 00:00:00 2001 From: meriadec Date: Mon, 3 Dec 2018 18:21:40 +0100 Subject: [PATCH 5/5] Add word-break: break-word; to send confirmation step --- src/components/modals/Send/steps/04-step-confirmation.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/modals/Send/steps/04-step-confirmation.js b/src/components/modals/Send/steps/04-step-confirmation.js index f39881b9..50b762cc 100644 --- a/src/components/modals/Send/steps/04-step-confirmation.js +++ b/src/components/modals/Send/steps/04-step-confirmation.js @@ -34,6 +34,7 @@ const Title = styled(Box).attrs({ mt: 2, })` text-align: center; + word-break: break-word; ` const Text = styled(Box).attrs({