diff --git a/browser/brave_wallet/android/android_page_appearing_browsertest.cc b/browser/brave_wallet/android/android_page_appearing_browsertest.cc index 4b12a9eb0a1..3dfd5a2ebfd 100644 --- a/browser/brave_wallet/android/android_page_appearing_browsertest.cc +++ b/browser/brave_wallet/android/android_page_appearing_browsertest.cc @@ -9,7 +9,6 @@ #include "base/check.h" #include "base/files/scoped_temp_dir.h" -#include "base/logging.h" #include "base/memory/scoped_refptr.h" #include "base/strings/pattern.h" #include "base/strings/strcat.h" diff --git a/browser/brave_wallet/external_wallets_importer.cc b/browser/brave_wallet/external_wallets_importer.cc index acbc8be2206..31d95c7d956 100644 --- a/browser/brave_wallet/external_wallets_importer.cc +++ b/browser/brave_wallet/external_wallets_importer.cc @@ -14,7 +14,6 @@ #include "base/check.h" #include "base/functional/bind.h" #include "base/json/json_reader.h" -#include "base/logging.h" #include "base/notreached.h" #include "base/strings/string_view_util.h" #include "base/strings/utf_string_conversion_utils.h" @@ -59,7 +58,6 @@ std::string GetLegacyCryptoWalletsPassword(const std::string& password, const auto* argon_params = dict.FindDictByDottedPath("data.KeyringController.argonParams"); if (!argon_params) { - VLOG(0) << "data.KeyringController.argonParams is not dict"; return std::string(); } auto hash_len = argon_params->FindInt("hashLen"); @@ -67,19 +65,16 @@ std::string GetLegacyCryptoWalletsPassword(const std::string& password, auto time = argon_params->FindInt("time"); auto type = argon_params->FindInt("type"); if (!hash_len || !mem || !time) { - VLOG(0) << "missing hashLen, mem, time or type in argonParams"; return std::string(); } if (type != 2) { - VLOG(0) << "Type should be Argon2_id"; return std::string(); } const std::string* salt_str = dict.FindStringByDottedPath("data.KeyringController.salt"); if (!salt_str) { - VLOG(0) << "missing data.KeyringController.salt"; return std::string(); } @@ -104,7 +99,6 @@ std::string GetLegacyCryptoWalletsPassword(const std::string& password, if (argon2id_hash_raw(*time, *mem, 1, password.data(), password.size(), salt_str->data(), character_count, master_key.data(), *hash_len) != ARGON2_OK) { - VLOG(1) << "argon2id_hash_raw failed"; return std::string(); } const std::string info = "metamask-encryptor"; @@ -112,7 +106,6 @@ std::string GetLegacyCryptoWalletsPassword(const std::string& password, if (!HKDF(sub_key.data(), sub_key.size(), EVP_sha512(), master_key.data(), master_key.size(), nullptr, 0, (uint8_t*)info.data(), info.size())) { - VLOG(1) << "HKDF failed"; return std::string(); } @@ -148,7 +141,6 @@ void ExternalWalletsImporter::Initialize(InitCallback callback) { if (type_ == mojom::ExternalWalletType::MetaMask) { extension = GetMetaMask(); if (!extension) { - VLOG(1) << "Failed to load MetaMask extension"; std::move(callback).Run(false); return; } @@ -194,7 +186,6 @@ void ExternalWalletsImporter::GetImportInfo( } if (password.empty()) { - VLOG(1) << "password is empty"; std::move(callback).Run(base::unexpected(ImportError::kPasswordError)); return; } @@ -231,7 +222,6 @@ void ExternalWalletsImporter::GetLocalStorage( StorageFrontend* frontend = StorageFrontend::Get(context_); if (!frontend) { - VLOG(1) << "Failed to read chrome.storage.local"; std::move(callback).Run(false); return; } @@ -263,7 +253,6 @@ void ExternalWalletsImporter::GetMnemonic(bool is_legacy_crypto_wallets, DCHECK(IsInitialized()); if (password.empty()) { - VLOG(0) << "Failed to get password of legacy Crypto Wallets"; std::move(callback).Run(base::unexpected(ImportError::kInternalError)); return; } @@ -271,7 +260,6 @@ void ExternalWalletsImporter::GetMnemonic(bool is_legacy_crypto_wallets, const std::string* vault_str = storage_data_->FindStringByDottedPath("data.KeyringController.vault"); if (!vault_str) { - VLOG(0) << "cannot find data.KeyringController.vault"; std::move(callback).Run(base::unexpected(ImportError::kJsonError)); return; } @@ -279,7 +267,6 @@ void ExternalWalletsImporter::GetMnemonic(bool is_legacy_crypto_wallets, *vault_str, base::JSON_PARSE_CHROMIUM_EXTENSIONS | base::JSON_ALLOW_TRAILING_COMMAS); if (!vault) { - VLOG(1) << "not a valid JSON: " << *vault_str; std::move(callback).Run(base::unexpected(ImportError::kJsonError)); return; } @@ -287,26 +274,22 @@ void ExternalWalletsImporter::GetMnemonic(bool is_legacy_crypto_wallets, auto* iv_str = vault->FindString("iv"); auto* salt_str = vault->FindString("salt"); if (!data_str || !iv_str || !salt_str) { - VLOG(1) << "data or iv or salt is missing"; std::move(callback).Run(base::unexpected(ImportError::kJsonError)); return; } auto salt_decoded = base::Base64Decode(*salt_str); if (!salt_decoded) { - VLOG(1) << "base64 decode failed: " << *salt_str; std::move(callback).Run(base::unexpected(ImportError::kJsonError)); return; } auto iv_decoded = base::Base64Decode(*iv_str); if (!iv_decoded) { - VLOG(1) << "base64 decode failed: " << *iv_str; std::move(callback).Run(base::unexpected(ImportError::kJsonError)); return; } auto data_decoded = base::Base64Decode(*data_str); if (!data_decoded) { - VLOG(1) << "base64 decode failed: " << *data_str; std::move(callback).Run(base::unexpected(ImportError::kJsonError)); return; } @@ -330,7 +313,6 @@ void ExternalWalletsImporter::GetMnemonic(bool is_legacy_crypto_wallets, } if (!decrypted_keyrings) { - VLOG(0) << "Importer decryption failed"; std::move(callback).Run(base::unexpected(ImportError::kPasswordError)); return; } @@ -341,7 +323,6 @@ void ExternalWalletsImporter::GetMnemonic(bool is_legacy_crypto_wallets, decrypted_keyrings_str, base::JSON_PARSE_CHROMIUM_EXTENSIONS | base::JSON_ALLOW_TRAILING_COMMAS); if (!keyrings) { - VLOG(1) << "not a valid JSON: " << decrypted_keyrings_str; std::move(callback).Run(base::unexpected(ImportError::kJsonError)); return; } @@ -353,7 +334,6 @@ void ExternalWalletsImporter::GetMnemonic(bool is_legacy_crypto_wallets, const auto& keyring = *keyring_listed.GetIfDict(); const auto* type = keyring.FindString("type"); if (!type) { - VLOG(0) << "keyring.type is missing"; std::move(callback).Run(base::unexpected(ImportError::kJsonError)); return; } @@ -375,8 +355,6 @@ void ExternalWalletsImporter::GetMnemonic(bool is_legacy_crypto_wallets, } } if (utf8_encoded_mnemonic.empty()) { - VLOG(0) << "keyring.data.mnemonic is missing"; - std::move(callback).Run(base::unexpected(ImportError::kJsonError)); return; } @@ -390,7 +368,6 @@ void ExternalWalletsImporter::GetMnemonic(bool is_legacy_crypto_wallets, } if (!mnemonic) { - VLOG(0) << "Failed to find mnemonic in decrypted keyrings"; std::move(callback).Run(base::unexpected(ImportError::kJsonError)); return; } diff --git a/browser/brave_wallet/notifications/wallet_notification_service.cc b/browser/brave_wallet/notifications/wallet_notification_service.cc index 7b29aeae681..a60126bb65c 100644 --- a/browser/brave_wallet/notifications/wallet_notification_service.cc +++ b/browser/brave_wallet/notifications/wallet_notification_service.cc @@ -8,7 +8,6 @@ #include #include -#include "base/logging.h" #include "base/strings/utf_string_conversions.h" #include "brave/components/brave_wallet/browser/brave_wallet_service.h" #include "brave/components/brave_wallet/browser/tx_service.h" @@ -34,7 +33,6 @@ int GetStatusTitle(brave_wallet::mojom::TransactionStatus status) { default: break; } - VLOG(1) << "No title for " << int(status) << " transaction status"; return -1; } diff --git a/components/brave_wallet/browser/asset_ratio_response_parser.cc b/components/brave_wallet/browser/asset_ratio_response_parser.cc index 47764b094e2..d8fa690f422 100644 --- a/components/brave_wallet/browser/asset_ratio_response_parser.cc +++ b/components/brave_wallet/browser/asset_ratio_response_parser.cc @@ -6,7 +6,6 @@ #include "brave/components/brave_wallet/browser/asset_ratio_response_parser.h" #include "base/check.h" -#include "base/logging.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" @@ -71,7 +70,6 @@ mojom::AssetPriceSource GetAssetPriceSource(const std::string& source) { std::vector ParseAssetPrices( const base::Value& json_value) { if (!json_value.is_list()) { - LOG(ERROR) << "Invalid response, expected array"; return {}; } @@ -81,8 +79,6 @@ std::vector ParseAssetPrices( for (const auto& item : response_list) { auto payload = api::asset_ratio::AssetPricePayload::FromValue(item); if (!payload) { - LOG(ERROR) << "Invalid response, could not parse AssetPricePayload:" - << item.DebugString(); continue; } @@ -135,7 +131,6 @@ bool ParseAssetPriceHistory(const base::Value& json_value, // } if (!json_value.is_dict()) { - LOG(ERROR) << "Invalid response, could not parse JSON, JSON is not a dict"; return false; } diff --git a/components/brave_wallet/browser/asset_ratio_service.cc b/components/brave_wallet/browser/asset_ratio_service.cc index 8ea2133f43e..fb5687023e3 100644 --- a/components/brave_wallet/browser/asset_ratio_service.cc +++ b/components/brave_wallet/browser/asset_ratio_service.cc @@ -116,7 +116,6 @@ std::string CreatePricingRequestPayload( if (auto coin_str = GetStringFromCoinType(request->coin)) { response_item.Set("coin", *coin_str); } else { - LOG(ERROR) << "Invalid coin type: " << request->coin; continue; } diff --git a/components/brave_wallet/browser/bitcoin/bitcoin_tx_manager.cc b/components/brave_wallet/browser/bitcoin/bitcoin_tx_manager.cc index d1c39e17fbf..8578002e4c1 100644 --- a/components/brave_wallet/browser/bitcoin/bitcoin_tx_manager.cc +++ b/components/brave_wallet/browser/bitcoin/bitcoin_tx_manager.cc @@ -13,7 +13,6 @@ #include "base/check.h" #include "base/functional/bind.h" -#include "base/logging.h" #include "base/notimplemented.h" #include "base/notreached.h" #include "brave/components/brave_wallet/browser/bitcoin/bitcoin_block_tracker.h" @@ -172,7 +171,6 @@ void BitcoinTxManager::ApproveTransaction(const std::string& tx_meta_id, std::unique_ptr meta = GetBitcoinTxStateManager().GetBitcoinTx(tx_meta_id); if (!meta) { - LOG(ERROR) << "Transaction should be found"; std::move(callback).Run( false, mojom::ProviderErrorUnion::NewBitcoinProviderError( @@ -206,7 +204,6 @@ void BitcoinTxManager::ContinueApproveTransaction( std::unique_ptr meta = GetBitcoinTxStateManager().GetBitcoinTx(tx_meta_id); if (!meta) { - LOG(ERROR) << "Transaction should be found"; std::move(callback).Run( false, mojom::ProviderErrorUnion::NewBitcoinProviderError( diff --git a/components/brave_wallet/browser/blockchain_list_parser.cc b/components/brave_wallet/browser/blockchain_list_parser.cc index 922ed9c45be..9816b5354cf 100644 --- a/components/brave_wallet/browser/blockchain_list_parser.cc +++ b/components/brave_wallet/browser/blockchain_list_parser.cc @@ -12,7 +12,6 @@ #include "base/check.h" #include "base/json/json_reader.h" -#include "base/logging.h" #include "base/strings/strcat.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" @@ -79,13 +78,9 @@ std::optional ParseNullableStringAsUint32(const base::Value& value) { } std::optional ParseJsonToDict(const std::string& json) { - std::optional records_v = base::JSONReader::ReadDict( + return base::JSONReader::ReadDict( json, base::JSON_PARSE_CHROMIUM_EXTENSIONS | base::JSONParserOptions::JSON_PARSE_RFC); - if (!records_v) { - VLOG(1) << "Invalid response, could not parse JSON, JSON is: " << json; - } - return records_v; } std::string EmptyIfNull(const std::string* str) { @@ -249,7 +244,6 @@ bool ParseTokenList(const std::string& json, TokenListMap* token_list_map) { json, base::JSON_PARSE_CHROMIUM_EXTENSIONS | base::JSONParserOptions::JSON_PARSE_RFC); if (!records_v) { - VLOG(1) << "Invalid response, could not parse JSON, JSON is: " << json; return false; } @@ -499,10 +493,6 @@ bool ParseChainList(const std::string& json, ChainList* result) { json, base::JSON_PARSE_CHROMIUM_EXTENSIONS | base::JSONParserOptions::JSON_PARSE_RFC); if (!records_v.has_value()) { - LOG(ERROR) << "Invalid response, could not parse JSON. " - << records_v.error().message - << ", line: " << records_v.error().line - << ", col: " << records_v.error().column; return false; } diff --git a/components/brave_wallet/browser/blockchain_registry.cc b/components/brave_wallet/browser/blockchain_registry.cc index caa05e91d2a..48e3c6b72d4 100644 --- a/components/brave_wallet/browser/blockchain_registry.cc +++ b/components/brave_wallet/browser/blockchain_registry.cc @@ -13,7 +13,6 @@ #include "base/containers/map_util.h" #include "base/files/file_path.h" #include "base/files/file_util.h" -#include "base/logging.h" #include "base/no_destructor.h" #include "base/strings/string_util.h" #include "brave/components/brave_wallet/browser/network_manager.h" @@ -43,18 +42,15 @@ void HandleRampTokenLists(const std::optional& result, } auto parsedRampTokensListMaps = ParseRampTokenListMaps(*result); if (!parsedRampTokensListMaps) { - VLOG(1) << "Can't parse on/off ramp token lists."; return; } if (parsedRampTokensListMaps->first.empty()) { - VLOG(1) << "On ramp supported token lists is empty."; } else { out.on_ramp_token_lists = std::move(parsedRampTokensListMaps->first); } if (parsedRampTokensListMaps->second.empty()) { - VLOG(1) << "Off ramp supported sell token lists is empty."; } else { out.off_ramp_token_lists = std::move(parsedRampTokensListMaps->second); } @@ -69,7 +65,6 @@ void HandleOnRampCurrenciesLists(const std::optional& result, std::optional> lists = ParseOnRampCurrencyLists(*result); if (!lists) { - VLOG(1) << "Can't parse on ramp supported sell token lists."; return; } @@ -80,13 +75,7 @@ base::FilePath ResolveAbsolutePath(const base::FilePath& input_path) { // On some platforms (e.g. Mac) we use symlinks for paths. Convert paths to // absolute paths to avoid unexpected failure. base::MakeAbsoluteFilePath() // requires IO so it needs to be posted. - const base::FilePath output_path = base::MakeAbsoluteFilePath(input_path); - - if (output_path.empty()) { - LOG(ERROR) << "Failed to get absolute install path."; - } - - return output_path; + return base::MakeAbsoluteFilePath(input_path); } std::optional ParseJsonFile(base::FilePath path, @@ -98,7 +87,6 @@ std::optional ParseJsonFile(base::FilePath path, std::string json_content; const base::FilePath json_path = path.AppendASCII(filename); if (!base::ReadFileToString(json_path, &json_content)) { - LOG(ERROR) << "Can't read file: " << filename; return std::nullopt; } @@ -114,7 +102,6 @@ void DoParseCoingeckoIdsMap(const base::FilePath& dir, ParseListsResult& out) { std::optional coingecko_ids_map = ParseCoingeckoIdsMap(*result); if (!coingecko_ids_map) { - VLOG(1) << "Can't parse coingecko-ids.json"; return; } @@ -129,7 +116,6 @@ void DoParseTokenList(const base::FilePath& dir, ParseListsResult& out) { TokenListMap lists; if (!ParseTokenList(*result, &lists)) { - VLOG(1) << "Can't parse token list."; return; } @@ -146,7 +132,6 @@ void DoParseChainList(const base::FilePath& dir, ParseListsResult& out) { ChainList chains; if (!ParseChainList(*result, &chains)) { - VLOG(1) << "Can't parse chain list."; return; } @@ -166,7 +151,6 @@ void DoParseDappLists(const base::FilePath& dir, ParseListsResult& out) { std::optional lists = ParseDappLists(converted_json); if (!lists) { - VLOG(1) << "Can't parse dapp lists."; return; } @@ -192,7 +176,6 @@ void DoParseRestrictedAddressesLists(const base::FilePath& dir, std::optional> list = ParseRestrictedAddressesList(*result); if (!list) { - VLOG(1) << "Can't parse restricted addresses list."; return; } diff --git a/components/brave_wallet/browser/brave_wallet_p3a.cc b/components/brave_wallet/browser/brave_wallet_p3a.cc index b835b0566d5..3a7ece6ae73 100644 --- a/components/brave_wallet/browser/brave_wallet_p3a.cc +++ b/components/brave_wallet/browser/brave_wallet_p3a.cc @@ -13,7 +13,6 @@ #include "base/check.h" #include "base/check_op.h" #include "base/command_line.h" -#include "base/logging.h" #include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_macros.h" #include "base/notreached.h" @@ -103,7 +102,6 @@ void BraveWalletP3A::Bind( } void BraveWalletP3A::ReportUsage(bool unlocked) { - VLOG(1) << "Wallet P3A: starting report"; base::Time wallet_last_used = local_state_->GetTime(kBraveWalletLastUnlockTime); @@ -371,7 +369,6 @@ void BraveWalletP3A::OnUpdateTimerFired() { } void BraveWalletP3A::WriteUsageStatsToHistogram() { - VLOG(1) << "Wallet P3A: Recording usage"; UMA_HISTOGRAM_BOOLEAN(kBraveWalletMonthlyHistogramName, true); UMA_HISTOGRAM_BOOLEAN(kBraveWalletWeeklyHistogramName, true); UMA_HISTOGRAM_BOOLEAN(kBraveWalletDailyHistogramName, true); diff --git a/components/brave_wallet/browser/brave_wallet_service.cc b/components/brave_wallet/browser/brave_wallet_service.cc index 8d97173881c..400a45cd6a1 100644 --- a/components/brave_wallet/browser/brave_wallet_service.cc +++ b/components/brave_wallet/browser/brave_wallet_service.cc @@ -12,7 +12,6 @@ #include "base/check.h" #include "base/check_op.h" -#include "base/logging.h" #include "base/notreached.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" @@ -1266,8 +1265,6 @@ void BraveWalletService::GetPendingSignMessageErrors( void BraveWalletService::NotifySignMessageErrorProcessed( const std::string& id) { if (sign_message_errors_.empty() || sign_message_errors_.front()->id != id) { - VLOG(1) << "id: " << id << " is not expected, should be " - << sign_message_errors_.front()->id; return; } sign_message_errors_.pop_front(); @@ -1315,8 +1312,6 @@ void BraveWalletService::NotifySignSolTransactionsRequestProcessed( const std::optional& error) { if (sign_sol_transactions_requests_.empty() || sign_sol_transactions_requests_.front()->id != id) { - VLOG(1) << "id: " << id << " is not expected, should be " - << sign_sol_transactions_requests_.front()->id; return; } auto callback = std::move(sign_sol_transactions_callbacks_.front()); diff --git a/components/brave_wallet/browser/eth_block_tracker.cc b/components/brave_wallet/browser/eth_block_tracker.cc index d1cafb5d2f5..764c93daf2d 100644 --- a/components/brave_wallet/browser/eth_block_tracker.cc +++ b/components/brave_wallet/browser/eth_block_tracker.cc @@ -10,7 +10,6 @@ #include "base/containers/map_util.h" #include "base/functional/bind.h" -#include "base/logging.h" #include "brave/components/brave_wallet/browser/json_rpc_service.h" namespace brave_wallet { @@ -84,9 +83,6 @@ void EthBlockTracker::OnGetBlockNumber(const std::string& chain_id, for (auto& observer : observers_) { observer.OnLatestBlock(chain_id, block_num); } - - } else { - LOG(ERROR) << "GetBlockNumber failed"; } } diff --git a/components/brave_wallet/browser/eth_logs_tracker.cc b/components/brave_wallet/browser/eth_logs_tracker.cc index 9a60f355ab6..91b06d86b8e 100644 --- a/components/brave_wallet/browser/eth_logs_tracker.cc +++ b/components/brave_wallet/browser/eth_logs_tracker.cc @@ -9,7 +9,6 @@ #include #include "base/check.h" -#include "base/logging.h" namespace brave_wallet { @@ -71,8 +70,6 @@ void EthLogsTracker::OnGetLogs(const std::string& subscription, for (auto& observer : observers_) { observer.OnLogsReceived(subscription, rawlogs.Clone()); } - } else { - LOG(ERROR) << "OnGetLogs failed"; } } diff --git a/components/brave_wallet/browser/eth_transaction.cc b/components/brave_wallet/browser/eth_transaction.cc index addaade1bf2..211f4ca00e1 100644 --- a/components/brave_wallet/browser/eth_transaction.cc +++ b/components/brave_wallet/browser/eth_transaction.cc @@ -11,7 +11,6 @@ #include "base/base64.h" #include "base/check.h" #include "base/containers/to_vector.h" -#include "base/logging.h" #include "base/values.h" #include "brave/components/brave_wallet/browser/rlp_encode.h" #include "brave/components/brave_wallet/common/eth_address.h" @@ -250,7 +249,6 @@ bool EthTransaction::ProcessVRS(const std::vector& v, } if (!HexValueToUint256(ToHex(v), &v_)) { - LOG(ERROR) << "Unable to decode v param"; return false; } diff --git a/components/brave_wallet/browser/eth_tx_manager_unittest.cc b/components/brave_wallet/browser/eth_tx_manager_unittest.cc index 33b64891924..42d2073c92e 100644 --- a/components/brave_wallet/browser/eth_tx_manager_unittest.cc +++ b/components/brave_wallet/browser/eth_tx_manager_unittest.cc @@ -15,7 +15,6 @@ #include "base/files/scoped_temp_dir.h" #include "base/functional/callback_helpers.h" -#include "base/logging.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" #include "base/task/sequenced_task_runner.h" diff --git a/components/brave_wallet/browser/eth_tx_meta.cc b/components/brave_wallet/browser/eth_tx_meta.cc index c61d4e91959..7e77630c589 100644 --- a/components/brave_wallet/browser/eth_tx_meta.cc +++ b/components/brave_wallet/browser/eth_tx_meta.cc @@ -10,7 +10,6 @@ #include #include "base/check_op.h" -#include "base/logging.h" #include "brave/components/brave_wallet/browser/brave_wallet_constants.h" #include "brave/components/brave_wallet/browser/brave_wallet_utils.h" #include "brave/components/brave_wallet/browser/eip1559_transaction.h" @@ -120,7 +119,6 @@ mojom::TransactionInfoPtr EthTxMeta::ToTransactionInfo() const { std::optional final_recipient; auto tx_info = GetTransactionInfoFromData(data); if (!tx_info) { - LOG(ERROR) << "Error parsing transaction data: " << ToHex(data); } else { mojom::SwapInfoPtr swap_info_from_data; std::tie(tx_type, tx_params, tx_args, swap_info_from_data) = diff --git a/components/brave_wallet/browser/eth_tx_state_manager.cc b/components/brave_wallet/browser/eth_tx_state_manager.cc index fb11b77c19b..d50e463c9f4 100644 --- a/components/brave_wallet/browser/eth_tx_state_manager.cc +++ b/components/brave_wallet/browser/eth_tx_state_manager.cc @@ -7,7 +7,6 @@ #include -#include "base/logging.h" #include "base/values.h" #include "brave/components/brave_wallet/browser/brave_wallet_utils.h" #include "brave/components/brave_wallet/browser/eip1559_transaction.h" @@ -110,7 +109,6 @@ std::unique_ptr EthTxStateManager::ValueToTxMeta( break; } default: - LOG(ERROR) << "tx type is not supported"; break; } diff --git a/components/brave_wallet/browser/fil_block_tracker.cc b/components/brave_wallet/browser/fil_block_tracker.cc index 65a46242d9a..b5742631bba 100644 --- a/components/brave_wallet/browser/fil_block_tracker.cc +++ b/components/brave_wallet/browser/fil_block_tracker.cc @@ -9,7 +9,6 @@ #include #include "base/functional/bind.h" -#include "base/logging.h" #include "brave/components/brave_wallet/browser/json_rpc_service.h" namespace brave_wallet { @@ -56,8 +55,6 @@ void FilBlockTracker::OnGetFilBlockHeight(const std::string& chain_id, } if (error != mojom::FilecoinProviderError::kSuccess) { - VLOG(1) << __FUNCTION__ << ": Failed to get latest height, error: " - << static_cast(error) << ", error_message: " << error_message; return; } if (GetLatestHeight(chain_id) == latest_height) { diff --git a/components/brave_wallet/browser/fil_tx_manager.cc b/components/brave_wallet/browser/fil_tx_manager.cc index 8b4c1de809f..40c024819de 100644 --- a/components/brave_wallet/browser/fil_tx_manager.cc +++ b/components/brave_wallet/browser/fil_tx_manager.cc @@ -12,8 +12,6 @@ #include #include "base/check.h" -#include "base/check_op.h" -#include "base/logging.h" #include "base/notimplemented.h" #include "brave/components/brave_wallet/browser/account_resolver_delegate.h" #include "brave/components/brave_wallet/browser/fil_block_tracker.h" @@ -147,7 +145,6 @@ void FilTxManager::ApproveTransaction(const std::string& tx_meta_id, ApproveTransactionCallback callback) { std::unique_ptr meta = GetFilTxStateManager().GetFilTx(tx_meta_id); if (!meta) { - LOG(ERROR) << "Transaction should be found"; std::move(callback).Run( false, mojom::ProviderErrorUnion::NewFilecoinProviderError( @@ -176,7 +173,6 @@ void FilTxManager::OnGetNextNonce(std::unique_ptr meta, if (!success) { meta->set_status(mojom::TransactionStatus::Error); tx_state_manager().AddOrUpdateTx(*meta); - LOG(ERROR) << "GetNextNonce failed"; std::move(callback).Run( false, mojom::ProviderErrorUnion::NewFilecoinProviderError( @@ -285,7 +281,6 @@ void FilTxManager::GetFilTransactionMessageToSign( GetFilTransactionMessageToSignCallback callback) { std::unique_ptr meta = GetFilTxStateManager().GetFilTx(tx_meta_id); if (!meta || !meta->tx()) { - VLOG(1) << __FUNCTION__ << "No transaction found with id:" << tx_meta_id; std::move(callback).Run(std::nullopt); return; } diff --git a/components/brave_wallet/browser/filecoin_keyring.cc b/components/brave_wallet/browser/filecoin_keyring.cc index db07797fe1e..7d7b4e19f8c 100644 --- a/components/brave_wallet/browser/filecoin_keyring.cc +++ b/components/brave_wallet/browser/filecoin_keyring.cc @@ -15,7 +15,6 @@ #include "base/containers/span_rust.h" #include "base/containers/to_vector.h" #include "base/json/json_reader.h" -#include "base/logging.h" #include "base/notreached.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" @@ -119,7 +118,6 @@ bool FilecoinKeyring::DecodeImportPayload( key_payload, base::JSON_PARSE_CHROMIUM_EXTENSIONS | base::JSONParserOptions::JSON_PARSE_RFC); if (!records_v) { - VLOG(1) << "Invalid payload, could not parse JSON"; return false; } diff --git a/components/brave_wallet/browser/internal/hd_key.cc b/components/brave_wallet/browser/internal/hd_key.cc index 00d70c0c8e8..152ab516190 100644 --- a/components/brave_wallet/browser/internal/hd_key.cc +++ b/components/brave_wallet/browser/internal/hd_key.cc @@ -16,7 +16,6 @@ #include "base/containers/span_reader.h" #include "base/containers/span_writer.h" #include "base/containers/to_vector.h" -#include "base/logging.h" #include "base/numerics/byte_conversions.h" #include "brave/components/brave_wallet/browser/internal/hd_key_common.h" #include "brave/components/brave_wallet/common/hash_utils.h" @@ -97,7 +96,6 @@ std::unique_ptr HDKey::GenerateFromExtendedKey( const std::string& key) { std::vector decoded_key(kSerializationLength); if (!DecodeBase58Check(key, decoded_key, decoded_key.size())) { - LOG(ERROR) << __func__ << ": DecodeBase58Check failed"; return nullptr; } @@ -170,7 +168,6 @@ void HDKey::SetPublicKey( secp256k1_pubkey pubkey; if (!secp256k1_ec_pubkey_parse(GetSecp256k1Ctx(), &pubkey, value.data(), value.size())) { - LOG(ERROR) << __func__ << ": not a valid public key"; return; } public_key_ = base::ToVector(value); @@ -187,13 +184,12 @@ std::vector HDKey::GetUncompressedPublicKey() const { secp256k1_pubkey pubkey; if (!secp256k1_ec_pubkey_parse(GetSecp256k1Ctx(), &pubkey, public_key_.data(), public_key_.size())) { - LOG(ERROR) << __func__ << ": secp256k1_ec_pubkey_parse failed"; return public_key; } if (!secp256k1_ec_pubkey_serialize(GetSecp256k1Ctx(), public_key.data(), &public_key_len, &pubkey, SECP256K1_EC_UNCOMPRESSED)) { - LOG(ERROR) << __func__ << ": secp256k1_ec_pubkey_serialize failed"; + return public_key; } return public_key; @@ -284,7 +280,6 @@ std::unique_ptr HDKey::DeriveChild(const DerivationIndex& index) { unsigned int out_len; if (!HMAC(EVP_sha512(), chain_code_.data(), chain_code_.size(), data.data(), data.size(), hmac.data(), &out_len)) { - LOG(ERROR) << __func__ << ": HMAC_SHA512 failed"; return nullptr; } DCHECK(out_len == kSHA512Length); @@ -301,7 +296,6 @@ std::unique_ptr HDKey::DeriveChild(const DerivationIndex& index) { SecureVector private_key = private_key_; if (!secp256k1_ec_seckey_tweak_add(GetSecp256k1Ctx(), private_key.data(), hmac_span.first<32>().data())) { - LOG(ERROR) << __func__ << ": secp256k1_ec_seckey_tweak_add failed"; return nullptr; } if (!hdkey->SetPrivateKey( @@ -315,13 +309,11 @@ std::unique_ptr HDKey::DeriveChild(const DerivationIndex& index) { secp256k1_pubkey pubkey; if (!secp256k1_ec_pubkey_parse(GetSecp256k1Ctx(), &pubkey, public_key_.data(), public_key_.size())) { - LOG(ERROR) << __func__ << ": secp256k1_ec_pubkey_parse failed"; return nullptr; } if (!secp256k1_ec_pubkey_tweak_add(GetSecp256k1Ctx(), &pubkey, hmac_span.first<32>().data())) { - LOG(ERROR) << __func__ << ": secp256k1_ec_pubkey_tweak_add failed"; return nullptr; } size_t public_key_len = kSecp256k1PubkeySize; @@ -329,7 +321,6 @@ std::unique_ptr HDKey::DeriveChild(const DerivationIndex& index) { if (!secp256k1_ec_pubkey_serialize(GetSecp256k1Ctx(), public_key.data(), &public_key_len, &pubkey, SECP256K1_EC_COMPRESSED)) { - LOG(ERROR) << __func__ << ": secp256k1_ec_pubkey_serialize failed"; return nullptr; } hdkey->SetPublicKey(public_key); @@ -402,7 +393,6 @@ std::optional> HDKey::SignDer(Secp256k1SignMsgSpan msg) { if (!secp256k1_ecdsa_sign( GetSecp256k1Ctx(), &ecdsa_sig, msg.data(), private_key_.data(), secp256k1_nonce_function_rfc6979, extra_entropy)) { - LOG(ERROR) << __func__ << ": secp256k1_ecdsa_sign failed"; return std::nullopt; } } @@ -425,19 +415,15 @@ bool HDKey::VerifyForTesting(Secp256k1SignMsgSpan msg, secp256k1_ecdsa_signature ecdsa_sig; if (!secp256k1_ecdsa_signature_parse_compact(GetSecp256k1Ctx(), &ecdsa_sig, sig.data())) { - LOG(ERROR) << __func__ - << ": secp256k1_ecdsa_signature_parse_compact failed"; return false; } secp256k1_pubkey pubkey; if (!secp256k1_ec_pubkey_parse(GetSecp256k1Ctx(), &pubkey, public_key_.data(), public_key_.size())) { - LOG(ERROR) << __func__ << ": secp256k1_ec_pubkey_parse failed"; return false; } if (!secp256k1_ecdsa_verify(GetSecp256k1Ctx(), &ecdsa_sig, msg.data(), &pubkey)) { - LOG(ERROR) << __func__ << ": secp256k1_ecdsa_verify failed"; return false; } return true; @@ -465,23 +451,18 @@ std::optional> HDKey::RecoverCompact( secp256k1_ecdsa_recoverable_signature ecdsa_sig; if (!secp256k1_ecdsa_recoverable_signature_parse_compact( GetSecp256k1Ctx(), &ecdsa_sig, sig.rs_bytes().data(), sig.recid())) { - LOG(ERROR) - << __func__ - << ": secp256k1_ecdsa_recoverable_signature_parse_compact failed"; return std::nullopt; } secp256k1_pubkey pubkey; if (!secp256k1_ecdsa_recover(GetSecp256k1Ctx(), &pubkey, &ecdsa_sig, msg.data())) { - LOG(ERROR) << __func__ << ": secp256k1_ecdsa_recover failed"; return std::nullopt; } if (!secp256k1_ec_pubkey_serialize( GetSecp256k1Ctx(), public_key.data(), &public_key_len, &pubkey, compressed ? SECP256K1_EC_COMPRESSED : SECP256K1_EC_UNCOMPRESSED)) { - LOG(ERROR) << "secp256k1_ec_pubkey_serialize failed"; return std::nullopt; } @@ -492,14 +473,13 @@ void HDKey::GeneratePublicKey() { secp256k1_pubkey public_key; if (!secp256k1_ec_pubkey_create(GetSecp256k1Ctx(), &public_key, private_key_.data())) { - LOG(ERROR) << "secp256k1_ec_pubkey_create failed"; return; } size_t public_key_len = 33; if (!secp256k1_ec_pubkey_serialize(GetSecp256k1Ctx(), public_key_.data(), &public_key_len, &public_key, SECP256K1_EC_COMPRESSED)) { - LOG(ERROR) << "secp256k1_ec_pubkey_serialize failed"; + return; } } diff --git a/components/brave_wallet/browser/meld_integration_response_parser.cc b/components/brave_wallet/browser/meld_integration_response_parser.cc index aeda3039798..3c082a42d1d 100644 --- a/components/brave_wallet/browser/meld_integration_response_parser.cc +++ b/components/brave_wallet/browser/meld_integration_response_parser.cc @@ -10,7 +10,6 @@ #include #include -#include "base/logging.h" #include "base/strings/string_number_conversions.h" #include "base/types/expected.h" #include "base/values.h" @@ -360,7 +359,6 @@ std::optional> ParseCountries( // } // ] if (!json_value.is_list()) { - LOG(ERROR) << "Invalid response, could not parse JSON, JSON is not a list"; return std::nullopt; } std::vector countries; @@ -368,7 +366,6 @@ std::optional> ParseCountries( const auto country_value = meld_integration_responses::Country::FromValue(country_item); if (!country_value) { - LOG(ERROR) << "Invalid response, could not parse JSON"; return std::nullopt; } diff --git a/components/brave_wallet/browser/solana_block_tracker.cc b/components/brave_wallet/browser/solana_block_tracker.cc index 441dccac89b..171b7c19c1c 100644 --- a/components/brave_wallet/browser/solana_block_tracker.cc +++ b/components/brave_wallet/browser/solana_block_tracker.cc @@ -10,7 +10,6 @@ #include "base/functional/bind.h" #include "base/functional/callback_helpers.h" -#include "base/logging.h" #include "brave/components/brave_wallet/browser/brave_wallet_constants.h" #include "brave/components/brave_wallet/browser/json_rpc_service.h" @@ -73,8 +72,6 @@ void SolanaBlockTracker::OnGetLatestBlockhash( } if (error != mojom::SolanaProviderError::kSuccess) { - VLOG(1) << __FUNCTION__ << ": Failed to get latest blockhash, error: " - << static_cast(error) << ", error_message: " << error_message; return; } diff --git a/components/brave_wallet/browser/solana_tx_manager.cc b/components/brave_wallet/browser/solana_tx_manager.cc index 30e055cbd4a..d4ef3994bbc 100644 --- a/components/brave_wallet/browser/solana_tx_manager.cc +++ b/components/brave_wallet/browser/solana_tx_manager.cc @@ -16,7 +16,6 @@ #include "base/base64.h" #include "base/check.h" #include "base/functional/callback_helpers.h" -#include "base/logging.h" #include "base/notimplemented.h" #include "brave/components/brave_wallet/browser/account_resolver_delegate.h" #include "brave/components/brave_wallet/browser/blockchain_registry.h" @@ -304,7 +303,6 @@ void SolanaTxManager::ApproveTransaction(const std::string& tx_meta_id, std::unique_ptr meta = GetSolanaTxStateManager().GetSolanaTx(tx_meta_id); if (!meta) { - LOG(ERROR) << "Transaction should be found"; std::move(callback).Run( false, mojom::ProviderErrorUnion::NewSolanaProviderError( @@ -432,7 +430,6 @@ void SolanaTxManager::OnSendSolanaTransaction( const std::string& error_message) { std::unique_ptr meta = tx_state_manager().GetTx(tx_meta_id); if (!meta) { - LOG(ERROR) << "Transaction should be found"; std::move(callback).Run( false, mojom::ProviderErrorUnion::NewSolanaProviderError( @@ -672,7 +669,6 @@ void SolanaTxManager::GetSolTransactionMessageToSign( std::unique_ptr meta = GetSolanaTxStateManager().GetSolanaTx(tx_meta_id); if (!meta || !meta->tx()) { - VLOG(1) << __FUNCTION__ << "No transaction found with id:" << tx_meta_id; std::move(callback).Run(std::nullopt); return; } diff --git a/components/brave_wallet/browser/swap_response_parser.cc b/components/brave_wallet/browser/swap_response_parser.cc index 1f6e294b57a..1912eb95f6e 100644 --- a/components/brave_wallet/browser/swap_response_parser.cc +++ b/components/brave_wallet/browser/swap_response_parser.cc @@ -1267,10 +1267,6 @@ mojom::Gate3SwapRoutePtr ParseRoute( swap_responses::Gate3SwapNetworkFee::FromValue(value.network_fee); if (network_fee_value) { result->network_fee = ParseNetworkFee(*network_fee_value); - } else { - // Log if parsing failed but network_fee was present - LOG(ERROR) << "Failed to parse Gate3SwapNetworkFee from value: " - << value.network_fee; } } diff --git a/components/brave_wallet/browser/tx_manager.cc b/components/brave_wallet/browser/tx_manager.cc index 46d92b99808..88b1c4e6fc4 100644 --- a/components/brave_wallet/browser/tx_manager.cc +++ b/components/brave_wallet/browser/tx_manager.cc @@ -11,7 +11,6 @@ #include #include "base/containers/to_vector.h" -#include "base/logging.h" #include "brave/components/brave_wallet/browser/block_tracker.h" #include "brave/components/brave_wallet/browser/brave_wallet_constants.h" #include "brave/components/brave_wallet/browser/keyring_service.h" @@ -60,7 +59,6 @@ void TxManager::RejectTransaction(const std::string& tx_meta_id, RejectTransactionCallback callback) { std::unique_ptr meta = tx_state_manager_->GetTx(tx_meta_id); if (!meta) { - LOG(ERROR) << "No transaction found"; std::move(callback).Run(false); return; } diff --git a/components/brave_wallet/browser/zcash/zcash_complete_transaction_task.cc b/components/brave_wallet/browser/zcash/zcash_complete_transaction_task.cc index 905ed12fe2b..a88f256c1f6 100644 --- a/components/brave_wallet/browser/zcash/zcash_complete_transaction_task.cc +++ b/components/brave_wallet/browser/zcash/zcash_complete_transaction_task.cc @@ -10,7 +10,6 @@ #include #include "base/check.h" -#include "base/logging.h" #include "base/strings/string_number_conversions.h" #include "base/task/thread_pool.h" #include "brave/components/brave_wallet/browser/keyring_service.h" @@ -29,10 +28,8 @@ namespace { std::unique_ptr ApplyOrchardSignatures( std::unique_ptr orchard_bundle_manager, std::array sighash) { - DVLOG(1) << "Apply signatures for ZCash transaction"; // Heavy CPU operation, should be executed on background thread auto result = orchard_bundle_manager->ApplySignature(sighash); - DVLOG(1) << "Signatures applied"; return result; } diff --git a/components/brave_wallet/browser/zcash/zcash_create_orchard_to_transparent_transaction_task.cc b/components/brave_wallet/browser/zcash/zcash_create_orchard_to_transparent_transaction_task.cc index d95175b022d..2d8f8d08c73 100644 --- a/components/brave_wallet/browser/zcash/zcash_create_orchard_to_transparent_transaction_task.cc +++ b/components/brave_wallet/browser/zcash/zcash_create_orchard_to_transparent_transaction_task.cc @@ -9,7 +9,6 @@ #include #include "base/check.h" -#include "base/logging.h" #include "base/numerics/checked_math.h" #include "brave/components/brave_wallet/browser/zcash/zcash_transaction_utils.h" #include "brave/components/brave_wallet/common/brave_wallet.mojom.h" diff --git a/components/brave_wallet/browser/zcash/zcash_tx_manager.cc b/components/brave_wallet/browser/zcash/zcash_tx_manager.cc index 729e667da08..6b9363d00cb 100644 --- a/components/brave_wallet/browser/zcash/zcash_tx_manager.cc +++ b/components/brave_wallet/browser/zcash/zcash_tx_manager.cc @@ -12,7 +12,6 @@ #include #include "base/functional/bind.h" -#include "base/logging.h" #include "base/notimplemented.h" #include "base/notreached.h" #include "brave/components/brave_wallet/browser/zcash/zcash_block_tracker.h" @@ -154,7 +153,6 @@ void ZCashTxManager::ApproveTransaction(const std::string& tx_meta_id, std::unique_ptr meta = GetZCashTxStateManager().GetZCashTx(tx_meta_id); if (!meta) { - LOG(ERROR) << "Transaction should be found"; std::move(callback).Run( false, mojom::ProviderErrorUnion::NewZcashProviderError( @@ -207,7 +205,6 @@ void ZCashTxManager::ContinueApproveTransaction( std::unique_ptr meta = GetZCashTxStateManager().GetZCashTx(tx_meta_id); if (!meta) { - LOG(ERROR) << "Transaction should be found"; std::move(callback).Run( false, mojom::ProviderErrorUnion::NewZcashProviderError( diff --git a/components/brave_wallet/common/eth_sign_typed_data_helper.cc b/components/brave_wallet/common/eth_sign_typed_data_helper.cc index f0395013e4b..d30e1c1c3ff 100644 --- a/components/brave_wallet/common/eth_sign_typed_data_helper.cc +++ b/components/brave_wallet/common/eth_sign_typed_data_helper.cc @@ -13,7 +13,6 @@ #include "base/check.h" #include "base/containers/extend.h" #include "base/containers/span.h" -#include "base/logging.h" #include "base/strings/strcat.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_split.h" @@ -198,7 +197,6 @@ EthSignTypedDataHelper::EncodeField(const std::string_view type, if (type.ends_with(']')) { if (version_ != Version::kV4) { - VLOG(0) << "version has to be v4 to support array"; return std::nullopt; } if (!value.is_list()) {