From 83778bb121cdf22d2d5c10d3a4fdffd1eefa342f Mon Sep 17 00:00:00 2001 From: likho Date: Sun, 28 May 2023 14:57:05 +0200 Subject: [PATCH 1/6] Fix Epiccash caching issue, add additional status messages as in Epicpay --- .../models/blockchain_data/transaction.dart | 11 ++++++- .../models/blockchain_data/transaction.g.dart | 1 + lib/models/paymint/transactions_model.dart | 9 +++++- .../sub_widgets/transactions_list.dart | 14 ++------- .../transaction_details_view.dart | 31 +++++++++++++++++++ .../coins/bitcoin/bitcoin_wallet.dart | 1 + .../coins/bitcoincash/bitcoincash_wallet.dart | 2 ++ .../coins/dogecoin/dogecoin_wallet.dart | 1 + lib/services/coins/ecash/ecash_wallet.dart | 2 ++ .../coins/epiccash/epiccash_wallet.dart | 9 +++--- .../coins/ethereum/ethereum_wallet.dart | 2 ++ lib/services/coins/firo/firo_wallet.dart | 7 +++++ .../coins/litecoin/litecoin_wallet.dart | 1 + lib/services/coins/monero/monero_wallet.dart | 1 + .../coins/namecoin/namecoin_wallet.dart | 1 + .../coins/particl/particl_wallet.dart | 2 ++ .../coins/wownero/wownero_wallet.dart | 1 + .../ethereum/ethereum_token_service.dart | 2 ++ lib/services/mixins/electrum_x_parsing.dart | 1 + lib/utilities/db_version_migration.dart | 1 + 20 files changed, 81 insertions(+), 19 deletions(-) diff --git a/lib/models/isar/models/blockchain_data/transaction.dart b/lib/models/isar/models/blockchain_data/transaction.dart index 39d2cc0af..e3e3d0595 100644 --- a/lib/models/isar/models/blockchain_data/transaction.dart +++ b/lib/models/isar/models/blockchain_data/transaction.dart @@ -12,6 +12,7 @@ part 'transaction.g.dart'; @Collection() class Transaction { + Transaction({ required this.walletId, required this.txid, @@ -29,6 +30,7 @@ class Transaction { required this.inputs, required this.outputs, required this.nonce, + required this.numberOfMessages, }); Tuple2 copyWith({ @@ -50,6 +52,7 @@ class Transaction { int? nonce, Id? id, Address? address, + int? numberOfMessages, }) { return Tuple2( Transaction( @@ -68,7 +71,8 @@ class Transaction { otherData: otherData ?? this.otherData, nonce: nonce ?? this.nonce, inputs: inputs ?? this.inputs, - outputs: outputs ?? this.outputs) + outputs: outputs ?? this.outputs, + numberOfMessages: numberOfMessages ?? this.numberOfMessages) ..id = id ?? this.id, address ?? this.address.value, ); @@ -114,6 +118,8 @@ class Transaction { late final List outputs; + late final int? numberOfMessages; + @Backlink(to: "transactions") final address = IsarLink
(); @@ -154,6 +160,7 @@ class Transaction { "address: ${address.value}, " "inputsLength: ${inputs.length}, " "outputsLength: ${outputs.length}, " + "numberOfMessages: $numberOfMessages, " "}"; String toJsonString() { @@ -175,6 +182,7 @@ class Transaction { "address": address.value?.toJsonString(), "inputs": inputs.map((e) => e.toJsonString()).toList(), "outputs": outputs.map((e) => e.toJsonString()).toList(), + "numberOfMessages": numberOfMessages, }; return jsonEncode(result); } @@ -205,6 +213,7 @@ class Transaction { outputs: List.from(json["outputs"] as List) .map((e) => Output.fromJsonString(e)) .toList(), + numberOfMessages: json["numberOfMessages"] as int, ); if (json["address"] == null) { return Tuple2(transaction, null); diff --git a/lib/models/isar/models/blockchain_data/transaction.g.dart b/lib/models/isar/models/blockchain_data/transaction.g.dart index 74a5a1652..ba603b250 100644 --- a/lib/models/isar/models/blockchain_data/transaction.g.dart +++ b/lib/models/isar/models/blockchain_data/transaction.g.dart @@ -286,6 +286,7 @@ Transaction _transactionDeserialize( type: _TransactiontypeValueEnumMap[reader.readByteOrNull(offsets[14])] ?? TransactionType.outgoing, walletId: reader.readString(offsets[15]), + numberOfMessages: reader.readLong(offsets[2]), ); object.id = id; return object; diff --git a/lib/models/paymint/transactions_model.dart b/lib/models/paymint/transactions_model.dart index cee48b8eb..4982f1ec1 100644 --- a/lib/models/paymint/transactions_model.dart +++ b/lib/models/paymint/transactions_model.dart @@ -155,6 +155,9 @@ class Transaction { // @HiveField(18) final String? otherData; + // @HiveField(16) + final int? numberOfMessages; + Transaction({ required this.txid, required this.confirmedStatus, @@ -176,6 +179,7 @@ class Transaction { this.isCancelled = false, this.slateId, this.otherData, + this.numberOfMessages, }); factory Transaction.fromJson(Map json) { @@ -211,6 +215,7 @@ class Transaction { isCancelled: json["isCancelled"] as bool? ?? false, slateId: json["slateId"] as String?, otherData: json["otherData"] as String?, + numberOfMessages: json["numberOfMessages"] as int?, ); } @@ -269,6 +274,7 @@ class Transaction { bool? isCancelled, String? slateId, String? otherData, + int? numberOfMessages, }) { return Transaction( txid: txid ?? this.txid, @@ -292,13 +298,14 @@ class Transaction { isCancelled: isCancelled ?? this.isCancelled, slateId: slateId ?? this.slateId, otherData: otherData ?? this.otherData, + numberOfMessages: numberOfMessages ?? this.numberOfMessages, ); } @override String toString() { String transaction = - "{txid: $txid, type: $txType, subType: $subType, value: $amount, fee: $fees, height: $height, confirm: $confirmedStatus, confirmations: $confirmations, address: $address, timestamp: $timestamp, worthNow: $worthNow, inputs: $inputs, slateid: $slateId }"; + "{txid: $txid, type: $txType, subType: $subType, value: $amount, fee: $fees, height: $height, confirm: $confirmedStatus, confirmations: $confirmations, address: $address, timestamp: $timestamp, worthNow: $worthNow, inputs: $inputs, slateid: $slateId, numberOfMessages: $numberOfMessages }"; return transaction; } } diff --git a/lib/pages/wallet_view/sub_widgets/transactions_list.dart b/lib/pages/wallet_view/sub_widgets/transactions_list.dart index e68b443ed..559906af7 100644 --- a/lib/pages/wallet_view/sub_widgets/transactions_list.dart +++ b/lib/pages/wallet_view/sub_widgets/transactions_list.dart @@ -93,12 +93,7 @@ class _TransactionsListState extends ConsumerState { children: [ TransactionCard( // this may mess with combined firo transactions - key: isConfirmed - ? Key(tx.txid + - tx.type.name + - tx.address.value.toString() + - tx.height.toString()) - : UniqueKey(), // + key: UniqueKey(), // transaction: tx, walletId: widget.walletId, ), @@ -193,12 +188,7 @@ class _TransactionsListState extends ConsumerState { ), child: TransactionCard( // this may mess with combined firo transactions - key: isConfirmed - ? Key(tx.txid + - tx.type.name + - tx.address.value.toString() + - tx.height.toString()) - : UniqueKey(), + key: UniqueKey(), transaction: tx, walletId: widget.walletId, ), diff --git a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart index d3f8467cd..d4165f811 100644 --- a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart @@ -126,6 +126,37 @@ class _TransactionDetailsViewState } } + if (coin == Coin.epicCash) { + if (_transaction.isCancelled) { + return "Cancelled"; + } else if (type == TransactionType.incoming) { + if (tx.isConfirmed(height, coin.requiredConfirmations)) { + return "Received"; + } else { + if (_transaction.numberOfMessages == 1) { + return "Receiving (waiting for sender)"; + } else if ((_transaction.numberOfMessages ?? 0) > 1) { + return + "Receiving (waiting for confirmations)"; // TODO test if the sender still has to open again after the receiver has 2 messages present, ie. sender->receiver->sender->node (yes) vs. sender->receiver->node (no) + } else { + return "Receiving"; + } + } + } else if (type == TransactionType.outgoing) { + if (tx.isConfirmed(height, coin.requiredConfirmations)) { + return "Sent (confirmed)"; + } else { + if (_transaction.numberOfMessages == 1) { + return "Sending (waiting for receiver)"; + } else if ((_transaction.numberOfMessages ?? 0) > 1) { + return "Sending (waiting for confirmations)"; + } else { + return "Sending"; + } + } + } + } + if (type == TransactionType.incoming) { // if (_transaction.isMinting) { // return "Minting"; diff --git a/lib/services/coins/bitcoin/bitcoin_wallet.dart b/lib/services/coins/bitcoin/bitcoin_wallet.dart index 0c7c86059..7d44af5dc 100644 --- a/lib/services/coins/bitcoin/bitcoin_wallet.dart +++ b/lib/services/coins/bitcoin/bitcoin_wallet.dart @@ -1288,6 +1288,7 @@ class BitcoinWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String diff --git a/lib/services/coins/bitcoincash/bitcoincash_wallet.dart b/lib/services/coins/bitcoincash/bitcoincash_wallet.dart index 47458a7d8..6ff56fd26 100644 --- a/lib/services/coins/bitcoincash/bitcoincash_wallet.dart +++ b/lib/services/coins/bitcoincash/bitcoincash_wallet.dart @@ -1153,6 +1153,7 @@ class BitcoinCashWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String @@ -2137,6 +2138,7 @@ class BitcoinCashWallet extends CoinServiceAPI nonce: null, inputs: inputs, outputs: outputs, + numberOfMessages: null, ); txns.add(Tuple2(tx, transactionAddress)); diff --git a/lib/services/coins/dogecoin/dogecoin_wallet.dart b/lib/services/coins/dogecoin/dogecoin_wallet.dart index cc081539c..cb4c17ed3 100644 --- a/lib/services/coins/dogecoin/dogecoin_wallet.dart +++ b/lib/services/coins/dogecoin/dogecoin_wallet.dart @@ -1140,6 +1140,7 @@ class DogecoinWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String diff --git a/lib/services/coins/ecash/ecash_wallet.dart b/lib/services/coins/ecash/ecash_wallet.dart index 4459c3fbc..62a2a8648 100644 --- a/lib/services/coins/ecash/ecash_wallet.dart +++ b/lib/services/coins/ecash/ecash_wallet.dart @@ -1365,6 +1365,7 @@ class ECashWallet extends CoinServiceAPI nonce: null, inputs: inputs, outputs: outputs, + numberOfMessages: null, ); txns.add(Tuple2(tx, transactionAddress)); @@ -2770,6 +2771,7 @@ class ECashWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String diff --git a/lib/services/coins/epiccash/epiccash_wallet.dart b/lib/services/coins/epiccash/epiccash_wallet.dart index 137be8001..acdd172cf 100644 --- a/lib/services/coins/epiccash/epiccash_wallet.dart +++ b/lib/services/coins/epiccash/epiccash_wallet.dart @@ -1153,10 +1153,6 @@ class EpicCashWallet extends CoinServiceAPI Future startScans() async { try { if (ListenerManager.pointer != null) { - Logging.instance - .log("LISTENER HANDLER IS NOT NULL ....", level: LogLevel.Info); - Logging.instance - .log("STOPPING ANY WALLET LISTENER ....", level: LogLevel.Info); epicboxListenerStop(ListenerManager.pointer!); } @@ -1643,7 +1639,7 @@ class EpicCashWallet extends CoinServiceAPI Future _refreshTransactions() async { // final currentChainHeight = await chainHeight; final wallet = await _secureStore.read(key: '${_walletId}_wallet'); - const refreshFromNode = 0; + const refreshFromNode = 1; dynamic message; await m.protect(() async { @@ -1709,6 +1705,7 @@ class EpicCashWallet extends CoinServiceAPI ?[tx["tx_type"] == "TxReceived" ? "from" : "to"] as String? ?? ""; String? commitId = slatesToCommits[slateId]?['commitId'] as String?; + tx['numberOfMessages'] = tx['messages']?['messages']?.length; int? height; @@ -1721,6 +1718,7 @@ class EpicCashWallet extends CoinServiceAPI final isIncoming = (tx["tx_type"] == "TxReceived" || tx["tx_type"] == "TxReceivedCancelled"); + final txn = isar_models.Transaction( walletId: walletId, txid: commitId ?? tx["id"].toString(), @@ -1744,6 +1742,7 @@ class EpicCashWallet extends CoinServiceAPI otherData: tx["id"].toString(), inputs: [], outputs: [], + numberOfMessages: ((tx["numberOfMessages"] == null) ? 0 : tx["numberOfMessages"]) as int, ); // txn.address = diff --git a/lib/services/coins/ethereum/ethereum_wallet.dart b/lib/services/coins/ethereum/ethereum_wallet.dart index 2052ead4b..5ea669b7a 100644 --- a/lib/services/coins/ethereum/ethereum_wallet.dart +++ b/lib/services/coins/ethereum/ethereum_wallet.dart @@ -944,6 +944,7 @@ class EthereumWallet extends CoinServiceAPI with WalletCache, WalletDB { response.value?.nonce.toBigIntFromHex.toInt(), inputs: [], outputs: [], + numberOfMessages: null, ); Address? address = await db.getAddress( @@ -1035,6 +1036,7 @@ class EthereumWallet extends CoinServiceAPI with WalletCache, WalletDB { nonce: tuple.item2, inputs: [], outputs: [], + numberOfMessages: null, ); Address? transactionAddress = await db diff --git a/lib/services/coins/firo/firo_wallet.dart b/lib/services/coins/firo/firo_wallet.dart index fa9cfca5c..be25c4188 100644 --- a/lib/services/coins/firo/firo_wallet.dart +++ b/lib/services/coins/firo/firo_wallet.dart @@ -449,6 +449,7 @@ Future> staticProcessRestore( nonce: null, inputs: element.inputs, outputs: element.outputs, + numberOfMessages: null, )..address.value = element.address.value; } }); @@ -891,6 +892,7 @@ class FiroWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String @@ -3033,6 +3035,7 @@ class FiroWallet extends CoinServiceAPI otherData: transactionInfo["otherData"] as String?, inputs: [], outputs: [], + numberOfMessages: null, ); final transactionAddress = await db @@ -3513,6 +3516,7 @@ class FiroWallet extends CoinServiceAPI nonce: null, inputs: ins, outputs: [], + numberOfMessages: null, ); txnsData.add(Tuple2(tx, null)); @@ -3635,6 +3639,7 @@ class FiroWallet extends CoinServiceAPI nonce: null, inputs: ins, outputs: outs, + numberOfMessages: null, ); txnsData.add(Tuple2(tx, transactionAddress)); @@ -3786,6 +3791,7 @@ class FiroWallet extends CoinServiceAPI nonce: null, inputs: ins, outputs: outs, + numberOfMessages: null, ); txnsData.add(Tuple2(tx, transactionAddress)); @@ -5064,6 +5070,7 @@ class FiroWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = await db diff --git a/lib/services/coins/litecoin/litecoin_wallet.dart b/lib/services/coins/litecoin/litecoin_wallet.dart index 765f3d81a..c55566a34 100644 --- a/lib/services/coins/litecoin/litecoin_wallet.dart +++ b/lib/services/coins/litecoin/litecoin_wallet.dart @@ -1271,6 +1271,7 @@ class LitecoinWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String diff --git a/lib/services/coins/monero/monero_wallet.dart b/lib/services/coins/monero/monero_wallet.dart index 29debe753..248f60b84 100644 --- a/lib/services/coins/monero/monero_wallet.dart +++ b/lib/services/coins/monero/monero_wallet.dart @@ -954,6 +954,7 @@ class MoneroWallet extends CoinServiceAPI with WalletCache, WalletDB { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); txnsData.add(Tuple2(txn, address)); diff --git a/lib/services/coins/namecoin/namecoin_wallet.dart b/lib/services/coins/namecoin/namecoin_wallet.dart index 640b2cba0..09984733b 100644 --- a/lib/services/coins/namecoin/namecoin_wallet.dart +++ b/lib/services/coins/namecoin/namecoin_wallet.dart @@ -1260,6 +1260,7 @@ class NamecoinWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String diff --git a/lib/services/coins/particl/particl_wallet.dart b/lib/services/coins/particl/particl_wallet.dart index 34e5ede45..f6aa32532 100644 --- a/lib/services/coins/particl/particl_wallet.dart +++ b/lib/services/coins/particl/particl_wallet.dart @@ -1188,6 +1188,7 @@ class ParticlWallet extends CoinServiceAPI nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); final address = txData["address"] is String @@ -2391,6 +2392,7 @@ class ParticlWallet extends CoinServiceAPI nonce: null, slateId: null, otherData: null, + numberOfMessages: null, ); txns.add(Tuple2(tx, transactionAddress)); diff --git a/lib/services/coins/wownero/wownero_wallet.dart b/lib/services/coins/wownero/wownero_wallet.dart index c07582fa5..71b6bc295 100644 --- a/lib/services/coins/wownero/wownero_wallet.dart +++ b/lib/services/coins/wownero/wownero_wallet.dart @@ -1041,6 +1041,7 @@ class WowneroWallet extends CoinServiceAPI with WalletCache, WalletDB { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); txnsData.add(Tuple2(txn, address)); diff --git a/lib/services/ethereum/ethereum_token_service.dart b/lib/services/ethereum/ethereum_token_service.dart index c7007c905..f9faf1859 100644 --- a/lib/services/ethereum/ethereum_token_service.dart +++ b/lib/services/ethereum/ethereum_token_service.dart @@ -169,6 +169,7 @@ class EthTokenWallet extends ChangeNotifier with EthTokenCache { response.value?.nonce.toBigIntFromHex.toInt(), inputs: [], outputs: [], + numberOfMessages: null, ); Address? address = await ethWallet.db.getAddress( @@ -519,6 +520,7 @@ class EthTokenWallet extends ChangeNotifier with EthTokenCache { otherData: tuple.item1.address, inputs: [], outputs: [], + numberOfMessages: null, ); Address? transactionAddress = await ethWallet.db diff --git a/lib/services/mixins/electrum_x_parsing.dart b/lib/services/mixins/electrum_x_parsing.dart index 92cf86305..2827690c5 100644 --- a/lib/services/mixins/electrum_x_parsing.dart +++ b/lib/services/mixins/electrum_x_parsing.dart @@ -258,6 +258,7 @@ mixin ElectrumXParsing { nonce: null, inputs: ins, outputs: outs, + numberOfMessages: null, ); return Tuple2(tx, transactionAddress); diff --git a/lib/utilities/db_version_migration.dart b/lib/utilities/db_version_migration.dart index a83ea4305..c07ed5438 100644 --- a/lib/utilities/db_version_migration.dart +++ b/lib/utilities/db_version_migration.dart @@ -397,6 +397,7 @@ class DbVersionMigrator with WalletDB { nonce: null, inputs: [], outputs: [], + numberOfMessages: tx.numberOfMessages, ); if (tx.address.isEmpty) { From 436b11a102a75a84af5e736f8cc99f0fba23d70f Mon Sep 17 00:00:00 2001 From: likho Date: Mon, 29 May 2023 14:33:57 +0200 Subject: [PATCH 2/6] Generate isar model/ fix status showing incorrectly in the transaction view page --- .../models/blockchain_data/transaction.g.dart | 187 ++++-- test/electrumx_test.mocks.dart | 49 +- .../notification_card_test.mocks.dart | 9 + .../pages/send_view/send_view_test.mocks.dart | 9 + .../bitcoin/bitcoin_wallet_test.mocks.dart | 223 ++++---- .../bitcoincash_wallet_test.mocks.dart | 223 ++++---- .../dogecoin/dogecoin_wallet_test.mocks.dart | 223 ++++---- .../coins/firo/firo_wallet_test.mocks.dart | 541 +++++++++--------- test/services/coins/manager_test.mocks.dart | 8 + .../namecoin/namecoin_wallet_test.mocks.dart | 223 ++++---- .../particl/particl_wallet_test.mocks.dart | 223 ++++---- .../favorite_toggle_test.mocks.dart | 9 + .../custom_loading_overlay_test.mocks.dart | 9 + .../desktop/desktop_scaffold_test.mocks.dart | 9 + .../managed_favorite_test.mocks.dart | 9 + .../table_view/table_view_row_test.mocks.dart | 9 + test/widget_tests/trade_card_test.mocks.dart | 9 + .../transaction_card_test.mocks.dart | 17 + test/widget_tests/wallet_card_test.mocks.dart | 9 + .../wallet_info_row_test.mocks.dart | 9 + 20 files changed, 1052 insertions(+), 955 deletions(-) diff --git a/lib/models/isar/models/blockchain_data/transaction.g.dart b/lib/models/isar/models/blockchain_data/transaction.g.dart index ba603b250..c11649ddb 100644 --- a/lib/models/isar/models/blockchain_data/transaction.g.dart +++ b/lib/models/isar/models/blockchain_data/transaction.g.dart @@ -58,46 +58,51 @@ const TransactionSchema = CollectionSchema( name: r'nonce', type: IsarType.long, ), - r'otherData': PropertySchema( + r'numberOfMessages': PropertySchema( id: 8, + name: r'numberOfMessages', + type: IsarType.long, + ), + r'otherData': PropertySchema( + id: 9, name: r'otherData', type: IsarType.string, ), r'outputs': PropertySchema( - id: 9, + id: 10, name: r'outputs', type: IsarType.objectList, target: r'Output', ), r'slateId': PropertySchema( - id: 10, + id: 11, name: r'slateId', type: IsarType.string, ), r'subType': PropertySchema( - id: 11, + id: 12, name: r'subType', type: IsarType.byte, enumMap: _TransactionsubTypeEnumValueMap, ), r'timestamp': PropertySchema( - id: 12, + id: 13, name: r'timestamp', type: IsarType.long, ), r'txid': PropertySchema( - id: 13, + id: 14, name: r'txid', type: IsarType.string, ), r'type': PropertySchema( - id: 14, + id: 15, name: r'type', type: IsarType.byte, enumMap: _TransactiontypeEnumValueMap, ), r'walletId': PropertySchema( - id: 15, + id: 16, name: r'walletId', type: IsarType.string, ) @@ -233,19 +238,20 @@ void _transactionSerialize( writer.writeBool(offsets[5], object.isCancelled); writer.writeBool(offsets[6], object.isLelantus); writer.writeLong(offsets[7], object.nonce); - writer.writeString(offsets[8], object.otherData); + writer.writeLong(offsets[8], object.numberOfMessages); + writer.writeString(offsets[9], object.otherData); writer.writeObjectList( - offsets[9], + offsets[10], allOffsets, OutputSchema.serialize, object.outputs, ); - writer.writeString(offsets[10], object.slateId); - writer.writeByte(offsets[11], object.subType.index); - writer.writeLong(offsets[12], object.timestamp); - writer.writeString(offsets[13], object.txid); - writer.writeByte(offsets[14], object.type.index); - writer.writeString(offsets[15], object.walletId); + writer.writeString(offsets[11], object.slateId); + writer.writeByte(offsets[12], object.subType.index); + writer.writeLong(offsets[13], object.timestamp); + writer.writeString(offsets[14], object.txid); + writer.writeByte(offsets[15], object.type.index); + writer.writeString(offsets[16], object.walletId); } Transaction _transactionDeserialize( @@ -269,24 +275,24 @@ Transaction _transactionDeserialize( isCancelled: reader.readBool(offsets[5]), isLelantus: reader.readBoolOrNull(offsets[6]), nonce: reader.readLongOrNull(offsets[7]), - otherData: reader.readStringOrNull(offsets[8]), + numberOfMessages: reader.readLongOrNull(offsets[8]), + otherData: reader.readStringOrNull(offsets[9]), outputs: reader.readObjectList( - offsets[9], + offsets[10], OutputSchema.deserialize, allOffsets, Output(), ) ?? [], - slateId: reader.readStringOrNull(offsets[10]), + slateId: reader.readStringOrNull(offsets[11]), subType: - _TransactionsubTypeValueEnumMap[reader.readByteOrNull(offsets[11])] ?? + _TransactionsubTypeValueEnumMap[reader.readByteOrNull(offsets[12])] ?? TransactionSubType.none, - timestamp: reader.readLong(offsets[12]), - txid: reader.readString(offsets[13]), - type: _TransactiontypeValueEnumMap[reader.readByteOrNull(offsets[14])] ?? + timestamp: reader.readLong(offsets[13]), + txid: reader.readString(offsets[14]), + type: _TransactiontypeValueEnumMap[reader.readByteOrNull(offsets[15])] ?? TransactionType.outgoing, - walletId: reader.readString(offsets[15]), - numberOfMessages: reader.readLong(offsets[2]), + walletId: reader.readString(offsets[16]), ); object.id = id; return object; @@ -322,8 +328,10 @@ P _transactionDeserializeProp

( case 7: return (reader.readLongOrNull(offset)) as P; case 8: - return (reader.readStringOrNull(offset)) as P; + return (reader.readLongOrNull(offset)) as P; case 9: + return (reader.readStringOrNull(offset)) as P; + case 10: return (reader.readObjectList( offset, OutputSchema.deserialize, @@ -331,19 +339,19 @@ P _transactionDeserializeProp

( Output(), ) ?? []) as P; - case 10: - return (reader.readStringOrNull(offset)) as P; case 11: + return (reader.readStringOrNull(offset)) as P; + case 12: return (_TransactionsubTypeValueEnumMap[reader.readByteOrNull(offset)] ?? TransactionSubType.none) as P; - case 12: - return (reader.readLong(offset)) as P; case 13: - return (reader.readString(offset)) as P; + return (reader.readLong(offset)) as P; case 14: + return (reader.readString(offset)) as P; + case 15: return (_TransactiontypeValueEnumMap[reader.readByteOrNull(offset)] ?? TransactionType.outgoing) as P; - case 15: + case 16: return (reader.readString(offset)) as P; default: throw IsarError('Unknown property with id $propertyId'); @@ -1375,6 +1383,80 @@ extension TransactionQueryFilter }); } + QueryBuilder + numberOfMessagesIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'numberOfMessages', + )); + }); + } + + QueryBuilder + numberOfMessagesIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'numberOfMessages', + )); + }); + } + + QueryBuilder + numberOfMessagesEqualTo(int? value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'numberOfMessages', + value: value, + )); + }); + } + + QueryBuilder + numberOfMessagesGreaterThan( + int? value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'numberOfMessages', + value: value, + )); + }); + } + + QueryBuilder + numberOfMessagesLessThan( + int? value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'numberOfMessages', + value: value, + )); + }); + } + + QueryBuilder + numberOfMessagesBetween( + int? lower, + int? upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'numberOfMessages', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + QueryBuilder otherDataIsNull() { return QueryBuilder.apply(this, (query) { @@ -2321,6 +2403,20 @@ extension TransactionQuerySortBy }); } + QueryBuilder + sortByNumberOfMessages() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'numberOfMessages', Sort.asc); + }); + } + + QueryBuilder + sortByNumberOfMessagesDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'numberOfMessages', Sort.desc); + }); + } + QueryBuilder sortByOtherData() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'otherData', Sort.asc); @@ -2505,6 +2601,20 @@ extension TransactionQuerySortThenBy }); } + QueryBuilder + thenByNumberOfMessages() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'numberOfMessages', Sort.asc); + }); + } + + QueryBuilder + thenByNumberOfMessagesDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'numberOfMessages', Sort.desc); + }); + } + QueryBuilder thenByOtherData() { return QueryBuilder.apply(this, (query) { return query.addSortBy(r'otherData', Sort.asc); @@ -2635,6 +2745,13 @@ extension TransactionQueryWhereDistinct }); } + QueryBuilder + distinctByNumberOfMessages() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'numberOfMessages'); + }); + } + QueryBuilder distinctByOtherData( {bool caseSensitive = true}) { return QueryBuilder.apply(this, (query) { @@ -2738,6 +2855,12 @@ extension TransactionQueryProperty }); } + QueryBuilder numberOfMessagesProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'numberOfMessages'); + }); + } + QueryBuilder otherDataProperty() { return QueryBuilder.apply(this, (query) { return query.addPropertyName(r'otherData'); diff --git a/test/electrumx_test.mocks.dart b/test/electrumx_test.mocks.dart index 1cfe9cf4a..6e5d43014 100644 --- a/test/electrumx_test.mocks.dart +++ b/test/electrumx_test.mocks.dart @@ -47,40 +47,16 @@ class MockJsonRPC extends _i1.Mock implements _i2.JsonRPC { returnValue: false, ) as bool); @override - set useSSL(bool? _useSSL) => super.noSuchMethod( - Invocation.setter( - #useSSL, - _useSSL, - ), - returnValueForMissingStub: null, - ); - @override String get host => (super.noSuchMethod( Invocation.getter(#host), returnValue: '', ) as String); @override - set host(String? _host) => super.noSuchMethod( - Invocation.setter( - #host, - _host, - ), - returnValueForMissingStub: null, - ); - @override int get port => (super.noSuchMethod( Invocation.getter(#port), returnValue: 0, ) as int); @override - set port(int? _port) => super.noSuchMethod( - Invocation.setter( - #port, - _port, - ), - returnValueForMissingStub: null, - ); - @override Duration get connectionTimeout => (super.noSuchMethod( Invocation.getter(#connectionTimeout), returnValue: _FakeDuration_0( @@ -89,14 +65,6 @@ class MockJsonRPC extends _i1.Mock implements _i2.JsonRPC { ), ) as Duration); @override - set connectionTimeout(Duration? _connectionTimeout) => super.noSuchMethod( - Invocation.setter( - #connectionTimeout, - _connectionTimeout, - ), - returnValueForMissingStub: null, - ); - @override _i3.Future request(String? jsonRpcRequest) => (super.noSuchMethod( Invocation.method( #request, @@ -104,6 +72,23 @@ class MockJsonRPC extends _i1.Mock implements _i2.JsonRPC { ), returnValue: _i3.Future.value(), ) as _i3.Future); + @override + void disconnect() => super.noSuchMethod( + Invocation.method( + #disconnect, + [], + ), + returnValueForMissingStub: null, + ); + @override + _i3.Future connect() => (super.noSuchMethod( + Invocation.method( + #connect, + [], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [Prefs]. diff --git a/test/notifications/notification_card_test.mocks.dart b/test/notifications/notification_card_test.mocks.dart index 7f60b97c9..bb8b8ae74 100644 --- a/test/notifications/notification_card_test.mocks.dart +++ b/test/notifications/notification_card_test.mocks.dart @@ -83,6 +83,15 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService { returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override + _i5.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override _i5.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( Invocation.method( diff --git a/test/pages/send_view/send_view_test.mocks.dart b/test/pages/send_view/send_view_test.mocks.dart index 8a33fcb87..2276836ce 100644 --- a/test/pages/send_view/send_view_test.mocks.dart +++ b/test/pages/send_view/send_view_test.mocks.dart @@ -2278,6 +2278,15 @@ class MockThemeService extends _i1.Mock implements _i32.ThemeService { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override + _i23.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i23.Future.value(), + returnValueForMissingStub: _i23.Future.value(), + ) as _i23.Future); + @override _i23.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( Invocation.method( diff --git a/test/services/coins/bitcoin/bitcoin_wallet_test.mocks.dart b/test/services/coins/bitcoin/bitcoin_wallet_test.mocks.dart index 93eb0e1c8..f88574029 100644 --- a/test/services/coins/bitcoin/bitcoin_wallet_test.mocks.dart +++ b/test/services/coins/bitcoin/bitcoin_wallet_test.mocks.dart @@ -3,16 +3,15 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i5; +import 'dart:async' as _i4; import 'package:decimal/decimal.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i6; -import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i4; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i5; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i3; import 'package:stackwallet/services/transaction_notification_tracker.dart' - as _i8; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i7; -import 'package:stackwallet/utilities/prefs.dart' as _i3; + as _i7; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i6; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -35,8 +34,8 @@ class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal { ); } -class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { - _FakePrefs_1( +class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX { + _FakeElectrumX_1( Object parent, Invocation parentInvocation, ) : super( @@ -48,13 +47,13 @@ class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { /// A class which mocks [ElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { +class MockElectrumX extends _i1.Mock implements _i3.ElectrumX { MockElectrumX() { _i1.throwOnMissingStub(this); } @override - set failovers(List<_i4.ElectrumXNode>? _failovers) => super.noSuchMethod( + set failovers(List<_i3.ElectrumXNode>? _failovers) => super.noSuchMethod( Invocation.setter( #failovers, _failovers, @@ -90,7 +89,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { returnValue: false, ) as bool); @override - _i5.Future request({ + _i4.Future request({ required String? command, List? args = const [], Duration? connectionTimeout = const Duration(seconds: 60), @@ -109,10 +108,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future>> batchRequest({ + _i4.Future>> batchRequest({ required String? command, required Map>? args, Duration? connectionTimeout = const Duration(seconds: 60), @@ -129,11 +128,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future ping({ + _i4.Future ping({ String? requestID, int? retryCount = 1, }) => @@ -146,10 +145,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retryCount: retryCount, }, ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + returnValue: _i4.Future.value(false), + ) as _i4.Future); @override - _i5.Future> getBlockHeadTip({String? requestID}) => + _i4.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( Invocation.method( #getBlockHeadTip, @@ -157,10 +156,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getServerFeatures({String? requestID}) => + _i4.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( Invocation.method( #getServerFeatures, @@ -168,10 +167,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future broadcastTransaction({ + _i4.Future broadcastTransaction({ required String? rawTx, String? requestID, }) => @@ -184,10 +183,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future.value(''), - ) as _i5.Future); + returnValue: _i4.Future.value(''), + ) as _i4.Future); @override - _i5.Future> getBalance({ + _i4.Future> getBalance({ required String? scripthash, String? requestID, }) => @@ -201,10 +200,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future>> getHistory({ + _i4.Future>> getHistory({ required String? scripthash, String? requestID, }) => @@ -217,11 +216,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future>>> getBatchHistory( + _i4.Future>>> getBatchHistory( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -229,11 +228,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i5.Future>>>.value( + returnValue: _i4.Future>>>.value( >>{}), - ) as _i5.Future>>>); + ) as _i4.Future>>>); @override - _i5.Future>> getUTXOs({ + _i4.Future>> getUTXOs({ required String? scripthash, String? requestID, }) => @@ -246,11 +245,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future>>> getBatchUTXOs( + _i4.Future>>> getBatchUTXOs( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -258,11 +257,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i5.Future>>>.value( + returnValue: _i4.Future>>>.value( >>{}), - ) as _i5.Future>>>); + ) as _i4.Future>>>); @override - _i5.Future> getTransaction({ + _i4.Future> getTransaction({ required String? txHash, bool? verbose = true, String? requestID, @@ -278,10 +277,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getAnonymitySet({ + _i4.Future> getAnonymitySet({ String? groupId = r'1', String? blockhash = r'', String? requestID, @@ -297,10 +296,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future getMintData({ + _i4.Future getMintData({ dynamic mints, String? requestID, }) => @@ -313,10 +312,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future> getUsedCoinSerials({ + _i4.Future> getUsedCoinSerials({ String? requestID, required int? startNumber, }) => @@ -330,19 +329,19 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( + _i4.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i5.Future.value(0), - ) as _i5.Future); + returnValue: _i4.Future.value(0), + ) as _i4.Future); @override - _i5.Future> getFeeRate({String? requestID}) => + _i4.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( Invocation.method( #getFeeRate, @@ -350,10 +349,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future<_i2.Decimal> estimateFee({ + _i4.Future<_i2.Decimal> estimateFee({ String? requestID, required int? blocks, }) => @@ -366,7 +365,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #blocks: blocks, }, ), - returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #estimateFee, @@ -377,15 +376,15 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), )), - ) as _i5.Future<_i2.Decimal>); + ) as _i4.Future<_i2.Decimal>); @override - _i5.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + _i4.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( Invocation.method( #relayFee, [], {#requestID: requestID}, ), - returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #relayFee, @@ -393,50 +392,30 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), )), - ) as _i5.Future<_i2.Decimal>); + ) as _i4.Future<_i2.Decimal>); } /// A class which mocks [CachedElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { +class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX { MockCachedElectrumX() { _i1.throwOnMissingStub(this); } @override - String get server => (super.noSuchMethod( - Invocation.getter(#server), - returnValue: '', - ) as String); - @override - int get port => (super.noSuchMethod( - Invocation.getter(#port), - returnValue: 0, - ) as int); - @override - bool get useSSL => (super.noSuchMethod( - Invocation.getter(#useSSL), - returnValue: false, - ) as bool); - @override - _i3.Prefs get prefs => (super.noSuchMethod( - Invocation.getter(#prefs), - returnValue: _FakePrefs_1( + _i3.ElectrumX get electrumXClient => (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumX_1( this, - Invocation.getter(#prefs), + Invocation.getter(#electrumXClient), ), - ) as _i3.Prefs); + ) as _i3.ElectrumX); @override - List<_i4.ElectrumXNode> get failovers => (super.noSuchMethod( - Invocation.getter(#failovers), - returnValue: <_i4.ElectrumXNode>[], - ) as List<_i4.ElectrumXNode>); - @override - _i5.Future> getAnonymitySet({ + _i4.Future> getAnonymitySet({ required String? groupId, String? blockhash = r'', - required _i7.Coin? coin, + required _i6.Coin? coin, }) => (super.noSuchMethod( Invocation.method( @@ -449,8 +428,8 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override String base64ToHex(String? source) => (super.noSuchMethod( Invocation.method( @@ -468,9 +447,9 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { returnValue: '', ) as String); @override - _i5.Future> getTransaction({ + _i4.Future> getTransaction({ required String? txHash, - required _i7.Coin? coin, + required _i6.Coin? coin, bool? verbose = true, }) => (super.noSuchMethod( @@ -484,11 +463,11 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getUsedCoinSerials({ - required _i7.Coin? coin, + _i4.Future> getUsedCoinSerials({ + required _i6.Coin? coin, int? startNumber = 0, }) => (super.noSuchMethod( @@ -500,26 +479,26 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { #startNumber: startNumber, }, ), - returnValue: _i5.Future>.value([]), - ) as _i5.Future>); + returnValue: _i4.Future>.value([]), + ) as _i4.Future>); @override - _i5.Future clearSharedTransactionCache({required _i7.Coin? coin}) => + _i4.Future clearSharedTransactionCache({required _i6.Coin? coin}) => (super.noSuchMethod( Invocation.method( #clearSharedTransactionCache, [], {#coin: coin}, ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [TransactionNotificationTracker]. /// /// See the documentation for Mockito's code generation for more information. class MockTransactionNotificationTracker extends _i1.Mock - implements _i8.TransactionNotificationTracker { + implements _i7.TransactionNotificationTracker { MockTransactionNotificationTracker() { _i1.throwOnMissingStub(this); } @@ -548,14 +527,14 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i5.Future addNotifiedPending(String? txid) => (super.noSuchMethod( + _i4.Future addNotifiedPending(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedPending, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( @@ -565,21 +544,21 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i5.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( + _i4.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedConfirmed, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future deleteTransaction(String? txid) => (super.noSuchMethod( + _i4.Future deleteTransaction(String? txid) => (super.noSuchMethod( Invocation.method( #deleteTransaction, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } diff --git a/test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart b/test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart index 05cd24ebd..2e39e6916 100644 --- a/test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart +++ b/test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart @@ -3,16 +3,15 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i5; +import 'dart:async' as _i4; import 'package:decimal/decimal.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i6; -import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i4; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i5; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i3; import 'package:stackwallet/services/transaction_notification_tracker.dart' - as _i8; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i7; -import 'package:stackwallet/utilities/prefs.dart' as _i3; + as _i7; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i6; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -35,8 +34,8 @@ class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal { ); } -class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { - _FakePrefs_1( +class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX { + _FakeElectrumX_1( Object parent, Invocation parentInvocation, ) : super( @@ -48,13 +47,13 @@ class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { /// A class which mocks [ElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { +class MockElectrumX extends _i1.Mock implements _i3.ElectrumX { MockElectrumX() { _i1.throwOnMissingStub(this); } @override - set failovers(List<_i4.ElectrumXNode>? _failovers) => super.noSuchMethod( + set failovers(List<_i3.ElectrumXNode>? _failovers) => super.noSuchMethod( Invocation.setter( #failovers, _failovers, @@ -90,7 +89,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { returnValue: false, ) as bool); @override - _i5.Future request({ + _i4.Future request({ required String? command, List? args = const [], Duration? connectionTimeout = const Duration(seconds: 60), @@ -109,10 +108,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future>> batchRequest({ + _i4.Future>> batchRequest({ required String? command, required Map>? args, Duration? connectionTimeout = const Duration(seconds: 60), @@ -129,11 +128,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future ping({ + _i4.Future ping({ String? requestID, int? retryCount = 1, }) => @@ -146,10 +145,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retryCount: retryCount, }, ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + returnValue: _i4.Future.value(false), + ) as _i4.Future); @override - _i5.Future> getBlockHeadTip({String? requestID}) => + _i4.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( Invocation.method( #getBlockHeadTip, @@ -157,10 +156,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getServerFeatures({String? requestID}) => + _i4.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( Invocation.method( #getServerFeatures, @@ -168,10 +167,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future broadcastTransaction({ + _i4.Future broadcastTransaction({ required String? rawTx, String? requestID, }) => @@ -184,10 +183,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future.value(''), - ) as _i5.Future); + returnValue: _i4.Future.value(''), + ) as _i4.Future); @override - _i5.Future> getBalance({ + _i4.Future> getBalance({ required String? scripthash, String? requestID, }) => @@ -201,10 +200,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future>> getHistory({ + _i4.Future>> getHistory({ required String? scripthash, String? requestID, }) => @@ -217,11 +216,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future>>> getBatchHistory( + _i4.Future>>> getBatchHistory( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -229,11 +228,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i5.Future>>>.value( + returnValue: _i4.Future>>>.value( >>{}), - ) as _i5.Future>>>); + ) as _i4.Future>>>); @override - _i5.Future>> getUTXOs({ + _i4.Future>> getUTXOs({ required String? scripthash, String? requestID, }) => @@ -246,11 +245,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future>>> getBatchUTXOs( + _i4.Future>>> getBatchUTXOs( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -258,11 +257,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i5.Future>>>.value( + returnValue: _i4.Future>>>.value( >>{}), - ) as _i5.Future>>>); + ) as _i4.Future>>>); @override - _i5.Future> getTransaction({ + _i4.Future> getTransaction({ required String? txHash, bool? verbose = true, String? requestID, @@ -278,10 +277,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getAnonymitySet({ + _i4.Future> getAnonymitySet({ String? groupId = r'1', String? blockhash = r'', String? requestID, @@ -297,10 +296,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future getMintData({ + _i4.Future getMintData({ dynamic mints, String? requestID, }) => @@ -313,10 +312,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future> getUsedCoinSerials({ + _i4.Future> getUsedCoinSerials({ String? requestID, required int? startNumber, }) => @@ -330,19 +329,19 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( + _i4.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i5.Future.value(0), - ) as _i5.Future); + returnValue: _i4.Future.value(0), + ) as _i4.Future); @override - _i5.Future> getFeeRate({String? requestID}) => + _i4.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( Invocation.method( #getFeeRate, @@ -350,10 +349,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future<_i2.Decimal> estimateFee({ + _i4.Future<_i2.Decimal> estimateFee({ String? requestID, required int? blocks, }) => @@ -366,7 +365,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #blocks: blocks, }, ), - returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #estimateFee, @@ -377,15 +376,15 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), )), - ) as _i5.Future<_i2.Decimal>); + ) as _i4.Future<_i2.Decimal>); @override - _i5.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + _i4.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( Invocation.method( #relayFee, [], {#requestID: requestID}, ), - returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #relayFee, @@ -393,50 +392,30 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), )), - ) as _i5.Future<_i2.Decimal>); + ) as _i4.Future<_i2.Decimal>); } /// A class which mocks [CachedElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { +class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX { MockCachedElectrumX() { _i1.throwOnMissingStub(this); } @override - String get server => (super.noSuchMethod( - Invocation.getter(#server), - returnValue: '', - ) as String); - @override - int get port => (super.noSuchMethod( - Invocation.getter(#port), - returnValue: 0, - ) as int); - @override - bool get useSSL => (super.noSuchMethod( - Invocation.getter(#useSSL), - returnValue: false, - ) as bool); - @override - _i3.Prefs get prefs => (super.noSuchMethod( - Invocation.getter(#prefs), - returnValue: _FakePrefs_1( + _i3.ElectrumX get electrumXClient => (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumX_1( this, - Invocation.getter(#prefs), + Invocation.getter(#electrumXClient), ), - ) as _i3.Prefs); + ) as _i3.ElectrumX); @override - List<_i4.ElectrumXNode> get failovers => (super.noSuchMethod( - Invocation.getter(#failovers), - returnValue: <_i4.ElectrumXNode>[], - ) as List<_i4.ElectrumXNode>); - @override - _i5.Future> getAnonymitySet({ + _i4.Future> getAnonymitySet({ required String? groupId, String? blockhash = r'', - required _i7.Coin? coin, + required _i6.Coin? coin, }) => (super.noSuchMethod( Invocation.method( @@ -449,8 +428,8 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override String base64ToHex(String? source) => (super.noSuchMethod( Invocation.method( @@ -468,9 +447,9 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { returnValue: '', ) as String); @override - _i5.Future> getTransaction({ + _i4.Future> getTransaction({ required String? txHash, - required _i7.Coin? coin, + required _i6.Coin? coin, bool? verbose = true, }) => (super.noSuchMethod( @@ -484,11 +463,11 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getUsedCoinSerials({ - required _i7.Coin? coin, + _i4.Future> getUsedCoinSerials({ + required _i6.Coin? coin, int? startNumber = 0, }) => (super.noSuchMethod( @@ -500,26 +479,26 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { #startNumber: startNumber, }, ), - returnValue: _i5.Future>.value([]), - ) as _i5.Future>); + returnValue: _i4.Future>.value([]), + ) as _i4.Future>); @override - _i5.Future clearSharedTransactionCache({required _i7.Coin? coin}) => + _i4.Future clearSharedTransactionCache({required _i6.Coin? coin}) => (super.noSuchMethod( Invocation.method( #clearSharedTransactionCache, [], {#coin: coin}, ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [TransactionNotificationTracker]. /// /// See the documentation for Mockito's code generation for more information. class MockTransactionNotificationTracker extends _i1.Mock - implements _i8.TransactionNotificationTracker { + implements _i7.TransactionNotificationTracker { MockTransactionNotificationTracker() { _i1.throwOnMissingStub(this); } @@ -548,14 +527,14 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i5.Future addNotifiedPending(String? txid) => (super.noSuchMethod( + _i4.Future addNotifiedPending(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedPending, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( @@ -565,21 +544,21 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i5.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( + _i4.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedConfirmed, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future deleteTransaction(String? txid) => (super.noSuchMethod( + _i4.Future deleteTransaction(String? txid) => (super.noSuchMethod( Invocation.method( #deleteTransaction, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } diff --git a/test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart b/test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart index ff04b9f73..cd9adfe0f 100644 --- a/test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart +++ b/test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart @@ -3,16 +3,15 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i5; +import 'dart:async' as _i4; import 'package:decimal/decimal.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i6; -import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i4; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i5; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i3; import 'package:stackwallet/services/transaction_notification_tracker.dart' - as _i8; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i7; -import 'package:stackwallet/utilities/prefs.dart' as _i3; + as _i7; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i6; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -35,8 +34,8 @@ class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal { ); } -class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { - _FakePrefs_1( +class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX { + _FakeElectrumX_1( Object parent, Invocation parentInvocation, ) : super( @@ -48,13 +47,13 @@ class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { /// A class which mocks [ElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { +class MockElectrumX extends _i1.Mock implements _i3.ElectrumX { MockElectrumX() { _i1.throwOnMissingStub(this); } @override - set failovers(List<_i4.ElectrumXNode>? _failovers) => super.noSuchMethod( + set failovers(List<_i3.ElectrumXNode>? _failovers) => super.noSuchMethod( Invocation.setter( #failovers, _failovers, @@ -90,7 +89,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { returnValue: false, ) as bool); @override - _i5.Future request({ + _i4.Future request({ required String? command, List? args = const [], Duration? connectionTimeout = const Duration(seconds: 60), @@ -109,10 +108,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future>> batchRequest({ + _i4.Future>> batchRequest({ required String? command, required Map>? args, Duration? connectionTimeout = const Duration(seconds: 60), @@ -129,11 +128,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future ping({ + _i4.Future ping({ String? requestID, int? retryCount = 1, }) => @@ -146,10 +145,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retryCount: retryCount, }, ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + returnValue: _i4.Future.value(false), + ) as _i4.Future); @override - _i5.Future> getBlockHeadTip({String? requestID}) => + _i4.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( Invocation.method( #getBlockHeadTip, @@ -157,10 +156,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getServerFeatures({String? requestID}) => + _i4.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( Invocation.method( #getServerFeatures, @@ -168,10 +167,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future broadcastTransaction({ + _i4.Future broadcastTransaction({ required String? rawTx, String? requestID, }) => @@ -184,10 +183,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future.value(''), - ) as _i5.Future); + returnValue: _i4.Future.value(''), + ) as _i4.Future); @override - _i5.Future> getBalance({ + _i4.Future> getBalance({ required String? scripthash, String? requestID, }) => @@ -201,10 +200,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future>> getHistory({ + _i4.Future>> getHistory({ required String? scripthash, String? requestID, }) => @@ -217,11 +216,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future>>> getBatchHistory( + _i4.Future>>> getBatchHistory( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -229,11 +228,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i5.Future>>>.value( + returnValue: _i4.Future>>>.value( >>{}), - ) as _i5.Future>>>); + ) as _i4.Future>>>); @override - _i5.Future>> getUTXOs({ + _i4.Future>> getUTXOs({ required String? scripthash, String? requestID, }) => @@ -246,11 +245,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future>>> getBatchUTXOs( + _i4.Future>>> getBatchUTXOs( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -258,11 +257,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i5.Future>>>.value( + returnValue: _i4.Future>>>.value( >>{}), - ) as _i5.Future>>>); + ) as _i4.Future>>>); @override - _i5.Future> getTransaction({ + _i4.Future> getTransaction({ required String? txHash, bool? verbose = true, String? requestID, @@ -278,10 +277,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getAnonymitySet({ + _i4.Future> getAnonymitySet({ String? groupId = r'1', String? blockhash = r'', String? requestID, @@ -297,10 +296,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future getMintData({ + _i4.Future getMintData({ dynamic mints, String? requestID, }) => @@ -313,10 +312,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future> getUsedCoinSerials({ + _i4.Future> getUsedCoinSerials({ String? requestID, required int? startNumber, }) => @@ -330,19 +329,19 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( + _i4.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i5.Future.value(0), - ) as _i5.Future); + returnValue: _i4.Future.value(0), + ) as _i4.Future); @override - _i5.Future> getFeeRate({String? requestID}) => + _i4.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( Invocation.method( #getFeeRate, @@ -350,10 +349,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future<_i2.Decimal> estimateFee({ + _i4.Future<_i2.Decimal> estimateFee({ String? requestID, required int? blocks, }) => @@ -366,7 +365,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #blocks: blocks, }, ), - returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #estimateFee, @@ -377,15 +376,15 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), )), - ) as _i5.Future<_i2.Decimal>); + ) as _i4.Future<_i2.Decimal>); @override - _i5.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + _i4.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( Invocation.method( #relayFee, [], {#requestID: requestID}, ), - returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #relayFee, @@ -393,50 +392,30 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), )), - ) as _i5.Future<_i2.Decimal>); + ) as _i4.Future<_i2.Decimal>); } /// A class which mocks [CachedElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { +class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX { MockCachedElectrumX() { _i1.throwOnMissingStub(this); } @override - String get server => (super.noSuchMethod( - Invocation.getter(#server), - returnValue: '', - ) as String); - @override - int get port => (super.noSuchMethod( - Invocation.getter(#port), - returnValue: 0, - ) as int); - @override - bool get useSSL => (super.noSuchMethod( - Invocation.getter(#useSSL), - returnValue: false, - ) as bool); - @override - _i3.Prefs get prefs => (super.noSuchMethod( - Invocation.getter(#prefs), - returnValue: _FakePrefs_1( + _i3.ElectrumX get electrumXClient => (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumX_1( this, - Invocation.getter(#prefs), + Invocation.getter(#electrumXClient), ), - ) as _i3.Prefs); + ) as _i3.ElectrumX); @override - List<_i4.ElectrumXNode> get failovers => (super.noSuchMethod( - Invocation.getter(#failovers), - returnValue: <_i4.ElectrumXNode>[], - ) as List<_i4.ElectrumXNode>); - @override - _i5.Future> getAnonymitySet({ + _i4.Future> getAnonymitySet({ required String? groupId, String? blockhash = r'', - required _i7.Coin? coin, + required _i6.Coin? coin, }) => (super.noSuchMethod( Invocation.method( @@ -449,8 +428,8 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override String base64ToHex(String? source) => (super.noSuchMethod( Invocation.method( @@ -468,9 +447,9 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { returnValue: '', ) as String); @override - _i5.Future> getTransaction({ + _i4.Future> getTransaction({ required String? txHash, - required _i7.Coin? coin, + required _i6.Coin? coin, bool? verbose = true, }) => (super.noSuchMethod( @@ -484,11 +463,11 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getUsedCoinSerials({ - required _i7.Coin? coin, + _i4.Future> getUsedCoinSerials({ + required _i6.Coin? coin, int? startNumber = 0, }) => (super.noSuchMethod( @@ -500,26 +479,26 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { #startNumber: startNumber, }, ), - returnValue: _i5.Future>.value([]), - ) as _i5.Future>); + returnValue: _i4.Future>.value([]), + ) as _i4.Future>); @override - _i5.Future clearSharedTransactionCache({required _i7.Coin? coin}) => + _i4.Future clearSharedTransactionCache({required _i6.Coin? coin}) => (super.noSuchMethod( Invocation.method( #clearSharedTransactionCache, [], {#coin: coin}, ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [TransactionNotificationTracker]. /// /// See the documentation for Mockito's code generation for more information. class MockTransactionNotificationTracker extends _i1.Mock - implements _i8.TransactionNotificationTracker { + implements _i7.TransactionNotificationTracker { MockTransactionNotificationTracker() { _i1.throwOnMissingStub(this); } @@ -548,14 +527,14 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i5.Future addNotifiedPending(String? txid) => (super.noSuchMethod( + _i4.Future addNotifiedPending(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedPending, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( @@ -565,21 +544,21 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i5.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( + _i4.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedConfirmed, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future deleteTransaction(String? txid) => (super.noSuchMethod( + _i4.Future deleteTransaction(String? txid) => (super.noSuchMethod( Invocation.method( #deleteTransaction, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } diff --git a/test/services/coins/firo/firo_wallet_test.mocks.dart b/test/services/coins/firo/firo_wallet_test.mocks.dart index bb6d13ca7..56864bfdb 100644 --- a/test/services/coins/firo/firo_wallet_test.mocks.dart +++ b/test/services/coins/firo/firo_wallet_test.mocks.dart @@ -3,22 +3,21 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i6; +import 'dart:async' as _i5; import 'package:decimal/decimal.dart' as _i2; import 'package:isar/isar.dart' as _i4; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/db/isar/main_db.dart' as _i10; -import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i7; -import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i5; -import 'package:stackwallet/models/isar/models/block_explorer.dart' as _i12; -import 'package:stackwallet/models/isar/models/contact_entry.dart' as _i11; -import 'package:stackwallet/models/isar/models/isar_models.dart' as _i13; +import 'package:stackwallet/db/isar/main_db.dart' as _i9; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i6; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i3; +import 'package:stackwallet/models/isar/models/block_explorer.dart' as _i11; +import 'package:stackwallet/models/isar/models/contact_entry.dart' as _i10; +import 'package:stackwallet/models/isar/models/isar_models.dart' as _i12; import 'package:stackwallet/services/transaction_notification_tracker.dart' - as _i9; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i8; -import 'package:stackwallet/utilities/prefs.dart' as _i3; -import 'package:tuple/tuple.dart' as _i14; + as _i8; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i7; +import 'package:tuple/tuple.dart' as _i13; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -41,8 +40,8 @@ class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal { ); } -class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { - _FakePrefs_1( +class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX { + _FakeElectrumX_1( Object parent, Invocation parentInvocation, ) : super( @@ -75,13 +74,13 @@ class _FakeQueryBuilder_3 extends _i1.SmartFake /// A class which mocks [ElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { +class MockElectrumX extends _i1.Mock implements _i3.ElectrumX { MockElectrumX() { _i1.throwOnMissingStub(this); } @override - set failovers(List<_i5.ElectrumXNode>? _failovers) => super.noSuchMethod( + set failovers(List<_i3.ElectrumXNode>? _failovers) => super.noSuchMethod( Invocation.setter( #failovers, _failovers, @@ -117,7 +116,7 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { returnValue: false, ) as bool); @override - _i6.Future request({ + _i5.Future request({ required String? command, List? args = const [], Duration? connectionTimeout = const Duration(seconds: 60), @@ -136,10 +135,10 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { #retries: retries, }, ), - returnValue: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Future>> batchRequest({ + _i5.Future>> batchRequest({ required String? command, required Map>? args, Duration? connectionTimeout = const Duration(seconds: 60), @@ -156,11 +155,11 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { #retries: retries, }, ), - returnValue: _i6.Future>>.value( + returnValue: _i5.Future>>.value( >[]), - ) as _i6.Future>>); + ) as _i5.Future>>); @override - _i6.Future ping({ + _i5.Future ping({ String? requestID, int? retryCount = 1, }) => @@ -173,10 +172,10 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { #retryCount: retryCount, }, ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + returnValue: _i5.Future.value(false), + ) as _i5.Future); @override - _i6.Future> getBlockHeadTip({String? requestID}) => + _i5.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( Invocation.method( #getBlockHeadTip, @@ -184,10 +183,10 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { {#requestID: requestID}, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i5.Future>.value({}), + ) as _i5.Future>); @override - _i6.Future> getServerFeatures({String? requestID}) => + _i5.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( Invocation.method( #getServerFeatures, @@ -195,10 +194,10 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { {#requestID: requestID}, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i5.Future>.value({}), + ) as _i5.Future>); @override - _i6.Future broadcastTransaction({ + _i5.Future broadcastTransaction({ required String? rawTx, String? requestID, }) => @@ -211,10 +210,10 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { #requestID: requestID, }, ), - returnValue: _i6.Future.value(''), - ) as _i6.Future); + returnValue: _i5.Future.value(''), + ) as _i5.Future); @override - _i6.Future> getBalance({ + _i5.Future> getBalance({ required String? scripthash, String? requestID, }) => @@ -228,10 +227,10 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i5.Future>.value({}), + ) as _i5.Future>); @override - _i6.Future>> getHistory({ + _i5.Future>> getHistory({ required String? scripthash, String? requestID, }) => @@ -244,11 +243,11 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { #requestID: requestID, }, ), - returnValue: _i6.Future>>.value( + returnValue: _i5.Future>>.value( >[]), - ) as _i6.Future>>); + ) as _i5.Future>>); @override - _i6.Future>>> getBatchHistory( + _i5.Future>>> getBatchHistory( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -256,11 +255,11 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { [], {#args: args}, ), - returnValue: _i6.Future>>>.value( + returnValue: _i5.Future>>>.value( >>{}), - ) as _i6.Future>>>); + ) as _i5.Future>>>); @override - _i6.Future>> getUTXOs({ + _i5.Future>> getUTXOs({ required String? scripthash, String? requestID, }) => @@ -273,11 +272,11 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { #requestID: requestID, }, ), - returnValue: _i6.Future>>.value( + returnValue: _i5.Future>>.value( >[]), - ) as _i6.Future>>); + ) as _i5.Future>>); @override - _i6.Future>>> getBatchUTXOs( + _i5.Future>>> getBatchUTXOs( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -285,11 +284,11 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { [], {#args: args}, ), - returnValue: _i6.Future>>>.value( + returnValue: _i5.Future>>>.value( >>{}), - ) as _i6.Future>>>); + ) as _i5.Future>>>); @override - _i6.Future> getTransaction({ + _i5.Future> getTransaction({ required String? txHash, bool? verbose = true, String? requestID, @@ -305,10 +304,10 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i5.Future>.value({}), + ) as _i5.Future>); @override - _i6.Future> getAnonymitySet({ + _i5.Future> getAnonymitySet({ String? groupId = r'1', String? blockhash = r'', String? requestID, @@ -324,10 +323,10 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i5.Future>.value({}), + ) as _i5.Future>); @override - _i6.Future getMintData({ + _i5.Future getMintData({ dynamic mints, String? requestID, }) => @@ -340,10 +339,10 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { #requestID: requestID, }, ), - returnValue: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Future> getUsedCoinSerials({ + _i5.Future> getUsedCoinSerials({ String? requestID, required int? startNumber, }) => @@ -357,19 +356,19 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i5.Future>.value({}), + ) as _i5.Future>); @override - _i6.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( + _i5.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i5.Future.value(0), + ) as _i5.Future); @override - _i6.Future> getFeeRate({String? requestID}) => + _i5.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( Invocation.method( #getFeeRate, @@ -377,10 +376,10 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { {#requestID: requestID}, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i5.Future>.value({}), + ) as _i5.Future>); @override - _i6.Future<_i2.Decimal> estimateFee({ + _i5.Future<_i2.Decimal> estimateFee({ String? requestID, required int? blocks, }) => @@ -393,7 +392,7 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { #blocks: blocks, }, ), - returnValue: _i6.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #estimateFee, @@ -404,15 +403,15 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { }, ), )), - ) as _i6.Future<_i2.Decimal>); + ) as _i5.Future<_i2.Decimal>); @override - _i6.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + _i5.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( Invocation.method( #relayFee, [], {#requestID: requestID}, ), - returnValue: _i6.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #relayFee, @@ -420,50 +419,30 @@ class MockElectrumX extends _i1.Mock implements _i5.ElectrumX { {#requestID: requestID}, ), )), - ) as _i6.Future<_i2.Decimal>); + ) as _i5.Future<_i2.Decimal>); } /// A class which mocks [CachedElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX { +class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { MockCachedElectrumX() { _i1.throwOnMissingStub(this); } @override - String get server => (super.noSuchMethod( - Invocation.getter(#server), - returnValue: '', - ) as String); - @override - int get port => (super.noSuchMethod( - Invocation.getter(#port), - returnValue: 0, - ) as int); - @override - bool get useSSL => (super.noSuchMethod( - Invocation.getter(#useSSL), - returnValue: false, - ) as bool); - @override - _i3.Prefs get prefs => (super.noSuchMethod( - Invocation.getter(#prefs), - returnValue: _FakePrefs_1( + _i3.ElectrumX get electrumXClient => (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumX_1( this, - Invocation.getter(#prefs), + Invocation.getter(#electrumXClient), ), - ) as _i3.Prefs); + ) as _i3.ElectrumX); @override - List<_i5.ElectrumXNode> get failovers => (super.noSuchMethod( - Invocation.getter(#failovers), - returnValue: <_i5.ElectrumXNode>[], - ) as List<_i5.ElectrumXNode>); - @override - _i6.Future> getAnonymitySet({ + _i5.Future> getAnonymitySet({ required String? groupId, String? blockhash = r'', - required _i8.Coin? coin, + required _i7.Coin? coin, }) => (super.noSuchMethod( Invocation.method( @@ -476,8 +455,8 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i5.Future>.value({}), + ) as _i5.Future>); @override String base64ToHex(String? source) => (super.noSuchMethod( Invocation.method( @@ -495,9 +474,9 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX { returnValue: '', ) as String); @override - _i6.Future> getTransaction({ + _i5.Future> getTransaction({ required String? txHash, - required _i8.Coin? coin, + required _i7.Coin? coin, bool? verbose = true, }) => (super.noSuchMethod( @@ -511,11 +490,11 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX { }, ), returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); + _i5.Future>.value({}), + ) as _i5.Future>); @override - _i6.Future> getUsedCoinSerials({ - required _i8.Coin? coin, + _i5.Future> getUsedCoinSerials({ + required _i7.Coin? coin, int? startNumber = 0, }) => (super.noSuchMethod( @@ -527,26 +506,26 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX { #startNumber: startNumber, }, ), - returnValue: _i6.Future>.value([]), - ) as _i6.Future>); + returnValue: _i5.Future>.value([]), + ) as _i5.Future>); @override - _i6.Future clearSharedTransactionCache({required _i8.Coin? coin}) => + _i5.Future clearSharedTransactionCache({required _i7.Coin? coin}) => (super.noSuchMethod( Invocation.method( #clearSharedTransactionCache, [], {#coin: coin}, ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); } /// A class which mocks [TransactionNotificationTracker]. /// /// See the documentation for Mockito's code generation for more information. class MockTransactionNotificationTracker extends _i1.Mock - implements _i9.TransactionNotificationTracker { + implements _i8.TransactionNotificationTracker { MockTransactionNotificationTracker() { _i1.throwOnMissingStub(this); } @@ -575,14 +554,14 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i6.Future addNotifiedPending(String? txid) => (super.noSuchMethod( + _i5.Future addNotifiedPending(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedPending, [txid], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( @@ -592,29 +571,29 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i6.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( + _i5.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedConfirmed, [txid], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Future deleteTransaction(String? txid) => (super.noSuchMethod( + _i5.Future deleteTransaction(String? txid) => (super.noSuchMethod( Invocation.method( #deleteTransaction, [txid], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); } /// A class which mocks [MainDB]. /// /// See the documentation for Mockito's code generation for more information. -class MockMainDB extends _i1.Mock implements _i10.MainDB { +class MockMainDB extends _i1.Mock implements _i9.MainDB { MockMainDB() { _i1.throwOnMissingStub(this); } @@ -628,86 +607,86 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { ), ) as _i4.Isar); @override - _i6.Future initMainDB({_i4.Isar? mock}) => (super.noSuchMethod( + _i5.Future initMainDB({_i4.Isar? mock}) => (super.noSuchMethod( Invocation.method( #initMainDB, [], {#mock: mock}, ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + returnValue: _i5.Future.value(false), + ) as _i5.Future); @override - List<_i11.ContactEntry> getContactEntries() => (super.noSuchMethod( + List<_i10.ContactEntry> getContactEntries() => (super.noSuchMethod( Invocation.method( #getContactEntries, [], ), - returnValue: <_i11.ContactEntry>[], - ) as List<_i11.ContactEntry>); + returnValue: <_i10.ContactEntry>[], + ) as List<_i10.ContactEntry>); @override - _i6.Future deleteContactEntry({required String? id}) => + _i5.Future deleteContactEntry({required String? id}) => (super.noSuchMethod( Invocation.method( #deleteContactEntry, [], {#id: id}, ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + returnValue: _i5.Future.value(false), + ) as _i5.Future); @override - _i6.Future isContactEntryExists({required String? id}) => + _i5.Future isContactEntryExists({required String? id}) => (super.noSuchMethod( Invocation.method( #isContactEntryExists, [], {#id: id}, ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + returnValue: _i5.Future.value(false), + ) as _i5.Future); @override - _i11.ContactEntry? getContactEntry({required String? id}) => + _i10.ContactEntry? getContactEntry({required String? id}) => (super.noSuchMethod(Invocation.method( #getContactEntry, [], {#id: id}, - )) as _i11.ContactEntry?); + )) as _i10.ContactEntry?); @override - _i6.Future putContactEntry( - {required _i11.ContactEntry? contactEntry}) => + _i5.Future putContactEntry( + {required _i10.ContactEntry? contactEntry}) => (super.noSuchMethod( Invocation.method( #putContactEntry, [], {#contactEntry: contactEntry}, ), - returnValue: _i6.Future.value(false), - ) as _i6.Future); + returnValue: _i5.Future.value(false), + ) as _i5.Future); @override - _i12.TransactionBlockExplorer? getTransactionBlockExplorer( - {required _i8.Coin? coin}) => + _i11.TransactionBlockExplorer? getTransactionBlockExplorer( + {required _i7.Coin? coin}) => (super.noSuchMethod(Invocation.method( #getTransactionBlockExplorer, [], {#coin: coin}, - )) as _i12.TransactionBlockExplorer?); + )) as _i11.TransactionBlockExplorer?); @override - _i6.Future putTransactionBlockExplorer( - _i12.TransactionBlockExplorer? explorer) => + _i5.Future putTransactionBlockExplorer( + _i11.TransactionBlockExplorer? explorer) => (super.noSuchMethod( Invocation.method( #putTransactionBlockExplorer, [explorer], ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i5.Future.value(0), + ) as _i5.Future); @override - _i4.QueryBuilder<_i13.Address, _i13.Address, _i4.QAfterWhereClause> + _i4.QueryBuilder<_i12.Address, _i12.Address, _i4.QAfterWhereClause> getAddresses(String? walletId) => (super.noSuchMethod( Invocation.method( #getAddresses, [walletId], ), - returnValue: _FakeQueryBuilder_3<_i13.Address, _i13.Address, + returnValue: _FakeQueryBuilder_3<_i12.Address, _i12.Address, _i4.QAfterWhereClause>( this, Invocation.method( @@ -716,35 +695,35 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { ), ), ) as _i4 - .QueryBuilder<_i13.Address, _i13.Address, _i4.QAfterWhereClause>); + .QueryBuilder<_i12.Address, _i12.Address, _i4.QAfterWhereClause>); @override - _i6.Future putAddress(_i13.Address? address) => (super.noSuchMethod( + _i5.Future putAddress(_i12.Address? address) => (super.noSuchMethod( Invocation.method( #putAddress, [address], ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i5.Future.value(0), + ) as _i5.Future); @override - _i6.Future> putAddresses(List<_i13.Address>? addresses) => + _i5.Future> putAddresses(List<_i12.Address>? addresses) => (super.noSuchMethod( Invocation.method( #putAddresses, [addresses], ), - returnValue: _i6.Future>.value([]), - ) as _i6.Future>); + returnValue: _i5.Future>.value([]), + ) as _i5.Future>); @override - _i6.Future> updateOrPutAddresses(List<_i13.Address>? addresses) => + _i5.Future> updateOrPutAddresses(List<_i12.Address>? addresses) => (super.noSuchMethod( Invocation.method( #updateOrPutAddresses, [addresses], ), - returnValue: _i6.Future>.value([]), - ) as _i6.Future>); + returnValue: _i5.Future>.value([]), + ) as _i5.Future>); @override - _i6.Future<_i13.Address?> getAddress( + _i5.Future<_i12.Address?> getAddress( String? walletId, String? address, ) => @@ -756,12 +735,12 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { address, ], ), - returnValue: _i6.Future<_i13.Address?>.value(), - ) as _i6.Future<_i13.Address?>); + returnValue: _i5.Future<_i12.Address?>.value(), + ) as _i5.Future<_i12.Address?>); @override - _i6.Future updateAddress( - _i13.Address? oldAddress, - _i13.Address? newAddress, + _i5.Future updateAddress( + _i12.Address? oldAddress, + _i12.Address? newAddress, ) => (super.noSuchMethod( Invocation.method( @@ -771,16 +750,16 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { newAddress, ], ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i5.Future.value(0), + ) as _i5.Future); @override - _i4.QueryBuilder<_i13.Transaction, _i13.Transaction, _i4.QAfterWhereClause> + _i4.QueryBuilder<_i12.Transaction, _i12.Transaction, _i4.QAfterWhereClause> getTransactions(String? walletId) => (super.noSuchMethod( Invocation.method( #getTransactions, [walletId], ), - returnValue: _FakeQueryBuilder_3<_i13.Transaction, _i13.Transaction, + returnValue: _FakeQueryBuilder_3<_i12.Transaction, _i12.Transaction, _i4.QAfterWhereClause>( this, Invocation.method( @@ -788,28 +767,28 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { [walletId], ), ), - ) as _i4.QueryBuilder<_i13.Transaction, _i13.Transaction, + ) as _i4.QueryBuilder<_i12.Transaction, _i12.Transaction, _i4.QAfterWhereClause>); @override - _i6.Future putTransaction(_i13.Transaction? transaction) => + _i5.Future putTransaction(_i12.Transaction? transaction) => (super.noSuchMethod( Invocation.method( #putTransaction, [transaction], ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i5.Future.value(0), + ) as _i5.Future); @override - _i6.Future> putTransactions(List<_i13.Transaction>? transactions) => + _i5.Future> putTransactions(List<_i12.Transaction>? transactions) => (super.noSuchMethod( Invocation.method( #putTransactions, [transactions], ), - returnValue: _i6.Future>.value([]), - ) as _i6.Future>); + returnValue: _i5.Future>.value([]), + ) as _i5.Future>); @override - _i6.Future<_i13.Transaction?> getTransaction( + _i5.Future<_i12.Transaction?> getTransaction( String? walletId, String? txid, ) => @@ -821,10 +800,10 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { txid, ], ), - returnValue: _i6.Future<_i13.Transaction?>.value(), - ) as _i6.Future<_i13.Transaction?>); + returnValue: _i5.Future<_i12.Transaction?>.value(), + ) as _i5.Future<_i12.Transaction?>); @override - _i6.Stream<_i13.Transaction?> watchTransaction({ + _i5.Stream<_i12.Transaction?> watchTransaction({ required int? id, bool? fireImmediately = false, }) => @@ -837,10 +816,10 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { #fireImmediately: fireImmediately, }, ), - returnValue: _i6.Stream<_i13.Transaction?>.empty(), - ) as _i6.Stream<_i13.Transaction?>); + returnValue: _i5.Stream<_i12.Transaction?>.empty(), + ) as _i5.Stream<_i12.Transaction?>); @override - _i4.QueryBuilder<_i13.UTXO, _i13.UTXO, _i4.QAfterWhereClause> getUTXOs( + _i4.QueryBuilder<_i12.UTXO, _i12.UTXO, _i4.QAfterWhereClause> getUTXOs( String? walletId) => (super.noSuchMethod( Invocation.method( @@ -848,36 +827,36 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { [walletId], ), returnValue: - _FakeQueryBuilder_3<_i13.UTXO, _i13.UTXO, _i4.QAfterWhereClause>( + _FakeQueryBuilder_3<_i12.UTXO, _i12.UTXO, _i4.QAfterWhereClause>( this, Invocation.method( #getUTXOs, [walletId], ), ), - ) as _i4.QueryBuilder<_i13.UTXO, _i13.UTXO, _i4.QAfterWhereClause>); + ) as _i4.QueryBuilder<_i12.UTXO, _i12.UTXO, _i4.QAfterWhereClause>); @override - _i6.Future putUTXO(_i13.UTXO? utxo) => (super.noSuchMethod( + _i5.Future putUTXO(_i12.UTXO? utxo) => (super.noSuchMethod( Invocation.method( #putUTXO, [utxo], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Future putUTXOs(List<_i13.UTXO>? utxos) => (super.noSuchMethod( + _i5.Future putUTXOs(List<_i12.UTXO>? utxos) => (super.noSuchMethod( Invocation.method( #putUTXOs, [utxos], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Future updateUTXOs( + _i5.Future updateUTXOs( String? walletId, - List<_i13.UTXO>? utxos, + List<_i12.UTXO>? utxos, ) => (super.noSuchMethod( Invocation.method( @@ -887,11 +866,11 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { utxos, ], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Stream<_i13.UTXO?> watchUTXO({ + _i5.Stream<_i12.UTXO?> watchUTXO({ required int? id, bool? fireImmediately = false, }) => @@ -904,10 +883,10 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { #fireImmediately: fireImmediately, }, ), - returnValue: _i6.Stream<_i13.UTXO?>.empty(), - ) as _i6.Stream<_i13.UTXO?>); + returnValue: _i5.Stream<_i12.UTXO?>.empty(), + ) as _i5.Stream<_i12.UTXO?>); @override - _i4.QueryBuilder<_i13.TransactionNote, _i13.TransactionNote, + _i4.QueryBuilder<_i12.TransactionNote, _i12.TransactionNote, _i4.QAfterWhereClause> getTransactionNotes( String? walletId) => (super.noSuchMethod( @@ -915,39 +894,39 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { #getTransactionNotes, [walletId], ), - returnValue: _FakeQueryBuilder_3<_i13.TransactionNote, - _i13.TransactionNote, _i4.QAfterWhereClause>( + returnValue: _FakeQueryBuilder_3<_i12.TransactionNote, + _i12.TransactionNote, _i4.QAfterWhereClause>( this, Invocation.method( #getTransactionNotes, [walletId], ), ), - ) as _i4.QueryBuilder<_i13.TransactionNote, _i13.TransactionNote, + ) as _i4.QueryBuilder<_i12.TransactionNote, _i12.TransactionNote, _i4.QAfterWhereClause>); @override - _i6.Future putTransactionNote(_i13.TransactionNote? transactionNote) => + _i5.Future putTransactionNote(_i12.TransactionNote? transactionNote) => (super.noSuchMethod( Invocation.method( #putTransactionNote, [transactionNote], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Future putTransactionNotes( - List<_i13.TransactionNote>? transactionNotes) => + _i5.Future putTransactionNotes( + List<_i12.TransactionNote>? transactionNotes) => (super.noSuchMethod( Invocation.method( #putTransactionNotes, [transactionNotes], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Future<_i13.TransactionNote?> getTransactionNote( + _i5.Future<_i12.TransactionNote?> getTransactionNote( String? walletId, String? txid, ) => @@ -959,10 +938,10 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { txid, ], ), - returnValue: _i6.Future<_i13.TransactionNote?>.value(), - ) as _i6.Future<_i13.TransactionNote?>); + returnValue: _i5.Future<_i12.TransactionNote?>.value(), + ) as _i5.Future<_i12.TransactionNote?>); @override - _i6.Stream<_i13.TransactionNote?> watchTransactionNote({ + _i5.Stream<_i12.TransactionNote?> watchTransactionNote({ required int? id, bool? fireImmediately = false, }) => @@ -975,36 +954,36 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { #fireImmediately: fireImmediately, }, ), - returnValue: _i6.Stream<_i13.TransactionNote?>.empty(), - ) as _i6.Stream<_i13.TransactionNote?>); + returnValue: _i5.Stream<_i12.TransactionNote?>.empty(), + ) as _i5.Stream<_i12.TransactionNote?>); @override - _i4.QueryBuilder<_i13.AddressLabel, _i13.AddressLabel, _i4.QAfterWhereClause> + _i4.QueryBuilder<_i12.AddressLabel, _i12.AddressLabel, _i4.QAfterWhereClause> getAddressLabels(String? walletId) => (super.noSuchMethod( Invocation.method( #getAddressLabels, [walletId], ), - returnValue: _FakeQueryBuilder_3<_i13.AddressLabel, - _i13.AddressLabel, _i4.QAfterWhereClause>( + returnValue: _FakeQueryBuilder_3<_i12.AddressLabel, + _i12.AddressLabel, _i4.QAfterWhereClause>( this, Invocation.method( #getAddressLabels, [walletId], ), ), - ) as _i4.QueryBuilder<_i13.AddressLabel, _i13.AddressLabel, + ) as _i4.QueryBuilder<_i12.AddressLabel, _i12.AddressLabel, _i4.QAfterWhereClause>); @override - _i6.Future putAddressLabel(_i13.AddressLabel? addressLabel) => + _i5.Future putAddressLabel(_i12.AddressLabel? addressLabel) => (super.noSuchMethod( Invocation.method( #putAddressLabel, [addressLabel], ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i5.Future.value(0), + ) as _i5.Future); @override - int putAddressLabelSync(_i13.AddressLabel? addressLabel) => + int putAddressLabelSync(_i12.AddressLabel? addressLabel) => (super.noSuchMethod( Invocation.method( #putAddressLabelSync, @@ -1013,17 +992,17 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { returnValue: 0, ) as int); @override - _i6.Future putAddressLabels(List<_i13.AddressLabel>? addressLabels) => + _i5.Future putAddressLabels(List<_i12.AddressLabel>? addressLabels) => (super.noSuchMethod( Invocation.method( #putAddressLabels, [addressLabels], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Future<_i13.AddressLabel?> getAddressLabel( + _i5.Future<_i12.AddressLabel?> getAddressLabel( String? walletId, String? addressString, ) => @@ -1035,10 +1014,10 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { addressString, ], ), - returnValue: _i6.Future<_i13.AddressLabel?>.value(), - ) as _i6.Future<_i13.AddressLabel?>); + returnValue: _i5.Future<_i12.AddressLabel?>.value(), + ) as _i5.Future<_i12.AddressLabel?>); @override - _i13.AddressLabel? getAddressLabelSync( + _i12.AddressLabel? getAddressLabelSync( String? walletId, String? addressString, ) => @@ -1048,9 +1027,9 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { walletId, addressString, ], - )) as _i13.AddressLabel?); + )) as _i12.AddressLabel?); @override - _i6.Stream<_i13.AddressLabel?> watchAddressLabel({ + _i5.Stream<_i12.AddressLabel?> watchAddressLabel({ required int? id, bool? fireImmediately = false, }) => @@ -1063,49 +1042,49 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { #fireImmediately: fireImmediately, }, ), - returnValue: _i6.Stream<_i13.AddressLabel?>.empty(), - ) as _i6.Stream<_i13.AddressLabel?>); + returnValue: _i5.Stream<_i12.AddressLabel?>.empty(), + ) as _i5.Stream<_i12.AddressLabel?>); @override - _i6.Future updateAddressLabel(_i13.AddressLabel? addressLabel) => + _i5.Future updateAddressLabel(_i12.AddressLabel? addressLabel) => (super.noSuchMethod( Invocation.method( #updateAddressLabel, [addressLabel], ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i5.Future.value(0), + ) as _i5.Future); @override - _i6.Future deleteWalletBlockchainData(String? walletId) => + _i5.Future deleteWalletBlockchainData(String? walletId) => (super.noSuchMethod( Invocation.method( #deleteWalletBlockchainData, [walletId], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Future deleteAddressLabels(String? walletId) => (super.noSuchMethod( + _i5.Future deleteAddressLabels(String? walletId) => (super.noSuchMethod( Invocation.method( #deleteAddressLabels, [walletId], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Future deleteTransactionNotes(String? walletId) => + _i5.Future deleteTransactionNotes(String? walletId) => (super.noSuchMethod( Invocation.method( #deleteTransactionNotes, [walletId], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i6.Future addNewTransactionData( - List<_i14.Tuple2<_i13.Transaction, _i13.Address?>>? transactionsData, + _i5.Future addNewTransactionData( + List<_i13.Tuple2<_i12.Transaction, _i12.Address?>>? transactionsData, String? walletId, ) => (super.noSuchMethod( @@ -1116,17 +1095,17 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { walletId, ], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); @override - _i4.QueryBuilder<_i13.EthContract, _i13.EthContract, _i4.QWhere> + _i4.QueryBuilder<_i12.EthContract, _i12.EthContract, _i4.QWhere> getEthContracts() => (super.noSuchMethod( Invocation.method( #getEthContracts, [], ), - returnValue: _FakeQueryBuilder_3<_i13.EthContract, _i13.EthContract, + returnValue: _FakeQueryBuilder_3<_i12.EthContract, _i12.EthContract, _i4.QWhere>( this, Invocation.method( @@ -1135,39 +1114,39 @@ class MockMainDB extends _i1.Mock implements _i10.MainDB { ), ), ) as _i4 - .QueryBuilder<_i13.EthContract, _i13.EthContract, _i4.QWhere>); + .QueryBuilder<_i12.EthContract, _i12.EthContract, _i4.QWhere>); @override - _i6.Future<_i13.EthContract?> getEthContract(String? contractAddress) => + _i5.Future<_i12.EthContract?> getEthContract(String? contractAddress) => (super.noSuchMethod( Invocation.method( #getEthContract, [contractAddress], ), - returnValue: _i6.Future<_i13.EthContract?>.value(), - ) as _i6.Future<_i13.EthContract?>); + returnValue: _i5.Future<_i12.EthContract?>.value(), + ) as _i5.Future<_i12.EthContract?>); @override - _i13.EthContract? getEthContractSync(String? contractAddress) => + _i12.EthContract? getEthContractSync(String? contractAddress) => (super.noSuchMethod(Invocation.method( #getEthContractSync, [contractAddress], - )) as _i13.EthContract?); + )) as _i12.EthContract?); @override - _i6.Future putEthContract(_i13.EthContract? contract) => + _i5.Future putEthContract(_i12.EthContract? contract) => (super.noSuchMethod( Invocation.method( #putEthContract, [contract], ), - returnValue: _i6.Future.value(0), - ) as _i6.Future); + returnValue: _i5.Future.value(0), + ) as _i5.Future); @override - _i6.Future putEthContracts(List<_i13.EthContract>? contracts) => + _i5.Future putEthContracts(List<_i12.EthContract>? contracts) => (super.noSuchMethod( Invocation.method( #putEthContracts, [contracts], ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); } diff --git a/test/services/coins/manager_test.mocks.dart b/test/services/coins/manager_test.mocks.dart index 8a607f14f..821da6efc 100644 --- a/test/services/coins/manager_test.mocks.dart +++ b/test/services/coins/manager_test.mocks.dart @@ -1086,6 +1086,14 @@ class MockFiroWallet extends _i1.Mock implements _i10.FiroWallet { returnValueForMissingStub: _i11.Future.value(), ) as _i11.Future); @override + int firoGetMintIndex() => (super.noSuchMethod( + Invocation.method( + #firoGetMintIndex, + [], + ), + returnValue: 0, + ) as int); + @override _i11.Future firoUpdateMintIndex(int? mintIndex) => (super.noSuchMethod( Invocation.method( #firoUpdateMintIndex, diff --git a/test/services/coins/namecoin/namecoin_wallet_test.mocks.dart b/test/services/coins/namecoin/namecoin_wallet_test.mocks.dart index 3e9fd4fde..ec242c79c 100644 --- a/test/services/coins/namecoin/namecoin_wallet_test.mocks.dart +++ b/test/services/coins/namecoin/namecoin_wallet_test.mocks.dart @@ -3,16 +3,15 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i5; +import 'dart:async' as _i4; import 'package:decimal/decimal.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i6; -import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i4; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i5; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i3; import 'package:stackwallet/services/transaction_notification_tracker.dart' - as _i8; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i7; -import 'package:stackwallet/utilities/prefs.dart' as _i3; + as _i7; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i6; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -35,8 +34,8 @@ class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal { ); } -class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { - _FakePrefs_1( +class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX { + _FakeElectrumX_1( Object parent, Invocation parentInvocation, ) : super( @@ -48,13 +47,13 @@ class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { /// A class which mocks [ElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { +class MockElectrumX extends _i1.Mock implements _i3.ElectrumX { MockElectrumX() { _i1.throwOnMissingStub(this); } @override - set failovers(List<_i4.ElectrumXNode>? _failovers) => super.noSuchMethod( + set failovers(List<_i3.ElectrumXNode>? _failovers) => super.noSuchMethod( Invocation.setter( #failovers, _failovers, @@ -90,7 +89,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { returnValue: false, ) as bool); @override - _i5.Future request({ + _i4.Future request({ required String? command, List? args = const [], Duration? connectionTimeout = const Duration(seconds: 60), @@ -109,10 +108,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future>> batchRequest({ + _i4.Future>> batchRequest({ required String? command, required Map>? args, Duration? connectionTimeout = const Duration(seconds: 60), @@ -129,11 +128,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future ping({ + _i4.Future ping({ String? requestID, int? retryCount = 1, }) => @@ -146,10 +145,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retryCount: retryCount, }, ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + returnValue: _i4.Future.value(false), + ) as _i4.Future); @override - _i5.Future> getBlockHeadTip({String? requestID}) => + _i4.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( Invocation.method( #getBlockHeadTip, @@ -157,10 +156,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getServerFeatures({String? requestID}) => + _i4.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( Invocation.method( #getServerFeatures, @@ -168,10 +167,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future broadcastTransaction({ + _i4.Future broadcastTransaction({ required String? rawTx, String? requestID, }) => @@ -184,10 +183,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future.value(''), - ) as _i5.Future); + returnValue: _i4.Future.value(''), + ) as _i4.Future); @override - _i5.Future> getBalance({ + _i4.Future> getBalance({ required String? scripthash, String? requestID, }) => @@ -201,10 +200,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future>> getHistory({ + _i4.Future>> getHistory({ required String? scripthash, String? requestID, }) => @@ -217,11 +216,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future>>> getBatchHistory( + _i4.Future>>> getBatchHistory( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -229,11 +228,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i5.Future>>>.value( + returnValue: _i4.Future>>>.value( >>{}), - ) as _i5.Future>>>); + ) as _i4.Future>>>); @override - _i5.Future>> getUTXOs({ + _i4.Future>> getUTXOs({ required String? scripthash, String? requestID, }) => @@ -246,11 +245,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future>>> getBatchUTXOs( + _i4.Future>>> getBatchUTXOs( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -258,11 +257,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i5.Future>>>.value( + returnValue: _i4.Future>>>.value( >>{}), - ) as _i5.Future>>>); + ) as _i4.Future>>>); @override - _i5.Future> getTransaction({ + _i4.Future> getTransaction({ required String? txHash, bool? verbose = true, String? requestID, @@ -278,10 +277,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getAnonymitySet({ + _i4.Future> getAnonymitySet({ String? groupId = r'1', String? blockhash = r'', String? requestID, @@ -297,10 +296,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future getMintData({ + _i4.Future getMintData({ dynamic mints, String? requestID, }) => @@ -313,10 +312,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future> getUsedCoinSerials({ + _i4.Future> getUsedCoinSerials({ String? requestID, required int? startNumber, }) => @@ -330,19 +329,19 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( + _i4.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i5.Future.value(0), - ) as _i5.Future); + returnValue: _i4.Future.value(0), + ) as _i4.Future); @override - _i5.Future> getFeeRate({String? requestID}) => + _i4.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( Invocation.method( #getFeeRate, @@ -350,10 +349,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future<_i2.Decimal> estimateFee({ + _i4.Future<_i2.Decimal> estimateFee({ String? requestID, required int? blocks, }) => @@ -366,7 +365,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #blocks: blocks, }, ), - returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #estimateFee, @@ -377,15 +376,15 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), )), - ) as _i5.Future<_i2.Decimal>); + ) as _i4.Future<_i2.Decimal>); @override - _i5.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + _i4.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( Invocation.method( #relayFee, [], {#requestID: requestID}, ), - returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #relayFee, @@ -393,50 +392,30 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), )), - ) as _i5.Future<_i2.Decimal>); + ) as _i4.Future<_i2.Decimal>); } /// A class which mocks [CachedElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { +class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX { MockCachedElectrumX() { _i1.throwOnMissingStub(this); } @override - String get server => (super.noSuchMethod( - Invocation.getter(#server), - returnValue: '', - ) as String); - @override - int get port => (super.noSuchMethod( - Invocation.getter(#port), - returnValue: 0, - ) as int); - @override - bool get useSSL => (super.noSuchMethod( - Invocation.getter(#useSSL), - returnValue: false, - ) as bool); - @override - _i3.Prefs get prefs => (super.noSuchMethod( - Invocation.getter(#prefs), - returnValue: _FakePrefs_1( + _i3.ElectrumX get electrumXClient => (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumX_1( this, - Invocation.getter(#prefs), + Invocation.getter(#electrumXClient), ), - ) as _i3.Prefs); + ) as _i3.ElectrumX); @override - List<_i4.ElectrumXNode> get failovers => (super.noSuchMethod( - Invocation.getter(#failovers), - returnValue: <_i4.ElectrumXNode>[], - ) as List<_i4.ElectrumXNode>); - @override - _i5.Future> getAnonymitySet({ + _i4.Future> getAnonymitySet({ required String? groupId, String? blockhash = r'', - required _i7.Coin? coin, + required _i6.Coin? coin, }) => (super.noSuchMethod( Invocation.method( @@ -449,8 +428,8 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override String base64ToHex(String? source) => (super.noSuchMethod( Invocation.method( @@ -468,9 +447,9 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { returnValue: '', ) as String); @override - _i5.Future> getTransaction({ + _i4.Future> getTransaction({ required String? txHash, - required _i7.Coin? coin, + required _i6.Coin? coin, bool? verbose = true, }) => (super.noSuchMethod( @@ -484,11 +463,11 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getUsedCoinSerials({ - required _i7.Coin? coin, + _i4.Future> getUsedCoinSerials({ + required _i6.Coin? coin, int? startNumber = 0, }) => (super.noSuchMethod( @@ -500,26 +479,26 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { #startNumber: startNumber, }, ), - returnValue: _i5.Future>.value([]), - ) as _i5.Future>); + returnValue: _i4.Future>.value([]), + ) as _i4.Future>); @override - _i5.Future clearSharedTransactionCache({required _i7.Coin? coin}) => + _i4.Future clearSharedTransactionCache({required _i6.Coin? coin}) => (super.noSuchMethod( Invocation.method( #clearSharedTransactionCache, [], {#coin: coin}, ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [TransactionNotificationTracker]. /// /// See the documentation for Mockito's code generation for more information. class MockTransactionNotificationTracker extends _i1.Mock - implements _i8.TransactionNotificationTracker { + implements _i7.TransactionNotificationTracker { MockTransactionNotificationTracker() { _i1.throwOnMissingStub(this); } @@ -548,14 +527,14 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i5.Future addNotifiedPending(String? txid) => (super.noSuchMethod( + _i4.Future addNotifiedPending(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedPending, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( @@ -565,21 +544,21 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i5.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( + _i4.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedConfirmed, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future deleteTransaction(String? txid) => (super.noSuchMethod( + _i4.Future deleteTransaction(String? txid) => (super.noSuchMethod( Invocation.method( #deleteTransaction, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } diff --git a/test/services/coins/particl/particl_wallet_test.mocks.dart b/test/services/coins/particl/particl_wallet_test.mocks.dart index 11a8de944..e4677cc8e 100644 --- a/test/services/coins/particl/particl_wallet_test.mocks.dart +++ b/test/services/coins/particl/particl_wallet_test.mocks.dart @@ -3,16 +3,15 @@ // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i5; +import 'dart:async' as _i4; import 'package:decimal/decimal.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; -import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i6; -import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i4; +import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i5; +import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i3; import 'package:stackwallet/services/transaction_notification_tracker.dart' - as _i8; -import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i7; -import 'package:stackwallet/utilities/prefs.dart' as _i3; + as _i7; +import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i6; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values @@ -35,8 +34,8 @@ class _FakeDecimal_0 extends _i1.SmartFake implements _i2.Decimal { ); } -class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { - _FakePrefs_1( +class _FakeElectrumX_1 extends _i1.SmartFake implements _i3.ElectrumX { + _FakeElectrumX_1( Object parent, Invocation parentInvocation, ) : super( @@ -48,13 +47,13 @@ class _FakePrefs_1 extends _i1.SmartFake implements _i3.Prefs { /// A class which mocks [ElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { +class MockElectrumX extends _i1.Mock implements _i3.ElectrumX { MockElectrumX() { _i1.throwOnMissingStub(this); } @override - set failovers(List<_i4.ElectrumXNode>? _failovers) => super.noSuchMethod( + set failovers(List<_i3.ElectrumXNode>? _failovers) => super.noSuchMethod( Invocation.setter( #failovers, _failovers, @@ -90,7 +89,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { returnValue: false, ) as bool); @override - _i5.Future request({ + _i4.Future request({ required String? command, List? args = const [], Duration? connectionTimeout = const Duration(seconds: 60), @@ -109,10 +108,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future>> batchRequest({ + _i4.Future>> batchRequest({ required String? command, required Map>? args, Duration? connectionTimeout = const Duration(seconds: 60), @@ -129,11 +128,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retries: retries, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future ping({ + _i4.Future ping({ String? requestID, int? retryCount = 1, }) => @@ -146,10 +145,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #retryCount: retryCount, }, ), - returnValue: _i5.Future.value(false), - ) as _i5.Future); + returnValue: _i4.Future.value(false), + ) as _i4.Future); @override - _i5.Future> getBlockHeadTip({String? requestID}) => + _i4.Future> getBlockHeadTip({String? requestID}) => (super.noSuchMethod( Invocation.method( #getBlockHeadTip, @@ -157,10 +156,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getServerFeatures({String? requestID}) => + _i4.Future> getServerFeatures({String? requestID}) => (super.noSuchMethod( Invocation.method( #getServerFeatures, @@ -168,10 +167,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future broadcastTransaction({ + _i4.Future broadcastTransaction({ required String? rawTx, String? requestID, }) => @@ -184,10 +183,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future.value(''), - ) as _i5.Future); + returnValue: _i4.Future.value(''), + ) as _i4.Future); @override - _i5.Future> getBalance({ + _i4.Future> getBalance({ required String? scripthash, String? requestID, }) => @@ -201,10 +200,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future>> getHistory({ + _i4.Future>> getHistory({ required String? scripthash, String? requestID, }) => @@ -217,11 +216,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future>>> getBatchHistory( + _i4.Future>>> getBatchHistory( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -229,11 +228,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i5.Future>>>.value( + returnValue: _i4.Future>>>.value( >>{}), - ) as _i5.Future>>>); + ) as _i4.Future>>>); @override - _i5.Future>> getUTXOs({ + _i4.Future>> getUTXOs({ required String? scripthash, String? requestID, }) => @@ -246,11 +245,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future>>.value( + returnValue: _i4.Future>>.value( >[]), - ) as _i5.Future>>); + ) as _i4.Future>>); @override - _i5.Future>>> getBatchUTXOs( + _i4.Future>>> getBatchUTXOs( {required Map>? args}) => (super.noSuchMethod( Invocation.method( @@ -258,11 +257,11 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { [], {#args: args}, ), - returnValue: _i5.Future>>>.value( + returnValue: _i4.Future>>>.value( >>{}), - ) as _i5.Future>>>); + ) as _i4.Future>>>); @override - _i5.Future> getTransaction({ + _i4.Future> getTransaction({ required String? txHash, bool? verbose = true, String? requestID, @@ -278,10 +277,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getAnonymitySet({ + _i4.Future> getAnonymitySet({ String? groupId = r'1', String? blockhash = r'', String? requestID, @@ -297,10 +296,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future getMintData({ + _i4.Future getMintData({ dynamic mints, String? requestID, }) => @@ -313,10 +312,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #requestID: requestID, }, ), - returnValue: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future> getUsedCoinSerials({ + _i4.Future> getUsedCoinSerials({ String? requestID, required int? startNumber, }) => @@ -330,19 +329,19 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( + _i4.Future getLatestCoinId({String? requestID}) => (super.noSuchMethod( Invocation.method( #getLatestCoinId, [], {#requestID: requestID}, ), - returnValue: _i5.Future.value(0), - ) as _i5.Future); + returnValue: _i4.Future.value(0), + ) as _i4.Future); @override - _i5.Future> getFeeRate({String? requestID}) => + _i4.Future> getFeeRate({String? requestID}) => (super.noSuchMethod( Invocation.method( #getFeeRate, @@ -350,10 +349,10 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future<_i2.Decimal> estimateFee({ + _i4.Future<_i2.Decimal> estimateFee({ String? requestID, required int? blocks, }) => @@ -366,7 +365,7 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { #blocks: blocks, }, ), - returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #estimateFee, @@ -377,15 +376,15 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { }, ), )), - ) as _i5.Future<_i2.Decimal>); + ) as _i4.Future<_i2.Decimal>); @override - _i5.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( + _i4.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod( Invocation.method( #relayFee, [], {#requestID: requestID}, ), - returnValue: _i5.Future<_i2.Decimal>.value(_FakeDecimal_0( + returnValue: _i4.Future<_i2.Decimal>.value(_FakeDecimal_0( this, Invocation.method( #relayFee, @@ -393,50 +392,30 @@ class MockElectrumX extends _i1.Mock implements _i4.ElectrumX { {#requestID: requestID}, ), )), - ) as _i5.Future<_i2.Decimal>); + ) as _i4.Future<_i2.Decimal>); } /// A class which mocks [CachedElectrumX]. /// /// See the documentation for Mockito's code generation for more information. -class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { +class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX { MockCachedElectrumX() { _i1.throwOnMissingStub(this); } @override - String get server => (super.noSuchMethod( - Invocation.getter(#server), - returnValue: '', - ) as String); - @override - int get port => (super.noSuchMethod( - Invocation.getter(#port), - returnValue: 0, - ) as int); - @override - bool get useSSL => (super.noSuchMethod( - Invocation.getter(#useSSL), - returnValue: false, - ) as bool); - @override - _i3.Prefs get prefs => (super.noSuchMethod( - Invocation.getter(#prefs), - returnValue: _FakePrefs_1( + _i3.ElectrumX get electrumXClient => (super.noSuchMethod( + Invocation.getter(#electrumXClient), + returnValue: _FakeElectrumX_1( this, - Invocation.getter(#prefs), + Invocation.getter(#electrumXClient), ), - ) as _i3.Prefs); + ) as _i3.ElectrumX); @override - List<_i4.ElectrumXNode> get failovers => (super.noSuchMethod( - Invocation.getter(#failovers), - returnValue: <_i4.ElectrumXNode>[], - ) as List<_i4.ElectrumXNode>); - @override - _i5.Future> getAnonymitySet({ + _i4.Future> getAnonymitySet({ required String? groupId, String? blockhash = r'', - required _i7.Coin? coin, + required _i6.Coin? coin, }) => (super.noSuchMethod( Invocation.method( @@ -449,8 +428,8 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override String base64ToHex(String? source) => (super.noSuchMethod( Invocation.method( @@ -468,9 +447,9 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { returnValue: '', ) as String); @override - _i5.Future> getTransaction({ + _i4.Future> getTransaction({ required String? txHash, - required _i7.Coin? coin, + required _i6.Coin? coin, bool? verbose = true, }) => (super.noSuchMethod( @@ -484,11 +463,11 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { }, ), returnValue: - _i5.Future>.value({}), - ) as _i5.Future>); + _i4.Future>.value({}), + ) as _i4.Future>); @override - _i5.Future> getUsedCoinSerials({ - required _i7.Coin? coin, + _i4.Future> getUsedCoinSerials({ + required _i6.Coin? coin, int? startNumber = 0, }) => (super.noSuchMethod( @@ -500,26 +479,26 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX { #startNumber: startNumber, }, ), - returnValue: _i5.Future>.value([]), - ) as _i5.Future>); + returnValue: _i4.Future>.value([]), + ) as _i4.Future>); @override - _i5.Future clearSharedTransactionCache({required _i7.Coin? coin}) => + _i4.Future clearSharedTransactionCache({required _i6.Coin? coin}) => (super.noSuchMethod( Invocation.method( #clearSharedTransactionCache, [], {#coin: coin}, ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } /// A class which mocks [TransactionNotificationTracker]. /// /// See the documentation for Mockito's code generation for more information. class MockTransactionNotificationTracker extends _i1.Mock - implements _i8.TransactionNotificationTracker { + implements _i7.TransactionNotificationTracker { MockTransactionNotificationTracker() { _i1.throwOnMissingStub(this); } @@ -548,14 +527,14 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i5.Future addNotifiedPending(String? txid) => (super.noSuchMethod( + _i4.Future addNotifiedPending(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedPending, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override bool wasNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( @@ -565,21 +544,21 @@ class MockTransactionNotificationTracker extends _i1.Mock returnValue: false, ) as bool); @override - _i5.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( + _i4.Future addNotifiedConfirmed(String? txid) => (super.noSuchMethod( Invocation.method( #addNotifiedConfirmed, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); @override - _i5.Future deleteTransaction(String? txid) => (super.noSuchMethod( + _i4.Future deleteTransaction(String? txid) => (super.noSuchMethod( Invocation.method( #deleteTransaction, [txid], ), - returnValue: _i5.Future.value(), - returnValueForMissingStub: _i5.Future.value(), - ) as _i5.Future); + returnValue: _i4.Future.value(), + returnValueForMissingStub: _i4.Future.value(), + ) as _i4.Future); } diff --git a/test/widget_tests/custom_buttons/favorite_toggle_test.mocks.dart b/test/widget_tests/custom_buttons/favorite_toggle_test.mocks.dart index 9bccdcc86..59e02607b 100644 --- a/test/widget_tests/custom_buttons/favorite_toggle_test.mocks.dart +++ b/test/widget_tests/custom_buttons/favorite_toggle_test.mocks.dart @@ -83,6 +83,15 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService { returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override + _i5.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override _i5.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( Invocation.method( diff --git a/test/widget_tests/custom_loading_overlay_test.mocks.dart b/test/widget_tests/custom_loading_overlay_test.mocks.dart index c2244014e..f192714d8 100644 --- a/test/widget_tests/custom_loading_overlay_test.mocks.dart +++ b/test/widget_tests/custom_loading_overlay_test.mocks.dart @@ -83,6 +83,15 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService { returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override + _i5.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override _i5.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( Invocation.method( diff --git a/test/widget_tests/desktop/desktop_scaffold_test.mocks.dart b/test/widget_tests/desktop/desktop_scaffold_test.mocks.dart index aa5f1260d..5972c21c2 100644 --- a/test/widget_tests/desktop/desktop_scaffold_test.mocks.dart +++ b/test/widget_tests/desktop/desktop_scaffold_test.mocks.dart @@ -83,6 +83,15 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService { returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override + _i5.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override _i5.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( Invocation.method( diff --git a/test/widget_tests/managed_favorite_test.mocks.dart b/test/widget_tests/managed_favorite_test.mocks.dart index 1be169e52..5bd694533 100644 --- a/test/widget_tests/managed_favorite_test.mocks.dart +++ b/test/widget_tests/managed_favorite_test.mocks.dart @@ -2008,6 +2008,15 @@ class MockThemeService extends _i1.Mock implements _i30.ThemeService { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override + _i23.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i23.Future.value(), + returnValueForMissingStub: _i23.Future.value(), + ) as _i23.Future); + @override _i23.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( Invocation.method( diff --git a/test/widget_tests/table_view/table_view_row_test.mocks.dart b/test/widget_tests/table_view/table_view_row_test.mocks.dart index 62a4e3bd5..d86e3d82d 100644 --- a/test/widget_tests/table_view/table_view_row_test.mocks.dart +++ b/test/widget_tests/table_view/table_view_row_test.mocks.dart @@ -729,6 +729,15 @@ class MockThemeService extends _i1.Mock implements _i25.ThemeService { returnValueForMissingStub: _i22.Future.value(), ) as _i22.Future); @override + _i22.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i22.Future.value(), + returnValueForMissingStub: _i22.Future.value(), + ) as _i22.Future); + @override _i22.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( Invocation.method( diff --git a/test/widget_tests/trade_card_test.mocks.dart b/test/widget_tests/trade_card_test.mocks.dart index b4092378c..55895389f 100644 --- a/test/widget_tests/trade_card_test.mocks.dart +++ b/test/widget_tests/trade_card_test.mocks.dart @@ -83,6 +83,15 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService { returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); @override + _i5.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); + @override _i5.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( Invocation.method( diff --git a/test/widget_tests/transaction_card_test.mocks.dart b/test/widget_tests/transaction_card_test.mocks.dart index 67081a304..93cc0c9a7 100644 --- a/test/widget_tests/transaction_card_test.mocks.dart +++ b/test/widget_tests/transaction_card_test.mocks.dart @@ -2076,6 +2076,14 @@ class MockFiroWallet extends _i1.Mock implements _i22.FiroWallet { returnValueForMissingStub: _i18.Future.value(), ) as _i18.Future); @override + int firoGetMintIndex() => (super.noSuchMethod( + Invocation.method( + #firoGetMintIndex, + [], + ), + returnValue: 0, + ) as int); + @override _i18.Future firoUpdateMintIndex(int? mintIndex) => (super.noSuchMethod( Invocation.method( #firoUpdateMintIndex, @@ -2864,6 +2872,15 @@ class MockThemeService extends _i1.Mock implements _i30.ThemeService { returnValueForMissingStub: _i18.Future.value(), ) as _i18.Future); @override + _i18.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) as _i18.Future); + @override _i18.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( Invocation.method( diff --git a/test/widget_tests/wallet_card_test.mocks.dart b/test/widget_tests/wallet_card_test.mocks.dart index af1d78fdd..af955c477 100644 --- a/test/widget_tests/wallet_card_test.mocks.dart +++ b/test/widget_tests/wallet_card_test.mocks.dart @@ -1812,6 +1812,15 @@ class MockThemeService extends _i1.Mock implements _i30.ThemeService { returnValueForMissingStub: _i21.Future.value(), ) as _i21.Future); @override + _i21.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); + @override _i21.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( Invocation.method( diff --git a/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart b/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart index 8c8fdc9df..f76a04c74 100644 --- a/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart +++ b/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart @@ -741,6 +741,15 @@ class MockThemeService extends _i1.Mock implements _i26.ThemeService { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override + _i23.Future checkDefaultThemesOnStartup() => (super.noSuchMethod( + Invocation.method( + #checkDefaultThemesOnStartup, + [], + ), + returnValue: _i23.Future.value(), + returnValueForMissingStub: _i23.Future.value(), + ) as _i23.Future); + @override _i23.Future verifyInstalled({required String? themeId}) => (super.noSuchMethod( Invocation.method( From c94cbf6cd9eddf4c5d8ebb193ca44c8b731230f5 Mon Sep 17 00:00:00 2001 From: likho Date: Mon, 29 May 2023 20:19:14 +0200 Subject: [PATCH 3/6] Fix failing tests --- test/models/transactions_model_test.dart | 2 +- test/services/coins/firo/firo_wallet_test.dart | 1 + test/services/coins/manager_test.dart | 1 + test/widget_tests/transaction_card_test.dart | 4 ++++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/test/models/transactions_model_test.dart b/test/models/transactions_model_test.dart index 1e19f769a..7547d03fe 100644 --- a/test/models/transactions_model_test.dart +++ b/test/models/transactions_model_test.dart @@ -143,7 +143,7 @@ void main() { ] }); expect(txChunk.toString(), - "timestamp: 993260735 transactions: [\n {txid: txid, type: txType, subType: mint, value: 10, fee: 1, height: 1, confirm: true, confirmations: 1, address: address, timestamp: 1876352482, worthNow: 1, inputs: [], slateid: slateId } \n]"); + "timestamp: 993260735 transactions: [\n {txid: txid, type: txType, subType: mint, value: 10, fee: 1, height: 1, confirm: true, confirmations: 1, address: address, timestamp: 1876352482, worthNow: 1, inputs: [], slateid: slateId, numberOfMessages: null } \n]"); }); }); diff --git a/test/services/coins/firo/firo_wallet_test.dart b/test/services/coins/firo/firo_wallet_test.dart index 766df279f..68db15437 100644 --- a/test/services/coins/firo/firo_wallet_test.dart +++ b/test/services/coins/firo/firo_wallet_test.dart @@ -105,6 +105,7 @@ void main() { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ), ) .toList(); diff --git a/test/services/coins/manager_test.dart b/test/services/coins/manager_test.dart index 65a2de918..fcc246882 100644 --- a/test/services/coins/manager_test.dart +++ b/test/services/coins/manager_test.dart @@ -126,6 +126,7 @@ void main() { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, ); when(wallet.transactions).thenAnswer((_) async => [ tx, diff --git a/test/widget_tests/transaction_card_test.dart b/test/widget_tests/transaction_card_test.dart index fcad532fa..d3d16b655 100644 --- a/test/widget_tests/transaction_card_test.dart +++ b/test/widget_tests/transaction_card_test.dart @@ -71,6 +71,7 @@ void main() { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, )..address.value = Address( walletId: "walletId", value: "", @@ -188,6 +189,7 @@ void main() { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, )..address.value = Address( walletId: "walletId", value: "", @@ -302,6 +304,7 @@ void main() { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, )..address.value = Address( walletId: "walletId", value: "", @@ -410,6 +413,7 @@ void main() { nonce: null, inputs: [], outputs: [], + numberOfMessages: null, )..address.value = Address( walletId: "walletId", value: "", From d811009600669a796a254f4807ac1407d27898ee Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 29 May 2023 16:26:46 -0600 Subject: [PATCH 4/6] fix: merge cleanup --- test/electrumx_test.mocks.dart | 76 ++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 35 deletions(-) diff --git a/test/electrumx_test.mocks.dart b/test/electrumx_test.mocks.dart index 1cfe9cf4a..5a73b6b95 100644 --- a/test/electrumx_test.mocks.dart +++ b/test/electrumx_test.mocks.dart @@ -33,6 +33,17 @@ class _FakeDuration_0 extends _i1.SmartFake implements Duration { ); } +class _FakeJsonRPCResponse_1 extends _i1.SmartFake + implements _i2.JsonRPCResponse { + _FakeJsonRPCResponse_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + /// A class which mocks [JsonRPC]. /// /// See the documentation for Mockito's code generation for more information. @@ -47,40 +58,16 @@ class MockJsonRPC extends _i1.Mock implements _i2.JsonRPC { returnValue: false, ) as bool); @override - set useSSL(bool? _useSSL) => super.noSuchMethod( - Invocation.setter( - #useSSL, - _useSSL, - ), - returnValueForMissingStub: null, - ); - @override String get host => (super.noSuchMethod( Invocation.getter(#host), returnValue: '', ) as String); @override - set host(String? _host) => super.noSuchMethod( - Invocation.setter( - #host, - _host, - ), - returnValueForMissingStub: null, - ); - @override int get port => (super.noSuchMethod( Invocation.getter(#port), returnValue: 0, ) as int); @override - set port(int? _port) => super.noSuchMethod( - Invocation.setter( - #port, - _port, - ), - returnValueForMissingStub: null, - ); - @override Duration get connectionTimeout => (super.noSuchMethod( Invocation.getter(#connectionTimeout), returnValue: _FakeDuration_0( @@ -89,21 +76,40 @@ class MockJsonRPC extends _i1.Mock implements _i2.JsonRPC { ), ) as Duration); @override - set connectionTimeout(Duration? _connectionTimeout) => super.noSuchMethod( - Invocation.setter( - #connectionTimeout, - _connectionTimeout, - ), - returnValueForMissingStub: null, - ); - @override - _i3.Future request(String? jsonRpcRequest) => (super.noSuchMethod( + _i3.Future<_i2.JsonRPCResponse> request(String? jsonRpcRequest) => + (super.noSuchMethod( Invocation.method( #request, [jsonRpcRequest], ), - returnValue: _i3.Future.value(), - ) as _i3.Future); + returnValue: + _i3.Future<_i2.JsonRPCResponse>.value(_FakeJsonRPCResponse_1( + this, + Invocation.method( + #request, + [jsonRpcRequest], + ), + )), + ) as _i3.Future<_i2.JsonRPCResponse>); + @override + _i3.Future disconnect({required String? reason}) => (super.noSuchMethod( + Invocation.method( + #disconnect, + [], + {#reason: reason}, + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); + @override + _i3.Future connect() => (super.noSuchMethod( + Invocation.method( + #connect, + [], + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } /// A class which mocks [Prefs]. From d1c14ada55a076851119129365060cab19f22ae9 Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 29 May 2023 16:29:36 -0600 Subject: [PATCH 5/6] fix: rpc test --- test/json_rpc_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/json_rpc_test.dart b/test/json_rpc_test.dart index ea6b214be..1c7cc4a00 100644 --- a/test/json_rpc_test.dart +++ b/test/json_rpc_test.dart @@ -17,7 +17,7 @@ void main() { '{"jsonrpc": "2.0", "id": "some id","method": "server.ping","params": []}'; final result = await jsonRPC.request(jsonRequestString); - expect(result, {"jsonrpc": "2.0", "result": null, "id": "some id"}); + expect(result.data, {"jsonrpc": "2.0", "result": null, "id": "some id"}); }); test("JsonRPC.request fails due to SocketException", () async { From cd0bcbd357567a84a4aa1210afc6142d0f846b84 Mon Sep 17 00:00:00 2001 From: Diego Salazar Date: Mon, 29 May 2023 17:38:51 -0600 Subject: [PATCH 6/6] Bumped version (1.7.11, build 176) --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index dc1ffb1fa..08c5ea11a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: Stack Wallet # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.7.11+175 +version: 1.7.11+176 environment: sdk: ">=2.17.0 <3.0.0"