CAKE-298 | used 8 minor digits for btc amount validator; applied btc address formats for btc address validator

This commit is contained in:
OleksandrSobol 2021-03-26 14:45:46 +02:00
parent 4a62e2db33
commit 928be1a49c
2 changed files with 4 additions and 4 deletions

View file

@ -22,7 +22,8 @@ class AddressValidator extends TextValidator {
case CryptoCurrency.bnb:
return '[0-9a-zA-Z]';
case CryptoCurrency.btc:
return '[0-9a-zA-Z]';
return '^1[0-9a-zA-Z]{32}\$|^1[0-9a-zA-Z]{33}\$|^3[0-9a-zA-Z]{32}\$'
'|^3[0-9a-zA-Z]{33}\$|^bc1[0-9a-zA-Z]{39}\$|^bc1[0-9a-zA-Z]{59}\$';
case CryptoCurrency.dai:
return '[0-9a-zA-Z]';
case CryptoCurrency.dash:
@ -61,7 +62,7 @@ class AddressValidator extends TextValidator {
case CryptoCurrency.bnb:
return [42];
case CryptoCurrency.btc:
return [33, 34, 42, 62];
return null;
case CryptoCurrency.dai:
return [42];
case CryptoCurrency.dash:

View file

@ -16,8 +16,7 @@ class AmountValidator extends TextValidator {
case WalletType.monero:
return '^([0-9]+([.\,][0-9]{0,12})?|[.\,][0-9]{1,12})\$';
case WalletType.bitcoin:
// FIXME: Incorrect pattern for bitcoin
return '^([0-9]+([.\,][0-9]{0,12})?|[.\,][0-9]{1,12})\$';
return '^([0-9]+([.\,][0-9]{0,8})?|[.\,][0-9]{1,8})\$';
default:
return '';
}