fixes from comments

This commit is contained in:
cyan 2024-06-28 05:50:51 +00:00
parent e42cc3febe
commit 355d990df0
4 changed files with 5 additions and 9 deletions

View file

@ -30,7 +30,6 @@ List<Transaction> getAllTransactions() {
return List.generate(size, (index) => Transaction(txInfo: monero.TransactionHistory_transaction(txhistory!, index: index)));
}
// TODO(mrcyjanek): ...
Transaction getTransaction(String txId) {
return Transaction(txInfo: monero.TransactionHistory_transactionById(txhistory!, txid: txId));
}

View file

@ -43,7 +43,7 @@ String getSeed() {
return legacy;
}
String getAddress({int accountIndex = 0, int addressIndex = 1}) =>
String getAddress({int accountIndex = 0, int addressIndex = 0}) =>
monero.Wallet_address(wptr!,
accountIndex: accountIndex, addressIndex: addressIndex);
@ -103,9 +103,6 @@ void startRefreshSync() {
monero.Wallet_startRefresh(wptr!);
}
Future<bool> connectToNode() async {
return true;
}
void setRefreshFromBlockHeight({required int height}) =>
monero.Wallet_setRefreshFromBlockHeight(wptr!,
@ -118,7 +115,7 @@ final storeMutex = Mutex();
void storeSync() async {
await storeMutex.acquire();
final addr = wptr!.address;
Isolate.run(() {
await Isolate.run(() {
monero.Wallet_store(Pointer.fromAddress(addr));
});
storeMutex.release();

View file

@ -268,7 +268,7 @@ void _restoreFromSpendKey(Map<String, dynamic> args) {
Future<void> _openWallet(Map<String, String> args) async => loadWallet(
path: args['path'] as String, password: args['password'] as String);
Future<bool> _isWalletExist(String path) async => isWalletExistSync(path: path);
bool _isWalletExist(String path) => isWalletExistSync(path: path);
void openWallet(
{required String path,
@ -343,4 +343,4 @@ Future<void> restoreFromSpendKey(
'restoreHeight': restoreHeight
});
Future<bool> isWalletExist({required String path}) => _isWalletExist(path);
bool isWalletExist({required String path}) => _isWalletExist(path);

View file

@ -452,7 +452,7 @@ abstract class MoneroWalletBase
monero.CoinsInfo_unlocked(coin),
);
if (unspent.hash.isNotEmpty) {
unspent.isChange = transaction_history.getTransaction(unspent.hash) == 1;
unspent.isChange = transaction_history.getTransaction(unspent.hash).isSpend == true;
}
unspentCoins.add(unspent);
}