From 2a97ad4ba8331d10350bf7602c772645f90ee166 Mon Sep 17 00:00:00 2001 From: microcai Date: Tue, 28 Jan 2020 06:15:03 +0800 Subject: [PATCH] follow secp256k1@4.0.0 api change (#41642) --- types/secp256k1/index.d.ts | 2 +- types/secp256k1/secp256k1-tests.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/secp256k1/index.d.ts b/types/secp256k1/index.d.ts index 686171565b..d5ec720a39 100644 --- a/types/secp256k1/index.d.ts +++ b/types/secp256k1/index.d.ts @@ -113,7 +113,7 @@ export function signatureImportLax(signature: Buffer): Buffer; * - Compose 32-byte scalar `s = k^-1 * (r * d + m)`. Reject nonce if `s` is zero. * - The signature is `(r, s)`. */ -export function sign(message: Buffer, privateKey: Buffer, options?: SignOptions): {signature: Buffer, recovery: number}; +export function ecdsaSign(message: Buffer, privateKey: Buffer, options?: SignOptions): {signature: Uint8Array, recovery: number}; /** * Verify an ECDSA signature. diff --git a/types/secp256k1/secp256k1-tests.ts b/types/secp256k1/secp256k1-tests.ts index 03754354b1..f1104765ad 100644 --- a/types/secp256k1/secp256k1-tests.ts +++ b/types/secp256k1/secp256k1-tests.ts @@ -1,4 +1,4 @@ -import { SignOptions, sign } from "secp256k1"; +import { SignOptions, ecdsaSign } from "secp256k1"; const opts: SignOptions = { data: Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]) @@ -8,4 +8,4 @@ const message = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); const prvKey = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); -sign(message, prvKey, opts); +ecdsaSign(message, prvKey, opts);