Skip to content

Commit

Permalink
fix: make toBytes actually return the type it's typehint claims
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptopapi997 authored Dec 17, 2022
1 parent d1722b7 commit 5c0f729
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion web3.js/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(b.buffer, b.byteOffset, b.byteLength);
}

/**
Expand Down

0 comments on commit 5c0f729

Please sign in to comment.