mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-03-08 01:34:54 +00:00
update tests and generated files
This commit is contained in:
parent
649ebd1987
commit
f2eaba178c
4 changed files with 291 additions and 112 deletions
lib/models/exchange/response_objects
test
models/exchange
screen_tests/exchange
104
lib/models/exchange/response_objects/trade.g.dart
Normal file
104
lib/models/exchange/response_objects/trade.g.dart
Normal file
|
@ -0,0 +1,104 @@
|
|||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'trade.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// TypeAdapterGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class TradeAdapter extends TypeAdapter<Trade> {
|
||||
@override
|
||||
final int typeId = 22;
|
||||
|
||||
@override
|
||||
Trade read(BinaryReader reader) {
|
||||
final numOfFields = reader.readByte();
|
||||
final fields = <int, dynamic>{
|
||||
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||
};
|
||||
return Trade(
|
||||
uuid: fields[0] as String,
|
||||
tradeId: fields[1] as String,
|
||||
rateType: fields[2] as String,
|
||||
direction: fields[3] as String,
|
||||
timestamp: fields[4] as DateTime,
|
||||
updatedAt: fields[5] as DateTime,
|
||||
payInCurrency: fields[6] as String,
|
||||
payInAmount: fields[7] as String,
|
||||
payInAddress: fields[8] as String,
|
||||
payInNetwork: fields[9] as String,
|
||||
payInExtraId: fields[10] as String,
|
||||
payInTxid: fields[11] as String,
|
||||
payOutCurrency: fields[12] as String,
|
||||
payOutAmount: fields[13] as String,
|
||||
payOutAddress: fields[14] as String,
|
||||
payOutNetwork: fields[15] as String,
|
||||
payOutExtraId: fields[16] as String,
|
||||
payOutTxid: fields[17] as String,
|
||||
refundAddress: fields[18] as String,
|
||||
refundExtraId: fields[19] as String,
|
||||
status: fields[20] as String,
|
||||
exchangeName: fields[21] as String,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, Trade obj) {
|
||||
writer
|
||||
..writeByte(22)
|
||||
..writeByte(0)
|
||||
..write(obj.uuid)
|
||||
..writeByte(1)
|
||||
..write(obj.tradeId)
|
||||
..writeByte(2)
|
||||
..write(obj.rateType)
|
||||
..writeByte(3)
|
||||
..write(obj.direction)
|
||||
..writeByte(4)
|
||||
..write(obj.timestamp)
|
||||
..writeByte(5)
|
||||
..write(obj.updatedAt)
|
||||
..writeByte(6)
|
||||
..write(obj.payInCurrency)
|
||||
..writeByte(7)
|
||||
..write(obj.payInAmount)
|
||||
..writeByte(8)
|
||||
..write(obj.payInAddress)
|
||||
..writeByte(9)
|
||||
..write(obj.payInNetwork)
|
||||
..writeByte(10)
|
||||
..write(obj.payInExtraId)
|
||||
..writeByte(11)
|
||||
..write(obj.payInTxid)
|
||||
..writeByte(12)
|
||||
..write(obj.payOutCurrency)
|
||||
..writeByte(13)
|
||||
..write(obj.payOutAmount)
|
||||
..writeByte(14)
|
||||
..write(obj.payOutAddress)
|
||||
..writeByte(15)
|
||||
..write(obj.payOutNetwork)
|
||||
..writeByte(16)
|
||||
..write(obj.payOutExtraId)
|
||||
..writeByte(17)
|
||||
..write(obj.payOutTxid)
|
||||
..writeByte(18)
|
||||
..write(obj.refundAddress)
|
||||
..writeByte(19)
|
||||
..write(obj.refundExtraId)
|
||||
..writeByte(20)
|
||||
..write(obj.status)
|
||||
..writeByte(21)
|
||||
..write(obj.exchangeName);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => typeId.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is TradeAdapter &&
|
||||
runtimeType == other.runtimeType &&
|
||||
typeId == other.typeId;
|
||||
}
|
|
@ -92,7 +92,7 @@ void main() {
|
|||
test(
|
||||
"updateTo after updateFrom where amounts are null and getMinimalExchangeAmount succeeds",
|
||||
() async {
|
||||
final cn = MockChangeNow();
|
||||
final cn = MockChangeNowAPI();
|
||||
|
||||
final state = EstimatedRateExchangeFormState();
|
||||
state.cnTesting = cn;
|
||||
|
@ -119,7 +119,7 @@ void main() {
|
|||
test(
|
||||
"updateTo after updateFrom where amounts are null and getMinimalExchangeAmount fails",
|
||||
() async {
|
||||
final cn = MockChangeNow();
|
||||
final cn = MockChangeNowAPI();
|
||||
|
||||
final state = EstimatedRateExchangeFormState();
|
||||
state.cnTesting = cn;
|
||||
|
@ -146,7 +146,7 @@ void main() {
|
|||
test(
|
||||
"updateTo after updateFrom and setFromAmountAndCalculateToAmount where fromAmount is less than the minimum required exchange amount",
|
||||
() async {
|
||||
final cn = MockChangeNow();
|
||||
final cn = MockChangeNowAPI();
|
||||
|
||||
final state = EstimatedRateExchangeFormState();
|
||||
state.cnTesting = cn;
|
||||
|
@ -174,7 +174,7 @@ void main() {
|
|||
test(
|
||||
"updateTo after updateFrom and setFromAmountAndCalculateToAmount where fromAmount is greater than the minimum required exchange amount",
|
||||
() async {
|
||||
final cn = MockChangeNow();
|
||||
final cn = MockChangeNowAPI();
|
||||
|
||||
final state = EstimatedRateExchangeFormState();
|
||||
state.cnTesting = cn;
|
||||
|
|
|
@ -8,19 +8,20 @@ import 'package:decimal/decimal.dart' as _i7;
|
|||
import 'package:http/http.dart' as _i4;
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:stackwallet/models/exchange/change_now/available_floating_rate_pair.dart'
|
||||
as _i13;
|
||||
as _i14;
|
||||
import 'package:stackwallet/models/exchange/change_now/cn_exchange_estimate.dart'
|
||||
as _i9;
|
||||
import 'package:stackwallet/models/exchange/change_now/estimated_exchange_amount.dart'
|
||||
as _i8;
|
||||
import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart'
|
||||
as _i11;
|
||||
import 'package:stackwallet/models/exchange/change_now/exchange_transaction_status.dart'
|
||||
as _i12;
|
||||
import 'package:stackwallet/models/exchange/change_now/fixed_rate_market.dart'
|
||||
as _i10;
|
||||
import 'package:stackwallet/models/exchange/change_now/estimated_exchange_amount.dart'
|
||||
as _i9;
|
||||
import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart'
|
||||
as _i12;
|
||||
import 'package:stackwallet/models/exchange/change_now/exchange_transaction_status.dart'
|
||||
as _i13;
|
||||
import 'package:stackwallet/models/exchange/change_now/fixed_rate_market.dart'
|
||||
as _i11;
|
||||
import 'package:stackwallet/models/exchange/response_objects/currency.dart'
|
||||
as _i6;
|
||||
import 'package:stackwallet/models/exchange/response_objects/range.dart' as _i8;
|
||||
import 'package:stackwallet/services/exchange/change_now/change_now_api.dart'
|
||||
as _i3;
|
||||
import 'package:stackwallet/services/exchange/exchange_response.dart' as _i2;
|
||||
|
@ -35,14 +36,14 @@ import 'package:stackwallet/services/exchange/exchange_response.dart' as _i2;
|
|||
// ignore_for_file: unnecessary_parenthesis
|
||||
// ignore_for_file: camel_case_types
|
||||
|
||||
class _FakeChangeNowResponse_0<T> extends _i1.Fake
|
||||
class _FakeExchangeResponse_0<T> extends _i1.Fake
|
||||
implements _i2.ExchangeResponse<T> {}
|
||||
|
||||
/// A class which mocks [ChangeNow].
|
||||
/// A class which mocks [ChangeNowAPI].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockChangeNow extends _i1.Mock implements _i3.ChangeNowAPI {
|
||||
MockChangeNow() {
|
||||
class MockChangeNowAPI extends _i1.Mock implements _i3.ChangeNowAPI {
|
||||
MockChangeNowAPI() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
|
@ -57,7 +58,7 @@ class MockChangeNow extends _i1.Mock implements _i3.ChangeNowAPI {
|
|||
Invocation.method(#getAvailableCurrencies, [],
|
||||
{#fixedRate: fixedRate, #active: active}),
|
||||
returnValue: Future<_i2.ExchangeResponse<List<_i6.Currency>>>.value(
|
||||
_FakeChangeNowResponse_0<List<_i6.Currency>>())) as _i5
|
||||
_FakeExchangeResponse_0<List<_i6.Currency>>())) as _i5
|
||||
.Future<_i2.ExchangeResponse<List<_i6.Currency>>>);
|
||||
@override
|
||||
_i5.Future<_i2.ExchangeResponse<List<_i6.Currency>>> getPairedCurrencies(
|
||||
|
@ -66,7 +67,7 @@ class MockChangeNow extends _i1.Mock implements _i3.ChangeNowAPI {
|
|||
Invocation.method(#getPairedCurrencies, [],
|
||||
{#ticker: ticker, #fixedRate: fixedRate}),
|
||||
returnValue: Future<_i2.ExchangeResponse<List<_i6.Currency>>>.value(
|
||||
_FakeChangeNowResponse_0<List<_i6.Currency>>())) as _i5
|
||||
_FakeExchangeResponse_0<List<_i6.Currency>>())) as _i5
|
||||
.Future<_i2.ExchangeResponse<List<_i6.Currency>>>);
|
||||
@override
|
||||
_i5.Future<_i2.ExchangeResponse<_i7.Decimal>> getMinimalExchangeAmount(
|
||||
|
@ -78,10 +79,26 @@ class MockChangeNow extends _i1.Mock implements _i3.ChangeNowAPI {
|
|||
#apiKey: apiKey
|
||||
}),
|
||||
returnValue: Future<_i2.ExchangeResponse<_i7.Decimal>>.value(
|
||||
_FakeChangeNowResponse_0<_i7.Decimal>()))
|
||||
_FakeExchangeResponse_0<_i7.Decimal>()))
|
||||
as _i5.Future<_i2.ExchangeResponse<_i7.Decimal>>);
|
||||
@override
|
||||
_i5.Future<_i2.ExchangeResponse<_i8.EstimatedExchangeAmount>>
|
||||
_i5.Future<_i2.ExchangeResponse<_i8.Range>> getRange(
|
||||
{String? fromTicker,
|
||||
String? toTicker,
|
||||
bool? isFixedRate,
|
||||
String? apiKey}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#getRange, [], {
|
||||
#fromTicker: fromTicker,
|
||||
#toTicker: toTicker,
|
||||
#isFixedRate: isFixedRate,
|
||||
#apiKey: apiKey
|
||||
}),
|
||||
returnValue: Future<_i2.ExchangeResponse<_i8.Range>>.value(
|
||||
_FakeExchangeResponse_0<_i8.Range>()))
|
||||
as _i5.Future<_i2.ExchangeResponse<_i8.Range>>);
|
||||
@override
|
||||
_i5.Future<_i2.ExchangeResponse<_i9.EstimatedExchangeAmount>>
|
||||
getEstimatedExchangeAmount(
|
||||
{String? fromTicker,
|
||||
String? toTicker,
|
||||
|
@ -96,19 +113,40 @@ class MockChangeNow extends _i1.Mock implements _i3.ChangeNowAPI {
|
|||
}),
|
||||
returnValue: Future<
|
||||
_i2.ExchangeResponse<
|
||||
_i8.EstimatedExchangeAmount>>.value(
|
||||
_FakeChangeNowResponse_0<_i8.EstimatedExchangeAmount>()))
|
||||
as _i5.Future<_i2.ExchangeResponse<_i8.EstimatedExchangeAmount>>);
|
||||
_i9.EstimatedExchangeAmount>>.value(
|
||||
_FakeExchangeResponse_0<_i9.EstimatedExchangeAmount>()))
|
||||
as _i5.Future<_i2.ExchangeResponse<_i9.EstimatedExchangeAmount>>);
|
||||
@override
|
||||
_i5.Future<_i2.ExchangeResponse<_i9.CNExchangeEstimate>>
|
||||
_i5.Future<_i2.ExchangeResponse<_i9.EstimatedExchangeAmount>>
|
||||
getEstimatedExchangeAmountFixedRate(
|
||||
{String? fromTicker,
|
||||
String? toTicker,
|
||||
_i7.Decimal? fromAmount,
|
||||
bool? reversed,
|
||||
String? apiKey}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#getEstimatedExchangeAmountFixedRate, [], {
|
||||
#fromTicker: fromTicker,
|
||||
#toTicker: toTicker,
|
||||
#fromAmount: fromAmount,
|
||||
#reversed: reversed,
|
||||
#apiKey: apiKey
|
||||
}),
|
||||
returnValue: Future<
|
||||
_i2.ExchangeResponse<
|
||||
_i9.EstimatedExchangeAmount>>.value(
|
||||
_FakeExchangeResponse_0<_i9.EstimatedExchangeAmount>()))
|
||||
as _i5.Future<_i2.ExchangeResponse<_i9.EstimatedExchangeAmount>>);
|
||||
@override
|
||||
_i5.Future<_i2.ExchangeResponse<_i10.CNExchangeEstimate>>
|
||||
getEstimatedExchangeAmountV2(
|
||||
{String? fromTicker,
|
||||
String? toTicker,
|
||||
_i9.CNEstimateType? fromOrTo,
|
||||
_i10.CNEstimateType? fromOrTo,
|
||||
_i7.Decimal? amount,
|
||||
String? fromNetwork,
|
||||
String? toNetwork,
|
||||
_i9.CNFlowType? flow = _i9.CNFlowType.standard,
|
||||
_i10.CNFlowType? flow = _i10.CNFlowType.standard,
|
||||
String? apiKey}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#getEstimatedExchangeAmountV2, [], {
|
||||
|
@ -122,20 +160,20 @@ class MockChangeNow extends _i1.Mock implements _i3.ChangeNowAPI {
|
|||
#apiKey: apiKey
|
||||
}),
|
||||
returnValue: Future<
|
||||
_i2.ExchangeResponse<_i9.CNExchangeEstimate>>.value(
|
||||
_FakeChangeNowResponse_0<_i9.CNExchangeEstimate>()))
|
||||
as _i5.Future<_i2.ExchangeResponse<_i9.CNExchangeEstimate>>);
|
||||
_i2.ExchangeResponse<_i10.CNExchangeEstimate>>.value(
|
||||
_FakeExchangeResponse_0<_i10.CNExchangeEstimate>()))
|
||||
as _i5.Future<_i2.ExchangeResponse<_i10.CNExchangeEstimate>>);
|
||||
@override
|
||||
_i5.Future<_i2.ExchangeResponse<List<_i10.FixedRateMarket>>>
|
||||
_i5.Future<_i2.ExchangeResponse<List<_i11.FixedRateMarket>>>
|
||||
getAvailableFixedRateMarkets({String? apiKey}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getAvailableFixedRateMarkets, [], {#apiKey: apiKey}),
|
||||
returnValue:
|
||||
Future<_i2.ExchangeResponse<List<_i10.FixedRateMarket>>>.value(
|
||||
_FakeChangeNowResponse_0<List<_i10.FixedRateMarket>>()))
|
||||
as _i5.Future<_i2.ExchangeResponse<List<_i10.FixedRateMarket>>>);
|
||||
Invocation.method(
|
||||
#getAvailableFixedRateMarkets, [], {#apiKey: apiKey}),
|
||||
returnValue:
|
||||
Future<_i2.ExchangeResponse<List<_i11.FixedRateMarket>>>.value(
|
||||
_FakeExchangeResponse_0<List<_i11.FixedRateMarket>>())) as _i5
|
||||
.Future<_i2.ExchangeResponse<List<_i11.FixedRateMarket>>>);
|
||||
@override
|
||||
_i5.Future<_i2.ExchangeResponse<_i11.ExchangeTransaction>>
|
||||
_i5.Future<_i2.ExchangeResponse<_i12.ExchangeTransaction>>
|
||||
createStandardExchangeTransaction(
|
||||
{String? fromTicker,
|
||||
String? toTicker,
|
||||
|
@ -161,11 +199,11 @@ class MockChangeNow extends _i1.Mock implements _i3.ChangeNowAPI {
|
|||
#apiKey: apiKey
|
||||
}),
|
||||
returnValue: Future<
|
||||
_i2.ExchangeResponse<_i11.ExchangeTransaction>>.value(
|
||||
_FakeChangeNowResponse_0<_i11.ExchangeTransaction>()))
|
||||
as _i5.Future<_i2.ExchangeResponse<_i11.ExchangeTransaction>>);
|
||||
_i2.ExchangeResponse<_i12.ExchangeTransaction>>.value(
|
||||
_FakeExchangeResponse_0<_i12.ExchangeTransaction>()))
|
||||
as _i5.Future<_i2.ExchangeResponse<_i12.ExchangeTransaction>>);
|
||||
@override
|
||||
_i5.Future<_i2.ExchangeResponse<_i11.ExchangeTransaction>>
|
||||
_i5.Future<_i2.ExchangeResponse<_i12.ExchangeTransaction>>
|
||||
createFixedRateExchangeTransaction(
|
||||
{String? fromTicker,
|
||||
String? toTicker,
|
||||
|
@ -193,26 +231,26 @@ class MockChangeNow extends _i1.Mock implements _i3.ChangeNowAPI {
|
|||
#apiKey: apiKey
|
||||
}),
|
||||
returnValue: Future<
|
||||
_i2.ExchangeResponse<_i11.ExchangeTransaction>>.value(
|
||||
_FakeChangeNowResponse_0<_i11.ExchangeTransaction>()))
|
||||
as _i5.Future<_i2.ExchangeResponse<_i11.ExchangeTransaction>>);
|
||||
_i2.ExchangeResponse<_i12.ExchangeTransaction>>.value(
|
||||
_FakeExchangeResponse_0<_i12.ExchangeTransaction>()))
|
||||
as _i5.Future<_i2.ExchangeResponse<_i12.ExchangeTransaction>>);
|
||||
@override
|
||||
_i5.Future<_i2.ExchangeResponse<_i12.ExchangeTransactionStatus>>
|
||||
_i5.Future<_i2.ExchangeResponse<_i13.ExchangeTransactionStatus>>
|
||||
getTransactionStatus({String? id, String? apiKey}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getTransactionStatus, [], {#id: id, #apiKey: apiKey}),
|
||||
returnValue:
|
||||
Future<_i2.ExchangeResponse<_i12.ExchangeTransactionStatus>>.value(
|
||||
_FakeChangeNowResponse_0<_i12.ExchangeTransactionStatus>())) as _i5
|
||||
.Future<_i2.ExchangeResponse<_i12.ExchangeTransactionStatus>>);
|
||||
Future<_i2.ExchangeResponse<_i13.ExchangeTransactionStatus>>.value(
|
||||
_FakeExchangeResponse_0<_i13.ExchangeTransactionStatus>())) as _i5
|
||||
.Future<_i2.ExchangeResponse<_i13.ExchangeTransactionStatus>>);
|
||||
@override
|
||||
_i5.Future<_i2.ExchangeResponse<List<_i13.AvailableFloatingRatePair>>>
|
||||
_i5.Future<_i2.ExchangeResponse<List<_i14.AvailableFloatingRatePair>>>
|
||||
getAvailableFloatingRatePairs({bool? includePartners = false}) => (super
|
||||
.noSuchMethod(
|
||||
Invocation.method(#getAvailableFloatingRatePairs, [],
|
||||
{#includePartners: includePartners}),
|
||||
returnValue:
|
||||
Future<_i2.ExchangeResponse<List<_i13.AvailableFloatingRatePair>>>.value(
|
||||
_FakeChangeNowResponse_0<List<_i13.AvailableFloatingRatePair>>())) as _i5
|
||||
.Future<_i2.ExchangeResponse<List<_i13.AvailableFloatingRatePair>>>);
|
||||
Future<_i2.ExchangeResponse<List<_i14.AvailableFloatingRatePair>>>.value(
|
||||
_FakeExchangeResponse_0<List<_i14.AvailableFloatingRatePair>>())) as _i5
|
||||
.Future<_i2.ExchangeResponse<List<_i14.AvailableFloatingRatePair>>>);
|
||||
}
|
||||
|
|
|
@ -9,19 +9,23 @@ import 'package:decimal/decimal.dart' as _i15;
|
|||
import 'package:http/http.dart' as _i13;
|
||||
import 'package:mockito/mockito.dart' as _i1;
|
||||
import 'package:stackwallet/models/exchange/change_now/available_floating_rate_pair.dart'
|
||||
as _i20;
|
||||
as _i22;
|
||||
import 'package:stackwallet/models/exchange/change_now/cn_exchange_estimate.dart'
|
||||
as _i17;
|
||||
import 'package:stackwallet/models/exchange/change_now/estimated_exchange_amount.dart'
|
||||
as _i16;
|
||||
import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart'
|
||||
as _i10;
|
||||
import 'package:stackwallet/models/exchange/change_now/exchange_transaction_status.dart'
|
||||
as _i19;
|
||||
import 'package:stackwallet/models/exchange/change_now/fixed_rate_market.dart'
|
||||
as _i18;
|
||||
import 'package:stackwallet/models/exchange/change_now/estimated_exchange_amount.dart'
|
||||
as _i17;
|
||||
import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart'
|
||||
as _i20;
|
||||
import 'package:stackwallet/models/exchange/change_now/exchange_transaction_status.dart'
|
||||
as _i21;
|
||||
import 'package:stackwallet/models/exchange/change_now/fixed_rate_market.dart'
|
||||
as _i19;
|
||||
import 'package:stackwallet/models/exchange/response_objects/currency.dart'
|
||||
as _i14;
|
||||
import 'package:stackwallet/models/exchange/response_objects/range.dart'
|
||||
as _i16;
|
||||
import 'package:stackwallet/models/exchange/response_objects/trade.dart'
|
||||
as _i10;
|
||||
import 'package:stackwallet/pages/exchange_view/sub_widgets/exchange_rate_sheet.dart'
|
||||
as _i5;
|
||||
import 'package:stackwallet/services/exchange/change_now/change_now_api.dart'
|
||||
|
@ -43,7 +47,7 @@ import 'package:stackwallet/utilities/prefs.dart' as _i3;
|
|||
// ignore_for_file: unnecessary_parenthesis
|
||||
// ignore_for_file: camel_case_types
|
||||
|
||||
class _FakeChangeNowResponse_0<T> extends _i1.Fake
|
||||
class _FakeExchangeResponse_0<T> extends _i1.Fake
|
||||
implements _i2.ExchangeResponse<T> {}
|
||||
|
||||
/// A class which mocks [Prefs].
|
||||
|
@ -246,33 +250,28 @@ class MockTradesService extends _i1.Mock implements _i9.TradesService {
|
|||
}
|
||||
|
||||
@override
|
||||
List<_i10.ExchangeTransaction> get trades =>
|
||||
(super.noSuchMethod(Invocation.getter(#trades),
|
||||
returnValue: <_i10.ExchangeTransaction>[])
|
||||
as List<_i10.ExchangeTransaction>);
|
||||
List<_i10.Trade> get trades => (super.noSuchMethod(Invocation.getter(#trades),
|
||||
returnValue: <_i10.Trade>[]) as List<_i10.Trade>);
|
||||
@override
|
||||
bool get hasListeners =>
|
||||
(super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false)
|
||||
as bool);
|
||||
@override
|
||||
_i7.Future<void> add(
|
||||
{_i10.ExchangeTransaction? trade, bool? shouldNotifyListeners}) =>
|
||||
_i7.Future<void> add({_i10.Trade? trade, bool? shouldNotifyListeners}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#add, [],
|
||||
{#trade: trade, #shouldNotifyListeners: shouldNotifyListeners}),
|
||||
returnValue: Future<void>.value(),
|
||||
returnValueForMissingStub: Future<void>.value()) as _i7.Future<void>);
|
||||
@override
|
||||
_i7.Future<void> edit(
|
||||
{_i10.ExchangeTransaction? trade, bool? shouldNotifyListeners}) =>
|
||||
_i7.Future<void> edit({_i10.Trade? trade, bool? shouldNotifyListeners}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#edit, [],
|
||||
{#trade: trade, #shouldNotifyListeners: shouldNotifyListeners}),
|
||||
returnValue: Future<void>.value(),
|
||||
returnValueForMissingStub: Future<void>.value()) as _i7.Future<void>);
|
||||
@override
|
||||
_i7.Future<void> delete(
|
||||
{_i10.ExchangeTransaction? trade, bool? shouldNotifyListeners}) =>
|
||||
_i7.Future<void> delete({_i10.Trade? trade, bool? shouldNotifyListeners}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#delete, [],
|
||||
{#trade: trade, #shouldNotifyListeners: shouldNotifyListeners}),
|
||||
|
@ -348,11 +347,11 @@ class MockTradeNotesService extends _i1.Mock implements _i11.TradeNotesService {
|
|||
returnValueForMissingStub: null);
|
||||
}
|
||||
|
||||
/// A class which mocks [ChangeNow].
|
||||
/// A class which mocks [ChangeNowAPI].
|
||||
///
|
||||
/// See the documentation for Mockito's code generation for more information.
|
||||
class MockChangeNow extends _i1.Mock implements _i12.ChangeNowAPI {
|
||||
MockChangeNow() {
|
||||
class MockChangeNowAPI extends _i1.Mock implements _i12.ChangeNowAPI {
|
||||
MockChangeNowAPI() {
|
||||
_i1.throwOnMissingStub(this);
|
||||
}
|
||||
|
||||
|
@ -367,7 +366,7 @@ class MockChangeNow extends _i1.Mock implements _i12.ChangeNowAPI {
|
|||
Invocation.method(#getAvailableCurrencies, [],
|
||||
{#fixedRate: fixedRate, #active: active}),
|
||||
returnValue: Future<_i2.ExchangeResponse<List<_i14.Currency>>>.value(
|
||||
_FakeChangeNowResponse_0<List<_i14.Currency>>())) as _i7
|
||||
_FakeExchangeResponse_0<List<_i14.Currency>>())) as _i7
|
||||
.Future<_i2.ExchangeResponse<List<_i14.Currency>>>);
|
||||
@override
|
||||
_i7.Future<_i2.ExchangeResponse<List<_i14.Currency>>> getPairedCurrencies(
|
||||
|
@ -376,7 +375,7 @@ class MockChangeNow extends _i1.Mock implements _i12.ChangeNowAPI {
|
|||
Invocation.method(#getPairedCurrencies, [],
|
||||
{#ticker: ticker, #fixedRate: fixedRate}),
|
||||
returnValue: Future<_i2.ExchangeResponse<List<_i14.Currency>>>.value(
|
||||
_FakeChangeNowResponse_0<List<_i14.Currency>>())) as _i7
|
||||
_FakeExchangeResponse_0<List<_i14.Currency>>())) as _i7
|
||||
.Future<_i2.ExchangeResponse<List<_i14.Currency>>>);
|
||||
@override
|
||||
_i7.Future<_i2.ExchangeResponse<_i15.Decimal>> getMinimalExchangeAmount(
|
||||
|
@ -388,10 +387,26 @@ class MockChangeNow extends _i1.Mock implements _i12.ChangeNowAPI {
|
|||
#apiKey: apiKey
|
||||
}),
|
||||
returnValue: Future<_i2.ExchangeResponse<_i15.Decimal>>.value(
|
||||
_FakeChangeNowResponse_0<_i15.Decimal>()))
|
||||
_FakeExchangeResponse_0<_i15.Decimal>()))
|
||||
as _i7.Future<_i2.ExchangeResponse<_i15.Decimal>>);
|
||||
@override
|
||||
_i7.Future<_i2.ExchangeResponse<_i16.EstimatedExchangeAmount>>
|
||||
_i7.Future<_i2.ExchangeResponse<_i16.Range>> getRange(
|
||||
{String? fromTicker,
|
||||
String? toTicker,
|
||||
bool? isFixedRate,
|
||||
String? apiKey}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#getRange, [], {
|
||||
#fromTicker: fromTicker,
|
||||
#toTicker: toTicker,
|
||||
#isFixedRate: isFixedRate,
|
||||
#apiKey: apiKey
|
||||
}),
|
||||
returnValue: Future<_i2.ExchangeResponse<_i16.Range>>.value(
|
||||
_FakeExchangeResponse_0<_i16.Range>()))
|
||||
as _i7.Future<_i2.ExchangeResponse<_i16.Range>>);
|
||||
@override
|
||||
_i7.Future<_i2.ExchangeResponse<_i17.EstimatedExchangeAmount>>
|
||||
getEstimatedExchangeAmount(
|
||||
{String? fromTicker,
|
||||
String? toTicker,
|
||||
|
@ -406,20 +421,42 @@ class MockChangeNow extends _i1.Mock implements _i12.ChangeNowAPI {
|
|||
}),
|
||||
returnValue: Future<
|
||||
_i2.ExchangeResponse<
|
||||
_i16.EstimatedExchangeAmount>>.value(
|
||||
_FakeChangeNowResponse_0<_i16.EstimatedExchangeAmount>()))
|
||||
_i17.EstimatedExchangeAmount>>.value(
|
||||
_FakeExchangeResponse_0<_i17.EstimatedExchangeAmount>()))
|
||||
as _i7
|
||||
.Future<_i2.ExchangeResponse<_i16.EstimatedExchangeAmount>>);
|
||||
.Future<_i2.ExchangeResponse<_i17.EstimatedExchangeAmount>>);
|
||||
@override
|
||||
_i7.Future<_i2.ExchangeResponse<_i17.CNExchangeEstimate>>
|
||||
_i7.Future<_i2.ExchangeResponse<_i17.EstimatedExchangeAmount>>
|
||||
getEstimatedExchangeAmountFixedRate(
|
||||
{String? fromTicker,
|
||||
String? toTicker,
|
||||
_i15.Decimal? fromAmount,
|
||||
bool? reversed,
|
||||
String? apiKey}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#getEstimatedExchangeAmountFixedRate, [], {
|
||||
#fromTicker: fromTicker,
|
||||
#toTicker: toTicker,
|
||||
#fromAmount: fromAmount,
|
||||
#reversed: reversed,
|
||||
#apiKey: apiKey
|
||||
}),
|
||||
returnValue: Future<
|
||||
_i2.ExchangeResponse<
|
||||
_i17.EstimatedExchangeAmount>>.value(
|
||||
_FakeExchangeResponse_0<_i17.EstimatedExchangeAmount>()))
|
||||
as _i7
|
||||
.Future<_i2.ExchangeResponse<_i17.EstimatedExchangeAmount>>);
|
||||
@override
|
||||
_i7.Future<_i2.ExchangeResponse<_i18.CNExchangeEstimate>>
|
||||
getEstimatedExchangeAmountV2(
|
||||
{String? fromTicker,
|
||||
String? toTicker,
|
||||
_i17.CNEstimateType? fromOrTo,
|
||||
_i18.CNEstimateType? fromOrTo,
|
||||
_i15.Decimal? amount,
|
||||
String? fromNetwork,
|
||||
String? toNetwork,
|
||||
_i17.CNFlowType? flow = _i17.CNFlowType.standard,
|
||||
_i18.CNFlowType? flow = _i18.CNFlowType.standard,
|
||||
String? apiKey}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(#getEstimatedExchangeAmountV2, [], {
|
||||
|
@ -433,20 +470,20 @@ class MockChangeNow extends _i1.Mock implements _i12.ChangeNowAPI {
|
|||
#apiKey: apiKey
|
||||
}),
|
||||
returnValue: Future<
|
||||
_i2.ExchangeResponse<_i17.CNExchangeEstimate>>.value(
|
||||
_FakeChangeNowResponse_0<_i17.CNExchangeEstimate>()))
|
||||
as _i7.Future<_i2.ExchangeResponse<_i17.CNExchangeEstimate>>);
|
||||
_i2.ExchangeResponse<_i18.CNExchangeEstimate>>.value(
|
||||
_FakeExchangeResponse_0<_i18.CNExchangeEstimate>()))
|
||||
as _i7.Future<_i2.ExchangeResponse<_i18.CNExchangeEstimate>>);
|
||||
@override
|
||||
_i7.Future<_i2.ExchangeResponse<List<_i18.FixedRateMarket>>>
|
||||
_i7.Future<_i2.ExchangeResponse<List<_i19.FixedRateMarket>>>
|
||||
getAvailableFixedRateMarkets({String? apiKey}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getAvailableFixedRateMarkets, [], {#apiKey: apiKey}),
|
||||
returnValue:
|
||||
Future<_i2.ExchangeResponse<List<_i18.FixedRateMarket>>>.value(
|
||||
_FakeChangeNowResponse_0<List<_i18.FixedRateMarket>>()))
|
||||
as _i7.Future<_i2.ExchangeResponse<List<_i18.FixedRateMarket>>>);
|
||||
Invocation.method(
|
||||
#getAvailableFixedRateMarkets, [], {#apiKey: apiKey}),
|
||||
returnValue:
|
||||
Future<_i2.ExchangeResponse<List<_i19.FixedRateMarket>>>.value(
|
||||
_FakeExchangeResponse_0<List<_i19.FixedRateMarket>>())) as _i7
|
||||
.Future<_i2.ExchangeResponse<List<_i19.FixedRateMarket>>>);
|
||||
@override
|
||||
_i7.Future<_i2.ExchangeResponse<_i10.ExchangeTransaction>>
|
||||
_i7.Future<_i2.ExchangeResponse<_i20.ExchangeTransaction>>
|
||||
createStandardExchangeTransaction(
|
||||
{String? fromTicker,
|
||||
String? toTicker,
|
||||
|
@ -472,11 +509,11 @@ class MockChangeNow extends _i1.Mock implements _i12.ChangeNowAPI {
|
|||
#apiKey: apiKey
|
||||
}),
|
||||
returnValue: Future<
|
||||
_i2.ExchangeResponse<_i10.ExchangeTransaction>>.value(
|
||||
_FakeChangeNowResponse_0<_i10.ExchangeTransaction>()))
|
||||
as _i7.Future<_i2.ExchangeResponse<_i10.ExchangeTransaction>>);
|
||||
_i2.ExchangeResponse<_i20.ExchangeTransaction>>.value(
|
||||
_FakeExchangeResponse_0<_i20.ExchangeTransaction>()))
|
||||
as _i7.Future<_i2.ExchangeResponse<_i20.ExchangeTransaction>>);
|
||||
@override
|
||||
_i7.Future<_i2.ExchangeResponse<_i10.ExchangeTransaction>>
|
||||
_i7.Future<_i2.ExchangeResponse<_i20.ExchangeTransaction>>
|
||||
createFixedRateExchangeTransaction(
|
||||
{String? fromTicker,
|
||||
String? toTicker,
|
||||
|
@ -504,26 +541,26 @@ class MockChangeNow extends _i1.Mock implements _i12.ChangeNowAPI {
|
|||
#apiKey: apiKey
|
||||
}),
|
||||
returnValue: Future<
|
||||
_i2.ExchangeResponse<_i10.ExchangeTransaction>>.value(
|
||||
_FakeChangeNowResponse_0<_i10.ExchangeTransaction>()))
|
||||
as _i7.Future<_i2.ExchangeResponse<_i10.ExchangeTransaction>>);
|
||||
_i2.ExchangeResponse<_i20.ExchangeTransaction>>.value(
|
||||
_FakeExchangeResponse_0<_i20.ExchangeTransaction>()))
|
||||
as _i7.Future<_i2.ExchangeResponse<_i20.ExchangeTransaction>>);
|
||||
@override
|
||||
_i7.Future<_i2.ExchangeResponse<_i19.ExchangeTransactionStatus>>
|
||||
_i7.Future<_i2.ExchangeResponse<_i21.ExchangeTransactionStatus>>
|
||||
getTransactionStatus({String? id, String? apiKey}) => (super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getTransactionStatus, [], {#id: id, #apiKey: apiKey}),
|
||||
returnValue:
|
||||
Future<_i2.ExchangeResponse<_i19.ExchangeTransactionStatus>>.value(
|
||||
_FakeChangeNowResponse_0<_i19.ExchangeTransactionStatus>())) as _i7
|
||||
.Future<_i2.ExchangeResponse<_i19.ExchangeTransactionStatus>>);
|
||||
Future<_i2.ExchangeResponse<_i21.ExchangeTransactionStatus>>.value(
|
||||
_FakeExchangeResponse_0<_i21.ExchangeTransactionStatus>())) as _i7
|
||||
.Future<_i2.ExchangeResponse<_i21.ExchangeTransactionStatus>>);
|
||||
@override
|
||||
_i7.Future<_i2.ExchangeResponse<List<_i20.AvailableFloatingRatePair>>>
|
||||
_i7.Future<_i2.ExchangeResponse<List<_i22.AvailableFloatingRatePair>>>
|
||||
getAvailableFloatingRatePairs({bool? includePartners = false}) => (super
|
||||
.noSuchMethod(
|
||||
Invocation.method(#getAvailableFloatingRatePairs, [],
|
||||
{#includePartners: includePartners}),
|
||||
returnValue:
|
||||
Future<_i2.ExchangeResponse<List<_i20.AvailableFloatingRatePair>>>.value(
|
||||
_FakeChangeNowResponse_0<List<_i20.AvailableFloatingRatePair>>())) as _i7
|
||||
.Future<_i2.ExchangeResponse<List<_i20.AvailableFloatingRatePair>>>);
|
||||
Future<_i2.ExchangeResponse<List<_i22.AvailableFloatingRatePair>>>.value(
|
||||
_FakeExchangeResponse_0<List<_i22.AvailableFloatingRatePair>>())) as _i7
|
||||
.Future<_i2.ExchangeResponse<List<_i22.AvailableFloatingRatePair>>>);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue