diff --git a/android/app/src/main/jniLibs/arm64-v8a/libc++_shared.so b/android/app/src/main/jniLibs/arm64-v8a/libc++_shared.so deleted file mode 120000 index 327e44763..000000000 --- a/android/app/src/main/jniLibs/arm64-v8a/libc++_shared.so +++ /dev/null @@ -1 +0,0 @@ -../../../../../../scripts/monero_c/release/monero/aarch64-linux-android_libc++_shared.so \ No newline at end of file diff --git a/android/app/src/main/jniLibs/armeabi-v7a/libc++_shared.so b/android/app/src/main/jniLibs/armeabi-v7a/libc++_shared.so deleted file mode 120000 index f4aca0350..000000000 --- a/android/app/src/main/jniLibs/armeabi-v7a/libc++_shared.so +++ /dev/null @@ -1 +0,0 @@ -../../../../../../scripts/monero_c/release/monero/arm-linux-androideabi_libc++_shared.so \ No newline at end of file diff --git a/android/app/src/main/jniLibs/x86_64/libc++_shared.so b/android/app/src/main/jniLibs/x86_64/libc++_shared.so deleted file mode 120000 index c98ebd3b6..000000000 --- a/android/app/src/main/jniLibs/x86_64/libc++_shared.so +++ /dev/null @@ -1 +0,0 @@ -../../../../../../scripts/monero_c/release/monero/x86_64-linux-android_libc++_shared.so \ No newline at end of file diff --git a/cw_wownero/lib/api/wallet_manager.dart b/cw_wownero/lib/api/wallet_manager.dart index e73286089..516437bfc 100644 --- a/cw_wownero/lib/api/wallet_manager.dart +++ b/cw_wownero/lib/api/wallet_manager.dart @@ -12,7 +12,7 @@ import 'package:monero/wownero.dart' as wownero; wownero.WalletManager? _wmPtr; final wownero.WalletManager wmPtr = Pointer.fromAddress((() { try { - // Problems with the wallet? Crashes? Lags? this will print all calls to xmr + // Problems with the wallet? Crashes? Lags? this will print all calls to wow // codebase, so it will be easier to debug what happens. At least easier // than plugging gdb in. Especially on windows/android. wownero.printStarts = false; diff --git a/cw_wownero/lib/pending_wownero_transaction.dart b/cw_wownero/lib/pending_wownero_transaction.dart index 2d89704d9..1fc1805eb 100644 --- a/cw_wownero/lib/pending_wownero_transaction.dart +++ b/cw_wownero/lib/pending_wownero_transaction.dart @@ -11,7 +11,7 @@ class DoubleSpendException implements Exception { @override String toString() => - 'This transaction cannot be committed. This can be due to many reasons including the wallet not being synced, there is not enough XMR in your available balance, or previous transactions are not yet fully processed.'; + 'This transaction cannot be committed. This can be due to many reasons including the wallet not being synced, there is not enough WOW in your available balance, or previous transactions are not yet fully processed.'; } class PendingWowneroTransaction with PendingTransaction { @@ -28,12 +28,12 @@ class PendingWowneroTransaction with PendingTransaction { String get txKey => pendingTransactionDescription.txKey; @override - String get amountFormatted => AmountConverter.amountIntToString( - CryptoCurrency.xmr, pendingTransactionDescription.amount); + String get amountFormatted => + AmountConverter.amountIntToString(CryptoCurrency.wow, pendingTransactionDescription.amount); @override - String get feeFormatted => AmountConverter.amountIntToString( - CryptoCurrency.xmr, pendingTransactionDescription.fee); + String get feeFormatted => + AmountConverter.amountIntToString(CryptoCurrency.wow, pendingTransactionDescription.fee); @override Future commit() async { diff --git a/cw_wownero/lib/wownero_transaction_info.dart b/cw_wownero/lib/wownero_transaction_info.dart index 0dddf59df..2060f1f95 100644 --- a/cw_wownero/lib/wownero_transaction_info.dart +++ b/cw_wownero/lib/wownero_transaction_info.dart @@ -67,8 +67,7 @@ class WowneroTransactionInfo extends TransactionInfo { String? _fiatAmount; @override - String amountFormatted() => - '${formatAmount(wowneroAmountToString(amount: amount))} XMR'; + String amountFormatted() => '${formatAmount(wowneroAmountToString(amount: amount))} WOW'; @override String fiatAmount() => _fiatAmount ?? ''; @@ -77,6 +76,5 @@ class WowneroTransactionInfo extends TransactionInfo { void changeFiatAmount(String amount) => _fiatAmount = formatAmount(amount); @override - String feeFormatted() => - '${formatAmount(wowneroAmountToString(amount: fee))} XMR'; + String feeFormatted() => '${formatAmount(wowneroAmountToString(amount: fee))} WOW'; } diff --git a/cw_wownero/lib/wownero_wallet.dart b/cw_wownero/lib/wownero_wallet.dart index 6946d2138..8330d47c6 100644 --- a/cw_wownero/lib/wownero_wallet.dart +++ b/cw_wownero/lib/wownero_wallet.dart @@ -52,7 +52,7 @@ abstract class WowneroWalletBase WowneroWalletBase( {required WalletInfo walletInfo, required Box unspentCoinsInfo}) : balance = ObservableMap.of({ - CryptoCurrency.xmr: WowneroBalance( + CryptoCurrency.wow: WowneroBalance( fullBalance: wownero_wallet.getFullBalance(accountIndex: 0), unlockedBalance: wownero_wallet.getFullBalance(accountIndex: 0)) }), @@ -242,7 +242,7 @@ abstract class WowneroWalletBase if (hasMultiDestination) { if (outputs.any((item) => item.sendAll || (item.formattedCryptoAmount ?? 0) <= 0)) { throw WowneroTransactionCreationException( - 'You do not have enough XMR to send this amount.'); + 'You do not have enough WOW to send this amount.'); } final int totalAmount = @@ -251,7 +251,7 @@ abstract class WowneroWalletBase final estimatedFee = calculateEstimatedFee(_credentials.priority, totalAmount); if (unlockedBalance < totalAmount) { throw WowneroTransactionCreationException( - 'You do not have enough XMR to send this amount.'); + 'You do not have enough WOW to send this amount.'); } if (!spendAllCoins && (allInputsAmount < totalAmount + estimatedFee)) { diff --git a/lib/entities/parse_address_from_domain.dart b/lib/entities/parse_address_from_domain.dart index 409724c6e..c95ce9847 100644 --- a/lib/entities/parse_address_from_domain.dart +++ b/lib/entities/parse_address_from_domain.dart @@ -201,7 +201,7 @@ class AddressResolver { final txtRecord = await OpenaliasRecord.lookupOpenAliasRecord(formattedName); if (txtRecord != null) { final record = await OpenaliasRecord.fetchAddressAndName( - formattedName: formattedName, ticker: ticker, txtRecord: txtRecord); + formattedName: formattedName, ticker: ticker.toLowerCase(), txtRecord: txtRecord); return ParsedAddress.fetchOpenAliasAddress(record: record, name: text); } } diff --git a/lib/src/screens/rescan/rescan_page.dart b/lib/src/screens/rescan/rescan_page.dart index c59ae4ad0..4b2327c43 100644 --- a/lib/src/screens/rescan/rescan_page.dart +++ b/lib/src/screens/rescan/rescan_page.dart @@ -33,6 +33,7 @@ class RescanPage extends BasePage { doSingleScan: _rescanViewModel.doSingleScan, toggleSingleScan: () => _rescanViewModel.doSingleScan = !_rescanViewModel.doSingleScan, + walletType: _rescanViewModel.wallet.type, )), Observer( builder: (_) => LoadingPrimaryButton( diff --git a/lib/src/screens/restore/wallet_restore_from_keys_form.dart b/lib/src/screens/restore/wallet_restore_from_keys_form.dart index 588fd7187..f8336a2e8 100644 --- a/lib/src/screens/restore/wallet_restore_from_keys_form.dart +++ b/lib/src/screens/restore/wallet_restore_from_keys_form.dart @@ -171,6 +171,7 @@ class WalletRestoreFromKeysFromState extends State { hasDatePicker: widget.walletRestoreViewModel.type != WalletType.haven, onHeightChange: (_) => null, onHeightOrDateEntered: widget.onHeightOrDateEntered, + walletType: widget.walletRestoreViewModel.type, ), ], ); diff --git a/lib/src/screens/restore/wallet_restore_from_seed_form.dart b/lib/src/screens/restore/wallet_restore_from_seed_form.dart index 0d467e19f..baf8a1091 100644 --- a/lib/src/screens/restore/wallet_restore_from_seed_form.dart +++ b/lib/src/screens/restore/wallet_restore_from_seed_form.dart @@ -199,6 +199,7 @@ class WalletRestoreFromSeedFormState extends State { key: blockchainHeightKey, onHeightOrDateEntered: widget.onHeightOrDateEntered, hasDatePicker: widget.type == WalletType.monero || widget.type == WalletType.wownero, + walletType: widget.type, ), if (widget.displayPassphrase) ...[ const SizedBox(height: 10), @@ -213,7 +214,7 @@ class WalletRestoreFromSeedFormState extends State { bool get isPolyseed => widget.seedTypeViewModel.moneroSeedType == SeedType.polyseed && - (widget.type == WalletType.monero || widget.type == WalletType.wownero); + (widget.type == WalletType.monero || widget.type == WalletType.wownero); Widget get expandIcon => Container( padding: EdgeInsets.all(18), diff --git a/lib/src/widgets/blockchain_height_widget.dart b/lib/src/widgets/blockchain_height_widget.dart index d85680cc8..4023e66ad 100644 --- a/lib/src/widgets/blockchain_height_widget.dart +++ b/lib/src/widgets/blockchain_height_widget.dart @@ -2,6 +2,8 @@ import 'package:cake_wallet/bitcoin/bitcoin.dart'; import 'package:cake_wallet/src/widgets/standard_switch.dart'; import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/utils/date_picker.dart'; +import 'package:cake_wallet/wownero/wownero.dart'; +import 'package:cw_core/wallet_type.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; import 'package:cake_wallet/generated/i18n.dart'; @@ -18,6 +20,7 @@ class BlockchainHeightWidget extends StatefulWidget { this.isSilentPaymentsScan = false, this.toggleSingleScan, this.doSingleScan = false, + required this.walletType, }) : super(key: key); final Function(int)? onHeightChange; @@ -27,6 +30,7 @@ class BlockchainHeightWidget extends StatefulWidget { final bool isSilentPaymentsScan; final bool doSingleScan; final Function()? toggleSingleScan; + final WalletType walletType; @override State createState() => BlockchainHeightState(); @@ -160,7 +164,13 @@ class BlockchainHeightState extends State { if (widget.isSilentPaymentsScan) { height = bitcoin!.getHeightByDate(date: date); } else { - height = monero!.getHeightByDate(date: date); + if (widget.walletType == WalletType.monero) { + height = monero!.getHeightByDate(date: date); + } else { + assert(widget.walletType == WalletType.wownero, + "unknown currency in BlockchainHeightWidget"); + height = wownero!.getHeightByDate(date: date); + } } setState(() { dateController.text = DateFormat('yyyy-MM-dd').format(date); diff --git a/scripts/android/build_monero_all.sh b/scripts/android/build_monero_all.sh index 027674caa..261ebd560 100755 --- a/scripts/android/build_monero_all.sh +++ b/scripts/android/build_monero_all.sh @@ -48,13 +48,10 @@ else popd unxz -f ../monero_c/release/${COIN}/x86_64-linux-android_libwallet2_api_c.so.xz - unxz -f ../monero_c/release/${COIN}/x86_64-linux-android_libc++_shared.so.xz unxz -f ../monero_c/release/${COIN}/armv7a-linux-androideabi_libwallet2_api_c.so.xz - unxz -f ../monero_c/release/${COIN}/armv7a-linux-androideabi_libc++_shared.so.xz unxz -f ../monero_c/release/${COIN}/aarch64-linux-android_libwallet2_api_c.so.xz - unxz -f ../monero_c/release/${COIN}/aarch64-linux-android_libc++_shared.so.xz [[ ! "x$REMOVE_CACHES" == "x" ]] && rm -rf ${COIN}/contrib/depends/{built,sources} done fi diff --git a/scripts/prepare_moneroc.sh b/scripts/prepare_moneroc.sh index 7936ab69d..ffbe4919f 100755 --- a/scripts/prepare_moneroc.sh +++ b/scripts/prepare_moneroc.sh @@ -8,7 +8,7 @@ if [[ ! -d "monero_c" ]]; then git clone https://github.com/mrcyjanek/monero_c --branch rewrite-wip cd monero_c - git checkout 4f4cde82f799b191576f619a7653fe5f6f366758 + git checkout 0b1520b6c24c87440f35a4c17f64044d5edcf647 git reset --hard git submodule update --init --force --recursive ./apply_patches.sh monero