Skip to content

Commit

Permalink
Add proper casts.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreibancioiu committed May 24, 2023
1 parent afc0c16 commit 27576a8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@multiversx/sdk-wallet",
"version": "4.2.0-alpha.3",
"version": "4.2.0-alpha.4",
"description": "Wallet components for MultiversX",
"main": "out/index.js",
"types": "out/index.d.js",
Expand Down
3 changes: 0 additions & 3 deletions src/globals.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
require("./globals");

export * from "./mnemonic";
export * from "./pem";
export * from "./userKeys";
Expand Down
4 changes: 2 additions & 2 deletions src/userKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class UserSecretKey {
}

sign(message: Buffer): Buffer {
const signature = ed.sync.sign(message, this.buffer);
const signature = ed.sync.sign(new Uint8Array(message), new Uint8Array(this.buffer));
return Buffer.from(signature);
}

Expand All @@ -61,7 +61,7 @@ export class UserPublicKey {

verify(data: Buffer, signature: Buffer): boolean {
try {
const ok = ed.sync.verify(signature, data, this.buffer);
const ok = ed.sync.verify(new Uint8Array(signature), new Uint8Array(data), new Uint8Array(this.buffer));
return ok;
} catch (err: any) {
console.error(err);
Expand Down

0 comments on commit 27576a8

Please sign in to comment.