Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
fix: make toBytes actually return the type it's typehint claims (#29313)
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptopapi997 authored Dec 20, 2022
1 parent 48a5026 commit 4ebe08e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/publickey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ export class PublicKey extends Struct {
* Return the byte array representation of the public key in big endian
*/
toBytes(): Uint8Array {
return this.toBuffer();
const buf = this.toBuffer();
return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
}

/**
Expand Down

0 comments on commit 4ebe08e

Please sign in to comment.