mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-04-17 19:51:58 +00:00
updated rust logging method, added mnemonic word validation for Xelis
This commit is contained in:
parent
0f7e44fadd
commit
4feb14c7da
2 changed files with 10 additions and 3 deletions
lib
|
@ -82,9 +82,9 @@ final openedFromSWBFileStringStateProvider =
|
|||
|
||||
void startListeningToRustLogs() {
|
||||
xelis_api.createLogStream().listen((logEntry) {
|
||||
print("[Rust Log] [${logEntry.level}] ${logEntry.tag}: ${logEntry.msg}");
|
||||
Logging.instance.i("[Rust Log] [${logEntry.level}] ${logEntry.tag}: ${logEntry.msg}");
|
||||
}, onError: (e) {
|
||||
print("Error receiving Rust logs: $e");
|
||||
Logging.instance.e("Error receiving Rust logs: $e");
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,8 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:wakelock_plus/wakelock_plus.dart';
|
||||
|
||||
import 'package:xelis_flutter/src/api/seed_search_engine.dart' as x_seed;
|
||||
|
||||
import '../../../notifications/show_flush_bar.dart';
|
||||
import '../../../pages_desktop_specific/desktop_home_view.dart';
|
||||
import '../../../pages_desktop_specific/my_stack_view/exit_to_my_stack_button.dart';
|
||||
|
@ -104,6 +106,7 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
|
|||
late final int _seedWordCount;
|
||||
late final bool isDesktop;
|
||||
|
||||
x_seed.SearchEngine? _xelisSeedSearch;
|
||||
final HashSet<String> _wordListHashSet = HashSet.from(bip39wordlist.WORDLIST);
|
||||
final ScrollController controller = ScrollController();
|
||||
|
||||
|
@ -168,6 +171,10 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
|
|||
// _focusNodes.add(FocusNode());
|
||||
}
|
||||
|
||||
if (widget.coin is Xelis) {
|
||||
_xelisSeedSearch = x_seed.SearchEngine.init(languageIndex: BigInt.from(0));
|
||||
}
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
||||
|
@ -202,7 +209,7 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
|
|||
}
|
||||
// TODO: use Xelis word list
|
||||
if (widget.coin is Xelis) {
|
||||
return true;
|
||||
return _xelisSeedSearch!.search(query: word).length > 0;
|
||||
}
|
||||
return _wordListHashSet.contains(word);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue