Resolve "feat(Primitives): Have Bytes Primitive extends Uint8Array (if possible)"
This commit is contained in:
@@ -78,7 +78,7 @@ export class PublicKey {
|
||||
* @returns The created Public Key entity.
|
||||
*/
|
||||
public static fromHex(publicKeyHex: string): PublicKey {
|
||||
return new this(Bytes.fromHex(publicKeyHex).toBytes());
|
||||
return new this(Bytes.fromHex(publicKeyHex));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -232,11 +232,11 @@ export class PublicKey {
|
||||
signature: Uint8Array | string,
|
||||
): boolean {
|
||||
if (typeof messageHash === 'string') {
|
||||
messageHash = Bytes.fromHex(messageHash).toBytes();
|
||||
messageHash = Bytes.fromHex(messageHash);
|
||||
}
|
||||
|
||||
if (typeof signature === 'string') {
|
||||
signature = Bytes.fromHex(signature).toBytes();
|
||||
signature = Bytes.fromHex(signature);
|
||||
}
|
||||
|
||||
const validity = secp256k1.verifySignatureDER(
|
||||
@@ -261,11 +261,11 @@ export class PublicKey {
|
||||
signature: Uint8Array | string,
|
||||
): boolean {
|
||||
if (typeof messageHash === 'string') {
|
||||
messageHash = Bytes.fromHex(messageHash).toBytes();
|
||||
messageHash = Bytes.fromHex(messageHash);
|
||||
}
|
||||
|
||||
if (typeof signature === 'string') {
|
||||
signature = Bytes.fromHex(signature).toBytes();
|
||||
signature = Bytes.fromHex(signature);
|
||||
}
|
||||
|
||||
const validity = secp256k1.verifySignatureSchnorr(
|
||||
|
||||
Reference in New Issue
Block a user