Browse Source

Merge pull request #441 from meriadec/master

Pass `hasTimestamp` to `signTransaction` (fix Stratis / Stealthcoin)
master
Meriadec Pillet 7 years ago
committed by GitHub
parent
commit
f7340573ce
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      package.json
  2. 4
      src/commands/libcoreSignAndBroadcast.js
  3. 6
      yarn.lock

2
package.json

@ -41,7 +41,7 @@
"@ledgerhq/hw-app-xrp": "^4.12.0", "@ledgerhq/hw-app-xrp": "^4.12.0",
"@ledgerhq/hw-transport": "^4.12.0", "@ledgerhq/hw-transport": "^4.12.0",
"@ledgerhq/hw-transport-node-hid": "^4.12.0", "@ledgerhq/hw-transport-node-hid": "^4.12.0",
"@ledgerhq/ledger-core": "1.4.3", "@ledgerhq/ledger-core": "1.4.4",
"@ledgerhq/live-common": "^2.25.0", "@ledgerhq/live-common": "^2.25.0",
"axios": "^0.18.0", "axios": "^0.18.0",
"babel-runtime": "^6.26.0", "babel-runtime": "^6.26.0",

4
src/commands/libcoreSignAndBroadcast.js

@ -85,6 +85,9 @@ export async function doSignAndBroadcast({
njsWalletCurrency.bitcoinLikeNetworkParameters.SigHash, njsWalletCurrency.bitcoinLikeNetworkParameters.SigHash,
) )
const hasTimestamp = njsWalletCurrency.bitcoinLikeNetworkParameters.UsesTimestampedTransaction
// TODO: const timestampDelay = njsWalletCurrency.bitcoinLikeNetworkParameters.TimestampDelay
const currency = getCryptoCurrencyById(account.currencyId) const currency = getCryptoCurrencyById(account.currencyId)
const signedTransaction = await core.signTransaction({ const signedTransaction = await core.signTransaction({
hwApp, hwApp,
@ -92,6 +95,7 @@ export async function doSignAndBroadcast({
sigHashType: parseInt(sigHashType, 16).toString(), sigHashType: parseInt(sigHashType, 16).toString(),
supportsSegwit: !!currency.supportsSegwit, supportsSegwit: !!currency.supportsSegwit,
isSegwit: account.isSegwit, isSegwit: account.isSegwit,
hasTimestamp,
}) })
const txHash = await njsAccount.asBitcoinLikeAccount().broadcastRawTransaction(signedTransaction) const txHash = await njsAccount.asBitcoinLikeAccount().broadcastRawTransaction(signedTransaction)

6
yarn.lock

@ -1482,9 +1482,9 @@
dependencies: dependencies:
events "^2.0.0" events "^2.0.0"
"@ledgerhq/ledger-core@1.4.3": "@ledgerhq/ledger-core@1.4.4":
version "1.4.3" version "1.4.4"
resolved "https://registry.yarnpkg.com/@ledgerhq/ledger-core/-/ledger-core-1.4.3.tgz#6cc44560e5a8fb35f85c8ad9fbae56436eacfc94" resolved "https://registry.yarnpkg.com/@ledgerhq/ledger-core/-/ledger-core-1.4.4.tgz#36e1d41fee921e1635361b87e342ddec12293c0b"
dependencies: dependencies:
"@ledgerhq/hw-app-btc" "^4.7.3" "@ledgerhq/hw-app-btc" "^4.7.3"
"@ledgerhq/hw-transport-node-hid" "^4.7.6" "@ledgerhq/hw-transport-node-hid" "^4.7.6"

Loading…
Cancel
Save