mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 20:39: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
|
@ -4,6 +4,7 @@ import 'package:cake_wallet/core/secure_storage.dart';
|
|||
import 'package:cake_wallet/core/totp_request_details.dart';
|
||||
import 'package:cake_wallet/routes.dart';
|
||||
import 'package:cake_wallet/src/screens/auth/auth_page.dart';
|
||||
import 'package:cw_core/utils/print_verbose.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
@ -51,7 +52,7 @@ class AuthService with Store {
|
|||
try {
|
||||
password = await secureStorage.read(key: key) ?? '';
|
||||
} catch (e) {
|
||||
print(e);
|
||||
printV(e);
|
||||
}
|
||||
|
||||
return walletName.isNotEmpty && password.isNotEmpty;
|
||||
|
|
|
@ -7,6 +7,7 @@ import 'package:cake_wallet/entities/transaction_description.dart';
|
|||
import 'package:cake_wallet/themes/theme_list.dart';
|
||||
import 'package:cw_core/root_dir.dart';
|
||||
import 'package:cake_wallet/utils/device_info.dart';
|
||||
import 'package:cw_core/utils/print_verbose.dart';
|
||||
import 'package:cw_core/wallet_type.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
|
@ -110,11 +111,11 @@ class BackupService {
|
|||
for (var ignore in ignoreFiles) {
|
||||
final filename = entity.absolute.path;
|
||||
if (filename.endsWith(ignore) && !filename.contains("wallets/")) {
|
||||
print("ignoring backup file: $filename");
|
||||
printV("ignoring backup file: $filename");
|
||||
return;
|
||||
}
|
||||
}
|
||||
print("restoring: $filename");
|
||||
printV("restoring: $filename");
|
||||
if (entity.statSync().type == FileSystemEntityType.directory) {
|
||||
zipEncoder.addDirectory(Directory(entity.path));
|
||||
} else {
|
||||
|
@ -175,11 +176,11 @@ class BackupService {
|
|||
final filename = file.name;
|
||||
for (var ignore in ignoreFiles) {
|
||||
if (filename.endsWith(ignore) && !filename.contains("wallets/")) {
|
||||
print("ignoring backup file: $filename");
|
||||
printV("ignoring backup file: $filename");
|
||||
continue outer;
|
||||
}
|
||||
}
|
||||
print("restoring: $filename");
|
||||
printV("restoring: $filename");
|
||||
if (file.isFile) {
|
||||
final content = file.content as List<int>;
|
||||
File('${appDir.path}/' + filename)
|
||||
|
@ -193,7 +194,7 @@ class BackupService {
|
|||
await _verifyWallets();
|
||||
await _importKeychainDumpV2(password);
|
||||
await _importPreferencesDump();
|
||||
await _importTransactionDescriptionDump();
|
||||
await _importTransactionDescriptionDump(); // HiveError: Box has already been closed
|
||||
}
|
||||
|
||||
Future<void> _verifyWallets() async {
|
||||
|
|
|
@ -8,6 +8,7 @@ import 'package:cake_wallet/src/screens/wallet_connect/widgets/message_display_w
|
|||
import 'package:cake_wallet/core/wallet_connect/models/connection_model.dart';
|
||||
import 'package:cake_wallet/src/screens/wallet_connect/widgets/connection_widget.dart';
|
||||
import 'package:cake_wallet/src/screens/wallet_connect/widgets/modals/web3_request_modal.dart';
|
||||
import 'package:cw_core/utils/print_verbose.dart';
|
||||
import 'package:solana/base58.dart';
|
||||
import 'package:solana/solana.dart';
|
||||
import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart';
|
||||
|
@ -127,7 +128,7 @@ class SolanaChainServiceImpl implements ChainService {
|
|||
commitment: Commitment.confirmed,
|
||||
);
|
||||
|
||||
print(signature);
|
||||
printV(signature);
|
||||
|
||||
bottomSheetService.queueBottomSheet(
|
||||
isModalDismissible: true,
|
||||
|
@ -165,7 +166,7 @@ class SolanaChainServiceImpl implements ChainService {
|
|||
try {
|
||||
sign = await ownerKeyPair?.sign(base58decode(solanaSignMessage.message));
|
||||
} catch (e) {
|
||||
print(e);
|
||||
printV(e);
|
||||
}
|
||||
|
||||
if (sign == null) {
|
||||
|
|
|
@ -17,6 +17,7 @@ import 'package:cake_wallet/src/screens/wallet_connect/widgets/connection_reques
|
|||
import 'package:cake_wallet/src/screens/wallet_connect/widgets/message_display_widget.dart';
|
||||
import 'package:cake_wallet/src/screens/wallet_connect/widgets/modals/web3_request_modal.dart';
|
||||
import 'package:cake_wallet/store/app_store.dart';
|
||||
import 'package:cw_core/utils/print_verbose.dart';
|
||||
import 'package:cw_core/wallet_type.dart';
|
||||
import 'package:eth_sig_util/eth_sig_util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
@ -260,7 +261,7 @@ abstract class Web3WalletServiceBase with Store {
|
|||
|
||||
@action
|
||||
void _refreshPairings() {
|
||||
print('Refreshing pairings');
|
||||
printV('Refreshing pairings');
|
||||
pairings.clear();
|
||||
|
||||
final allPairings = _web3Wallet.pairings.getAll();
|
||||
|
@ -397,10 +398,10 @@ abstract class Web3WalletServiceBase with Store {
|
|||
// Get all pairing topics attached to this key
|
||||
final pairingTopicsForWallet = getPairingTopicsForWallet(key);
|
||||
|
||||
print(pairingTopicsForWallet);
|
||||
printV(pairingTopicsForWallet);
|
||||
|
||||
bool isPairingTopicAlreadySaved = pairingTopicsForWallet.contains(pairingTopic);
|
||||
print('Is Pairing Topic Saved: $isPairingTopicAlreadySaved');
|
||||
printV('Is Pairing Topic Saved: $isPairingTopicAlreadySaved');
|
||||
|
||||
if (!isPairingTopicAlreadySaved) {
|
||||
// Update the list with the most recent pairing topic
|
||||
|
|
|
@ -12,6 +12,7 @@ import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
|
|||
import 'package:cake_wallet/utils/exception_handler.dart';
|
||||
import 'package:cake_wallet/utils/show_pop_up.dart';
|
||||
import 'package:cw_core/cake_hive.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_service.dart';
|
||||
|
@ -97,7 +98,7 @@ class WalletLoadingService {
|
|||
// if found a wallet that is not corrupted, then still display the seeds of the corrupted ones
|
||||
authenticatedErrorStreamController.add(corruptedWalletsSeeds);
|
||||
} catch (e) {
|
||||
print(e);
|
||||
printV(e);
|
||||
// save seeds and show corrupted wallets' seeds to the user
|
||||
try {
|
||||
final seeds = await _getCorruptedWalletSeeds(walletInfo.name, walletInfo.type);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue