mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-02 12:14:09 +01:00
Monero stability and cleanup (#1572)
* migrate monero.dart from it's own repository to monero_c * show errors when invalid monero_c library is being used * Delete unused code * Delete unused code * Fix potential bug causing missing Polyseeds and tx-keys; Add Waring * Remove unused wownero-code * bump monero_c commit --------- Co-authored-by: Czarek Nakamoto <cyjan@mrcyjanek.net> Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
co-authored by
Czarek Nakamoto
Omar Hatem
parent
ba433ef6f3
commit
8e7233b5c3
@@ -346,4 +346,9 @@ class CWMonero extends Monero {
|
||||
Future<int> getCurrentHeight() async {
|
||||
return monero_wallet_api.getCurrentHeight();
|
||||
}
|
||||
|
||||
@override
|
||||
void monerocCheck() {
|
||||
checkIfMoneroCIsFine();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,6 +124,36 @@ class CryptoBalanceWidget extends StatelessWidget {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Observer(
|
||||
builder: (_) {
|
||||
if (dashboardViewModel.getMoneroError != null) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16,0,16,16),
|
||||
child: DashBoardRoundedCardWidget(
|
||||
title: "Invalid monero bindings",
|
||||
subTitle: dashboardViewModel.getMoneroError.toString(),
|
||||
onTap: () {},
|
||||
),
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
),
|
||||
Observer(
|
||||
builder: (_) {
|
||||
if (dashboardViewModel.getWowneroError != null) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16,0,16,16),
|
||||
child: DashBoardRoundedCardWidget(
|
||||
title: "Invalid wownero bindings",
|
||||
subTitle: dashboardViewModel.getWowneroError.toString(),
|
||||
onTap: () {},
|
||||
)
|
||||
);
|
||||
}
|
||||
return Container();
|
||||
},
|
||||
),
|
||||
Observer(
|
||||
builder: (_) => dashboardViewModel.balanceViewModel.hasAccounts
|
||||
? HomeScreenAccountWidget(
|
||||
|
||||
@@ -11,6 +11,7 @@ import 'package:cake_wallet/entities/service_status.dart';
|
||||
import 'package:cake_wallet/exchange/exchange_provider_description.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/monero/monero.dart';
|
||||
import 'package:cake_wallet/wownero/wownero.dart' as wow;
|
||||
import 'package:cake_wallet/nano/nano.dart';
|
||||
import 'package:cake_wallet/store/anonpay/anonpay_transactions_store.dart';
|
||||
import 'package:cake_wallet/store/app_store.dart';
|
||||
@@ -336,6 +337,27 @@ abstract class DashboardViewModelBase with Store {
|
||||
wallet.type == WalletType.haven;
|
||||
|
||||
@computed
|
||||
String? get getMoneroError {
|
||||
if (wallet.type != WalletType.monero) return null;
|
||||
try {
|
||||
monero!.monerocCheck();
|
||||
} catch (e) {
|
||||
return e.toString();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@computed
|
||||
String? get getWowneroError {
|
||||
if (wallet.type != WalletType.wownero) return null;
|
||||
try {
|
||||
wow.wownero!.wownerocCheck();
|
||||
} catch (e) {
|
||||
return e.toString();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
List<String> get isMoneroWalletBrokenReasons {
|
||||
if (wallet.type != WalletType.monero) return [];
|
||||
final keys = monero!.getKeys(wallet);
|
||||
|
||||
@@ -347,4 +347,9 @@ class CWWownero extends Wownero {
|
||||
|
||||
String getLegacySeed(Object wallet, String langName) =>
|
||||
(wallet as WowneroWalletBase).seedLegacy(langName);
|
||||
|
||||
@override
|
||||
void wownerocCheck() {
|
||||
checkIfMoneroCIsFine();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user