use async code

This commit is contained in:
Czarek Nakamoto 2024-12-15 10:00:33 -05:00
parent ca2c16acf0
commit 13b608495b

View file

@ -557,7 +557,7 @@ abstract class WowneroWalletBase
@override @override
Future<Map<String, WowneroTransactionInfo>> fetchTransactions() async { Future<Map<String, WowneroTransactionInfo>> fetchTransactions() async {
transaction_history.refreshTransactions(); transaction_history.refreshTransactions();
return _getAllTransactionsOfAccount(walletAddresses.account?.id) return (await _getAllTransactionsOfAccount(walletAddresses.account?.id))
.fold<Map<String, WowneroTransactionInfo>>(<String, WowneroTransactionInfo>{}, .fold<Map<String, WowneroTransactionInfo>>(<String, WowneroTransactionInfo>{},
(Map<String, WowneroTransactionInfo> acc, WowneroTransactionInfo tx) { (Map<String, WowneroTransactionInfo> acc, WowneroTransactionInfo tx) {
acc[tx.id] = tx; acc[tx.id] = tx;
@ -586,9 +586,9 @@ abstract class WowneroWalletBase
String getSubaddressLabel(int accountIndex, int addressIndex) => String getSubaddressLabel(int accountIndex, int addressIndex) =>
wownero_wallet.getSubaddressLabel(accountIndex, addressIndex); wownero_wallet.getSubaddressLabel(accountIndex, addressIndex);
List<WowneroTransactionInfo> _getAllTransactionsOfAccount(int? accountIndex) => Future<List<WowneroTransactionInfo>> _getAllTransactionsOfAccount(int? accountIndex) async =>
transaction_history (await transaction_history
.getAllTransactions() .getAllTransactions())
.map( .map(
(row) => WowneroTransactionInfo( (row) => WowneroTransactionInfo(
row.hash, row.hash,