mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 03:49:22 +00:00
more build runner mocks regen
This commit is contained in:
parent
932937f3a1
commit
9addf101a9
11 changed files with 659 additions and 209 deletions
|
@ -302,14 +302,14 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient {
|
||||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
) as _i5.Future<Map<String, dynamic>>);
|
) as _i5.Future<Map<String, dynamic>>);
|
||||||
@override
|
@override
|
||||||
_i5.Future<Map<String, dynamic>> getAnonymitySet({
|
_i5.Future<Map<String, dynamic>> getLelantusAnonymitySet({
|
||||||
String? groupId = r'1',
|
String? groupId = r'1',
|
||||||
String? blockhash = r'',
|
String? blockhash = r'',
|
||||||
String? requestID,
|
String? requestID,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getAnonymitySet,
|
#getLelantusAnonymitySet,
|
||||||
[],
|
[],
|
||||||
{
|
{
|
||||||
#groupId: groupId,
|
#groupId: groupId,
|
||||||
|
@ -321,13 +321,13 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient {
|
||||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
) as _i5.Future<Map<String, dynamic>>);
|
) as _i5.Future<Map<String, dynamic>>);
|
||||||
@override
|
@override
|
||||||
_i5.Future<dynamic> getMintData({
|
_i5.Future<dynamic> getLelantusMintData({
|
||||||
dynamic mints,
|
dynamic mints,
|
||||||
String? requestID,
|
String? requestID,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getMintData,
|
#getLelantusMintData,
|
||||||
[],
|
[],
|
||||||
{
|
{
|
||||||
#mints: mints,
|
#mints: mints,
|
||||||
|
@ -337,13 +337,13 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient {
|
||||||
returnValue: _i5.Future<dynamic>.value(),
|
returnValue: _i5.Future<dynamic>.value(),
|
||||||
) as _i5.Future<dynamic>);
|
) as _i5.Future<dynamic>);
|
||||||
@override
|
@override
|
||||||
_i5.Future<Map<String, dynamic>> getUsedCoinSerials({
|
_i5.Future<Map<String, dynamic>> getLelantusUsedCoinSerials({
|
||||||
String? requestID,
|
String? requestID,
|
||||||
required int? startNumber,
|
required int? startNumber,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getUsedCoinSerials,
|
#getLelantusUsedCoinSerials,
|
||||||
[],
|
[],
|
||||||
{
|
{
|
||||||
#requestID: requestID,
|
#requestID: requestID,
|
||||||
|
@ -354,9 +354,73 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient {
|
||||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
) as _i5.Future<Map<String, dynamic>>);
|
) as _i5.Future<Map<String, dynamic>>);
|
||||||
@override
|
@override
|
||||||
_i5.Future<int> getLatestCoinId({String? requestID}) => (super.noSuchMethod(
|
_i5.Future<int> getLelantusLatestCoinId({String? requestID}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getLatestCoinId,
|
#getLelantusLatestCoinId,
|
||||||
|
[],
|
||||||
|
{#requestID: requestID},
|
||||||
|
),
|
||||||
|
returnValue: _i5.Future<int>.value(0),
|
||||||
|
) as _i5.Future<int>);
|
||||||
|
@override
|
||||||
|
_i5.Future<Map<String, dynamic>> getSparkAnonymitySet({
|
||||||
|
String? coinGroupId = r'1',
|
||||||
|
String? startBlockHash = r'',
|
||||||
|
String? requestID,
|
||||||
|
}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkAnonymitySet,
|
||||||
|
[],
|
||||||
|
{
|
||||||
|
#coinGroupId: coinGroupId,
|
||||||
|
#startBlockHash: startBlockHash,
|
||||||
|
#requestID: requestID,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
returnValue:
|
||||||
|
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
|
) as _i5.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
|
_i5.Future<Map<String, dynamic>> getSparkUsedCoinsTags({
|
||||||
|
String? requestID,
|
||||||
|
required int? startNumber,
|
||||||
|
}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkUsedCoinsTags,
|
||||||
|
[],
|
||||||
|
{
|
||||||
|
#requestID: requestID,
|
||||||
|
#startNumber: startNumber,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
returnValue:
|
||||||
|
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
|
) as _i5.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
|
_i5.Future<Map<String, dynamic>> getSparkMintMetaData({
|
||||||
|
String? requestID,
|
||||||
|
required List<String>? sparkCoinHashes,
|
||||||
|
}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkMintMetaData,
|
||||||
|
[],
|
||||||
|
{
|
||||||
|
#requestID: requestID,
|
||||||
|
#sparkCoinHashes: sparkCoinHashes,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
returnValue:
|
||||||
|
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
|
) as _i5.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
|
_i5.Future<int> getSparkLatestCoinId({String? requestID}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkLatestCoinId,
|
||||||
[],
|
[],
|
||||||
{#requestID: requestID},
|
{#requestID: requestID},
|
||||||
),
|
),
|
||||||
|
|
|
@ -826,7 +826,7 @@ void main() {
|
||||||
torService: torService,
|
torService: torService,
|
||||||
failovers: []);
|
failovers: []);
|
||||||
|
|
||||||
final result = await client.getAnonymitySet(
|
final result = await client.getLelantusAnonymitySet(
|
||||||
groupId: "1", blockhash: "", requestID: "some requestId");
|
groupId: "1", blockhash: "", requestID: "some requestId");
|
||||||
|
|
||||||
expect(result, GetAnonymitySetSampleData.data);
|
expect(result, GetAnonymitySetSampleData.data);
|
||||||
|
@ -862,8 +862,8 @@ void main() {
|
||||||
failovers: []);
|
failovers: []);
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
() =>
|
() => client.getLelantusAnonymitySet(
|
||||||
client.getAnonymitySet(groupId: "1", requestID: "some requestId"),
|
groupId: "1", requestID: "some requestId"),
|
||||||
throwsA(isA<Exception>()));
|
throwsA(isA<Exception>()));
|
||||||
|
|
||||||
verify(mockPrefs.wifiOnly).called(1);
|
verify(mockPrefs.wifiOnly).called(1);
|
||||||
|
@ -903,7 +903,7 @@ void main() {
|
||||||
torService: torService,
|
torService: torService,
|
||||||
failovers: []);
|
failovers: []);
|
||||||
|
|
||||||
final result = await client.getMintData(
|
final result = await client.getLelantusMintData(
|
||||||
mints: "some mints", requestID: "some requestId");
|
mints: "some mints", requestID: "some requestId");
|
||||||
|
|
||||||
expect(result, "mint meta data");
|
expect(result, "mint meta data");
|
||||||
|
@ -939,7 +939,7 @@ void main() {
|
||||||
failovers: []);
|
failovers: []);
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
() => client.getMintData(
|
() => client.getLelantusMintData(
|
||||||
mints: "some mints", requestID: "some requestId"),
|
mints: "some mints", requestID: "some requestId"),
|
||||||
throwsA(isA<Exception>()));
|
throwsA(isA<Exception>()));
|
||||||
|
|
||||||
|
@ -980,7 +980,7 @@ void main() {
|
||||||
torService: torService,
|
torService: torService,
|
||||||
failovers: []);
|
failovers: []);
|
||||||
|
|
||||||
final result = await client.getUsedCoinSerials(
|
final result = await client.getLelantusUsedCoinSerials(
|
||||||
requestID: "some requestId", startNumber: 0);
|
requestID: "some requestId", startNumber: 0);
|
||||||
|
|
||||||
expect(result, GetUsedSerialsSampleData.serials);
|
expect(result, GetUsedSerialsSampleData.serials);
|
||||||
|
@ -1016,7 +1016,7 @@ void main() {
|
||||||
failovers: []);
|
failovers: []);
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
() => client.getUsedCoinSerials(
|
() => client.getLelantusUsedCoinSerials(
|
||||||
requestID: "some requestId", startNumber: 0),
|
requestID: "some requestId", startNumber: 0),
|
||||||
throwsA(isA<Exception>()));
|
throwsA(isA<Exception>()));
|
||||||
|
|
||||||
|
@ -1057,7 +1057,8 @@ void main() {
|
||||||
torService: torService,
|
torService: torService,
|
||||||
failovers: []);
|
failovers: []);
|
||||||
|
|
||||||
final result = await client.getLatestCoinId(requestID: "some requestId");
|
final result =
|
||||||
|
await client.getLelantusLatestCoinId(requestID: "some requestId");
|
||||||
|
|
||||||
expect(result, 1);
|
expect(result, 1);
|
||||||
|
|
||||||
|
@ -1092,7 +1093,7 @@ void main() {
|
||||||
failovers: []);
|
failovers: []);
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
() => client.getLatestCoinId(
|
() => client.getLelantusLatestCoinId(
|
||||||
requestID: "some requestId",
|
requestID: "some requestId",
|
||||||
),
|
),
|
||||||
throwsA(isA<Exception>()));
|
throwsA(isA<Exception>()));
|
||||||
|
@ -1134,7 +1135,7 @@ void main() {
|
||||||
torService: torService,
|
torService: torService,
|
||||||
failovers: []);
|
failovers: []);
|
||||||
|
|
||||||
final result = await client.getAnonymitySet(
|
final result = await client.getLelantusAnonymitySet(
|
||||||
groupId: "1", blockhash: "", requestID: "some requestId");
|
groupId: "1", blockhash: "", requestID: "some requestId");
|
||||||
|
|
||||||
expect(result, GetAnonymitySetSampleData.data);
|
expect(result, GetAnonymitySetSampleData.data);
|
||||||
|
@ -1170,7 +1171,7 @@ void main() {
|
||||||
failovers: []);
|
failovers: []);
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
() => client.getAnonymitySet(
|
() => client.getLelantusAnonymitySet(
|
||||||
groupId: "1",
|
groupId: "1",
|
||||||
requestID: "some requestId",
|
requestID: "some requestId",
|
||||||
),
|
),
|
||||||
|
@ -1213,7 +1214,7 @@ void main() {
|
||||||
torService: torService,
|
torService: torService,
|
||||||
failovers: []);
|
failovers: []);
|
||||||
|
|
||||||
final result = await client.getMintData(
|
final result = await client.getLelantusMintData(
|
||||||
mints: "some mints", requestID: "some requestId");
|
mints: "some mints", requestID: "some requestId");
|
||||||
|
|
||||||
expect(result, "mint meta data");
|
expect(result, "mint meta data");
|
||||||
|
@ -1249,7 +1250,7 @@ void main() {
|
||||||
failovers: []);
|
failovers: []);
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
() => client.getMintData(
|
() => client.getLelantusMintData(
|
||||||
mints: "some mints",
|
mints: "some mints",
|
||||||
requestID: "some requestId",
|
requestID: "some requestId",
|
||||||
),
|
),
|
||||||
|
@ -1292,7 +1293,7 @@ void main() {
|
||||||
torService: torService,
|
torService: torService,
|
||||||
failovers: []);
|
failovers: []);
|
||||||
|
|
||||||
final result = await client.getUsedCoinSerials(
|
final result = await client.getLelantusUsedCoinSerials(
|
||||||
requestID: "some requestId", startNumber: 0);
|
requestID: "some requestId", startNumber: 0);
|
||||||
|
|
||||||
expect(result, GetUsedSerialsSampleData.serials);
|
expect(result, GetUsedSerialsSampleData.serials);
|
||||||
|
@ -1328,7 +1329,7 @@ void main() {
|
||||||
failovers: []);
|
failovers: []);
|
||||||
|
|
||||||
expect(
|
expect(
|
||||||
() => client.getUsedCoinSerials(
|
() => client.getLelantusUsedCoinSerials(
|
||||||
requestID: "some requestId", startNumber: 0),
|
requestID: "some requestId", startNumber: 0),
|
||||||
throwsA(isA<Exception>()));
|
throwsA(isA<Exception>()));
|
||||||
|
|
||||||
|
@ -1369,7 +1370,8 @@ void main() {
|
||||||
torService: torService,
|
torService: torService,
|
||||||
failovers: []);
|
failovers: []);
|
||||||
|
|
||||||
final result = await client.getLatestCoinId(requestID: "some requestId");
|
final result =
|
||||||
|
await client.getLelantusLatestCoinId(requestID: "some requestId");
|
||||||
|
|
||||||
expect(result, 1);
|
expect(result, 1);
|
||||||
|
|
||||||
|
@ -1403,7 +1405,7 @@ void main() {
|
||||||
torService: torService,
|
torService: torService,
|
||||||
failovers: []);
|
failovers: []);
|
||||||
|
|
||||||
expect(() => client.getLatestCoinId(requestID: "some requestId"),
|
expect(() => client.getLelantusLatestCoinId(requestID: "some requestId"),
|
||||||
throwsA(isA<Exception>()));
|
throwsA(isA<Exception>()));
|
||||||
|
|
||||||
verify(mockPrefs.wifiOnly).called(1);
|
verify(mockPrefs.wifiOnly).called(1);
|
||||||
|
|
|
@ -300,14 +300,14 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
) as _i4.Future<Map<String, dynamic>>);
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
@override
|
@override
|
||||||
_i4.Future<Map<String, dynamic>> getAnonymitySet({
|
_i4.Future<Map<String, dynamic>> getLelantusAnonymitySet({
|
||||||
String? groupId = r'1',
|
String? groupId = r'1',
|
||||||
String? blockhash = r'',
|
String? blockhash = r'',
|
||||||
String? requestID,
|
String? requestID,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getAnonymitySet,
|
#getLelantusAnonymitySet,
|
||||||
[],
|
[],
|
||||||
{
|
{
|
||||||
#groupId: groupId,
|
#groupId: groupId,
|
||||||
|
@ -319,13 +319,13 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
) as _i4.Future<Map<String, dynamic>>);
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
@override
|
@override
|
||||||
_i4.Future<dynamic> getMintData({
|
_i4.Future<dynamic> getLelantusMintData({
|
||||||
dynamic mints,
|
dynamic mints,
|
||||||
String? requestID,
|
String? requestID,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getMintData,
|
#getLelantusMintData,
|
||||||
[],
|
[],
|
||||||
{
|
{
|
||||||
#mints: mints,
|
#mints: mints,
|
||||||
|
@ -335,13 +335,13 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
returnValue: _i4.Future<dynamic>.value(),
|
returnValue: _i4.Future<dynamic>.value(),
|
||||||
) as _i4.Future<dynamic>);
|
) as _i4.Future<dynamic>);
|
||||||
@override
|
@override
|
||||||
_i4.Future<Map<String, dynamic>> getUsedCoinSerials({
|
_i4.Future<Map<String, dynamic>> getLelantusUsedCoinSerials({
|
||||||
String? requestID,
|
String? requestID,
|
||||||
required int? startNumber,
|
required int? startNumber,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getUsedCoinSerials,
|
#getLelantusUsedCoinSerials,
|
||||||
[],
|
[],
|
||||||
{
|
{
|
||||||
#requestID: requestID,
|
#requestID: requestID,
|
||||||
|
@ -352,9 +352,73 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
) as _i4.Future<Map<String, dynamic>>);
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
@override
|
@override
|
||||||
_i4.Future<int> getLatestCoinId({String? requestID}) => (super.noSuchMethod(
|
_i4.Future<int> getLelantusLatestCoinId({String? requestID}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getLatestCoinId,
|
#getLelantusLatestCoinId,
|
||||||
|
[],
|
||||||
|
{#requestID: requestID},
|
||||||
|
),
|
||||||
|
returnValue: _i4.Future<int>.value(0),
|
||||||
|
) as _i4.Future<int>);
|
||||||
|
@override
|
||||||
|
_i4.Future<Map<String, dynamic>> getSparkAnonymitySet({
|
||||||
|
String? coinGroupId = r'1',
|
||||||
|
String? startBlockHash = r'',
|
||||||
|
String? requestID,
|
||||||
|
}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkAnonymitySet,
|
||||||
|
[],
|
||||||
|
{
|
||||||
|
#coinGroupId: coinGroupId,
|
||||||
|
#startBlockHash: startBlockHash,
|
||||||
|
#requestID: requestID,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
returnValue:
|
||||||
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
|
_i4.Future<Map<String, dynamic>> getSparkUsedCoinsTags({
|
||||||
|
String? requestID,
|
||||||
|
required int? startNumber,
|
||||||
|
}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkUsedCoinsTags,
|
||||||
|
[],
|
||||||
|
{
|
||||||
|
#requestID: requestID,
|
||||||
|
#startNumber: startNumber,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
returnValue:
|
||||||
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
|
_i4.Future<Map<String, dynamic>> getSparkMintMetaData({
|
||||||
|
String? requestID,
|
||||||
|
required List<String>? sparkCoinHashes,
|
||||||
|
}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkMintMetaData,
|
||||||
|
[],
|
||||||
|
{
|
||||||
|
#requestID: requestID,
|
||||||
|
#sparkCoinHashes: sparkCoinHashes,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
returnValue:
|
||||||
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
|
_i4.Future<int> getSparkLatestCoinId({String? requestID}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkLatestCoinId,
|
||||||
[],
|
[],
|
||||||
{#requestID: requestID},
|
{#requestID: requestID},
|
||||||
),
|
),
|
||||||
|
|
|
@ -300,14 +300,14 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
) as _i4.Future<Map<String, dynamic>>);
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
@override
|
@override
|
||||||
_i4.Future<Map<String, dynamic>> getAnonymitySet({
|
_i4.Future<Map<String, dynamic>> getLelantusAnonymitySet({
|
||||||
String? groupId = r'1',
|
String? groupId = r'1',
|
||||||
String? blockhash = r'',
|
String? blockhash = r'',
|
||||||
String? requestID,
|
String? requestID,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getAnonymitySet,
|
#getLelantusAnonymitySet,
|
||||||
[],
|
[],
|
||||||
{
|
{
|
||||||
#groupId: groupId,
|
#groupId: groupId,
|
||||||
|
@ -319,13 +319,13 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
) as _i4.Future<Map<String, dynamic>>);
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
@override
|
@override
|
||||||
_i4.Future<dynamic> getMintData({
|
_i4.Future<dynamic> getLelantusMintData({
|
||||||
dynamic mints,
|
dynamic mints,
|
||||||
String? requestID,
|
String? requestID,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getMintData,
|
#getLelantusMintData,
|
||||||
[],
|
[],
|
||||||
{
|
{
|
||||||
#mints: mints,
|
#mints: mints,
|
||||||
|
@ -335,13 +335,13 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
returnValue: _i4.Future<dynamic>.value(),
|
returnValue: _i4.Future<dynamic>.value(),
|
||||||
) as _i4.Future<dynamic>);
|
) as _i4.Future<dynamic>);
|
||||||
@override
|
@override
|
||||||
_i4.Future<Map<String, dynamic>> getUsedCoinSerials({
|
_i4.Future<Map<String, dynamic>> getLelantusUsedCoinSerials({
|
||||||
String? requestID,
|
String? requestID,
|
||||||
required int? startNumber,
|
required int? startNumber,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getUsedCoinSerials,
|
#getLelantusUsedCoinSerials,
|
||||||
[],
|
[],
|
||||||
{
|
{
|
||||||
#requestID: requestID,
|
#requestID: requestID,
|
||||||
|
@ -352,9 +352,73 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
) as _i4.Future<Map<String, dynamic>>);
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
@override
|
@override
|
||||||
_i4.Future<int> getLatestCoinId({String? requestID}) => (super.noSuchMethod(
|
_i4.Future<int> getLelantusLatestCoinId({String? requestID}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getLatestCoinId,
|
#getLelantusLatestCoinId,
|
||||||
|
[],
|
||||||
|
{#requestID: requestID},
|
||||||
|
),
|
||||||
|
returnValue: _i4.Future<int>.value(0),
|
||||||
|
) as _i4.Future<int>);
|
||||||
|
@override
|
||||||
|
_i4.Future<Map<String, dynamic>> getSparkAnonymitySet({
|
||||||
|
String? coinGroupId = r'1',
|
||||||
|
String? startBlockHash = r'',
|
||||||
|
String? requestID,
|
||||||
|
}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkAnonymitySet,
|
||||||
|
[],
|
||||||
|
{
|
||||||
|
#coinGroupId: coinGroupId,
|
||||||
|
#startBlockHash: startBlockHash,
|
||||||
|
#requestID: requestID,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
returnValue:
|
||||||
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
|
_i4.Future<Map<String, dynamic>> getSparkUsedCoinsTags({
|
||||||
|
String? requestID,
|
||||||
|
required int? startNumber,
|
||||||
|
}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkUsedCoinsTags,
|
||||||
|
[],
|
||||||
|
{
|
||||||
|
#requestID: requestID,
|
||||||
|
#startNumber: startNumber,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
returnValue:
|
||||||
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
|
_i4.Future<Map<String, dynamic>> getSparkMintMetaData({
|
||||||
|
String? requestID,
|
||||||
|
required List<String>? sparkCoinHashes,
|
||||||
|
}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkMintMetaData,
|
||||||
|
[],
|
||||||
|
{
|
||||||
|
#requestID: requestID,
|
||||||
|
#sparkCoinHashes: sparkCoinHashes,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
returnValue:
|
||||||
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
|
_i4.Future<int> getSparkLatestCoinId({String? requestID}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkLatestCoinId,
|
||||||
[],
|
[],
|
||||||
{#requestID: requestID},
|
{#requestID: requestID},
|
||||||
),
|
),
|
||||||
|
|
|
@ -300,14 +300,14 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
) as _i4.Future<Map<String, dynamic>>);
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
@override
|
@override
|
||||||
_i4.Future<Map<String, dynamic>> getAnonymitySet({
|
_i4.Future<Map<String, dynamic>> getLelantusAnonymitySet({
|
||||||
String? groupId = r'1',
|
String? groupId = r'1',
|
||||||
String? blockhash = r'',
|
String? blockhash = r'',
|
||||||
String? requestID,
|
String? requestID,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getAnonymitySet,
|
#getLelantusAnonymitySet,
|
||||||
[],
|
[],
|
||||||
{
|
{
|
||||||
#groupId: groupId,
|
#groupId: groupId,
|
||||||
|
@ -319,13 +319,13 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
) as _i4.Future<Map<String, dynamic>>);
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
@override
|
@override
|
||||||
_i4.Future<dynamic> getMintData({
|
_i4.Future<dynamic> getLelantusMintData({
|
||||||
dynamic mints,
|
dynamic mints,
|
||||||
String? requestID,
|
String? requestID,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getMintData,
|
#getLelantusMintData,
|
||||||
[],
|
[],
|
||||||
{
|
{
|
||||||
#mints: mints,
|
#mints: mints,
|
||||||
|
@ -335,13 +335,13 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
returnValue: _i4.Future<dynamic>.value(),
|
returnValue: _i4.Future<dynamic>.value(),
|
||||||
) as _i4.Future<dynamic>);
|
) as _i4.Future<dynamic>);
|
||||||
@override
|
@override
|
||||||
_i4.Future<Map<String, dynamic>> getUsedCoinSerials({
|
_i4.Future<Map<String, dynamic>> getLelantusUsedCoinSerials({
|
||||||
String? requestID,
|
String? requestID,
|
||||||
required int? startNumber,
|
required int? startNumber,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getUsedCoinSerials,
|
#getLelantusUsedCoinSerials,
|
||||||
[],
|
[],
|
||||||
{
|
{
|
||||||
#requestID: requestID,
|
#requestID: requestID,
|
||||||
|
@ -352,9 +352,73 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
) as _i4.Future<Map<String, dynamic>>);
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
@override
|
@override
|
||||||
_i4.Future<int> getLatestCoinId({String? requestID}) => (super.noSuchMethod(
|
_i4.Future<int> getLelantusLatestCoinId({String? requestID}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getLatestCoinId,
|
#getLelantusLatestCoinId,
|
||||||
|
[],
|
||||||
|
{#requestID: requestID},
|
||||||
|
),
|
||||||
|
returnValue: _i4.Future<int>.value(0),
|
||||||
|
) as _i4.Future<int>);
|
||||||
|
@override
|
||||||
|
_i4.Future<Map<String, dynamic>> getSparkAnonymitySet({
|
||||||
|
String? coinGroupId = r'1',
|
||||||
|
String? startBlockHash = r'',
|
||||||
|
String? requestID,
|
||||||
|
}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkAnonymitySet,
|
||||||
|
[],
|
||||||
|
{
|
||||||
|
#coinGroupId: coinGroupId,
|
||||||
|
#startBlockHash: startBlockHash,
|
||||||
|
#requestID: requestID,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
returnValue:
|
||||||
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
|
_i4.Future<Map<String, dynamic>> getSparkUsedCoinsTags({
|
||||||
|
String? requestID,
|
||||||
|
required int? startNumber,
|
||||||
|
}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkUsedCoinsTags,
|
||||||
|
[],
|
||||||
|
{
|
||||||
|
#requestID: requestID,
|
||||||
|
#startNumber: startNumber,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
returnValue:
|
||||||
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
|
_i4.Future<Map<String, dynamic>> getSparkMintMetaData({
|
||||||
|
String? requestID,
|
||||||
|
required List<String>? sparkCoinHashes,
|
||||||
|
}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkMintMetaData,
|
||||||
|
[],
|
||||||
|
{
|
||||||
|
#requestID: requestID,
|
||||||
|
#sparkCoinHashes: sparkCoinHashes,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
returnValue:
|
||||||
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
|
_i4.Future<int> getSparkLatestCoinId({String? requestID}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkLatestCoinId,
|
||||||
[],
|
[],
|
||||||
{#requestID: requestID},
|
{#requestID: requestID},
|
||||||
),
|
),
|
||||||
|
|
|
@ -37,7 +37,7 @@ import 'sample_data/transaction_data_samples.dart';
|
||||||
void main() {
|
void main() {
|
||||||
group("isolate functions", () {
|
group("isolate functions", () {
|
||||||
test("isolateRestore success", () async {
|
test("isolateRestore success", () async {
|
||||||
final cachedClient = MockCachedElectrumX();
|
final cachedClient = MockCachedElectrumXClient();
|
||||||
final txDataOLD = old.TransactionData.fromJson(dateTimeChunksJson);
|
final txDataOLD = old.TransactionData.fromJson(dateTimeChunksJson);
|
||||||
final Map<dynamic, dynamic> setData = {};
|
final Map<dynamic, dynamic> setData = {};
|
||||||
setData[1] = GetAnonymitySetSampleData.data;
|
setData[1] = GetAnonymitySetSampleData.data;
|
||||||
|
@ -195,7 +195,7 @@ void main() {
|
||||||
"function": "estimateJoinSplit",
|
"function": "estimateJoinSplit",
|
||||||
"spendAmount": "spendAmount",
|
"spendAmount": "spendAmount",
|
||||||
"subtractFeeFromAmount": true,
|
"subtractFeeFromAmount": true,
|
||||||
"lelantusEntries": MockCachedElectrumX(),
|
"lelantusEntries": MockCachedElectrumXClient(),
|
||||||
});
|
});
|
||||||
expect(await receivePort.first, "Error");
|
expect(await receivePort.first, "Error");
|
||||||
});
|
});
|
||||||
|
@ -226,7 +226,7 @@ void main() {
|
||||||
// test(
|
// test(
|
||||||
// "getJMintTransactions throws Error due to some invalid transactions passed to this function",
|
// "getJMintTransactions throws Error due to some invalid transactions passed to this function",
|
||||||
// () {
|
// () {
|
||||||
// final cachedClient = MockCachedElectrumX();
|
// final cachedClient = MockCachedElectrumXClient();
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// // mock price calls
|
// // mock price calls
|
||||||
|
@ -287,7 +287,7 @@ void main() {
|
||||||
// });
|
// });
|
||||||
//
|
//
|
||||||
// test("getJMintTransactions success", () async {
|
// test("getJMintTransactions success", () async {
|
||||||
// final cachedClient = MockCachedElectrumX();
|
// final cachedClient = MockCachedElectrumXClient();
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// // mock price calls
|
// // mock price calls
|
||||||
|
@ -342,7 +342,7 @@ void main() {
|
||||||
// });
|
// });
|
||||||
//
|
//
|
||||||
// test("getAnonymitySet", () async {
|
// test("getAnonymitySet", () async {
|
||||||
// final cachedClient = MockCachedElectrumX();
|
// final cachedClient = MockCachedElectrumXClient();
|
||||||
// when(cachedClient.getAnonymitySet(
|
// when(cachedClient.getAnonymitySet(
|
||||||
// groupId: "1", coin: Coin.firo, ))
|
// groupId: "1", coin: Coin.firo, ))
|
||||||
// .thenAnswer((_) async => {
|
// .thenAnswer((_) async => {
|
||||||
|
@ -373,7 +373,7 @@ void main() {
|
||||||
// });
|
// });
|
||||||
|
|
||||||
test("getBlockHead", () async {
|
test("getBlockHead", () async {
|
||||||
final client = MockElectrumX();
|
final client = MockElectrumXClient();
|
||||||
when(client.getBlockHeadTip()).thenAnswer(
|
when(client.getBlockHeadTip()).thenAnswer(
|
||||||
(_) async => {"height": 4359032, "hex": "... some block hex ..."});
|
(_) async => {"height": 4359032, "hex": "... some block hex ..."});
|
||||||
|
|
||||||
|
@ -388,8 +388,8 @@ void main() {
|
||||||
walletName: 'unit test',
|
walletName: 'unit test',
|
||||||
walletId: 'some id',
|
walletId: 'some id',
|
||||||
coin: Coin.firo,
|
coin: Coin.firo,
|
||||||
client: MockElectrumX(),
|
client: MockElectrumXClient(),
|
||||||
cachedClient: MockCachedElectrumX(),
|
cachedClient: MockCachedElectrumXClient(),
|
||||||
secureStore: FakeSecureStorage(),
|
secureStore: FakeSecureStorage(),
|
||||||
tracker: MockTransactionNotificationTracker(),
|
tracker: MockTransactionNotificationTracker(),
|
||||||
);
|
);
|
||||||
|
@ -402,8 +402,8 @@ void main() {
|
||||||
walletName: 'unit test',
|
walletName: 'unit test',
|
||||||
walletId: 'some id',
|
walletId: 'some id',
|
||||||
coin: Coin.firo,
|
coin: Coin.firo,
|
||||||
client: MockElectrumX(),
|
client: MockElectrumXClient(),
|
||||||
cachedClient: MockCachedElectrumX(),
|
cachedClient: MockCachedElectrumXClient(),
|
||||||
secureStore: FakeSecureStorage(),
|
secureStore: FakeSecureStorage(),
|
||||||
tracker: MockTransactionNotificationTracker(),
|
tracker: MockTransactionNotificationTracker(),
|
||||||
);
|
);
|
||||||
|
@ -416,8 +416,8 @@ void main() {
|
||||||
walletName: 'unit test',
|
walletName: 'unit test',
|
||||||
walletId: 'some id',
|
walletId: 'some id',
|
||||||
coin: Coin.firo,
|
coin: Coin.firo,
|
||||||
client: MockElectrumX(),
|
client: MockElectrumXClient(),
|
||||||
cachedClient: MockCachedElectrumX(),
|
cachedClient: MockCachedElectrumXClient(),
|
||||||
secureStore: FakeSecureStorage(),
|
secureStore: FakeSecureStorage(),
|
||||||
tracker: MockTransactionNotificationTracker(),
|
tracker: MockTransactionNotificationTracker(),
|
||||||
);
|
);
|
||||||
|
@ -430,8 +430,8 @@ void main() {
|
||||||
walletName: 'unit test',
|
walletName: 'unit test',
|
||||||
walletId: 'some id',
|
walletId: 'some id',
|
||||||
coin: Coin.firoTestNet,
|
coin: Coin.firoTestNet,
|
||||||
client: MockElectrumX(),
|
client: MockElectrumXClient(),
|
||||||
cachedClient: MockCachedElectrumX(),
|
cachedClient: MockCachedElectrumXClient(),
|
||||||
secureStore: FakeSecureStorage(),
|
secureStore: FakeSecureStorage(),
|
||||||
tracker: MockTransactionNotificationTracker(),
|
tracker: MockTransactionNotificationTracker(),
|
||||||
);
|
);
|
||||||
|
@ -444,8 +444,8 @@ void main() {
|
||||||
walletName: 'unit test',
|
walletName: 'unit test',
|
||||||
walletId: 'some id',
|
walletId: 'some id',
|
||||||
coin: Coin.firoTestNet,
|
coin: Coin.firoTestNet,
|
||||||
client: MockElectrumX(),
|
client: MockElectrumXClient(),
|
||||||
cachedClient: MockCachedElectrumX(),
|
cachedClient: MockCachedElectrumXClient(),
|
||||||
secureStore: FakeSecureStorage(),
|
secureStore: FakeSecureStorage(),
|
||||||
tracker: MockTransactionNotificationTracker(),
|
tracker: MockTransactionNotificationTracker(),
|
||||||
);
|
);
|
||||||
|
@ -458,8 +458,8 @@ void main() {
|
||||||
walletName: 'unit test',
|
walletName: 'unit test',
|
||||||
walletId: 'some id',
|
walletId: 'some id',
|
||||||
coin: Coin.firoTestNet,
|
coin: Coin.firoTestNet,
|
||||||
client: MockElectrumX(),
|
client: MockElectrumXClient(),
|
||||||
cachedClient: MockCachedElectrumX(),
|
cachedClient: MockCachedElectrumXClient(),
|
||||||
secureStore: FakeSecureStorage(),
|
secureStore: FakeSecureStorage(),
|
||||||
tracker: MockTransactionNotificationTracker(),
|
tracker: MockTransactionNotificationTracker(),
|
||||||
);
|
);
|
||||||
|
@ -470,7 +470,7 @@ void main() {
|
||||||
|
|
||||||
group("testNetworkConnection", () {
|
group("testNetworkConnection", () {
|
||||||
test("attempted connection fails due to server error", () async {
|
test("attempted connection fails due to server error", () async {
|
||||||
final client = MockElectrumX();
|
final client = MockElectrumXClient();
|
||||||
when(client.ping()).thenAnswer((_) async => false);
|
when(client.ping()).thenAnswer((_) async => false);
|
||||||
|
|
||||||
final firo = FiroWallet(
|
final firo = FiroWallet(
|
||||||
|
@ -478,7 +478,7 @@ void main() {
|
||||||
walletId: 'some id',
|
walletId: 'some id',
|
||||||
coin: Coin.firo,
|
coin: Coin.firo,
|
||||||
client: client,
|
client: client,
|
||||||
cachedClient: MockCachedElectrumX(),
|
cachedClient: MockCachedElectrumXClient(),
|
||||||
secureStore: FakeSecureStorage(),
|
secureStore: FakeSecureStorage(),
|
||||||
tracker: MockTransactionNotificationTracker(),
|
tracker: MockTransactionNotificationTracker(),
|
||||||
);
|
);
|
||||||
|
@ -488,7 +488,7 @@ void main() {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("attempted connection fails due to exception", () async {
|
test("attempted connection fails due to exception", () async {
|
||||||
final client = MockElectrumX();
|
final client = MockElectrumXClient();
|
||||||
when(client.ping()).thenThrow(Exception);
|
when(client.ping()).thenThrow(Exception);
|
||||||
|
|
||||||
final firo = FiroWallet(
|
final firo = FiroWallet(
|
||||||
|
@ -496,7 +496,7 @@ void main() {
|
||||||
walletId: 'some id',
|
walletId: 'some id',
|
||||||
coin: Coin.firo,
|
coin: Coin.firo,
|
||||||
client: client,
|
client: client,
|
||||||
cachedClient: MockCachedElectrumX(),
|
cachedClient: MockCachedElectrumXClient(),
|
||||||
secureStore: FakeSecureStorage(),
|
secureStore: FakeSecureStorage(),
|
||||||
tracker: MockTransactionNotificationTracker(),
|
tracker: MockTransactionNotificationTracker(),
|
||||||
);
|
);
|
||||||
|
@ -506,7 +506,7 @@ void main() {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("attempted connection test success", () async {
|
test("attempted connection test success", () async {
|
||||||
final client = MockElectrumX();
|
final client = MockElectrumXClient();
|
||||||
when(client.ping()).thenAnswer((_) async => true);
|
when(client.ping()).thenAnswer((_) async => true);
|
||||||
|
|
||||||
final firo = FiroWallet(
|
final firo = FiroWallet(
|
||||||
|
@ -514,7 +514,7 @@ void main() {
|
||||||
walletId: 'some id',
|
walletId: 'some id',
|
||||||
coin: Coin.firoTestNet,
|
coin: Coin.firoTestNet,
|
||||||
client: client,
|
client: client,
|
||||||
cachedClient: MockCachedElectrumX(),
|
cachedClient: MockCachedElectrumXClient(),
|
||||||
secureStore: FakeSecureStorage(),
|
secureStore: FakeSecureStorage(),
|
||||||
tracker: MockTransactionNotificationTracker(),
|
tracker: MockTransactionNotificationTracker(),
|
||||||
);
|
);
|
||||||
|
@ -536,8 +536,8 @@ void main() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// test("initializeWallet no network", () async {
|
// test("initializeWallet no network", () async {
|
||||||
// final client = MockElectrumX();
|
// final client = MockElectrumXClient();
|
||||||
// final cachedClient = MockCachedElectrumX();
|
// final cachedClient = MockCachedElectrumXClient();
|
||||||
// final secureStore = FakeSecureStorage();
|
// final secureStore = FakeSecureStorage();
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
@ -558,8 +558,8 @@ void main() {
|
||||||
// });
|
// });
|
||||||
|
|
||||||
// test("initializeWallet no network exception", () async {
|
// test("initializeWallet no network exception", () async {
|
||||||
// final client = MockElectrumX();
|
// final client = MockElectrumXClient();
|
||||||
// final cachedClient = MockCachedElectrumX();
|
// final cachedClient = MockCachedElectrumXClient();
|
||||||
// final secureStore = FakeSecureStorage();
|
// final secureStore = FakeSecureStorage();
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
@ -581,8 +581,8 @@ void main() {
|
||||||
// });
|
// });
|
||||||
//
|
//
|
||||||
// test("initializeWallet throws bad network on testnet", () async {
|
// test("initializeWallet throws bad network on testnet", () async {
|
||||||
// final client = MockElectrumX();
|
// final client = MockElectrumXClient();
|
||||||
// final cachedClient = MockCachedElectrumX();
|
// final cachedClient = MockCachedElectrumXClient();
|
||||||
// final secureStore = FakeSecureStorage();
|
// final secureStore = FakeSecureStorage();
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
@ -615,8 +615,8 @@ void main() {
|
||||||
// });
|
// });
|
||||||
//
|
//
|
||||||
// test("initializeWallet throws bad network on mainnet", () async {
|
// test("initializeWallet throws bad network on mainnet", () async {
|
||||||
// final client = MockElectrumX();
|
// final client = MockElectrumXClient();
|
||||||
// final cachedClient = MockCachedElectrumX();
|
// final cachedClient = MockCachedElectrumXClient();
|
||||||
// final secureStore = FakeSecureStorage();
|
// final secureStore = FakeSecureStorage();
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
@ -652,8 +652,8 @@ void main() {
|
||||||
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
||||||
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
||||||
//
|
//
|
||||||
// final client = MockElectrumX();
|
// final client = MockElectrumXClient();
|
||||||
// final cachedClient = MockCachedElectrumX();
|
// final cachedClient = MockCachedElectrumXClient();
|
||||||
// final secureStore = FakeSecureStorage();
|
// final secureStore = FakeSecureStorage();
|
||||||
//
|
//
|
||||||
// when(priceAPI.getPrice(ticker: "tFIRO", baseCurrency: "USD"))
|
// when(priceAPI.getPrice(ticker: "tFIRO", baseCurrency: "USD"))
|
||||||
|
@ -724,8 +724,8 @@ void main() {
|
||||||
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
||||||
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
||||||
//
|
//
|
||||||
// final client = MockElectrumX();
|
// final client = MockElectrumXClient();
|
||||||
// final cachedClient = MockCachedElectrumX();
|
// final cachedClient = MockCachedElectrumXClient();
|
||||||
// final secureStore = FakeSecureStorage();
|
// final secureStore = FakeSecureStorage();
|
||||||
//
|
//
|
||||||
// // when(priceAPI.getPrice(ticker: "tFIRO", baseCurrency: "USD"))
|
// // when(priceAPI.getPrice(ticker: "tFIRO", baseCurrency: "USD"))
|
||||||
|
@ -830,8 +830,8 @@ void main() {
|
||||||
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
||||||
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
||||||
//
|
//
|
||||||
// final client = MockElectrumX();
|
// final client = MockElectrumXClient();
|
||||||
// final cachedClient = MockCachedElectrumX();
|
// final cachedClient = MockCachedElectrumXClient();
|
||||||
// final secureStore = FakeSecureStorage();
|
// final secureStore = FakeSecureStorage();
|
||||||
//
|
//
|
||||||
// // mock price calls
|
// // mock price calls
|
||||||
|
@ -908,8 +908,8 @@ void main() {
|
||||||
// });
|
// });
|
||||||
|
|
||||||
// test("getAllTxsToWatch", () async {
|
// test("getAllTxsToWatch", () async {
|
||||||
// final client = MockElectrumX();
|
// final client = MockElectrumXClient();
|
||||||
// final cachedClient = MockCachedElectrumX();
|
// final cachedClient = MockCachedElectrumXClient();
|
||||||
// final secureStore = FakeSecureStorage();
|
// final secureStore = FakeSecureStorage();
|
||||||
//
|
//
|
||||||
// final tracker = MockTransactionNotificationTracker();
|
// final tracker = MockTransactionNotificationTracker();
|
||||||
|
@ -975,8 +975,8 @@ void main() {
|
||||||
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
||||||
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
||||||
//
|
//
|
||||||
// final client = MockElectrumX();
|
// final client = MockElectrumXClient();
|
||||||
// final cachedClient = MockCachedElectrumX();
|
// final cachedClient = MockCachedElectrumXClient();
|
||||||
// final secureStore = FakeSecureStorage();
|
// final secureStore = FakeSecureStorage();
|
||||||
// final tracker = MockTransactionNotificationTracker();
|
// final tracker = MockTransactionNotificationTracker();
|
||||||
//
|
//
|
||||||
|
@ -1069,8 +1069,8 @@ void main() {
|
||||||
// TODO: mock NotificationAPI
|
// TODO: mock NotificationAPI
|
||||||
// test("refreshIfThereIsNewData with two unconfirmed transactions",
|
// test("refreshIfThereIsNewData with two unconfirmed transactions",
|
||||||
// () async {
|
// () async {
|
||||||
// final client = MockElectrumX();
|
// final client = MockElectrumXClient();
|
||||||
// final cachedClient = MockCachedElectrumX();
|
// final cachedClient = MockCachedElectrumXClient();
|
||||||
// final secureStore = FakeSecureStorage();
|
// final secureStore = FakeSecureStorage();
|
||||||
//
|
//
|
||||||
// final tracker = MockTransactionNotificationTracker();
|
// final tracker = MockTransactionNotificationTracker();
|
||||||
|
@ -1126,8 +1126,8 @@ void main() {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("submitHexToNetwork", () async {
|
test("submitHexToNetwork", () async {
|
||||||
final client = MockElectrumX();
|
final client = MockElectrumXClient();
|
||||||
final cachedClient = MockCachedElectrumX();
|
final cachedClient = MockCachedElectrumXClient();
|
||||||
final secureStore = FakeSecureStorage();
|
final secureStore = FakeSecureStorage();
|
||||||
|
|
||||||
when(client.broadcastTransaction(
|
when(client.broadcastTransaction(
|
||||||
|
@ -1175,8 +1175,8 @@ void main() {
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
const sats = 9658;
|
const sats = 9658;
|
||||||
final client = MockElectrumX();
|
final client = MockElectrumXClient();
|
||||||
final cachedClient = MockCachedElectrumX();
|
final cachedClient = MockCachedElectrumXClient();
|
||||||
final secureStore = FakeSecureStorage();
|
final secureStore = FakeSecureStorage();
|
||||||
final mainDB = MockMainDB();
|
final mainDB = MockMainDB();
|
||||||
|
|
||||||
|
@ -1206,7 +1206,7 @@ void main() {
|
||||||
|
|
||||||
when(client.getBlockHeadTip()).thenAnswer(
|
when(client.getBlockHeadTip()).thenAnswer(
|
||||||
(_) async => {"height": 455873, "hex": "this value not used here"});
|
(_) async => {"height": 455873, "hex": "this value not used here"});
|
||||||
when(client.getLatestCoinId()).thenAnswer((_) async => 2);
|
when(client.getLelantusLatestCoinId()).thenAnswer((_) async => 2);
|
||||||
|
|
||||||
when(mainDB.getAddress("${testWalletId}buildMintTransaction", any))
|
when(mainDB.getAddress("${testWalletId}buildMintTransaction", any))
|
||||||
.thenAnswer((realInvocation) async => null);
|
.thenAnswer((realInvocation) async => null);
|
||||||
|
@ -1255,8 +1255,8 @@ void main() {
|
||||||
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
||||||
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
||||||
//
|
//
|
||||||
// final client = MockElectrumX();
|
// final client = MockElectrumXClient();
|
||||||
// final cachedClient = MockCachedElectrumX();
|
// final cachedClient = MockCachedElectrumXClient();
|
||||||
// final secureStore = FakeSecureStorage();
|
// final secureStore = FakeSecureStorage();
|
||||||
//
|
//
|
||||||
// // mock electrumx client calls
|
// // mock electrumx client calls
|
||||||
|
@ -1489,8 +1489,8 @@ void main() {
|
||||||
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
||||||
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
||||||
//
|
//
|
||||||
// final client = MockElectrumX();
|
// final client = MockElectrumXClient();
|
||||||
// final cachedClient = MockCachedElectrumX();
|
// final cachedClient = MockCachedElectrumXClient();
|
||||||
// final secureStore = FakeSecureStorage();
|
// final secureStore = FakeSecureStorage();
|
||||||
//
|
//
|
||||||
// await secureStore.write(
|
// await secureStore.write(
|
||||||
|
@ -1698,8 +1698,8 @@ void main() {
|
||||||
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
||||||
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
||||||
//
|
//
|
||||||
// final client = MockElectrumX();
|
// final client = MockElectrumXClient();
|
||||||
// final cachedClient = MockCachedElectrumX();
|
// final cachedClient = MockCachedElectrumXClient();
|
||||||
// final secureStore = FakeSecureStorage();
|
// final secureStore = FakeSecureStorage();
|
||||||
//
|
//
|
||||||
// await secureStore.write(
|
// await secureStore.write(
|
||||||
|
@ -1836,8 +1836,8 @@ void main() {
|
||||||
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
||||||
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
||||||
//
|
//
|
||||||
// final client = MockElectrumX();
|
// final client = MockElectrumXClient();
|
||||||
// final cachedClient = MockCachedElectrumX();
|
// final cachedClient = MockCachedElectrumXClient();
|
||||||
// final secureStore = FakeSecureStorage();
|
// final secureStore = FakeSecureStorage();
|
||||||
//
|
//
|
||||||
// // mock electrumx client calls
|
// // mock electrumx client calls
|
||||||
|
@ -2110,8 +2110,8 @@ void main() {
|
||||||
// }, timeout: const Timeout(Duration(minutes: 6)));
|
// }, timeout: const Timeout(Duration(minutes: 6)));
|
||||||
|
|
||||||
test("recoverFromMnemonic fails testnet", () async {
|
test("recoverFromMnemonic fails testnet", () async {
|
||||||
final client = MockElectrumX();
|
final client = MockElectrumXClient();
|
||||||
final cachedClient = MockCachedElectrumX();
|
final cachedClient = MockCachedElectrumXClient();
|
||||||
final secureStore = FakeSecureStorage();
|
final secureStore = FakeSecureStorage();
|
||||||
|
|
||||||
// mock electrumx client calls
|
// mock electrumx client calls
|
||||||
|
@ -2146,8 +2146,8 @@ void main() {
|
||||||
}, timeout: const Timeout(Duration(minutes: 3)));
|
}, timeout: const Timeout(Duration(minutes: 3)));
|
||||||
|
|
||||||
test("recoverFromMnemonic fails mainnet", () async {
|
test("recoverFromMnemonic fails mainnet", () async {
|
||||||
final client = MockElectrumX();
|
final client = MockElectrumXClient();
|
||||||
final cachedClient = MockCachedElectrumX();
|
final cachedClient = MockCachedElectrumXClient();
|
||||||
final secureStore = FakeSecureStorage();
|
final secureStore = FakeSecureStorage();
|
||||||
|
|
||||||
// mock electrumx client calls
|
// mock electrumx client calls
|
||||||
|
@ -2186,8 +2186,8 @@ void main() {
|
||||||
walletId: "${testWalletId}checkReceivingAddressForTransactions fails",
|
walletId: "${testWalletId}checkReceivingAddressForTransactions fails",
|
||||||
walletName: testWalletName,
|
walletName: testWalletName,
|
||||||
coin: Coin.firo,
|
coin: Coin.firo,
|
||||||
client: MockElectrumX(),
|
client: MockElectrumXClient(),
|
||||||
cachedClient: MockCachedElectrumX(),
|
cachedClient: MockCachedElectrumXClient(),
|
||||||
secureStore: FakeSecureStorage(),
|
secureStore: FakeSecureStorage(),
|
||||||
tracker: MockTransactionNotificationTracker(),
|
tracker: MockTransactionNotificationTracker(),
|
||||||
);
|
);
|
||||||
|
@ -2202,7 +2202,7 @@ void main() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// test("checkReceivingAddressForTransactions numtxs >= 1", () async {
|
// test("checkReceivingAddressForTransactions numtxs >= 1", () async {
|
||||||
// final client = MockElectrumX();
|
// final client = MockElectrumXClient();
|
||||||
// final secureStore = FakeSecureStorage();
|
// final secureStore = FakeSecureStorage();
|
||||||
//
|
//
|
||||||
// when(client.getHistory(scripthash: SampleGetHistoryData.scripthash1))
|
// when(client.getHistory(scripthash: SampleGetHistoryData.scripthash1))
|
||||||
|
@ -2214,7 +2214,7 @@ void main() {
|
||||||
// walletName: testWalletName,
|
// walletName: testWalletName,
|
||||||
// coin: Coin.firo,
|
// coin: Coin.firo,
|
||||||
// client: client,
|
// client: client,
|
||||||
// cachedClient: MockCachedElectrumX(),
|
// cachedClient: MockCachedElectrumXClient(),
|
||||||
// secureStore: secureStore,
|
// secureStore: secureStore,
|
||||||
// tracker: MockTransactionNotificationTracker(),
|
// tracker: MockTransactionNotificationTracker(),
|
||||||
// );
|
// );
|
||||||
|
@ -2237,16 +2237,16 @@ void main() {
|
||||||
// });
|
// });
|
||||||
|
|
||||||
test("getLatestSetId", () async {
|
test("getLatestSetId", () async {
|
||||||
final client = MockElectrumX();
|
final client = MockElectrumXClient();
|
||||||
|
|
||||||
when(client.getLatestCoinId()).thenAnswer((_) async => 1);
|
when(client.getLelantusLatestCoinId()).thenAnswer((_) async => 1);
|
||||||
|
|
||||||
final firo = FiroWallet(
|
final firo = FiroWallet(
|
||||||
walletId: "${testWalletId}exit",
|
walletId: "${testWalletId}exit",
|
||||||
walletName: testWalletName,
|
walletName: testWalletName,
|
||||||
coin: Coin.firo,
|
coin: Coin.firo,
|
||||||
client: client,
|
client: client,
|
||||||
cachedClient: MockCachedElectrumX(),
|
cachedClient: MockCachedElectrumXClient(),
|
||||||
secureStore: FakeSecureStorage(),
|
secureStore: FakeSecureStorage(),
|
||||||
tracker: MockTransactionNotificationTracker(),
|
tracker: MockTransactionNotificationTracker(),
|
||||||
);
|
);
|
||||||
|
@ -2256,7 +2256,7 @@ void main() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// test("getSetData", () async {
|
// test("getSetData", () async {
|
||||||
// final client = MockElectrumX();
|
// final client = MockElectrumXClient();
|
||||||
//
|
//
|
||||||
// when(client.getCoinsForRecovery(setId: 1))
|
// when(client.getCoinsForRecovery(setId: 1))
|
||||||
// .thenAnswer((_) async => getCoinsForRecoveryResponse);
|
// .thenAnswer((_) async => getCoinsForRecoveryResponse);
|
||||||
|
@ -2266,7 +2266,7 @@ void main() {
|
||||||
// walletName: testWalletName,
|
// walletName: testWalletName,
|
||||||
// networkType: firoNetworkType,
|
// networkType: firoNetworkType,
|
||||||
// client: client,
|
// client: client,
|
||||||
// cachedClient: MockCachedElectrumX(),
|
// cachedClient: MockCachedElectrumXClient(),
|
||||||
// secureStore: FakeSecureStorage(),
|
// secureStore: FakeSecureStorage(),
|
||||||
//
|
//
|
||||||
// tracker: MockTransactionNotificationTracker(),
|
// tracker: MockTransactionNotificationTracker(),
|
||||||
|
@ -2277,8 +2277,8 @@ void main() {
|
||||||
// });
|
// });
|
||||||
|
|
||||||
test("getUsedCoinSerials", () async {
|
test("getUsedCoinSerials", () async {
|
||||||
final client = MockElectrumX();
|
final client = MockElectrumXClient();
|
||||||
final cachedClient = MockCachedElectrumX();
|
final cachedClient = MockCachedElectrumXClient();
|
||||||
|
|
||||||
// when(client.getUsedCoinSerials(startNumber: 0))
|
// when(client.getUsedCoinSerials(startNumber: 0))
|
||||||
// .thenAnswer((_) async => GetUsedSerialsSampleData.serials);
|
// .thenAnswer((_) async => GetUsedSerialsSampleData.serials);
|
||||||
|
@ -2309,8 +2309,8 @@ void main() {
|
||||||
const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
||||||
.setMockMethodCallHandler((methodCall) async => 'en_US');
|
.setMockMethodCallHandler((methodCall) async => 'en_US');
|
||||||
|
|
||||||
final client = MockElectrumX();
|
final client = MockElectrumXClient();
|
||||||
final cachedClient = MockCachedElectrumX();
|
final cachedClient = MockCachedElectrumXClient();
|
||||||
final secureStore = FakeSecureStorage();
|
final secureStore = FakeSecureStorage();
|
||||||
|
|
||||||
// set mnemonic
|
// set mnemonic
|
||||||
|
@ -2345,10 +2345,10 @@ void main() {
|
||||||
"services": <dynamic>[]
|
"services": <dynamic>[]
|
||||||
});
|
});
|
||||||
|
|
||||||
when(client.getLatestCoinId()).thenAnswer((_) async => 1);
|
when(client.getLelantusLatestCoinId()).thenAnswer((_) async => 1);
|
||||||
// when(client.getCoinsForRecovery(setId: 1))
|
// when(client.getCoinsForRecovery(setId: 1))
|
||||||
// .thenAnswer((_) async => getCoinsForRecoveryResponse);
|
// .thenAnswer((_) async => getCoinsForRecoveryResponse);
|
||||||
when(client.getUsedCoinSerials(startNumber: 0))
|
when(client.getLelantusUsedCoinSerials(startNumber: 0))
|
||||||
.thenAnswer((_) async => GetUsedSerialsSampleData.serials);
|
.thenAnswer((_) async => GetUsedSerialsSampleData.serials);
|
||||||
|
|
||||||
when(client.estimateFee(blocks: 1))
|
when(client.estimateFee(blocks: 1))
|
||||||
|
@ -2430,8 +2430,8 @@ void main() {
|
||||||
// TestWidgetsFlutterBinding.ensureInitialized();
|
// TestWidgetsFlutterBinding.ensureInitialized();
|
||||||
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
||||||
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
||||||
// final client = MockElectrumX();
|
// final client = MockElectrumXClient();
|
||||||
// final cachedClient = MockCachedElectrumX();
|
// final cachedClient = MockCachedElectrumXClient();
|
||||||
// final secureStore = FakeSecureStorage();
|
// final secureStore = FakeSecureStorage();
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
@ -2613,8 +2613,8 @@ void main() {
|
||||||
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
||||||
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
||||||
//
|
//
|
||||||
// final client = MockElectrumX();
|
// final client = MockElectrumXClient();
|
||||||
// final cachedClient = MockCachedElectrumX();
|
// final cachedClient = MockCachedElectrumXClient();
|
||||||
// final secureStore = FakeSecureStorage();
|
// final secureStore = FakeSecureStorage();
|
||||||
//
|
//
|
||||||
// when(client.getLatestCoinId()).thenAnswer((_) async => 1);
|
// when(client.getLatestCoinId()).thenAnswer((_) async => 1);
|
||||||
|
@ -2789,8 +2789,8 @@ void main() {
|
||||||
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
||||||
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
||||||
//
|
//
|
||||||
// final client = MockElectrumX();
|
// final client = MockElectrumXClient();
|
||||||
// final cachedClient = MockCachedElectrumX();
|
// final cachedClient = MockCachedElectrumXClient();
|
||||||
//
|
//
|
||||||
// // mock history calls
|
// // mock history calls
|
||||||
// when(client.getHistory(scripthash: SampleGetHistoryData.scripthash0))
|
// when(client.getHistory(scripthash: SampleGetHistoryData.scripthash0))
|
||||||
|
@ -2869,8 +2869,8 @@ void main() {
|
||||||
// });
|
// });
|
||||||
|
|
||||||
// test("get transactions", () async {
|
// test("get transactions", () async {
|
||||||
// final client = MockElectrumX();
|
// final client = MockElectrumXClient();
|
||||||
// final cachedClient = MockCachedElectrumX();
|
// final cachedClient = MockCachedElectrumXClient();
|
||||||
// final secureStore = FakeSecureStorage();
|
// final secureStore = FakeSecureStorage();
|
||||||
//
|
//
|
||||||
// // set mnemonic
|
// // set mnemonic
|
||||||
|
@ -2976,8 +2976,8 @@ void main() {
|
||||||
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
// const MethodChannel('uk.spiralarm.flutter/devicelocale')
|
||||||
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
// .setMockMethodCallHandler((methodCall) async => 'en_US');
|
||||||
//
|
//
|
||||||
// final client = MockElectrumX();
|
// final client = MockElectrumXClient();
|
||||||
// final cachedClient = MockCachedElectrumX();
|
// final cachedClient = MockCachedElectrumXClient();
|
||||||
// final secureStore = FakeSecureStorage();
|
// final secureStore = FakeSecureStorage();
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
|
@ -3196,8 +3196,8 @@ void main() {
|
||||||
walletId: "${testWalletId}exit",
|
walletId: "${testWalletId}exit",
|
||||||
walletName: testWalletName,
|
walletName: testWalletName,
|
||||||
coin: Coin.firo,
|
coin: Coin.firo,
|
||||||
client: MockElectrumX(),
|
client: MockElectrumXClient(),
|
||||||
cachedClient: MockCachedElectrumX(),
|
cachedClient: MockCachedElectrumXClient(),
|
||||||
secureStore: FakeSecureStorage(),
|
secureStore: FakeSecureStorage(),
|
||||||
tracker: MockTransactionNotificationTracker(),
|
tracker: MockTransactionNotificationTracker(),
|
||||||
);
|
);
|
||||||
|
@ -3222,7 +3222,7 @@ void main() {
|
||||||
group("simple getters", () {
|
group("simple getters", () {
|
||||||
group("fees", () {
|
group("fees", () {
|
||||||
test("get fees succeeds", () async {
|
test("get fees succeeds", () async {
|
||||||
final client = MockElectrumX();
|
final client = MockElectrumXClient();
|
||||||
|
|
||||||
when(client.estimateFee(blocks: 1))
|
when(client.estimateFee(blocks: 1))
|
||||||
.thenAnswer((_) async => Decimal.parse("0.00001000"));
|
.thenAnswer((_) async => Decimal.parse("0.00001000"));
|
||||||
|
@ -3236,7 +3236,7 @@ void main() {
|
||||||
walletName: "some name",
|
walletName: "some name",
|
||||||
coin: Coin.firo,
|
coin: Coin.firo,
|
||||||
client: client,
|
client: client,
|
||||||
cachedClient: MockCachedElectrumX(),
|
cachedClient: MockCachedElectrumXClient(),
|
||||||
secureStore: FakeSecureStorage(),
|
secureStore: FakeSecureStorage(),
|
||||||
tracker: MockTransactionNotificationTracker(),
|
tracker: MockTransactionNotificationTracker(),
|
||||||
);
|
);
|
||||||
|
@ -3247,7 +3247,7 @@ void main() {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("get fees throws", () {
|
test("get fees throws", () {
|
||||||
final client = MockElectrumX();
|
final client = MockElectrumXClient();
|
||||||
|
|
||||||
when(client.estimateFee(blocks: 1))
|
when(client.estimateFee(blocks: 1))
|
||||||
.thenThrow(Exception("Some exception"));
|
.thenThrow(Exception("Some exception"));
|
||||||
|
@ -3257,7 +3257,7 @@ void main() {
|
||||||
walletName: "some name",
|
walletName: "some name",
|
||||||
coin: Coin.firo,
|
coin: Coin.firo,
|
||||||
client: client,
|
client: client,
|
||||||
cachedClient: MockCachedElectrumX(),
|
cachedClient: MockCachedElectrumXClient(),
|
||||||
secureStore: FakeSecureStorage(),
|
secureStore: FakeSecureStorage(),
|
||||||
tracker: MockTransactionNotificationTracker(),
|
tracker: MockTransactionNotificationTracker(),
|
||||||
);
|
);
|
||||||
|
@ -3272,8 +3272,8 @@ void main() {
|
||||||
walletId: "some id",
|
walletId: "some id",
|
||||||
walletName: "some name",
|
walletName: "some name",
|
||||||
coin: Coin.firo,
|
coin: Coin.firo,
|
||||||
client: MockElectrumX(),
|
client: MockElectrumXClient(),
|
||||||
cachedClient: MockCachedElectrumX(),
|
cachedClient: MockCachedElectrumXClient(),
|
||||||
secureStore: FakeSecureStorage(),
|
secureStore: FakeSecureStorage(),
|
||||||
tracker: MockTransactionNotificationTracker(),
|
tracker: MockTransactionNotificationTracker(),
|
||||||
);
|
);
|
||||||
|
@ -3286,8 +3286,8 @@ void main() {
|
||||||
walletId: "some id",
|
walletId: "some id",
|
||||||
walletName: "some name",
|
walletName: "some name",
|
||||||
coin: Coin.firoTestNet,
|
coin: Coin.firoTestNet,
|
||||||
client: MockElectrumX(),
|
client: MockElectrumXClient(),
|
||||||
cachedClient: MockCachedElectrumX(),
|
cachedClient: MockCachedElectrumXClient(),
|
||||||
secureStore: FakeSecureStorage(),
|
secureStore: FakeSecureStorage(),
|
||||||
tracker: MockTransactionNotificationTracker(),
|
tracker: MockTransactionNotificationTracker(),
|
||||||
);
|
);
|
||||||
|
@ -3308,8 +3308,8 @@ void main() {
|
||||||
walletName: 'unit test',
|
walletName: 'unit test',
|
||||||
walletId: 'some id',
|
walletId: 'some id',
|
||||||
coin: Coin.firoTestNet,
|
coin: Coin.firoTestNet,
|
||||||
client: MockElectrumX(),
|
client: MockElectrumXClient(),
|
||||||
cachedClient: MockCachedElectrumX(),
|
cachedClient: MockCachedElectrumXClient(),
|
||||||
secureStore: store,
|
secureStore: store,
|
||||||
tracker: MockTransactionNotificationTracker(),
|
tracker: MockTransactionNotificationTracker(),
|
||||||
);
|
);
|
||||||
|
@ -3336,8 +3336,8 @@ void main() {
|
||||||
walletName: 'unit test',
|
walletName: 'unit test',
|
||||||
walletId: 'some other id',
|
walletId: 'some other id',
|
||||||
coin: Coin.firoTestNet,
|
coin: Coin.firoTestNet,
|
||||||
client: MockElectrumX(),
|
client: MockElectrumXClient(),
|
||||||
cachedClient: MockCachedElectrumX(),
|
cachedClient: MockCachedElectrumXClient(),
|
||||||
secureStore: store,
|
secureStore: store,
|
||||||
tracker: MockTransactionNotificationTracker(),
|
tracker: MockTransactionNotificationTracker(),
|
||||||
);
|
);
|
||||||
|
@ -3351,8 +3351,8 @@ void main() {
|
||||||
walletId: "some id",
|
walletId: "some id",
|
||||||
walletName: "some name",
|
walletName: "some name",
|
||||||
coin: Coin.firo,
|
coin: Coin.firo,
|
||||||
client: MockElectrumX(),
|
client: MockElectrumXClient(),
|
||||||
cachedClient: MockCachedElectrumX(),
|
cachedClient: MockCachedElectrumXClient(),
|
||||||
secureStore: FakeSecureStorage(),
|
secureStore: FakeSecureStorage(),
|
||||||
tracker: MockTransactionNotificationTracker(),
|
tracker: MockTransactionNotificationTracker(),
|
||||||
);
|
);
|
||||||
|
@ -3368,8 +3368,8 @@ void main() {
|
||||||
walletId: "some id",
|
walletId: "some id",
|
||||||
walletName: "some name",
|
walletName: "some name",
|
||||||
coin: Coin.firo,
|
coin: Coin.firo,
|
||||||
client: MockElectrumX(),
|
client: MockElectrumXClient(),
|
||||||
cachedClient: MockCachedElectrumX(),
|
cachedClient: MockCachedElectrumXClient(),
|
||||||
secureStore: FakeSecureStorage(),
|
secureStore: FakeSecureStorage(),
|
||||||
tracker: MockTransactionNotificationTracker(),
|
tracker: MockTransactionNotificationTracker(),
|
||||||
);
|
);
|
||||||
|
|
|
@ -330,14 +330,14 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
) as _i5.Future<Map<String, dynamic>>);
|
) as _i5.Future<Map<String, dynamic>>);
|
||||||
@override
|
@override
|
||||||
_i5.Future<Map<String, dynamic>> getAnonymitySet({
|
_i5.Future<Map<String, dynamic>> getLelantusAnonymitySet({
|
||||||
String? groupId = r'1',
|
String? groupId = r'1',
|
||||||
String? blockhash = r'',
|
String? blockhash = r'',
|
||||||
String? requestID,
|
String? requestID,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getAnonymitySet,
|
#getLelantusAnonymitySet,
|
||||||
[],
|
[],
|
||||||
{
|
{
|
||||||
#groupId: groupId,
|
#groupId: groupId,
|
||||||
|
@ -349,13 +349,13 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
) as _i5.Future<Map<String, dynamic>>);
|
) as _i5.Future<Map<String, dynamic>>);
|
||||||
@override
|
@override
|
||||||
_i5.Future<dynamic> getMintData({
|
_i5.Future<dynamic> getLelantusMintData({
|
||||||
dynamic mints,
|
dynamic mints,
|
||||||
String? requestID,
|
String? requestID,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getMintData,
|
#getLelantusMintData,
|
||||||
[],
|
[],
|
||||||
{
|
{
|
||||||
#mints: mints,
|
#mints: mints,
|
||||||
|
@ -365,13 +365,13 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
returnValue: _i5.Future<dynamic>.value(),
|
returnValue: _i5.Future<dynamic>.value(),
|
||||||
) as _i5.Future<dynamic>);
|
) as _i5.Future<dynamic>);
|
||||||
@override
|
@override
|
||||||
_i5.Future<Map<String, dynamic>> getUsedCoinSerials({
|
_i5.Future<Map<String, dynamic>> getLelantusUsedCoinSerials({
|
||||||
String? requestID,
|
String? requestID,
|
||||||
required int? startNumber,
|
required int? startNumber,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getUsedCoinSerials,
|
#getLelantusUsedCoinSerials,
|
||||||
[],
|
[],
|
||||||
{
|
{
|
||||||
#requestID: requestID,
|
#requestID: requestID,
|
||||||
|
@ -382,9 +382,73 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
) as _i5.Future<Map<String, dynamic>>);
|
) as _i5.Future<Map<String, dynamic>>);
|
||||||
@override
|
@override
|
||||||
_i5.Future<int> getLatestCoinId({String? requestID}) => (super.noSuchMethod(
|
_i5.Future<int> getLelantusLatestCoinId({String? requestID}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getLatestCoinId,
|
#getLelantusLatestCoinId,
|
||||||
|
[],
|
||||||
|
{#requestID: requestID},
|
||||||
|
),
|
||||||
|
returnValue: _i5.Future<int>.value(0),
|
||||||
|
) as _i5.Future<int>);
|
||||||
|
@override
|
||||||
|
_i5.Future<Map<String, dynamic>> getSparkAnonymitySet({
|
||||||
|
String? coinGroupId = r'1',
|
||||||
|
String? startBlockHash = r'',
|
||||||
|
String? requestID,
|
||||||
|
}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkAnonymitySet,
|
||||||
|
[],
|
||||||
|
{
|
||||||
|
#coinGroupId: coinGroupId,
|
||||||
|
#startBlockHash: startBlockHash,
|
||||||
|
#requestID: requestID,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
returnValue:
|
||||||
|
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
|
) as _i5.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
|
_i5.Future<Map<String, dynamic>> getSparkUsedCoinsTags({
|
||||||
|
String? requestID,
|
||||||
|
required int? startNumber,
|
||||||
|
}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkUsedCoinsTags,
|
||||||
|
[],
|
||||||
|
{
|
||||||
|
#requestID: requestID,
|
||||||
|
#startNumber: startNumber,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
returnValue:
|
||||||
|
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
|
) as _i5.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
|
_i5.Future<Map<String, dynamic>> getSparkMintMetaData({
|
||||||
|
String? requestID,
|
||||||
|
required List<String>? sparkCoinHashes,
|
||||||
|
}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkMintMetaData,
|
||||||
|
[],
|
||||||
|
{
|
||||||
|
#requestID: requestID,
|
||||||
|
#sparkCoinHashes: sparkCoinHashes,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
returnValue:
|
||||||
|
_i5.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
|
) as _i5.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
|
_i5.Future<int> getSparkLatestCoinId({String? requestID}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkLatestCoinId,
|
||||||
[],
|
[],
|
||||||
{#requestID: requestID},
|
{#requestID: requestID},
|
||||||
),
|
),
|
||||||
|
|
|
@ -47,16 +47,16 @@ void main() {
|
||||||
});
|
});
|
||||||
|
|
||||||
group("validate mainnet namecoin addresses", () {
|
group("validate mainnet namecoin addresses", () {
|
||||||
MockElectrumX? client;
|
MockElectrumXClient? client;
|
||||||
MockCachedElectrumX? cachedClient;
|
MockCachedElectrumXClient? cachedClient;
|
||||||
late FakeSecureStorage secureStore;
|
late FakeSecureStorage secureStore;
|
||||||
MockTransactionNotificationTracker? tracker;
|
MockTransactionNotificationTracker? tracker;
|
||||||
|
|
||||||
NamecoinWallet? mainnetWallet;
|
NamecoinWallet? mainnetWallet;
|
||||||
|
|
||||||
setUp(() {
|
setUp(() {
|
||||||
client = MockElectrumX();
|
client = MockElectrumXClient();
|
||||||
cachedClient = MockCachedElectrumX();
|
cachedClient = MockCachedElectrumXClient();
|
||||||
secureStore = FakeSecureStorage();
|
secureStore = FakeSecureStorage();
|
||||||
tracker = MockTransactionNotificationTracker();
|
tracker = MockTransactionNotificationTracker();
|
||||||
|
|
||||||
|
@ -117,16 +117,16 @@ void main() {
|
||||||
});
|
});
|
||||||
|
|
||||||
group("testNetworkConnection", () {
|
group("testNetworkConnection", () {
|
||||||
MockElectrumX? client;
|
MockElectrumXClient? client;
|
||||||
MockCachedElectrumX? cachedClient;
|
MockCachedElectrumXClient? cachedClient;
|
||||||
late FakeSecureStorage secureStore;
|
late FakeSecureStorage secureStore;
|
||||||
MockTransactionNotificationTracker? tracker;
|
MockTransactionNotificationTracker? tracker;
|
||||||
|
|
||||||
NamecoinWallet? nmc;
|
NamecoinWallet? nmc;
|
||||||
|
|
||||||
setUp(() {
|
setUp(() {
|
||||||
client = MockElectrumX();
|
client = MockElectrumXClient();
|
||||||
cachedClient = MockCachedElectrumX();
|
cachedClient = MockCachedElectrumXClient();
|
||||||
secureStore = FakeSecureStorage();
|
secureStore = FakeSecureStorage();
|
||||||
tracker = MockTransactionNotificationTracker();
|
tracker = MockTransactionNotificationTracker();
|
||||||
|
|
||||||
|
@ -176,8 +176,8 @@ void main() {
|
||||||
const testWalletId = "NMCtestWalletID";
|
const testWalletId = "NMCtestWalletID";
|
||||||
const testWalletName = "NMCWallet";
|
const testWalletName = "NMCWallet";
|
||||||
|
|
||||||
MockElectrumX? client;
|
MockElectrumXClient? client;
|
||||||
MockCachedElectrumX? cachedClient;
|
MockCachedElectrumXClient? cachedClient;
|
||||||
|
|
||||||
late FakeSecureStorage secureStore;
|
late FakeSecureStorage secureStore;
|
||||||
MockTransactionNotificationTracker? tracker;
|
MockTransactionNotificationTracker? tracker;
|
||||||
|
@ -185,8 +185,8 @@ void main() {
|
||||||
NamecoinWallet? nmc;
|
NamecoinWallet? nmc;
|
||||||
|
|
||||||
setUp(() async {
|
setUp(() async {
|
||||||
client = MockElectrumX();
|
client = MockElectrumXClient();
|
||||||
cachedClient = MockCachedElectrumX();
|
cachedClient = MockCachedElectrumXClient();
|
||||||
|
|
||||||
secureStore = FakeSecureStorage();
|
secureStore = FakeSecureStorage();
|
||||||
tracker = MockTransactionNotificationTracker();
|
tracker = MockTransactionNotificationTracker();
|
||||||
|
@ -377,8 +377,8 @@ void main() {
|
||||||
|
|
||||||
bool hiveAdaptersRegistered = false;
|
bool hiveAdaptersRegistered = false;
|
||||||
|
|
||||||
MockElectrumX? client;
|
MockElectrumXClient? client;
|
||||||
MockCachedElectrumX? cachedClient;
|
MockCachedElectrumXClient? cachedClient;
|
||||||
|
|
||||||
late FakeSecureStorage secureStore;
|
late FakeSecureStorage secureStore;
|
||||||
MockTransactionNotificationTracker? tracker;
|
MockTransactionNotificationTracker? tracker;
|
||||||
|
@ -394,8 +394,8 @@ void main() {
|
||||||
await wallets.put('currentWalletName', testWalletName);
|
await wallets.put('currentWalletName', testWalletName);
|
||||||
}
|
}
|
||||||
|
|
||||||
client = MockElectrumX();
|
client = MockElectrumXClient();
|
||||||
cachedClient = MockCachedElectrumX();
|
cachedClient = MockCachedElectrumXClient();
|
||||||
|
|
||||||
secureStore = FakeSecureStorage();
|
secureStore = FakeSecureStorage();
|
||||||
tracker = MockTransactionNotificationTracker();
|
tracker = MockTransactionNotificationTracker();
|
||||||
|
|
|
@ -300,14 +300,14 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
) as _i4.Future<Map<String, dynamic>>);
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
@override
|
@override
|
||||||
_i4.Future<Map<String, dynamic>> getAnonymitySet({
|
_i4.Future<Map<String, dynamic>> getLelantusAnonymitySet({
|
||||||
String? groupId = r'1',
|
String? groupId = r'1',
|
||||||
String? blockhash = r'',
|
String? blockhash = r'',
|
||||||
String? requestID,
|
String? requestID,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getAnonymitySet,
|
#getLelantusAnonymitySet,
|
||||||
[],
|
[],
|
||||||
{
|
{
|
||||||
#groupId: groupId,
|
#groupId: groupId,
|
||||||
|
@ -319,13 +319,13 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
) as _i4.Future<Map<String, dynamic>>);
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
@override
|
@override
|
||||||
_i4.Future<dynamic> getMintData({
|
_i4.Future<dynamic> getLelantusMintData({
|
||||||
dynamic mints,
|
dynamic mints,
|
||||||
String? requestID,
|
String? requestID,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getMintData,
|
#getLelantusMintData,
|
||||||
[],
|
[],
|
||||||
{
|
{
|
||||||
#mints: mints,
|
#mints: mints,
|
||||||
|
@ -335,13 +335,13 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
returnValue: _i4.Future<dynamic>.value(),
|
returnValue: _i4.Future<dynamic>.value(),
|
||||||
) as _i4.Future<dynamic>);
|
) as _i4.Future<dynamic>);
|
||||||
@override
|
@override
|
||||||
_i4.Future<Map<String, dynamic>> getUsedCoinSerials({
|
_i4.Future<Map<String, dynamic>> getLelantusUsedCoinSerials({
|
||||||
String? requestID,
|
String? requestID,
|
||||||
required int? startNumber,
|
required int? startNumber,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getUsedCoinSerials,
|
#getLelantusUsedCoinSerials,
|
||||||
[],
|
[],
|
||||||
{
|
{
|
||||||
#requestID: requestID,
|
#requestID: requestID,
|
||||||
|
@ -352,9 +352,73 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
) as _i4.Future<Map<String, dynamic>>);
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
@override
|
@override
|
||||||
_i4.Future<int> getLatestCoinId({String? requestID}) => (super.noSuchMethod(
|
_i4.Future<int> getLelantusLatestCoinId({String? requestID}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getLatestCoinId,
|
#getLelantusLatestCoinId,
|
||||||
|
[],
|
||||||
|
{#requestID: requestID},
|
||||||
|
),
|
||||||
|
returnValue: _i4.Future<int>.value(0),
|
||||||
|
) as _i4.Future<int>);
|
||||||
|
@override
|
||||||
|
_i4.Future<Map<String, dynamic>> getSparkAnonymitySet({
|
||||||
|
String? coinGroupId = r'1',
|
||||||
|
String? startBlockHash = r'',
|
||||||
|
String? requestID,
|
||||||
|
}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkAnonymitySet,
|
||||||
|
[],
|
||||||
|
{
|
||||||
|
#coinGroupId: coinGroupId,
|
||||||
|
#startBlockHash: startBlockHash,
|
||||||
|
#requestID: requestID,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
returnValue:
|
||||||
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
|
_i4.Future<Map<String, dynamic>> getSparkUsedCoinsTags({
|
||||||
|
String? requestID,
|
||||||
|
required int? startNumber,
|
||||||
|
}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkUsedCoinsTags,
|
||||||
|
[],
|
||||||
|
{
|
||||||
|
#requestID: requestID,
|
||||||
|
#startNumber: startNumber,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
returnValue:
|
||||||
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
|
_i4.Future<Map<String, dynamic>> getSparkMintMetaData({
|
||||||
|
String? requestID,
|
||||||
|
required List<String>? sparkCoinHashes,
|
||||||
|
}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkMintMetaData,
|
||||||
|
[],
|
||||||
|
{
|
||||||
|
#requestID: requestID,
|
||||||
|
#sparkCoinHashes: sparkCoinHashes,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
returnValue:
|
||||||
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
|
_i4.Future<int> getSparkLatestCoinId({String? requestID}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkLatestCoinId,
|
||||||
[],
|
[],
|
||||||
{#requestID: requestID},
|
{#requestID: requestID},
|
||||||
),
|
),
|
||||||
|
|
|
@ -48,8 +48,8 @@ void main() {
|
||||||
});
|
});
|
||||||
|
|
||||||
group("validate mainnet particl addresses", () {
|
group("validate mainnet particl addresses", () {
|
||||||
MockElectrumX? client;
|
MockElectrumXClient? client;
|
||||||
MockCachedElectrumX? cachedClient;
|
MockCachedElectrumXClient? cachedClient;
|
||||||
|
|
||||||
late FakeSecureStorage secureStore;
|
late FakeSecureStorage secureStore;
|
||||||
MockTransactionNotificationTracker? tracker;
|
MockTransactionNotificationTracker? tracker;
|
||||||
|
@ -58,8 +58,8 @@ void main() {
|
||||||
mainnetWallet; // TODO reimplement testnet, see 9baa30c1a40b422bb5f4746efc1220b52691ace6 and sneurlax/stack_wallet#ec399ade0aef1d9ab2dd78876a2d20819dae4ba0
|
mainnetWallet; // TODO reimplement testnet, see 9baa30c1a40b422bb5f4746efc1220b52691ace6 and sneurlax/stack_wallet#ec399ade0aef1d9ab2dd78876a2d20819dae4ba0
|
||||||
|
|
||||||
setUp(() {
|
setUp(() {
|
||||||
client = MockElectrumX();
|
client = MockElectrumXClient();
|
||||||
cachedClient = MockCachedElectrumX();
|
cachedClient = MockCachedElectrumXClient();
|
||||||
|
|
||||||
secureStore = FakeSecureStorage();
|
secureStore = FakeSecureStorage();
|
||||||
tracker = MockTransactionNotificationTracker();
|
tracker = MockTransactionNotificationTracker();
|
||||||
|
@ -165,8 +165,8 @@ void main() {
|
||||||
});
|
});
|
||||||
|
|
||||||
group("testNetworkConnection", () {
|
group("testNetworkConnection", () {
|
||||||
MockElectrumX? client;
|
MockElectrumXClient? client;
|
||||||
MockCachedElectrumX? cachedClient;
|
MockCachedElectrumXClient? cachedClient;
|
||||||
|
|
||||||
late FakeSecureStorage secureStore;
|
late FakeSecureStorage secureStore;
|
||||||
MockTransactionNotificationTracker? tracker;
|
MockTransactionNotificationTracker? tracker;
|
||||||
|
@ -174,8 +174,8 @@ void main() {
|
||||||
ParticlWallet? part;
|
ParticlWallet? part;
|
||||||
|
|
||||||
setUp(() {
|
setUp(() {
|
||||||
client = MockElectrumX();
|
client = MockElectrumXClient();
|
||||||
cachedClient = MockCachedElectrumX();
|
cachedClient = MockCachedElectrumXClient();
|
||||||
|
|
||||||
secureStore = FakeSecureStorage();
|
secureStore = FakeSecureStorage();
|
||||||
tracker = MockTransactionNotificationTracker();
|
tracker = MockTransactionNotificationTracker();
|
||||||
|
@ -226,8 +226,8 @@ void main() {
|
||||||
const testWalletId = "ParticltestWalletID";
|
const testWalletId = "ParticltestWalletID";
|
||||||
const testWalletName = "ParticlWallet";
|
const testWalletName = "ParticlWallet";
|
||||||
|
|
||||||
MockElectrumX? client;
|
MockElectrumXClient? client;
|
||||||
MockCachedElectrumX? cachedClient;
|
MockCachedElectrumXClient? cachedClient;
|
||||||
|
|
||||||
late FakeSecureStorage secureStore;
|
late FakeSecureStorage secureStore;
|
||||||
MockTransactionNotificationTracker? tracker;
|
MockTransactionNotificationTracker? tracker;
|
||||||
|
@ -235,8 +235,8 @@ void main() {
|
||||||
ParticlWallet? part;
|
ParticlWallet? part;
|
||||||
|
|
||||||
setUp(() async {
|
setUp(() async {
|
||||||
client = MockElectrumX();
|
client = MockElectrumXClient();
|
||||||
cachedClient = MockCachedElectrumX();
|
cachedClient = MockCachedElectrumXClient();
|
||||||
|
|
||||||
secureStore = FakeSecureStorage();
|
secureStore = FakeSecureStorage();
|
||||||
tracker = MockTransactionNotificationTracker();
|
tracker = MockTransactionNotificationTracker();
|
||||||
|
@ -427,8 +427,8 @@ void main() {
|
||||||
|
|
||||||
bool hiveAdaptersRegistered = false;
|
bool hiveAdaptersRegistered = false;
|
||||||
|
|
||||||
MockElectrumX? client;
|
MockElectrumXClient? client;
|
||||||
MockCachedElectrumX? cachedClient;
|
MockCachedElectrumXClient? cachedClient;
|
||||||
|
|
||||||
late FakeSecureStorage secureStore;
|
late FakeSecureStorage secureStore;
|
||||||
MockTransactionNotificationTracker? tracker;
|
MockTransactionNotificationTracker? tracker;
|
||||||
|
@ -444,8 +444,8 @@ void main() {
|
||||||
await wallets.put('currentWalletName', testWalletName);
|
await wallets.put('currentWalletName', testWalletName);
|
||||||
}
|
}
|
||||||
|
|
||||||
client = MockElectrumX();
|
client = MockElectrumXClient();
|
||||||
cachedClient = MockCachedElectrumX();
|
cachedClient = MockCachedElectrumXClient();
|
||||||
|
|
||||||
secureStore = FakeSecureStorage();
|
secureStore = FakeSecureStorage();
|
||||||
tracker = MockTransactionNotificationTracker();
|
tracker = MockTransactionNotificationTracker();
|
||||||
|
|
|
@ -300,14 +300,14 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
) as _i4.Future<Map<String, dynamic>>);
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
@override
|
@override
|
||||||
_i4.Future<Map<String, dynamic>> getAnonymitySet({
|
_i4.Future<Map<String, dynamic>> getLelantusAnonymitySet({
|
||||||
String? groupId = r'1',
|
String? groupId = r'1',
|
||||||
String? blockhash = r'',
|
String? blockhash = r'',
|
||||||
String? requestID,
|
String? requestID,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getAnonymitySet,
|
#getLelantusAnonymitySet,
|
||||||
[],
|
[],
|
||||||
{
|
{
|
||||||
#groupId: groupId,
|
#groupId: groupId,
|
||||||
|
@ -319,13 +319,13 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
) as _i4.Future<Map<String, dynamic>>);
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
@override
|
@override
|
||||||
_i4.Future<dynamic> getMintData({
|
_i4.Future<dynamic> getLelantusMintData({
|
||||||
dynamic mints,
|
dynamic mints,
|
||||||
String? requestID,
|
String? requestID,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getMintData,
|
#getLelantusMintData,
|
||||||
[],
|
[],
|
||||||
{
|
{
|
||||||
#mints: mints,
|
#mints: mints,
|
||||||
|
@ -335,13 +335,13 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
returnValue: _i4.Future<dynamic>.value(),
|
returnValue: _i4.Future<dynamic>.value(),
|
||||||
) as _i4.Future<dynamic>);
|
) as _i4.Future<dynamic>);
|
||||||
@override
|
@override
|
||||||
_i4.Future<Map<String, dynamic>> getUsedCoinSerials({
|
_i4.Future<Map<String, dynamic>> getLelantusUsedCoinSerials({
|
||||||
String? requestID,
|
String? requestID,
|
||||||
required int? startNumber,
|
required int? startNumber,
|
||||||
}) =>
|
}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getUsedCoinSerials,
|
#getLelantusUsedCoinSerials,
|
||||||
[],
|
[],
|
||||||
{
|
{
|
||||||
#requestID: requestID,
|
#requestID: requestID,
|
||||||
|
@ -352,9 +352,73 @@ class MockElectrumXClient extends _i1.Mock implements _i3.ElectrumXClient {
|
||||||
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
) as _i4.Future<Map<String, dynamic>>);
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
@override
|
@override
|
||||||
_i4.Future<int> getLatestCoinId({String? requestID}) => (super.noSuchMethod(
|
_i4.Future<int> getLelantusLatestCoinId({String? requestID}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getLatestCoinId,
|
#getLelantusLatestCoinId,
|
||||||
|
[],
|
||||||
|
{#requestID: requestID},
|
||||||
|
),
|
||||||
|
returnValue: _i4.Future<int>.value(0),
|
||||||
|
) as _i4.Future<int>);
|
||||||
|
@override
|
||||||
|
_i4.Future<Map<String, dynamic>> getSparkAnonymitySet({
|
||||||
|
String? coinGroupId = r'1',
|
||||||
|
String? startBlockHash = r'',
|
||||||
|
String? requestID,
|
||||||
|
}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkAnonymitySet,
|
||||||
|
[],
|
||||||
|
{
|
||||||
|
#coinGroupId: coinGroupId,
|
||||||
|
#startBlockHash: startBlockHash,
|
||||||
|
#requestID: requestID,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
returnValue:
|
||||||
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
|
_i4.Future<Map<String, dynamic>> getSparkUsedCoinsTags({
|
||||||
|
String? requestID,
|
||||||
|
required int? startNumber,
|
||||||
|
}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkUsedCoinsTags,
|
||||||
|
[],
|
||||||
|
{
|
||||||
|
#requestID: requestID,
|
||||||
|
#startNumber: startNumber,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
returnValue:
|
||||||
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
|
_i4.Future<Map<String, dynamic>> getSparkMintMetaData({
|
||||||
|
String? requestID,
|
||||||
|
required List<String>? sparkCoinHashes,
|
||||||
|
}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkMintMetaData,
|
||||||
|
[],
|
||||||
|
{
|
||||||
|
#requestID: requestID,
|
||||||
|
#sparkCoinHashes: sparkCoinHashes,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
returnValue:
|
||||||
|
_i4.Future<Map<String, dynamic>>.value(<String, dynamic>{}),
|
||||||
|
) as _i4.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
|
_i4.Future<int> getSparkLatestCoinId({String? requestID}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#getSparkLatestCoinId,
|
||||||
[],
|
[],
|
||||||
{#requestID: requestID},
|
{#requestID: requestID},
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue