mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
fix logix (#2881)
This commit is contained in:
@@ -335,8 +335,7 @@ abstract class ZcashWalletBase
|
||||
"privateViewKey": backup.fvk,
|
||||
"uvk": backup.uvk,
|
||||
"tsk": backup.tsk,
|
||||
if (lastKnownRestoreHeight != null)
|
||||
"restoreHeight": lastKnownRestoreHeight.toString(),
|
||||
if (lastKnownRestoreHeight != null) "restoreHeight": lastKnownRestoreHeight.toString(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1055,7 +1054,7 @@ abstract class ZcashWalletBase
|
||||
await ZcashTransactionInfo.init();
|
||||
_initialized = true;
|
||||
}
|
||||
|
||||
|
||||
static bool isProverLoaded = false;
|
||||
static Future<void> loadProver() async {
|
||||
Uint8List? spend;
|
||||
@@ -1066,9 +1065,10 @@ abstract class ZcashWalletBase
|
||||
final outputBundle = await rootBundle.load('scripts/zcash_lib/assets/sapling-output.params');
|
||||
spend = spendBundle.buffer.asUint8List();
|
||||
output = outputBundle.buffer.asUint8List();
|
||||
if (spend.length == 0 || output.length == 0) throw Exception("NUH UH");
|
||||
spend = await File(cacheDir.path+"/sapling-spend.params").readAsBytesSync();
|
||||
output = await File(cacheDir.path+"/sapling-output.params").readAsBytesSync();
|
||||
if (spend.length == 0 || output.length == 0) {
|
||||
spend = await File(cacheDir.path + "/sapling-spend.params").readAsBytesSync();
|
||||
output = await File(cacheDir.path + "/sapling-output.params").readAsBytesSync();
|
||||
}
|
||||
if (spend.length == 0 || output.length == 0) throw Exception("NUH UH");
|
||||
} catch (e) {
|
||||
printV("$e. Fine, I'll download them.");
|
||||
@@ -1080,8 +1080,8 @@ abstract class ZcashWalletBase
|
||||
);
|
||||
spend = spendResponse.bodyBytes;
|
||||
output = outputResponse.bodyBytes;
|
||||
await File(cacheDir.path+"/sapling-spend.params").writeAsBytes(spend);
|
||||
await File(cacheDir.path+"/sapling-output.params").writeAsBytes(output);
|
||||
await File(cacheDir.path + "/sapling-spend.params").writeAsBytes(spend);
|
||||
await File(cacheDir.path + "/sapling-output.params").writeAsBytes(output);
|
||||
}
|
||||
WarpApi.initProver(spend, output);
|
||||
isProverLoaded = true;
|
||||
|
||||
Reference in New Issue
Block a user