mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-02-02 03:06:29 +00:00
fix eth token balance not updating
This commit is contained in:
parent
15a43899c4
commit
7bb8948d73
2 changed files with 12 additions and 7 deletions
|
@ -75,9 +75,8 @@ class TokenWalletInfo implements IsarId {
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
await isar.writeTxn(() async {
|
await isar.writeTxn(() async {
|
||||||
await isar.tokenWalletInfo.deleteByWalletIdTokenAddress(
|
await isar.tokenWalletInfo.delete(
|
||||||
walletId,
|
thisEntry.id,
|
||||||
tokenAddress,
|
|
||||||
);
|
);
|
||||||
await isar.tokenWalletInfo.put(
|
await isar.tokenWalletInfo.put(
|
||||||
TokenWalletInfo(
|
TokenWalletInfo(
|
||||||
|
@ -85,7 +84,7 @@ class TokenWalletInfo implements IsarId {
|
||||||
tokenAddress: tokenAddress,
|
tokenAddress: tokenAddress,
|
||||||
tokenFractionDigits: tokenFractionDigits,
|
tokenFractionDigits: tokenFractionDigits,
|
||||||
cachedBalanceJsonString: balance.toJsonIgnoreCoin(),
|
cachedBalanceJsonString: balance.toJsonIgnoreCoin(),
|
||||||
),
|
)..id = thisEntry.id,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,8 +116,14 @@ class EthereumWallet extends Bip39Wallet with PrivateKeyInterface {
|
||||||
FilterGroup.and(standardReceivingAddressFilters);
|
FilterGroup.and(standardReceivingAddressFilters);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> init({bool? isRestore}) {
|
Future<void> init({bool? isRestore}) async {
|
||||||
// TODO: implement init
|
final address = await getCurrentReceivingAddress();
|
||||||
|
if (address == null) {
|
||||||
|
await _generateAndSaveAddress(
|
||||||
|
await getMnemonic(),
|
||||||
|
await getMnemonicPassphrase(),
|
||||||
|
);
|
||||||
|
}
|
||||||
return super.init();
|
return super.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,7 +211,7 @@ class EthereumWallet extends Bip39Wallet with PrivateKeyInterface {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> updateTransactions({bool isRescan = false}) async {
|
Future<void> updateTransactions({bool isRescan = false}) async {
|
||||||
String thisAddress = (await getCurrentReceivingAddress())!.value;
|
final thisAddress = (await getCurrentReceivingAddress())!.value;
|
||||||
|
|
||||||
int firstBlock = 0;
|
int firstBlock = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue