This repository was archived by the owner on Feb 23, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ export const isLnUri = str => {
228228 * @return {boolean } If the uri is valid
229229 */
230230export const isAddress = str => {
231- return / ^ [ a - k m - z A - H J - N P - Z 0 - 9 ] { 26 , 35 } $ / . test ( str ) ;
231+ return / ^ [ a - k m - z A - H J - N P - Z 0 - 9 ] { 26 , 90 } $ / . test ( str ) ;
232232} ;
233233
234234/**
Original file line number Diff line number Diff line change @@ -721,12 +721,18 @@ describe('Helpers Unit Tests', () => {
721721 } ) ;
722722
723723 describe ( 'isAddress()' , ( ) => {
724- it ( 'should accept bitcoin uri ' , ( ) => {
724+ it ( 'should accept bitcoin address ' , ( ) => {
725725 const address = 'rfu4i1Mo2NF7TQsN9bMVLFSojSzcyQCEH5' ;
726726 expect ( helpers . isAddress ( address ) , 'to be' , true ) ;
727727 } ) ;
728728
729- it ( 'should reject invalid bitcoin uri' , ( ) => {
729+ it ( 'should accept bech32 address' , ( ) => {
730+ const address =
731+ 'bc1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qccfmv3' ;
732+ expect ( helpers . isAddress ( address ) , 'to be' , true ) ;
733+ } ) ;
734+
735+ it ( 'should reject invalid bitcoin address' , ( ) => {
730736 const address = '/INVALID/rfu4i1Mo2NF7TQsN9bMVLFSoj' ;
731737 expect ( helpers . isAddress ( address ) , 'to be' , false ) ;
732738 } ) ;
You can’t perform that action at this time.
0 commit comments