diff --git a/src/components/SignMessageModal.tsx b/src/components/SignMessageModal.tsx index c0187ab..7c269eb 100644 --- a/src/components/SignMessageModal.tsx +++ b/src/components/SignMessageModal.tsx @@ -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, diff --git a/src/components/VerifyMessageModal.tsx b/src/components/VerifyMessageModal.tsx index 0bfe861..79e34f1 100644 --- a/src/components/VerifyMessageModal.tsx +++ b/src/components/VerifyMessageModal.tsx @@ -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); })