Merge pull request #264 from cypherstack/desktop

Desktop
This commit is contained in:
julian-CStack 2022-12-14 13:34:43 -06:00 committed by GitHub
commit e43aaa765f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 5 deletions

@ -1 +1 @@
Subproject commit b1e0b20621be3ebb280ab3e3de10afe0c11db073
Subproject commit 265d83e1adb3ca161e700214a9353bc044d16557

View file

@ -83,10 +83,10 @@ class CachedElectrumX {
// update set with new data
if (newSet["setHash"] != "" && set["setHash"] != newSet["setHash"]) {
set["setHash"] = !isHexadecimal(newSet["setHash"] as String)
? base64ToReverseHex(newSet["setHash"] as String)
? base64ToHex(newSet["setHash"] as String)
: newSet["setHash"];
set["blockHash"] = !isHexadecimal(newSet["blockHash"] as String)
? base64ToHex(newSet["blockHash"] as String)
? base64ToReverseHex(newSet["blockHash"] as String)
: newSet["blockHash"];
for (int i = (newSet["coins"] as List).length - 1; i >= 0; i--) {
dynamic newCoin = newSet["coins"][i];

View file

@ -164,7 +164,7 @@ class _WalletSummaryInfoState extends State<WalletSummaryInfo> {
const Spacer(),
FittedBox(
fit: BoxFit.scaleDown,
child: Text(
child: SelectableText(
"${Format.localizedStringAsFixed(
value: balanceToShow,
locale: locale,

View file

@ -38,7 +38,7 @@ abstract class Constants {
// Enable Logger.print statements
static const bool disableLogger = false;
static const int currentHiveDbVersion = 3;
static const int currentHiveDbVersion = 4;
static int satsPerCoin(Coin coin) {
switch (coin) {

View file

@ -141,6 +141,7 @@ class DbVersionMigrator {
// try to continue migrating
return await migrate(2, secureStore: secureStore);
case 2:
await Hive.openBox<dynamic>(DB.boxNamePrefs);
final prefs = Prefs.instance;
@ -154,6 +155,20 @@ class DbVersionMigrator {
boxName: DB.boxNameDBInfo, key: "hive_data_version", value: 3);
return await migrate(3, secureStore: secureStore);
case 3:
// clear possible broken firo cache
await DB.instance.deleteBoxFromDisk(
boxName: DB.instance.boxNameSetCache(coin: Coin.firo));
await DB.instance.deleteBoxFromDisk(
boxName: DB.instance.boxNameUsedSerialsCache(coin: Coin.firo));
// update version
await DB.instance.put<dynamic>(
boxName: DB.boxNameDBInfo, key: "hive_data_version", value: 4);
// try to continue migrating
return await migrate(4, secureStore: secureStore);
default:
// finally return
return;