move amount_converter to cw_core (#588)

Co-authored-by: Serhii <borodenko.sv@gmail.com>

mkyq committed Nov 3, 2022 at 14:45 UTC 8e70b611d0cd3b257da14d2dbd62f32e35d00e37
4 files changed +11 -19
cw_core/lib/amount_converter.dart renamed
cw_haven/lib/pending_haven_transaction.dart
+5 -9
@@ -2,7 +2,7 @@ import 'package:cw_haven/api/structs/pending_transaction.dart';
2 import 'package:cw_haven/api/transaction_history.dart'
3 as haven_transaction_history;
4 import 'package:cw_core/crypto_currency.dart';
5 -// import 'package:cake_wallet/core/amount_converter.dart';
5 +import 'package:cw_core/amount_converter.dart';
6 import 'package:cw_core/pending_transaction.dart';
7
8 class DoubleSpendException implements Exception {
@@ -25,17 +25,13 @@ class PendingHavenTransaction with PendingTransaction {
25 @override
26 String get hex => '';
27
28 - // FIX-ME: AmountConverter
28 @override
30 - String get amountFormatted => '';
31 - // AmountConverter.amountIntToString(
32 - // cryptoCurrency, pendingTransactionDescription.amount);
29 + String get amountFormatted => AmountConverter.amountIntToString(
30 + cryptoCurrency, pendingTransactionDescription.amount);
31
34 - // FIX-ME: AmountConverter
32 @override
36 - String get feeFormatted => '';
37 - // AmountConverter.amountIntToString(
38 - // cryptoCurrency, pendingTransactionDescription.fee);
33 + String get feeFormatted => AmountConverter.amountIntToString(
34 + cryptoCurrency, pendingTransactionDescription.fee);
35
36 @override
37 Future<void> commit() async {
cw_monero/lib/pending_monero_transaction.dart
+5 -9
@@ -2,7 +2,7 @@ import 'package:cw_monero/api/structs/pending_transaction.dart';
2 import 'package:cw_monero/api/transaction_history.dart'
3 as monero_transaction_history;
4 import 'package:cw_core/crypto_currency.dart';
5 -// import 'package:cake_wallet/core/amount_converter.dart';
5 +import 'package:cw_core/amount_converter.dart';
6
7 import 'package:cw_core/pending_transaction.dart';
8
@@ -27,17 +27,13 @@ class PendingMoneroTransaction with PendingTransaction {
27
28 String get txKey => pendingTransactionDescription.txKey;
29
30 - // FIX-ME: AmountConverter
30 @override
32 - String get amountFormatted => '';
33 - // AmountConverter.amountIntToString(
34 - // CryptoCurrency.xmr, pendingTransactionDescription.amount);
31 + String get amountFormatted => AmountConverter.amountIntToString(
32 + CryptoCurrency.xmr, pendingTransactionDescription.amount);
33
36 - // FIX-ME: AmountConverter
34 @override
38 - String get feeFormatted => '';
39 - // AmountConverter.amountIntToString(
40 - // CryptoCurrency.xmr, pendingTransactionDescription.fee);
35 + String get feeFormatted => AmountConverter.amountIntToString(
36 + CryptoCurrency.xmr, pendingTransactionDescription.fee);
37
38 @override
39 Future<void> commit() async {
lib/exchange/morphtoken/morphtoken_exchange_provider.dart
+1 -1
@@ -1,5 +1,5 @@
1 import 'dart:convert';
2 -import 'package:cake_wallet/core/amount_converter.dart';
2 +import 'package:cw_core/amount_converter.dart';
3 import 'package:hive/hive.dart';
4 import 'package:cake_wallet/exchange/trade_not_found_exeption.dart';
5 import 'package:flutter/foundation.dart';