Radish alpha
r
Radicle web interface
Radicle
Git (anonymous pull)
Log in to clone via SSH
Convert SIWE message to utf8array before hashing
Sebastian Martinez committed 4 years ago
commit c56a9497781b698a36c04729b51ec83317fec21b
parent 08a7cf6e1417d1adf373cf8429384700fa90527c
1 file changed +4 -1
modified src/WalletConnectSigner.ts
@@ -51,13 +51,16 @@ export class WalletConnectSigner extends ethers.Signer {
    const prefix = ethers.utils.toUtf8Bytes(
      `\x19Ethereum Signed Message:\n${message.length}`
    );
-
    const msg = ethers.utils.concat([prefix, message]);
+
    const data = ((typeof(message) === "string") ? ethers.utils.toUtf8Bytes(message): message);
+

+
    const msg = ethers.utils.concat([prefix, data]);
    const address = await this.getAddress();
    const keccakMessage = ethers.utils.keccak256(msg);
    const signature = await this.walletConnect.signMessage([
      address.toLowerCase(),
      keccakMessage,
    ]);
+

    return signature;
  }