mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00:00
v4.24.0 (#2102)
* - Add Decred Wallet - Remove Haven Wallet - Fix and Improve Solana Wallet - Improve app usability and user experience - User interface enhancements - Bug fixes * Release candidate feedback fixes * Release candidate feedback fixes * update release notes [skip ci] * fix iOS stupidity [skip ci] * minor fix * decred: Do not create log file. (#2106) (#2107) Co-authored-by: JoeGruffins <34998433+JoeGruffins@users.noreply.github.com> * fix Monero HWW * fix Monero view only wallet * fix background sync for hardware and viewonly wallets * check for status on correct wptr * minor fixes [skip ci] --------- Co-authored-by: JoeGruffins <34998433+JoeGruffins@users.noreply.github.com> Co-authored-by: Czarek Nakamoto <cyjan@mrcyjanek.net>
This commit is contained in:
parent
13dc6de8dd
commit
0aa563ead7
60 changed files with 304 additions and 290 deletions
|
@ -89,11 +89,7 @@ void createWalletSync(
|
|||
throw WalletCreationException(message: monero.Wallet_errorString(newWptr));
|
||||
}
|
||||
|
||||
monero.Wallet_setupBackgroundSync(newWptr, backgroundSyncType: 2, walletPassword: password, backgroundCachePassword: '');
|
||||
status = monero.Wallet_status(newWptr);
|
||||
if (status != 0) {
|
||||
throw WalletCreationException(message: monero.Wallet_errorString(newWptr));
|
||||
}
|
||||
setupBackgroundSync(password, newWptr);
|
||||
|
||||
wptr = newWptr;
|
||||
monero.Wallet_setCacheAttribute(wptr!, key: "cakewallet.passphrase", value: passphrase);
|
||||
|
@ -186,13 +182,6 @@ void restoreWalletFromKeysSync(
|
|||
message: monero.Wallet_errorString(newWptr));
|
||||
}
|
||||
|
||||
|
||||
monero.Wallet_setupBackgroundSync(newWptr, backgroundSyncType: 2, walletPassword: password, backgroundCachePassword: '');
|
||||
status = monero.Wallet_status(newWptr);
|
||||
if (status != 0) {
|
||||
throw WalletCreationException(message: monero.Wallet_errorString(newWptr));
|
||||
}
|
||||
|
||||
// CW-712 - Try to restore deterministic wallet first, if the view key doesn't
|
||||
// match the view key provided
|
||||
if (spendKey != "") {
|
||||
|
@ -216,12 +205,8 @@ void restoreWalletFromKeysSync(
|
|||
throw WalletRestoreFromKeysException(
|
||||
message: monero.Wallet_errorString(newWptr));
|
||||
}
|
||||
|
||||
monero.Wallet_setupBackgroundSync(newWptr, backgroundSyncType: 2, walletPassword: password, backgroundCachePassword: '');
|
||||
status = monero.Wallet_status(newWptr);
|
||||
if (status != 0) {
|
||||
throw WalletCreationException(message: monero.Wallet_errorString(newWptr));
|
||||
}
|
||||
|
||||
setupBackgroundSync(password, newWptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -267,12 +252,8 @@ void restoreWalletFromPolyseedWithOffset(
|
|||
monero.Wallet_setCacheAttribute(wptr!, key: "cakewallet.seed", value: seed);
|
||||
monero.Wallet_setCacheAttribute(wptr!, key: "cakewallet.passphrase", value: seedOffset);
|
||||
monero.Wallet_store(wptr!);
|
||||
|
||||
monero.Wallet_setupBackgroundSync(newWptr, backgroundSyncType: 2, walletPassword: password, backgroundCachePassword: '');
|
||||
status = monero.Wallet_status(newWptr);
|
||||
if (status != 0) {
|
||||
throw WalletCreationException(message: monero.Wallet_errorString(newWptr));
|
||||
}
|
||||
|
||||
setupBackgroundSync(password, newWptr);
|
||||
storeSync();
|
||||
|
||||
openedWalletsByPath[path] = wptr!;
|
||||
|
@ -323,12 +304,8 @@ void restoreWalletFromSpendKeySync(
|
|||
monero.Wallet_setCacheAttribute(wptr!, key: "cakewallet.seed", value: seed);
|
||||
|
||||
storeSync();
|
||||
|
||||
monero.Wallet_setupBackgroundSync(newWptr, backgroundSyncType: 2, walletPassword: password, backgroundCachePassword: '');
|
||||
status = monero.Wallet_status(newWptr);
|
||||
if (status != 0) {
|
||||
throw WalletCreationException(message: monero.Wallet_errorString(newWptr));
|
||||
}
|
||||
|
||||
setupBackgroundSync(password, newWptr);
|
||||
|
||||
openedWalletsByPath[path] = wptr!;
|
||||
_lastOpenedWallet = path;
|
||||
|
@ -361,13 +338,6 @@ Future<void> restoreWalletFromHardwareWallet(
|
|||
throw WalletRestoreFromSeedException(message: error);
|
||||
}
|
||||
|
||||
// TODO: Check with upstream if we can use background sync here
|
||||
// monero.Wallet_setupBackgroundSync(newWptr, backgroundSyncType: 2, walletPassword: password, backgroundCachePassword: '');
|
||||
// status = monero.Wallet_status(newWptr);
|
||||
// if (status != 0) {
|
||||
// throw WalletCreationException(message: monero.Wallet_errorString(newWptr));
|
||||
// }
|
||||
|
||||
wptr = newWptr;
|
||||
_lastOpenedWallet = path;
|
||||
openedWalletsByPath[path] = wptr!;
|
||||
|
@ -437,12 +407,8 @@ Future<void> loadWallet(
|
|||
printV("loadWallet:"+err);
|
||||
throw WalletOpeningException(message: err);
|
||||
}
|
||||
monero.Wallet_setupBackgroundSync(newWptr, backgroundSyncType: 2, walletPassword: password, backgroundCachePassword: '');
|
||||
status = monero.Wallet_status(newWptr);
|
||||
if (status != 0) {
|
||||
final err = monero.Wallet_errorString(newWptr);
|
||||
printV("loadWallet:"+err);
|
||||
throw WalletOpeningException(message: err);
|
||||
if (deviceType == 0) {
|
||||
setupBackgroundSync(password, newWptr);
|
||||
}
|
||||
|
||||
wptr = newWptr;
|
||||
|
@ -451,6 +417,17 @@ Future<void> loadWallet(
|
|||
}
|
||||
}
|
||||
|
||||
void setupBackgroundSync(String password, Pointer<Void>? wptrOverride) {
|
||||
if (isViewOnlyBySpendKey(wptrOverride)) {
|
||||
return;
|
||||
}
|
||||
monero.Wallet_setupBackgroundSync(wptrOverride ?? wptr!, backgroundSyncType: 2, walletPassword: password, backgroundCachePassword: '');
|
||||
if (monero.Wallet_status(wptrOverride ?? wptr!) != 0) {
|
||||
// We simply ignore the error.
|
||||
printV("setupBackgroundSync: ${monero.Wallet_errorString(wptrOverride ?? wptr!)}");
|
||||
}
|
||||
}
|
||||
|
||||
void _createWallet(Map<String, dynamic> args) {
|
||||
final path = args['path'] as String;
|
||||
final password = args['password'] as String;
|
||||
|
@ -591,4 +568,4 @@ Future<void> restoreFromSpendKey(
|
|||
|
||||
bool isWalletExist({required String path}) => _isWalletExist(path);
|
||||
|
||||
bool isViewOnlyBySpendKey() => int.tryParse(monero.Wallet_secretSpendKey(wptr!)) == 0;
|
||||
bool isViewOnlyBySpendKey(Pointer<Void>? wptrOverride) => int.tryParse(monero.Wallet_secretSpendKey(wptrOverride ?? wptr!)) == 0;
|
||||
|
|
|
@ -233,18 +233,14 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
|
|||
return;
|
||||
}
|
||||
isBackgroundSyncRunning = true;
|
||||
int status = monero.Wallet_status(wptr!);
|
||||
if (status != 0) {
|
||||
final err = monero.Wallet_errorString(wptr!);
|
||||
throw Exception("unable to setup background sync: $err");
|
||||
}
|
||||
await save();
|
||||
|
||||
monero.Wallet_startBackgroundSync(wptr!);
|
||||
status = monero.Wallet_status(wptr!);
|
||||
final status = monero.Wallet_status(wptr!);
|
||||
if (status != 0) {
|
||||
final err = monero.Wallet_errorString(wptr!);
|
||||
throw Exception("unable to start background sync: $err");
|
||||
isBackgroundSyncRunning = false;
|
||||
printV("startBackgroundSync: $err");
|
||||
}
|
||||
await save();
|
||||
await init();
|
||||
|
@ -260,9 +256,9 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
|
|||
printV("Stopping background sync");
|
||||
await save();
|
||||
monero.Wallet_stopBackgroundSync(wptr!, '');
|
||||
await save();
|
||||
isBackgroundSyncRunning = false;
|
||||
}
|
||||
await save();
|
||||
}
|
||||
|
||||
@action
|
||||
|
|
|
@ -29,10 +29,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: asn1lib
|
||||
sha256: "1c296cd268f486cabcc3930e9b93a8133169305f18d722916e675959a88f6d2c"
|
||||
sha256: "4bae5ae63e6d6dd17c4aac8086f3dec26c0236f6a0f03416c6c19d830c367cf5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.5.9"
|
||||
version: "1.5.8"
|
||||
async:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -78,18 +78,18 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: build_config
|
||||
sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33"
|
||||
sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.2"
|
||||
version: "1.1.1"
|
||||
build_daemon:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build_daemon
|
||||
sha256: "8e928697a82be082206edb0b9c99c5a4ad6bc31c9e9b8b2f291ae65cd4a25daa"
|
||||
sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.4"
|
||||
version: "4.0.2"
|
||||
build_resolvers:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
|
@ -384,10 +384,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: http_parser
|
||||
sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571"
|
||||
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.1.2"
|
||||
version: "4.0.2"
|
||||
intl:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -682,10 +682,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: pubspec_parse
|
||||
sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082"
|
||||
sha256: "81876843eb50dc2e1e5b151792c9a985c5ed2536914115ed04e9c8528f6647b0"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.5.0"
|
||||
version: "1.4.0"
|
||||
rational:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -706,10 +706,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: shelf
|
||||
sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12
|
||||
sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.4.2"
|
||||
version: "1.4.1"
|
||||
shelf_web_socket:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -924,5 +924,5 @@ packages:
|
|||
source: hosted
|
||||
version: "3.1.3"
|
||||
sdks:
|
||||
dart: ">=3.6.0 <4.0.0"
|
||||
dart: ">=3.5.0 <4.0.0"
|
||||
flutter: ">=3.24.0"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue