cake_wallet/cw_monero/lib/monero_transaction_history.dart
Serhii 02fd12f5f8
CW-214-Monero-wallet-rescan-bug (#945)
* clear transactionHistory before rescan

* move the clear method to the abstract class
2023-07-11 20:56:01 +03:00

28 lines
814 B
Dart

import 'dart:core';
import 'package:mobx/mobx.dart';
import 'package:cw_core/transaction_history.dart';
import 'package:cw_monero/monero_transaction_info.dart';
part 'monero_transaction_history.g.dart';
class MoneroTransactionHistory = MoneroTransactionHistoryBase
with _$MoneroTransactionHistory;
abstract class MoneroTransactionHistoryBase
extends TransactionHistoryBase<MoneroTransactionInfo> with Store {
MoneroTransactionHistoryBase() {
transactions = ObservableMap<String, MoneroTransactionInfo>();
}
@override
Future<void> save() async {}
@override
void addOne(MoneroTransactionInfo transaction) =>
transactions[transaction.id] = transaction;
@override
void addMany(Map<String, MoneroTransactionInfo> transactions) =>
this.transactions.addAll(transactions);
}