Misc Primitive Fixes
This commit is contained in:
@@ -15,7 +15,7 @@ import {
|
||||
*/
|
||||
export class PublicKey {
|
||||
// The raw bytes representing the Public Key.
|
||||
public readonly bytes: Uint8Array;
|
||||
protected readonly bytes: Uint8Array;
|
||||
|
||||
/**
|
||||
* Construct a new Public Key.
|
||||
@@ -37,8 +37,8 @@ export class PublicKey {
|
||||
*/
|
||||
public static from(publicKey: Uint8Array | string) {
|
||||
return publicKey instanceof Uint8Array
|
||||
? PublicKey.fromBytes(publicKey)
|
||||
: PublicKey.fromHex(publicKey);
|
||||
? this.fromBytes(publicKey)
|
||||
: this.fromHex(publicKey);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -56,7 +56,7 @@ export class PublicKey {
|
||||
throw new Error(`Invalid Public Key.`);
|
||||
}
|
||||
|
||||
return new PublicKey(publicKeyBytes);
|
||||
return new this(publicKeyBytes);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,7 +80,7 @@ export class PublicKey {
|
||||
const publicKey = hexToBin(publicKeyHex);
|
||||
|
||||
// Create a Public Key Entity from the binary.
|
||||
return new PublicKey(publicKey);
|
||||
return new this(publicKey);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user