From e404de2116a5dc959220515b1c83194c9d681508 Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 24 Jan 2023 10:30:00 -0600 Subject: [PATCH] force usage of adkVersion parameter --- .../stack_backup_views/create_auto_backup_view.dart | 2 +- .../stack_backup_views/edit_auto_backup_view.dart | 2 +- .../stack_backup_views/helpers/restore_create_backup.dart | 6 +++--- .../backup_and_restore/create_auto_backup.dart | 2 +- lib/services/auto_swb_service.dart | 3 +-- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/create_auto_backup_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/create_auto_backup_view.dart index 8e8731105..e95424cc0 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/create_auto_backup_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/create_auto_backup_view.dart @@ -596,7 +596,7 @@ class _EnableAutoBackupViewState extends ConsumerState { fileToSave, adkString, jsonEncode(backup), - adkVersion: adkVersion, + adkVersion, ); // this future should already be complete unless there was an error encrypting diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/edit_auto_backup_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/edit_auto_backup_view.dart index 0cc85d77c..69fc4ca48 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/edit_auto_backup_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/edit_auto_backup_view.dart @@ -187,7 +187,7 @@ class _EditAutoBackupViewState extends ConsumerState { fileToSave, adkString, jsonEncode(backup), - adkVersion: adkVersion, + adkVersion, ); // this future should already be complete unless there was an error encrypting diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/helpers/restore_create_backup.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/helpers/restore_create_backup.dart index 62a8bf9cb..39bd4ac94 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/helpers/restore_create_backup.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/helpers/restore_create_backup.dart @@ -133,9 +133,9 @@ abstract class SWB { static Future encryptStackWalletWithADK( String fileToSave, String adk, - String plaintext, { - int? adkVersion, - }) async { + String plaintext, + int adkVersion, + ) async { try { File backupFile = File(fileToSave); if (!backupFile.existsSync()) { diff --git a/lib/pages_desktop_specific/settings/settings_menu/backup_and_restore/create_auto_backup.dart b/lib/pages_desktop_specific/settings/settings_menu/backup_and_restore/create_auto_backup.dart index df80da732..5b092834b 100644 --- a/lib/pages_desktop_specific/settings/settings_menu/backup_and_restore/create_auto_backup.dart +++ b/lib/pages_desktop_specific/settings/settings_menu/backup_and_restore/create_auto_backup.dart @@ -722,7 +722,7 @@ class _CreateAutoBackup extends ConsumerState { fileToSave, adkString, jsonEncode(backup), - adkVersion: adkVersion, + adkVersion, ); // this future should already be complete unless there was an error encrypting diff --git a/lib/services/auto_swb_service.dart b/lib/services/auto_swb_service.dart index f7efc994e..15b4b9f77 100644 --- a/lib/services/auto_swb_service.dart +++ b/lib/services/auto_swb_service.dart @@ -75,8 +75,7 @@ class AutoSWBService extends ChangeNotifier { createAutoBackupFilename(autoBackupDirectoryPath, now); final result = await SWB.encryptStackWalletWithADK( - fileToSave, adkString!, jsonString, - adkVersion: adkVersion); + fileToSave, adkString!, jsonString, adkVersion); if (!result) { throw Exception("stack auto backup service failed to create a backup");