From 0c11e859aa97f7b96954ce99821db35ca6ab4358 Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 28 Feb 2023 14:27:42 -0600 Subject: [PATCH] changenow v2 currencies call to access tokenContract param --- lib/models/isar/exchange_cache/currency.dart | 16 +- .../isar/exchange_cache/currency.g.dart | 205 ++++++++++++++++++ .../models/blockchain_data/address.g.dart | 2 + .../models/blockchain_data/transaction.g.dart | 2 + .../sub_widgets/add_token_list_element.dart | 28 +-- .../exchange/change_now/change_now_api.dart | 83 +++++++ .../change_now/change_now_exchange.dart | 9 +- .../majestic_bank/majestic_bank_exchange.dart | 1 + .../simpleswap/simpleswap_exchange.dart | 1 + .../pages/send_view/send_view_test.mocks.dart | 16 ++ .../exchange/exchange_view_test.mocks.dart | 17 ++ .../managed_favorite_test.mocks.dart | 16 ++ .../table_view/table_view_row_test.mocks.dart | 16 ++ .../transaction_card_test.mocks.dart | 15 ++ test/widget_tests/wallet_card_test.mocks.dart | 16 ++ ...et_info_row_balance_future_test.mocks.dart | 16 ++ .../wallet_info_row_test.mocks.dart | 16 ++ 17 files changed, 452 insertions(+), 23 deletions(-) diff --git a/lib/models/isar/exchange_cache/currency.dart b/lib/models/isar/exchange_cache/currency.dart index 81471a3d1..1744f9350 100644 --- a/lib/models/isar/exchange_cache/currency.dart +++ b/lib/models/isar/exchange_cache/currency.dart @@ -44,11 +44,16 @@ class Currency { @Index() final bool isStackCoin; - @ignore - bool get supportsFixedRate => rateType == SupportedRateType.fixed || rateType == SupportedRateType.both; + final String? tokenContract; @ignore - bool get supportsEstimatedRate => rateType == SupportedRateType.estimated || rateType == SupportedRateType.both; + bool get supportsFixedRate => + rateType == SupportedRateType.fixed || rateType == SupportedRateType.both; + + @ignore + bool get supportsEstimatedRate => + rateType == SupportedRateType.estimated || + rateType == SupportedRateType.both; Currency({ required this.exchangeName, @@ -61,6 +66,7 @@ class Currency { required this.rateType, this.isAvailable, required this.isStackCoin, + required this.tokenContract, }); factory Currency.fromJson( @@ -83,6 +89,7 @@ class Currency { isAvailable: json["isAvailable"] as bool?, isStackCoin: json["isStackCoin"] as bool? ?? Currency.checkIsStackCoin(ticker), + tokenContract: json["tokenContract"] as String?, )..id = json["id"] as int?; } catch (e) { rethrow; @@ -102,6 +109,7 @@ class Currency { "rateType": rateType, "isAvailable": isAvailable, "isStackCoin": isStackCoin, + "tokenContract": tokenContract, }; return map; @@ -119,6 +127,7 @@ class Currency { SupportedRateType? rateType, bool? isAvailable, bool? isStackCoin, + String? tokenContract, }) { return Currency( exchangeName: exchangeName ?? this.exchangeName, @@ -131,6 +140,7 @@ class Currency { rateType: rateType ?? this.rateType, isAvailable: isAvailable ?? this.isAvailable, isStackCoin: isStackCoin ?? this.isStackCoin, + tokenContract: tokenContract ?? this.tokenContract, )..id = id ?? this.id; } diff --git a/lib/models/isar/exchange_cache/currency.g.dart b/lib/models/isar/exchange_cache/currency.g.dart index 02c58cadd..8f81bfdc0 100644 --- a/lib/models/isar/exchange_cache/currency.g.dart +++ b/lib/models/isar/exchange_cache/currency.g.dart @@ -67,6 +67,11 @@ const CurrencySchema = CollectionSchema( id: 9, name: r'ticker', type: IsarType.string, + ), + r'tokenContract': PropertySchema( + id: 10, + name: r'tokenContract', + type: IsarType.string, ) }, estimateSize: _currencyEstimateSize, @@ -150,6 +155,12 @@ int _currencyEstimateSize( bytesCount += 3 + object.name.length * 3; bytesCount += 3 + object.network.length * 3; bytesCount += 3 + object.ticker.length * 3; + { + final value = object.tokenContract; + if (value != null) { + bytesCount += 3 + value.length * 3; + } + } return bytesCount; } @@ -169,6 +180,7 @@ void _currencySerialize( writer.writeString(offsets[7], object.network); writer.writeByte(offsets[8], object.rateType.index); writer.writeString(offsets[9], object.ticker); + writer.writeString(offsets[10], object.tokenContract); } Currency _currencyDeserialize( @@ -190,6 +202,7 @@ Currency _currencyDeserialize( _CurrencyrateTypeValueEnumMap[reader.readByteOrNull(offsets[8])] ?? SupportedRateType.fixed, ticker: reader.readString(offsets[9]), + tokenContract: reader.readStringOrNull(offsets[10]), ); object.id = id; return object; @@ -223,6 +236,8 @@ P _currencyDeserializeProp

( SupportedRateType.fixed) as P; case 9: return (reader.readString(offset)) as P; + case 10: + return (reader.readStringOrNull(offset)) as P; default: throw IsarError('Unknown property with id $propertyId'); } @@ -1533,6 +1548,158 @@ extension CurrencyQueryFilter )); }); } + + QueryBuilder + tokenContractIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'tokenContract', + )); + }); + } + + QueryBuilder + tokenContractIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'tokenContract', + )); + }); + } + + QueryBuilder tokenContractEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'tokenContract', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + tokenContractGreaterThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'tokenContract', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder tokenContractLessThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'tokenContract', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder tokenContractBetween( + String? lower, + String? upper, { + bool includeLower = true, + bool includeUpper = true, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'tokenContract', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + tokenContractStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'tokenContract', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder tokenContractEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'tokenContract', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder tokenContractContains( + String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'tokenContract', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder tokenContractMatches( + String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'tokenContract', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + tokenContractIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'tokenContract', + value: '', + )); + }); + } + + QueryBuilder + tokenContractIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'tokenContract', + value: '', + )); + }); + } } extension CurrencyQueryObject @@ -1661,6 +1828,18 @@ extension CurrencyQuerySortBy on QueryBuilder { return query.addSortBy(r'ticker', Sort.desc); }); } + + QueryBuilder sortByTokenContract() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'tokenContract', Sort.asc); + }); + } + + QueryBuilder sortByTokenContractDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'tokenContract', Sort.desc); + }); + } } extension CurrencyQuerySortThenBy @@ -1796,6 +1975,18 @@ extension CurrencyQuerySortThenBy return query.addSortBy(r'ticker', Sort.desc); }); } + + QueryBuilder thenByTokenContract() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'tokenContract', Sort.asc); + }); + } + + QueryBuilder thenByTokenContractDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'tokenContract', Sort.desc); + }); + } } extension CurrencyQueryWhereDistinct @@ -1865,6 +2056,14 @@ extension CurrencyQueryWhereDistinct return query.addDistinctBy(r'ticker', caseSensitive: caseSensitive); }); } + + QueryBuilder distinctByTokenContract( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'tokenContract', + caseSensitive: caseSensitive); + }); + } } extension CurrencyQueryProperty @@ -1935,4 +2134,10 @@ extension CurrencyQueryProperty return query.addPropertyName(r'ticker'); }); } + + QueryBuilder tokenContractProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'tokenContract'); + }); + } } diff --git a/lib/models/isar/models/blockchain_data/address.g.dart b/lib/models/isar/models/blockchain_data/address.g.dart index 37186584b..49188b395 100644 --- a/lib/models/isar/models/blockchain_data/address.g.dart +++ b/lib/models/isar/models/blockchain_data/address.g.dart @@ -260,6 +260,7 @@ const _AddresstypeEnumValueMap = { 'mimbleWimble': 4, 'unknown': 5, 'nonWallet': 6, + 'ethereum': 7, }; const _AddresstypeValueEnumMap = { 0: AddressType.p2pkh, @@ -269,6 +270,7 @@ const _AddresstypeValueEnumMap = { 4: AddressType.mimbleWimble, 5: AddressType.unknown, 6: AddressType.nonWallet, + 7: AddressType.ethereum, }; Id _addressGetId(Address object) { diff --git a/lib/models/isar/models/blockchain_data/transaction.g.dart b/lib/models/isar/models/blockchain_data/transaction.g.dart index 53acce84f..b70e0eec7 100644 --- a/lib/models/isar/models/blockchain_data/transaction.g.dart +++ b/lib/models/isar/models/blockchain_data/transaction.g.dart @@ -330,12 +330,14 @@ const _TransactionsubTypeEnumValueMap = { 'bip47Notification': 1, 'mint': 2, 'join': 3, + 'ethToken': 4, }; const _TransactionsubTypeValueEnumMap = { 0: TransactionSubType.none, 1: TransactionSubType.bip47Notification, 2: TransactionSubType.mint, 3: TransactionSubType.join, + 4: TransactionSubType.ethToken, }; const _TransactiontypeEnumValueMap = { 'outgoing': 0, diff --git a/lib/pages/add_wallet_views/add_token_view/sub_widgets/add_token_list_element.dart b/lib/pages/add_wallet_views/add_token_view/sub_widgets/add_token_list_element.dart index ecf19fa85..2dbdd7ce5 100644 --- a/lib/pages/add_wallet_views/add_token_view/sub_widgets/add_token_list_element.dart +++ b/lib/pages/add_wallet_views/add_token_view/sub_widgets/add_token_list_element.dart @@ -5,6 +5,7 @@ import 'package:stackwallet/models/ethereum/eth_token.dart'; import 'package:stackwallet/models/isar/exchange_cache/currency.dart'; import 'package:stackwallet/services/exchange/change_now/change_now_exchange.dart'; import 'package:stackwallet/services/exchange/exchange_data_loading_service.dart'; +import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/widgets/custom_buttons/draggable_switch_button.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; @@ -30,23 +31,16 @@ class _AddTokenListElementState extends State { Widget build(BuildContext context) { final currency = ExchangeDataLoadingService.instance.isar.currencies .where() - .tickerExchangeNameEqualToAnyName( - "${widget.data.token.symbol}ERC20", - ChangeNowExchange.exchangeName, - ) - .or() - .tickerExchangeNameEqualToAnyName( - widget.data.token.symbol, - ChangeNowExchange.exchangeName, - ) - .or() - .tickerExchangeNameEqualToAnyName( - "${widget.data.token.symbol}BSC", - ChangeNowExchange.exchangeName, - ) + .exchangeNameEqualTo(ChangeNowExchange.exchangeName) .filter() + .tokenContractEqualTo( + widget.data.token.contractAddress, + caseSensitive: false, + ) + .and() .imageIsNotEmpty() .findFirstSync(); + return RoundedWhiteContainer( child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -59,10 +53,12 @@ class _AddTokenListElementState extends State { width: 24, height: 24, ) - : Container( + : SvgPicture.asset( + widget.data.token.symbol == "BNB" + ? Assets.svg.bnbIcon + : Assets.svg.ethereum, width: 24, height: 24, - color: Colors.red, ), const SizedBox( width: 12, diff --git a/lib/services/exchange/change_now/change_now_api.dart b/lib/services/exchange/change_now/change_now_api.dart index cc9a14182..57823a813 100644 --- a/lib/services/exchange/change_now/change_now_api.dart +++ b/lib/services/exchange/change_now/change_now_api.dart @@ -195,6 +195,89 @@ class ChangeNowAPI { } } + Future>> getCurrenciesV2( + // { + // bool? fixedRate, + // bool? active, + // } + ) async { + Map? params; + + // if (active != null || fixedRate != null) { + // params = {}; + // if (fixedRate != null) { + // params.addAll({"fixedRate": fixedRate.toString()}); + // } + // if (active != null) { + // params.addAll({"active": active.toString()}); + // } + // } + + final uri = _buildUriV2("/exchange/currencies", params); + + try { + // json array is expected here + final jsonArray = await _makeGetRequest(uri); + + try { + final result = await compute( + _parseV2CurrenciesJson, + jsonArray as List, + ); + return result; + } catch (e, s) { + Logging.instance.log("getAvailableCurrencies exception: $e\n$s", + level: LogLevel.Error); + return ExchangeResponse( + exception: ExchangeException( + "Error: $jsonArray", + ExchangeExceptionType.serializeResponseError, + ), + ); + } + } catch (e, s) { + Logging.instance.log("getAvailableCurrencies exception: $e\n$s", + level: LogLevel.Error); + return ExchangeResponse( + exception: ExchangeException( + e.toString(), + ExchangeExceptionType.generic, + ), + ); + } + } + + ExchangeResponse> _parseV2CurrenciesJson( + List args, + ) { + try { + List currencies = []; + + for (final json in args) { + try { + final map = Map.from(json as Map); + currencies.add( + Currency.fromJson( + map, + rateType: (map["supportsFixedRate"] as bool) + ? SupportedRateType.both + : SupportedRateType.estimated, + exchangeName: ChangeNowExchange.exchangeName, + ), + ); + } catch (_) { + return ExchangeResponse( + exception: ExchangeException("Failed to serialize $json", + ExchangeExceptionType.serializeResponseError)); + } + } + + return ExchangeResponse(value: currencies); + } catch (_) { + rethrow; + } + } + /// This API endpoint returns the array of markets available for the specified currency be default. /// The availability of a particular pair is determined by the 'isAvailable' field. /// diff --git a/lib/services/exchange/change_now/change_now_exchange.dart b/lib/services/exchange/change_now/change_now_exchange.dart index dd5baec94..3189ff84e 100644 --- a/lib/services/exchange/change_now/change_now_exchange.dart +++ b/lib/services/exchange/change_now/change_now_exchange.dart @@ -82,10 +82,11 @@ class ChangeNowExchange extends Exchange { Future>> getAllCurrencies( bool fixedRate, ) async { - return await ChangeNowAPI.instance.getAvailableCurrencies( - fixedRate: fixedRate ? true : null, - active: true, - ); + return await ChangeNowAPI.instance.getCurrenciesV2(); + // return await ChangeNowAPI.instance.getAvailableCurrencies( + // fixedRate: fixedRate ? true : null, + // active: true, + // ); } @override diff --git a/lib/services/exchange/majestic_bank/majestic_bank_exchange.dart b/lib/services/exchange/majestic_bank/majestic_bank_exchange.dart index acb881c31..24403b722 100644 --- a/lib/services/exchange/majestic_bank/majestic_bank_exchange.dart +++ b/lib/services/exchange/majestic_bank/majestic_bank_exchange.dart @@ -131,6 +131,7 @@ class MajesticBankExchange extends Exchange { rateType: SupportedRateType.both, isAvailable: true, isStackCoin: Currency.checkIsStackCoin(limit.currency), + tokenContract: null, ); currencies.add(currency); } diff --git a/lib/services/exchange/simpleswap/simpleswap_exchange.dart b/lib/services/exchange/simpleswap/simpleswap_exchange.dart index 791ccb17c..1157bd09e 100644 --- a/lib/services/exchange/simpleswap/simpleswap_exchange.dart +++ b/lib/services/exchange/simpleswap/simpleswap_exchange.dart @@ -67,6 +67,7 @@ class SimpleSwapExchange extends Exchange { : SupportedRateType.estimated, isAvailable: true, isStackCoin: Currency.checkIsStackCoin(e.symbol), + tokenContract: null, ), ) .toList(); diff --git a/test/pages/send_view/send_view_test.mocks.dart b/test/pages/send_view/send_view_test.mocks.dart index 0bd33fe78..50e97f600 100644 --- a/test/pages/send_view/send_view_test.mocks.dart +++ b/test/pages/send_view/send_view_test.mocks.dart @@ -1988,6 +1988,22 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValue: _i22.Future<_i18.PaymentCode?>.value(), ) as _i22.Future<_i18.PaymentCode?>); @override + _i22.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransactionBad({ + required _i16.Transaction? transaction, + required _i16.Address? myNotificationAddress, + }) => + (super.noSuchMethod( + Invocation.method( + #unBlindedPaymentCodeFromTransactionBad, + [], + { + #transaction: transaction, + #myNotificationAddress: myNotificationAddress, + }, + ), + returnValue: _i22.Future<_i18.PaymentCode?>.value(), + ) as _i22.Future<_i18.PaymentCode?>); + @override _i22.Future> getAllPaymentCodesFromNotificationTransactions() => (super.noSuchMethod( Invocation.method( diff --git a/test/screen_tests/exchange/exchange_view_test.mocks.dart b/test/screen_tests/exchange/exchange_view_test.mocks.dart index 767b18bb6..5ef51904d 100644 --- a/test/screen_tests/exchange/exchange_view_test.mocks.dart +++ b/test/screen_tests/exchange/exchange_view_test.mocks.dart @@ -662,6 +662,23 @@ class MockChangeNowAPI extends _i1.Mock implements _i11.ChangeNowAPI { )), ) as _i6.Future<_i2.ExchangeResponse>>); @override + _i6.Future<_i2.ExchangeResponse>> getCurrenciesV2() => + (super.noSuchMethod( + Invocation.method( + #getCurrenciesV2, + [], + ), + returnValue: + _i6.Future<_i2.ExchangeResponse>>.value( + _FakeExchangeResponse_0>( + this, + Invocation.method( + #getCurrenciesV2, + [], + ), + )), + ) as _i6.Future<_i2.ExchangeResponse>>); + @override _i6.Future<_i2.ExchangeResponse>> getPairedCurrencies({ required String? ticker, bool? fixedRate, diff --git a/test/widget_tests/managed_favorite_test.mocks.dart b/test/widget_tests/managed_favorite_test.mocks.dart index 95a80031f..c3237983f 100644 --- a/test/widget_tests/managed_favorite_test.mocks.dart +++ b/test/widget_tests/managed_favorite_test.mocks.dart @@ -1780,6 +1780,22 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { returnValue: _i22.Future<_i17.PaymentCode?>.value(), ) as _i22.Future<_i17.PaymentCode?>); @override + _i22.Future<_i17.PaymentCode?> unBlindedPaymentCodeFromTransactionBad({ + required _i15.Transaction? transaction, + required _i15.Address? myNotificationAddress, + }) => + (super.noSuchMethod( + Invocation.method( + #unBlindedPaymentCodeFromTransactionBad, + [], + { + #transaction: transaction, + #myNotificationAddress: myNotificationAddress, + }, + ), + returnValue: _i22.Future<_i17.PaymentCode?>.value(), + ) as _i22.Future<_i17.PaymentCode?>); + @override _i22.Future> getAllPaymentCodesFromNotificationTransactions() => (super.noSuchMethod( Invocation.method( diff --git a/test/widget_tests/table_view/table_view_row_test.mocks.dart b/test/widget_tests/table_view/table_view_row_test.mocks.dart index e4076b175..26b0bdfcc 100644 --- a/test/widget_tests/table_view/table_view_row_test.mocks.dart +++ b/test/widget_tests/table_view/table_view_row_test.mocks.dart @@ -1767,6 +1767,22 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet { returnValue: _i21.Future<_i17.PaymentCode?>.value(), ) as _i21.Future<_i17.PaymentCode?>); @override + _i21.Future<_i17.PaymentCode?> unBlindedPaymentCodeFromTransactionBad({ + required _i15.Transaction? transaction, + required _i15.Address? myNotificationAddress, + }) => + (super.noSuchMethod( + Invocation.method( + #unBlindedPaymentCodeFromTransactionBad, + [], + { + #transaction: transaction, + #myNotificationAddress: myNotificationAddress, + }, + ), + returnValue: _i21.Future<_i17.PaymentCode?>.value(), + ) as _i21.Future<_i17.PaymentCode?>); + @override _i21.Future> getAllPaymentCodesFromNotificationTransactions() => (super.noSuchMethod( Invocation.method( diff --git a/test/widget_tests/transaction_card_test.mocks.dart b/test/widget_tests/transaction_card_test.mocks.dart index b26e5779d..5d0011b14 100644 --- a/test/widget_tests/transaction_card_test.mocks.dart +++ b/test/widget_tests/transaction_card_test.mocks.dart @@ -2454,6 +2454,21 @@ class MockPriceService extends _i1.Mock implements _i26.PriceService { ), ) as _i15.Tuple2<_i14.Decimal, double>); @override + _i15.Tuple2<_i14.Decimal, double> getTokenPrice(String? contractAddress) => + (super.noSuchMethod( + Invocation.method( + #getTokenPrice, + [contractAddress], + ), + returnValue: _FakeTuple2_13<_i14.Decimal, double>( + this, + Invocation.method( + #getTokenPrice, + [contractAddress], + ), + ), + ) as _i15.Tuple2<_i14.Decimal, double>); + @override _i18.Future updatePrice() => (super.noSuchMethod( Invocation.method( #updatePrice, diff --git a/test/widget_tests/wallet_card_test.mocks.dart b/test/widget_tests/wallet_card_test.mocks.dart index 696d8a0fd..e3a64d7da 100644 --- a/test/widget_tests/wallet_card_test.mocks.dart +++ b/test/widget_tests/wallet_card_test.mocks.dart @@ -1530,6 +1530,22 @@ class MockBitcoinWallet extends _i1.Mock implements _i23.BitcoinWallet { returnValue: _i20.Future<_i17.PaymentCode?>.value(), ) as _i20.Future<_i17.PaymentCode?>); @override + _i20.Future<_i17.PaymentCode?> unBlindedPaymentCodeFromTransactionBad({ + required _i15.Transaction? transaction, + required _i15.Address? myNotificationAddress, + }) => + (super.noSuchMethod( + Invocation.method( + #unBlindedPaymentCodeFromTransactionBad, + [], + { + #transaction: transaction, + #myNotificationAddress: myNotificationAddress, + }, + ), + returnValue: _i20.Future<_i17.PaymentCode?>.value(), + ) as _i20.Future<_i17.PaymentCode?>); + @override _i20.Future> getAllPaymentCodesFromNotificationTransactions() => (super.noSuchMethod( Invocation.method( diff --git a/test/widget_tests/wallet_info_row/sub_widgets/wallet_info_row_balance_future_test.mocks.dart b/test/widget_tests/wallet_info_row/sub_widgets/wallet_info_row_balance_future_test.mocks.dart index cf667bf2d..18da705aa 100644 --- a/test/widget_tests/wallet_info_row/sub_widgets/wallet_info_row_balance_future_test.mocks.dart +++ b/test/widget_tests/wallet_info_row/sub_widgets/wallet_info_row_balance_future_test.mocks.dart @@ -1779,6 +1779,22 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { returnValue: _i22.Future<_i17.PaymentCode?>.value(), ) as _i22.Future<_i17.PaymentCode?>); @override + _i22.Future<_i17.PaymentCode?> unBlindedPaymentCodeFromTransactionBad({ + required _i15.Transaction? transaction, + required _i15.Address? myNotificationAddress, + }) => + (super.noSuchMethod( + Invocation.method( + #unBlindedPaymentCodeFromTransactionBad, + [], + { + #transaction: transaction, + #myNotificationAddress: myNotificationAddress, + }, + ), + returnValue: _i22.Future<_i17.PaymentCode?>.value(), + ) as _i22.Future<_i17.PaymentCode?>); + @override _i22.Future> getAllPaymentCodesFromNotificationTransactions() => (super.noSuchMethod( Invocation.method( diff --git a/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart b/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart index 019047b9a..0f8c36d4a 100644 --- a/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart +++ b/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart @@ -1779,6 +1779,22 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { returnValue: _i22.Future<_i17.PaymentCode?>.value(), ) as _i22.Future<_i17.PaymentCode?>); @override + _i22.Future<_i17.PaymentCode?> unBlindedPaymentCodeFromTransactionBad({ + required _i15.Transaction? transaction, + required _i15.Address? myNotificationAddress, + }) => + (super.noSuchMethod( + Invocation.method( + #unBlindedPaymentCodeFromTransactionBad, + [], + { + #transaction: transaction, + #myNotificationAddress: myNotificationAddress, + }, + ), + returnValue: _i22.Future<_i17.PaymentCode?>.value(), + ) as _i22.Future<_i17.PaymentCode?>); + @override _i22.Future> getAllPaymentCodesFromNotificationTransactions() => (super.noSuchMethod( Invocation.method(