mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 11:39:22 +00:00
add card for when monero wallet is in broken state (#1578)
Some checks are pending
Cache Dependencies / test (push) Waiting to run
Some checks are pending
Cache Dependencies / test (push) Waiting to run
This commit is contained in:
parent
5e944a8bf7
commit
e58d87e94c
2 changed files with 31 additions and 0 deletions
|
@ -250,6 +250,20 @@ class CryptoBalanceWidget extends StatelessWidget {
|
|||
Observer(builder: (context) {
|
||||
return Column(
|
||||
children: [
|
||||
if (dashboardViewModel.isMoneroWalletBrokenReasons.isNotEmpty) ...[
|
||||
SizedBox(height: 10),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),
|
||||
child: DashBoardRoundedCardWidget(
|
||||
customBorder: 30,
|
||||
title: "Monero wallet is broken",
|
||||
subTitle: "Here are the things that are broken:\n - "
|
||||
+dashboardViewModel.isMoneroWalletBrokenReasons.join("\n - ")
|
||||
+"\n\nPlease restart your wallet and if it doesn't help contact our support.",
|
||||
onTap: () {},
|
||||
)
|
||||
)
|
||||
],
|
||||
if (dashboardViewModel.showSilentPaymentsCard) ...[
|
||||
SizedBox(height: 10),
|
||||
Padding(
|
||||
|
|
|
@ -335,6 +335,23 @@ abstract class DashboardViewModelBase with Store {
|
|||
wallet.type == WalletType.wownero ||
|
||||
wallet.type == WalletType.haven;
|
||||
|
||||
@computed
|
||||
List<String> get isMoneroWalletBrokenReasons {
|
||||
if (wallet.type != WalletType.monero) return [];
|
||||
final keys = monero!.getKeys(wallet);
|
||||
List<String> errors = [
|
||||
if (keys['privateSpendKey'] == List.generate(64, (index) => "0").join("")) "Private spend key is 0",
|
||||
if (keys['privateViewKey'] == List.generate(64, (index) => "0").join("")) "private view key is 0",
|
||||
if (keys['publicSpendKey'] == List.generate(64, (index) => "0").join("")) "public spend key is 0",
|
||||
if (keys['publicViewKey'] == List.generate(64, (index) => "0").join("")) "private view key is 0",
|
||||
if (wallet.seed == null) "wallet seed is null",
|
||||
if (wallet.seed == "") "wallet seed is empty",
|
||||
if (monero!.getSubaddressList(wallet).getAll(wallet)[0].address == "41d7FXjswpK1111111111111111111111111111111111111111111111111111111111111111111111111111112KhNi4")
|
||||
"primary address is invalid, you won't be able to receive / spend funds",
|
||||
];
|
||||
return errors;
|
||||
}
|
||||
|
||||
@computed
|
||||
bool get hasSilentPayments => wallet.type == WalletType.bitcoin && !wallet.isHardwareWallet;
|
||||
|
||||
|
|
Loading…
Reference in a new issue