HomePhabricator

[Cashtab] add message signing function

Description

[Cashtab] add message signing function

Summary:

  • Adds a new function for the user to sign messages using the current active wallet.
  • New signPkMessage function in useBCH.js which calls the signMessageWithPrivKey function
  • New collapsable form added to Send.js, which then passes BCH, fundingWif and message to useBCH.js, which subsequently calls BCH.BitcoinCash.signMessageWithPrivKey(pk, message) to sign the message and returns the corresponding signature.

Test Plan:

  • npm start
  • navigate to the Send tab and un-collapse the Sign Message form
  • ensure the Sign Message button is disabled when no input is entered
  • ensure the Sign Message button is disabled when input is entered but is then deleted
  • ensure the Sign Message button is disabled when input is greater than 150 characters
  • input message between 1-150 characters then click the sign message button, okay the dialog and note the successful notification and signature returned
  • click on the signature field after a signature has been generated and verify it has copied to clipboard
  • without moving away from the same screen, sign another message and ensure the 'Copied to clipboard' message disappears, before clicking on the newly generated signature and verify the new signature is now copied to clipboard
  • open electrumABC wallet
  • verify signature in the electrumABC wallet
  • verify cross browser compatibility in firefox
  • npm run extension
  • verify the above works in extension mode

Reviewers: bytesofman, #bitcoin_abc

Reviewed By: bytesofman, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D10409

Details

Provenance
emackAuthored on Nov 1 2021, 13:56
emackPushed on Nov 4 2021, 22:12
Reviewer
Restricted Project
Differential Revision
D10409: [Cashtab] add message signing function
Parents
rABCf9e512da127d: Revert "[Cashtab] Auto add latest commit hash to configure"
Branches
Unknown
Tags
Unknown