Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #64 from MXCzkEVM/tx_records
Browse files Browse the repository at this point in the history
fix: Added 8 decimal limitation & fixed logical bug
  • Loading branch information
reasje authored Sep 20, 2023
2 parents a1154db + 2c7ad84 commit ec3f3c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class TransactionsHistoryUseCase extends ReactiveUseCase {
if (index != -1) {
final chainTx = transactionsHistory.value[index];
final pendingTxList = chainTx.txList
.where((element) => element.status == TransactionStatus.failed);
.where((element) => element.status == TransactionStatus.pending);
for (TransactionModel pendingTx in pendingTxList) {
spyOnTransaction(pendingTx, chainId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,15 @@ class SendCryptoPage extends HookConsumerWidget {
return res;
}
try {
if (int.parse(v!).isNegative) {
final doubleValue = double.parse(v!);
String stringValue = doubleValue.toString();

int decimalPlaces = stringValue.split('.')[1].length;

if (doubleValue.isNegative || decimalPlaces > 8) {
return translate('invalid_format');
}

return null;
} catch (e) {
return translate('invalid_format');
Expand Down

0 comments on commit ec3f3c7

Please sign in to comment.