From 8acf84e22290d39025a3c02125b5c88044011266 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 17 Jan 2024 12:09:04 -0600 Subject: [PATCH] clean up unused code and mark old as deprecated --- lib/db/db_version_migration.dart | 12 +- lib/services/wallets_service.dart | 401 +----------------- .../lockscreen_view_screen_test.mocks.dart | 238 ++--------- .../main_view_screen_testA_test.mocks.dart | 195 +-------- .../main_view_screen_testB_test.mocks.dart | 195 +-------- .../main_view_screen_testC_test.mocks.dart | 195 +-------- ...up_key_warning_view_screen_test.mocks.dart | 187 +------- .../create_pin_view_screen_test.mocks.dart | 238 ++--------- ...me_your_wallet_view_screen_test.mocks.dart | 187 +------- ...restore_wallet_view_screen_test.mocks.dart | 238 ++--------- .../change_pin_view_screen_test.mocks.dart | 187 +------- .../rename_wallet_view_screen_test.mocks.dart | 187 +------- ...elete_mnemonic_view_screen_test.mocks.dart | 187 +------- ...allet_settings_view_screen_test.mocks.dart | 180 -------- .../settings_view_screen_test.mocks.dart | 187 +------- test/services/wallets_service_test.dart | 182 -------- test/services/wallets_service_test.mocks.dart | 145 ------- 17 files changed, 148 insertions(+), 3193 deletions(-) delete mode 100644 test/services/wallets_service_test.dart delete mode 100644 test/services/wallets_service_test.mocks.dart diff --git a/lib/db/db_version_migration.dart b/lib/db/db_version_migration.dart index a75d97959..21241f630 100644 --- a/lib/db/db_version_migration.dart +++ b/lib/db/db_version_migration.dart @@ -48,8 +48,7 @@ class DbVersionMigrator with WalletDB { case 0: await Hive.openBox(DB.boxNameAllWalletsData); await Hive.openBox(DB.boxNamePrefs); - final walletsService = - WalletsService(secureStorageInterface: secureStore); + final walletsService = WalletsService(); final nodeService = NodeService(secureStorageInterface: secureStore); final prefs = Prefs.instance; final walletInfoList = await walletsService.walletNames; @@ -304,8 +303,7 @@ class DbVersionMigrator with WalletDB { case 8: // migrate await Hive.openBox(DB.boxNameAllWalletsData); - final walletsService = - WalletsService(secureStorageInterface: secureStore); + final walletsService = WalletsService(); final walletInfoList = await walletsService.walletNames; await MainDB.instance.initMainDB(); for (final walletId in walletInfoList.keys) { @@ -374,7 +372,7 @@ class DbVersionMigrator with WalletDB { Future _v4(SecureStorageInterface secureStore) async { await Hive.openBox(DB.boxNameAllWalletsData); await Hive.openBox(DB.boxNamePrefs); - final walletsService = WalletsService(secureStorageInterface: secureStore); + final walletsService = WalletsService(); final prefs = Prefs.instance; final walletInfoList = await walletsService.walletNames; await prefs.init(); @@ -487,7 +485,7 @@ class DbVersionMigrator with WalletDB { Future _v7(SecureStorageInterface secureStore) async { await Hive.openBox(DB.boxNameAllWalletsData); - final walletsService = WalletsService(secureStorageInterface: secureStore); + final walletsService = WalletsService(); final walletInfoList = await walletsService.walletNames; await MainDB.instance.initMainDB(); @@ -573,7 +571,7 @@ class DbVersionMigrator with WalletDB { Future _v10(SecureStorageInterface secureStore) async { await Hive.openBox(DB.boxNameAllWalletsData); await Hive.openBox(DB.boxNamePrefs); - final walletsService = WalletsService(secureStorageInterface: secureStore); + final walletsService = WalletsService(); final prefs = Prefs.instance; final walletInfoList = await walletsService.walletNames; await prefs.init(); diff --git a/lib/services/wallets_service.dart b/lib/services/wallets_service.dart index 27bc4b95f..738c9d6c6 100644 --- a/lib/services/wallets_service.dart +++ b/lib/services/wallets_service.dart @@ -11,26 +11,24 @@ import 'dart:convert'; import 'package:flutter/material.dart'; -import 'package:flutter_libmonero/monero/monero.dart'; -import 'package:flutter_libmonero/wownero/wownero.dart'; import 'package:stackwallet/db/hive/db.dart'; -import 'package:stackwallet/db/isar/main_db.dart'; -import 'package:stackwallet/services/notifications_service.dart'; -import 'package:stackwallet/services/trade_sent_from_stack_service.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; -import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'; import 'package:stackwallet/utilities/logger.dart'; -import 'package:stackwallet/wallets/wallet/impl/epiccash_wallet.dart'; -import 'package:uuid/uuid.dart'; +@Deprecated("Legacy support only. Do not use.") class WalletInfo { final Coin coin; final String walletId; final String name; - const WalletInfo( - {required this.coin, required this.walletId, required this.name}); + @Deprecated("Legacy support only. Do not use.") + const WalletInfo({ + required this.coin, + required this.walletId, + required this.name, + }); + @Deprecated("Legacy support only. Do not use.") factory WalletInfo.fromJson(Map jsonObject) { return WalletInfo( coin: Coin.values.byName(jsonObject["coin"] as String), @@ -39,6 +37,7 @@ class WalletInfo { ); } + @Deprecated("Legacy support only. Do not use.") Map toMap() { return { "name": name, @@ -47,78 +46,30 @@ class WalletInfo { }; } + @Deprecated("Legacy support only. Do not use.") String toJsonString() { return jsonEncode(toMap()); } @override + @Deprecated("Legacy support only. Do not use.") String toString() { return "WalletInfo: ${toJsonString()}"; } } +@Deprecated("Legacy support only. Do not use.") class WalletsService extends ChangeNotifier { - late final SecureStorageInterface _secureStore; - + @Deprecated("Legacy support only. Do not use.") Future>? _walletNames; + @Deprecated("Legacy support only. Do not use.") Future> get walletNames => _walletNames ??= _fetchWalletNames(); - WalletsService({ - required SecureStorageInterface secureStorageInterface, - }) { - _secureStore = secureStorageInterface; - } - - // Future getWalletCryptoCurrency({required String walletName}) async { - // final id = await getWalletId(walletName); - // final currency = DB.instance.get( - // boxName: DB.boxNameAllWalletsData, key: "${id}_cryptoCurrency"); - // return Coin.values.byName(currency as String); - // } - - Future renameWallet({ - required String from, - required String to, - required bool shouldNotifyListeners, - }) async { - if (from == to) { - return true; - } - - final walletInfo = DB.instance - .get(boxName: DB.boxNameAllWalletsData, key: 'names') as Map; - - final info = walletInfo.values.firstWhere( - (element) => element['name'] == from, - orElse: () => {}) as Map; - - if (info.isEmpty) { - // tried to rename a non existing wallet - Logging.instance - .log("Tried to rename a non existing wallet!", level: LogLevel.Error); - return false; - } - - if (from != to && - (walletInfo.values.firstWhere((element) => element['name'] == to, - orElse: () => {}) as Map) - .isNotEmpty) { - // name already exists - Logging.instance.log("wallet with name \"$to\" already exists!", - level: LogLevel.Error); - return false; - } - - info["name"] = to; - walletInfo[info['id']] = info; - - await DB.instance.put( - boxName: DB.boxNameAllWalletsData, key: 'names', value: walletInfo); - await refreshWallets(shouldNotifyListeners); - return true; - } + @Deprecated("Legacy support only. Do not use.") + WalletsService(); + @Deprecated("Legacy support only. Do not use.") Future> _fetchWalletNames() async { final names = DB.instance .get(boxName: DB.boxNameAllWalletsData, key: 'names') as Map?; @@ -149,322 +100,4 @@ class WalletsService extends ChangeNotifier { return mapped.map((name, dyn) => MapEntry( name, WalletInfo.fromJson(Map.from(dyn as Map)))); } - - Map fetchWalletsData() { - final names = DB.instance.get( - boxName: DB.boxNameAllWalletsData, key: 'names') as Map? ?? - {}; - - Logging.instance.log("Fetched wallet names: $names", level: LogLevel.Info); - final mapped = Map.from(names); - mapped.removeWhere((name, dyn) { - final jsonObject = Map.from(dyn as Map); - try { - Coin.values.byName(jsonObject["coin"] as String); - return false; - } catch (e, s) { - Logging.instance.log("Error, ${jsonObject["coin"]} does not exist", - level: LogLevel.Error); - return true; - } - }); - - return mapped.map((name, dyn) => MapEntry( - name, WalletInfo.fromJson(Map.from(dyn as Map)))); - } - - Future addExistingStackWallet({ - required String name, - required String walletId, - required Coin coin, - required bool shouldNotifyListeners, - }) async { - final _names = DB.instance - .get(boxName: DB.boxNameAllWalletsData, key: 'names') as Map?; - - Map names; - if (_names == null) { - names = {}; - } else { - names = Map.from(_names); - } - - if (names.keys.contains(walletId)) { - throw Exception("Wallet with walletId \"$walletId\" already exists!"); - } - if (names.values.where((element) => element['name'] == name).isNotEmpty) { - throw Exception("Wallet with name \"$name\" already exists!"); - } - - names[walletId] = { - "id": walletId, - "coin": coin.name, - "name": name, - }; - - await DB.instance.put( - boxName: DB.boxNameAllWalletsData, key: 'names', value: names); - await DB.instance.put( - boxName: DB.boxNameAllWalletsData, - key: "${walletId}_cryptoCurrency", - value: coin.name); - await DB.instance.put( - boxName: DB.boxNameAllWalletsData, - key: "${walletId}_mnemonicHasBeenVerified", - value: false); - await DB.instance.addWalletBox(walletId: walletId); - await refreshWallets(shouldNotifyListeners); - } - - /// returns the new walletId if successful, otherwise null - Future addNewWallet({ - required String name, - required Coin coin, - required bool shouldNotifyListeners, - }) async { - final _names = DB.instance - .get(boxName: DB.boxNameAllWalletsData, key: 'names') as Map?; - - Map names; - if (_names == null) { - names = {}; - } else { - names = Map.from(_names); - } - - // Prevent overwriting or storing empty names - if (name.isEmpty || - names.values.where((element) => element['name'] == name).isNotEmpty) { - return null; - } - - final id = const Uuid().v1(); - names[id] = { - "id": id, - "coin": coin.name, - "name": name, - }; - - await DB.instance.put( - boxName: DB.boxNameAllWalletsData, key: 'names', value: names); - await DB.instance.put( - boxName: DB.boxNameAllWalletsData, - key: "${id}_cryptoCurrency", - value: coin.name); - await DB.instance.put( - boxName: DB.boxNameAllWalletsData, - key: "${id}_mnemonicHasBeenVerified", - value: false); - await DB.instance.addWalletBox(walletId: id); - await refreshWallets(shouldNotifyListeners); - return id; - } - - Future> getFavoriteWalletIds() async { - return DB.instance - .values(boxName: DB.boxNameFavoriteWallets) - .toList(); - } - - Future saveFavoriteWalletIds(List walletIds) async { - await DB.instance.deleteAll(boxName: DB.boxNameFavoriteWallets); - await DB.instance - .addAll(boxName: DB.boxNameFavoriteWallets, values: walletIds); - //todo: check if print needed - // debugPrint("saveFavoriteWalletIds list: $walletIds"); - } - - Future addFavorite(String walletId) async { - final list = await getFavoriteWalletIds(); - if (!list.contains(walletId)) { - list.add(walletId); - } - await saveFavoriteWalletIds(list); - } - - Future removeFavorite(String walletId) async { - final list = await getFavoriteWalletIds(); - list.remove(walletId); - await saveFavoriteWalletIds(list); - } - - Future moveFavorite({ - required int fromIndex, - required int toIndex, - }) async { - final list = await getFavoriteWalletIds(); - if (fromIndex < toIndex) { - toIndex -= 1; - } - final walletId = list.removeAt(fromIndex); - list.insert(toIndex, walletId); - await saveFavoriteWalletIds(list); - } - - Future checkForDuplicate(String name) async { - final names = DB.instance - .get(boxName: DB.boxNameAllWalletsData, key: 'names') as Map?; - if (names == null) return false; - - return names.values.where((element) => element['name'] == name).isNotEmpty; - } - - Future getWalletId(String walletName) async { - final names = DB.instance - .get(boxName: DB.boxNameAllWalletsData, key: 'names') as Map; - final shells = - names.values.where((element) => element['name'] == walletName); - if (shells.isEmpty) { - return null; - } - return shells.first["id"] as String; - } - - Future isMnemonicVerified({required String walletId}) async { - final isVerified = DB.instance.get( - boxName: DB.boxNameAllWalletsData, - key: "${walletId}_mnemonicHasBeenVerified") as bool?; - - if (isVerified == null) { - Logging.instance.log( - "isMnemonicVerified(walletId: $walletId) returned null which should never happen!", - level: LogLevel.Error, - ); - throw Exception( - "isMnemonicVerified(walletId: $walletId) returned null which should never happen!"); - } else { - return isVerified; - } - } - - Future setMnemonicVerified({required String walletId}) async { - final isVerified = DB.instance.get( - boxName: DB.boxNameAllWalletsData, - key: "${walletId}_mnemonicHasBeenVerified") as bool?; - - if (isVerified == null) { - Logging.instance.log( - "setMnemonicVerified(walletId: $walletId) tried running on non existent wallet!", - level: LogLevel.Error, - ); - throw Exception( - "setMnemonicVerified(walletId: $walletId) tried running on non existent wallet!"); - } else if (isVerified) { - Logging.instance.log( - "setMnemonicVerified(walletId: $walletId) tried running on already verified wallet!", - level: LogLevel.Error, - ); - throw Exception( - "setMnemonicVerified(walletId: $walletId) tried running on already verified wallet!"); - } else { - await DB.instance.put( - boxName: DB.boxNameAllWalletsData, - key: "${walletId}_mnemonicHasBeenVerified", - value: true); - Logging.instance.log( - "setMnemonicVerified(walletId: $walletId) successful", - level: LogLevel.Error, - ); - } - } - - // pin + mnemonic as well as anything else in secureStore - Future deleteWallet(String name, bool shouldNotifyListeners) async { - final names = DB.instance.get( - boxName: DB.boxNameAllWalletsData, key: 'names') as Map? ?? - {}; - - final walletId = await getWalletId(name); - if (walletId == null) { - return 3; - } - - Logging.instance.log( - "deleteWallet called with name=$name and id=$walletId", - level: LogLevel.Warning, - ); - - final shell = names.remove(walletId); - - if (shell == null) { - return 0; - } - - // TODO delete derivations!!! - await _secureStore.delete(key: "${walletId}_pin"); - await _secureStore.delete(key: "${walletId}_mnemonic"); - - await DB.instance.delete( - boxName: DB.boxNameAllWalletsData, key: "${walletId}_cryptoCurrency"); - await DB.instance.delete( - boxName: DB.boxNameAllWalletsData, - key: "${walletId}_mnemonicHasBeenVerified"); - if (coinFromPrettyName(shell['coin'] as String) == Coin.wownero) { - final wowService = - wownero.createWowneroWalletService(DB.instance.moneroWalletInfoBox); - await wowService.remove(walletId); - Logging.instance - .log("monero wallet: $walletId deleted", level: LogLevel.Info); - } else if (coinFromPrettyName(shell['coin'] as String) == Coin.monero) { - final xmrService = - monero.createMoneroWalletService(DB.instance.moneroWalletInfoBox); - await xmrService.remove(walletId); - Logging.instance - .log("monero wallet: $walletId deleted", level: LogLevel.Info); - } else if (coinFromPrettyName(shell['coin'] as String) == Coin.epicCash) { - final deleteResult = - await deleteEpicWallet(walletId: walletId, secureStore: _secureStore); - Logging.instance.log( - "epic wallet: $walletId deleted with result: $deleteResult", - level: LogLevel.Info); - } - - // delete wallet data in main db - await MainDB.instance.deleteWalletBlockchainData(walletId); - await MainDB.instance.deleteAddressLabels(walletId); - await MainDB.instance.deleteTransactionNotes(walletId); - - // box data may currently still be read/written to if wallet was refreshing - // when delete was requested so instead of deleting now we mark the wallet - // as needs delete by adding it's id to a list which gets checked on app start - await DB.instance.add( - boxName: DB.boxNameWalletsToDeleteOnStart, value: walletId); - - final lookupService = TradeSentFromStackService(); - for (final lookup in lookupService.all) { - if (lookup.walletIds.contains(walletId)) { - // update lookup data to reflect deleted wallet - await lookupService.save( - tradeWalletLookup: lookup.copyWith( - walletIds: lookup.walletIds.where((id) => id != walletId).toList(), - ), - ); - } - } - - // delete notifications tied to deleted wallet - for (final notification in NotificationsService.instance.notifications) { - if (notification.walletId == walletId) { - await NotificationsService.instance.delete(notification, false); - } - } - - if (names.isEmpty) { - await DB.instance.deleteAll(boxName: DB.boxNameAllWalletsData); - _walletNames = Future(() => {}); - notifyListeners(); - return 2; // error code no wallets on device - } - - await DB.instance.put( - boxName: DB.boxNameAllWalletsData, key: 'names', value: names); - await refreshWallets(shouldNotifyListeners); - return 0; - } - - Future refreshWallets(bool shouldNotifyListeners) async { - final newNames = await _fetchWalletNames(); - _walletNames = Future(() => newNames); - if (shouldNotifyListeners) notifyListeners(); - } } diff --git a/test/screen_tests/lockscreen_view_screen_test.mocks.dart b/test/screen_tests/lockscreen_view_screen_test.mocks.dart index e813e7614..0a4b9c09d 100644 --- a/test/screen_tests/lockscreen_view_screen_test.mocks.dart +++ b/test/screen_tests/lockscreen_view_screen_test.mocks.dart @@ -4,13 +4,13 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i4; -import 'dart:ui' as _i6; +import 'dart:ui' as _i5; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/models/node_model.dart' as _i8; -import 'package:stackwallet/services/node_service.dart' as _i7; +import 'package:stackwallet/models/node_model.dart' as _i7; +import 'package:stackwallet/services/node_service.dart' as _i6; import 'package:stackwallet/services/wallets_service.dart' as _i3; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i5; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i8; import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart' as _i2; @@ -53,187 +53,7 @@ class MockWalletsService extends _i1.Mock implements _i3.WalletsService { returnValue: false, ) as bool); @override - _i4.Future renameWallet({ - required String? from, - required String? to, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #renameWallet, - [], - { - #from: from, - #to: to, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); - @override - Map fetchWalletsData() => (super.noSuchMethod( - Invocation.method( - #fetchWalletsData, - [], - ), - returnValue: {}, - ) as Map); - @override - _i4.Future addExistingStackWallet({ - required String? name, - required String? walletId, - required _i5.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addExistingStackWallet, - [], - { - #name: name, - #walletId: walletId, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future addNewWallet({ - required String? name, - required _i5.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addNewWallet, - [], - { - #name: name, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future> getFavoriteWalletIds() => (super.noSuchMethod( - Invocation.method( - #getFavoriteWalletIds, - [], - ), - returnValue: _i4.Future>.value([]), - ) as _i4.Future>); - @override - _i4.Future saveFavoriteWalletIds(List? walletIds) => - (super.noSuchMethod( - Invocation.method( - #saveFavoriteWalletIds, - [walletIds], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future addFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #addFavorite, - [walletId], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future removeFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #removeFavorite, - [walletId], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future moveFavorite({ - required int? fromIndex, - required int? toIndex, - }) => - (super.noSuchMethod( - Invocation.method( - #moveFavorite, - [], - { - #fromIndex: fromIndex, - #toIndex: toIndex, - }, - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future checkForDuplicate(String? name) => (super.noSuchMethod( - Invocation.method( - #checkForDuplicate, - [name], - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); - @override - _i4.Future getWalletId(String? walletName) => (super.noSuchMethod( - Invocation.method( - #getWalletId, - [walletName], - ), - returnValue: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future isMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #isMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); - @override - _i4.Future setMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #setMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future deleteWallet( - String? name, - bool? shouldNotifyListeners, - ) => - (super.noSuchMethod( - Invocation.method( - #deleteWallet, - [ - name, - shouldNotifyListeners, - ], - ), - returnValue: _i4.Future.value(0), - ) as _i4.Future); - @override - _i4.Future refreshWallets(bool? shouldNotifyListeners) => - (super.noSuchMethod( - Invocation.method( - #refreshWallets, - [shouldNotifyListeners], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - @override - void addListener(_i6.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -241,7 +61,7 @@ class MockWalletsService extends _i1.Mock implements _i3.WalletsService { returnValueForMissingStub: null, ); @override - void removeListener(_i6.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -269,7 +89,7 @@ class MockWalletsService extends _i1.Mock implements _i3.WalletsService { /// A class which mocks [NodeService]. /// /// See the documentation for Mockito's code generation for more information. -class MockNodeService extends _i1.Mock implements _i7.NodeService { +class MockNodeService extends _i1.Mock implements _i6.NodeService { @override _i2.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod( Invocation.getter(#secureStorageInterface), @@ -279,15 +99,15 @@ class MockNodeService extends _i1.Mock implements _i7.NodeService { ), ) as _i2.SecureStorageInterface); @override - List<_i8.NodeModel> get primaryNodes => (super.noSuchMethod( + List<_i7.NodeModel> get primaryNodes => (super.noSuchMethod( Invocation.getter(#primaryNodes), - returnValue: <_i8.NodeModel>[], - ) as List<_i8.NodeModel>); + returnValue: <_i7.NodeModel>[], + ) as List<_i7.NodeModel>); @override - List<_i8.NodeModel> get nodes => (super.noSuchMethod( + List<_i7.NodeModel> get nodes => (super.noSuchMethod( Invocation.getter(#nodes), - returnValue: <_i8.NodeModel>[], - ) as List<_i8.NodeModel>); + returnValue: <_i7.NodeModel>[], + ) as List<_i7.NodeModel>); @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), @@ -304,8 +124,8 @@ class MockNodeService extends _i1.Mock implements _i7.NodeService { ) as _i4.Future); @override _i4.Future setPrimaryNodeFor({ - required _i5.Coin? coin, - required _i8.NodeModel? node, + required _i8.Coin? coin, + required _i7.NodeModel? node, bool? shouldNotifyListeners = false, }) => (super.noSuchMethod( @@ -322,40 +142,40 @@ class MockNodeService extends _i1.Mock implements _i7.NodeService { returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - _i8.NodeModel? getPrimaryNodeFor({required _i5.Coin? coin}) => + _i7.NodeModel? getPrimaryNodeFor({required _i8.Coin? coin}) => (super.noSuchMethod(Invocation.method( #getPrimaryNodeFor, [], {#coin: coin}, - )) as _i8.NodeModel?); + )) as _i7.NodeModel?); @override - List<_i8.NodeModel> getNodesFor(_i5.Coin? coin) => (super.noSuchMethod( + List<_i7.NodeModel> getNodesFor(_i8.Coin? coin) => (super.noSuchMethod( Invocation.method( #getNodesFor, [coin], ), - returnValue: <_i8.NodeModel>[], - ) as List<_i8.NodeModel>); + returnValue: <_i7.NodeModel>[], + ) as List<_i7.NodeModel>); @override - _i8.NodeModel? getNodeById({required String? id}) => + _i7.NodeModel? getNodeById({required String? id}) => (super.noSuchMethod(Invocation.method( #getNodeById, [], {#id: id}, - )) as _i8.NodeModel?); + )) as _i7.NodeModel?); @override - List<_i8.NodeModel> failoverNodesFor({required _i5.Coin? coin}) => + List<_i7.NodeModel> failoverNodesFor({required _i8.Coin? coin}) => (super.noSuchMethod( Invocation.method( #failoverNodesFor, [], {#coin: coin}, ), - returnValue: <_i8.NodeModel>[], - ) as List<_i8.NodeModel>); + returnValue: <_i7.NodeModel>[], + ) as List<_i7.NodeModel>); @override _i4.Future add( - _i8.NodeModel? node, + _i7.NodeModel? node, String? password, bool? shouldNotifyListeners, ) => @@ -407,7 +227,7 @@ class MockNodeService extends _i1.Mock implements _i7.NodeService { ) as _i4.Future); @override _i4.Future edit( - _i8.NodeModel? editedNode, + _i7.NodeModel? editedNode, String? password, bool? shouldNotifyListeners, ) => @@ -433,7 +253,7 @@ class MockNodeService extends _i1.Mock implements _i7.NodeService { returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - void addListener(_i6.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -441,7 +261,7 @@ class MockNodeService extends _i1.Mock implements _i7.NodeService { returnValueForMissingStub: null, ); @override - void removeListener(_i6.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], diff --git a/test/screen_tests/main_view_tests/main_view_screen_testA_test.mocks.dart b/test/screen_tests/main_view_tests/main_view_screen_testA_test.mocks.dart index 2a9b531c2..e9b29b616 100644 --- a/test/screen_tests/main_view_tests/main_view_screen_testA_test.mocks.dart +++ b/test/screen_tests/main_view_tests/main_view_screen_testA_test.mocks.dart @@ -4,12 +4,11 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; -import 'dart:ui' as _i5; +import 'dart:ui' as _i4; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/services/locale_service.dart' as _i6; +import 'package:stackwallet/services/locale_service.dart' as _i5; import 'package:stackwallet/services/wallets_service.dart' as _i2; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i4; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -39,187 +38,7 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { returnValue: false, ) as bool); @override - _i3.Future renameWallet({ - required String? from, - required String? to, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #renameWallet, - [], - { - #from: from, - #to: to, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - Map fetchWalletsData() => (super.noSuchMethod( - Invocation.method( - #fetchWalletsData, - [], - ), - returnValue: {}, - ) as Map); - @override - _i3.Future addExistingStackWallet({ - required String? name, - required String? walletId, - required _i4.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addExistingStackWallet, - [], - { - #name: name, - #walletId: walletId, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future addNewWallet({ - required String? name, - required _i4.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addNewWallet, - [], - { - #name: name, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future> getFavoriteWalletIds() => (super.noSuchMethod( - Invocation.method( - #getFavoriteWalletIds, - [], - ), - returnValue: _i3.Future>.value([]), - ) as _i3.Future>); - @override - _i3.Future saveFavoriteWalletIds(List? walletIds) => - (super.noSuchMethod( - Invocation.method( - #saveFavoriteWalletIds, - [walletIds], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future addFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #addFavorite, - [walletId], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future removeFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #removeFavorite, - [walletId], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future moveFavorite({ - required int? fromIndex, - required int? toIndex, - }) => - (super.noSuchMethod( - Invocation.method( - #moveFavorite, - [], - { - #fromIndex: fromIndex, - #toIndex: toIndex, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future checkForDuplicate(String? name) => (super.noSuchMethod( - Invocation.method( - #checkForDuplicate, - [name], - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - _i3.Future getWalletId(String? walletName) => (super.noSuchMethod( - Invocation.method( - #getWalletId, - [walletName], - ), - returnValue: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future isMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #isMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - _i3.Future setMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #setMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future deleteWallet( - String? name, - bool? shouldNotifyListeners, - ) => - (super.noSuchMethod( - Invocation.method( - #deleteWallet, - [ - name, - shouldNotifyListeners, - ], - ), - returnValue: _i3.Future.value(0), - ) as _i3.Future); - @override - _i3.Future refreshWallets(bool? shouldNotifyListeners) => - (super.noSuchMethod( - Invocation.method( - #refreshWallets, - [shouldNotifyListeners], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -227,7 +46,7 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { returnValueForMissingStub: null, ); @override - void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -255,7 +74,7 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { /// A class which mocks [LocaleService]. /// /// See the documentation for Mockito's code generation for more information. -class MockLocaleService extends _i1.Mock implements _i6.LocaleService { +class MockLocaleService extends _i1.Mock implements _i5.LocaleService { @override String get locale => (super.noSuchMethod( Invocation.getter(#locale), @@ -277,7 +96,7 @@ class MockLocaleService extends _i1.Mock implements _i6.LocaleService { returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -285,7 +104,7 @@ class MockLocaleService extends _i1.Mock implements _i6.LocaleService { returnValueForMissingStub: null, ); @override - void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], diff --git a/test/screen_tests/main_view_tests/main_view_screen_testB_test.mocks.dart b/test/screen_tests/main_view_tests/main_view_screen_testB_test.mocks.dart index 977f1aa81..75731831b 100644 --- a/test/screen_tests/main_view_tests/main_view_screen_testB_test.mocks.dart +++ b/test/screen_tests/main_view_tests/main_view_screen_testB_test.mocks.dart @@ -4,12 +4,11 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; -import 'dart:ui' as _i5; +import 'dart:ui' as _i4; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/services/locale_service.dart' as _i6; +import 'package:stackwallet/services/locale_service.dart' as _i5; import 'package:stackwallet/services/wallets_service.dart' as _i2; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i4; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -39,187 +38,7 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { returnValue: false, ) as bool); @override - _i3.Future renameWallet({ - required String? from, - required String? to, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #renameWallet, - [], - { - #from: from, - #to: to, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - Map fetchWalletsData() => (super.noSuchMethod( - Invocation.method( - #fetchWalletsData, - [], - ), - returnValue: {}, - ) as Map); - @override - _i3.Future addExistingStackWallet({ - required String? name, - required String? walletId, - required _i4.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addExistingStackWallet, - [], - { - #name: name, - #walletId: walletId, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future addNewWallet({ - required String? name, - required _i4.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addNewWallet, - [], - { - #name: name, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future> getFavoriteWalletIds() => (super.noSuchMethod( - Invocation.method( - #getFavoriteWalletIds, - [], - ), - returnValue: _i3.Future>.value([]), - ) as _i3.Future>); - @override - _i3.Future saveFavoriteWalletIds(List? walletIds) => - (super.noSuchMethod( - Invocation.method( - #saveFavoriteWalletIds, - [walletIds], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future addFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #addFavorite, - [walletId], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future removeFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #removeFavorite, - [walletId], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future moveFavorite({ - required int? fromIndex, - required int? toIndex, - }) => - (super.noSuchMethod( - Invocation.method( - #moveFavorite, - [], - { - #fromIndex: fromIndex, - #toIndex: toIndex, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future checkForDuplicate(String? name) => (super.noSuchMethod( - Invocation.method( - #checkForDuplicate, - [name], - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - _i3.Future getWalletId(String? walletName) => (super.noSuchMethod( - Invocation.method( - #getWalletId, - [walletName], - ), - returnValue: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future isMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #isMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - _i3.Future setMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #setMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future deleteWallet( - String? name, - bool? shouldNotifyListeners, - ) => - (super.noSuchMethod( - Invocation.method( - #deleteWallet, - [ - name, - shouldNotifyListeners, - ], - ), - returnValue: _i3.Future.value(0), - ) as _i3.Future); - @override - _i3.Future refreshWallets(bool? shouldNotifyListeners) => - (super.noSuchMethod( - Invocation.method( - #refreshWallets, - [shouldNotifyListeners], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -227,7 +46,7 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { returnValueForMissingStub: null, ); @override - void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -255,7 +74,7 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { /// A class which mocks [LocaleService]. /// /// See the documentation for Mockito's code generation for more information. -class MockLocaleService extends _i1.Mock implements _i6.LocaleService { +class MockLocaleService extends _i1.Mock implements _i5.LocaleService { @override String get locale => (super.noSuchMethod( Invocation.getter(#locale), @@ -277,7 +96,7 @@ class MockLocaleService extends _i1.Mock implements _i6.LocaleService { returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -285,7 +104,7 @@ class MockLocaleService extends _i1.Mock implements _i6.LocaleService { returnValueForMissingStub: null, ); @override - void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], diff --git a/test/screen_tests/main_view_tests/main_view_screen_testC_test.mocks.dart b/test/screen_tests/main_view_tests/main_view_screen_testC_test.mocks.dart index e4fe905d5..01b3907bc 100644 --- a/test/screen_tests/main_view_tests/main_view_screen_testC_test.mocks.dart +++ b/test/screen_tests/main_view_tests/main_view_screen_testC_test.mocks.dart @@ -4,12 +4,11 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; -import 'dart:ui' as _i5; +import 'dart:ui' as _i4; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/services/locale_service.dart' as _i6; +import 'package:stackwallet/services/locale_service.dart' as _i5; import 'package:stackwallet/services/wallets_service.dart' as _i2; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i4; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -39,187 +38,7 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { returnValue: false, ) as bool); @override - _i3.Future renameWallet({ - required String? from, - required String? to, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #renameWallet, - [], - { - #from: from, - #to: to, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - Map fetchWalletsData() => (super.noSuchMethod( - Invocation.method( - #fetchWalletsData, - [], - ), - returnValue: {}, - ) as Map); - @override - _i3.Future addExistingStackWallet({ - required String? name, - required String? walletId, - required _i4.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addExistingStackWallet, - [], - { - #name: name, - #walletId: walletId, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future addNewWallet({ - required String? name, - required _i4.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addNewWallet, - [], - { - #name: name, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future> getFavoriteWalletIds() => (super.noSuchMethod( - Invocation.method( - #getFavoriteWalletIds, - [], - ), - returnValue: _i3.Future>.value([]), - ) as _i3.Future>); - @override - _i3.Future saveFavoriteWalletIds(List? walletIds) => - (super.noSuchMethod( - Invocation.method( - #saveFavoriteWalletIds, - [walletIds], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future addFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #addFavorite, - [walletId], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future removeFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #removeFavorite, - [walletId], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future moveFavorite({ - required int? fromIndex, - required int? toIndex, - }) => - (super.noSuchMethod( - Invocation.method( - #moveFavorite, - [], - { - #fromIndex: fromIndex, - #toIndex: toIndex, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future checkForDuplicate(String? name) => (super.noSuchMethod( - Invocation.method( - #checkForDuplicate, - [name], - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - _i3.Future getWalletId(String? walletName) => (super.noSuchMethod( - Invocation.method( - #getWalletId, - [walletName], - ), - returnValue: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future isMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #isMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - _i3.Future setMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #setMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future deleteWallet( - String? name, - bool? shouldNotifyListeners, - ) => - (super.noSuchMethod( - Invocation.method( - #deleteWallet, - [ - name, - shouldNotifyListeners, - ], - ), - returnValue: _i3.Future.value(0), - ) as _i3.Future); - @override - _i3.Future refreshWallets(bool? shouldNotifyListeners) => - (super.noSuchMethod( - Invocation.method( - #refreshWallets, - [shouldNotifyListeners], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -227,7 +46,7 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { returnValueForMissingStub: null, ); @override - void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -255,7 +74,7 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { /// A class which mocks [LocaleService]. /// /// See the documentation for Mockito's code generation for more information. -class MockLocaleService extends _i1.Mock implements _i6.LocaleService { +class MockLocaleService extends _i1.Mock implements _i5.LocaleService { @override String get locale => (super.noSuchMethod( Invocation.getter(#locale), @@ -277,7 +96,7 @@ class MockLocaleService extends _i1.Mock implements _i6.LocaleService { returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); @override - void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -285,7 +104,7 @@ class MockLocaleService extends _i1.Mock implements _i6.LocaleService { returnValueForMissingStub: null, ); @override - void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], diff --git a/test/screen_tests/onboarding/backup_key_warning_view_screen_test.mocks.dart b/test/screen_tests/onboarding/backup_key_warning_view_screen_test.mocks.dart index 29fd92dd1..fe6e52860 100644 --- a/test/screen_tests/onboarding/backup_key_warning_view_screen_test.mocks.dart +++ b/test/screen_tests/onboarding/backup_key_warning_view_screen_test.mocks.dart @@ -4,11 +4,10 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; -import 'dart:ui' as _i5; +import 'dart:ui' as _i4; import 'package:mockito/mockito.dart' as _i1; import 'package:stackwallet/services/wallets_service.dart' as _i2; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i4; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -38,187 +37,7 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { returnValue: false, ) as bool); @override - _i3.Future renameWallet({ - required String? from, - required String? to, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #renameWallet, - [], - { - #from: from, - #to: to, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - Map fetchWalletsData() => (super.noSuchMethod( - Invocation.method( - #fetchWalletsData, - [], - ), - returnValue: {}, - ) as Map); - @override - _i3.Future addExistingStackWallet({ - required String? name, - required String? walletId, - required _i4.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addExistingStackWallet, - [], - { - #name: name, - #walletId: walletId, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future addNewWallet({ - required String? name, - required _i4.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addNewWallet, - [], - { - #name: name, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future> getFavoriteWalletIds() => (super.noSuchMethod( - Invocation.method( - #getFavoriteWalletIds, - [], - ), - returnValue: _i3.Future>.value([]), - ) as _i3.Future>); - @override - _i3.Future saveFavoriteWalletIds(List? walletIds) => - (super.noSuchMethod( - Invocation.method( - #saveFavoriteWalletIds, - [walletIds], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future addFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #addFavorite, - [walletId], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future removeFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #removeFavorite, - [walletId], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future moveFavorite({ - required int? fromIndex, - required int? toIndex, - }) => - (super.noSuchMethod( - Invocation.method( - #moveFavorite, - [], - { - #fromIndex: fromIndex, - #toIndex: toIndex, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future checkForDuplicate(String? name) => (super.noSuchMethod( - Invocation.method( - #checkForDuplicate, - [name], - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - _i3.Future getWalletId(String? walletName) => (super.noSuchMethod( - Invocation.method( - #getWalletId, - [walletName], - ), - returnValue: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future isMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #isMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - _i3.Future setMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #setMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future deleteWallet( - String? name, - bool? shouldNotifyListeners, - ) => - (super.noSuchMethod( - Invocation.method( - #deleteWallet, - [ - name, - shouldNotifyListeners, - ], - ), - returnValue: _i3.Future.value(0), - ) as _i3.Future); - @override - _i3.Future refreshWallets(bool? shouldNotifyListeners) => - (super.noSuchMethod( - Invocation.method( - #refreshWallets, - [shouldNotifyListeners], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -226,7 +45,7 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { returnValueForMissingStub: null, ); @override - void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], diff --git a/test/screen_tests/onboarding/create_pin_view_screen_test.mocks.dart b/test/screen_tests/onboarding/create_pin_view_screen_test.mocks.dart index 1a7a058e5..877fab27b 100644 --- a/test/screen_tests/onboarding/create_pin_view_screen_test.mocks.dart +++ b/test/screen_tests/onboarding/create_pin_view_screen_test.mocks.dart @@ -4,13 +4,13 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i4; -import 'dart:ui' as _i6; +import 'dart:ui' as _i5; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/models/node_model.dart' as _i8; -import 'package:stackwallet/services/node_service.dart' as _i7; +import 'package:stackwallet/models/node_model.dart' as _i7; +import 'package:stackwallet/services/node_service.dart' as _i6; import 'package:stackwallet/services/wallets_service.dart' as _i3; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i5; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i8; import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart' as _i2; @@ -53,187 +53,7 @@ class MockWalletsService extends _i1.Mock implements _i3.WalletsService { returnValue: false, ) as bool); @override - _i4.Future renameWallet({ - required String? from, - required String? to, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #renameWallet, - [], - { - #from: from, - #to: to, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); - @override - Map fetchWalletsData() => (super.noSuchMethod( - Invocation.method( - #fetchWalletsData, - [], - ), - returnValue: {}, - ) as Map); - @override - _i4.Future addExistingStackWallet({ - required String? name, - required String? walletId, - required _i5.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addExistingStackWallet, - [], - { - #name: name, - #walletId: walletId, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future addNewWallet({ - required String? name, - required _i5.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addNewWallet, - [], - { - #name: name, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future> getFavoriteWalletIds() => (super.noSuchMethod( - Invocation.method( - #getFavoriteWalletIds, - [], - ), - returnValue: _i4.Future>.value([]), - ) as _i4.Future>); - @override - _i4.Future saveFavoriteWalletIds(List? walletIds) => - (super.noSuchMethod( - Invocation.method( - #saveFavoriteWalletIds, - [walletIds], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future addFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #addFavorite, - [walletId], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future removeFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #removeFavorite, - [walletId], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future moveFavorite({ - required int? fromIndex, - required int? toIndex, - }) => - (super.noSuchMethod( - Invocation.method( - #moveFavorite, - [], - { - #fromIndex: fromIndex, - #toIndex: toIndex, - }, - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future checkForDuplicate(String? name) => (super.noSuchMethod( - Invocation.method( - #checkForDuplicate, - [name], - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); - @override - _i4.Future getWalletId(String? walletName) => (super.noSuchMethod( - Invocation.method( - #getWalletId, - [walletName], - ), - returnValue: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future isMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #isMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); - @override - _i4.Future setMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #setMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future deleteWallet( - String? name, - bool? shouldNotifyListeners, - ) => - (super.noSuchMethod( - Invocation.method( - #deleteWallet, - [ - name, - shouldNotifyListeners, - ], - ), - returnValue: _i4.Future.value(0), - ) as _i4.Future); - @override - _i4.Future refreshWallets(bool? shouldNotifyListeners) => - (super.noSuchMethod( - Invocation.method( - #refreshWallets, - [shouldNotifyListeners], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - @override - void addListener(_i6.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -241,7 +61,7 @@ class MockWalletsService extends _i1.Mock implements _i3.WalletsService { returnValueForMissingStub: null, ); @override - void removeListener(_i6.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -269,7 +89,7 @@ class MockWalletsService extends _i1.Mock implements _i3.WalletsService { /// A class which mocks [NodeService]. /// /// See the documentation for Mockito's code generation for more information. -class MockNodeService extends _i1.Mock implements _i7.NodeService { +class MockNodeService extends _i1.Mock implements _i6.NodeService { @override _i2.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod( Invocation.getter(#secureStorageInterface), @@ -279,15 +99,15 @@ class MockNodeService extends _i1.Mock implements _i7.NodeService { ), ) as _i2.SecureStorageInterface); @override - List<_i8.NodeModel> get primaryNodes => (super.noSuchMethod( + List<_i7.NodeModel> get primaryNodes => (super.noSuchMethod( Invocation.getter(#primaryNodes), - returnValue: <_i8.NodeModel>[], - ) as List<_i8.NodeModel>); + returnValue: <_i7.NodeModel>[], + ) as List<_i7.NodeModel>); @override - List<_i8.NodeModel> get nodes => (super.noSuchMethod( + List<_i7.NodeModel> get nodes => (super.noSuchMethod( Invocation.getter(#nodes), - returnValue: <_i8.NodeModel>[], - ) as List<_i8.NodeModel>); + returnValue: <_i7.NodeModel>[], + ) as List<_i7.NodeModel>); @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), @@ -304,8 +124,8 @@ class MockNodeService extends _i1.Mock implements _i7.NodeService { ) as _i4.Future); @override _i4.Future setPrimaryNodeFor({ - required _i5.Coin? coin, - required _i8.NodeModel? node, + required _i8.Coin? coin, + required _i7.NodeModel? node, bool? shouldNotifyListeners = false, }) => (super.noSuchMethod( @@ -322,40 +142,40 @@ class MockNodeService extends _i1.Mock implements _i7.NodeService { returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - _i8.NodeModel? getPrimaryNodeFor({required _i5.Coin? coin}) => + _i7.NodeModel? getPrimaryNodeFor({required _i8.Coin? coin}) => (super.noSuchMethod(Invocation.method( #getPrimaryNodeFor, [], {#coin: coin}, - )) as _i8.NodeModel?); + )) as _i7.NodeModel?); @override - List<_i8.NodeModel> getNodesFor(_i5.Coin? coin) => (super.noSuchMethod( + List<_i7.NodeModel> getNodesFor(_i8.Coin? coin) => (super.noSuchMethod( Invocation.method( #getNodesFor, [coin], ), - returnValue: <_i8.NodeModel>[], - ) as List<_i8.NodeModel>); + returnValue: <_i7.NodeModel>[], + ) as List<_i7.NodeModel>); @override - _i8.NodeModel? getNodeById({required String? id}) => + _i7.NodeModel? getNodeById({required String? id}) => (super.noSuchMethod(Invocation.method( #getNodeById, [], {#id: id}, - )) as _i8.NodeModel?); + )) as _i7.NodeModel?); @override - List<_i8.NodeModel> failoverNodesFor({required _i5.Coin? coin}) => + List<_i7.NodeModel> failoverNodesFor({required _i8.Coin? coin}) => (super.noSuchMethod( Invocation.method( #failoverNodesFor, [], {#coin: coin}, ), - returnValue: <_i8.NodeModel>[], - ) as List<_i8.NodeModel>); + returnValue: <_i7.NodeModel>[], + ) as List<_i7.NodeModel>); @override _i4.Future add( - _i8.NodeModel? node, + _i7.NodeModel? node, String? password, bool? shouldNotifyListeners, ) => @@ -407,7 +227,7 @@ class MockNodeService extends _i1.Mock implements _i7.NodeService { ) as _i4.Future); @override _i4.Future edit( - _i8.NodeModel? editedNode, + _i7.NodeModel? editedNode, String? password, bool? shouldNotifyListeners, ) => @@ -433,7 +253,7 @@ class MockNodeService extends _i1.Mock implements _i7.NodeService { returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); @override - void addListener(_i6.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -441,7 +261,7 @@ class MockNodeService extends _i1.Mock implements _i7.NodeService { returnValueForMissingStub: null, ); @override - void removeListener(_i6.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], diff --git a/test/screen_tests/onboarding/name_your_wallet_view_screen_test.mocks.dart b/test/screen_tests/onboarding/name_your_wallet_view_screen_test.mocks.dart index ac36cefb3..35f9c5505 100644 --- a/test/screen_tests/onboarding/name_your_wallet_view_screen_test.mocks.dart +++ b/test/screen_tests/onboarding/name_your_wallet_view_screen_test.mocks.dart @@ -4,11 +4,10 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; -import 'dart:ui' as _i5; +import 'dart:ui' as _i4; import 'package:mockito/mockito.dart' as _i1; import 'package:stackwallet/services/wallets_service.dart' as _i2; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i4; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -38,187 +37,7 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { returnValue: false, ) as bool); @override - _i3.Future renameWallet({ - required String? from, - required String? to, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #renameWallet, - [], - { - #from: from, - #to: to, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - Map fetchWalletsData() => (super.noSuchMethod( - Invocation.method( - #fetchWalletsData, - [], - ), - returnValue: {}, - ) as Map); - @override - _i3.Future addExistingStackWallet({ - required String? name, - required String? walletId, - required _i4.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addExistingStackWallet, - [], - { - #name: name, - #walletId: walletId, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future addNewWallet({ - required String? name, - required _i4.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addNewWallet, - [], - { - #name: name, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future> getFavoriteWalletIds() => (super.noSuchMethod( - Invocation.method( - #getFavoriteWalletIds, - [], - ), - returnValue: _i3.Future>.value([]), - ) as _i3.Future>); - @override - _i3.Future saveFavoriteWalletIds(List? walletIds) => - (super.noSuchMethod( - Invocation.method( - #saveFavoriteWalletIds, - [walletIds], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future addFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #addFavorite, - [walletId], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future removeFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #removeFavorite, - [walletId], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future moveFavorite({ - required int? fromIndex, - required int? toIndex, - }) => - (super.noSuchMethod( - Invocation.method( - #moveFavorite, - [], - { - #fromIndex: fromIndex, - #toIndex: toIndex, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future checkForDuplicate(String? name) => (super.noSuchMethod( - Invocation.method( - #checkForDuplicate, - [name], - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - _i3.Future getWalletId(String? walletName) => (super.noSuchMethod( - Invocation.method( - #getWalletId, - [walletName], - ), - returnValue: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future isMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #isMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - _i3.Future setMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #setMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future deleteWallet( - String? name, - bool? shouldNotifyListeners, - ) => - (super.noSuchMethod( - Invocation.method( - #deleteWallet, - [ - name, - shouldNotifyListeners, - ], - ), - returnValue: _i3.Future.value(0), - ) as _i3.Future); - @override - _i3.Future refreshWallets(bool? shouldNotifyListeners) => - (super.noSuchMethod( - Invocation.method( - #refreshWallets, - [shouldNotifyListeners], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -226,7 +45,7 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { returnValueForMissingStub: null, ); @override - void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], diff --git a/test/screen_tests/onboarding/restore_wallet_view_screen_test.mocks.dart b/test/screen_tests/onboarding/restore_wallet_view_screen_test.mocks.dart index fa4a9737a..b9acc5cfa 100644 --- a/test/screen_tests/onboarding/restore_wallet_view_screen_test.mocks.dart +++ b/test/screen_tests/onboarding/restore_wallet_view_screen_test.mocks.dart @@ -4,15 +4,15 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i5; -import 'dart:ui' as _i8; +import 'dart:ui' as _i7; import 'package:barcode_scan2/barcode_scan2.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/models/node_model.dart' as _i10; -import 'package:stackwallet/services/node_service.dart' as _i9; +import 'package:stackwallet/models/node_model.dart' as _i9; +import 'package:stackwallet/services/node_service.dart' as _i8; import 'package:stackwallet/services/wallets_service.dart' as _i6; import 'package:stackwallet/utilities/barcode_scanner_interface.dart' as _i4; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i7; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i10; import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart' as _i3; @@ -94,187 +94,7 @@ class MockWalletsService extends _i1.Mock implements _i6.WalletsService { returnValue: false, ) as bool); @override - _i5.Future renameWallet({ - required String? from, - required String? to, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #renameWallet, - [], - { - #from: from, - #to: to, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); - @override - Map fetchWalletsData() => (super.noSuchMethod( - Invocation.method( - #fetchWalletsData, - [], - ), - returnValue: {}, - ) as Map); - @override - _i5.Future addExistingStackWallet({ - required String? name, - required String? walletId, - required _i7.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addExistingStackWallet, - [], - { - #name: name, - #walletId: walletId, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - @override - _i5.Future addNewWallet({ - required String? name, - required _i7.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addNewWallet, - [], - { - #name: name, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i5.Future.value(), - ) as _i5.Future); - @override - _i5.Future> getFavoriteWalletIds() => (super.noSuchMethod( - Invocation.method( - #getFavoriteWalletIds, - [], - ), - returnValue: _i5.Future>.value([]), - ) as _i5.Future>); - @override - _i5.Future saveFavoriteWalletIds(List? walletIds) => - (super.noSuchMethod( - Invocation.method( - #saveFavoriteWalletIds, - [walletIds], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - @override - _i5.Future addFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #addFavorite, - [walletId], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - @override - _i5.Future removeFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #removeFavorite, - [walletId], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - @override - _i5.Future moveFavorite({ - required int? fromIndex, - required int? toIndex, - }) => - (super.noSuchMethod( - Invocation.method( - #moveFavorite, - [], - { - #fromIndex: fromIndex, - #toIndex: toIndex, - }, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - @override - _i5.Future checkForDuplicate(String? name) => (super.noSuchMethod( - Invocation.method( - #checkForDuplicate, - [name], - ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); - @override - _i5.Future getWalletId(String? walletName) => (super.noSuchMethod( - Invocation.method( - #getWalletId, - [walletName], - ), - returnValue: _i5.Future.value(), - ) as _i5.Future); - @override - _i5.Future isMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #isMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); - @override - _i5.Future setMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #setMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - @override - _i5.Future deleteWallet( - String? name, - bool? shouldNotifyListeners, - ) => - (super.noSuchMethod( - Invocation.method( - #deleteWallet, - [ - name, - shouldNotifyListeners, - ], - ), - returnValue: _i5.Future.value(0), - ) as _i5.Future); - @override - _i5.Future refreshWallets(bool? shouldNotifyListeners) => - (super.noSuchMethod( - Invocation.method( - #refreshWallets, - [shouldNotifyListeners], - ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); - @override - void addListener(_i8.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i7.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -282,7 +102,7 @@ class MockWalletsService extends _i1.Mock implements _i6.WalletsService { returnValueForMissingStub: null, ); @override - void removeListener(_i8.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i7.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -310,7 +130,7 @@ class MockWalletsService extends _i1.Mock implements _i6.WalletsService { /// A class which mocks [NodeService]. /// /// See the documentation for Mockito's code generation for more information. -class MockNodeService extends _i1.Mock implements _i9.NodeService { +class MockNodeService extends _i1.Mock implements _i8.NodeService { @override _i3.SecureStorageInterface get secureStorageInterface => (super.noSuchMethod( Invocation.getter(#secureStorageInterface), @@ -320,15 +140,15 @@ class MockNodeService extends _i1.Mock implements _i9.NodeService { ), ) as _i3.SecureStorageInterface); @override - List<_i10.NodeModel> get primaryNodes => (super.noSuchMethod( + List<_i9.NodeModel> get primaryNodes => (super.noSuchMethod( Invocation.getter(#primaryNodes), - returnValue: <_i10.NodeModel>[], - ) as List<_i10.NodeModel>); + returnValue: <_i9.NodeModel>[], + ) as List<_i9.NodeModel>); @override - List<_i10.NodeModel> get nodes => (super.noSuchMethod( + List<_i9.NodeModel> get nodes => (super.noSuchMethod( Invocation.getter(#nodes), - returnValue: <_i10.NodeModel>[], - ) as List<_i10.NodeModel>); + returnValue: <_i9.NodeModel>[], + ) as List<_i9.NodeModel>); @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), @@ -345,8 +165,8 @@ class MockNodeService extends _i1.Mock implements _i9.NodeService { ) as _i5.Future); @override _i5.Future setPrimaryNodeFor({ - required _i7.Coin? coin, - required _i10.NodeModel? node, + required _i10.Coin? coin, + required _i9.NodeModel? node, bool? shouldNotifyListeners = false, }) => (super.noSuchMethod( @@ -363,40 +183,40 @@ class MockNodeService extends _i1.Mock implements _i9.NodeService { returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override - _i10.NodeModel? getPrimaryNodeFor({required _i7.Coin? coin}) => + _i9.NodeModel? getPrimaryNodeFor({required _i10.Coin? coin}) => (super.noSuchMethod(Invocation.method( #getPrimaryNodeFor, [], {#coin: coin}, - )) as _i10.NodeModel?); + )) as _i9.NodeModel?); @override - List<_i10.NodeModel> getNodesFor(_i7.Coin? coin) => (super.noSuchMethod( + List<_i9.NodeModel> getNodesFor(_i10.Coin? coin) => (super.noSuchMethod( Invocation.method( #getNodesFor, [coin], ), - returnValue: <_i10.NodeModel>[], - ) as List<_i10.NodeModel>); + returnValue: <_i9.NodeModel>[], + ) as List<_i9.NodeModel>); @override - _i10.NodeModel? getNodeById({required String? id}) => + _i9.NodeModel? getNodeById({required String? id}) => (super.noSuchMethod(Invocation.method( #getNodeById, [], {#id: id}, - )) as _i10.NodeModel?); + )) as _i9.NodeModel?); @override - List<_i10.NodeModel> failoverNodesFor({required _i7.Coin? coin}) => + List<_i9.NodeModel> failoverNodesFor({required _i10.Coin? coin}) => (super.noSuchMethod( Invocation.method( #failoverNodesFor, [], {#coin: coin}, ), - returnValue: <_i10.NodeModel>[], - ) as List<_i10.NodeModel>); + returnValue: <_i9.NodeModel>[], + ) as List<_i9.NodeModel>); @override _i5.Future add( - _i10.NodeModel? node, + _i9.NodeModel? node, String? password, bool? shouldNotifyListeners, ) => @@ -448,7 +268,7 @@ class MockNodeService extends _i1.Mock implements _i9.NodeService { ) as _i5.Future); @override _i5.Future edit( - _i10.NodeModel? editedNode, + _i9.NodeModel? editedNode, String? password, bool? shouldNotifyListeners, ) => @@ -474,7 +294,7 @@ class MockNodeService extends _i1.Mock implements _i9.NodeService { returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override - void addListener(_i8.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i7.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -482,7 +302,7 @@ class MockNodeService extends _i1.Mock implements _i9.NodeService { returnValueForMissingStub: null, ); @override - void removeListener(_i8.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i7.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], diff --git a/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/change_pin_view_screen_test.mocks.dart b/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/change_pin_view_screen_test.mocks.dart index 1391c64aa..764ed5967 100644 --- a/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/change_pin_view_screen_test.mocks.dart +++ b/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/change_pin_view_screen_test.mocks.dart @@ -4,11 +4,10 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; -import 'dart:ui' as _i5; +import 'dart:ui' as _i4; import 'package:mockito/mockito.dart' as _i1; import 'package:stackwallet/services/wallets_service.dart' as _i2; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i4; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -38,187 +37,7 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { returnValue: false, ) as bool); @override - _i3.Future renameWallet({ - required String? from, - required String? to, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #renameWallet, - [], - { - #from: from, - #to: to, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - Map fetchWalletsData() => (super.noSuchMethod( - Invocation.method( - #fetchWalletsData, - [], - ), - returnValue: {}, - ) as Map); - @override - _i3.Future addExistingStackWallet({ - required String? name, - required String? walletId, - required _i4.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addExistingStackWallet, - [], - { - #name: name, - #walletId: walletId, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future addNewWallet({ - required String? name, - required _i4.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addNewWallet, - [], - { - #name: name, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future> getFavoriteWalletIds() => (super.noSuchMethod( - Invocation.method( - #getFavoriteWalletIds, - [], - ), - returnValue: _i3.Future>.value([]), - ) as _i3.Future>); - @override - _i3.Future saveFavoriteWalletIds(List? walletIds) => - (super.noSuchMethod( - Invocation.method( - #saveFavoriteWalletIds, - [walletIds], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future addFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #addFavorite, - [walletId], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future removeFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #removeFavorite, - [walletId], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future moveFavorite({ - required int? fromIndex, - required int? toIndex, - }) => - (super.noSuchMethod( - Invocation.method( - #moveFavorite, - [], - { - #fromIndex: fromIndex, - #toIndex: toIndex, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future checkForDuplicate(String? name) => (super.noSuchMethod( - Invocation.method( - #checkForDuplicate, - [name], - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - _i3.Future getWalletId(String? walletName) => (super.noSuchMethod( - Invocation.method( - #getWalletId, - [walletName], - ), - returnValue: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future isMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #isMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - _i3.Future setMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #setMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future deleteWallet( - String? name, - bool? shouldNotifyListeners, - ) => - (super.noSuchMethod( - Invocation.method( - #deleteWallet, - [ - name, - shouldNotifyListeners, - ], - ), - returnValue: _i3.Future.value(0), - ) as _i3.Future); - @override - _i3.Future refreshWallets(bool? shouldNotifyListeners) => - (super.noSuchMethod( - Invocation.method( - #refreshWallets, - [shouldNotifyListeners], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -226,7 +45,7 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { returnValueForMissingStub: null, ); @override - void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], diff --git a/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/rename_wallet_view_screen_test.mocks.dart b/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/rename_wallet_view_screen_test.mocks.dart index f189731e2..7db7d3109 100644 --- a/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/rename_wallet_view_screen_test.mocks.dart +++ b/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/rename_wallet_view_screen_test.mocks.dart @@ -4,11 +4,10 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; -import 'dart:ui' as _i5; +import 'dart:ui' as _i4; import 'package:mockito/mockito.dart' as _i1; import 'package:stackwallet/services/wallets_service.dart' as _i2; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i4; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -38,187 +37,7 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { returnValue: false, ) as bool); @override - _i3.Future renameWallet({ - required String? from, - required String? to, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #renameWallet, - [], - { - #from: from, - #to: to, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - Map fetchWalletsData() => (super.noSuchMethod( - Invocation.method( - #fetchWalletsData, - [], - ), - returnValue: {}, - ) as Map); - @override - _i3.Future addExistingStackWallet({ - required String? name, - required String? walletId, - required _i4.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addExistingStackWallet, - [], - { - #name: name, - #walletId: walletId, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future addNewWallet({ - required String? name, - required _i4.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addNewWallet, - [], - { - #name: name, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future> getFavoriteWalletIds() => (super.noSuchMethod( - Invocation.method( - #getFavoriteWalletIds, - [], - ), - returnValue: _i3.Future>.value([]), - ) as _i3.Future>); - @override - _i3.Future saveFavoriteWalletIds(List? walletIds) => - (super.noSuchMethod( - Invocation.method( - #saveFavoriteWalletIds, - [walletIds], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future addFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #addFavorite, - [walletId], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future removeFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #removeFavorite, - [walletId], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future moveFavorite({ - required int? fromIndex, - required int? toIndex, - }) => - (super.noSuchMethod( - Invocation.method( - #moveFavorite, - [], - { - #fromIndex: fromIndex, - #toIndex: toIndex, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future checkForDuplicate(String? name) => (super.noSuchMethod( - Invocation.method( - #checkForDuplicate, - [name], - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - _i3.Future getWalletId(String? walletName) => (super.noSuchMethod( - Invocation.method( - #getWalletId, - [walletName], - ), - returnValue: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future isMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #isMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - _i3.Future setMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #setMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future deleteWallet( - String? name, - bool? shouldNotifyListeners, - ) => - (super.noSuchMethod( - Invocation.method( - #deleteWallet, - [ - name, - shouldNotifyListeners, - ], - ), - returnValue: _i3.Future.value(0), - ) as _i3.Future); - @override - _i3.Future refreshWallets(bool? shouldNotifyListeners) => - (super.noSuchMethod( - Invocation.method( - #refreshWallets, - [shouldNotifyListeners], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -226,7 +45,7 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { returnValueForMissingStub: null, ); @override - void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], diff --git a/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/wallet_delete_mnemonic_view_screen_test.mocks.dart b/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/wallet_delete_mnemonic_view_screen_test.mocks.dart index 422b63101..42b82db3b 100644 --- a/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/wallet_delete_mnemonic_view_screen_test.mocks.dart +++ b/test/screen_tests/settings_view/settings_subviews/wallet_settings_subviews/wallet_delete_mnemonic_view_screen_test.mocks.dart @@ -4,11 +4,10 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; -import 'dart:ui' as _i5; +import 'dart:ui' as _i4; import 'package:mockito/mockito.dart' as _i1; import 'package:stackwallet/services/wallets_service.dart' as _i2; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i4; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -38,187 +37,7 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { returnValue: false, ) as bool); @override - _i3.Future renameWallet({ - required String? from, - required String? to, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #renameWallet, - [], - { - #from: from, - #to: to, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - Map fetchWalletsData() => (super.noSuchMethod( - Invocation.method( - #fetchWalletsData, - [], - ), - returnValue: {}, - ) as Map); - @override - _i3.Future addExistingStackWallet({ - required String? name, - required String? walletId, - required _i4.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addExistingStackWallet, - [], - { - #name: name, - #walletId: walletId, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future addNewWallet({ - required String? name, - required _i4.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addNewWallet, - [], - { - #name: name, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future> getFavoriteWalletIds() => (super.noSuchMethod( - Invocation.method( - #getFavoriteWalletIds, - [], - ), - returnValue: _i3.Future>.value([]), - ) as _i3.Future>); - @override - _i3.Future saveFavoriteWalletIds(List? walletIds) => - (super.noSuchMethod( - Invocation.method( - #saveFavoriteWalletIds, - [walletIds], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future addFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #addFavorite, - [walletId], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future removeFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #removeFavorite, - [walletId], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future moveFavorite({ - required int? fromIndex, - required int? toIndex, - }) => - (super.noSuchMethod( - Invocation.method( - #moveFavorite, - [], - { - #fromIndex: fromIndex, - #toIndex: toIndex, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future checkForDuplicate(String? name) => (super.noSuchMethod( - Invocation.method( - #checkForDuplicate, - [name], - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - _i3.Future getWalletId(String? walletName) => (super.noSuchMethod( - Invocation.method( - #getWalletId, - [walletName], - ), - returnValue: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future isMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #isMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - _i3.Future setMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #setMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future deleteWallet( - String? name, - bool? shouldNotifyListeners, - ) => - (super.noSuchMethod( - Invocation.method( - #deleteWallet, - [ - name, - shouldNotifyListeners, - ], - ), - returnValue: _i3.Future.value(0), - ) as _i3.Future); - @override - _i3.Future refreshWallets(bool? shouldNotifyListeners) => - (super.noSuchMethod( - Invocation.method( - #refreshWallets, - [shouldNotifyListeners], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -226,7 +45,7 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { returnValueForMissingStub: null, ); @override - void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], diff --git a/test/screen_tests/settings_view/settings_subviews/wallet_settings_view_screen_test.mocks.dart b/test/screen_tests/settings_view/settings_subviews/wallet_settings_view_screen_test.mocks.dart index f7cd4c34f..bb7ed9b5b 100644 --- a/test/screen_tests/settings_view/settings_subviews/wallet_settings_view_screen_test.mocks.dart +++ b/test/screen_tests/settings_view/settings_subviews/wallet_settings_view_screen_test.mocks.dart @@ -305,186 +305,6 @@ class MockWalletsService extends _i1.Mock implements _i9.WalletsService { returnValue: false, ) as bool); @override - _i4.Future renameWallet({ - required String? from, - required String? to, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #renameWallet, - [], - { - #from: from, - #to: to, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); - @override - Map fetchWalletsData() => (super.noSuchMethod( - Invocation.method( - #fetchWalletsData, - [], - ), - returnValue: {}, - ) as Map); - @override - _i4.Future addExistingStackWallet({ - required String? name, - required String? walletId, - required _i5.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addExistingStackWallet, - [], - { - #name: name, - #walletId: walletId, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future addNewWallet({ - required String? name, - required _i5.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addNewWallet, - [], - { - #name: name, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future> getFavoriteWalletIds() => (super.noSuchMethod( - Invocation.method( - #getFavoriteWalletIds, - [], - ), - returnValue: _i4.Future>.value([]), - ) as _i4.Future>); - @override - _i4.Future saveFavoriteWalletIds(List? walletIds) => - (super.noSuchMethod( - Invocation.method( - #saveFavoriteWalletIds, - [walletIds], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future addFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #addFavorite, - [walletId], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future removeFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #removeFavorite, - [walletId], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future moveFavorite({ - required int? fromIndex, - required int? toIndex, - }) => - (super.noSuchMethod( - Invocation.method( - #moveFavorite, - [], - { - #fromIndex: fromIndex, - #toIndex: toIndex, - }, - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future checkForDuplicate(String? name) => (super.noSuchMethod( - Invocation.method( - #checkForDuplicate, - [name], - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); - @override - _i4.Future getWalletId(String? walletName) => (super.noSuchMethod( - Invocation.method( - #getWalletId, - [walletName], - ), - returnValue: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future isMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #isMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i4.Future.value(false), - ) as _i4.Future); - @override - _i4.Future setMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #setMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - @override - _i4.Future deleteWallet( - String? name, - bool? shouldNotifyListeners, - ) => - (super.noSuchMethod( - Invocation.method( - #deleteWallet, - [ - name, - shouldNotifyListeners, - ], - ), - returnValue: _i4.Future.value(0), - ) as _i4.Future); - @override - _i4.Future refreshWallets(bool? shouldNotifyListeners) => - (super.noSuchMethod( - Invocation.method( - #refreshWallets, - [shouldNotifyListeners], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - @override void addListener(_i10.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, diff --git a/test/screen_tests/settings_view/settings_view_screen_test.mocks.dart b/test/screen_tests/settings_view/settings_view_screen_test.mocks.dart index 3aa71a76a..a4edcd6ab 100644 --- a/test/screen_tests/settings_view/settings_view_screen_test.mocks.dart +++ b/test/screen_tests/settings_view/settings_view_screen_test.mocks.dart @@ -4,11 +4,10 @@ // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; -import 'dart:ui' as _i5; +import 'dart:ui' as _i4; import 'package:mockito/mockito.dart' as _i1; import 'package:stackwallet/services/wallets_service.dart' as _i2; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i4; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -38,187 +37,7 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { returnValue: false, ) as bool); @override - _i3.Future renameWallet({ - required String? from, - required String? to, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #renameWallet, - [], - { - #from: from, - #to: to, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - Map fetchWalletsData() => (super.noSuchMethod( - Invocation.method( - #fetchWalletsData, - [], - ), - returnValue: {}, - ) as Map); - @override - _i3.Future addExistingStackWallet({ - required String? name, - required String? walletId, - required _i4.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addExistingStackWallet, - [], - { - #name: name, - #walletId: walletId, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future addNewWallet({ - required String? name, - required _i4.Coin? coin, - required bool? shouldNotifyListeners, - }) => - (super.noSuchMethod( - Invocation.method( - #addNewWallet, - [], - { - #name: name, - #coin: coin, - #shouldNotifyListeners: shouldNotifyListeners, - }, - ), - returnValue: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future> getFavoriteWalletIds() => (super.noSuchMethod( - Invocation.method( - #getFavoriteWalletIds, - [], - ), - returnValue: _i3.Future>.value([]), - ) as _i3.Future>); - @override - _i3.Future saveFavoriteWalletIds(List? walletIds) => - (super.noSuchMethod( - Invocation.method( - #saveFavoriteWalletIds, - [walletIds], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future addFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #addFavorite, - [walletId], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future removeFavorite(String? walletId) => (super.noSuchMethod( - Invocation.method( - #removeFavorite, - [walletId], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future moveFavorite({ - required int? fromIndex, - required int? toIndex, - }) => - (super.noSuchMethod( - Invocation.method( - #moveFavorite, - [], - { - #fromIndex: fromIndex, - #toIndex: toIndex, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future checkForDuplicate(String? name) => (super.noSuchMethod( - Invocation.method( - #checkForDuplicate, - [name], - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - _i3.Future getWalletId(String? walletName) => (super.noSuchMethod( - Invocation.method( - #getWalletId, - [walletName], - ), - returnValue: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future isMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #isMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i3.Future.value(false), - ) as _i3.Future); - @override - _i3.Future setMnemonicVerified({required String? walletId}) => - (super.noSuchMethod( - Invocation.method( - #setMnemonicVerified, - [], - {#walletId: walletId}, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future deleteWallet( - String? name, - bool? shouldNotifyListeners, - ) => - (super.noSuchMethod( - Invocation.method( - #deleteWallet, - [ - name, - shouldNotifyListeners, - ], - ), - returnValue: _i3.Future.value(0), - ) as _i3.Future); - @override - _i3.Future refreshWallets(bool? shouldNotifyListeners) => - (super.noSuchMethod( - Invocation.method( - #refreshWallets, - [shouldNotifyListeners], - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - void addListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -226,7 +45,7 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { returnValueForMissingStub: null, ); @override - void removeListener(_i5.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i4.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], diff --git a/test/services/wallets_service_test.dart b/test/services/wallets_service_test.dart deleted file mode 100644 index 86659206a..000000000 --- a/test/services/wallets_service_test.dart +++ /dev/null @@ -1,182 +0,0 @@ -import 'package:flutter_test/flutter_test.dart'; -import 'package:hive/hive.dart'; -import 'package:hive_test/hive_test.dart'; -import 'package:mockito/annotations.dart'; -import 'package:stackwallet/db/hive/db.dart'; -import 'package:stackwallet/services/wallets_service.dart'; -import 'package:stackwallet/utilities/enums/coin_enum.dart'; -import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'; - -@GenerateMocks([SecureStorageWrapper]) -void main() { - setUp(() async { - await setUpTestHive(); - final wallets = await Hive.openBox(DB.boxNameAllWalletsData); - await wallets.put('names', { - "wallet_id": { - "name": "My Firo Wallet", - "id": "wallet_id", - "coin": "bitcoin", - }, - "wallet_id2": { - "name": "wallet2", - "id": "wallet_id2", - "coin": "bitcoin", - }, - }); - }); - - test("get walletNames", () async { - final service = WalletsService(secureStorageInterface: FakeSecureStorage()); - expect((await service.walletNames).toString(), - '{wallet_id: WalletInfo: {"name":"My Firo Wallet","id":"wallet_id","coin":"bitcoin"}, wallet_id2: WalletInfo: {"name":"wallet2","id":"wallet_id2","coin":"bitcoin"}}'); - }); - - test("get null wallet names", () async { - final wallets = await Hive.openBox('wallets'); - await wallets.put('names', null); - final service = WalletsService(secureStorageInterface: FakeSecureStorage()); - expect(await service.walletNames, {}); - expect((await service.walletNames).toString(), '{}'); - }); - - test("rename wallet to same name", () async { - final service = WalletsService(secureStorageInterface: FakeSecureStorage()); - expect( - await service.renameWallet( - from: "My Firo Wallet", - to: "My Firo Wallet", - shouldNotifyListeners: false), - true); - expect((await service.walletNames).toString(), - '{wallet_id: WalletInfo: {"name":"My Firo Wallet","id":"wallet_id","coin":"bitcoin"}, wallet_id2: WalletInfo: {"name":"wallet2","id":"wallet_id2","coin":"bitcoin"}}'); - }); - - test("rename wallet to new name", () async { - final service = WalletsService(secureStorageInterface: FakeSecureStorage()); - expect( - await service.renameWallet( - from: "My Firo Wallet", - to: "My New Wallet", - shouldNotifyListeners: false), - true); - - expect((await service.walletNames).toString(), - '{wallet_id: WalletInfo: {"name":"My New Wallet","id":"wallet_id","coin":"bitcoin"}, wallet_id2: WalletInfo: {"name":"wallet2","id":"wallet_id2","coin":"bitcoin"}}'); - }); - - test("attempt rename wallet to another existing name", () async { - final service = WalletsService(secureStorageInterface: FakeSecureStorage()); - expect( - await service.renameWallet( - from: "My Firo Wallet", - to: "wallet2", - shouldNotifyListeners: false), - false); - expect((await service.walletNames).toString(), - '{wallet_id: WalletInfo: {"name":"My Firo Wallet","id":"wallet_id","coin":"bitcoin"}, wallet_id2: WalletInfo: {"name":"wallet2","id":"wallet_id2","coin":"bitcoin"}}'); - }); - - test("add new wallet name", () async { - final service = WalletsService(secureStorageInterface: FakeSecureStorage()); - expect( - await service.addNewWallet( - name: "wallet3", coin: Coin.bitcoin, shouldNotifyListeners: false), - isA()); - expect((await service.walletNames).length, 3); - }); - - test("add duplicate wallet name fails", () async { - final service = WalletsService(secureStorageInterface: FakeSecureStorage()); - expect( - await service.addNewWallet( - name: "wallet2", coin: Coin.bitcoin, shouldNotifyListeners: false), - null); - expect((await service.walletNames).length, 2); - }); - - test("check for duplicates when null names", () async { - final wallets = await Hive.openBox('wallets'); - await wallets.put('names', null); - final service = WalletsService(secureStorageInterface: FakeSecureStorage()); - expect(await service.checkForDuplicate("anything"), false); - }); - - test("check for duplicates when some names with no matches", () async { - final service = WalletsService(secureStorageInterface: FakeSecureStorage()); - expect(await service.checkForDuplicate("anything"), false); - }); - - test("check for duplicates when some names with a match", () async { - final service = WalletsService(secureStorageInterface: FakeSecureStorage()); - expect(await service.checkForDuplicate("wallet2"), true); - }); - - test("get existing wallet id", () async { - final service = WalletsService(secureStorageInterface: FakeSecureStorage()); - expect(await service.getWalletId("wallet2"), "wallet_id2"); - }); - - test("get non existent wallet id", () async { - final service = WalletsService(secureStorageInterface: FakeSecureStorage()); - await expectLater(await service.getWalletId("wallet 99"), null); - }); - - // test("delete a wallet", () async { - // await Hive.openBox(DB.boxNameWalletsToDeleteOnStart); - // await Hive.openBox(DB.boxNameTradeLookup); - // await Hive.openBox(DB.boxNameNotifications); - // final secureStore = MockSecureStorageWrapper(); - // - // when(secureStore.delete(key: "wallet_id_pin")).thenAnswer((_) async {}); - // when(secureStore.delete(key: "wallet_id_mnemonic")) - // .thenAnswer((_) async {}); - // - // final service = WalletsService(secureStorageInterface: secureStore); - // - // expect(await service.deleteWallet("My Firo Wallet", false), 0); - // expect((await service.walletNames).length, 1); - // - // verify(secureStore.delete(key: "wallet_id_pin")).called(1); - // verify(secureStore.delete(key: "wallet_id_mnemonic")).called(1); - // - // verifyNoMoreInteractions(secureStore); - // }); - // - // test("delete last wallet", () async { - // await Hive.openBox(DB.boxNameWalletsToDeleteOnStart); - // await Hive.openBox(DB.boxNameTradeLookup); - // await Hive.openBox(DB.boxNameNotifications); - // final wallets = await Hive.openBox('wallets'); - // await wallets.put('names', { - // "wallet_id": { - // "name": "My Firo Wallet", - // "id": "wallet_id", - // "coin": "bitcoin", - // }, - // }); - // final secureStore = MockSecureStorageWrapper(); - // - // when(secureStore.delete(key: "wallet_id_pin")).thenAnswer((_) async {}); - // when(secureStore.delete(key: "wallet_id_mnemonic")) - // .thenAnswer((_) async {}); - // - // final service = WalletsService(secureStorageInterface: secureStore); - // - // expect(await service.deleteWallet("My Firo Wallet", false), 2); - // expect((await service.walletNames).length, 0); - // - // verify(secureStore.delete(key: "wallet_id_pin")).called(1); - // verify(secureStore.delete(key: "wallet_id_mnemonic")).called(1); - // - // verifyNoMoreInteractions(secureStore); - // }); - - // test("get", () async { - // final service = WalletsService(); - // }); - - tearDown(() async { - await tearDownTestHive(); - }); -} diff --git a/test/services/wallets_service_test.mocks.dart b/test/services/wallets_service_test.mocks.dart deleted file mode 100644 index b2d820427..000000000 --- a/test/services/wallets_service_test.mocks.dart +++ /dev/null @@ -1,145 +0,0 @@ -// Mocks generated by Mockito 5.4.2 from annotations -// in stackwallet/test/services/wallets_service_test.dart. -// Do not manually edit this file. - -// ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i3; - -import 'package:flutter_secure_storage/flutter_secure_storage.dart' as _i4; -import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart' - as _i2; - -// ignore_for_file: type=lint -// ignore_for_file: avoid_redundant_argument_values -// ignore_for_file: avoid_setters_without_getters -// ignore_for_file: comment_references -// ignore_for_file: implementation_imports -// ignore_for_file: invalid_use_of_visible_for_testing_member -// ignore_for_file: prefer_const_constructors -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: camel_case_types -// ignore_for_file: subtype_of_sealed_class - -/// A class which mocks [SecureStorageWrapper]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockSecureStorageWrapper extends _i1.Mock - implements _i2.SecureStorageWrapper { - MockSecureStorageWrapper() { - _i1.throwOnMissingStub(this); - } - - @override - _i3.Future> get keys => (super.noSuchMethod( - Invocation.getter(#keys), - returnValue: _i3.Future>.value([]), - ) as _i3.Future>); - @override - _i3.Future read({ - required String? key, - _i4.IOSOptions? iOptions, - _i4.AndroidOptions? aOptions, - _i4.LinuxOptions? lOptions, - _i4.WebOptions? webOptions, - _i4.MacOsOptions? mOptions, - _i4.WindowsOptions? wOptions, - }) => - (super.noSuchMethod( - Invocation.method( - #read, - [], - { - #key: key, - #iOptions: iOptions, - #aOptions: aOptions, - #lOptions: lOptions, - #webOptions: webOptions, - #mOptions: mOptions, - #wOptions: wOptions, - }, - ), - returnValue: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future write({ - required String? key, - required String? value, - _i4.IOSOptions? iOptions, - _i4.AndroidOptions? aOptions, - _i4.LinuxOptions? lOptions, - _i4.WebOptions? webOptions, - _i4.MacOsOptions? mOptions, - _i4.WindowsOptions? wOptions, - }) => - (super.noSuchMethod( - Invocation.method( - #write, - [], - { - #key: key, - #value: value, - #iOptions: iOptions, - #aOptions: aOptions, - #lOptions: lOptions, - #webOptions: webOptions, - #mOptions: mOptions, - #wOptions: wOptions, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future delete({ - required String? key, - _i4.IOSOptions? iOptions, - _i4.AndroidOptions? aOptions, - _i4.LinuxOptions? lOptions, - _i4.WebOptions? webOptions, - _i4.MacOsOptions? mOptions, - _i4.WindowsOptions? wOptions, - }) => - (super.noSuchMethod( - Invocation.method( - #delete, - [], - { - #key: key, - #iOptions: iOptions, - #aOptions: aOptions, - #lOptions: lOptions, - #webOptions: webOptions, - #mOptions: mOptions, - #wOptions: wOptions, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); - @override - _i3.Future deleteAll({ - _i4.IOSOptions? iOptions, - _i4.AndroidOptions? aOptions, - _i4.LinuxOptions? lOptions, - _i4.WebOptions? webOptions, - _i4.MacOsOptions? mOptions, - _i4.WindowsOptions? wOptions, - }) => - (super.noSuchMethod( - Invocation.method( - #deleteAll, - [], - { - #iOptions: iOptions, - #aOptions: aOptions, - #lOptions: lOptions, - #webOptions: webOptions, - #mOptions: mOptions, - #wOptions: wOptions, - }, - ), - returnValue: _i3.Future.value(), - returnValueForMissingStub: _i3.Future.value(), - ) as _i3.Future); -}