Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Pegasus] backend: Fixed bug in signMessage and verifyMessage #1575

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions backends/EmbeddedLND.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import LND from './LND';
import OpenChannelRequest from '../models/OpenChannelRequest';
// import Base64Utils from './../utils/Base64Utils';
import Base64Utils from './../utils/Base64Utils';
// import { Hash as sha256Hash } from 'fast-sha256';

import lndMobile from '../lndmobile/LndMobileInjection';
Expand Down Expand Up @@ -106,11 +106,14 @@ export default class EmbeddedLND extends LND {
getNodeInfo = async (urlParams?: Array<string>) =>
await getNodeInfo(urlParams[0]);
signMessage = async (msg: Uint8Array) => {
return await signMessageNodePubkey(msg);
return await signMessageNodePubkey(Base64Utils.stringToUint8Array(msg));
};
verifyMessage = async (data: object) => {
verifyMessage = async (data: any) => {
const { signature, msg } = data;
return await verifyMessageNodePubkey(signature, msg);
return await verifyMessageNodePubkey(
signature,
Base64Utils.stringToUint8Array(msg)
);
};

// getFees = () => N/A;
Expand Down