Skip to content

Commit

Permalink
chore: Remove legacy sign message logic
Browse files Browse the repository at this point in the history
  • Loading branch information
hackurity01 committed Sep 26, 2022
1 parent d7d2769 commit b11d4cb
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/components/SignMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@ function SignMessage() {
const [message, setMessage] = useState('');
const [signedMessage, setSignedMessage] = useState('');

async function signMessage(isEthSign = false) {
async function signMessage() {
const provider = new providers.Web3Provider(face.getEthLikeProvider(), 'any');
let response;
if (isEthSign) {
response = await provider.getSigner()._legacySignMessage(message);
} else {
response = await provider.getSigner().signMessage(message);
}

const signer = await provider.getSigner();
const response = await signer.signMessage(message);

console.log('Signed message', response);
setSignedMessage(response);
}
Expand Down

0 comments on commit b11d4cb

Please sign in to comment.