mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-22 11:29:23 +00:00
fix price test and update mocks
This commit is contained in:
parent
4b518243c6
commit
6214688768
19 changed files with 4335 additions and 4166 deletions
|
@ -33,8 +33,7 @@ class PriceAPI {
|
|||
static const Duration refreshIntervalDuration =
|
||||
Duration(seconds: refreshInterval);
|
||||
|
||||
// final Client client;
|
||||
HTTP client = HTTP();
|
||||
final HTTP client;
|
||||
|
||||
PriceAPI(this.client);
|
||||
|
||||
|
|
|
@ -582,14 +582,14 @@ class MockPrefs extends _i1.Mock implements _i5.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get torKillswitch => (super.noSuchMethod(
|
||||
Invocation.getter(#torKillswitch),
|
||||
bool get torKillSwitch => (super.noSuchMethod(
|
||||
Invocation.getter(#torKillSwitch),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
set torKillswitch(bool? torKillswitch) => super.noSuchMethod(
|
||||
set torKillSwitch(bool? torKillswitch) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#torKillswitch,
|
||||
#torKillSwitch,
|
||||
torKillswitch,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
|
|
|
@ -1524,7 +1524,7 @@ void main() {
|
|||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((_) => false);
|
||||
when(mockPrefs.torKillswitch)
|
||||
when(mockPrefs.torKillSwitch)
|
||||
.thenAnswer((_) => false); // Or true, shouldn't matter.
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final mockTorService = MockTorService();
|
||||
|
@ -1549,7 +1549,7 @@ void main() {
|
|||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verify(mockPrefs.useTor).called(1);
|
||||
verifyNever(mockPrefs.torKillswitch);
|
||||
verifyNever(mockPrefs.torKillSwitch);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
verifyNever(mockTorService.enabled);
|
||||
verifyNoMoreInteractions(mockTorService);
|
||||
|
@ -1571,7 +1571,7 @@ void main() {
|
|||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((_) => true);
|
||||
when(mockPrefs.torKillswitch).thenAnswer((_) => false);
|
||||
when(mockPrefs.torKillSwitch).thenAnswer((_) => false);
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
|
||||
final mockTorService = MockTorService();
|
||||
|
@ -1599,7 +1599,7 @@ void main() {
|
|||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verify(mockPrefs.useTor).called(1);
|
||||
verify(mockPrefs.torKillswitch).called(1);
|
||||
verify(mockPrefs.torKillSwitch).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
verify(mockTorService.enabled).called(1);
|
||||
verifyNever(mockTorService.proxyInfo);
|
||||
|
@ -1624,7 +1624,7 @@ void main() {
|
|||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((_) => true);
|
||||
when(mockPrefs.torKillswitch).thenAnswer((_) => false); // Or true.
|
||||
when(mockPrefs.torKillSwitch).thenAnswer((_) => false); // Or true.
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
|
||||
final mockTorService = MockTorService();
|
||||
|
@ -1651,7 +1651,7 @@ void main() {
|
|||
verify(mockClient.proxyInfo).called(1);
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verify(mockPrefs.useTor).called(1);
|
||||
verifyNever(mockPrefs.torKillswitch);
|
||||
verifyNever(mockPrefs.torKillSwitch);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
verify(mockTorService.enabled).called(1);
|
||||
verify(mockTorService.proxyInfo).called(1);
|
||||
|
@ -1682,7 +1682,7 @@ void main() {
|
|||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((_) => true);
|
||||
when(mockPrefs.torKillswitch).thenAnswer((_) => true);
|
||||
when(mockPrefs.torKillSwitch).thenAnswer((_) => true);
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final mockTorService = MockTorService();
|
||||
when(mockTorService.enabled).thenAnswer((_) => false);
|
||||
|
@ -1710,7 +1710,7 @@ void main() {
|
|||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verify(mockPrefs.useTor).called(1);
|
||||
verify(mockPrefs.torKillswitch).called(1);
|
||||
verify(mockPrefs.torKillSwitch).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
verify(mockTorService.enabled).called(1);
|
||||
verifyNoMoreInteractions(mockTorService);
|
||||
|
@ -1737,7 +1737,7 @@ void main() {
|
|||
|
||||
final mockPrefs = MockPrefs();
|
||||
when(mockPrefs.useTor).thenAnswer((_) => true);
|
||||
when(mockPrefs.torKillswitch).thenAnswer((_) => false);
|
||||
when(mockPrefs.torKillSwitch).thenAnswer((_) => false);
|
||||
when(mockPrefs.wifiOnly).thenAnswer((_) => false);
|
||||
final mockTorService = MockTorService();
|
||||
when(mockTorService.enabled).thenAnswer((_) => false);
|
||||
|
@ -1761,7 +1761,7 @@ void main() {
|
|||
|
||||
verify(mockPrefs.wifiOnly).called(1);
|
||||
verify(mockPrefs.useTor).called(1);
|
||||
verify(mockPrefs.torKillswitch).called(1);
|
||||
verify(mockPrefs.torKillSwitch).called(1);
|
||||
verifyNoMoreInteractions(mockPrefs);
|
||||
verify(mockTorService.enabled).called(1);
|
||||
verifyNoMoreInteractions(mockTorService);
|
||||
|
|
|
@ -15,6 +15,7 @@ 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;
|
||||
import 'package:tor_ffi_plugin/tor_ffi_plugin.dart' as _i12;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
|
@ -321,14 +322,14 @@ class MockPrefs extends _i1.Mock implements _i5.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get torKillswitch => (super.noSuchMethod(
|
||||
Invocation.getter(#torKillswitch),
|
||||
bool get torKillSwitch => (super.noSuchMethod(
|
||||
Invocation.getter(#torKillSwitch),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
set torKillswitch(bool? torKillswitch) => super.noSuchMethod(
|
||||
set torKillSwitch(bool? torKillswitch) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#torKillswitch,
|
||||
#torKillSwitch,
|
||||
torKillswitch,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
|
@ -674,6 +675,15 @@ class MockTorService extends _i1.Mock implements _i11.TorService {
|
|||
),
|
||||
) as ({_i3.InternetAddress host, int port}));
|
||||
@override
|
||||
void init({_i12.Tor? mockableOverride}) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#init,
|
||||
[],
|
||||
{#mockableOverride: mockableOverride},
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i4.Future<void> start() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#start,
|
||||
|
|
|
@ -3,13 +3,14 @@
|
|||
// Do not manually edit this file.
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i5;
|
||||
import 'dart:typed_data' as _i6;
|
||||
import 'dart:async' as _i6;
|
||||
import 'dart:typed_data' as _i7;
|
||||
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:stackwallet/db/isar/main_db.dart' as _i2;
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart' as _i4;
|
||||
import 'package:stackwallet/themes/theme_service.dart' as _i3;
|
||||
import 'package:stackwallet/db/isar/main_db.dart' as _i3;
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart' as _i5;
|
||||
import 'package:stackwallet/networking/http.dart' as _i2;
|
||||
import 'package:stackwallet/themes/theme_service.dart' as _i4;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
|
@ -22,8 +23,18 @@ import 'package:stackwallet/themes/theme_service.dart' as _i3;
|
|||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB {
|
||||
_FakeMainDB_0(
|
||||
class _FakeHTTP_0 extends _i1.SmartFake implements _i2.HTTP {
|
||||
_FakeHTTP_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeMainDB_1 extends _i1.SmartFake implements _i3.MainDB {
|
||||
_FakeMainDB_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
|
@ -35,26 +46,42 @@ class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB {
|
|||
/// A class which mocks [ThemeService].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockThemeService extends _i1.Mock implements _i3.ThemeService {
|
||||
class MockThemeService extends _i1.Mock implements _i4.ThemeService {
|
||||
MockThemeService() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_i2.MainDB get db => (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,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i3.MainDB get db => (super.noSuchMethod(
|
||||
Invocation.getter(#db),
|
||||
returnValue: _FakeMainDB_0(
|
||||
returnValue: _FakeMainDB_1(
|
||||
this,
|
||||
Invocation.getter(#db),
|
||||
),
|
||||
) as _i2.MainDB);
|
||||
) as _i3.MainDB);
|
||||
@override
|
||||
List<_i4.StackTheme> get installedThemes => (super.noSuchMethod(
|
||||
List<_i5.StackTheme> get installedThemes => (super.noSuchMethod(
|
||||
Invocation.getter(#installedThemes),
|
||||
returnValue: <_i4.StackTheme>[],
|
||||
) as List<_i4.StackTheme>);
|
||||
returnValue: <_i5.StackTheme>[],
|
||||
) as List<_i5.StackTheme>);
|
||||
@override
|
||||
void init(_i2.MainDB? db) => super.noSuchMethod(
|
||||
void init(_i3.MainDB? db) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#init,
|
||||
[db],
|
||||
|
@ -62,70 +89,70 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i5.Future<void> install({required _i6.Uint8List? themeArchiveData}) =>
|
||||
_i6.Future<void> install({required _i7.Uint8List? themeArchiveData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#install,
|
||||
[],
|
||||
{#themeArchiveData: themeArchiveData},
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
@override
|
||||
_i5.Future<void> remove({required String? themeId}) => (super.noSuchMethod(
|
||||
_i6.Future<void> remove({required String? themeId}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#remove,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
@override
|
||||
_i5.Future<void> checkDefaultThemesOnStartup() => (super.noSuchMethod(
|
||||
_i6.Future<void> checkDefaultThemesOnStartup() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#checkDefaultThemesOnStartup,
|
||||
[],
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
@override
|
||||
_i5.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||
_i6.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#verifyInstalled,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i5.Future<bool>.value(false),
|
||||
) as _i5.Future<bool>);
|
||||
returnValue: _i6.Future<bool>.value(false),
|
||||
) as _i6.Future<bool>);
|
||||
@override
|
||||
_i5.Future<List<_i3.StackThemeMetaData>> fetchThemes() => (super.noSuchMethod(
|
||||
_i6.Future<List<_i4.StackThemeMetaData>> fetchThemes() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchThemes,
|
||||
[],
|
||||
),
|
||||
returnValue: _i5.Future<List<_i3.StackThemeMetaData>>.value(
|
||||
<_i3.StackThemeMetaData>[]),
|
||||
) as _i5.Future<List<_i3.StackThemeMetaData>>);
|
||||
returnValue: _i6.Future<List<_i4.StackThemeMetaData>>.value(
|
||||
<_i4.StackThemeMetaData>[]),
|
||||
) as _i6.Future<List<_i4.StackThemeMetaData>>);
|
||||
@override
|
||||
_i5.Future<_i6.Uint8List> fetchTheme(
|
||||
{required _i3.StackThemeMetaData? themeMetaData}) =>
|
||||
_i6.Future<_i7.Uint8List> fetchTheme(
|
||||
{required _i4.StackThemeMetaData? themeMetaData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchTheme,
|
||||
[],
|
||||
{#themeMetaData: themeMetaData},
|
||||
),
|
||||
returnValue: _i5.Future<_i6.Uint8List>.value(_i6.Uint8List(0)),
|
||||
) as _i5.Future<_i6.Uint8List>);
|
||||
returnValue: _i6.Future<_i7.Uint8List>.value(_i7.Uint8List(0)),
|
||||
) as _i6.Future<_i7.Uint8List>);
|
||||
@override
|
||||
_i4.StackTheme? getTheme({required String? themeId}) =>
|
||||
_i5.StackTheme? getTheme({required String? themeId}) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
#getTheme,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
)) as _i4.StackTheme?);
|
||||
)) as _i5.StackTheme?);
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,17 +1,18 @@
|
|||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:hive_test/hive_test.dart';
|
||||
import 'package:http/http.dart';
|
||||
import 'package:mockito/annotations.dart';
|
||||
import 'package:mockito/mockito.dart';
|
||||
import 'package:stackwallet/db/hive/db.dart';
|
||||
import 'package:stackwallet/networking/http.dart';
|
||||
import 'package:stackwallet/services/price.dart';
|
||||
|
||||
import 'price_test.mocks.dart';
|
||||
|
||||
@GenerateMocks([Client])
|
||||
@GenerateMocks([HTTP])
|
||||
void main() {
|
||||
setUp(() async {
|
||||
await setUpTestHive();
|
||||
|
@ -22,10 +23,11 @@ void main() {
|
|||
});
|
||||
|
||||
test("getPricesAnd24hChange fetch", () async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
|
||||
when(client.get(
|
||||
Uri.parse(
|
||||
proxyInfo: null,
|
||||
url: Uri.parse(
|
||||
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&ids"
|
||||
"=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,bitcoin-cash"
|
||||
",namecoin,wownero,ethereum,particl,nano,banano,stellar,tezos"
|
||||
|
@ -34,63 +36,64 @@ void main() {
|
|||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
})).thenAnswer((_) async => Response(
|
||||
'[{"id":"bitcoin","symbol":"btc","name":"Bitcoin","image":"https://asse'
|
||||
'ts.coingecko.com/coins/images/1/large/bitcoin.png?1547033579","curr'
|
||||
'ent_price":1.0,"market_cap":19128800,"market_cap_rank":1,"fully_dil'
|
||||
'uted_valuation":21000000,"total_volume":1272132,"high_24h":1.0,"low'
|
||||
'_24h":1.0,"price_change_24h":0.0,"price_change_percentage_24h":0.0,'
|
||||
'"market_cap_change_24h":950.0,"market_cap_change_percentage_24h":0.0'
|
||||
'0497,"circulating_supply":19128800.0,"total_supply":21000000.0,"max'
|
||||
'_supply":21000000.0,"ath":1.003301,"ath_change_percentage":-0.32896'
|
||||
',"ath_date":"2019-10-15T16:00:56.136Z","atl":0.99895134,"atl_change_'
|
||||
'percentage":0.10498,"atl_date":"2019-10-21T00:00:00.000Z","roi":nul'
|
||||
'l,"last_updated":"2022-08-22T16:37:59.237Z"},{"id":"dogecoin","symb'
|
||||
'ol":"doge","name":"Dogecoin","image":"https://assets.coingecko.com/'
|
||||
'coins/images/5/large/dogecoin.png?1547792256","current_price":3.15e'
|
||||
'-06,"market_cap":417916,"market_cap_rank":10,"fully_diluted_valuati'
|
||||
'on":null,"total_volume":27498,"high_24h":3.26e-06,"low_24h":3.13e-0'
|
||||
'6,"price_change_24h":-8.6889947714e-08,"price_change_percentage_24h'
|
||||
'":-2.68533,"market_cap_change_24h":-11370.894861206936,"market_cap_c'
|
||||
'hange_percentage_24h":-2.64879,"circulating_supply":132670764299.89'
|
||||
'4,"total_supply":null,"max_supply":null,"ath":1.264e-05,"ath_change'
|
||||
'_percentage":-75.05046,"ath_date":"2021-05-07T23:04:53.026Z","atl":'
|
||||
'1.50936e-07,"atl_change_percentage":1989.69346,"atl_date":"2020-12-'
|
||||
'17T09:18:05.654Z","roi":null,"last_updated":"2022-08-22T16:38:15.11'
|
||||
'3Z"},{"id":"monero","symbol":"xmr","name":"Monero","image":"https:/'
|
||||
'/assets.coingecko.com/coins/images/69/large/monero_logo.png?1547033'
|
||||
'729","current_price":0.00717236,"market_cap":130002,"market_cap_ran'
|
||||
'k":29,"fully_diluted_valuation":null,"total_volume":4901,"high_24h":'
|
||||
'0.00731999,"low_24h":0.00707511,"price_change_24h":-5.6133543212467'
|
||||
'e-05,"price_change_percentage_24h":-0.77656,"market_cap_change_24h"'
|
||||
':-1007.8447677436197,"market_cap_change_percentage_24h":-0.76929,"c'
|
||||
'irculating_supply":18147820.3764146,"total_supply":null,"max_supply'
|
||||
'":null,"ath":0.03475393,"ath_change_percentage":-79.32037,"ath_date'
|
||||
'":"2018-01-09T00:00:00.000Z","atl":0.00101492,"atl_change_percentag'
|
||||
'e":608.13327,"atl_date":"2014-12-18T00:00:00.000Z","roi":null,"las'
|
||||
't_updated":"2022-08-22T16:38:26.347Z"},{"id":"zcoin","symbol":"firo'
|
||||
'","name":"Firo","image":"https://assets.coingecko.com/coins/images/'
|
||||
'479/large/firocoingecko.png?1636537544","current_price":0.0001096,"'
|
||||
'market_cap":1252,"market_cap_rank":604,"fully_diluted_valuation":234'
|
||||
'9,"total_volume":90.573,"high_24h":0.00011148,"low_24h":0.00010834,'
|
||||
'"price_change_24h":-9.87561775002e-07,"price_change_percentage_24h'
|
||||
'":-0.89304,"market_cap_change_24h":-10.046635178462793,"market_cap_'
|
||||
'change_percentage_24h":-0.79578,"circulating_supply":11411043.83546'
|
||||
'97,"total_supply":21400000.0,"max_supply":21400000.0,"ath":0.016162'
|
||||
'72,"ath_change_percentage":-99.3208,"ath_date":"2018-04-04T16:04:48.'
|
||||
'408Z","atl":4.268e-05,"atl_change_percentage":157.22799,"atl_date":"'
|
||||
'2022-05-12T07:28:47.088Z","roi":null,"last_updated":"2022-08-22T16'
|
||||
':38:47.229Z"},{"id":"epic-cash","symbol":"epic","name":"Epic Cash",'
|
||||
'"image":"https://assets.coingecko.com/coins/images/9520/large/Epic_C'
|
||||
'oin_NO_drop_shadow.png?1620122642","current_price":2.803e-05,"marke'
|
||||
't_cap":415.109,"market_cap_rank":953,"fully_diluted_valuation":null'
|
||||
',"total_volume":0.2371557,"high_24h":3.053e-05,"low_24h":2.581e-05'
|
||||
',"price_change_24h":1.9e-06,"price_change_percentage_24h":7.27524,"'
|
||||
'market_cap_change_24h":28.26753,"market_cap_change_percentage_24h":'
|
||||
'7.30726,"circulating_supply":14808052.0,"total_supply":21000000.0,"'
|
||||
'max_supply":null,"ath":0.00013848,"ath_change_percentage":-79.75864'
|
||||
',"ath_date":"2021-12-11T08:39:41.129Z","atl":5.74028e-07,"atl_chang'
|
||||
'e_percentage":4783.08078,"atl_date":"2020-03-13T16:55:01.177Z","roi'
|
||||
'":null,"last_updated":"2022-08-22T16:38:32.826Z"}]',
|
||||
utf8.encode(
|
||||
'[{"id":"bitcoin","symbol":"btc","name":"Bitcoin","image":"https://asse'
|
||||
'ts.coingecko.com/coins/images/1/large/bitcoin.png?1547033579","curr'
|
||||
'ent_price":1.0,"market_cap":19128800,"market_cap_rank":1,"fully_dil'
|
||||
'uted_valuation":21000000,"total_volume":1272132,"high_24h":1.0,"low'
|
||||
'_24h":1.0,"price_change_24h":0.0,"price_change_percentage_24h":0.0,'
|
||||
'"market_cap_change_24h":950.0,"market_cap_change_percentage_24h":0.0'
|
||||
'0497,"circulating_supply":19128800.0,"total_supply":21000000.0,"max'
|
||||
'_supply":21000000.0,"ath":1.003301,"ath_change_percentage":-0.32896'
|
||||
',"ath_date":"2019-10-15T16:00:56.136Z","atl":0.99895134,"atl_change_'
|
||||
'percentage":0.10498,"atl_date":"2019-10-21T00:00:00.000Z","roi":nul'
|
||||
'l,"last_updated":"2022-08-22T16:37:59.237Z"},{"id":"dogecoin","symb'
|
||||
'ol":"doge","name":"Dogecoin","image":"https://assets.coingecko.com/'
|
||||
'coins/images/5/large/dogecoin.png?1547792256","current_price":3.15e'
|
||||
'-06,"market_cap":417916,"market_cap_rank":10,"fully_diluted_valuati'
|
||||
'on":null,"total_volume":27498,"high_24h":3.26e-06,"low_24h":3.13e-0'
|
||||
'6,"price_change_24h":-8.6889947714e-08,"price_change_percentage_24h'
|
||||
'":-2.68533,"market_cap_change_24h":-11370.894861206936,"market_cap_c'
|
||||
'hange_percentage_24h":-2.64879,"circulating_supply":132670764299.89'
|
||||
'4,"total_supply":null,"max_supply":null,"ath":1.264e-05,"ath_change'
|
||||
'_percentage":-75.05046,"ath_date":"2021-05-07T23:04:53.026Z","atl":'
|
||||
'1.50936e-07,"atl_change_percentage":1989.69346,"atl_date":"2020-12-'
|
||||
'17T09:18:05.654Z","roi":null,"last_updated":"2022-08-22T16:38:15.11'
|
||||
'3Z"},{"id":"monero","symbol":"xmr","name":"Monero","image":"https:/'
|
||||
'/assets.coingecko.com/coins/images/69/large/monero_logo.png?1547033'
|
||||
'729","current_price":0.00717236,"market_cap":130002,"market_cap_ran'
|
||||
'k":29,"fully_diluted_valuation":null,"total_volume":4901,"high_24h":'
|
||||
'0.00731999,"low_24h":0.00707511,"price_change_24h":-5.6133543212467'
|
||||
'e-05,"price_change_percentage_24h":-0.77656,"market_cap_change_24h"'
|
||||
':-1007.8447677436197,"market_cap_change_percentage_24h":-0.76929,"c'
|
||||
'irculating_supply":18147820.3764146,"total_supply":null,"max_supply'
|
||||
'":null,"ath":0.03475393,"ath_change_percentage":-79.32037,"ath_date'
|
||||
'":"2018-01-09T00:00:00.000Z","atl":0.00101492,"atl_change_percentag'
|
||||
'e":608.13327,"atl_date":"2014-12-18T00:00:00.000Z","roi":null,"las'
|
||||
't_updated":"2022-08-22T16:38:26.347Z"},{"id":"zcoin","symbol":"firo'
|
||||
'","name":"Firo","image":"https://assets.coingecko.com/coins/images/'
|
||||
'479/large/firocoingecko.png?1636537544","current_price":0.0001096,"'
|
||||
'market_cap":1252,"market_cap_rank":604,"fully_diluted_valuation":234'
|
||||
'9,"total_volume":90.573,"high_24h":0.00011148,"low_24h":0.00010834,'
|
||||
'"price_change_24h":-9.87561775002e-07,"price_change_percentage_24h'
|
||||
'":-0.89304,"market_cap_change_24h":-10.046635178462793,"market_cap_'
|
||||
'change_percentage_24h":-0.79578,"circulating_supply":11411043.83546'
|
||||
'97,"total_supply":21400000.0,"max_supply":21400000.0,"ath":0.016162'
|
||||
'72,"ath_change_percentage":-99.3208,"ath_date":"2018-04-04T16:04:48.'
|
||||
'408Z","atl":4.268e-05,"atl_change_percentage":157.22799,"atl_date":"'
|
||||
'2022-05-12T07:28:47.088Z","roi":null,"last_updated":"2022-08-22T16'
|
||||
':38:47.229Z"},{"id":"epic-cash","symbol":"epic","name":"Epic Cash",'
|
||||
'"image":"https://assets.coingecko.com/coins/images/9520/large/Epic_C'
|
||||
'oin_NO_drop_shadow.png?1620122642","current_price":2.803e-05,"marke'
|
||||
't_cap":415.109,"market_cap_rank":953,"fully_diluted_valuation":null'
|
||||
',"total_volume":0.2371557,"high_24h":3.053e-05,"low_24h":2.581e-05'
|
||||
',"price_change_24h":1.9e-06,"price_change_percentage_24h":7.27524,"'
|
||||
'market_cap_change_24h":28.26753,"market_cap_change_percentage_24h":'
|
||||
'7.30726,"circulating_supply":14808052.0,"total_supply":21000000.0,"'
|
||||
'max_supply":null,"ath":0.00013848,"ath_change_percentage":-79.75864'
|
||||
',"ath_date":"2021-12-11T08:39:41.129Z","atl":5.74028e-07,"atl_chang'
|
||||
'e_percentage":4783.08078,"atl_date":"2020-03-13T16:55:01.177Z","roi'
|
||||
'":null,"last_updated":"2022-08-22T16:38:32.826Z"}]'),
|
||||
200));
|
||||
|
||||
final priceAPI = PriceAPI(client);
|
||||
|
@ -126,7 +129,8 @@ void main() {
|
|||
'}',
|
||||
);
|
||||
verify(client.get(
|
||||
Uri.parse(
|
||||
proxyInfo: null,
|
||||
url: Uri.parse(
|
||||
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc"
|
||||
"&ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,"
|
||||
"bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano,stellar"
|
||||
|
@ -139,10 +143,11 @@ void main() {
|
|||
});
|
||||
|
||||
test("cached price fetch", () async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
|
||||
when(client.get(
|
||||
Uri.parse(
|
||||
proxyInfo: null,
|
||||
url: Uri.parse(
|
||||
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&"
|
||||
"ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,"
|
||||
"bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano,stellar"
|
||||
|
@ -151,63 +156,64 @@ void main() {
|
|||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
})).thenAnswer((_) async => Response(
|
||||
'[{"id":"bitcoin","symbol":"btc","name":"Bitcoin","image":"https://a'
|
||||
'ssets.coingecko.com/coins/images/1/large/bitcoin.png?1547033579","c'
|
||||
'urrent_price":1.0,"market_cap":19128800,"market_cap_rank":1,"fully_'
|
||||
'diluted_valuation":21000000,"total_volume":1272132,"high_24h":1.0,"'
|
||||
'low_24h":1.0,"price_change_24h":0.0,"price_change_percentage_24h":0'
|
||||
'.0,"market_cap_change_24h":950.0,"market_cap_change_percentage_24h"'
|
||||
':0.00497,"circulating_supply":19128800.0,"total_supply":21000000.0,"'
|
||||
'max_supply":21000000.0,"ath":1.003301,"ath_change_percentage":-0.32'
|
||||
'896,"ath_date":"2019-10-15T16:00:56.136Z","atl":0.99895134,"atl_cha'
|
||||
'nge_percentage":0.10498,"atl_date":"2019-10-21T00:00:00.000Z","roi"'
|
||||
':null,"last_updated":"2022-08-22T16:37:59.237Z"},{"id":"dogecoin","'
|
||||
'symbol":"doge","name":"Dogecoin","image":"https://assets.coingecko.'
|
||||
'com/coins/images/5/large/dogecoin.png?1547792256","current_price":3'
|
||||
'.15e-06,"market_cap":417916,"market_cap_rank":10,"fully_diluted_val'
|
||||
'uation":null,"total_volume":27498,"high_24h":3.26e-06,"low_24h":3.1'
|
||||
'3e-06,"price_change_24h":-8.6889947714e-08,"price_change_percentage'
|
||||
'_24h":-2.68533,"market_cap_change_24h":-11370.894861206936,"market_'
|
||||
'cap_change_percentage_24h":-2.64879,"circulating_supply":1326707642'
|
||||
'99.894,"total_supply":null,"max_supply":null,"ath":1.264e-05,"ath_c'
|
||||
'hange_percentage":-75.05046,"ath_date":"2021-05-07T23:04:53.026Z","'
|
||||
'atl":1.50936e-07,"atl_change_percentage":1989.69346,"atl_date":"202'
|
||||
'0-12-17T09:18:05.654Z","roi":null,"last_updated":"2022-08-22T16:38:'
|
||||
'15.113Z"},{"id":"monero","symbol":"xmr","name":"Monero","image":"ht'
|
||||
'tps://assets.coingecko.com/coins/images/69/large/monero_logo.png?15'
|
||||
'47033729","current_price":0.00717236,"market_cap":130002,"market_cap'
|
||||
'_rank":29,"fully_diluted_valuation":null,"total_volume":4901,"high'
|
||||
'_24h":0.00731999,"low_24h":0.00707511,"price_change_24h":-5.613354'
|
||||
'3212467e-05,"price_change_percentage_24h":-0.77656,"market_cap_chan'
|
||||
'ge_24h":-1007.8447677436197,"market_cap_change_percentage_24h":-0.7'
|
||||
'6929,"circulating_supply":18147820.3764146,"total_supply":null,"ma'
|
||||
'x_supply":null,"ath":0.03475393,"ath_change_percentage":-79.32037,"'
|
||||
'ath_date":"2018-01-09T00:00:00.000Z","atl":0.00101492,"atl_change_'
|
||||
'percentage":608.13327,"atl_date":"2014-12-18T00:00:00.000Z","roi":n'
|
||||
'ull,"last_updated":"2022-08-22T16:38:26.347Z"},{"id":"zcoin","symbo'
|
||||
'l":"firo","name":"Firo","image":"https://assets.coingecko.com/coins'
|
||||
'/images/479/large/firocoingecko.png?1636537544","current_price":0.0'
|
||||
'001096,"market_cap":1252,"market_cap_rank":604,"fully_diluted_valu'
|
||||
'ation":2349,"total_volume":90.573,"high_24h":0.00011148,"low_24h":0'
|
||||
'.00010834,"price_change_24h":-9.87561775002e-07,"price_change_perce'
|
||||
'ntage_24h":-0.89304,"market_cap_change_24h":-10.046635178462793,"ma'
|
||||
'rket_cap_change_percentage_24h":-0.79578,"circulating_supply":11411'
|
||||
'043.8354697,"total_supply":21400000.0,"max_supply":21400000.0,"ath"'
|
||||
':0.01616272,"ath_change_percentage":-99.3208,"ath_date":"2018-04-04'
|
||||
'T16:04:48.408Z","atl":4.268e-05,"atl_change_percentage":157.22799,'
|
||||
'"atl_date":"2022-05-12T07:28:47.088Z","roi":null,"last_updated":"2'
|
||||
'022-08-22T16:38:47.229Z"},{"id":"epic-cash","symbol":"epic","name":"'
|
||||
'Epic Cash","image":"https://assets.coingecko.com/coins/images/9520/'
|
||||
'large/Epic_Coin_NO_drop_shadow.png?1620122642","current_price":2.80'
|
||||
'3e-05,"market_cap":415.109,"market_cap_rank":953,"fully_diluted_val'
|
||||
'uation":null,"total_volume":0.2371557,"high_24h":3.053e-05,"low_24h'
|
||||
'":2.581e-05,"price_change_24h":1.9e-06,"price_change_percentage_24'
|
||||
'h":7.27524,"market_cap_change_24h":28.26753,"market_cap_change_perc'
|
||||
'entage_24h":7.30726,"circulating_supply":14808052.0,"total_supply":'
|
||||
'21000000.0,"max_supply":null,"ath":0.00013848,"ath_change_percentag'
|
||||
'e":-79.75864,"ath_date":"2021-12-11T08:39:41.129Z","atl":5.74028e-0'
|
||||
'7,"atl_change_percentage":4783.08078,"atl_date":"2020-03-13T16:55:01'
|
||||
'.177Z","roi":null,"last_updated":"2022-08-22T16:38:32.826Z"}]',
|
||||
utf8.encode(
|
||||
'[{"id":"bitcoin","symbol":"btc","name":"Bitcoin","image":"https://a'
|
||||
'ssets.coingecko.com/coins/images/1/large/bitcoin.png?1547033579","c'
|
||||
'urrent_price":1.0,"market_cap":19128800,"market_cap_rank":1,"fully_'
|
||||
'diluted_valuation":21000000,"total_volume":1272132,"high_24h":1.0,"'
|
||||
'low_24h":1.0,"price_change_24h":0.0,"price_change_percentage_24h":0'
|
||||
'.0,"market_cap_change_24h":950.0,"market_cap_change_percentage_24h"'
|
||||
':0.00497,"circulating_supply":19128800.0,"total_supply":21000000.0,"'
|
||||
'max_supply":21000000.0,"ath":1.003301,"ath_change_percentage":-0.32'
|
||||
'896,"ath_date":"2019-10-15T16:00:56.136Z","atl":0.99895134,"atl_cha'
|
||||
'nge_percentage":0.10498,"atl_date":"2019-10-21T00:00:00.000Z","roi"'
|
||||
':null,"last_updated":"2022-08-22T16:37:59.237Z"},{"id":"dogecoin","'
|
||||
'symbol":"doge","name":"Dogecoin","image":"https://assets.coingecko.'
|
||||
'com/coins/images/5/large/dogecoin.png?1547792256","current_price":3'
|
||||
'.15e-06,"market_cap":417916,"market_cap_rank":10,"fully_diluted_val'
|
||||
'uation":null,"total_volume":27498,"high_24h":3.26e-06,"low_24h":3.1'
|
||||
'3e-06,"price_change_24h":-8.6889947714e-08,"price_change_percentage'
|
||||
'_24h":-2.68533,"market_cap_change_24h":-11370.894861206936,"market_'
|
||||
'cap_change_percentage_24h":-2.64879,"circulating_supply":1326707642'
|
||||
'99.894,"total_supply":null,"max_supply":null,"ath":1.264e-05,"ath_c'
|
||||
'hange_percentage":-75.05046,"ath_date":"2021-05-07T23:04:53.026Z","'
|
||||
'atl":1.50936e-07,"atl_change_percentage":1989.69346,"atl_date":"202'
|
||||
'0-12-17T09:18:05.654Z","roi":null,"last_updated":"2022-08-22T16:38:'
|
||||
'15.113Z"},{"id":"monero","symbol":"xmr","name":"Monero","image":"ht'
|
||||
'tps://assets.coingecko.com/coins/images/69/large/monero_logo.png?15'
|
||||
'47033729","current_price":0.00717236,"market_cap":130002,"market_cap'
|
||||
'_rank":29,"fully_diluted_valuation":null,"total_volume":4901,"high'
|
||||
'_24h":0.00731999,"low_24h":0.00707511,"price_change_24h":-5.613354'
|
||||
'3212467e-05,"price_change_percentage_24h":-0.77656,"market_cap_chan'
|
||||
'ge_24h":-1007.8447677436197,"market_cap_change_percentage_24h":-0.7'
|
||||
'6929,"circulating_supply":18147820.3764146,"total_supply":null,"ma'
|
||||
'x_supply":null,"ath":0.03475393,"ath_change_percentage":-79.32037,"'
|
||||
'ath_date":"2018-01-09T00:00:00.000Z","atl":0.00101492,"atl_change_'
|
||||
'percentage":608.13327,"atl_date":"2014-12-18T00:00:00.000Z","roi":n'
|
||||
'ull,"last_updated":"2022-08-22T16:38:26.347Z"},{"id":"zcoin","symbo'
|
||||
'l":"firo","name":"Firo","image":"https://assets.coingecko.com/coins'
|
||||
'/images/479/large/firocoingecko.png?1636537544","current_price":0.0'
|
||||
'001096,"market_cap":1252,"market_cap_rank":604,"fully_diluted_valu'
|
||||
'ation":2349,"total_volume":90.573,"high_24h":0.00011148,"low_24h":0'
|
||||
'.00010834,"price_change_24h":-9.87561775002e-07,"price_change_perce'
|
||||
'ntage_24h":-0.89304,"market_cap_change_24h":-10.046635178462793,"ma'
|
||||
'rket_cap_change_percentage_24h":-0.79578,"circulating_supply":11411'
|
||||
'043.8354697,"total_supply":21400000.0,"max_supply":21400000.0,"ath"'
|
||||
':0.01616272,"ath_change_percentage":-99.3208,"ath_date":"2018-04-04'
|
||||
'T16:04:48.408Z","atl":4.268e-05,"atl_change_percentage":157.22799,'
|
||||
'"atl_date":"2022-05-12T07:28:47.088Z","roi":null,"last_updated":"2'
|
||||
'022-08-22T16:38:47.229Z"},{"id":"epic-cash","symbol":"epic","name":"'
|
||||
'Epic Cash","image":"https://assets.coingecko.com/coins/images/9520/'
|
||||
'large/Epic_Coin_NO_drop_shadow.png?1620122642","current_price":2.80'
|
||||
'3e-05,"market_cap":415.109,"market_cap_rank":953,"fully_diluted_val'
|
||||
'uation":null,"total_volume":0.2371557,"high_24h":3.053e-05,"low_24h'
|
||||
'":2.581e-05,"price_change_24h":1.9e-06,"price_change_percentage_24'
|
||||
'h":7.27524,"market_cap_change_24h":28.26753,"market_cap_change_perc'
|
||||
'entage_24h":7.30726,"circulating_supply":14808052.0,"total_supply":'
|
||||
'21000000.0,"max_supply":null,"ath":0.00013848,"ath_change_percentag'
|
||||
'e":-79.75864,"ath_date":"2021-12-11T08:39:41.129Z","atl":5.74028e-0'
|
||||
'7,"atl_change_percentage":4783.08078,"atl_date":"2020-03-13T16:55:01'
|
||||
'.177Z","roi":null,"last_updated":"2022-08-22T16:38:32.826Z"}]'),
|
||||
200));
|
||||
|
||||
final priceAPI = PriceAPI(client);
|
||||
|
@ -247,7 +253,8 @@ void main() {
|
|||
|
||||
// verify only called once during filling of cache
|
||||
verify(client.get(
|
||||
Uri.parse(
|
||||
proxyInfo: null,
|
||||
url: Uri.parse(
|
||||
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc&ids"
|
||||
"=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,"
|
||||
"bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano,stellar"
|
||||
|
@ -259,10 +266,11 @@ void main() {
|
|||
});
|
||||
|
||||
test("response parse failure", () async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
|
||||
when(client.get(
|
||||
Uri.parse(
|
||||
proxyInfo: null,
|
||||
url: Uri.parse(
|
||||
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc"
|
||||
"&ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,"
|
||||
"bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano,stellar"
|
||||
|
@ -271,64 +279,65 @@ void main() {
|
|||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
})).thenAnswer((_) async => Response(
|
||||
'[{"id":"bitcoin","symbol":"btc","name":com/coins/images/1/large/'
|
||||
'bitcoin.png?1547033579","current_price":1.0,"market_cap":19128800'
|
||||
',"market_cap_rank":1,"fully_diluted_valuation":21000000,"total_volum'
|
||||
'e":1272132,"high_24h":1.0,"low_24h":1.0,"price_change_24h":0.0,"pri'
|
||||
'ce_change_percentage_24h":0.0,"market_cap_change_24h":950.0,"market_'
|
||||
'cap_change_percentage_24h":0.00497,"circulating_supply":19128800.0,"t'
|
||||
'otal_supply":21000000.0,"max_supply":21000000.0,"ath":1.003301,"ath'
|
||||
'_change_percentage":-0.32896,"ath_date":"2019-10-15T16:00:56.136Z",'
|
||||
'"atl":0.99895134,"atl_change_percentage":0.10498,"atl_date":'
|
||||
'"2019-10-21T00:00:00.000Z","roi":null,'
|
||||
'"last_updated":"2022-08-22T16:37:59.237Z"},{"id":"dogecoin"'
|
||||
',"symbol":"doge","name":"Dogecoin","image":'
|
||||
'"https://assets.coingecko.com/coins/images/5/large/dogecoin.png?1547792256",'
|
||||
'"current_price":3.15e-06,"market_cap":417916,"market_cap_rank":10'
|
||||
',"fully_diluted_valuation":null,"total_volume":27498,"high_24h":3'
|
||||
'.26e-06,"low_24h":3.13e-06,"price_change_24h":-8.6889947714e-08,"'
|
||||
'price_change_percentage_24h":-2.68533,"market_cap_change_24h":-11'
|
||||
'370.894861206936,"market_cap_change_percentage_24h":-2.64879,"cir'
|
||||
'culating_supply":132670764299.894,"total_supply":null,"max_supply'
|
||||
'":null,"ath":1.264e-05,"ath_change_percentage":-75.05046,"ath_date'
|
||||
'":"2021-05-07T23:04:53.026Z","atl":1.50936e-07,"atl_change_percen'
|
||||
'tage":1989.69346,"atl_date":"2020-12-17T09:18:05.654Z","roi":null,'
|
||||
'"last_updated":"2022-08-22T16:38:15.113Z"},{"id":"monero","symbol"'
|
||||
':"xmr","name":"Monero","image":"https://assets.coingecko.com/coins'
|
||||
'/images/69/large/monero_logo.png?1547033729","current_price":0.007'
|
||||
'17236,"market_cap":130002,"market_cap_rank":29,"fully_diluted_valu'
|
||||
'ation":null,"total_volume":4901,"high_24h":0.00731999,"low_24h":0.'
|
||||
'00707511,"price_change_24h":-5.6133543212467e-05,"price_change_per'
|
||||
'centage_24h":-0.77656,"market_cap_change_24h":-1007.8447677436197'
|
||||
',"market_cap_change_percentage_24h":-0.76929,"circulating_supply":'
|
||||
'18147820.3764146,"total_supply":null,"max_supply":null,"ath":0.034'
|
||||
'75393,"ath_change_percentage":-79.32037,"ath_date":"2018-01-09T00:'
|
||||
'00:00.000Z","atl":0.00101492,"atl_change_percentage":608.13327,"at'
|
||||
'l_date":"2014-12-18T00:00:00.000Z","roi":null,"last_updated":"2022'
|
||||
'-08-22T16:38:26.347Z"},{"id":"zcoin","symbol":"firo","name":"Firo"'
|
||||
',"image":"https://assets.coingecko.com/coins/images/479/large/firo'
|
||||
'coingecko.png?1636537544","current_price":0.0001096,"market_cap":1'
|
||||
'252,"market_cap_rank":604,"fully_diluted_valuation":2349,"total_vo'
|
||||
'lume":90.573,"high_24h":0.00011148,"low_24h":0.00010834,"price_chang'
|
||||
'e_24h":-9.87561775002e-07,"price_change_percentage_24h":-0.89304,'
|
||||
'"market_cap_change_24h":-10.046635178462793,"market_cap_change_per'
|
||||
'centage_24h":-0.79578,"circulating_supply":11411043.8354697,"tota'
|
||||
'l_supply":21400000.0,"max_supply":21400000.0,"ath":0.01616272,"ath'
|
||||
'_change_percentage":-99.3208,"ath_date":"2018-04-04T16:04:48.408Z"'
|
||||
',"atl":4.268e-05,"atl_change_percentage":157.22799,"atl_date":"202'
|
||||
'2-05-12T07:28:47.088Z","roi":null,"last_updated":"2022-08-22T16:3'
|
||||
'8:47.229Z"},{"id":"epic-cash","symbol":"epic","name":"Epic Cash",'
|
||||
'"image":"https://assets.coingecko.com/coins/images/9520/large/'
|
||||
'Epic_Coin_NO_drop_shadow.png?1620122642","current_price":2.803e-0'
|
||||
'5,"market_cap":415.109,"market_cap_rank":953,"fully_diluted_valuat'
|
||||
'ion":null,"total_volume":0.2371557,"high_24h":3.053e-05,"low_24h":'
|
||||
'2.581e-05,"price_change_24h":1.9e-06,"price_change_percentage_24h"'
|
||||
':7.27524,"market_cap_change_24h":28.26753,"market_cap_change_per'
|
||||
'centage_24h":7.30726,"circulating_supply":14808052.0,"total_suppl'
|
||||
'y":21000000.0,"max_supply":null,"ath":0.00013848,"ath_change_perce'
|
||||
'ntage":-79.75864,"ath_date":"2021-12-11T08:39:41.129Z","atl":5.74'
|
||||
'028e-07,"atl_change_percentage":4783.08078,"atl_date":"2020-03-13T'
|
||||
'16:55:01.177Z","roi":null,"last_updated":"2022-08-22T16:38:32.826Z"}]',
|
||||
utf8.encode(
|
||||
'[{"id":"bitcoin","symbol":"btc","name":com/coins/images/1/large/'
|
||||
'bitcoin.png?1547033579","current_price":1.0,"market_cap":19128800'
|
||||
',"market_cap_rank":1,"fully_diluted_valuation":21000000,"total_volum'
|
||||
'e":1272132,"high_24h":1.0,"low_24h":1.0,"price_change_24h":0.0,"pri'
|
||||
'ce_change_percentage_24h":0.0,"market_cap_change_24h":950.0,"market_'
|
||||
'cap_change_percentage_24h":0.00497,"circulating_supply":19128800.0,"t'
|
||||
'otal_supply":21000000.0,"max_supply":21000000.0,"ath":1.003301,"ath'
|
||||
'_change_percentage":-0.32896,"ath_date":"2019-10-15T16:00:56.136Z",'
|
||||
'"atl":0.99895134,"atl_change_percentage":0.10498,"atl_date":'
|
||||
'"2019-10-21T00:00:00.000Z","roi":null,'
|
||||
'"last_updated":"2022-08-22T16:37:59.237Z"},{"id":"dogecoin"'
|
||||
',"symbol":"doge","name":"Dogecoin","image":'
|
||||
'"https://assets.coingecko.com/coins/images/5/large/dogecoin.png?1547792256",'
|
||||
'"current_price":3.15e-06,"market_cap":417916,"market_cap_rank":10'
|
||||
',"fully_diluted_valuation":null,"total_volume":27498,"high_24h":3'
|
||||
'.26e-06,"low_24h":3.13e-06,"price_change_24h":-8.6889947714e-08,"'
|
||||
'price_change_percentage_24h":-2.68533,"market_cap_change_24h":-11'
|
||||
'370.894861206936,"market_cap_change_percentage_24h":-2.64879,"cir'
|
||||
'culating_supply":132670764299.894,"total_supply":null,"max_supply'
|
||||
'":null,"ath":1.264e-05,"ath_change_percentage":-75.05046,"ath_date'
|
||||
'":"2021-05-07T23:04:53.026Z","atl":1.50936e-07,"atl_change_percen'
|
||||
'tage":1989.69346,"atl_date":"2020-12-17T09:18:05.654Z","roi":null,'
|
||||
'"last_updated":"2022-08-22T16:38:15.113Z"},{"id":"monero","symbol"'
|
||||
':"xmr","name":"Monero","image":"https://assets.coingecko.com/coins'
|
||||
'/images/69/large/monero_logo.png?1547033729","current_price":0.007'
|
||||
'17236,"market_cap":130002,"market_cap_rank":29,"fully_diluted_valu'
|
||||
'ation":null,"total_volume":4901,"high_24h":0.00731999,"low_24h":0.'
|
||||
'00707511,"price_change_24h":-5.6133543212467e-05,"price_change_per'
|
||||
'centage_24h":-0.77656,"market_cap_change_24h":-1007.8447677436197'
|
||||
',"market_cap_change_percentage_24h":-0.76929,"circulating_supply":'
|
||||
'18147820.3764146,"total_supply":null,"max_supply":null,"ath":0.034'
|
||||
'75393,"ath_change_percentage":-79.32037,"ath_date":"2018-01-09T00:'
|
||||
'00:00.000Z","atl":0.00101492,"atl_change_percentage":608.13327,"at'
|
||||
'l_date":"2014-12-18T00:00:00.000Z","roi":null,"last_updated":"2022'
|
||||
'-08-22T16:38:26.347Z"},{"id":"zcoin","symbol":"firo","name":"Firo"'
|
||||
',"image":"https://assets.coingecko.com/coins/images/479/large/firo'
|
||||
'coingecko.png?1636537544","current_price":0.0001096,"market_cap":1'
|
||||
'252,"market_cap_rank":604,"fully_diluted_valuation":2349,"total_vo'
|
||||
'lume":90.573,"high_24h":0.00011148,"low_24h":0.00010834,"price_chang'
|
||||
'e_24h":-9.87561775002e-07,"price_change_percentage_24h":-0.89304,'
|
||||
'"market_cap_change_24h":-10.046635178462793,"market_cap_change_per'
|
||||
'centage_24h":-0.79578,"circulating_supply":11411043.8354697,"tota'
|
||||
'l_supply":21400000.0,"max_supply":21400000.0,"ath":0.01616272,"ath'
|
||||
'_change_percentage":-99.3208,"ath_date":"2018-04-04T16:04:48.408Z"'
|
||||
',"atl":4.268e-05,"atl_change_percentage":157.22799,"atl_date":"202'
|
||||
'2-05-12T07:28:47.088Z","roi":null,"last_updated":"2022-08-22T16:3'
|
||||
'8:47.229Z"},{"id":"epic-cash","symbol":"epic","name":"Epic Cash",'
|
||||
'"image":"https://assets.coingecko.com/coins/images/9520/large/'
|
||||
'Epic_Coin_NO_drop_shadow.png?1620122642","current_price":2.803e-0'
|
||||
'5,"market_cap":415.109,"market_cap_rank":953,"fully_diluted_valuat'
|
||||
'ion":null,"total_volume":0.2371557,"high_24h":3.053e-05,"low_24h":'
|
||||
'2.581e-05,"price_change_24h":1.9e-06,"price_change_percentage_24h"'
|
||||
':7.27524,"market_cap_change_24h":28.26753,"market_cap_change_per'
|
||||
'centage_24h":7.30726,"circulating_supply":14808052.0,"total_suppl'
|
||||
'y":21000000.0,"max_supply":null,"ath":0.00013848,"ath_change_perce'
|
||||
'ntage":-79.75864,"ath_date":"2021-12-11T08:39:41.129Z","atl":5.74'
|
||||
'028e-07,"atl_change_percentage":4783.08078,"atl_date":"2020-03-13T'
|
||||
'16:55:01.177Z","roi":null,"last_updated":"2022-08-22T16:38:32.826Z"}]'),
|
||||
200));
|
||||
|
||||
final priceAPI = PriceAPI(client);
|
||||
|
@ -365,10 +374,11 @@ void main() {
|
|||
});
|
||||
|
||||
test("no internet available", () async {
|
||||
final client = MockClient();
|
||||
final client = MockHTTP();
|
||||
|
||||
when(client.get(
|
||||
Uri.parse(
|
||||
proxyInfo: null,
|
||||
url: Uri.parse(
|
||||
"https://api.coingecko.com/api/v3/coins/markets?vs_currency=btc"
|
||||
"&ids=monero,bitcoin,litecoin,ecash,epic-cash,zcoin,dogecoin,"
|
||||
"bitcoin-cash,namecoin,wownero,ethereum,particl,nano,banano,stellar"
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
|
||||
// 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 'dart:convert' as _i5;
|
||||
import 'dart:io' as _i4;
|
||||
|
||||
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 +31,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 ({_i4.InternetAddress host, int port})? proxyInfo,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#get,
|
||||
[url],
|
||||
{#headers: headers},
|
||||
[],
|
||||
{
|
||||
#url: url,
|
||||
#headers: headers,
|
||||
#proxyInfo: proxyInfo,
|
||||
},
|
||||
),
|
||||
returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0(
|
||||
this,
|
||||
Invocation.method(
|
||||
#get,
|
||||
[url],
|
||||
{#headers: headers},
|
||||
[],
|
||||
{
|
||||
#url: url,
|
||||
#headers: headers,
|
||||
#proxyInfo: proxyInfo,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) 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,
|
||||
_i5.Encoding? encoding,
|
||||
required ({_i4.InternetAddress host, int port})? proxyInfo,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#post,
|
||||
[url],
|
||||
[],
|
||||
{
|
||||
#url: url,
|
||||
#headers: headers,
|
||||
#body: body,
|
||||
#encoding: encoding,
|
||||
#proxyInfo: proxyInfo,
|
||||
},
|
||||
),
|
||||
returnValue: _i3.Future<_i2.Response>.value(_FakeResponse_0(
|
||||
this,
|
||||
Invocation.method(
|
||||
#post,
|
||||
[url],
|
||||
[],
|
||||
{
|
||||
#url: url,
|
||||
#headers: headers,
|
||||
#body: body,
|
||||
#encoding: encoding,
|
||||
#proxyInfo: proxyInfo,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) 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,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -244,14 +244,14 @@ class MockPrefs extends _i1.Mock implements _i4.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get torKillswitch => (super.noSuchMethod(
|
||||
Invocation.getter(#torKillswitch),
|
||||
bool get torKillSwitch => (super.noSuchMethod(
|
||||
Invocation.getter(#torKillSwitch),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
set torKillswitch(bool? torKillswitch) => super.noSuchMethod(
|
||||
set torKillSwitch(bool? torKillswitch) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#torKillswitch,
|
||||
#torKillSwitch,
|
||||
torKillswitch,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
|
|
|
@ -3,13 +3,14 @@
|
|||
// Do not manually edit this file.
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i5;
|
||||
import 'dart:typed_data' as _i6;
|
||||
import 'dart:async' as _i6;
|
||||
import 'dart:typed_data' as _i7;
|
||||
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:stackwallet/db/isar/main_db.dart' as _i2;
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart' as _i4;
|
||||
import 'package:stackwallet/themes/theme_service.dart' as _i3;
|
||||
import 'package:stackwallet/db/isar/main_db.dart' as _i3;
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart' as _i5;
|
||||
import 'package:stackwallet/networking/http.dart' as _i2;
|
||||
import 'package:stackwallet/themes/theme_service.dart' as _i4;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
|
@ -22,8 +23,18 @@ import 'package:stackwallet/themes/theme_service.dart' as _i3;
|
|||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB {
|
||||
_FakeMainDB_0(
|
||||
class _FakeHTTP_0 extends _i1.SmartFake implements _i2.HTTP {
|
||||
_FakeHTTP_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeMainDB_1 extends _i1.SmartFake implements _i3.MainDB {
|
||||
_FakeMainDB_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
|
@ -35,26 +46,42 @@ class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB {
|
|||
/// A class which mocks [ThemeService].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockThemeService extends _i1.Mock implements _i3.ThemeService {
|
||||
class MockThemeService extends _i1.Mock implements _i4.ThemeService {
|
||||
MockThemeService() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_i2.MainDB get db => (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,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i3.MainDB get db => (super.noSuchMethod(
|
||||
Invocation.getter(#db),
|
||||
returnValue: _FakeMainDB_0(
|
||||
returnValue: _FakeMainDB_1(
|
||||
this,
|
||||
Invocation.getter(#db),
|
||||
),
|
||||
) as _i2.MainDB);
|
||||
) as _i3.MainDB);
|
||||
@override
|
||||
List<_i4.StackTheme> get installedThemes => (super.noSuchMethod(
|
||||
List<_i5.StackTheme> get installedThemes => (super.noSuchMethod(
|
||||
Invocation.getter(#installedThemes),
|
||||
returnValue: <_i4.StackTheme>[],
|
||||
) as List<_i4.StackTheme>);
|
||||
returnValue: <_i5.StackTheme>[],
|
||||
) as List<_i5.StackTheme>);
|
||||
@override
|
||||
void init(_i2.MainDB? db) => super.noSuchMethod(
|
||||
void init(_i3.MainDB? db) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#init,
|
||||
[db],
|
||||
|
@ -62,70 +89,70 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i5.Future<void> install({required _i6.Uint8List? themeArchiveData}) =>
|
||||
_i6.Future<void> install({required _i7.Uint8List? themeArchiveData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#install,
|
||||
[],
|
||||
{#themeArchiveData: themeArchiveData},
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
@override
|
||||
_i5.Future<void> remove({required String? themeId}) => (super.noSuchMethod(
|
||||
_i6.Future<void> remove({required String? themeId}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#remove,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
@override
|
||||
_i5.Future<void> checkDefaultThemesOnStartup() => (super.noSuchMethod(
|
||||
_i6.Future<void> checkDefaultThemesOnStartup() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#checkDefaultThemesOnStartup,
|
||||
[],
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
@override
|
||||
_i5.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||
_i6.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#verifyInstalled,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i5.Future<bool>.value(false),
|
||||
) as _i5.Future<bool>);
|
||||
returnValue: _i6.Future<bool>.value(false),
|
||||
) as _i6.Future<bool>);
|
||||
@override
|
||||
_i5.Future<List<_i3.StackThemeMetaData>> fetchThemes() => (super.noSuchMethod(
|
||||
_i6.Future<List<_i4.StackThemeMetaData>> fetchThemes() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchThemes,
|
||||
[],
|
||||
),
|
||||
returnValue: _i5.Future<List<_i3.StackThemeMetaData>>.value(
|
||||
<_i3.StackThemeMetaData>[]),
|
||||
) as _i5.Future<List<_i3.StackThemeMetaData>>);
|
||||
returnValue: _i6.Future<List<_i4.StackThemeMetaData>>.value(
|
||||
<_i4.StackThemeMetaData>[]),
|
||||
) as _i6.Future<List<_i4.StackThemeMetaData>>);
|
||||
@override
|
||||
_i5.Future<_i6.Uint8List> fetchTheme(
|
||||
{required _i3.StackThemeMetaData? themeMetaData}) =>
|
||||
_i6.Future<_i7.Uint8List> fetchTheme(
|
||||
{required _i4.StackThemeMetaData? themeMetaData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchTheme,
|
||||
[],
|
||||
{#themeMetaData: themeMetaData},
|
||||
),
|
||||
returnValue: _i5.Future<_i6.Uint8List>.value(_i6.Uint8List(0)),
|
||||
) as _i5.Future<_i6.Uint8List>);
|
||||
returnValue: _i6.Future<_i7.Uint8List>.value(_i7.Uint8List(0)),
|
||||
) as _i6.Future<_i7.Uint8List>);
|
||||
@override
|
||||
_i4.StackTheme? getTheme({required String? themeId}) =>
|
||||
_i5.StackTheme? getTheme({required String? themeId}) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
#getTheme,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
)) as _i4.StackTheme?);
|
||||
)) as _i5.StackTheme?);
|
||||
}
|
||||
|
|
|
@ -3,13 +3,14 @@
|
|||
// Do not manually edit this file.
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i5;
|
||||
import 'dart:typed_data' as _i6;
|
||||
import 'dart:async' as _i6;
|
||||
import 'dart:typed_data' as _i7;
|
||||
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:stackwallet/db/isar/main_db.dart' as _i2;
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart' as _i4;
|
||||
import 'package:stackwallet/themes/theme_service.dart' as _i3;
|
||||
import 'package:stackwallet/db/isar/main_db.dart' as _i3;
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart' as _i5;
|
||||
import 'package:stackwallet/networking/http.dart' as _i2;
|
||||
import 'package:stackwallet/themes/theme_service.dart' as _i4;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
|
@ -22,8 +23,18 @@ import 'package:stackwallet/themes/theme_service.dart' as _i3;
|
|||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB {
|
||||
_FakeMainDB_0(
|
||||
class _FakeHTTP_0 extends _i1.SmartFake implements _i2.HTTP {
|
||||
_FakeHTTP_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeMainDB_1 extends _i1.SmartFake implements _i3.MainDB {
|
||||
_FakeMainDB_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
|
@ -35,26 +46,42 @@ class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB {
|
|||
/// A class which mocks [ThemeService].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockThemeService extends _i1.Mock implements _i3.ThemeService {
|
||||
class MockThemeService extends _i1.Mock implements _i4.ThemeService {
|
||||
MockThemeService() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_i2.MainDB get db => (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,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i3.MainDB get db => (super.noSuchMethod(
|
||||
Invocation.getter(#db),
|
||||
returnValue: _FakeMainDB_0(
|
||||
returnValue: _FakeMainDB_1(
|
||||
this,
|
||||
Invocation.getter(#db),
|
||||
),
|
||||
) as _i2.MainDB);
|
||||
) as _i3.MainDB);
|
||||
@override
|
||||
List<_i4.StackTheme> get installedThemes => (super.noSuchMethod(
|
||||
List<_i5.StackTheme> get installedThemes => (super.noSuchMethod(
|
||||
Invocation.getter(#installedThemes),
|
||||
returnValue: <_i4.StackTheme>[],
|
||||
) as List<_i4.StackTheme>);
|
||||
returnValue: <_i5.StackTheme>[],
|
||||
) as List<_i5.StackTheme>);
|
||||
@override
|
||||
void init(_i2.MainDB? db) => super.noSuchMethod(
|
||||
void init(_i3.MainDB? db) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#init,
|
||||
[db],
|
||||
|
@ -62,70 +89,70 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i5.Future<void> install({required _i6.Uint8List? themeArchiveData}) =>
|
||||
_i6.Future<void> install({required _i7.Uint8List? themeArchiveData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#install,
|
||||
[],
|
||||
{#themeArchiveData: themeArchiveData},
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
@override
|
||||
_i5.Future<void> remove({required String? themeId}) => (super.noSuchMethod(
|
||||
_i6.Future<void> remove({required String? themeId}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#remove,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
@override
|
||||
_i5.Future<void> checkDefaultThemesOnStartup() => (super.noSuchMethod(
|
||||
_i6.Future<void> checkDefaultThemesOnStartup() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#checkDefaultThemesOnStartup,
|
||||
[],
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
@override
|
||||
_i5.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||
_i6.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#verifyInstalled,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i5.Future<bool>.value(false),
|
||||
) as _i5.Future<bool>);
|
||||
returnValue: _i6.Future<bool>.value(false),
|
||||
) as _i6.Future<bool>);
|
||||
@override
|
||||
_i5.Future<List<_i3.StackThemeMetaData>> fetchThemes() => (super.noSuchMethod(
|
||||
_i6.Future<List<_i4.StackThemeMetaData>> fetchThemes() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchThemes,
|
||||
[],
|
||||
),
|
||||
returnValue: _i5.Future<List<_i3.StackThemeMetaData>>.value(
|
||||
<_i3.StackThemeMetaData>[]),
|
||||
) as _i5.Future<List<_i3.StackThemeMetaData>>);
|
||||
returnValue: _i6.Future<List<_i4.StackThemeMetaData>>.value(
|
||||
<_i4.StackThemeMetaData>[]),
|
||||
) as _i6.Future<List<_i4.StackThemeMetaData>>);
|
||||
@override
|
||||
_i5.Future<_i6.Uint8List> fetchTheme(
|
||||
{required _i3.StackThemeMetaData? themeMetaData}) =>
|
||||
_i6.Future<_i7.Uint8List> fetchTheme(
|
||||
{required _i4.StackThemeMetaData? themeMetaData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchTheme,
|
||||
[],
|
||||
{#themeMetaData: themeMetaData},
|
||||
),
|
||||
returnValue: _i5.Future<_i6.Uint8List>.value(_i6.Uint8List(0)),
|
||||
) as _i5.Future<_i6.Uint8List>);
|
||||
returnValue: _i6.Future<_i7.Uint8List>.value(_i7.Uint8List(0)),
|
||||
) as _i6.Future<_i7.Uint8List>);
|
||||
@override
|
||||
_i4.StackTheme? getTheme({required String? themeId}) =>
|
||||
_i5.StackTheme? getTheme({required String? themeId}) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
#getTheme,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
)) as _i4.StackTheme?);
|
||||
)) as _i5.StackTheme?);
|
||||
}
|
||||
|
|
|
@ -3,13 +3,14 @@
|
|||
// Do not manually edit this file.
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i5;
|
||||
import 'dart:typed_data' as _i6;
|
||||
import 'dart:async' as _i6;
|
||||
import 'dart:typed_data' as _i7;
|
||||
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:stackwallet/db/isar/main_db.dart' as _i2;
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart' as _i4;
|
||||
import 'package:stackwallet/themes/theme_service.dart' as _i3;
|
||||
import 'package:stackwallet/db/isar/main_db.dart' as _i3;
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart' as _i5;
|
||||
import 'package:stackwallet/networking/http.dart' as _i2;
|
||||
import 'package:stackwallet/themes/theme_service.dart' as _i4;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
|
@ -22,8 +23,18 @@ import 'package:stackwallet/themes/theme_service.dart' as _i3;
|
|||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB {
|
||||
_FakeMainDB_0(
|
||||
class _FakeHTTP_0 extends _i1.SmartFake implements _i2.HTTP {
|
||||
_FakeHTTP_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeMainDB_1 extends _i1.SmartFake implements _i3.MainDB {
|
||||
_FakeMainDB_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
|
@ -35,26 +46,42 @@ class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB {
|
|||
/// A class which mocks [ThemeService].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockThemeService extends _i1.Mock implements _i3.ThemeService {
|
||||
class MockThemeService extends _i1.Mock implements _i4.ThemeService {
|
||||
MockThemeService() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_i2.MainDB get db => (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,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i3.MainDB get db => (super.noSuchMethod(
|
||||
Invocation.getter(#db),
|
||||
returnValue: _FakeMainDB_0(
|
||||
returnValue: _FakeMainDB_1(
|
||||
this,
|
||||
Invocation.getter(#db),
|
||||
),
|
||||
) as _i2.MainDB);
|
||||
) as _i3.MainDB);
|
||||
@override
|
||||
List<_i4.StackTheme> get installedThemes => (super.noSuchMethod(
|
||||
List<_i5.StackTheme> get installedThemes => (super.noSuchMethod(
|
||||
Invocation.getter(#installedThemes),
|
||||
returnValue: <_i4.StackTheme>[],
|
||||
) as List<_i4.StackTheme>);
|
||||
returnValue: <_i5.StackTheme>[],
|
||||
) as List<_i5.StackTheme>);
|
||||
@override
|
||||
void init(_i2.MainDB? db) => super.noSuchMethod(
|
||||
void init(_i3.MainDB? db) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#init,
|
||||
[db],
|
||||
|
@ -62,70 +89,70 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i5.Future<void> install({required _i6.Uint8List? themeArchiveData}) =>
|
||||
_i6.Future<void> install({required _i7.Uint8List? themeArchiveData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#install,
|
||||
[],
|
||||
{#themeArchiveData: themeArchiveData},
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
@override
|
||||
_i5.Future<void> remove({required String? themeId}) => (super.noSuchMethod(
|
||||
_i6.Future<void> remove({required String? themeId}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#remove,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
@override
|
||||
_i5.Future<void> checkDefaultThemesOnStartup() => (super.noSuchMethod(
|
||||
_i6.Future<void> checkDefaultThemesOnStartup() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#checkDefaultThemesOnStartup,
|
||||
[],
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
@override
|
||||
_i5.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||
_i6.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#verifyInstalled,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i5.Future<bool>.value(false),
|
||||
) as _i5.Future<bool>);
|
||||
returnValue: _i6.Future<bool>.value(false),
|
||||
) as _i6.Future<bool>);
|
||||
@override
|
||||
_i5.Future<List<_i3.StackThemeMetaData>> fetchThemes() => (super.noSuchMethod(
|
||||
_i6.Future<List<_i4.StackThemeMetaData>> fetchThemes() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchThemes,
|
||||
[],
|
||||
),
|
||||
returnValue: _i5.Future<List<_i3.StackThemeMetaData>>.value(
|
||||
<_i3.StackThemeMetaData>[]),
|
||||
) as _i5.Future<List<_i3.StackThemeMetaData>>);
|
||||
returnValue: _i6.Future<List<_i4.StackThemeMetaData>>.value(
|
||||
<_i4.StackThemeMetaData>[]),
|
||||
) as _i6.Future<List<_i4.StackThemeMetaData>>);
|
||||
@override
|
||||
_i5.Future<_i6.Uint8List> fetchTheme(
|
||||
{required _i3.StackThemeMetaData? themeMetaData}) =>
|
||||
_i6.Future<_i7.Uint8List> fetchTheme(
|
||||
{required _i4.StackThemeMetaData? themeMetaData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchTheme,
|
||||
[],
|
||||
{#themeMetaData: themeMetaData},
|
||||
),
|
||||
returnValue: _i5.Future<_i6.Uint8List>.value(_i6.Uint8List(0)),
|
||||
) as _i5.Future<_i6.Uint8List>);
|
||||
returnValue: _i6.Future<_i7.Uint8List>.value(_i7.Uint8List(0)),
|
||||
) as _i6.Future<_i7.Uint8List>);
|
||||
@override
|
||||
_i4.StackTheme? getTheme({required String? themeId}) =>
|
||||
_i5.StackTheme? getTheme({required String? themeId}) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
#getTheme,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
)) as _i4.StackTheme?);
|
||||
)) as _i5.StackTheme?);
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -23,6 +23,7 @@ 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 _i13;
|
||||
import 'package:tor_ffi_plugin/tor_ffi_plugin.dart' as _i20;
|
||||
import 'package:tuple/tuple.dart' as _i11;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
|
@ -483,14 +484,14 @@ class MockPrefs extends _i1.Mock implements _i13.Prefs {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
bool get torKillswitch => (super.noSuchMethod(
|
||||
Invocation.getter(#torKillswitch),
|
||||
bool get torKillSwitch => (super.noSuchMethod(
|
||||
Invocation.getter(#torKillSwitch),
|
||||
returnValue: false,
|
||||
) as bool);
|
||||
@override
|
||||
set torKillswitch(bool? torKillswitch) => super.noSuchMethod(
|
||||
set torKillSwitch(bool? torKillswitch) => super.noSuchMethod(
|
||||
Invocation.setter(
|
||||
#torKillswitch,
|
||||
#torKillSwitch,
|
||||
torKillswitch,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
|
@ -1040,6 +1041,15 @@ class MockTorService extends _i1.Mock implements _i19.TorService {
|
|||
),
|
||||
) as ({_i8.InternetAddress host, int port}));
|
||||
@override
|
||||
void init({_i20.Tor? mockableOverride}) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#init,
|
||||
[],
|
||||
{#mockableOverride: mockableOverride},
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i12.Future<void> start() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#start,
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -3,13 +3,14 @@
|
|||
// Do not manually edit this file.
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'dart:async' as _i5;
|
||||
import 'dart:typed_data' as _i6;
|
||||
import 'dart:async' as _i6;
|
||||
import 'dart:typed_data' as _i7;
|
||||
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:stackwallet/db/isar/main_db.dart' as _i2;
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart' as _i4;
|
||||
import 'package:stackwallet/themes/theme_service.dart' as _i3;
|
||||
import 'package:stackwallet/db/isar/main_db.dart' as _i3;
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart' as _i5;
|
||||
import 'package:stackwallet/networking/http.dart' as _i2;
|
||||
import 'package:stackwallet/themes/theme_service.dart' as _i4;
|
||||
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: avoid_redundant_argument_values
|
||||
|
@ -22,8 +23,18 @@ import 'package:stackwallet/themes/theme_service.dart' as _i3;
|
|||
// ignore_for_file: camel_case_types
|
||||
// ignore_for_file: subtype_of_sealed_class
|
||||
|
||||
class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB {
|
||||
_FakeMainDB_0(
|
||||
class _FakeHTTP_0 extends _i1.SmartFake implements _i2.HTTP {
|
||||
_FakeHTTP_0(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
parent,
|
||||
parentInvocation,
|
||||
);
|
||||
}
|
||||
|
||||
class _FakeMainDB_1 extends _i1.SmartFake implements _i3.MainDB {
|
||||
_FakeMainDB_1(
|
||||
Object parent,
|
||||
Invocation parentInvocation,
|
||||
) : super(
|
||||
|
@ -35,26 +46,42 @@ class _FakeMainDB_0 extends _i1.SmartFake implements _i2.MainDB {
|
|||
/// A class which mocks [ThemeService].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockThemeService extends _i1.Mock implements _i3.ThemeService {
|
||||
class MockThemeService extends _i1.Mock implements _i4.ThemeService {
|
||||
MockThemeService() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
@override
|
||||
_i2.MainDB get db => (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,
|
||||
),
|
||||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i3.MainDB get db => (super.noSuchMethod(
|
||||
Invocation.getter(#db),
|
||||
returnValue: _FakeMainDB_0(
|
||||
returnValue: _FakeMainDB_1(
|
||||
this,
|
||||
Invocation.getter(#db),
|
||||
),
|
||||
) as _i2.MainDB);
|
||||
) as _i3.MainDB);
|
||||
@override
|
||||
List<_i4.StackTheme> get installedThemes => (super.noSuchMethod(
|
||||
List<_i5.StackTheme> get installedThemes => (super.noSuchMethod(
|
||||
Invocation.getter(#installedThemes),
|
||||
returnValue: <_i4.StackTheme>[],
|
||||
) as List<_i4.StackTheme>);
|
||||
returnValue: <_i5.StackTheme>[],
|
||||
) as List<_i5.StackTheme>);
|
||||
@override
|
||||
void init(_i2.MainDB? db) => super.noSuchMethod(
|
||||
void init(_i3.MainDB? db) => super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#init,
|
||||
[db],
|
||||
|
@ -62,78 +89,78 @@ class MockThemeService extends _i1.Mock implements _i3.ThemeService {
|
|||
returnValueForMissingStub: null,
|
||||
);
|
||||
@override
|
||||
_i5.Future<void> install({required _i6.Uint8List? themeArchiveData}) =>
|
||||
_i6.Future<void> install({required _i7.Uint8List? themeArchiveData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#install,
|
||||
[],
|
||||
{#themeArchiveData: themeArchiveData},
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
@override
|
||||
_i5.Future<void> remove({required String? themeId}) => (super.noSuchMethod(
|
||||
_i6.Future<void> remove({required String? themeId}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#remove,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
@override
|
||||
_i5.Future<void> checkDefaultThemesOnStartup() => (super.noSuchMethod(
|
||||
_i6.Future<void> checkDefaultThemesOnStartup() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#checkDefaultThemesOnStartup,
|
||||
[],
|
||||
),
|
||||
returnValue: _i5.Future<void>.value(),
|
||||
returnValueForMissingStub: _i5.Future<void>.value(),
|
||||
) as _i5.Future<void>);
|
||||
returnValue: _i6.Future<void>.value(),
|
||||
returnValueForMissingStub: _i6.Future<void>.value(),
|
||||
) as _i6.Future<void>);
|
||||
@override
|
||||
_i5.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||
_i6.Future<bool> verifyInstalled({required String? themeId}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#verifyInstalled,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
),
|
||||
returnValue: _i5.Future<bool>.value(false),
|
||||
) as _i5.Future<bool>);
|
||||
returnValue: _i6.Future<bool>.value(false),
|
||||
) as _i6.Future<bool>);
|
||||
@override
|
||||
_i5.Future<List<_i3.StackThemeMetaData>> fetchThemes() => (super.noSuchMethod(
|
||||
_i6.Future<List<_i4.StackThemeMetaData>> fetchThemes() => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchThemes,
|
||||
[],
|
||||
),
|
||||
returnValue: _i5.Future<List<_i3.StackThemeMetaData>>.value(
|
||||
<_i3.StackThemeMetaData>[]),
|
||||
) as _i5.Future<List<_i3.StackThemeMetaData>>);
|
||||
returnValue: _i6.Future<List<_i4.StackThemeMetaData>>.value(
|
||||
<_i4.StackThemeMetaData>[]),
|
||||
) as _i6.Future<List<_i4.StackThemeMetaData>>);
|
||||
@override
|
||||
_i5.Future<_i6.Uint8List> fetchTheme(
|
||||
{required _i3.StackThemeMetaData? themeMetaData}) =>
|
||||
_i6.Future<_i7.Uint8List> fetchTheme(
|
||||
{required _i4.StackThemeMetaData? themeMetaData}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#fetchTheme,
|
||||
[],
|
||||
{#themeMetaData: themeMetaData},
|
||||
),
|
||||
returnValue: _i5.Future<_i6.Uint8List>.value(_i6.Uint8List(0)),
|
||||
) as _i5.Future<_i6.Uint8List>);
|
||||
returnValue: _i6.Future<_i7.Uint8List>.value(_i7.Uint8List(0)),
|
||||
) as _i6.Future<_i7.Uint8List>);
|
||||
@override
|
||||
_i4.StackTheme? getTheme({required String? themeId}) =>
|
||||
_i5.StackTheme? getTheme({required String? themeId}) =>
|
||||
(super.noSuchMethod(Invocation.method(
|
||||
#getTheme,
|
||||
[],
|
||||
{#themeId: themeId},
|
||||
)) as _i4.StackTheme?);
|
||||
)) as _i5.StackTheme?);
|
||||
}
|
||||
|
||||
/// A class which mocks [IThemeAssets].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockIThemeAssets extends _i1.Mock implements _i4.IThemeAssets {
|
||||
class MockIThemeAssets extends _i1.Mock implements _i5.IThemeAssets {
|
||||
MockIThemeAssets() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue