1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-19 21:30:10 +01:00

add litecoin address native segwit format

This commit is contained in:
linsui 2023-05-01 17:01:08 +08:00 committed by Hans-Christoph Steiner
parent 2135a9e7fb
commit 1a0a0a1839
2 changed files with 7 additions and 2 deletions

View File

@ -430,7 +430,7 @@ valuetypes = {
["Bitcoin"]), ["Bitcoin"]),
FieldValidator("Litecoin address", FieldValidator("Litecoin address",
r'^[LM3][a-km-zA-HJ-NP-Z1-9]{26,33}$', r'^([LM3][a-km-zA-HJ-NP-Z1-9]{26,33}|ltc1[a-km-z0-9]{39})$',
["Litecoin"]), ["Litecoin"]),
FieldValidator("Repo Type", FieldValidator("Repo Type",

View File

@ -128,7 +128,7 @@ class MetadataTest(unittest.TestCase):
fdroidserver.metadata.warnings_action = 'error' fdroidserver.metadata.warnings_action = 'error'
# some valid addresses (L, M, 3) # some valid addresses (L, M, 3, segwit)
self.assertIsNone( self.assertIsNone(
validator.check('LgeGrrrrJAxyXprrPrrBrrX5Qrrrrrrrrd', 'fake.app.id') validator.check('LgeGrrrrJAxyXprrPrrBrrX5Qrrrrrrrrd', 'fake.app.id')
) )
@ -136,6 +136,11 @@ class MetadataTest(unittest.TestCase):
validator.check('MrrrrrrrJAxyXpanPtrrRAX5QHxvUJo8id', 'fake.app.id') validator.check('MrrrrrrrJAxyXpanPtrrRAX5QHxvUJo8id', 'fake.app.id')
) )
self.assertIsNone(validator.check('3rereVr9rAryrranrrrrrAXrrHx', 'fake.app.id')) self.assertIsNone(validator.check('3rereVr9rAryrranrrrrrAXrrHx', 'fake.app.id'))
self.assertIsNone(
validator.check(
'ltc1q7euacwhn6ef99vcfa57mute92q572aqsc4c2j5', 'fake.app.id'
)
)
# some invalid addresses (various special use/testnet addresses, invalid chars) # some invalid addresses (various special use/testnet addresses, invalid chars)
self.assertRaises( self.assertRaises(