mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-19 05:58:50 +02:00
CAKE-185 | removed isValidAmount() from exchange_view_model.dart and exchange_page.dart; throw exception in the createTrade() (xmrto_exchange_provider.dart) if number of fractional digits of amount more than 8
This commit is contained in:
@@ -311,20 +311,6 @@ abstract class ExchangeViewModelBase with Store {
|
||||
void removeTemplate({ExchangeTemplate template}) =>
|
||||
_exchangeTemplateStore.remove(template: template);
|
||||
|
||||
bool isValidAmount() {
|
||||
bool isValid = true;
|
||||
|
||||
if (provider is XMRTOExchangeProvider) {
|
||||
final amount = isReceiveAmountEntered
|
||||
? receiveAmount
|
||||
: depositAmount;
|
||||
final pattern = '^([0-9]+([.\,][0-9]{0,8})?|[.\,][0-9]{1,8})\$';
|
||||
isValid = RegExp(pattern).hasMatch(amount);
|
||||
}
|
||||
|
||||
return isValid;
|
||||
}
|
||||
|
||||
List<ExchangeProvider> providersForCurrentPair() {
|
||||
return _providersForPair(from: depositCurrency, to: receiveCurrency);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user