From 67aa87e28df35c414b0650d8a0b79998e58a64a7 Mon Sep 17 00:00:00 2001 From: jolestar Date: Tue, 23 Apr 2019 13:55:51 +0800 Subject: [PATCH 1/6] fix bug:ECPair.verify should return boolean fECPair.verify should return boolean, and js implements indeed return boolean. --- types/ecpair.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/ecpair.d.ts b/types/ecpair.d.ts index a5ae716..2cc2c27 100644 --- a/types/ecpair.d.ts +++ b/types/ecpair.d.ts @@ -12,7 +12,7 @@ export interface ECPairInterface { publicKey?: Buffer; toWIF(): string; sign(hash: Buffer): Buffer; - verify(hash: Buffer, signature: Buffer): Buffer; + verify(hash: Buffer, signature: Buffer): boolean; getPublicKey?(): Buffer; } declare class ECPair implements ECPairInterface { @@ -25,7 +25,7 @@ declare class ECPair implements ECPairInterface { readonly publicKey: Buffer | undefined; toWIF(): string; sign(hash: Buffer): Buffer; - verify(hash: Buffer, signature: Buffer): Buffer; + verify(hash: Buffer, signature: Buffer): boolean; } declare function fromPrivateKey(buffer: Buffer, options?: ECPairOptions): ECPair; declare function fromPublicKey(buffer: Buffer, options?: ECPairOptions): ECPair; From 00ca4c2ec7a112ca5f036409d98cfedaa24ee0cf Mon Sep 17 00:00:00 2001 From: Jonathan Underwood Date: Tue, 23 Apr 2019 15:10:01 +0900 Subject: [PATCH 2/6] Fix ts files from Buffer to boolean --- ts_src/ecpair.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ts_src/ecpair.ts b/ts_src/ecpair.ts index 3941afa..5c31e7f 100644 --- a/ts_src/ecpair.ts +++ b/ts_src/ecpair.ts @@ -26,7 +26,7 @@ export interface ECPairInterface { publicKey?: Buffer; toWIF(): string; sign(hash: Buffer): Buffer; - verify(hash: Buffer, signature: Buffer): Buffer; + verify(hash: Buffer, signature: Buffer): boolean; getPublicKey?(): Buffer; } @@ -66,7 +66,7 @@ class ECPair implements ECPairInterface { return ecc.sign(hash, this.__D); } - verify(hash: Buffer, signature: Buffer): Buffer { + verify(hash: Buffer, signature: Buffer): boolean { return ecc.verify(hash, this.publicKey, signature); } } From 56c876e979a24fbdaa6c90cad3bafe302f9f9f24 Mon Sep 17 00:00:00 2001 From: junderw Date: Thu, 25 Apr 2019 19:07:46 +0900 Subject: [PATCH 3/6] 5.0.3 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index f56a619..b69c70b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "bitcoinjs-lib", - "version": "5.0.2", + "version": "5.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 591e98a..2387bed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bitcoinjs-lib", - "version": "5.0.2", + "version": "5.0.3", "description": "Client-side Bitcoin JavaScript library", "main": "./src/index.js", "types": "./types/index.d.ts", From 68339fda4de72cc40fa8db6602595b4e1a7e8577 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Mon, 13 May 2019 16:35:02 +0700 Subject: [PATCH 4/6] Remove source files before rebuilding --- package-lock.json | 25 +++++++++++++++++++++++++ package.json | 4 +++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index b69c70b..2b0f37e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1845,6 +1845,31 @@ "path-parse": "^1.0.5" } }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + }, + "dependencies": { + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, "ripemd160": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", diff --git a/package.json b/package.json index 2387bed..b667ba0 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "bitcoinjs" ], "scripts": { - "build": "tsc -p ./tsconfig.json", + "clean": "rimraf src", + "build": "npm run clean && tsc -p ./tsconfig.json", "coverage-report": "npm run build && npm run nobuild:coverage-report", "coverage-html": "npm run build && npm run nobuild:coverage-html", "coverage": "npm run build && npm run nobuild:coverage", @@ -71,6 +72,7 @@ "nyc": "^13.3.0", "prettier": "1.16.4", "proxyquire": "^2.0.1", + "rimraf": "^2.6.3", "tslint": "5.13.1", "typescript": "3.2.2" }, From 5ef135f9e429925c51461d11c3000ce6d1275793 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Mon, 13 May 2019 16:39:08 +0700 Subject: [PATCH 5/6] Ensure build scripts are in alphabetical order --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b667ba0..a26330d 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,8 @@ "bitcoinjs" ], "scripts": { - "clean": "rimraf src", "build": "npm run clean && tsc -p ./tsconfig.json", + "clean": "rimraf src", "coverage-report": "npm run build && npm run nobuild:coverage-report", "coverage-html": "npm run build && npm run nobuild:coverage-html", "coverage": "npm run build && npm run nobuild:coverage", From 5a381ba582856a348d8182508a15a2584894cefa Mon Sep 17 00:00:00 2001 From: Agent of User Date: Fri, 17 May 2019 08:02:53 -0400 Subject: [PATCH 6/6] Bump tiny-secp256k1 to version supporting node 12 --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2b0f37e..f5bb788 100644 --- a/package-lock.json +++ b/package-lock.json @@ -731,9 +731,9 @@ "dev": true }, "nan": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", - "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==" + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" }, "nyc": { "version": "13.3.0", @@ -1936,15 +1936,15 @@ } }, "tiny-secp256k1": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tiny-secp256k1/-/tiny-secp256k1-1.0.1.tgz", - "integrity": "sha512-Wz2kMPWtCI5XBftFeF3bUL8uz2+VlasniKwOkRPjvL7h1QVd9rbhrve/HWUu747kJKzVf1XHonzcdM4Ut8fvww==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/tiny-secp256k1/-/tiny-secp256k1-1.1.1.tgz", + "integrity": "sha512-jA9WalQuhKun1svJrAVi9Vu8aUWKMfR7nMV903kHjrHTTY/IFa0petSq+Jk/Mv447dGD9LC8fGsmGRubBbcNng==", "requires": { "bindings": "^1.3.0", "bn.js": "^4.11.8", "create-hmac": "^1.1.7", "elliptic": "^6.4.0", - "nan": "^2.10.0" + "nan": "^2.13.2" } }, "to-fast-properties": { diff --git a/package.json b/package.json index a26330d..1f6f83a 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "merkle-lib": "^2.0.10", "pushdata-bitcoin": "^1.0.1", "randombytes": "^2.0.1", - "tiny-secp256k1": "^1.0.0", + "tiny-secp256k1": "^1.1.1", "typeforce": "^1.11.3", "varuint-bitcoin": "^1.0.4", "wif": "^2.0.1"