From 5a88095f1347a0f6df55f39b32d1dfc89c3af120 Mon Sep 17 00:00:00 2001 From: julian-CStack <97684800+julian-CStack@users.noreply.github.com> Date: Mon, 29 May 2023 17:34:03 -0600 Subject: [PATCH] Upgrades from stack (#36) * untested protected rpc version * update tests * cleaned up electrumx rpc * fix: bug in setting _isConnected as well as adding call to refresh on reconnection established * fix: update electrumx tests * fix: update fiat price on fiat currency selection changed * Fix failing tests * fix: rpc test --------- Co-authored-by: likho --- lib/electrumx_rpc/electrumx.dart | 27 +- lib/electrumx_rpc/rpc.dart | 262 ++- .../global_settings_view/currency_view.dart | 4 + .../coins/bitcoin/bitcoin_wallet.dart | 7 +- test/cached_electrumx_test.dart | 6 +- test/electrumx_test.dart | 233 +- test/electrumx_test.mocks.dart | 76 +- test/json_rpc_test.dart | 2 +- test/models/transactions_model_test.dart | 2 +- .../notification_card_test.mocks.dart | 131 ++ .../pages/send_view/send_view_test.mocks.dart | 190 +- ...allet_settings_view_screen_test.mocks.dart | 438 ++-- .../bitcoin/bitcoin_wallet_test.mocks.dart | 226 +- .../bitcoincash_wallet_test.mocks.dart | 564 +++++ .../dogecoin/dogecoin_wallet_test.mocks.dart | 564 +++++ .../coins/firo/firo_wallet_test.mocks.dart | 1152 ++++++++++ test/services/coins/manager_test.dart | 108 +- test/services/coins/manager_test.mocks.dart | 1575 +++++-------- .../namecoin/namecoin_wallet_test.mocks.dart | 564 +++++ .../particl/particl_wallet_test.mocks.dart | 564 +++++ .../favorite_toggle_test.mocks.dart | 131 ++ .../custom_loading_overlay_test.mocks.dart | 131 ++ .../desktop/desktop_scaffold_test.mocks.dart | 131 ++ .../managed_favorite_test.mocks.dart | 210 +- .../table_view/table_view_row_test.mocks.dart | 328 ++- test/widget_tests/trade_card_test.mocks.dart | 131 ++ test/widget_tests/transaction_card_test.dart | 197 +- .../transaction_card_test.mocks.dart | 2003 +++++++++++++---- test/widget_tests/wallet_card_test.mocks.dart | 1861 +++++++++++++++ .../wallet_info_row_test.mocks.dart | 364 ++- 30 files changed, 9860 insertions(+), 2322 deletions(-) create mode 100644 test/notifications/notification_card_test.mocks.dart create mode 100644 test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart create mode 100644 test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart create mode 100644 test/services/coins/firo/firo_wallet_test.mocks.dart create mode 100644 test/services/coins/namecoin/namecoin_wallet_test.mocks.dart create mode 100644 test/services/coins/particl/particl_wallet_test.mocks.dart create mode 100644 test/widget_tests/custom_buttons/favorite_toggle_test.mocks.dart create mode 100644 test/widget_tests/custom_loading_overlay_test.mocks.dart create mode 100644 test/widget_tests/desktop/desktop_scaffold_test.mocks.dart create mode 100644 test/widget_tests/trade_card_test.mocks.dart create mode 100644 test/widget_tests/wallet_card_test.mocks.dart diff --git a/lib/electrumx_rpc/electrumx.dart b/lib/electrumx_rpc/electrumx.dart index 1b7b7158e..78adc6cd5 100644 --- a/lib/electrumx_rpc/electrumx.dart +++ b/lib/electrumx_rpc/electrumx.dart @@ -132,13 +132,12 @@ class ElectrumX { final response = await _rpcClient!.request(jsonRequestString); - print("================================================="); - print("TYPE: ${response.runtimeType}"); - print("RESPONSE: $response"); - print("================================================="); + if (response.exception != null) { + throw response.exception!; + } - if (response["error"] != null) { - if (response["error"] + if (response.data["error"] != null) { + if (response.data["error"] .toString() .contains("No such mempool or blockchain transaction")) { throw NoSuchTransactionException( @@ -148,11 +147,15 @@ class ElectrumX { } throw Exception( - "JSONRPC response \ncommand: $command \nargs: $args \nerror: $response"); + "JSONRPC response\n" + " command: $command\n" + " args: $args\n" + " error: $response.data", + ); } currentFailoverIndex = -1; - return response; + return response.data; } on WifiOnlyException { rethrow; } on SocketException { @@ -233,7 +236,13 @@ class ElectrumX { // Logging.instance.log("batch request: $request"); // send batch request - final response = (await _rpcClient!.request(request)) as List; + final jsonRpcResponse = (await _rpcClient!.request(request)); + + if (jsonRpcResponse.exception != null) { + throw jsonRpcResponse.exception!; + } + + final response = jsonRpcResponse.data as List; // check for errors, format and throw if there are any final List errors = []; diff --git a/lib/electrumx_rpc/rpc.dart b/lib/electrumx_rpc/rpc.dart index a426b96b1..a62f7511d 100644 --- a/lib/electrumx_rpc/rpc.dart +++ b/lib/electrumx_rpc/rpc.dart @@ -1,12 +1,12 @@ import 'dart:async'; import 'dart:convert'; import 'dart:io'; -import 'dart:typed_data'; +import 'package:flutter/foundation.dart'; import 'package:mutex/mutex.dart'; import 'package:stackduo/utilities/logger.dart'; -// hacky fix to receive large jsonrpc responses +// Json RPC class to handle connecting to electrumx servers class JsonRPC { JsonRPC({ required this.host, @@ -25,90 +25,60 @@ class JsonRPC { StreamSubscription? _subscription; void _dataHandler(List data) { - if (_requestQueue.isEmpty) { - // probably just return although this case should never actually hit - return; - } - - final req = _requestQueue.next; - req.appendDataAndCheckIfComplete(data); + _requestQueue.nextIncompleteReq.then((req) { + if (req != null) { + req.appendDataAndCheckIfComplete(data); - if (req.isComplete) { - _onReqCompleted(req); - } + if (req.isComplete) { + _onReqCompleted(req); + } + } else { + Logging.instance.log( + "_dataHandler found a null req!", + level: LogLevel.Warning, + ); + } + }); } void _errorHandler(Object error, StackTrace trace) { - Logging.instance.log( - "JsonRPC errorHandler: $error\n$trace", - level: LogLevel.Error, - ); - - final req = _requestQueue.next; - req.completer.completeError(error, trace); - _onReqCompleted(req); + _requestQueue.nextIncompleteReq.then((req) { + if (req != null) { + req.completer.completeError(error, trace); + _onReqCompleted(req); + } + }); } void _doneHandler() { - Logging.instance.log( - "JsonRPC doneHandler: " - "connection closed to $host:$port, destroying socket", - level: LogLevel.Info, - ); - - if (_requestQueue.isNotEmpty) { - Logging.instance.log( - "JsonRPC doneHandler: queue not empty but connection closed, " - "completing pending requests with errors", - level: LogLevel.Error, - ); - - for (final req in _requestQueue.queue) { - if (!req.isComplete) { - try { - throw Exception( - "JsonRPC doneHandler: socket closed " - "before request could complete", - ); - } catch (e, s) { - req.completer.completeError(e, s); - } - } - } - _requestQueue.clear(); - } - - disconnect(); + disconnect(reason: "JsonRPC _doneHandler() called"); } void _onReqCompleted(_JsonRPCRequest req) { - _requestQueue.remove(req); - if (_requestQueue.isNotEmpty) { + _requestQueue.remove(req).then((_) { + // attempt to send next request _sendNextAvailableRequest(); - } + }); } void _sendNextAvailableRequest() { - if (_requestQueue.isEmpty) { - // TODO handle properly - throw Exception("JSON RPC queue empty"); - } - - final req = _requestQueue.next; - - _socket!.write('${req.jsonRequest}\r\n'); - - req.initiateTimeout(const Duration(seconds: 10)); - // Logging.instance.log( - // "JsonRPC request: wrote request ${req.jsonRequest} " - // "to socket $host:$port", - // level: LogLevel.Info, - // ); + _requestQueue.nextIncompleteReq.then((req) { + if (req != null) { + // \r\n required by electrumx server + _socket!.write('${req.jsonRequest}\r\n'); + + // TODO different timeout length? + req.initiateTimeout( + const Duration(seconds: 10), + onTimedOut: () { + _requestQueue.remove(req); + }, + ); + } + }); } - Future request(String jsonRpcRequest) async { - // todo: handle this better? - // Do we need to check the subscription, too? + Future request(String jsonRpcRequest) async { await _requestMutex.protect(() async { if (_socket == null) { Logging.instance.log( @@ -121,51 +91,69 @@ class JsonRPC { final req = _JsonRPCRequest( jsonRequest: jsonRpcRequest, - completer: Completer(), + completer: Completer(), ); - _requestQueue.add(req); + final future = req.completer.future.onError( + (error, stackTrace) async { + await disconnect( + reason: "return req.completer.future.onError: $error\n$stackTrace", + ); + return JsonRPCResponse( + exception: error is Exception + ? error + : Exception( + "req.completer.future.onError: $error\n$stackTrace", + ), + ); + }, + ); // if this is the only/first request then send it right away - if (_requestQueue.length == 1) { - _sendNextAvailableRequest(); - } else { - // Logging.instance.log( - // "JsonRPC request: queued request $jsonRpcRequest " - // "to socket $host:$port", - // level: LogLevel.Info, - // ); - } - - return req.completer.future.onError( - (error, stackTrace) => - Exception("return req.completer.future.onError: $error"), + await _requestQueue.add( + req, + onInitialRequestAdded: _sendNextAvailableRequest, ); + + return future; } - void disconnect() { - // TODO: maybe clear req queue here and wrap in mutex? - _subscription?.cancel().then((_) => _subscription = null); - _socket?.destroy(); - _socket = null; + Future disconnect({required String reason}) async { + await _requestMutex.protect(() async { + await _subscription?.cancel(); + _subscription = null; + _socket?.destroy(); + _socket = null; + + // clean up remaining queue + await _requestQueue.completeRemainingWithError( + "JsonRPC disconnect() called with reason: \"$reason\"", + ); + }); } Future connect() async { + if (_socket != null) { + throw Exception( + "JsonRPC attempted to connect to an already existing socket!", + ); + } + if (useSSL) { - _socket ??= await SecureSocket.connect( + _socket = await SecureSocket.connect( host, port, timeout: connectionTimeout, onBadCertificate: (_) => true, ); // TODO do not automatically trust bad certificates } else { - _socket ??= await Socket.connect( + _socket = await Socket.connect( host, port, timeout: connectionTimeout, ); } - await _subscription?.cancel(); + _subscription = _socket!.listen( _dataHandler, onError: _errorHandler, @@ -176,36 +164,85 @@ class JsonRPC { } class _JsonRPCRequestQueue { + final _lock = Mutex(); final List<_JsonRPCRequest> _rq = []; - void add(_JsonRPCRequest req) => _rq.add(req); + Future add( + _JsonRPCRequest req, { + VoidCallback? onInitialRequestAdded, + }) async { + return await _lock.protect(() async { + _rq.add(req); + if (_rq.length == 1) { + onInitialRequestAdded?.call(); + } + }); + } + + Future remove(_JsonRPCRequest req) async { + return await _lock.protect(() async { + final result = _rq.remove(req); + return result; + }); + } + + Future<_JsonRPCRequest?> get nextIncompleteReq async { + return await _lock.protect(() async { + int removeCount = 0; + _JsonRPCRequest? returnValue; + for (final req in _rq) { + if (req.isComplete) { + removeCount++; + } else { + returnValue = req; + break; + } + } - bool remove(_JsonRPCRequest req) => _rq.remove(req); + _rq.removeRange(0, removeCount); - void clear() => _rq.clear(); + return returnValue; + }); + } - bool get isEmpty => _rq.isEmpty; - bool get isNotEmpty => _rq.isNotEmpty; - int get length => _rq.length; - _JsonRPCRequest get next => _rq.first; - List<_JsonRPCRequest> get queue => _rq.toList(growable: false); + Future completeRemainingWithError( + String error, { + StackTrace? stackTrace, + }) async { + await _lock.protect(() async { + for (final req in _rq) { + if (!req.isComplete) { + req.completer.completeError(Exception(error), stackTrace); + } + } + _rq.clear(); + }); + } + + Future get isEmpty async { + return await _lock.protect(() async { + return _rq.isEmpty; + }); + } } class _JsonRPCRequest { + // 0x0A is newline + // https://electrumx-spesmilo.readthedocs.io/en/latest/protocol-basics.html + static const int separatorByte = 0x0A; + final String jsonRequest; - final Completer completer; + final Completer completer; final List _responseData = []; _JsonRPCRequest({required this.jsonRequest, required this.completer}); void appendDataAndCheckIfComplete(List data) { _responseData.addAll(data); - // 0x0A is newline - // https://electrumx-spesmilo.readthedocs.io/en/latest/protocol-basics.html - if (data.last == 0x0A) { + if (data.last == separatorByte) { try { final response = json.decode(String.fromCharCodes(_responseData)); - completer.complete(response); + completer.complete(JsonRPCResponse(data: response)); } catch (e, s) { Logging.instance.log( "JsonRPC json.decode: $e\n$s", @@ -216,13 +253,17 @@ class _JsonRPCRequest { } } - void initiateTimeout(Duration timeout) { + void initiateTimeout( + Duration timeout, { + VoidCallback? onTimedOut, + }) { Future.delayed(timeout).then((_) { if (!isComplete) { try { throw Exception("_JsonRPCRequest timed out: $jsonRequest"); } catch (e, s) { completer.completeError(e, s); + onTimedOut?.call(); } } }); @@ -230,3 +271,10 @@ class _JsonRPCRequest { bool get isComplete => completer.isCompleted; } + +class JsonRPCResponse { + final dynamic data; + final Exception? exception; + + JsonRPCResponse({this.data, this.exception}); +} diff --git a/lib/pages/settings_views/global_settings_view/currency_view.dart b/lib/pages/settings_views/global_settings_view/currency_view.dart index 87f31e190..9ce682c14 100644 --- a/lib/pages/settings_views/global_settings_view/currency_view.dart +++ b/lib/pages/settings_views/global_settings_view/currency_view.dart @@ -50,6 +50,10 @@ class _CurrencyViewState extends ConsumerState { currenciesWithoutSelected.remove(current); currenciesWithoutSelected.insert(0, current); ref.read(prefsChangeNotifierProvider).currency = current; + + if (ref.read(prefsChangeNotifierProvider).externalCalls) { + ref.read(priceAnd24hChangeNotifierProvider).updatePrice(); + } } } diff --git a/lib/services/coins/bitcoin/bitcoin_wallet.dart b/lib/services/coins/bitcoin/bitcoin_wallet.dart index 2278588ec..0fa906a9e 100644 --- a/lib/services/coins/bitcoin/bitcoin_wallet.dart +++ b/lib/services/coins/bitcoin/bitcoin_wallet.dart @@ -1201,13 +1201,18 @@ class BitcoinWallet extends CoinServiceAPI void _periodicPingCheck() async { bool hasNetwork = await testNetworkConnection(); - _isConnected = hasNetwork; + if (_isConnected != hasNetwork) { NodeConnectionStatus status = hasNetwork ? NodeConnectionStatus.connected : NodeConnectionStatus.disconnected; GlobalEventBus.instance .fire(NodeConnectionStatusChangedEvent(status, walletId, coin)); + + _isConnected = hasNetwork; + if (hasNetwork) { + unawaited(refresh()); + } } } diff --git a/test/cached_electrumx_test.dart b/test/cached_electrumx_test.dart index c3df6c2e8..052bf87b2 100644 --- a/test/cached_electrumx_test.dart +++ b/test/cached_electrumx_test.dart @@ -142,11 +142,7 @@ void main() { useSSL: true, ); - final client = CachedElectrumX.from( - node: node, - prefs: MockPrefs(), - failovers: [], - electrumXClient: MockElectrumX()); + final client = CachedElectrumX.from(electrumXClient: MockElectrumX()); expect(client, isA()); }); diff --git a/test/electrumx_test.dart b/test/electrumx_test.dart index 3ae162529..8d29f63e9 100644 --- a/test/electrumx_test.dart +++ b/test/electrumx_test.dart @@ -57,16 +57,18 @@ void main() { const jsonArgs = '["",true]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "error": { "code": 1, "message": "None should be a transaction hash", }, "id": "some requestId", - }, + }), ); final mockPrefs = MockPrefs(); @@ -93,13 +95,15 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": {"height": 520481, "hex": "some block hex string"}, "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -126,7 +130,9 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -153,9 +159,15 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => {"jsonrpc": "2.0", "result": null, "id": "some requestId"}, + (_) async => JsonRPCResponse(data: { + "jsonrpc": "2.0", + "result": null, + "id": "some requestId", + }), ); final mockPrefs = MockPrefs(); @@ -181,7 +193,9 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -208,9 +222,11 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": { "genesis_hash": @@ -225,7 +241,7 @@ void main() { "hash_function": "sha256" }, "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -263,7 +279,9 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -290,13 +308,15 @@ void main() { const jsonArgs = '["some raw transaction string"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": "the txid of the rawtx", "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -323,7 +343,9 @@ void main() { const jsonArgs = '["some raw transaction string"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -353,16 +375,18 @@ void main() { const jsonArgs = '["dummy hash"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": { "confirmed": 103873966, "unconfirmed": 23684400, }, "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -389,7 +413,9 @@ void main() { const jsonArgs = '["dummy hash"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -418,9 +444,11 @@ void main() { const jsonArgs = '["dummy hash"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": [ { @@ -435,7 +463,7 @@ void main() { } ], "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -473,7 +501,9 @@ void main() { const jsonArgs = '["dummy hash"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -502,9 +532,11 @@ void main() { const jsonArgs = '["dummy hash"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": [ { @@ -523,7 +555,7 @@ void main() { } ], "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -565,7 +597,9 @@ void main() { const jsonArgs = '["dummy hash"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -594,13 +628,15 @@ void main() { const jsonArgs = '["${SampleGetTransactionData.txHash0}",true]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": SampleGetTransactionData.txData0, "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -629,7 +665,9 @@ void main() { const jsonArgs = '["${SampleGetTransactionData.txHash0}",true]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -659,13 +697,15 @@ void main() { const jsonArgs = '["1",""]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": GetAnonymitySetSampleData.data, "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -692,7 +732,9 @@ void main() { const jsonArgs = '["1",""]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -721,13 +763,15 @@ void main() { const jsonArgs = '["some mints"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": "mint meta data", "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -754,7 +798,9 @@ void main() { const jsonArgs = '["some mints"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -783,13 +829,15 @@ void main() { const jsonArgs = '["0"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": GetUsedSerialsSampleData.serials, "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -816,7 +864,9 @@ void main() { const jsonArgs = '["0"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -845,9 +895,15 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => {"jsonrpc": "2.0", "result": 1, "id": "some requestId"}, + (_) async => JsonRPCResponse(data: { + "jsonrpc": "2.0", + "result": 1, + "id": "some requestId", + }), ); final mockPrefs = MockPrefs(); @@ -873,7 +929,9 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -886,7 +944,10 @@ void main() { prefs: mockPrefs, failovers: []); - expect(() => client.getLatestCoinId(requestID: "some requestId"), + expect( + () => client.getLatestCoinId( + requestID: "some requestId", + ), throwsA(isA())); verify(mockPrefs.wifiOnly).called(1); verifyNoMoreInteractions(mockPrefs); @@ -900,13 +961,15 @@ void main() { const jsonArgs = '["1",""]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": GetAnonymitySetSampleData.data, "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -933,7 +996,9 @@ void main() { const jsonArgs = '["1",""]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -947,8 +1012,10 @@ void main() { failovers: []); expect( - () => - client.getAnonymitySet(groupId: "1", requestID: "some requestId"), + () => client.getAnonymitySet( + groupId: "1", + requestID: "some requestId", + ), throwsA(isA())); verify(mockPrefs.wifiOnly).called(1); verifyNoMoreInteractions(mockPrefs); @@ -962,13 +1029,15 @@ void main() { const jsonArgs = '["some mints"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": "mint meta data", "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -995,7 +1064,9 @@ void main() { const jsonArgs = '["some mints"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -1010,7 +1081,9 @@ void main() { expect( () => client.getMintData( - mints: "some mints", requestID: "some requestId"), + mints: "some mints", + requestID: "some requestId", + ), throwsA(isA())); verify(mockPrefs.wifiOnly).called(1); verifyNoMoreInteractions(mockPrefs); @@ -1024,13 +1097,15 @@ void main() { const jsonArgs = '["0"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": GetUsedSerialsSampleData.serials, "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -1057,7 +1132,9 @@ void main() { const jsonArgs = '["0"]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -1086,9 +1163,15 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => {"jsonrpc": "2.0", "result": 1, "id": "some requestId"}, + (_) async => JsonRPCResponse(data: { + "jsonrpc": "2.0", + "result": 1, + "id": "some requestId", + }), ); final mockPrefs = MockPrefs(); @@ -1114,7 +1197,9 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); @@ -1141,15 +1226,17 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenAnswer( - (_) async => { + (_) async => JsonRPCResponse(data: { "jsonrpc": "2.0", "result": { "rate": 1000, }, "id": "some requestId" - }, + }), ); final mockPrefs = MockPrefs(); @@ -1175,7 +1262,9 @@ void main() { const jsonArgs = '[]'; when( mockClient.request( - '{"jsonrpc": "2.0", "id": "some requestId","method": "$command","params": $jsonArgs}'), + '{"jsonrpc": "2.0", "id": "some requestId",' + '"method": "$command","params": $jsonArgs}', + ), ).thenThrow(Exception()); final mockPrefs = MockPrefs(); diff --git a/test/electrumx_test.mocks.dart b/test/electrumx_test.mocks.dart index 2f3abf347..8c9649d20 100644 --- a/test/electrumx_test.mocks.dart +++ b/test/electrumx_test.mocks.dart @@ -33,6 +33,17 @@ class _FakeDuration_0 extends _i1.SmartFake implements Duration { ); } +class _FakeJsonRPCResponse_1 extends _i1.SmartFake + implements _i2.JsonRPCResponse { + _FakeJsonRPCResponse_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + /// A class which mocks [JsonRPC]. /// /// See the documentation for Mockito's code generation for more information. @@ -47,40 +58,16 @@ class MockJsonRPC extends _i1.Mock implements _i2.JsonRPC { returnValue: false, ) as bool); @override - set useSSL(bool? _useSSL) => super.noSuchMethod( - Invocation.setter( - #useSSL, - _useSSL, - ), - returnValueForMissingStub: null, - ); - @override String get host => (super.noSuchMethod( Invocation.getter(#host), returnValue: '', ) as String); @override - set host(String? _host) => super.noSuchMethod( - Invocation.setter( - #host, - _host, - ), - returnValueForMissingStub: null, - ); - @override int get port => (super.noSuchMethod( Invocation.getter(#port), returnValue: 0, ) as int); @override - set port(int? _port) => super.noSuchMethod( - Invocation.setter( - #port, - _port, - ), - returnValueForMissingStub: null, - ); - @override Duration get connectionTimeout => (super.noSuchMethod( Invocation.getter(#connectionTimeout), returnValue: _FakeDuration_0( @@ -89,21 +76,40 @@ class MockJsonRPC extends _i1.Mock implements _i2.JsonRPC { ), ) as Duration); @override - set connectionTimeout(Duration? _connectionTimeout) => super.noSuchMethod( - Invocation.setter( - #connectionTimeout, - _connectionTimeout, - ), - returnValueForMissingStub: null, - ); - @override - _i3.Future request(String? jsonRpcRequest) => (super.noSuchMethod( + _i3.Future<_i2.JsonRPCResponse> request(String? jsonRpcRequest) => + (super.noSuchMethod( Invocation.method( #request, [jsonRpcRequest], ), - returnValue: _i3.Future.value(), - ) as _i3.Future); + returnValue: + _i3.Future<_i2.JsonRPCResponse>.value(_FakeJsonRPCResponse_1( + this, + Invocation.method( + #request, + [jsonRpcRequest], + ), + )), + ) as _i3.Future<_i2.JsonRPCResponse>); + @override + _i3.Future disconnect({required String? reason}) => (super.noSuchMethod( + Invocation.method( + #disconnect, + [], + {#reason: reason}, + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + @override + _i3.Future connect() => (super.noSuchMethod( + Invocation.method( + #connect, + [], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [Prefs]. diff --git a/test/json_rpc_test.dart b/test/json_rpc_test.dart index b7a613631..d6af19546 100644 --- a/test/json_rpc_test.dart +++ b/test/json_rpc_test.dart @@ -17,7 +17,7 @@ void main() { '{"jsonrpc": "2.0", "id": "some id","method": "server.ping","params": []}'; final result = await jsonRPC.request(jsonRequestString); - expect(result, {"jsonrpc": "2.0", "result": null, "id": "some id"}); + expect(result.data, {"jsonrpc": "2.0", "result": null, "id": "some id"}); }); test("JsonRPC.request fails due to SocketException", () async { diff --git a/test/models/transactions_model_test.dart b/test/models/transactions_model_test.dart index 176452694..3fca56511 100644 --- a/test/models/transactions_model_test.dart +++ b/test/models/transactions_model_test.dart @@ -118,7 +118,7 @@ void main() { ] }); expect(txChunk.toString(), - "timestamp: 993260735 transactions: [\n {txid: txid, type: txType, subType: mint, value: 10, fee: 1, height: 1, confirm: true, confirmations: 1, address: address, timestamp: 1876352482, worthNow: 1, inputs: [], slateid: slateId } \n]"); + "timestamp: 993260735 transactions: [\n {txid: txid, type: txType, subType: mint, value: 10, fee: 1, height: 1, confirm: true, confirmations: 1, address: address, timestamp: 1876352482, worthNow: 1, inputs: [], slateid: slateId, numberOfMessages: null } \n]"); }); }); diff --git a/test/notifications/notification_card_test.mocks.dart b/test/notifications/notification_card_test.mocks.dart new file mode 100644 index 000000000..bb8b8ae74 --- /dev/null +++ b/test/notifications/notification_card_test.mocks.dart @@ -0,0 +1,131 @@ +// Mocks generated by Mockito 5.3.2 from annotations +// in stackwallet/test/notifications/notification_card_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i5; +import 'dart:typed_data' as _i6; + +import 'package:mockito/mockito.dart' as _i1; +import 'package:stackwallet/db/isar/main_db.dart' as _i2; +import 'package:stackwallet/models/isar/stack_theme.dart' as _i4; +import 'package:stackwallet/themes/theme_service.dart' as _i3; + +// 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 + +class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB { + _FakeMainDB_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [ThemeService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockThemeService extends _i1.Mock implements _i3.ThemeService { + MockThemeService() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.MainDB get db => (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_0( + this, + Invocation.getter(#db), + ), + ) as _i2.MainDB); + @override + List<_i4.StackTheme> get installedThemes => (super.noSuchMethod( + Invocation.getter(#installedThemes), + returnValue: <_i4.StackTheme>[], + ) as List<_i4.StackTheme>); + @override + void init(_i2.MainDB? db) => super.noSuchMethod( + Invocation.method( + #init, + [db], + ), + returnValueForMissingStub: null, + ); + @override + _i5.Future install({required _i6.Uint8List? themeArchiveData}) => + (super.noSuchMethod( + Invocation.method( + #install, + [], + {#themeArchiveData: themeArchiveData}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future remove({required String? themeId}) => (super.noSuchMethod( + Invocation.method( + #remove, + [], + {#themeId: themeId}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future verifyInstalled({required String? themeId}) => + (super.noSuchMethod( + Invocation.method( + #verifyInstalled, + [], + {#themeId: themeId}, + ), + returnValue: _i5.Future.value(false), + ) as _i5.Future); + @override + _i5.Future> fetchThemes() => (super.noSuchMethod( + Invocation.method( + #fetchThemes, + [], + ), + returnValue: _i5.Future>.value( + <_i3.StackThemeMetaData>[]), + ) as _i5.Future>); + @override + _i5.Future<_i6.Uint8List> fetchTheme( + {required _i3.StackThemeMetaData? themeMetaData}) => + (super.noSuchMethod( + Invocation.method( + #fetchTheme, + [], + {#themeMetaData: themeMetaData}, + ), + returnValue: _i5.Future<_i6.Uint8List>.value(_i6.Uint8List(0)), + ) as _i5.Future<_i6.Uint8List>); + @override + _i4.StackTheme? getTheme({required String? themeId}) => + (super.noSuchMethod(Invocation.method( + #getTheme, + [], + {#themeId: themeId}, + )) as _i4.StackTheme?); +} diff --git a/test/pages/send_view/send_view_test.mocks.dart b/test/pages/send_view/send_view_test.mocks.dart index 60041c9d9..2276836ce 100644 --- a/test/pages/send_view/send_view_test.mocks.dart +++ b/test/pages/send_view/send_view_test.mocks.dart @@ -1,5 +1,5 @@ // Mocks generated by Mockito 5.3.2 from annotations -// in stackduo/test/pages/send_view/send_view_test.dart. +// in stackwallet/test/pages/send_view/send_view_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes @@ -13,30 +13,33 @@ import 'package:bitcoindart/bitcoindart.dart' as _i14; import 'package:flutter/foundation.dart' as _i4; import 'package:flutter_riverpod/flutter_riverpod.dart' as _i5; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackduo/db/main_db.dart' as _i13; -import 'package:stackduo/electrumx_rpc/cached_electrumx.dart' as _i11; -import 'package:stackduo/electrumx_rpc/electrumx.dart' as _i10; -import 'package:stackduo/models/balance.dart' as _i12; -import 'package:stackduo/models/isar/models/isar_models.dart' as _i18; -import 'package:stackduo/models/node_model.dart' as _i26; -import 'package:stackduo/models/paymint/fee_object_model.dart' as _i9; -import 'package:stackduo/models/signing_data.dart' as _i29; -import 'package:stackduo/services/coins/bitcoin/bitcoin_wallet.dart' as _i27; -import 'package:stackduo/services/coins/coin_service.dart' as _i20; -import 'package:stackduo/services/coins/manager.dart' as _i6; -import 'package:stackduo/services/locale_service.dart' as _i31; -import 'package:stackduo/services/node_service.dart' as _i3; -import 'package:stackduo/services/transaction_notification_tracker.dart' as _i8; -import 'package:stackduo/services/wallets.dart' as _i21; -import 'package:stackduo/services/wallets_service.dart' as _i2; -import 'package:stackduo/utilities/amount/amount.dart' as _i15; -import 'package:stackduo/utilities/enums/backup_frequency_type.dart' as _i33; -import 'package:stackduo/utilities/enums/coin_enum.dart' as _i22; -import 'package:stackduo/utilities/enums/derive_path_type_enum.dart' as _i28; -import 'package:stackduo/utilities/enums/sync_type_enum.dart' as _i32; -import 'package:stackduo/utilities/flutter_secure_storage_interface.dart' +import 'package:stackwallet/db/isar/main_db.dart' as _i13; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i11; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i10; +import 'package:stackwallet/models/balance.dart' as _i12; +import 'package:stackwallet/models/isar/models/isar_models.dart' as _i18; +import 'package:stackwallet/models/isar/stack_theme.dart' as _i33; +import 'package:stackwallet/models/node_model.dart' as _i26; +import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i9; +import 'package:stackwallet/models/signing_data.dart' as _i29; +import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart' as _i27; +import 'package:stackwallet/services/coins/coin_service.dart' as _i20; +import 'package:stackwallet/services/coins/manager.dart' as _i6; +import 'package:stackwallet/services/locale_service.dart' as _i31; +import 'package:stackwallet/services/node_service.dart' as _i3; +import 'package:stackwallet/services/transaction_notification_tracker.dart' + as _i8; +import 'package:stackwallet/services/wallets.dart' as _i21; +import 'package:stackwallet/services/wallets_service.dart' as _i2; +import 'package:stackwallet/themes/theme_service.dart' as _i32; +import 'package:stackwallet/utilities/amount/amount.dart' as _i15; +import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i35; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i22; +import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart' as _i28; +import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i34; +import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart' as _i7; -import 'package:stackduo/utilities/prefs.dart' as _i24; +import 'package:stackwallet/utilities/prefs.dart' as _i24; import 'package:tuple/tuple.dart' as _i16; // ignore_for_file: type=lint @@ -1647,6 +1650,25 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override + List getWalletTokenContractAddresses() => (super.noSuchMethod( + Invocation.method( + #getWalletTokenContractAddresses, + [], + ), + returnValue: [], + ) as List); + @override + _i23.Future updateWalletTokenContractAddresses( + List? contractAddresses) => + (super.noSuchMethod( + Invocation.method( + #updateWalletTokenContractAddresses, + [contractAddresses], + ), + returnValue: _i23.Future.value(), + returnValueForMissingStub: _i23.Future.value(), + ) as _i23.Future); + @override void initWalletDB({_i13.MainDB? mockableOverride}) => super.noSuchMethod( Invocation.method( #initWalletDB, @@ -2205,6 +2227,105 @@ class MockLocaleService extends _i1.Mock implements _i31.LocaleService { ); } +/// A class which mocks [ThemeService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockThemeService extends _i1.Mock implements _i32.ThemeService { + MockThemeService() { + _i1.throwOnMissingStub(this); + } + + @override + _i13.MainDB get db => (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_10( + this, + Invocation.getter(#db), + ), + ) as _i13.MainDB); + @override + List<_i33.StackTheme> get installedThemes => (super.noSuchMethod( + Invocation.getter(#installedThemes), + returnValue: <_i33.StackTheme>[], + ) as List<_i33.StackTheme>); + @override + void init(_i13.MainDB? db) => super.noSuchMethod( + Invocation.method( + #init, + [db], + ), + returnValueForMissingStub: null, + ); + @override + _i23.Future install({required _i30.Uint8List? themeArchiveData}) => + (super.noSuchMethod( + Invocation.method( + #install, + [], + {#themeArchiveData: themeArchiveData}, + ), + returnValue: _i23.Future.value(), + returnValueForMissingStub: _i23.Future.value(), + ) as _i23.Future); + @override + _i23.Future remove({required String? themeId}) => (super.noSuchMethod( + Invocation.method( + #remove, + [], + {#themeId: themeId}, + ), + returnValue: _i23.Future.value(), + returnValueForMissingStub: _i23.Future.value(), + ) as _i23.Future); + @override + _i23.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i23.Future.value(), + returnValueForMissingStub: _i23.Future.value(), + ) as _i23.Future); + @override + _i23.Future verifyInstalled({required String? themeId}) => + (super.noSuchMethod( + Invocation.method( + #verifyInstalled, + [], + {#themeId: themeId}, + ), + returnValue: _i23.Future.value(false), + ) as _i23.Future); + @override + _i23.Future> fetchThemes() => + (super.noSuchMethod( + Invocation.method( + #fetchThemes, + [], + ), + returnValue: _i23.Future>.value( + <_i32.StackThemeMetaData>[]), + ) as _i23.Future>); + @override + _i23.Future<_i30.Uint8List> fetchTheme( + {required _i32.StackThemeMetaData? themeMetaData}) => + (super.noSuchMethod( + Invocation.method( + #fetchTheme, + [], + {#themeMetaData: themeMetaData}, + ), + returnValue: _i23.Future<_i30.Uint8List>.value(_i30.Uint8List(0)), + ) as _i23.Future<_i30.Uint8List>); + @override + _i33.StackTheme? getTheme({required String? themeId}) => + (super.noSuchMethod(Invocation.method( + #getTheme, + [], + {#themeId: themeId}, + )) as _i33.StackTheme?); +} + /// A class which mocks [Prefs]. /// /// See the documentation for Mockito's code generation for more information. @@ -2264,12 +2385,12 @@ class MockPrefs extends _i1.Mock implements _i24.Prefs { returnValueForMissingStub: null, ); @override - _i32.SyncingType get syncType => (super.noSuchMethod( + _i34.SyncingType get syncType => (super.noSuchMethod( Invocation.getter(#syncType), - returnValue: _i32.SyncingType.currentWalletOnly, - ) as _i32.SyncingType); + returnValue: _i34.SyncingType.currentWalletOnly, + ) as _i34.SyncingType); @override - set syncType(_i32.SyncingType? syncType) => super.noSuchMethod( + set syncType(_i34.SyncingType? syncType) => super.noSuchMethod( Invocation.setter( #syncType, syncType, @@ -2415,12 +2536,12 @@ class MockPrefs extends _i1.Mock implements _i24.Prefs { returnValueForMissingStub: null, ); @override - _i33.BackupFrequencyType get backupFrequencyType => (super.noSuchMethod( + _i35.BackupFrequencyType get backupFrequencyType => (super.noSuchMethod( Invocation.getter(#backupFrequencyType), - returnValue: _i33.BackupFrequencyType.everyTenMinutes, - ) as _i33.BackupFrequencyType); + returnValue: _i35.BackupFrequencyType.everyTenMinutes, + ) as _i35.BackupFrequencyType); @override - set backupFrequencyType(_i33.BackupFrequencyType? backupFrequencyType) => + set backupFrequencyType(_i35.BackupFrequencyType? backupFrequencyType) => super.noSuchMethod( Invocation.setter( #backupFrequencyType, @@ -2787,6 +2908,11 @@ class MockManager extends _i1.Mock implements _i6.Manager { returnValue: false, ) as bool); @override + bool get hasTokenSupport => (super.noSuchMethod( + Invocation.getter(#hasTokenSupport), + returnValue: false, + ) as bool); + @override bool get hasWhirlpoolSupport => (super.noSuchMethod( Invocation.getter(#hasWhirlpoolSupport), returnValue: false, 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 db4ad51c9..df8c7958c 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 @@ -1,26 +1,25 @@ // Mocks generated by Mockito 5.3.2 from annotations -// in stackduo/test/screen_tests/settings_view/settings_subviews/wallet_settings_view_screen_test.dart. +// in stackwallet/test/screen_tests/settings_view/settings_subviews/wallet_settings_view_screen_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i9; -import 'dart:ui' as _i15; +import 'dart:async' as _i8; +import 'dart:ui' as _i14; -import 'package:local_auth/auth_strings.dart' as _i12; -import 'package:local_auth/local_auth.dart' as _i11; +import 'package:local_auth/auth_strings.dart' as _i11; +import 'package:local_auth/local_auth.dart' as _i10; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackduo/electrumx_rpc/cached_electrumx.dart' as _i7; -import 'package:stackduo/electrumx_rpc/electrumx.dart' as _i8; -import 'package:stackduo/models/balance.dart' as _i5; -import 'package:stackduo/models/isar/models/isar_models.dart' as _i17; -import 'package:stackduo/models/models.dart' as _i4; -import 'package:stackduo/services/coins/coin_service.dart' as _i3; -import 'package:stackduo/services/coins/manager.dart' as _i16; -import 'package:stackduo/services/wallets_service.dart' as _i14; -import 'package:stackduo/utilities/amount/amount.dart' as _i6; -import 'package:stackduo/utilities/biometrics.dart' as _i13; -import 'package:stackduo/utilities/enums/coin_enum.dart' as _i10; -import 'package:stackduo/utilities/prefs.dart' as _i2; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i7; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i2; +import 'package:stackwallet/models/balance.dart' as _i5; +import 'package:stackwallet/models/isar/models/isar_models.dart' as _i16; +import 'package:stackwallet/models/models.dart' as _i4; +import 'package:stackwallet/services/coins/coin_service.dart' as _i3; +import 'package:stackwallet/services/coins/manager.dart' as _i15; +import 'package:stackwallet/services/wallets_service.dart' as _i13; +import 'package:stackwallet/utilities/amount/amount.dart' as _i6; +import 'package:stackwallet/utilities/biometrics.dart' as _i12; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i9; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -33,8 +32,8 @@ import 'package:stackduo/utilities/prefs.dart' as _i2; // ignore_for_file: camel_case_types // ignore_for_file: subtype_of_sealed_class -class _FakePrefs_0 extends _i1.SmartFake implements _i2.Prefs { - _FakePrefs_0( +class _FakeElectrumX_0 extends _i1.SmartFake implements _i2.ElectrumX { + _FakeElectrumX_0( Object parent, Invocation parentInvocation, ) : super( @@ -93,38 +92,18 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX { } @override - String get server => (super.noSuchMethod( - Invocation.getter(#server), - returnValue: '', - ) as String); - @override - int get port => (super.noSuchMethod( - Invocation.getter(#port), - returnValue: 0, - ) as int); - @override - bool get useSSL => (super.noSuchMethod( - Invocation.getter(#useSSL), - returnValue: false, - ) as bool); - @override - _i2.Prefs get prefs => (super.noSuchMethod( - Invocation.getter(#prefs), - returnValue: _FakePrefs_0( + _i2.ElectrumX get electrumXClient => (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumX_0( this, - Invocation.getter(#prefs), + Invocation.getter(#electrumXClient), ), - ) as _i2.Prefs); - @override - List<_i8.ElectrumXNode> get failovers => (super.noSuchMethod( - Invocation.getter(#failovers), - returnValue: <_i8.ElectrumXNode>[], - ) as List<_i8.ElectrumXNode>); + ) as _i2.ElectrumX); @override - _i9.Future> getAnonymitySet({ + _i8.Future> getAnonymitySet({ required String? groupId, String? blockhash = r'', - required _i10.Coin? coin, + required _i9.Coin? coin, }) => (super.noSuchMethod( Invocation.method( @@ -137,8 +116,8 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX { }, ), returnValue: - _i9.Future>.value({}), - ) as _i9.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override String base64ToHex(String? source) => (super.noSuchMethod( Invocation.method( @@ -156,9 +135,9 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX { returnValue: '', ) as String); @override - _i9.Future> getTransaction({ + _i8.Future> getTransaction({ required String? txHash, - required _i10.Coin? coin, + required _i9.Coin? coin, bool? verbose = true, }) => (super.noSuchMethod( @@ -172,11 +151,11 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX { }, ), returnValue: - _i9.Future>.value({}), - ) as _i9.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i9.Future> getUsedCoinSerials({ - required _i10.Coin? coin, + _i8.Future> getUsedCoinSerials({ + required _i9.Coin? coin, int? startNumber = 0, }) => (super.noSuchMethod( @@ -188,43 +167,43 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX { #startNumber: startNumber, }, ), - returnValue: _i9.Future>.value([]), - ) as _i9.Future>); + returnValue: _i8.Future>.value([]), + ) as _i8.Future>); @override - _i9.Future clearSharedTransactionCache({required _i10.Coin? coin}) => + _i8.Future clearSharedTransactionCache({required _i9.Coin? coin}) => (super.noSuchMethod( Invocation.method( #clearSharedTransactionCache, [], {#coin: coin}, ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); } /// A class which mocks [LocalAuthentication]. /// /// See the documentation for Mockito's code generation for more information. class MockLocalAuthentication extends _i1.Mock - implements _i11.LocalAuthentication { + implements _i10.LocalAuthentication { MockLocalAuthentication() { _i1.throwOnMissingStub(this); } @override - _i9.Future get canCheckBiometrics => (super.noSuchMethod( + _i8.Future get canCheckBiometrics => (super.noSuchMethod( Invocation.getter(#canCheckBiometrics), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i9.Future authenticateWithBiometrics({ + _i8.Future authenticateWithBiometrics({ required String? localizedReason, bool? useErrorDialogs = true, bool? stickyAuth = false, - _i12.AndroidAuthMessages? androidAuthStrings = - const _i12.AndroidAuthMessages(), - _i12.IOSAuthMessages? iOSAuthStrings = const _i12.IOSAuthMessages(), + _i11.AndroidAuthMessages? androidAuthStrings = + const _i11.AndroidAuthMessages(), + _i11.IOSAuthMessages? iOSAuthStrings = const _i11.IOSAuthMessages(), bool? sensitiveTransaction = true, }) => (super.noSuchMethod( @@ -240,16 +219,16 @@ class MockLocalAuthentication extends _i1.Mock #sensitiveTransaction: sensitiveTransaction, }, ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i9.Future authenticate({ + _i8.Future authenticate({ required String? localizedReason, bool? useErrorDialogs = true, bool? stickyAuth = false, - _i12.AndroidAuthMessages? androidAuthStrings = - const _i12.AndroidAuthMessages(), - _i12.IOSAuthMessages? iOSAuthStrings = const _i12.IOSAuthMessages(), + _i11.AndroidAuthMessages? androidAuthStrings = + const _i11.AndroidAuthMessages(), + _i11.IOSAuthMessages? iOSAuthStrings = const _i11.IOSAuthMessages(), bool? sensitiveTransaction = true, bool? biometricOnly = false, }) => @@ -267,46 +246,46 @@ class MockLocalAuthentication extends _i1.Mock #biometricOnly: biometricOnly, }, ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i9.Future stopAuthentication() => (super.noSuchMethod( + _i8.Future stopAuthentication() => (super.noSuchMethod( Invocation.method( #stopAuthentication, [], ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i9.Future isDeviceSupported() => (super.noSuchMethod( + _i8.Future isDeviceSupported() => (super.noSuchMethod( Invocation.method( #isDeviceSupported, [], ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i9.Future> getAvailableBiometrics() => + _i8.Future> getAvailableBiometrics() => (super.noSuchMethod( Invocation.method( #getAvailableBiometrics, [], ), returnValue: - _i9.Future>.value(<_i11.BiometricType>[]), - ) as _i9.Future>); + _i8.Future>.value(<_i10.BiometricType>[]), + ) as _i8.Future>); } /// A class which mocks [Biometrics]. /// /// See the documentation for Mockito's code generation for more information. -class MockBiometrics extends _i1.Mock implements _i13.Biometrics { +class MockBiometrics extends _i1.Mock implements _i12.Biometrics { MockBiometrics() { _i1.throwOnMissingStub(this); } @override - _i9.Future authenticate({ + _i8.Future authenticate({ required String? cancelButtonText, required String? localizedReason, required String? title, @@ -321,28 +300,28 @@ class MockBiometrics extends _i1.Mock implements _i13.Biometrics { #title: title, }, ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); } /// A class which mocks [WalletsService]. /// /// See the documentation for Mockito's code generation for more information. -class MockWalletsService extends _i1.Mock implements _i14.WalletsService { +class MockWalletsService extends _i1.Mock implements _i13.WalletsService { @override - _i9.Future> get walletNames => + _i8.Future> get walletNames => (super.noSuchMethod( Invocation.getter(#walletNames), - returnValue: _i9.Future>.value( - {}), - ) as _i9.Future>); + returnValue: _i8.Future>.value( + {}), + ) as _i8.Future>); @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, ) as bool); @override - _i9.Future renameWallet({ + _i8.Future renameWallet({ required String? from, required String? to, required bool? shouldNotifyListeners, @@ -357,21 +336,21 @@ class MockWalletsService extends _i1.Mock implements _i14.WalletsService { #shouldNotifyListeners: shouldNotifyListeners, }, ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - Map fetchWalletsData() => (super.noSuchMethod( + Map fetchWalletsData() => (super.noSuchMethod( Invocation.method( #fetchWalletsData, [], ), - returnValue: {}, - ) as Map); + returnValue: {}, + ) as Map); @override - _i9.Future addExistingStackWallet({ + _i8.Future addExistingStackWallet({ required String? name, required String? walletId, - required _i10.Coin? coin, + required _i9.Coin? coin, required bool? shouldNotifyListeners, }) => (super.noSuchMethod( @@ -385,13 +364,13 @@ class MockWalletsService extends _i1.Mock implements _i14.WalletsService { #shouldNotifyListeners: shouldNotifyListeners, }, ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future addNewWallet({ + _i8.Future addNewWallet({ required String? name, - required _i10.Coin? coin, + required _i9.Coin? coin, required bool? shouldNotifyListeners, }) => (super.noSuchMethod( @@ -404,46 +383,46 @@ class MockWalletsService extends _i1.Mock implements _i14.WalletsService { #shouldNotifyListeners: shouldNotifyListeners, }, ), - returnValue: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future> getFavoriteWalletIds() => (super.noSuchMethod( + _i8.Future> getFavoriteWalletIds() => (super.noSuchMethod( Invocation.method( #getFavoriteWalletIds, [], ), - returnValue: _i9.Future>.value([]), - ) as _i9.Future>); + returnValue: _i8.Future>.value([]), + ) as _i8.Future>); @override - _i9.Future saveFavoriteWalletIds(List? walletIds) => + _i8.Future saveFavoriteWalletIds(List? walletIds) => (super.noSuchMethod( Invocation.method( #saveFavoriteWalletIds, [walletIds], ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future addFavorite(String? walletId) => (super.noSuchMethod( + _i8.Future addFavorite(String? walletId) => (super.noSuchMethod( Invocation.method( #addFavorite, [walletId], ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future removeFavorite(String? walletId) => (super.noSuchMethod( + _i8.Future removeFavorite(String? walletId) => (super.noSuchMethod( Invocation.method( #removeFavorite, [walletId], ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future moveFavorite({ + _i8.Future moveFavorite({ required int? fromIndex, required int? toIndex, }) => @@ -456,48 +435,48 @@ class MockWalletsService extends _i1.Mock implements _i14.WalletsService { #toIndex: toIndex, }, ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future checkForDuplicate(String? name) => (super.noSuchMethod( + _i8.Future checkForDuplicate(String? name) => (super.noSuchMethod( Invocation.method( #checkForDuplicate, [name], ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i9.Future getWalletId(String? walletName) => (super.noSuchMethod( + _i8.Future getWalletId(String? walletName) => (super.noSuchMethod( Invocation.method( #getWalletId, [walletName], ), - returnValue: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future isMnemonicVerified({required String? walletId}) => + _i8.Future isMnemonicVerified({required String? walletId}) => (super.noSuchMethod( Invocation.method( #isMnemonicVerified, [], {#walletId: walletId}, ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i9.Future setMnemonicVerified({required String? walletId}) => + _i8.Future setMnemonicVerified({required String? walletId}) => (super.noSuchMethod( Invocation.method( #setMnemonicVerified, [], {#walletId: walletId}, ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future deleteWallet( + _i8.Future deleteWallet( String? name, bool? shouldNotifyListeners, ) => @@ -509,20 +488,20 @@ class MockWalletsService extends _i1.Mock implements _i14.WalletsService { shouldNotifyListeners, ], ), - returnValue: _i9.Future.value(0), - ) as _i9.Future); + returnValue: _i8.Future.value(0), + ) as _i8.Future); @override - _i9.Future refreshWallets(bool? shouldNotifyListeners) => + _i8.Future refreshWallets(bool? shouldNotifyListeners) => (super.noSuchMethod( Invocation.method( #refreshWallets, [shouldNotifyListeners], ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - void addListener(_i15.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i14.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -530,7 +509,7 @@ class MockWalletsService extends _i1.Mock implements _i14.WalletsService { returnValueForMissingStub: null, ); @override - void removeListener(_i15.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i14.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -558,7 +537,7 @@ class MockWalletsService extends _i1.Mock implements _i14.WalletsService { /// A class which mocks [Manager]. /// /// See the documentation for Mockito's code generation for more information. -class MockManager extends _i1.Mock implements _i16.Manager { +class MockManager extends _i1.Mock implements _i15.Manager { @override bool get isActiveWallet => (super.noSuchMethod( Invocation.getter(#isActiveWallet), @@ -586,10 +565,10 @@ class MockManager extends _i1.Mock implements _i16.Manager { returnValue: false, ) as bool); @override - _i10.Coin get coin => (super.noSuchMethod( + _i9.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i10.Coin.bitcoin, - ) as _i10.Coin); + returnValue: _i9.Coin.bitcoin, + ) as _i9.Coin); @override bool get isRefreshing => (super.noSuchMethod( Invocation.getter(#isRefreshing), @@ -622,23 +601,23 @@ class MockManager extends _i1.Mock implements _i16.Manager { returnValueForMissingStub: null, ); @override - _i9.Future<_i4.FeeObject> get fees => (super.noSuchMethod( + _i8.Future<_i4.FeeObject> get fees => (super.noSuchMethod( Invocation.getter(#fees), - returnValue: _i9.Future<_i4.FeeObject>.value(_FakeFeeObject_2( + returnValue: _i8.Future<_i4.FeeObject>.value(_FakeFeeObject_2( this, Invocation.getter(#fees), )), - ) as _i9.Future<_i4.FeeObject>); + ) as _i8.Future<_i4.FeeObject>); @override - _i9.Future get maxFee => (super.noSuchMethod( + _i8.Future get maxFee => (super.noSuchMethod( Invocation.getter(#maxFee), - returnValue: _i9.Future.value(0), - ) as _i9.Future); + returnValue: _i8.Future.value(0), + ) as _i8.Future); @override - _i9.Future get currentReceivingAddress => (super.noSuchMethod( + _i8.Future get currentReceivingAddress => (super.noSuchMethod( Invocation.getter(#currentReceivingAddress), - returnValue: _i9.Future.value(''), - ) as _i9.Future); + returnValue: _i8.Future.value(''), + ) as _i8.Future); @override _i5.Balance get balance => (super.noSuchMethod( Invocation.getter(#balance), @@ -648,16 +627,16 @@ class MockManager extends _i1.Mock implements _i16.Manager { ), ) as _i5.Balance); @override - _i9.Future> get transactions => (super.noSuchMethod( + _i8.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), returnValue: - _i9.Future>.value(<_i17.Transaction>[]), - ) as _i9.Future>); + _i8.Future>.value(<_i16.Transaction>[]), + ) as _i8.Future>); @override - _i9.Future> get utxos => (super.noSuchMethod( + _i8.Future> get utxos => (super.noSuchMethod( Invocation.getter(#utxos), - returnValue: _i9.Future>.value(<_i17.UTXO>[]), - ) as _i9.Future>); + returnValue: _i8.Future>.value(<_i16.UTXO>[]), + ) as _i8.Future>); @override set walletName(String? newName) => super.noSuchMethod( Invocation.setter( @@ -677,15 +656,15 @@ class MockManager extends _i1.Mock implements _i16.Manager { returnValue: '', ) as String); @override - _i9.Future> get mnemonic => (super.noSuchMethod( + _i8.Future> get mnemonic => (super.noSuchMethod( Invocation.getter(#mnemonic), - returnValue: _i9.Future>.value([]), - ) as _i9.Future>); + returnValue: _i8.Future>.value([]), + ) as _i8.Future>); @override - _i9.Future get mnemonicPassphrase => (super.noSuchMethod( + _i8.Future get mnemonicPassphrase => (super.noSuchMethod( Invocation.getter(#mnemonicPassphrase), - returnValue: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + ) as _i8.Future); @override bool get isConnected => (super.noSuchMethod( Invocation.getter(#isConnected), @@ -707,6 +686,11 @@ class MockManager extends _i1.Mock implements _i16.Manager { returnValue: false, ) as bool); @override + bool get hasTokenSupport => (super.noSuchMethod( + Invocation.getter(#hasTokenSupport), + returnValue: false, + ) as bool); + @override bool get hasWhirlpoolSupport => (super.noSuchMethod( Invocation.getter(#hasWhirlpoolSupport), returnValue: false, @@ -722,24 +706,24 @@ class MockManager extends _i1.Mock implements _i16.Manager { returnValue: false, ) as bool); @override - _i9.Future get xpub => (super.noSuchMethod( + _i8.Future get xpub => (super.noSuchMethod( Invocation.getter(#xpub), - returnValue: _i9.Future.value(''), - ) as _i9.Future); + returnValue: _i8.Future.value(''), + ) as _i8.Future); @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, ) as bool); @override - _i9.Future updateNode(bool? shouldRefresh) => (super.noSuchMethod( + _i8.Future updateNode(bool? shouldRefresh) => (super.noSuchMethod( Invocation.method( #updateNode, [shouldRefresh], ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override void dispose() => super.noSuchMethod( Invocation.method( @@ -749,7 +733,7 @@ class MockManager extends _i1.Mock implements _i16.Manager { returnValueForMissingStub: null, ); @override - _i9.Future> prepareSend({ + _i8.Future> prepareSend({ required String? address, required _i6.Amount? amount, Map? args, @@ -765,27 +749,27 @@ class MockManager extends _i1.Mock implements _i16.Manager { }, ), returnValue: - _i9.Future>.value({}), - ) as _i9.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i9.Future confirmSend({required Map? txData}) => + _i8.Future confirmSend({required Map? txData}) => (super.noSuchMethod( Invocation.method( #confirmSend, [], {#txData: txData}, ), - returnValue: _i9.Future.value(''), - ) as _i9.Future); + returnValue: _i8.Future.value(''), + ) as _i8.Future); @override - _i9.Future refresh() => (super.noSuchMethod( + _i8.Future refresh() => (super.noSuchMethod( Invocation.method( #refresh, [], ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override bool validateAddress(String? address) => (super.noSuchMethod( Invocation.method( @@ -795,33 +779,33 @@ class MockManager extends _i1.Mock implements _i16.Manager { returnValue: false, ) as bool); @override - _i9.Future testNetworkConnection() => (super.noSuchMethod( + _i8.Future testNetworkConnection() => (super.noSuchMethod( Invocation.method( #testNetworkConnection, [], ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i9.Future initializeNew() => (super.noSuchMethod( + _i8.Future initializeNew() => (super.noSuchMethod( Invocation.method( #initializeNew, [], ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future initializeExisting() => (super.noSuchMethod( + _i8.Future initializeExisting() => (super.noSuchMethod( Invocation.method( #initializeExisting, [], ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future recoverFromMnemonic({ + _i8.Future recoverFromMnemonic({ required String? mnemonic, String? mnemonicPassphrase, required int? maxUnusedAddressGap, @@ -840,20 +824,20 @@ class MockManager extends _i1.Mock implements _i16.Manager { #height: height, }, ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future exitCurrentWallet() => (super.noSuchMethod( + _i8.Future exitCurrentWallet() => (super.noSuchMethod( Invocation.method( #exitCurrentWallet, [], ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future fullRescan( + _i8.Future fullRescan( int? maxUnusedAddressGap, int? maxNumberOfIndexesToCheck, ) => @@ -865,11 +849,11 @@ class MockManager extends _i1.Mock implements _i16.Manager { maxNumberOfIndexesToCheck, ], ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i9.Future<_i6.Amount> estimateFeeFor( + _i8.Future<_i6.Amount> estimateFeeFor( _i6.Amount? amount, int? feeRate, ) => @@ -881,7 +865,7 @@ class MockManager extends _i1.Mock implements _i16.Manager { feeRate, ], ), - returnValue: _i9.Future<_i6.Amount>.value(_FakeAmount_4( + returnValue: _i8.Future<_i6.Amount>.value(_FakeAmount_4( this, Invocation.method( #estimateFeeFor, @@ -891,26 +875,26 @@ class MockManager extends _i1.Mock implements _i16.Manager { ], ), )), - ) as _i9.Future<_i6.Amount>); + ) as _i8.Future<_i6.Amount>); @override - _i9.Future generateNewAddress() => (super.noSuchMethod( + _i8.Future generateNewAddress() => (super.noSuchMethod( Invocation.method( #generateNewAddress, [], ), - returnValue: _i9.Future.value(false), - ) as _i9.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i9.Future resetRescanOnOpen() => (super.noSuchMethod( + _i8.Future resetRescanOnOpen() => (super.noSuchMethod( Invocation.method( #resetRescanOnOpen, [], ), - returnValue: _i9.Future.value(), - returnValueForMissingStub: _i9.Future.value(), - ) as _i9.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - void addListener(_i15.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i14.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -918,7 +902,7 @@ class MockManager extends _i1.Mock implements _i16.Manager { returnValueForMissingStub: null, ); @override - void removeListener(_i15.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i14.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], diff --git a/test/services/coins/bitcoin/bitcoin_wallet_test.mocks.dart b/test/services/coins/bitcoin/bitcoin_wallet_test.mocks.dart index 139ef28fd..f88574029 100644 --- a/test/services/coins/bitcoin/bitcoin_wallet_test.mocks.dart +++ b/test/services/coins/bitcoin/bitcoin_wallet_test.mocks.dart @@ -1,17 +1,17 @@ // Mocks generated by Mockito 5.3.2 from annotations -// in stackduo/test/services/coins/bitcoin/bitcoin_wallet_test.dart. +// in stackwallet/test/services/coins/bitcoin/bitcoin_wallet_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i5; +import 'dart:async' as _i4; import 'package:decimal/decimal.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackduo/electrumx_rpc/cached_electrumx.dart' as _i6; -import 'package:stackduo/electrumx_rpc/electrumx.dart' as _i4; -import 'package:stackduo/services/transaction_notification_tracker.dart' as _i8; -import 'package:stackduo/utilities/enums/coin_enum.dart' as _i7; -import 'package:stackduo/utilities/prefs.dart' as _i3; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i5; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i3; +import 'package:stackwallet/services/transaction_notification_tracker.dart' + as _i7; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i6; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -34,8 +34,8 @@ class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal { ); } -class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { - _FakePrefs_1( +class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX { + _FakeElectrumX_1( Object parent, Invocation parentInvocation, ) : super( @@ -47,13 +47,13 @@ class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { /// A class which mocks [ElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { +class MockElectrumX extends _i1.Mock implements _i3.ElectrumX { MockElectrumX() { _i1.throwOnMissingStub(this); } @override - set failovers(List<_i4.ElectrumXNode>? _failovers) => super.noSuchMethod( + set failovers(List<_i3.ElectrumXNode>? _failovers) => super.noSuchMethod( Invocation.setter( #failovers, _failovers, @@ -89,7 +89,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { returnValue: false, ) as bool); @override - _i5.Future request({ + _i4.Future request({ required String? command, List? args = const [], Duration? connectionTimeout = const Duration(seconds: 60), @@ -108,10 +108,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future>> batchRequest({ + _i4.Future>> batchRequest({ required String? command, required Map>? args, Duration? connectionTimeout = const Duration(seconds: 60), @@ -128,11 +128,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future ping({ + _i4.Future ping({ String? requestID, int? retryCount = 1, }) => @@ -145,10 +145,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retryCount: retryCount, }, ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + returnValue: _i4.Future.value(false), + ) as _i4.Future); @override - _i5.Future> getBlockHeadTip({String? requestID}) => + _i4.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( Invocation.method( #getBlockHeadTip, @@ -156,10 +156,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getServerFeatures({String? requestID}) => + _i4.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( Invocation.method( #getServerFeatures, @@ -167,10 +167,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future broadcastTransaction({ + _i4.Future broadcastTransaction({ required String? rawTx, String? requestID, }) => @@ -183,10 +183,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future.value(''), - ) as _i5.Future); + returnValue: _i4.Future.value(''), + ) as _i4.Future); @override - _i5.Future> getBalance({ + _i4.Future> getBalance({ required String? scripthash, String? requestID, }) => @@ -200,10 +200,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future>> getHistory({ + _i4.Future>> getHistory({ required String? scripthash, String? requestID, }) => @@ -216,11 +216,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future>>> getBatchHistory( + _i4.Future>>> getBatchHistory( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -228,11 +228,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i5.Future>>>.value( + returnValue: _i4.Future>>>.value( >>{}), - ) as _i5.Future>>>); + ) as _i4.Future>>>); @override - _i5.Future>> getUTXOs({ + _i4.Future>> getUTXOs({ required String? scripthash, String? requestID, }) => @@ -245,11 +245,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future>>> getBatchUTXOs( + _i4.Future>>> getBatchUTXOs( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -257,11 +257,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i5.Future>>>.value( + returnValue: _i4.Future>>>.value( >>{}), - ) as _i5.Future>>>); + ) as _i4.Future>>>); @override - _i5.Future> getTransaction({ + _i4.Future> getTransaction({ required String? txHash, bool? verbose = true, String? requestID, @@ -277,10 +277,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getAnonymitySet({ + _i4.Future> getAnonymitySet({ String? groupId = r'1', String? blockhash = r'', String? requestID, @@ -296,10 +296,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future getMintData({ + _i4.Future getMintData({ dynamic mints, String? requestID, }) => @@ -312,10 +312,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future> getUsedCoinSerials({ + _i4.Future> getUsedCoinSerials({ String? requestID, required int? startNumber, }) => @@ -329,19 +329,19 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( + _i4.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i5.Future.value(0), - ) as _i5.Future); + returnValue: _i4.Future.value(0), + ) as _i4.Future); @override - _i5.Future> getFeeRate({String? requestID}) => + _i4.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( Invocation.method( #getFeeRate, @@ -349,10 +349,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future<_i2.Decimal> estimateFee({ + _i4.Future<_i2.Decimal> estimateFee({ String? requestID, required int? blocks, }) => @@ -365,7 +365,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #blocks: blocks, }, ), - returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #estimateFee, @@ -376,15 +376,15 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), )), - ) as _i5.Future<_i2.Decimal>); + ) as _i4.Future<_i2.Decimal>); @override - _i5.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + _i4.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( Invocation.method( #relayFee, [], {#requestID: requestID}, ), - returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #relayFee, @@ -392,50 +392,30 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), )), - ) as _i5.Future<_i2.Decimal>); + ) as _i4.Future<_i2.Decimal>); } /// A class which mocks [CachedElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { +class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX { MockCachedElectrumX() { _i1.throwOnMissingStub(this); } @override - String get server => (super.noSuchMethod( - Invocation.getter(#server), - returnValue: '', - ) as String); - @override - int get port => (super.noSuchMethod( - Invocation.getter(#port), - returnValue: 0, - ) as int); - @override - bool get useSSL => (super.noSuchMethod( - Invocation.getter(#useSSL), - returnValue: false, - ) as bool); - @override - _i3.Prefs get prefs => (super.noSuchMethod( - Invocation.getter(#prefs), - returnValue: _FakePrefs_1( + _i3.ElectrumX get electrumXClient => (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumX_1( this, - Invocation.getter(#prefs), + Invocation.getter(#electrumXClient), ), - ) as _i3.Prefs); - @override - List<_i4.ElectrumXNode> get failovers => (super.noSuchMethod( - Invocation.getter(#failovers), - returnValue: <_i4.ElectrumXNode>[], - ) as List<_i4.ElectrumXNode>); + ) as _i3.ElectrumX); @override - _i5.Future> getAnonymitySet({ + _i4.Future> getAnonymitySet({ required String? groupId, String? blockhash = r'', - required _i7.Coin? coin, + required _i6.Coin? coin, }) => (super.noSuchMethod( Invocation.method( @@ -448,8 +428,8 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override String base64ToHex(String? source) => (super.noSuchMethod( Invocation.method( @@ -467,9 +447,9 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { returnValue: '', ) as String); @override - _i5.Future> getTransaction({ + _i4.Future> getTransaction({ required String? txHash, - required _i7.Coin? coin, + required _i6.Coin? coin, bool? verbose = true, }) => (super.noSuchMethod( @@ -483,11 +463,11 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getUsedCoinSerials({ - required _i7.Coin? coin, + _i4.Future> getUsedCoinSerials({ + required _i6.Coin? coin, int? startNumber = 0, }) => (super.noSuchMethod( @@ -499,26 +479,26 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { #startNumber: startNumber, }, ), - returnValue: _i5.Future>.value([]), - ) as _i5.Future>); + returnValue: _i4.Future>.value([]), + ) as _i4.Future>); @override - _i5.Future clearSharedTransactionCache({required _i7.Coin? coin}) => + _i4.Future clearSharedTransactionCache({required _i6.Coin? coin}) => (super.noSuchMethod( Invocation.method( #clearSharedTransactionCache, [], {#coin: coin}, ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [TransactionNotificationTracker]. /// /// See the documentation for Mockito's code generation for more information. class MockTransactionNotificationTracker extends _i1.Mock - implements _i8.TransactionNotificationTracker { + implements _i7.TransactionNotificationTracker { MockTransactionNotificationTracker() { _i1.throwOnMissingStub(this); } @@ -547,14 +527,14 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i5.Future addNotifiedPending(String? txid) => (super.noSuchMethod( + _i4.Future addNotifiedPending(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedPending, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( @@ -564,21 +544,21 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i5.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( + _i4.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedConfirmed, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future deleteTransaction(String? txid) => (super.noSuchMethod( + _i4.Future deleteTransaction(String? txid) => (super.noSuchMethod( Invocation.method( #deleteTransaction, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } diff --git a/test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart b/test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart new file mode 100644 index 000000000..2e39e6916 --- /dev/null +++ b/test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart @@ -0,0 +1,564 @@ +// Mocks generated by Mockito 5.3.2 from annotations +// in stackwallet/test/services/coins/bitcoincash/bitcoincash_wallet_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i4; + +import 'package:decimal/decimal.dart' as _i2; +import 'package:mockito/mockito.dart' as _i1; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i5; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i3; +import 'package:stackwallet/services/transaction_notification_tracker.dart' + as _i7; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i6; + +// 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 + +class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal { + _FakeDecimal_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX { + _FakeElectrumX_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [ElectrumX]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockElectrumX extends _i1.Mock implements _i3.ElectrumX { + MockElectrumX() { + _i1.throwOnMissingStub(this); + } + + @override + set failovers(List<_i3.ElectrumXNode>? _failovers) => super.noSuchMethod( + Invocation.setter( + #failovers, + _failovers, + ), + returnValueForMissingStub: null, + ); + @override + int get currentFailoverIndex => (super.noSuchMethod( + Invocation.getter(#currentFailoverIndex), + returnValue: 0, + ) as int); + @override + set currentFailoverIndex(int? _currentFailoverIndex) => super.noSuchMethod( + Invocation.setter( + #currentFailoverIndex, + _currentFailoverIndex, + ), + returnValueForMissingStub: null, + ); + @override + String get host => (super.noSuchMethod( + Invocation.getter(#host), + returnValue: '', + ) as String); + @override + int get port => (super.noSuchMethod( + Invocation.getter(#port), + returnValue: 0, + ) as int); + @override + bool get useSSL => (super.noSuchMethod( + Invocation.getter(#useSSL), + returnValue: false, + ) as bool); + @override + _i4.Future request({ + required String? command, + List? args = const [], + Duration? connectionTimeout = const Duration(seconds: 60), + String? requestID, + int? retries = 2, + }) => + (super.noSuchMethod( + Invocation.method( + #request, + [], + { + #command: command, + #args: args, + #connectionTimeout: connectionTimeout, + #requestID: requestID, + #retries: retries, + }, + ), + returnValue: _i4.Future.value(), + ) as _i4.Future); + @override + _i4.Future>> batchRequest({ + required String? command, + required Map>? args, + Duration? connectionTimeout = const Duration(seconds: 60), + int? retries = 2, + }) => + (super.noSuchMethod( + Invocation.method( + #batchRequest, + [], + { + #command: command, + #args: args, + #connectionTimeout: connectionTimeout, + #retries: retries, + }, + ), + returnValue: _i4.Future>>.value( + >[]), + ) as _i4.Future>>); + @override + _i4.Future ping({ + String? requestID, + int? retryCount = 1, + }) => + (super.noSuchMethod( + Invocation.method( + #ping, + [], + { + #requestID: requestID, + #retryCount: retryCount, + }, + ), + returnValue: _i4.Future.value(false), + ) as _i4.Future); + @override + _i4.Future> getBlockHeadTip({String? requestID}) => + (super.noSuchMethod( + Invocation.method( + #getBlockHeadTip, + [], + {#requestID: requestID}, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future> getServerFeatures({String? requestID}) => + (super.noSuchMethod( + Invocation.method( + #getServerFeatures, + [], + {#requestID: requestID}, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future broadcastTransaction({ + required String? rawTx, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #broadcastTransaction, + [], + { + #rawTx: rawTx, + #requestID: requestID, + }, + ), + returnValue: _i4.Future.value(''), + ) as _i4.Future); + @override + _i4.Future> getBalance({ + required String? scripthash, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getBalance, + [], + { + #scripthash: scripthash, + #requestID: requestID, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future>> getHistory({ + required String? scripthash, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getHistory, + [], + { + #scripthash: scripthash, + #requestID: requestID, + }, + ), + returnValue: _i4.Future>>.value( + >[]), + ) as _i4.Future>>); + @override + _i4.Future>>> getBatchHistory( + {required Map>? args}) => + (super.noSuchMethod( + Invocation.method( + #getBatchHistory, + [], + {#args: args}, + ), + returnValue: _i4.Future>>>.value( + >>{}), + ) as _i4.Future>>>); + @override + _i4.Future>> getUTXOs({ + required String? scripthash, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getUTXOs, + [], + { + #scripthash: scripthash, + #requestID: requestID, + }, + ), + returnValue: _i4.Future>>.value( + >[]), + ) as _i4.Future>>); + @override + _i4.Future>>> getBatchUTXOs( + {required Map>? args}) => + (super.noSuchMethod( + Invocation.method( + #getBatchUTXOs, + [], + {#args: args}, + ), + returnValue: _i4.Future>>>.value( + >>{}), + ) as _i4.Future>>>); + @override + _i4.Future> getTransaction({ + required String? txHash, + bool? verbose = true, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getTransaction, + [], + { + #txHash: txHash, + #verbose: verbose, + #requestID: requestID, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future> getAnonymitySet({ + String? groupId = r'1', + String? blockhash = r'', + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getAnonymitySet, + [], + { + #groupId: groupId, + #blockhash: blockhash, + #requestID: requestID, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future getMintData({ + dynamic mints, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getMintData, + [], + { + #mints: mints, + #requestID: requestID, + }, + ), + returnValue: _i4.Future.value(), + ) as _i4.Future); + @override + _i4.Future> getUsedCoinSerials({ + String? requestID, + required int? startNumber, + }) => + (super.noSuchMethod( + Invocation.method( + #getUsedCoinSerials, + [], + { + #requestID: requestID, + #startNumber: startNumber, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( + Invocation.method( + #getLatestCoinId, + [], + {#requestID: requestID}, + ), + returnValue: _i4.Future.value(0), + ) as _i4.Future); + @override + _i4.Future> getFeeRate({String? requestID}) => + (super.noSuchMethod( + Invocation.method( + #getFeeRate, + [], + {#requestID: requestID}, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future<_i2.Decimal> estimateFee({ + String? requestID, + required int? blocks, + }) => + (super.noSuchMethod( + Invocation.method( + #estimateFee, + [], + { + #requestID: requestID, + #blocks: blocks, + }, + ), + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( + this, + Invocation.method( + #estimateFee, + [], + { + #requestID: requestID, + #blocks: blocks, + }, + ), + )), + ) as _i4.Future<_i2.Decimal>); + @override + _i4.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + Invocation.method( + #relayFee, + [], + {#requestID: requestID}, + ), + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( + this, + Invocation.method( + #relayFee, + [], + {#requestID: requestID}, + ), + )), + ) as _i4.Future<_i2.Decimal>); +} + +/// A class which mocks [CachedElectrumX]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX { + MockCachedElectrumX() { + _i1.throwOnMissingStub(this); + } + + @override + _i3.ElectrumX get electrumXClient => (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumX_1( + this, + Invocation.getter(#electrumXClient), + ), + ) as _i3.ElectrumX); + @override + _i4.Future> getAnonymitySet({ + required String? groupId, + String? blockhash = r'', + required _i6.Coin? coin, + }) => + (super.noSuchMethod( + Invocation.method( + #getAnonymitySet, + [], + { + #groupId: groupId, + #blockhash: blockhash, + #coin: coin, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + String base64ToHex(String? source) => (super.noSuchMethod( + Invocation.method( + #base64ToHex, + [source], + ), + returnValue: '', + ) as String); + @override + String base64ToReverseHex(String? source) => (super.noSuchMethod( + Invocation.method( + #base64ToReverseHex, + [source], + ), + returnValue: '', + ) as String); + @override + _i4.Future> getTransaction({ + required String? txHash, + required _i6.Coin? coin, + bool? verbose = true, + }) => + (super.noSuchMethod( + Invocation.method( + #getTransaction, + [], + { + #txHash: txHash, + #coin: coin, + #verbose: verbose, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future> getUsedCoinSerials({ + required _i6.Coin? coin, + int? startNumber = 0, + }) => + (super.noSuchMethod( + Invocation.method( + #getUsedCoinSerials, + [], + { + #coin: coin, + #startNumber: startNumber, + }, + ), + returnValue: _i4.Future>.value([]), + ) as _i4.Future>); + @override + _i4.Future clearSharedTransactionCache({required _i6.Coin? coin}) => + (super.noSuchMethod( + Invocation.method( + #clearSharedTransactionCache, + [], + {#coin: coin}, + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); +} + +/// A class which mocks [TransactionNotificationTracker]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockTransactionNotificationTracker extends _i1.Mock + implements _i7.TransactionNotificationTracker { + MockTransactionNotificationTracker() { + _i1.throwOnMissingStub(this); + } + + @override + String get walletId => (super.noSuchMethod( + Invocation.getter(#walletId), + returnValue: '', + ) as String); + @override + List get pendings => (super.noSuchMethod( + Invocation.getter(#pendings), + returnValue: [], + ) as List); + @override + List get confirmeds => (super.noSuchMethod( + Invocation.getter(#confirmeds), + returnValue: [], + ) as List); + @override + bool wasNotifiedPending(String? txid) => (super.noSuchMethod( + Invocation.method( + #wasNotifiedPending, + [txid], + ), + returnValue: false, + ) as bool); + @override + _i4.Future addNotifiedPending(String? txid) => (super.noSuchMethod( + Invocation.method( + #addNotifiedPending, + [txid], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + @override + bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( + Invocation.method( + #wasNotifiedConfirmed, + [txid], + ), + returnValue: false, + ) as bool); + @override + _i4.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( + Invocation.method( + #addNotifiedConfirmed, + [txid], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + @override + _i4.Future deleteTransaction(String? txid) => (super.noSuchMethod( + Invocation.method( + #deleteTransaction, + [txid], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); +} diff --git a/test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart b/test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart new file mode 100644 index 000000000..cd9adfe0f --- /dev/null +++ b/test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart @@ -0,0 +1,564 @@ +// Mocks generated by Mockito 5.3.2 from annotations +// in stackwallet/test/services/coins/dogecoin/dogecoin_wallet_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i4; + +import 'package:decimal/decimal.dart' as _i2; +import 'package:mockito/mockito.dart' as _i1; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i5; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i3; +import 'package:stackwallet/services/transaction_notification_tracker.dart' + as _i7; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i6; + +// 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 + +class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal { + _FakeDecimal_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX { + _FakeElectrumX_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [ElectrumX]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockElectrumX extends _i1.Mock implements _i3.ElectrumX { + MockElectrumX() { + _i1.throwOnMissingStub(this); + } + + @override + set failovers(List<_i3.ElectrumXNode>? _failovers) => super.noSuchMethod( + Invocation.setter( + #failovers, + _failovers, + ), + returnValueForMissingStub: null, + ); + @override + int get currentFailoverIndex => (super.noSuchMethod( + Invocation.getter(#currentFailoverIndex), + returnValue: 0, + ) as int); + @override + set currentFailoverIndex(int? _currentFailoverIndex) => super.noSuchMethod( + Invocation.setter( + #currentFailoverIndex, + _currentFailoverIndex, + ), + returnValueForMissingStub: null, + ); + @override + String get host => (super.noSuchMethod( + Invocation.getter(#host), + returnValue: '', + ) as String); + @override + int get port => (super.noSuchMethod( + Invocation.getter(#port), + returnValue: 0, + ) as int); + @override + bool get useSSL => (super.noSuchMethod( + Invocation.getter(#useSSL), + returnValue: false, + ) as bool); + @override + _i4.Future request({ + required String? command, + List? args = const [], + Duration? connectionTimeout = const Duration(seconds: 60), + String? requestID, + int? retries = 2, + }) => + (super.noSuchMethod( + Invocation.method( + #request, + [], + { + #command: command, + #args: args, + #connectionTimeout: connectionTimeout, + #requestID: requestID, + #retries: retries, + }, + ), + returnValue: _i4.Future.value(), + ) as _i4.Future); + @override + _i4.Future>> batchRequest({ + required String? command, + required Map>? args, + Duration? connectionTimeout = const Duration(seconds: 60), + int? retries = 2, + }) => + (super.noSuchMethod( + Invocation.method( + #batchRequest, + [], + { + #command: command, + #args: args, + #connectionTimeout: connectionTimeout, + #retries: retries, + }, + ), + returnValue: _i4.Future>>.value( + >[]), + ) as _i4.Future>>); + @override + _i4.Future ping({ + String? requestID, + int? retryCount = 1, + }) => + (super.noSuchMethod( + Invocation.method( + #ping, + [], + { + #requestID: requestID, + #retryCount: retryCount, + }, + ), + returnValue: _i4.Future.value(false), + ) as _i4.Future); + @override + _i4.Future> getBlockHeadTip({String? requestID}) => + (super.noSuchMethod( + Invocation.method( + #getBlockHeadTip, + [], + {#requestID: requestID}, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future> getServerFeatures({String? requestID}) => + (super.noSuchMethod( + Invocation.method( + #getServerFeatures, + [], + {#requestID: requestID}, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future broadcastTransaction({ + required String? rawTx, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #broadcastTransaction, + [], + { + #rawTx: rawTx, + #requestID: requestID, + }, + ), + returnValue: _i4.Future.value(''), + ) as _i4.Future); + @override + _i4.Future> getBalance({ + required String? scripthash, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getBalance, + [], + { + #scripthash: scripthash, + #requestID: requestID, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future>> getHistory({ + required String? scripthash, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getHistory, + [], + { + #scripthash: scripthash, + #requestID: requestID, + }, + ), + returnValue: _i4.Future>>.value( + >[]), + ) as _i4.Future>>); + @override + _i4.Future>>> getBatchHistory( + {required Map>? args}) => + (super.noSuchMethod( + Invocation.method( + #getBatchHistory, + [], + {#args: args}, + ), + returnValue: _i4.Future>>>.value( + >>{}), + ) as _i4.Future>>>); + @override + _i4.Future>> getUTXOs({ + required String? scripthash, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getUTXOs, + [], + { + #scripthash: scripthash, + #requestID: requestID, + }, + ), + returnValue: _i4.Future>>.value( + >[]), + ) as _i4.Future>>); + @override + _i4.Future>>> getBatchUTXOs( + {required Map>? args}) => + (super.noSuchMethod( + Invocation.method( + #getBatchUTXOs, + [], + {#args: args}, + ), + returnValue: _i4.Future>>>.value( + >>{}), + ) as _i4.Future>>>); + @override + _i4.Future> getTransaction({ + required String? txHash, + bool? verbose = true, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getTransaction, + [], + { + #txHash: txHash, + #verbose: verbose, + #requestID: requestID, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future> getAnonymitySet({ + String? groupId = r'1', + String? blockhash = r'', + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getAnonymitySet, + [], + { + #groupId: groupId, + #blockhash: blockhash, + #requestID: requestID, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future getMintData({ + dynamic mints, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getMintData, + [], + { + #mints: mints, + #requestID: requestID, + }, + ), + returnValue: _i4.Future.value(), + ) as _i4.Future); + @override + _i4.Future> getUsedCoinSerials({ + String? requestID, + required int? startNumber, + }) => + (super.noSuchMethod( + Invocation.method( + #getUsedCoinSerials, + [], + { + #requestID: requestID, + #startNumber: startNumber, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( + Invocation.method( + #getLatestCoinId, + [], + {#requestID: requestID}, + ), + returnValue: _i4.Future.value(0), + ) as _i4.Future); + @override + _i4.Future> getFeeRate({String? requestID}) => + (super.noSuchMethod( + Invocation.method( + #getFeeRate, + [], + {#requestID: requestID}, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future<_i2.Decimal> estimateFee({ + String? requestID, + required int? blocks, + }) => + (super.noSuchMethod( + Invocation.method( + #estimateFee, + [], + { + #requestID: requestID, + #blocks: blocks, + }, + ), + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( + this, + Invocation.method( + #estimateFee, + [], + { + #requestID: requestID, + #blocks: blocks, + }, + ), + )), + ) as _i4.Future<_i2.Decimal>); + @override + _i4.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + Invocation.method( + #relayFee, + [], + {#requestID: requestID}, + ), + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( + this, + Invocation.method( + #relayFee, + [], + {#requestID: requestID}, + ), + )), + ) as _i4.Future<_i2.Decimal>); +} + +/// A class which mocks [CachedElectrumX]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX { + MockCachedElectrumX() { + _i1.throwOnMissingStub(this); + } + + @override + _i3.ElectrumX get electrumXClient => (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumX_1( + this, + Invocation.getter(#electrumXClient), + ), + ) as _i3.ElectrumX); + @override + _i4.Future> getAnonymitySet({ + required String? groupId, + String? blockhash = r'', + required _i6.Coin? coin, + }) => + (super.noSuchMethod( + Invocation.method( + #getAnonymitySet, + [], + { + #groupId: groupId, + #blockhash: blockhash, + #coin: coin, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + String base64ToHex(String? source) => (super.noSuchMethod( + Invocation.method( + #base64ToHex, + [source], + ), + returnValue: '', + ) as String); + @override + String base64ToReverseHex(String? source) => (super.noSuchMethod( + Invocation.method( + #base64ToReverseHex, + [source], + ), + returnValue: '', + ) as String); + @override + _i4.Future> getTransaction({ + required String? txHash, + required _i6.Coin? coin, + bool? verbose = true, + }) => + (super.noSuchMethod( + Invocation.method( + #getTransaction, + [], + { + #txHash: txHash, + #coin: coin, + #verbose: verbose, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future> getUsedCoinSerials({ + required _i6.Coin? coin, + int? startNumber = 0, + }) => + (super.noSuchMethod( + Invocation.method( + #getUsedCoinSerials, + [], + { + #coin: coin, + #startNumber: startNumber, + }, + ), + returnValue: _i4.Future>.value([]), + ) as _i4.Future>); + @override + _i4.Future clearSharedTransactionCache({required _i6.Coin? coin}) => + (super.noSuchMethod( + Invocation.method( + #clearSharedTransactionCache, + [], + {#coin: coin}, + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); +} + +/// A class which mocks [TransactionNotificationTracker]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockTransactionNotificationTracker extends _i1.Mock + implements _i7.TransactionNotificationTracker { + MockTransactionNotificationTracker() { + _i1.throwOnMissingStub(this); + } + + @override + String get walletId => (super.noSuchMethod( + Invocation.getter(#walletId), + returnValue: '', + ) as String); + @override + List get pendings => (super.noSuchMethod( + Invocation.getter(#pendings), + returnValue: [], + ) as List); + @override + List get confirmeds => (super.noSuchMethod( + Invocation.getter(#confirmeds), + returnValue: [], + ) as List); + @override + bool wasNotifiedPending(String? txid) => (super.noSuchMethod( + Invocation.method( + #wasNotifiedPending, + [txid], + ), + returnValue: false, + ) as bool); + @override + _i4.Future addNotifiedPending(String? txid) => (super.noSuchMethod( + Invocation.method( + #addNotifiedPending, + [txid], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + @override + bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( + Invocation.method( + #wasNotifiedConfirmed, + [txid], + ), + returnValue: false, + ) as bool); + @override + _i4.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( + Invocation.method( + #addNotifiedConfirmed, + [txid], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + @override + _i4.Future deleteTransaction(String? txid) => (super.noSuchMethod( + Invocation.method( + #deleteTransaction, + [txid], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); +} diff --git a/test/services/coins/firo/firo_wallet_test.mocks.dart b/test/services/coins/firo/firo_wallet_test.mocks.dart new file mode 100644 index 000000000..56864bfdb --- /dev/null +++ b/test/services/coins/firo/firo_wallet_test.mocks.dart @@ -0,0 +1,1152 @@ +// Mocks generated by Mockito 5.3.2 from annotations +// in stackwallet/test/services/coins/firo/firo_wallet_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i5; + +import 'package:decimal/decimal.dart' as _i2; +import 'package:isar/isar.dart' as _i4; +import 'package:mockito/mockito.dart' as _i1; +import 'package:stackwallet/db/isar/main_db.dart' as _i9; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i6; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i3; +import 'package:stackwallet/models/isar/models/block_explorer.dart' as _i11; +import 'package:stackwallet/models/isar/models/contact_entry.dart' as _i10; +import 'package:stackwallet/models/isar/models/isar_models.dart' as _i12; +import 'package:stackwallet/services/transaction_notification_tracker.dart' + as _i8; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i7; +import 'package:tuple/tuple.dart' as _i13; + +// 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 + +class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal { + _FakeDecimal_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX { + _FakeElectrumX_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeIsar_2 extends _i1.SmartFake implements _i4.Isar { + _FakeIsar_2( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeQueryBuilder_3 extends _i1.SmartFake + implements _i4.QueryBuilder { + _FakeQueryBuilder_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [ElectrumX]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockElectrumX extends _i1.Mock implements _i3.ElectrumX { + MockElectrumX() { + _i1.throwOnMissingStub(this); + } + + @override + set failovers(List<_i3.ElectrumXNode>? _failovers) => super.noSuchMethod( + Invocation.setter( + #failovers, + _failovers, + ), + returnValueForMissingStub: null, + ); + @override + int get currentFailoverIndex => (super.noSuchMethod( + Invocation.getter(#currentFailoverIndex), + returnValue: 0, + ) as int); + @override + set currentFailoverIndex(int? _currentFailoverIndex) => super.noSuchMethod( + Invocation.setter( + #currentFailoverIndex, + _currentFailoverIndex, + ), + returnValueForMissingStub: null, + ); + @override + String get host => (super.noSuchMethod( + Invocation.getter(#host), + returnValue: '', + ) as String); + @override + int get port => (super.noSuchMethod( + Invocation.getter(#port), + returnValue: 0, + ) as int); + @override + bool get useSSL => (super.noSuchMethod( + Invocation.getter(#useSSL), + returnValue: false, + ) as bool); + @override + _i5.Future request({ + required String? command, + List? args = const [], + Duration? connectionTimeout = const Duration(seconds: 60), + String? requestID, + int? retries = 2, + }) => + (super.noSuchMethod( + Invocation.method( + #request, + [], + { + #command: command, + #args: args, + #connectionTimeout: connectionTimeout, + #requestID: requestID, + #retries: retries, + }, + ), + returnValue: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future>> batchRequest({ + required String? command, + required Map>? args, + Duration? connectionTimeout = const Duration(seconds: 60), + int? retries = 2, + }) => + (super.noSuchMethod( + Invocation.method( + #batchRequest, + [], + { + #command: command, + #args: args, + #connectionTimeout: connectionTimeout, + #retries: retries, + }, + ), + returnValue: _i5.Future>>.value( + >[]), + ) as _i5.Future>>); + @override + _i5.Future ping({ + String? requestID, + int? retryCount = 1, + }) => + (super.noSuchMethod( + Invocation.method( + #ping, + [], + { + #requestID: requestID, + #retryCount: retryCount, + }, + ), + returnValue: _i5.Future.value(false), + ) as _i5.Future); + @override + _i5.Future> getBlockHeadTip({String? requestID}) => + (super.noSuchMethod( + Invocation.method( + #getBlockHeadTip, + [], + {#requestID: requestID}, + ), + returnValue: + _i5.Future>.value({}), + ) as _i5.Future>); + @override + _i5.Future> getServerFeatures({String? requestID}) => + (super.noSuchMethod( + Invocation.method( + #getServerFeatures, + [], + {#requestID: requestID}, + ), + returnValue: + _i5.Future>.value({}), + ) as _i5.Future>); + @override + _i5.Future broadcastTransaction({ + required String? rawTx, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #broadcastTransaction, + [], + { + #rawTx: rawTx, + #requestID: requestID, + }, + ), + returnValue: _i5.Future.value(''), + ) as _i5.Future); + @override + _i5.Future> getBalance({ + required String? scripthash, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getBalance, + [], + { + #scripthash: scripthash, + #requestID: requestID, + }, + ), + returnValue: + _i5.Future>.value({}), + ) as _i5.Future>); + @override + _i5.Future>> getHistory({ + required String? scripthash, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getHistory, + [], + { + #scripthash: scripthash, + #requestID: requestID, + }, + ), + returnValue: _i5.Future>>.value( + >[]), + ) as _i5.Future>>); + @override + _i5.Future>>> getBatchHistory( + {required Map>? args}) => + (super.noSuchMethod( + Invocation.method( + #getBatchHistory, + [], + {#args: args}, + ), + returnValue: _i5.Future>>>.value( + >>{}), + ) as _i5.Future>>>); + @override + _i5.Future>> getUTXOs({ + required String? scripthash, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getUTXOs, + [], + { + #scripthash: scripthash, + #requestID: requestID, + }, + ), + returnValue: _i5.Future>>.value( + >[]), + ) as _i5.Future>>); + @override + _i5.Future>>> getBatchUTXOs( + {required Map>? args}) => + (super.noSuchMethod( + Invocation.method( + #getBatchUTXOs, + [], + {#args: args}, + ), + returnValue: _i5.Future>>>.value( + >>{}), + ) as _i5.Future>>>); + @override + _i5.Future> getTransaction({ + required String? txHash, + bool? verbose = true, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getTransaction, + [], + { + #txHash: txHash, + #verbose: verbose, + #requestID: requestID, + }, + ), + returnValue: + _i5.Future>.value({}), + ) as _i5.Future>); + @override + _i5.Future> getAnonymitySet({ + String? groupId = r'1', + String? blockhash = r'', + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getAnonymitySet, + [], + { + #groupId: groupId, + #blockhash: blockhash, + #requestID: requestID, + }, + ), + returnValue: + _i5.Future>.value({}), + ) as _i5.Future>); + @override + _i5.Future getMintData({ + dynamic mints, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getMintData, + [], + { + #mints: mints, + #requestID: requestID, + }, + ), + returnValue: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future> getUsedCoinSerials({ + String? requestID, + required int? startNumber, + }) => + (super.noSuchMethod( + Invocation.method( + #getUsedCoinSerials, + [], + { + #requestID: requestID, + #startNumber: startNumber, + }, + ), + returnValue: + _i5.Future>.value({}), + ) as _i5.Future>); + @override + _i5.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( + Invocation.method( + #getLatestCoinId, + [], + {#requestID: requestID}, + ), + returnValue: _i5.Future.value(0), + ) as _i5.Future); + @override + _i5.Future> getFeeRate({String? requestID}) => + (super.noSuchMethod( + Invocation.method( + #getFeeRate, + [], + {#requestID: requestID}, + ), + returnValue: + _i5.Future>.value({}), + ) as _i5.Future>); + @override + _i5.Future<_i2.Decimal> estimateFee({ + String? requestID, + required int? blocks, + }) => + (super.noSuchMethod( + Invocation.method( + #estimateFee, + [], + { + #requestID: requestID, + #blocks: blocks, + }, + ), + returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + this, + Invocation.method( + #estimateFee, + [], + { + #requestID: requestID, + #blocks: blocks, + }, + ), + )), + ) as _i5.Future<_i2.Decimal>); + @override + _i5.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + Invocation.method( + #relayFee, + [], + {#requestID: requestID}, + ), + returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + this, + Invocation.method( + #relayFee, + [], + {#requestID: requestID}, + ), + )), + ) as _i5.Future<_i2.Decimal>); +} + +/// A class which mocks [CachedElectrumX]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { + MockCachedElectrumX() { + _i1.throwOnMissingStub(this); + } + + @override + _i3.ElectrumX get electrumXClient => (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumX_1( + this, + Invocation.getter(#electrumXClient), + ), + ) as _i3.ElectrumX); + @override + _i5.Future> getAnonymitySet({ + required String? groupId, + String? blockhash = r'', + required _i7.Coin? coin, + }) => + (super.noSuchMethod( + Invocation.method( + #getAnonymitySet, + [], + { + #groupId: groupId, + #blockhash: blockhash, + #coin: coin, + }, + ), + returnValue: + _i5.Future>.value({}), + ) as _i5.Future>); + @override + String base64ToHex(String? source) => (super.noSuchMethod( + Invocation.method( + #base64ToHex, + [source], + ), + returnValue: '', + ) as String); + @override + String base64ToReverseHex(String? source) => (super.noSuchMethod( + Invocation.method( + #base64ToReverseHex, + [source], + ), + returnValue: '', + ) as String); + @override + _i5.Future> getTransaction({ + required String? txHash, + required _i7.Coin? coin, + bool? verbose = true, + }) => + (super.noSuchMethod( + Invocation.method( + #getTransaction, + [], + { + #txHash: txHash, + #coin: coin, + #verbose: verbose, + }, + ), + returnValue: + _i5.Future>.value({}), + ) as _i5.Future>); + @override + _i5.Future> getUsedCoinSerials({ + required _i7.Coin? coin, + int? startNumber = 0, + }) => + (super.noSuchMethod( + Invocation.method( + #getUsedCoinSerials, + [], + { + #coin: coin, + #startNumber: startNumber, + }, + ), + returnValue: _i5.Future>.value([]), + ) as _i5.Future>); + @override + _i5.Future clearSharedTransactionCache({required _i7.Coin? coin}) => + (super.noSuchMethod( + Invocation.method( + #clearSharedTransactionCache, + [], + {#coin: coin}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); +} + +/// A class which mocks [TransactionNotificationTracker]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockTransactionNotificationTracker extends _i1.Mock + implements _i8.TransactionNotificationTracker { + MockTransactionNotificationTracker() { + _i1.throwOnMissingStub(this); + } + + @override + String get walletId => (super.noSuchMethod( + Invocation.getter(#walletId), + returnValue: '', + ) as String); + @override + List get pendings => (super.noSuchMethod( + Invocation.getter(#pendings), + returnValue: [], + ) as List); + @override + List get confirmeds => (super.noSuchMethod( + Invocation.getter(#confirmeds), + returnValue: [], + ) as List); + @override + bool wasNotifiedPending(String? txid) => (super.noSuchMethod( + Invocation.method( + #wasNotifiedPending, + [txid], + ), + returnValue: false, + ) as bool); + @override + _i5.Future addNotifiedPending(String? txid) => (super.noSuchMethod( + Invocation.method( + #addNotifiedPending, + [txid], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( + Invocation.method( + #wasNotifiedConfirmed, + [txid], + ), + returnValue: false, + ) as bool); + @override + _i5.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( + Invocation.method( + #addNotifiedConfirmed, + [txid], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future deleteTransaction(String? txid) => (super.noSuchMethod( + Invocation.method( + #deleteTransaction, + [txid], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); +} + +/// A class which mocks [MainDB]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockMainDB extends _i1.Mock implements _i9.MainDB { + MockMainDB() { + _i1.throwOnMissingStub(this); + } + + @override + _i4.Isar get isar => (super.noSuchMethod( + Invocation.getter(#isar), + returnValue: _FakeIsar_2( + this, + Invocation.getter(#isar), + ), + ) as _i4.Isar); + @override + _i5.Future initMainDB({_i4.Isar? mock}) => (super.noSuchMethod( + Invocation.method( + #initMainDB, + [], + {#mock: mock}, + ), + returnValue: _i5.Future.value(false), + ) as _i5.Future); + @override + List<_i10.ContactEntry> getContactEntries() => (super.noSuchMethod( + Invocation.method( + #getContactEntries, + [], + ), + returnValue: <_i10.ContactEntry>[], + ) as List<_i10.ContactEntry>); + @override + _i5.Future deleteContactEntry({required String? id}) => + (super.noSuchMethod( + Invocation.method( + #deleteContactEntry, + [], + {#id: id}, + ), + returnValue: _i5.Future.value(false), + ) as _i5.Future); + @override + _i5.Future isContactEntryExists({required String? id}) => + (super.noSuchMethod( + Invocation.method( + #isContactEntryExists, + [], + {#id: id}, + ), + returnValue: _i5.Future.value(false), + ) as _i5.Future); + @override + _i10.ContactEntry? getContactEntry({required String? id}) => + (super.noSuchMethod(Invocation.method( + #getContactEntry, + [], + {#id: id}, + )) as _i10.ContactEntry?); + @override + _i5.Future putContactEntry( + {required _i10.ContactEntry? contactEntry}) => + (super.noSuchMethod( + Invocation.method( + #putContactEntry, + [], + {#contactEntry: contactEntry}, + ), + returnValue: _i5.Future.value(false), + ) as _i5.Future); + @override + _i11.TransactionBlockExplorer? getTransactionBlockExplorer( + {required _i7.Coin? coin}) => + (super.noSuchMethod(Invocation.method( + #getTransactionBlockExplorer, + [], + {#coin: coin}, + )) as _i11.TransactionBlockExplorer?); + @override + _i5.Future putTransactionBlockExplorer( + _i11.TransactionBlockExplorer? explorer) => + (super.noSuchMethod( + Invocation.method( + #putTransactionBlockExplorer, + [explorer], + ), + returnValue: _i5.Future.value(0), + ) as _i5.Future); + @override + _i4.QueryBuilder<_i12.Address, _i12.Address, _i4.QAfterWhereClause> + getAddresses(String? walletId) => (super.noSuchMethod( + Invocation.method( + #getAddresses, + [walletId], + ), + returnValue: _FakeQueryBuilder_3<_i12.Address, _i12.Address, + _i4.QAfterWhereClause>( + this, + Invocation.method( + #getAddresses, + [walletId], + ), + ), + ) as _i4 + .QueryBuilder<_i12.Address, _i12.Address, _i4.QAfterWhereClause>); + @override + _i5.Future putAddress(_i12.Address? address) => (super.noSuchMethod( + Invocation.method( + #putAddress, + [address], + ), + returnValue: _i5.Future.value(0), + ) as _i5.Future); + @override + _i5.Future> putAddresses(List<_i12.Address>? addresses) => + (super.noSuchMethod( + Invocation.method( + #putAddresses, + [addresses], + ), + returnValue: _i5.Future>.value([]), + ) as _i5.Future>); + @override + _i5.Future> updateOrPutAddresses(List<_i12.Address>? addresses) => + (super.noSuchMethod( + Invocation.method( + #updateOrPutAddresses, + [addresses], + ), + returnValue: _i5.Future>.value([]), + ) as _i5.Future>); + @override + _i5.Future<_i12.Address?> getAddress( + String? walletId, + String? address, + ) => + (super.noSuchMethod( + Invocation.method( + #getAddress, + [ + walletId, + address, + ], + ), + returnValue: _i5.Future<_i12.Address?>.value(), + ) as _i5.Future<_i12.Address?>); + @override + _i5.Future updateAddress( + _i12.Address? oldAddress, + _i12.Address? newAddress, + ) => + (super.noSuchMethod( + Invocation.method( + #updateAddress, + [ + oldAddress, + newAddress, + ], + ), + returnValue: _i5.Future.value(0), + ) as _i5.Future); + @override + _i4.QueryBuilder<_i12.Transaction, _i12.Transaction, _i4.QAfterWhereClause> + getTransactions(String? walletId) => (super.noSuchMethod( + Invocation.method( + #getTransactions, + [walletId], + ), + returnValue: _FakeQueryBuilder_3<_i12.Transaction, _i12.Transaction, + _i4.QAfterWhereClause>( + this, + Invocation.method( + #getTransactions, + [walletId], + ), + ), + ) as _i4.QueryBuilder<_i12.Transaction, _i12.Transaction, + _i4.QAfterWhereClause>); + @override + _i5.Future putTransaction(_i12.Transaction? transaction) => + (super.noSuchMethod( + Invocation.method( + #putTransaction, + [transaction], + ), + returnValue: _i5.Future.value(0), + ) as _i5.Future); + @override + _i5.Future> putTransactions(List<_i12.Transaction>? transactions) => + (super.noSuchMethod( + Invocation.method( + #putTransactions, + [transactions], + ), + returnValue: _i5.Future>.value([]), + ) as _i5.Future>); + @override + _i5.Future<_i12.Transaction?> getTransaction( + String? walletId, + String? txid, + ) => + (super.noSuchMethod( + Invocation.method( + #getTransaction, + [ + walletId, + txid, + ], + ), + returnValue: _i5.Future<_i12.Transaction?>.value(), + ) as _i5.Future<_i12.Transaction?>); + @override + _i5.Stream<_i12.Transaction?> watchTransaction({ + required int? id, + bool? fireImmediately = false, + }) => + (super.noSuchMethod( + Invocation.method( + #watchTransaction, + [], + { + #id: id, + #fireImmediately: fireImmediately, + }, + ), + returnValue: _i5.Stream<_i12.Transaction?>.empty(), + ) as _i5.Stream<_i12.Transaction?>); + @override + _i4.QueryBuilder<_i12.UTXO, _i12.UTXO, _i4.QAfterWhereClause> getUTXOs( + String? walletId) => + (super.noSuchMethod( + Invocation.method( + #getUTXOs, + [walletId], + ), + returnValue: + _FakeQueryBuilder_3<_i12.UTXO, _i12.UTXO, _i4.QAfterWhereClause>( + this, + Invocation.method( + #getUTXOs, + [walletId], + ), + ), + ) as _i4.QueryBuilder<_i12.UTXO, _i12.UTXO, _i4.QAfterWhereClause>); + @override + _i5.Future putUTXO(_i12.UTXO? utxo) => (super.noSuchMethod( + Invocation.method( + #putUTXO, + [utxo], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future putUTXOs(List<_i12.UTXO>? utxos) => (super.noSuchMethod( + Invocation.method( + #putUTXOs, + [utxos], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future updateUTXOs( + String? walletId, + List<_i12.UTXO>? utxos, + ) => + (super.noSuchMethod( + Invocation.method( + #updateUTXOs, + [ + walletId, + utxos, + ], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Stream<_i12.UTXO?> watchUTXO({ + required int? id, + bool? fireImmediately = false, + }) => + (super.noSuchMethod( + Invocation.method( + #watchUTXO, + [], + { + #id: id, + #fireImmediately: fireImmediately, + }, + ), + returnValue: _i5.Stream<_i12.UTXO?>.empty(), + ) as _i5.Stream<_i12.UTXO?>); + @override + _i4.QueryBuilder<_i12.TransactionNote, _i12.TransactionNote, + _i4.QAfterWhereClause> getTransactionNotes( + String? walletId) => + (super.noSuchMethod( + Invocation.method( + #getTransactionNotes, + [walletId], + ), + returnValue: _FakeQueryBuilder_3<_i12.TransactionNote, + _i12.TransactionNote, _i4.QAfterWhereClause>( + this, + Invocation.method( + #getTransactionNotes, + [walletId], + ), + ), + ) as _i4.QueryBuilder<_i12.TransactionNote, _i12.TransactionNote, + _i4.QAfterWhereClause>); + @override + _i5.Future putTransactionNote(_i12.TransactionNote? transactionNote) => + (super.noSuchMethod( + Invocation.method( + #putTransactionNote, + [transactionNote], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future putTransactionNotes( + List<_i12.TransactionNote>? transactionNotes) => + (super.noSuchMethod( + Invocation.method( + #putTransactionNotes, + [transactionNotes], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future<_i12.TransactionNote?> getTransactionNote( + String? walletId, + String? txid, + ) => + (super.noSuchMethod( + Invocation.method( + #getTransactionNote, + [ + walletId, + txid, + ], + ), + returnValue: _i5.Future<_i12.TransactionNote?>.value(), + ) as _i5.Future<_i12.TransactionNote?>); + @override + _i5.Stream<_i12.TransactionNote?> watchTransactionNote({ + required int? id, + bool? fireImmediately = false, + }) => + (super.noSuchMethod( + Invocation.method( + #watchTransactionNote, + [], + { + #id: id, + #fireImmediately: fireImmediately, + }, + ), + returnValue: _i5.Stream<_i12.TransactionNote?>.empty(), + ) as _i5.Stream<_i12.TransactionNote?>); + @override + _i4.QueryBuilder<_i12.AddressLabel, _i12.AddressLabel, _i4.QAfterWhereClause> + getAddressLabels(String? walletId) => (super.noSuchMethod( + Invocation.method( + #getAddressLabels, + [walletId], + ), + returnValue: _FakeQueryBuilder_3<_i12.AddressLabel, + _i12.AddressLabel, _i4.QAfterWhereClause>( + this, + Invocation.method( + #getAddressLabels, + [walletId], + ), + ), + ) as _i4.QueryBuilder<_i12.AddressLabel, _i12.AddressLabel, + _i4.QAfterWhereClause>); + @override + _i5.Future putAddressLabel(_i12.AddressLabel? addressLabel) => + (super.noSuchMethod( + Invocation.method( + #putAddressLabel, + [addressLabel], + ), + returnValue: _i5.Future.value(0), + ) as _i5.Future); + @override + int putAddressLabelSync(_i12.AddressLabel? addressLabel) => + (super.noSuchMethod( + Invocation.method( + #putAddressLabelSync, + [addressLabel], + ), + returnValue: 0, + ) as int); + @override + _i5.Future putAddressLabels(List<_i12.AddressLabel>? addressLabels) => + (super.noSuchMethod( + Invocation.method( + #putAddressLabels, + [addressLabels], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future<_i12.AddressLabel?> getAddressLabel( + String? walletId, + String? addressString, + ) => + (super.noSuchMethod( + Invocation.method( + #getAddressLabel, + [ + walletId, + addressString, + ], + ), + returnValue: _i5.Future<_i12.AddressLabel?>.value(), + ) as _i5.Future<_i12.AddressLabel?>); + @override + _i12.AddressLabel? getAddressLabelSync( + String? walletId, + String? addressString, + ) => + (super.noSuchMethod(Invocation.method( + #getAddressLabelSync, + [ + walletId, + addressString, + ], + )) as _i12.AddressLabel?); + @override + _i5.Stream<_i12.AddressLabel?> watchAddressLabel({ + required int? id, + bool? fireImmediately = false, + }) => + (super.noSuchMethod( + Invocation.method( + #watchAddressLabel, + [], + { + #id: id, + #fireImmediately: fireImmediately, + }, + ), + returnValue: _i5.Stream<_i12.AddressLabel?>.empty(), + ) as _i5.Stream<_i12.AddressLabel?>); + @override + _i5.Future updateAddressLabel(_i12.AddressLabel? addressLabel) => + (super.noSuchMethod( + Invocation.method( + #updateAddressLabel, + [addressLabel], + ), + returnValue: _i5.Future.value(0), + ) as _i5.Future); + @override + _i5.Future deleteWalletBlockchainData(String? walletId) => + (super.noSuchMethod( + Invocation.method( + #deleteWalletBlockchainData, + [walletId], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future deleteAddressLabels(String? walletId) => (super.noSuchMethod( + Invocation.method( + #deleteAddressLabels, + [walletId], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future deleteTransactionNotes(String? walletId) => + (super.noSuchMethod( + Invocation.method( + #deleteTransactionNotes, + [walletId], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future addNewTransactionData( + List<_i13.Tuple2<_i12.Transaction, _i12.Address?>>? transactionsData, + String? walletId, + ) => + (super.noSuchMethod( + Invocation.method( + #addNewTransactionData, + [ + transactionsData, + walletId, + ], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i4.QueryBuilder<_i12.EthContract, _i12.EthContract, _i4.QWhere> + getEthContracts() => (super.noSuchMethod( + Invocation.method( + #getEthContracts, + [], + ), + returnValue: _FakeQueryBuilder_3<_i12.EthContract, _i12.EthContract, + _i4.QWhere>( + this, + Invocation.method( + #getEthContracts, + [], + ), + ), + ) as _i4 + .QueryBuilder<_i12.EthContract, _i12.EthContract, _i4.QWhere>); + @override + _i5.Future<_i12.EthContract?> getEthContract(String? contractAddress) => + (super.noSuchMethod( + Invocation.method( + #getEthContract, + [contractAddress], + ), + returnValue: _i5.Future<_i12.EthContract?>.value(), + ) as _i5.Future<_i12.EthContract?>); + @override + _i12.EthContract? getEthContractSync(String? contractAddress) => + (super.noSuchMethod(Invocation.method( + #getEthContractSync, + [contractAddress], + )) as _i12.EthContract?); + @override + _i5.Future putEthContract(_i12.EthContract? contract) => + (super.noSuchMethod( + Invocation.method( + #putEthContract, + [contract], + ), + returnValue: _i5.Future.value(0), + ) as _i5.Future); + @override + _i5.Future putEthContracts(List<_i12.EthContract>? contracts) => + (super.noSuchMethod( + Invocation.method( + #putEthContracts, + [contracts], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); +} diff --git a/test/services/coins/manager_test.dart b/test/services/coins/manager_test.dart index 52a31b1b7..fcc246882 100644 --- a/test/services/coins/manager_test.dart +++ b/test/services/coins/manager_test.dart @@ -1,37 +1,44 @@ +import 'package:decimal/decimal.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; -import 'package:stackduo/electrumx_rpc/electrumx.dart'; -import 'package:stackduo/models/balance.dart'; -import 'package:stackduo/models/isar/models/isar_models.dart'; -import 'package:stackduo/models/paymint/fee_object_model.dart'; -import 'package:stackduo/services/coins/bitcoin/bitcoin_wallet.dart'; -import 'package:stackduo/services/coins/coin_service.dart'; -import 'package:stackduo/services/coins/manager.dart'; -import 'package:stackduo/utilities/amount/amount.dart'; -import 'package:stackduo/utilities/enums/coin_enum.dart'; - -// import '../../pages/send_view/send_view_test.mocks.dart'; +import 'package:stackwallet/electrumx_rpc/electrumx.dart'; +import 'package:stackwallet/models/balance.dart'; +import 'package:stackwallet/models/isar/models/isar_models.dart'; +import 'package:stackwallet/models/paymint/fee_object_model.dart'; +import 'package:stackwallet/services/coins/coin_service.dart'; +import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; +import 'package:stackwallet/services/coins/manager.dart'; +import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/enums/coin_enum.dart'; + import 'manager_test.mocks.dart'; -@GenerateMocks([BitcoinWallet, ElectrumX]) +/// quick amount constructor wrapper. Using an int is bad practice but for +/// testing with small amounts this should be fine +Amount _a(int i) => Amount.fromDecimal( + Decimal.fromInt(i), + fractionDigits: 8, + ); + +@GenerateMocks([FiroWallet, ElectrumX]) void main() { test("Manager should have a backgroundRefreshListener on initialization", () { - final manager = Manager(MockBitcoinWallet()); + final manager = Manager(MockFiroWallet()); expect(manager.hasBackgroundRefreshListener, true); }); test("get coin", () { - final CoinServiceAPI wallet = MockBitcoinWallet(); - when(wallet.coin).thenAnswer((_) => Coin.bitcoin); + final CoinServiceAPI wallet = MockFiroWallet(); + when(wallet.coin).thenAnswer((_) => Coin.firo); final manager = Manager(wallet); - expect(manager.coin, Coin.bitcoin); + expect(manager.coin, Coin.firo); }); test("fees", () async { - final CoinServiceAPI wallet = MockBitcoinWallet(); + final CoinServiceAPI wallet = MockFiroWallet(); when(wallet.fees).thenAnswer((_) async => FeeObject( fast: 10, medium: 5, @@ -53,7 +60,7 @@ void main() { }); test("maxFee", () async { - final CoinServiceAPI wallet = MockBitcoinWallet(); + final CoinServiceAPI wallet = MockFiroWallet(); when(wallet.maxFee).thenAnswer((_) async => 10); final manager = Manager(wallet); @@ -64,7 +71,7 @@ void main() { }); test("get currentReceivingAddress", () async { - final CoinServiceAPI wallet = MockBitcoinWallet(); + final CoinServiceAPI wallet = MockFiroWallet(); when(wallet.currentReceivingAddress) .thenAnswer((_) async => "Some address string"); @@ -75,27 +82,30 @@ void main() { group("get balances", () { test("balance", () async { - final CoinServiceAPI wallet = MockBitcoinWallet(); + final CoinServiceAPI wallet = MockFiroWallet(); + final balance = Balance( + total: _a(10), + spendable: _a(1), + blockedTotal: _a(0), + pendingSpendable: _a(9), + ); + + when(wallet.coin).thenAnswer((_) => Coin.firo); when(wallet.balance).thenAnswer( - (_) => Balance( - total: 10.toAmountAsRaw(fractionDigits: 8), - spendable: 1.toAmountAsRaw(fractionDigits: 8), - blockedTotal: 0.toAmountAsRaw(fractionDigits: 8), - pendingSpendable: 9.toAmountAsRaw(fractionDigits: 8), - ), + (_) => balance, ); final manager = Manager(wallet); - expect(manager.balance.total.raw.toInt(), 10); - expect(manager.balance.spendable.raw.toInt(), 1); - expect(manager.balance.blockedTotal.raw.toInt(), 0); - expect(manager.balance.pendingSpendable.raw.toInt(), 9); + expect(manager.balance, balance); }); }); test("transactions", () async { - final CoinServiceAPI wallet = MockBitcoinWallet(); + final CoinServiceAPI wallet = MockFiroWallet(); + + when(wallet.coin).thenAnswer((realInvocation) => Coin.firo); + final tx = Transaction( walletId: "walletId", txid: "txid", @@ -103,16 +113,20 @@ void main() { type: TransactionType.incoming, subType: TransactionSubType.mint, amount: 123, + amountString: Amount( + rawValue: BigInt.from(123), + fractionDigits: wallet.coin.decimals, + ).toJsonString(), fee: 3, height: 123, isCancelled: false, isLelantus: true, slateId: null, otherData: null, + nonce: null, inputs: [], outputs: [], - amountString: '', - nonce: null, + numberOfMessages: null, ); when(wallet.transactions).thenAnswer((_) async => [ tx, @@ -128,7 +142,7 @@ void main() { }); test("refresh", () async { - final CoinServiceAPI wallet = MockBitcoinWallet(); + final CoinServiceAPI wallet = MockFiroWallet(); when(wallet.refresh()).thenAnswer((_) => Future(() => {})); final manager = Manager(wallet); @@ -139,7 +153,7 @@ void main() { }); test("get walletName", () { - final CoinServiceAPI wallet = MockBitcoinWallet(); + final CoinServiceAPI wallet = MockFiroWallet(); when(wallet.walletName).thenAnswer((_) => "Some wallet name"); final manager = Manager(wallet); @@ -147,7 +161,7 @@ void main() { }); test("get walletId", () { - final CoinServiceAPI wallet = MockBitcoinWallet(); + final CoinServiceAPI wallet = MockFiroWallet(); when(wallet.walletId).thenAnswer((_) => "Some wallet ID"); final manager = Manager(wallet); @@ -157,7 +171,7 @@ void main() { group("validateAddress", () { test("some valid address", () { - final CoinServiceAPI wallet = MockBitcoinWallet(); + final CoinServiceAPI wallet = MockFiroWallet(); when(wallet.validateAddress("a valid address")).thenAnswer((_) => true); final manager = Manager(wallet); @@ -166,7 +180,7 @@ void main() { }); test("some invalid address", () { - final CoinServiceAPI wallet = MockBitcoinWallet(); + final CoinServiceAPI wallet = MockFiroWallet(); when(wallet.validateAddress("an invalid address")) .thenAnswer((_) => false); @@ -177,7 +191,7 @@ void main() { }); test("get mnemonic", () async { - final CoinServiceAPI wallet = MockBitcoinWallet(); + final CoinServiceAPI wallet = MockFiroWallet(); when(wallet.mnemonic) .thenAnswer((_) async => ["Some", "seed", "word", "list"]); @@ -187,7 +201,7 @@ void main() { }); test("testNetworkConnection", () async { - final CoinServiceAPI wallet = MockBitcoinWallet(); + final CoinServiceAPI wallet = MockFiroWallet(); when(wallet.testNetworkConnection()).thenAnswer((_) async => true); final manager = Manager(wallet); @@ -197,7 +211,7 @@ void main() { group("recoverFromMnemonic", () { test("successfully recover", () async { - final CoinServiceAPI wallet = MockBitcoinWallet(); + final CoinServiceAPI wallet = MockFiroWallet(); when(wallet.recoverFromMnemonic( mnemonic: "Some valid mnemonic", maxUnusedAddressGap: 20, @@ -222,7 +236,7 @@ void main() { }); test("failed recovery", () async { - final CoinServiceAPI wallet = MockBitcoinWallet(); + final CoinServiceAPI wallet = MockFiroWallet(); when(wallet.recoverFromMnemonic( mnemonic: "Some invalid mnemonic", maxUnusedAddressGap: 20, @@ -249,7 +263,7 @@ void main() { }); test("failed recovery due to some other error", () async { - final CoinServiceAPI wallet = MockBitcoinWallet(); + final CoinServiceAPI wallet = MockFiroWallet(); when(wallet.recoverFromMnemonic( mnemonic: "Some valid mnemonic", maxUnusedAddressGap: 20, @@ -277,7 +291,7 @@ void main() { }); test("exitCurrentWallet", () async { - final CoinServiceAPI wallet = MockBitcoinWallet(); + final CoinServiceAPI wallet = MockFiroWallet(); when(wallet.exit()).thenAnswer((realInvocation) => Future(() => {})); when(wallet.walletId).thenAnswer((realInvocation) => "some id"); when(wallet.walletName).thenAnswer((realInvocation) => "some name"); @@ -294,7 +308,7 @@ void main() { }); test("dispose", () async { - final CoinServiceAPI wallet = MockBitcoinWallet(); + final CoinServiceAPI wallet = MockFiroWallet(); when(wallet.exit()).thenAnswer((realInvocation) => Future(() => {})); when(wallet.walletId).thenAnswer((realInvocation) => "some id"); when(wallet.walletName).thenAnswer((realInvocation) => "some name"); @@ -305,7 +319,7 @@ void main() { }); test("fullRescan succeeds", () { - final CoinServiceAPI wallet = MockBitcoinWallet(); + final CoinServiceAPI wallet = MockFiroWallet(); when(wallet.fullRescan(20, 1000)).thenAnswer((_) async {}); final manager = Manager(wallet); @@ -314,7 +328,7 @@ void main() { }); test("fullRescan fails", () { - final CoinServiceAPI wallet = MockBitcoinWallet(); + final CoinServiceAPI wallet = MockFiroWallet(); when(wallet.fullRescan(20, 1000)).thenThrow(Exception()); final manager = Manager(wallet); diff --git a/test/services/coins/manager_test.mocks.dart b/test/services/coins/manager_test.mocks.dart index ad1c81f32..821da6efc 100644 --- a/test/services/coins/manager_test.mocks.dart +++ b/test/services/coins/manager_test.mocks.dart @@ -1,31 +1,25 @@ // Mocks generated by Mockito 5.3.2 from annotations -// in stackduo/test/services/coins/manager_test.dart. +// in stackwallet/test/services/coins/manager_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i16; -import 'dart:typed_data' as _i21; +import 'dart:async' as _i11; -import 'package:bip32/bip32.dart' as _i11; -import 'package:bip47/bip47.dart' as _i13; -import 'package:bitcoindart/bitcoindart.dart' as _i8; -import 'package:decimal/decimal.dart' as _i14; +import 'package:decimal/decimal.dart' as _i9; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackduo/db/main_db.dart' as _i7; -import 'package:stackduo/electrumx_rpc/cached_electrumx.dart' as _i5; -import 'package:stackduo/electrumx_rpc/electrumx.dart' as _i4; -import 'package:stackduo/models/balance.dart' as _i6; -import 'package:stackduo/models/isar/models/isar_models.dart' as _i12; -import 'package:stackduo/models/paymint/fee_object_model.dart' as _i3; -import 'package:stackduo/models/signing_data.dart' as _i19; -import 'package:stackduo/services/coins/bitcoin/bitcoin_wallet.dart' as _i15; -import 'package:stackduo/services/transaction_notification_tracker.dart' as _i2; -import 'package:stackduo/utilities/amount/amount.dart' as _i9; -import 'package:stackduo/utilities/enums/coin_enum.dart' as _i17; -import 'package:stackduo/utilities/enums/derive_path_type_enum.dart' as _i18; -import 'package:stackduo/utilities/flutter_secure_storage_interface.dart' - as _i20; -import 'package:tuple/tuple.dart' as _i10; +import 'package:stackwallet/db/isar/main_db.dart' as _i7; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i5; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i4; +import 'package:stackwallet/models/balance.dart' as _i6; +import 'package:stackwallet/models/isar/models/isar_models.dart' as _i13; +import 'package:stackwallet/models/lelantus_coin.dart' as _i15; +import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i3; +import 'package:stackwallet/models/signing_data.dart' as _i14; +import 'package:stackwallet/services/coins/firo/firo_wallet.dart' as _i10; +import 'package:stackwallet/services/transaction_notification_tracker.dart' + as _i2; +import 'package:stackwallet/utilities/amount/amount.dart' as _i8; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i12; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -100,8 +94,8 @@ class _FakeMainDB_5 extends _i1.SmartFake implements _i7.MainDB { ); } -class _FakeNetworkType_6 extends _i1.SmartFake implements _i8.NetworkType { - _FakeNetworkType_6( +class _FakeAmount_6 extends _i1.SmartFake implements _i8.Amount { + _FakeAmount_6( Object parent, Invocation parentInvocation, ) : super( @@ -110,8 +104,8 @@ class _FakeNetworkType_6 extends _i1.SmartFake implements _i8.NetworkType { ); } -class _FakeElectrumXNode_7 extends _i1.SmartFake implements _i4.ElectrumXNode { - _FakeElectrumXNode_7( +class _FakeDecimal_7 extends _i1.SmartFake implements _i9.Decimal { + _FakeDecimal_7( Object parent, Invocation parentInvocation, ) : super( @@ -120,77 +114,16 @@ class _FakeElectrumXNode_7 extends _i1.SmartFake implements _i4.ElectrumXNode { ); } -class _FakeAmount_8 extends _i1.SmartFake implements _i9.Amount { - _FakeAmount_8( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); -} - -class _FakeTuple2_9 extends _i1.SmartFake - implements _i10.Tuple2 { - _FakeTuple2_9( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); -} - -class _FakeBIP32_10 extends _i1.SmartFake implements _i11.BIP32 { - _FakeBIP32_10( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); -} - -class _FakeAddress_11 extends _i1.SmartFake implements _i12.Address { - _FakeAddress_11( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); -} - -class _FakePaymentCode_12 extends _i1.SmartFake implements _i13.PaymentCode { - _FakePaymentCode_12( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); -} - -class _FakeDecimal_13 extends _i1.SmartFake implements _i14.Decimal { - _FakeDecimal_13( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); -} - -/// A class which mocks [BitcoinWallet]. +/// A class which mocks [FiroWallet]. /// /// See the documentation for Mockito's code generation for more information. -class MockBitcoinWallet extends _i1.Mock implements _i15.BitcoinWallet { - MockBitcoinWallet() { +class MockFiroWallet extends _i1.Mock implements _i10.FiroWallet { + MockFiroWallet() { _i1.throwOnMissingStub(this); } @override - set timer(_i16.Timer? _timer) => super.noSuchMethod( + set timer(_i11.Timer? _timer) => super.noSuchMethod( Invocation.setter( #timer, _timer, @@ -215,28 +148,28 @@ class MockBitcoinWallet extends _i1.Mock implements _i15.BitcoinWallet { returnValueForMissingStub: null, ); @override - bool get longMutex => (super.noSuchMethod( - Invocation.getter(#longMutex), + bool get refreshMutex => (super.noSuchMethod( + Invocation.getter(#refreshMutex), returnValue: false, ) as bool); @override - set longMutex(bool? _longMutex) => super.noSuchMethod( + set refreshMutex(bool? _refreshMutex) => super.noSuchMethod( Invocation.setter( - #longMutex, - _longMutex, + #refreshMutex, + _refreshMutex, ), returnValueForMissingStub: null, ); @override - bool get refreshMutex => (super.noSuchMethod( - Invocation.getter(#refreshMutex), + bool get longMutex => (super.noSuchMethod( + Invocation.getter(#longMutex), returnValue: false, ) as bool); @override - set refreshMutex(bool? _refreshMutex) => super.noSuchMethod( + set longMutex(bool? _longMutex) => super.noSuchMethod( Invocation.setter( - #refreshMutex, - _refreshMutex, + #longMutex, + _longMutex, ), returnValueForMissingStub: null, ); @@ -254,6 +187,19 @@ class MockBitcoinWallet extends _i1.Mock implements _i15.BitcoinWallet { returnValueForMissingStub: null, ); @override + bool get shouldAutoSync => (super.noSuchMethod( + Invocation.getter(#shouldAutoSync), + returnValue: false, + ) as bool); + @override + set shouldAutoSync(bool? shouldAutoSync) => super.noSuchMethod( + Invocation.setter( + #shouldAutoSync, + shouldAutoSync, + ), + returnValueForMissingStub: null, + ); + @override set isFavorite(bool? markFavorite) => super.noSuchMethod( Invocation.setter( #isFavorite, @@ -267,107 +213,48 @@ class MockBitcoinWallet extends _i1.Mock implements _i15.BitcoinWallet { returnValue: false, ) as bool); @override - _i17.Coin get coin => (super.noSuchMethod( + _i12.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i17.Coin.bitcoin, - ) as _i17.Coin); - @override - _i16.Future> get utxos => (super.noSuchMethod( - Invocation.getter(#utxos), - returnValue: _i16.Future>.value(<_i12.UTXO>[]), - ) as _i16.Future>); + returnValue: _i12.Coin.bitcoin, + ) as _i12.Coin); @override - _i16.Future> get transactions => (super.noSuchMethod( - Invocation.getter(#transactions), - returnValue: - _i16.Future>.value(<_i12.Transaction>[]), - ) as _i16.Future>); - @override - _i16.Future get currentReceivingAddress => (super.noSuchMethod( - Invocation.getter(#currentReceivingAddress), - returnValue: _i16.Future.value(''), - ) as _i16.Future); + _i11.Future> get mnemonic => (super.noSuchMethod( + Invocation.getter(#mnemonic), + returnValue: _i11.Future>.value([]), + ) as _i11.Future>); @override - _i16.Future get currentChangeAddress => (super.noSuchMethod( - Invocation.getter(#currentChangeAddress), - returnValue: _i16.Future.value(''), - ) as _i16.Future); + _i11.Future get mnemonicString => (super.noSuchMethod( + Invocation.getter(#mnemonicString), + returnValue: _i11.Future.value(), + ) as _i11.Future); @override - _i16.Future get currentChangeAddressP2PKH => (super.noSuchMethod( - Invocation.getter(#currentChangeAddressP2PKH), - returnValue: _i16.Future.value(''), - ) as _i16.Future); + _i11.Future get mnemonicPassphrase => (super.noSuchMethod( + Invocation.getter(#mnemonicPassphrase), + returnValue: _i11.Future.value(), + ) as _i11.Future); @override - bool get hasCalledExit => (super.noSuchMethod( - Invocation.getter(#hasCalledExit), - returnValue: false, - ) as bool); + _i11.Future get maxFee => (super.noSuchMethod( + Invocation.getter(#maxFee), + returnValue: _i11.Future.value(0), + ) as _i11.Future); @override - _i16.Future<_i3.FeeObject> get fees => (super.noSuchMethod( + _i11.Future<_i3.FeeObject> get fees => (super.noSuchMethod( Invocation.getter(#fees), - returnValue: _i16.Future<_i3.FeeObject>.value(_FakeFeeObject_1( + returnValue: _i11.Future<_i3.FeeObject>.value(_FakeFeeObject_1( this, Invocation.getter(#fees), )), - ) as _i16.Future<_i3.FeeObject>); - @override - _i16.Future get maxFee => (super.noSuchMethod( - Invocation.getter(#maxFee), - returnValue: _i16.Future.value(0), - ) as _i16.Future); - @override - _i16.Future> get mnemonic => (super.noSuchMethod( - Invocation.getter(#mnemonic), - returnValue: _i16.Future>.value([]), - ) as _i16.Future>); - @override - _i16.Future get mnemonicString => (super.noSuchMethod( - Invocation.getter(#mnemonicString), - returnValue: _i16.Future.value(), - ) as _i16.Future); - @override - _i16.Future get mnemonicPassphrase => (super.noSuchMethod( - Invocation.getter(#mnemonicPassphrase), - returnValue: _i16.Future.value(), - ) as _i16.Future); - @override - _i16.Future get chainHeight => (super.noSuchMethod( - Invocation.getter(#chainHeight), - returnValue: _i16.Future.value(0), - ) as _i16.Future); - @override - int get storedChainHeight => (super.noSuchMethod( - Invocation.getter(#storedChainHeight), - returnValue: 0, - ) as int); - @override - bool get shouldAutoSync => (super.noSuchMethod( - Invocation.getter(#shouldAutoSync), - returnValue: false, - ) as bool); + ) as _i11.Future<_i3.FeeObject>); @override - set shouldAutoSync(bool? shouldAutoSync) => super.noSuchMethod( - Invocation.setter( - #shouldAutoSync, - shouldAutoSync, - ), - returnValueForMissingStub: null, - ); - @override - bool get isRefreshing => (super.noSuchMethod( - Invocation.getter(#isRefreshing), - returnValue: false, - ) as bool); - @override - bool get isConnected => (super.noSuchMethod( - Invocation.getter(#isConnected), - returnValue: false, - ) as bool); + _i11.Future get currentReceivingAddress => (super.noSuchMethod( + Invocation.getter(#currentReceivingAddress), + returnValue: _i11.Future.value(''), + ) as _i11.Future); @override - String get walletId => (super.noSuchMethod( - Invocation.getter(#walletId), - returnValue: '', - ) as String); + _i11.Future get currentChangeAddress => (super.noSuchMethod( + Invocation.getter(#currentChangeAddress), + returnValue: _i11.Future.value(''), + ) as _i11.Future); @override String get walletName => (super.noSuchMethod( Invocation.getter(#walletName), @@ -382,6 +269,16 @@ class MockBitcoinWallet extends _i1.Mock implements _i15.BitcoinWallet { returnValueForMissingStub: null, ); @override + String get walletId => (super.noSuchMethod( + Invocation.getter(#walletId), + returnValue: '', + ) as String); + @override + bool get isConnected => (super.noSuchMethod( + Invocation.getter(#isConnected), + returnValue: false, + ) as bool); + @override _i4.ElectrumX get electrumXClient => (super.noSuchMethod( Invocation.getter(#electrumXClient), returnValue: _FakeElectrumX_2( @@ -398,6 +295,26 @@ class MockBitcoinWallet extends _i1.Mock implements _i15.BitcoinWallet { ), ) as _i5.CachedElectrumX); @override + bool get isRefreshing => (super.noSuchMethod( + Invocation.getter(#isRefreshing), + returnValue: false, + ) as bool); + @override + bool get hasCalledExit => (super.noSuchMethod( + Invocation.getter(#hasCalledExit), + returnValue: false, + ) as bool); + @override + _i11.Future get chainHeight => (super.noSuchMethod( + Invocation.getter(#chainHeight), + returnValue: _i11.Future.value(0), + ) as _i11.Future); + @override + int get storedChainHeight => (super.noSuchMethod( + Invocation.getter(#storedChainHeight), + returnValue: 0, + ) as int); + @override _i6.Balance get balance => (super.noSuchMethod( Invocation.getter(#balance), returnValue: _FakeBalance_4( @@ -406,10 +323,29 @@ class MockBitcoinWallet extends _i1.Mock implements _i15.BitcoinWallet { ), ) as _i6.Balance); @override - _i16.Future get xpub => (super.noSuchMethod( + _i6.Balance get balancePrivate => (super.noSuchMethod( + Invocation.getter(#balancePrivate), + returnValue: _FakeBalance_4( + this, + Invocation.getter(#balancePrivate), + ), + ) as _i6.Balance); + @override + _i11.Future> get utxos => (super.noSuchMethod( + Invocation.getter(#utxos), + returnValue: _i11.Future>.value(<_i13.UTXO>[]), + ) as _i11.Future>); + @override + _i11.Future> get transactions => (super.noSuchMethod( + Invocation.getter(#transactions), + returnValue: + _i11.Future>.value(<_i13.Transaction>[]), + ) as _i11.Future>); + @override + _i11.Future get xpub => (super.noSuchMethod( Invocation.getter(#xpub), - returnValue: _i16.Future.value(''), - ) as _i16.Future); + returnValue: _i11.Future.value(''), + ) as _i11.Future); @override set onIsActiveWalletChanged(void Function(bool)? _onIsActiveWalletChanged) => super.noSuchMethod( @@ -428,95 +364,80 @@ class MockBitcoinWallet extends _i1.Mock implements _i15.BitcoinWallet { ), ) as _i7.MainDB); @override - _i8.NetworkType get networkType => (super.noSuchMethod( - Invocation.getter(#networkType), - returnValue: _FakeNetworkType_6( - this, - Invocation.getter(#networkType), - ), - ) as _i8.NetworkType); - @override - _i16.Future exit() => (super.noSuchMethod( + bool validateAddress(String? address) => (super.noSuchMethod( Invocation.method( - #exit, - [], + #validateAddress, + [address], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); + returnValue: false, + ) as bool); @override - _i18.DerivePathType addressType({required String? address}) => + _i11.Future updateSentCachedTxData(Map? txData) => (super.noSuchMethod( Invocation.method( - #addressType, - [], - {#address: address}, + #updateSentCachedTxData, + [txData], ), - returnValue: _i18.DerivePathType.bip44, - ) as _i18.DerivePathType); + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override - _i16.Future recoverFromMnemonic({ - required String? mnemonic, - String? mnemonicPassphrase, - required int? maxUnusedAddressGap, - required int? maxNumberOfIndexesToCheck, - required int? height, - }) => - (super.noSuchMethod( + _i11.Future testNetworkConnection() => (super.noSuchMethod( Invocation.method( - #recoverFromMnemonic, + #testNetworkConnection, [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - #maxUnusedAddressGap: maxUnusedAddressGap, - #maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck, - #height: height, - }, ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); + returnValue: _i11.Future.value(false), + ) as _i11.Future); @override - _i16.Future getTransactionCacheEarly(List? allAddresses) => - (super.noSuchMethod( + void startNetworkAlivePinging() => super.noSuchMethod( Invocation.method( - #getTransactionCacheEarly, - [allAddresses], + #startNetworkAlivePinging, + [], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); + returnValueForMissingStub: null, + ); @override - _i16.Future refreshIfThereIsNewData() => (super.noSuchMethod( + void stopNetworkAlivePinging() => super.noSuchMethod( Invocation.method( - #refreshIfThereIsNewData, + #stopNetworkAlivePinging, [], ), - returnValue: _i16.Future.value(false), - ) as _i16.Future); + returnValueForMissingStub: null, + ); @override - _i16.Future getAllTxsToWatch() => (super.noSuchMethod( + _i11.Future> prepareSendPublic({ + required String? address, + required _i8.Amount? amount, + Map? args, + }) => + (super.noSuchMethod( Invocation.method( - #getAllTxsToWatch, + #prepareSendPublic, [], + { + #address: address, + #amount: amount, + #args: args, + }, ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); + returnValue: + _i11.Future>.value({}), + ) as _i11.Future>); @override - _i16.Future refresh() => (super.noSuchMethod( + _i11.Future confirmSendPublic({dynamic txData}) => + (super.noSuchMethod( Invocation.method( - #refresh, + #confirmSendPublic, [], + {#txData: txData}, ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); + returnValue: _i11.Future.value(''), + ) as _i11.Future); @override - _i16.Future> prepareSend({ + _i11.Future> prepareSend({ required String? address, - required _i9.Amount? amount, + required _i8.Amount? amount, Map? args, }) => (super.noSuchMethod( @@ -530,253 +451,373 @@ class MockBitcoinWallet extends _i1.Mock implements _i15.BitcoinWallet { }, ), returnValue: - _i16.Future>.value({}), - ) as _i16.Future>); + _i11.Future>.value({}), + ) as _i11.Future>); @override - _i16.Future confirmSend({required Map? txData}) => + _i11.Future confirmSend({required Map? txData}) => (super.noSuchMethod( Invocation.method( #confirmSend, [], {#txData: txData}, ), - returnValue: _i16.Future.value(''), - ) as _i16.Future); + returnValue: _i11.Future.value(''), + ) as _i11.Future); @override - _i16.Future testNetworkConnection() => (super.noSuchMethod( + int estimateTxFee({ + required int? vSize, + required int? feeRatePerKB, + }) => + (super.noSuchMethod( Invocation.method( - #testNetworkConnection, + #estimateTxFee, [], + { + #vSize: vSize, + #feeRatePerKB: feeRatePerKB, + }, ), - returnValue: _i16.Future.value(false), - ) as _i16.Future); + returnValue: 0, + ) as int); @override - void startNetworkAlivePinging() => super.noSuchMethod( + dynamic coinSelection( + int? satoshiAmountToSend, + int? selectedTxFeeRate, + String? _recipientAddress, + bool? isSendAll, { + int? additionalOutputs = 0, + List<_i13.UTXO>? utxos, + }) => + super.noSuchMethod(Invocation.method( + #coinSelection, + [ + satoshiAmountToSend, + selectedTxFeeRate, + _recipientAddress, + isSendAll, + ], + { + #additionalOutputs: additionalOutputs, + #utxos: utxos, + }, + )); + @override + _i11.Future> fetchBuildTxData( + List<_i13.UTXO>? utxosToUse) => + (super.noSuchMethod( Invocation.method( - #startNetworkAlivePinging, - [], + #fetchBuildTxData, + [utxosToUse], ), - returnValueForMissingStub: null, - ); + returnValue: + _i11.Future>.value(<_i14.SigningData>[]), + ) as _i11.Future>); @override - void stopNetworkAlivePinging() => super.noSuchMethod( + _i11.Future> buildTransaction({ + required List<_i14.SigningData>? utxoSigningData, + required List? recipients, + required List? satoshiAmounts, + }) => + (super.noSuchMethod( Invocation.method( - #stopNetworkAlivePinging, + #buildTransaction, [], + { + #utxoSigningData: utxoSigningData, + #recipients: recipients, + #satoshiAmounts: satoshiAmounts, + }, ), - returnValueForMissingStub: null, - ); + returnValue: + _i11.Future>.value({}), + ) as _i11.Future>); @override - _i16.Future initializeNew() => (super.noSuchMethod( + _i11.Future updateNode(bool? shouldRefresh) => (super.noSuchMethod( + Invocation.method( + #updateNode, + [shouldRefresh], + ), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); + @override + _i11.Future initializeNew() => (super.noSuchMethod( Invocation.method( #initializeNew, [], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override - _i16.Future initializeExisting() => (super.noSuchMethod( + _i11.Future initializeExisting() => (super.noSuchMethod( Invocation.method( #initializeExisting, [], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override - _i16.Future updateSentCachedTxData(Map? txData) => - (super.noSuchMethod( + _i11.Future refreshIfThereIsNewData() => (super.noSuchMethod( Invocation.method( - #updateSentCachedTxData, - [txData], + #refreshIfThereIsNewData, + [], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); + returnValue: _i11.Future.value(false), + ) as _i11.Future); @override - bool validateAddress(String? address) => (super.noSuchMethod( + _i11.Future getAllTxsToWatch() => (super.noSuchMethod( Invocation.method( - #validateAddress, - [address], + #getAllTxsToWatch, + [], ), - returnValue: false, - ) as bool); + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override - _i16.Future updateNode(bool? shouldRefresh) => (super.noSuchMethod( + _i11.Future refresh() => (super.noSuchMethod( Invocation.method( - #updateNode, - [shouldRefresh], + #refresh, + [], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override - _i16.Future<_i4.ElectrumXNode> getCurrentNode() => (super.noSuchMethod( + List> getLelantusCoinMap() => + (super.noSuchMethod( Invocation.method( - #getCurrentNode, + #getLelantusCoinMap, [], ), - returnValue: _i16.Future<_i4.ElectrumXNode>.value(_FakeElectrumXNode_7( - this, - Invocation.method( - #getCurrentNode, - [], - ), - )), - ) as _i16.Future<_i4.ElectrumXNode>); + returnValue: >[], + ) as List>); @override - _i16.Future>> fastFetch( - List? allTxHashes) => + _i11.Future anonymizeAllPublicFunds() => (super.noSuchMethod( + Invocation.method( + #anonymizeAllPublicFunds, + [], + ), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); + @override + _i11.Future>> createMintsFromAmount(int? total) => (super.noSuchMethod( Invocation.method( - #fastFetch, - [allTxHashes], + #createMintsFromAmount, + [total], ), - returnValue: _i16.Future>>.value( + returnValue: _i11.Future>>.value( >[]), - ) as _i16.Future>>); + ) as _i11.Future>>); + @override + _i11.Future submitHexToNetwork(String? hex) => (super.noSuchMethod( + Invocation.method( + #submitHexToNetwork, + [hex], + ), + returnValue: _i11.Future.value(''), + ) as _i11.Future); @override - _i16.Future getTxCount({required String? address}) => + _i11.Future> buildMintTransaction( + List<_i13.UTXO>? utxosToUse, + int? satoshisPerRecipient, + List>? mintsMap, + ) => (super.noSuchMethod( Invocation.method( - #getTxCount, - [], - {#address: address}, + #buildMintTransaction, + [ + utxosToUse, + satoshisPerRecipient, + mintsMap, + ], ), - returnValue: _i16.Future.value(0), - ) as _i16.Future); + returnValue: + _i11.Future>.value({}), + ) as _i11.Future>); @override - _i16.Future checkCurrentReceivingAddressesForTransactions() => + _i11.Future checkReceivingAddressForTransactions() => (super.noSuchMethod( Invocation.method( - #checkCurrentReceivingAddressesForTransactions, + #checkReceivingAddressForTransactions, [], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override - _i16.Future checkCurrentChangeAddressesForTransactions() => - (super.noSuchMethod( + _i11.Future checkChangeAddressForTransactions() => (super.noSuchMethod( Invocation.method( - #checkCurrentChangeAddressesForTransactions, + #checkChangeAddressForTransactions, [], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override - int estimateTxFee({ - required int? vSize, - required int? feeRatePerKB, + _i11.Future fullRescan( + int? maxUnusedAddressGap, + int? maxNumberOfIndexesToCheck, + ) => + (super.noSuchMethod( + Invocation.method( + #fullRescan, + [ + maxUnusedAddressGap, + maxNumberOfIndexesToCheck, + ], + ), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); + @override + _i11.Future recoverFromMnemonic({ + required String? mnemonic, + String? mnemonicPassphrase, + required int? maxUnusedAddressGap, + required int? maxNumberOfIndexesToCheck, + required int? height, }) => (super.noSuchMethod( Invocation.method( - #estimateTxFee, + #recoverFromMnemonic, [], { - #vSize: vSize, - #feeRatePerKB: feeRatePerKB, + #mnemonic: mnemonic, + #mnemonicPassphrase: mnemonicPassphrase, + #maxUnusedAddressGap: maxUnusedAddressGap, + #maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck, + #height: height, }, ), - returnValue: 0, - ) as int); + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override - dynamic coinSelection({ - required int? satoshiAmountToSend, - required int? selectedTxFeeRate, - required String? recipientAddress, - required bool? coinControl, - required bool? isSendAll, - int? additionalOutputs = 0, - List<_i12.UTXO>? utxos, - }) => - super.noSuchMethod(Invocation.method( - #coinSelection, - [], - { - #satoshiAmountToSend: satoshiAmountToSend, - #selectedTxFeeRate: selectedTxFeeRate, - #recipientAddress: recipientAddress, - #coinControl: coinControl, - #isSendAll: isSendAll, - #additionalOutputs: additionalOutputs, - #utxos: utxos, - }, - )); + _i11.Future> getSetDataMap(int? latestSetId) => + (super.noSuchMethod( + Invocation.method( + #getSetDataMap, + [latestSetId], + ), + returnValue: _i11.Future>.value({}), + ) as _i11.Future>); @override - _i16.Future> fetchBuildTxData( - List<_i12.UTXO>? utxosToUse) => + _i11.Future getTransactionCacheEarly(List? allAddresses) => (super.noSuchMethod( Invocation.method( - #fetchBuildTxData, - [utxosToUse], + #getTransactionCacheEarly, + [allAddresses], ), - returnValue: - _i16.Future>.value(<_i19.SigningData>[]), - ) as _i16.Future>); + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override - _i16.Future> buildTransaction({ - required List<_i19.SigningData>? utxoSigningData, - required List? recipients, - required List? satoshiAmounts, - }) => + _i11.Future>> fetchAnonymitySets() => (super.noSuchMethod( Invocation.method( - #buildTransaction, + #fetchAnonymitySets, [], - { - #utxoSigningData: utxoSigningData, - #recipients: recipients, - #satoshiAmounts: satoshiAmounts, - }, ), - returnValue: - _i16.Future>.value({}), - ) as _i16.Future>); + returnValue: _i11.Future>>.value( + >[]), + ) as _i11.Future>>); + @override + _i11.Future getLatestSetId() => (super.noSuchMethod( + Invocation.method( + #getLatestSetId, + [], + ), + returnValue: _i11.Future.value(0), + ) as _i11.Future); + @override + _i11.Future> getUsedCoinSerials() => (super.noSuchMethod( + Invocation.method( + #getUsedCoinSerials, + [], + ), + returnValue: _i11.Future>.value([]), + ) as _i11.Future>); + @override + _i11.Future exit() => (super.noSuchMethod( + Invocation.method( + #exit, + [], + ), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); + @override + _i11.Future getCoinsToJoinSplit(int? required) => + (super.noSuchMethod( + Invocation.method( + #getCoinsToJoinSplit, + [required], + ), + returnValue: _i11.Future.value(), + ) as _i11.Future); + @override + _i11.Future estimateJoinSplitFee(int? spendAmount) => + (super.noSuchMethod( + Invocation.method( + #estimateJoinSplitFee, + [spendAmount], + ), + returnValue: _i11.Future.value(0), + ) as _i11.Future); @override - _i16.Future fullRescan( - int? maxUnusedAddressGap, - int? maxNumberOfIndexesToCheck, + _i11.Future<_i8.Amount> estimateFeeFor( + _i8.Amount? amount, + int? feeRate, ) => (super.noSuchMethod( Invocation.method( - #fullRescan, + #estimateFeeFor, [ - maxUnusedAddressGap, - maxNumberOfIndexesToCheck, + amount, + feeRate, ], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); + returnValue: _i11.Future<_i8.Amount>.value(_FakeAmount_6( + this, + Invocation.method( + #estimateFeeFor, + [ + amount, + feeRate, + ], + ), + )), + ) as _i11.Future<_i8.Amount>); @override - _i16.Future<_i9.Amount> estimateFeeFor( - _i9.Amount? amount, + _i11.Future<_i8.Amount> estimateFeeForPublic( + _i8.Amount? amount, int? feeRate, ) => (super.noSuchMethod( Invocation.method( - #estimateFeeFor, + #estimateFeeForPublic, [ amount, feeRate, ], ), - returnValue: _i16.Future<_i9.Amount>.value(_FakeAmount_8( + returnValue: _i11.Future<_i8.Amount>.value(_FakeAmount_6( this, Invocation.method( - #estimateFeeFor, + #estimateFeeForPublic, [ amount, feeRate, ], ), )), - ) as _i16.Future<_i9.Amount>); + ) as _i11.Future<_i8.Amount>); @override - _i9.Amount roughFeeEstimate( + _i8.Amount roughFeeEstimate( int? inputCount, int? outputCount, int? feeRatePerKB, @@ -790,7 +831,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i15.BitcoinWallet { feeRatePerKB, ], ), - returnValue: _FakeAmount_8( + returnValue: _FakeAmount_6( this, Invocation.method( #roughFeeEstimate, @@ -801,33 +842,90 @@ class MockBitcoinWallet extends _i1.Mock implements _i15.BitcoinWallet { ], ), ), - ) as _i9.Amount); + ) as _i8.Amount); @override - _i16.Future<_i9.Amount> sweepAllEstimate(int? feeRate) => (super.noSuchMethod( + _i11.Future<_i8.Amount> sweepAllEstimate(int? feeRate) => (super.noSuchMethod( Invocation.method( #sweepAllEstimate, [feeRate], ), - returnValue: _i16.Future<_i9.Amount>.value(_FakeAmount_8( + returnValue: _i11.Future<_i8.Amount>.value(_FakeAmount_6( this, Invocation.method( #sweepAllEstimate, [feeRate], ), )), - ) as _i16.Future<_i9.Amount>); + ) as _i11.Future<_i8.Amount>); + @override + _i11.Future>> fastFetch( + List? allTxHashes) => + (super.noSuchMethod( + Invocation.method( + #fastFetch, + [allTxHashes], + ), + returnValue: _i11.Future>>.value( + >[]), + ) as _i11.Future>>); + @override + _i11.Future> getJMintTransactions( + _i5.CachedElectrumX? cachedClient, + List? transactions, + _i12.Coin? coin, + ) => + (super.noSuchMethod( + Invocation.method( + #getJMintTransactions, + [ + cachedClient, + transactions, + coin, + ], + ), + returnValue: _i11.Future>.value( + <_i13.Address, _i13.Transaction>{}), + ) as _i11.Future>); @override - _i16.Future generateNewAddress() => (super.noSuchMethod( + _i11.Future generateNewAddress() => (super.noSuchMethod( Invocation.method( #generateNewAddress, [], ), - returnValue: _i16.Future.value(false), - ) as _i16.Future); + returnValue: _i11.Future.value(false), + ) as _i11.Future); + @override + _i8.Amount availablePrivateBalance() => (super.noSuchMethod( + Invocation.method( + #availablePrivateBalance, + [], + ), + returnValue: _FakeAmount_6( + this, + Invocation.method( + #availablePrivateBalance, + [], + ), + ), + ) as _i8.Amount); + @override + _i8.Amount availablePublicBalance() => (super.noSuchMethod( + Invocation.method( + #availablePublicBalance, + [], + ), + returnValue: _FakeAmount_6( + this, + Invocation.method( + #availablePublicBalance, + [], + ), + ), + ) as _i8.Amount); @override void initCache( String? walletId, - _i17.Coin? coin, + _i12.Coin? coin, ) => super.noSuchMethod( Invocation.method( @@ -840,14 +938,14 @@ class MockBitcoinWallet extends _i1.Mock implements _i15.BitcoinWallet { returnValueForMissingStub: null, ); @override - _i16.Future updateCachedId(String? id) => (super.noSuchMethod( + _i11.Future updateCachedId(String? id) => (super.noSuchMethod( Invocation.method( #updateCachedId, [id], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override int getCachedChainHeight() => (super.noSuchMethod( Invocation.method( @@ -857,14 +955,14 @@ class MockBitcoinWallet extends _i1.Mock implements _i15.BitcoinWallet { returnValue: 0, ) as int); @override - _i16.Future updateCachedChainHeight(int? height) => (super.noSuchMethod( + _i11.Future updateCachedChainHeight(int? height) => (super.noSuchMethod( Invocation.method( #updateCachedChainHeight, [height], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override bool getCachedIsFavorite() => (super.noSuchMethod( Invocation.method( @@ -874,15 +972,15 @@ class MockBitcoinWallet extends _i1.Mock implements _i15.BitcoinWallet { returnValue: false, ) as bool); @override - _i16.Future updateCachedIsFavorite(bool? isFavorite) => + _i11.Future updateCachedIsFavorite(bool? isFavorite) => (super.noSuchMethod( Invocation.method( #updateCachedIsFavorite, [isFavorite], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override _i6.Balance getCachedBalance() => (super.noSuchMethod( Invocation.method( @@ -898,15 +996,15 @@ class MockBitcoinWallet extends _i1.Mock implements _i15.BitcoinWallet { ), ) as _i6.Balance); @override - _i16.Future updateCachedBalance(_i6.Balance? balance) => + _i11.Future updateCachedBalance(_i6.Balance? balance) => (super.noSuchMethod( Invocation.method( #updateCachedBalance, [balance], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override _i6.Balance getCachedBalanceSecondary() => (super.noSuchMethod( Invocation.method( @@ -922,510 +1020,88 @@ class MockBitcoinWallet extends _i1.Mock implements _i15.BitcoinWallet { ), ) as _i6.Balance); @override - _i16.Future updateCachedBalanceSecondary(_i6.Balance? balance) => + _i11.Future updateCachedBalanceSecondary(_i6.Balance? balance) => (super.noSuchMethod( Invocation.method( #updateCachedBalanceSecondary, [balance], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override - void initWalletDB({_i7.MainDB? mockableOverride}) => super.noSuchMethod( + List getWalletTokenContractAddresses() => (super.noSuchMethod( Invocation.method( - #initWalletDB, + #getWalletTokenContractAddresses, [], - {#mockableOverride: mockableOverride}, ), - returnValueForMissingStub: null, - ); + returnValue: [], + ) as List); @override - _i16.Future<_i10.Tuple2<_i12.Transaction, _i12.Address>> parseTransaction( - Map? txData, - dynamic electrumxClient, - List<_i12.Address>? myAddresses, - _i17.Coin? coin, - int? minConfirms, - String? walletId, - ) => + _i11.Future updateWalletTokenContractAddresses( + List? contractAddresses) => (super.noSuchMethod( Invocation.method( - #parseTransaction, - [ - txData, - electrumxClient, - myAddresses, - coin, - minConfirms, - walletId, - ], + #updateWalletTokenContractAddresses, + [contractAddresses], ), - returnValue: - _i16.Future<_i10.Tuple2<_i12.Transaction, _i12.Address>>.value( - _FakeTuple2_9<_i12.Transaction, _i12.Address>( - this, - Invocation.method( - #parseTransaction, - [ - txData, - electrumxClient, - myAddresses, - coin, - minConfirms, - walletId, - ], - ), - )), - ) as _i16.Future<_i10.Tuple2<_i12.Transaction, _i12.Address>>); - @override - void initPaynymWalletInterface({ - required String? walletId, - required String? walletName, - required _i8.NetworkType? network, - required _i17.Coin? coin, - required _i7.MainDB? db, - required _i4.ElectrumX? electrumXClient, - required _i20.SecureStorageInterface? secureStorage, - required int? dustLimit, - required int? dustLimitP2PKH, - required int? minConfirms, - required _i16.Future Function()? getMnemonicString, - required _i16.Future Function()? getMnemonicPassphrase, - required _i16.Future Function()? getChainHeight, - required _i16.Future Function()? getCurrentChangeAddress, - required int Function({ - required int feeRatePerKB, - required int vSize, - })? - estimateTxFee, - required _i16.Future> Function({ - required String address, - required _i9.Amount amount, - Map? args, - })? - prepareSend, - required _i16.Future Function({required String address})? getTxCount, - required _i16.Future> Function(List<_i12.UTXO>)? - fetchBuildTxData, - required _i16.Future Function()? refresh, - required _i16.Future Function()? checkChangeAddressForTransactions, - }) => - super.noSuchMethod( + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); + @override + void initWalletDB({_i7.MainDB? mockableOverride}) => super.noSuchMethod( Invocation.method( - #initPaynymWalletInterface, + #initWalletDB, [], - { - #walletId: walletId, - #walletName: walletName, - #network: network, - #coin: coin, - #db: db, - #electrumXClient: electrumXClient, - #secureStorage: secureStorage, - #dustLimit: dustLimit, - #dustLimitP2PKH: dustLimitP2PKH, - #minConfirms: minConfirms, - #getMnemonicString: getMnemonicString, - #getMnemonicPassphrase: getMnemonicPassphrase, - #getChainHeight: getChainHeight, - #getCurrentChangeAddress: getCurrentChangeAddress, - #estimateTxFee: estimateTxFee, - #prepareSend: prepareSend, - #getTxCount: getTxCount, - #fetchBuildTxData: fetchBuildTxData, - #refresh: refresh, - #checkChangeAddressForTransactions: - checkChangeAddressForTransactions, - }, + {#mockableOverride: mockableOverride}, ), returnValueForMissingStub: null, ); @override - _i16.Future<_i11.BIP32> getBip47BaseNode() => (super.noSuchMethod( - Invocation.method( - #getBip47BaseNode, - [], - ), - returnValue: _i16.Future<_i11.BIP32>.value(_FakeBIP32_10( - this, - Invocation.method( - #getBip47BaseNode, - [], - ), - )), - ) as _i16.Future<_i11.BIP32>); - @override - _i16.Future<_i21.Uint8List> getPrivateKeyForPaynymReceivingAddress({ - required String? paymentCodeString, - required int? index, - }) => - (super.noSuchMethod( - Invocation.method( - #getPrivateKeyForPaynymReceivingAddress, - [], - { - #paymentCodeString: paymentCodeString, - #index: index, - }, - ), - returnValue: _i16.Future<_i21.Uint8List>.value(_i21.Uint8List(0)), - ) as _i16.Future<_i21.Uint8List>); - @override - _i16.Future<_i12.Address> currentReceivingPaynymAddress({ - required _i13.PaymentCode? sender, - required bool? isSegwit, - }) => - (super.noSuchMethod( - Invocation.method( - #currentReceivingPaynymAddress, - [], - { - #sender: sender, - #isSegwit: isSegwit, - }, - ), - returnValue: _i16.Future<_i12.Address>.value(_FakeAddress_11( - this, - Invocation.method( - #currentReceivingPaynymAddress, - [], - { - #sender: sender, - #isSegwit: isSegwit, - }, - ), - )), - ) as _i16.Future<_i12.Address>); - @override - _i16.Future checkCurrentPaynymReceivingAddressForTransactions({ - required _i13.PaymentCode? sender, - required bool? isSegwit, - }) => - (super.noSuchMethod( - Invocation.method( - #checkCurrentPaynymReceivingAddressForTransactions, - [], - { - #sender: sender, - #isSegwit: isSegwit, - }, - ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); - @override - _i16.Future checkAllCurrentReceivingPaynymAddressesForTransactions() => - (super.noSuchMethod( - Invocation.method( - #checkAllCurrentReceivingPaynymAddressesForTransactions, - [], - ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); - @override - _i16.Future<_i11.BIP32> deriveNotificationBip32Node() => (super.noSuchMethod( - Invocation.method( - #deriveNotificationBip32Node, - [], - ), - returnValue: _i16.Future<_i11.BIP32>.value(_FakeBIP32_10( - this, - Invocation.method( - #deriveNotificationBip32Node, - [], - ), - )), - ) as _i16.Future<_i11.BIP32>); - @override - _i16.Future<_i13.PaymentCode> getPaymentCode({required bool? isSegwit}) => - (super.noSuchMethod( - Invocation.method( - #getPaymentCode, - [], - {#isSegwit: isSegwit}, - ), - returnValue: _i16.Future<_i13.PaymentCode>.value(_FakePaymentCode_12( - this, - Invocation.method( - #getPaymentCode, - [], - {#isSegwit: isSegwit}, - ), - )), - ) as _i16.Future<_i13.PaymentCode>); - @override - _i16.Future<_i21.Uint8List> signWithNotificationKey(_i21.Uint8List? data) => - (super.noSuchMethod( - Invocation.method( - #signWithNotificationKey, - [data], - ), - returnValue: _i16.Future<_i21.Uint8List>.value(_i21.Uint8List(0)), - ) as _i16.Future<_i21.Uint8List>); - @override - _i16.Future signStringWithNotificationKey(String? data) => - (super.noSuchMethod( - Invocation.method( - #signStringWithNotificationKey, - [data], - ), - returnValue: _i16.Future.value(''), - ) as _i16.Future); - @override - _i16.Future> preparePaymentCodeSend({ - required _i13.PaymentCode? paymentCode, - required bool? isSegwit, - required _i9.Amount? amount, - Map? args, - }) => - (super.noSuchMethod( - Invocation.method( - #preparePaymentCodeSend, - [], - { - #paymentCode: paymentCode, - #isSegwit: isSegwit, - #amount: amount, - #args: args, - }, - ), - returnValue: - _i16.Future>.value({}), - ) as _i16.Future>); - @override - _i16.Future<_i12.Address> nextUnusedSendAddressFrom({ - required _i13.PaymentCode? pCode, - required bool? isSegwit, - required _i11.BIP32? privateKeyNode, - int? startIndex = 0, - }) => - (super.noSuchMethod( - Invocation.method( - #nextUnusedSendAddressFrom, - [], - { - #pCode: pCode, - #isSegwit: isSegwit, - #privateKeyNode: privateKeyNode, - #startIndex: startIndex, - }, - ), - returnValue: _i16.Future<_i12.Address>.value(_FakeAddress_11( - this, - Invocation.method( - #nextUnusedSendAddressFrom, - [], - { - #pCode: pCode, - #isSegwit: isSegwit, - #privateKeyNode: privateKeyNode, - #startIndex: startIndex, - }, - ), - )), - ) as _i16.Future<_i12.Address>); - @override - _i16.Future> prepareNotificationTx({ - required int? selectedTxFeeRate, - required String? targetPaymentCodeString, - int? additionalOutputs = 0, - List<_i12.UTXO>? utxos, - }) => - (super.noSuchMethod( - Invocation.method( - #prepareNotificationTx, - [], - { - #selectedTxFeeRate: selectedTxFeeRate, - #targetPaymentCodeString: targetPaymentCodeString, - #additionalOutputs: additionalOutputs, - #utxos: utxos, - }, - ), - returnValue: - _i16.Future>.value({}), - ) as _i16.Future>); - @override - _i16.Future broadcastNotificationTx( - {required Map? preparedTx}) => - (super.noSuchMethod( - Invocation.method( - #broadcastNotificationTx, - [], - {#preparedTx: preparedTx}, - ), - returnValue: _i16.Future.value(''), - ) as _i16.Future); - @override - _i16.Future hasConnected(String? paymentCodeString) => - (super.noSuchMethod( - Invocation.method( - #hasConnected, - [paymentCodeString], - ), - returnValue: _i16.Future.value(false), - ) as _i16.Future); - @override - _i16.Future<_i13.PaymentCode?> unBlindedPaymentCodeFromTransaction( - {required _i12.Transaction? transaction}) => - (super.noSuchMethod( - Invocation.method( - #unBlindedPaymentCodeFromTransaction, - [], - {#transaction: transaction}, - ), - returnValue: _i16.Future<_i13.PaymentCode?>.value(), - ) as _i16.Future<_i13.PaymentCode?>); - @override - _i16.Future<_i13.PaymentCode?> unBlindedPaymentCodeFromTransactionBad( - {required _i12.Transaction? transaction}) => - (super.noSuchMethod( - Invocation.method( - #unBlindedPaymentCodeFromTransactionBad, - [], - {#transaction: transaction}, - ), - returnValue: _i16.Future<_i13.PaymentCode?>.value(), - ) as _i16.Future<_i13.PaymentCode?>); - @override - _i16.Future> - getAllPaymentCodesFromNotificationTransactions() => (super.noSuchMethod( - Invocation.method( - #getAllPaymentCodesFromNotificationTransactions, - [], - ), - returnValue: - _i16.Future>.value(<_i13.PaymentCode>[]), - ) as _i16.Future>); - @override - _i16.Future checkForNotificationTransactionsTo( - Set? otherCodeStrings) => - (super.noSuchMethod( - Invocation.method( - #checkForNotificationTransactionsTo, - [otherCodeStrings], - ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); - @override - _i16.Future restoreAllHistory({ - required int? maxUnusedAddressGap, - required int? maxNumberOfIndexesToCheck, - required Set? paymentCodeStrings, - }) => - (super.noSuchMethod( - Invocation.method( - #restoreAllHistory, - [], - { - #maxUnusedAddressGap: maxUnusedAddressGap, - #maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck, - #paymentCodeStrings: paymentCodeStrings, - }, - ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); - @override - _i16.Future restoreHistoryWith({ - required _i13.PaymentCode? other, - required bool? checkSegwitAsWell, - required int? maxUnusedAddressGap, - required int? maxNumberOfIndexesToCheck, - }) => - (super.noSuchMethod( - Invocation.method( - #restoreHistoryWith, - [], - { - #other: other, - #checkSegwitAsWell: checkSegwitAsWell, - #maxUnusedAddressGap: maxUnusedAddressGap, - #maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck, - }, - ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); - @override - _i16.Future<_i12.Address> getMyNotificationAddress() => (super.noSuchMethod( - Invocation.method( - #getMyNotificationAddress, - [], - ), - returnValue: _i16.Future<_i12.Address>.value(_FakeAddress_11( - this, - Invocation.method( - #getMyNotificationAddress, - [], - ), - )), - ) as _i16.Future<_i12.Address>); - @override - _i16.Future> lookupKey(String? paymentCodeString) => - (super.noSuchMethod( + void initFiroHive(String? walletId) => super.noSuchMethod( Invocation.method( - #lookupKey, - [paymentCodeString], + #initFiroHive, + [walletId], ), - returnValue: _i16.Future>.value([]), - ) as _i16.Future>); + returnValueForMissingStub: null, + ); @override - _i16.Future paymentCodeStringByKey(String? key) => + _i11.Future firoUpdateJIndex(List? jIndex) => (super.noSuchMethod( Invocation.method( - #paymentCodeStringByKey, - [key], + #firoUpdateJIndex, + [jIndex], ), - returnValue: _i16.Future.value(), - ) as _i16.Future); + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override - _i16.Future storeCode(String? paymentCodeString) => + _i11.Future firoUpdateLelantusCoins(List? lelantusCoins) => (super.noSuchMethod( Invocation.method( - #storeCode, - [paymentCodeString], + #firoUpdateLelantusCoins, + [lelantusCoins], ), - returnValue: _i16.Future.value(''), - ) as _i16.Future); + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); @override - void initCoinControlInterface({ - required String? walletId, - required String? walletName, - required _i17.Coin? coin, - required _i7.MainDB? db, - required _i16.Future Function()? getChainHeight, - required _i16.Future Function(_i6.Balance)? refreshedBalanceCallback, - }) => - super.noSuchMethod( + int firoGetMintIndex() => (super.noSuchMethod( Invocation.method( - #initCoinControlInterface, + #firoGetMintIndex, [], - { - #walletId: walletId, - #walletName: walletName, - #coin: coin, - #db: db, - #getChainHeight: getChainHeight, - #refreshedBalanceCallback: refreshedBalanceCallback, - }, ), - returnValueForMissingStub: null, - ); + returnValue: 0, + ) as int); @override - _i16.Future refreshBalance({bool? notify = false}) => - (super.noSuchMethod( + _i11.Future firoUpdateMintIndex(int? mintIndex) => (super.noSuchMethod( Invocation.method( - #refreshBalance, - [], - {#notify: notify}, + #firoUpdateMintIndex, + [mintIndex], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) as _i11.Future); } /// A class which mocks [ElectrumX]. @@ -1473,7 +1149,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { returnValue: false, ) as bool); @override - _i16.Future request({ + _i11.Future request({ required String? command, List? args = const [], Duration? connectionTimeout = const Duration(seconds: 60), @@ -1492,10 +1168,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i16.Future.value(), - ) as _i16.Future); + returnValue: _i11.Future.value(), + ) as _i11.Future); @override - _i16.Future>> batchRequest({ + _i11.Future>> batchRequest({ required String? command, required Map>? args, Duration? connectionTimeout = const Duration(seconds: 60), @@ -1512,11 +1188,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i16.Future>>.value( + returnValue: _i11.Future>>.value( >[]), - ) as _i16.Future>>); + ) as _i11.Future>>); @override - _i16.Future ping({ + _i11.Future ping({ String? requestID, int? retryCount = 1, }) => @@ -1529,10 +1205,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retryCount: retryCount, }, ), - returnValue: _i16.Future.value(false), - ) as _i16.Future); + returnValue: _i11.Future.value(false), + ) as _i11.Future); @override - _i16.Future> getBlockHeadTip({String? requestID}) => + _i11.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( Invocation.method( #getBlockHeadTip, @@ -1540,10 +1216,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i16.Future>.value({}), - ) as _i16.Future>); + _i11.Future>.value({}), + ) as _i11.Future>); @override - _i16.Future> getServerFeatures({String? requestID}) => + _i11.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( Invocation.method( #getServerFeatures, @@ -1551,10 +1227,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i16.Future>.value({}), - ) as _i16.Future>); + _i11.Future>.value({}), + ) as _i11.Future>); @override - _i16.Future broadcastTransaction({ + _i11.Future broadcastTransaction({ required String? rawTx, String? requestID, }) => @@ -1567,10 +1243,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i16.Future.value(''), - ) as _i16.Future); + returnValue: _i11.Future.value(''), + ) as _i11.Future); @override - _i16.Future> getBalance({ + _i11.Future> getBalance({ required String? scripthash, String? requestID, }) => @@ -1584,10 +1260,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i16.Future>.value({}), - ) as _i16.Future>); + _i11.Future>.value({}), + ) as _i11.Future>); @override - _i16.Future>> getHistory({ + _i11.Future>> getHistory({ required String? scripthash, String? requestID, }) => @@ -1600,11 +1276,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i16.Future>>.value( + returnValue: _i11.Future>>.value( >[]), - ) as _i16.Future>>); + ) as _i11.Future>>); @override - _i16.Future>>> getBatchHistory( + _i11.Future>>> getBatchHistory( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -1612,11 +1288,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i16.Future>>>.value( + returnValue: _i11.Future>>>.value( >>{}), - ) as _i16.Future>>>); + ) as _i11.Future>>>); @override - _i16.Future>> getUTXOs({ + _i11.Future>> getUTXOs({ required String? scripthash, String? requestID, }) => @@ -1629,11 +1305,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i16.Future>>.value( + returnValue: _i11.Future>>.value( >[]), - ) as _i16.Future>>); + ) as _i11.Future>>); @override - _i16.Future>>> getBatchUTXOs( + _i11.Future>>> getBatchUTXOs( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -1641,11 +1317,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i16.Future>>>.value( + returnValue: _i11.Future>>>.value( >>{}), - ) as _i16.Future>>>); + ) as _i11.Future>>>); @override - _i16.Future> getTransaction({ + _i11.Future> getTransaction({ required String? txHash, bool? verbose = true, String? requestID, @@ -1661,10 +1337,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i16.Future>.value({}), - ) as _i16.Future>); + _i11.Future>.value({}), + ) as _i11.Future>); @override - _i16.Future> getAnonymitySet({ + _i11.Future> getAnonymitySet({ String? groupId = r'1', String? blockhash = r'', String? requestID, @@ -1680,10 +1356,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i16.Future>.value({}), - ) as _i16.Future>); + _i11.Future>.value({}), + ) as _i11.Future>); @override - _i16.Future getMintData({ + _i11.Future getMintData({ dynamic mints, String? requestID, }) => @@ -1696,10 +1372,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i16.Future.value(), - ) as _i16.Future); + returnValue: _i11.Future.value(), + ) as _i11.Future); @override - _i16.Future> getUsedCoinSerials({ + _i11.Future> getUsedCoinSerials({ String? requestID, required int? startNumber, }) => @@ -1713,19 +1389,19 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i16.Future>.value({}), - ) as _i16.Future>); + _i11.Future>.value({}), + ) as _i11.Future>); @override - _i16.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( + _i11.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i16.Future.value(0), - ) as _i16.Future); + returnValue: _i11.Future.value(0), + ) as _i11.Future); @override - _i16.Future> getFeeRate({String? requestID}) => + _i11.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( Invocation.method( #getFeeRate, @@ -1733,10 +1409,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i16.Future>.value({}), - ) as _i16.Future>); + _i11.Future>.value({}), + ) as _i11.Future>); @override - _i16.Future<_i14.Decimal> estimateFee({ + _i11.Future<_i9.Decimal> estimateFee({ String? requestID, required int? blocks, }) => @@ -1749,7 +1425,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #blocks: blocks, }, ), - returnValue: _i16.Future<_i14.Decimal>.value(_FakeDecimal_13( + returnValue: _i11.Future<_i9.Decimal>.value(_FakeDecimal_7( this, Invocation.method( #estimateFee, @@ -1760,16 +1436,15 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), )), - ) as _i16.Future<_i14.Decimal>); + ) as _i11.Future<_i9.Decimal>); @override - _i16.Future<_i14.Decimal> relayFee({String? requestID}) => - (super.noSuchMethod( + _i11.Future<_i9.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( Invocation.method( #relayFee, [], {#requestID: requestID}, ), - returnValue: _i16.Future<_i14.Decimal>.value(_FakeDecimal_13( + returnValue: _i11.Future<_i9.Decimal>.value(_FakeDecimal_7( this, Invocation.method( #relayFee, @@ -1777,5 +1452,5 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), )), - ) as _i16.Future<_i14.Decimal>); + ) as _i11.Future<_i9.Decimal>); } diff --git a/test/services/coins/namecoin/namecoin_wallet_test.mocks.dart b/test/services/coins/namecoin/namecoin_wallet_test.mocks.dart new file mode 100644 index 000000000..ec242c79c --- /dev/null +++ b/test/services/coins/namecoin/namecoin_wallet_test.mocks.dart @@ -0,0 +1,564 @@ +// Mocks generated by Mockito 5.3.2 from annotations +// in stackwallet/test/services/coins/namecoin/namecoin_wallet_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i4; + +import 'package:decimal/decimal.dart' as _i2; +import 'package:mockito/mockito.dart' as _i1; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i5; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i3; +import 'package:stackwallet/services/transaction_notification_tracker.dart' + as _i7; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i6; + +// 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 + +class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal { + _FakeDecimal_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX { + _FakeElectrumX_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [ElectrumX]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockElectrumX extends _i1.Mock implements _i3.ElectrumX { + MockElectrumX() { + _i1.throwOnMissingStub(this); + } + + @override + set failovers(List<_i3.ElectrumXNode>? _failovers) => super.noSuchMethod( + Invocation.setter( + #failovers, + _failovers, + ), + returnValueForMissingStub: null, + ); + @override + int get currentFailoverIndex => (super.noSuchMethod( + Invocation.getter(#currentFailoverIndex), + returnValue: 0, + ) as int); + @override + set currentFailoverIndex(int? _currentFailoverIndex) => super.noSuchMethod( + Invocation.setter( + #currentFailoverIndex, + _currentFailoverIndex, + ), + returnValueForMissingStub: null, + ); + @override + String get host => (super.noSuchMethod( + Invocation.getter(#host), + returnValue: '', + ) as String); + @override + int get port => (super.noSuchMethod( + Invocation.getter(#port), + returnValue: 0, + ) as int); + @override + bool get useSSL => (super.noSuchMethod( + Invocation.getter(#useSSL), + returnValue: false, + ) as bool); + @override + _i4.Future request({ + required String? command, + List? args = const [], + Duration? connectionTimeout = const Duration(seconds: 60), + String? requestID, + int? retries = 2, + }) => + (super.noSuchMethod( + Invocation.method( + #request, + [], + { + #command: command, + #args: args, + #connectionTimeout: connectionTimeout, + #requestID: requestID, + #retries: retries, + }, + ), + returnValue: _i4.Future.value(), + ) as _i4.Future); + @override + _i4.Future>> batchRequest({ + required String? command, + required Map>? args, + Duration? connectionTimeout = const Duration(seconds: 60), + int? retries = 2, + }) => + (super.noSuchMethod( + Invocation.method( + #batchRequest, + [], + { + #command: command, + #args: args, + #connectionTimeout: connectionTimeout, + #retries: retries, + }, + ), + returnValue: _i4.Future>>.value( + >[]), + ) as _i4.Future>>); + @override + _i4.Future ping({ + String? requestID, + int? retryCount = 1, + }) => + (super.noSuchMethod( + Invocation.method( + #ping, + [], + { + #requestID: requestID, + #retryCount: retryCount, + }, + ), + returnValue: _i4.Future.value(false), + ) as _i4.Future); + @override + _i4.Future> getBlockHeadTip({String? requestID}) => + (super.noSuchMethod( + Invocation.method( + #getBlockHeadTip, + [], + {#requestID: requestID}, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future> getServerFeatures({String? requestID}) => + (super.noSuchMethod( + Invocation.method( + #getServerFeatures, + [], + {#requestID: requestID}, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future broadcastTransaction({ + required String? rawTx, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #broadcastTransaction, + [], + { + #rawTx: rawTx, + #requestID: requestID, + }, + ), + returnValue: _i4.Future.value(''), + ) as _i4.Future); + @override + _i4.Future> getBalance({ + required String? scripthash, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getBalance, + [], + { + #scripthash: scripthash, + #requestID: requestID, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future>> getHistory({ + required String? scripthash, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getHistory, + [], + { + #scripthash: scripthash, + #requestID: requestID, + }, + ), + returnValue: _i4.Future>>.value( + >[]), + ) as _i4.Future>>); + @override + _i4.Future>>> getBatchHistory( + {required Map>? args}) => + (super.noSuchMethod( + Invocation.method( + #getBatchHistory, + [], + {#args: args}, + ), + returnValue: _i4.Future>>>.value( + >>{}), + ) as _i4.Future>>>); + @override + _i4.Future>> getUTXOs({ + required String? scripthash, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getUTXOs, + [], + { + #scripthash: scripthash, + #requestID: requestID, + }, + ), + returnValue: _i4.Future>>.value( + >[]), + ) as _i4.Future>>); + @override + _i4.Future>>> getBatchUTXOs( + {required Map>? args}) => + (super.noSuchMethod( + Invocation.method( + #getBatchUTXOs, + [], + {#args: args}, + ), + returnValue: _i4.Future>>>.value( + >>{}), + ) as _i4.Future>>>); + @override + _i4.Future> getTransaction({ + required String? txHash, + bool? verbose = true, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getTransaction, + [], + { + #txHash: txHash, + #verbose: verbose, + #requestID: requestID, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future> getAnonymitySet({ + String? groupId = r'1', + String? blockhash = r'', + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getAnonymitySet, + [], + { + #groupId: groupId, + #blockhash: blockhash, + #requestID: requestID, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future getMintData({ + dynamic mints, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getMintData, + [], + { + #mints: mints, + #requestID: requestID, + }, + ), + returnValue: _i4.Future.value(), + ) as _i4.Future); + @override + _i4.Future> getUsedCoinSerials({ + String? requestID, + required int? startNumber, + }) => + (super.noSuchMethod( + Invocation.method( + #getUsedCoinSerials, + [], + { + #requestID: requestID, + #startNumber: startNumber, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( + Invocation.method( + #getLatestCoinId, + [], + {#requestID: requestID}, + ), + returnValue: _i4.Future.value(0), + ) as _i4.Future); + @override + _i4.Future> getFeeRate({String? requestID}) => + (super.noSuchMethod( + Invocation.method( + #getFeeRate, + [], + {#requestID: requestID}, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future<_i2.Decimal> estimateFee({ + String? requestID, + required int? blocks, + }) => + (super.noSuchMethod( + Invocation.method( + #estimateFee, + [], + { + #requestID: requestID, + #blocks: blocks, + }, + ), + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( + this, + Invocation.method( + #estimateFee, + [], + { + #requestID: requestID, + #blocks: blocks, + }, + ), + )), + ) as _i4.Future<_i2.Decimal>); + @override + _i4.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + Invocation.method( + #relayFee, + [], + {#requestID: requestID}, + ), + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( + this, + Invocation.method( + #relayFee, + [], + {#requestID: requestID}, + ), + )), + ) as _i4.Future<_i2.Decimal>); +} + +/// A class which mocks [CachedElectrumX]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX { + MockCachedElectrumX() { + _i1.throwOnMissingStub(this); + } + + @override + _i3.ElectrumX get electrumXClient => (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumX_1( + this, + Invocation.getter(#electrumXClient), + ), + ) as _i3.ElectrumX); + @override + _i4.Future> getAnonymitySet({ + required String? groupId, + String? blockhash = r'', + required _i6.Coin? coin, + }) => + (super.noSuchMethod( + Invocation.method( + #getAnonymitySet, + [], + { + #groupId: groupId, + #blockhash: blockhash, + #coin: coin, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + String base64ToHex(String? source) => (super.noSuchMethod( + Invocation.method( + #base64ToHex, + [source], + ), + returnValue: '', + ) as String); + @override + String base64ToReverseHex(String? source) => (super.noSuchMethod( + Invocation.method( + #base64ToReverseHex, + [source], + ), + returnValue: '', + ) as String); + @override + _i4.Future> getTransaction({ + required String? txHash, + required _i6.Coin? coin, + bool? verbose = true, + }) => + (super.noSuchMethod( + Invocation.method( + #getTransaction, + [], + { + #txHash: txHash, + #coin: coin, + #verbose: verbose, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future> getUsedCoinSerials({ + required _i6.Coin? coin, + int? startNumber = 0, + }) => + (super.noSuchMethod( + Invocation.method( + #getUsedCoinSerials, + [], + { + #coin: coin, + #startNumber: startNumber, + }, + ), + returnValue: _i4.Future>.value([]), + ) as _i4.Future>); + @override + _i4.Future clearSharedTransactionCache({required _i6.Coin? coin}) => + (super.noSuchMethod( + Invocation.method( + #clearSharedTransactionCache, + [], + {#coin: coin}, + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); +} + +/// A class which mocks [TransactionNotificationTracker]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockTransactionNotificationTracker extends _i1.Mock + implements _i7.TransactionNotificationTracker { + MockTransactionNotificationTracker() { + _i1.throwOnMissingStub(this); + } + + @override + String get walletId => (super.noSuchMethod( + Invocation.getter(#walletId), + returnValue: '', + ) as String); + @override + List get pendings => (super.noSuchMethod( + Invocation.getter(#pendings), + returnValue: [], + ) as List); + @override + List get confirmeds => (super.noSuchMethod( + Invocation.getter(#confirmeds), + returnValue: [], + ) as List); + @override + bool wasNotifiedPending(String? txid) => (super.noSuchMethod( + Invocation.method( + #wasNotifiedPending, + [txid], + ), + returnValue: false, + ) as bool); + @override + _i4.Future addNotifiedPending(String? txid) => (super.noSuchMethod( + Invocation.method( + #addNotifiedPending, + [txid], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + @override + bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( + Invocation.method( + #wasNotifiedConfirmed, + [txid], + ), + returnValue: false, + ) as bool); + @override + _i4.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( + Invocation.method( + #addNotifiedConfirmed, + [txid], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + @override + _i4.Future deleteTransaction(String? txid) => (super.noSuchMethod( + Invocation.method( + #deleteTransaction, + [txid], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); +} diff --git a/test/services/coins/particl/particl_wallet_test.mocks.dart b/test/services/coins/particl/particl_wallet_test.mocks.dart new file mode 100644 index 000000000..e4677cc8e --- /dev/null +++ b/test/services/coins/particl/particl_wallet_test.mocks.dart @@ -0,0 +1,564 @@ +// Mocks generated by Mockito 5.3.2 from annotations +// in stackwallet/test/services/coins/particl/particl_wallet_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i4; + +import 'package:decimal/decimal.dart' as _i2; +import 'package:mockito/mockito.dart' as _i1; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i5; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i3; +import 'package:stackwallet/services/transaction_notification_tracker.dart' + as _i7; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i6; + +// 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 + +class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal { + _FakeDecimal_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX { + _FakeElectrumX_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [ElectrumX]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockElectrumX extends _i1.Mock implements _i3.ElectrumX { + MockElectrumX() { + _i1.throwOnMissingStub(this); + } + + @override + set failovers(List<_i3.ElectrumXNode>? _failovers) => super.noSuchMethod( + Invocation.setter( + #failovers, + _failovers, + ), + returnValueForMissingStub: null, + ); + @override + int get currentFailoverIndex => (super.noSuchMethod( + Invocation.getter(#currentFailoverIndex), + returnValue: 0, + ) as int); + @override + set currentFailoverIndex(int? _currentFailoverIndex) => super.noSuchMethod( + Invocation.setter( + #currentFailoverIndex, + _currentFailoverIndex, + ), + returnValueForMissingStub: null, + ); + @override + String get host => (super.noSuchMethod( + Invocation.getter(#host), + returnValue: '', + ) as String); + @override + int get port => (super.noSuchMethod( + Invocation.getter(#port), + returnValue: 0, + ) as int); + @override + bool get useSSL => (super.noSuchMethod( + Invocation.getter(#useSSL), + returnValue: false, + ) as bool); + @override + _i4.Future request({ + required String? command, + List? args = const [], + Duration? connectionTimeout = const Duration(seconds: 60), + String? requestID, + int? retries = 2, + }) => + (super.noSuchMethod( + Invocation.method( + #request, + [], + { + #command: command, + #args: args, + #connectionTimeout: connectionTimeout, + #requestID: requestID, + #retries: retries, + }, + ), + returnValue: _i4.Future.value(), + ) as _i4.Future); + @override + _i4.Future>> batchRequest({ + required String? command, + required Map>? args, + Duration? connectionTimeout = const Duration(seconds: 60), + int? retries = 2, + }) => + (super.noSuchMethod( + Invocation.method( + #batchRequest, + [], + { + #command: command, + #args: args, + #connectionTimeout: connectionTimeout, + #retries: retries, + }, + ), + returnValue: _i4.Future>>.value( + >[]), + ) as _i4.Future>>); + @override + _i4.Future ping({ + String? requestID, + int? retryCount = 1, + }) => + (super.noSuchMethod( + Invocation.method( + #ping, + [], + { + #requestID: requestID, + #retryCount: retryCount, + }, + ), + returnValue: _i4.Future.value(false), + ) as _i4.Future); + @override + _i4.Future> getBlockHeadTip({String? requestID}) => + (super.noSuchMethod( + Invocation.method( + #getBlockHeadTip, + [], + {#requestID: requestID}, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future> getServerFeatures({String? requestID}) => + (super.noSuchMethod( + Invocation.method( + #getServerFeatures, + [], + {#requestID: requestID}, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future broadcastTransaction({ + required String? rawTx, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #broadcastTransaction, + [], + { + #rawTx: rawTx, + #requestID: requestID, + }, + ), + returnValue: _i4.Future.value(''), + ) as _i4.Future); + @override + _i4.Future> getBalance({ + required String? scripthash, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getBalance, + [], + { + #scripthash: scripthash, + #requestID: requestID, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future>> getHistory({ + required String? scripthash, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getHistory, + [], + { + #scripthash: scripthash, + #requestID: requestID, + }, + ), + returnValue: _i4.Future>>.value( + >[]), + ) as _i4.Future>>); + @override + _i4.Future>>> getBatchHistory( + {required Map>? args}) => + (super.noSuchMethod( + Invocation.method( + #getBatchHistory, + [], + {#args: args}, + ), + returnValue: _i4.Future>>>.value( + >>{}), + ) as _i4.Future>>>); + @override + _i4.Future>> getUTXOs({ + required String? scripthash, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getUTXOs, + [], + { + #scripthash: scripthash, + #requestID: requestID, + }, + ), + returnValue: _i4.Future>>.value( + >[]), + ) as _i4.Future>>); + @override + _i4.Future>>> getBatchUTXOs( + {required Map>? args}) => + (super.noSuchMethod( + Invocation.method( + #getBatchUTXOs, + [], + {#args: args}, + ), + returnValue: _i4.Future>>>.value( + >>{}), + ) as _i4.Future>>>); + @override + _i4.Future> getTransaction({ + required String? txHash, + bool? verbose = true, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getTransaction, + [], + { + #txHash: txHash, + #verbose: verbose, + #requestID: requestID, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future> getAnonymitySet({ + String? groupId = r'1', + String? blockhash = r'', + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getAnonymitySet, + [], + { + #groupId: groupId, + #blockhash: blockhash, + #requestID: requestID, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future getMintData({ + dynamic mints, + String? requestID, + }) => + (super.noSuchMethod( + Invocation.method( + #getMintData, + [], + { + #mints: mints, + #requestID: requestID, + }, + ), + returnValue: _i4.Future.value(), + ) as _i4.Future); + @override + _i4.Future> getUsedCoinSerials({ + String? requestID, + required int? startNumber, + }) => + (super.noSuchMethod( + Invocation.method( + #getUsedCoinSerials, + [], + { + #requestID: requestID, + #startNumber: startNumber, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( + Invocation.method( + #getLatestCoinId, + [], + {#requestID: requestID}, + ), + returnValue: _i4.Future.value(0), + ) as _i4.Future); + @override + _i4.Future> getFeeRate({String? requestID}) => + (super.noSuchMethod( + Invocation.method( + #getFeeRate, + [], + {#requestID: requestID}, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future<_i2.Decimal> estimateFee({ + String? requestID, + required int? blocks, + }) => + (super.noSuchMethod( + Invocation.method( + #estimateFee, + [], + { + #requestID: requestID, + #blocks: blocks, + }, + ), + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( + this, + Invocation.method( + #estimateFee, + [], + { + #requestID: requestID, + #blocks: blocks, + }, + ), + )), + ) as _i4.Future<_i2.Decimal>); + @override + _i4.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + Invocation.method( + #relayFee, + [], + {#requestID: requestID}, + ), + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( + this, + Invocation.method( + #relayFee, + [], + {#requestID: requestID}, + ), + )), + ) as _i4.Future<_i2.Decimal>); +} + +/// A class which mocks [CachedElectrumX]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX { + MockCachedElectrumX() { + _i1.throwOnMissingStub(this); + } + + @override + _i3.ElectrumX get electrumXClient => (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumX_1( + this, + Invocation.getter(#electrumXClient), + ), + ) as _i3.ElectrumX); + @override + _i4.Future> getAnonymitySet({ + required String? groupId, + String? blockhash = r'', + required _i6.Coin? coin, + }) => + (super.noSuchMethod( + Invocation.method( + #getAnonymitySet, + [], + { + #groupId: groupId, + #blockhash: blockhash, + #coin: coin, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + String base64ToHex(String? source) => (super.noSuchMethod( + Invocation.method( + #base64ToHex, + [source], + ), + returnValue: '', + ) as String); + @override + String base64ToReverseHex(String? source) => (super.noSuchMethod( + Invocation.method( + #base64ToReverseHex, + [source], + ), + returnValue: '', + ) as String); + @override + _i4.Future> getTransaction({ + required String? txHash, + required _i6.Coin? coin, + bool? verbose = true, + }) => + (super.noSuchMethod( + Invocation.method( + #getTransaction, + [], + { + #txHash: txHash, + #coin: coin, + #verbose: verbose, + }, + ), + returnValue: + _i4.Future>.value({}), + ) as _i4.Future>); + @override + _i4.Future> getUsedCoinSerials({ + required _i6.Coin? coin, + int? startNumber = 0, + }) => + (super.noSuchMethod( + Invocation.method( + #getUsedCoinSerials, + [], + { + #coin: coin, + #startNumber: startNumber, + }, + ), + returnValue: _i4.Future>.value([]), + ) as _i4.Future>); + @override + _i4.Future clearSharedTransactionCache({required _i6.Coin? coin}) => + (super.noSuchMethod( + Invocation.method( + #clearSharedTransactionCache, + [], + {#coin: coin}, + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); +} + +/// A class which mocks [TransactionNotificationTracker]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockTransactionNotificationTracker extends _i1.Mock + implements _i7.TransactionNotificationTracker { + MockTransactionNotificationTracker() { + _i1.throwOnMissingStub(this); + } + + @override + String get walletId => (super.noSuchMethod( + Invocation.getter(#walletId), + returnValue: '', + ) as String); + @override + List get pendings => (super.noSuchMethod( + Invocation.getter(#pendings), + returnValue: [], + ) as List); + @override + List get confirmeds => (super.noSuchMethod( + Invocation.getter(#confirmeds), + returnValue: [], + ) as List); + @override + bool wasNotifiedPending(String? txid) => (super.noSuchMethod( + Invocation.method( + #wasNotifiedPending, + [txid], + ), + returnValue: false, + ) as bool); + @override + _i4.Future addNotifiedPending(String? txid) => (super.noSuchMethod( + Invocation.method( + #addNotifiedPending, + [txid], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + @override + bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( + Invocation.method( + #wasNotifiedConfirmed, + [txid], + ), + returnValue: false, + ) as bool); + @override + _i4.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( + Invocation.method( + #addNotifiedConfirmed, + [txid], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); + @override + _i4.Future deleteTransaction(String? txid) => (super.noSuchMethod( + Invocation.method( + #deleteTransaction, + [txid], + ), + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); +} diff --git a/test/widget_tests/custom_buttons/favorite_toggle_test.mocks.dart b/test/widget_tests/custom_buttons/favorite_toggle_test.mocks.dart new file mode 100644 index 000000000..59e02607b --- /dev/null +++ b/test/widget_tests/custom_buttons/favorite_toggle_test.mocks.dart @@ -0,0 +1,131 @@ +// Mocks generated by Mockito 5.3.2 from annotations +// in stackwallet/test/widget_tests/custom_buttons/favorite_toggle_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i5; +import 'dart:typed_data' as _i6; + +import 'package:mockito/mockito.dart' as _i1; +import 'package:stackwallet/db/isar/main_db.dart' as _i2; +import 'package:stackwallet/models/isar/stack_theme.dart' as _i4; +import 'package:stackwallet/themes/theme_service.dart' as _i3; + +// 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 + +class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB { + _FakeMainDB_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [ThemeService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockThemeService extends _i1.Mock implements _i3.ThemeService { + MockThemeService() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.MainDB get db => (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_0( + this, + Invocation.getter(#db), + ), + ) as _i2.MainDB); + @override + List<_i4.StackTheme> get installedThemes => (super.noSuchMethod( + Invocation.getter(#installedThemes), + returnValue: <_i4.StackTheme>[], + ) as List<_i4.StackTheme>); + @override + void init(_i2.MainDB? db) => super.noSuchMethod( + Invocation.method( + #init, + [db], + ), + returnValueForMissingStub: null, + ); + @override + _i5.Future install({required _i6.Uint8List? themeArchiveData}) => + (super.noSuchMethod( + Invocation.method( + #install, + [], + {#themeArchiveData: themeArchiveData}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future remove({required String? themeId}) => (super.noSuchMethod( + Invocation.method( + #remove, + [], + {#themeId: themeId}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future verifyInstalled({required String? themeId}) => + (super.noSuchMethod( + Invocation.method( + #verifyInstalled, + [], + {#themeId: themeId}, + ), + returnValue: _i5.Future.value(false), + ) as _i5.Future); + @override + _i5.Future> fetchThemes() => (super.noSuchMethod( + Invocation.method( + #fetchThemes, + [], + ), + returnValue: _i5.Future>.value( + <_i3.StackThemeMetaData>[]), + ) as _i5.Future>); + @override + _i5.Future<_i6.Uint8List> fetchTheme( + {required _i3.StackThemeMetaData? themeMetaData}) => + (super.noSuchMethod( + Invocation.method( + #fetchTheme, + [], + {#themeMetaData: themeMetaData}, + ), + returnValue: _i5.Future<_i6.Uint8List>.value(_i6.Uint8List(0)), + ) as _i5.Future<_i6.Uint8List>); + @override + _i4.StackTheme? getTheme({required String? themeId}) => + (super.noSuchMethod(Invocation.method( + #getTheme, + [], + {#themeId: themeId}, + )) as _i4.StackTheme?); +} diff --git a/test/widget_tests/custom_loading_overlay_test.mocks.dart b/test/widget_tests/custom_loading_overlay_test.mocks.dart new file mode 100644 index 000000000..f192714d8 --- /dev/null +++ b/test/widget_tests/custom_loading_overlay_test.mocks.dart @@ -0,0 +1,131 @@ +// Mocks generated by Mockito 5.3.2 from annotations +// in stackwallet/test/widget_tests/custom_loading_overlay_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i5; +import 'dart:typed_data' as _i6; + +import 'package:mockito/mockito.dart' as _i1; +import 'package:stackwallet/db/isar/main_db.dart' as _i2; +import 'package:stackwallet/models/isar/stack_theme.dart' as _i4; +import 'package:stackwallet/themes/theme_service.dart' as _i3; + +// 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 + +class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB { + _FakeMainDB_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [ThemeService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockThemeService extends _i1.Mock implements _i3.ThemeService { + MockThemeService() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.MainDB get db => (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_0( + this, + Invocation.getter(#db), + ), + ) as _i2.MainDB); + @override + List<_i4.StackTheme> get installedThemes => (super.noSuchMethod( + Invocation.getter(#installedThemes), + returnValue: <_i4.StackTheme>[], + ) as List<_i4.StackTheme>); + @override + void init(_i2.MainDB? db) => super.noSuchMethod( + Invocation.method( + #init, + [db], + ), + returnValueForMissingStub: null, + ); + @override + _i5.Future install({required _i6.Uint8List? themeArchiveData}) => + (super.noSuchMethod( + Invocation.method( + #install, + [], + {#themeArchiveData: themeArchiveData}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future remove({required String? themeId}) => (super.noSuchMethod( + Invocation.method( + #remove, + [], + {#themeId: themeId}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future verifyInstalled({required String? themeId}) => + (super.noSuchMethod( + Invocation.method( + #verifyInstalled, + [], + {#themeId: themeId}, + ), + returnValue: _i5.Future.value(false), + ) as _i5.Future); + @override + _i5.Future> fetchThemes() => (super.noSuchMethod( + Invocation.method( + #fetchThemes, + [], + ), + returnValue: _i5.Future>.value( + <_i3.StackThemeMetaData>[]), + ) as _i5.Future>); + @override + _i5.Future<_i6.Uint8List> fetchTheme( + {required _i3.StackThemeMetaData? themeMetaData}) => + (super.noSuchMethod( + Invocation.method( + #fetchTheme, + [], + {#themeMetaData: themeMetaData}, + ), + returnValue: _i5.Future<_i6.Uint8List>.value(_i6.Uint8List(0)), + ) as _i5.Future<_i6.Uint8List>); + @override + _i4.StackTheme? getTheme({required String? themeId}) => + (super.noSuchMethod(Invocation.method( + #getTheme, + [], + {#themeId: themeId}, + )) as _i4.StackTheme?); +} diff --git a/test/widget_tests/desktop/desktop_scaffold_test.mocks.dart b/test/widget_tests/desktop/desktop_scaffold_test.mocks.dart new file mode 100644 index 000000000..5972c21c2 --- /dev/null +++ b/test/widget_tests/desktop/desktop_scaffold_test.mocks.dart @@ -0,0 +1,131 @@ +// Mocks generated by Mockito 5.3.2 from annotations +// in stackwallet/test/widget_tests/desktop/desktop_scaffold_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i5; +import 'dart:typed_data' as _i6; + +import 'package:mockito/mockito.dart' as _i1; +import 'package:stackwallet/db/isar/main_db.dart' as _i2; +import 'package:stackwallet/models/isar/stack_theme.dart' as _i4; +import 'package:stackwallet/themes/theme_service.dart' as _i3; + +// 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 + +class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB { + _FakeMainDB_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [ThemeService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockThemeService extends _i1.Mock implements _i3.ThemeService { + MockThemeService() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.MainDB get db => (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_0( + this, + Invocation.getter(#db), + ), + ) as _i2.MainDB); + @override + List<_i4.StackTheme> get installedThemes => (super.noSuchMethod( + Invocation.getter(#installedThemes), + returnValue: <_i4.StackTheme>[], + ) as List<_i4.StackTheme>); + @override + void init(_i2.MainDB? db) => super.noSuchMethod( + Invocation.method( + #init, + [db], + ), + returnValueForMissingStub: null, + ); + @override + _i5.Future install({required _i6.Uint8List? themeArchiveData}) => + (super.noSuchMethod( + Invocation.method( + #install, + [], + {#themeArchiveData: themeArchiveData}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future remove({required String? themeId}) => (super.noSuchMethod( + Invocation.method( + #remove, + [], + {#themeId: themeId}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future verifyInstalled({required String? themeId}) => + (super.noSuchMethod( + Invocation.method( + #verifyInstalled, + [], + {#themeId: themeId}, + ), + returnValue: _i5.Future.value(false), + ) as _i5.Future); + @override + _i5.Future> fetchThemes() => (super.noSuchMethod( + Invocation.method( + #fetchThemes, + [], + ), + returnValue: _i5.Future>.value( + <_i3.StackThemeMetaData>[]), + ) as _i5.Future>); + @override + _i5.Future<_i6.Uint8List> fetchTheme( + {required _i3.StackThemeMetaData? themeMetaData}) => + (super.noSuchMethod( + Invocation.method( + #fetchTheme, + [], + {#themeMetaData: themeMetaData}, + ), + returnValue: _i5.Future<_i6.Uint8List>.value(_i6.Uint8List(0)), + ) as _i5.Future<_i6.Uint8List>); + @override + _i4.StackTheme? getTheme({required String? themeId}) => + (super.noSuchMethod(Invocation.method( + #getTheme, + [], + {#themeId: themeId}, + )) as _i4.StackTheme?); +} diff --git a/test/widget_tests/managed_favorite_test.mocks.dart b/test/widget_tests/managed_favorite_test.mocks.dart index 7b5cab81e..5bd694533 100644 --- a/test/widget_tests/managed_favorite_test.mocks.dart +++ b/test/widget_tests/managed_favorite_test.mocks.dart @@ -1,5 +1,5 @@ // Mocks generated by Mockito 5.3.2 from annotations -// in stackduo/test/widget_tests/managed_favorite_test.dart. +// in stackwallet/test/widget_tests/managed_favorite_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes @@ -13,28 +13,31 @@ import 'package:bitcoindart/bitcoindart.dart' as _i13; import 'package:flutter/foundation.dart' as _i4; import 'package:flutter_riverpod/flutter_riverpod.dart' as _i5; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackduo/db/main_db.dart' as _i12; -import 'package:stackduo/electrumx_rpc/cached_electrumx.dart' as _i10; -import 'package:stackduo/electrumx_rpc/electrumx.dart' as _i9; -import 'package:stackduo/models/balance.dart' as _i11; -import 'package:stackduo/models/isar/models/isar_models.dart' as _i17; -import 'package:stackduo/models/node_model.dart' as _i31; -import 'package:stackduo/models/paymint/fee_object_model.dart' as _i8; -import 'package:stackduo/models/signing_data.dart' as _i28; -import 'package:stackduo/services/coins/bitcoin/bitcoin_wallet.dart' as _i26; -import 'package:stackduo/services/coins/coin_service.dart' as _i20; -import 'package:stackduo/services/coins/manager.dart' as _i6; -import 'package:stackduo/services/locale_service.dart' as _i30; -import 'package:stackduo/services/node_service.dart' as _i3; -import 'package:stackduo/services/transaction_notification_tracker.dart' as _i7; -import 'package:stackduo/services/wallets.dart' as _i21; -import 'package:stackduo/services/wallets_service.dart' as _i2; -import 'package:stackduo/utilities/amount/amount.dart' as _i14; -import 'package:stackduo/utilities/enums/coin_enum.dart' as _i22; -import 'package:stackduo/utilities/enums/derive_path_type_enum.dart' as _i27; -import 'package:stackduo/utilities/flutter_secure_storage_interface.dart' +import 'package:stackwallet/db/isar/main_db.dart' as _i12; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i10; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i9; +import 'package:stackwallet/models/balance.dart' as _i11; +import 'package:stackwallet/models/isar/models/isar_models.dart' as _i17; +import 'package:stackwallet/models/isar/stack_theme.dart' as _i31; +import 'package:stackwallet/models/node_model.dart' as _i33; +import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i8; +import 'package:stackwallet/models/signing_data.dart' as _i28; +import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart' as _i26; +import 'package:stackwallet/services/coins/coin_service.dart' as _i20; +import 'package:stackwallet/services/coins/manager.dart' as _i6; +import 'package:stackwallet/services/locale_service.dart' as _i32; +import 'package:stackwallet/services/node_service.dart' as _i3; +import 'package:stackwallet/services/transaction_notification_tracker.dart' + as _i7; +import 'package:stackwallet/services/wallets.dart' as _i21; +import 'package:stackwallet/services/wallets_service.dart' as _i2; +import 'package:stackwallet/themes/theme_service.dart' as _i30; +import 'package:stackwallet/utilities/amount/amount.dart' as _i14; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i22; +import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart' as _i27; +import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart' as _i19; -import 'package:stackduo/utilities/prefs.dart' as _i24; +import 'package:stackwallet/utilities/prefs.dart' as _i24; import 'package:tuple/tuple.dart' as _i15; // ignore_for_file: type=lint @@ -1439,6 +1442,25 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override + List getWalletTokenContractAddresses() => (super.noSuchMethod( + Invocation.method( + #getWalletTokenContractAddresses, + [], + ), + returnValue: [], + ) as List); + @override + _i23.Future updateWalletTokenContractAddresses( + List? contractAddresses) => + (super.noSuchMethod( + Invocation.method( + #updateWalletTokenContractAddresses, + [contractAddresses], + ), + returnValue: _i23.Future.value(), + returnValueForMissingStub: _i23.Future.value(), + ) as _i23.Future); + @override void initWalletDB({_i12.MainDB? mockableOverride}) => super.noSuchMethod( Invocation.method( #initWalletDB, @@ -1935,10 +1957,109 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { ) as _i23.Future); } +/// A class which mocks [ThemeService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockThemeService extends _i1.Mock implements _i30.ThemeService { + MockThemeService() { + _i1.throwOnMissingStub(this); + } + + @override + _i12.MainDB get db => (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_9( + this, + Invocation.getter(#db), + ), + ) as _i12.MainDB); + @override + List<_i31.StackTheme> get installedThemes => (super.noSuchMethod( + Invocation.getter(#installedThemes), + returnValue: <_i31.StackTheme>[], + ) as List<_i31.StackTheme>); + @override + void init(_i12.MainDB? db) => super.noSuchMethod( + Invocation.method( + #init, + [db], + ), + returnValueForMissingStub: null, + ); + @override + _i23.Future install({required _i29.Uint8List? themeArchiveData}) => + (super.noSuchMethod( + Invocation.method( + #install, + [], + {#themeArchiveData: themeArchiveData}, + ), + returnValue: _i23.Future.value(), + returnValueForMissingStub: _i23.Future.value(), + ) as _i23.Future); + @override + _i23.Future remove({required String? themeId}) => (super.noSuchMethod( + Invocation.method( + #remove, + [], + {#themeId: themeId}, + ), + returnValue: _i23.Future.value(), + returnValueForMissingStub: _i23.Future.value(), + ) as _i23.Future); + @override + _i23.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i23.Future.value(), + returnValueForMissingStub: _i23.Future.value(), + ) as _i23.Future); + @override + _i23.Future verifyInstalled({required String? themeId}) => + (super.noSuchMethod( + Invocation.method( + #verifyInstalled, + [], + {#themeId: themeId}, + ), + returnValue: _i23.Future.value(false), + ) as _i23.Future); + @override + _i23.Future> fetchThemes() => + (super.noSuchMethod( + Invocation.method( + #fetchThemes, + [], + ), + returnValue: _i23.Future>.value( + <_i30.StackThemeMetaData>[]), + ) as _i23.Future>); + @override + _i23.Future<_i29.Uint8List> fetchTheme( + {required _i30.StackThemeMetaData? themeMetaData}) => + (super.noSuchMethod( + Invocation.method( + #fetchTheme, + [], + {#themeMetaData: themeMetaData}, + ), + returnValue: _i23.Future<_i29.Uint8List>.value(_i29.Uint8List(0)), + ) as _i23.Future<_i29.Uint8List>); + @override + _i31.StackTheme? getTheme({required String? themeId}) => + (super.noSuchMethod(Invocation.method( + #getTheme, + [], + {#themeId: themeId}, + )) as _i31.StackTheme?); +} + /// A class which mocks [LocaleService]. /// /// See the documentation for Mockito's code generation for more information. -class MockLocaleService extends _i1.Mock implements _i30.LocaleService { +class MockLocaleService extends _i1.Mock implements _i32.LocaleService { MockLocaleService() { _i1.throwOnMissingStub(this); } @@ -2010,15 +2131,15 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { ), ) as _i19.SecureStorageInterface); @override - List<_i31.NodeModel> get primaryNodes => (super.noSuchMethod( + List<_i33.NodeModel> get primaryNodes => (super.noSuchMethod( Invocation.getter(#primaryNodes), - returnValue: <_i31.NodeModel>[], - ) as List<_i31.NodeModel>); + returnValue: <_i33.NodeModel>[], + ) as List<_i33.NodeModel>); @override - List<_i31.NodeModel> get nodes => (super.noSuchMethod( + List<_i33.NodeModel> get nodes => (super.noSuchMethod( Invocation.getter(#nodes), - returnValue: <_i31.NodeModel>[], - ) as List<_i31.NodeModel>); + returnValue: <_i33.NodeModel>[], + ) as List<_i33.NodeModel>); @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), @@ -2036,7 +2157,7 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { @override _i23.Future setPrimaryNodeFor({ required _i22.Coin? coin, - required _i31.NodeModel? node, + required _i33.NodeModel? node, bool? shouldNotifyListeners = false, }) => (super.noSuchMethod( @@ -2053,40 +2174,40 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override - _i31.NodeModel? getPrimaryNodeFor({required _i22.Coin? coin}) => + _i33.NodeModel? getPrimaryNodeFor({required _i22.Coin? coin}) => (super.noSuchMethod(Invocation.method( #getPrimaryNodeFor, [], {#coin: coin}, - )) as _i31.NodeModel?); + )) as _i33.NodeModel?); @override - List<_i31.NodeModel> getNodesFor(_i22.Coin? coin) => (super.noSuchMethod( + List<_i33.NodeModel> getNodesFor(_i22.Coin? coin) => (super.noSuchMethod( Invocation.method( #getNodesFor, [coin], ), - returnValue: <_i31.NodeModel>[], - ) as List<_i31.NodeModel>); + returnValue: <_i33.NodeModel>[], + ) as List<_i33.NodeModel>); @override - _i31.NodeModel? getNodeById({required String? id}) => + _i33.NodeModel? getNodeById({required String? id}) => (super.noSuchMethod(Invocation.method( #getNodeById, [], {#id: id}, - )) as _i31.NodeModel?); + )) as _i33.NodeModel?); @override - List<_i31.NodeModel> failoverNodesFor({required _i22.Coin? coin}) => + List<_i33.NodeModel> failoverNodesFor({required _i22.Coin? coin}) => (super.noSuchMethod( Invocation.method( #failoverNodesFor, [], {#coin: coin}, ), - returnValue: <_i31.NodeModel>[], - ) as List<_i31.NodeModel>); + returnValue: <_i33.NodeModel>[], + ) as List<_i33.NodeModel>); @override _i23.Future add( - _i31.NodeModel? node, + _i33.NodeModel? node, String? password, bool? shouldNotifyListeners, ) => @@ -2138,7 +2259,7 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { ) as _i23.Future); @override _i23.Future edit( - _i31.NodeModel? editedNode, + _i33.NodeModel? editedNode, String? password, bool? shouldNotifyListeners, ) => @@ -2349,6 +2470,11 @@ class MockManager extends _i1.Mock implements _i6.Manager { returnValue: false, ) as bool); @override + bool get hasTokenSupport => (super.noSuchMethod( + Invocation.getter(#hasTokenSupport), + returnValue: false, + ) as bool); + @override bool get hasWhirlpoolSupport => (super.noSuchMethod( Invocation.getter(#hasWhirlpoolSupport), returnValue: false, diff --git a/test/widget_tests/table_view/table_view_row_test.mocks.dart b/test/widget_tests/table_view/table_view_row_test.mocks.dart index 66646e6bc..d86e3d82d 100644 --- a/test/widget_tests/table_view/table_view_row_test.mocks.dart +++ b/test/widget_tests/table_view/table_view_row_test.mocks.dart @@ -1,10 +1,10 @@ // Mocks generated by Mockito 5.3.2 from annotations -// in stackduo/test/widget_tests/table_view/table_view_row_test.dart. +// in stackwallet/test/widget_tests/table_view/table_view_row_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i22; -import 'dart:typed_data' as _i29; +import 'dart:typed_data' as _i27; import 'dart:ui' as _i24; import 'package:bip32/bip32.dart' as _i16; @@ -13,26 +13,29 @@ import 'package:bitcoindart/bitcoindart.dart' as _i13; import 'package:flutter/foundation.dart' as _i4; import 'package:flutter_riverpod/flutter_riverpod.dart' as _i5; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackduo/db/main_db.dart' as _i12; -import 'package:stackduo/electrumx_rpc/cached_electrumx.dart' as _i10; -import 'package:stackduo/electrumx_rpc/electrumx.dart' as _i9; -import 'package:stackduo/models/balance.dart' as _i11; -import 'package:stackduo/models/isar/models/isar_models.dart' as _i17; -import 'package:stackduo/models/paymint/fee_object_model.dart' as _i8; -import 'package:stackduo/models/signing_data.dart' as _i27; -import 'package:stackduo/services/coins/bitcoin/bitcoin_wallet.dart' as _i25; -import 'package:stackduo/services/coins/coin_service.dart' as _i19; -import 'package:stackduo/services/coins/manager.dart' as _i6; -import 'package:stackduo/services/node_service.dart' as _i3; -import 'package:stackduo/services/transaction_notification_tracker.dart' as _i7; -import 'package:stackduo/services/wallets.dart' as _i20; -import 'package:stackduo/services/wallets_service.dart' as _i2; -import 'package:stackduo/utilities/amount/amount.dart' as _i14; -import 'package:stackduo/utilities/enums/coin_enum.dart' as _i21; -import 'package:stackduo/utilities/enums/derive_path_type_enum.dart' as _i26; -import 'package:stackduo/utilities/flutter_secure_storage_interface.dart' - as _i28; -import 'package:stackduo/utilities/prefs.dart' as _i23; +import 'package:stackwallet/db/isar/main_db.dart' as _i7; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i11; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i10; +import 'package:stackwallet/models/balance.dart' as _i12; +import 'package:stackwallet/models/isar/models/isar_models.dart' as _i17; +import 'package:stackwallet/models/isar/stack_theme.dart' as _i26; +import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i9; +import 'package:stackwallet/models/signing_data.dart' as _i30; +import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart' as _i28; +import 'package:stackwallet/services/coins/coin_service.dart' as _i19; +import 'package:stackwallet/services/coins/manager.dart' as _i6; +import 'package:stackwallet/services/node_service.dart' as _i3; +import 'package:stackwallet/services/transaction_notification_tracker.dart' + as _i8; +import 'package:stackwallet/services/wallets.dart' as _i20; +import 'package:stackwallet/services/wallets_service.dart' as _i2; +import 'package:stackwallet/themes/theme_service.dart' as _i25; +import 'package:stackwallet/utilities/amount/amount.dart' as _i14; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i21; +import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart' as _i29; +import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart' + as _i31; +import 'package:stackwallet/utilities/prefs.dart' as _i23; import 'package:tuple/tuple.dart' as _i15; // ignore_for_file: type=lint @@ -88,9 +91,8 @@ class _FakeManager_3 extends _i1.SmartFake implements _i6.Manager { ); } -class _FakeTransactionNotificationTracker_4 extends _i1.SmartFake - implements _i7.TransactionNotificationTracker { - _FakeTransactionNotificationTracker_4( +class _FakeMainDB_4 extends _i1.SmartFake implements _i7.MainDB { + _FakeMainDB_4( Object parent, Invocation parentInvocation, ) : super( @@ -99,8 +101,9 @@ class _FakeTransactionNotificationTracker_4 extends _i1.SmartFake ); } -class _FakeFeeObject_5 extends _i1.SmartFake implements _i8.FeeObject { - _FakeFeeObject_5( +class _FakeTransactionNotificationTracker_5 extends _i1.SmartFake + implements _i8.TransactionNotificationTracker { + _FakeTransactionNotificationTracker_5( Object parent, Invocation parentInvocation, ) : super( @@ -109,8 +112,8 @@ class _FakeFeeObject_5 extends _i1.SmartFake implements _i8.FeeObject { ); } -class _FakeElectrumX_6 extends _i1.SmartFake implements _i9.ElectrumX { - _FakeElectrumX_6( +class _FakeFeeObject_6 extends _i1.SmartFake implements _i9.FeeObject { + _FakeFeeObject_6( Object parent, Invocation parentInvocation, ) : super( @@ -119,9 +122,8 @@ class _FakeElectrumX_6 extends _i1.SmartFake implements _i9.ElectrumX { ); } -class _FakeCachedElectrumX_7 extends _i1.SmartFake - implements _i10.CachedElectrumX { - _FakeCachedElectrumX_7( +class _FakeElectrumX_7 extends _i1.SmartFake implements _i10.ElectrumX { + _FakeElectrumX_7( Object parent, Invocation parentInvocation, ) : super( @@ -130,8 +132,9 @@ class _FakeCachedElectrumX_7 extends _i1.SmartFake ); } -class _FakeBalance_8 extends _i1.SmartFake implements _i11.Balance { - _FakeBalance_8( +class _FakeCachedElectrumX_8 extends _i1.SmartFake + implements _i11.CachedElectrumX { + _FakeCachedElectrumX_8( Object parent, Invocation parentInvocation, ) : super( @@ -140,8 +143,8 @@ class _FakeBalance_8 extends _i1.SmartFake implements _i11.Balance { ); } -class _FakeMainDB_9 extends _i1.SmartFake implements _i12.MainDB { - _FakeMainDB_9( +class _FakeBalance_9 extends _i1.SmartFake implements _i12.Balance { + _FakeBalance_9( Object parent, Invocation parentInvocation, ) : super( @@ -160,7 +163,8 @@ class _FakeNetworkType_10 extends _i1.SmartFake implements _i13.NetworkType { ); } -class _FakeElectrumXNode_11 extends _i1.SmartFake implements _i9.ElectrumXNode { +class _FakeElectrumXNode_11 extends _i1.SmartFake + implements _i10.ElectrumXNode { _FakeElectrumXNode_11( Object parent, Invocation parentInvocation, @@ -674,10 +678,109 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { ); } +/// A class which mocks [ThemeService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockThemeService extends _i1.Mock implements _i25.ThemeService { + MockThemeService() { + _i1.throwOnMissingStub(this); + } + + @override + _i7.MainDB get db => (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_4( + this, + Invocation.getter(#db), + ), + ) as _i7.MainDB); + @override + List<_i26.StackTheme> get installedThemes => (super.noSuchMethod( + Invocation.getter(#installedThemes), + returnValue: <_i26.StackTheme>[], + ) as List<_i26.StackTheme>); + @override + void init(_i7.MainDB? db) => super.noSuchMethod( + Invocation.method( + #init, + [db], + ), + returnValueForMissingStub: null, + ); + @override + _i22.Future install({required _i27.Uint8List? themeArchiveData}) => + (super.noSuchMethod( + Invocation.method( + #install, + [], + {#themeArchiveData: themeArchiveData}, + ), + returnValue: _i22.Future.value(), + returnValueForMissingStub: _i22.Future.value(), + ) as _i22.Future); + @override + _i22.Future remove({required String? themeId}) => (super.noSuchMethod( + Invocation.method( + #remove, + [], + {#themeId: themeId}, + ), + returnValue: _i22.Future.value(), + returnValueForMissingStub: _i22.Future.value(), + ) as _i22.Future); + @override + _i22.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i22.Future.value(), + returnValueForMissingStub: _i22.Future.value(), + ) as _i22.Future); + @override + _i22.Future verifyInstalled({required String? themeId}) => + (super.noSuchMethod( + Invocation.method( + #verifyInstalled, + [], + {#themeId: themeId}, + ), + returnValue: _i22.Future.value(false), + ) as _i22.Future); + @override + _i22.Future> fetchThemes() => + (super.noSuchMethod( + Invocation.method( + #fetchThemes, + [], + ), + returnValue: _i22.Future>.value( + <_i25.StackThemeMetaData>[]), + ) as _i22.Future>); + @override + _i22.Future<_i27.Uint8List> fetchTheme( + {required _i25.StackThemeMetaData? themeMetaData}) => + (super.noSuchMethod( + Invocation.method( + #fetchTheme, + [], + {#themeMetaData: themeMetaData}, + ), + returnValue: _i22.Future<_i27.Uint8List>.value(_i27.Uint8List(0)), + ) as _i22.Future<_i27.Uint8List>); + @override + _i26.StackTheme? getTheme({required String? themeId}) => + (super.noSuchMethod(Invocation.method( + #getTheme, + [], + {#themeId: themeId}, + )) as _i26.StackTheme?); +} + /// A class which mocks [BitcoinWallet]. /// /// See the documentation for Mockito's code generation for more information. -class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { +class MockBitcoinWallet extends _i1.Mock implements _i28.BitcoinWallet { MockBitcoinWallet() { _i1.throwOnMissingStub(this); } @@ -691,15 +794,15 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { returnValueForMissingStub: null, ); @override - _i7.TransactionNotificationTracker get txTracker => (super.noSuchMethod( + _i8.TransactionNotificationTracker get txTracker => (super.noSuchMethod( Invocation.getter(#txTracker), - returnValue: _FakeTransactionNotificationTracker_4( + returnValue: _FakeTransactionNotificationTracker_5( this, Invocation.getter(#txTracker), ), - ) as _i7.TransactionNotificationTracker); + ) as _i8.TransactionNotificationTracker); @override - set txTracker(_i7.TransactionNotificationTracker? _txTracker) => + set txTracker(_i8.TransactionNotificationTracker? _txTracker) => super.noSuchMethod( Invocation.setter( #txTracker, @@ -796,13 +899,13 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { returnValue: false, ) as bool); @override - _i22.Future<_i8.FeeObject> get fees => (super.noSuchMethod( + _i22.Future<_i9.FeeObject> get fees => (super.noSuchMethod( Invocation.getter(#fees), - returnValue: _i22.Future<_i8.FeeObject>.value(_FakeFeeObject_5( + returnValue: _i22.Future<_i9.FeeObject>.value(_FakeFeeObject_6( this, Invocation.getter(#fees), )), - ) as _i22.Future<_i8.FeeObject>); + ) as _i22.Future<_i9.FeeObject>); @override _i22.Future get maxFee => (super.noSuchMethod( Invocation.getter(#maxFee), @@ -875,29 +978,29 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { returnValueForMissingStub: null, ); @override - _i9.ElectrumX get electrumXClient => (super.noSuchMethod( + _i10.ElectrumX get electrumXClient => (super.noSuchMethod( Invocation.getter(#electrumXClient), - returnValue: _FakeElectrumX_6( + returnValue: _FakeElectrumX_7( this, Invocation.getter(#electrumXClient), ), - ) as _i9.ElectrumX); + ) as _i10.ElectrumX); @override - _i10.CachedElectrumX get cachedElectrumXClient => (super.noSuchMethod( + _i11.CachedElectrumX get cachedElectrumXClient => (super.noSuchMethod( Invocation.getter(#cachedElectrumXClient), - returnValue: _FakeCachedElectrumX_7( + returnValue: _FakeCachedElectrumX_8( this, Invocation.getter(#cachedElectrumXClient), ), - ) as _i10.CachedElectrumX); + ) as _i11.CachedElectrumX); @override - _i11.Balance get balance => (super.noSuchMethod( + _i12.Balance get balance => (super.noSuchMethod( Invocation.getter(#balance), - returnValue: _FakeBalance_8( + returnValue: _FakeBalance_9( this, Invocation.getter(#balance), ), - ) as _i11.Balance); + ) as _i12.Balance); @override _i22.Future get xpub => (super.noSuchMethod( Invocation.getter(#xpub), @@ -913,13 +1016,13 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { returnValueForMissingStub: null, ); @override - _i12.MainDB get db => (super.noSuchMethod( + _i7.MainDB get db => (super.noSuchMethod( Invocation.getter(#db), - returnValue: _FakeMainDB_9( + returnValue: _FakeMainDB_4( this, Invocation.getter(#db), ), - ) as _i12.MainDB); + ) as _i7.MainDB); @override _i13.NetworkType get networkType => (super.noSuchMethod( Invocation.getter(#networkType), @@ -938,15 +1041,15 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { returnValueForMissingStub: _i22.Future.value(), ) as _i22.Future); @override - _i26.DerivePathType addressType({required String? address}) => + _i29.DerivePathType addressType({required String? address}) => (super.noSuchMethod( Invocation.method( #addressType, [], {#address: address}, ), - returnValue: _i26.DerivePathType.bip44, - ) as _i26.DerivePathType); + returnValue: _i29.DerivePathType.bip44, + ) as _i29.DerivePathType); @override _i22.Future recoverFromMnemonic({ required String? mnemonic, @@ -1105,19 +1208,20 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { returnValueForMissingStub: _i22.Future.value(), ) as _i22.Future); @override - _i22.Future<_i9.ElectrumXNode> getCurrentNode() => (super.noSuchMethod( + _i22.Future<_i10.ElectrumXNode> getCurrentNode() => (super.noSuchMethod( Invocation.method( #getCurrentNode, [], ), - returnValue: _i22.Future<_i9.ElectrumXNode>.value(_FakeElectrumXNode_11( + returnValue: + _i22.Future<_i10.ElectrumXNode>.value(_FakeElectrumXNode_11( this, Invocation.method( #getCurrentNode, [], ), )), - ) as _i22.Future<_i9.ElectrumXNode>); + ) as _i22.Future<_i10.ElectrumXNode>); @override _i22.Future>> fastFetch( List? allTxHashes) => @@ -1199,7 +1303,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { }, )); @override - _i22.Future> fetchBuildTxData( + _i22.Future> fetchBuildTxData( List<_i17.UTXO>? utxosToUse) => (super.noSuchMethod( Invocation.method( @@ -1207,11 +1311,11 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { [utxosToUse], ), returnValue: - _i22.Future>.value(<_i27.SigningData>[]), - ) as _i22.Future>); + _i22.Future>.value(<_i30.SigningData>[]), + ) as _i22.Future>); @override _i22.Future> buildTransaction({ - required List<_i27.SigningData>? utxoSigningData, + required List<_i30.SigningData>? utxoSigningData, required List? recipients, required List? satoshiAmounts, }) => @@ -1378,21 +1482,21 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { returnValueForMissingStub: _i22.Future.value(), ) as _i22.Future); @override - _i11.Balance getCachedBalance() => (super.noSuchMethod( + _i12.Balance getCachedBalance() => (super.noSuchMethod( Invocation.method( #getCachedBalance, [], ), - returnValue: _FakeBalance_8( + returnValue: _FakeBalance_9( this, Invocation.method( #getCachedBalance, [], ), ), - ) as _i11.Balance); + ) as _i12.Balance); @override - _i22.Future updateCachedBalance(_i11.Balance? balance) => + _i22.Future updateCachedBalance(_i12.Balance? balance) => (super.noSuchMethod( Invocation.method( #updateCachedBalance, @@ -1402,21 +1506,21 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { returnValueForMissingStub: _i22.Future.value(), ) as _i22.Future); @override - _i11.Balance getCachedBalanceSecondary() => (super.noSuchMethod( + _i12.Balance getCachedBalanceSecondary() => (super.noSuchMethod( Invocation.method( #getCachedBalanceSecondary, [], ), - returnValue: _FakeBalance_8( + returnValue: _FakeBalance_9( this, Invocation.method( #getCachedBalanceSecondary, [], ), ), - ) as _i11.Balance); + ) as _i12.Balance); @override - _i22.Future updateCachedBalanceSecondary(_i11.Balance? balance) => + _i22.Future updateCachedBalanceSecondary(_i12.Balance? balance) => (super.noSuchMethod( Invocation.method( #updateCachedBalanceSecondary, @@ -1426,7 +1530,26 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { returnValueForMissingStub: _i22.Future.value(), ) as _i22.Future); @override - void initWalletDB({_i12.MainDB? mockableOverride}) => super.noSuchMethod( + List getWalletTokenContractAddresses() => (super.noSuchMethod( + Invocation.method( + #getWalletTokenContractAddresses, + [], + ), + returnValue: [], + ) as List); + @override + _i22.Future updateWalletTokenContractAddresses( + List? contractAddresses) => + (super.noSuchMethod( + Invocation.method( + #updateWalletTokenContractAddresses, + [contractAddresses], + ), + returnValue: _i22.Future.value(), + returnValueForMissingStub: _i22.Future.value(), + ) as _i22.Future); + @override + void initWalletDB({_i7.MainDB? mockableOverride}) => super.noSuchMethod( Invocation.method( #initWalletDB, [], @@ -1478,9 +1601,9 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { required String? walletName, required _i13.NetworkType? network, required _i21.Coin? coin, - required _i12.MainDB? db, - required _i9.ElectrumX? electrumXClient, - required _i28.SecureStorageInterface? secureStorage, + required _i7.MainDB? db, + required _i10.ElectrumX? electrumXClient, + required _i31.SecureStorageInterface? secureStorage, required int? dustLimit, required int? dustLimitP2PKH, required int? minConfirms, @@ -1500,7 +1623,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { })? prepareSend, required _i22.Future Function({required String address})? getTxCount, - required _i22.Future> Function(List<_i17.UTXO>)? + required _i22.Future> Function(List<_i17.UTXO>)? fetchBuildTxData, required _i22.Future Function()? refresh, required _i22.Future Function()? checkChangeAddressForTransactions, @@ -1550,7 +1673,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { )), ) as _i22.Future<_i16.BIP32>); @override - _i22.Future<_i29.Uint8List> getPrivateKeyForPaynymReceivingAddress({ + _i22.Future<_i27.Uint8List> getPrivateKeyForPaynymReceivingAddress({ required String? paymentCodeString, required int? index, }) => @@ -1563,8 +1686,8 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { #index: index, }, ), - returnValue: _i22.Future<_i29.Uint8List>.value(_i29.Uint8List(0)), - ) as _i22.Future<_i29.Uint8List>); + returnValue: _i22.Future<_i27.Uint8List>.value(_i27.Uint8List(0)), + ) as _i22.Future<_i27.Uint8List>); @override _i22.Future<_i17.Address> currentReceivingPaynymAddress({ required _i18.PaymentCode? sender, @@ -1650,14 +1773,14 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { )), ) as _i22.Future<_i18.PaymentCode>); @override - _i22.Future<_i29.Uint8List> signWithNotificationKey(_i29.Uint8List? data) => + _i22.Future<_i27.Uint8List> signWithNotificationKey(_i27.Uint8List? data) => (super.noSuchMethod( Invocation.method( #signWithNotificationKey, [data], ), - returnValue: _i22.Future<_i29.Uint8List>.value(_i29.Uint8List(0)), - ) as _i22.Future<_i29.Uint8List>); + returnValue: _i22.Future<_i27.Uint8List>.value(_i27.Uint8List(0)), + ) as _i22.Future<_i27.Uint8List>); @override _i22.Future signStringWithNotificationKey(String? data) => (super.noSuchMethod( @@ -1890,9 +2013,9 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { required String? walletId, required String? walletName, required _i21.Coin? coin, - required _i12.MainDB? db, + required _i7.MainDB? db, required _i22.Future Function()? getChainHeight, - required _i22.Future Function(_i11.Balance)? refreshedBalanceCallback, + required _i22.Future Function(_i12.Balance)? refreshedBalanceCallback, }) => super.noSuchMethod( Invocation.method( @@ -1989,13 +2112,13 @@ class MockManager extends _i1.Mock implements _i6.Manager { returnValueForMissingStub: null, ); @override - _i22.Future<_i8.FeeObject> get fees => (super.noSuchMethod( + _i22.Future<_i9.FeeObject> get fees => (super.noSuchMethod( Invocation.getter(#fees), - returnValue: _i22.Future<_i8.FeeObject>.value(_FakeFeeObject_5( + returnValue: _i22.Future<_i9.FeeObject>.value(_FakeFeeObject_6( this, Invocation.getter(#fees), )), - ) as _i22.Future<_i8.FeeObject>); + ) as _i22.Future<_i9.FeeObject>); @override _i22.Future get maxFee => (super.noSuchMethod( Invocation.getter(#maxFee), @@ -2007,13 +2130,13 @@ class MockManager extends _i1.Mock implements _i6.Manager { returnValue: _i22.Future.value(''), ) as _i22.Future); @override - _i11.Balance get balance => (super.noSuchMethod( + _i12.Balance get balance => (super.noSuchMethod( Invocation.getter(#balance), - returnValue: _FakeBalance_8( + returnValue: _FakeBalance_9( this, Invocation.getter(#balance), ), - ) as _i11.Balance); + ) as _i12.Balance); @override _i22.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), @@ -2074,6 +2197,11 @@ class MockManager extends _i1.Mock implements _i6.Manager { returnValue: false, ) as bool); @override + bool get hasTokenSupport => (super.noSuchMethod( + Invocation.getter(#hasTokenSupport), + returnValue: false, + ) as bool); + @override bool get hasWhirlpoolSupport => (super.noSuchMethod( Invocation.getter(#hasWhirlpoolSupport), returnValue: false, @@ -2352,13 +2480,13 @@ class MockCoinServiceAPI extends _i1.Mock implements _i19.CoinServiceAPI { returnValueForMissingStub: null, ); @override - _i22.Future<_i8.FeeObject> get fees => (super.noSuchMethod( + _i22.Future<_i9.FeeObject> get fees => (super.noSuchMethod( Invocation.getter(#fees), - returnValue: _i22.Future<_i8.FeeObject>.value(_FakeFeeObject_5( + returnValue: _i22.Future<_i9.FeeObject>.value(_FakeFeeObject_6( this, Invocation.getter(#fees), )), - ) as _i22.Future<_i8.FeeObject>); + ) as _i22.Future<_i9.FeeObject>); @override _i22.Future get maxFee => (super.noSuchMethod( Invocation.getter(#maxFee), @@ -2370,13 +2498,13 @@ class MockCoinServiceAPI extends _i1.Mock implements _i19.CoinServiceAPI { returnValue: _i22.Future.value(''), ) as _i22.Future); @override - _i11.Balance get balance => (super.noSuchMethod( + _i12.Balance get balance => (super.noSuchMethod( Invocation.getter(#balance), - returnValue: _FakeBalance_8( + returnValue: _FakeBalance_9( this, Invocation.getter(#balance), ), - ) as _i11.Balance); + ) as _i12.Balance); @override _i22.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), diff --git a/test/widget_tests/trade_card_test.mocks.dart b/test/widget_tests/trade_card_test.mocks.dart new file mode 100644 index 000000000..55895389f --- /dev/null +++ b/test/widget_tests/trade_card_test.mocks.dart @@ -0,0 +1,131 @@ +// Mocks generated by Mockito 5.3.2 from annotations +// in stackwallet/test/widget_tests/trade_card_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i5; +import 'dart:typed_data' as _i6; + +import 'package:mockito/mockito.dart' as _i1; +import 'package:stackwallet/db/isar/main_db.dart' as _i2; +import 'package:stackwallet/models/isar/stack_theme.dart' as _i4; +import 'package:stackwallet/themes/theme_service.dart' as _i3; + +// 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 + +class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB { + _FakeMainDB_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [ThemeService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockThemeService extends _i1.Mock implements _i3.ThemeService { + MockThemeService() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.MainDB get db => (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_0( + this, + Invocation.getter(#db), + ), + ) as _i2.MainDB); + @override + List<_i4.StackTheme> get installedThemes => (super.noSuchMethod( + Invocation.getter(#installedThemes), + returnValue: <_i4.StackTheme>[], + ) as List<_i4.StackTheme>); + @override + void init(_i2.MainDB? db) => super.noSuchMethod( + Invocation.method( + #init, + [db], + ), + returnValueForMissingStub: null, + ); + @override + _i5.Future install({required _i6.Uint8List? themeArchiveData}) => + (super.noSuchMethod( + Invocation.method( + #install, + [], + {#themeArchiveData: themeArchiveData}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future remove({required String? themeId}) => (super.noSuchMethod( + Invocation.method( + #remove, + [], + {#themeId: themeId}, + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override + _i5.Future verifyInstalled({required String? themeId}) => + (super.noSuchMethod( + Invocation.method( + #verifyInstalled, + [], + {#themeId: themeId}, + ), + returnValue: _i5.Future.value(false), + ) as _i5.Future); + @override + _i5.Future> fetchThemes() => (super.noSuchMethod( + Invocation.method( + #fetchThemes, + [], + ), + returnValue: _i5.Future>.value( + <_i3.StackThemeMetaData>[]), + ) as _i5.Future>); + @override + _i5.Future<_i6.Uint8List> fetchTheme( + {required _i3.StackThemeMetaData? themeMetaData}) => + (super.noSuchMethod( + Invocation.method( + #fetchTheme, + [], + {#themeMetaData: themeMetaData}, + ), + returnValue: _i5.Future<_i6.Uint8List>.value(_i6.Uint8List(0)), + ) as _i5.Future<_i6.Uint8List>); + @override + _i4.StackTheme? getTheme({required String? themeId}) => + (super.noSuchMethod(Invocation.method( + #getTheme, + [], + {#themeId: themeId}, + )) as _i4.StackTheme?); +} diff --git a/test/widget_tests/transaction_card_test.dart b/test/widget_tests/transaction_card_test.dart index 9bbd93dee..d3d16b655 100644 --- a/test/widget_tests/transaction_card_test.dart +++ b/test/widget_tests/transaction_card_test.dart @@ -1,3 +1,4 @@ +import 'package:decimal/decimal.dart'; import 'package:flutter/material.dart'; import 'package:flutter_feather_icons/flutter_feather_icons.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -5,33 +6,40 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockingjay/mockingjay.dart' as mockingjay; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; -import 'package:stackduo/models/isar/models/blockchain_data/address.dart'; -import 'package:stackduo/models/isar/models/blockchain_data/transaction.dart'; -import 'package:stackduo/pages/wallet_view/transaction_views/transaction_details_view.dart'; -import 'package:stackduo/providers/providers.dart'; -import 'package:stackduo/services/coins/coin_service.dart'; -import 'package:stackduo/services/coins/manager.dart'; -import 'package:stackduo/services/locale_service.dart'; -import 'package:stackduo/services/notes_service.dart'; -import 'package:stackduo/services/price_service.dart'; -import 'package:stackduo/services/wallets.dart'; -import 'package:stackduo/utilities/amount/amount.dart'; -import 'package:stackduo/utilities/prefs.dart'; -import 'package:stackduo/utilities/theme/light_colors.dart'; -import 'package:stackduo/utilities/theme/stack_colors.dart'; -import 'package:stackduo/utilities/util.dart'; -import 'package:stackduo/widgets/transaction_card.dart'; - +import 'package:stackwallet/models/isar/models/blockchain_data/address.dart'; +import 'package:stackwallet/models/isar/models/blockchain_data/transaction.dart'; +import 'package:stackwallet/models/isar/stack_theme.dart'; +import 'package:stackwallet/pages/wallet_view/transaction_views/transaction_details_view.dart'; +import 'package:stackwallet/providers/providers.dart'; +import 'package:stackwallet/services/coins/coin_service.dart'; +import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; +import 'package:stackwallet/services/coins/manager.dart'; +import 'package:stackwallet/services/locale_service.dart'; +import 'package:stackwallet/services/notes_service.dart'; +import 'package:stackwallet/services/price_service.dart'; +import 'package:stackwallet/services/wallets.dart'; +import 'package:stackwallet/themes/stack_colors.dart'; +import 'package:stackwallet/themes/theme_service.dart'; +import 'package:stackwallet/utilities/amount/amount.dart'; +import 'package:stackwallet/utilities/enums/coin_enum.dart'; +import 'package:stackwallet/utilities/prefs.dart'; +import 'package:stackwallet/utilities/util.dart'; +import 'package:stackwallet/widgets/transaction_card.dart'; +import 'package:tuple/tuple.dart'; + +import '../sample_data/theme_json.dart'; import 'transaction_card_test.mocks.dart'; @GenerateMocks([ Wallets, Manager, CoinServiceAPI, + FiroWallet, LocaleService, Prefs, PriceService, - NotesService + NotesService, + ThemeService, ], customMocks: []) void main() { TestWidgetsFlutterBinding.ensureInitialized(); @@ -41,12 +49,17 @@ void main() { final wallets = MockWallets(); final mockPrefs = MockPrefs(); final mockPriceService = MockPriceService(); + final mockThemeService = MockThemeService(); final tx = Transaction( txid: "some txid", timestamp: 1648595998, type: TransactionType.outgoing, amount: 100000000, + amountString: Amount( + rawValue: BigInt.from(100000000), + fractionDigits: Coin.firo.decimals, + ).toJsonString(), fee: 3794, height: 450123, subType: TransactionSubType.none, @@ -55,10 +68,10 @@ void main() { isLelantus: null, slateId: '', otherData: '', + nonce: null, inputs: [], outputs: [], - amountString: Amount.zero.toJsonString(), - nonce: null, + numberOfMessages: null, )..address.value = Address( walletId: "walletId", value: "", @@ -68,10 +81,27 @@ void main() { type: AddressType.p2pkh, subType: AddressSubType.receiving); + final CoinServiceAPI wallet = MockFiroWallet(); + + when(mockThemeService.getTheme(themeId: "light")).thenAnswer( + (_) => StackTheme.fromJson( + json: lightThemeJsonMap, + applicationThemesDirectoryPath: "test", + ), + ); + when(wallet.coin.ticker).thenAnswer((_) => "FIRO"); when(mockLocaleService.locale).thenAnswer((_) => "en_US"); when(mockPrefs.currency).thenAnswer((_) => "USD"); when(mockPrefs.externalCalls).thenAnswer((_) => true); + when(mockPriceService.getPrice(Coin.firo)) + .thenAnswer((realInvocation) => Tuple2(Decimal.ten, 0.00)); + + when(wallet.coin).thenAnswer((_) => Coin.firo); + when(wallets.getManager("wallet-id")) + .thenAnswer((realInvocation) => Manager(wallet)); + + when(wallet.storedChainHeight).thenAnswer((_) => 6000000); // await tester.pumpWidget( ProviderScope( @@ -79,6 +109,7 @@ void main() { walletsChangeNotifierProvider.overrideWithValue(wallets), localeServiceChangeNotifierProvider .overrideWithValue(mockLocaleService), + pThemeService.overrideWithValue(mockThemeService), prefsChangeNotifierProvider.overrideWithValue(mockPrefs), priceAnd24hChangeNotifierProvider.overrideWithValue(mockPriceService) ], @@ -86,7 +117,10 @@ void main() { theme: ThemeData( extensions: [ StackColors.fromStackColorTheme( - LightColors(), + StackTheme.fromJson( + json: lightThemeJsonMap, + applicationThemesDirectoryPath: "test", + ), ), ], ), @@ -118,6 +152,8 @@ void main() { verify(mockLocaleService.addListener(any)).called(1); verify(mockPrefs.currency).called(1); + verify(mockPriceService.getPrice(Coin.firo)).called(1); + verify(wallet.coin.ticker).called(1); verify(mockLocaleService.locale).called(1); @@ -131,12 +167,17 @@ void main() { final wallets = MockWallets(); final mockPrefs = MockPrefs(); final mockPriceService = MockPriceService(); + final mockThemeService = MockThemeService(); final tx = Transaction( txid: "some txid", timestamp: 1648595998, type: TransactionType.outgoing, amount: 9659, + amountString: Amount( + rawValue: BigInt.from(9659), + fractionDigits: Coin.firo.decimals, + ).toJsonString(), fee: 3794, height: 450123, subType: TransactionSubType.mint, @@ -145,10 +186,10 @@ void main() { isLelantus: null, slateId: '', otherData: '', + nonce: null, inputs: [], outputs: [], - amountString: Amount.zero.toJsonString(), - nonce: null, + numberOfMessages: null, )..address.value = Address( walletId: "walletId", value: "", @@ -158,10 +199,26 @@ void main() { type: AddressType.p2pkh, subType: AddressSubType.receiving); + final CoinServiceAPI wallet = MockFiroWallet(); + + when(mockThemeService.getTheme(themeId: "light")).thenAnswer( + (_) => StackTheme.fromJson( + json: lightThemeJsonMap, + applicationThemesDirectoryPath: "test", + ), + ); + when(wallet.coin.ticker).thenAnswer((_) => "FIRO"); when(mockLocaleService.locale).thenAnswer((_) => "en_US"); when(mockPrefs.currency).thenAnswer((_) => "USD"); when(mockPrefs.externalCalls).thenAnswer((_) => true); + when(mockPriceService.getPrice(Coin.firo)) + .thenAnswer((realInvocation) => Tuple2(Decimal.ten, 0.00)); + when(wallet.coin).thenAnswer((_) => Coin.firo); + when(wallet.storedChainHeight).thenAnswer((_) => 6000000); + + when(wallets.getManager("wallet-id")) + .thenAnswer((realInvocation) => Manager(wallet)); // await tester.pumpWidget( ProviderScope( @@ -170,13 +227,17 @@ void main() { localeServiceChangeNotifierProvider .overrideWithValue(mockLocaleService), prefsChangeNotifierProvider.overrideWithValue(mockPrefs), + pThemeService.overrideWithValue(mockThemeService), priceAnd24hChangeNotifierProvider.overrideWithValue(mockPriceService) ], child: MaterialApp( theme: ThemeData( extensions: [ StackColors.fromStackColorTheme( - LightColors(), + StackTheme.fromJson( + json: lightThemeJsonMap, + applicationThemesDirectoryPath: "test", + ), ), ], ), @@ -206,6 +267,8 @@ void main() { verify(mockLocaleService.addListener(any)).called(1); verify(mockPrefs.currency).called(1); + verify(mockPriceService.getPrice(Coin.firo)).called(1); + verify(wallet.coin.ticker).called(1); verify(mockLocaleService.locale).called(1); @@ -219,12 +282,17 @@ void main() { final wallets = MockWallets(); final mockPrefs = MockPrefs(); final mockPriceService = MockPriceService(); + final mockThemeService = MockThemeService(); final tx = Transaction( txid: "some txid", timestamp: 1648595998, type: TransactionType.incoming, amount: 100000000, + amountString: Amount( + rawValue: BigInt.from(100000000), + fractionDigits: Coin.firo.decimals, + ).toJsonString(), fee: 3794, height: 450123, subType: TransactionSubType.none, @@ -233,10 +301,10 @@ void main() { isLelantus: null, slateId: '', otherData: '', + nonce: null, inputs: [], outputs: [], - amountString: Amount.zero.toJsonString(), - nonce: null, + numberOfMessages: null, )..address.value = Address( walletId: "walletId", value: "", @@ -246,9 +314,27 @@ void main() { type: AddressType.p2pkh, subType: AddressSubType.receiving); + final CoinServiceAPI wallet = MockFiroWallet(); + + when(mockThemeService.getTheme(themeId: "light")).thenAnswer( + (_) => StackTheme.fromJson( + json: lightThemeJsonMap, + applicationThemesDirectoryPath: "test", + ), + ); + when(wallet.coin.ticker).thenAnswer((_) => "FIRO"); when(mockLocaleService.locale).thenAnswer((_) => "en_US"); when(mockPrefs.currency).thenAnswer((_) => "USD"); when(mockPrefs.externalCalls).thenAnswer((_) => true); + when(mockPriceService.getPrice(Coin.firo)) + .thenAnswer((realInvocation) => Tuple2(Decimal.ten, 0.00)); + + when(wallet.coin).thenAnswer((_) => Coin.firo); + + when(wallets.getManager("wallet-id")) + .thenAnswer((realInvocation) => Manager(wallet)); + + when(wallet.storedChainHeight).thenAnswer((_) => 6000000); await tester.pumpWidget( ProviderScope( @@ -257,13 +343,17 @@ void main() { localeServiceChangeNotifierProvider .overrideWithValue(mockLocaleService), prefsChangeNotifierProvider.overrideWithValue(mockPrefs), + pThemeService.overrideWithValue(mockThemeService), priceAnd24hChangeNotifierProvider.overrideWithValue(mockPriceService) ], child: MaterialApp( theme: ThemeData( extensions: [ StackColors.fromStackColorTheme( - LightColors(), + StackTheme.fromJson( + json: lightThemeJsonMap, + applicationThemesDirectoryPath: "test", + ), ), ], ), @@ -285,6 +375,8 @@ void main() { verify(mockLocaleService.addListener(any)).called(1); verify(mockPrefs.currency).called(1); + verify(mockPriceService.getPrice(Coin.firo)).called(1); + verify(wallet.coin.ticker).called(1); verify(mockLocaleService.locale).called(1); @@ -298,6 +390,7 @@ void main() { final wallets = MockWallets(); final mockPrefs = MockPrefs(); final mockPriceService = MockPriceService(); + final mockThemeService = MockThemeService(); final navigator = mockingjay.MockNavigator(); final tx = Transaction( @@ -305,6 +398,10 @@ void main() { timestamp: 1648595998, type: TransactionType.outgoing, amount: 100000000, + amountString: Amount( + rawValue: BigInt.from(100000000), + fractionDigits: Coin.firo.decimals, + ).toJsonString(), fee: 3794, height: 450123, subType: TransactionSubType.none, @@ -313,10 +410,10 @@ void main() { isLelantus: null, slateId: '', otherData: '', + nonce: null, inputs: [], outputs: [], - amountString: Amount.zero.toJsonString(), - nonce: null, + numberOfMessages: null, )..address.value = Address( walletId: "walletId", value: "", @@ -326,9 +423,32 @@ void main() { type: AddressType.p2pkh, subType: AddressSubType.receiving); + final CoinServiceAPI wallet = MockFiroWallet(); + + when(mockThemeService.getTheme(themeId: "light")).thenAnswer( + (_) => StackTheme.fromJson( + json: lightThemeJsonMap, + applicationThemesDirectoryPath: "test", + ), + ); + when(wallet.coin.ticker).thenAnswer((_) => "FIRO"); when(mockLocaleService.locale).thenAnswer((_) => "en_US"); when(mockPrefs.currency).thenAnswer((_) => "USD"); when(mockPrefs.externalCalls).thenAnswer((_) => true); + when(mockPriceService.getPrice(Coin.firo)) + .thenAnswer((realInvocation) => Tuple2(Decimal.ten, 0.00)); + + when(wallet.coin).thenAnswer((_) => Coin.firo); + + when(wallets.getManager("wallet id")) + .thenAnswer((realInvocation) => Manager(wallet)); + + when(wallet.storedChainHeight).thenAnswer((_) => 6000000); + + mockingjay + .when(() => navigator.pushNamed("/transactionDetails", + arguments: Tuple3(tx, Coin.firo, "wallet id"))) + .thenAnswer((_) async => {}); await tester.pumpWidget( ProviderScope( @@ -337,12 +457,18 @@ void main() { localeServiceChangeNotifierProvider .overrideWithValue(mockLocaleService), prefsChangeNotifierProvider.overrideWithValue(mockPrefs), + pThemeService.overrideWithValue(mockThemeService), priceAnd24hChangeNotifierProvider.overrideWithValue(mockPriceService) ], child: MaterialApp( theme: ThemeData( extensions: [ - StackColors.fromStackColorTheme(LightColors()), + StackColors.fromStackColorTheme( + StackTheme.fromJson( + json: lightThemeJsonMap, + applicationThemesDirectoryPath: "test", + ), + ), ], ), home: mockingjay.MockNavigatorProvider( @@ -361,16 +487,19 @@ void main() { verify(mockPrefs.currency).called(2); verify(mockLocaleService.locale).called(4); + verify(wallet.coin.ticker).called(1); + verify(wallet.storedChainHeight).called(2); + verifyNoMoreInteractions(wallet); verifyNoMoreInteractions(mockLocaleService); if (Util.isDesktop) { expect(find.byType(TransactionDetailsView), findsOneWidget); } else { - // mockingjay - // .verify(() => navigator.pushNamed("/transactionDetails", - // arguments: Tuple3(tx, Coin.firo, "wallet id"))) - // .called(1); + mockingjay + .verify(() => navigator.pushNamed("/transactionDetails", + arguments: Tuple3(tx, Coin.firo, "wallet id"))) + .called(1); } }); } diff --git a/test/widget_tests/transaction_card_test.mocks.dart b/test/widget_tests/transaction_card_test.mocks.dart index 5e7fa925d..93cc0c9a7 100644 --- a/test/widget_tests/transaction_card_test.mocks.dart +++ b/test/widget_tests/transaction_card_test.mocks.dart @@ -1,32 +1,42 @@ // Mocks generated by Mockito 5.3.2 from annotations -// in stackduo/test/widget_tests/transaction_card_test.dart. +// in stackwallet/test/widget_tests/transaction_card_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i14; -import 'dart:ui' as _i16; +import 'dart:async' as _i18; +import 'dart:typed_data' as _i32; +import 'dart:ui' as _i20; -import 'package:decimal/decimal.dart' as _i22; +import 'package:decimal/decimal.dart' as _i28; import 'package:flutter/foundation.dart' as _i4; import 'package:flutter_riverpod/flutter_riverpod.dart' as _i5; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackduo/models/balance.dart' as _i9; -import 'package:stackduo/models/isar/models/isar_models.dart' as _i17; -import 'package:stackduo/models/models.dart' as _i8; -import 'package:stackduo/services/coins/coin_service.dart' as _i7; -import 'package:stackduo/services/coins/manager.dart' as _i6; -import 'package:stackduo/services/locale_service.dart' as _i18; -import 'package:stackduo/services/node_service.dart' as _i3; -import 'package:stackduo/services/notes_service.dart' as _i23; -import 'package:stackduo/services/price_service.dart' as _i21; -import 'package:stackduo/services/wallets.dart' as _i12; -import 'package:stackduo/services/wallets_service.dart' as _i2; -import 'package:stackduo/utilities/amount/amount.dart' as _i10; -import 'package:stackduo/utilities/enums/backup_frequency_type.dart' as _i20; -import 'package:stackduo/utilities/enums/coin_enum.dart' as _i13; -import 'package:stackduo/utilities/enums/sync_type_enum.dart' as _i19; -import 'package:stackduo/utilities/prefs.dart' as _i15; -import 'package:tuple/tuple.dart' as _i11; +import 'package:stackwallet/db/isar/main_db.dart' as _i14; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i13; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i12; +import 'package:stackwallet/models/balance.dart' as _i9; +import 'package:stackwallet/models/isar/models/isar_models.dart' as _i21; +import 'package:stackwallet/models/isar/stack_theme.dart' as _i31; +import 'package:stackwallet/models/models.dart' as _i8; +import 'package:stackwallet/models/signing_data.dart' as _i23; +import 'package:stackwallet/services/coins/coin_service.dart' as _i7; +import 'package:stackwallet/services/coins/firo/firo_wallet.dart' as _i22; +import 'package:stackwallet/services/coins/manager.dart' as _i6; +import 'package:stackwallet/services/locale_service.dart' as _i24; +import 'package:stackwallet/services/node_service.dart' as _i3; +import 'package:stackwallet/services/notes_service.dart' as _i29; +import 'package:stackwallet/services/price_service.dart' as _i27; +import 'package:stackwallet/services/transaction_notification_tracker.dart' + as _i11; +import 'package:stackwallet/services/wallets.dart' as _i16; +import 'package:stackwallet/services/wallets_service.dart' as _i2; +import 'package:stackwallet/themes/theme_service.dart' as _i30; +import 'package:stackwallet/utilities/amount/amount.dart' as _i10; +import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i26; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i17; +import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i25; +import 'package:stackwallet/utilities/prefs.dart' as _i19; +import 'package:tuple/tuple.dart' as _i15; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -122,8 +132,9 @@ class _FakeAmount_7 extends _i1.SmartFake implements _i10.Amount { ); } -class _FakeDuration_8 extends _i1.SmartFake implements Duration { - _FakeDuration_8( +class _FakeTransactionNotificationTracker_8 extends _i1.SmartFake + implements _i11.TransactionNotificationTracker { + _FakeTransactionNotificationTracker_8( Object parent, Invocation parentInvocation, ) : super( @@ -132,9 +143,50 @@ class _FakeDuration_8 extends _i1.SmartFake implements Duration { ); } -class _FakeTuple2_9 extends _i1.SmartFake - implements _i11.Tuple2 { - _FakeTuple2_9( +class _FakeElectrumX_9 extends _i1.SmartFake implements _i12.ElectrumX { + _FakeElectrumX_9( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeCachedElectrumX_10 extends _i1.SmartFake + implements _i13.CachedElectrumX { + _FakeCachedElectrumX_10( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeMainDB_11 extends _i1.SmartFake implements _i14.MainDB { + _FakeMainDB_11( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeDuration_12 extends _i1.SmartFake implements Duration { + _FakeDuration_12( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeTuple2_13 extends _i1.SmartFake + implements _i15.Tuple2 { + _FakeTuple2_13( Object parent, Invocation parentInvocation, ) : super( @@ -146,7 +198,7 @@ class _FakeTuple2_9 extends _i1.SmartFake /// A class which mocks [Wallets]. /// /// See the documentation for Mockito's code generation for more information. -class MockWallets extends _i1.Mock implements _i12.Wallets { +class MockWallets extends _i1.Mock implements _i16.Wallets { MockWallets() { _i1.throwOnMissingStub(this); } @@ -213,7 +265,7 @@ class MockWallets extends _i1.Mock implements _i12.Wallets { returnValueForMissingStub: null, ); @override - List getWalletIdsFor({required _i13.Coin? coin}) => + List getWalletIdsFor({required _i17.Coin? coin}) => (super.noSuchMethod( Invocation.method( #getWalletIdsFor, @@ -223,21 +275,21 @@ class MockWallets extends _i1.Mock implements _i12.Wallets { returnValue: [], ) as List); @override - List<_i11.Tuple2<_i13.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>> + List<_i15.Tuple2<_i17.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>> getManagerProvidersByCoin() => (super.noSuchMethod( Invocation.method( #getManagerProvidersByCoin, [], ), returnValue: < - _i11.Tuple2<_i13.Coin, + _i15.Tuple2<_i17.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>>[], ) as List< - _i11.Tuple2<_i13.Coin, + _i15.Tuple2<_i17.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>>); @override List<_i5.ChangeNotifierProvider<_i6.Manager>> getManagerProvidersForCoin( - _i13.Coin? coin) => + _i17.Coin? coin) => (super.noSuchMethod( Invocation.method( #getManagerProvidersForCoin, @@ -301,17 +353,17 @@ class MockWallets extends _i1.Mock implements _i12.Wallets { returnValueForMissingStub: null, ); @override - _i14.Future load(_i15.Prefs? prefs) => (super.noSuchMethod( + _i18.Future load(_i19.Prefs? prefs) => (super.noSuchMethod( Invocation.method( #load, [prefs], ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override - _i14.Future loadAfterStackRestore( - _i15.Prefs? prefs, + _i18.Future loadAfterStackRestore( + _i19.Prefs? prefs, List<_i6.Manager>? managers, ) => (super.noSuchMethod( @@ -322,11 +374,11 @@ class MockWallets extends _i1.Mock implements _i12.Wallets { managers, ], ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override - void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i20.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -334,7 +386,7 @@ class MockWallets extends _i1.Mock implements _i12.Wallets { returnValueForMissingStub: null, ); @override - void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i20.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -386,10 +438,10 @@ class MockManager extends _i1.Mock implements _i6.Manager { returnValue: false, ) as bool); @override - _i13.Coin get coin => (super.noSuchMethod( + _i17.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i13.Coin.bitcoin, - ) as _i13.Coin); + returnValue: _i17.Coin.bitcoin, + ) as _i17.Coin); @override bool get isRefreshing => (super.noSuchMethod( Invocation.getter(#isRefreshing), @@ -422,23 +474,23 @@ class MockManager extends _i1.Mock implements _i6.Manager { returnValueForMissingStub: null, ); @override - _i14.Future<_i8.FeeObject> get fees => (super.noSuchMethod( + _i18.Future<_i8.FeeObject> get fees => (super.noSuchMethod( Invocation.getter(#fees), - returnValue: _i14.Future<_i8.FeeObject>.value(_FakeFeeObject_5( + returnValue: _i18.Future<_i8.FeeObject>.value(_FakeFeeObject_5( this, Invocation.getter(#fees), )), - ) as _i14.Future<_i8.FeeObject>); + ) as _i18.Future<_i8.FeeObject>); @override - _i14.Future get maxFee => (super.noSuchMethod( + _i18.Future get maxFee => (super.noSuchMethod( Invocation.getter(#maxFee), - returnValue: _i14.Future.value(0), - ) as _i14.Future); + returnValue: _i18.Future.value(0), + ) as _i18.Future); @override - _i14.Future get currentReceivingAddress => (super.noSuchMethod( + _i18.Future get currentReceivingAddress => (super.noSuchMethod( Invocation.getter(#currentReceivingAddress), - returnValue: _i14.Future.value(''), - ) as _i14.Future); + returnValue: _i18.Future.value(''), + ) as _i18.Future); @override _i9.Balance get balance => (super.noSuchMethod( Invocation.getter(#balance), @@ -448,16 +500,16 @@ class MockManager extends _i1.Mock implements _i6.Manager { ), ) as _i9.Balance); @override - _i14.Future> get transactions => (super.noSuchMethod( + _i18.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), returnValue: - _i14.Future>.value(<_i17.Transaction>[]), - ) as _i14.Future>); + _i18.Future>.value(<_i21.Transaction>[]), + ) as _i18.Future>); @override - _i14.Future> get utxos => (super.noSuchMethod( + _i18.Future> get utxos => (super.noSuchMethod( Invocation.getter(#utxos), - returnValue: _i14.Future>.value(<_i17.UTXO>[]), - ) as _i14.Future>); + returnValue: _i18.Future>.value(<_i21.UTXO>[]), + ) as _i18.Future>); @override set walletName(String? newName) => super.noSuchMethod( Invocation.setter( @@ -477,15 +529,15 @@ class MockManager extends _i1.Mock implements _i6.Manager { returnValue: '', ) as String); @override - _i14.Future> get mnemonic => (super.noSuchMethod( + _i18.Future> get mnemonic => (super.noSuchMethod( Invocation.getter(#mnemonic), - returnValue: _i14.Future>.value([]), - ) as _i14.Future>); + returnValue: _i18.Future>.value([]), + ) as _i18.Future>); @override - _i14.Future get mnemonicPassphrase => (super.noSuchMethod( + _i18.Future get mnemonicPassphrase => (super.noSuchMethod( Invocation.getter(#mnemonicPassphrase), - returnValue: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + ) as _i18.Future); @override bool get isConnected => (super.noSuchMethod( Invocation.getter(#isConnected), @@ -507,6 +559,11 @@ class MockManager extends _i1.Mock implements _i6.Manager { returnValue: false, ) as bool); @override + bool get hasTokenSupport => (super.noSuchMethod( + Invocation.getter(#hasTokenSupport), + returnValue: false, + ) as bool); + @override bool get hasWhirlpoolSupport => (super.noSuchMethod( Invocation.getter(#hasWhirlpoolSupport), returnValue: false, @@ -522,24 +579,24 @@ class MockManager extends _i1.Mock implements _i6.Manager { returnValue: false, ) as bool); @override - _i14.Future get xpub => (super.noSuchMethod( + _i18.Future get xpub => (super.noSuchMethod( Invocation.getter(#xpub), - returnValue: _i14.Future.value(''), - ) as _i14.Future); + returnValue: _i18.Future.value(''), + ) as _i18.Future); @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, ) as bool); @override - _i14.Future updateNode(bool? shouldRefresh) => (super.noSuchMethod( + _i18.Future updateNode(bool? shouldRefresh) => (super.noSuchMethod( Invocation.method( #updateNode, [shouldRefresh], ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override void dispose() => super.noSuchMethod( Invocation.method( @@ -549,7 +606,7 @@ class MockManager extends _i1.Mock implements _i6.Manager { returnValueForMissingStub: null, ); @override - _i14.Future> prepareSend({ + _i18.Future> prepareSend({ required String? address, required _i10.Amount? amount, Map? args, @@ -565,27 +622,27 @@ class MockManager extends _i1.Mock implements _i6.Manager { }, ), returnValue: - _i14.Future>.value({}), - ) as _i14.Future>); + _i18.Future>.value({}), + ) as _i18.Future>); @override - _i14.Future confirmSend({required Map? txData}) => + _i18.Future confirmSend({required Map? txData}) => (super.noSuchMethod( Invocation.method( #confirmSend, [], {#txData: txData}, ), - returnValue: _i14.Future.value(''), - ) as _i14.Future); + returnValue: _i18.Future.value(''), + ) as _i18.Future); @override - _i14.Future refresh() => (super.noSuchMethod( + _i18.Future refresh() => (super.noSuchMethod( Invocation.method( #refresh, [], ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override bool validateAddress(String? address) => (super.noSuchMethod( Invocation.method( @@ -595,33 +652,33 @@ class MockManager extends _i1.Mock implements _i6.Manager { returnValue: false, ) as bool); @override - _i14.Future testNetworkConnection() => (super.noSuchMethod( + _i18.Future testNetworkConnection() => (super.noSuchMethod( Invocation.method( #testNetworkConnection, [], ), - returnValue: _i14.Future.value(false), - ) as _i14.Future); + returnValue: _i18.Future.value(false), + ) as _i18.Future); @override - _i14.Future initializeNew() => (super.noSuchMethod( + _i18.Future initializeNew() => (super.noSuchMethod( Invocation.method( #initializeNew, [], ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override - _i14.Future initializeExisting() => (super.noSuchMethod( + _i18.Future initializeExisting() => (super.noSuchMethod( Invocation.method( #initializeExisting, [], ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override - _i14.Future recoverFromMnemonic({ + _i18.Future recoverFromMnemonic({ required String? mnemonic, String? mnemonicPassphrase, required int? maxUnusedAddressGap, @@ -640,20 +697,20 @@ class MockManager extends _i1.Mock implements _i6.Manager { #height: height, }, ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override - _i14.Future exitCurrentWallet() => (super.noSuchMethod( + _i18.Future exitCurrentWallet() => (super.noSuchMethod( Invocation.method( #exitCurrentWallet, [], ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override - _i14.Future fullRescan( + _i18.Future fullRescan( int? maxUnusedAddressGap, int? maxNumberOfIndexesToCheck, ) => @@ -665,11 +722,11 @@ class MockManager extends _i1.Mock implements _i6.Manager { maxNumberOfIndexesToCheck, ], ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override - _i14.Future<_i10.Amount> estimateFeeFor( + _i18.Future<_i10.Amount> estimateFeeFor( _i10.Amount? amount, int? feeRate, ) => @@ -681,7 +738,7 @@ class MockManager extends _i1.Mock implements _i6.Manager { feeRate, ], ), - returnValue: _i14.Future<_i10.Amount>.value(_FakeAmount_7( + returnValue: _i18.Future<_i10.Amount>.value(_FakeAmount_7( this, Invocation.method( #estimateFeeFor, @@ -691,26 +748,26 @@ class MockManager extends _i1.Mock implements _i6.Manager { ], ), )), - ) as _i14.Future<_i10.Amount>); + ) as _i18.Future<_i10.Amount>); @override - _i14.Future generateNewAddress() => (super.noSuchMethod( + _i18.Future generateNewAddress() => (super.noSuchMethod( Invocation.method( #generateNewAddress, [], ), - returnValue: _i14.Future.value(false), - ) as _i14.Future); + returnValue: _i18.Future.value(false), + ) as _i18.Future); @override - _i14.Future resetRescanOnOpen() => (super.noSuchMethod( + _i18.Future resetRescanOnOpen() => (super.noSuchMethod( Invocation.method( #resetRescanOnOpen, [], ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override - void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i20.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -718,7 +775,7 @@ class MockManager extends _i1.Mock implements _i6.Manager { returnValueForMissingStub: null, ); @override - void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i20.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -753,10 +810,10 @@ class MockCoinServiceAPI extends _i1.Mock implements _i7.CoinServiceAPI { returnValueForMissingStub: null, ); @override - _i13.Coin get coin => (super.noSuchMethod( + _i17.Coin get coin => (super.noSuchMethod( Invocation.getter(#coin), - returnValue: _i13.Coin.bitcoin, - ) as _i13.Coin); + returnValue: _i17.Coin.bitcoin, + ) as _i17.Coin); @override bool get isRefreshing => (super.noSuchMethod( Invocation.getter(#isRefreshing), @@ -789,23 +846,23 @@ class MockCoinServiceAPI extends _i1.Mock implements _i7.CoinServiceAPI { returnValueForMissingStub: null, ); @override - _i14.Future<_i8.FeeObject> get fees => (super.noSuchMethod( + _i18.Future<_i8.FeeObject> get fees => (super.noSuchMethod( Invocation.getter(#fees), - returnValue: _i14.Future<_i8.FeeObject>.value(_FakeFeeObject_5( + returnValue: _i18.Future<_i8.FeeObject>.value(_FakeFeeObject_5( this, Invocation.getter(#fees), )), - ) as _i14.Future<_i8.FeeObject>); + ) as _i18.Future<_i8.FeeObject>); @override - _i14.Future get maxFee => (super.noSuchMethod( + _i18.Future get maxFee => (super.noSuchMethod( Invocation.getter(#maxFee), - returnValue: _i14.Future.value(0), - ) as _i14.Future); + returnValue: _i18.Future.value(0), + ) as _i18.Future); @override - _i14.Future get currentReceivingAddress => (super.noSuchMethod( + _i18.Future get currentReceivingAddress => (super.noSuchMethod( Invocation.getter(#currentReceivingAddress), - returnValue: _i14.Future.value(''), - ) as _i14.Future); + returnValue: _i18.Future.value(''), + ) as _i18.Future); @override _i9.Balance get balance => (super.noSuchMethod( Invocation.getter(#balance), @@ -815,16 +872,16 @@ class MockCoinServiceAPI extends _i1.Mock implements _i7.CoinServiceAPI { ), ) as _i9.Balance); @override - _i14.Future> get transactions => (super.noSuchMethod( + _i18.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), returnValue: - _i14.Future>.value(<_i17.Transaction>[]), - ) as _i14.Future>); + _i18.Future>.value(<_i21.Transaction>[]), + ) as _i18.Future>); @override - _i14.Future> get utxos => (super.noSuchMethod( + _i18.Future> get utxos => (super.noSuchMethod( Invocation.getter(#utxos), - returnValue: _i14.Future>.value(<_i17.UTXO>[]), - ) as _i14.Future>); + returnValue: _i18.Future>.value(<_i21.UTXO>[]), + ) as _i18.Future>); @override set walletName(String? newName) => super.noSuchMethod( Invocation.setter( @@ -844,20 +901,20 @@ class MockCoinServiceAPI extends _i1.Mock implements _i7.CoinServiceAPI { returnValue: '', ) as String); @override - _i14.Future> get mnemonic => (super.noSuchMethod( + _i18.Future> get mnemonic => (super.noSuchMethod( Invocation.getter(#mnemonic), - returnValue: _i14.Future>.value([]), - ) as _i14.Future>); + returnValue: _i18.Future>.value([]), + ) as _i18.Future>); @override - _i14.Future get mnemonicString => (super.noSuchMethod( + _i18.Future get mnemonicString => (super.noSuchMethod( Invocation.getter(#mnemonicString), - returnValue: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + ) as _i18.Future); @override - _i14.Future get mnemonicPassphrase => (super.noSuchMethod( + _i18.Future get mnemonicPassphrase => (super.noSuchMethod( Invocation.getter(#mnemonicPassphrase), - returnValue: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + ) as _i18.Future); @override bool get hasCalledExit => (super.noSuchMethod( Invocation.getter(#hasCalledExit), @@ -874,7 +931,7 @@ class MockCoinServiceAPI extends _i1.Mock implements _i7.CoinServiceAPI { returnValue: 0, ) as int); @override - _i14.Future> prepareSend({ + _i18.Future> prepareSend({ required String? address, required _i10.Amount? amount, Map? args, @@ -890,36 +947,36 @@ class MockCoinServiceAPI extends _i1.Mock implements _i7.CoinServiceAPI { }, ), returnValue: - _i14.Future>.value({}), - ) as _i14.Future>); + _i18.Future>.value({}), + ) as _i18.Future>); @override - _i14.Future confirmSend({required Map? txData}) => + _i18.Future confirmSend({required Map? txData}) => (super.noSuchMethod( Invocation.method( #confirmSend, [], {#txData: txData}, ), - returnValue: _i14.Future.value(''), - ) as _i14.Future); + returnValue: _i18.Future.value(''), + ) as _i18.Future); @override - _i14.Future refresh() => (super.noSuchMethod( + _i18.Future refresh() => (super.noSuchMethod( Invocation.method( #refresh, [], ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override - _i14.Future updateNode(bool? shouldRefresh) => (super.noSuchMethod( + _i18.Future updateNode(bool? shouldRefresh) => (super.noSuchMethod( Invocation.method( #updateNode, [shouldRefresh], ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override bool validateAddress(String? address) => (super.noSuchMethod( Invocation.method( @@ -929,15 +986,15 @@ class MockCoinServiceAPI extends _i1.Mock implements _i7.CoinServiceAPI { returnValue: false, ) as bool); @override - _i14.Future testNetworkConnection() => (super.noSuchMethod( + _i18.Future testNetworkConnection() => (super.noSuchMethod( Invocation.method( #testNetworkConnection, [], ), - returnValue: _i14.Future.value(false), - ) as _i14.Future); + returnValue: _i18.Future.value(false), + ) as _i18.Future); @override - _i14.Future recoverFromMnemonic({ + _i18.Future recoverFromMnemonic({ required String? mnemonic, String? mnemonicPassphrase, required int? maxUnusedAddressGap, @@ -956,38 +1013,38 @@ class MockCoinServiceAPI extends _i1.Mock implements _i7.CoinServiceAPI { #height: height, }, ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override - _i14.Future initializeNew() => (super.noSuchMethod( + _i18.Future initializeNew() => (super.noSuchMethod( Invocation.method( #initializeNew, [], ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override - _i14.Future initializeExisting() => (super.noSuchMethod( + _i18.Future initializeExisting() => (super.noSuchMethod( Invocation.method( #initializeExisting, [], ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override - _i14.Future exit() => (super.noSuchMethod( + _i18.Future exit() => (super.noSuchMethod( Invocation.method( #exit, [], ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override - _i14.Future fullRescan( + _i18.Future fullRescan( int? maxUnusedAddressGap, int? maxNumberOfIndexesToCheck, ) => @@ -999,11 +1056,11 @@ class MockCoinServiceAPI extends _i1.Mock implements _i7.CoinServiceAPI { maxNumberOfIndexesToCheck, ], ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override - _i14.Future<_i10.Amount> estimateFeeFor( + _i18.Future<_i10.Amount> estimateFeeFor( _i10.Amount? amount, int? feeRate, ) => @@ -1015,7 +1072,7 @@ class MockCoinServiceAPI extends _i1.Mock implements _i7.CoinServiceAPI { feeRate, ], ), - returnValue: _i14.Future<_i10.Amount>.value(_FakeAmount_7( + returnValue: _i18.Future<_i10.Amount>.value(_FakeAmount_7( this, Invocation.method( #estimateFeeFor, @@ -1025,276 +1082,1267 @@ class MockCoinServiceAPI extends _i1.Mock implements _i7.CoinServiceAPI { ], ), )), - ) as _i14.Future<_i10.Amount>); + ) as _i18.Future<_i10.Amount>); @override - _i14.Future generateNewAddress() => (super.noSuchMethod( + _i18.Future generateNewAddress() => (super.noSuchMethod( Invocation.method( #generateNewAddress, [], ), - returnValue: _i14.Future.value(false), - ) as _i14.Future); + returnValue: _i18.Future.value(false), + ) as _i18.Future); @override - _i14.Future updateSentCachedTxData(Map? txData) => + _i18.Future updateSentCachedTxData(Map? txData) => (super.noSuchMethod( Invocation.method( #updateSentCachedTxData, [txData], ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); } -/// A class which mocks [LocaleService]. +/// A class which mocks [FiroWallet]. /// /// See the documentation for Mockito's code generation for more information. -class MockLocaleService extends _i1.Mock implements _i18.LocaleService { - MockLocaleService() { +class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { + MockFiroWallet() { _i1.throwOnMissingStub(this); } @override - String get locale => (super.noSuchMethod( - Invocation.getter(#locale), - returnValue: '', - ) as String); - @override - bool get hasListeners => (super.noSuchMethod( - Invocation.getter(#hasListeners), - returnValue: false, - ) as bool); - @override - _i14.Future loadLocale({bool? notify = true}) => (super.noSuchMethod( - Invocation.method( - #loadLocale, - [], - {#notify: notify}, - ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); - @override - void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #addListener, - [listener], - ), - returnValueForMissingStub: null, - ); - @override - void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( - Invocation.method( - #removeListener, - [listener], + set timer(_i18.Timer? _timer) => super.noSuchMethod( + Invocation.setter( + #timer, + _timer, ), returnValueForMissingStub: null, ); @override - void dispose() => super.noSuchMethod( - Invocation.method( - #dispose, - [], + _i11.TransactionNotificationTracker get txTracker => (super.noSuchMethod( + Invocation.getter(#txTracker), + returnValue: _FakeTransactionNotificationTracker_8( + this, + Invocation.getter(#txTracker), ), - returnValueForMissingStub: null, - ); + ) as _i11.TransactionNotificationTracker); @override - void notifyListeners() => super.noSuchMethod( - Invocation.method( - #notifyListeners, - [], + set txTracker(_i11.TransactionNotificationTracker? _txTracker) => + super.noSuchMethod( + Invocation.setter( + #txTracker, + _txTracker, ), returnValueForMissingStub: null, ); -} - -/// A class which mocks [Prefs]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockPrefs extends _i1.Mock implements _i15.Prefs { - MockPrefs() { - _i1.throwOnMissingStub(this); - } - @override - bool get isInitialized => (super.noSuchMethod( - Invocation.getter(#isInitialized), + bool get refreshMutex => (super.noSuchMethod( + Invocation.getter(#refreshMutex), returnValue: false, ) as bool); @override - int get lastUnlockedTimeout => (super.noSuchMethod( - Invocation.getter(#lastUnlockedTimeout), - returnValue: 0, - ) as int); - @override - set lastUnlockedTimeout(int? lastUnlockedTimeout) => super.noSuchMethod( + set refreshMutex(bool? _refreshMutex) => super.noSuchMethod( Invocation.setter( - #lastUnlockedTimeout, - lastUnlockedTimeout, + #refreshMutex, + _refreshMutex, ), returnValueForMissingStub: null, ); @override - int get lastUnlocked => (super.noSuchMethod( - Invocation.getter(#lastUnlocked), - returnValue: 0, - ) as int); + bool get longMutex => (super.noSuchMethod( + Invocation.getter(#longMutex), + returnValue: false, + ) as bool); @override - set lastUnlocked(int? lastUnlocked) => super.noSuchMethod( + set longMutex(bool? _longMutex) => super.noSuchMethod( Invocation.setter( - #lastUnlocked, - lastUnlocked, + #longMutex, + _longMutex, ), returnValueForMissingStub: null, ); @override - int get currentNotificationId => (super.noSuchMethod( - Invocation.getter(#currentNotificationId), - returnValue: 0, - ) as int); - @override - List get walletIdsSyncOnStartup => (super.noSuchMethod( - Invocation.getter(#walletIdsSyncOnStartup), - returnValue: [], - ) as List); + bool get isActive => (super.noSuchMethod( + Invocation.getter(#isActive), + returnValue: false, + ) as bool); @override - set walletIdsSyncOnStartup(List? walletIdsSyncOnStartup) => - super.noSuchMethod( + set isActive(bool? _isActive) => super.noSuchMethod( Invocation.setter( - #walletIdsSyncOnStartup, - walletIdsSyncOnStartup, + #isActive, + _isActive, ), returnValueForMissingStub: null, ); @override - _i19.SyncingType get syncType => (super.noSuchMethod( - Invocation.getter(#syncType), - returnValue: _i19.SyncingType.currentWalletOnly, - ) as _i19.SyncingType); + bool get shouldAutoSync => (super.noSuchMethod( + Invocation.getter(#shouldAutoSync), + returnValue: false, + ) as bool); @override - set syncType(_i19.SyncingType? syncType) => super.noSuchMethod( + set shouldAutoSync(bool? shouldAutoSync) => super.noSuchMethod( Invocation.setter( - #syncType, - syncType, + #shouldAutoSync, + shouldAutoSync, ), returnValueForMissingStub: null, ); @override - bool get wifiOnly => (super.noSuchMethod( - Invocation.getter(#wifiOnly), - returnValue: false, - ) as bool); - @override - set wifiOnly(bool? wifiOnly) => super.noSuchMethod( + set isFavorite(bool? markFavorite) => super.noSuchMethod( Invocation.setter( - #wifiOnly, - wifiOnly, + #isFavorite, + markFavorite, ), returnValueForMissingStub: null, ); @override - bool get showFavoriteWallets => (super.noSuchMethod( - Invocation.getter(#showFavoriteWallets), + bool get isFavorite => (super.noSuchMethod( + Invocation.getter(#isFavorite), returnValue: false, ) as bool); @override - set showFavoriteWallets(bool? showFavoriteWallets) => super.noSuchMethod( - Invocation.setter( - #showFavoriteWallets, - showFavoriteWallets, - ), - returnValueForMissingStub: null, - ); + _i17.Coin get coin => (super.noSuchMethod( + Invocation.getter(#coin), + returnValue: _i17.Coin.bitcoin, + ) as _i17.Coin); @override - String get language => (super.noSuchMethod( - Invocation.getter(#language), + _i18.Future> get mnemonic => (super.noSuchMethod( + Invocation.getter(#mnemonic), + returnValue: _i18.Future>.value([]), + ) as _i18.Future>); + @override + _i18.Future get mnemonicString => (super.noSuchMethod( + Invocation.getter(#mnemonicString), + returnValue: _i18.Future.value(), + ) as _i18.Future); + @override + _i18.Future get mnemonicPassphrase => (super.noSuchMethod( + Invocation.getter(#mnemonicPassphrase), + returnValue: _i18.Future.value(), + ) as _i18.Future); + @override + _i18.Future get maxFee => (super.noSuchMethod( + Invocation.getter(#maxFee), + returnValue: _i18.Future.value(0), + ) as _i18.Future); + @override + _i18.Future<_i8.FeeObject> get fees => (super.noSuchMethod( + Invocation.getter(#fees), + returnValue: _i18.Future<_i8.FeeObject>.value(_FakeFeeObject_5( + this, + Invocation.getter(#fees), + )), + ) as _i18.Future<_i8.FeeObject>); + @override + _i18.Future get currentReceivingAddress => (super.noSuchMethod( + Invocation.getter(#currentReceivingAddress), + returnValue: _i18.Future.value(''), + ) as _i18.Future); + @override + _i18.Future get currentChangeAddress => (super.noSuchMethod( + Invocation.getter(#currentChangeAddress), + returnValue: _i18.Future.value(''), + ) as _i18.Future); + @override + String get walletName => (super.noSuchMethod( + Invocation.getter(#walletName), returnValue: '', ) as String); @override - set language(String? newLanguage) => super.noSuchMethod( + set walletName(String? newName) => super.noSuchMethod( Invocation.setter( - #language, - newLanguage, + #walletName, + newName, ), returnValueForMissingStub: null, ); @override - String get currency => (super.noSuchMethod( - Invocation.getter(#currency), + String get walletId => (super.noSuchMethod( + Invocation.getter(#walletId), returnValue: '', ) as String); @override - set currency(String? newCurrency) => super.noSuchMethod( - Invocation.setter( - #currency, - newCurrency, - ), - returnValueForMissingStub: null, - ); - @override - bool get randomizePIN => (super.noSuchMethod( - Invocation.getter(#randomizePIN), + bool get isConnected => (super.noSuchMethod( + Invocation.getter(#isConnected), returnValue: false, ) as bool); @override - set randomizePIN(bool? randomizePIN) => super.noSuchMethod( - Invocation.setter( - #randomizePIN, - randomizePIN, + _i12.ElectrumX get electrumXClient => (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumX_9( + this, + Invocation.getter(#electrumXClient), ), - returnValueForMissingStub: null, - ); + ) as _i12.ElectrumX); @override - bool get useBiometrics => (super.noSuchMethod( - Invocation.getter(#useBiometrics), + _i13.CachedElectrumX get cachedElectrumXClient => (super.noSuchMethod( + Invocation.getter(#cachedElectrumXClient), + returnValue: _FakeCachedElectrumX_10( + this, + Invocation.getter(#cachedElectrumXClient), + ), + ) as _i13.CachedElectrumX); + @override + bool get isRefreshing => (super.noSuchMethod( + Invocation.getter(#isRefreshing), returnValue: false, ) as bool); @override - set useBiometrics(bool? useBiometrics) => super.noSuchMethod( - Invocation.setter( - #useBiometrics, - useBiometrics, - ), - returnValueForMissingStub: null, - ); - @override - bool get hasPin => (super.noSuchMethod( - Invocation.getter(#hasPin), + bool get hasCalledExit => (super.noSuchMethod( + Invocation.getter(#hasCalledExit), returnValue: false, ) as bool); @override - set hasPin(bool? hasPin) => super.noSuchMethod( - Invocation.setter( - #hasPin, - hasPin, - ), - returnValueForMissingStub: null, - ); + _i18.Future get chainHeight => (super.noSuchMethod( + Invocation.getter(#chainHeight), + returnValue: _i18.Future.value(0), + ) as _i18.Future); @override - int get familiarity => (super.noSuchMethod( - Invocation.getter(#familiarity), + int get storedChainHeight => (super.noSuchMethod( + Invocation.getter(#storedChainHeight), returnValue: 0, ) as int); @override - set familiarity(int? familiarity) => super.noSuchMethod( - Invocation.setter( - #familiarity, - familiarity, + _i9.Balance get balance => (super.noSuchMethod( + Invocation.getter(#balance), + returnValue: _FakeBalance_6( + this, + Invocation.getter(#balance), ), - returnValueForMissingStub: null, - ); - @override - bool get showTestNetCoins => (super.noSuchMethod( - Invocation.getter(#showTestNetCoins), - returnValue: false, - ) as bool); + ) as _i9.Balance); @override - set showTestNetCoins(bool? showTestNetCoins) => super.noSuchMethod( - Invocation.setter( - #showTestNetCoins, - showTestNetCoins, + _i9.Balance get balancePrivate => (super.noSuchMethod( + Invocation.getter(#balancePrivate), + returnValue: _FakeBalance_6( + this, + Invocation.getter(#balancePrivate), ), - returnValueForMissingStub: null, + ) as _i9.Balance); + @override + _i18.Future> get utxos => (super.noSuchMethod( + Invocation.getter(#utxos), + returnValue: _i18.Future>.value(<_i21.UTXO>[]), + ) as _i18.Future>); + @override + _i18.Future> get transactions => (super.noSuchMethod( + Invocation.getter(#transactions), + returnValue: + _i18.Future>.value(<_i21.Transaction>[]), + ) as _i18.Future>); + @override + _i18.Future get xpub => (super.noSuchMethod( + Invocation.getter(#xpub), + returnValue: _i18.Future.value(''), + ) as _i18.Future); + @override + set onIsActiveWalletChanged(void Function(bool)? _onIsActiveWalletChanged) => + super.noSuchMethod( + Invocation.setter( + #onIsActiveWalletChanged, + _onIsActiveWalletChanged, + ), + returnValueForMissingStub: null, + ); + @override + _i14.MainDB get db => (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_11( + this, + Invocation.getter(#db), + ), + ) as _i14.MainDB); + @override + bool validateAddress(String? address) => (super.noSuchMethod( + Invocation.method( + #validateAddress, + [address], + ), + returnValue: false, + ) as bool); + @override + _i18.Future updateSentCachedTxData(Map? txData) => + (super.noSuchMethod( + Invocation.method( + #updateSentCachedTxData, + [txData], + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + _i18.Future testNetworkConnection() => (super.noSuchMethod( + Invocation.method( + #testNetworkConnection, + [], + ), + returnValue: _i18.Future.value(false), + ) as _i18.Future); + @override + void startNetworkAlivePinging() => super.noSuchMethod( + Invocation.method( + #startNetworkAlivePinging, + [], + ), + returnValueForMissingStub: null, + ); + @override + void stopNetworkAlivePinging() => super.noSuchMethod( + Invocation.method( + #stopNetworkAlivePinging, + [], + ), + returnValueForMissingStub: null, + ); + @override + _i18.Future> prepareSendPublic({ + required String? address, + required _i10.Amount? amount, + Map? args, + }) => + (super.noSuchMethod( + Invocation.method( + #prepareSendPublic, + [], + { + #address: address, + #amount: amount, + #args: args, + }, + ), + returnValue: + _i18.Future>.value({}), + ) as _i18.Future>); + @override + _i18.Future confirmSendPublic({dynamic txData}) => + (super.noSuchMethod( + Invocation.method( + #confirmSendPublic, + [], + {#txData: txData}, + ), + returnValue: _i18.Future.value(''), + ) as _i18.Future); + @override + _i18.Future> prepareSend({ + required String? address, + required _i10.Amount? amount, + Map? args, + }) => + (super.noSuchMethod( + Invocation.method( + #prepareSend, + [], + { + #address: address, + #amount: amount, + #args: args, + }, + ), + returnValue: + _i18.Future>.value({}), + ) as _i18.Future>); + @override + _i18.Future confirmSend({required Map? txData}) => + (super.noSuchMethod( + Invocation.method( + #confirmSend, + [], + {#txData: txData}, + ), + returnValue: _i18.Future.value(''), + ) as _i18.Future); + @override + int estimateTxFee({ + required int? vSize, + required int? feeRatePerKB, + }) => + (super.noSuchMethod( + Invocation.method( + #estimateTxFee, + [], + { + #vSize: vSize, + #feeRatePerKB: feeRatePerKB, + }, + ), + returnValue: 0, + ) as int); + @override + dynamic coinSelection( + int? satoshiAmountToSend, + int? selectedTxFeeRate, + String? _recipientAddress, + bool? isSendAll, { + int? additionalOutputs = 0, + List<_i21.UTXO>? utxos, + }) => + super.noSuchMethod(Invocation.method( + #coinSelection, + [ + satoshiAmountToSend, + selectedTxFeeRate, + _recipientAddress, + isSendAll, + ], + { + #additionalOutputs: additionalOutputs, + #utxos: utxos, + }, + )); + @override + _i18.Future> fetchBuildTxData( + List<_i21.UTXO>? utxosToUse) => + (super.noSuchMethod( + Invocation.method( + #fetchBuildTxData, + [utxosToUse], + ), + returnValue: + _i18.Future>.value(<_i23.SigningData>[]), + ) as _i18.Future>); + @override + _i18.Future> buildTransaction({ + required List<_i23.SigningData>? utxoSigningData, + required List? recipients, + required List? satoshiAmounts, + }) => + (super.noSuchMethod( + Invocation.method( + #buildTransaction, + [], + { + #utxoSigningData: utxoSigningData, + #recipients: recipients, + #satoshiAmounts: satoshiAmounts, + }, + ), + returnValue: + _i18.Future>.value({}), + ) as _i18.Future>); + @override + _i18.Future updateNode(bool? shouldRefresh) => (super.noSuchMethod( + Invocation.method( + #updateNode, + [shouldRefresh], + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + _i18.Future initializeNew() => (super.noSuchMethod( + Invocation.method( + #initializeNew, + [], + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + _i18.Future initializeExisting() => (super.noSuchMethod( + Invocation.method( + #initializeExisting, + [], + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + _i18.Future refreshIfThereIsNewData() => (super.noSuchMethod( + Invocation.method( + #refreshIfThereIsNewData, + [], + ), + returnValue: _i18.Future.value(false), + ) as _i18.Future); + @override + _i18.Future getAllTxsToWatch() => (super.noSuchMethod( + Invocation.method( + #getAllTxsToWatch, + [], + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + _i18.Future refresh() => (super.noSuchMethod( + Invocation.method( + #refresh, + [], + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + List> getLelantusCoinMap() => + (super.noSuchMethod( + Invocation.method( + #getLelantusCoinMap, + [], + ), + returnValue: >[], + ) as List>); + @override + _i18.Future anonymizeAllPublicFunds() => (super.noSuchMethod( + Invocation.method( + #anonymizeAllPublicFunds, + [], + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + _i18.Future>> createMintsFromAmount(int? total) => + (super.noSuchMethod( + Invocation.method( + #createMintsFromAmount, + [total], + ), + returnValue: _i18.Future>>.value( + >[]), + ) as _i18.Future>>); + @override + _i18.Future submitHexToNetwork(String? hex) => (super.noSuchMethod( + Invocation.method( + #submitHexToNetwork, + [hex], + ), + returnValue: _i18.Future.value(''), + ) as _i18.Future); + @override + _i18.Future> buildMintTransaction( + List<_i21.UTXO>? utxosToUse, + int? satoshisPerRecipient, + List>? mintsMap, + ) => + (super.noSuchMethod( + Invocation.method( + #buildMintTransaction, + [ + utxosToUse, + satoshisPerRecipient, + mintsMap, + ], + ), + returnValue: + _i18.Future>.value({}), + ) as _i18.Future>); + @override + _i18.Future checkReceivingAddressForTransactions() => + (super.noSuchMethod( + Invocation.method( + #checkReceivingAddressForTransactions, + [], + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + _i18.Future checkChangeAddressForTransactions() => (super.noSuchMethod( + Invocation.method( + #checkChangeAddressForTransactions, + [], + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + _i18.Future fullRescan( + int? maxUnusedAddressGap, + int? maxNumberOfIndexesToCheck, + ) => + (super.noSuchMethod( + Invocation.method( + #fullRescan, + [ + maxUnusedAddressGap, + maxNumberOfIndexesToCheck, + ], + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + _i18.Future recoverFromMnemonic({ + required String? mnemonic, + String? mnemonicPassphrase, + required int? maxUnusedAddressGap, + required int? maxNumberOfIndexesToCheck, + required int? height, + }) => + (super.noSuchMethod( + Invocation.method( + #recoverFromMnemonic, + [], + { + #mnemonic: mnemonic, + #mnemonicPassphrase: mnemonicPassphrase, + #maxUnusedAddressGap: maxUnusedAddressGap, + #maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck, + #height: height, + }, + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + _i18.Future> getSetDataMap(int? latestSetId) => + (super.noSuchMethod( + Invocation.method( + #getSetDataMap, + [latestSetId], + ), + returnValue: _i18.Future>.value({}), + ) as _i18.Future>); + @override + _i18.Future getTransactionCacheEarly(List? allAddresses) => + (super.noSuchMethod( + Invocation.method( + #getTransactionCacheEarly, + [allAddresses], + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + _i18.Future>> fetchAnonymitySets() => + (super.noSuchMethod( + Invocation.method( + #fetchAnonymitySets, + [], + ), + returnValue: _i18.Future>>.value( + >[]), + ) as _i18.Future>>); + @override + _i18.Future getLatestSetId() => (super.noSuchMethod( + Invocation.method( + #getLatestSetId, + [], + ), + returnValue: _i18.Future.value(0), + ) as _i18.Future); + @override + _i18.Future> getUsedCoinSerials() => (super.noSuchMethod( + Invocation.method( + #getUsedCoinSerials, + [], + ), + returnValue: _i18.Future>.value([]), + ) as _i18.Future>); + @override + _i18.Future exit() => (super.noSuchMethod( + Invocation.method( + #exit, + [], + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + _i18.Future getCoinsToJoinSplit(int? required) => + (super.noSuchMethod( + Invocation.method( + #getCoinsToJoinSplit, + [required], + ), + returnValue: _i18.Future.value(), + ) as _i18.Future); + @override + _i18.Future estimateJoinSplitFee(int? spendAmount) => + (super.noSuchMethod( + Invocation.method( + #estimateJoinSplitFee, + [spendAmount], + ), + returnValue: _i18.Future.value(0), + ) as _i18.Future); + @override + _i18.Future<_i10.Amount> estimateFeeFor( + _i10.Amount? amount, + int? feeRate, + ) => + (super.noSuchMethod( + Invocation.method( + #estimateFeeFor, + [ + amount, + feeRate, + ], + ), + returnValue: _i18.Future<_i10.Amount>.value(_FakeAmount_7( + this, + Invocation.method( + #estimateFeeFor, + [ + amount, + feeRate, + ], + ), + )), + ) as _i18.Future<_i10.Amount>); + @override + _i18.Future<_i10.Amount> estimateFeeForPublic( + _i10.Amount? amount, + int? feeRate, + ) => + (super.noSuchMethod( + Invocation.method( + #estimateFeeForPublic, + [ + amount, + feeRate, + ], + ), + returnValue: _i18.Future<_i10.Amount>.value(_FakeAmount_7( + this, + Invocation.method( + #estimateFeeForPublic, + [ + amount, + feeRate, + ], + ), + )), + ) as _i18.Future<_i10.Amount>); + @override + _i10.Amount roughFeeEstimate( + int? inputCount, + int? outputCount, + int? feeRatePerKB, + ) => + (super.noSuchMethod( + Invocation.method( + #roughFeeEstimate, + [ + inputCount, + outputCount, + feeRatePerKB, + ], + ), + returnValue: _FakeAmount_7( + this, + Invocation.method( + #roughFeeEstimate, + [ + inputCount, + outputCount, + feeRatePerKB, + ], + ), + ), + ) as _i10.Amount); + @override + _i18.Future<_i10.Amount> sweepAllEstimate(int? feeRate) => + (super.noSuchMethod( + Invocation.method( + #sweepAllEstimate, + [feeRate], + ), + returnValue: _i18.Future<_i10.Amount>.value(_FakeAmount_7( + this, + Invocation.method( + #sweepAllEstimate, + [feeRate], + ), + )), + ) as _i18.Future<_i10.Amount>); + @override + _i18.Future>> fastFetch( + List? allTxHashes) => + (super.noSuchMethod( + Invocation.method( + #fastFetch, + [allTxHashes], + ), + returnValue: _i18.Future>>.value( + >[]), + ) as _i18.Future>>); + @override + _i18.Future> getJMintTransactions( + _i13.CachedElectrumX? cachedClient, + List? transactions, + _i17.Coin? coin, + ) => + (super.noSuchMethod( + Invocation.method( + #getJMintTransactions, + [ + cachedClient, + transactions, + coin, + ], + ), + returnValue: _i18.Future>.value( + <_i21.Address, _i21.Transaction>{}), + ) as _i18.Future>); + @override + _i18.Future generateNewAddress() => (super.noSuchMethod( + Invocation.method( + #generateNewAddress, + [], + ), + returnValue: _i18.Future.value(false), + ) as _i18.Future); + @override + _i10.Amount availablePrivateBalance() => (super.noSuchMethod( + Invocation.method( + #availablePrivateBalance, + [], + ), + returnValue: _FakeAmount_7( + this, + Invocation.method( + #availablePrivateBalance, + [], + ), + ), + ) as _i10.Amount); + @override + _i10.Amount availablePublicBalance() => (super.noSuchMethod( + Invocation.method( + #availablePublicBalance, + [], + ), + returnValue: _FakeAmount_7( + this, + Invocation.method( + #availablePublicBalance, + [], + ), + ), + ) as _i10.Amount); + @override + void initCache( + String? walletId, + _i17.Coin? coin, + ) => + super.noSuchMethod( + Invocation.method( + #initCache, + [ + walletId, + coin, + ], + ), + returnValueForMissingStub: null, + ); + @override + _i18.Future updateCachedId(String? id) => (super.noSuchMethod( + Invocation.method( + #updateCachedId, + [id], + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + int getCachedChainHeight() => (super.noSuchMethod( + Invocation.method( + #getCachedChainHeight, + [], + ), + returnValue: 0, + ) as int); + @override + _i18.Future updateCachedChainHeight(int? height) => (super.noSuchMethod( + Invocation.method( + #updateCachedChainHeight, + [height], + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + bool getCachedIsFavorite() => (super.noSuchMethod( + Invocation.method( + #getCachedIsFavorite, + [], + ), + returnValue: false, + ) as bool); + @override + _i18.Future updateCachedIsFavorite(bool? isFavorite) => + (super.noSuchMethod( + Invocation.method( + #updateCachedIsFavorite, + [isFavorite], + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + _i9.Balance getCachedBalance() => (super.noSuchMethod( + Invocation.method( + #getCachedBalance, + [], + ), + returnValue: _FakeBalance_6( + this, + Invocation.method( + #getCachedBalance, + [], + ), + ), + ) as _i9.Balance); + @override + _i18.Future updateCachedBalance(_i9.Balance? balance) => + (super.noSuchMethod( + Invocation.method( + #updateCachedBalance, + [balance], + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + _i9.Balance getCachedBalanceSecondary() => (super.noSuchMethod( + Invocation.method( + #getCachedBalanceSecondary, + [], + ), + returnValue: _FakeBalance_6( + this, + Invocation.method( + #getCachedBalanceSecondary, + [], + ), + ), + ) as _i9.Balance); + @override + _i18.Future updateCachedBalanceSecondary(_i9.Balance? balance) => + (super.noSuchMethod( + Invocation.method( + #updateCachedBalanceSecondary, + [balance], + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + List getWalletTokenContractAddresses() => (super.noSuchMethod( + Invocation.method( + #getWalletTokenContractAddresses, + [], + ), + returnValue: [], + ) as List); + @override + _i18.Future updateWalletTokenContractAddresses( + List? contractAddresses) => + (super.noSuchMethod( + Invocation.method( + #updateWalletTokenContractAddresses, + [contractAddresses], + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + void initWalletDB({_i14.MainDB? mockableOverride}) => super.noSuchMethod( + Invocation.method( + #initWalletDB, + [], + {#mockableOverride: mockableOverride}, + ), + returnValueForMissingStub: null, + ); + @override + void initFiroHive(String? walletId) => super.noSuchMethod( + Invocation.method( + #initFiroHive, + [walletId], + ), + returnValueForMissingStub: null, + ); + @override + _i18.Future firoUpdateJIndex(List? jIndex) => + (super.noSuchMethod( + Invocation.method( + #firoUpdateJIndex, + [jIndex], + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + _i18.Future firoUpdateLelantusCoins(List? lelantusCoins) => + (super.noSuchMethod( + Invocation.method( + #firoUpdateLelantusCoins, + [lelantusCoins], + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + int firoGetMintIndex() => (super.noSuchMethod( + Invocation.method( + #firoGetMintIndex, + [], + ), + returnValue: 0, + ) as int); + @override + _i18.Future firoUpdateMintIndex(int? mintIndex) => (super.noSuchMethod( + Invocation.method( + #firoUpdateMintIndex, + [mintIndex], + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); +} + +/// A class which mocks [LocaleService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockLocaleService extends _i1.Mock implements _i24.LocaleService { + MockLocaleService() { + _i1.throwOnMissingStub(this); + } + + @override + String get locale => (super.noSuchMethod( + Invocation.getter(#locale), + returnValue: '', + ) as String); + @override + bool get hasListeners => (super.noSuchMethod( + Invocation.getter(#hasListeners), + returnValue: false, + ) as bool); + @override + _i18.Future loadLocale({bool? notify = true}) => (super.noSuchMethod( + Invocation.method( + #loadLocale, + [], + {#notify: notify}, + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + void addListener(_i20.VoidCallback? listener) => super.noSuchMethod( + Invocation.method( + #addListener, + [listener], + ), + returnValueForMissingStub: null, + ); + @override + void removeListener(_i20.VoidCallback? listener) => super.noSuchMethod( + Invocation.method( + #removeListener, + [listener], + ), + returnValueForMissingStub: null, + ); + @override + void dispose() => super.noSuchMethod( + Invocation.method( + #dispose, + [], + ), + returnValueForMissingStub: null, + ); + @override + void notifyListeners() => super.noSuchMethod( + Invocation.method( + #notifyListeners, + [], + ), + returnValueForMissingStub: null, + ); +} + +/// A class which mocks [Prefs]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockPrefs extends _i1.Mock implements _i19.Prefs { + MockPrefs() { + _i1.throwOnMissingStub(this); + } + + @override + bool get isInitialized => (super.noSuchMethod( + Invocation.getter(#isInitialized), + returnValue: false, + ) as bool); + @override + int get lastUnlockedTimeout => (super.noSuchMethod( + Invocation.getter(#lastUnlockedTimeout), + returnValue: 0, + ) as int); + @override + set lastUnlockedTimeout(int? lastUnlockedTimeout) => super.noSuchMethod( + Invocation.setter( + #lastUnlockedTimeout, + lastUnlockedTimeout, + ), + returnValueForMissingStub: null, + ); + @override + int get lastUnlocked => (super.noSuchMethod( + Invocation.getter(#lastUnlocked), + returnValue: 0, + ) as int); + @override + set lastUnlocked(int? lastUnlocked) => super.noSuchMethod( + Invocation.setter( + #lastUnlocked, + lastUnlocked, + ), + returnValueForMissingStub: null, + ); + @override + int get currentNotificationId => (super.noSuchMethod( + Invocation.getter(#currentNotificationId), + returnValue: 0, + ) as int); + @override + List get walletIdsSyncOnStartup => (super.noSuchMethod( + Invocation.getter(#walletIdsSyncOnStartup), + returnValue: [], + ) as List); + @override + set walletIdsSyncOnStartup(List? walletIdsSyncOnStartup) => + super.noSuchMethod( + Invocation.setter( + #walletIdsSyncOnStartup, + walletIdsSyncOnStartup, + ), + returnValueForMissingStub: null, + ); + @override + _i25.SyncingType get syncType => (super.noSuchMethod( + Invocation.getter(#syncType), + returnValue: _i25.SyncingType.currentWalletOnly, + ) as _i25.SyncingType); + @override + set syncType(_i25.SyncingType? syncType) => super.noSuchMethod( + Invocation.setter( + #syncType, + syncType, + ), + returnValueForMissingStub: null, + ); + @override + bool get wifiOnly => (super.noSuchMethod( + Invocation.getter(#wifiOnly), + returnValue: false, + ) as bool); + @override + set wifiOnly(bool? wifiOnly) => super.noSuchMethod( + Invocation.setter( + #wifiOnly, + wifiOnly, + ), + returnValueForMissingStub: null, + ); + @override + bool get showFavoriteWallets => (super.noSuchMethod( + Invocation.getter(#showFavoriteWallets), + returnValue: false, + ) as bool); + @override + set showFavoriteWallets(bool? showFavoriteWallets) => super.noSuchMethod( + Invocation.setter( + #showFavoriteWallets, + showFavoriteWallets, + ), + returnValueForMissingStub: null, + ); + @override + String get language => (super.noSuchMethod( + Invocation.getter(#language), + returnValue: '', + ) as String); + @override + set language(String? newLanguage) => super.noSuchMethod( + Invocation.setter( + #language, + newLanguage, + ), + returnValueForMissingStub: null, + ); + @override + String get currency => (super.noSuchMethod( + Invocation.getter(#currency), + returnValue: '', + ) as String); + @override + set currency(String? newCurrency) => super.noSuchMethod( + Invocation.setter( + #currency, + newCurrency, + ), + returnValueForMissingStub: null, + ); + @override + bool get randomizePIN => (super.noSuchMethod( + Invocation.getter(#randomizePIN), + returnValue: false, + ) as bool); + @override + set randomizePIN(bool? randomizePIN) => super.noSuchMethod( + Invocation.setter( + #randomizePIN, + randomizePIN, + ), + returnValueForMissingStub: null, + ); + @override + bool get useBiometrics => (super.noSuchMethod( + Invocation.getter(#useBiometrics), + returnValue: false, + ) as bool); + @override + set useBiometrics(bool? useBiometrics) => super.noSuchMethod( + Invocation.setter( + #useBiometrics, + useBiometrics, + ), + returnValueForMissingStub: null, + ); + @override + bool get hasPin => (super.noSuchMethod( + Invocation.getter(#hasPin), + returnValue: false, + ) as bool); + @override + set hasPin(bool? hasPin) => super.noSuchMethod( + Invocation.setter( + #hasPin, + hasPin, + ), + returnValueForMissingStub: null, + ); + @override + int get familiarity => (super.noSuchMethod( + Invocation.getter(#familiarity), + returnValue: 0, + ) as int); + @override + set familiarity(int? familiarity) => super.noSuchMethod( + Invocation.setter( + #familiarity, + familiarity, + ), + returnValueForMissingStub: null, + ); + @override + bool get showTestNetCoins => (super.noSuchMethod( + Invocation.getter(#showTestNetCoins), + returnValue: false, + ) as bool); + @override + set showTestNetCoins(bool? showTestNetCoins) => super.noSuchMethod( + Invocation.setter( + #showTestNetCoins, + showTestNetCoins, + ), + returnValueForMissingStub: null, ); @override bool get isAutoBackupEnabled => (super.noSuchMethod( @@ -1318,12 +2366,12 @@ class MockPrefs extends _i1.Mock implements _i15.Prefs { returnValueForMissingStub: null, ); @override - _i20.BackupFrequencyType get backupFrequencyType => (super.noSuchMethod( + _i26.BackupFrequencyType get backupFrequencyType => (super.noSuchMethod( Invocation.getter(#backupFrequencyType), - returnValue: _i20.BackupFrequencyType.everyTenMinutes, - ) as _i20.BackupFrequencyType); + returnValue: _i26.BackupFrequencyType.everyTenMinutes, + ) as _i26.BackupFrequencyType); @override - set backupFrequencyType(_i20.BackupFrequencyType? backupFrequencyType) => + set backupFrequencyType(_i26.BackupFrequencyType? backupFrequencyType) => super.noSuchMethod( Invocation.setter( #backupFrequencyType, @@ -1461,51 +2509,51 @@ class MockPrefs extends _i1.Mock implements _i15.Prefs { returnValue: false, ) as bool); @override - _i14.Future init() => (super.noSuchMethod( + _i18.Future init() => (super.noSuchMethod( Invocation.method( #init, [], ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override - _i14.Future incrementCurrentNotificationIndex() => (super.noSuchMethod( + _i18.Future incrementCurrentNotificationIndex() => (super.noSuchMethod( Invocation.method( #incrementCurrentNotificationIndex, [], ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override - _i14.Future isExternalCallsSet() => (super.noSuchMethod( + _i18.Future isExternalCallsSet() => (super.noSuchMethod( Invocation.method( #isExternalCallsSet, [], ), - returnValue: _i14.Future.value(false), - ) as _i14.Future); + returnValue: _i18.Future.value(false), + ) as _i18.Future); @override - _i14.Future saveUserID(String? userId) => (super.noSuchMethod( + _i18.Future saveUserID(String? userId) => (super.noSuchMethod( Invocation.method( #saveUserID, [userId], ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override - _i14.Future saveSignupEpoch(int? signupEpoch) => (super.noSuchMethod( + _i18.Future saveSignupEpoch(int? signupEpoch) => (super.noSuchMethod( Invocation.method( #saveSignupEpoch, [signupEpoch], ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override - void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i20.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -1513,7 +2561,7 @@ class MockPrefs extends _i1.Mock implements _i15.Prefs { returnValueForMissingStub: null, ); @override - void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i20.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -1541,7 +2589,7 @@ class MockPrefs extends _i1.Mock implements _i15.Prefs { /// A class which mocks [PriceService]. /// /// See the documentation for Mockito's code generation for more information. -class MockPriceService extends _i1.Mock implements _i21.PriceService { +class MockPriceService extends _i1.Mock implements _i27.PriceService { MockPriceService() { _i1.throwOnMissingStub(this); } @@ -1560,9 +2608,14 @@ class MockPriceService extends _i1.Mock implements _i21.PriceService { returnValueForMissingStub: null, ); @override + Set get tokenContractAddressesToCheck => (super.noSuchMethod( + Invocation.getter(#tokenContractAddressesToCheck), + returnValue: {}, + ) as Set); + @override Duration get updateInterval => (super.noSuchMethod( Invocation.getter(#updateInterval), - returnValue: _FakeDuration_8( + returnValue: _FakeDuration_12( this, Invocation.getter(#updateInterval), ), @@ -1573,29 +2626,44 @@ class MockPriceService extends _i1.Mock implements _i21.PriceService { returnValue: false, ) as bool); @override - _i11.Tuple2<_i22.Decimal, double> getPrice(_i13.Coin? coin) => + _i15.Tuple2<_i28.Decimal, double> getPrice(_i17.Coin? coin) => (super.noSuchMethod( Invocation.method( #getPrice, [coin], ), - returnValue: _FakeTuple2_9<_i22.Decimal, double>( + returnValue: _FakeTuple2_13<_i28.Decimal, double>( this, Invocation.method( #getPrice, [coin], ), ), - ) as _i11.Tuple2<_i22.Decimal, double>); + ) as _i15.Tuple2<_i28.Decimal, double>); + @override + _i15.Tuple2<_i28.Decimal, double> getTokenPrice(String? contractAddress) => + (super.noSuchMethod( + Invocation.method( + #getTokenPrice, + [contractAddress], + ), + returnValue: _FakeTuple2_13<_i28.Decimal, double>( + this, + Invocation.method( + #getTokenPrice, + [contractAddress], + ), + ), + ) as _i15.Tuple2<_i28.Decimal, double>); @override - _i14.Future updatePrice() => (super.noSuchMethod( + _i18.Future updatePrice() => (super.noSuchMethod( Invocation.method( #updatePrice, [], ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override void cancel() => super.noSuchMethod( Invocation.method( @@ -1621,7 +2689,7 @@ class MockPriceService extends _i1.Mock implements _i21.PriceService { returnValueForMissingStub: null, ); @override - void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i20.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -1629,7 +2697,7 @@ class MockPriceService extends _i1.Mock implements _i21.PriceService { returnValueForMissingStub: null, ); @override - void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i20.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -1649,7 +2717,7 @@ class MockPriceService extends _i1.Mock implements _i21.PriceService { /// A class which mocks [NotesService]. /// /// See the documentation for Mockito's code generation for more information. -class MockNotesService extends _i1.Mock implements _i23.NotesService { +class MockNotesService extends _i1.Mock implements _i29.NotesService { MockNotesService() { _i1.throwOnMissingStub(this); } @@ -1665,35 +2733,35 @@ class MockNotesService extends _i1.Mock implements _i23.NotesService { returnValue: {}, ) as Map); @override - _i14.Future> get notes => (super.noSuchMethod( + _i18.Future> get notes => (super.noSuchMethod( Invocation.getter(#notes), - returnValue: _i14.Future>.value({}), - ) as _i14.Future>); + returnValue: _i18.Future>.value({}), + ) as _i18.Future>); @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), returnValue: false, ) as bool); @override - _i14.Future> search(String? text) => (super.noSuchMethod( + _i18.Future> search(String? text) => (super.noSuchMethod( Invocation.method( #search, [text], ), - returnValue: _i14.Future>.value({}), - ) as _i14.Future>); + returnValue: _i18.Future>.value({}), + ) as _i18.Future>); @override - _i14.Future getNoteFor({required String? txid}) => + _i18.Future getNoteFor({required String? txid}) => (super.noSuchMethod( Invocation.method( #getNoteFor, [], {#txid: txid}, ), - returnValue: _i14.Future.value(''), - ) as _i14.Future); + returnValue: _i18.Future.value(''), + ) as _i18.Future); @override - _i14.Future editOrAddNote({ + _i18.Future editOrAddNote({ required String? txid, required String? note, }) => @@ -1706,21 +2774,21 @@ class MockNotesService extends _i1.Mock implements _i23.NotesService { #note: note, }, ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override - _i14.Future deleteNote({required String? txid}) => (super.noSuchMethod( + _i18.Future deleteNote({required String? txid}) => (super.noSuchMethod( Invocation.method( #deleteNote, [], {#txid: txid}, ), - returnValue: _i14.Future.value(), - returnValueForMissingStub: _i14.Future.value(), - ) as _i14.Future); + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); @override - void addListener(_i16.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i20.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -1728,7 +2796,7 @@ class MockNotesService extends _i1.Mock implements _i23.NotesService { returnValueForMissingStub: null, ); @override - void removeListener(_i16.VoidCallback? listener) => super.noSuchMethod( + void removeListener(_i20.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #removeListener, [listener], @@ -1752,3 +2820,102 @@ class MockNotesService extends _i1.Mock implements _i23.NotesService { returnValueForMissingStub: null, ); } + +/// A class which mocks [ThemeService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockThemeService extends _i1.Mock implements _i30.ThemeService { + MockThemeService() { + _i1.throwOnMissingStub(this); + } + + @override + _i14.MainDB get db => (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_11( + this, + Invocation.getter(#db), + ), + ) as _i14.MainDB); + @override + List<_i31.StackTheme> get installedThemes => (super.noSuchMethod( + Invocation.getter(#installedThemes), + returnValue: <_i31.StackTheme>[], + ) as List<_i31.StackTheme>); + @override + void init(_i14.MainDB? db) => super.noSuchMethod( + Invocation.method( + #init, + [db], + ), + returnValueForMissingStub: null, + ); + @override + _i18.Future install({required _i32.Uint8List? themeArchiveData}) => + (super.noSuchMethod( + Invocation.method( + #install, + [], + {#themeArchiveData: themeArchiveData}, + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + _i18.Future remove({required String? themeId}) => (super.noSuchMethod( + Invocation.method( + #remove, + [], + {#themeId: themeId}, + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + _i18.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override + _i18.Future verifyInstalled({required String? themeId}) => + (super.noSuchMethod( + Invocation.method( + #verifyInstalled, + [], + {#themeId: themeId}, + ), + returnValue: _i18.Future.value(false), + ) as _i18.Future); + @override + _i18.Future> fetchThemes() => + (super.noSuchMethod( + Invocation.method( + #fetchThemes, + [], + ), + returnValue: _i18.Future>.value( + <_i30.StackThemeMetaData>[]), + ) as _i18.Future>); + @override + _i18.Future<_i32.Uint8List> fetchTheme( + {required _i30.StackThemeMetaData? themeMetaData}) => + (super.noSuchMethod( + Invocation.method( + #fetchTheme, + [], + {#themeMetaData: themeMetaData}, + ), + returnValue: _i18.Future<_i32.Uint8List>.value(_i32.Uint8List(0)), + ) as _i18.Future<_i32.Uint8List>); + @override + _i31.StackTheme? getTheme({required String? themeId}) => + (super.noSuchMethod(Invocation.method( + #getTheme, + [], + {#themeId: themeId}, + )) as _i31.StackTheme?); +} diff --git a/test/widget_tests/wallet_card_test.mocks.dart b/test/widget_tests/wallet_card_test.mocks.dart new file mode 100644 index 000000000..af955c477 --- /dev/null +++ b/test/widget_tests/wallet_card_test.mocks.dart @@ -0,0 +1,1861 @@ +// Mocks generated by Mockito 5.3.2 from annotations +// in stackwallet/test/widget_tests/wallet_card_test.dart. +// Do not manually edit this file. + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i21; +import 'dart:typed_data' as _i28; +import 'dart:ui' as _i23; + +import 'package:bip32/bip32.dart' as _i16; +import 'package:bip47/bip47.dart' as _i18; +import 'package:bitcoindart/bitcoindart.dart' as _i13; +import 'package:flutter/foundation.dart' as _i4; +import 'package:flutter_riverpod/flutter_riverpod.dart' as _i5; +import 'package:mockito/mockito.dart' as _i1; +import 'package:stackwallet/db/isar/main_db.dart' as _i12; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i10; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i9; +import 'package:stackwallet/models/balance.dart' as _i11; +import 'package:stackwallet/models/isar/models/isar_models.dart' as _i17; +import 'package:stackwallet/models/isar/stack_theme.dart' as _i31; +import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i8; +import 'package:stackwallet/models/signing_data.dart' as _i26; +import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart' as _i24; +import 'package:stackwallet/services/coins/manager.dart' as _i6; +import 'package:stackwallet/services/locale_service.dart' as _i29; +import 'package:stackwallet/services/node_service.dart' as _i3; +import 'package:stackwallet/services/transaction_notification_tracker.dart' + as _i7; +import 'package:stackwallet/services/wallets.dart' as _i19; +import 'package:stackwallet/services/wallets_service.dart' as _i2; +import 'package:stackwallet/themes/theme_service.dart' as _i30; +import 'package:stackwallet/utilities/amount/amount.dart' as _i14; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i20; +import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart' as _i25; +import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart' + as _i27; +import 'package:stackwallet/utilities/prefs.dart' as _i22; +import 'package:tuple/tuple.dart' as _i15; + +// 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 + +class _FakeWalletsService_0 extends _i1.SmartFake + implements _i2.WalletsService { + _FakeWalletsService_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeNodeService_1 extends _i1.SmartFake implements _i3.NodeService { + _FakeNodeService_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeChangeNotifierProvider_2 + extends _i1.SmartFake implements _i5.ChangeNotifierProvider { + _FakeChangeNotifierProvider_2( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeManager_3 extends _i1.SmartFake implements _i6.Manager { + _FakeManager_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeTransactionNotificationTracker_4 extends _i1.SmartFake + implements _i7.TransactionNotificationTracker { + _FakeTransactionNotificationTracker_4( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeFeeObject_5 extends _i1.SmartFake implements _i8.FeeObject { + _FakeFeeObject_5( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeElectrumX_6 extends _i1.SmartFake implements _i9.ElectrumX { + _FakeElectrumX_6( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeCachedElectrumX_7 extends _i1.SmartFake + implements _i10.CachedElectrumX { + _FakeCachedElectrumX_7( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeBalance_8 extends _i1.SmartFake implements _i11.Balance { + _FakeBalance_8( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeMainDB_9 extends _i1.SmartFake implements _i12.MainDB { + _FakeMainDB_9( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeNetworkType_10 extends _i1.SmartFake implements _i13.NetworkType { + _FakeNetworkType_10( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeElectrumXNode_11 extends _i1.SmartFake implements _i9.ElectrumXNode { + _FakeElectrumXNode_11( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeAmount_12 extends _i1.SmartFake implements _i14.Amount { + _FakeAmount_12( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeTuple2_13 extends _i1.SmartFake + implements _i15.Tuple2 { + _FakeTuple2_13( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeBIP32_14 extends _i1.SmartFake implements _i16.BIP32 { + _FakeBIP32_14( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeAddress_15 extends _i1.SmartFake implements _i17.Address { + _FakeAddress_15( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakePaymentCode_16 extends _i1.SmartFake implements _i18.PaymentCode { + _FakePaymentCode_16( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [Wallets]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockWallets extends _i1.Mock implements _i19.Wallets { + MockWallets() { + _i1.throwOnMissingStub(this); + } + + @override + _i2.WalletsService get walletsService => (super.noSuchMethod( + Invocation.getter(#walletsService), + returnValue: _FakeWalletsService_0( + this, + Invocation.getter(#walletsService), + ), + ) as _i2.WalletsService); + @override + set walletsService(_i2.WalletsService? _walletsService) => super.noSuchMethod( + Invocation.setter( + #walletsService, + _walletsService, + ), + returnValueForMissingStub: null, + ); + @override + _i3.NodeService get nodeService => (super.noSuchMethod( + Invocation.getter(#nodeService), + returnValue: _FakeNodeService_1( + this, + Invocation.getter(#nodeService), + ), + ) as _i3.NodeService); + @override + set nodeService(_i3.NodeService? _nodeService) => super.noSuchMethod( + Invocation.setter( + #nodeService, + _nodeService, + ), + returnValueForMissingStub: null, + ); + @override + bool get hasWallets => (super.noSuchMethod( + Invocation.getter(#hasWallets), + returnValue: false, + ) as bool); + @override + List<_i5.ChangeNotifierProvider<_i6.Manager>> get managerProviders => + (super.noSuchMethod( + Invocation.getter(#managerProviders), + returnValue: <_i5.ChangeNotifierProvider<_i6.Manager>>[], + ) as List<_i5.ChangeNotifierProvider<_i6.Manager>>); + @override + List<_i6.Manager> get managers => (super.noSuchMethod( + Invocation.getter(#managers), + returnValue: <_i6.Manager>[], + ) as List<_i6.Manager>); + @override + bool get hasListeners => (super.noSuchMethod( + Invocation.getter(#hasListeners), + returnValue: false, + ) as bool); + @override + void dispose() => super.noSuchMethod( + Invocation.method( + #dispose, + [], + ), + returnValueForMissingStub: null, + ); + @override + List getWalletIdsFor({required _i20.Coin? coin}) => + (super.noSuchMethod( + Invocation.method( + #getWalletIdsFor, + [], + {#coin: coin}, + ), + returnValue: [], + ) as List); + @override + List<_i15.Tuple2<_i20.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>> + getManagerProvidersByCoin() => (super.noSuchMethod( + Invocation.method( + #getManagerProvidersByCoin, + [], + ), + returnValue: < + _i15.Tuple2<_i20.Coin, + List<_i5.ChangeNotifierProvider<_i6.Manager>>>>[], + ) as List< + _i15.Tuple2<_i20.Coin, + List<_i5.ChangeNotifierProvider<_i6.Manager>>>>); + @override + List<_i5.ChangeNotifierProvider<_i6.Manager>> getManagerProvidersForCoin( + _i20.Coin? coin) => + (super.noSuchMethod( + Invocation.method( + #getManagerProvidersForCoin, + [coin], + ), + returnValue: <_i5.ChangeNotifierProvider<_i6.Manager>>[], + ) as List<_i5.ChangeNotifierProvider<_i6.Manager>>); + @override + _i5.ChangeNotifierProvider<_i6.Manager> getManagerProvider( + String? walletId) => + (super.noSuchMethod( + Invocation.method( + #getManagerProvider, + [walletId], + ), + returnValue: _FakeChangeNotifierProvider_2<_i6.Manager>( + this, + Invocation.method( + #getManagerProvider, + [walletId], + ), + ), + ) as _i5.ChangeNotifierProvider<_i6.Manager>); + @override + _i6.Manager getManager(String? walletId) => (super.noSuchMethod( + Invocation.method( + #getManager, + [walletId], + ), + returnValue: _FakeManager_3( + this, + Invocation.method( + #getManager, + [walletId], + ), + ), + ) as _i6.Manager); + @override + void addWallet({ + required String? walletId, + required _i6.Manager? manager, + }) => + super.noSuchMethod( + Invocation.method( + #addWallet, + [], + { + #walletId: walletId, + #manager: manager, + }, + ), + returnValueForMissingStub: null, + ); + @override + void removeWallet({required String? walletId}) => super.noSuchMethod( + Invocation.method( + #removeWallet, + [], + {#walletId: walletId}, + ), + returnValueForMissingStub: null, + ); + @override + _i21.Future load(_i22.Prefs? prefs) => (super.noSuchMethod( + Invocation.method( + #load, + [prefs], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + _i21.Future loadAfterStackRestore( + _i22.Prefs? prefs, + List<_i6.Manager>? managers, + ) => + (super.noSuchMethod( + Invocation.method( + #loadAfterStackRestore, + [ + prefs, + managers, + ], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + void addListener(_i23.VoidCallback? listener) => super.noSuchMethod( + Invocation.method( + #addListener, + [listener], + ), + returnValueForMissingStub: null, + ); + @override + void removeListener(_i23.VoidCallback? listener) => super.noSuchMethod( + Invocation.method( + #removeListener, + [listener], + ), + returnValueForMissingStub: null, + ); + @override + void notifyListeners() => super.noSuchMethod( + Invocation.method( + #notifyListeners, + [], + ), + returnValueForMissingStub: null, + ); +} + +/// A class which mocks [BitcoinWallet]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet { + MockBitcoinWallet() { + _i1.throwOnMissingStub(this); + } + + @override + set timer(_i21.Timer? _timer) => super.noSuchMethod( + Invocation.setter( + #timer, + _timer, + ), + returnValueForMissingStub: null, + ); + @override + _i7.TransactionNotificationTracker get txTracker => (super.noSuchMethod( + Invocation.getter(#txTracker), + returnValue: _FakeTransactionNotificationTracker_4( + this, + Invocation.getter(#txTracker), + ), + ) as _i7.TransactionNotificationTracker); + @override + set txTracker(_i7.TransactionNotificationTracker? _txTracker) => + super.noSuchMethod( + Invocation.setter( + #txTracker, + _txTracker, + ), + returnValueForMissingStub: null, + ); + @override + bool get longMutex => (super.noSuchMethod( + Invocation.getter(#longMutex), + returnValue: false, + ) as bool); + @override + set longMutex(bool? _longMutex) => super.noSuchMethod( + Invocation.setter( + #longMutex, + _longMutex, + ), + returnValueForMissingStub: null, + ); + @override + bool get refreshMutex => (super.noSuchMethod( + Invocation.getter(#refreshMutex), + returnValue: false, + ) as bool); + @override + set refreshMutex(bool? _refreshMutex) => super.noSuchMethod( + Invocation.setter( + #refreshMutex, + _refreshMutex, + ), + returnValueForMissingStub: null, + ); + @override + bool get isActive => (super.noSuchMethod( + Invocation.getter(#isActive), + returnValue: false, + ) as bool); + @override + set isActive(bool? _isActive) => super.noSuchMethod( + Invocation.setter( + #isActive, + _isActive, + ), + returnValueForMissingStub: null, + ); + @override + set isFavorite(bool? markFavorite) => super.noSuchMethod( + Invocation.setter( + #isFavorite, + markFavorite, + ), + returnValueForMissingStub: null, + ); + @override + bool get isFavorite => (super.noSuchMethod( + Invocation.getter(#isFavorite), + returnValue: false, + ) as bool); + @override + _i20.Coin get coin => (super.noSuchMethod( + Invocation.getter(#coin), + returnValue: _i20.Coin.bitcoin, + ) as _i20.Coin); + @override + _i21.Future> get utxos => (super.noSuchMethod( + Invocation.getter(#utxos), + returnValue: _i21.Future>.value(<_i17.UTXO>[]), + ) as _i21.Future>); + @override + _i21.Future> get transactions => (super.noSuchMethod( + Invocation.getter(#transactions), + returnValue: + _i21.Future>.value(<_i17.Transaction>[]), + ) as _i21.Future>); + @override + _i21.Future get currentReceivingAddress => (super.noSuchMethod( + Invocation.getter(#currentReceivingAddress), + returnValue: _i21.Future.value(''), + ) as _i21.Future); + @override + _i21.Future get currentChangeAddress => (super.noSuchMethod( + Invocation.getter(#currentChangeAddress), + returnValue: _i21.Future.value(''), + ) as _i21.Future); + @override + _i21.Future get currentChangeAddressP2PKH => (super.noSuchMethod( + Invocation.getter(#currentChangeAddressP2PKH), + returnValue: _i21.Future.value(''), + ) as _i21.Future); + @override + bool get hasCalledExit => (super.noSuchMethod( + Invocation.getter(#hasCalledExit), + returnValue: false, + ) as bool); + @override + _i21.Future<_i8.FeeObject> get fees => (super.noSuchMethod( + Invocation.getter(#fees), + returnValue: _i21.Future<_i8.FeeObject>.value(_FakeFeeObject_5( + this, + Invocation.getter(#fees), + )), + ) as _i21.Future<_i8.FeeObject>); + @override + _i21.Future get maxFee => (super.noSuchMethod( + Invocation.getter(#maxFee), + returnValue: _i21.Future.value(0), + ) as _i21.Future); + @override + _i21.Future> get mnemonic => (super.noSuchMethod( + Invocation.getter(#mnemonic), + returnValue: _i21.Future>.value([]), + ) as _i21.Future>); + @override + _i21.Future get mnemonicString => (super.noSuchMethod( + Invocation.getter(#mnemonicString), + returnValue: _i21.Future.value(), + ) as _i21.Future); + @override + _i21.Future get mnemonicPassphrase => (super.noSuchMethod( + Invocation.getter(#mnemonicPassphrase), + returnValue: _i21.Future.value(), + ) as _i21.Future); + @override + _i21.Future get chainHeight => (super.noSuchMethod( + Invocation.getter(#chainHeight), + returnValue: _i21.Future.value(0), + ) as _i21.Future); + @override + int get storedChainHeight => (super.noSuchMethod( + Invocation.getter(#storedChainHeight), + returnValue: 0, + ) as int); + @override + bool get shouldAutoSync => (super.noSuchMethod( + Invocation.getter(#shouldAutoSync), + returnValue: false, + ) as bool); + @override + set shouldAutoSync(bool? shouldAutoSync) => super.noSuchMethod( + Invocation.setter( + #shouldAutoSync, + shouldAutoSync, + ), + returnValueForMissingStub: null, + ); + @override + bool get isRefreshing => (super.noSuchMethod( + Invocation.getter(#isRefreshing), + returnValue: false, + ) as bool); + @override + bool get isConnected => (super.noSuchMethod( + Invocation.getter(#isConnected), + returnValue: false, + ) as bool); + @override + String get walletId => (super.noSuchMethod( + Invocation.getter(#walletId), + returnValue: '', + ) as String); + @override + String get walletName => (super.noSuchMethod( + Invocation.getter(#walletName), + returnValue: '', + ) as String); + @override + set walletName(String? newName) => super.noSuchMethod( + Invocation.setter( + #walletName, + newName, + ), + returnValueForMissingStub: null, + ); + @override + _i9.ElectrumX get electrumXClient => (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumX_6( + this, + Invocation.getter(#electrumXClient), + ), + ) as _i9.ElectrumX); + @override + _i10.CachedElectrumX get cachedElectrumXClient => (super.noSuchMethod( + Invocation.getter(#cachedElectrumXClient), + returnValue: _FakeCachedElectrumX_7( + this, + Invocation.getter(#cachedElectrumXClient), + ), + ) as _i10.CachedElectrumX); + @override + _i11.Balance get balance => (super.noSuchMethod( + Invocation.getter(#balance), + returnValue: _FakeBalance_8( + this, + Invocation.getter(#balance), + ), + ) as _i11.Balance); + @override + _i21.Future get xpub => (super.noSuchMethod( + Invocation.getter(#xpub), + returnValue: _i21.Future.value(''), + ) as _i21.Future); + @override + set onIsActiveWalletChanged(void Function(bool)? _onIsActiveWalletChanged) => + super.noSuchMethod( + Invocation.setter( + #onIsActiveWalletChanged, + _onIsActiveWalletChanged, + ), + returnValueForMissingStub: null, + ); + @override + _i12.MainDB get db => (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_9( + this, + Invocation.getter(#db), + ), + ) as _i12.MainDB); + @override + _i13.NetworkType get networkType => (super.noSuchMethod( + Invocation.getter(#networkType), + returnValue: _FakeNetworkType_10( + this, + Invocation.getter(#networkType), + ), + ) as _i13.NetworkType); + @override + _i21.Future exit() => (super.noSuchMethod( + Invocation.method( + #exit, + [], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + _i25.DerivePathType addressType({required String? address}) => + (super.noSuchMethod( + Invocation.method( + #addressType, + [], + {#address: address}, + ), + returnValue: _i25.DerivePathType.bip44, + ) as _i25.DerivePathType); + @override + _i21.Future recoverFromMnemonic({ + required String? mnemonic, + String? mnemonicPassphrase, + required int? maxUnusedAddressGap, + required int? maxNumberOfIndexesToCheck, + required int? height, + }) => + (super.noSuchMethod( + Invocation.method( + #recoverFromMnemonic, + [], + { + #mnemonic: mnemonic, + #mnemonicPassphrase: mnemonicPassphrase, + #maxUnusedAddressGap: maxUnusedAddressGap, + #maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck, + #height: height, + }, + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + _i21.Future getTransactionCacheEarly(List? allAddresses) => + (super.noSuchMethod( + Invocation.method( + #getTransactionCacheEarly, + [allAddresses], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + _i21.Future refreshIfThereIsNewData() => (super.noSuchMethod( + Invocation.method( + #refreshIfThereIsNewData, + [], + ), + returnValue: _i21.Future.value(false), + ) as _i21.Future); + @override + _i21.Future getAllTxsToWatch() => (super.noSuchMethod( + Invocation.method( + #getAllTxsToWatch, + [], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + _i21.Future refresh() => (super.noSuchMethod( + Invocation.method( + #refresh, + [], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + _i21.Future> prepareSend({ + required String? address, + required _i14.Amount? amount, + Map? args, + }) => + (super.noSuchMethod( + Invocation.method( + #prepareSend, + [], + { + #address: address, + #amount: amount, + #args: args, + }, + ), + returnValue: + _i21.Future>.value({}), + ) as _i21.Future>); + @override + _i21.Future confirmSend({required Map? txData}) => + (super.noSuchMethod( + Invocation.method( + #confirmSend, + [], + {#txData: txData}, + ), + returnValue: _i21.Future.value(''), + ) as _i21.Future); + @override + _i21.Future testNetworkConnection() => (super.noSuchMethod( + Invocation.method( + #testNetworkConnection, + [], + ), + returnValue: _i21.Future.value(false), + ) as _i21.Future); + @override + void startNetworkAlivePinging() => super.noSuchMethod( + Invocation.method( + #startNetworkAlivePinging, + [], + ), + returnValueForMissingStub: null, + ); + @override + void stopNetworkAlivePinging() => super.noSuchMethod( + Invocation.method( + #stopNetworkAlivePinging, + [], + ), + returnValueForMissingStub: null, + ); + @override + _i21.Future initializeNew() => (super.noSuchMethod( + Invocation.method( + #initializeNew, + [], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + _i21.Future initializeExisting() => (super.noSuchMethod( + Invocation.method( + #initializeExisting, + [], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + _i21.Future updateSentCachedTxData(Map? txData) => + (super.noSuchMethod( + Invocation.method( + #updateSentCachedTxData, + [txData], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + bool validateAddress(String? address) => (super.noSuchMethod( + Invocation.method( + #validateAddress, + [address], + ), + returnValue: false, + ) as bool); + @override + _i21.Future updateNode(bool? shouldRefresh) => (super.noSuchMethod( + Invocation.method( + #updateNode, + [shouldRefresh], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + _i21.Future<_i9.ElectrumXNode> getCurrentNode() => (super.noSuchMethod( + Invocation.method( + #getCurrentNode, + [], + ), + returnValue: _i21.Future<_i9.ElectrumXNode>.value(_FakeElectrumXNode_11( + this, + Invocation.method( + #getCurrentNode, + [], + ), + )), + ) as _i21.Future<_i9.ElectrumXNode>); + @override + _i21.Future>> fastFetch( + List? allTxHashes) => + (super.noSuchMethod( + Invocation.method( + #fastFetch, + [allTxHashes], + ), + returnValue: _i21.Future>>.value( + >[]), + ) as _i21.Future>>); + @override + _i21.Future getTxCount({required String? address}) => + (super.noSuchMethod( + Invocation.method( + #getTxCount, + [], + {#address: address}, + ), + returnValue: _i21.Future.value(0), + ) as _i21.Future); + @override + _i21.Future checkCurrentReceivingAddressesForTransactions() => + (super.noSuchMethod( + Invocation.method( + #checkCurrentReceivingAddressesForTransactions, + [], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + _i21.Future checkCurrentChangeAddressesForTransactions() => + (super.noSuchMethod( + Invocation.method( + #checkCurrentChangeAddressesForTransactions, + [], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + int estimateTxFee({ + required int? vSize, + required int? feeRatePerKB, + }) => + (super.noSuchMethod( + Invocation.method( + #estimateTxFee, + [], + { + #vSize: vSize, + #feeRatePerKB: feeRatePerKB, + }, + ), + returnValue: 0, + ) as int); + @override + dynamic coinSelection({ + required int? satoshiAmountToSend, + required int? selectedTxFeeRate, + required String? recipientAddress, + required bool? coinControl, + required bool? isSendAll, + int? additionalOutputs = 0, + List<_i17.UTXO>? utxos, + }) => + super.noSuchMethod(Invocation.method( + #coinSelection, + [], + { + #satoshiAmountToSend: satoshiAmountToSend, + #selectedTxFeeRate: selectedTxFeeRate, + #recipientAddress: recipientAddress, + #coinControl: coinControl, + #isSendAll: isSendAll, + #additionalOutputs: additionalOutputs, + #utxos: utxos, + }, + )); + @override + _i21.Future> fetchBuildTxData( + List<_i17.UTXO>? utxosToUse) => + (super.noSuchMethod( + Invocation.method( + #fetchBuildTxData, + [utxosToUse], + ), + returnValue: + _i21.Future>.value(<_i26.SigningData>[]), + ) as _i21.Future>); + @override + _i21.Future> buildTransaction({ + required List<_i26.SigningData>? utxoSigningData, + required List? recipients, + required List? satoshiAmounts, + }) => + (super.noSuchMethod( + Invocation.method( + #buildTransaction, + [], + { + #utxoSigningData: utxoSigningData, + #recipients: recipients, + #satoshiAmounts: satoshiAmounts, + }, + ), + returnValue: + _i21.Future>.value({}), + ) as _i21.Future>); + @override + _i21.Future fullRescan( + int? maxUnusedAddressGap, + int? maxNumberOfIndexesToCheck, + ) => + (super.noSuchMethod( + Invocation.method( + #fullRescan, + [ + maxUnusedAddressGap, + maxNumberOfIndexesToCheck, + ], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + _i21.Future<_i14.Amount> estimateFeeFor( + _i14.Amount? amount, + int? feeRate, + ) => + (super.noSuchMethod( + Invocation.method( + #estimateFeeFor, + [ + amount, + feeRate, + ], + ), + returnValue: _i21.Future<_i14.Amount>.value(_FakeAmount_12( + this, + Invocation.method( + #estimateFeeFor, + [ + amount, + feeRate, + ], + ), + )), + ) as _i21.Future<_i14.Amount>); + @override + _i14.Amount roughFeeEstimate( + int? inputCount, + int? outputCount, + int? feeRatePerKB, + ) => + (super.noSuchMethod( + Invocation.method( + #roughFeeEstimate, + [ + inputCount, + outputCount, + feeRatePerKB, + ], + ), + returnValue: _FakeAmount_12( + this, + Invocation.method( + #roughFeeEstimate, + [ + inputCount, + outputCount, + feeRatePerKB, + ], + ), + ), + ) as _i14.Amount); + @override + _i21.Future<_i14.Amount> sweepAllEstimate(int? feeRate) => + (super.noSuchMethod( + Invocation.method( + #sweepAllEstimate, + [feeRate], + ), + returnValue: _i21.Future<_i14.Amount>.value(_FakeAmount_12( + this, + Invocation.method( + #sweepAllEstimate, + [feeRate], + ), + )), + ) as _i21.Future<_i14.Amount>); + @override + _i21.Future generateNewAddress() => (super.noSuchMethod( + Invocation.method( + #generateNewAddress, + [], + ), + returnValue: _i21.Future.value(false), + ) as _i21.Future); + @override + void initCache( + String? walletId, + _i20.Coin? coin, + ) => + super.noSuchMethod( + Invocation.method( + #initCache, + [ + walletId, + coin, + ], + ), + returnValueForMissingStub: null, + ); + @override + _i21.Future updateCachedId(String? id) => (super.noSuchMethod( + Invocation.method( + #updateCachedId, + [id], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + int getCachedChainHeight() => (super.noSuchMethod( + Invocation.method( + #getCachedChainHeight, + [], + ), + returnValue: 0, + ) as int); + @override + _i21.Future updateCachedChainHeight(int? height) => (super.noSuchMethod( + Invocation.method( + #updateCachedChainHeight, + [height], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + bool getCachedIsFavorite() => (super.noSuchMethod( + Invocation.method( + #getCachedIsFavorite, + [], + ), + returnValue: false, + ) as bool); + @override + _i21.Future updateCachedIsFavorite(bool? isFavorite) => + (super.noSuchMethod( + Invocation.method( + #updateCachedIsFavorite, + [isFavorite], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + _i11.Balance getCachedBalance() => (super.noSuchMethod( + Invocation.method( + #getCachedBalance, + [], + ), + returnValue: _FakeBalance_8( + this, + Invocation.method( + #getCachedBalance, + [], + ), + ), + ) as _i11.Balance); + @override + _i21.Future updateCachedBalance(_i11.Balance? balance) => + (super.noSuchMethod( + Invocation.method( + #updateCachedBalance, + [balance], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + _i11.Balance getCachedBalanceSecondary() => (super.noSuchMethod( + Invocation.method( + #getCachedBalanceSecondary, + [], + ), + returnValue: _FakeBalance_8( + this, + Invocation.method( + #getCachedBalanceSecondary, + [], + ), + ), + ) as _i11.Balance); + @override + _i21.Future updateCachedBalanceSecondary(_i11.Balance? balance) => + (super.noSuchMethod( + Invocation.method( + #updateCachedBalanceSecondary, + [balance], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + List getWalletTokenContractAddresses() => (super.noSuchMethod( + Invocation.method( + #getWalletTokenContractAddresses, + [], + ), + returnValue: [], + ) as List); + @override + _i21.Future updateWalletTokenContractAddresses( + List? contractAddresses) => + (super.noSuchMethod( + Invocation.method( + #updateWalletTokenContractAddresses, + [contractAddresses], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + void initWalletDB({_i12.MainDB? mockableOverride}) => super.noSuchMethod( + Invocation.method( + #initWalletDB, + [], + {#mockableOverride: mockableOverride}, + ), + returnValueForMissingStub: null, + ); + @override + _i21.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>> parseTransaction( + Map? txData, + dynamic electrumxClient, + List<_i17.Address>? myAddresses, + _i20.Coin? coin, + int? minConfirms, + String? walletId, + ) => + (super.noSuchMethod( + Invocation.method( + #parseTransaction, + [ + txData, + electrumxClient, + myAddresses, + coin, + minConfirms, + walletId, + ], + ), + returnValue: + _i21.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>>.value( + _FakeTuple2_13<_i17.Transaction, _i17.Address>( + this, + Invocation.method( + #parseTransaction, + [ + txData, + electrumxClient, + myAddresses, + coin, + minConfirms, + walletId, + ], + ), + )), + ) as _i21.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>>); + @override + void initPaynymWalletInterface({ + required String? walletId, + required String? walletName, + required _i13.NetworkType? network, + required _i20.Coin? coin, + required _i12.MainDB? db, + required _i9.ElectrumX? electrumXClient, + required _i27.SecureStorageInterface? secureStorage, + required int? dustLimit, + required int? dustLimitP2PKH, + required int? minConfirms, + required _i21.Future Function()? getMnemonicString, + required _i21.Future Function()? getMnemonicPassphrase, + required _i21.Future Function()? getChainHeight, + required _i21.Future Function()? getCurrentChangeAddress, + required int Function({ + required int feeRatePerKB, + required int vSize, + })? + estimateTxFee, + required _i21.Future> Function({ + required String address, + required _i14.Amount amount, + Map? args, + })? + prepareSend, + required _i21.Future Function({required String address})? getTxCount, + required _i21.Future> Function(List<_i17.UTXO>)? + fetchBuildTxData, + required _i21.Future Function()? refresh, + required _i21.Future Function()? checkChangeAddressForTransactions, + }) => + super.noSuchMethod( + Invocation.method( + #initPaynymWalletInterface, + [], + { + #walletId: walletId, + #walletName: walletName, + #network: network, + #coin: coin, + #db: db, + #electrumXClient: electrumXClient, + #secureStorage: secureStorage, + #dustLimit: dustLimit, + #dustLimitP2PKH: dustLimitP2PKH, + #minConfirms: minConfirms, + #getMnemonicString: getMnemonicString, + #getMnemonicPassphrase: getMnemonicPassphrase, + #getChainHeight: getChainHeight, + #getCurrentChangeAddress: getCurrentChangeAddress, + #estimateTxFee: estimateTxFee, + #prepareSend: prepareSend, + #getTxCount: getTxCount, + #fetchBuildTxData: fetchBuildTxData, + #refresh: refresh, + #checkChangeAddressForTransactions: + checkChangeAddressForTransactions, + }, + ), + returnValueForMissingStub: null, + ); + @override + _i21.Future<_i16.BIP32> getBip47BaseNode() => (super.noSuchMethod( + Invocation.method( + #getBip47BaseNode, + [], + ), + returnValue: _i21.Future<_i16.BIP32>.value(_FakeBIP32_14( + this, + Invocation.method( + #getBip47BaseNode, + [], + ), + )), + ) as _i21.Future<_i16.BIP32>); + @override + _i21.Future<_i28.Uint8List> getPrivateKeyForPaynymReceivingAddress({ + required String? paymentCodeString, + required int? index, + }) => + (super.noSuchMethod( + Invocation.method( + #getPrivateKeyForPaynymReceivingAddress, + [], + { + #paymentCodeString: paymentCodeString, + #index: index, + }, + ), + returnValue: _i21.Future<_i28.Uint8List>.value(_i28.Uint8List(0)), + ) as _i21.Future<_i28.Uint8List>); + @override + _i21.Future<_i17.Address> currentReceivingPaynymAddress({ + required _i18.PaymentCode? sender, + required bool? isSegwit, + }) => + (super.noSuchMethod( + Invocation.method( + #currentReceivingPaynymAddress, + [], + { + #sender: sender, + #isSegwit: isSegwit, + }, + ), + returnValue: _i21.Future<_i17.Address>.value(_FakeAddress_15( + this, + Invocation.method( + #currentReceivingPaynymAddress, + [], + { + #sender: sender, + #isSegwit: isSegwit, + }, + ), + )), + ) as _i21.Future<_i17.Address>); + @override + _i21.Future checkCurrentPaynymReceivingAddressForTransactions({ + required _i18.PaymentCode? sender, + required bool? isSegwit, + }) => + (super.noSuchMethod( + Invocation.method( + #checkCurrentPaynymReceivingAddressForTransactions, + [], + { + #sender: sender, + #isSegwit: isSegwit, + }, + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + _i21.Future checkAllCurrentReceivingPaynymAddressesForTransactions() => + (super.noSuchMethod( + Invocation.method( + #checkAllCurrentReceivingPaynymAddressesForTransactions, + [], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + _i21.Future<_i16.BIP32> deriveNotificationBip32Node() => (super.noSuchMethod( + Invocation.method( + #deriveNotificationBip32Node, + [], + ), + returnValue: _i21.Future<_i16.BIP32>.value(_FakeBIP32_14( + this, + Invocation.method( + #deriveNotificationBip32Node, + [], + ), + )), + ) as _i21.Future<_i16.BIP32>); + @override + _i21.Future<_i18.PaymentCode> getPaymentCode({required bool? isSegwit}) => + (super.noSuchMethod( + Invocation.method( + #getPaymentCode, + [], + {#isSegwit: isSegwit}, + ), + returnValue: _i21.Future<_i18.PaymentCode>.value(_FakePaymentCode_16( + this, + Invocation.method( + #getPaymentCode, + [], + {#isSegwit: isSegwit}, + ), + )), + ) as _i21.Future<_i18.PaymentCode>); + @override + _i21.Future<_i28.Uint8List> signWithNotificationKey(_i28.Uint8List? data) => + (super.noSuchMethod( + Invocation.method( + #signWithNotificationKey, + [data], + ), + returnValue: _i21.Future<_i28.Uint8List>.value(_i28.Uint8List(0)), + ) as _i21.Future<_i28.Uint8List>); + @override + _i21.Future signStringWithNotificationKey(String? data) => + (super.noSuchMethod( + Invocation.method( + #signStringWithNotificationKey, + [data], + ), + returnValue: _i21.Future.value(''), + ) as _i21.Future); + @override + _i21.Future> preparePaymentCodeSend({ + required _i18.PaymentCode? paymentCode, + required bool? isSegwit, + required _i14.Amount? amount, + Map? args, + }) => + (super.noSuchMethod( + Invocation.method( + #preparePaymentCodeSend, + [], + { + #paymentCode: paymentCode, + #isSegwit: isSegwit, + #amount: amount, + #args: args, + }, + ), + returnValue: + _i21.Future>.value({}), + ) as _i21.Future>); + @override + _i21.Future<_i17.Address> nextUnusedSendAddressFrom({ + required _i18.PaymentCode? pCode, + required bool? isSegwit, + required _i16.BIP32? privateKeyNode, + int? startIndex = 0, + }) => + (super.noSuchMethod( + Invocation.method( + #nextUnusedSendAddressFrom, + [], + { + #pCode: pCode, + #isSegwit: isSegwit, + #privateKeyNode: privateKeyNode, + #startIndex: startIndex, + }, + ), + returnValue: _i21.Future<_i17.Address>.value(_FakeAddress_15( + this, + Invocation.method( + #nextUnusedSendAddressFrom, + [], + { + #pCode: pCode, + #isSegwit: isSegwit, + #privateKeyNode: privateKeyNode, + #startIndex: startIndex, + }, + ), + )), + ) as _i21.Future<_i17.Address>); + @override + _i21.Future> prepareNotificationTx({ + required int? selectedTxFeeRate, + required String? targetPaymentCodeString, + int? additionalOutputs = 0, + List<_i17.UTXO>? utxos, + }) => + (super.noSuchMethod( + Invocation.method( + #prepareNotificationTx, + [], + { + #selectedTxFeeRate: selectedTxFeeRate, + #targetPaymentCodeString: targetPaymentCodeString, + #additionalOutputs: additionalOutputs, + #utxos: utxos, + }, + ), + returnValue: + _i21.Future>.value({}), + ) as _i21.Future>); + @override + _i21.Future broadcastNotificationTx( + {required Map? preparedTx}) => + (super.noSuchMethod( + Invocation.method( + #broadcastNotificationTx, + [], + {#preparedTx: preparedTx}, + ), + returnValue: _i21.Future.value(''), + ) as _i21.Future); + @override + _i21.Future hasConnected(String? paymentCodeString) => + (super.noSuchMethod( + Invocation.method( + #hasConnected, + [paymentCodeString], + ), + returnValue: _i21.Future.value(false), + ) as _i21.Future); + @override + _i21.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransaction( + {required _i17.Transaction? transaction}) => + (super.noSuchMethod( + Invocation.method( + #unBlindedPaymentCodeFromTransaction, + [], + {#transaction: transaction}, + ), + returnValue: _i21.Future<_i18.PaymentCode?>.value(), + ) as _i21.Future<_i18.PaymentCode?>); + @override + _i21.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransactionBad( + {required _i17.Transaction? transaction}) => + (super.noSuchMethod( + Invocation.method( + #unBlindedPaymentCodeFromTransactionBad, + [], + {#transaction: transaction}, + ), + returnValue: _i21.Future<_i18.PaymentCode?>.value(), + ) as _i21.Future<_i18.PaymentCode?>); + @override + _i21.Future> + getAllPaymentCodesFromNotificationTransactions() => (super.noSuchMethod( + Invocation.method( + #getAllPaymentCodesFromNotificationTransactions, + [], + ), + returnValue: + _i21.Future>.value(<_i18.PaymentCode>[]), + ) as _i21.Future>); + @override + _i21.Future checkForNotificationTransactionsTo( + Set? otherCodeStrings) => + (super.noSuchMethod( + Invocation.method( + #checkForNotificationTransactionsTo, + [otherCodeStrings], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + _i21.Future restoreAllHistory({ + required int? maxUnusedAddressGap, + required int? maxNumberOfIndexesToCheck, + required Set? paymentCodeStrings, + }) => + (super.noSuchMethod( + Invocation.method( + #restoreAllHistory, + [], + { + #maxUnusedAddressGap: maxUnusedAddressGap, + #maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck, + #paymentCodeStrings: paymentCodeStrings, + }, + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + _i21.Future restoreHistoryWith({ + required _i18.PaymentCode? other, + required bool? checkSegwitAsWell, + required int? maxUnusedAddressGap, + required int? maxNumberOfIndexesToCheck, + }) => + (super.noSuchMethod( + Invocation.method( + #restoreHistoryWith, + [], + { + #other: other, + #checkSegwitAsWell: checkSegwitAsWell, + #maxUnusedAddressGap: maxUnusedAddressGap, + #maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck, + }, + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + _i21.Future<_i17.Address> getMyNotificationAddress() => (super.noSuchMethod( + Invocation.method( + #getMyNotificationAddress, + [], + ), + returnValue: _i21.Future<_i17.Address>.value(_FakeAddress_15( + this, + Invocation.method( + #getMyNotificationAddress, + [], + ), + )), + ) as _i21.Future<_i17.Address>); + @override + _i21.Future> lookupKey(String? paymentCodeString) => + (super.noSuchMethod( + Invocation.method( + #lookupKey, + [paymentCodeString], + ), + returnValue: _i21.Future>.value([]), + ) as _i21.Future>); + @override + _i21.Future paymentCodeStringByKey(String? key) => + (super.noSuchMethod( + Invocation.method( + #paymentCodeStringByKey, + [key], + ), + returnValue: _i21.Future.value(), + ) as _i21.Future); + @override + _i21.Future storeCode(String? paymentCodeString) => + (super.noSuchMethod( + Invocation.method( + #storeCode, + [paymentCodeString], + ), + returnValue: _i21.Future.value(''), + ) as _i21.Future); + @override + void initCoinControlInterface({ + required String? walletId, + required String? walletName, + required _i20.Coin? coin, + required _i12.MainDB? db, + required _i21.Future Function()? getChainHeight, + required _i21.Future Function(_i11.Balance)? refreshedBalanceCallback, + }) => + super.noSuchMethod( + Invocation.method( + #initCoinControlInterface, + [], + { + #walletId: walletId, + #walletName: walletName, + #coin: coin, + #db: db, + #getChainHeight: getChainHeight, + #refreshedBalanceCallback: refreshedBalanceCallback, + }, + ), + returnValueForMissingStub: null, + ); + @override + _i21.Future refreshBalance({bool? notify = false}) => + (super.noSuchMethod( + Invocation.method( + #refreshBalance, + [], + {#notify: notify}, + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); +} + +/// A class which mocks [LocaleService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockLocaleService extends _i1.Mock implements _i29.LocaleService { + MockLocaleService() { + _i1.throwOnMissingStub(this); + } + + @override + String get locale => (super.noSuchMethod( + Invocation.getter(#locale), + returnValue: '', + ) as String); + @override + bool get hasListeners => (super.noSuchMethod( + Invocation.getter(#hasListeners), + returnValue: false, + ) as bool); + @override + _i21.Future loadLocale({bool? notify = true}) => (super.noSuchMethod( + Invocation.method( + #loadLocale, + [], + {#notify: notify}, + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + void addListener(_i23.VoidCallback? listener) => super.noSuchMethod( + Invocation.method( + #addListener, + [listener], + ), + returnValueForMissingStub: null, + ); + @override + void removeListener(_i23.VoidCallback? listener) => super.noSuchMethod( + Invocation.method( + #removeListener, + [listener], + ), + returnValueForMissingStub: null, + ); + @override + void dispose() => super.noSuchMethod( + Invocation.method( + #dispose, + [], + ), + returnValueForMissingStub: null, + ); + @override + void notifyListeners() => super.noSuchMethod( + Invocation.method( + #notifyListeners, + [], + ), + returnValueForMissingStub: null, + ); +} + +/// A class which mocks [ThemeService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockThemeService extends _i1.Mock implements _i30.ThemeService { + MockThemeService() { + _i1.throwOnMissingStub(this); + } + + @override + _i12.MainDB get db => (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_9( + this, + Invocation.getter(#db), + ), + ) as _i12.MainDB); + @override + List<_i31.StackTheme> get installedThemes => (super.noSuchMethod( + Invocation.getter(#installedThemes), + returnValue: <_i31.StackTheme>[], + ) as List<_i31.StackTheme>); + @override + void init(_i12.MainDB? db) => super.noSuchMethod( + Invocation.method( + #init, + [db], + ), + returnValueForMissingStub: null, + ); + @override + _i21.Future install({required _i28.Uint8List? themeArchiveData}) => + (super.noSuchMethod( + Invocation.method( + #install, + [], + {#themeArchiveData: themeArchiveData}, + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + _i21.Future remove({required String? themeId}) => (super.noSuchMethod( + Invocation.method( + #remove, + [], + {#themeId: themeId}, + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + _i21.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override + _i21.Future verifyInstalled({required String? themeId}) => + (super.noSuchMethod( + Invocation.method( + #verifyInstalled, + [], + {#themeId: themeId}, + ), + returnValue: _i21.Future.value(false), + ) as _i21.Future); + @override + _i21.Future> fetchThemes() => + (super.noSuchMethod( + Invocation.method( + #fetchThemes, + [], + ), + returnValue: _i21.Future>.value( + <_i30.StackThemeMetaData>[]), + ) as _i21.Future>); + @override + _i21.Future<_i28.Uint8List> fetchTheme( + {required _i30.StackThemeMetaData? themeMetaData}) => + (super.noSuchMethod( + Invocation.method( + #fetchTheme, + [], + {#themeMetaData: themeMetaData}, + ), + returnValue: _i21.Future<_i28.Uint8List>.value(_i28.Uint8List(0)), + ) as _i21.Future<_i28.Uint8List>); + @override + _i31.StackTheme? getTheme({required String? themeId}) => + (super.noSuchMethod(Invocation.method( + #getTheme, + [], + {#themeId: themeId}, + )) as _i31.StackTheme?); +} diff --git a/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart b/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart index 1cfa90f00..f76a04c74 100644 --- a/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart +++ b/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart @@ -1,10 +1,10 @@ // Mocks generated by Mockito 5.3.2 from annotations -// in stackduo/test/widget_tests/wallet_info_row/wallet_info_row_test.dart. +// in stackwallet/test/widget_tests/wallet_info_row/wallet_info_row_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i23; -import 'dart:typed_data' as _i29; +import 'dart:typed_data' as _i28; import 'dart:ui' as _i25; import 'package:bip32/bip32.dart' as _i16; @@ -13,27 +13,30 @@ import 'package:bitcoindart/bitcoindart.dart' as _i13; import 'package:flutter/foundation.dart' as _i4; import 'package:flutter_riverpod/flutter_riverpod.dart' as _i5; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackduo/db/main_db.dart' as _i12; -import 'package:stackduo/electrumx_rpc/cached_electrumx.dart' as _i10; -import 'package:stackduo/electrumx_rpc/electrumx.dart' as _i9; -import 'package:stackduo/models/balance.dart' as _i11; -import 'package:stackduo/models/isar/models/isar_models.dart' as _i17; -import 'package:stackduo/models/node_model.dart' as _i30; -import 'package:stackduo/models/paymint/fee_object_model.dart' as _i8; -import 'package:stackduo/models/signing_data.dart' as _i28; -import 'package:stackduo/services/coins/bitcoin/bitcoin_wallet.dart' as _i26; -import 'package:stackduo/services/coins/coin_service.dart' as _i20; -import 'package:stackduo/services/coins/manager.dart' as _i6; -import 'package:stackduo/services/node_service.dart' as _i3; -import 'package:stackduo/services/transaction_notification_tracker.dart' as _i7; -import 'package:stackduo/services/wallets.dart' as _i21; -import 'package:stackduo/services/wallets_service.dart' as _i2; -import 'package:stackduo/utilities/amount/amount.dart' as _i14; -import 'package:stackduo/utilities/enums/coin_enum.dart' as _i22; -import 'package:stackduo/utilities/enums/derive_path_type_enum.dart' as _i27; -import 'package:stackduo/utilities/flutter_secure_storage_interface.dart' +import 'package:stackwallet/db/isar/main_db.dart' as _i7; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i11; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i10; +import 'package:stackwallet/models/balance.dart' as _i12; +import 'package:stackwallet/models/isar/models/isar_models.dart' as _i17; +import 'package:stackwallet/models/isar/stack_theme.dart' as _i27; +import 'package:stackwallet/models/node_model.dart' as _i32; +import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i9; +import 'package:stackwallet/models/signing_data.dart' as _i31; +import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart' as _i29; +import 'package:stackwallet/services/coins/coin_service.dart' as _i20; +import 'package:stackwallet/services/coins/manager.dart' as _i6; +import 'package:stackwallet/services/node_service.dart' as _i3; +import 'package:stackwallet/services/transaction_notification_tracker.dart' + as _i8; +import 'package:stackwallet/services/wallets.dart' as _i21; +import 'package:stackwallet/services/wallets_service.dart' as _i2; +import 'package:stackwallet/themes/theme_service.dart' as _i26; +import 'package:stackwallet/utilities/amount/amount.dart' as _i14; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i22; +import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart' as _i30; +import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart' as _i19; -import 'package:stackduo/utilities/prefs.dart' as _i24; +import 'package:stackwallet/utilities/prefs.dart' as _i24; import 'package:tuple/tuple.dart' as _i15; // ignore_for_file: type=lint @@ -89,9 +92,8 @@ class _FakeManager_3 extends _i1.SmartFake implements _i6.Manager { ); } -class _FakeTransactionNotificationTracker_4 extends _i1.SmartFake - implements _i7.TransactionNotificationTracker { - _FakeTransactionNotificationTracker_4( +class _FakeMainDB_4 extends _i1.SmartFake implements _i7.MainDB { + _FakeMainDB_4( Object parent, Invocation parentInvocation, ) : super( @@ -100,8 +102,9 @@ class _FakeTransactionNotificationTracker_4 extends _i1.SmartFake ); } -class _FakeFeeObject_5 extends _i1.SmartFake implements _i8.FeeObject { - _FakeFeeObject_5( +class _FakeTransactionNotificationTracker_5 extends _i1.SmartFake + implements _i8.TransactionNotificationTracker { + _FakeTransactionNotificationTracker_5( Object parent, Invocation parentInvocation, ) : super( @@ -110,8 +113,8 @@ class _FakeFeeObject_5 extends _i1.SmartFake implements _i8.FeeObject { ); } -class _FakeElectrumX_6 extends _i1.SmartFake implements _i9.ElectrumX { - _FakeElectrumX_6( +class _FakeFeeObject_6 extends _i1.SmartFake implements _i9.FeeObject { + _FakeFeeObject_6( Object parent, Invocation parentInvocation, ) : super( @@ -120,9 +123,8 @@ class _FakeElectrumX_6 extends _i1.SmartFake implements _i9.ElectrumX { ); } -class _FakeCachedElectrumX_7 extends _i1.SmartFake - implements _i10.CachedElectrumX { - _FakeCachedElectrumX_7( +class _FakeElectrumX_7 extends _i1.SmartFake implements _i10.ElectrumX { + _FakeElectrumX_7( Object parent, Invocation parentInvocation, ) : super( @@ -131,8 +133,9 @@ class _FakeCachedElectrumX_7 extends _i1.SmartFake ); } -class _FakeBalance_8 extends _i1.SmartFake implements _i11.Balance { - _FakeBalance_8( +class _FakeCachedElectrumX_8 extends _i1.SmartFake + implements _i11.CachedElectrumX { + _FakeCachedElectrumX_8( Object parent, Invocation parentInvocation, ) : super( @@ -141,8 +144,8 @@ class _FakeBalance_8 extends _i1.SmartFake implements _i11.Balance { ); } -class _FakeMainDB_9 extends _i1.SmartFake implements _i12.MainDB { - _FakeMainDB_9( +class _FakeBalance_9 extends _i1.SmartFake implements _i12.Balance { + _FakeBalance_9( Object parent, Invocation parentInvocation, ) : super( @@ -161,7 +164,8 @@ class _FakeNetworkType_10 extends _i1.SmartFake implements _i13.NetworkType { ); } -class _FakeElectrumXNode_11 extends _i1.SmartFake implements _i9.ElectrumXNode { +class _FakeElectrumXNode_11 extends _i1.SmartFake + implements _i10.ElectrumXNode { _FakeElectrumXNode_11( Object parent, Invocation parentInvocation, @@ -686,10 +690,109 @@ class MockWalletsService extends _i1.Mock implements _i2.WalletsService { ); } +/// A class which mocks [ThemeService]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockThemeService extends _i1.Mock implements _i26.ThemeService { + MockThemeService() { + _i1.throwOnMissingStub(this); + } + + @override + _i7.MainDB get db => (super.noSuchMethod( + Invocation.getter(#db), + returnValue: _FakeMainDB_4( + this, + Invocation.getter(#db), + ), + ) as _i7.MainDB); + @override + List<_i27.StackTheme> get installedThemes => (super.noSuchMethod( + Invocation.getter(#installedThemes), + returnValue: <_i27.StackTheme>[], + ) as List<_i27.StackTheme>); + @override + void init(_i7.MainDB? db) => super.noSuchMethod( + Invocation.method( + #init, + [db], + ), + returnValueForMissingStub: null, + ); + @override + _i23.Future install({required _i28.Uint8List? themeArchiveData}) => + (super.noSuchMethod( + Invocation.method( + #install, + [], + {#themeArchiveData: themeArchiveData}, + ), + returnValue: _i23.Future.value(), + returnValueForMissingStub: _i23.Future.value(), + ) as _i23.Future); + @override + _i23.Future remove({required String? themeId}) => (super.noSuchMethod( + Invocation.method( + #remove, + [], + {#themeId: themeId}, + ), + returnValue: _i23.Future.value(), + returnValueForMissingStub: _i23.Future.value(), + ) as _i23.Future); + @override + _i23.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i23.Future.value(), + returnValueForMissingStub: _i23.Future.value(), + ) as _i23.Future); + @override + _i23.Future verifyInstalled({required String? themeId}) => + (super.noSuchMethod( + Invocation.method( + #verifyInstalled, + [], + {#themeId: themeId}, + ), + returnValue: _i23.Future.value(false), + ) as _i23.Future); + @override + _i23.Future> fetchThemes() => + (super.noSuchMethod( + Invocation.method( + #fetchThemes, + [], + ), + returnValue: _i23.Future>.value( + <_i26.StackThemeMetaData>[]), + ) as _i23.Future>); + @override + _i23.Future<_i28.Uint8List> fetchTheme( + {required _i26.StackThemeMetaData? themeMetaData}) => + (super.noSuchMethod( + Invocation.method( + #fetchTheme, + [], + {#themeMetaData: themeMetaData}, + ), + returnValue: _i23.Future<_i28.Uint8List>.value(_i28.Uint8List(0)), + ) as _i23.Future<_i28.Uint8List>); + @override + _i27.StackTheme? getTheme({required String? themeId}) => + (super.noSuchMethod(Invocation.method( + #getTheme, + [], + {#themeId: themeId}, + )) as _i27.StackTheme?); +} + /// A class which mocks [BitcoinWallet]. /// /// See the documentation for Mockito's code generation for more information. -class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { +class MockBitcoinWallet extends _i1.Mock implements _i29.BitcoinWallet { MockBitcoinWallet() { _i1.throwOnMissingStub(this); } @@ -703,15 +806,15 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValueForMissingStub: null, ); @override - _i7.TransactionNotificationTracker get txTracker => (super.noSuchMethod( + _i8.TransactionNotificationTracker get txTracker => (super.noSuchMethod( Invocation.getter(#txTracker), - returnValue: _FakeTransactionNotificationTracker_4( + returnValue: _FakeTransactionNotificationTracker_5( this, Invocation.getter(#txTracker), ), - ) as _i7.TransactionNotificationTracker); + ) as _i8.TransactionNotificationTracker); @override - set txTracker(_i7.TransactionNotificationTracker? _txTracker) => + set txTracker(_i8.TransactionNotificationTracker? _txTracker) => super.noSuchMethod( Invocation.setter( #txTracker, @@ -808,13 +911,13 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValue: false, ) as bool); @override - _i23.Future<_i8.FeeObject> get fees => (super.noSuchMethod( + _i23.Future<_i9.FeeObject> get fees => (super.noSuchMethod( Invocation.getter(#fees), - returnValue: _i23.Future<_i8.FeeObject>.value(_FakeFeeObject_5( + returnValue: _i23.Future<_i9.FeeObject>.value(_FakeFeeObject_6( this, Invocation.getter(#fees), )), - ) as _i23.Future<_i8.FeeObject>); + ) as _i23.Future<_i9.FeeObject>); @override _i23.Future get maxFee => (super.noSuchMethod( Invocation.getter(#maxFee), @@ -887,29 +990,29 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValueForMissingStub: null, ); @override - _i9.ElectrumX get electrumXClient => (super.noSuchMethod( + _i10.ElectrumX get electrumXClient => (super.noSuchMethod( Invocation.getter(#electrumXClient), - returnValue: _FakeElectrumX_6( + returnValue: _FakeElectrumX_7( this, Invocation.getter(#electrumXClient), ), - ) as _i9.ElectrumX); + ) as _i10.ElectrumX); @override - _i10.CachedElectrumX get cachedElectrumXClient => (super.noSuchMethod( + _i11.CachedElectrumX get cachedElectrumXClient => (super.noSuchMethod( Invocation.getter(#cachedElectrumXClient), - returnValue: _FakeCachedElectrumX_7( + returnValue: _FakeCachedElectrumX_8( this, Invocation.getter(#cachedElectrumXClient), ), - ) as _i10.CachedElectrumX); + ) as _i11.CachedElectrumX); @override - _i11.Balance get balance => (super.noSuchMethod( + _i12.Balance get balance => (super.noSuchMethod( Invocation.getter(#balance), - returnValue: _FakeBalance_8( + returnValue: _FakeBalance_9( this, Invocation.getter(#balance), ), - ) as _i11.Balance); + ) as _i12.Balance); @override _i23.Future get xpub => (super.noSuchMethod( Invocation.getter(#xpub), @@ -925,13 +1028,13 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValueForMissingStub: null, ); @override - _i12.MainDB get db => (super.noSuchMethod( + _i7.MainDB get db => (super.noSuchMethod( Invocation.getter(#db), - returnValue: _FakeMainDB_9( + returnValue: _FakeMainDB_4( this, Invocation.getter(#db), ), - ) as _i12.MainDB); + ) as _i7.MainDB); @override _i13.NetworkType get networkType => (super.noSuchMethod( Invocation.getter(#networkType), @@ -950,15 +1053,15 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override - _i27.DerivePathType addressType({required String? address}) => + _i30.DerivePathType addressType({required String? address}) => (super.noSuchMethod( Invocation.method( #addressType, [], {#address: address}, ), - returnValue: _i27.DerivePathType.bip44, - ) as _i27.DerivePathType); + returnValue: _i30.DerivePathType.bip44, + ) as _i30.DerivePathType); @override _i23.Future recoverFromMnemonic({ required String? mnemonic, @@ -1117,19 +1220,20 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override - _i23.Future<_i9.ElectrumXNode> getCurrentNode() => (super.noSuchMethod( + _i23.Future<_i10.ElectrumXNode> getCurrentNode() => (super.noSuchMethod( Invocation.method( #getCurrentNode, [], ), - returnValue: _i23.Future<_i9.ElectrumXNode>.value(_FakeElectrumXNode_11( + returnValue: + _i23.Future<_i10.ElectrumXNode>.value(_FakeElectrumXNode_11( this, Invocation.method( #getCurrentNode, [], ), )), - ) as _i23.Future<_i9.ElectrumXNode>); + ) as _i23.Future<_i10.ElectrumXNode>); @override _i23.Future>> fastFetch( List? allTxHashes) => @@ -1211,7 +1315,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { }, )); @override - _i23.Future> fetchBuildTxData( + _i23.Future> fetchBuildTxData( List<_i17.UTXO>? utxosToUse) => (super.noSuchMethod( Invocation.method( @@ -1219,11 +1323,11 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { [utxosToUse], ), returnValue: - _i23.Future>.value(<_i28.SigningData>[]), - ) as _i23.Future>); + _i23.Future>.value(<_i31.SigningData>[]), + ) as _i23.Future>); @override _i23.Future> buildTransaction({ - required List<_i28.SigningData>? utxoSigningData, + required List<_i31.SigningData>? utxoSigningData, required List? recipients, required List? satoshiAmounts, }) => @@ -1390,21 +1494,21 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override - _i11.Balance getCachedBalance() => (super.noSuchMethod( + _i12.Balance getCachedBalance() => (super.noSuchMethod( Invocation.method( #getCachedBalance, [], ), - returnValue: _FakeBalance_8( + returnValue: _FakeBalance_9( this, Invocation.method( #getCachedBalance, [], ), ), - ) as _i11.Balance); + ) as _i12.Balance); @override - _i23.Future updateCachedBalance(_i11.Balance? balance) => + _i23.Future updateCachedBalance(_i12.Balance? balance) => (super.noSuchMethod( Invocation.method( #updateCachedBalance, @@ -1414,21 +1518,21 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override - _i11.Balance getCachedBalanceSecondary() => (super.noSuchMethod( + _i12.Balance getCachedBalanceSecondary() => (super.noSuchMethod( Invocation.method( #getCachedBalanceSecondary, [], ), - returnValue: _FakeBalance_8( + returnValue: _FakeBalance_9( this, Invocation.method( #getCachedBalanceSecondary, [], ), ), - ) as _i11.Balance); + ) as _i12.Balance); @override - _i23.Future updateCachedBalanceSecondary(_i11.Balance? balance) => + _i23.Future updateCachedBalanceSecondary(_i12.Balance? balance) => (super.noSuchMethod( Invocation.method( #updateCachedBalanceSecondary, @@ -1438,7 +1542,26 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override - void initWalletDB({_i12.MainDB? mockableOverride}) => super.noSuchMethod( + List getWalletTokenContractAddresses() => (super.noSuchMethod( + Invocation.method( + #getWalletTokenContractAddresses, + [], + ), + returnValue: [], + ) as List); + @override + _i23.Future updateWalletTokenContractAddresses( + List? contractAddresses) => + (super.noSuchMethod( + Invocation.method( + #updateWalletTokenContractAddresses, + [contractAddresses], + ), + returnValue: _i23.Future.value(), + returnValueForMissingStub: _i23.Future.value(), + ) as _i23.Future); + @override + void initWalletDB({_i7.MainDB? mockableOverride}) => super.noSuchMethod( Invocation.method( #initWalletDB, [], @@ -1490,8 +1613,8 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { required String? walletName, required _i13.NetworkType? network, required _i22.Coin? coin, - required _i12.MainDB? db, - required _i9.ElectrumX? electrumXClient, + required _i7.MainDB? db, + required _i10.ElectrumX? electrumXClient, required _i19.SecureStorageInterface? secureStorage, required int? dustLimit, required int? dustLimitP2PKH, @@ -1512,7 +1635,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { })? prepareSend, required _i23.Future Function({required String address})? getTxCount, - required _i23.Future> Function(List<_i17.UTXO>)? + required _i23.Future> Function(List<_i17.UTXO>)? fetchBuildTxData, required _i23.Future Function()? refresh, required _i23.Future Function()? checkChangeAddressForTransactions, @@ -1562,7 +1685,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { )), ) as _i23.Future<_i16.BIP32>); @override - _i23.Future<_i29.Uint8List> getPrivateKeyForPaynymReceivingAddress({ + _i23.Future<_i28.Uint8List> getPrivateKeyForPaynymReceivingAddress({ required String? paymentCodeString, required int? index, }) => @@ -1575,8 +1698,8 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { #index: index, }, ), - returnValue: _i23.Future<_i29.Uint8List>.value(_i29.Uint8List(0)), - ) as _i23.Future<_i29.Uint8List>); + returnValue: _i23.Future<_i28.Uint8List>.value(_i28.Uint8List(0)), + ) as _i23.Future<_i28.Uint8List>); @override _i23.Future<_i17.Address> currentReceivingPaynymAddress({ required _i18.PaymentCode? sender, @@ -1662,14 +1785,14 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { )), ) as _i23.Future<_i18.PaymentCode>); @override - _i23.Future<_i29.Uint8List> signWithNotificationKey(_i29.Uint8List? data) => + _i23.Future<_i28.Uint8List> signWithNotificationKey(_i28.Uint8List? data) => (super.noSuchMethod( Invocation.method( #signWithNotificationKey, [data], ), - returnValue: _i23.Future<_i29.Uint8List>.value(_i29.Uint8List(0)), - ) as _i23.Future<_i29.Uint8List>); + returnValue: _i23.Future<_i28.Uint8List>.value(_i28.Uint8List(0)), + ) as _i23.Future<_i28.Uint8List>); @override _i23.Future signStringWithNotificationKey(String? data) => (super.noSuchMethod( @@ -1902,9 +2025,9 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { required String? walletId, required String? walletName, required _i22.Coin? coin, - required _i12.MainDB? db, + required _i7.MainDB? db, required _i23.Future Function()? getChainHeight, - required _i23.Future Function(_i11.Balance)? refreshedBalanceCallback, + required _i23.Future Function(_i12.Balance)? refreshedBalanceCallback, }) => super.noSuchMethod( Invocation.method( @@ -1947,15 +2070,15 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { ), ) as _i19.SecureStorageInterface); @override - List<_i30.NodeModel> get primaryNodes => (super.noSuchMethod( + List<_i32.NodeModel> get primaryNodes => (super.noSuchMethod( Invocation.getter(#primaryNodes), - returnValue: <_i30.NodeModel>[], - ) as List<_i30.NodeModel>); + returnValue: <_i32.NodeModel>[], + ) as List<_i32.NodeModel>); @override - List<_i30.NodeModel> get nodes => (super.noSuchMethod( + List<_i32.NodeModel> get nodes => (super.noSuchMethod( Invocation.getter(#nodes), - returnValue: <_i30.NodeModel>[], - ) as List<_i30.NodeModel>); + returnValue: <_i32.NodeModel>[], + ) as List<_i32.NodeModel>); @override bool get hasListeners => (super.noSuchMethod( Invocation.getter(#hasListeners), @@ -1973,7 +2096,7 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { @override _i23.Future setPrimaryNodeFor({ required _i22.Coin? coin, - required _i30.NodeModel? node, + required _i32.NodeModel? node, bool? shouldNotifyListeners = false, }) => (super.noSuchMethod( @@ -1990,40 +2113,40 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override - _i30.NodeModel? getPrimaryNodeFor({required _i22.Coin? coin}) => + _i32.NodeModel? getPrimaryNodeFor({required _i22.Coin? coin}) => (super.noSuchMethod(Invocation.method( #getPrimaryNodeFor, [], {#coin: coin}, - )) as _i30.NodeModel?); + )) as _i32.NodeModel?); @override - List<_i30.NodeModel> getNodesFor(_i22.Coin? coin) => (super.noSuchMethod( + List<_i32.NodeModel> getNodesFor(_i22.Coin? coin) => (super.noSuchMethod( Invocation.method( #getNodesFor, [coin], ), - returnValue: <_i30.NodeModel>[], - ) as List<_i30.NodeModel>); + returnValue: <_i32.NodeModel>[], + ) as List<_i32.NodeModel>); @override - _i30.NodeModel? getNodeById({required String? id}) => + _i32.NodeModel? getNodeById({required String? id}) => (super.noSuchMethod(Invocation.method( #getNodeById, [], {#id: id}, - )) as _i30.NodeModel?); + )) as _i32.NodeModel?); @override - List<_i30.NodeModel> failoverNodesFor({required _i22.Coin? coin}) => + List<_i32.NodeModel> failoverNodesFor({required _i22.Coin? coin}) => (super.noSuchMethod( Invocation.method( #failoverNodesFor, [], {#coin: coin}, ), - returnValue: <_i30.NodeModel>[], - ) as List<_i30.NodeModel>); + returnValue: <_i32.NodeModel>[], + ) as List<_i32.NodeModel>); @override _i23.Future add( - _i30.NodeModel? node, + _i32.NodeModel? node, String? password, bool? shouldNotifyListeners, ) => @@ -2075,7 +2198,7 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService { ) as _i23.Future); @override _i23.Future edit( - _i30.NodeModel? editedNode, + _i32.NodeModel? editedNode, String? password, bool? shouldNotifyListeners, ) => @@ -2201,13 +2324,13 @@ class MockManager extends _i1.Mock implements _i6.Manager { returnValueForMissingStub: null, ); @override - _i23.Future<_i8.FeeObject> get fees => (super.noSuchMethod( + _i23.Future<_i9.FeeObject> get fees => (super.noSuchMethod( Invocation.getter(#fees), - returnValue: _i23.Future<_i8.FeeObject>.value(_FakeFeeObject_5( + returnValue: _i23.Future<_i9.FeeObject>.value(_FakeFeeObject_6( this, Invocation.getter(#fees), )), - ) as _i23.Future<_i8.FeeObject>); + ) as _i23.Future<_i9.FeeObject>); @override _i23.Future get maxFee => (super.noSuchMethod( Invocation.getter(#maxFee), @@ -2219,13 +2342,13 @@ class MockManager extends _i1.Mock implements _i6.Manager { returnValue: _i23.Future.value(''), ) as _i23.Future); @override - _i11.Balance get balance => (super.noSuchMethod( + _i12.Balance get balance => (super.noSuchMethod( Invocation.getter(#balance), - returnValue: _FakeBalance_8( + returnValue: _FakeBalance_9( this, Invocation.getter(#balance), ), - ) as _i11.Balance); + ) as _i12.Balance); @override _i23.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), @@ -2286,6 +2409,11 @@ class MockManager extends _i1.Mock implements _i6.Manager { returnValue: false, ) as bool); @override + bool get hasTokenSupport => (super.noSuchMethod( + Invocation.getter(#hasTokenSupport), + returnValue: false, + ) as bool); + @override bool get hasWhirlpoolSupport => (super.noSuchMethod( Invocation.getter(#hasWhirlpoolSupport), returnValue: false, @@ -2564,13 +2692,13 @@ class MockCoinServiceAPI extends _i1.Mock implements _i20.CoinServiceAPI { returnValueForMissingStub: null, ); @override - _i23.Future<_i8.FeeObject> get fees => (super.noSuchMethod( + _i23.Future<_i9.FeeObject> get fees => (super.noSuchMethod( Invocation.getter(#fees), - returnValue: _i23.Future<_i8.FeeObject>.value(_FakeFeeObject_5( + returnValue: _i23.Future<_i9.FeeObject>.value(_FakeFeeObject_6( this, Invocation.getter(#fees), )), - ) as _i23.Future<_i8.FeeObject>); + ) as _i23.Future<_i9.FeeObject>); @override _i23.Future get maxFee => (super.noSuchMethod( Invocation.getter(#maxFee), @@ -2582,13 +2710,13 @@ class MockCoinServiceAPI extends _i1.Mock implements _i20.CoinServiceAPI { returnValue: _i23.Future.value(''), ) as _i23.Future); @override - _i11.Balance get balance => (super.noSuchMethod( + _i12.Balance get balance => (super.noSuchMethod( Invocation.getter(#balance), - returnValue: _FakeBalance_8( + returnValue: _FakeBalance_9( this, Invocation.getter(#balance), ), - ) as _i11.Balance); + ) as _i12.Balance); @override _i23.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions),