diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart index 2fae2352c..58e51b34e 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart @@ -48,6 +48,7 @@ import '../../../wallets/isar/models/wallet_info.dart'; import '../../../wallets/wallet/impl/epiccash_wallet.dart'; import '../../../wallets/wallet/impl/monero_wallet.dart'; import '../../../wallets/wallet/impl/wownero_wallet.dart'; +import '../../../wallets/wallet/intermediate/lib_monero_wallet.dart'; import '../../../wallets/wallet/supporting/epiccash_wallet_info_extension.dart'; import '../../../wallets/wallet/wallet.dart'; import '../../../widgets/custom_buttons/app_bar_icon_button.dart'; @@ -369,6 +370,10 @@ class _RestoreWalletViewState extends ConsumerState { await wallet.recover(isRescan: false); + if (wallet is LibMoneroWallet) { + await wallet.exit(); + } + // check if state is still active before continuing if (mounted) { await wallet.info.setMnemonicVerified( diff --git a/lib/wallets/crypto_currency/coins/monero.dart b/lib/wallets/crypto_currency/coins/monero.dart index 7e0347775..4cbeeeb68 100644 --- a/lib/wallets/crypto_currency/coins/monero.dart +++ b/lib/wallets/crypto_currency/coins/monero.dart @@ -49,6 +49,9 @@ class Monero extends CryptonoteCurrency { @override bool validateAddress(String address) { + if (address.contains("111")) { + return false; + } switch (network) { case CryptoCurrencyNetwork.main: return xmr_wallet_ffi.validateAddress(address, 0); diff --git a/lib/wallets/crypto_currency/coins/wownero.dart b/lib/wallets/crypto_currency/coins/wownero.dart index e043fdd7b..2aea90aa8 100644 --- a/lib/wallets/crypto_currency/coins/wownero.dart +++ b/lib/wallets/crypto_currency/coins/wownero.dart @@ -49,6 +49,9 @@ class Wownero extends CryptonoteCurrency { @override bool validateAddress(String address) { + if (address.contains("111")) { + return false; + } switch (network) { case CryptoCurrencyNetwork.main: return wow_wallet_ffi.validateAddress(address, 0); @@ -82,7 +85,7 @@ class Wownero extends CryptonoteCurrency { } @override - int get defaultSeedPhraseLength => 14; + int get defaultSeedPhraseLength => 16; //14; @override int get fractionDigits => 11; @@ -94,7 +97,7 @@ class Wownero extends CryptonoteCurrency { bool get hasMnemonicPassphraseSupport => false; @override - List get possibleMnemonicLengths => [defaultSeedPhraseLength, 16, 25]; + List get possibleMnemonicLengths => [defaultSeedPhraseLength, 25]; @override BigInt get satsPerCoin => BigInt.from(100000000000); diff --git a/lib/wallets/wallet/impl/wownero_wallet.dart b/lib/wallets/wallet/impl/wownero_wallet.dart index 8df6de1d0..09a9d4c5d 100644 --- a/lib/wallets/wallet/impl/wownero_wallet.dart +++ b/lib/wallets/wallet/impl/wownero_wallet.dart @@ -115,10 +115,6 @@ class WowneroWallet extends LibMoneroWallet { }) async { final lib_monero.WowneroSeedType type; switch (wordCount) { - case 14: - type = lib_monero.WowneroSeedType.fourteen; - break; - case 16: type = lib_monero.WowneroSeedType.sixteen; break; @@ -171,7 +167,7 @@ class WowneroWallet extends LibMoneroWallet { @override void invalidSeedLengthCheck(int length) { - if (!(length == 14 || length == 16 || length == 25)) { + if (!(length == 16 || length == 25)) { throw Exception("Invalid wownero mnemonic length found: $length"); } } diff --git a/lib/wallets/wallet/intermediate/lib_monero_wallet.dart b/lib/wallets/wallet/intermediate/lib_monero_wallet.dart index e515a570f..4301de24c 100644 --- a/lib/wallets/wallet/intermediate/lib_monero_wallet.dart +++ b/lib/wallets/wallet/intermediate/lib_monero_wallet.dart @@ -272,6 +272,10 @@ abstract class LibMoneroWallet addressIndex: index, ); + if (address.value.contains("111")) { + throw Exception("111 address found!"); + } + final newReceivingAddress = Address( walletId: walletId, derivationIndex: index, diff --git a/pubspec.lock b/pubspec.lock index a973ef92f..9b55c770b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -435,10 +435,10 @@ packages: dependency: "direct main" description: name: cs_monero - sha256: b9b9db6602361587b1ce512002f174fd833818ff2a63787c3058e0532fc0d9d8 + sha256: "8b2c1451d8eb09fc2a1248ecd652f2332343946a1d622b2f623b74d5f999c8d5" url: "https://pub.dev" source: hosted - version: "1.0.0-pre" + version: "1.0.0-pre.1" cs_monero_flutter_libs: dependency: "direct main" description: diff --git a/scripts/app_config/templates/pubspec.template b/scripts/app_config/templates/pubspec.template index 862731c6e..9b4541240 100644 --- a/scripts/app_config/templates/pubspec.template +++ b/scripts/app_config/templates/pubspec.template @@ -195,7 +195,7 @@ dependencies: blockchain_utils: ^3.3.0 on_chain: ^4.0.1 cbor: ^6.3.3 - cs_monero: 1.0.0-pre + cs_monero: 1.0.0-pre.1 cs_monero_flutter_libs: 1.0.0-pre.0 dev_dependencies: