fix bug:ECPair.verify should return boolean

fECPair.verify should return boolean, and js implements indeed return boolean.
This commit is contained in:
jolestar 2019-04-23 13:55:51 +08:00 committed by GitHub
parent a52ef82e4f
commit 67aa87e28d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

4
types/ecpair.d.ts vendored
View file

@ -12,7 +12,7 @@ export interface ECPairInterface {
publicKey?: Buffer; publicKey?: Buffer;
toWIF(): string; toWIF(): string;
sign(hash: Buffer): Buffer; sign(hash: Buffer): Buffer;
verify(hash: Buffer, signature: Buffer): Buffer; verify(hash: Buffer, signature: Buffer): boolean;
getPublicKey?(): Buffer; getPublicKey?(): Buffer;
} }
declare class ECPair implements ECPairInterface { declare class ECPair implements ECPairInterface {
@ -25,7 +25,7 @@ declare class ECPair implements ECPairInterface {
readonly publicKey: Buffer | undefined; readonly publicKey: Buffer | undefined;
toWIF(): string; toWIF(): string;
sign(hash: Buffer): Buffer; 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 fromPrivateKey(buffer: Buffer, options?: ECPairOptions): ECPair;
declare function fromPublicKey(buffer: Buffer, options?: ECPairOptions): ECPair; declare function fromPublicKey(buffer: Buffer, options?: ECPairOptions): ECPair;