some small bug fixes

This commit is contained in:
julian 2023-01-12 16:07:15 -06:00
parent 8c67901c28
commit 7e6daad779
4 changed files with 9 additions and 9 deletions

View file

@ -945,6 +945,7 @@ class EpicCashWallet extends CoinServiceAPI
Logging.instance.log("Opening existing ${coin.prettyName} wallet",
level: LogLevel.Info);
await isarInit(walletId);
final config = await getRealConfig();
final password = await _secureStore.read(key: '${_walletId}_password');
@ -959,7 +960,6 @@ class EpicCashWallet extends CoinServiceAPI
}
await _prefs.init();
await updateNode(false);
await isarInit(walletId);
await _refreshBalance();
// TODO: is there anything else that should be set up here whenever this wallet is first loaded again?
}
@ -1015,6 +1015,8 @@ class EpicCashWallet extends CoinServiceAPI
String stringConfig = await getConfig();
String epicboxConfig = await getEpicBoxConfig();
await isarInit(walletId);
await _secureStore.write(
key: '${_walletId}_mnemonic', value: mnemonicString);
await _secureStore.write(key: '${_walletId}_config', value: stringConfig);
@ -1051,8 +1053,6 @@ class EpicCashWallet extends CoinServiceAPI
epicUpdateRestoreHeight(bufferedCreateHeight),
updateCachedIsFavorite(false),
]);
await isarInit(walletId);
}
bool refreshMutex = false;

View file

@ -1077,6 +1077,7 @@ class MoneroWallet extends CoinServiceAPI with WalletCache, WalletDB {
if (highestPercentCached < percent) {
highestPercentCached = percent;
}
await updateCachedChainHeight(height);
GlobalEventBus.instance.fire(
RefreshPercentChangedEvent(
@ -1206,8 +1207,7 @@ class MoneroWallet extends CoinServiceAPI with WalletCache, WalletDB {
);
@override
// TODO: implement storedChainHeight
int get storedChainHeight => throw UnimplementedError();
int get storedChainHeight => getCachedChainHeight();
@override
Balance get balance => _balance ??= getCachedBalance();

View file

@ -1146,6 +1146,7 @@ class WowneroWallet extends CoinServiceAPI with WalletCache, WalletDB {
if (highestPercentCached < percent) {
highestPercentCached = percent;
}
await updateCachedChainHeight(height);
GlobalEventBus.instance.fire(
RefreshPercentChangedEvent(
@ -1275,8 +1276,7 @@ class WowneroWallet extends CoinServiceAPI with WalletCache, WalletDB {
);
@override
// TODO: implement storedChainHeight
int get storedChainHeight => throw UnimplementedError();
int get storedChainHeight => getCachedChainHeight();
@override
Balance get balance => _balance ??= getCachedBalance();

View file

@ -85,7 +85,7 @@ mixin EpicCashHive {
// epic restore height
int? epicGetRestoreHeight() {
return DB.instance.get<dynamic>(boxName: _walletId, key: "restoreHeight")
as int;
as int?;
}
Future<void> epicUpdateRestoreHeight(int height) async {
@ -99,7 +99,7 @@ mixin EpicCashHive {
// epic creation height
int? epicGetCreationHeight() {
return DB.instance.get<dynamic>(boxName: _walletId, key: "creationHeight")
as int;
as int?;
}
Future<void> epicUpdateCreationHeight(int height) async {