changes from review

This commit is contained in:
Czarek Nakamoto 2024-08-21 09:37:49 +02:00
parent b1b886dc40
commit 75c2bf2db9
5 changed files with 11 additions and 25 deletions

View file

@ -32,8 +32,7 @@ String getSeed() {
// monero.Wallet_setCacheAttribute(wptr!, key: "cakewallet.seed", value: seed);
final cakepolyseed =
monero.Wallet_getCacheAttribute(wptr!, key: "cakewallet.seed");
final cakepassphrase =
monero.Wallet_getCacheAttribute(wptr!, key: "cakewallet.passphrase");
final cakepassphrase = getPassphrase();
if (cakepolyseed != "") {
return cakepolyseed;
}
@ -46,8 +45,7 @@ String getSeed() {
}
String getSeedLegacy(String? language) {
final cakepassphrase =
monero.Wallet_getCacheAttribute(wptr!, key: "cakewallet.passphrase");
final cakepassphrase = getPassphrase();
var legacy = monero.Wallet_seed(wptr!, seedOffset: cakepassphrase);
switch (language) {
case "Chinese (Traditional)": language = "Chinese (simplified)"; break;
@ -70,11 +68,8 @@ String getSeedLegacy(String? language) {
return legacy;
}
String? getPassphrase() {
final cakepassphrase =
monero.Wallet_getCacheAttribute(wptr!, key: "cakewallet.passphrase");
if (cakepassphrase == "") return null;
return cakepassphrase;
String getPassphrase() {
return monero.Wallet_getCacheAttribute(wptr!, key: "cakewallet.passphrase");
}
String getAddress({int accountIndex = 0, int addressIndex = 0}) =>

View file

@ -34,8 +34,7 @@ String getSeed() {
// wownero.Wallet_setCacheAttribute(wptr!, key: "cakewallet.seed", value: seed);
final cakepolyseed =
wownero.Wallet_getCacheAttribute(wptr!, key: "cakewallet.seed");
final cakepassphrase =
wownero.Wallet_getCacheAttribute(wptr!, key: "cakewallet.passphrase");
final cakepassphrase = getPassphrase();
if (cakepolyseed != "") {
return cakepolyseed;
}
@ -48,8 +47,7 @@ String getSeed() {
}
String getSeedLegacy(String? language) {
final cakepassphrase =
wownero.Wallet_getCacheAttribute(wptr!, key: "cakewallet.passphrase");
final cakepassphrase = getPassphrase();
var legacy = wownero.Wallet_seed(wptr!, seedOffset: cakepassphrase);
switch (language) {
case "Chinese (Traditional)": language = "Chinese (simplified)"; break;
@ -72,11 +70,8 @@ String getSeedLegacy(String? language) {
return legacy;
}
String? getPassphrase() {
final cakepassphrase =
wownero.Wallet_getCacheAttribute(wptr!, key: "cakewallet.passphrase");
if (cakepassphrase == "") return null;
return cakepassphrase;
String getPassphrase() {
return wownero.Wallet_getCacheAttribute(wptr!, key: "cakewallet.passphrase");
}
String getAddress({int accountIndex = 0, int addressIndex = 1}) =>

View file

@ -111,7 +111,7 @@ abstract class WalletRestorationFromQRVMBase extends WalletCreationVM with Store
height: restoreWallet.height ?? 0,
mnemonic: restoreWallet.mnemonicSeed ?? '',
password: password,
passphrase: '',
passphrase: passphrase ?? '',
);
case WalletType.bitcoin:
case WalletType.litecoin:

View file

@ -48,12 +48,14 @@ class RestoredWallet {
final height = json['height'] as String?;
final mnemonic_seed = json['mnemonic_seed'] as String?;
final seed = json['seed'] as String? ?? json['hexSeed'] as String?;
final passphrase = json['passphrase'] as String?;
return RestoredWallet(
restoreMode: json['mode'] as WalletRestoreMode,
type: json['type'] as WalletType,
address: json['address'] as String?,
mnemonicSeed: mnemonic_seed ?? seed,
height: height != null ? int.parse(height) : 0,
passphrase: passphrase
);
}

View file

@ -102,12 +102,6 @@ abstract class WalletKeysViewModelBase with Store {
title: S.current.wallet_recovery_height,
value: restoreHeight.toString()));
}
final passphrase = (_appStore.wallet as MoneroWalletBase).passphrase();
if (passphrase != null) {
items.add(StandartListItem(
title: S.current.passphrase,
value: passphrase.toString()));
}
}
if (_appStore.wallet!.type == WalletType.haven) {