Skip to content

Commit 7ce8714

Browse files
committed
Fix get compressed key bytes returned value
The returned value should be a new array, instead of referencing the original one.
1 parent 5804f08 commit 7ce8714

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/chain/public-key.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export class PublicKey implements ABISerializableObject {
7373
* This is suitable for cryptographic operations like verification.
7474
*/
7575
getCompressedKeyBytes(): Uint8Array {
76-
return this.type === KeyType.WA ? this.data.array.subarray(0, 33) : this.data.array
76+
return this.type === KeyType.WA ? this.data.array.slice(0, 33) : this.data.array
7777
}
7878

7979
equals(other: PublicKeyType) {

0 commit comments

Comments
 (0)