Skip to content

Commit

Permalink
tweak: add "Message:" prefix to the text in the resulting JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
brusherru committed Oct 1, 2024
1 parent 70685c4 commit 4a61a05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
9 changes: 3 additions & 6 deletions src/components/SignMessageModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,14 @@ function SignMessageModal({
// Sign using Ledger device
throw new Error('Hardware wallet is not supported yet');
}
const text = `${SIGNED_MESSAGE_PREFIX}${message}`;
// Sign using local key
return JSON.stringify(
{
publicKey: key.publicKey,
text: message,
text,
signature: toHexString(
await signMessage(
`${SIGNED_MESSAGE_PREFIX}${message}`,
key.publicKey,
password
)
await signMessage(text, key.publicKey, password)
),
} satisfies SignedMessage,
null,
Expand Down
6 changes: 1 addition & 5 deletions src/components/VerifyMessageModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,7 @@ function VerifyMessageModal({
});
return;
}
verifyMessage(
data.signature,
`${SIGNED_MESSAGE_PREFIX}${data.text}`,
data.publicKey
)
verifyMessage(data.signature, data.text, data.publicKey)
.then((result) => {
setVerifyStatus(result ? VerifyStatus.Valid : VerifyStatus.Invalid);
})
Expand Down

0 comments on commit 4a61a05

Please sign in to comment.