get appropriate WowneroWordList based on seed length

This commit is contained in:
sneurlax 2022-11-08 17:30:09 -06:00
parent 015f333269
commit c66e382fc3
2 changed files with 7 additions and 2 deletions

@ -1 +1 @@
Subproject commit 0b355aee55608f497ca54aba151d0b3e9e2c4579 Subproject commit e440e9a3a125ee2030551ad7dea9114dd6a06aa0

View file

@ -8,6 +8,7 @@ import 'package:bip39/src/wordlists/english.dart' as bip39wordlist;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_libmonero/monero/monero.dart'; import 'package:flutter_libmonero/monero/monero.dart';
import 'package:flutter_libmonero/wownero/wownero.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:stackwallet/notifications/show_flush_bar.dart'; import 'package:stackwallet/notifications/show_flush_bar.dart';
@ -149,13 +150,17 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
super.dispose(); super.dispose();
} }
// TODO: check for wownero wordlist?
bool _isValidMnemonicWord(String word) { bool _isValidMnemonicWord(String word) {
// TODO: get the actual language // TODO: get the actual language
if (widget.coin == Coin.monero) { if (widget.coin == Coin.monero) {
var moneroWordList = monero.getMoneroWordList("English"); var moneroWordList = monero.getMoneroWordList("English");
return moneroWordList.contains(word); return moneroWordList.contains(word);
} }
if (widget.coin == Coin.wownero) {
var wowneroWordList = wownero.getWowneroWordList("English",
seedWordsLength: widget.seedWordsLength);
return wowneroWordList.contains(word);
}
return _wordListHashSet.contains(word); return _wordListHashSet.contains(word);
} }