From 6e32e048429ed53a3373d85ea595d687f114a838 Mon Sep 17 00:00:00 2001 From: Lautaro Dragan Date: Wed, 3 Jul 2019 19:49:22 -0300 Subject: [PATCH] fix: use signrawtransactionwithwallet (#947) --- docker-compose.yml | 2 -- package-lock.json | 16 ++++++++-------- package.json | 2 +- src/BlockchainWriter/Controller.ts | 2 +- typings/bitcoin-core.d.ts | 1 + 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index ca0853b9..cb2e6763 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -52,7 +52,6 @@ services: -rpcuser=bitcoinrpcuser -rpcpassword=bitcoinrpcpassword -rpcallowip=::/0 - -deprecatedrpc=signrawtransaction bitcoind-2: image: ruimarinho/bitcoin-core:0.17.0 @@ -70,7 +69,6 @@ services: -rpcuser=bitcoinrpcuser -rpcpassword=bitcoinrpcpassword -rpcallowip=::/0 - -deprecatedrpc=signrawtransaction k6: build: diff --git a/package-lock.json b/package-lock.json index 493f8e6c..58061cb9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1733,9 +1733,9 @@ } }, "bitcoin-core": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/bitcoin-core/-/bitcoin-core-2.0.0.tgz", - "integrity": "sha512-I6I7ejzbXfyMtR5/z0BhfjTeN8PMQGD+1B1rpu6IoLcwqoybaSa+P4zYnja/p2xdqjdctmgbOtAaCaaqyVCycQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/bitcoin-core/-/bitcoin-core-2.2.0.tgz", + "integrity": "sha512-WIEvgEbVzezbPWLddNwRLaN/mx1i3SrAqJAsFHoWMMjOOxpFWZePqEJO2R0ZjvP+H1VMtWjREc44QoX7oxfESQ==", "requires": { "@uphold/request-logger": "^2.0.0", "bluebird": "^3.4.1", @@ -6127,9 +6127,9 @@ "dev": true }, "moment": { - "version": "2.22.2", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz", - "integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y=", + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz", + "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==", "optional": true }, "mongodb": { @@ -6268,7 +6268,7 @@ }, "ncp": { "version": "2.0.0", - "resolved": "http://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", "integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=", "optional": true }, @@ -10763,7 +10763,7 @@ }, "rimraf": { "version": "2.4.5", - "resolved": "http://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz", "integrity": "sha1-7nEM5dk6j9uFb7Xqj/Di11k0sto=", "optional": true, "requires": { diff --git a/package.json b/package.json index 79106a21..13397d0b 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "dependencies": { "@po.et/poet-js": "5.1.17", "amqplib": "0.5.3", - "bitcoin-core": "2.0.0", + "bitcoin-core": "2.2.0", "bs58": "4.0.1", "form-data": "2.3.3", "ipfs-http-client": "28.1.0", diff --git a/src/BlockchainWriter/Controller.ts b/src/BlockchainWriter/Controller.ts index 29ee6bfd..0ecd31fa 100644 --- a/src/BlockchainWriter/Controller.ts +++ b/src/BlockchainWriter/Controller.ts @@ -180,7 +180,7 @@ export class Controller { 'Got fundedTransaction from Bitcoin Core', ) - const signedTransaction = await bitcoinCore.signRawTransaction(fundedTransaction.hex) + const signedTransaction = await bitcoinCore.signRawTransactionWithWallet(fundedTransaction.hex) logger.trace( { diff --git a/typings/bitcoin-core.d.ts b/typings/bitcoin-core.d.ts index 6350cdd0..c3df68f7 100644 --- a/typings/bitcoin-core.d.ts +++ b/typings/bitcoin-core.d.ts @@ -60,6 +60,7 @@ declare module 'bitcoin-core' { fundRawTransaction(hexstring: string, options?: FundRawTransactionOptions): Promise setNetworkActive(flag: boolean): Promise signRawTransaction(hexstring: string): Promise + signRawTransactionWithWallet(hexstring: string): Promise sendRawTransaction(hexstring: string): Promise estimateSmartFee(blocks: number): Promise }