mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-31 16:09:49 +00:00
fix monero.com builds, make passphrase a getter on WalletBase
This commit is contained in:
parent
6f2ea35b77
commit
d5decd2406
4 changed files with 14 additions and 6 deletions
|
@ -46,6 +46,8 @@ abstract class WalletBase<BalanceType extends Balance, HistoryType extends Trans
|
|||
|
||||
String? get hexSeed => null;
|
||||
|
||||
String get passphrase => "";
|
||||
|
||||
Object get keys;
|
||||
|
||||
WalletAddresses get walletAddresses;
|
||||
|
|
|
@ -6,6 +6,7 @@ import 'package:cw_monero/api/account_list.dart';
|
|||
import 'package:cw_monero/api/exceptions/setup_wallet_exception.dart';
|
||||
import 'package:monero/monero.dart' as monero;
|
||||
import 'package:mutex/mutex.dart';
|
||||
import 'package:polyseed/polyseed.dart';
|
||||
|
||||
int getSyncingHeight() {
|
||||
// final height = monero.MONERO_cw_WalletListener_height(getWlptr());
|
||||
|
@ -32,6 +33,13 @@ String getSeed() {
|
|||
// monero.Wallet_setCacheAttribute(wptr!, key: "cakewallet.seed", value: seed);
|
||||
final cakepolyseed =
|
||||
monero.Wallet_getCacheAttribute(wptr!, key: "cakewallet.seed");
|
||||
final cakepassphrase = getPassphrase();
|
||||
if (cakepassphrase != "") {
|
||||
final lang = PolyseedLang.getByPhrase(cakepassphrase);
|
||||
final coin = PolyseedCoin.POLYSEED_MONERO;
|
||||
final ps = Polyseed.decode(cakepolyseed, lang, coin);
|
||||
if (ps.isEncrypted) return ps.encode(lang, coin);
|
||||
}
|
||||
if (cakepolyseed != "") {
|
||||
return cakepolyseed;
|
||||
}
|
||||
|
|
|
@ -118,9 +118,8 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
|
|||
@override
|
||||
String get password => _password;
|
||||
|
||||
String? passphrase() {
|
||||
return monero_wallet.getPassphrase();
|
||||
}
|
||||
@override
|
||||
String get passphrase => monero_wallet.getPassphrase();
|
||||
|
||||
@override
|
||||
MoneroWalletKeys get keys => MoneroWalletKeys(
|
||||
|
|
|
@ -97,7 +97,7 @@ abstract class WalletKeysViewModelBase with Store {
|
|||
.seedLegacy(lang.nameEnglish)));
|
||||
}
|
||||
|
||||
final passphrase = (_appStore.wallet as MoneroWalletBase).passphrase();
|
||||
final passphrase = _appStore.wallet?.passphrase;
|
||||
if (passphrase != null && passphrase != "") {
|
||||
items.add(StandartListItem(
|
||||
title: S.current.passphrase_view_keys,
|
||||
|
@ -292,8 +292,7 @@ abstract class WalletKeysViewModelBase with Store {
|
|||
_appStore.wallet!.privateKey != null)
|
||||
'private_key': _appStore.wallet!.privateKey!,
|
||||
if (restoreHeightResult != null) ...{'height': restoreHeightResult},
|
||||
if (_appStore.wallet is MoneroWalletBase) ...{'passphrase': (_appStore.wallet as MoneroWalletBase).passphrase()??''},
|
||||
if (_appStore.wallet is WowneroWalletBase) ...{'passphrase': (_appStore.wallet as WowneroWalletBase).passphrase()??''}
|
||||
if ((_appStore.wallet?.passphrase??"") != "") ...{'passphrase': _appStore.wallet?.passphrase??''},
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue