mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 11:39:22 +00:00
Generic fixes (#1605)
* minor fixes * fix not saving wallet password to secure storage * cache linux deps as well
This commit is contained in:
parent
4e7e00b975
commit
525df820c3
6 changed files with 23 additions and 27 deletions
5
.github/workflows/cache_dependencies.yml
vendored
5
.github/workflows/cache_dependencies.yml
vendored
|
@ -60,7 +60,7 @@ jobs:
|
|||
path: |
|
||||
/opt/android/cake_wallet/cw_haven/android/.cxx
|
||||
/opt/android/cake_wallet/scripts/monero_c/release
|
||||
key: ${{ hashFiles('**/prepare_moneroc.sh' ,'**/build_monero_all.sh') }}
|
||||
key: ${{ hashFiles('**/prepare_moneroc.sh' ,'**/build_monero_all.sh' ,'**/cache_dependencies.yml') }}
|
||||
|
||||
- if: ${{ steps.cache-externals.outputs.cache-hit != 'true' }}
|
||||
name: Generate Externals
|
||||
|
@ -68,3 +68,6 @@ jobs:
|
|||
cd /opt/android/cake_wallet/scripts/android/
|
||||
source ./app_env.sh cakewallet
|
||||
./build_monero_all.sh
|
||||
cd ../linux/
|
||||
source ./app_env.sh cakewallet
|
||||
./build_monero_all.sh
|
||||
|
|
|
@ -8,10 +8,7 @@ import 'package:cw_monero/api/exceptions/wallet_opening_exception.dart';
|
|||
import 'package:cw_monero/api/exceptions/wallet_restore_from_keys_exception.dart';
|
||||
import 'package:cw_monero/api/exceptions/wallet_restore_from_seed_exception.dart';
|
||||
import 'package:cw_monero/api/wallet.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:cw_monero/api/transaction_history.dart';
|
||||
import 'package:cw_monero/api/wallet.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:monero/monero.dart' as monero;
|
||||
|
||||
class MoneroCException implements Exception {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import 'package:cake_wallet/core/secure_storage.dart';
|
||||
import 'package:cake_wallet/di.dart';
|
||||
import 'package:cake_wallet/store/settings_store.dart';
|
||||
import 'package:cw_core/wallet_info.dart';
|
||||
|
@ -57,9 +56,9 @@ class WalletCreationService {
|
|||
|
||||
if (credentials.password == null) {
|
||||
credentials.password = generateWalletPassword();
|
||||
await keyService.saveWalletPassword(
|
||||
password: credentials.password!, walletName: credentials.name);
|
||||
}
|
||||
await keyService.saveWalletPassword(
|
||||
password: credentials.password!, walletName: credentials.name);
|
||||
|
||||
if (_hasSeedPhraseLengthOption) {
|
||||
credentials.seedPhraseLength = settingsStore.seedPhraseLength.value;
|
||||
|
@ -99,9 +98,9 @@ class WalletCreationService {
|
|||
|
||||
if (credentials.password == null) {
|
||||
credentials.password = generateWalletPassword();
|
||||
await keyService.saveWalletPassword(
|
||||
password: credentials.password!, walletName: credentials.name);
|
||||
}
|
||||
await keyService.saveWalletPassword(
|
||||
password: credentials.password!, walletName: credentials.name);
|
||||
|
||||
final wallet = await _service!.restoreFromKeys(credentials, isTestnet: isTestnet);
|
||||
|
||||
|
@ -118,9 +117,9 @@ class WalletCreationService {
|
|||
|
||||
if (credentials.password == null) {
|
||||
credentials.password = generateWalletPassword();
|
||||
await keyService.saveWalletPassword(
|
||||
password: credentials.password!, walletName: credentials.name);
|
||||
}
|
||||
await keyService.saveWalletPassword(
|
||||
password: credentials.password!, walletName: credentials.name);
|
||||
|
||||
final wallet = await _service!.restoreFromSeed(credentials, isTestnet: isTestnet);
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ class _WalletNameFormState extends State<WalletNameForm> {
|
|||
_walletNewVM.hasWalletPassword ? TextEditingController() : null;
|
||||
|
||||
static const aspectRatioImage = 1.22;
|
||||
static bool formProcessing = false;
|
||||
bool _formProcessing = false;
|
||||
|
||||
final GlobalKey<FormState> _formKey;
|
||||
final GlobalKey<SeedLanguageSelectorState> _languageSelectorKey;
|
||||
|
@ -350,11 +350,11 @@ class _WalletNameFormState extends State<WalletNameForm> {
|
|||
}
|
||||
|
||||
void _confirmForm() async {
|
||||
if (formProcessing) return;
|
||||
formProcessing = true;
|
||||
if (_formProcessing) return;
|
||||
_formProcessing = true;
|
||||
try {
|
||||
if (_formKey.currentState != null && !_formKey.currentState!.validate()) {
|
||||
formProcessing = false;
|
||||
_formProcessing = false;
|
||||
return;
|
||||
}
|
||||
if (_walletNewVM.nameExists(_walletNewVM.name)) {
|
||||
|
@ -374,10 +374,10 @@ class _WalletNameFormState extends State<WalletNameForm> {
|
|||
: null);
|
||||
}
|
||||
} catch (e) {
|
||||
formProcessing = false;
|
||||
_formProcessing = false;
|
||||
rethrow;
|
||||
}
|
||||
formProcessing = false;
|
||||
_formProcessing = false;
|
||||
}
|
||||
|
||||
bool get isPolyseed => widget._seedTypeViewModel.moneroSeedType == SeedType.polyseed;
|
||||
|
|
|
@ -2,7 +2,6 @@ import 'package:cake_wallet/core/execution_state.dart';
|
|||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/routes.dart';
|
||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||
import 'package:cake_wallet/src/screens/new_wallet/new_wallet_page.dart';
|
||||
import 'package:cake_wallet/src/screens/restore/wallet_restore_from_keys_form.dart';
|
||||
import 'package:cake_wallet/src/screens/restore/wallet_restore_from_seed_form.dart';
|
||||
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
|
||||
|
@ -81,7 +80,7 @@ class WalletRestorePage extends BasePage {
|
|||
});
|
||||
}
|
||||
|
||||
static bool formProcessing = false;
|
||||
bool _formProcessing = false;
|
||||
|
||||
@override
|
||||
Widget middle(BuildContext context) => Observer(
|
||||
|
@ -353,8 +352,8 @@ class WalletRestorePage extends BasePage {
|
|||
}
|
||||
|
||||
Future<void> _confirmForm(BuildContext context) async {
|
||||
if (formProcessing) return;
|
||||
formProcessing = true;
|
||||
if (_formProcessing) return;
|
||||
_formProcessing = true;
|
||||
try {
|
||||
// Dismissing all visible keyboard to provide context for navigation
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
|
@ -373,13 +372,13 @@ class WalletRestorePage extends BasePage {
|
|||
}
|
||||
|
||||
if (!formKey!.currentState!.validate()) {
|
||||
formProcessing = false;
|
||||
_formProcessing = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (walletRestoreViewModel.nameExists(name)) {
|
||||
showNameExistsAlert(formContext!);
|
||||
formProcessing = false;
|
||||
_formProcessing = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -428,10 +427,10 @@ class WalletRestorePage extends BasePage {
|
|||
|
||||
await walletRestoreViewModel.create(options: _credentials());
|
||||
} catch (e) {
|
||||
formProcessing = false;
|
||||
_formProcessing = false;
|
||||
rethrow;
|
||||
}
|
||||
formProcessing = false;
|
||||
_formProcessing = false;
|
||||
}
|
||||
|
||||
Future<void> showNameExistsAlert(BuildContext context) {
|
||||
|
|
|
@ -110,8 +110,6 @@ abstract class WalletCreationVMBase with Store {
|
|||
_appStore.authenticationStore.allowed();
|
||||
state = ExecutedSuccessfullyState();
|
||||
} catch (e, s) {
|
||||
print("@@@@@@@@");
|
||||
print(s);
|
||||
state = FailureState(e.toString());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue