mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-22 19:39:22 +00:00
update tests
This commit is contained in:
parent
d317bc5e8b
commit
a97be12f57
19 changed files with 1051 additions and 620 deletions
|
@ -19,6 +19,7 @@ import 'package:stackwallet/notifications/show_flush_bar.dart';
|
|||
import 'package:stackwallet/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart';
|
||||
import 'package:stackwallet/pages/settings_views/global_settings_view/manage_nodes_views/node_details_view.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/services/tor_service.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
|
@ -157,6 +158,7 @@ class NodeOptionsSheet extends ConsumerWidget {
|
|||
useSSL: node.useSSL,
|
||||
failovers: [],
|
||||
prefs: ref.read(prefsChangeNotifierProvider),
|
||||
torService: ref.read(pTorService),
|
||||
);
|
||||
|
||||
try {
|
||||
|
|
|
@ -582,6 +582,19 @@ class MockPrefs extends _i1.Mock implements _i5.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get torKillswitch => (super.noSuchMethod(
|
||||
Invocation.getter(#torKillswitch),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
set torKillswitch(bool? torKillswitch) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#torKillswitch,
|
||||
torKillswitch,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get showTestNetCoins => (super.noSuchMethod(
|
||||
Invocation.getter(#showTestNetCoins),
|
||||
returnValue: false,
|
||||
|
@ -754,6 +767,19 @@ class MockPrefs extends _i1.Mock implements _i5.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get useTor => (super.noSuchMethod(
|
||||
Invocation.getter(#useTor),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
set useTor(bool? useTor) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#useTor,
|
||||
useTor,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
|
|
|
@ -3,6 +3,7 @@ import 'package:mockito/annotations.dart';
|
|||
import 'package:mockito/mockito.dart';
|
||||
import 'package:stackwallet/electrumx_rpc/electrumx.dart';
|
||||
import 'package:stackwallet/electrumx_rpc/rpc.dart';
|
||||
import 'package:stackwallet/services/tor_service.dart';
|
||||
import 'package:stackwallet/utilities/prefs.dart';
|
||||
|
||||
import 'electrumx_test.mocks.dart';
|
||||
|
@ -10,7 +11,7 @@ import 'sample_data/get_anonymity_set_sample_data.dart';
|
|||
import 'sample_data/get_used_serials_sample_data.dart';
|
||||
import 'sample_data/transaction_data_samples.dart';
|
||||
|
||||
@GenerateMocks([JsonRPC, Prefs])
|
||||
@GenerateMocks([JsonRPC, Prefs, TorService])
|
||||
void main() {
|
||||
group("factory constructors and getters", () {
|
||||
test("electrumxnode .from factory", () {
|
||||
|
@ -38,9 +39,16 @@ void main() {
|
|||
);
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
|
||||
final client =
|
||||
ElectrumX.from(node: node, failovers: [], prefs: mockPrefs);
|
||||
final client = ElectrumX.from(
|
||||
node: node,
|
||||
failovers: [],
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
);
|
||||
|
||||
expect(client.useSSL, node.useSSL);
|
||||
expect(client.host, node.address);
|
||||
|
@ -73,18 +81,23 @@ void main() {
|
|||
);
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
port: 0,
|
||||
useSSL: true,
|
||||
client: mockClient,
|
||||
failovers: [],
|
||||
prefs: mockPrefs);
|
||||
host: "some server",
|
||||
port: 0,
|
||||
useSSL: true,
|
||||
client: mockClient,
|
||||
failovers: [],
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
);
|
||||
|
||||
expect(() => client.getTransaction(requestID: "some requestId", txHash: ''),
|
||||
throwsA(isA<Exception>()));
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
@ -109,6 +122,8 @@ void main() {
|
|||
);
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -116,13 +131,16 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
final result =
|
||||
await (client.getBlockHeadTip(requestID: "some requestId"));
|
||||
|
||||
expect(result["height"], 520481);
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verify(mockPrefs.useTor).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
||||
|
@ -139,6 +157,8 @@ void main() {
|
|||
).thenThrow(Exception());
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -146,10 +166,12 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
expect(() => client.getBlockHeadTip(requestID: "some requestId"),
|
||||
throwsA(isA<Exception>()));
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
@ -175,6 +197,8 @@ void main() {
|
|||
);
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -182,12 +206,15 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
final result = await client.ping(requestID: "some requestId");
|
||||
|
||||
expect(result, true);
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verify(mockPrefs.useTor).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
||||
|
@ -204,6 +231,8 @@ void main() {
|
|||
).thenThrow(Exception());
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -211,10 +240,12 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
expect(() => client.ping(requestID: "some requestId"),
|
||||
throwsA(isA<Exception>()));
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
@ -251,6 +282,8 @@ void main() {
|
|||
);
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -258,6 +291,7 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
final result =
|
||||
|
@ -275,7 +309,9 @@ void main() {
|
|||
"server_version": "ElectrumX 1.0.17",
|
||||
"hash_function": "sha256",
|
||||
});
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verify(mockPrefs.useTor).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
||||
|
@ -292,6 +328,8 @@ void main() {
|
|||
).thenThrow(Exception());
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -299,10 +337,12 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
expect(() => client.getServerFeatures(requestID: "some requestId"),
|
||||
throwsA(isA<Exception>()));
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
@ -328,6 +368,8 @@ void main() {
|
|||
);
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -335,13 +377,16 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
final result = await client.broadcastTransaction(
|
||||
rawTx: "some raw transaction string", requestID: "some requestId");
|
||||
|
||||
expect(result, "the txid of the rawtx");
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verify(mockPrefs.useTor).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
||||
|
@ -358,6 +403,8 @@ void main() {
|
|||
).thenThrow(Exception());
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -365,6 +412,7 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
expect(
|
||||
|
@ -372,6 +420,7 @@ void main() {
|
|||
rawTx: "some raw transaction string",
|
||||
requestID: "some requestId"),
|
||||
throwsA(isA<Exception>()));
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
@ -400,6 +449,8 @@ void main() {
|
|||
);
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -407,13 +458,16 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
final result = await client.getBalance(
|
||||
scripthash: "dummy hash", requestID: "some requestId");
|
||||
|
||||
expect(result, {"confirmed": 103873966, "unconfirmed": 23684400});
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verify(mockPrefs.useTor).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
||||
|
@ -430,6 +484,8 @@ void main() {
|
|||
).thenThrow(Exception());
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -437,12 +493,14 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
expect(
|
||||
() => client.getBalance(
|
||||
scripthash: "dummy hash", requestID: "some requestId"),
|
||||
throwsA(isA<Exception>()));
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
@ -479,6 +537,8 @@ void main() {
|
|||
);
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -486,6 +546,7 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
final result = await client.getHistory(
|
||||
|
@ -503,7 +564,9 @@ void main() {
|
|||
"f3e1bf48975b8d6060a9de8884296abb80be618dc00ae3cb2f6cee3085e09403"
|
||||
}
|
||||
]);
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verify(mockPrefs.useTor).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
||||
|
@ -520,6 +583,8 @@ void main() {
|
|||
).thenThrow(Exception());
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -527,12 +592,14 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
expect(
|
||||
() => client.getHistory(
|
||||
scripthash: "dummy hash", requestID: "some requestId"),
|
||||
throwsA(isA<Exception>()));
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
@ -573,6 +640,8 @@ void main() {
|
|||
);
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -580,6 +649,7 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
final result = await client.getUTXOs(
|
||||
|
@ -601,7 +671,9 @@ void main() {
|
|||
"height": 441696
|
||||
}
|
||||
]);
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verify(mockPrefs.useTor).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
||||
|
@ -618,6 +690,8 @@ void main() {
|
|||
).thenThrow(Exception());
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -625,12 +699,14 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
expect(
|
||||
() => client.getUTXOs(
|
||||
scripthash: "dummy hash", requestID: "some requestId"),
|
||||
throwsA(isA<Exception>()));
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
@ -656,6 +732,8 @@ void main() {
|
|||
);
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -663,6 +741,7 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
final result = await client.getTransaction(
|
||||
|
@ -671,7 +750,9 @@ void main() {
|
|||
requestID: "some requestId");
|
||||
|
||||
expect(result, SampleGetTransactionData.txData0);
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verify(mockPrefs.useTor).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
||||
|
@ -688,6 +769,8 @@ void main() {
|
|||
).thenThrow(Exception());
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -695,6 +778,7 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
expect(
|
||||
|
@ -702,6 +786,7 @@ void main() {
|
|||
txHash: SampleGetTransactionData.txHash0,
|
||||
requestID: "some requestId"),
|
||||
throwsA(isA<Exception>()));
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
@ -727,6 +812,8 @@ void main() {
|
|||
);
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -734,13 +821,16 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
final result = await client.getAnonymitySet(
|
||||
groupId: "1", blockhash: "", requestID: "some requestId");
|
||||
|
||||
expect(result, GetAnonymitySetSampleData.data);
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verify(mockPrefs.useTor).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
||||
|
@ -757,6 +847,8 @@ void main() {
|
|||
).thenThrow(Exception());
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -764,12 +856,14 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
expect(
|
||||
() =>
|
||||
client.getAnonymitySet(groupId: "1", requestID: "some requestId"),
|
||||
throwsA(isA<Exception>()));
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
@ -795,6 +889,8 @@ void main() {
|
|||
);
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -802,13 +898,16 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
final result = await client.getMintData(
|
||||
mints: "some mints", requestID: "some requestId");
|
||||
|
||||
expect(result, "mint meta data");
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verify(mockPrefs.useTor).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
||||
|
@ -825,6 +924,8 @@ void main() {
|
|||
).thenThrow(Exception());
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -832,12 +933,14 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
expect(
|
||||
() => client.getMintData(
|
||||
mints: "some mints", requestID: "some requestId"),
|
||||
throwsA(isA<Exception>()));
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
@ -863,6 +966,8 @@ void main() {
|
|||
);
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -870,13 +975,16 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
final result = await client.getUsedCoinSerials(
|
||||
requestID: "some requestId", startNumber: 0);
|
||||
|
||||
expect(result, GetUsedSerialsSampleData.serials);
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verify(mockPrefs.useTor).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
||||
|
@ -893,6 +1001,8 @@ void main() {
|
|||
).thenThrow(Exception());
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -900,12 +1010,14 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
expect(
|
||||
() => client.getUsedCoinSerials(
|
||||
requestID: "some requestId", startNumber: 0),
|
||||
throwsA(isA<Exception>()));
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
@ -931,6 +1043,8 @@ void main() {
|
|||
);
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -938,12 +1052,15 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
final result = await client.getLatestCoinId(requestID: "some requestId");
|
||||
|
||||
expect(result, 1);
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verify(mockPrefs.useTor).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
||||
|
@ -960,6 +1077,8 @@ void main() {
|
|||
).thenThrow(Exception());
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -967,6 +1086,7 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
expect(
|
||||
|
@ -974,6 +1094,7 @@ void main() {
|
|||
requestID: "some requestId",
|
||||
),
|
||||
throwsA(isA<Exception>()));
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
@ -999,6 +1120,8 @@ void main() {
|
|||
);
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -1006,13 +1129,16 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
final result = await client.getAnonymitySet(
|
||||
groupId: "1", blockhash: "", requestID: "some requestId");
|
||||
|
||||
expect(result, GetAnonymitySetSampleData.data);
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verify(mockPrefs.useTor).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
||||
|
@ -1029,6 +1155,8 @@ void main() {
|
|||
).thenThrow(Exception());
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -1036,6 +1164,7 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
expect(
|
||||
|
@ -1044,6 +1173,7 @@ void main() {
|
|||
requestID: "some requestId",
|
||||
),
|
||||
throwsA(isA<Exception>()));
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
@ -1069,6 +1199,8 @@ void main() {
|
|||
);
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -1076,13 +1208,16 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
final result = await client.getMintData(
|
||||
mints: "some mints", requestID: "some requestId");
|
||||
|
||||
expect(result, "mint meta data");
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verify(mockPrefs.useTor).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
||||
|
@ -1099,6 +1234,8 @@ void main() {
|
|||
).thenThrow(Exception());
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -1106,6 +1243,7 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
expect(
|
||||
|
@ -1114,6 +1252,7 @@ void main() {
|
|||
requestID: "some requestId",
|
||||
),
|
||||
throwsA(isA<Exception>()));
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
@ -1139,6 +1278,8 @@ void main() {
|
|||
);
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -1146,13 +1287,16 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
final result = await client.getUsedCoinSerials(
|
||||
requestID: "some requestId", startNumber: 0);
|
||||
|
||||
expect(result, GetUsedSerialsSampleData.serials);
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verify(mockPrefs.useTor).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
||||
|
@ -1169,6 +1313,8 @@ void main() {
|
|||
).thenThrow(Exception());
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -1176,12 +1322,14 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
expect(
|
||||
() => client.getUsedCoinSerials(
|
||||
requestID: "some requestId", startNumber: 0),
|
||||
throwsA(isA<Exception>()));
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
@ -1207,6 +1355,8 @@ void main() {
|
|||
);
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -1214,12 +1364,15 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
final result = await client.getLatestCoinId(requestID: "some requestId");
|
||||
|
||||
expect(result, 1);
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verify(mockPrefs.useTor).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
||||
|
@ -1236,6 +1389,8 @@ void main() {
|
|||
).thenThrow(Exception());
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -1243,10 +1398,12 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
expect(() => client.getLatestCoinId(requestID: "some requestId"),
|
||||
throwsA(isA<Exception>()));
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
@ -1274,6 +1431,8 @@ void main() {
|
|||
);
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -1281,12 +1440,15 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
final result = await client.getFeeRate(requestID: "some requestId");
|
||||
|
||||
expect(result, {"rate": 1000});
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verify(mockPrefs.useTor).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
||||
|
@ -1303,6 +1465,8 @@ void main() {
|
|||
).thenThrow(Exception());
|
||||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
host: "some server",
|
||||
|
@ -1310,10 +1474,12 @@ void main() {
|
|||
useSSL: true,
|
||||
client: mockClient,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: []);
|
||||
|
||||
expect(() => client.getFeeRate(requestID: "some requestId"),
|
||||
throwsA(isA<Exception>()));
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
@ -1321,6 +1487,8 @@ void main() {
|
|||
|
||||
test("rpcClient is null throws with bad server info", () {
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((realInvocation) => false);
|
||||
final torService = MockTorService();
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final client = ElectrumX(
|
||||
client: null,
|
||||
|
@ -1328,10 +1496,12 @@ void main() {
|
|||
host: "_ :sa %",
|
||||
useSSL: false,
|
||||
prefs: mockPrefs,
|
||||
torService: torService,
|
||||
failovers: [],
|
||||
);
|
||||
|
||||
expect(() => client.getFeeRate(), throwsA(isA<Exception>()));
|
||||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
});
|
||||
|
|
|
@ -3,16 +3,20 @@
|
|||
// Do not manually edit this file.
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i3;
|
||||
import 'dart:ui' as _i9;
|
||||
import 'dart:async' as _i4;
|
||||
import 'dart:io' as _i3;
|
||||
import 'dart:ui' as _i10;
|
||||
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:stackwallet/electrumx_rpc/rpc.dart' as _i2;
|
||||
import 'package:stackwallet/utilities/amount/amount_unit.dart' as _i7;
|
||||
import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i6;
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i8;
|
||||
import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i5;
|
||||
import 'package:stackwallet/utilities/prefs.dart' as _i4;
|
||||
import 'package:stackwallet/services/event_bus/events/global/tor_connection_status_changed_event.dart'
|
||||
as _i12;
|
||||
import 'package:stackwallet/services/tor_service.dart' as _i11;
|
||||
import 'package:stackwallet/utilities/amount/amount_unit.dart' as _i8;
|
||||
import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i7;
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i9;
|
||||
import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i6;
|
||||
import 'package:stackwallet/utilities/prefs.dart' as _i5;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
|
@ -46,6 +50,17 @@ class _FakeJsonRPCResponse_1 extends _i1.SmartFake
|
|||
);
|
||||
}
|
||||
|
||||
class _FakeInternetAddress_2 extends _i1.SmartFake
|
||||
implements _i3.InternetAddress {
|
||||
_FakeInternetAddress_2(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
}
|
||||
|
||||
/// A class which mocks [JsonRPC].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
|
@ -78,7 +93,16 @@ class MockJsonRPC extends _i1.Mock implements _i2.JsonRPC {
|
|||
),
|
||||
) as Duration);
|
||||
@override
|
||||
_i3.Future<_i2.JsonRPCResponse> request(
|
||||
set proxyInfo(({_i3.InternetAddress host, int port})? _proxyInfo) =>
|
||||
super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#proxyInfo,
|
||||
_proxyInfo,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i4.Future<_i2.JsonRPCResponse> request(
|
||||
String? jsonRpcRequest,
|
||||
Duration? requestTimeout,
|
||||
) =>
|
||||
|
@ -91,7 +115,7 @@ class MockJsonRPC extends _i1.Mock implements _i2.JsonRPC {
|
|||
],
|
||||
),
|
||||
returnValue:
|
||||
_i3.Future<_i2.JsonRPCResponse>.value(_FakeJsonRPCResponse_1(
|
||||
_i4.Future<_i2.JsonRPCResponse>.value(_FakeJsonRPCResponse_1(
|
||||
this,
|
||||
Invocation.method(
|
||||
#request,
|
||||
|
@ -101,32 +125,32 @@ class MockJsonRPC extends _i1.Mock implements _i2.JsonRPC {
|
|||
],
|
||||
),
|
||||
)),
|
||||
) as _i3.Future<_i2.JsonRPCResponse>);
|
||||
) as _i4.Future<_i2.JsonRPCResponse>);
|
||||
@override
|
||||
_i3.Future<void> disconnect({required String? reason}) => (super.noSuchMethod(
|
||||
_i4.Future<void> disconnect({required String? reason}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#disconnect,
|
||||
[],
|
||||
{#reason: reason},
|
||||
),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
) as _i3.Future<void>);
|
||||
returnValue: _i4.Future<void>.value(),
|
||||
returnValueForMissingStub: _i4.Future<void>.value(),
|
||||
) as _i4.Future<void>);
|
||||
@override
|
||||
_i3.Future<void> connect() => (super.noSuchMethod(
|
||||
_i4.Future<void> connect() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#connect,
|
||||
[],
|
||||
),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
) as _i3.Future<void>);
|
||||
returnValue: _i4.Future<void>.value(),
|
||||
returnValueForMissingStub: _i4.Future<void>.value(),
|
||||
) as _i4.Future<void>);
|
||||
}
|
||||
|
||||
/// A class which mocks [Prefs].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockPrefs extends _i1.Mock implements _i4.Prefs {
|
||||
class MockPrefs extends _i1.Mock implements _i5.Prefs {
|
||||
MockPrefs() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
@ -182,12 +206,12 @@ class MockPrefs extends _i1.Mock implements _i4.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i5.SyncingType get syncType => (super.noSuchMethod(
|
||||
_i6.SyncingType get syncType => (super.noSuchMethod(
|
||||
Invocation.getter(#syncType),
|
||||
returnValue: _i5.SyncingType.currentWalletOnly,
|
||||
) as _i5.SyncingType);
|
||||
returnValue: _i6.SyncingType.currentWalletOnly,
|
||||
) as _i6.SyncingType);
|
||||
@override
|
||||
set syncType(_i5.SyncingType? syncType) => super.noSuchMethod(
|
||||
set syncType(_i6.SyncingType? syncType) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#syncType,
|
||||
syncType,
|
||||
|
@ -299,6 +323,19 @@ class MockPrefs extends _i1.Mock implements _i4.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get torKillswitch => (super.noSuchMethod(
|
||||
Invocation.getter(#torKillswitch),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
set torKillswitch(bool? torKillswitch) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#torKillswitch,
|
||||
torKillswitch,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get showTestNetCoins => (super.noSuchMethod(
|
||||
Invocation.getter(#showTestNetCoins),
|
||||
returnValue: false,
|
||||
|
@ -333,12 +370,12 @@ class MockPrefs extends _i1.Mock implements _i4.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i6.BackupFrequencyType get backupFrequencyType => (super.noSuchMethod(
|
||||
_i7.BackupFrequencyType get backupFrequencyType => (super.noSuchMethod(
|
||||
Invocation.getter(#backupFrequencyType),
|
||||
returnValue: _i6.BackupFrequencyType.everyTenMinutes,
|
||||
) as _i6.BackupFrequencyType);
|
||||
returnValue: _i7.BackupFrequencyType.everyTenMinutes,
|
||||
) as _i7.BackupFrequencyType);
|
||||
@override
|
||||
set backupFrequencyType(_i6.BackupFrequencyType? backupFrequencyType) =>
|
||||
set backupFrequencyType(_i7.BackupFrequencyType? backupFrequencyType) =>
|
||||
super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#backupFrequencyType,
|
||||
|
@ -471,66 +508,79 @@ class MockPrefs extends _i1.Mock implements _i4.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get useTor => (super.noSuchMethod(
|
||||
Invocation.getter(#useTor),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
set useTor(bool? useTor) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#useTor,
|
||||
useTor,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
_i3.Future<void> init() => (super.noSuchMethod(
|
||||
_i4.Future<void> init() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#init,
|
||||
[],
|
||||
),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
) as _i3.Future<void>);
|
||||
returnValue: _i4.Future<void>.value(),
|
||||
returnValueForMissingStub: _i4.Future<void>.value(),
|
||||
) as _i4.Future<void>);
|
||||
@override
|
||||
_i3.Future<void> incrementCurrentNotificationIndex() => (super.noSuchMethod(
|
||||
_i4.Future<void> incrementCurrentNotificationIndex() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#incrementCurrentNotificationIndex,
|
||||
[],
|
||||
),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
) as _i3.Future<void>);
|
||||
returnValue: _i4.Future<void>.value(),
|
||||
returnValueForMissingStub: _i4.Future<void>.value(),
|
||||
) as _i4.Future<void>);
|
||||
@override
|
||||
_i3.Future<bool> isExternalCallsSet() => (super.noSuchMethod(
|
||||
_i4.Future<bool> isExternalCallsSet() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#isExternalCallsSet,
|
||||
[],
|
||||
),
|
||||
returnValue: _i3.Future<bool>.value(false),
|
||||
) as _i3.Future<bool>);
|
||||
returnValue: _i4.Future<bool>.value(false),
|
||||
) as _i4.Future<bool>);
|
||||
@override
|
||||
_i3.Future<void> saveUserID(String? userId) => (super.noSuchMethod(
|
||||
_i4.Future<void> saveUserID(String? userId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#saveUserID,
|
||||
[userId],
|
||||
),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
) as _i3.Future<void>);
|
||||
returnValue: _i4.Future<void>.value(),
|
||||
returnValueForMissingStub: _i4.Future<void>.value(),
|
||||
) as _i4.Future<void>);
|
||||
@override
|
||||
_i3.Future<void> saveSignupEpoch(int? signupEpoch) => (super.noSuchMethod(
|
||||
_i4.Future<void> saveSignupEpoch(int? signupEpoch) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#saveSignupEpoch,
|
||||
[signupEpoch],
|
||||
),
|
||||
returnValue: _i3.Future<void>.value(),
|
||||
returnValueForMissingStub: _i3.Future<void>.value(),
|
||||
) as _i3.Future<void>);
|
||||
returnValue: _i4.Future<void>.value(),
|
||||
returnValueForMissingStub: _i4.Future<void>.value(),
|
||||
) as _i4.Future<void>);
|
||||
@override
|
||||
_i7.AmountUnit amountUnit(_i8.Coin? coin) => (super.noSuchMethod(
|
||||
_i8.AmountUnit amountUnit(_i9.Coin? coin) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#amountUnit,
|
||||
[coin],
|
||||
),
|
||||
returnValue: _i7.AmountUnit.normal,
|
||||
) as _i7.AmountUnit);
|
||||
returnValue: _i8.AmountUnit.normal,
|
||||
) as _i8.AmountUnit);
|
||||
@override
|
||||
void updateAmountUnit({
|
||||
required _i8.Coin? coin,
|
||||
required _i7.AmountUnit? amountUnit,
|
||||
required _i9.Coin? coin,
|
||||
required _i8.AmountUnit? amountUnit,
|
||||
}) =>
|
||||
super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
@ -544,7 +594,7 @@ class MockPrefs extends _i1.Mock implements _i4.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
int maxDecimals(_i8.Coin? coin) => (super.noSuchMethod(
|
||||
int maxDecimals(_i9.Coin? coin) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#maxDecimals,
|
||||
[coin],
|
||||
|
@ -553,7 +603,7 @@ class MockPrefs extends _i1.Mock implements _i4.Prefs {
|
|||
) as int);
|
||||
@override
|
||||
void updateMaxDecimals({
|
||||
required _i8.Coin? coin,
|
||||
required _i9.Coin? coin,
|
||||
required int? maxDecimals,
|
||||
}) =>
|
||||
super.noSuchMethod(
|
||||
|
@ -568,7 +618,7 @@ class MockPrefs extends _i1.Mock implements _i4.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
void addListener(_i9.VoidCallback? listener) => super.noSuchMethod(
|
||||
void addListener(_i10.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addListener,
|
||||
[listener],
|
||||
|
@ -576,7 +626,7 @@ class MockPrefs extends _i1.Mock implements _i4.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
void removeListener(_i9.VoidCallback? listener) => super.noSuchMethod(
|
||||
void removeListener(_i10.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#removeListener,
|
||||
[listener],
|
||||
|
@ -600,3 +650,52 @@ class MockPrefs extends _i1.Mock implements _i4.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
}
|
||||
|
||||
/// A class which mocks [TorService].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockTorService extends _i1.Mock implements _i11.TorService {
|
||||
MockTorService() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
bool get enabled => (super.noSuchMethod(
|
||||
Invocation.getter(#enabled),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
_i12.TorConnectionStatus get status => (super.noSuchMethod(
|
||||
Invocation.getter(#status),
|
||||
returnValue: _i12.TorConnectionStatus.disconnected,
|
||||
) as _i12.TorConnectionStatus);
|
||||
@override
|
||||
({_i3.InternetAddress host, int port}) get proxyInfo => (super.noSuchMethod(
|
||||
Invocation.getter(#proxyInfo),
|
||||
returnValue: (
|
||||
host: _FakeInternetAddress_2(
|
||||
this,
|
||||
Invocation.getter(#proxyInfo),
|
||||
),
|
||||
port: 0
|
||||
),
|
||||
) as ({_i3.InternetAddress host, int port}));
|
||||
@override
|
||||
_i4.Future<void> start() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#start,
|
||||
[],
|
||||
),
|
||||
returnValue: _i4.Future<void>.value(),
|
||||
returnValueForMissingStub: _i4.Future<void>.value(),
|
||||
) as _i4.Future<void>);
|
||||
@override
|
||||
_i4.Future<void> stop() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#stop,
|
||||
[],
|
||||
),
|
||||
returnValue: _i4.Future<void>.value(),
|
||||
returnValueForMissingStub: _i4.Future<void>.value(),
|
||||
) as _i4.Future<void>);
|
||||
}
|
||||
|
|
|
@ -2504,6 +2504,19 @@ class MockPrefs extends _i1.Mock implements _i24.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get torKillswitch => (super.noSuchMethod(
|
||||
Invocation.getter(#torKillswitch),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
set torKillswitch(bool? torKillswitch) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#torKillswitch,
|
||||
torKillswitch,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get showTestNetCoins => (super.noSuchMethod(
|
||||
Invocation.getter(#showTestNetCoins),
|
||||
returnValue: false,
|
||||
|
@ -2676,6 +2689,19 @@ class MockPrefs extends _i1.Mock implements _i24.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get useTor => (super.noSuchMethod(
|
||||
Invocation.getter(#useTor),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
set useTor(bool? useTor) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#useTor,
|
||||
useTor,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
|
|
|
@ -3,11 +3,10 @@
|
|||
// Do not manually edit this file.
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i6;
|
||||
import 'dart:ui' as _i9;
|
||||
import 'dart:async' as _i7;
|
||||
import 'dart:ui' as _i10;
|
||||
|
||||
import 'package:decimal/decimal.dart' as _i16;
|
||||
import 'package:http/http.dart' as _i14;
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:stackwallet/models/exchange/change_now/cn_exchange_estimate.dart'
|
||||
as _i19;
|
||||
|
@ -22,19 +21,20 @@ import 'package:stackwallet/models/exchange/response_objects/fixed_rate_market.d
|
|||
import 'package:stackwallet/models/exchange/response_objects/range.dart'
|
||||
as _i17;
|
||||
import 'package:stackwallet/models/exchange/response_objects/trade.dart'
|
||||
as _i11;
|
||||
as _i12;
|
||||
import 'package:stackwallet/models/isar/exchange_cache/currency.dart' as _i15;
|
||||
import 'package:stackwallet/models/isar/exchange_cache/pair.dart' as _i23;
|
||||
import 'package:stackwallet/networking/http.dart' as _i2;
|
||||
import 'package:stackwallet/services/exchange/change_now/change_now_api.dart'
|
||||
as _i13;
|
||||
import 'package:stackwallet/services/exchange/exchange_response.dart' as _i2;
|
||||
import 'package:stackwallet/services/trade_notes_service.dart' as _i12;
|
||||
import 'package:stackwallet/services/trade_service.dart' as _i10;
|
||||
import 'package:stackwallet/utilities/amount/amount_unit.dart' as _i7;
|
||||
import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i5;
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i8;
|
||||
import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i4;
|
||||
import 'package:stackwallet/utilities/prefs.dart' as _i3;
|
||||
as _i14;
|
||||
import 'package:stackwallet/services/exchange/exchange_response.dart' as _i3;
|
||||
import 'package:stackwallet/services/trade_notes_service.dart' as _i13;
|
||||
import 'package:stackwallet/services/trade_service.dart' as _i11;
|
||||
import 'package:stackwallet/utilities/amount/amount_unit.dart' as _i8;
|
||||
import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i6;
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i9;
|
||||
import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i5;
|
||||
import 'package:stackwallet/utilities/prefs.dart' as _i4;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
|
@ -47,9 +47,19 @@ import 'package:stackwallet/utilities/prefs.dart' as _i3;
|
|||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeExchangeResponse_0<T> extends _i1.SmartFake
|
||||
implements _i2.ExchangeResponse<T> {
|
||||
_FakeExchangeResponse_0(
|
||||
class _FakeHTTP_0 extends _i1.SmartFake implements _i2.HTTP {
|
||||
_FakeHTTP_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeExchangeResponse_1<T> extends _i1.SmartFake
|
||||
implements _i3.ExchangeResponse<T> {
|
||||
_FakeExchangeResponse_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
|
@ -61,7 +71,7 @@ class _FakeExchangeResponse_0<T> extends _i1.SmartFake
|
|||
/// A class which mocks [Prefs].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockPrefs extends _i1.Mock implements _i3.Prefs {
|
||||
class MockPrefs extends _i1.Mock implements _i4.Prefs {
|
||||
MockPrefs() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
@ -117,12 +127,12 @@ class MockPrefs extends _i1.Mock implements _i3.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i4.SyncingType get syncType => (super.noSuchMethod(
|
||||
_i5.SyncingType get syncType => (super.noSuchMethod(
|
||||
Invocation.getter(#syncType),
|
||||
returnValue: _i4.SyncingType.currentWalletOnly,
|
||||
) as _i4.SyncingType);
|
||||
returnValue: _i5.SyncingType.currentWalletOnly,
|
||||
) as _i5.SyncingType);
|
||||
@override
|
||||
set syncType(_i4.SyncingType? syncType) => super.noSuchMethod(
|
||||
set syncType(_i5.SyncingType? syncType) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#syncType,
|
||||
syncType,
|
||||
|
@ -234,6 +244,19 @@ class MockPrefs extends _i1.Mock implements _i3.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get torKillswitch => (super.noSuchMethod(
|
||||
Invocation.getter(#torKillswitch),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
set torKillswitch(bool? torKillswitch) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#torKillswitch,
|
||||
torKillswitch,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get showTestNetCoins => (super.noSuchMethod(
|
||||
Invocation.getter(#showTestNetCoins),
|
||||
returnValue: false,
|
||||
|
@ -268,12 +291,12 @@ class MockPrefs extends _i1.Mock implements _i3.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i5.BackupFrequencyType get backupFrequencyType => (super.noSuchMethod(
|
||||
_i6.BackupFrequencyType get backupFrequencyType => (super.noSuchMethod(
|
||||
Invocation.getter(#backupFrequencyType),
|
||||
returnValue: _i5.BackupFrequencyType.everyTenMinutes,
|
||||
) as _i5.BackupFrequencyType);
|
||||
returnValue: _i6.BackupFrequencyType.everyTenMinutes,
|
||||
) as _i6.BackupFrequencyType);
|
||||
@override
|
||||
set backupFrequencyType(_i5.BackupFrequencyType? backupFrequencyType) =>
|
||||
set backupFrequencyType(_i6.BackupFrequencyType? backupFrequencyType) =>
|
||||
super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#backupFrequencyType,
|
||||
|
@ -406,66 +429,79 @@ class MockPrefs extends _i1.Mock implements _i3.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get useTor => (super.noSuchMethod(
|
||||
Invocation.getter(#useTor),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
set useTor(bool? useTor) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#useTor,
|
||||
useTor,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
_i6.Future<void> init() => (super.noSuchMethod(
|
||||
_i7.Future<void> init() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#init,
|
||||
[],
|
||||
),
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
returnValue: _i7.Future<void>.value(),
|
||||
returnValueForMissingStub: _i7.Future<void>.value(),
|
||||
) as _i7.Future<void>);
|
||||
@override
|
||||
_i6.Future<void> incrementCurrentNotificationIndex() => (super.noSuchMethod(
|
||||
_i7.Future<void> incrementCurrentNotificationIndex() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#incrementCurrentNotificationIndex,
|
||||
[],
|
||||
),
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
returnValue: _i7.Future<void>.value(),
|
||||
returnValueForMissingStub: _i7.Future<void>.value(),
|
||||
) as _i7.Future<void>);
|
||||
@override
|
||||
_i6.Future<bool> isExternalCallsSet() => (super.noSuchMethod(
|
||||
_i7.Future<bool> isExternalCallsSet() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#isExternalCallsSet,
|
||||
[],
|
||||
),
|
||||
returnValue: _i6.Future<bool>.value(false),
|
||||
) as _i6.Future<bool>);
|
||||
returnValue: _i7.Future<bool>.value(false),
|
||||
) as _i7.Future<bool>);
|
||||
@override
|
||||
_i6.Future<void> saveUserID(String? userId) => (super.noSuchMethod(
|
||||
_i7.Future<void> saveUserID(String? userId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#saveUserID,
|
||||
[userId],
|
||||
),
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
returnValue: _i7.Future<void>.value(),
|
||||
returnValueForMissingStub: _i7.Future<void>.value(),
|
||||
) as _i7.Future<void>);
|
||||
@override
|
||||
_i6.Future<void> saveSignupEpoch(int? signupEpoch) => (super.noSuchMethod(
|
||||
_i7.Future<void> saveSignupEpoch(int? signupEpoch) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#saveSignupEpoch,
|
||||
[signupEpoch],
|
||||
),
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
returnValue: _i7.Future<void>.value(),
|
||||
returnValueForMissingStub: _i7.Future<void>.value(),
|
||||
) as _i7.Future<void>);
|
||||
@override
|
||||
_i7.AmountUnit amountUnit(_i8.Coin? coin) => (super.noSuchMethod(
|
||||
_i8.AmountUnit amountUnit(_i9.Coin? coin) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#amountUnit,
|
||||
[coin],
|
||||
),
|
||||
returnValue: _i7.AmountUnit.normal,
|
||||
) as _i7.AmountUnit);
|
||||
returnValue: _i8.AmountUnit.normal,
|
||||
) as _i8.AmountUnit);
|
||||
@override
|
||||
void updateAmountUnit({
|
||||
required _i8.Coin? coin,
|
||||
required _i7.AmountUnit? amountUnit,
|
||||
required _i9.Coin? coin,
|
||||
required _i8.AmountUnit? amountUnit,
|
||||
}) =>
|
||||
super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
@ -479,7 +515,7 @@ class MockPrefs extends _i1.Mock implements _i3.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
int maxDecimals(_i8.Coin? coin) => (super.noSuchMethod(
|
||||
int maxDecimals(_i9.Coin? coin) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#maxDecimals,
|
||||
[coin],
|
||||
|
@ -488,7 +524,7 @@ class MockPrefs extends _i1.Mock implements _i3.Prefs {
|
|||
) as int);
|
||||
@override
|
||||
void updateMaxDecimals({
|
||||
required _i8.Coin? coin,
|
||||
required _i9.Coin? coin,
|
||||
required int? maxDecimals,
|
||||
}) =>
|
||||
super.noSuchMethod(
|
||||
|
@ -503,7 +539,7 @@ class MockPrefs extends _i1.Mock implements _i3.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
void addListener(_i9.VoidCallback? listener) => super.noSuchMethod(
|
||||
void addListener(_i10.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addListener,
|
||||
[listener],
|
||||
|
@ -511,7 +547,7 @@ class MockPrefs extends _i1.Mock implements _i3.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
void removeListener(_i9.VoidCallback? listener) => super.noSuchMethod(
|
||||
void removeListener(_i10.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#removeListener,
|
||||
[listener],
|
||||
|
@ -539,29 +575,29 @@ class MockPrefs extends _i1.Mock implements _i3.Prefs {
|
|||
/// A class which mocks [TradesService].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockTradesService extends _i1.Mock implements _i10.TradesService {
|
||||
class MockTradesService extends _i1.Mock implements _i11.TradesService {
|
||||
MockTradesService() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
List<_i11.Trade> get trades => (super.noSuchMethod(
|
||||
List<_i12.Trade> get trades => (super.noSuchMethod(
|
||||
Invocation.getter(#trades),
|
||||
returnValue: <_i11.Trade>[],
|
||||
) as List<_i11.Trade>);
|
||||
returnValue: <_i12.Trade>[],
|
||||
) as List<_i12.Trade>);
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
_i11.Trade? get(String? tradeId) => (super.noSuchMethod(Invocation.method(
|
||||
_i12.Trade? get(String? tradeId) => (super.noSuchMethod(Invocation.method(
|
||||
#get,
|
||||
[tradeId],
|
||||
)) as _i11.Trade?);
|
||||
)) as _i12.Trade?);
|
||||
@override
|
||||
_i6.Future<void> add({
|
||||
required _i11.Trade? trade,
|
||||
_i7.Future<void> add({
|
||||
required _i12.Trade? trade,
|
||||
required bool? shouldNotifyListeners,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
|
@ -573,12 +609,12 @@ class MockTradesService extends _i1.Mock implements _i10.TradesService {
|
|||
#shouldNotifyListeners: shouldNotifyListeners,
|
||||
},
|
||||
),
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
returnValue: _i7.Future<void>.value(),
|
||||
returnValueForMissingStub: _i7.Future<void>.value(),
|
||||
) as _i7.Future<void>);
|
||||
@override
|
||||
_i6.Future<void> edit({
|
||||
required _i11.Trade? trade,
|
||||
_i7.Future<void> edit({
|
||||
required _i12.Trade? trade,
|
||||
required bool? shouldNotifyListeners,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
|
@ -590,12 +626,12 @@ class MockTradesService extends _i1.Mock implements _i10.TradesService {
|
|||
#shouldNotifyListeners: shouldNotifyListeners,
|
||||
},
|
||||
),
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
returnValue: _i7.Future<void>.value(),
|
||||
returnValueForMissingStub: _i7.Future<void>.value(),
|
||||
) as _i7.Future<void>);
|
||||
@override
|
||||
_i6.Future<void> delete({
|
||||
required _i11.Trade? trade,
|
||||
_i7.Future<void> delete({
|
||||
required _i12.Trade? trade,
|
||||
required bool? shouldNotifyListeners,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
|
@ -607,11 +643,11 @@ class MockTradesService extends _i1.Mock implements _i10.TradesService {
|
|||
#shouldNotifyListeners: shouldNotifyListeners,
|
||||
},
|
||||
),
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
returnValue: _i7.Future<void>.value(),
|
||||
returnValueForMissingStub: _i7.Future<void>.value(),
|
||||
) as _i7.Future<void>);
|
||||
@override
|
||||
_i6.Future<void> deleteByUuid({
|
||||
_i7.Future<void> deleteByUuid({
|
||||
required String? uuid,
|
||||
required bool? shouldNotifyListeners,
|
||||
}) =>
|
||||
|
@ -624,11 +660,11 @@ class MockTradesService extends _i1.Mock implements _i10.TradesService {
|
|||
#shouldNotifyListeners: shouldNotifyListeners,
|
||||
},
|
||||
),
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
returnValue: _i7.Future<void>.value(),
|
||||
returnValueForMissingStub: _i7.Future<void>.value(),
|
||||
) as _i7.Future<void>);
|
||||
@override
|
||||
void addListener(_i9.VoidCallback? listener) => super.noSuchMethod(
|
||||
void addListener(_i10.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addListener,
|
||||
[listener],
|
||||
|
@ -636,7 +672,7 @@ class MockTradesService extends _i1.Mock implements _i10.TradesService {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
void removeListener(_i9.VoidCallback? listener) => super.noSuchMethod(
|
||||
void removeListener(_i10.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#removeListener,
|
||||
[listener],
|
||||
|
@ -664,7 +700,7 @@ class MockTradesService extends _i1.Mock implements _i10.TradesService {
|
|||
/// A class which mocks [TradeNotesService].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockTradeNotesService extends _i1.Mock implements _i12.TradeNotesService {
|
||||
class MockTradeNotesService extends _i1.Mock implements _i13.TradeNotesService {
|
||||
MockTradeNotesService() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
@ -689,7 +725,7 @@ class MockTradeNotesService extends _i1.Mock implements _i12.TradeNotesService {
|
|||
returnValue: '',
|
||||
) as String);
|
||||
@override
|
||||
_i6.Future<void> set({
|
||||
_i7.Future<void> set({
|
||||
required String? tradeId,
|
||||
required String? note,
|
||||
}) =>
|
||||
|
@ -702,21 +738,21 @@ class MockTradeNotesService extends _i1.Mock implements _i12.TradeNotesService {
|
|||
#note: note,
|
||||
},
|
||||
),
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
returnValue: _i7.Future<void>.value(),
|
||||
returnValueForMissingStub: _i7.Future<void>.value(),
|
||||
) as _i7.Future<void>);
|
||||
@override
|
||||
_i6.Future<void> delete({required String? tradeId}) => (super.noSuchMethod(
|
||||
_i7.Future<void> delete({required String? tradeId}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#delete,
|
||||
[],
|
||||
{#tradeId: tradeId},
|
||||
),
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
returnValue: _i7.Future<void>.value(),
|
||||
returnValueForMissingStub: _i7.Future<void>.value(),
|
||||
) as _i7.Future<void>);
|
||||
@override
|
||||
void addListener(_i9.VoidCallback? listener) => super.noSuchMethod(
|
||||
void addListener(_i10.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addListener,
|
||||
[listener],
|
||||
|
@ -724,7 +760,7 @@ class MockTradeNotesService extends _i1.Mock implements _i12.TradeNotesService {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
void removeListener(_i9.VoidCallback? listener) => super.noSuchMethod(
|
||||
void removeListener(_i10.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#removeListener,
|
||||
[listener],
|
||||
|
@ -752,13 +788,21 @@ class MockTradeNotesService extends _i1.Mock implements _i12.TradeNotesService {
|
|||
/// A class which mocks [ChangeNowAPI].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
|
||||
class MockChangeNowAPI extends _i1.Mock implements _i14.ChangeNowAPI {
|
||||
MockChangeNowAPI() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
set client(_i14.Client? _client) => super.noSuchMethod(
|
||||
_i2.HTTP get client => (super.noSuchMethod(
|
||||
Invocation.getter(#client),
|
||||
returnValue: _FakeHTTP_0(
|
||||
this,
|
||||
Invocation.getter(#client),
|
||||
),
|
||||
) as _i2.HTTP);
|
||||
@override
|
||||
set client(_i2.HTTP? _client) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#client,
|
||||
_client,
|
||||
|
@ -766,7 +810,7 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i6.Future<_i2.ExchangeResponse<List<_i15.Currency>>> getAvailableCurrencies({
|
||||
_i7.Future<_i3.ExchangeResponse<List<_i15.Currency>>> getAvailableCurrencies({
|
||||
bool? fixedRate,
|
||||
bool? active,
|
||||
}) =>
|
||||
|
@ -780,8 +824,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
|
|||
},
|
||||
),
|
||||
returnValue:
|
||||
_i6.Future<_i2.ExchangeResponse<List<_i15.Currency>>>.value(
|
||||
_FakeExchangeResponse_0<List<_i15.Currency>>(
|
||||
_i7.Future<_i3.ExchangeResponse<List<_i15.Currency>>>.value(
|
||||
_FakeExchangeResponse_1<List<_i15.Currency>>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getAvailableCurrencies,
|
||||
|
@ -792,26 +836,26 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
|
|||
},
|
||||
),
|
||||
)),
|
||||
) as _i6.Future<_i2.ExchangeResponse<List<_i15.Currency>>>);
|
||||
) as _i7.Future<_i3.ExchangeResponse<List<_i15.Currency>>>);
|
||||
@override
|
||||
_i6.Future<_i2.ExchangeResponse<List<_i15.Currency>>> getCurrenciesV2() =>
|
||||
_i7.Future<_i3.ExchangeResponse<List<_i15.Currency>>> getCurrenciesV2() =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getCurrenciesV2,
|
||||
[],
|
||||
),
|
||||
returnValue:
|
||||
_i6.Future<_i2.ExchangeResponse<List<_i15.Currency>>>.value(
|
||||
_FakeExchangeResponse_0<List<_i15.Currency>>(
|
||||
_i7.Future<_i3.ExchangeResponse<List<_i15.Currency>>>.value(
|
||||
_FakeExchangeResponse_1<List<_i15.Currency>>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getCurrenciesV2,
|
||||
[],
|
||||
),
|
||||
)),
|
||||
) as _i6.Future<_i2.ExchangeResponse<List<_i15.Currency>>>);
|
||||
) as _i7.Future<_i3.ExchangeResponse<List<_i15.Currency>>>);
|
||||
@override
|
||||
_i6.Future<_i2.ExchangeResponse<List<_i15.Currency>>> getPairedCurrencies({
|
||||
_i7.Future<_i3.ExchangeResponse<List<_i15.Currency>>> getPairedCurrencies({
|
||||
required String? ticker,
|
||||
bool? fixedRate,
|
||||
}) =>
|
||||
|
@ -825,8 +869,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
|
|||
},
|
||||
),
|
||||
returnValue:
|
||||
_i6.Future<_i2.ExchangeResponse<List<_i15.Currency>>>.value(
|
||||
_FakeExchangeResponse_0<List<_i15.Currency>>(
|
||||
_i7.Future<_i3.ExchangeResponse<List<_i15.Currency>>>.value(
|
||||
_FakeExchangeResponse_1<List<_i15.Currency>>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getPairedCurrencies,
|
||||
|
@ -837,9 +881,9 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
|
|||
},
|
||||
),
|
||||
)),
|
||||
) as _i6.Future<_i2.ExchangeResponse<List<_i15.Currency>>>);
|
||||
) as _i7.Future<_i3.ExchangeResponse<List<_i15.Currency>>>);
|
||||
@override
|
||||
_i6.Future<_i2.ExchangeResponse<_i16.Decimal>> getMinimalExchangeAmount({
|
||||
_i7.Future<_i3.ExchangeResponse<_i16.Decimal>> getMinimalExchangeAmount({
|
||||
required String? fromTicker,
|
||||
required String? toTicker,
|
||||
String? apiKey,
|
||||
|
@ -854,8 +898,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
|
|||
#apiKey: apiKey,
|
||||
},
|
||||
),
|
||||
returnValue: _i6.Future<_i2.ExchangeResponse<_i16.Decimal>>.value(
|
||||
_FakeExchangeResponse_0<_i16.Decimal>(
|
||||
returnValue: _i7.Future<_i3.ExchangeResponse<_i16.Decimal>>.value(
|
||||
_FakeExchangeResponse_1<_i16.Decimal>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getMinimalExchangeAmount,
|
||||
|
@ -867,9 +911,9 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
|
|||
},
|
||||
),
|
||||
)),
|
||||
) as _i6.Future<_i2.ExchangeResponse<_i16.Decimal>>);
|
||||
) as _i7.Future<_i3.ExchangeResponse<_i16.Decimal>>);
|
||||
@override
|
||||
_i6.Future<_i2.ExchangeResponse<_i17.Range>> getRange({
|
||||
_i7.Future<_i3.ExchangeResponse<_i17.Range>> getRange({
|
||||
required String? fromTicker,
|
||||
required String? toTicker,
|
||||
required bool? isFixedRate,
|
||||
|
@ -886,8 +930,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
|
|||
#apiKey: apiKey,
|
||||
},
|
||||
),
|
||||
returnValue: _i6.Future<_i2.ExchangeResponse<_i17.Range>>.value(
|
||||
_FakeExchangeResponse_0<_i17.Range>(
|
||||
returnValue: _i7.Future<_i3.ExchangeResponse<_i17.Range>>.value(
|
||||
_FakeExchangeResponse_1<_i17.Range>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getRange,
|
||||
|
@ -900,9 +944,9 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
|
|||
},
|
||||
),
|
||||
)),
|
||||
) as _i6.Future<_i2.ExchangeResponse<_i17.Range>>);
|
||||
) as _i7.Future<_i3.ExchangeResponse<_i17.Range>>);
|
||||
@override
|
||||
_i6.Future<_i2.ExchangeResponse<_i18.Estimate>> getEstimatedExchangeAmount({
|
||||
_i7.Future<_i3.ExchangeResponse<_i18.Estimate>> getEstimatedExchangeAmount({
|
||||
required String? fromTicker,
|
||||
required String? toTicker,
|
||||
required _i16.Decimal? fromAmount,
|
||||
|
@ -919,8 +963,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
|
|||
#apiKey: apiKey,
|
||||
},
|
||||
),
|
||||
returnValue: _i6.Future<_i2.ExchangeResponse<_i18.Estimate>>.value(
|
||||
_FakeExchangeResponse_0<_i18.Estimate>(
|
||||
returnValue: _i7.Future<_i3.ExchangeResponse<_i18.Estimate>>.value(
|
||||
_FakeExchangeResponse_1<_i18.Estimate>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getEstimatedExchangeAmount,
|
||||
|
@ -933,9 +977,9 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
|
|||
},
|
||||
),
|
||||
)),
|
||||
) as _i6.Future<_i2.ExchangeResponse<_i18.Estimate>>);
|
||||
) as _i7.Future<_i3.ExchangeResponse<_i18.Estimate>>);
|
||||
@override
|
||||
_i6.Future<_i2.ExchangeResponse<_i18.Estimate>>
|
||||
_i7.Future<_i3.ExchangeResponse<_i18.Estimate>>
|
||||
getEstimatedExchangeAmountFixedRate({
|
||||
required String? fromTicker,
|
||||
required String? toTicker,
|
||||
|
@ -957,8 +1001,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
|
|||
#apiKey: apiKey,
|
||||
},
|
||||
),
|
||||
returnValue: _i6.Future<_i2.ExchangeResponse<_i18.Estimate>>.value(
|
||||
_FakeExchangeResponse_0<_i18.Estimate>(
|
||||
returnValue: _i7.Future<_i3.ExchangeResponse<_i18.Estimate>>.value(
|
||||
_FakeExchangeResponse_1<_i18.Estimate>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getEstimatedExchangeAmountFixedRate,
|
||||
|
@ -973,9 +1017,9 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
|
|||
},
|
||||
),
|
||||
)),
|
||||
) as _i6.Future<_i2.ExchangeResponse<_i18.Estimate>>);
|
||||
) as _i7.Future<_i3.ExchangeResponse<_i18.Estimate>>);
|
||||
@override
|
||||
_i6.Future<_i2.ExchangeResponse<_i19.CNExchangeEstimate>>
|
||||
_i7.Future<_i3.ExchangeResponse<_i19.CNExchangeEstimate>>
|
||||
getEstimatedExchangeAmountV2({
|
||||
required String? fromTicker,
|
||||
required String? toTicker,
|
||||
|
@ -1002,8 +1046,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
|
|||
},
|
||||
),
|
||||
returnValue:
|
||||
_i6.Future<_i2.ExchangeResponse<_i19.CNExchangeEstimate>>.value(
|
||||
_FakeExchangeResponse_0<_i19.CNExchangeEstimate>(
|
||||
_i7.Future<_i3.ExchangeResponse<_i19.CNExchangeEstimate>>.value(
|
||||
_FakeExchangeResponse_1<_i19.CNExchangeEstimate>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getEstimatedExchangeAmountV2,
|
||||
|
@ -1020,18 +1064,18 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
|
|||
},
|
||||
),
|
||||
)),
|
||||
) as _i6.Future<_i2.ExchangeResponse<_i19.CNExchangeEstimate>>);
|
||||
) as _i7.Future<_i3.ExchangeResponse<_i19.CNExchangeEstimate>>);
|
||||
@override
|
||||
_i6.Future<_i2.ExchangeResponse<List<_i20.FixedRateMarket>>>
|
||||
_i7.Future<_i3.ExchangeResponse<List<_i20.FixedRateMarket>>>
|
||||
getAvailableFixedRateMarkets({String? apiKey}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getAvailableFixedRateMarkets,
|
||||
[],
|
||||
{#apiKey: apiKey},
|
||||
),
|
||||
returnValue: _i6
|
||||
.Future<_i2.ExchangeResponse<List<_i20.FixedRateMarket>>>.value(
|
||||
_FakeExchangeResponse_0<List<_i20.FixedRateMarket>>(
|
||||
returnValue: _i7.Future<
|
||||
_i3.ExchangeResponse<List<_i20.FixedRateMarket>>>.value(
|
||||
_FakeExchangeResponse_1<List<_i20.FixedRateMarket>>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getAvailableFixedRateMarkets,
|
||||
|
@ -1039,9 +1083,9 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
|
|||
{#apiKey: apiKey},
|
||||
),
|
||||
)),
|
||||
) as _i6.Future<_i2.ExchangeResponse<List<_i20.FixedRateMarket>>>);
|
||||
) as _i7.Future<_i3.ExchangeResponse<List<_i20.FixedRateMarket>>>);
|
||||
@override
|
||||
_i6.Future<_i2.ExchangeResponse<_i21.ExchangeTransaction>>
|
||||
_i7.Future<_i3.ExchangeResponse<_i21.ExchangeTransaction>>
|
||||
createStandardExchangeTransaction({
|
||||
required String? fromTicker,
|
||||
required String? toTicker,
|
||||
|
@ -1071,9 +1115,9 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
|
|||
#apiKey: apiKey,
|
||||
},
|
||||
),
|
||||
returnValue: _i6
|
||||
.Future<_i2.ExchangeResponse<_i21.ExchangeTransaction>>.value(
|
||||
_FakeExchangeResponse_0<_i21.ExchangeTransaction>(
|
||||
returnValue: _i7.Future<
|
||||
_i3.ExchangeResponse<_i21.ExchangeTransaction>>.value(
|
||||
_FakeExchangeResponse_1<_i21.ExchangeTransaction>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#createStandardExchangeTransaction,
|
||||
|
@ -1092,9 +1136,9 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
|
|||
},
|
||||
),
|
||||
)),
|
||||
) as _i6.Future<_i2.ExchangeResponse<_i21.ExchangeTransaction>>);
|
||||
) as _i7.Future<_i3.ExchangeResponse<_i21.ExchangeTransaction>>);
|
||||
@override
|
||||
_i6.Future<_i2.ExchangeResponse<_i21.ExchangeTransaction>>
|
||||
_i7.Future<_i3.ExchangeResponse<_i21.ExchangeTransaction>>
|
||||
createFixedRateExchangeTransaction({
|
||||
required String? fromTicker,
|
||||
required String? toTicker,
|
||||
|
@ -1128,9 +1172,9 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
|
|||
#apiKey: apiKey,
|
||||
},
|
||||
),
|
||||
returnValue: _i6
|
||||
.Future<_i2.ExchangeResponse<_i21.ExchangeTransaction>>.value(
|
||||
_FakeExchangeResponse_0<_i21.ExchangeTransaction>(
|
||||
returnValue: _i7.Future<
|
||||
_i3.ExchangeResponse<_i21.ExchangeTransaction>>.value(
|
||||
_FakeExchangeResponse_1<_i21.ExchangeTransaction>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#createFixedRateExchangeTransaction,
|
||||
|
@ -1151,39 +1195,39 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
|
|||
},
|
||||
),
|
||||
)),
|
||||
) as _i6.Future<_i2.ExchangeResponse<_i21.ExchangeTransaction>>);
|
||||
) as _i7.Future<_i3.ExchangeResponse<_i21.ExchangeTransaction>>);
|
||||
@override
|
||||
_i6.Future<
|
||||
_i2
|
||||
.ExchangeResponse<_i22.ExchangeTransactionStatus>> getTransactionStatus({
|
||||
_i7.Future<_i3.ExchangeResponse<_i22.ExchangeTransactionStatus>>
|
||||
getTransactionStatus({
|
||||
required String? id,
|
||||
String? apiKey,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getTransactionStatus,
|
||||
[],
|
||||
{
|
||||
#id: id,
|
||||
#apiKey: apiKey,
|
||||
},
|
||||
),
|
||||
returnValue: _i6
|
||||
.Future<_i2.ExchangeResponse<_i22.ExchangeTransactionStatus>>.value(
|
||||
_FakeExchangeResponse_0<_i22.ExchangeTransactionStatus>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getTransactionStatus,
|
||||
[],
|
||||
{
|
||||
#id: id,
|
||||
#apiKey: apiKey,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i6.Future<_i2.ExchangeResponse<_i22.ExchangeTransactionStatus>>);
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getTransactionStatus,
|
||||
[],
|
||||
{
|
||||
#id: id,
|
||||
#apiKey: apiKey,
|
||||
},
|
||||
),
|
||||
returnValue: _i7.Future<
|
||||
_i3.ExchangeResponse<_i22.ExchangeTransactionStatus>>.value(
|
||||
_FakeExchangeResponse_1<_i22.ExchangeTransactionStatus>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getTransactionStatus,
|
||||
[],
|
||||
{
|
||||
#id: id,
|
||||
#apiKey: apiKey,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i7
|
||||
.Future<_i3.ExchangeResponse<_i22.ExchangeTransactionStatus>>);
|
||||
@override
|
||||
_i6.Future<_i2.ExchangeResponse<List<_i23.Pair>>>
|
||||
_i7.Future<_i3.ExchangeResponse<List<_i23.Pair>>>
|
||||
getAvailableFloatingRatePairs({bool? includePartners = false}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
@ -1192,8 +1236,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
|
|||
{#includePartners: includePartners},
|
||||
),
|
||||
returnValue:
|
||||
_i6.Future<_i2.ExchangeResponse<List<_i23.Pair>>>.value(
|
||||
_FakeExchangeResponse_0<List<_i23.Pair>>(
|
||||
_i7.Future<_i3.ExchangeResponse<List<_i23.Pair>>>.value(
|
||||
_FakeExchangeResponse_1<List<_i23.Pair>>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getAvailableFloatingRatePairs,
|
||||
|
@ -1201,5 +1245,5 @@ class MockChangeNowAPI extends _i1.Mock implements _i13.ChangeNowAPI {
|
|||
{#includePartners: includePartners},
|
||||
),
|
||||
)),
|
||||
) as _i6.Future<_i2.ExchangeResponse<List<_i23.Pair>>>);
|
||||
) as _i7.Future<_i3.ExchangeResponse<List<_i23.Pair>>>);
|
||||
}
|
||||
|
|
|
@ -154,12 +154,18 @@ class MockCachedElectrumX extends _i1.Mock implements _i7.CachedElectrumX {
|
|||
_i8.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i8.Future<Map<String, dynamic>>);
|
||||
@override
|
||||
_i8.Future<List<String>> getUsedCoinSerials({required _i9.Coin? coin}) =>
|
||||
_i8.Future<List<String>> getUsedCoinSerials({
|
||||
required _i9.Coin? coin,
|
||||
int? startNumber = 0,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getUsedCoinSerials,
|
||||
[],
|
||||
{#coin: coin},
|
||||
{
|
||||
#coin: coin,
|
||||
#startNumber: startNumber,
|
||||
},
|
||||
),
|
||||
returnValue: _i8.Future<List<String>>.value(<String>[]),
|
||||
) as _i8.Future<List<String>>);
|
||||
|
|
|
@ -2,7 +2,6 @@ import 'dart:convert';
|
|||
|
||||
import 'package:decimal/decimal.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:http/http.dart';
|
||||
import 'package:mockito/annotations.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:stackwallet/exceptions/exchange/exchange_exception.dart';
|
||||
|
@ -10,21 +9,23 @@ import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart
|
|||
import 'package:stackwallet/models/exchange/change_now/exchange_transaction_status.dart';
|
||||
import 'package:stackwallet/models/exchange/response_objects/estimate.dart';
|
||||
import 'package:stackwallet/models/isar/exchange_cache/pair.dart';
|
||||
import 'package:stackwallet/networking/http.dart';
|
||||
import 'package:stackwallet/services/exchange/change_now/change_now_api.dart';
|
||||
|
||||
import 'change_now_sample_data.dart';
|
||||
import 'change_now_test.mocks.dart';
|
||||
|
||||
@GenerateMocks([Client])
|
||||
@GenerateMocks([HTTP])
|
||||
void main() {
|
||||
group("getAvailableCurrencies", () {
|
||||
test("getAvailableCurrencies succeeds without options", () async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse("https://api.ChangeNow.io/v1/currencies"),
|
||||
url: Uri.parse("https://api.ChangeNow.io/v1/currencies"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async =>
|
||||
Response(jsonEncode(availableCurrenciesJSON), 200));
|
||||
|
||||
|
@ -36,12 +37,13 @@ void main() {
|
|||
});
|
||||
|
||||
test("getAvailableCurrencies succeeds with active option", () async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse("https://api.ChangeNow.io/v1/currencies?active=true"),
|
||||
url: Uri.parse("https://api.ChangeNow.io/v1/currencies?active=true"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async =>
|
||||
Response(jsonEncode(availableCurrenciesJSONActive), 200));
|
||||
|
||||
|
@ -54,12 +56,13 @@ void main() {
|
|||
});
|
||||
|
||||
test("getAvailableCurrencies succeeds with fixedRate option", () async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse("https://api.ChangeNow.io/v1/currencies?fixedRate=true"),
|
||||
url: Uri.parse("https://api.ChangeNow.io/v1/currencies?fixedRate=true"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async =>
|
||||
Response(jsonEncode(availableCurrenciesJSONFixedRate), 200));
|
||||
|
||||
|
@ -73,13 +76,14 @@ void main() {
|
|||
|
||||
test("getAvailableCurrencies succeeds with fixedRate and active options",
|
||||
() async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse(
|
||||
url: Uri.parse(
|
||||
"https://api.ChangeNow.io/v1/currencies?fixedRate=true&active=true"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async =>
|
||||
Response(jsonEncode(availableCurrenciesJSONActiveFixedRate), 200));
|
||||
|
||||
|
@ -94,12 +98,13 @@ void main() {
|
|||
test(
|
||||
"getAvailableCurrencies fails with ChangeNowExceptionType.serializeResponseError",
|
||||
() async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse("https://api.ChangeNow.io/v1/currencies"),
|
||||
url: Uri.parse("https://api.ChangeNow.io/v1/currencies"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async =>
|
||||
Response('{"some unexpected": "but valid json data"}', 200));
|
||||
|
||||
|
@ -111,12 +116,13 @@ void main() {
|
|||
});
|
||||
|
||||
test("getAvailableCurrencies fails for any other reason", () async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse("https://api.ChangeNow.io/v1/currencies"),
|
||||
url: Uri.parse("https://api.ChangeNow.io/v1/currencies"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async => Response("", 400));
|
||||
|
||||
final result = await ChangeNowAPI.instance.getAvailableCurrencies();
|
||||
|
@ -129,12 +135,13 @@ void main() {
|
|||
|
||||
group("getPairedCurrencies", () {
|
||||
test("getPairedCurrencies succeeds without fixedRate option", () async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse("https://api.ChangeNow.io/v1/currencies-to/XMR"),
|
||||
url: Uri.parse("https://api.ChangeNow.io/v1/currencies-to/XMR"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async =>
|
||||
Response(jsonEncode(getPairedCurrenciesJSON), 200));
|
||||
|
||||
|
@ -147,13 +154,14 @@ void main() {
|
|||
});
|
||||
|
||||
test("getPairedCurrencies succeeds with fixedRate option", () async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse(
|
||||
url: Uri.parse(
|
||||
"https://api.ChangeNow.io/v1/currencies-to/XMR?fixedRate=true"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async =>
|
||||
Response(jsonEncode(getPairedCurrenciesJSONFixedRate), 200));
|
||||
|
||||
|
@ -168,12 +176,13 @@ void main() {
|
|||
test(
|
||||
"getPairedCurrencies fails with ChangeNowExceptionType.serializeResponseError A",
|
||||
() async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse("https://api.ChangeNow.io/v1/currencies-to/XMR"),
|
||||
url: Uri.parse("https://api.ChangeNow.io/v1/currencies-to/XMR"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async =>
|
||||
Response('[{"some unexpected": "but valid json data"}]', 200));
|
||||
|
||||
|
@ -186,12 +195,13 @@ void main() {
|
|||
});
|
||||
|
||||
test("getPairedCurrencies fails for any other reason", () async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse("https://api.ChangeNow.io/v1/currencies"),
|
||||
url: Uri.parse("https://api.ChangeNow.io/v1/currencies"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async => Response("", 400));
|
||||
|
||||
final result = await ChangeNowAPI.instance
|
||||
|
@ -204,13 +214,14 @@ void main() {
|
|||
|
||||
group("getMinimalExchangeAmount", () {
|
||||
test("getMinimalExchangeAmount succeeds", () async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse(
|
||||
url: Uri.parse(
|
||||
"https://api.ChangeNow.io/v1/min-amount/xmr_btc?api_key=testAPIKEY"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer(
|
||||
(realInvocation) async => Response('{"minAmount": 42}', 200));
|
||||
|
||||
|
@ -228,13 +239,14 @@ void main() {
|
|||
test(
|
||||
"getMinimalExchangeAmount fails with ChangeNowExceptionType.serializeResponseError",
|
||||
() async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse(
|
||||
url: Uri.parse(
|
||||
"https://api.ChangeNow.io/v1/min-amount/xmr_btc?api_key=testAPIKEY"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async => Response('{"error": 42}', 200));
|
||||
|
||||
final result = await ChangeNowAPI.instance.getMinimalExchangeAmount(
|
||||
|
@ -249,13 +261,14 @@ void main() {
|
|||
});
|
||||
|
||||
test("getMinimalExchangeAmount fails for any other reason", () async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse(
|
||||
url: Uri.parse(
|
||||
"https://api.ChangeNow.io/v1/min-amount/xmr_btc?api_key=testAPIKEY"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async => Response('', 400));
|
||||
|
||||
final result = await ChangeNowAPI.instance.getMinimalExchangeAmount(
|
||||
|
@ -272,13 +285,14 @@ void main() {
|
|||
|
||||
group("getEstimatedExchangeAmount", () {
|
||||
test("getEstimatedExchangeAmount succeeds", () async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse(
|
||||
url: Uri.parse(
|
||||
"https://api.ChangeNow.io/v1/exchange-amount/42/xmr_btc?api_key=testAPIKEY"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async => Response(
|
||||
'{"estimatedAmount": 58.4142873, "transactionSpeedForecast": "10-60", "warningMessage": null}',
|
||||
200));
|
||||
|
@ -298,13 +312,14 @@ void main() {
|
|||
test(
|
||||
"getEstimatedExchangeAmount fails with ChangeNowExceptionType.serializeResponseError",
|
||||
() async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse(
|
||||
url: Uri.parse(
|
||||
"https://api.ChangeNow.io/v1/exchange-amount/42/xmr_btc?api_key=testAPIKEY"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async => Response('{"error": 42}', 200));
|
||||
|
||||
final result = await ChangeNowAPI.instance.getEstimatedExchangeAmount(
|
||||
|
@ -320,13 +335,14 @@ void main() {
|
|||
});
|
||||
|
||||
test("getEstimatedExchangeAmount fails for any other reason", () async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse(
|
||||
url: Uri.parse(
|
||||
"https://api.ChangeNow.io/v1/exchange-amount/42/xmr_btc?api_key=testAPIKEY"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async => Response('', 400));
|
||||
|
||||
final result = await ChangeNowAPI.instance.getEstimatedExchangeAmount(
|
||||
|
@ -343,13 +359,14 @@ void main() {
|
|||
|
||||
// group("getEstimatedFixedRateExchangeAmount", () {
|
||||
// test("getEstimatedFixedRateExchangeAmount succeeds", () async {
|
||||
// final client = MockClient();
|
||||
// final client = MockHTTP();
|
||||
// ChangeNow.instance.client = client;
|
||||
//
|
||||
// when(client.get(
|
||||
// when(client.get(url:
|
||||
// Uri.parse(
|
||||
// "https://api.ChangeNow.io/v1/exchange-amount/fixed-rate/10/xmr_btc?api_key=testAPIKEY&useRateId=true"),
|
||||
// headers: {'Content-Type': 'application/json'},
|
||||
// routeOverTor: false,
|
||||
// )).thenAnswer((realInvocation) async =>
|
||||
// Response(jsonEncode(estFixedRateExchangeAmountJSON), 200));
|
||||
//
|
||||
|
@ -370,13 +387,14 @@ void main() {
|
|||
// test(
|
||||
// "getEstimatedFixedRateExchangeAmount fails with ChangeNowExceptionType.serializeResponseError",
|
||||
// () async {
|
||||
// final client = MockClient();
|
||||
// final client = MockHTTP();
|
||||
// ChangeNow.instance.client = client;
|
||||
//
|
||||
// when(client.get(
|
||||
// when(client.get(url:
|
||||
// Uri.parse(
|
||||
// "https://api.ChangeNow.io/v1/exchange-amount/fixed-rate/10/xmr_btc?api_key=testAPIKEY&useRateId=true"),
|
||||
// headers: {'Content-Type': 'application/json'},
|
||||
// routeOverTor: false,
|
||||
// )).thenAnswer((realInvocation) async => Response('{"error": 42}', 200));
|
||||
//
|
||||
// final result =
|
||||
|
@ -394,13 +412,14 @@ void main() {
|
|||
//
|
||||
// test("getEstimatedFixedRateExchangeAmount fails for any other reason",
|
||||
// () async {
|
||||
// final client = MockClient();
|
||||
// final client = MockHTTP();
|
||||
// ChangeNow.instance.client = client;
|
||||
//
|
||||
// when(client.get(
|
||||
// when(client.get(url:
|
||||
// Uri.parse(
|
||||
// "https://api.ChangeNow.io/v1/exchange-amount/fixed-rate/10/xmr_btc?api_key=testAPIKEY&useRateId=true"),
|
||||
// headers: {'Content-Type': 'application/json'},
|
||||
// routeOverTor: false,
|
||||
// )).thenAnswer((realInvocation) async => Response('', 400));
|
||||
//
|
||||
// final result =
|
||||
|
@ -418,13 +437,14 @@ void main() {
|
|||
|
||||
group("getAvailableFixedRateMarkets", () {
|
||||
test("getAvailableFixedRateMarkets succeeds", () async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse(
|
||||
url: Uri.parse(
|
||||
"https://api.ChangeNow.io/v1/market-info/fixed-rate/testAPIKEY"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async =>
|
||||
Response(jsonEncode(fixedRateMarketsJSON), 200));
|
||||
|
||||
|
@ -440,13 +460,14 @@ void main() {
|
|||
test(
|
||||
"getAvailableFixedRateMarkets fails with ChangeNowExceptionType.serializeResponseError",
|
||||
() async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse(
|
||||
url: Uri.parse(
|
||||
"https://api.ChangeNow.io/v1/market-info/fixed-rate/testAPIKEY"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async => Response('{"error": 42}', 200));
|
||||
|
||||
final result = await ChangeNowAPI.instance.getAvailableFixedRateMarkets(
|
||||
|
@ -459,13 +480,14 @@ void main() {
|
|||
});
|
||||
|
||||
test("getAvailableFixedRateMarkets fails for any other reason", () async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse(
|
||||
url: Uri.parse(
|
||||
"https://api.ChangeNow.io/v1/market-info/fixed-rate/testAPIKEY"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async => Response('', 400));
|
||||
|
||||
final result = await ChangeNowAPI.instance.getAvailableFixedRateMarkets(
|
||||
|
@ -480,12 +502,13 @@ void main() {
|
|||
|
||||
group("createStandardExchangeTransaction", () {
|
||||
test("createStandardExchangeTransaction succeeds", () async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.post(
|
||||
Uri.parse("https://api.ChangeNow.io/v1/transactions/testAPIKEY"),
|
||||
url: Uri.parse("https://api.ChangeNow.io/v1/transactions/testAPIKEY"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
body:
|
||||
'{"from":"xmr","to":"btc","address":"bc1qu58svs9983e2vuyqh7gq7ratf8k5qehz5k0cn5","amount":"0.3","flow":"standard","extraId":"","userId":"","contactEmail":"","refundAddress":"888tNkZrPN6JsEgekjMnABU4TBzc2Dt29EPAvkRxbANsAnjyPbb3iQ1YBRk1UXcdRsiKc9dhwMVgN5S9cQUiyoogDavup3H","refundExtraId":""}',
|
||||
encoding: null,
|
||||
|
@ -511,12 +534,13 @@ void main() {
|
|||
test(
|
||||
"createStandardExchangeTransaction fails with ChangeNowExceptionType.serializeResponseError",
|
||||
() async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.post(
|
||||
Uri.parse("https://api.ChangeNow.io/v1/transactions/testAPIKEY"),
|
||||
url: Uri.parse("https://api.ChangeNow.io/v1/transactions/testAPIKEY"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
body:
|
||||
'{"from":"xmr","to":"btc","address":"bc1qu58svs9983e2vuyqh7gq7ratf8k5qehz5k0cn5","amount":"0.3","flow":"standard","extraId":"","userId":"","contactEmail":"","refundAddress":"888tNkZrPN6JsEgekjMnABU4TBzc2Dt29EPAvkRxbANsAnjyPbb3iQ1YBRk1UXcdRsiKc9dhwMVgN5S9cQUiyoogDavup3H","refundExtraId":""}',
|
||||
encoding: null,
|
||||
|
@ -540,12 +564,13 @@ void main() {
|
|||
|
||||
test("createStandardExchangeTransaction fails for any other reason",
|
||||
() async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.post(
|
||||
Uri.parse("https://api.ChangeNow.io/v1/transactions/testAPIKEY"),
|
||||
url: Uri.parse("https://api.ChangeNow.io/v1/transactions/testAPIKEY"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
body:
|
||||
'{"from":"xmr","to":"btc","address":"bc1qu58svs9983e2vuyqh7gq7ratf8k5qehz5k0cn5","amount":"0.3","flow":"standard","extraId":"","userId":"","contactEmail":"","refundAddress":"888tNkZrPN6JsEgekjMnABU4TBzc2Dt29EPAvkRxbANsAnjyPbb3iQ1YBRk1UXcdRsiKc9dhwMVgN5S9cQUiyoogDavup3H","refundExtraId":""}',
|
||||
encoding: null,
|
||||
|
@ -569,13 +594,14 @@ void main() {
|
|||
|
||||
group("createFixedRateExchangeTransaction", () {
|
||||
test("createFixedRateExchangeTransaction succeeds", () async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.post(
|
||||
Uri.parse(
|
||||
url: Uri.parse(
|
||||
"https://api.ChangeNow.io/v1/transactions/fixed-rate/testAPIKEY"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
body:
|
||||
'{"from":"btc","to":"eth","address":"0x57f31ad4b64095347F87eDB1675566DAfF5EC886","flow":"fixed-rate","extraId":"","userId":"","contactEmail":"","refundAddress":"","refundExtraId":"","rateId":"","amount":"0.3"}',
|
||||
encoding: null,
|
||||
|
@ -603,13 +629,14 @@ void main() {
|
|||
test(
|
||||
"createFixedRateExchangeTransaction fails with ChangeNowExceptionType.serializeResponseError",
|
||||
() async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.post(
|
||||
Uri.parse(
|
||||
url: Uri.parse(
|
||||
"https://api.ChangeNow.io/v1/transactions/fixed-rate/testAPIKEY"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
body:
|
||||
'{"from":"btc","to":"eth","address":"0x57f31ad4b64095347F87eDB1675566DAfF5EC886","amount":"0.3","flow":"fixed-rate","extraId":"","userId":"","contactEmail":"","refundAddress":"","refundExtraId":"","rateId":""}',
|
||||
encoding: null,
|
||||
|
@ -634,13 +661,14 @@ void main() {
|
|||
|
||||
test("createFixedRateExchangeTransaction fails for any other reason",
|
||||
() async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.post(
|
||||
Uri.parse(
|
||||
url: Uri.parse(
|
||||
"https://api.ChangeNow.io/v1/transactions/fixed-rate/testAPIKEY"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
body:
|
||||
'{"from": "btc","to": "eth","address": "0x57f31ad4b64095347F87eDB1675566DAfF5EC886", "amount": "1.12345","extraId": "", "userId": "","contactEmail": "","refundAddress": "", "refundExtraId": "", "rateId": "" }',
|
||||
encoding: null,
|
||||
|
@ -666,13 +694,14 @@ void main() {
|
|||
|
||||
group("getTransactionStatus", () {
|
||||
test("getTransactionStatus succeeds", () async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse(
|
||||
url: Uri.parse(
|
||||
"https://api.ChangeNow.io/v1/transactions/47F87eDB1675566DAfF5EC886/testAPIKEY"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async => Response(
|
||||
'{"status": "waiting", "payinAddress": "32Ge2ci26rj1sRGw2NjiQa9L7Xvxtgzhrj", "payoutAddress": "0x57f31ad4b64095347F87eDB1675566DAfF5EC886", "fromCurrency": "btc", "toCurrency": "eth", "id": "50727663e5d9a4", "updatedAt": "2019-08-22T14:47:49.943Z", "expectedSendAmount": 1, "expectedReceiveAmount": 52.31667, "createdAt": "2019-08-22T14:47:49.943Z", "isPartner": false}',
|
||||
200));
|
||||
|
@ -690,13 +719,14 @@ void main() {
|
|||
test(
|
||||
"getTransactionStatus fails with ChangeNowExceptionType.serializeResponseError",
|
||||
() async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse(
|
||||
url: Uri.parse(
|
||||
"https://api.ChangeNow.io/v1/transactions/47F87eDB1675566DAfF5EC886/testAPIKEY"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async => Response('{"error": 42}', 200));
|
||||
|
||||
final result = await ChangeNowAPI.instance.getTransactionStatus(
|
||||
|
@ -710,13 +740,14 @@ void main() {
|
|||
});
|
||||
|
||||
test("getTransactionStatus fails for any other reason", () async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse(
|
||||
url: Uri.parse(
|
||||
"https://api.ChangeNow.io/v1/transactions/47F87eDB1675566DAfF5EC886/testAPIKEY"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async => Response('', 400));
|
||||
|
||||
final result = await ChangeNowAPI.instance.getTransactionStatus(
|
||||
|
@ -732,13 +763,14 @@ void main() {
|
|||
|
||||
group("getAvailableFloatingRatePairs", () {
|
||||
test("getAvailableFloatingRatePairs succeeds", () async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse(
|
||||
url: Uri.parse(
|
||||
"https://api.ChangeNow.io/v1/market-info/available-pairs?includePartners=false"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async =>
|
||||
Response('["btc_xmr","btc_firo","btc_doge","eth_ltc"]', 200));
|
||||
|
||||
|
@ -753,13 +785,14 @@ void main() {
|
|||
test(
|
||||
"getAvailableFloatingRatePairs fails with ChangeNowExceptionType.serializeResponseError",
|
||||
() async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse(
|
||||
url: Uri.parse(
|
||||
"https://api.ChangeNow.io/v1/market-info/available-pairs?includePartners=false"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async => Response('{"error": 42}', 200));
|
||||
|
||||
final result =
|
||||
|
@ -771,13 +804,14 @@ void main() {
|
|||
});
|
||||
|
||||
test("getAvailableFloatingRatePairs fails for any other reason", () async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
ChangeNowAPI.instance.client = client;
|
||||
|
||||
when(client.get(
|
||||
Uri.parse(
|
||||
url: Uri.parse(
|
||||
"https://api.ChangeNow.io/v1/market-info/available-pairs?includePartners=false"),
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
routeOverTor: false,
|
||||
)).thenAnswer((realInvocation) async => Response('', 400));
|
||||
|
||||
final result =
|
||||
|
|
|
@ -5,10 +5,9 @@
|
|||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i3;
|
||||
import 'dart:convert' as _i4;
|
||||
import 'dart:typed_data' as _i5;
|
||||
|
||||
import 'package:http/http.dart' as _i2;
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:stackwallet/networking/http.dart' as _i2;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
|
@ -31,233 +30,76 @@ class _FakeResponse_0 extends _i1.SmartFake implements _i2.Response {
|
|||
);
|
||||
}
|
||||
|
||||
class _FakeStreamedResponse_1 extends _i1.SmartFake
|
||||
implements _i2.StreamedResponse {
|
||||
_FakeStreamedResponse_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
}
|
||||
|
||||
/// A class which mocks [Client].
|
||||
/// A class which mocks [HTTP].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockClient extends _i1.Mock implements _i2.Client {
|
||||
MockClient() {
|
||||
class MockHTTP extends _i1.Mock implements _i2.HTTP {
|
||||
MockHTTP() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_i3.Future<_i2.Response> head(
|
||||
Uri? url, {
|
||||
Map<String, String>? headers,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#head,
|
||||
[url],
|
||||
{#headers: headers},
|
||||
),
|
||||
returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0(
|
||||
this,
|
||||
Invocation.method(
|
||||
#head,
|
||||
[url],
|
||||
{#headers: headers},
|
||||
),
|
||||
)),
|
||||
) as _i3.Future<_i2.Response>);
|
||||
@override
|
||||
_i3.Future<_i2.Response> get(
|
||||
Uri? url, {
|
||||
_i3.Future<_i2.Response> get({
|
||||
required Uri? url,
|
||||
Map<String, String>? headers,
|
||||
required bool? routeOverTor,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#get,
|
||||
[url],
|
||||
{#headers: headers},
|
||||
[],
|
||||
{
|
||||
#url: url,
|
||||
#headers: headers,
|
||||
#routeOverTor: routeOverTor,
|
||||
},
|
||||
),
|
||||
returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0(
|
||||
this,
|
||||
Invocation.method(
|
||||
#get,
|
||||
[url],
|
||||
{#headers: headers},
|
||||
[],
|
||||
{
|
||||
#url: url,
|
||||
#headers: headers,
|
||||
#routeOverTor: routeOverTor,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i3.Future<_i2.Response>);
|
||||
@override
|
||||
_i3.Future<_i2.Response> post(
|
||||
Uri? url, {
|
||||
_i3.Future<_i2.Response> post({
|
||||
required Uri? url,
|
||||
Map<String, String>? headers,
|
||||
Object? body,
|
||||
_i4.Encoding? encoding,
|
||||
required bool? routeOverTor,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#post,
|
||||
[url],
|
||||
[],
|
||||
{
|
||||
#url: url,
|
||||
#headers: headers,
|
||||
#body: body,
|
||||
#encoding: encoding,
|
||||
#routeOverTor: routeOverTor,
|
||||
},
|
||||
),
|
||||
returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0(
|
||||
this,
|
||||
Invocation.method(
|
||||
#post,
|
||||
[url],
|
||||
[],
|
||||
{
|
||||
#url: url,
|
||||
#headers: headers,
|
||||
#body: body,
|
||||
#encoding: encoding,
|
||||
#routeOverTor: routeOverTor,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i3.Future<_i2.Response>);
|
||||
@override
|
||||
_i3.Future<_i2.Response> put(
|
||||
Uri? url, {
|
||||
Map<String, String>? headers,
|
||||
Object? body,
|
||||
_i4.Encoding? encoding,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#put,
|
||||
[url],
|
||||
{
|
||||
#headers: headers,
|
||||
#body: body,
|
||||
#encoding: encoding,
|
||||
},
|
||||
),
|
||||
returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0(
|
||||
this,
|
||||
Invocation.method(
|
||||
#put,
|
||||
[url],
|
||||
{
|
||||
#headers: headers,
|
||||
#body: body,
|
||||
#encoding: encoding,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i3.Future<_i2.Response>);
|
||||
@override
|
||||
_i3.Future<_i2.Response> patch(
|
||||
Uri? url, {
|
||||
Map<String, String>? headers,
|
||||
Object? body,
|
||||
_i4.Encoding? encoding,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#patch,
|
||||
[url],
|
||||
{
|
||||
#headers: headers,
|
||||
#body: body,
|
||||
#encoding: encoding,
|
||||
},
|
||||
),
|
||||
returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0(
|
||||
this,
|
||||
Invocation.method(
|
||||
#patch,
|
||||
[url],
|
||||
{
|
||||
#headers: headers,
|
||||
#body: body,
|
||||
#encoding: encoding,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i3.Future<_i2.Response>);
|
||||
@override
|
||||
_i3.Future<_i2.Response> delete(
|
||||
Uri? url, {
|
||||
Map<String, String>? headers,
|
||||
Object? body,
|
||||
_i4.Encoding? encoding,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#delete,
|
||||
[url],
|
||||
{
|
||||
#headers: headers,
|
||||
#body: body,
|
||||
#encoding: encoding,
|
||||
},
|
||||
),
|
||||
returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0(
|
||||
this,
|
||||
Invocation.method(
|
||||
#delete,
|
||||
[url],
|
||||
{
|
||||
#headers: headers,
|
||||
#body: body,
|
||||
#encoding: encoding,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i3.Future<_i2.Response>);
|
||||
@override
|
||||
_i3.Future<String> read(
|
||||
Uri? url, {
|
||||
Map<String, String>? headers,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#read,
|
||||
[url],
|
||||
{#headers: headers},
|
||||
),
|
||||
returnValue: _i3.Future<String>.value(''),
|
||||
) as _i3.Future<String>);
|
||||
@override
|
||||
_i3.Future<_i5.Uint8List> readBytes(
|
||||
Uri? url, {
|
||||
Map<String, String>? headers,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#readBytes,
|
||||
[url],
|
||||
{#headers: headers},
|
||||
),
|
||||
returnValue: _i3.Future<_i5.Uint8List>.value(_i5.Uint8List(0)),
|
||||
) as _i3.Future<_i5.Uint8List>);
|
||||
@override
|
||||
_i3.Future<_i2.StreamedResponse> send(_i2.BaseRequest? request) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#send,
|
||||
[request],
|
||||
),
|
||||
returnValue:
|
||||
_i3.Future<_i2.StreamedResponse>.value(_FakeStreamedResponse_1(
|
||||
this,
|
||||
Invocation.method(
|
||||
#send,
|
||||
[request],
|
||||
),
|
||||
)),
|
||||
) as _i3.Future<_i2.StreamedResponse>);
|
||||
@override
|
||||
void close() => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#close,
|
||||
[],
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -485,12 +485,18 @@ class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX {
|
|||
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i4.Future<Map<String, dynamic>>);
|
||||
@override
|
||||
_i4.Future<List<String>> getUsedCoinSerials({required _i6.Coin? coin}) =>
|
||||
_i4.Future<List<String>> getUsedCoinSerials({
|
||||
required _i6.Coin? coin,
|
||||
int? startNumber = 0,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getUsedCoinSerials,
|
||||
[],
|
||||
{#coin: coin},
|
||||
{
|
||||
#coin: coin,
|
||||
#startNumber: startNumber,
|
||||
},
|
||||
),
|
||||
returnValue: _i4.Future<List<String>>.value(<String>[]),
|
||||
) as _i4.Future<List<String>>);
|
||||
|
|
|
@ -485,12 +485,18 @@ class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX {
|
|||
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i4.Future<Map<String, dynamic>>);
|
||||
@override
|
||||
_i4.Future<List<String>> getUsedCoinSerials({required _i6.Coin? coin}) =>
|
||||
_i4.Future<List<String>> getUsedCoinSerials({
|
||||
required _i6.Coin? coin,
|
||||
int? startNumber = 0,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getUsedCoinSerials,
|
||||
[],
|
||||
{#coin: coin},
|
||||
{
|
||||
#coin: coin,
|
||||
#startNumber: startNumber,
|
||||
},
|
||||
),
|
||||
returnValue: _i4.Future<List<String>>.value(<String>[]),
|
||||
) as _i4.Future<List<String>>);
|
||||
|
|
|
@ -485,12 +485,18 @@ class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX {
|
|||
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i4.Future<Map<String, dynamic>>);
|
||||
@override
|
||||
_i4.Future<List<String>> getUsedCoinSerials({required _i6.Coin? coin}) =>
|
||||
_i4.Future<List<String>> getUsedCoinSerials({
|
||||
required _i6.Coin? coin,
|
||||
int? startNumber = 0,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getUsedCoinSerials,
|
||||
[],
|
||||
{#coin: coin},
|
||||
{
|
||||
#coin: coin,
|
||||
#startNumber: startNumber,
|
||||
},
|
||||
),
|
||||
returnValue: _i4.Future<List<String>>.value(<String>[]),
|
||||
) as _i4.Future<List<String>>);
|
||||
|
@ -531,6 +537,7 @@ class MockTransactionNotificationTracker extends _i1.Mock
|
|||
Invocation.getter(#confirmeds),
|
||||
returnValue: <String>[],
|
||||
) as List<String>);
|
||||
|
||||
@override
|
||||
bool wasNotifiedPending(String? txid) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
|
|
@ -512,12 +512,18 @@ class MockCachedElectrumX extends _i1.Mock implements _i6.CachedElectrumX {
|
|||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i5.Future<Map<String, dynamic>>);
|
||||
@override
|
||||
_i5.Future<List<String>> getUsedCoinSerials({required _i7.Coin? coin}) =>
|
||||
_i5.Future<List<String>> getUsedCoinSerials({
|
||||
required _i7.Coin? coin,
|
||||
int? startNumber = 0,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getUsedCoinSerials,
|
||||
[],
|
||||
{#coin: coin},
|
||||
{
|
||||
#coin: coin,
|
||||
#startNumber: startNumber,
|
||||
},
|
||||
),
|
||||
returnValue: _i5.Future<List<String>>.value(<String>[]),
|
||||
) as _i5.Future<List<String>>);
|
||||
|
|
|
@ -485,12 +485,18 @@ class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX {
|
|||
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i4.Future<Map<String, dynamic>>);
|
||||
@override
|
||||
_i4.Future<List<String>> getUsedCoinSerials({required _i6.Coin? coin}) =>
|
||||
_i4.Future<List<String>> getUsedCoinSerials({
|
||||
required _i6.Coin? coin,
|
||||
int? startNumber = 0,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getUsedCoinSerials,
|
||||
[],
|
||||
{#coin: coin},
|
||||
{
|
||||
#coin: coin,
|
||||
#startNumber: startNumber,
|
||||
},
|
||||
),
|
||||
returnValue: _i4.Future<List<String>>.value(<String>[]),
|
||||
) as _i4.Future<List<String>>);
|
||||
|
|
|
@ -485,12 +485,18 @@ class MockCachedElectrumX extends _i1.Mock implements _i5.CachedElectrumX {
|
|||
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||
) as _i4.Future<Map<String, dynamic>>);
|
||||
@override
|
||||
_i4.Future<List<String>> getUsedCoinSerials({required _i6.Coin? coin}) =>
|
||||
_i4.Future<List<String>> getUsedCoinSerials({
|
||||
required _i6.Coin? coin,
|
||||
int? startNumber = 0,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getUsedCoinSerials,
|
||||
[],
|
||||
{#coin: coin},
|
||||
{
|
||||
#coin: coin,
|
||||
#startNumber: startNumber,
|
||||
},
|
||||
),
|
||||
returnValue: _i4.Future<List<String>>.value(<String>[]),
|
||||
) as _i4.Future<List<String>>);
|
||||
|
|
|
@ -2236,6 +2236,19 @@ class MockPrefs extends _i1.Mock implements _i24.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get torKillswitch => (super.noSuchMethod(
|
||||
Invocation.getter(#torKillswitch),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
set torKillswitch(bool? torKillswitch) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#torKillswitch,
|
||||
torKillswitch,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get showTestNetCoins => (super.noSuchMethod(
|
||||
Invocation.getter(#showTestNetCoins),
|
||||
returnValue: false,
|
||||
|
@ -2408,6 +2421,19 @@ class MockPrefs extends _i1.Mock implements _i24.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get useTor => (super.noSuchMethod(
|
||||
Invocation.getter(#useTor),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
set useTor(bool? useTor) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#useTor,
|
||||
useTor,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
|
|
|
@ -9,6 +9,7 @@ import 'package:stackwallet/models/isar/stack_theme.dart';
|
|||
import 'package:stackwallet/models/node_model.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/services/node_service.dart';
|
||||
import 'package:stackwallet/services/tor_service.dart';
|
||||
import 'package:stackwallet/services/wallets.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
|
@ -19,7 +20,7 @@ import 'package:tuple/tuple.dart';
|
|||
import '../sample_data/theme_json.dart';
|
||||
import 'node_options_sheet_test.mocks.dart';
|
||||
|
||||
@GenerateMocks([Wallets, Prefs, NodeService])
|
||||
@GenerateMocks([Wallets, Prefs, NodeService, TorService])
|
||||
void main() {
|
||||
testWidgets("Load Node Options widget", (tester) async {
|
||||
final mockWallets = MockWallets();
|
||||
|
@ -163,6 +164,7 @@ void main() {
|
|||
final mockWallets = MockWallets();
|
||||
final mockPrefs = MockPrefs();
|
||||
final mockNodeService = MockNodeService();
|
||||
final mockTorService = MockTorService();
|
||||
|
||||
when(mockNodeService.getNodeById(id: "node id")).thenAnswer(
|
||||
(realInvocation) => NodeModel(
|
||||
|
@ -193,7 +195,8 @@ void main() {
|
|||
overrides: [
|
||||
walletsChangeNotifierProvider.overrideWithValue(mockWallets),
|
||||
prefsChangeNotifierProvider.overrideWithValue(mockPrefs),
|
||||
nodeServiceChangeNotifierProvider.overrideWithValue(mockNodeService)
|
||||
nodeServiceChangeNotifierProvider.overrideWithValue(mockNodeService),
|
||||
pTorService.overrideWithValue(mockTorService),
|
||||
],
|
||||
child: MaterialApp(
|
||||
theme: ThemeData(
|
||||
|
|
|
@ -3,25 +3,29 @@
|
|||
// Do not manually edit this file.
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i11;
|
||||
import 'dart:ui' as _i13;
|
||||
import 'dart:async' as _i12;
|
||||
import 'dart:io' as _i8;
|
||||
import 'dart:ui' as _i14;
|
||||
|
||||
import 'package:flutter/foundation.dart' as _i4;
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart' as _i5;
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:stackwallet/models/node_model.dart' as _i17;
|
||||
import 'package:stackwallet/models/node_model.dart' as _i18;
|
||||
import 'package:stackwallet/services/coins/manager.dart' as _i6;
|
||||
import 'package:stackwallet/services/event_bus/events/global/tor_connection_status_changed_event.dart'
|
||||
as _i20;
|
||||
import 'package:stackwallet/services/node_service.dart' as _i3;
|
||||
import 'package:stackwallet/services/wallets.dart' as _i8;
|
||||
import 'package:stackwallet/services/tor_service.dart' as _i19;
|
||||
import 'package:stackwallet/services/wallets.dart' as _i9;
|
||||
import 'package:stackwallet/services/wallets_service.dart' as _i2;
|
||||
import 'package:stackwallet/utilities/amount/amount_unit.dart' as _i16;
|
||||
import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i15;
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i9;
|
||||
import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i14;
|
||||
import 'package:stackwallet/utilities/amount/amount_unit.dart' as _i17;
|
||||
import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i16;
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i10;
|
||||
import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i15;
|
||||
import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'
|
||||
as _i7;
|
||||
import 'package:stackwallet/utilities/prefs.dart' as _i12;
|
||||
import 'package:tuple/tuple.dart' as _i10;
|
||||
import 'package:stackwallet/utilities/prefs.dart' as _i13;
|
||||
import 'package:tuple/tuple.dart' as _i11;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
|
@ -87,10 +91,21 @@ class _FakeSecureStorageInterface_4 extends _i1.SmartFake
|
|||
);
|
||||
}
|
||||
|
||||
class _FakeInternetAddress_5 extends _i1.SmartFake
|
||||
implements _i8.InternetAddress {
|
||||
_FakeInternetAddress_5(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
}
|
||||
|
||||
/// A class which mocks [Wallets].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockWallets extends _i1.Mock implements _i8.Wallets {
|
||||
class MockWallets extends _i1.Mock implements _i9.Wallets {
|
||||
MockWallets() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
@ -157,7 +172,7 @@ class MockWallets extends _i1.Mock implements _i8.Wallets {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
List<String> getWalletIdsFor({required _i9.Coin? coin}) =>
|
||||
List<String> getWalletIdsFor({required _i10.Coin? coin}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getWalletIdsFor,
|
||||
|
@ -167,20 +182,20 @@ class MockWallets extends _i1.Mock implements _i8.Wallets {
|
|||
returnValue: <String>[],
|
||||
) as List<String>);
|
||||
@override
|
||||
List<_i10.Tuple2<_i9.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>>
|
||||
List<_i11.Tuple2<_i10.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>>
|
||||
getManagerProvidersByCoin() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getManagerProvidersByCoin,
|
||||
[],
|
||||
),
|
||||
returnValue: <_i10.Tuple2<_i9.Coin,
|
||||
returnValue: <_i11.Tuple2<_i10.Coin,
|
||||
List<_i5.ChangeNotifierProvider<_i6.Manager>>>>[],
|
||||
) as List<
|
||||
_i10.Tuple2<_i9.Coin,
|
||||
_i11.Tuple2<_i10.Coin,
|
||||
List<_i5.ChangeNotifierProvider<_i6.Manager>>>>);
|
||||
@override
|
||||
List<_i5.ChangeNotifierProvider<_i6.Manager>> getManagerProvidersForCoin(
|
||||
_i9.Coin? coin) =>
|
||||
_i10.Coin? coin) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getManagerProvidersForCoin,
|
||||
|
@ -244,17 +259,17 @@ class MockWallets extends _i1.Mock implements _i8.Wallets {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i11.Future<void> load(_i12.Prefs? prefs) => (super.noSuchMethod(
|
||||
_i12.Future<void> load(_i13.Prefs? prefs) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#load,
|
||||
[prefs],
|
||||
),
|
||||
returnValue: _i11.Future<void>.value(),
|
||||
returnValueForMissingStub: _i11.Future<void>.value(),
|
||||
) as _i11.Future<void>);
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
@override
|
||||
_i11.Future<void> loadAfterStackRestore(
|
||||
_i12.Prefs? prefs,
|
||||
_i12.Future<void> loadAfterStackRestore(
|
||||
_i13.Prefs? prefs,
|
||||
List<_i6.Manager>? managers,
|
||||
) =>
|
||||
(super.noSuchMethod(
|
||||
|
@ -265,11 +280,11 @@ class MockWallets extends _i1.Mock implements _i8.Wallets {
|
|||
managers,
|
||||
],
|
||||
),
|
||||
returnValue: _i11.Future<void>.value(),
|
||||
returnValueForMissingStub: _i11.Future<void>.value(),
|
||||
) as _i11.Future<void>);
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
@override
|
||||
void addListener(_i13.VoidCallback? listener) => super.noSuchMethod(
|
||||
void addListener(_i14.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addListener,
|
||||
[listener],
|
||||
|
@ -277,7 +292,7 @@ class MockWallets extends _i1.Mock implements _i8.Wallets {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
void removeListener(_i13.VoidCallback? listener) => super.noSuchMethod(
|
||||
void removeListener(_i14.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#removeListener,
|
||||
[listener],
|
||||
|
@ -297,7 +312,7 @@ class MockWallets extends _i1.Mock implements _i8.Wallets {
|
|||
/// A class which mocks [Prefs].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockPrefs extends _i1.Mock implements _i12.Prefs {
|
||||
class MockPrefs extends _i1.Mock implements _i13.Prefs {
|
||||
MockPrefs() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
@ -353,12 +368,12 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i14.SyncingType get syncType => (super.noSuchMethod(
|
||||
_i15.SyncingType get syncType => (super.noSuchMethod(
|
||||
Invocation.getter(#syncType),
|
||||
returnValue: _i14.SyncingType.currentWalletOnly,
|
||||
) as _i14.SyncingType);
|
||||
returnValue: _i15.SyncingType.currentWalletOnly,
|
||||
) as _i15.SyncingType);
|
||||
@override
|
||||
set syncType(_i14.SyncingType? syncType) => super.noSuchMethod(
|
||||
set syncType(_i15.SyncingType? syncType) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#syncType,
|
||||
syncType,
|
||||
|
@ -470,6 +485,19 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get torKillswitch => (super.noSuchMethod(
|
||||
Invocation.getter(#torKillswitch),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
set torKillswitch(bool? torKillswitch) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#torKillswitch,
|
||||
torKillswitch,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get showTestNetCoins => (super.noSuchMethod(
|
||||
Invocation.getter(#showTestNetCoins),
|
||||
returnValue: false,
|
||||
|
@ -504,12 +532,12 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i15.BackupFrequencyType get backupFrequencyType => (super.noSuchMethod(
|
||||
_i16.BackupFrequencyType get backupFrequencyType => (super.noSuchMethod(
|
||||
Invocation.getter(#backupFrequencyType),
|
||||
returnValue: _i15.BackupFrequencyType.everyTenMinutes,
|
||||
) as _i15.BackupFrequencyType);
|
||||
returnValue: _i16.BackupFrequencyType.everyTenMinutes,
|
||||
) as _i16.BackupFrequencyType);
|
||||
@override
|
||||
set backupFrequencyType(_i15.BackupFrequencyType? backupFrequencyType) =>
|
||||
set backupFrequencyType(_i16.BackupFrequencyType? backupFrequencyType) =>
|
||||
super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#backupFrequencyType,
|
||||
|
@ -642,66 +670,79 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get useTor => (super.noSuchMethod(
|
||||
Invocation.getter(#useTor),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
set useTor(bool? useTor) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#useTor,
|
||||
useTor,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
_i11.Future<void> init() => (super.noSuchMethod(
|
||||
_i12.Future<void> init() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#init,
|
||||
[],
|
||||
),
|
||||
returnValue: _i11.Future<void>.value(),
|
||||
returnValueForMissingStub: _i11.Future<void>.value(),
|
||||
) as _i11.Future<void>);
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
@override
|
||||
_i11.Future<void> incrementCurrentNotificationIndex() => (super.noSuchMethod(
|
||||
_i12.Future<void> incrementCurrentNotificationIndex() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#incrementCurrentNotificationIndex,
|
||||
[],
|
||||
),
|
||||
returnValue: _i11.Future<void>.value(),
|
||||
returnValueForMissingStub: _i11.Future<void>.value(),
|
||||
) as _i11.Future<void>);
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
@override
|
||||
_i11.Future<bool> isExternalCallsSet() => (super.noSuchMethod(
|
||||
_i12.Future<bool> isExternalCallsSet() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#isExternalCallsSet,
|
||||
[],
|
||||
),
|
||||
returnValue: _i11.Future<bool>.value(false),
|
||||
) as _i11.Future<bool>);
|
||||
returnValue: _i12.Future<bool>.value(false),
|
||||
) as _i12.Future<bool>);
|
||||
@override
|
||||
_i11.Future<void> saveUserID(String? userId) => (super.noSuchMethod(
|
||||
_i12.Future<void> saveUserID(String? userId) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#saveUserID,
|
||||
[userId],
|
||||
),
|
||||
returnValue: _i11.Future<void>.value(),
|
||||
returnValueForMissingStub: _i11.Future<void>.value(),
|
||||
) as _i11.Future<void>);
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
@override
|
||||
_i11.Future<void> saveSignupEpoch(int? signupEpoch) => (super.noSuchMethod(
|
||||
_i12.Future<void> saveSignupEpoch(int? signupEpoch) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#saveSignupEpoch,
|
||||
[signupEpoch],
|
||||
),
|
||||
returnValue: _i11.Future<void>.value(),
|
||||
returnValueForMissingStub: _i11.Future<void>.value(),
|
||||
) as _i11.Future<void>);
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
@override
|
||||
_i16.AmountUnit amountUnit(_i9.Coin? coin) => (super.noSuchMethod(
|
||||
_i17.AmountUnit amountUnit(_i10.Coin? coin) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#amountUnit,
|
||||
[coin],
|
||||
),
|
||||
returnValue: _i16.AmountUnit.normal,
|
||||
) as _i16.AmountUnit);
|
||||
returnValue: _i17.AmountUnit.normal,
|
||||
) as _i17.AmountUnit);
|
||||
@override
|
||||
void updateAmountUnit({
|
||||
required _i9.Coin? coin,
|
||||
required _i16.AmountUnit? amountUnit,
|
||||
required _i10.Coin? coin,
|
||||
required _i17.AmountUnit? amountUnit,
|
||||
}) =>
|
||||
super.noSuchMethod(
|
||||
Invocation.method(
|
||||
|
@ -715,7 +756,7 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
int maxDecimals(_i9.Coin? coin) => (super.noSuchMethod(
|
||||
int maxDecimals(_i10.Coin? coin) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#maxDecimals,
|
||||
[coin],
|
||||
|
@ -724,7 +765,7 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs {
|
|||
) as int);
|
||||
@override
|
||||
void updateMaxDecimals({
|
||||
required _i9.Coin? coin,
|
||||
required _i10.Coin? coin,
|
||||
required int? maxDecimals,
|
||||
}) =>
|
||||
super.noSuchMethod(
|
||||
|
@ -739,7 +780,7 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
void addListener(_i13.VoidCallback? listener) => super.noSuchMethod(
|
||||
void addListener(_i14.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addListener,
|
||||
[listener],
|
||||
|
@ -747,7 +788,7 @@ class MockPrefs extends _i1.Mock implements _i12.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
void removeListener(_i13.VoidCallback? listener) => super.noSuchMethod(
|
||||
void removeListener(_i14.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#removeListener,
|
||||
[listener],
|
||||
|
@ -789,33 +830,33 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService {
|
|||
),
|
||||
) as _i7.SecureStorageInterface);
|
||||
@override
|
||||
List<_i17.NodeModel> get primaryNodes => (super.noSuchMethod(
|
||||
List<_i18.NodeModel> get primaryNodes => (super.noSuchMethod(
|
||||
Invocation.getter(#primaryNodes),
|
||||
returnValue: <_i17.NodeModel>[],
|
||||
) as List<_i17.NodeModel>);
|
||||
returnValue: <_i18.NodeModel>[],
|
||||
) as List<_i18.NodeModel>);
|
||||
@override
|
||||
List<_i17.NodeModel> get nodes => (super.noSuchMethod(
|
||||
List<_i18.NodeModel> get nodes => (super.noSuchMethod(
|
||||
Invocation.getter(#nodes),
|
||||
returnValue: <_i17.NodeModel>[],
|
||||
) as List<_i17.NodeModel>);
|
||||
returnValue: <_i18.NodeModel>[],
|
||||
) as List<_i18.NodeModel>);
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
_i11.Future<void> updateDefaults() => (super.noSuchMethod(
|
||||
_i12.Future<void> updateDefaults() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#updateDefaults,
|
||||
[],
|
||||
),
|
||||
returnValue: _i11.Future<void>.value(),
|
||||
returnValueForMissingStub: _i11.Future<void>.value(),
|
||||
) as _i11.Future<void>);
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
@override
|
||||
_i11.Future<void> setPrimaryNodeFor({
|
||||
required _i9.Coin? coin,
|
||||
required _i17.NodeModel? node,
|
||||
_i12.Future<void> setPrimaryNodeFor({
|
||||
required _i10.Coin? coin,
|
||||
required _i18.NodeModel? node,
|
||||
bool? shouldNotifyListeners = false,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
|
@ -828,44 +869,44 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService {
|
|||
#shouldNotifyListeners: shouldNotifyListeners,
|
||||
},
|
||||
),
|
||||
returnValue: _i11.Future<void>.value(),
|
||||
returnValueForMissingStub: _i11.Future<void>.value(),
|
||||
) as _i11.Future<void>);
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
@override
|
||||
_i17.NodeModel? getPrimaryNodeFor({required _i9.Coin? coin}) =>
|
||||
_i18.NodeModel? getPrimaryNodeFor({required _i10.Coin? coin}) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
#getPrimaryNodeFor,
|
||||
[],
|
||||
{#coin: coin},
|
||||
)) as _i17.NodeModel?);
|
||||
)) as _i18.NodeModel?);
|
||||
@override
|
||||
List<_i17.NodeModel> getNodesFor(_i9.Coin? coin) => (super.noSuchMethod(
|
||||
List<_i18.NodeModel> getNodesFor(_i10.Coin? coin) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getNodesFor,
|
||||
[coin],
|
||||
),
|
||||
returnValue: <_i17.NodeModel>[],
|
||||
) as List<_i17.NodeModel>);
|
||||
returnValue: <_i18.NodeModel>[],
|
||||
) as List<_i18.NodeModel>);
|
||||
@override
|
||||
_i17.NodeModel? getNodeById({required String? id}) =>
|
||||
_i18.NodeModel? getNodeById({required String? id}) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
#getNodeById,
|
||||
[],
|
||||
{#id: id},
|
||||
)) as _i17.NodeModel?);
|
||||
)) as _i18.NodeModel?);
|
||||
@override
|
||||
List<_i17.NodeModel> failoverNodesFor({required _i9.Coin? coin}) =>
|
||||
List<_i18.NodeModel> failoverNodesFor({required _i10.Coin? coin}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#failoverNodesFor,
|
||||
[],
|
||||
{#coin: coin},
|
||||
),
|
||||
returnValue: <_i17.NodeModel>[],
|
||||
) as List<_i17.NodeModel>);
|
||||
returnValue: <_i18.NodeModel>[],
|
||||
) as List<_i18.NodeModel>);
|
||||
@override
|
||||
_i11.Future<void> add(
|
||||
_i17.NodeModel? node,
|
||||
_i12.Future<void> add(
|
||||
_i18.NodeModel? node,
|
||||
String? password,
|
||||
bool? shouldNotifyListeners,
|
||||
) =>
|
||||
|
@ -878,11 +919,11 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService {
|
|||
shouldNotifyListeners,
|
||||
],
|
||||
),
|
||||
returnValue: _i11.Future<void>.value(),
|
||||
returnValueForMissingStub: _i11.Future<void>.value(),
|
||||
) as _i11.Future<void>);
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
@override
|
||||
_i11.Future<void> delete(
|
||||
_i12.Future<void> delete(
|
||||
String? id,
|
||||
bool? shouldNotifyListeners,
|
||||
) =>
|
||||
|
@ -894,11 +935,11 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService {
|
|||
shouldNotifyListeners,
|
||||
],
|
||||
),
|
||||
returnValue: _i11.Future<void>.value(),
|
||||
returnValueForMissingStub: _i11.Future<void>.value(),
|
||||
) as _i11.Future<void>);
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
@override
|
||||
_i11.Future<void> setEnabledState(
|
||||
_i12.Future<void> setEnabledState(
|
||||
String? id,
|
||||
bool? enabled,
|
||||
bool? shouldNotifyListeners,
|
||||
|
@ -912,12 +953,12 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService {
|
|||
shouldNotifyListeners,
|
||||
],
|
||||
),
|
||||
returnValue: _i11.Future<void>.value(),
|
||||
returnValueForMissingStub: _i11.Future<void>.value(),
|
||||
) as _i11.Future<void>);
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
@override
|
||||
_i11.Future<void> edit(
|
||||
_i17.NodeModel? editedNode,
|
||||
_i12.Future<void> edit(
|
||||
_i18.NodeModel? editedNode,
|
||||
String? password,
|
||||
bool? shouldNotifyListeners,
|
||||
) =>
|
||||
|
@ -930,20 +971,20 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService {
|
|||
shouldNotifyListeners,
|
||||
],
|
||||
),
|
||||
returnValue: _i11.Future<void>.value(),
|
||||
returnValueForMissingStub: _i11.Future<void>.value(),
|
||||
) as _i11.Future<void>);
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
@override
|
||||
_i11.Future<void> updateCommunityNodes() => (super.noSuchMethod(
|
||||
_i12.Future<void> updateCommunityNodes() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#updateCommunityNodes,
|
||||
[],
|
||||
),
|
||||
returnValue: _i11.Future<void>.value(),
|
||||
returnValueForMissingStub: _i11.Future<void>.value(),
|
||||
) as _i11.Future<void>);
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
@override
|
||||
void addListener(_i13.VoidCallback? listener) => super.noSuchMethod(
|
||||
void addListener(_i14.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#addListener,
|
||||
[listener],
|
||||
|
@ -951,7 +992,7 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
void removeListener(_i13.VoidCallback? listener) => super.noSuchMethod(
|
||||
void removeListener(_i14.VoidCallback? listener) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#removeListener,
|
||||
[listener],
|
||||
|
@ -975,3 +1016,52 @@ class MockNodeService extends _i1.Mock implements _i3.NodeService {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
}
|
||||
|
||||
/// A class which mocks [TorService].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockTorService extends _i1.Mock implements _i19.TorService {
|
||||
MockTorService() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
bool get enabled => (super.noSuchMethod(
|
||||
Invocation.getter(#enabled),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
_i20.TorConnectionStatus get status => (super.noSuchMethod(
|
||||
Invocation.getter(#status),
|
||||
returnValue: _i20.TorConnectionStatus.disconnected,
|
||||
) as _i20.TorConnectionStatus);
|
||||
@override
|
||||
({_i8.InternetAddress host, int port}) get proxyInfo => (super.noSuchMethod(
|
||||
Invocation.getter(#proxyInfo),
|
||||
returnValue: (
|
||||
host: _FakeInternetAddress_5(
|
||||
this,
|
||||
Invocation.getter(#proxyInfo),
|
||||
),
|
||||
port: 0
|
||||
),
|
||||
) as ({_i8.InternetAddress host, int port}));
|
||||
@override
|
||||
_i12.Future<void> start() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#start,
|
||||
[],
|
||||
),
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
@override
|
||||
_i12.Future<void> stop() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#stop,
|
||||
[],
|
||||
),
|
||||
returnValue: _i12.Future<void>.value(),
|
||||
returnValueForMissingStub: _i12.Future<void>.value(),
|
||||
) as _i12.Future<void>);
|
||||
}
|
||||
|
|
|
@ -2329,6 +2329,19 @@ class MockPrefs extends _i1.Mock implements _i20.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get torKillswitch => (super.noSuchMethod(
|
||||
Invocation.getter(#torKillswitch),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
set torKillswitch(bool? torKillswitch) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#torKillswitch,
|
||||
torKillswitch,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get showTestNetCoins => (super.noSuchMethod(
|
||||
Invocation.getter(#showTestNetCoins),
|
||||
returnValue: false,
|
||||
|
@ -2501,6 +2514,19 @@ class MockPrefs extends _i1.Mock implements _i20.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get useTor => (super.noSuchMethod(
|
||||
Invocation.getter(#useTor),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
set useTor(bool? useTor) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#useTor,
|
||||
useTor,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get hasListeners => (super.noSuchMethod(
|
||||
Invocation.getter(#hasListeners),
|
||||
returnValue: false,
|
||||
|
|
Loading…
Reference in a new issue