mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-22 15:19:11 +00:00
commit
e43aaa765f
5 changed files with 20 additions and 5 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit b1e0b20621be3ebb280ab3e3de10afe0c11db073
|
Subproject commit 265d83e1adb3ca161e700214a9353bc044d16557
|
|
@ -83,10 +83,10 @@ class CachedElectrumX {
|
||||||
// update set with new data
|
// update set with new data
|
||||||
if (newSet["setHash"] != "" && set["setHash"] != newSet["setHash"]) {
|
if (newSet["setHash"] != "" && set["setHash"] != newSet["setHash"]) {
|
||||||
set["setHash"] = !isHexadecimal(newSet["setHash"] as String)
|
set["setHash"] = !isHexadecimal(newSet["setHash"] as String)
|
||||||
? base64ToReverseHex(newSet["setHash"] as String)
|
? base64ToHex(newSet["setHash"] as String)
|
||||||
: newSet["setHash"];
|
: newSet["setHash"];
|
||||||
set["blockHash"] = !isHexadecimal(newSet["blockHash"] as String)
|
set["blockHash"] = !isHexadecimal(newSet["blockHash"] as String)
|
||||||
? base64ToHex(newSet["blockHash"] as String)
|
? base64ToReverseHex(newSet["blockHash"] as String)
|
||||||
: newSet["blockHash"];
|
: newSet["blockHash"];
|
||||||
for (int i = (newSet["coins"] as List).length - 1; i >= 0; i--) {
|
for (int i = (newSet["coins"] as List).length - 1; i >= 0; i--) {
|
||||||
dynamic newCoin = newSet["coins"][i];
|
dynamic newCoin = newSet["coins"][i];
|
||||||
|
|
|
@ -164,7 +164,7 @@ class _WalletSummaryInfoState extends State<WalletSummaryInfo> {
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
FittedBox(
|
FittedBox(
|
||||||
fit: BoxFit.scaleDown,
|
fit: BoxFit.scaleDown,
|
||||||
child: Text(
|
child: SelectableText(
|
||||||
"${Format.localizedStringAsFixed(
|
"${Format.localizedStringAsFixed(
|
||||||
value: balanceToShow,
|
value: balanceToShow,
|
||||||
locale: locale,
|
locale: locale,
|
||||||
|
|
|
@ -38,7 +38,7 @@ abstract class Constants {
|
||||||
// Enable Logger.print statements
|
// Enable Logger.print statements
|
||||||
static const bool disableLogger = false;
|
static const bool disableLogger = false;
|
||||||
|
|
||||||
static const int currentHiveDbVersion = 3;
|
static const int currentHiveDbVersion = 4;
|
||||||
|
|
||||||
static int satsPerCoin(Coin coin) {
|
static int satsPerCoin(Coin coin) {
|
||||||
switch (coin) {
|
switch (coin) {
|
||||||
|
|
|
@ -141,6 +141,7 @@ class DbVersionMigrator {
|
||||||
|
|
||||||
// try to continue migrating
|
// try to continue migrating
|
||||||
return await migrate(2, secureStore: secureStore);
|
return await migrate(2, secureStore: secureStore);
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
await Hive.openBox<dynamic>(DB.boxNamePrefs);
|
await Hive.openBox<dynamic>(DB.boxNamePrefs);
|
||||||
final prefs = Prefs.instance;
|
final prefs = Prefs.instance;
|
||||||
|
@ -154,6 +155,20 @@ class DbVersionMigrator {
|
||||||
boxName: DB.boxNameDBInfo, key: "hive_data_version", value: 3);
|
boxName: DB.boxNameDBInfo, key: "hive_data_version", value: 3);
|
||||||
return await migrate(3, secureStore: secureStore);
|
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:
|
default:
|
||||||
// finally return
|
// finally return
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue