force usage of adkVersion parameter

This commit is contained in:
julian 2023-01-24 10:30:00 -06:00
parent 7d10ae2011
commit e404de2116
5 changed files with 7 additions and 8 deletions

View file

@ -596,7 +596,7 @@ class _EnableAutoBackupViewState extends ConsumerState<CreateAutoBackupView> {
fileToSave, fileToSave,
adkString, adkString,
jsonEncode(backup), jsonEncode(backup),
adkVersion: adkVersion, adkVersion,
); );
// this future should already be complete unless there was an error encrypting // this future should already be complete unless there was an error encrypting

View file

@ -187,7 +187,7 @@ class _EditAutoBackupViewState extends ConsumerState<EditAutoBackupView> {
fileToSave, fileToSave,
adkString, adkString,
jsonEncode(backup), jsonEncode(backup),
adkVersion: adkVersion, adkVersion,
); );
// this future should already be complete unless there was an error encrypting // this future should already be complete unless there was an error encrypting

View file

@ -133,9 +133,9 @@ abstract class SWB {
static Future<bool> encryptStackWalletWithADK( static Future<bool> encryptStackWalletWithADK(
String fileToSave, String fileToSave,
String adk, String adk,
String plaintext, { String plaintext,
int? adkVersion, int adkVersion,
}) async { ) async {
try { try {
File backupFile = File(fileToSave); File backupFile = File(fileToSave);
if (!backupFile.existsSync()) { if (!backupFile.existsSync()) {

View file

@ -722,7 +722,7 @@ class _CreateAutoBackup extends ConsumerState<CreateAutoBackup> {
fileToSave, fileToSave,
adkString, adkString,
jsonEncode(backup), jsonEncode(backup),
adkVersion: adkVersion, adkVersion,
); );
// this future should already be complete unless there was an error encrypting // this future should already be complete unless there was an error encrypting

View file

@ -75,8 +75,7 @@ class AutoSWBService extends ChangeNotifier {
createAutoBackupFilename(autoBackupDirectoryPath, now); createAutoBackupFilename(autoBackupDirectoryPath, now);
final result = await SWB.encryptStackWalletWithADK( final result = await SWB.encryptStackWalletWithADK(
fileToSave, adkString!, jsonString, fileToSave, adkString!, jsonString, adkVersion);
adkVersion: adkVersion);
if (!result) { if (!result) {
throw Exception("stack auto backup service failed to create a backup"); throw Exception("stack auto backup service failed to create a backup");