mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-22 10:45:08 +00:00
fixes from comments
This commit is contained in:
parent
e42cc3febe
commit
355d990df0
4 changed files with 5 additions and 9 deletions
|
@ -30,7 +30,6 @@ List<Transaction> getAllTransactions() {
|
||||||
return List.generate(size, (index) => Transaction(txInfo: monero.TransactionHistory_transaction(txhistory!, index: index)));
|
return List.generate(size, (index) => Transaction(txInfo: monero.TransactionHistory_transaction(txhistory!, index: index)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(mrcyjanek): ...
|
|
||||||
Transaction getTransaction(String txId) {
|
Transaction getTransaction(String txId) {
|
||||||
return Transaction(txInfo: monero.TransactionHistory_transactionById(txhistory!, txid: txId));
|
return Transaction(txInfo: monero.TransactionHistory_transactionById(txhistory!, txid: txId));
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ String getSeed() {
|
||||||
return legacy;
|
return legacy;
|
||||||
}
|
}
|
||||||
|
|
||||||
String getAddress({int accountIndex = 0, int addressIndex = 1}) =>
|
String getAddress({int accountIndex = 0, int addressIndex = 0}) =>
|
||||||
monero.Wallet_address(wptr!,
|
monero.Wallet_address(wptr!,
|
||||||
accountIndex: accountIndex, addressIndex: addressIndex);
|
accountIndex: accountIndex, addressIndex: addressIndex);
|
||||||
|
|
||||||
|
@ -103,9 +103,6 @@ void startRefreshSync() {
|
||||||
monero.Wallet_startRefresh(wptr!);
|
monero.Wallet_startRefresh(wptr!);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> connectToNode() async {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setRefreshFromBlockHeight({required int height}) =>
|
void setRefreshFromBlockHeight({required int height}) =>
|
||||||
monero.Wallet_setRefreshFromBlockHeight(wptr!,
|
monero.Wallet_setRefreshFromBlockHeight(wptr!,
|
||||||
|
@ -118,7 +115,7 @@ final storeMutex = Mutex();
|
||||||
void storeSync() async {
|
void storeSync() async {
|
||||||
await storeMutex.acquire();
|
await storeMutex.acquire();
|
||||||
final addr = wptr!.address;
|
final addr = wptr!.address;
|
||||||
Isolate.run(() {
|
await Isolate.run(() {
|
||||||
monero.Wallet_store(Pointer.fromAddress(addr));
|
monero.Wallet_store(Pointer.fromAddress(addr));
|
||||||
});
|
});
|
||||||
storeMutex.release();
|
storeMutex.release();
|
||||||
|
|
|
@ -268,7 +268,7 @@ void _restoreFromSpendKey(Map<String, dynamic> args) {
|
||||||
Future<void> _openWallet(Map<String, String> args) async => loadWallet(
|
Future<void> _openWallet(Map<String, String> args) async => loadWallet(
|
||||||
path: args['path'] as String, password: args['password'] as String);
|
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(
|
void openWallet(
|
||||||
{required String path,
|
{required String path,
|
||||||
|
@ -343,4 +343,4 @@ Future<void> restoreFromSpendKey(
|
||||||
'restoreHeight': restoreHeight
|
'restoreHeight': restoreHeight
|
||||||
});
|
});
|
||||||
|
|
||||||
Future<bool> isWalletExist({required String path}) => _isWalletExist(path);
|
bool isWalletExist({required String path}) => _isWalletExist(path);
|
||||||
|
|
|
@ -452,7 +452,7 @@ abstract class MoneroWalletBase
|
||||||
monero.CoinsInfo_unlocked(coin),
|
monero.CoinsInfo_unlocked(coin),
|
||||||
);
|
);
|
||||||
if (unspent.hash.isNotEmpty) {
|
if (unspent.hash.isNotEmpty) {
|
||||||
unspent.isChange = transaction_history.getTransaction(unspent.hash) == 1;
|
unspent.isChange = transaction_history.getTransaction(unspent.hash).isSpend == true;
|
||||||
}
|
}
|
||||||
unspentCoins.add(unspent);
|
unspentCoins.add(unspent);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue