From 96688636553421b6427a77ea782baeb1df2547ed Mon Sep 17 00:00:00 2001 From: Rafael Saes <76502841+saltrafael@users.noreply.github.com> Date: Wed, 24 May 2023 10:48:06 -0300 Subject: [PATCH] CW-320-validate-address-case (#934) * feat: allow all-lowercase OR all-uppercase ltc1 addresses (btc1 already working) * fix: ltc length --- lib/core/address_validator.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/core/address_validator.dart b/lib/core/address_validator.dart index 57318254a..064efa11b 100644 --- a/lib/core/address_validator.dart +++ b/lib/core/address_validator.dart @@ -61,10 +61,11 @@ class AddressValidator extends TextValidator { case CryptoCurrency.dai: case CryptoCurrency.dash: case CryptoCurrency.eos: - case CryptoCurrency.ltc: case CryptoCurrency.bch: case CryptoCurrency.bnb: return '[0-9a-zA-Z]'; + case CryptoCurrency.ltc: + return '^(?!(ltc|LTC)1)[0-9a-zA-Z]*\$|(^LTC1[A-Z0-9]*\$)|(^ltc1[a-z0-9]*\$)'; case CryptoCurrency.hbar: return '[0-9a-zA-Z.]'; case CryptoCurrency.zaddr: @@ -119,7 +120,7 @@ class AddressValidator extends TextValidator { case CryptoCurrency.eth: return [42]; case CryptoCurrency.ltc: - return [34, 43]; + return [34, 43, 63]; case CryptoCurrency.nano: return [64, 65]; case CryptoCurrency.sc: