Page MenuHomePhabricator

[Cashtab] Verify Message feature
ClosedPublic

Authored by emack on Mar 31 2022, 07:35.

Details

Reviewers
bytesofman
Group Reviewers
Restricted Project
Commits
rABCa6ccd842b996: [Cashtab] Verify Message feature
Summary

As per T2368, adding a Verify Message feature to complement the existing Sign Message function.

Test Plan
  • Navigate to Send component
  • Use the Sign Message feature to sign a message using the activate wallet, noting the address, message and signature
  • Enter the message, address and signature into the Verify Message feature and ensure successful verification
  • enter an invalid cash address or valid etoken address and ensure error validation is triggered
  • enter a signature that is not 88 characters and ensure error validation is triggered
  • ensure the Verify Message button is only active when the Message is not empty, Address is a valid eCash address and the Signature is exactly 88 characters. Ensure it is inactive when one of the three fields is invalid.
  • test across chrome/brave/firefox browsers and iOS/Android devices

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emack requested review of this revision.Mar 31 2022, 07:35
bytesofman added inline comments.
web/cashtab/src/hooks/useBCH.js
1324 ↗(On Diff #33019)

I know we have this function split out here for signing, but I think similar situation as earlier discussed. This function isn't really doing anything more than the BCH.BitcoinCash.verifyMessage function; so we should just use that function instead.

As a rule of thumb, if we can't add unit tests for a low-level function in Cashtab, then we shouldn't add the function.

This revision now requires changes to proceed.Mar 31 2022, 14:22
emack marked an inline comment as done.

Calling BCH.BitcoinCash.verifyMessage API directly in the Send component

Going forward, we'll

  • add a screen to contain all of the signature logic
  • get rid of the signPk function in useBCH.js
  • Consider getting rid of the confirmation modals

But this is effective as is and important to have given the signature discrepancies between electrum and cashtab.

This revision is now accepted and ready to land.Apr 1 2022, 17:13
This revision was automatically updated to reflect the committed changes.