Skip to content

Commit

Permalink
Use EncryptedFile
Browse files Browse the repository at this point in the history
  • Loading branch information
KingGorrin committed Jan 18, 2024
1 parent 23d9b01 commit 1655320
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/utils/wallet_file.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ abstract class WalletFile {
if (!file.existsSync()) {
throw InvalidWalletPath('Given wallet path does not exist ($walletPath)');
}
return SecureFile.fromJson(json.decode(file.readAsStringSync()))
return EncryptedFile.fromJson(json.decode(file.readAsStringSync()))
.decrypt(password);
}

static Future<void> write(
String walletPath, List<int> data, String password) async {
final file = File(walletPath);
final encrypted = await SecureFile.encrypt(data, password);
final encrypted = await EncryptedFile.encrypt(data, password);
file.writeAsString(json.encode(encrypted), mode: FileMode.writeOnly);
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1606,7 +1606,7 @@ packages:
description:
path: "."
ref: "feature/ledger"
resolved-ref: "51441ddbeaa634f51a2ea34e4325a3a01cc90e98"
resolved-ref: "996d563361903d9e6860c56833b0652790578de1"
url: "https://github.com/kinggorrin/znn_sdk_dart.git"
source: git
version: "0.0.6"
Expand Down

0 comments on commit 1655320

Please sign in to comment.