Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log the drain ID when a token drain is successfully initiated #8613

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@

#include "base/json/json_writer.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "bat/ledger/internal/credentials/credentials_promotion.h"
#include "bat/ledger/internal/credentials/credentials_util.h"
#include "bat/ledger/internal/ledger_impl.h"
#include "bat/ledger/internal/logging/event_log_keys.h"

using std::placeholders::_1;
using std::placeholders::_2;
Expand Down Expand Up @@ -533,6 +535,11 @@ void CredentialsPromotion::OnDrainTokens(
id = redeem.contribution_id;
}

ledger_->database()->SaveEventLog(
log::kTokensDrained,
base::StringPrintf("tokens: %lu, drain_id: %s", token_id_list.size(),
drain_id.c_str()));

DCHECK(redeem.type == type::RewardsType::TRANSFER);
ledger_->database()->MarkUnblindedTokensAsSpent(
token_id_list, type::RewardsType::TRANSFER, id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const char kDatabaseMigrated[] = "database_migrated";
const char kPromotionsClaimed[] = "promotion_claimed";
const char kWalletRecovered[] = "wallet_recovered";
const char kDeviceLimitReached[] = "device_limit_reached";
const char kTokensDrained[] = "tokens_drained";

} // namespace log
} // namespace ledger
Expand Down