mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-17 01:37:40 +00:00
CAKE-298 | used 8 minor digits for btc amount validator; applied btc address formats for btc address validator
This commit is contained in:
parent
4a62e2db33
commit
928be1a49c
2 changed files with 4 additions and 4 deletions
|
@ -22,7 +22,8 @@ class AddressValidator extends TextValidator {
|
||||||
case CryptoCurrency.bnb:
|
case CryptoCurrency.bnb:
|
||||||
return '[0-9a-zA-Z]';
|
return '[0-9a-zA-Z]';
|
||||||
case CryptoCurrency.btc:
|
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:
|
case CryptoCurrency.dai:
|
||||||
return '[0-9a-zA-Z]';
|
return '[0-9a-zA-Z]';
|
||||||
case CryptoCurrency.dash:
|
case CryptoCurrency.dash:
|
||||||
|
@ -61,7 +62,7 @@ class AddressValidator extends TextValidator {
|
||||||
case CryptoCurrency.bnb:
|
case CryptoCurrency.bnb:
|
||||||
return [42];
|
return [42];
|
||||||
case CryptoCurrency.btc:
|
case CryptoCurrency.btc:
|
||||||
return [33, 34, 42, 62];
|
return null;
|
||||||
case CryptoCurrency.dai:
|
case CryptoCurrency.dai:
|
||||||
return [42];
|
return [42];
|
||||||
case CryptoCurrency.dash:
|
case CryptoCurrency.dash:
|
||||||
|
|
|
@ -16,8 +16,7 @@ class AmountValidator extends TextValidator {
|
||||||
case WalletType.monero:
|
case WalletType.monero:
|
||||||
return '^([0-9]+([.\,][0-9]{0,12})?|[.\,][0-9]{1,12})\$';
|
return '^([0-9]+([.\,][0-9]{0,12})?|[.\,][0-9]{1,12})\$';
|
||||||
case WalletType.bitcoin:
|
case WalletType.bitcoin:
|
||||||
// FIXME: Incorrect pattern for bitcoin
|
return '^([0-9]+([.\,][0-9]{0,8})?|[.\,][0-9]{1,8})\$';
|
||||||
return '^([0-9]+([.\,][0-9]{0,12})?|[.\,][0-9]{1,12})\$';
|
|
||||||
default:
|
default:
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue