HomePhabricator

[Cashtab] Better validation for token document url

Description

[Cashtab] Better validation for token document url

Summary:
T3528

Improve validation for token document url

  • We do not need to build the regex every time this function is run, define this as a const outside the function
  • Return distinct error msgs depending on the validation problem
  • We also update the newTokenDefaultUrl, since always utf8-encoding bytes for https:// is not necessary and this passes the validation

Test Plan: npm test

Reviewers: #bitcoin_abc, emack

Reviewed By: #bitcoin_abc, emack

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

Details

Provenance
bytesofmanAuthored on Wed, Apr 17, 16:53
bytesofmanPushed on Thu, Apr 18, 03:04
Reviewer
Restricted Project
Differential Revision
D16005: [Cashtab] Better validation for token document url
Parents
rABCc517e2ea321d: [Cashtab] Add unimplemented functions to support NFT minting and sending
Branches
Unknown
Tags
Unknown