From 9716bed96fca98f21fed2147cbc7a2446e23b183 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 8 Mar 2023 14:28:47 -0600 Subject: [PATCH] update mocks --- .../pages/send_view/send_view_test.mocks.dart | 73 +++++++++++-------- .../managed_favorite_test.mocks.dart | 73 +++++++++++-------- .../table_view/table_view_row_test.mocks.dart | 73 +++++++++++-------- test/widget_tests/wallet_card_test.mocks.dart | 73 +++++++++++-------- ...et_info_row_balance_future_test.mocks.dart | 73 +++++++++++-------- .../wallet_info_row_test.mocks.dart | 73 +++++++++++-------- 6 files changed, 264 insertions(+), 174 deletions(-) diff --git a/test/pages/send_view/send_view_test.mocks.dart b/test/pages/send_view/send_view_test.mocks.dart index 6a117aa06..cce89daf6 100644 --- a/test/pages/send_view/send_view_test.mocks.dart +++ b/test/pages/send_view/send_view_test.mocks.dart @@ -1415,44 +1415,24 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValue: 0, ) as int); @override - _i22.Future f({ + dynamic coinSelection({ required int? satoshiAmountToSend, required int? selectedTxFeeRate, required String? recipientAddress, - required List<_i16.UTXO>? utxos, - }) => - (super.noSuchMethod( - Invocation.method( - #f, - [], - { - #satoshiAmountToSend: satoshiAmountToSend, - #selectedTxFeeRate: selectedTxFeeRate, - #recipientAddress: recipientAddress, - #utxos: utxos, - }, - ), - returnValue: _i22.Future.value(), - returnValueForMissingStub: _i22.Future.value(), - ) as _i22.Future); - @override - dynamic coinSelection( - int? satoshiAmountToSend, - int? selectedTxFeeRate, - String? _recipientAddress, - bool? isSendAll, { + required bool? coinControl, + required bool? isSendAll, int? additionalOutputs = 0, List<_i16.UTXO>? utxos, }) => super.noSuchMethod(Invocation.method( #coinSelection, - [ - satoshiAmountToSend, - selectedTxFeeRate, - _recipientAddress, - isSendAll, - ], + [], { + #satoshiAmountToSend: satoshiAmountToSend, + #selectedTxFeeRate: selectedTxFeeRate, + #recipientAddress: recipientAddress, + #coinControl: coinControl, + #isSendAll: isSendAll, #additionalOutputs: additionalOutputs, #utxos: utxos, }, @@ -2189,6 +2169,41 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { ), returnValue: _i22.Future.value(''), ) as _i22.Future); + @override + void initCoinControlInterface({ + required String? walletId, + required String? walletName, + required _i21.Coin? coin, + required _i13.MainDB? db, + required _i22.Future Function()? getChainHeight, + required _i22.Future Function(_i12.Balance)? refreshedBalanceCallback, + }) => + super.noSuchMethod( + Invocation.method( + #initCoinControlInterface, + [], + { + #walletId: walletId, + #walletName: walletName, + #coin: coin, + #db: db, + #getChainHeight: getChainHeight, + #refreshedBalanceCallback: refreshedBalanceCallback, + }, + ), + returnValueForMissingStub: null, + ); + @override + _i22.Future refreshBalance({bool? notify = false}) => + (super.noSuchMethod( + Invocation.method( + #refreshBalance, + [], + {#notify: notify}, + ), + returnValue: _i22.Future.value(), + returnValueForMissingStub: _i22.Future.value(), + ) as _i22.Future); } /// A class which mocks [LocaleService]. diff --git a/test/widget_tests/managed_favorite_test.mocks.dart b/test/widget_tests/managed_favorite_test.mocks.dart index 13108dfb8..2ec582fc9 100644 --- a/test/widget_tests/managed_favorite_test.mocks.dart +++ b/test/widget_tests/managed_favorite_test.mocks.dart @@ -1207,44 +1207,24 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { returnValue: 0, ) as int); @override - _i22.Future f({ + dynamic coinSelection({ required int? satoshiAmountToSend, required int? selectedTxFeeRate, required String? recipientAddress, - required List<_i15.UTXO>? utxos, - }) => - (super.noSuchMethod( - Invocation.method( - #f, - [], - { - #satoshiAmountToSend: satoshiAmountToSend, - #selectedTxFeeRate: selectedTxFeeRate, - #recipientAddress: recipientAddress, - #utxos: utxos, - }, - ), - returnValue: _i22.Future.value(), - returnValueForMissingStub: _i22.Future.value(), - ) as _i22.Future); - @override - dynamic coinSelection( - int? satoshiAmountToSend, - int? selectedTxFeeRate, - String? _recipientAddress, - bool? isSendAll, { + required bool? coinControl, + required bool? isSendAll, int? additionalOutputs = 0, List<_i15.UTXO>? utxos, }) => super.noSuchMethod(Invocation.method( #coinSelection, - [ - satoshiAmountToSend, - selectedTxFeeRate, - _recipientAddress, - isSendAll, - ], + [], { + #satoshiAmountToSend: satoshiAmountToSend, + #selectedTxFeeRate: selectedTxFeeRate, + #recipientAddress: recipientAddress, + #coinControl: coinControl, + #isSendAll: isSendAll, #additionalOutputs: additionalOutputs, #utxos: utxos, }, @@ -1981,6 +1961,41 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { ), returnValue: _i22.Future.value(''), ) as _i22.Future); + @override + void initCoinControlInterface({ + required String? walletId, + required String? walletName, + required _i21.Coin? coin, + required _i12.MainDB? db, + required _i22.Future Function()? getChainHeight, + required _i22.Future Function(_i11.Balance)? refreshedBalanceCallback, + }) => + super.noSuchMethod( + Invocation.method( + #initCoinControlInterface, + [], + { + #walletId: walletId, + #walletName: walletName, + #coin: coin, + #db: db, + #getChainHeight: getChainHeight, + #refreshedBalanceCallback: refreshedBalanceCallback, + }, + ), + returnValueForMissingStub: null, + ); + @override + _i22.Future refreshBalance({bool? notify = false}) => + (super.noSuchMethod( + Invocation.method( + #refreshBalance, + [], + {#notify: notify}, + ), + returnValue: _i22.Future.value(), + returnValueForMissingStub: _i22.Future.value(), + ) as _i22.Future); } /// A class which mocks [LocaleService]. 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 0beccc606..fd247fd7c 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 @@ -1194,44 +1194,24 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet { returnValue: 0, ) as int); @override - _i21.Future f({ + dynamic coinSelection({ required int? satoshiAmountToSend, required int? selectedTxFeeRate, required String? recipientAddress, - required List<_i15.UTXO>? utxos, - }) => - (super.noSuchMethod( - Invocation.method( - #f, - [], - { - #satoshiAmountToSend: satoshiAmountToSend, - #selectedTxFeeRate: selectedTxFeeRate, - #recipientAddress: recipientAddress, - #utxos: utxos, - }, - ), - returnValue: _i21.Future.value(), - returnValueForMissingStub: _i21.Future.value(), - ) as _i21.Future); - @override - dynamic coinSelection( - int? satoshiAmountToSend, - int? selectedTxFeeRate, - String? _recipientAddress, - bool? isSendAll, { + required bool? coinControl, + required bool? isSendAll, int? additionalOutputs = 0, List<_i15.UTXO>? utxos, }) => super.noSuchMethod(Invocation.method( #coinSelection, - [ - satoshiAmountToSend, - selectedTxFeeRate, - _recipientAddress, - isSendAll, - ], + [], { + #satoshiAmountToSend: satoshiAmountToSend, + #selectedTxFeeRate: selectedTxFeeRate, + #recipientAddress: recipientAddress, + #coinControl: coinControl, + #isSendAll: isSendAll, #additionalOutputs: additionalOutputs, #utxos: utxos, }, @@ -1968,6 +1948,41 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet { ), returnValue: _i21.Future.value(''), ) as _i21.Future); + @override + void initCoinControlInterface({ + required String? walletId, + required String? walletName, + required _i20.Coin? coin, + required _i12.MainDB? db, + required _i21.Future Function()? getChainHeight, + required _i21.Future Function(_i11.Balance)? refreshedBalanceCallback, + }) => + super.noSuchMethod( + Invocation.method( + #initCoinControlInterface, + [], + { + #walletId: walletId, + #walletName: walletName, + #coin: coin, + #db: db, + #getChainHeight: getChainHeight, + #refreshedBalanceCallback: refreshedBalanceCallback, + }, + ), + returnValueForMissingStub: null, + ); + @override + _i21.Future refreshBalance({bool? notify = false}) => + (super.noSuchMethod( + Invocation.method( + #refreshBalance, + [], + {#notify: notify}, + ), + returnValue: _i21.Future.value(), + returnValueForMissingStub: _i21.Future.value(), + ) as _i21.Future); } /// A class which mocks [Manager]. diff --git a/test/widget_tests/wallet_card_test.mocks.dart b/test/widget_tests/wallet_card_test.mocks.dart index d67778d51..19c1f2c5b 100644 --- a/test/widget_tests/wallet_card_test.mocks.dart +++ b/test/widget_tests/wallet_card_test.mocks.dart @@ -957,44 +957,24 @@ class MockBitcoinWallet extends _i1.Mock implements _i23.BitcoinWallet { returnValue: 0, ) as int); @override - _i20.Future f({ + dynamic coinSelection({ required int? satoshiAmountToSend, required int? selectedTxFeeRate, required String? recipientAddress, - required List<_i15.UTXO>? utxos, - }) => - (super.noSuchMethod( - Invocation.method( - #f, - [], - { - #satoshiAmountToSend: satoshiAmountToSend, - #selectedTxFeeRate: selectedTxFeeRate, - #recipientAddress: recipientAddress, - #utxos: utxos, - }, - ), - returnValue: _i20.Future.value(), - returnValueForMissingStub: _i20.Future.value(), - ) as _i20.Future); - @override - dynamic coinSelection( - int? satoshiAmountToSend, - int? selectedTxFeeRate, - String? _recipientAddress, - bool? isSendAll, { + required bool? coinControl, + required bool? isSendAll, int? additionalOutputs = 0, List<_i15.UTXO>? utxos, }) => super.noSuchMethod(Invocation.method( #coinSelection, - [ - satoshiAmountToSend, - selectedTxFeeRate, - _recipientAddress, - isSendAll, - ], + [], { + #satoshiAmountToSend: satoshiAmountToSend, + #selectedTxFeeRate: selectedTxFeeRate, + #recipientAddress: recipientAddress, + #coinControl: coinControl, + #isSendAll: isSendAll, #additionalOutputs: additionalOutputs, #utxos: utxos, }, @@ -1731,6 +1711,41 @@ class MockBitcoinWallet extends _i1.Mock implements _i23.BitcoinWallet { ), returnValue: _i20.Future.value(''), ) as _i20.Future); + @override + void initCoinControlInterface({ + required String? walletId, + required String? walletName, + required _i19.Coin? coin, + required _i12.MainDB? db, + required _i20.Future Function()? getChainHeight, + required _i20.Future Function(_i11.Balance)? refreshedBalanceCallback, + }) => + super.noSuchMethod( + Invocation.method( + #initCoinControlInterface, + [], + { + #walletId: walletId, + #walletName: walletName, + #coin: coin, + #db: db, + #getChainHeight: getChainHeight, + #refreshedBalanceCallback: refreshedBalanceCallback, + }, + ), + returnValueForMissingStub: null, + ); + @override + _i20.Future refreshBalance({bool? notify = false}) => + (super.noSuchMethod( + Invocation.method( + #refreshBalance, + [], + {#notify: notify}, + ), + returnValue: _i20.Future.value(), + returnValueForMissingStub: _i20.Future.value(), + ) as _i20.Future); } /// A class which mocks [LocaleService]. 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 153c6e190..dd9795da9 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 @@ -1206,44 +1206,24 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { returnValue: 0, ) as int); @override - _i22.Future f({ + dynamic coinSelection({ required int? satoshiAmountToSend, required int? selectedTxFeeRate, required String? recipientAddress, - required List<_i15.UTXO>? utxos, - }) => - (super.noSuchMethod( - Invocation.method( - #f, - [], - { - #satoshiAmountToSend: satoshiAmountToSend, - #selectedTxFeeRate: selectedTxFeeRate, - #recipientAddress: recipientAddress, - #utxos: utxos, - }, - ), - returnValue: _i22.Future.value(), - returnValueForMissingStub: _i22.Future.value(), - ) as _i22.Future); - @override - dynamic coinSelection( - int? satoshiAmountToSend, - int? selectedTxFeeRate, - String? _recipientAddress, - bool? isSendAll, { + required bool? coinControl, + required bool? isSendAll, int? additionalOutputs = 0, List<_i15.UTXO>? utxos, }) => super.noSuchMethod(Invocation.method( #coinSelection, - [ - satoshiAmountToSend, - selectedTxFeeRate, - _recipientAddress, - isSendAll, - ], + [], { + #satoshiAmountToSend: satoshiAmountToSend, + #selectedTxFeeRate: selectedTxFeeRate, + #recipientAddress: recipientAddress, + #coinControl: coinControl, + #isSendAll: isSendAll, #additionalOutputs: additionalOutputs, #utxos: utxos, }, @@ -1980,6 +1960,41 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { ), returnValue: _i22.Future.value(''), ) as _i22.Future); + @override + void initCoinControlInterface({ + required String? walletId, + required String? walletName, + required _i21.Coin? coin, + required _i12.MainDB? db, + required _i22.Future Function()? getChainHeight, + required _i22.Future Function(_i11.Balance)? refreshedBalanceCallback, + }) => + super.noSuchMethod( + Invocation.method( + #initCoinControlInterface, + [], + { + #walletId: walletId, + #walletName: walletName, + #coin: coin, + #db: db, + #getChainHeight: getChainHeight, + #refreshedBalanceCallback: refreshedBalanceCallback, + }, + ), + returnValueForMissingStub: null, + ); + @override + _i22.Future refreshBalance({bool? notify = false}) => + (super.noSuchMethod( + Invocation.method( + #refreshBalance, + [], + {#notify: notify}, + ), + returnValue: _i22.Future.value(), + returnValueForMissingStub: _i22.Future.value(), + ) as _i22.Future); } /// A class which mocks [NodeService]. 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 3c42843b5..6f3e1a060 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 @@ -1206,44 +1206,24 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { returnValue: 0, ) as int); @override - _i22.Future f({ + dynamic coinSelection({ required int? satoshiAmountToSend, required int? selectedTxFeeRate, required String? recipientAddress, - required List<_i15.UTXO>? utxos, - }) => - (super.noSuchMethod( - Invocation.method( - #f, - [], - { - #satoshiAmountToSend: satoshiAmountToSend, - #selectedTxFeeRate: selectedTxFeeRate, - #recipientAddress: recipientAddress, - #utxos: utxos, - }, - ), - returnValue: _i22.Future.value(), - returnValueForMissingStub: _i22.Future.value(), - ) as _i22.Future); - @override - dynamic coinSelection( - int? satoshiAmountToSend, - int? selectedTxFeeRate, - String? _recipientAddress, - bool? isSendAll, { + required bool? coinControl, + required bool? isSendAll, int? additionalOutputs = 0, List<_i15.UTXO>? utxos, }) => super.noSuchMethod(Invocation.method( #coinSelection, - [ - satoshiAmountToSend, - selectedTxFeeRate, - _recipientAddress, - isSendAll, - ], + [], { + #satoshiAmountToSend: satoshiAmountToSend, + #selectedTxFeeRate: selectedTxFeeRate, + #recipientAddress: recipientAddress, + #coinControl: coinControl, + #isSendAll: isSendAll, #additionalOutputs: additionalOutputs, #utxos: utxos, }, @@ -1980,6 +1960,41 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { ), returnValue: _i22.Future.value(''), ) as _i22.Future); + @override + void initCoinControlInterface({ + required String? walletId, + required String? walletName, + required _i21.Coin? coin, + required _i12.MainDB? db, + required _i22.Future Function()? getChainHeight, + required _i22.Future Function(_i11.Balance)? refreshedBalanceCallback, + }) => + super.noSuchMethod( + Invocation.method( + #initCoinControlInterface, + [], + { + #walletId: walletId, + #walletName: walletName, + #coin: coin, + #db: db, + #getChainHeight: getChainHeight, + #refreshedBalanceCallback: refreshedBalanceCallback, + }, + ), + returnValueForMissingStub: null, + ); + @override + _i22.Future refreshBalance({bool? notify = false}) => + (super.noSuchMethod( + Invocation.method( + #refreshBalance, + [], + {#notify: notify}, + ), + returnValue: _i22.Future.value(), + returnValueForMissingStub: _i22.Future.value(), + ) as _i22.Future); } /// A class which mocks [NodeService].