mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-17 01:37:40 +00:00
Remove direct calls of cw_bitcoin BitcoinTransactionPriority from SendViewModel and SettingsViewModel. Add bitcoinTransactionPriorityWithLabel to bitcoin facade. (#574)
This commit is contained in:
parent
12e7b45520
commit
52aabee658
4 changed files with 7 additions and 4 deletions
|
@ -112,6 +112,10 @@ class CWBitcoin extends Bitcoin {
|
|||
int formatterStringDoubleToBitcoinAmount(String amount)
|
||||
=> stringDoubleToBitcoinAmount(amount);
|
||||
|
||||
@override
|
||||
String bitcoinTransactionPriorityWithLabel(TransactionPriority priority, int rate)
|
||||
=> (priority as BitcoinTransactionPriority).labelWithRate(rate);
|
||||
|
||||
@override
|
||||
List<Unspent> getUnspents(Object wallet) {
|
||||
final bitcoinWallet = wallet as ElectrumWallet;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import 'package:cake_wallet/entities/balance_display_mode.dart';
|
||||
import 'package:cake_wallet/entities/transaction_description.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/balance_view_model.dart';
|
||||
import 'package:cw_bitcoin/bitcoin_transaction_priority.dart';
|
||||
import 'package:cw_core/transaction_priority.dart';
|
||||
import 'package:cake_wallet/view_model/send/output.dart';
|
||||
import 'package:cake_wallet/view_model/send/send_template_view_model.dart';
|
||||
|
@ -276,7 +275,7 @@ abstract class SendViewModelBase with Store {
|
|||
|
||||
if (isElectrumWallet) {
|
||||
final rate = bitcoin!.getFeeRate(wallet, _priority);
|
||||
return '${(priority as BitcoinTransactionPriority).labelWithRate(rate)}';
|
||||
return bitcoin!.bitcoinTransactionPriorityWithLabel(_priority, rate);
|
||||
}
|
||||
|
||||
return priority.toString();
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import 'package:cake_wallet/entities/language_service.dart';
|
||||
import 'package:cake_wallet/store/yat/yat_store.dart';
|
||||
import 'package:cake_wallet/view_model/settings/choices_list_item.dart';
|
||||
import 'package:cw_bitcoin/bitcoin_transaction_priority.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
import 'package:package_info/package_info.dart';
|
||||
|
@ -137,7 +136,7 @@ abstract class SettingsViewModelBase with Store {
|
|||
if (wallet.type == WalletType.bitcoin
|
||||
|| wallet.type == WalletType.litecoin) {
|
||||
final rate = bitcoin!.getFeeRate(wallet, _priority);
|
||||
return '${(priority as BitcoinTransactionPriority).labelWithRate(rate)}';
|
||||
return bitcoin!.bitcoinTransactionPriorityWithLabel(_priority, rate);
|
||||
}
|
||||
|
||||
return priority.toString();
|
||||
|
|
|
@ -86,6 +86,7 @@ abstract class Bitcoin {
|
|||
String formatterBitcoinAmountToString({required int amount});
|
||||
double formatterBitcoinAmountToDouble({required int amount});
|
||||
int formatterStringDoubleToBitcoinAmount(String amount);
|
||||
String bitcoinTransactionPriorityWithLabel(TransactionPriority priority, int rate);
|
||||
|
||||
List<Unspent> getUnspents(Object wallet);
|
||||
void updateUnspents(Object wallet);
|
||||
|
|
Loading…
Reference in a new issue