diff --git a/lib/db/sqlite/firo_cache.dart b/lib/db/sqlite/firo_cache.dart index eac511aaa..d32db1bf3 100644 --- a/lib/db/sqlite/firo_cache.dart +++ b/lib/db/sqlite/firo_cache.dart @@ -9,6 +9,7 @@ import 'package:sqlite3/sqlite3.dart'; import 'package:uuid/uuid.dart'; import '../../electrumx_rpc/electrumx_client.dart'; +import '../../models/electrumx_response/spark_models.dart'; import '../../utilities/extensions/extensions.dart'; import '../../utilities/logger.dart'; import '../../utilities/stack_file_system.dart'; @@ -30,7 +31,7 @@ void _debugLog(Object? object) { } abstract class _FiroCache { - static const int _setCacheVersion = 1; + static const int _setCacheVersion = 2; static const int _tagsCacheVersion = 2; static final networks = [ @@ -134,7 +135,7 @@ abstract class _FiroCache { blockHash TEXT NOT NULL, setHash TEXT NOT NULL, groupId INTEGER NOT NULL, - timestampUTC INTEGER NOT NULL, + size INTEGER NOT NULL, UNIQUE (blockHash, setHash, groupId) ); @@ -143,7 +144,8 @@ abstract class _FiroCache { serialized TEXT NOT NULL, txHash TEXT NOT NULL, context TEXT NOT NULL, - UNIQUE(serialized, txHash, context) + groupId INTEGER NOT NULL, + UNIQUE(serialized, txHash, context, groupId) ); CREATE TABLE SparkSetCoins ( diff --git a/lib/db/sqlite/firo_cache_coordinator.dart b/lib/db/sqlite/firo_cache_coordinator.dart index fe720f804..a002dc222 100644 --- a/lib/db/sqlite/firo_cache_coordinator.dart +++ b/lib/db/sqlite/firo_cache_coordinator.dart @@ -6,6 +6,8 @@ typedef LTagPair = ({String tag, String txid}); /// background isolate and [FiroCacheCoordinator] should manage that isolate abstract class FiroCacheCoordinator { static final Map _workers = {}; + static final Map _tagLocks = {}; + static final Map _setLocks = {}; static bool _init = false; static Future init() async { @@ -15,6 +17,8 @@ abstract class FiroCacheCoordinator { _init = true; await _FiroCache.init(); for (final network in _FiroCache.networks) { + _tagLocks[network] = Mutex(); + _setLocks[network] = Mutex(); _workers[network] = await _FiroCacheWorker.spawn(network); } } @@ -31,11 +35,23 @@ abstract class FiroCacheCoordinator { final usedTagsCacheFile = File( "${dir.path}/${_FiroCache.sparkUsedTagsCacheFileName(network)}", ); - final int bytes = - ((await setCacheFile.exists()) ? await setCacheFile.length() : 0) + - ((await usedTagsCacheFile.exists()) - ? await usedTagsCacheFile.length() - : 0); + + final setSize = + (await setCacheFile.exists()) ? await setCacheFile.length() : 0; + final tagsSize = (await usedTagsCacheFile.exists()) + ? await usedTagsCacheFile.length() + : 0; + + Logging.instance.log( + "Spark cache used tags size: $tagsSize", + level: LogLevel.Debug, + ); + Logging.instance.log( + "Spark cache anon set size: $setSize", + level: LogLevel.Debug, + ); + + final int bytes = tagsSize + setSize; if (bytes < 1024) { return '$bytes B'; @@ -55,43 +71,96 @@ abstract class FiroCacheCoordinator { ElectrumXClient client, CryptoCurrencyNetwork network, ) async { - final count = await FiroCacheCoordinator.getUsedCoinTagsCount(network); - final unhashedTags = await client.getSparkUnhashedUsedCoinsTagsWithTxHashes( - startNumber: count, - ); - if (unhashedTags.isNotEmpty) { - await _workers[network]!.runTask( - FCTask( - func: FCFuncName._updateSparkUsedTagsWith, - data: unhashedTags, - ), + await _tagLocks[network]!.protect(() async { + final count = await FiroCacheCoordinator.getUsedCoinTagsCount(network); + final unhashedTags = + await client.getSparkUnhashedUsedCoinsTagsWithTxHashes( + startNumber: count, ); - } + if (unhashedTags.isNotEmpty) { + await _workers[network]!.runTask( + FCTask( + func: FCFuncName._updateSparkUsedTagsWith, + data: unhashedTags, + ), + ); + } + }); } static Future runFetchAndUpdateSparkAnonSetCacheForGroupId( int groupId, ElectrumXClient client, CryptoCurrencyNetwork network, + void Function(int countFetched, int totalCount)? progressUpdated, ) async { - final blockhashResult = - await FiroCacheCoordinator.getLatestSetInfoForGroupId( - groupId, - network, - ); - final blockHash = blockhashResult?.blockHash ?? ""; + await _setLocks[network]!.protect(() async { + const sectorSize = + 1500; // chosen as a somewhat decent value. Could be changed in the future if wanted/needed + final prevMeta = await FiroCacheCoordinator.getLatestSetInfoForGroupId( + groupId, + network, + ); - final json = await client.getSparkAnonymitySet( - coinGroupId: groupId.toString(), - startBlockHash: blockHash.toHexReversedFromBase64, - ); + final prevSize = prevMeta?.size ?? 0; - await _workers[network]!.runTask( - FCTask( - func: FCFuncName._updateSparkAnonSetCoinsWith, - data: (groupId, json), - ), - ); + final meta = await client.getSparkAnonymitySetMeta( + coinGroupId: groupId, + ); + + progressUpdated?.call(prevSize, meta.size); + + if (prevMeta?.blockHash == meta.blockHash) { + Logging.instance.log( + "prevMeta?.blockHash == meta.blockHash", + level: LogLevel.Debug, + ); + return; + } + + final numberOfCoinsToFetch = meta.size - prevSize; + + final fullSectorCount = numberOfCoinsToFetch ~/ sectorSize; + final remainder = numberOfCoinsToFetch % sectorSize; + + final List coins = []; + + for (int i = 0; i < fullSectorCount; i++) { + final start = (i * sectorSize); + final data = await client.getSparkAnonymitySetBySector( + coinGroupId: groupId, + latestBlock: meta.blockHash, + startIndex: start, + endIndex: start + sectorSize, + ); + progressUpdated?.call(start + sectorSize, numberOfCoinsToFetch); + + coins.addAll(data); + } + + if (remainder > 0) { + final data = await client.getSparkAnonymitySetBySector( + coinGroupId: groupId, + latestBlock: meta.blockHash, + startIndex: numberOfCoinsToFetch - remainder, + endIndex: numberOfCoinsToFetch, + ); + progressUpdated?.call(numberOfCoinsToFetch, numberOfCoinsToFetch); + + coins.addAll(data); + } + + final result = coins + .map((e) => RawSparkCoin.fromRPCResponse(e as List, groupId)) + .toList(); + + await _workers[network]!.runTask( + FCTask( + func: FCFuncName._updateSparkAnonSetCoinsWith, + data: (meta, result), + ), + ); + }); } // =========================================================================== @@ -165,28 +234,29 @@ abstract class FiroCacheCoordinator { ); } - static Future< - List< - ({ - String serialized, - String txHash, - String context, - })>> getSetCoinsForGroupId( + static Future> getSetCoinsForGroupId( int groupId, { - int? newerThanTimeStamp, + String? afterBlockHash, required CryptoCurrencyNetwork network, }) async { - final resultSet = await _Reader._getSetCoinsForGroupId( - groupId, - db: _FiroCache.setCacheDB(network), - newerThanTimeStamp: newerThanTimeStamp, - ); + final resultSet = afterBlockHash == null + ? await _Reader._getSetCoinsForGroupId( + groupId, + db: _FiroCache.setCacheDB(network), + ) + : await _Reader._getSetCoinsForGroupIdAndBlockHash( + groupId, + afterBlockHash, + db: _FiroCache.setCacheDB(network), + ); + return resultSet .map( - (row) => ( + (row) => RawSparkCoin( serialized: row["serialized"] as String, txHash: row["txHash"] as String, context: row["context"] as String, + groupId: groupId, ), ) .toList() @@ -194,12 +264,7 @@ abstract class FiroCacheCoordinator { .toList(); } - static Future< - ({ - String blockHash, - String setHash, - int timestampUTC, - })?> getLatestSetInfoForGroupId( + static Future getLatestSetInfoForGroupId( int groupId, CryptoCurrencyNetwork network, ) async { @@ -212,10 +277,11 @@ abstract class FiroCacheCoordinator { return null; } - return ( + return SparkAnonymitySetMeta( + coinGroupId: groupId, blockHash: result.first["blockHash"] as String, setHash: result.first["setHash"] as String, - timestampUTC: result.first["timestampUTC"] as int, + size: result.first["size"] as int, ); } diff --git a/lib/db/sqlite/firo_cache_reader.dart b/lib/db/sqlite/firo_cache_reader.dart index 33763ba3e..67fea7764 100644 --- a/lib/db/sqlite/firo_cache_reader.dart +++ b/lib/db/sqlite/firo_cache_reader.dart @@ -8,21 +8,15 @@ abstract class _Reader { static Future _getSetCoinsForGroupId( int groupId, { required Database db, - int? newerThanTimeStamp, }) async { - String query = """ - SELECT sc.serialized, sc.txHash, sc.context + final query = """ + SELECT sc.serialized, sc.txHash, sc.context, sc.groupId FROM SparkSet AS ss JOIN SparkSetCoins AS ssc ON ss.id = ssc.setId JOIN SparkCoin AS sc ON ssc.coinId = sc.id - WHERE ss.groupId = $groupId + WHERE ss.groupId = $groupId; """; - if (newerThanTimeStamp != null) { - query += " AND ss.timestampUTC" - " > $newerThanTimeStamp"; - } - return db.select("$query;"); } @@ -31,16 +25,45 @@ abstract class _Reader { required Database db, }) async { final query = """ - SELECT ss.blockHash, ss.setHash, ss.timestampUTC + SELECT ss.blockHash, ss.setHash, ss.size FROM SparkSet ss WHERE ss.groupId = $groupId - ORDER BY ss.timestampUTC DESC + ORDER BY ss.size DESC LIMIT 1; """; return db.select("$query;"); } + static Future _getSetCoinsForGroupIdAndBlockHash( + int groupId, + String blockHash, { + required Database db, + }) async { + const query = """ + WITH TargetBlock AS ( + SELECT id + FROM SparkSet + WHERE blockHash = ? + ), + TargetSets AS ( + SELECT id AS setId + FROM SparkSet + WHERE groupId = ? AND id > (SELECT id FROM TargetBlock) + ) + SELECT + SparkCoin.serialized, + SparkCoin.txHash, + SparkCoin.context, + SparkCoin.groupId + FROM SparkSetCoins + JOIN SparkCoin ON SparkSetCoins.coinId = SparkCoin.id + WHERE SparkSetCoins.setId IN (SELECT setId FROM TargetSets); + """; + + return db.select("$query;", [blockHash, groupId]); + } + static Future _checkSetInfoForGroupIdExists( int groupId, { required Database db, diff --git a/lib/db/sqlite/firo_cache_worker.dart b/lib/db/sqlite/firo_cache_worker.dart index 71e407992..abaceb288 100644 --- a/lib/db/sqlite/firo_cache_worker.dart +++ b/lib/db/sqlite/firo_cache_worker.dart @@ -48,7 +48,11 @@ class _FiroCacheWorker { try { await Isolate.spawn( _startWorkerIsolate, - (initPort.sendPort, setCacheFilePath, usedTagsCacheFilePath), + ( + initPort.sendPort, + setCacheFilePath, + usedTagsCacheFilePath, + ), ); } catch (_) { initPort.close(); @@ -90,7 +94,8 @@ class _FiroCacheWorker { final FCResult result; switch (task.func) { case FCFuncName._updateSparkAnonSetCoinsWith: - final data = task.data as (int, Map); + final data = + task.data as (SparkAnonymitySetMeta, List); result = _updateSparkAnonSetCoinsWith( setCacheDb, data.$2, diff --git a/lib/db/sqlite/firo_cache_writer.dart b/lib/db/sqlite/firo_cache_writer.dart index 99d318444..63192d964 100644 --- a/lib/db/sqlite/firo_cache_writer.dart +++ b/lib/db/sqlite/firo_cache_writer.dart @@ -52,29 +52,13 @@ FCResult _updateSparkUsedTagsWith( // ================== write to spark anon set cache ========================== /// update the sqlite cache -/// Expected json format: -/// { -/// "blockHash": "someBlockHash", -/// "setHash": "someSetHash", -/// "coins": [ -/// ["serliazed1", "hash1", "context1"], -/// ["serliazed2", "hash2", "context2"], -/// ... -/// ["serliazed3", "hash3", "context3"], -/// ["serliazed4", "hash4", "context4"], -/// ], -/// } /// /// returns true if successful, otherwise false FCResult _updateSparkAnonSetCoinsWith( Database db, - Map json, - int groupId, + final List coinsRaw, + SparkAnonymitySetMeta meta, ) { - final blockHash = json["blockHash"] as String; - final setHash = json["setHash"] as String; - final coinsRaw = json["coins"] as List; - if (coinsRaw.isEmpty) { // no coins to actually insert return FCResult(success: true); @@ -87,9 +71,9 @@ FCResult _updateSparkAnonSetCoinsWith( WHERE blockHash = ? AND setHash = ? AND groupId = ?; """, [ - blockHash, - setHash, - groupId, + meta.blockHash, + meta.setHash, + meta.coinGroupId, ], ); @@ -98,59 +82,28 @@ FCResult _updateSparkAnonSetCoinsWith( return FCResult(success: true); } - final coins = coinsRaw - .map( - (e) => [ - e[0] as String, - e[1] as String, - e[2] as String, - ], - ) - .toList() - .reversed; - - final timestamp = DateTime.now().toUtc().millisecondsSinceEpoch ~/ 1000; + final coins = coinsRaw.reversed; db.execute("BEGIN;"); try { db.execute( """ - INSERT INTO SparkSet (blockHash, setHash, groupId, timestampUTC) + INSERT INTO SparkSet (blockHash, setHash, groupId, size) VALUES (?, ?, ?, ?); """, - [blockHash, setHash, groupId, timestamp], + [meta.blockHash, meta.setHash, meta.coinGroupId, meta.size], ); final setId = db.lastInsertRowId; for (final coin in coins) { - int coinId; - try { - // try to insert and get row id - db.execute( - """ - INSERT INTO SparkCoin (serialized, txHash, context) - VALUES (?, ?, ?); + db.execute( + """ + INSERT INTO SparkCoin (serialized, txHash, context, groupId) + VALUES (?, ?, ?, ?); """, - coin, - ); - coinId = db.lastInsertRowId; - } on SqliteException catch (e) { - // if there already is a matching coin in the db - // just grab its row id - if (e.extendedResultCode == 2067) { - final result = db.select( - """ - SELECT id - FROM SparkCoin - WHERE serialized = ? AND txHash = ? AND context = ?; - """, - coin, - ); - coinId = result.first["id"] as int; - } else { - rethrow; - } - } + [coin.serialized, coin.txHash, coin.context, coin.groupId], + ); + final coinId = db.lastInsertRowId; // finally add the row id to the newly added set db.execute( diff --git a/lib/electrumx_rpc/electrumx_client.dart b/lib/electrumx_rpc/electrumx_client.dart index dff2b68fd..8ff04712a 100644 --- a/lib/electrumx_rpc/electrumx_client.dart +++ b/lib/electrumx_rpc/electrumx_client.dart @@ -21,6 +21,7 @@ import 'package:mutex/mutex.dart'; import 'package:stream_channel/stream_channel.dart'; import '../exceptions/electrumx/no_such_transaction.dart'; +import '../models/electrumx_response/spark_models.dart'; import '../services/event_bus/events/global/tor_connection_status_changed_event.dart'; import '../services/event_bus/events/global/tor_status_changed_event.dart'; import '../services/event_bus/global_event_bus.dart'; @@ -34,13 +35,6 @@ import '../wallets/crypto_currency/crypto_currency.dart'; import '../wallets/crypto_currency/interfaces/electrumx_currency_interface.dart'; import 'client_manager.dart'; -typedef SparkMempoolData = ({ - String txid, - List serialContext, - List lTags, - List coins, -}); - class WifiOnlyException implements Exception {} class TorOnlyException implements Exception {} @@ -108,7 +102,7 @@ class ElectrumXClient { late Prefs _prefs; late TorService _torService; - List? failovers; + late final List _failovers; int currentFailoverIndex = -1; final Duration connectionTimeoutForSpecialCaseJsonRPCClients; @@ -145,6 +139,7 @@ class ElectrumXClient { _host = host; _port = port; _useSSL = useSSL; + _failovers = failovers; final bus = globalEventBusForTesting ?? GlobalEventBus.instance; @@ -284,9 +279,11 @@ class ElectrumXClient { usePort = port; useUseSSL = useSSL; } else { - useHost = failovers![currentFailoverIndex].address; - usePort = failovers![currentFailoverIndex].port; - useUseSSL = failovers![currentFailoverIndex].useSSL; + _electrumAdapterChannel = null; + await ClientManager.sharedInstance.remove(cryptoCurrency: cryptoCurrency); + useHost = _failovers[currentFailoverIndex].address; + usePort = _failovers[currentFailoverIndex].port; + useUseSSL = _failovers[currentFailoverIndex].useSSL; } _electrumAdapterChannel ??= await electrum_adapter.connect( @@ -402,7 +399,12 @@ class ElectrumXClient { rethrow; } } catch (e) { - if (failovers != null && currentFailoverIndex < failovers!.length - 1) { + final errorMessage = e.toString(); + Logging.instance.log("$host $e", level: LogLevel.Debug); + if (errorMessage.contains("JSON-RPC error")) { + currentFailoverIndex = _failovers.length; + } + if (currentFailoverIndex < _failovers.length - 1) { currentFailoverIndex++; return request( command: command, @@ -495,7 +497,7 @@ class ElectrumXClient { rethrow; } } catch (e) { - if (failovers != null && currentFailoverIndex < failovers!.length - 1) { + if (currentFailoverIndex < _failovers.length - 1) { currentFailoverIndex++; return batchRequest( command: command, @@ -528,10 +530,10 @@ class ElectrumXClient { return await request( requestID: requestID, command: 'server.ping', - requestTimeout: const Duration(seconds: 3), + requestTimeout: const Duration(seconds: 30), retries: retryCount, ).timeout( - const Duration(seconds: 3), + const Duration(seconds: 30), onTimeout: () { Logging.instance.log( "ElectrumxClient.ping timed out with retryCount=$retryCount, host=$_host", @@ -1034,29 +1036,30 @@ class ElectrumXClient { /// "b476ed2b374bb081ea51d111f68f0136252521214e213d119b8dc67b92f5a390", /// ] /// } - Future>> getSparkMintMetaData({ - String? requestID, - required List sparkCoinHashes, - }) async { - try { - Logging.instance.log( - "attempting to fetch spark.getsparkmintmetadata...", - level: LogLevel.Info, - ); - await checkElectrumAdapter(); - final List response = - await (getElectrumAdapter() as FiroElectrumClient) - .getSparkMintMetaData(sparkCoinHashes: sparkCoinHashes); - Logging.instance.log( - "Fetching spark.getsparkmintmetadata finished", - level: LogLevel.Info, - ); - return List>.from(response); - } catch (e) { - Logging.instance.log(e, level: LogLevel.Error); - rethrow; - } - } + /// NOT USED? + // Future>> getSparkMintMetaData({ + // String? requestID, + // required List sparkCoinHashes, + // }) async { + // try { + // Logging.instance.log( + // "attempting to fetch spark.getsparkmintmetadata...", + // level: LogLevel.Info, + // ); + // await checkElectrumAdapter(); + // final List response = + // await (getElectrumAdapter() as FiroElectrumClient) + // .getSparkMintMetaData(sparkCoinHashes: sparkCoinHashes); + // Logging.instance.log( + // "Fetching spark.getsparkmintmetadata finished", + // level: LogLevel.Info, + // ); + // return List>.from(response); + // } catch (e) { + // Logging.instance.log(e, level: LogLevel.Error); + // rethrow; + // } + // } /// Returns the latest Spark set id /// @@ -1132,7 +1135,7 @@ class ElectrumXClient { final List result = []; for (final entry in map.entries) { result.add( - ( + SparkMempoolData( txid: entry.key, serialContext: List.from(entry.value["serial_context"] as List), @@ -1188,6 +1191,98 @@ class ElectrumXClient { rethrow; } } + // ======== New Paginated Endpoints ========================================== + + Future getSparkAnonymitySetMeta({ + String? requestID, + required int coinGroupId, + }) async { + try { + const command = "spark.getsparkanonymitysetmeta"; + Logging.instance.log( + "[${getElectrumAdapter()?.host}] => attempting to fetch $command...", + level: LogLevel.Info, + ); + + final start = DateTime.now(); + final response = await request( + requestID: requestID, + command: command, + args: [ + "$coinGroupId", + ], + ); + + final map = Map.from(response as Map); + + final result = SparkAnonymitySetMeta( + coinGroupId: coinGroupId, + blockHash: map["blockHash"] as String, + setHash: map["setHash"] as String, + size: map["size"] as int, + ); + + Logging.instance.log( + "Finished ElectrumXClient.getSparkAnonymitySetMeta(" + "requestID=$requestID, " + "coinGroupId=$coinGroupId" + "). Set meta=$result, " + "Duration=${DateTime.now().difference(start)}", + level: LogLevel.Debug, + ); + + return result; + } catch (e) { + Logging.instance.log(e, level: LogLevel.Error); + rethrow; + } + } + + Future> getSparkAnonymitySetBySector({ + String? requestID, + required int coinGroupId, + required String latestBlock, + required int startIndex, // inclusive + required int endIndex, // exclusive + }) async { + try { + const command = + "spark.getsparkanonymitysetsector"; // TODO verify this will be correct + final start = DateTime.now(); + final response = await request( + requestID: requestID, + command: command, + args: [ + "$coinGroupId", + latestBlock, + "$startIndex", + "$endIndex", + ], + ); + + final map = Map.from(response as Map); + + final result = map["coins"] as List; + + Logging.instance.log( + "Finished ElectrumXClient.getSparkAnonymitySetBySector(" + "requestID=$requestID, " + "coinGroupId=$coinGroupId, " + "latestBlock=$latestBlock, " + "startIndex=$startIndex, " + "endIndex=$endIndex" + "). # of coins=${result.length}, " + "Duration=${DateTime.now().difference(start)}", + level: LogLevel.Debug, + ); + + return result; + } catch (e) { + Logging.instance.log(e, level: LogLevel.Error); + rethrow; + } + } + // =========================================================================== Future isMasterNodeCollateral({ diff --git a/lib/models/electrumx_response/spark_models.dart b/lib/models/electrumx_response/spark_models.dart new file mode 100644 index 000000000..43bf9f61f --- /dev/null +++ b/lib/models/electrumx_response/spark_models.dart @@ -0,0 +1,98 @@ +class SparkMempoolData { + final String txid; + final List serialContext; + final List lTags; + final List coins; + + SparkMempoolData({ + required this.txid, + required this.serialContext, + required this.lTags, + required this.coins, + }); + + @override + String toString() { + return "SparkMempoolData{" + "txid: $txid, " + "serialContext: $serialContext, " + "lTags: $lTags, " + "coins: $coins" + "}"; + } +} + +class SparkAnonymitySetMeta { + final int coinGroupId; + final String blockHash; + final String setHash; + final int size; + + SparkAnonymitySetMeta({ + required this.coinGroupId, + required this.blockHash, + required this.setHash, + required this.size, + }); + + @override + String toString() { + return "SparkAnonymitySetMeta{" + "coinGroupId: $coinGroupId, " + "blockHash: $blockHash, " + "setHash: $setHash, " + "size: $size" + "}"; + } +} + +class RawSparkCoin { + final String serialized; + final String txHash; + final String context; + final int groupId; + + RawSparkCoin({ + required this.serialized, + required this.txHash, + required this.context, + required this.groupId, + }); + + static RawSparkCoin fromRPCResponse(List data, int groupId) { + try { + if (data.length != 3) throw Exception(); + return RawSparkCoin( + serialized: data[0] as String, + txHash: data[1] as String, + context: data[2] as String, + groupId: groupId, + ); + } catch (_) { + throw Exception("Invalid coin data: $data"); + } + } + + @override + bool operator ==(Object other) { + if (identical(this, other)) return true; + if (other is! RawSparkCoin) return false; + return serialized == other.serialized && + txHash == other.txHash && + groupId == other.groupId && + context == other.context; + } + + @override + int get hashCode => Object.hash(serialized, txHash, context); + + @override + String toString() { + return "SparkAnonymitySetMeta{" + "serialized: $serialized, " + "txHash: $txHash, " + "context: $context, " + "groupId: $groupId" + "}"; + } +} diff --git a/lib/models/isar/models/blockchain_data/address.g.dart b/lib/models/isar/models/blockchain_data/address.g.dart index 092198990..340ab9f1b 100644 --- a/lib/models/isar/models/blockchain_data/address.g.dart +++ b/lib/models/isar/models/blockchain_data/address.g.dart @@ -278,6 +278,7 @@ const _AddresstypeEnumValueMap = { 'frostMS': 13, 'p2tr': 14, 'solana': 15, + 'cardanoShelley': 16, }; const _AddresstypeValueEnumMap = { 0: AddressType.p2pkh, @@ -296,6 +297,7 @@ const _AddresstypeValueEnumMap = { 13: AddressType.frostMS, 14: AddressType.p2tr, 15: AddressType.solana, + 16: AddressType.cardanoShelley, }; Id _addressGetId(Address object) { diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart index 1be577f1d..f8eb344a8 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart @@ -39,6 +39,7 @@ import '../../../../wallets/isar/providers/wallet_info_provider.dart'; import '../../../../wallets/wallet/impl/epiccash_wallet.dart'; import '../../../../wallets/wallet/impl/monero_wallet.dart'; import '../../../../wallets/wallet/impl/wownero_wallet.dart'; +import '../../../../wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart'; import '../../../../widgets/animated_text.dart'; import '../../../../widgets/background.dart'; import '../../../../widgets/conditional_parent.dart'; @@ -233,7 +234,10 @@ class _WalletNetworkSettingsViewState _percent = 1; _blocksRemaining = 0; } else { - _percent = 0; + _percent = + (ref.read(pWallets).getWallet(widget.walletId) as ElectrumXInterface?) + ?.refreshingPercent ?? + 0; _blocksRemaining = -1; } diff --git a/lib/services/node_service.dart b/lib/services/node_service.dart index e55e2218b..db4a25a1b 100644 --- a/lib/services/node_service.dart +++ b/lib/services/node_service.dart @@ -32,6 +32,49 @@ class NodeService extends ChangeNotifier { }); Future updateDefaults() async { + // hack + if (AppConfig.coins.where((e) => e.identifier == "firo").isNotEmpty) { + final others = [ + "electrumx01.firo.org", + "electrumx02.firo.org", + "electrumx03.firo.org", + "electrumx.firo.org", + ]; + const port = 50002; + const idPrefix = "not_a_real_default_but_temp"; + + for (final host in others) { + final _id = "${idPrefix}_$host"; + + NodeModel? node = DB.instance.get( + boxName: DB.boxNameNodeModels, + key: _id, + ); + + if (node == null) { + node = NodeModel( + host: host, + port: port, + name: host, + id: _id, + useSSL: true, + enabled: true, + coinName: "firo", + isFailover: true, + isDown: false, + torEnabled: true, + clearnetEnabled: true, + ); + + await DB.instance.put( + boxName: DB.boxNameNodeModels, + key: _id, + value: node, + ); + } + } + } + for (final defaultNode in AppConfig.coins.map( (e) => e.defaultNode, )) { diff --git a/lib/utilities/constants.dart b/lib/utilities/constants.dart index 6b64d4a73..163b7d04e 100644 --- a/lib/utilities/constants.dart +++ b/lib/utilities/constants.dart @@ -35,7 +35,7 @@ abstract class Constants { // // true; // true for development, static const int notificationsMax = 0xFFFFFFFF; - static const Duration networkAliveTimerDuration = Duration(seconds: 10); + static const Duration networkAliveTimerDuration = Duration(seconds: 30); // Enable Logger.print statements static const bool disableLogger = false; diff --git a/lib/wallets/isar/models/spark_coin.dart b/lib/wallets/isar/models/spark_coin.dart index d3ef6825c..9501bf06d 100644 --- a/lib/wallets/isar/models/spark_coin.dart +++ b/lib/wallets/isar/models/spark_coin.dart @@ -1,3 +1,5 @@ +import 'dart:math'; + import 'package:isar/isar.dart'; part 'spark_coin.g.dart'; @@ -59,6 +61,19 @@ class SparkCoin { @ignore BigInt get diversifier => BigInt.parse(diversifierIntString); + int getConfirmations(int currentChainHeight) { + if (height == null || height! <= 0) return 0; + return max(0, currentChainHeight - (height! - 1)); + } + + bool isConfirmed( + int currentChainHeight, + int minimumConfirms, + ) { + final confirmations = getConfirmations(currentChainHeight); + return confirmations >= minimumConfirms; + } + SparkCoin({ required this.walletId, required this.type, diff --git a/lib/wallets/isar/models/wallet_info.dart b/lib/wallets/isar/models/wallet_info.dart index eb6a4e9ea..51aa69a45 100644 --- a/lib/wallets/isar/models/wallet_info.dart +++ b/lib/wallets/isar/models/wallet_info.dart @@ -520,8 +520,8 @@ abstract class WalletInfoKeys { static const String lelantusCoinIsarRescanRequired = "lelantusCoinIsarRescanRequired"; static const String enableLelantusScanning = "enableLelantusScanningKey"; - static const String firoSparkCacheSetTimestampCache = - "firoSparkCacheSetTimestampCacheKey"; + static const String firoSparkCacheSetBlockHashCache = + "firoSparkCacheSetBlockHashCacheKey"; static const String enableOptInRbf = "enableOptInRbfKey"; static const String reuseAddress = "reuseAddressKey"; static const String isViewOnlyKey = "isViewOnlyKey"; diff --git a/lib/wallets/isar/models/wallet_info.g.dart b/lib/wallets/isar/models/wallet_info.g.dart index 89c5511fa..6e02fd6d5 100644 --- a/lib/wallets/isar/models/wallet_info.g.dart +++ b/lib/wallets/isar/models/wallet_info.g.dart @@ -268,6 +268,7 @@ const _WalletInfomainAddressTypeEnumValueMap = { 'frostMS': 13, 'p2tr': 14, 'solana': 15, + 'cardanoShelley': 16, }; const _WalletInfomainAddressTypeValueEnumMap = { 0: AddressType.p2pkh, @@ -286,6 +287,7 @@ const _WalletInfomainAddressTypeValueEnumMap = { 13: AddressType.frostMS, 14: AddressType.p2tr, 15: AddressType.solana, + 16: AddressType.cardanoShelley, }; Id _walletInfoGetId(WalletInfo object) { diff --git a/lib/wallets/wallet/impl/firo_wallet.dart b/lib/wallets/wallet/impl/firo_wallet.dart index 1ff9999fe..d149a7a9e 100644 --- a/lib/wallets/wallet/impl/firo_wallet.dart +++ b/lib/wallets/wallet/impl/firo_wallet.dart @@ -93,33 +93,13 @@ class FiroWallet extends Bip39HDWallet .walletIdEqualToAnyLTagHash(walletId) .findAll(); - final Set sparkTxids = {}; - - for (final coin in sparkCoins) { - sparkTxids.add(coin.txHash); - // check for duplicates before adding to list - if (allTxHashes.indexWhere((e) => e["tx_hash"] == coin.txHash) == -1) { - final info = { - "tx_hash": coin.txHash, - "height": coin.height, - }; - allTxHashes.add(info); - } - } - - final missing = await getMissingSparkSpendTransactionIds(); - for (final txid in missing.map((e) => e.txid).toSet()) { - allTxHashes.add({ - "tx_hash": txid, - }); - } - final List> allTransactions = []; // some lelantus transactions aren't fetched via wallet addresses so they // will never show as confirmed in the gui. - final unconfirmedTransactions = await mainDB - .getTransactions(walletId) + final unconfirmedTransactions = await mainDB.isar.transactionV2s + .where() + .walletIdEqualTo(walletId) .filter() .heightIsNull() .findAll(); @@ -137,21 +117,54 @@ class FiroWallet extends Bip39HDWallet final info = { "tx_hash": tx.txid, "height": height, - "address": tx.address.value?.value, }; allTxHashes.add(info); } } - for (final txHash in allTxHashes) { - // final storedTx = await db - // .getTransactions(walletId) - // .filter() - // .txidEqualTo(txHash["tx_hash"] as String) - // .findFirst(); + final Set sparkTxids = {}; + for (final coin in sparkCoins) { + sparkTxids.add(coin.txHash); + // check for duplicates before adding to list + if (allTxHashes.indexWhere((e) => e["tx_hash"] == coin.txHash) == -1) { + final info = { + "tx_hash": coin.txHash, + "height": coin.height, + }; + allTxHashes.add(info); + } + } + + final missing = await getSparkSpendTransactionIds(); + for (final txid in missing.map((e) => e.txid).toSet()) { + // check for duplicates before adding to list + if (allTxHashes.indexWhere((e) => e["tx_hash"] == txid) == -1) { + final info = { + "tx_hash": txid, + }; + allTxHashes.add(info); + } + } + + final currentHeight = await chainHeight; - // if (storedTx == null || - // !storedTx.isConfirmed(currentHeight, MINIMUM_CONFIRMATIONS)) { + for (final txHash in allTxHashes) { + final storedTx = await mainDB.isar.transactionV2s + .where() + .walletIdEqualTo(walletId) + .filter() + .txidEqualTo(txHash["tx_hash"] as String) + .findFirst(); + + if (storedTx?.isConfirmed( + currentHeight, + cryptoCurrency.minConfirms, + cryptoCurrency.minCoinbaseConfirms, + ) == + true) { + // tx already confirmed, no need to process it again + continue; + } // firod/electrumx seem to take forever to process spark txns so we'll // just ignore null errors and check again on next refresh. @@ -174,7 +187,6 @@ class FiroWallet extends Bip39HDWallet tx["height"] ??= txHash["height"]; allTransactions.add(tx); } - // } } final List txns = []; @@ -193,7 +205,6 @@ class FiroWallet extends Bip39HDWallet bool isMint = false; bool isJMint = false; bool isSparkMint = false; - final bool isMasterNodePayment = false; final bool isSparkSpend = txData["type"] == 9 && txData["version"] == 3; final bool isMySpark = sparkTxids.contains(txData["txid"] as String); final bool isMySpentSpark = @@ -671,7 +682,7 @@ class FiroWallet extends Bip39HDWallet // reset last checked values await info.updateOtherData( newEntries: { - WalletInfoKeys.firoSparkCacheSetTimestampCache: {}, + WalletInfoKeys.firoSparkCacheSetBlockHashCache: {}, }, isar: mainDB.isar, ); @@ -725,6 +736,7 @@ class FiroWallet extends Bip39HDWallet i, electrumXClient, cryptoCurrency.network, + null, ), ); } diff --git a/lib/wallets/wallet/wallet.dart b/lib/wallets/wallet/wallet.dart index 0beaf2a80..b0516b74e 100644 --- a/lib/wallets/wallet/wallet.dart +++ b/lib/wallets/wallet/wallet.dart @@ -415,6 +415,11 @@ abstract class Wallet { } void _periodicPingCheck() async { + if (refreshMutex.isLocked) { + // should be active calls happening so no need to make extra work + return; + } + final bool hasNetwork = await pingCheck(); if (_isConnected != hasNetwork) { @@ -559,6 +564,11 @@ abstract class Wallet { return future; } + void _fireRefreshPercentChange(double percent) { + (this as ElectrumXInterface?)?.refreshingPercent = percent; + GlobalEventBus.instance.fire(RefreshPercentChangedEvent(percent, walletId)); + } + // Should fire events Future _refresh(Completer completer) async { // Awaiting this lock could be dangerous. @@ -568,22 +578,6 @@ abstract class Wallet { } final start = DateTime.now(); - bool tAlive = true; - final t = Timer.periodic(const Duration(seconds: 1), (timer) async { - if (tAlive) { - final pingSuccess = await pingCheck(); - if (!pingSuccess) { - tAlive = false; - } - } else { - timer.cancel(); - } - }); - - void _checkAlive() { - if (!tAlive) throw Exception("refresh alive ping failure"); - } - final viewOnly = this is ViewOnlyOptionInterface && (this as ViewOnlyOptionInterface).isViewOnly; @@ -600,61 +594,47 @@ abstract class Wallet { ), ); - _checkAlive(); - // add some small buffer before making calls. // this can probably be removed in the future but was added as a // debugging feature await Future.delayed(const Duration(milliseconds: 300)); - _checkAlive(); // TODO: [prio=low] handle this differently. Extra modification of this file for coin specific functionality should be avoided. final Set codesToCheck = {}; - _checkAlive(); if (this is PaynymInterface && !viewOnly) { // isSegwit does not matter here at all final myCode = await (this as PaynymInterface).getPaymentCode(isSegwit: false); - _checkAlive(); final nym = await PaynymIsApi().nym(myCode.toString()); - _checkAlive(); if (nym.value != null) { for (final follower in nym.value!.followers) { codesToCheck.add(follower.code); } - _checkAlive(); for (final following in nym.value!.following) { codesToCheck.add(following.code); } } - _checkAlive(); } - GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.0, walletId)); - _checkAlive(); + _fireRefreshPercentChange(0); await updateChainHeight(); - _checkAlive(); if (this is BitcoinFrostWallet) { await (this as BitcoinFrostWallet).lookAhead(); } - _checkAlive(); - GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.1, walletId)); + _fireRefreshPercentChange(0.1); - _checkAlive(); // TODO: [prio=low] handle this differently. Extra modification of this file for coin specific functionality should be avoided. if (this is MultiAddressInterface) { if (info.otherData[WalletInfoKeys.reuseAddress] != true) { await (this as MultiAddressInterface) .checkReceivingAddressForTransactions(); } - _checkAlive(); } - GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.2, walletId)); - _checkAlive(); + _fireRefreshPercentChange(0.2); // TODO: [prio=low] handle this differently. Extra modification of this file for coin specific functionality should be avoided. if (this is MultiAddressInterface) { @@ -663,67 +643,52 @@ abstract class Wallet { .checkChangeAddressForTransactions(); } } - _checkAlive(); - GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.3, walletId)); + _fireRefreshPercentChange(0.3); if (this is SparkInterface && !viewOnly) { // this should be called before updateTransactions() - await (this as SparkInterface).refreshSparkData(); + await (this as SparkInterface).refreshSparkData((0.3, 0.6)); } - _checkAlive(); - GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.50, walletId)); - _checkAlive(); final fetchFuture = updateTransactions(); - _checkAlive(); + + _fireRefreshPercentChange(0.6); final utxosRefreshFuture = updateUTXOs(); // if (currentHeight != storedHeight) { - GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.60, walletId)); + _fireRefreshPercentChange(0.65); - _checkAlive(); await utxosRefreshFuture; - GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.70, walletId)); + _fireRefreshPercentChange(0.70); - _checkAlive(); await fetchFuture; // TODO: [prio=low] handle this differently. Extra modification of this file for coin specific functionality should be avoided. if (!viewOnly && this is PaynymInterface && codesToCheck.isNotEmpty) { - _checkAlive(); await (this as PaynymInterface) .checkForNotificationTransactionsTo(codesToCheck); // check utxos again for notification outputs - _checkAlive(); await updateUTXOs(); } - _checkAlive(); - GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.80, walletId)); + _fireRefreshPercentChange(0.80); // await getAllTxsToWatch(); - _checkAlive(); // TODO: [prio=low] handle this differently. Extra modification of this file for coin specific functionality should be avoided. if (this is LelantusInterface && !viewOnly) { if (info.otherData[WalletInfoKeys.enableLelantusScanning] as bool? ?? false) { await (this as LelantusInterface).refreshLelantusData(); - _checkAlive(); } } - GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.90, walletId)); + _fireRefreshPercentChange(0.90); - _checkAlive(); await updateBalance(); - _checkAlive(); - GlobalEventBus.instance.fire(RefreshPercentChangedEvent(1.0, walletId)); - - tAlive = false; // interrupt timer as its not needed anymore + _fireRefreshPercentChange(1.0); completer.complete(); } catch (error, strace) { completer.completeError(error, strace); } finally { - t.cancel(); refreshMutex.release(); if (!completer.isCompleted) { completer.completeError( diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart index cc49149d9..b59041ef8 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart @@ -42,6 +42,8 @@ mixin ElectrumXInterface int? get maximumFeerate => null; + double? refreshingPercent; + static const _kServerBatchCutoffVersion = [1, 6]; List? _serverVersion; Future get serverCanBatch async { diff --git a/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart b/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart index 977a95124..186eb5663 100644 --- a/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart +++ b/lib/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart @@ -14,6 +14,8 @@ import '../../../models/isar/models/blockchain_data/v2/output_v2.dart'; import '../../../models/isar/models/blockchain_data/v2/transaction_v2.dart'; import '../../../models/isar/models/isar_models.dart'; import '../../../models/signing_data.dart'; +import '../../../services/event_bus/events/global/refresh_percent_changed_event.dart'; +import '../../../services/event_bus/global_event_bus.dart'; import '../../../utilities/amount/amount.dart'; import '../../../utilities/enums/derive_path_type_enum.dart'; import '../../../utilities/extensions/extensions.dart'; @@ -795,7 +797,25 @@ mixin SparkInterface } } - Future refreshSparkData() async { + // returns next percent + double _triggerEventHelper(double current, double increment) { + refreshingPercent = current; + GlobalEventBus.instance.fire( + RefreshPercentChangedEvent( + current, + walletId, + ), + ); + return current + increment; + } + + // Linearly make calls so there is less chance of timing out or otherwise breaking + Future refreshSparkData( + ( + double startingPercent, + double endingPercent, + )? refreshProgressRange, + ) async { final start = DateTime.now(); try { // start by checking if any previous sets are missing from db and add the @@ -816,30 +836,61 @@ mixin SparkInterface } groupIds.add(latestGroupId); - // start fetch and update process for each set groupId as required - final possibleFutures = groupIds.map( - (e) => - FiroCacheCoordinator.runFetchAndUpdateSparkAnonSetCacheForGroupId( - e, + final steps = groupIds.length + + 1 // get used tags step + + + 1 // check updated cache step + + + 1 // identify coins step + + + 1 // cross ref coins and txns + + + 1; // update balance + + final percentIncrement = refreshProgressRange == null + ? null + : (refreshProgressRange.$2 - refreshProgressRange.$1) / steps; + double currentPercent = refreshProgressRange?.$1 ?? 0; + + // fetch and update process for each set groupId as required + for (final gId in groupIds) { + await FiroCacheCoordinator.runFetchAndUpdateSparkAnonSetCacheForGroupId( + gId, electrumXClient, cryptoCurrency.network, - ), + // null, + (a, b) { + if (percentIncrement != null) { + _triggerEventHelper( + currentPercent + (percentIncrement * (a / b)), + 0, + ); + } + }, + ); + if (percentIncrement != null) { + currentPercent += percentIncrement; + } + } + + if (percentIncrement != null) { + currentPercent = _triggerEventHelper(currentPercent, percentIncrement); + } + + await FiroCacheCoordinator.runFetchAndUpdateSparkUsedCoinTags( + electrumXClient, + cryptoCurrency.network, ); - // wait for each fetch and update to complete - await Future.wait([ - ...possibleFutures, - FiroCacheCoordinator.runFetchAndUpdateSparkUsedCoinTags( - electrumXClient, - cryptoCurrency.network, - ), - ]); + if (percentIncrement != null) { + currentPercent = _triggerEventHelper(currentPercent, percentIncrement); + } - // Get cached timestamps per groupId. These timestamps are used to check + // Get cached block hashes per groupId. These hashes are used to check // and try to id coins that were added to the spark anon set cache - // after that timestamp. - final groupIdTimestampUTCMap = - info.otherData[WalletInfoKeys.firoSparkCacheSetTimestampCache] + // after that block. + final groupIdBlockHashMap = + info.otherData[WalletInfoKeys.firoSparkCacheSetBlockHashCache] as Map? ?? {}; @@ -847,8 +898,7 @@ mixin SparkInterface // processed by this wallet yet final Map>> rawCoinsBySetId = {}; for (int i = 1; i <= latestGroupId; i++) { - final lastCheckedTimeStampUTC = - groupIdTimestampUTCMap[i.toString()] as int? ?? 0; + final lastCheckedHash = groupIdBlockHashMap[i.toString()] as String?; final info = await FiroCacheCoordinator.getLatestSetInfoForGroupId( i, cryptoCurrency.network, @@ -856,7 +906,7 @@ mixin SparkInterface final anonymitySetResult = await FiroCacheCoordinator.getSetCoinsForGroupId( i, - newerThanTimeStamp: lastCheckedTimeStampUTC, + afterBlockHash: lastCheckedHash, network: cryptoCurrency.network, ); final coinsRaw = anonymitySetResult @@ -873,11 +923,12 @@ mixin SparkInterface rawCoinsBySetId[i] = coinsRaw; } - // update last checked timestamp data - groupIdTimestampUTCMap[i.toString()] = max( - lastCheckedTimeStampUTC, - info?.timestampUTC ?? lastCheckedTimeStampUTC, - ); + // update last checked + groupIdBlockHashMap[i.toString()] = info?.blockHash; + } + + if (percentIncrement != null) { + currentPercent = _triggerEventHelper(currentPercent, percentIncrement); } // get address(es) to get the private key hex strings required for @@ -918,15 +969,18 @@ mixin SparkInterface }); } - // finally update the cached timestamps in the database + // finally update the cached block hashes in the database await info.updateOtherData( newEntries: { - WalletInfoKeys.firoSparkCacheSetTimestampCache: - groupIdTimestampUTCMap, + WalletInfoKeys.firoSparkCacheSetBlockHashCache: groupIdBlockHashMap, }, isar: mainDB.isar, ); + if (percentIncrement != null) { + currentPercent = _triggerEventHelper(currentPercent, percentIncrement); + } + // check for spark coins in mempool final mempoolMyCoins = await _refreshSparkCoinsMempoolCheck( privateKeyHexSet: privateKeyHexSet, @@ -988,6 +1042,10 @@ mixin SparkInterface }); } + if (percentIncrement != null) { + currentPercent = _triggerEventHelper(currentPercent, percentIncrement); + } + // used to check if balance is spendable or total final currentHeight = await chainHeight; @@ -1008,9 +1066,7 @@ mixin SparkInterface final spendable = Amount( rawValue: unusedCoins .where( - (e) => - e.height != null && - e.height! + cryptoCurrency.minConfirms <= currentHeight, + (e) => e.isConfirmed(currentHeight, cryptoCurrency.minConfirms), ) .map((e) => e.value) .fold(BigInt.zero, (prev, e) => prev + e), @@ -1047,7 +1103,7 @@ mixin SparkInterface } } - Future> getMissingSparkSpendTransactionIds() async { + Future> getSparkSpendTransactionIds() async { final tags = await mainDB.isar.sparkCoins .where() .walletIdEqualToAnyLTagHash(walletId) @@ -1056,21 +1112,11 @@ mixin SparkInterface .lTagHashProperty() .findAll(); - final usedCoinTxidsFoundLocally = await mainDB.isar.transactionV2s - .where() - .walletIdEqualTo(walletId) - .filter() - .subTypeEqualTo(TransactionSubType.sparkSpend) - .txidProperty() - .findAll(); - final pairs = await FiroCacheCoordinator.getUsedCoinTxidsFor( tags: tags, network: cryptoCurrency.network, ); - pairs.removeWhere((e) => usedCoinTxidsFoundLocally.contains(e.txid)); - return pairs.toSet(); } @@ -1086,7 +1132,7 @@ mixin SparkInterface } try { - await refreshSparkData(); + await refreshSparkData(null); } catch (e, s) { Logging.instance.log( "$runtimeType $walletId ${info.name}: $e\n$s", diff --git a/test/cached_electrumx_test.mocks.dart b/test/cached_electrumx_test.mocks.dart index 993f73f69..a5c7c4c54 100644 --- a/test/cached_electrumx_test.mocks.dart +++ b/test/cached_electrumx_test.mocks.dart @@ -3,21 +3,23 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i7; -import 'dart:ui' as _i12; +import 'dart:async' as _i9; +import 'dart:ui' as _i14; -import 'package:decimal/decimal.dart' as _i3; +import 'package:decimal/decimal.dart' as _i4; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i6; -import 'package:stackwallet/electrumx_rpc/electrumx_client.dart' as _i5; -import 'package:stackwallet/utilities/amount/amount_unit.dart' as _i11; -import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i10; -import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i9; -import 'package:stackwallet/utilities/prefs.dart' as _i8; +import 'package:mockito/src/dummies.dart' as _i8; +import 'package:stackwallet/electrumx_rpc/electrumx_client.dart' as _i6; +import 'package:stackwallet/models/electrumx_response/spark_models.dart' as _i3; +import 'package:stackwallet/utilities/amount/amount_unit.dart' as _i13; +import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i12; +import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i11; +import 'package:stackwallet/utilities/prefs.dart' as _i10; +import 'package:stackwallet/utilities/tor_plain_net_option_enum.dart' as _i7; import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart' as _i2; import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart' - as _i4; + as _i5; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -53,8 +55,9 @@ class _FakeDuration_1 extends _i1.SmartFake implements Duration { ); } -class _FakeDecimal_2 extends _i1.SmartFake implements _i3.Decimal { - _FakeDecimal_2( +class _FakeSparkAnonymitySetMeta_2 extends _i1.SmartFake + implements _i3.SparkAnonymitySetMeta { + _FakeSparkAnonymitySetMeta_2( Object parent, Invocation parentInvocation, ) : super( @@ -63,8 +66,18 @@ class _FakeDecimal_2 extends _i1.SmartFake implements _i3.Decimal { ); } -class _FakeFusionInfo_3 extends _i1.SmartFake implements _i4.FusionInfo { - _FakeFusionInfo_3( +class _FakeDecimal_3 extends _i1.SmartFake implements _i4.Decimal { + _FakeDecimal_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeFusionInfo_4 extends _i1.SmartFake implements _i5.FusionInfo { + _FakeFusionInfo_4( Object parent, Invocation parentInvocation, ) : super( @@ -76,7 +89,7 @@ class _FakeFusionInfo_3 extends _i1.SmartFake implements _i4.FusionInfo { /// A class which mocks [ElectrumXClient]. /// /// See the documentation for Mockito's code generation for more information. -class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { +class MockElectrumXClient extends _i1.Mock implements _i6.ElectrumXClient { MockElectrumXClient() { _i1.throwOnMissingStub(this); } @@ -91,13 +104,10 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { ) as _i2.CryptoCurrency); @override - set failovers(List<_i5.ElectrumXNode>? _failovers) => super.noSuchMethod( - Invocation.setter( - #failovers, - _failovers, - ), - returnValueForMissingStub: null, - ); + _i7.TorPlainNetworkOption get netType => (super.noSuchMethod( + Invocation.getter(#netType), + returnValue: _i7.TorPlainNetworkOption.tor, + ) as _i7.TorPlainNetworkOption); @override int get currentFailoverIndex => (super.noSuchMethod( @@ -127,7 +137,7 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { @override String get host => (super.noSuchMethod( Invocation.getter(#host), - returnValue: _i6.dummyValue( + returnValue: _i8.dummyValue( this, Invocation.getter(#host), ), @@ -146,27 +156,27 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { ) as bool); @override - _i7.Future closeAdapter() => (super.noSuchMethod( + _i9.Future closeAdapter() => (super.noSuchMethod( Invocation.method( #closeAdapter, [], ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override - _i7.Future checkElectrumAdapter() => (super.noSuchMethod( + _i9.Future checkElectrumAdapter() => (super.noSuchMethod( Invocation.method( #checkElectrumAdapter, [], ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override - _i7.Future request({ + _i9.Future request({ required String? command, List? args = const [], String? requestID, @@ -185,11 +195,11 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { #requestTimeout: requestTimeout, }, ), - returnValue: _i7.Future.value(), - ) as _i7.Future); + returnValue: _i9.Future.value(), + ) as _i9.Future); @override - _i7.Future> batchRequest({ + _i9.Future> batchRequest({ required String? command, required List? args, Duration? requestTimeout = const Duration(seconds: 60), @@ -206,11 +216,11 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { #retries: retries, }, ), - returnValue: _i7.Future>.value([]), - ) as _i7.Future>); + returnValue: _i9.Future>.value([]), + ) as _i9.Future>); @override - _i7.Future ping({ + _i9.Future ping({ String? requestID, int? retryCount = 1, }) => @@ -223,11 +233,11 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { #retryCount: retryCount, }, ), - returnValue: _i7.Future.value(false), - ) as _i7.Future); + returnValue: _i9.Future.value(false), + ) as _i9.Future); @override - _i7.Future> getBlockHeadTip({String? requestID}) => + _i9.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( Invocation.method( #getBlockHeadTip, @@ -235,11 +245,11 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { {#requestID: requestID}, ), returnValue: - _i7.Future>.value({}), - ) as _i7.Future>); + _i9.Future>.value({}), + ) as _i9.Future>); @override - _i7.Future> getServerFeatures({String? requestID}) => + _i9.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( Invocation.method( #getServerFeatures, @@ -247,11 +257,11 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { {#requestID: requestID}, ), returnValue: - _i7.Future>.value({}), - ) as _i7.Future>); + _i9.Future>.value({}), + ) as _i9.Future>); @override - _i7.Future broadcastTransaction({ + _i9.Future broadcastTransaction({ required String? rawTx, String? requestID, }) => @@ -264,7 +274,7 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i7.Future.value(_i6.dummyValue( + returnValue: _i9.Future.value(_i8.dummyValue( this, Invocation.method( #broadcastTransaction, @@ -275,10 +285,10 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { }, ), )), - ) as _i7.Future); + ) as _i9.Future); @override - _i7.Future> getBalance({ + _i9.Future> getBalance({ required String? scripthash, String? requestID, }) => @@ -292,11 +302,11 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { }, ), returnValue: - _i7.Future>.value({}), - ) as _i7.Future>); + _i9.Future>.value({}), + ) as _i9.Future>); @override - _i7.Future>> getHistory({ + _i9.Future>> getHistory({ required String? scripthash, String? requestID, }) => @@ -309,12 +319,12 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i7.Future>>.value( + returnValue: _i9.Future>>.value( >[]), - ) as _i7.Future>>); + ) as _i9.Future>>); @override - _i7.Future>>> getBatchHistory( + _i9.Future>>> getBatchHistory( {required List? args}) => (super.noSuchMethod( Invocation.method( @@ -322,12 +332,12 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { [], {#args: args}, ), - returnValue: _i7.Future>>>.value( + returnValue: _i9.Future>>>.value( >>[]), - ) as _i7.Future>>>); + ) as _i9.Future>>>); @override - _i7.Future>> getUTXOs({ + _i9.Future>> getUTXOs({ required String? scripthash, String? requestID, }) => @@ -340,12 +350,12 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i7.Future>>.value( + returnValue: _i9.Future>>.value( >[]), - ) as _i7.Future>>); + ) as _i9.Future>>); @override - _i7.Future>>> getBatchUTXOs( + _i9.Future>>> getBatchUTXOs( {required List? args}) => (super.noSuchMethod( Invocation.method( @@ -353,12 +363,12 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { [], {#args: args}, ), - returnValue: _i7.Future>>>.value( + returnValue: _i9.Future>>>.value( >>[]), - ) as _i7.Future>>>); + ) as _i9.Future>>>); @override - _i7.Future> getTransaction({ + _i9.Future> getTransaction({ required String? txHash, bool? verbose = true, String? requestID, @@ -374,11 +384,11 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { }, ), returnValue: - _i7.Future>.value({}), - ) as _i7.Future>); + _i9.Future>.value({}), + ) as _i9.Future>); @override - _i7.Future> getLelantusAnonymitySet({ + _i9.Future> getLelantusAnonymitySet({ String? groupId = r'1', String? blockhash = r'', String? requestID, @@ -394,11 +404,11 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { }, ), returnValue: - _i7.Future>.value({}), - ) as _i7.Future>); + _i9.Future>.value({}), + ) as _i9.Future>); @override - _i7.Future getLelantusMintData({ + _i9.Future getLelantusMintData({ dynamic mints, String? requestID, }) => @@ -411,11 +421,11 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i7.Future.value(), - ) as _i7.Future); + returnValue: _i9.Future.value(), + ) as _i9.Future); @override - _i7.Future> getLelantusUsedCoinSerials({ + _i9.Future> getLelantusUsedCoinSerials({ String? requestID, required int? startNumber, }) => @@ -429,22 +439,22 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { }, ), returnValue: - _i7.Future>.value({}), - ) as _i7.Future>); + _i9.Future>.value({}), + ) as _i9.Future>); @override - _i7.Future getLelantusLatestCoinId({String? requestID}) => + _i9.Future getLelantusLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getLelantusLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i7.Future.value(0), - ) as _i7.Future); + returnValue: _i9.Future.value(0), + ) as _i9.Future); @override - _i7.Future> getSparkAnonymitySet({ + _i9.Future> getSparkAnonymitySet({ String? coinGroupId = r'1', String? startBlockHash = r'', String? requestID, @@ -460,58 +470,33 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { }, ), returnValue: - _i7.Future>.value({}), - ) as _i7.Future>); + _i9.Future>.value({}), + ) as _i9.Future>); @override - _i7.Future>> getSparkMintMetaData({ - String? requestID, - required List? sparkCoinHashes, - }) => - (super.noSuchMethod( - Invocation.method( - #getSparkMintMetaData, - [], - { - #requestID: requestID, - #sparkCoinHashes: sparkCoinHashes, - }, - ), - returnValue: _i7.Future>>.value( - >[]), - ) as _i7.Future>>); - - @override - _i7.Future getSparkLatestCoinId({String? requestID}) => + _i9.Future getSparkLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getSparkLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i7.Future.value(0), - ) as _i7.Future); + returnValue: _i9.Future.value(0), + ) as _i9.Future); @override - _i7.Future> getMempoolTxids({String? requestID}) => + _i9.Future> getMempoolTxids({String? requestID}) => (super.noSuchMethod( Invocation.method( #getMempoolTxids, [], {#requestID: requestID}, ), - returnValue: _i7.Future>.value({}), - ) as _i7.Future>); + returnValue: _i9.Future>.value({}), + ) as _i9.Future>); @override - _i7.Future< - List< - ({ - List coins, - List lTags, - List serialContext, - String txid - })>> getMempoolSparkData({ + _i9.Future> getMempoolSparkData({ String? requestID, required List? txids, }) => @@ -524,30 +509,12 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { #txids: txids, }, ), - returnValue: _i7.Future< - List< - ({ - List coins, - List lTags, - List serialContext, - String txid - })>>.value(<({ - List coins, - List lTags, - List serialContext, - String txid - })>[]), - ) as _i7.Future< - List< - ({ - List coins, - List lTags, - List serialContext, - String txid - })>>); - - @override - _i7.Future>> getSparkUnhashedUsedCoinsTagsWithTxHashes({ + returnValue: _i9.Future>.value( + <_i3.SparkMempoolData>[]), + ) as _i9.Future>); + + @override + _i9.Future>> getSparkUnhashedUsedCoinsTagsWithTxHashes({ String? requestID, required int? startNumber, }) => @@ -560,11 +527,62 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { #startNumber: startNumber, }, ), - returnValue: _i7.Future>>.value(>[]), - ) as _i7.Future>>); + returnValue: _i9.Future>>.value(>[]), + ) as _i9.Future>>); + + @override + _i9.Future<_i3.SparkAnonymitySetMeta> getSparkAnonymitySetMeta({ + String? requestID, + required int? coinGroupId, + }) => + (super.noSuchMethod( + Invocation.method( + #getSparkAnonymitySetMeta, + [], + { + #requestID: requestID, + #coinGroupId: coinGroupId, + }, + ), + returnValue: _i9.Future<_i3.SparkAnonymitySetMeta>.value( + _FakeSparkAnonymitySetMeta_2( + this, + Invocation.method( + #getSparkAnonymitySetMeta, + [], + { + #requestID: requestID, + #coinGroupId: coinGroupId, + }, + ), + )), + ) as _i9.Future<_i3.SparkAnonymitySetMeta>); + + @override + _i9.Future> getSparkAnonymitySetBySector({ + String? requestID, + required int? coinGroupId, + required String? latestBlock, + required int? startIndex, + required int? endIndex, + }) => + (super.noSuchMethod( + Invocation.method( + #getSparkAnonymitySetBySector, + [], + { + #requestID: requestID, + #coinGroupId: coinGroupId, + #latestBlock: latestBlock, + #startIndex: startIndex, + #endIndex: endIndex, + }, + ), + returnValue: _i9.Future>.value([]), + ) as _i9.Future>); @override - _i7.Future isMasterNodeCollateral({ + _i9.Future isMasterNodeCollateral({ String? requestID, required String? txid, required int? index, @@ -579,11 +597,11 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { #index: index, }, ), - returnValue: _i7.Future.value(false), - ) as _i7.Future); + returnValue: _i9.Future.value(false), + ) as _i9.Future); @override - _i7.Future> getFeeRate({String? requestID}) => + _i9.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( Invocation.method( #getFeeRate, @@ -591,11 +609,11 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { {#requestID: requestID}, ), returnValue: - _i7.Future>.value({}), - ) as _i7.Future>); + _i9.Future>.value({}), + ) as _i9.Future>); @override - _i7.Future<_i3.Decimal> estimateFee({ + _i9.Future<_i4.Decimal> estimateFee({ String? requestID, required int? blocks, }) => @@ -608,7 +626,7 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { #blocks: blocks, }, ), - returnValue: _i7.Future<_i3.Decimal>.value(_FakeDecimal_2( + returnValue: _i9.Future<_i4.Decimal>.value(_FakeDecimal_3( this, Invocation.method( #estimateFee, @@ -619,16 +637,16 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { }, ), )), - ) as _i7.Future<_i3.Decimal>); + ) as _i9.Future<_i4.Decimal>); @override - _i7.Future<_i3.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + _i9.Future<_i4.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( Invocation.method( #relayFee, [], {#requestID: requestID}, ), - returnValue: _i7.Future<_i3.Decimal>.value(_FakeDecimal_2( + returnValue: _i9.Future<_i4.Decimal>.value(_FakeDecimal_3( this, Invocation.method( #relayFee, @@ -636,13 +654,13 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { {#requestID: requestID}, ), )), - ) as _i7.Future<_i3.Decimal>); + ) as _i9.Future<_i4.Decimal>); } /// A class which mocks [Prefs]. /// /// See the documentation for Mockito's code generation for more information. -class MockPrefs extends _i1.Mock implements _i8.Prefs { +class MockPrefs extends _i1.Mock implements _i10.Prefs { MockPrefs() { _i1.throwOnMissingStub(this); } @@ -706,13 +724,13 @@ class MockPrefs extends _i1.Mock implements _i8.Prefs { ); @override - _i9.SyncingType get syncType => (super.noSuchMethod( + _i11.SyncingType get syncType => (super.noSuchMethod( Invocation.getter(#syncType), - returnValue: _i9.SyncingType.currentWalletOnly, - ) as _i9.SyncingType); + returnValue: _i11.SyncingType.currentWalletOnly, + ) as _i11.SyncingType); @override - set syncType(_i9.SyncingType? syncType) => super.noSuchMethod( + set syncType(_i11.SyncingType? syncType) => super.noSuchMethod( Invocation.setter( #syncType, syncType, @@ -753,7 +771,7 @@ class MockPrefs extends _i1.Mock implements _i8.Prefs { @override String get language => (super.noSuchMethod( Invocation.getter(#language), - returnValue: _i6.dummyValue( + returnValue: _i8.dummyValue( this, Invocation.getter(#language), ), @@ -771,7 +789,7 @@ class MockPrefs extends _i1.Mock implements _i8.Prefs { @override String get currency => (super.noSuchMethod( Invocation.getter(#currency), - returnValue: _i6.dummyValue( + returnValue: _i8.dummyValue( this, Invocation.getter(#currency), ), @@ -901,13 +919,13 @@ class MockPrefs extends _i1.Mock implements _i8.Prefs { ); @override - _i10.BackupFrequencyType get backupFrequencyType => (super.noSuchMethod( + _i12.BackupFrequencyType get backupFrequencyType => (super.noSuchMethod( Invocation.getter(#backupFrequencyType), - returnValue: _i10.BackupFrequencyType.everyTenMinutes, - ) as _i10.BackupFrequencyType); + returnValue: _i12.BackupFrequencyType.everyTenMinutes, + ) as _i12.BackupFrequencyType); @override - set backupFrequencyType(_i10.BackupFrequencyType? backupFrequencyType) => + set backupFrequencyType(_i12.BackupFrequencyType? backupFrequencyType) => super.noSuchMethod( Invocation.setter( #backupFrequencyType, @@ -1014,7 +1032,7 @@ class MockPrefs extends _i1.Mock implements _i8.Prefs { @override String get themeId => (super.noSuchMethod( Invocation.getter(#themeId), - returnValue: _i6.dummyValue( + returnValue: _i8.dummyValue( this, Invocation.getter(#themeId), ), @@ -1032,7 +1050,7 @@ class MockPrefs extends _i1.Mock implements _i8.Prefs { @override String get systemBrightnessLightThemeId => (super.noSuchMethod( Invocation.getter(#systemBrightnessLightThemeId), - returnValue: _i6.dummyValue( + returnValue: _i8.dummyValue( this, Invocation.getter(#systemBrightnessLightThemeId), ), @@ -1051,7 +1069,7 @@ class MockPrefs extends _i1.Mock implements _i8.Prefs { @override String get systemBrightnessDarkThemeId => (super.noSuchMethod( Invocation.getter(#systemBrightnessDarkThemeId), - returnValue: _i6.dummyValue( + returnValue: _i8.dummyValue( this, Invocation.getter(#systemBrightnessDarkThemeId), ), @@ -1119,67 +1137,67 @@ class MockPrefs extends _i1.Mock implements _i8.Prefs { ) as bool); @override - _i7.Future init() => (super.noSuchMethod( + _i9.Future init() => (super.noSuchMethod( Invocation.method( #init, [], ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override - _i7.Future incrementCurrentNotificationIndex() => (super.noSuchMethod( + _i9.Future incrementCurrentNotificationIndex() => (super.noSuchMethod( Invocation.method( #incrementCurrentNotificationIndex, [], ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override - _i7.Future isExternalCallsSet() => (super.noSuchMethod( + _i9.Future isExternalCallsSet() => (super.noSuchMethod( Invocation.method( #isExternalCallsSet, [], ), - returnValue: _i7.Future.value(false), - ) as _i7.Future); + returnValue: _i9.Future.value(false), + ) as _i9.Future); @override - _i7.Future saveUserID(String? userId) => (super.noSuchMethod( + _i9.Future saveUserID(String? userId) => (super.noSuchMethod( Invocation.method( #saveUserID, [userId], ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override - _i7.Future saveSignupEpoch(int? signupEpoch) => (super.noSuchMethod( + _i9.Future saveSignupEpoch(int? signupEpoch) => (super.noSuchMethod( Invocation.method( #saveSignupEpoch, [signupEpoch], ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) as _i9.Future); @override - _i11.AmountUnit amountUnit(_i2.CryptoCurrency? coin) => (super.noSuchMethod( + _i13.AmountUnit amountUnit(_i2.CryptoCurrency? coin) => (super.noSuchMethod( Invocation.method( #amountUnit, [coin], ), - returnValue: _i11.AmountUnit.normal, - ) as _i11.AmountUnit); + returnValue: _i13.AmountUnit.normal, + ) as _i13.AmountUnit); @override void updateAmountUnit({ required _i2.CryptoCurrency? coin, - required _i11.AmountUnit? amountUnit, + required _i13.AmountUnit? amountUnit, }) => super.noSuchMethod( Invocation.method( @@ -1220,25 +1238,25 @@ class MockPrefs extends _i1.Mock implements _i8.Prefs { ); @override - _i4.FusionInfo getFusionServerInfo(_i2.CryptoCurrency? coin) => + _i5.FusionInfo getFusionServerInfo(_i2.CryptoCurrency? coin) => (super.noSuchMethod( Invocation.method( #getFusionServerInfo, [coin], ), - returnValue: _FakeFusionInfo_3( + returnValue: _FakeFusionInfo_4( this, Invocation.method( #getFusionServerInfo, [coin], ), ), - ) as _i4.FusionInfo); + ) as _i5.FusionInfo); @override void setFusionServerInfo( _i2.CryptoCurrency? coin, - _i4.FusionInfo? fusionServerInfo, + _i5.FusionInfo? fusionServerInfo, ) => super.noSuchMethod( Invocation.method( @@ -1252,7 +1270,7 @@ class MockPrefs extends _i1.Mock implements _i8.Prefs { ); @override - void addListener(_i12.VoidCallback? listener) => super.noSuchMethod( + void addListener(_i14.VoidCallback? listener) => super.noSuchMethod( Invocation.method( #addListener, [listener], @@ -1261,7 +1279,7 @@ class MockPrefs extends _i1.Mock implements _i8.Prefs { ); @override - void removeListener(_i12.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 e38af7ce9..a36aefef0 100644 --- a/test/services/coins/bitcoin/bitcoin_wallet_test.mocks.dart +++ b/test/services/coins/bitcoin/bitcoin_wallet_test.mocks.dart @@ -3,15 +3,17 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i6; +import 'dart:async' as _i8; -import 'package:decimal/decimal.dart' as _i3; +import 'package:decimal/decimal.dart' as _i4; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i5; -import 'package:stackwallet/electrumx_rpc/cached_electrumx_client.dart' as _i7; -import 'package:stackwallet/electrumx_rpc/electrumx_client.dart' as _i4; +import 'package:mockito/src/dummies.dart' as _i7; +import 'package:stackwallet/electrumx_rpc/cached_electrumx_client.dart' as _i9; +import 'package:stackwallet/electrumx_rpc/electrumx_client.dart' as _i5; +import 'package:stackwallet/models/electrumx_response/spark_models.dart' as _i3; import 'package:stackwallet/services/transaction_notification_tracker.dart' - as _i8; + as _i10; +import 'package:stackwallet/utilities/tor_plain_net_option_enum.dart' as _i6; import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart' as _i2; @@ -49,8 +51,9 @@ class _FakeDuration_1 extends _i1.SmartFake implements Duration { ); } -class _FakeDecimal_2 extends _i1.SmartFake implements _i3.Decimal { - _FakeDecimal_2( +class _FakeSparkAnonymitySetMeta_2 extends _i1.SmartFake + implements _i3.SparkAnonymitySetMeta { + _FakeSparkAnonymitySetMeta_2( Object parent, Invocation parentInvocation, ) : super( @@ -59,9 +62,19 @@ class _FakeDecimal_2 extends _i1.SmartFake implements _i3.Decimal { ); } -class _FakeElectrumXClient_3 extends _i1.SmartFake - implements _i4.ElectrumXClient { - _FakeElectrumXClient_3( +class _FakeDecimal_3 extends _i1.SmartFake implements _i4.Decimal { + _FakeDecimal_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeElectrumXClient_4 extends _i1.SmartFake + implements _i5.ElectrumXClient { + _FakeElectrumXClient_4( Object parent, Invocation parentInvocation, ) : super( @@ -73,7 +86,7 @@ class _FakeElectrumXClient_3 extends _i1.SmartFake /// A class which mocks [ElectrumXClient]. /// /// See the documentation for Mockito's code generation for more information. -class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { +class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { MockElectrumXClient() { _i1.throwOnMissingStub(this); } @@ -88,13 +101,10 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { ) as _i2.CryptoCurrency); @override - set failovers(List<_i4.ElectrumXNode>? _failovers) => super.noSuchMethod( - Invocation.setter( - #failovers, - _failovers, - ), - returnValueForMissingStub: null, - ); + _i6.TorPlainNetworkOption get netType => (super.noSuchMethod( + Invocation.getter(#netType), + returnValue: _i6.TorPlainNetworkOption.tor, + ) as _i6.TorPlainNetworkOption); @override int get currentFailoverIndex => (super.noSuchMethod( @@ -124,7 +134,7 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { @override String get host => (super.noSuchMethod( Invocation.getter(#host), - returnValue: _i5.dummyValue( + returnValue: _i7.dummyValue( this, Invocation.getter(#host), ), @@ -143,27 +153,27 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { ) as bool); @override - _i6.Future closeAdapter() => (super.noSuchMethod( + _i8.Future closeAdapter() => (super.noSuchMethod( Invocation.method( #closeAdapter, [], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future checkElectrumAdapter() => (super.noSuchMethod( + _i8.Future checkElectrumAdapter() => (super.noSuchMethod( Invocation.method( #checkElectrumAdapter, [], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future request({ + _i8.Future request({ required String? command, List? args = const [], String? requestID, @@ -182,11 +192,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestTimeout: requestTimeout, }, ), - returnValue: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future> batchRequest({ + _i8.Future> batchRequest({ required String? command, required List? args, Duration? requestTimeout = const Duration(seconds: 60), @@ -203,11 +213,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #retries: retries, }, ), - returnValue: _i6.Future>.value([]), - ) as _i6.Future>); + returnValue: _i8.Future>.value([]), + ) as _i8.Future>); @override - _i6.Future ping({ + _i8.Future ping({ String? requestID, int? retryCount = 1, }) => @@ -220,11 +230,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #retryCount: retryCount, }, ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i6.Future> getBlockHeadTip({String? requestID}) => + _i8.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( Invocation.method( #getBlockHeadTip, @@ -232,11 +242,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { {#requestID: requestID}, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future> getServerFeatures({String? requestID}) => + _i8.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( Invocation.method( #getServerFeatures, @@ -244,11 +254,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { {#requestID: requestID}, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future broadcastTransaction({ + _i8.Future broadcastTransaction({ required String? rawTx, String? requestID, }) => @@ -261,7 +271,7 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i6.Future.value(_i5.dummyValue( + returnValue: _i8.Future.value(_i7.dummyValue( this, Invocation.method( #broadcastTransaction, @@ -272,10 +282,10 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), )), - ) as _i6.Future); + ) as _i8.Future); @override - _i6.Future> getBalance({ + _i8.Future> getBalance({ required String? scripthash, String? requestID, }) => @@ -289,11 +299,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future>> getHistory({ + _i8.Future>> getHistory({ required String? scripthash, String? requestID, }) => @@ -306,12 +316,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i6.Future>>.value( + returnValue: _i8.Future>>.value( >[]), - ) as _i6.Future>>); + ) as _i8.Future>>); @override - _i6.Future>>> getBatchHistory( + _i8.Future>>> getBatchHistory( {required List? args}) => (super.noSuchMethod( Invocation.method( @@ -319,12 +329,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { [], {#args: args}, ), - returnValue: _i6.Future>>>.value( + returnValue: _i8.Future>>>.value( >>[]), - ) as _i6.Future>>>); + ) as _i8.Future>>>); @override - _i6.Future>> getUTXOs({ + _i8.Future>> getUTXOs({ required String? scripthash, String? requestID, }) => @@ -337,12 +347,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i6.Future>>.value( + returnValue: _i8.Future>>.value( >[]), - ) as _i6.Future>>); + ) as _i8.Future>>); @override - _i6.Future>>> getBatchUTXOs( + _i8.Future>>> getBatchUTXOs( {required List? args}) => (super.noSuchMethod( Invocation.method( @@ -350,12 +360,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { [], {#args: args}, ), - returnValue: _i6.Future>>>.value( + returnValue: _i8.Future>>>.value( >>[]), - ) as _i6.Future>>>); + ) as _i8.Future>>>); @override - _i6.Future> getTransaction({ + _i8.Future> getTransaction({ required String? txHash, bool? verbose = true, String? requestID, @@ -371,11 +381,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future> getLelantusAnonymitySet({ + _i8.Future> getLelantusAnonymitySet({ String? groupId = r'1', String? blockhash = r'', String? requestID, @@ -391,11 +401,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future getLelantusMintData({ + _i8.Future getLelantusMintData({ dynamic mints, String? requestID, }) => @@ -408,11 +418,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future> getLelantusUsedCoinSerials({ + _i8.Future> getLelantusUsedCoinSerials({ String? requestID, required int? startNumber, }) => @@ -426,22 +436,22 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future getLelantusLatestCoinId({String? requestID}) => + _i8.Future getLelantusLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getLelantusLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i8.Future.value(0), + ) as _i8.Future); @override - _i6.Future> getSparkAnonymitySet({ + _i8.Future> getSparkAnonymitySet({ String? coinGroupId = r'1', String? startBlockHash = r'', String? requestID, @@ -457,58 +467,33 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future>> getSparkMintMetaData({ - String? requestID, - required List? sparkCoinHashes, - }) => - (super.noSuchMethod( - Invocation.method( - #getSparkMintMetaData, - [], - { - #requestID: requestID, - #sparkCoinHashes: sparkCoinHashes, - }, - ), - returnValue: _i6.Future>>.value( - >[]), - ) as _i6.Future>>); - - @override - _i6.Future getSparkLatestCoinId({String? requestID}) => + _i8.Future getSparkLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getSparkLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i8.Future.value(0), + ) as _i8.Future); @override - _i6.Future> getMempoolTxids({String? requestID}) => + _i8.Future> getMempoolTxids({String? requestID}) => (super.noSuchMethod( Invocation.method( #getMempoolTxids, [], {#requestID: requestID}, ), - returnValue: _i6.Future>.value({}), - ) as _i6.Future>); + returnValue: _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future< - List< - ({ - List coins, - List lTags, - List serialContext, - String txid - })>> getMempoolSparkData({ + _i8.Future> getMempoolSparkData({ String? requestID, required List? txids, }) => @@ -521,30 +506,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #txids: txids, }, ), - returnValue: _i6.Future< - List< - ({ - List coins, - List lTags, - List serialContext, - String txid - })>>.value(<({ - List coins, - List lTags, - List serialContext, - String txid - })>[]), - ) as _i6.Future< - List< - ({ - List coins, - List lTags, - List serialContext, - String txid - })>>); - - @override - _i6.Future>> getSparkUnhashedUsedCoinsTagsWithTxHashes({ + returnValue: _i8.Future>.value( + <_i3.SparkMempoolData>[]), + ) as _i8.Future>); + + @override + _i8.Future>> getSparkUnhashedUsedCoinsTagsWithTxHashes({ String? requestID, required int? startNumber, }) => @@ -557,11 +524,62 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #startNumber: startNumber, }, ), - returnValue: _i6.Future>>.value(>[]), - ) as _i6.Future>>); + returnValue: _i8.Future>>.value(>[]), + ) as _i8.Future>>); + + @override + _i8.Future<_i3.SparkAnonymitySetMeta> getSparkAnonymitySetMeta({ + String? requestID, + required int? coinGroupId, + }) => + (super.noSuchMethod( + Invocation.method( + #getSparkAnonymitySetMeta, + [], + { + #requestID: requestID, + #coinGroupId: coinGroupId, + }, + ), + returnValue: _i8.Future<_i3.SparkAnonymitySetMeta>.value( + _FakeSparkAnonymitySetMeta_2( + this, + Invocation.method( + #getSparkAnonymitySetMeta, + [], + { + #requestID: requestID, + #coinGroupId: coinGroupId, + }, + ), + )), + ) as _i8.Future<_i3.SparkAnonymitySetMeta>); + + @override + _i8.Future> getSparkAnonymitySetBySector({ + String? requestID, + required int? coinGroupId, + required String? latestBlock, + required int? startIndex, + required int? endIndex, + }) => + (super.noSuchMethod( + Invocation.method( + #getSparkAnonymitySetBySector, + [], + { + #requestID: requestID, + #coinGroupId: coinGroupId, + #latestBlock: latestBlock, + #startIndex: startIndex, + #endIndex: endIndex, + }, + ), + returnValue: _i8.Future>.value([]), + ) as _i8.Future>); @override - _i6.Future isMasterNodeCollateral({ + _i8.Future isMasterNodeCollateral({ String? requestID, required String? txid, required int? index, @@ -576,11 +594,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #index: index, }, ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i6.Future> getFeeRate({String? requestID}) => + _i8.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( Invocation.method( #getFeeRate, @@ -588,11 +606,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { {#requestID: requestID}, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future<_i3.Decimal> estimateFee({ + _i8.Future<_i4.Decimal> estimateFee({ String? requestID, required int? blocks, }) => @@ -605,7 +623,7 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #blocks: blocks, }, ), - returnValue: _i6.Future<_i3.Decimal>.value(_FakeDecimal_2( + returnValue: _i8.Future<_i4.Decimal>.value(_FakeDecimal_3( this, Invocation.method( #estimateFee, @@ -616,16 +634,16 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), )), - ) as _i6.Future<_i3.Decimal>); + ) as _i8.Future<_i4.Decimal>); @override - _i6.Future<_i3.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + _i8.Future<_i4.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( Invocation.method( #relayFee, [], {#requestID: requestID}, ), - returnValue: _i6.Future<_i3.Decimal>.value(_FakeDecimal_2( + returnValue: _i8.Future<_i4.Decimal>.value(_FakeDecimal_3( this, Invocation.method( #relayFee, @@ -633,29 +651,29 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { {#requestID: requestID}, ), )), - ) as _i6.Future<_i3.Decimal>); + ) as _i8.Future<_i4.Decimal>); } /// A class which mocks [CachedElectrumXClient]. /// /// See the documentation for Mockito's code generation for more information. class MockCachedElectrumXClient extends _i1.Mock - implements _i7.CachedElectrumXClient { + implements _i9.CachedElectrumXClient { MockCachedElectrumXClient() { _i1.throwOnMissingStub(this); } @override - _i4.ElectrumXClient get electrumXClient => (super.noSuchMethod( + _i5.ElectrumXClient get electrumXClient => (super.noSuchMethod( Invocation.getter(#electrumXClient), - returnValue: _FakeElectrumXClient_3( + returnValue: _FakeElectrumXClient_4( this, Invocation.getter(#electrumXClient), ), - ) as _i4.ElectrumXClient); + ) as _i5.ElectrumXClient); @override - _i6.Future> getAnonymitySet({ + _i8.Future> getAnonymitySet({ required String? groupId, String? blockhash = r'', required _i2.CryptoCurrency? cryptoCurrency, @@ -671,8 +689,8 @@ class MockCachedElectrumXClient extends _i1.Mock }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override String base64ToHex(String? source) => (super.noSuchMethod( @@ -680,7 +698,7 @@ class MockCachedElectrumXClient extends _i1.Mock #base64ToHex, [source], ), - returnValue: _i5.dummyValue( + returnValue: _i7.dummyValue( this, Invocation.method( #base64ToHex, @@ -695,7 +713,7 @@ class MockCachedElectrumXClient extends _i1.Mock #base64ToReverseHex, [source], ), - returnValue: _i5.dummyValue( + returnValue: _i7.dummyValue( this, Invocation.method( #base64ToReverseHex, @@ -705,7 +723,7 @@ class MockCachedElectrumXClient extends _i1.Mock ) as String); @override - _i6.Future> getTransaction({ + _i8.Future> getTransaction({ required String? txHash, required _i2.CryptoCurrency? cryptoCurrency, bool? verbose = true, @@ -721,11 +739,11 @@ class MockCachedElectrumXClient extends _i1.Mock }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future> getUsedCoinSerials({ + _i8.Future> getUsedCoinSerials({ required _i2.CryptoCurrency? cryptoCurrency, int? startNumber = 0, }) => @@ -738,11 +756,11 @@ class MockCachedElectrumXClient extends _i1.Mock #startNumber: startNumber, }, ), - returnValue: _i6.Future>.value([]), - ) as _i6.Future>); + returnValue: _i8.Future>.value([]), + ) as _i8.Future>); @override - _i6.Future clearSharedTransactionCache( + _i8.Future clearSharedTransactionCache( {required _i2.CryptoCurrency? cryptoCurrency}) => (super.noSuchMethod( Invocation.method( @@ -750,16 +768,16 @@ class MockCachedElectrumXClient extends _i1.Mock [], {#cryptoCurrency: cryptoCurrency}, ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.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 _i10.TransactionNotificationTracker { MockTransactionNotificationTracker() { _i1.throwOnMissingStub(this); } @@ -767,7 +785,7 @@ class MockTransactionNotificationTracker extends _i1.Mock @override String get walletId => (super.noSuchMethod( Invocation.getter(#walletId), - returnValue: _i5.dummyValue( + returnValue: _i7.dummyValue( this, Invocation.getter(#walletId), ), @@ -795,14 +813,14 @@ class MockTransactionNotificationTracker extends _i1.Mock ) as bool); @override - _i6.Future addNotifiedPending(String? txid) => (super.noSuchMethod( + _i8.Future addNotifiedPending(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedPending, [txid], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( @@ -814,22 +832,22 @@ class MockTransactionNotificationTracker extends _i1.Mock ) as bool); @override - _i6.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( + _i8.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedConfirmed, [txid], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future deleteTransaction(String? txid) => (super.noSuchMethod( + _i8.Future deleteTransaction(String? txid) => (super.noSuchMethod( Invocation.method( #deleteTransaction, [txid], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); } diff --git a/test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart b/test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart index edbb3c632..c853a3f37 100644 --- a/test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart +++ b/test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart @@ -3,15 +3,17 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i6; +import 'dart:async' as _i8; -import 'package:decimal/decimal.dart' as _i3; +import 'package:decimal/decimal.dart' as _i4; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i5; -import 'package:stackwallet/electrumx_rpc/cached_electrumx_client.dart' as _i7; -import 'package:stackwallet/electrumx_rpc/electrumx_client.dart' as _i4; +import 'package:mockito/src/dummies.dart' as _i7; +import 'package:stackwallet/electrumx_rpc/cached_electrumx_client.dart' as _i9; +import 'package:stackwallet/electrumx_rpc/electrumx_client.dart' as _i5; +import 'package:stackwallet/models/electrumx_response/spark_models.dart' as _i3; import 'package:stackwallet/services/transaction_notification_tracker.dart' - as _i8; + as _i10; +import 'package:stackwallet/utilities/tor_plain_net_option_enum.dart' as _i6; import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart' as _i2; @@ -49,8 +51,9 @@ class _FakeDuration_1 extends _i1.SmartFake implements Duration { ); } -class _FakeDecimal_2 extends _i1.SmartFake implements _i3.Decimal { - _FakeDecimal_2( +class _FakeSparkAnonymitySetMeta_2 extends _i1.SmartFake + implements _i3.SparkAnonymitySetMeta { + _FakeSparkAnonymitySetMeta_2( Object parent, Invocation parentInvocation, ) : super( @@ -59,9 +62,19 @@ class _FakeDecimal_2 extends _i1.SmartFake implements _i3.Decimal { ); } -class _FakeElectrumXClient_3 extends _i1.SmartFake - implements _i4.ElectrumXClient { - _FakeElectrumXClient_3( +class _FakeDecimal_3 extends _i1.SmartFake implements _i4.Decimal { + _FakeDecimal_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeElectrumXClient_4 extends _i1.SmartFake + implements _i5.ElectrumXClient { + _FakeElectrumXClient_4( Object parent, Invocation parentInvocation, ) : super( @@ -73,7 +86,7 @@ class _FakeElectrumXClient_3 extends _i1.SmartFake /// A class which mocks [ElectrumXClient]. /// /// See the documentation for Mockito's code generation for more information. -class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { +class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { MockElectrumXClient() { _i1.throwOnMissingStub(this); } @@ -88,13 +101,10 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { ) as _i2.CryptoCurrency); @override - set failovers(List<_i4.ElectrumXNode>? _failovers) => super.noSuchMethod( - Invocation.setter( - #failovers, - _failovers, - ), - returnValueForMissingStub: null, - ); + _i6.TorPlainNetworkOption get netType => (super.noSuchMethod( + Invocation.getter(#netType), + returnValue: _i6.TorPlainNetworkOption.tor, + ) as _i6.TorPlainNetworkOption); @override int get currentFailoverIndex => (super.noSuchMethod( @@ -124,7 +134,7 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { @override String get host => (super.noSuchMethod( Invocation.getter(#host), - returnValue: _i5.dummyValue( + returnValue: _i7.dummyValue( this, Invocation.getter(#host), ), @@ -143,27 +153,27 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { ) as bool); @override - _i6.Future closeAdapter() => (super.noSuchMethod( + _i8.Future closeAdapter() => (super.noSuchMethod( Invocation.method( #closeAdapter, [], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future checkElectrumAdapter() => (super.noSuchMethod( + _i8.Future checkElectrumAdapter() => (super.noSuchMethod( Invocation.method( #checkElectrumAdapter, [], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future request({ + _i8.Future request({ required String? command, List? args = const [], String? requestID, @@ -182,11 +192,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestTimeout: requestTimeout, }, ), - returnValue: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future> batchRequest({ + _i8.Future> batchRequest({ required String? command, required List? args, Duration? requestTimeout = const Duration(seconds: 60), @@ -203,11 +213,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #retries: retries, }, ), - returnValue: _i6.Future>.value([]), - ) as _i6.Future>); + returnValue: _i8.Future>.value([]), + ) as _i8.Future>); @override - _i6.Future ping({ + _i8.Future ping({ String? requestID, int? retryCount = 1, }) => @@ -220,11 +230,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #retryCount: retryCount, }, ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i6.Future> getBlockHeadTip({String? requestID}) => + _i8.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( Invocation.method( #getBlockHeadTip, @@ -232,11 +242,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { {#requestID: requestID}, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future> getServerFeatures({String? requestID}) => + _i8.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( Invocation.method( #getServerFeatures, @@ -244,11 +254,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { {#requestID: requestID}, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future broadcastTransaction({ + _i8.Future broadcastTransaction({ required String? rawTx, String? requestID, }) => @@ -261,7 +271,7 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i6.Future.value(_i5.dummyValue( + returnValue: _i8.Future.value(_i7.dummyValue( this, Invocation.method( #broadcastTransaction, @@ -272,10 +282,10 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), )), - ) as _i6.Future); + ) as _i8.Future); @override - _i6.Future> getBalance({ + _i8.Future> getBalance({ required String? scripthash, String? requestID, }) => @@ -289,11 +299,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future>> getHistory({ + _i8.Future>> getHistory({ required String? scripthash, String? requestID, }) => @@ -306,12 +316,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i6.Future>>.value( + returnValue: _i8.Future>>.value( >[]), - ) as _i6.Future>>); + ) as _i8.Future>>); @override - _i6.Future>>> getBatchHistory( + _i8.Future>>> getBatchHistory( {required List? args}) => (super.noSuchMethod( Invocation.method( @@ -319,12 +329,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { [], {#args: args}, ), - returnValue: _i6.Future>>>.value( + returnValue: _i8.Future>>>.value( >>[]), - ) as _i6.Future>>>); + ) as _i8.Future>>>); @override - _i6.Future>> getUTXOs({ + _i8.Future>> getUTXOs({ required String? scripthash, String? requestID, }) => @@ -337,12 +347,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i6.Future>>.value( + returnValue: _i8.Future>>.value( >[]), - ) as _i6.Future>>); + ) as _i8.Future>>); @override - _i6.Future>>> getBatchUTXOs( + _i8.Future>>> getBatchUTXOs( {required List? args}) => (super.noSuchMethod( Invocation.method( @@ -350,12 +360,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { [], {#args: args}, ), - returnValue: _i6.Future>>>.value( + returnValue: _i8.Future>>>.value( >>[]), - ) as _i6.Future>>>); + ) as _i8.Future>>>); @override - _i6.Future> getTransaction({ + _i8.Future> getTransaction({ required String? txHash, bool? verbose = true, String? requestID, @@ -371,11 +381,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future> getLelantusAnonymitySet({ + _i8.Future> getLelantusAnonymitySet({ String? groupId = r'1', String? blockhash = r'', String? requestID, @@ -391,11 +401,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future getLelantusMintData({ + _i8.Future getLelantusMintData({ dynamic mints, String? requestID, }) => @@ -408,11 +418,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future> getLelantusUsedCoinSerials({ + _i8.Future> getLelantusUsedCoinSerials({ String? requestID, required int? startNumber, }) => @@ -426,22 +436,22 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future getLelantusLatestCoinId({String? requestID}) => + _i8.Future getLelantusLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getLelantusLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i8.Future.value(0), + ) as _i8.Future); @override - _i6.Future> getSparkAnonymitySet({ + _i8.Future> getSparkAnonymitySet({ String? coinGroupId = r'1', String? startBlockHash = r'', String? requestID, @@ -457,58 +467,33 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future>> getSparkMintMetaData({ - String? requestID, - required List? sparkCoinHashes, - }) => - (super.noSuchMethod( - Invocation.method( - #getSparkMintMetaData, - [], - { - #requestID: requestID, - #sparkCoinHashes: sparkCoinHashes, - }, - ), - returnValue: _i6.Future>>.value( - >[]), - ) as _i6.Future>>); - - @override - _i6.Future getSparkLatestCoinId({String? requestID}) => + _i8.Future getSparkLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getSparkLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i8.Future.value(0), + ) as _i8.Future); @override - _i6.Future> getMempoolTxids({String? requestID}) => + _i8.Future> getMempoolTxids({String? requestID}) => (super.noSuchMethod( Invocation.method( #getMempoolTxids, [], {#requestID: requestID}, ), - returnValue: _i6.Future>.value({}), - ) as _i6.Future>); + returnValue: _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future< - List< - ({ - List coins, - List lTags, - List serialContext, - String txid - })>> getMempoolSparkData({ + _i8.Future> getMempoolSparkData({ String? requestID, required List? txids, }) => @@ -521,30 +506,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #txids: txids, }, ), - returnValue: _i6.Future< - List< - ({ - List coins, - List lTags, - List serialContext, - String txid - })>>.value(<({ - List coins, - List lTags, - List serialContext, - String txid - })>[]), - ) as _i6.Future< - List< - ({ - List coins, - List lTags, - List serialContext, - String txid - })>>); - - @override - _i6.Future>> getSparkUnhashedUsedCoinsTagsWithTxHashes({ + returnValue: _i8.Future>.value( + <_i3.SparkMempoolData>[]), + ) as _i8.Future>); + + @override + _i8.Future>> getSparkUnhashedUsedCoinsTagsWithTxHashes({ String? requestID, required int? startNumber, }) => @@ -557,11 +524,62 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #startNumber: startNumber, }, ), - returnValue: _i6.Future>>.value(>[]), - ) as _i6.Future>>); + returnValue: _i8.Future>>.value(>[]), + ) as _i8.Future>>); + + @override + _i8.Future<_i3.SparkAnonymitySetMeta> getSparkAnonymitySetMeta({ + String? requestID, + required int? coinGroupId, + }) => + (super.noSuchMethod( + Invocation.method( + #getSparkAnonymitySetMeta, + [], + { + #requestID: requestID, + #coinGroupId: coinGroupId, + }, + ), + returnValue: _i8.Future<_i3.SparkAnonymitySetMeta>.value( + _FakeSparkAnonymitySetMeta_2( + this, + Invocation.method( + #getSparkAnonymitySetMeta, + [], + { + #requestID: requestID, + #coinGroupId: coinGroupId, + }, + ), + )), + ) as _i8.Future<_i3.SparkAnonymitySetMeta>); + + @override + _i8.Future> getSparkAnonymitySetBySector({ + String? requestID, + required int? coinGroupId, + required String? latestBlock, + required int? startIndex, + required int? endIndex, + }) => + (super.noSuchMethod( + Invocation.method( + #getSparkAnonymitySetBySector, + [], + { + #requestID: requestID, + #coinGroupId: coinGroupId, + #latestBlock: latestBlock, + #startIndex: startIndex, + #endIndex: endIndex, + }, + ), + returnValue: _i8.Future>.value([]), + ) as _i8.Future>); @override - _i6.Future isMasterNodeCollateral({ + _i8.Future isMasterNodeCollateral({ String? requestID, required String? txid, required int? index, @@ -576,11 +594,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #index: index, }, ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i6.Future> getFeeRate({String? requestID}) => + _i8.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( Invocation.method( #getFeeRate, @@ -588,11 +606,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { {#requestID: requestID}, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future<_i3.Decimal> estimateFee({ + _i8.Future<_i4.Decimal> estimateFee({ String? requestID, required int? blocks, }) => @@ -605,7 +623,7 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #blocks: blocks, }, ), - returnValue: _i6.Future<_i3.Decimal>.value(_FakeDecimal_2( + returnValue: _i8.Future<_i4.Decimal>.value(_FakeDecimal_3( this, Invocation.method( #estimateFee, @@ -616,16 +634,16 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), )), - ) as _i6.Future<_i3.Decimal>); + ) as _i8.Future<_i4.Decimal>); @override - _i6.Future<_i3.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + _i8.Future<_i4.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( Invocation.method( #relayFee, [], {#requestID: requestID}, ), - returnValue: _i6.Future<_i3.Decimal>.value(_FakeDecimal_2( + returnValue: _i8.Future<_i4.Decimal>.value(_FakeDecimal_3( this, Invocation.method( #relayFee, @@ -633,29 +651,29 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { {#requestID: requestID}, ), )), - ) as _i6.Future<_i3.Decimal>); + ) as _i8.Future<_i4.Decimal>); } /// A class which mocks [CachedElectrumXClient]. /// /// See the documentation for Mockito's code generation for more information. class MockCachedElectrumXClient extends _i1.Mock - implements _i7.CachedElectrumXClient { + implements _i9.CachedElectrumXClient { MockCachedElectrumXClient() { _i1.throwOnMissingStub(this); } @override - _i4.ElectrumXClient get electrumXClient => (super.noSuchMethod( + _i5.ElectrumXClient get electrumXClient => (super.noSuchMethod( Invocation.getter(#electrumXClient), - returnValue: _FakeElectrumXClient_3( + returnValue: _FakeElectrumXClient_4( this, Invocation.getter(#electrumXClient), ), - ) as _i4.ElectrumXClient); + ) as _i5.ElectrumXClient); @override - _i6.Future> getAnonymitySet({ + _i8.Future> getAnonymitySet({ required String? groupId, String? blockhash = r'', required _i2.CryptoCurrency? cryptoCurrency, @@ -671,8 +689,8 @@ class MockCachedElectrumXClient extends _i1.Mock }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override String base64ToHex(String? source) => (super.noSuchMethod( @@ -680,7 +698,7 @@ class MockCachedElectrumXClient extends _i1.Mock #base64ToHex, [source], ), - returnValue: _i5.dummyValue( + returnValue: _i7.dummyValue( this, Invocation.method( #base64ToHex, @@ -695,7 +713,7 @@ class MockCachedElectrumXClient extends _i1.Mock #base64ToReverseHex, [source], ), - returnValue: _i5.dummyValue( + returnValue: _i7.dummyValue( this, Invocation.method( #base64ToReverseHex, @@ -705,7 +723,7 @@ class MockCachedElectrumXClient extends _i1.Mock ) as String); @override - _i6.Future> getTransaction({ + _i8.Future> getTransaction({ required String? txHash, required _i2.CryptoCurrency? cryptoCurrency, bool? verbose = true, @@ -721,11 +739,11 @@ class MockCachedElectrumXClient extends _i1.Mock }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future> getUsedCoinSerials({ + _i8.Future> getUsedCoinSerials({ required _i2.CryptoCurrency? cryptoCurrency, int? startNumber = 0, }) => @@ -738,11 +756,11 @@ class MockCachedElectrumXClient extends _i1.Mock #startNumber: startNumber, }, ), - returnValue: _i6.Future>.value([]), - ) as _i6.Future>); + returnValue: _i8.Future>.value([]), + ) as _i8.Future>); @override - _i6.Future clearSharedTransactionCache( + _i8.Future clearSharedTransactionCache( {required _i2.CryptoCurrency? cryptoCurrency}) => (super.noSuchMethod( Invocation.method( @@ -750,16 +768,16 @@ class MockCachedElectrumXClient extends _i1.Mock [], {#cryptoCurrency: cryptoCurrency}, ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.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 _i10.TransactionNotificationTracker { MockTransactionNotificationTracker() { _i1.throwOnMissingStub(this); } @@ -767,7 +785,7 @@ class MockTransactionNotificationTracker extends _i1.Mock @override String get walletId => (super.noSuchMethod( Invocation.getter(#walletId), - returnValue: _i5.dummyValue( + returnValue: _i7.dummyValue( this, Invocation.getter(#walletId), ), @@ -795,14 +813,14 @@ class MockTransactionNotificationTracker extends _i1.Mock ) as bool); @override - _i6.Future addNotifiedPending(String? txid) => (super.noSuchMethod( + _i8.Future addNotifiedPending(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedPending, [txid], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( @@ -814,22 +832,22 @@ class MockTransactionNotificationTracker extends _i1.Mock ) as bool); @override - _i6.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( + _i8.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedConfirmed, [txid], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future deleteTransaction(String? txid) => (super.noSuchMethod( + _i8.Future deleteTransaction(String? txid) => (super.noSuchMethod( Invocation.method( #deleteTransaction, [txid], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); } diff --git a/test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart b/test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart index c5c167366..08f884b57 100644 --- a/test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart +++ b/test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart @@ -3,15 +3,17 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i6; +import 'dart:async' as _i8; -import 'package:decimal/decimal.dart' as _i3; +import 'package:decimal/decimal.dart' as _i4; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i5; -import 'package:stackwallet/electrumx_rpc/cached_electrumx_client.dart' as _i7; -import 'package:stackwallet/electrumx_rpc/electrumx_client.dart' as _i4; +import 'package:mockito/src/dummies.dart' as _i7; +import 'package:stackwallet/electrumx_rpc/cached_electrumx_client.dart' as _i9; +import 'package:stackwallet/electrumx_rpc/electrumx_client.dart' as _i5; +import 'package:stackwallet/models/electrumx_response/spark_models.dart' as _i3; import 'package:stackwallet/services/transaction_notification_tracker.dart' - as _i8; + as _i10; +import 'package:stackwallet/utilities/tor_plain_net_option_enum.dart' as _i6; import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart' as _i2; @@ -49,8 +51,9 @@ class _FakeDuration_1 extends _i1.SmartFake implements Duration { ); } -class _FakeDecimal_2 extends _i1.SmartFake implements _i3.Decimal { - _FakeDecimal_2( +class _FakeSparkAnonymitySetMeta_2 extends _i1.SmartFake + implements _i3.SparkAnonymitySetMeta { + _FakeSparkAnonymitySetMeta_2( Object parent, Invocation parentInvocation, ) : super( @@ -59,9 +62,19 @@ class _FakeDecimal_2 extends _i1.SmartFake implements _i3.Decimal { ); } -class _FakeElectrumXClient_3 extends _i1.SmartFake - implements _i4.ElectrumXClient { - _FakeElectrumXClient_3( +class _FakeDecimal_3 extends _i1.SmartFake implements _i4.Decimal { + _FakeDecimal_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeElectrumXClient_4 extends _i1.SmartFake + implements _i5.ElectrumXClient { + _FakeElectrumXClient_4( Object parent, Invocation parentInvocation, ) : super( @@ -73,7 +86,7 @@ class _FakeElectrumXClient_3 extends _i1.SmartFake /// A class which mocks [ElectrumXClient]. /// /// See the documentation for Mockito's code generation for more information. -class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { +class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { MockElectrumXClient() { _i1.throwOnMissingStub(this); } @@ -88,13 +101,10 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { ) as _i2.CryptoCurrency); @override - set failovers(List<_i4.ElectrumXNode>? _failovers) => super.noSuchMethod( - Invocation.setter( - #failovers, - _failovers, - ), - returnValueForMissingStub: null, - ); + _i6.TorPlainNetworkOption get netType => (super.noSuchMethod( + Invocation.getter(#netType), + returnValue: _i6.TorPlainNetworkOption.tor, + ) as _i6.TorPlainNetworkOption); @override int get currentFailoverIndex => (super.noSuchMethod( @@ -124,7 +134,7 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { @override String get host => (super.noSuchMethod( Invocation.getter(#host), - returnValue: _i5.dummyValue( + returnValue: _i7.dummyValue( this, Invocation.getter(#host), ), @@ -143,27 +153,27 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { ) as bool); @override - _i6.Future closeAdapter() => (super.noSuchMethod( + _i8.Future closeAdapter() => (super.noSuchMethod( Invocation.method( #closeAdapter, [], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future checkElectrumAdapter() => (super.noSuchMethod( + _i8.Future checkElectrumAdapter() => (super.noSuchMethod( Invocation.method( #checkElectrumAdapter, [], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future request({ + _i8.Future request({ required String? command, List? args = const [], String? requestID, @@ -182,11 +192,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestTimeout: requestTimeout, }, ), - returnValue: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future> batchRequest({ + _i8.Future> batchRequest({ required String? command, required List? args, Duration? requestTimeout = const Duration(seconds: 60), @@ -203,11 +213,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #retries: retries, }, ), - returnValue: _i6.Future>.value([]), - ) as _i6.Future>); + returnValue: _i8.Future>.value([]), + ) as _i8.Future>); @override - _i6.Future ping({ + _i8.Future ping({ String? requestID, int? retryCount = 1, }) => @@ -220,11 +230,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #retryCount: retryCount, }, ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i6.Future> getBlockHeadTip({String? requestID}) => + _i8.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( Invocation.method( #getBlockHeadTip, @@ -232,11 +242,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { {#requestID: requestID}, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future> getServerFeatures({String? requestID}) => + _i8.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( Invocation.method( #getServerFeatures, @@ -244,11 +254,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { {#requestID: requestID}, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future broadcastTransaction({ + _i8.Future broadcastTransaction({ required String? rawTx, String? requestID, }) => @@ -261,7 +271,7 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i6.Future.value(_i5.dummyValue( + returnValue: _i8.Future.value(_i7.dummyValue( this, Invocation.method( #broadcastTransaction, @@ -272,10 +282,10 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), )), - ) as _i6.Future); + ) as _i8.Future); @override - _i6.Future> getBalance({ + _i8.Future> getBalance({ required String? scripthash, String? requestID, }) => @@ -289,11 +299,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future>> getHistory({ + _i8.Future>> getHistory({ required String? scripthash, String? requestID, }) => @@ -306,12 +316,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i6.Future>>.value( + returnValue: _i8.Future>>.value( >[]), - ) as _i6.Future>>); + ) as _i8.Future>>); @override - _i6.Future>>> getBatchHistory( + _i8.Future>>> getBatchHistory( {required List? args}) => (super.noSuchMethod( Invocation.method( @@ -319,12 +329,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { [], {#args: args}, ), - returnValue: _i6.Future>>>.value( + returnValue: _i8.Future>>>.value( >>[]), - ) as _i6.Future>>>); + ) as _i8.Future>>>); @override - _i6.Future>> getUTXOs({ + _i8.Future>> getUTXOs({ required String? scripthash, String? requestID, }) => @@ -337,12 +347,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i6.Future>>.value( + returnValue: _i8.Future>>.value( >[]), - ) as _i6.Future>>); + ) as _i8.Future>>); @override - _i6.Future>>> getBatchUTXOs( + _i8.Future>>> getBatchUTXOs( {required List? args}) => (super.noSuchMethod( Invocation.method( @@ -350,12 +360,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { [], {#args: args}, ), - returnValue: _i6.Future>>>.value( + returnValue: _i8.Future>>>.value( >>[]), - ) as _i6.Future>>>); + ) as _i8.Future>>>); @override - _i6.Future> getTransaction({ + _i8.Future> getTransaction({ required String? txHash, bool? verbose = true, String? requestID, @@ -371,11 +381,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future> getLelantusAnonymitySet({ + _i8.Future> getLelantusAnonymitySet({ String? groupId = r'1', String? blockhash = r'', String? requestID, @@ -391,11 +401,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future getLelantusMintData({ + _i8.Future getLelantusMintData({ dynamic mints, String? requestID, }) => @@ -408,11 +418,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future> getLelantusUsedCoinSerials({ + _i8.Future> getLelantusUsedCoinSerials({ String? requestID, required int? startNumber, }) => @@ -426,22 +436,22 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future getLelantusLatestCoinId({String? requestID}) => + _i8.Future getLelantusLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getLelantusLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i8.Future.value(0), + ) as _i8.Future); @override - _i6.Future> getSparkAnonymitySet({ + _i8.Future> getSparkAnonymitySet({ String? coinGroupId = r'1', String? startBlockHash = r'', String? requestID, @@ -457,58 +467,33 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future>> getSparkMintMetaData({ - String? requestID, - required List? sparkCoinHashes, - }) => - (super.noSuchMethod( - Invocation.method( - #getSparkMintMetaData, - [], - { - #requestID: requestID, - #sparkCoinHashes: sparkCoinHashes, - }, - ), - returnValue: _i6.Future>>.value( - >[]), - ) as _i6.Future>>); - - @override - _i6.Future getSparkLatestCoinId({String? requestID}) => + _i8.Future getSparkLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getSparkLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i8.Future.value(0), + ) as _i8.Future); @override - _i6.Future> getMempoolTxids({String? requestID}) => + _i8.Future> getMempoolTxids({String? requestID}) => (super.noSuchMethod( Invocation.method( #getMempoolTxids, [], {#requestID: requestID}, ), - returnValue: _i6.Future>.value({}), - ) as _i6.Future>); + returnValue: _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future< - List< - ({ - List coins, - List lTags, - List serialContext, - String txid - })>> getMempoolSparkData({ + _i8.Future> getMempoolSparkData({ String? requestID, required List? txids, }) => @@ -521,30 +506,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #txids: txids, }, ), - returnValue: _i6.Future< - List< - ({ - List coins, - List lTags, - List serialContext, - String txid - })>>.value(<({ - List coins, - List lTags, - List serialContext, - String txid - })>[]), - ) as _i6.Future< - List< - ({ - List coins, - List lTags, - List serialContext, - String txid - })>>); - - @override - _i6.Future>> getSparkUnhashedUsedCoinsTagsWithTxHashes({ + returnValue: _i8.Future>.value( + <_i3.SparkMempoolData>[]), + ) as _i8.Future>); + + @override + _i8.Future>> getSparkUnhashedUsedCoinsTagsWithTxHashes({ String? requestID, required int? startNumber, }) => @@ -557,11 +524,62 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #startNumber: startNumber, }, ), - returnValue: _i6.Future>>.value(>[]), - ) as _i6.Future>>); + returnValue: _i8.Future>>.value(>[]), + ) as _i8.Future>>); + + @override + _i8.Future<_i3.SparkAnonymitySetMeta> getSparkAnonymitySetMeta({ + String? requestID, + required int? coinGroupId, + }) => + (super.noSuchMethod( + Invocation.method( + #getSparkAnonymitySetMeta, + [], + { + #requestID: requestID, + #coinGroupId: coinGroupId, + }, + ), + returnValue: _i8.Future<_i3.SparkAnonymitySetMeta>.value( + _FakeSparkAnonymitySetMeta_2( + this, + Invocation.method( + #getSparkAnonymitySetMeta, + [], + { + #requestID: requestID, + #coinGroupId: coinGroupId, + }, + ), + )), + ) as _i8.Future<_i3.SparkAnonymitySetMeta>); + + @override + _i8.Future> getSparkAnonymitySetBySector({ + String? requestID, + required int? coinGroupId, + required String? latestBlock, + required int? startIndex, + required int? endIndex, + }) => + (super.noSuchMethod( + Invocation.method( + #getSparkAnonymitySetBySector, + [], + { + #requestID: requestID, + #coinGroupId: coinGroupId, + #latestBlock: latestBlock, + #startIndex: startIndex, + #endIndex: endIndex, + }, + ), + returnValue: _i8.Future>.value([]), + ) as _i8.Future>); @override - _i6.Future isMasterNodeCollateral({ + _i8.Future isMasterNodeCollateral({ String? requestID, required String? txid, required int? index, @@ -576,11 +594,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #index: index, }, ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i6.Future> getFeeRate({String? requestID}) => + _i8.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( Invocation.method( #getFeeRate, @@ -588,11 +606,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { {#requestID: requestID}, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future<_i3.Decimal> estimateFee({ + _i8.Future<_i4.Decimal> estimateFee({ String? requestID, required int? blocks, }) => @@ -605,7 +623,7 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #blocks: blocks, }, ), - returnValue: _i6.Future<_i3.Decimal>.value(_FakeDecimal_2( + returnValue: _i8.Future<_i4.Decimal>.value(_FakeDecimal_3( this, Invocation.method( #estimateFee, @@ -616,16 +634,16 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), )), - ) as _i6.Future<_i3.Decimal>); + ) as _i8.Future<_i4.Decimal>); @override - _i6.Future<_i3.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + _i8.Future<_i4.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( Invocation.method( #relayFee, [], {#requestID: requestID}, ), - returnValue: _i6.Future<_i3.Decimal>.value(_FakeDecimal_2( + returnValue: _i8.Future<_i4.Decimal>.value(_FakeDecimal_3( this, Invocation.method( #relayFee, @@ -633,29 +651,29 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { {#requestID: requestID}, ), )), - ) as _i6.Future<_i3.Decimal>); + ) as _i8.Future<_i4.Decimal>); } /// A class which mocks [CachedElectrumXClient]. /// /// See the documentation for Mockito's code generation for more information. class MockCachedElectrumXClient extends _i1.Mock - implements _i7.CachedElectrumXClient { + implements _i9.CachedElectrumXClient { MockCachedElectrumXClient() { _i1.throwOnMissingStub(this); } @override - _i4.ElectrumXClient get electrumXClient => (super.noSuchMethod( + _i5.ElectrumXClient get electrumXClient => (super.noSuchMethod( Invocation.getter(#electrumXClient), - returnValue: _FakeElectrumXClient_3( + returnValue: _FakeElectrumXClient_4( this, Invocation.getter(#electrumXClient), ), - ) as _i4.ElectrumXClient); + ) as _i5.ElectrumXClient); @override - _i6.Future> getAnonymitySet({ + _i8.Future> getAnonymitySet({ required String? groupId, String? blockhash = r'', required _i2.CryptoCurrency? cryptoCurrency, @@ -671,8 +689,8 @@ class MockCachedElectrumXClient extends _i1.Mock }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override String base64ToHex(String? source) => (super.noSuchMethod( @@ -680,7 +698,7 @@ class MockCachedElectrumXClient extends _i1.Mock #base64ToHex, [source], ), - returnValue: _i5.dummyValue( + returnValue: _i7.dummyValue( this, Invocation.method( #base64ToHex, @@ -695,7 +713,7 @@ class MockCachedElectrumXClient extends _i1.Mock #base64ToReverseHex, [source], ), - returnValue: _i5.dummyValue( + returnValue: _i7.dummyValue( this, Invocation.method( #base64ToReverseHex, @@ -705,7 +723,7 @@ class MockCachedElectrumXClient extends _i1.Mock ) as String); @override - _i6.Future> getTransaction({ + _i8.Future> getTransaction({ required String? txHash, required _i2.CryptoCurrency? cryptoCurrency, bool? verbose = true, @@ -721,11 +739,11 @@ class MockCachedElectrumXClient extends _i1.Mock }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future> getUsedCoinSerials({ + _i8.Future> getUsedCoinSerials({ required _i2.CryptoCurrency? cryptoCurrency, int? startNumber = 0, }) => @@ -738,11 +756,11 @@ class MockCachedElectrumXClient extends _i1.Mock #startNumber: startNumber, }, ), - returnValue: _i6.Future>.value([]), - ) as _i6.Future>); + returnValue: _i8.Future>.value([]), + ) as _i8.Future>); @override - _i6.Future clearSharedTransactionCache( + _i8.Future clearSharedTransactionCache( {required _i2.CryptoCurrency? cryptoCurrency}) => (super.noSuchMethod( Invocation.method( @@ -750,16 +768,16 @@ class MockCachedElectrumXClient extends _i1.Mock [], {#cryptoCurrency: cryptoCurrency}, ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.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 _i10.TransactionNotificationTracker { MockTransactionNotificationTracker() { _i1.throwOnMissingStub(this); } @@ -767,7 +785,7 @@ class MockTransactionNotificationTracker extends _i1.Mock @override String get walletId => (super.noSuchMethod( Invocation.getter(#walletId), - returnValue: _i5.dummyValue( + returnValue: _i7.dummyValue( this, Invocation.getter(#walletId), ), @@ -795,14 +813,14 @@ class MockTransactionNotificationTracker extends _i1.Mock ) as bool); @override - _i6.Future addNotifiedPending(String? txid) => (super.noSuchMethod( + _i8.Future addNotifiedPending(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedPending, [txid], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( @@ -814,22 +832,22 @@ class MockTransactionNotificationTracker extends _i1.Mock ) as bool); @override - _i6.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( + _i8.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedConfirmed, [txid], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future deleteTransaction(String? txid) => (super.noSuchMethod( + _i8.Future deleteTransaction(String? txid) => (super.noSuchMethod( Invocation.method( #deleteTransaction, [txid], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); } diff --git a/test/services/coins/namecoin/namecoin_wallet_test.mocks.dart b/test/services/coins/namecoin/namecoin_wallet_test.mocks.dart index 80e8c8922..cd27b6654 100644 --- a/test/services/coins/namecoin/namecoin_wallet_test.mocks.dart +++ b/test/services/coins/namecoin/namecoin_wallet_test.mocks.dart @@ -3,15 +3,17 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i6; +import 'dart:async' as _i8; -import 'package:decimal/decimal.dart' as _i3; +import 'package:decimal/decimal.dart' as _i4; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i5; -import 'package:stackwallet/electrumx_rpc/cached_electrumx_client.dart' as _i7; -import 'package:stackwallet/electrumx_rpc/electrumx_client.dart' as _i4; +import 'package:mockito/src/dummies.dart' as _i7; +import 'package:stackwallet/electrumx_rpc/cached_electrumx_client.dart' as _i9; +import 'package:stackwallet/electrumx_rpc/electrumx_client.dart' as _i5; +import 'package:stackwallet/models/electrumx_response/spark_models.dart' as _i3; import 'package:stackwallet/services/transaction_notification_tracker.dart' - as _i8; + as _i10; +import 'package:stackwallet/utilities/tor_plain_net_option_enum.dart' as _i6; import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart' as _i2; @@ -49,8 +51,9 @@ class _FakeDuration_1 extends _i1.SmartFake implements Duration { ); } -class _FakeDecimal_2 extends _i1.SmartFake implements _i3.Decimal { - _FakeDecimal_2( +class _FakeSparkAnonymitySetMeta_2 extends _i1.SmartFake + implements _i3.SparkAnonymitySetMeta { + _FakeSparkAnonymitySetMeta_2( Object parent, Invocation parentInvocation, ) : super( @@ -59,9 +62,19 @@ class _FakeDecimal_2 extends _i1.SmartFake implements _i3.Decimal { ); } -class _FakeElectrumXClient_3 extends _i1.SmartFake - implements _i4.ElectrumXClient { - _FakeElectrumXClient_3( +class _FakeDecimal_3 extends _i1.SmartFake implements _i4.Decimal { + _FakeDecimal_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeElectrumXClient_4 extends _i1.SmartFake + implements _i5.ElectrumXClient { + _FakeElectrumXClient_4( Object parent, Invocation parentInvocation, ) : super( @@ -73,7 +86,7 @@ class _FakeElectrumXClient_3 extends _i1.SmartFake /// A class which mocks [ElectrumXClient]. /// /// See the documentation for Mockito's code generation for more information. -class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { +class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { MockElectrumXClient() { _i1.throwOnMissingStub(this); } @@ -88,13 +101,10 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { ) as _i2.CryptoCurrency); @override - set failovers(List<_i4.ElectrumXNode>? _failovers) => super.noSuchMethod( - Invocation.setter( - #failovers, - _failovers, - ), - returnValueForMissingStub: null, - ); + _i6.TorPlainNetworkOption get netType => (super.noSuchMethod( + Invocation.getter(#netType), + returnValue: _i6.TorPlainNetworkOption.tor, + ) as _i6.TorPlainNetworkOption); @override int get currentFailoverIndex => (super.noSuchMethod( @@ -124,7 +134,7 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { @override String get host => (super.noSuchMethod( Invocation.getter(#host), - returnValue: _i5.dummyValue( + returnValue: _i7.dummyValue( this, Invocation.getter(#host), ), @@ -143,27 +153,27 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { ) as bool); @override - _i6.Future closeAdapter() => (super.noSuchMethod( + _i8.Future closeAdapter() => (super.noSuchMethod( Invocation.method( #closeAdapter, [], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future checkElectrumAdapter() => (super.noSuchMethod( + _i8.Future checkElectrumAdapter() => (super.noSuchMethod( Invocation.method( #checkElectrumAdapter, [], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future request({ + _i8.Future request({ required String? command, List? args = const [], String? requestID, @@ -182,11 +192,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestTimeout: requestTimeout, }, ), - returnValue: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future> batchRequest({ + _i8.Future> batchRequest({ required String? command, required List? args, Duration? requestTimeout = const Duration(seconds: 60), @@ -203,11 +213,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #retries: retries, }, ), - returnValue: _i6.Future>.value([]), - ) as _i6.Future>); + returnValue: _i8.Future>.value([]), + ) as _i8.Future>); @override - _i6.Future ping({ + _i8.Future ping({ String? requestID, int? retryCount = 1, }) => @@ -220,11 +230,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #retryCount: retryCount, }, ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i6.Future> getBlockHeadTip({String? requestID}) => + _i8.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( Invocation.method( #getBlockHeadTip, @@ -232,11 +242,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { {#requestID: requestID}, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future> getServerFeatures({String? requestID}) => + _i8.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( Invocation.method( #getServerFeatures, @@ -244,11 +254,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { {#requestID: requestID}, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future broadcastTransaction({ + _i8.Future broadcastTransaction({ required String? rawTx, String? requestID, }) => @@ -261,7 +271,7 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i6.Future.value(_i5.dummyValue( + returnValue: _i8.Future.value(_i7.dummyValue( this, Invocation.method( #broadcastTransaction, @@ -272,10 +282,10 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), )), - ) as _i6.Future); + ) as _i8.Future); @override - _i6.Future> getBalance({ + _i8.Future> getBalance({ required String? scripthash, String? requestID, }) => @@ -289,11 +299,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future>> getHistory({ + _i8.Future>> getHistory({ required String? scripthash, String? requestID, }) => @@ -306,12 +316,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i6.Future>>.value( + returnValue: _i8.Future>>.value( >[]), - ) as _i6.Future>>); + ) as _i8.Future>>); @override - _i6.Future>>> getBatchHistory( + _i8.Future>>> getBatchHistory( {required List? args}) => (super.noSuchMethod( Invocation.method( @@ -319,12 +329,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { [], {#args: args}, ), - returnValue: _i6.Future>>>.value( + returnValue: _i8.Future>>>.value( >>[]), - ) as _i6.Future>>>); + ) as _i8.Future>>>); @override - _i6.Future>> getUTXOs({ + _i8.Future>> getUTXOs({ required String? scripthash, String? requestID, }) => @@ -337,12 +347,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i6.Future>>.value( + returnValue: _i8.Future>>.value( >[]), - ) as _i6.Future>>); + ) as _i8.Future>>); @override - _i6.Future>>> getBatchUTXOs( + _i8.Future>>> getBatchUTXOs( {required List? args}) => (super.noSuchMethod( Invocation.method( @@ -350,12 +360,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { [], {#args: args}, ), - returnValue: _i6.Future>>>.value( + returnValue: _i8.Future>>>.value( >>[]), - ) as _i6.Future>>>); + ) as _i8.Future>>>); @override - _i6.Future> getTransaction({ + _i8.Future> getTransaction({ required String? txHash, bool? verbose = true, String? requestID, @@ -371,11 +381,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future> getLelantusAnonymitySet({ + _i8.Future> getLelantusAnonymitySet({ String? groupId = r'1', String? blockhash = r'', String? requestID, @@ -391,11 +401,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future getLelantusMintData({ + _i8.Future getLelantusMintData({ dynamic mints, String? requestID, }) => @@ -408,11 +418,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future> getLelantusUsedCoinSerials({ + _i8.Future> getLelantusUsedCoinSerials({ String? requestID, required int? startNumber, }) => @@ -426,22 +436,22 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future getLelantusLatestCoinId({String? requestID}) => + _i8.Future getLelantusLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getLelantusLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i8.Future.value(0), + ) as _i8.Future); @override - _i6.Future> getSparkAnonymitySet({ + _i8.Future> getSparkAnonymitySet({ String? coinGroupId = r'1', String? startBlockHash = r'', String? requestID, @@ -457,58 +467,33 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future>> getSparkMintMetaData({ - String? requestID, - required List? sparkCoinHashes, - }) => - (super.noSuchMethod( - Invocation.method( - #getSparkMintMetaData, - [], - { - #requestID: requestID, - #sparkCoinHashes: sparkCoinHashes, - }, - ), - returnValue: _i6.Future>>.value( - >[]), - ) as _i6.Future>>); - - @override - _i6.Future getSparkLatestCoinId({String? requestID}) => + _i8.Future getSparkLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getSparkLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i8.Future.value(0), + ) as _i8.Future); @override - _i6.Future> getMempoolTxids({String? requestID}) => + _i8.Future> getMempoolTxids({String? requestID}) => (super.noSuchMethod( Invocation.method( #getMempoolTxids, [], {#requestID: requestID}, ), - returnValue: _i6.Future>.value({}), - ) as _i6.Future>); + returnValue: _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future< - List< - ({ - List coins, - List lTags, - List serialContext, - String txid - })>> getMempoolSparkData({ + _i8.Future> getMempoolSparkData({ String? requestID, required List? txids, }) => @@ -521,30 +506,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #txids: txids, }, ), - returnValue: _i6.Future< - List< - ({ - List coins, - List lTags, - List serialContext, - String txid - })>>.value(<({ - List coins, - List lTags, - List serialContext, - String txid - })>[]), - ) as _i6.Future< - List< - ({ - List coins, - List lTags, - List serialContext, - String txid - })>>); - - @override - _i6.Future>> getSparkUnhashedUsedCoinsTagsWithTxHashes({ + returnValue: _i8.Future>.value( + <_i3.SparkMempoolData>[]), + ) as _i8.Future>); + + @override + _i8.Future>> getSparkUnhashedUsedCoinsTagsWithTxHashes({ String? requestID, required int? startNumber, }) => @@ -557,11 +524,62 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #startNumber: startNumber, }, ), - returnValue: _i6.Future>>.value(>[]), - ) as _i6.Future>>); + returnValue: _i8.Future>>.value(>[]), + ) as _i8.Future>>); + + @override + _i8.Future<_i3.SparkAnonymitySetMeta> getSparkAnonymitySetMeta({ + String? requestID, + required int? coinGroupId, + }) => + (super.noSuchMethod( + Invocation.method( + #getSparkAnonymitySetMeta, + [], + { + #requestID: requestID, + #coinGroupId: coinGroupId, + }, + ), + returnValue: _i8.Future<_i3.SparkAnonymitySetMeta>.value( + _FakeSparkAnonymitySetMeta_2( + this, + Invocation.method( + #getSparkAnonymitySetMeta, + [], + { + #requestID: requestID, + #coinGroupId: coinGroupId, + }, + ), + )), + ) as _i8.Future<_i3.SparkAnonymitySetMeta>); + + @override + _i8.Future> getSparkAnonymitySetBySector({ + String? requestID, + required int? coinGroupId, + required String? latestBlock, + required int? startIndex, + required int? endIndex, + }) => + (super.noSuchMethod( + Invocation.method( + #getSparkAnonymitySetBySector, + [], + { + #requestID: requestID, + #coinGroupId: coinGroupId, + #latestBlock: latestBlock, + #startIndex: startIndex, + #endIndex: endIndex, + }, + ), + returnValue: _i8.Future>.value([]), + ) as _i8.Future>); @override - _i6.Future isMasterNodeCollateral({ + _i8.Future isMasterNodeCollateral({ String? requestID, required String? txid, required int? index, @@ -576,11 +594,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #index: index, }, ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i6.Future> getFeeRate({String? requestID}) => + _i8.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( Invocation.method( #getFeeRate, @@ -588,11 +606,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { {#requestID: requestID}, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future<_i3.Decimal> estimateFee({ + _i8.Future<_i4.Decimal> estimateFee({ String? requestID, required int? blocks, }) => @@ -605,7 +623,7 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #blocks: blocks, }, ), - returnValue: _i6.Future<_i3.Decimal>.value(_FakeDecimal_2( + returnValue: _i8.Future<_i4.Decimal>.value(_FakeDecimal_3( this, Invocation.method( #estimateFee, @@ -616,16 +634,16 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), )), - ) as _i6.Future<_i3.Decimal>); + ) as _i8.Future<_i4.Decimal>); @override - _i6.Future<_i3.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + _i8.Future<_i4.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( Invocation.method( #relayFee, [], {#requestID: requestID}, ), - returnValue: _i6.Future<_i3.Decimal>.value(_FakeDecimal_2( + returnValue: _i8.Future<_i4.Decimal>.value(_FakeDecimal_3( this, Invocation.method( #relayFee, @@ -633,29 +651,29 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { {#requestID: requestID}, ), )), - ) as _i6.Future<_i3.Decimal>); + ) as _i8.Future<_i4.Decimal>); } /// A class which mocks [CachedElectrumXClient]. /// /// See the documentation for Mockito's code generation for more information. class MockCachedElectrumXClient extends _i1.Mock - implements _i7.CachedElectrumXClient { + implements _i9.CachedElectrumXClient { MockCachedElectrumXClient() { _i1.throwOnMissingStub(this); } @override - _i4.ElectrumXClient get electrumXClient => (super.noSuchMethod( + _i5.ElectrumXClient get electrumXClient => (super.noSuchMethod( Invocation.getter(#electrumXClient), - returnValue: _FakeElectrumXClient_3( + returnValue: _FakeElectrumXClient_4( this, Invocation.getter(#electrumXClient), ), - ) as _i4.ElectrumXClient); + ) as _i5.ElectrumXClient); @override - _i6.Future> getAnonymitySet({ + _i8.Future> getAnonymitySet({ required String? groupId, String? blockhash = r'', required _i2.CryptoCurrency? cryptoCurrency, @@ -671,8 +689,8 @@ class MockCachedElectrumXClient extends _i1.Mock }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override String base64ToHex(String? source) => (super.noSuchMethod( @@ -680,7 +698,7 @@ class MockCachedElectrumXClient extends _i1.Mock #base64ToHex, [source], ), - returnValue: _i5.dummyValue( + returnValue: _i7.dummyValue( this, Invocation.method( #base64ToHex, @@ -695,7 +713,7 @@ class MockCachedElectrumXClient extends _i1.Mock #base64ToReverseHex, [source], ), - returnValue: _i5.dummyValue( + returnValue: _i7.dummyValue( this, Invocation.method( #base64ToReverseHex, @@ -705,7 +723,7 @@ class MockCachedElectrumXClient extends _i1.Mock ) as String); @override - _i6.Future> getTransaction({ + _i8.Future> getTransaction({ required String? txHash, required _i2.CryptoCurrency? cryptoCurrency, bool? verbose = true, @@ -721,11 +739,11 @@ class MockCachedElectrumXClient extends _i1.Mock }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future> getUsedCoinSerials({ + _i8.Future> getUsedCoinSerials({ required _i2.CryptoCurrency? cryptoCurrency, int? startNumber = 0, }) => @@ -738,11 +756,11 @@ class MockCachedElectrumXClient extends _i1.Mock #startNumber: startNumber, }, ), - returnValue: _i6.Future>.value([]), - ) as _i6.Future>); + returnValue: _i8.Future>.value([]), + ) as _i8.Future>); @override - _i6.Future clearSharedTransactionCache( + _i8.Future clearSharedTransactionCache( {required _i2.CryptoCurrency? cryptoCurrency}) => (super.noSuchMethod( Invocation.method( @@ -750,16 +768,16 @@ class MockCachedElectrumXClient extends _i1.Mock [], {#cryptoCurrency: cryptoCurrency}, ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.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 _i10.TransactionNotificationTracker { MockTransactionNotificationTracker() { _i1.throwOnMissingStub(this); } @@ -767,7 +785,7 @@ class MockTransactionNotificationTracker extends _i1.Mock @override String get walletId => (super.noSuchMethod( Invocation.getter(#walletId), - returnValue: _i5.dummyValue( + returnValue: _i7.dummyValue( this, Invocation.getter(#walletId), ), @@ -795,14 +813,14 @@ class MockTransactionNotificationTracker extends _i1.Mock ) as bool); @override - _i6.Future addNotifiedPending(String? txid) => (super.noSuchMethod( + _i8.Future addNotifiedPending(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedPending, [txid], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( @@ -814,22 +832,22 @@ class MockTransactionNotificationTracker extends _i1.Mock ) as bool); @override - _i6.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( + _i8.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedConfirmed, [txid], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future deleteTransaction(String? txid) => (super.noSuchMethod( + _i8.Future deleteTransaction(String? txid) => (super.noSuchMethod( Invocation.method( #deleteTransaction, [txid], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); } diff --git a/test/services/coins/particl/particl_wallet_test.mocks.dart b/test/services/coins/particl/particl_wallet_test.mocks.dart index 0fde0b645..1360bd6db 100644 --- a/test/services/coins/particl/particl_wallet_test.mocks.dart +++ b/test/services/coins/particl/particl_wallet_test.mocks.dart @@ -3,15 +3,17 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i6; +import 'dart:async' as _i8; -import 'package:decimal/decimal.dart' as _i3; +import 'package:decimal/decimal.dart' as _i4; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i5; -import 'package:stackwallet/electrumx_rpc/cached_electrumx_client.dart' as _i7; -import 'package:stackwallet/electrumx_rpc/electrumx_client.dart' as _i4; +import 'package:mockito/src/dummies.dart' as _i7; +import 'package:stackwallet/electrumx_rpc/cached_electrumx_client.dart' as _i9; +import 'package:stackwallet/electrumx_rpc/electrumx_client.dart' as _i5; +import 'package:stackwallet/models/electrumx_response/spark_models.dart' as _i3; import 'package:stackwallet/services/transaction_notification_tracker.dart' - as _i8; + as _i10; +import 'package:stackwallet/utilities/tor_plain_net_option_enum.dart' as _i6; import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart' as _i2; @@ -49,8 +51,9 @@ class _FakeDuration_1 extends _i1.SmartFake implements Duration { ); } -class _FakeDecimal_2 extends _i1.SmartFake implements _i3.Decimal { - _FakeDecimal_2( +class _FakeSparkAnonymitySetMeta_2 extends _i1.SmartFake + implements _i3.SparkAnonymitySetMeta { + _FakeSparkAnonymitySetMeta_2( Object parent, Invocation parentInvocation, ) : super( @@ -59,9 +62,19 @@ class _FakeDecimal_2 extends _i1.SmartFake implements _i3.Decimal { ); } -class _FakeElectrumXClient_3 extends _i1.SmartFake - implements _i4.ElectrumXClient { - _FakeElectrumXClient_3( +class _FakeDecimal_3 extends _i1.SmartFake implements _i4.Decimal { + _FakeDecimal_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeElectrumXClient_4 extends _i1.SmartFake + implements _i5.ElectrumXClient { + _FakeElectrumXClient_4( Object parent, Invocation parentInvocation, ) : super( @@ -73,7 +86,7 @@ class _FakeElectrumXClient_3 extends _i1.SmartFake /// A class which mocks [ElectrumXClient]. /// /// See the documentation for Mockito's code generation for more information. -class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { +class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { MockElectrumXClient() { _i1.throwOnMissingStub(this); } @@ -88,13 +101,10 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { ) as _i2.CryptoCurrency); @override - set failovers(List<_i4.ElectrumXNode>? _failovers) => super.noSuchMethod( - Invocation.setter( - #failovers, - _failovers, - ), - returnValueForMissingStub: null, - ); + _i6.TorPlainNetworkOption get netType => (super.noSuchMethod( + Invocation.getter(#netType), + returnValue: _i6.TorPlainNetworkOption.tor, + ) as _i6.TorPlainNetworkOption); @override int get currentFailoverIndex => (super.noSuchMethod( @@ -124,7 +134,7 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { @override String get host => (super.noSuchMethod( Invocation.getter(#host), - returnValue: _i5.dummyValue( + returnValue: _i7.dummyValue( this, Invocation.getter(#host), ), @@ -143,27 +153,27 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { ) as bool); @override - _i6.Future closeAdapter() => (super.noSuchMethod( + _i8.Future closeAdapter() => (super.noSuchMethod( Invocation.method( #closeAdapter, [], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future checkElectrumAdapter() => (super.noSuchMethod( + _i8.Future checkElectrumAdapter() => (super.noSuchMethod( Invocation.method( #checkElectrumAdapter, [], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future request({ + _i8.Future request({ required String? command, List? args = const [], String? requestID, @@ -182,11 +192,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestTimeout: requestTimeout, }, ), - returnValue: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future> batchRequest({ + _i8.Future> batchRequest({ required String? command, required List? args, Duration? requestTimeout = const Duration(seconds: 60), @@ -203,11 +213,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #retries: retries, }, ), - returnValue: _i6.Future>.value([]), - ) as _i6.Future>); + returnValue: _i8.Future>.value([]), + ) as _i8.Future>); @override - _i6.Future ping({ + _i8.Future ping({ String? requestID, int? retryCount = 1, }) => @@ -220,11 +230,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #retryCount: retryCount, }, ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i6.Future> getBlockHeadTip({String? requestID}) => + _i8.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( Invocation.method( #getBlockHeadTip, @@ -232,11 +242,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { {#requestID: requestID}, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future> getServerFeatures({String? requestID}) => + _i8.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( Invocation.method( #getServerFeatures, @@ -244,11 +254,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { {#requestID: requestID}, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future broadcastTransaction({ + _i8.Future broadcastTransaction({ required String? rawTx, String? requestID, }) => @@ -261,7 +271,7 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i6.Future.value(_i5.dummyValue( + returnValue: _i8.Future.value(_i7.dummyValue( this, Invocation.method( #broadcastTransaction, @@ -272,10 +282,10 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), )), - ) as _i6.Future); + ) as _i8.Future); @override - _i6.Future> getBalance({ + _i8.Future> getBalance({ required String? scripthash, String? requestID, }) => @@ -289,11 +299,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future>> getHistory({ + _i8.Future>> getHistory({ required String? scripthash, String? requestID, }) => @@ -306,12 +316,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i6.Future>>.value( + returnValue: _i8.Future>>.value( >[]), - ) as _i6.Future>>); + ) as _i8.Future>>); @override - _i6.Future>>> getBatchHistory( + _i8.Future>>> getBatchHistory( {required List? args}) => (super.noSuchMethod( Invocation.method( @@ -319,12 +329,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { [], {#args: args}, ), - returnValue: _i6.Future>>>.value( + returnValue: _i8.Future>>>.value( >>[]), - ) as _i6.Future>>>); + ) as _i8.Future>>>); @override - _i6.Future>> getUTXOs({ + _i8.Future>> getUTXOs({ required String? scripthash, String? requestID, }) => @@ -337,12 +347,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i6.Future>>.value( + returnValue: _i8.Future>>.value( >[]), - ) as _i6.Future>>); + ) as _i8.Future>>); @override - _i6.Future>>> getBatchUTXOs( + _i8.Future>>> getBatchUTXOs( {required List? args}) => (super.noSuchMethod( Invocation.method( @@ -350,12 +360,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { [], {#args: args}, ), - returnValue: _i6.Future>>>.value( + returnValue: _i8.Future>>>.value( >>[]), - ) as _i6.Future>>>); + ) as _i8.Future>>>); @override - _i6.Future> getTransaction({ + _i8.Future> getTransaction({ required String? txHash, bool? verbose = true, String? requestID, @@ -371,11 +381,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future> getLelantusAnonymitySet({ + _i8.Future> getLelantusAnonymitySet({ String? groupId = r'1', String? blockhash = r'', String? requestID, @@ -391,11 +401,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future getLelantusMintData({ + _i8.Future getLelantusMintData({ dynamic mints, String? requestID, }) => @@ -408,11 +418,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #requestID: requestID, }, ), - returnValue: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future> getLelantusUsedCoinSerials({ + _i8.Future> getLelantusUsedCoinSerials({ String? requestID, required int? startNumber, }) => @@ -426,22 +436,22 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future getLelantusLatestCoinId({String? requestID}) => + _i8.Future getLelantusLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getLelantusLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i8.Future.value(0), + ) as _i8.Future); @override - _i6.Future> getSparkAnonymitySet({ + _i8.Future> getSparkAnonymitySet({ String? coinGroupId = r'1', String? startBlockHash = r'', String? requestID, @@ -457,58 +467,33 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future>> getSparkMintMetaData({ - String? requestID, - required List? sparkCoinHashes, - }) => - (super.noSuchMethod( - Invocation.method( - #getSparkMintMetaData, - [], - { - #requestID: requestID, - #sparkCoinHashes: sparkCoinHashes, - }, - ), - returnValue: _i6.Future>>.value( - >[]), - ) as _i6.Future>>); - - @override - _i6.Future getSparkLatestCoinId({String? requestID}) => + _i8.Future getSparkLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getSparkLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i8.Future.value(0), + ) as _i8.Future); @override - _i6.Future> getMempoolTxids({String? requestID}) => + _i8.Future> getMempoolTxids({String? requestID}) => (super.noSuchMethod( Invocation.method( #getMempoolTxids, [], {#requestID: requestID}, ), - returnValue: _i6.Future>.value({}), - ) as _i6.Future>); + returnValue: _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future< - List< - ({ - List coins, - List lTags, - List serialContext, - String txid - })>> getMempoolSparkData({ + _i8.Future> getMempoolSparkData({ String? requestID, required List? txids, }) => @@ -521,30 +506,12 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #txids: txids, }, ), - returnValue: _i6.Future< - List< - ({ - List coins, - List lTags, - List serialContext, - String txid - })>>.value(<({ - List coins, - List lTags, - List serialContext, - String txid - })>[]), - ) as _i6.Future< - List< - ({ - List coins, - List lTags, - List serialContext, - String txid - })>>); - - @override - _i6.Future>> getSparkUnhashedUsedCoinsTagsWithTxHashes({ + returnValue: _i8.Future>.value( + <_i3.SparkMempoolData>[]), + ) as _i8.Future>); + + @override + _i8.Future>> getSparkUnhashedUsedCoinsTagsWithTxHashes({ String? requestID, required int? startNumber, }) => @@ -557,11 +524,62 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #startNumber: startNumber, }, ), - returnValue: _i6.Future>>.value(>[]), - ) as _i6.Future>>); + returnValue: _i8.Future>>.value(>[]), + ) as _i8.Future>>); + + @override + _i8.Future<_i3.SparkAnonymitySetMeta> getSparkAnonymitySetMeta({ + String? requestID, + required int? coinGroupId, + }) => + (super.noSuchMethod( + Invocation.method( + #getSparkAnonymitySetMeta, + [], + { + #requestID: requestID, + #coinGroupId: coinGroupId, + }, + ), + returnValue: _i8.Future<_i3.SparkAnonymitySetMeta>.value( + _FakeSparkAnonymitySetMeta_2( + this, + Invocation.method( + #getSparkAnonymitySetMeta, + [], + { + #requestID: requestID, + #coinGroupId: coinGroupId, + }, + ), + )), + ) as _i8.Future<_i3.SparkAnonymitySetMeta>); + + @override + _i8.Future> getSparkAnonymitySetBySector({ + String? requestID, + required int? coinGroupId, + required String? latestBlock, + required int? startIndex, + required int? endIndex, + }) => + (super.noSuchMethod( + Invocation.method( + #getSparkAnonymitySetBySector, + [], + { + #requestID: requestID, + #coinGroupId: coinGroupId, + #latestBlock: latestBlock, + #startIndex: startIndex, + #endIndex: endIndex, + }, + ), + returnValue: _i8.Future>.value([]), + ) as _i8.Future>); @override - _i6.Future isMasterNodeCollateral({ + _i8.Future isMasterNodeCollateral({ String? requestID, required String? txid, required int? index, @@ -576,11 +594,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #index: index, }, ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + returnValue: _i8.Future.value(false), + ) as _i8.Future); @override - _i6.Future> getFeeRate({String? requestID}) => + _i8.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( Invocation.method( #getFeeRate, @@ -588,11 +606,11 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { {#requestID: requestID}, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future<_i3.Decimal> estimateFee({ + _i8.Future<_i4.Decimal> estimateFee({ String? requestID, required int? blocks, }) => @@ -605,7 +623,7 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { #blocks: blocks, }, ), - returnValue: _i6.Future<_i3.Decimal>.value(_FakeDecimal_2( + returnValue: _i8.Future<_i4.Decimal>.value(_FakeDecimal_3( this, Invocation.method( #estimateFee, @@ -616,16 +634,16 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { }, ), )), - ) as _i6.Future<_i3.Decimal>); + ) as _i8.Future<_i4.Decimal>); @override - _i6.Future<_i3.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + _i8.Future<_i4.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( Invocation.method( #relayFee, [], {#requestID: requestID}, ), - returnValue: _i6.Future<_i3.Decimal>.value(_FakeDecimal_2( + returnValue: _i8.Future<_i4.Decimal>.value(_FakeDecimal_3( this, Invocation.method( #relayFee, @@ -633,29 +651,29 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { {#requestID: requestID}, ), )), - ) as _i6.Future<_i3.Decimal>); + ) as _i8.Future<_i4.Decimal>); } /// A class which mocks [CachedElectrumXClient]. /// /// See the documentation for Mockito's code generation for more information. class MockCachedElectrumXClient extends _i1.Mock - implements _i7.CachedElectrumXClient { + implements _i9.CachedElectrumXClient { MockCachedElectrumXClient() { _i1.throwOnMissingStub(this); } @override - _i4.ElectrumXClient get electrumXClient => (super.noSuchMethod( + _i5.ElectrumXClient get electrumXClient => (super.noSuchMethod( Invocation.getter(#electrumXClient), - returnValue: _FakeElectrumXClient_3( + returnValue: _FakeElectrumXClient_4( this, Invocation.getter(#electrumXClient), ), - ) as _i4.ElectrumXClient); + ) as _i5.ElectrumXClient); @override - _i6.Future> getAnonymitySet({ + _i8.Future> getAnonymitySet({ required String? groupId, String? blockhash = r'', required _i2.CryptoCurrency? cryptoCurrency, @@ -671,8 +689,8 @@ class MockCachedElectrumXClient extends _i1.Mock }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override String base64ToHex(String? source) => (super.noSuchMethod( @@ -680,7 +698,7 @@ class MockCachedElectrumXClient extends _i1.Mock #base64ToHex, [source], ), - returnValue: _i5.dummyValue( + returnValue: _i7.dummyValue( this, Invocation.method( #base64ToHex, @@ -695,7 +713,7 @@ class MockCachedElectrumXClient extends _i1.Mock #base64ToReverseHex, [source], ), - returnValue: _i5.dummyValue( + returnValue: _i7.dummyValue( this, Invocation.method( #base64ToReverseHex, @@ -705,7 +723,7 @@ class MockCachedElectrumXClient extends _i1.Mock ) as String); @override - _i6.Future> getTransaction({ + _i8.Future> getTransaction({ required String? txHash, required _i2.CryptoCurrency? cryptoCurrency, bool? verbose = true, @@ -721,11 +739,11 @@ class MockCachedElectrumXClient extends _i1.Mock }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i8.Future>.value({}), + ) as _i8.Future>); @override - _i6.Future> getUsedCoinSerials({ + _i8.Future> getUsedCoinSerials({ required _i2.CryptoCurrency? cryptoCurrency, int? startNumber = 0, }) => @@ -738,11 +756,11 @@ class MockCachedElectrumXClient extends _i1.Mock #startNumber: startNumber, }, ), - returnValue: _i6.Future>.value([]), - ) as _i6.Future>); + returnValue: _i8.Future>.value([]), + ) as _i8.Future>); @override - _i6.Future clearSharedTransactionCache( + _i8.Future clearSharedTransactionCache( {required _i2.CryptoCurrency? cryptoCurrency}) => (super.noSuchMethod( Invocation.method( @@ -750,16 +768,16 @@ class MockCachedElectrumXClient extends _i1.Mock [], {#cryptoCurrency: cryptoCurrency}, ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.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 _i10.TransactionNotificationTracker { MockTransactionNotificationTracker() { _i1.throwOnMissingStub(this); } @@ -767,7 +785,7 @@ class MockTransactionNotificationTracker extends _i1.Mock @override String get walletId => (super.noSuchMethod( Invocation.getter(#walletId), - returnValue: _i5.dummyValue( + returnValue: _i7.dummyValue( this, Invocation.getter(#walletId), ), @@ -795,14 +813,14 @@ class MockTransactionNotificationTracker extends _i1.Mock ) as bool); @override - _i6.Future addNotifiedPending(String? txid) => (super.noSuchMethod( + _i8.Future addNotifiedPending(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedPending, [txid], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( @@ -814,22 +832,22 @@ class MockTransactionNotificationTracker extends _i1.Mock ) as bool); @override - _i6.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( + _i8.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedConfirmed, [txid], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); @override - _i6.Future deleteTransaction(String? txid) => (super.noSuchMethod( + _i8.Future deleteTransaction(String? txid) => (super.noSuchMethod( Invocation.method( #deleteTransaction, [txid], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); }