mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-22 10:34:32 +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 {
|
||||
await isar.writeTxn(() async {
|
||||
await isar.tokenWalletInfo.deleteByWalletIdTokenAddress(
|
||||
walletId,
|
||||
tokenAddress,
|
||||
await isar.tokenWalletInfo.delete(
|
||||
thisEntry.id,
|
||||
);
|
||||
await isar.tokenWalletInfo.put(
|
||||
TokenWalletInfo(
|
||||
|
@ -85,7 +84,7 @@ class TokenWalletInfo implements IsarId {
|
|||
tokenAddress: tokenAddress,
|
||||
tokenFractionDigits: tokenFractionDigits,
|
||||
cachedBalanceJsonString: balance.toJsonIgnoreCoin(),
|
||||
),
|
||||
)..id = thisEntry.id,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -116,8 +116,14 @@ class EthereumWallet extends Bip39Wallet with PrivateKeyInterface {
|
|||
FilterGroup.and(standardReceivingAddressFilters);
|
||||
|
||||
@override
|
||||
Future<void> init({bool? isRestore}) {
|
||||
// TODO: implement init
|
||||
Future<void> init({bool? isRestore}) async {
|
||||
final address = await getCurrentReceivingAddress();
|
||||
if (address == null) {
|
||||
await _generateAndSaveAddress(
|
||||
await getMnemonic(),
|
||||
await getMnemonicPassphrase(),
|
||||
);
|
||||
}
|
||||
return super.init();
|
||||
}
|
||||
|
||||
|
@ -205,7 +211,7 @@ class EthereumWallet extends Bip39Wallet with PrivateKeyInterface {
|
|||
|
||||
@override
|
||||
Future<void> updateTransactions({bool isRescan = false}) async {
|
||||
String thisAddress = (await getCurrentReceivingAddress())!.value;
|
||||
final thisAddress = (await getCurrentReceivingAddress())!.value;
|
||||
|
||||
int firstBlock = 0;
|
||||
|
||||
|
|
Loading…
Reference in a new issue