Renamed database classes to table classes.

Because they're not databases. They're tables.
This commit is contained in:
Greyson Parrelli
2022-11-29 10:47:12 -05:00
committed by Cody Henthorne
parent b190f9495a
commit 7949996c5c
382 changed files with 3420 additions and 3464 deletions

View File

@@ -6,7 +6,7 @@ import android.os.Build;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import org.thoughtcrime.securesms.database.PaymentDatabase;
import org.thoughtcrime.securesms.database.PaymentTable;
import org.thoughtcrime.securesms.database.SignalDatabase;
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
import org.thoughtcrime.securesms.keyvalue.SignalStore;
@@ -33,8 +33,8 @@ public final class DataExportUtil {
throw new AssertionError();
}
List<PaymentDatabase.PaymentTransaction> paymentTransactions = SignalDatabase.payments().getAll();
MobileCoinLedgerWrapper ledger = SignalStore.paymentsValues().liveMobileCoinLedger().getValue();
List<PaymentTable.PaymentTransaction> paymentTransactions = SignalDatabase.payments().getAll();
MobileCoinLedgerWrapper ledger = SignalStore.paymentsValues().liveMobileCoinLedger().getValue();
List<Payment> reconciled = LedgerReconcile.reconcile(paymentTransactions, Objects.requireNonNull(ledger));
return createTsv(reconciled);

View File

@@ -5,7 +5,7 @@ import androidx.lifecycle.LiveData;
import org.signal.core.util.concurrent.SignalExecutors;
import org.thoughtcrime.securesms.database.DatabaseObserver;
import org.thoughtcrime.securesms.database.PaymentDatabase;
import org.thoughtcrime.securesms.database.PaymentTable;
import org.thoughtcrime.securesms.database.SignalDatabase;
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
import org.thoughtcrime.securesms.util.concurrent.SerialMonoLifoExecutor;
@@ -13,10 +13,10 @@ import org.thoughtcrime.securesms.util.concurrent.SerialMonoLifoExecutor;
import java.util.UUID;
import java.util.concurrent.Executor;
public final class PaymentTransactionLiveData extends LiveData<PaymentDatabase.PaymentTransaction> {
public final class PaymentTransactionLiveData extends LiveData<PaymentTable.PaymentTransaction> {
private final UUID paymentId;
private final PaymentDatabase paymentDatabase;
private final PaymentTable paymentDatabase;
private final DatabaseObserver.Observer observer;
private final Executor executor;

View File

@@ -10,7 +10,7 @@ import androidx.lifecycle.ViewModelProvider;
import org.signal.core.util.logging.Log;
import org.signal.core.util.money.FiatMoney;
import org.thoughtcrime.securesms.database.PaymentDatabase.PaymentTransaction;
import org.thoughtcrime.securesms.database.PaymentTable.PaymentTransaction;
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
import org.thoughtcrime.securesms.keyvalue.SignalStore;
import org.thoughtcrime.securesms.payments.CreatePaymentDetails;

View File

@@ -9,7 +9,7 @@ import androidx.lifecycle.LiveData;
import com.annimon.stream.Stream;
import org.signal.core.util.logging.Log;
import org.thoughtcrime.securesms.database.PaymentDatabase;
import org.thoughtcrime.securesms.database.PaymentTable;
import org.thoughtcrime.securesms.database.SignalDatabase;
import org.thoughtcrime.securesms.keyvalue.SignalStore;
import org.thoughtcrime.securesms.payments.Direction;
@@ -29,7 +29,7 @@ public class PaymentsRepository {
private static final String TAG = Log.tag(PaymentsRepository.class);
private final PaymentDatabase paymentDatabase;
private final PaymentTable paymentDatabase;
private final LiveData<List<Payment>> recentPayments;
private final LiveData<List<Payment>> recentSentPayments;
private final LiveData<List<Payment>> recentReceivedPayments;
@@ -37,8 +37,8 @@ public class PaymentsRepository {
public PaymentsRepository() {
paymentDatabase = SignalDatabase.payments();
LiveData<List<PaymentDatabase.PaymentTransaction>> localPayments = paymentDatabase.getAllLive();
LiveData<MobileCoinLedgerWrapper> ledger = SignalStore.paymentsValues().liveMobileCoinLedger();
LiveData<List<PaymentTable.PaymentTransaction>> localPayments = paymentDatabase.getAllLive();
LiveData<MobileCoinLedgerWrapper> ledger = SignalStore.paymentsValues().liveMobileCoinLedger();
//noinspection NullableProblems
this.recentPayments = LiveDataUtil.mapAsync(LiveDataUtil.combineLatest(localPayments, ledger, Pair::create), p -> reconcile(p.first, p.second));
@@ -47,7 +47,7 @@ public class PaymentsRepository {
}
@WorkerThread
private @NonNull List<Payment> reconcile(@NonNull Collection<PaymentDatabase.PaymentTransaction> paymentTransactions, @NonNull MobileCoinLedgerWrapper ledger) {
private @NonNull List<Payment> reconcile(@NonNull Collection<PaymentTable.PaymentTransaction> paymentTransactions, @NonNull MobileCoinLedgerWrapper ledger) {
List<Payment> reconcile = LedgerReconcile.reconcile(paymentTransactions, ledger);
updateDatabaseWithNewBlockInformation(reconcile);

View File

@@ -25,7 +25,7 @@ import org.thoughtcrime.securesms.LoggingFragment;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.badges.BadgeImageView;
import org.thoughtcrime.securesms.components.AvatarImageView;
import org.thoughtcrime.securesms.database.PaymentDatabase;
import org.thoughtcrime.securesms.database.PaymentTable;
import org.thoughtcrime.securesms.payments.Direction;
import org.thoughtcrime.securesms.payments.MoneyView;
import org.thoughtcrime.securesms.payments.Payee;
@@ -211,7 +211,7 @@ public final class PaymentDetailsFragment extends LoggingFragment {
}
}
private @NonNull CharSequence describeSentTo(@NonNull PaymentsDetailsViewModel.ViewState state, @NonNull PaymentDatabase.PaymentTransaction payment) {
private @NonNull CharSequence describeSentTo(@NonNull PaymentsDetailsViewModel.ViewState state, @NonNull PaymentTable.PaymentTransaction payment) {
if (payment.getDirection().isSent()) {
return SpanUtil.insertSingleSpan(getResources(), R.string.PaymentsDetailsFragment__sent_to_s, describe(payment.getPayee(), state.getRecipient()));
} else {
@@ -219,7 +219,7 @@ public final class PaymentDetailsFragment extends LoggingFragment {
}
}
private @NonNull CharSequence describeStatus(@NonNull PaymentDatabase.PaymentTransaction payment) {
private @NonNull CharSequence describeStatus(@NonNull PaymentTable.PaymentTransaction payment) {
switch (payment.getState()) {
case INITIAL:
return getResources().getString(R.string.PaymentsDetailsFragment__submitting_payment);

View File

@@ -8,7 +8,7 @@ import androidx.lifecycle.Transformations;
import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;
import org.thoughtcrime.securesms.database.PaymentDatabase;
import org.thoughtcrime.securesms.database.PaymentTable;
import org.thoughtcrime.securesms.payments.PaymentTransactionLiveData;
import org.thoughtcrime.securesms.payments.UnreadPaymentsRepository;
import org.thoughtcrime.securesms.recipients.Recipient;
@@ -46,10 +46,10 @@ final class PaymentsDetailsViewModel extends ViewModel {
static class ViewState {
private final PaymentDatabase.PaymentTransaction payment;
private final Recipient recipient;
private final PaymentTable.PaymentTransaction payment;
private final Recipient recipient;
private ViewState(@NonNull PaymentDatabase.PaymentTransaction payment, @NonNull Recipient recipient) {
private ViewState(@NonNull PaymentTable.PaymentTransaction payment, @NonNull Recipient recipient) {
this.payment = payment;
this.recipient = recipient;
}
@@ -58,7 +58,7 @@ final class PaymentsDetailsViewModel extends ViewModel {
return recipient;
}
PaymentDatabase.PaymentTransaction getPayment() {
PaymentTable.PaymentTransaction getPayment() {
return payment;
}