mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
CW 781 replace all print statements with printV (#1733)
* replace all print statements with printV * restore backup error message * missing print statements, error fixes * Update cw_core/lib/utils/print_verbose.dart [skip ci] * Update cw_core/lib/utils/print_verbose.dart [skip ci] * CW-846: Correctly display balance (#1848) * Correctly display balance even with frozen coins * remove package= from AndroidMainfest.xml * update namespace * print -> printV --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
parent
c74194abf4
commit
c78662fbfe
124 changed files with 578 additions and 343 deletions
|
@ -2,6 +2,7 @@ import 'dart:async';
|
|||
import 'dart:convert';
|
||||
|
||||
import 'package:cw_core/nano_account_info_response.dart';
|
||||
import 'package:cw_core/utils/print_verbose.dart';
|
||||
import 'package:cw_nano/nano_block_info_response.dart';
|
||||
import 'package:cw_core/n2_node.dart';
|
||||
import 'package:cw_nano/nano_balance.dart';
|
||||
|
@ -106,7 +107,7 @@ class NanoClient {
|
|||
final data = await jsonDecode(response.body);
|
||||
return AccountInfoResponse.fromJson(data as Map<String, dynamic>);
|
||||
} catch (e) {
|
||||
print("error while getting account info $e");
|
||||
printV("error while getting account info $e");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -127,7 +128,7 @@ class NanoClient {
|
|||
final data = await jsonDecode(response.body);
|
||||
return BlockContentsResponse.fromJson(data["contents"] as Map<String, dynamic>);
|
||||
} catch (e) {
|
||||
print("error while getting block info $e");
|
||||
printV("error while getting block info $e");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -508,7 +509,7 @@ class NanoClient {
|
|||
.map<NanoTransactionModel>((transaction) => NanoTransactionModel.fromJson(transaction))
|
||||
.toList();
|
||||
} catch (e) {
|
||||
print(e);
|
||||
printV(e);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import 'dart:convert';
|
||||
import 'dart:core';
|
||||
import 'package:cw_core/pathForWallet.dart';
|
||||
import 'package:cw_core/utils/print_verbose.dart';
|
||||
import 'package:cw_core/wallet_info.dart';
|
||||
import 'package:cw_core/encryption_file_utils.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
|
@ -37,7 +38,7 @@ abstract class NanoTransactionHistoryBase extends TransactionHistoryBase<NanoTra
|
|||
final data = json.encode({'transactions': transactions});
|
||||
await encryptionFileUtils.write(path: path, password: _password, data: data);
|
||||
} catch (e) {
|
||||
print('Error while save nano transaction history: ${e.toString()}');
|
||||
printV('Error while save nano transaction history: ${e.toString()}');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -72,7 +73,7 @@ abstract class NanoTransactionHistoryBase extends TransactionHistoryBase<NanoTra
|
|||
}
|
||||
});
|
||||
} catch (e) {
|
||||
print(e);
|
||||
printV(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ import 'package:cw_core/pending_transaction.dart';
|
|||
import 'package:cw_core/sync_status.dart';
|
||||
import 'package:cw_core/transaction_direction.dart';
|
||||
import 'package:cw_core/transaction_priority.dart';
|
||||
import 'package:cw_core/utils/print_verbose.dart';
|
||||
import 'package:cw_core/wallet_base.dart';
|
||||
import 'package:cw_core/wallet_info.dart';
|
||||
import 'package:cw_core/wallet_keys_file.dart';
|
||||
|
@ -170,12 +171,12 @@ abstract class NanoWalletBase
|
|||
await _updateRep();
|
||||
await _receiveAll();
|
||||
} catch (e) {
|
||||
print(e);
|
||||
printV(e);
|
||||
}
|
||||
|
||||
syncStatus = ConnectedSyncStatus();
|
||||
} catch (e) {
|
||||
print(e);
|
||||
printV(e);
|
||||
syncStatus = FailedSyncStatus();
|
||||
}
|
||||
}
|
||||
|
@ -367,7 +368,7 @@ abstract class NanoWalletBase
|
|||
|
||||
syncStatus = SyncedSyncStatus();
|
||||
} catch (e) {
|
||||
print(e);
|
||||
printV(e);
|
||||
syncStatus = FailedSyncStatus();
|
||||
rethrow;
|
||||
}
|
||||
|
@ -444,7 +445,7 @@ abstract class NanoWalletBase
|
|||
try {
|
||||
balance[currency] = await _client.getBalance(_publicAddress!);
|
||||
} catch (e) {
|
||||
print("Failed to get balance $e");
|
||||
printV("Failed to get balance $e");
|
||||
// if we don't have a balance, we should at least create one, since it's a late binding
|
||||
// otherwise, it's better to just leave it as whatever it was before:
|
||||
if (balance[currency] == null) {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import 'package:cw_core/cake_hive.dart';
|
||||
import 'package:cw_core/utils/print_verbose.dart';
|
||||
import 'package:cw_core/wallet_addresses.dart';
|
||||
import 'package:cw_core/wallet_info.dart';
|
||||
import 'package:cw_core/nano_account.dart';
|
||||
|
@ -47,7 +48,7 @@ abstract class NanoWalletAddressesBase extends WalletAddresses with Store {
|
|||
addressesMap[address] = '';
|
||||
await saveAddressesInBox();
|
||||
} catch (e) {
|
||||
print(e.toString());
|
||||
printV(e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue