[skip ci] Merge branch 'main' of https://github.com/cake-tech/cake_wallet into mweb

This commit is contained in:
Matthew Fosse 2024-08-14 10:36:27 -07:00
commit ff8c869360
9 changed files with 34 additions and 44 deletions

View file

@ -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

View file

@ -78,7 +78,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

View file

@ -75,7 +75,7 @@ jobs:
path: |
/opt/android/cake_wallet/cw_haven/android/.cxx
/opt/android/cake_wallet/scripts/monero_c/release
key: linux-${{ hashFiles('**/prepare_moneroc.sh' ,'**/build_monero_all.sh') }}
key: linux_${{ hashFiles('**/prepare_moneroc.sh' ,'**/build_monero_all.sh' ,'**/cache_dependencies.yml') }}
- if: ${{ steps.cache-externals.outputs.cache-hit != 'true' }}
name: Generate Externals
@ -174,13 +174,14 @@ jobs:
with:
path: /opt/android/cake_wallet/build/linux/x64/release/${{env.BRANCH_NAME}}.zip
- name: Send Test APK
continue-on-error: true
uses: adrey/slack-file-upload-action@1.0.5
with:
token: ${{ secrets.SLACK_APP_TOKEN }}
path: /opt/android/cake_wallet/build/linux/x64/release/${{env.BRANCH_NAME}}.zip
channel: ${{ secrets.SLACK_APK_CHANNEL }}
title: "${{ env.BRANCH_NAME }}_linux.zip"
filename: ${{ env.BRANCH_NAME }}_linux.zip
initial_comment: ${{ github.event.head_commit.message }}
# Just as an artifact would be enough
# - name: Send Test APK
# continue-on-error: true
# uses: adrey/slack-file-upload-action@1.0.5
# with:
# token: ${{ secrets.SLACK_APP_TOKEN }}
# path: /opt/android/cake_wallet/build/linux/x64/release/${{env.BRANCH_NAME}}.zip
# channel: ${{ secrets.SLACK_APK_CHANNEL }}
# title: "${{ env.BRANCH_NAME }}_linux.zip"
# filename: ${{ env.BRANCH_NAME }}_linux.zip
# initial_comment: ${{ github.event.head_commit.message }}

View file

@ -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 {

View file

@ -3,11 +3,7 @@ import Flutter
import workmanager
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
lazy var resolution : Resolution? = {
return try? Resolution()
}()
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?

View file

@ -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);

View file

@ -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;

View file

@ -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) {

View file

@ -110,8 +110,6 @@ abstract class WalletCreationVMBase with Store {
_appStore.authenticationStore.allowed();
state = ExecutedSuccessfullyState();
} catch (e, s) {
print("@@@@@@@@");
print(s);
state = FailureState(e.toString());
}
}