Skip to content

Commit

Permalink
Moves recurring tips table
Browse files Browse the repository at this point in the history
  • Loading branch information
NejcZdovc committed Jan 23, 2020
1 parent 03db29e commit 0c322a1
Show file tree
Hide file tree
Showing 31 changed files with 400 additions and 680 deletions.
2 changes: 0 additions & 2 deletions components/brave_rewards/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ source_set("browser") {
"database/database_promotion.h",
"database/database_promotion_creds.cc",
"database/database_promotion_creds.h",
"database/database_recurring_tip.cc",
"database/database_recurring_tip.h",
"database/database_table.cc",
"database/database_table.h",
"database/database_unblinded_token.cc",
Expand Down
206 changes: 0 additions & 206 deletions components/brave_rewards/browser/database/database_recurring_tip.cc

This file was deleted.

48 changes: 0 additions & 48 deletions components/brave_rewards/browser/database/database_recurring_tip.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ PublisherInfoDatabase::PublisherInfoDatabase(

media_publisher_info_ =
std::make_unique<DatabaseMediaPublisherInfo>(GetCurrentVersion());

recurring_tip_ =
std::make_unique<DatabaseRecurringTip>(GetCurrentVersion());
}

PublisherInfoDatabase::~PublisherInfoDatabase() {
Expand Down Expand Up @@ -229,38 +226,6 @@ PublisherInfoDatabase::GetMediaPublisherInfo(const std::string& media_key) {
return media_publisher_info_->GetRecord(&GetDB(), media_key);
}

/**
*
* RECURRING TIPS
*
*/
bool PublisherInfoDatabase::InsertOrUpdateRecurringTip(
ledger::RecurringTipPtr info) {
if (!IsInitialized()) {
return false;
}

return recurring_tip_->InsertOrUpdate(&GetDB(), std::move(info));
}

void PublisherInfoDatabase::GetRecurringTips(
ledger::PublisherInfoList* list) {
if (!IsInitialized()) {
return;
}

recurring_tip_->GetAllRecords(&GetDB(), list);
}

bool PublisherInfoDatabase::RemoveRecurringTip(
const std::string& publisher_key) {
if (!IsInitialized()) {
return false;
}

return recurring_tip_->DeleteRecord(&GetDB(), publisher_key);
}

/**
*
* PENDING CONTRIBUTION
Expand Down Expand Up @@ -584,10 +549,6 @@ bool PublisherInfoDatabase::MigrateV1toV2() {
return false;
}

if (!recurring_tip_->Migrate(&GetDB(), 2)) {
return false;
}

return true;
}

Expand Down Expand Up @@ -754,10 +715,6 @@ bool PublisherInfoDatabase::MigrateV14toV15() {
return false;
}

if (!recurring_tip_->Migrate(&GetDB(), 15)) {
return false;
}

if (!unblinded_token_->Migrate(&GetDB(), 15)) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "brave/components/brave_rewards/browser/database/database_media_publisher_info.h"
#include "brave/components/brave_rewards/browser/database/database_pending_contribution.h"
#include "brave/components/brave_rewards/browser/database/database_promotion.h"
#include "brave/components/brave_rewards/browser/database/database_recurring_tip.h"
#include "brave/components/brave_rewards/browser/database/database_unblinded_token.h"
#include "brave/components/brave_rewards/browser/pending_contribution.h"
#include "build/build_config.h"
Expand Down Expand Up @@ -61,12 +60,6 @@ class PublisherInfoDatabase {
ledger::PublisherInfoPtr GetMediaPublisherInfo(
const std::string& media_key);

bool InsertOrUpdateRecurringTip(ledger::RecurringTipPtr info);

void GetRecurringTips(ledger::PublisherInfoList* list);

bool RemoveRecurringTip(const std::string& publisher_key);

bool InsertPendingContribution(ledger::PendingContributionList list);

double GetReservedAmount();
Expand Down Expand Up @@ -200,7 +193,6 @@ class PublisherInfoDatabase {
std::unique_ptr<DatabaseContributionInfo> contribution_info_;
std::unique_ptr<DatabasePendingContribution> pending_contribution_;
std::unique_ptr<DatabaseMediaPublisherInfo> media_publisher_info_;
std::unique_ptr<DatabaseRecurringTip> recurring_tip_;

SEQUENCE_CHECKER(sequence_checker_);
DISALLOW_COPY_AND_ASSIGN(PublisherInfoDatabase);
Expand Down
Loading

0 comments on commit 0c322a1

Please sign in to comment.