WIP: BCH and NMC tests

This commit is contained in:
Likho 2022-09-15 21:41:12 +02:00
parent 6ea7ed195e
commit 2f5650ce30
11 changed files with 5484 additions and 26 deletions

View file

@ -1506,6 +1506,7 @@ class BitcoinCashWallet extends CoinServiceAPI {
batches[batchNumber] = {};
}
final scripthash = _convertToScriptHash(allAddresses[i], _network);
print("SCRIPT_HASH_FOR_ADDRESS ${allAddresses[i]} IS $scripthash");
batches[batchNumber]!.addAll({
scripthash: [scripthash]
});
@ -1681,15 +1682,20 @@ class BitcoinCashWallet extends CoinServiceAPI {
}) async {
try {
final Map<String, List<dynamic>> args = {};
print("Address $addresses");
for (final entry in addresses.entries) {
args[entry.key] = [_convertToScriptHash(entry.value, _network)];
}
final response = await electrumXClient.getBatchHistory(args: args);
print("Args ${jsonEncode(args)}");
final response = await electrumXClient.getBatchHistory(args: args);
print("Response ${jsonEncode(response)}");
final Map<String, int> result = {};
for (final entry in response.entries) {
result[entry.key] = entry.value.length;
}
print("result ${jsonEncode(result)}");
return result;
} catch (e, s) {
Logging.instance.log(

View file

@ -1858,6 +1858,8 @@ class NamecoinWallet extends CoinServiceAPI {
batches[batchNumber] = {};
}
final scripthash = _convertToScriptHash(allAddresses[i], _network);
print("SCRIPT_HASH_FOR_ADDRESS ${allAddresses[i]} IS $scripthash");
batches[batchNumber]!.addAll({
scripthash: [scripthash]
});

View file

@ -0,0 +1,120 @@
final Map<String, List<dynamic>> historyBatchArgs0 = {
"k_0_0": ["4061323fc54ad0fd2fb6d3fd3af583068d7a733f562242a71e00ea7a82fb482b"],
"k_0_1": ["04818da846fe5e03ac993d2e0c1ccc3848ff6073c3aba6a572df4efc5432ae8b"],
"k_0_2": ["a0345933dd4146905a279f9aa35c867599fec2c52993a8f5da3a477acd0ebcfc"],
"k_0_3": ["607bc74daf946bfd9d593606f4393e44555a3dd0b529ddd08a0422be7955912e"],
"k_0_4": ["449dfb82e6f09f7e190f21fe63aaad5ccb854ba1f44f0a6622f6d71fff19fc63"],
"k_0_5": ["3643e3fe26e0b08dcbc89c47efce3b3264f361160341e3c2a6c73681dde12d39"],
"k_0_6": ["6daca5039b35adcbe62441b68eaaa48e9b0a806ab5a34314bd394b9b5c9289e5"],
"k_0_7": ["113f3d214f202795fdc3dccc6942395812270e787abb88fe4ddfa14f33d62d6f"],
"k_0_8": ["5dea575b85959647509d2ab3c92cda3776a4deba444486a7925ae3b71306e7e3"],
"k_0_9": ["5e2e6d3b43dfa29fabf66879d9ba67e4bb2f9f7ed10cfbb75e0b445eb4b84287"],
"k_0_10": [
"1bfe42869b6b1e5efa1e1b47f382615e3d27e3e66e9cc8ae46b71ece067b4d37"
],
"k_0_11": ["e0b38e944c5343e67c807a334fcf4b6563a6311447c99a105a0cf2cc3594ad11"]
};
final Map<String, List<dynamic>> historyBatchArgs1 = {
"k_0_0": ["4061323fc54ad0fd2fb6d3fd3af583068d7a733f562242a71e00ea7a82fb482b"],
"k_0_1": ["04818da846fe5e03ac993d2e0c1ccc3848ff6073c3aba6a572df4efc5432ae8b"],
"k_0_2": ["a0345933dd4146905a279f9aa35c867599fec2c52993a8f5da3a477acd0ebcfc"],
"k_0_3": ["607bc74daf946bfd9d593606f4393e44555a3dd0b529ddd08a0422be7955912e"],
"k_0_4": ["449dfb82e6f09f7e190f21fe63aaad5ccb854ba1f44f0a6622f6d71fff19fc63"],
"k_0_5": ["3643e3fe26e0b08dcbc89c47efce3b3264f361160341e3c2a6c73681dde12d39"],
"k_0_6": ["6daca5039b35adcbe62441b68eaaa48e9b0a806ab5a34314bd394b9b5c9289e5"],
"k_0_7": ["113f3d214f202795fdc3dccc6942395812270e787abb88fe4ddfa14f33d62d6f"],
"k_0_8": ["5dea575b85959647509d2ab3c92cda3776a4deba444486a7925ae3b71306e7e3"],
"k_0_9": ["5e2e6d3b43dfa29fabf66879d9ba67e4bb2f9f7ed10cfbb75e0b445eb4b84287"],
"k_0_10": [
"1bfe42869b6b1e5efa1e1b47f382615e3d27e3e66e9cc8ae46b71ece067b4d37"
],
"k_0_11": ["e0b38e944c5343e67c807a334fcf4b6563a6311447c99a105a0cf2cc3594ad11"]
};
final Map<String, List<Map<String, dynamic>>> historyBatchResponse = {
"k_0_0": [],
"s_0_0": [{}, {}],
"w_0_0": [],
"k_0_1": [{}],
"s_0_1": [],
"w_0_1": [{}, {}, {}],
"k_0_2": [],
"s_0_2": [],
"w_0_2": [],
"k_0_3": [],
"s_0_3": [],
"w_0_3": [],
"k_0_4": [],
"s_0_4": [],
"w_0_4": [],
"k_0_5": [],
"s_0_5": [],
"w_0_5": [],
"k_0_6": [],
"s_0_6": [],
"w_0_6": [],
"k_0_7": [],
"s_0_7": [],
"w_0_7": [],
"k_0_8": [],
"s_0_8": [],
"w_0_8": [],
"k_0_9": [],
"s_0_9": [],
"w_0_9": [],
"k_0_10": [],
"s_0_10": [],
"w_0_10": [],
"k_0_11": [],
"s_0_11": [],
"w_0_11": []
};
final Map<String, List<Map<String, dynamic>>> emptyHistoryBatchResponse = {
"k_0_0": [],
"s_0_0": [],
"w_0_0": [],
"k_0_1": [],
"s_0_1": [],
"w_0_1": [],
"k_0_2": [],
"s_0_2": [],
"w_0_2": [],
"k_0_3": [],
"s_0_3": [],
"w_0_3": [],
"k_0_4": [],
"s_0_4": [],
"w_0_4": [],
"k_0_5": [],
"s_0_5": [],
"w_0_5": [],
"k_0_6": [],
"s_0_6": [],
"w_0_6": [],
"k_0_7": [],
"s_0_7": [],
"w_0_7": [],
"k_0_8": [],
"s_0_8": [],
"w_0_8": [],
"k_0_9": [],
"s_0_9": [],
"w_0_9": [],
"k_0_10": [],
"s_0_10": [],
"w_0_10": [],
"k_0_11": [],
"s_0_11": [],
"w_0_11": []
};
final List<String> activeScriptHashes = [
"11663d093cb17dfbed4a96d148b22d3e094b31d23c639c2814beb79f2ab0ca75",
"06593b2d896751e8dda288bb6587b6bb6a1dee71d82a85457f5654f781e37b12",
"a328ae88ebce63c0010709ae900c199df2b585cdebce53a6291886dfdcc28c63",
"26f92666caebb9a17b14f5b573b385348cdc80065472b8961091f3226d2f650f",
"2f18558e5d3015cb6578aee1c3e4b645725fa4e1d26ce22cb31c9949f3b4957c",
"bf5a6c56814e80eed11e1e459801515f8c2b83da812568aa9dc26e6356f6965b",
];

View file

@ -1,3 +1,5 @@
import 'dart:convert';
import 'package:bitcoindart/bitcoindart.dart';
import 'package:decimal/decimal.dart';
import 'package:flutter_test/flutter_test.dart';
@ -16,6 +18,7 @@ import 'package:stackwallet/services/price.dart';
import 'package:stackwallet/services/transaction_notification_tracker.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart';
import 'package:stackwallet/utilities/prefs.dart';
// import '../../../cached_electrumx_test.mocks.dart';
// import '../../../screen_tests/settings_view/settings_subviews/wallet_settings_view_screen_test.mocks.dart';
@ -845,15 +848,15 @@ void main() {
await bch?.initializeExisting();
expect(
Address.validateAddress(
await bch!.currentReceivingAddress, bitcoincashtestnet),
await bch!.currentReceivingAddress, bitcoincash),
true);
expect(
Address.validateAddress(
await bch!.currentReceivingAddress, bitcoincashtestnet),
await bch!.currentReceivingAddress, bitcoincash),
true);
expect(
Address.validateAddress(
await bch!.currentReceivingAddress, bitcoincashtestnet),
await bch!.currentReceivingAddress, bitcoincash),
true);
verifyNever(client?.ping()).called(0);
@ -896,8 +899,7 @@ void main() {
expect(addresses?.length, 2);
for (int i = 0; i < 2; i++) {
expect(
Address.validateAddress(addresses![i], bitcoincashtestnet), true);
expect(Address.validateAddress(addresses![i], bitcoincash), true);
}
verifyNever(client?.ping()).called(0);
@ -1833,8 +1835,8 @@ void main() {
});
when(client?.getBatchHistory(args: historyBatchArgs0))
.thenAnswer((_) async => historyBatchResponse);
when(client?.getBatchHistory(args: historyBatchArgs1))
.thenAnswer((_) async => historyBatchResponse);
// when(client?.getBatchHistory(args: historyBatchArgs1))
// .thenAnswer((_) async => historyBatchResponse);
when(cachedClient?.clearSharedTransactionCache(coin: Coin.bitcoincash))
.thenAnswer((realInvocation) async {});
@ -1902,7 +1904,7 @@ void main() {
verify(client?.getServerFeatures()).called(1);
verify(client?.getBatchHistory(args: historyBatchArgs0)).called(2);
verify(client?.getBatchHistory(args: historyBatchArgs1)).called(2);
// verify(client?.getBatchHistory(args: historyBatchArgs1)).called(2);
verify(cachedClient?.clearSharedTransactionCache(coin: Coin.bitcoincash))
.called(1);
@ -1927,6 +1929,13 @@ void main() {
"hash_function": "sha256",
"services": []
});
// when(client?.getBatchHistory(args: anyNamed("args")))
// .thenAnswer((thing) async {
// print(jsonEncode(thing.namedArguments.entries.first.value));
// return {};
// });
when(client?.getBatchHistory(args: historyBatchArgs0))
.thenAnswer((_) async => emptyHistoryBatchResponse);
when(client?.getBatchHistory(args: historyBatchArgs1))
@ -1942,7 +1951,7 @@ void main() {
height: 4000);
expect(await bch?.mnemonic, TEST_MNEMONIC.split(" "));
//
verify(client?.getServerFeatures()).called(1);
verify(client?.getBatchHistory(args: historyBatchArgs0)).called(1);
verify(client?.getBatchHistory(args: historyBatchArgs1)).called(1);
@ -1993,7 +2002,7 @@ void main() {
bch = BitcoinCashWallet(
walletId: testWalletId,
walletName: testWalletName,
coin: Coin.bitcoincashTestNet,
coin: Coin.bitcoincash,
client: client!,
cachedClient: cachedClient!,
tracker: tracker!,
@ -2082,8 +2091,8 @@ void main() {
});
when(client?.getBatchHistory(args: historyBatchArgs0))
.thenAnswer((_) async => historyBatchResponse);
when(client?.getBatchHistory(args: historyBatchArgs1))
.thenAnswer((_) async => historyBatchResponse);
// when(client?.getBatchHistory(args: historyBatchArgs1))
// .thenAnswer((_) async => historyBatchResponse);
final wallet = await Hive.openBox(testWalletId);
@ -2101,7 +2110,7 @@ void main() {
verify(client?.getServerFeatures()).called(1);
verify(client?.getBatchHistory(args: historyBatchArgs0)).called(1);
verify(client?.getBatchHistory(args: historyBatchArgs1)).called(1);
// verify(client?.getBatchHistory(args: historyBatchArgs1)).called(1);
expect(secureStore?.interactions, 6);
expect(secureStore?.writes, 3);
@ -2127,8 +2136,8 @@ void main() {
});
when(client?.getBatchHistory(args: historyBatchArgs0))
.thenAnswer((_) async => historyBatchResponse);
when(client?.getBatchHistory(args: historyBatchArgs1))
.thenAnswer((_) async => historyBatchResponse);
// when(client?.getBatchHistory(args: historyBatchArgs1))
// .thenAnswer((_) async => historyBatchResponse);
when(cachedClient?.clearSharedTransactionCache(coin: Coin.bitcoincash))
.thenAnswer((realInvocation) async {});
@ -2196,7 +2205,7 @@ void main() {
verify(client?.getServerFeatures()).called(1);
verify(client?.getBatchHistory(args: historyBatchArgs0)).called(2);
verify(client?.getBatchHistory(args: historyBatchArgs1)).called(2);
// verify(client?.getBatchHistory(args: historyBatchArgs1)).called(2);
verify(cachedClient?.clearSharedTransactionCache(coin: Coin.bitcoincash))
.called(1);
@ -2224,8 +2233,8 @@ void main() {
when(client?.getBatchHistory(args: historyBatchArgs0))
.thenAnswer((_) async => historyBatchResponse);
when(client?.getBatchHistory(args: historyBatchArgs1))
.thenAnswer((_) async => historyBatchResponse);
// when(client?.getBatchHistory(args: historyBatchArgs1))
// .thenAnswer((_) async => historyBatchResponse);
when(cachedClient?.clearSharedTransactionCache(coin: Coin.bitcoincash))
.thenAnswer((realInvocation) async {});
@ -2285,7 +2294,7 @@ void main() {
verify(client?.getServerFeatures()).called(1);
verify(client?.getBatchHistory(args: historyBatchArgs0)).called(2);
verify(client?.getBatchHistory(args: historyBatchArgs1)).called(1);
// verify(client?.getBatchHistory(args: historyBatchArgs1)).called(1);
verify(cachedClient?.clearSharedTransactionCache(coin: Coin.bitcoincash))
.called(1);
@ -2779,8 +2788,8 @@ void main() {
});
when(client?.getBatchHistory(args: historyBatchArgs0))
.thenAnswer((_) async => historyBatchResponse);
when(client?.getBatchHistory(args: historyBatchArgs1))
.thenAnswer((_) async => historyBatchResponse);
// when(client?.getBatchHistory(args: historyBatchArgs1))
// .thenAnswer((_) async => historyBatchResponse);
final wallet = await Hive.openBox(testWalletId);
@ -2797,7 +2806,7 @@ void main() {
verify(client?.getServerFeatures()).called(1);
verify(client?.getBatchHistory(args: historyBatchArgs0)).called(1);
verify(client?.getBatchHistory(args: historyBatchArgs1)).called(1);
// verify(client?.getBatchHistory(args: historyBatchArgs1)).called(1);
expect(secureStore?.interactions, 6);
expect(secureStore?.writes, 3);
@ -2824,8 +2833,8 @@ void main() {
});
when(client?.getBatchHistory(args: historyBatchArgs0))
.thenAnswer((_) async => historyBatchResponse);
when(client?.getBatchHistory(args: historyBatchArgs1))
.thenAnswer((_) async => historyBatchResponse);
// when(client?.getBatchHistory(args: historyBatchArgs1))
// .thenAnswer((_) async => historyBatchResponse);
when(client?.getHistory(scripthash: anyNamed("scripthash")))
.thenThrow(Exception("some exception"));
@ -2842,7 +2851,7 @@ void main() {
verify(client?.getServerFeatures()).called(1);
verify(client?.getBatchHistory(args: historyBatchArgs0)).called(1);
verify(client?.getBatchHistory(args: historyBatchArgs1)).called(1);
// verify(client?.getBatchHistory(args: historyBatchArgs1)).called(1);
verify(client?.getBlockHeadTip()).called(1);
verify(client?.getHistory(scripthash: anyNamed("scripthash"))).called(1);

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,95 @@
final Map<String, List<dynamic>> historyBatchArgs0 = {
"k_0_0": ["bd84ae7e09414b0ccf5dcbf70a1f89f2fd42119a98af35dd4ecc80210fed0487"],
"k_0_1": ["3ef543d0887c3e9f9924f1b2d3b21410d0238937364663ed3414a2c2ddf4ccc6"]
};
final Map<String, List<dynamic>> historyBatchArgs1 = {
"k_0_0": ["dffa9543852197f9fb90f8adafaab8a0b9b4925e9ada8c6bdcaf00bf2e9f60d7"],
"k_0_1": ["71b56532e9e7321bd8c30d0f8b14530743049d2f3edd5623065c46eee1dda04d"]
};
final Map<String, List<dynamic>> historyBatchArgs2 = {
"k_0_0": ["c7e700f7e23a85bbdd9de86d502322a933607ee7ea7e16adaf02e477cdd849b9"]
};
final Map<String, List<Map<String, dynamic>>> historyBatchResponse = {
"k_0_0": [],
"s_0_0": [{}, {}],
"w_0_0": [],
"k_0_1": [{}],
"s_0_1": [],
"w_0_1": [{}, {}, {}],
"k_0_2": [],
"s_0_2": [],
"w_0_2": [],
"k_0_3": [],
"s_0_3": [],
"w_0_3": [],
"k_0_4": [],
"s_0_4": [],
"w_0_4": [],
"k_0_5": [],
"s_0_5": [],
"w_0_5": [],
"k_0_6": [],
"s_0_6": [],
"w_0_6": [],
"k_0_7": [],
"s_0_7": [],
"w_0_7": [],
"k_0_8": [],
"s_0_8": [],
"w_0_8": [],
"k_0_9": [],
"s_0_9": [],
"w_0_9": [],
"k_0_10": [],
"s_0_10": [],
"w_0_10": [],
"k_0_11": [],
"s_0_11": [],
"w_0_11": []
};
final Map<String, List<Map<String, dynamic>>> emptyHistoryBatchResponse = {
"k_0_0": [],
"s_0_0": [],
"w_0_0": [],
"k_0_1": [],
"s_0_1": [],
"w_0_1": [],
"k_0_2": [],
"s_0_2": [],
"w_0_2": [],
"k_0_3": [],
"s_0_3": [],
"w_0_3": [],
"k_0_4": [],
"s_0_4": [],
"w_0_4": [],
"k_0_5": [],
"s_0_5": [],
"w_0_5": [],
"k_0_6": [],
"s_0_6": [],
"w_0_6": [],
"k_0_7": [],
"s_0_7": [],
"w_0_7": [],
"k_0_8": [],
"s_0_8": [],
"w_0_8": [],
"k_0_9": [],
"s_0_9": [],
"w_0_9": [],
"k_0_10": [],
"s_0_10": [],
"w_0_10": [],
"k_0_11": [],
"s_0_11": [],
"w_0_11": []
};
final List<String> activeScriptHashes = [
"83b744ccb88827d544081c1a03ea782a7d00d6224ff9fddb7d0fbad399e1cae7",
"86906979fc9107d06d560275d7de8305b69d7189c3206ac9070ad76e6abff874",
"5baba32b1899d5e740838559ef39b7d8e9ba302bd24b732eeedd4c0e6ec65b51",
];

View file

@ -0,0 +1,355 @@
import 'package:stackwallet/models/paymint/transactions_model.dart';
final transactionData = TransactionData.fromMap({
"3ef543d0887c3e9f9924f1b2d3b21410d0238937364663ed3414a2c2ddf4ccc6": tx1,
"dffa9543852197f9fb90f8adafaab8a0b9b4925e9ada8c6bdcaf00bf2e9f60d7": tx2,
"71b56532e9e7321bd8c30d0f8b14530743049d2f3edd5623065c46eee1dda04d": tx3,
"c7e700f7e23a85bbdd9de86d502322a933607ee7ea7e16adaf02e477cdd849b9": tx4,
});
final tx1 = Transaction(
txid: "3ef543d0887c3e9f9924f1b2d3b21410d0238937364663ed3414a2c2ddf4ccc6",
confirmedStatus: true,
confirmations: 212,
txType: "Received",
amount: 1000000,
fees: 23896,
height: 629633,
address: "nc1qwfda4s9qmdqpnykgpjf85n09ath983srtuxcqx",
timestamp: 1663093275,
worthNow: "0.00",
worthAtBlockTimestamp: "0.00",
inputSize: 2,
outputSize: 2,
inputs: [
Input(
txid: "290904699ccbebd0921c4acc4f7a10f41141ee6a07bc64ebca5674c1e5ee8dfa",
vout: 1,
),
Input(
txid: "bd84ae7e09414b0ccf5dcbf70a1f89f2fd42119a98af35dd4ecc80210fed0487",
vout: 0,
),
],
outputs: [
Output(
scriptpubkeyAddress: "nc1qwfda4s9qmdqpnykgpjf85n09ath983srtuxcqx",
value: 1000000,
),
Output(
scriptpubkeyAddress: "nc1qp7h7fxcnkqcpul202z6nh8yjy8jpt39jcpeapj",
value: 29853562,
)
],
);
final tx2 = Transaction(
txid: "dffa9543852197f9fb90f8adafaab8a0b9b4925e9ada8c6bdcaf00bf2e9f60d7",
confirmedStatus: true,
confirmations: 150,
txType: "Sent",
amount: 988567,
fees: 11433,
height: 629695,
address: "nc1qraffwaq3cxngwp609e03ynwsx8ykgjnjve9f3y",
timestamp: 1663142110,
worthNow: "0.00",
worthAtBlockTimestamp: "0.00",
inputSize: 1,
outputSize: 1,
inputs: [
Input(
txid: "3ef543d0887c3e9f9924f1b2d3b21410d0238937364663ed3414a2c2ddf4ccc6",
vout: 0,
),
],
outputs: [
Output(
scriptpubkeyAddress: "nc1qraffwaq3cxngwp609e03ynwsx8ykgjnjve9f3y",
value: 988567,
),
],
);
final tx3 = Transaction(
txid: "71b56532e9e7321bd8c30d0f8b14530743049d2f3edd5623065c46eee1dda04d",
confirmedStatus: true,
confirmations: 147,
txType: "Received",
amount: 988567,
fees: 11433,
height: 629699,
address: "nc1qw4srwqq2semrxje4x6zcrg53g07q0pr3yqv5kr",
timestamp: 1663145287,
worthNow: "0.00",
worthAtBlockTimestamp: "0.00",
inputSize: 2,
outputSize: 1,
inputs: [
Input(
txid: "dffa9543852197f9fb90f8adafaab8a0b9b4925e9ada8c6bdcaf00bf2e9f60d7",
vout: 0,
),
Input(
txid: "80f8c6de5be2243013348219bbb7043a6d8d00ddc716baf6a69eab517f9a6fc1",
vout: 1,
),
],
outputs: [
Output(
scriptpubkeyAddress: "nc1qw4srwqq2semrxje4x6zcrg53g07q0pr3yqv5kr",
value: 1000000,
),
Output(
scriptpubkeyAddress: "nc1qsgr7u4hd22rc64r9vlef69en9wzlvmjt8dzyrm",
value: 28805770,
),
],
);
final tx4 = Transaction(
txid: "c7e700f7e23a85bbdd9de86d502322a933607ee7ea7e16adaf02e477cdd849b9",
confirmedStatus: true,
confirmations: 130,
txType: "Sent",
amount: 988567,
fees: 11433,
height: 629717,
address: "nc1qmdt0fxhpwx7x5ymmm9gvh229adu0kmtukfcsjk",
timestamp: 1663155739,
worthNow: "0.00",
worthAtBlockTimestamp: "0.00",
inputSize: 1,
outputSize: 1,
inputs: [
Input(
txid: "71b56532e9e7321bd8c30d0f8b14530743049d2f3edd5623065c46eee1dda04d",
vout: 0,
),
],
outputs: [
Output(
scriptpubkeyAddress: "nc1qmdt0fxhpwx7x5ymmm9gvh229adu0kmtukfcsjk",
value: 988567,
),
],
);
final tx1Raw = {
"txid": "3ef543d0887c3e9f9924f1b2d3b21410d0238937364663ed3414a2c2ddf4ccc6",
"hash": "40c8dd876cf111dc00d3aa2fedc93a77c18b391931939d4f99a760226cbff675",
"version": 2,
"size": 394,
"vsize": 232,
"weight": 925,
"locktime": 0,
"vin": [
{
"txid":
"290904699ccbebd0921c4acc4f7a10f41141ee6a07bc64ebca5674c1e5ee8dfa",
"vout": 1,
"scriptSig": {
"asm": "001466d2173325f3d379c6beb0a4949e937308edb152",
"hex": "16001466d2173325f3d379c6beb0a4949e937308edb152"
},
"txinwitness": [
"3044022062d0f32dc051ed1e91889a96070121c77d895f69d2ed5a307d8b320e0352186702206a0c2613e708e5ef8a935aba61b8fa14ddd6ca4e9a80a8b4ded126a879217dd101",
"0303cd92ed121ef22398826af055f3006769210e019f8fb43bd2f5556282d84997"
],
"sequence": 4294967295
},
{
"txid":
"bd84ae7e09414b0ccf5dcbf70a1f89f2fd42119a98af35dd4ecc80210fed0487",
"vout": 0,
"scriptSig": {"asm": "", "hex": ""},
"txinwitness": [
"3045022100e8814706766a2d7588908c51209c3b7095241bbc681febdd6b317b7e9b6ea97502205c33c63e4d8a675c19122bfe0057afce2159e6bd86f2c9aced214de77099dc8b01",
"03c35212e3a4c0734735eccae9219987dc78d9cf6245ab247942d430d0a01d61be"
],
"sequence": 4294967295
}
],
"vout": [
{
"value": 0.01,
"n": 0,
"scriptPubKey": {
"asm": "0 725bdac0a0db401992c80c927a4de5eaee53c603",
"hex": "0014725bdac0a0db401992c80c927a4de5eaee53c603",
"reqSigs": 1,
"type": "witness_v0_keyhash",
"addresses": ["nc1qwfda4s9qmdqpnykgpjf85n09ath983srtuxcqx"]
}
},
{
"value": 0.29853562,
"n": 1,
"scriptPubKey": {
"asm": "0 0fafe49b13b0301e7d4f50b53b9c9221e415c4b2",
"hex": "00140fafe49b13b0301e7d4f50b53b9c9221e415c4b2",
"reqSigs": 1,
"type": "witness_v0_keyhash",
"addresses": ["nc1qp7h7fxcnkqcpul202z6nh8yjy8jpt39jcpeapj"]
}
}
],
"hex":
"02000000000102fa8deee5c17456caeb64bc076aee4111f4107a4fcc4a1c92d0ebcb9c69040929010000001716001466d2173325f3d379c6beb0a4949e937308edb152ffffffff8704ed0f2180cc4edd35af989a1142fdf2891f0af7cb5dcf0c4b41097eae84bd0000000000ffffffff0240420f0000000000160014725bdac0a0db401992c80c927a4de5eaee53c6037a87c701000000001600140fafe49b13b0301e7d4f50b53b9c9221e415c4b202473044022062d0f32dc051ed1e91889a96070121c77d895f69d2ed5a307d8b320e0352186702206a0c2613e708e5ef8a935aba61b8fa14ddd6ca4e9a80a8b4ded126a879217dd101210303cd92ed121ef22398826af055f3006769210e019f8fb43bd2f5556282d8499702483045022100e8814706766a2d7588908c51209c3b7095241bbc681febdd6b317b7e9b6ea97502205c33c63e4d8a675c19122bfe0057afce2159e6bd86f2c9aced214de77099dc8b012103c35212e3a4c0734735eccae9219987dc78d9cf6245ab247942d430d0a01d61be00000000",
"blockhash":
"c9f53cc7cbf654cbcc400e17b33e03a32706d6e6647ad7085c688540f980a378",
"confirmations": 212,
"time": 1663093275,
"blocktime": 1663093275
};
final tx2Raw = {
"txid": "dffa9543852197f9fb90f8adafaab8a0b9b4925e9ada8c6bdcaf00bf2e9f60d7",
"hash": "32dbc0d21327e0cb94ec6069a8d235affd99689ffc5f68959bfb720bafc04bcf",
"version": 2,
"size": 192,
"vsize": 110,
"weight": 438,
"locktime": 0,
"vin": [
{
"txid":
"3ef543d0887c3e9f9924f1b2d3b21410d0238937364663ed3414a2c2ddf4ccc6",
"vout": 0,
"scriptSig": {"asm": "", "hex": ""},
"txinwitness": [
"30450221009d58ebfaab8eae297910bca93a7fd48f94ce52a1731cf27fb4c043368fa10e8d02207e88f5d868113d9567999793be0a5b752ad704d04224046839763cefe46463a501",
"02f6ca5274b59dfb014f6a0d690671964290dac7f97fe825f723204e6cb8daf086"
],
"sequence": 4294967295
}
],
"vout": [
{
"value": 0.00988567,
"n": 0,
"scriptPubKey": {
"asm": "0 1f52977411c1a687074f2e5f124dd031c9644a72",
"hex": "00141f52977411c1a687074f2e5f124dd031c9644a72",
"reqSigs": 1,
"type": "witness_v0_keyhash",
"addresses": ["nc1qraffwaq3cxngwp609e03ynwsx8ykgjnjve9f3y"]
}
}
],
"hex":
"02000000000101c6ccf4ddc2a21434ed634636378923d01014b2d3b2f124999f3e7c88d043f53e0000000000ffffffff0197150f00000000001600141f52977411c1a687074f2e5f124dd031c9644a72024830450221009d58ebfaab8eae297910bca93a7fd48f94ce52a1731cf27fb4c043368fa10e8d02207e88f5d868113d9567999793be0a5b752ad704d04224046839763cefe46463a5012102f6ca5274b59dfb014f6a0d690671964290dac7f97fe825f723204e6cb8daf08600000000",
"blockhash":
"ae1129ee834853c45b9edbb7228497c7fa423d7d1bdec8fd155f9e3c429c84d3",
"confirmations": 150,
"time": 1663142110,
"blocktime": 1663142110
};
final tx3Raw = {
"txid": "71b56532e9e7321bd8c30d0f8b14530743049d2f3edd5623065c46eee1dda04d",
"hash": "bb25567e1ffb2fd6ec9aa3925a7a8dd3055a29521f7811b2b2bc01ce7d8a216e",
"version": 2,
"size": 370,
"vsize": 208,
"weight": 832,
"locktime": 0,
"vin": [
{
"txid":
"dffa9543852197f9fb90f8adafaab8a0b9b4925e9ada8c6bdcaf00bf2e9f60d7",
"vout": 0,
"scriptSig": {"asm": "", "hex": ""},
"txinwitness": [
"304402203535cf570aca7c1acfa6e8d2f43e0b188b76d0b7a75ffca448e6af953ffe8b6302202ea52b312aaaf6d615d722bd92535d1e8b25fa9584a8dbe34dfa1ea9c18105ca01",
"038b68078a95f73f8710e8464dec52c61f9e21675ddf69d4f61b93cc417cf73d74"
],
"sequence": 4294967295
},
{
"txid":
"80f8c6de5be2243013348219bbb7043a6d8d00ddc716baf6a69eab517f9a6fc1",
"vout": 1,
"scriptSig": {"asm": "", "hex": ""},
"txinwitness": [
"3044022045268613674326251c46caeaf435081ca753e4ee2018d79480c4930ad7d5e19f022050090a9add82e7272b8206b9d369675e7e9a5f1396fc93490143f0053666102901",
"028e2ede901e69887cb80603c8e207839f61a477d59beff17705162a2045dd974e"
],
"sequence": 4294967295
}
],
"vout": [
{
"value": 0.01,
"n": 0,
"scriptPubKey": {
"asm": "0 756037000a8676334b35368581a29143fc078471",
"hex": "0014756037000a8676334b35368581a29143fc078471",
"reqSigs": 1,
"type": "witness_v0_keyhash",
"addresses": ["nc1qw4srwqq2semrxje4x6zcrg53g07q0pr3yqv5kr"]
}
},
{
"value": 0.2880577,
"n": 1,
"scriptPubKey": {
"asm": "0 8207ee56ed52878d546567f29d17332b85f66e4b",
"hex": "00148207ee56ed52878d546567f29d17332b85f66e4b",
"reqSigs": 1,
"type": "witness_v0_keyhash",
"addresses": ["nc1qsgr7u4hd22rc64r9vlef69en9wzlvmjt8dzyrm"]
}
}
],
"hex":
"02000000000102d7609f2ebf00afdc6b8cda9a5e92b4b9a0b8aaafadf890fbf99721854395fadf0000000000ffffffffc16f9a7f51ab9ea6f6ba16c7dd008d6d3a04b7bb198234133024e25bdec6f8800100000000ffffffff0240420f0000000000160014756037000a8676334b35368581a29143fc0784718a8ab701000000001600148207ee56ed52878d546567f29d17332b85f66e4b0247304402203535cf570aca7c1acfa6e8d2f43e0b188b76d0b7a75ffca448e6af953ffe8b6302202ea52b312aaaf6d615d722bd92535d1e8b25fa9584a8dbe34dfa1ea9c18105ca0121038b68078a95f73f8710e8464dec52c61f9e21675ddf69d4f61b93cc417cf73d7402473044022045268613674326251c46caeaf435081ca753e4ee2018d79480c4930ad7d5e19f022050090a9add82e7272b8206b9d369675e7e9a5f1396fc93490143f005366610290121028e2ede901e69887cb80603c8e207839f61a477d59beff17705162a2045dd974e00000000",
"blockhash":
"98f388ba99e3b6fc421c23edf3c699ada082b01e5a5d130af7550b7fa6184f2f",
"confirmations": 147,
"time": 1663145287,
"blocktime": 1663145287
};
final tx4Raw = {
"txid": "c7e700f7e23a85bbdd9de86d502322a933607ee7ea7e16adaf02e477cdd849b9",
"hash": "c6b544ddd7d901fcc7218208a6cfc8e1819c403a22cc8a1f1a7029aafa427925",
"version": 2,
"size": 192,
"vsize": 110,
"weight": 438,
"locktime": 0,
"vin": [
{
"txid":
"71b56532e9e7321bd8c30d0f8b14530743049d2f3edd5623065c46eee1dda04d",
"vout": 0,
"scriptSig": {"asm": "", "hex": ""},
"txinwitness": [
"3045022100c664c6ad206999e019954c5206a26c2eca1ae2572288c0f78074c279a4a210ce022017456fdf85f744d694fa2e4638acee782d809268ea4808c04d91da3ac4fe7fd401",
"035456b63e86c0a6235cb3debfb9654966a4c2362ec678ae3b9beec53d31a25eba"
],
"sequence": 4294967295
}
],
"vout": [
{
"value": 0.00988567,
"n": 0,
"scriptPubKey": {
"asm": "0 db56f49ae171bc6a137bd950cba945eb78fb6d7c",
"hex": "0014db56f49ae171bc6a137bd950cba945eb78fb6d7c",
"reqSigs": 1,
"type": "witness_v0_keyhash",
"addresses": ["nc1qmdt0fxhpwx7x5ymmm9gvh229adu0kmtukfcsjk"]
}
}
],
"hex":
"020000000001014da0dde1ee465c062356dd3e2f9d04430753148b0f0dc3d81b32e7e93265b5710000000000ffffffff0197150f0000000000160014db56f49ae171bc6a137bd950cba945eb78fb6d7c02483045022100c664c6ad206999e019954c5206a26c2eca1ae2572288c0f78074c279a4a210ce022017456fdf85f744d694fa2e4638acee782d809268ea4808c04d91da3ac4fe7fd40121035456b63e86c0a6235cb3debfb9654966a4c2362ec678ae3b9beec53d31a25eba00000000",
"blockhash":
"6f60029ff3a32ca2d7e7e23c02b9cb35f61e7f9481992f9c3ded2c60c7b1de9b",
"confirmations": 130,
"time": 1663155739,
"blocktime": 1663155739
};

View file

@ -0,0 +1,58 @@
import 'package:stackwallet/models/paymint/utxo_model.dart';
final Map<String, List<Map<String, dynamic>>> batchGetUTXOResponse0 = {
"some id 0": [
{
"tx_pos": 0,
"value": 988567,
"tx_hash":
"32dbc0d21327e0cb94ec6069a8d235affd99689ffc5f68959bfb720bafc04bcf",
"height": 629695
},
{
"tx_pos": 0,
"value": 1000000,
"tx_hash":
"40c8dd876cf111dc00d3aa2fedc93a77c18b391931939d4f99a760226cbff675",
"height": 629633
},
],
"some id 1": [],
};
final utxoList = [
UtxoObject(
txid: "dffa9543852197f9fb90f8adafaab8a0b9b4925e9ada8c6bdcaf00bf2e9f60d7",
vout: 0,
status: Status(
confirmed: true,
confirmations: 150,
blockHeight: 629695,
blockTime: 1663142110,
blockHash:
"32dbc0d21327e0cb94ec6069a8d235affd99689ffc5f68959bfb720bafc04bcf",
),
value: 988567,
fiatWorth: "\$0",
txName: "nc1qraffwaq3cxngwp609e03ynwsx8ykgjnjve9f3y",
blocked: false,
isCoinbase: false,
),
UtxoObject(
txid: "3ef543d0887c3e9f9924f1b2d3b21410d0238937364663ed3414a2c2ddf4ccc6",
vout: 0,
status: Status(
confirmed: true,
confirmations: 212,
blockHeight: 629633,
blockTime: 1663093275,
blockHash:
"40c8dd876cf111dc00d3aa2fedc93a77c18b391931939d4f99a760226cbff675",
),
value: 1000000,
fiatWorth: "\$0",
txName: "nc1qwfda4s9qmdqpnykgpjf85n09ath983srtuxcqx",
blocked: false,
isCoinbase: false,
),
];

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,352 @@
// Mocks generated by Mockito 5.2.0 from annotations
// in stackwallet/test/services/coins/namecoin/namecoin_wallet_test.dart.
// Do not manually edit this file.
import 'dart:async' as _i6;
import 'package:decimal/decimal.dart' as _i2;
import 'package:http/http.dart' as _i4;
import 'package:mockito/mockito.dart' as _i1;
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i7;
import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i5;
import 'package:stackwallet/services/price.dart' as _i9;
import 'package:stackwallet/services/transaction_notification_tracker.dart'
as _i11;
import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i8;
import 'package:stackwallet/utilities/prefs.dart' as _i3;
import 'package:tuple/tuple.dart' as _i10;
// ignore_for_file: type=lint
// ignore_for_file: avoid_redundant_argument_values
// ignore_for_file: avoid_setters_without_getters
// ignore_for_file: comment_references
// ignore_for_file: implementation_imports
// ignore_for_file: invalid_use_of_visible_for_testing_member
// ignore_for_file: prefer_const_constructors
// ignore_for_file: unnecessary_parenthesis
// ignore_for_file: camel_case_types
class _FakeDecimal_0 extends _i1.Fake implements _i2.Decimal {}
class _FakePrefs_1 extends _i1.Fake implements _i3.Prefs {}
class _FakeClient_2 extends _i1.Fake implements _i4.Client {}
/// A class which mocks [ElectrumX].
///
/// See the documentation for Mockito's code generation for more information.
class MockElectrumX extends _i1.Mock implements _i5.ElectrumX {
MockElectrumX() {
_i1.throwOnMissingStub(this);
}
@override
set failovers(List<_i5.ElectrumXNode>? _failovers) =>
super.noSuchMethod(Invocation.setter(#failovers, _failovers),
returnValueForMissingStub: null);
@override
int get currentFailoverIndex =>
(super.noSuchMethod(Invocation.getter(#currentFailoverIndex),
returnValue: 0) as int);
@override
set currentFailoverIndex(int? _currentFailoverIndex) => super.noSuchMethod(
Invocation.setter(#currentFailoverIndex, _currentFailoverIndex),
returnValueForMissingStub: null);
@override
String get host =>
(super.noSuchMethod(Invocation.getter(#host), returnValue: '') as String);
@override
int get port =>
(super.noSuchMethod(Invocation.getter(#port), returnValue: 0) as int);
@override
bool get useSSL =>
(super.noSuchMethod(Invocation.getter(#useSSL), returnValue: false)
as bool);
@override
_i6.Future<dynamic> request(
{String? command,
List<dynamic>? args = const [],
Duration? connectionTimeout = const Duration(seconds: 60),
String? requestID,
int? retries = 2}) =>
(super.noSuchMethod(
Invocation.method(#request, [], {
#command: command,
#args: args,
#connectionTimeout: connectionTimeout,
#requestID: requestID,
#retries: retries
}),
returnValue: Future<dynamic>.value()) as _i6.Future<dynamic>);
@override
_i6.Future<List<Map<String, dynamic>>> batchRequest(
{String? command,
Map<String, List<dynamic>>? args,
Duration? connectionTimeout = const Duration(seconds: 60),
int? retries = 2}) =>
(super.noSuchMethod(
Invocation.method(#batchRequest, [], {
#command: command,
#args: args,
#connectionTimeout: connectionTimeout,
#retries: retries
}),
returnValue: Future<List<Map<String, dynamic>>>.value(
<Map<String, dynamic>>[]))
as _i6.Future<List<Map<String, dynamic>>>);
@override
_i6.Future<bool> ping({String? requestID, int? retryCount = 1}) =>
(super.noSuchMethod(
Invocation.method(
#ping, [], {#requestID: requestID, #retryCount: retryCount}),
returnValue: Future<bool>.value(false)) as _i6.Future<bool>);
@override
_i6.Future<Map<String, dynamic>> getBlockHeadTip({String? requestID}) =>
(super.noSuchMethod(
Invocation.method(#getBlockHeadTip, [], {#requestID: requestID}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{}))
as _i6.Future<Map<String, dynamic>>);
@override
_i6.Future<Map<String, dynamic>> getServerFeatures({String? requestID}) =>
(super.noSuchMethod(
Invocation.method(#getServerFeatures, [], {#requestID: requestID}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{})) as _i6
.Future<Map<String, dynamic>>);
@override
_i6.Future<String> broadcastTransaction({String? rawTx, String? requestID}) =>
(super.noSuchMethod(
Invocation.method(#broadcastTransaction, [],
{#rawTx: rawTx, #requestID: requestID}),
returnValue: Future<String>.value('')) as _i6.Future<String>);
@override
_i6.Future<Map<String, dynamic>> getBalance(
{String? scripthash, String? requestID}) =>
(super.noSuchMethod(
Invocation.method(#getBalance, [],
{#scripthash: scripthash, #requestID: requestID}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{}))
as _i6.Future<Map<String, dynamic>>);
@override
_i6.Future<List<Map<String, dynamic>>> getHistory(
{String? scripthash, String? requestID}) =>
(super.noSuchMethod(
Invocation.method(#getHistory, [],
{#scripthash: scripthash, #requestID: requestID}),
returnValue: Future<List<Map<String, dynamic>>>.value(
<Map<String, dynamic>>[]))
as _i6.Future<List<Map<String, dynamic>>>);
@override
_i6.Future<Map<String, List<Map<String, dynamic>>>> getBatchHistory(
{Map<String, List<dynamic>>? args}) =>
(super.noSuchMethod(
Invocation.method(#getBatchHistory, [], {#args: args}),
returnValue: Future<Map<String, List<Map<String, dynamic>>>>.value(
<String, List<Map<String, dynamic>>>{})) as _i6
.Future<Map<String, List<Map<String, dynamic>>>>);
@override
_i6.Future<List<Map<String, dynamic>>> getUTXOs(
{String? scripthash, String? requestID}) =>
(super.noSuchMethod(
Invocation.method(
#getUTXOs, [], {#scripthash: scripthash, #requestID: requestID}),
returnValue: Future<List<Map<String, dynamic>>>.value(
<Map<String, dynamic>>[])) as _i6
.Future<List<Map<String, dynamic>>>);
@override
_i6.Future<Map<String, List<Map<String, dynamic>>>> getBatchUTXOs(
{Map<String, List<dynamic>>? args}) =>
(super.noSuchMethod(Invocation.method(#getBatchUTXOs, [], {#args: args}),
returnValue: Future<Map<String, List<Map<String, dynamic>>>>.value(
<String, List<Map<String, dynamic>>>{})) as _i6
.Future<Map<String, List<Map<String, dynamic>>>>);
@override
_i6.Future<Map<String, dynamic>> getTransaction(
{String? txHash, bool? verbose = true, String? requestID}) =>
(super.noSuchMethod(
Invocation.method(#getTransaction, [],
{#txHash: txHash, #verbose: verbose, #requestID: requestID}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{}))
as _i6.Future<Map<String, dynamic>>);
@override
_i6.Future<Map<String, dynamic>> getAnonymitySet(
{String? groupId = r'1',
String? blockhash = r'',
String? requestID}) =>
(super.noSuchMethod(
Invocation.method(#getAnonymitySet, [], {
#groupId: groupId,
#blockhash: blockhash,
#requestID: requestID
}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{}))
as _i6.Future<Map<String, dynamic>>);
@override
_i6.Future<dynamic> getMintData({dynamic mints, String? requestID}) =>
(super.noSuchMethod(
Invocation.method(
#getMintData, [], {#mints: mints, #requestID: requestID}),
returnValue: Future<dynamic>.value()) as _i6.Future<dynamic>);
@override
_i6.Future<Map<String, dynamic>> getUsedCoinSerials(
{String? requestID, int? startNumber}) =>
(super.noSuchMethod(
Invocation.method(#getUsedCoinSerials, [],
{#requestID: requestID, #startNumber: startNumber}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{}))
as _i6.Future<Map<String, dynamic>>);
@override
_i6.Future<int> getLatestCoinId({String? requestID}) => (super.noSuchMethod(
Invocation.method(#getLatestCoinId, [], {#requestID: requestID}),
returnValue: Future<int>.value(0)) as _i6.Future<int>);
@override
_i6.Future<Map<String, dynamic>> getFeeRate({String? requestID}) => (super
.noSuchMethod(Invocation.method(#getFeeRate, [], {#requestID: requestID}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{})) as _i6
.Future<Map<String, dynamic>>);
@override
_i6.Future<_i2.Decimal> estimateFee({String? requestID, int? blocks}) =>
(super.noSuchMethod(
Invocation.method(
#estimateFee, [], {#requestID: requestID, #blocks: blocks}),
returnValue: Future<_i2.Decimal>.value(_FakeDecimal_0()))
as _i6.Future<_i2.Decimal>);
@override
_i6.Future<_i2.Decimal> relayFee({String? requestID}) => (super.noSuchMethod(
Invocation.method(#relayFee, [], {#requestID: requestID}),
returnValue: Future<_i2.Decimal>.value(_FakeDecimal_0()))
as _i6.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 {
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()) as _i3.Prefs);
@override
List<_i5.ElectrumXNode> get failovers =>
(super.noSuchMethod(Invocation.getter(#failovers),
returnValue: <_i5.ElectrumXNode>[]) as List<_i5.ElectrumXNode>);
@override
_i6.Future<Map<String, dynamic>> getAnonymitySet(
{String? groupId, String? blockhash = r'', _i8.Coin? coin}) =>
(super.noSuchMethod(
Invocation.method(#getAnonymitySet, [],
{#groupId: groupId, #blockhash: blockhash, #coin: coin}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{}))
as _i6.Future<Map<String, dynamic>>);
@override
_i6.Future<Map<String, dynamic>> getTransaction(
{String? txHash, _i8.Coin? coin, bool? verbose = true}) =>
(super.noSuchMethod(
Invocation.method(#getTransaction, [],
{#txHash: txHash, #coin: coin, #verbose: verbose}),
returnValue:
Future<Map<String, dynamic>>.value(<String, dynamic>{}))
as _i6.Future<Map<String, dynamic>>);
@override
_i6.Future<List<dynamic>> getUsedCoinSerials(
{_i8.Coin? coin, int? startNumber = 0}) =>
(super.noSuchMethod(
Invocation.method(#getUsedCoinSerials, [],
{#coin: coin, #startNumber: startNumber}),
returnValue: Future<List<dynamic>>.value(<dynamic>[]))
as _i6.Future<List<dynamic>>);
@override
_i6.Future<void> clearSharedTransactionCache({_i8.Coin? coin}) =>
(super.noSuchMethod(
Invocation.method(#clearSharedTransactionCache, [], {#coin: coin}),
returnValue: Future<void>.value(),
returnValueForMissingStub: Future<void>.value()) as _i6.Future<void>);
}
/// A class which mocks [PriceAPI].
///
/// See the documentation for Mockito's code generation for more information.
class MockPriceAPI extends _i1.Mock implements _i9.PriceAPI {
MockPriceAPI() {
_i1.throwOnMissingStub(this);
}
@override
_i4.Client get client => (super.noSuchMethod(Invocation.getter(#client),
returnValue: _FakeClient_2()) as _i4.Client);
@override
void resetLastCalledToForceNextCallToUpdateCache() => super.noSuchMethod(
Invocation.method(#resetLastCalledToForceNextCallToUpdateCache, []),
returnValueForMissingStub: null);
@override
_i6.Future<Map<_i8.Coin, _i10.Tuple2<_i2.Decimal, double>>>
getPricesAnd24hChange({String? baseCurrency}) => (super.noSuchMethod(
Invocation.method(
#getPricesAnd24hChange, [], {#baseCurrency: baseCurrency}),
returnValue:
Future<Map<_i8.Coin, _i10.Tuple2<_i2.Decimal, double>>>.value(
<_i8.Coin, _i10.Tuple2<_i2.Decimal, double>>{}))
as _i6.Future<Map<_i8.Coin, _i10.Tuple2<_i2.Decimal, double>>>);
}
/// A class which mocks [TransactionNotificationTracker].
///
/// See the documentation for Mockito's code generation for more information.
class MockTransactionNotificationTracker extends _i1.Mock
implements _i11.TransactionNotificationTracker {
MockTransactionNotificationTracker() {
_i1.throwOnMissingStub(this);
}
@override
String get walletId =>
(super.noSuchMethod(Invocation.getter(#walletId), returnValue: '')
as String);
@override
List<String> get pendings =>
(super.noSuchMethod(Invocation.getter(#pendings), returnValue: <String>[])
as List<String>);
@override
List<String> get confirmeds => (super
.noSuchMethod(Invocation.getter(#confirmeds), returnValue: <String>[])
as List<String>);
@override
bool wasNotifiedPending(String? txid) =>
(super.noSuchMethod(Invocation.method(#wasNotifiedPending, [txid]),
returnValue: false) as bool);
@override
_i6.Future<void> addNotifiedPending(String? txid) =>
(super.noSuchMethod(Invocation.method(#addNotifiedPending, [txid]),
returnValue: Future<void>.value(),
returnValueForMissingStub: Future<void>.value()) as _i6.Future<void>);
@override
bool wasNotifiedConfirmed(String? txid) =>
(super.noSuchMethod(Invocation.method(#wasNotifiedConfirmed, [txid]),
returnValue: false) as bool);
@override
_i6.Future<void> addNotifiedConfirmed(String? txid) =>
(super.noSuchMethod(Invocation.method(#addNotifiedConfirmed, [txid]),
returnValue: Future<void>.value(),
returnValueForMissingStub: Future<void>.value()) as _i6.Future<void>);
}