diff --git a/test/pages/send_view/send_view_test.mocks.dart b/test/pages/send_view/send_view_test.mocks.dart index 7c8c5e4a1..fda4f4c21 100644 --- a/test/pages/send_view/send_view_test.mocks.dart +++ b/test/pages/send_view/send_view_test.mocks.dart @@ -7,7 +7,7 @@ import 'dart:async' as _i23; import 'dart:typed_data' as _i30; import 'dart:ui' as _i25; -import 'package:bip32/bip32.dart' as _i18; +import 'package:bip32/bip32.dart' as _i17; import 'package:bip47/bip47.dart' as _i19; import 'package:bitcoindart/bitcoindart.dart' as _i14; import 'package:flutter/foundation.dart' as _i4; @@ -17,7 +17,7 @@ import 'package:stackwallet/db/isar/main_db.dart' as _i13; import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i11; import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i10; import 'package:stackwallet/models/balance.dart' as _i12; -import 'package:stackwallet/models/isar/models/isar_models.dart' as _i17; +import 'package:stackwallet/models/isar/models/isar_models.dart' as _i18; import 'package:stackwallet/models/node_model.dart' as _i26; import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i9; import 'package:stackwallet/models/signing_data.dart' as _i29; @@ -209,8 +209,8 @@ class _FakeTuple2_14 extends _i1.SmartFake ); } -class _FakeAddress_15 extends _i1.SmartFake implements _i17.Address { - _FakeAddress_15( +class _FakeBIP32_15 extends _i1.SmartFake implements _i17.BIP32 { + _FakeBIP32_15( Object parent, Invocation parentInvocation, ) : super( @@ -219,8 +219,8 @@ class _FakeAddress_15 extends _i1.SmartFake implements _i17.Address { ); } -class _FakeBIP32_16 extends _i1.SmartFake implements _i18.BIP32 { - _FakeBIP32_16( +class _FakeAddress_16 extends _i1.SmartFake implements _i18.Address { + _FakeAddress_16( Object parent, Invocation parentInvocation, ) : super( @@ -987,16 +987,16 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet { returnValue: _i22.Coin.bitcoin, ) as _i22.Coin); @override - _i23.Future> get utxos => (super.noSuchMethod( + _i23.Future> get utxos => (super.noSuchMethod( Invocation.getter(#utxos), - returnValue: _i23.Future>.value(<_i17.UTXO>[]), - ) as _i23.Future>); + returnValue: _i23.Future>.value(<_i18.UTXO>[]), + ) as _i23.Future>); @override - _i23.Future> get transactions => (super.noSuchMethod( + _i23.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), returnValue: - _i23.Future>.value(<_i17.Transaction>[]), - ) as _i23.Future>); + _i23.Future>.value(<_i18.Transaction>[]), + ) as _i23.Future>); @override _i23.Future get currentReceivingAddress => (super.noSuchMethod( Invocation.getter(#currentReceivingAddress), @@ -1406,7 +1406,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet { required bool? coinControl, required bool? isSendAll, int? additionalOutputs = 0, - List<_i17.UTXO>? utxos, + List<_i18.UTXO>? utxos, }) => super.noSuchMethod(Invocation.method( #coinSelection, @@ -1423,7 +1423,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet { )); @override _i23.Future> fetchBuildTxData( - List<_i17.UTXO>? utxosToUse) => + List<_i18.UTXO>? utxosToUse) => (super.noSuchMethod( Invocation.method( #fetchBuildTxData, @@ -1677,10 +1677,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet { returnValueForMissingStub: null, ); @override - _i23.Future<_i16.Tuple2<_i17.Transaction, _i17.Address>> parseTransaction( + _i23.Future<_i16.Tuple2<_i18.Transaction, _i18.Address>> parseTransaction( Map? txData, dynamic electrumxClient, - List<_i17.Address>? myAddresses, + List<_i18.Address>? myAddresses, _i22.Coin? coin, int? minConfirms, String? walletId, @@ -1698,8 +1698,8 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet { ], ), returnValue: - _i23.Future<_i16.Tuple2<_i17.Transaction, _i17.Address>>.value( - _FakeTuple2_14<_i17.Transaction, _i17.Address>( + _i23.Future<_i16.Tuple2<_i18.Transaction, _i18.Address>>.value( + _FakeTuple2_14<_i18.Transaction, _i18.Address>( this, Invocation.method( #parseTransaction, @@ -1713,7 +1713,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet { ], ), )), - ) as _i23.Future<_i16.Tuple2<_i17.Transaction, _i17.Address>>); + ) as _i23.Future<_i16.Tuple2<_i18.Transaction, _i18.Address>>); @override void initPaynymWalletInterface({ required String? walletId, @@ -1723,6 +1723,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet { required _i13.MainDB? db, required _i10.ElectrumX? electrumXClient, required _i7.SecureStorageInterface? secureStorage, + required int? dustLimit, required int? dustLimitP2PKH, required int? minConfirms, required _i23.Future Function()? getMnemonicString, @@ -1741,7 +1742,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet { })? prepareSend, required _i23.Future Function({required String address})? getTxCount, - required _i23.Future> Function(List<_i17.UTXO>)? + required _i23.Future> Function(List<_i18.UTXO>)? fetchBuildTxData, required _i23.Future Function()? refresh, required _i23.Future Function()? checkChangeAddressForTransactions, @@ -1758,6 +1759,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet { #db: db, #electrumXClient: electrumXClient, #secureStorage: secureStorage, + #dustLimit: dustLimit, #dustLimitP2PKH: dustLimitP2PKH, #minConfirms: minConfirms, #getMnemonicString: getMnemonicString, @@ -1776,28 +1778,74 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet { returnValueForMissingStub: null, ); @override - _i23.Future<_i17.Address> currentReceivingPaynymAddress( - _i19.PaymentCode? sender) => + _i23.Future<_i17.BIP32> getBip47BaseNode() => (super.noSuchMethod( + Invocation.method( + #getBip47BaseNode, + [], + ), + returnValue: _i23.Future<_i17.BIP32>.value(_FakeBIP32_15( + this, + Invocation.method( + #getBip47BaseNode, + [], + ), + )), + ) as _i23.Future<_i17.BIP32>); + @override + _i23.Future<_i30.Uint8List> getPrivateKeyForPaynymReceivingAddress({ + required String? paymentCodeString, + required int? index, + }) => + (super.noSuchMethod( + Invocation.method( + #getPrivateKeyForPaynymReceivingAddress, + [], + { + #paymentCodeString: paymentCodeString, + #index: index, + }, + ), + returnValue: _i23.Future<_i30.Uint8List>.value(_i30.Uint8List(0)), + ) as _i23.Future<_i30.Uint8List>); + @override + _i23.Future<_i18.Address> currentReceivingPaynymAddress({ + required _i19.PaymentCode? sender, + required bool? isSegwit, + }) => (super.noSuchMethod( Invocation.method( #currentReceivingPaynymAddress, - [sender], + [], + { + #sender: sender, + #isSegwit: isSegwit, + }, ), - returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15( + returnValue: _i23.Future<_i18.Address>.value(_FakeAddress_16( this, Invocation.method( #currentReceivingPaynymAddress, - [sender], + [], + { + #sender: sender, + #isSegwit: isSegwit, + }, ), )), - ) as _i23.Future<_i17.Address>); + ) as _i23.Future<_i18.Address>); @override - _i23.Future checkCurrentPaynymReceivingAddressForTransactions( - _i19.PaymentCode? sender) => + _i23.Future checkCurrentPaynymReceivingAddressForTransactions({ + required _i19.PaymentCode? sender, + required bool? isSegwit, + }) => (super.noSuchMethod( Invocation.method( #checkCurrentPaynymReceivingAddressForTransactions, - [sender], + [], + { + #sender: sender, + #isSegwit: isSegwit, + }, ), returnValue: _i23.Future.value(), returnValueForMissingStub: _i23.Future.value(), @@ -1813,81 +1861,33 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override - _i23.Future<_i18.BIP32> deriveNotificationBip32Node({ - required String? mnemonic, - required String? mnemonicPassphrase, - }) => - (super.noSuchMethod( + _i23.Future<_i17.BIP32> deriveNotificationBip32Node() => (super.noSuchMethod( Invocation.method( #deriveNotificationBip32Node, [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - }, ), - returnValue: _i23.Future<_i18.BIP32>.value(_FakeBIP32_16( + returnValue: _i23.Future<_i17.BIP32>.value(_FakeBIP32_15( this, Invocation.method( #deriveNotificationBip32Node, [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - }, ), )), - ) as _i23.Future<_i18.BIP32>); + ) as _i23.Future<_i17.BIP32>); @override - _i23.Future<_i18.BIP32> deriveReceivingPrivateKeyNode({ - required String? mnemonic, - required String? mnemonicPassphrase, - required int? index, - }) => - (super.noSuchMethod( - Invocation.method( - #deriveReceivingPrivateKeyNode, - [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - #index: index, - }, - ), - returnValue: _i23.Future<_i18.BIP32>.value(_FakeBIP32_16( - this, - Invocation.method( - #deriveReceivingPrivateKeyNode, - [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - #index: index, - }, - ), - )), - ) as _i23.Future<_i18.BIP32>); - @override - _i23.Future<_i19.PaymentCode> getPaymentCode( - _i28.DerivePathType? derivePathType, [ - _i18.BIP32? bip32Root, - ]) => + _i23.Future<_i19.PaymentCode> getPaymentCode({required bool? isSegwit}) => (super.noSuchMethod( Invocation.method( #getPaymentCode, - [ - derivePathType, - bip32Root, - ], + [], + {#isSegwit: isSegwit}, ), returnValue: _i23.Future<_i19.PaymentCode>.value(_FakePaymentCode_17( this, Invocation.method( #getPaymentCode, - [ - derivePathType, - bip32Root, - ], + [], + {#isSegwit: isSegwit}, ), )), ) as _i23.Future<_i19.PaymentCode>); @@ -1912,6 +1912,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet { @override _i23.Future> preparePaymentCodeSend({ required _i19.PaymentCode? paymentCode, + required bool? isSegwit, required _i15.Amount? amount, Map? args, }) => @@ -1921,6 +1922,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet { [], { #paymentCode: paymentCode, + #isSegwit: isSegwit, #amount: amount, #args: args, }, @@ -1929,9 +1931,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet { _i23.Future>.value({}), ) as _i23.Future>); @override - _i23.Future<_i17.Address> nextUnusedSendAddressFrom({ + _i23.Future<_i18.Address> nextUnusedSendAddressFrom({ required _i19.PaymentCode? pCode, - required _i18.BIP32? privateKeyNode, + required bool? isSegwit, + required _i17.BIP32? privateKeyNode, int? startIndex = 0, }) => (super.noSuchMethod( @@ -1940,29 +1943,31 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet { [], { #pCode: pCode, + #isSegwit: isSegwit, #privateKeyNode: privateKeyNode, #startIndex: startIndex, }, ), - returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15( + returnValue: _i23.Future<_i18.Address>.value(_FakeAddress_16( this, Invocation.method( #nextUnusedSendAddressFrom, [], { #pCode: pCode, + #isSegwit: isSegwit, #privateKeyNode: privateKeyNode, #startIndex: startIndex, }, ), )), - ) as _i23.Future<_i17.Address>); + ) as _i23.Future<_i18.Address>); @override _i23.Future> prepareNotificationTx({ required int? selectedTxFeeRate, required String? targetPaymentCodeString, int? additionalOutputs = 0, - List<_i17.UTXO>? utxos, + List<_i18.UTXO>? utxos, }) => (super.noSuchMethod( Invocation.method( @@ -1999,34 +2004,24 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet { returnValue: _i23.Future.value(false), ) as _i23.Future); @override - _i23.Future<_i19.PaymentCode?> unBlindedPaymentCodeFromTransaction({ - required _i17.Transaction? transaction, - required _i17.Address? myNotificationAddress, - }) => + _i23.Future<_i19.PaymentCode?> unBlindedPaymentCodeFromTransaction( + {required _i18.Transaction? transaction}) => (super.noSuchMethod( Invocation.method( #unBlindedPaymentCodeFromTransaction, [], - { - #transaction: transaction, - #myNotificationAddress: myNotificationAddress, - }, + {#transaction: transaction}, ), returnValue: _i23.Future<_i19.PaymentCode?>.value(), ) as _i23.Future<_i19.PaymentCode?>); @override - _i23.Future<_i19.PaymentCode?> unBlindedPaymentCodeFromTransactionBad({ - required _i17.Transaction? transaction, - required _i17.Address? myNotificationAddress, - }) => + _i23.Future<_i19.PaymentCode?> unBlindedPaymentCodeFromTransactionBad( + {required _i18.Transaction? transaction}) => (super.noSuchMethod( Invocation.method( #unBlindedPaymentCodeFromTransactionBad, [], - { - #transaction: transaction, - #myNotificationAddress: myNotificationAddress, - }, + {#transaction: transaction}, ), returnValue: _i23.Future<_i19.PaymentCode?>.value(), ) as _i23.Future<_i19.PaymentCode?>); @@ -2071,111 +2066,40 @@ class MockBitcoinWallet extends _i1.Mock implements _i27.BitcoinWallet { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override - _i23.Future restoreHistoryWith( - _i19.PaymentCode? other, - int? maxUnusedAddressGap, - int? maxNumberOfIndexesToCheck, - ) => + _i23.Future restoreHistoryWith({ + required _i19.PaymentCode? other, + required bool? checkSegwitAsWell, + required int? maxUnusedAddressGap, + required int? maxNumberOfIndexesToCheck, + }) => (super.noSuchMethod( Invocation.method( #restoreHistoryWith, - [ - other, - maxUnusedAddressGap, - maxNumberOfIndexesToCheck, - ], + [], + { + #other: other, + #checkSegwitAsWell: checkSegwitAsWell, + #maxUnusedAddressGap: maxUnusedAddressGap, + #maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck, + }, ), returnValue: _i23.Future.value(), returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override - _i23.Future<_i17.Address> generatePaynymSendAddressFromKeyPair({ - required _i14.ECPair? pair, - required int? derivationIndex, - required _i28.DerivePathType? derivePathType, - required _i19.PaymentCode? toPaymentCode, - }) => - (super.noSuchMethod( - Invocation.method( - #generatePaynymSendAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #toPaymentCode: toPaymentCode, - }, - ), - returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15( - this, - Invocation.method( - #generatePaynymSendAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #toPaymentCode: toPaymentCode, - }, - ), - )), - ) as _i23.Future<_i17.Address>); - @override - _i23.Future<_i17.Address> generatePaynymReceivingAddressFromKeyPair({ - required _i14.ECPair? pair, - required int? derivationIndex, - required _i28.DerivePathType? derivePathType, - required _i19.PaymentCode? fromPaymentCode, - }) => - (super.noSuchMethod( - Invocation.method( - #generatePaynymReceivingAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #fromPaymentCode: fromPaymentCode, - }, - ), - returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15( - this, - Invocation.method( - #generatePaynymReceivingAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #fromPaymentCode: fromPaymentCode, - }, - ), - )), - ) as _i23.Future<_i17.Address>); - @override - _i23.Future<_i17.Address> getMyNotificationAddress( - _i28.DerivePathType? derivePathType, [ - _i18.BIP32? bip32Root, - ]) => - (super.noSuchMethod( + _i23.Future<_i18.Address> getMyNotificationAddress() => (super.noSuchMethod( Invocation.method( #getMyNotificationAddress, - [ - derivePathType, - bip32Root, - ], + [], ), - returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15( + returnValue: _i23.Future<_i18.Address>.value(_FakeAddress_16( this, Invocation.method( #getMyNotificationAddress, - [ - derivePathType, - bip32Root, - ], + [], ), )), - ) as _i23.Future<_i17.Address>); + ) as _i23.Future<_i18.Address>); @override _i23.Future> lookupKey(String? paymentCodeString) => (super.noSuchMethod( @@ -2812,16 +2736,16 @@ class MockManager extends _i1.Mock implements _i6.Manager { ), ) as _i12.Balance); @override - _i23.Future> get transactions => (super.noSuchMethod( + _i23.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), returnValue: - _i23.Future>.value(<_i17.Transaction>[]), - ) as _i23.Future>); + _i23.Future>.value(<_i18.Transaction>[]), + ) as _i23.Future>); @override - _i23.Future> get utxos => (super.noSuchMethod( + _i23.Future> get utxos => (super.noSuchMethod( Invocation.getter(#utxos), - returnValue: _i23.Future>.value(<_i17.UTXO>[]), - ) as _i23.Future>); + returnValue: _i23.Future>.value(<_i18.UTXO>[]), + ) as _i23.Future>); @override set walletName(String? newName) => super.noSuchMethod( Invocation.setter( @@ -3180,16 +3104,16 @@ class MockCoinServiceAPI extends _i1.Mock implements _i20.CoinServiceAPI { ), ) as _i12.Balance); @override - _i23.Future> get transactions => (super.noSuchMethod( + _i23.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), returnValue: - _i23.Future>.value(<_i17.Transaction>[]), - ) as _i23.Future>); + _i23.Future>.value(<_i18.Transaction>[]), + ) as _i23.Future>); @override - _i23.Future> get utxos => (super.noSuchMethod( + _i23.Future> get utxos => (super.noSuchMethod( Invocation.getter(#utxos), - returnValue: _i23.Future>.value(<_i17.UTXO>[]), - ) as _i23.Future>); + returnValue: _i23.Future>.value(<_i18.UTXO>[]), + ) as _i23.Future>); @override set walletName(String? newName) => super.noSuchMethod( Invocation.setter( diff --git a/test/widget_tests/managed_favorite_test.mocks.dart b/test/widget_tests/managed_favorite_test.mocks.dart index 4982f76bd..337eb47e4 100644 --- a/test/widget_tests/managed_favorite_test.mocks.dart +++ b/test/widget_tests/managed_favorite_test.mocks.dart @@ -7,7 +7,7 @@ import 'dart:async' as _i23; import 'dart:typed_data' as _i29; import 'dart:ui' as _i25; -import 'package:bip32/bip32.dart' as _i17; +import 'package:bip32/bip32.dart' as _i16; import 'package:bip47/bip47.dart' as _i18; import 'package:bitcoindart/bitcoindart.dart' as _i13; import 'package:flutter/foundation.dart' as _i4; @@ -17,7 +17,7 @@ import 'package:stackwallet/db/isar/main_db.dart' as _i12; import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i10; import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i9; import 'package:stackwallet/models/balance.dart' as _i11; -import 'package:stackwallet/models/isar/models/isar_models.dart' as _i16; +import 'package:stackwallet/models/isar/models/isar_models.dart' as _i17; import 'package:stackwallet/models/node_model.dart' as _i31; import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i8; import 'package:stackwallet/models/signing_data.dart' as _i28; @@ -194,8 +194,8 @@ class _FakeTuple2_13 extends _i1.SmartFake ); } -class _FakeAddress_14 extends _i1.SmartFake implements _i16.Address { - _FakeAddress_14( +class _FakeBIP32_14 extends _i1.SmartFake implements _i16.BIP32 { + _FakeBIP32_14( Object parent, Invocation parentInvocation, ) : super( @@ -204,8 +204,8 @@ class _FakeAddress_14 extends _i1.SmartFake implements _i16.Address { ); } -class _FakeBIP32_15 extends _i1.SmartFake implements _i17.BIP32 { - _FakeBIP32_15( +class _FakeAddress_15 extends _i1.SmartFake implements _i17.Address { + _FakeAddress_15( Object parent, Invocation parentInvocation, ) : super( @@ -779,16 +779,16 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValue: _i22.Coin.bitcoin, ) as _i22.Coin); @override - _i23.Future> get utxos => (super.noSuchMethod( + _i23.Future> get utxos => (super.noSuchMethod( Invocation.getter(#utxos), - returnValue: _i23.Future>.value(<_i16.UTXO>[]), - ) as _i23.Future>); + returnValue: _i23.Future>.value(<_i17.UTXO>[]), + ) as _i23.Future>); @override - _i23.Future> get transactions => (super.noSuchMethod( + _i23.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), returnValue: - _i23.Future>.value(<_i16.Transaction>[]), - ) as _i23.Future>); + _i23.Future>.value(<_i17.Transaction>[]), + ) as _i23.Future>); @override _i23.Future get currentReceivingAddress => (super.noSuchMethod( Invocation.getter(#currentReceivingAddress), @@ -1197,7 +1197,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { required bool? coinControl, required bool? isSendAll, int? additionalOutputs = 0, - List<_i16.UTXO>? utxos, + List<_i17.UTXO>? utxos, }) => super.noSuchMethod(Invocation.method( #coinSelection, @@ -1214,7 +1214,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { )); @override _i23.Future> fetchBuildTxData( - List<_i16.UTXO>? utxosToUse) => + List<_i17.UTXO>? utxosToUse) => (super.noSuchMethod( Invocation.method( #fetchBuildTxData, @@ -1468,10 +1468,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValueForMissingStub: null, ); @override - _i23.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>> parseTransaction( + _i23.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>> parseTransaction( Map? txData, dynamic electrumxClient, - List<_i16.Address>? myAddresses, + List<_i17.Address>? myAddresses, _i22.Coin? coin, int? minConfirms, String? walletId, @@ -1489,8 +1489,8 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { ], ), returnValue: - _i23.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>>.value( - _FakeTuple2_13<_i16.Transaction, _i16.Address>( + _i23.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>>.value( + _FakeTuple2_13<_i17.Transaction, _i17.Address>( this, Invocation.method( #parseTransaction, @@ -1504,7 +1504,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { ], ), )), - ) as _i23.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>>); + ) as _i23.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>>); @override void initPaynymWalletInterface({ required String? walletId, @@ -1514,6 +1514,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { required _i12.MainDB? db, required _i9.ElectrumX? electrumXClient, required _i19.SecureStorageInterface? secureStorage, + required int? dustLimit, required int? dustLimitP2PKH, required int? minConfirms, required _i23.Future Function()? getMnemonicString, @@ -1532,7 +1533,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { })? prepareSend, required _i23.Future Function({required String address})? getTxCount, - required _i23.Future> Function(List<_i16.UTXO>)? + required _i23.Future> Function(List<_i17.UTXO>)? fetchBuildTxData, required _i23.Future Function()? refresh, required _i23.Future Function()? checkChangeAddressForTransactions, @@ -1549,6 +1550,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { #db: db, #electrumXClient: electrumXClient, #secureStorage: secureStorage, + #dustLimit: dustLimit, #dustLimitP2PKH: dustLimitP2PKH, #minConfirms: minConfirms, #getMnemonicString: getMnemonicString, @@ -1567,28 +1569,74 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValueForMissingStub: null, ); @override - _i23.Future<_i16.Address> currentReceivingPaynymAddress( - _i18.PaymentCode? sender) => + _i23.Future<_i16.BIP32> getBip47BaseNode() => (super.noSuchMethod( + Invocation.method( + #getBip47BaseNode, + [], + ), + returnValue: _i23.Future<_i16.BIP32>.value(_FakeBIP32_14( + this, + Invocation.method( + #getBip47BaseNode, + [], + ), + )), + ) as _i23.Future<_i16.BIP32>); + @override + _i23.Future<_i29.Uint8List> getPrivateKeyForPaynymReceivingAddress({ + required String? paymentCodeString, + required int? index, + }) => + (super.noSuchMethod( + Invocation.method( + #getPrivateKeyForPaynymReceivingAddress, + [], + { + #paymentCodeString: paymentCodeString, + #index: index, + }, + ), + returnValue: _i23.Future<_i29.Uint8List>.value(_i29.Uint8List(0)), + ) as _i23.Future<_i29.Uint8List>); + @override + _i23.Future<_i17.Address> currentReceivingPaynymAddress({ + required _i18.PaymentCode? sender, + required bool? isSegwit, + }) => (super.noSuchMethod( Invocation.method( #currentReceivingPaynymAddress, - [sender], + [], + { + #sender: sender, + #isSegwit: isSegwit, + }, ), - returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14( + returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15( this, Invocation.method( #currentReceivingPaynymAddress, - [sender], + [], + { + #sender: sender, + #isSegwit: isSegwit, + }, ), )), - ) as _i23.Future<_i16.Address>); + ) as _i23.Future<_i17.Address>); @override - _i23.Future checkCurrentPaynymReceivingAddressForTransactions( - _i18.PaymentCode? sender) => + _i23.Future checkCurrentPaynymReceivingAddressForTransactions({ + required _i18.PaymentCode? sender, + required bool? isSegwit, + }) => (super.noSuchMethod( Invocation.method( #checkCurrentPaynymReceivingAddressForTransactions, - [sender], + [], + { + #sender: sender, + #isSegwit: isSegwit, + }, ), returnValue: _i23.Future.value(), returnValueForMissingStub: _i23.Future.value(), @@ -1604,81 +1652,33 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override - _i23.Future<_i17.BIP32> deriveNotificationBip32Node({ - required String? mnemonic, - required String? mnemonicPassphrase, - }) => - (super.noSuchMethod( + _i23.Future<_i16.BIP32> deriveNotificationBip32Node() => (super.noSuchMethod( Invocation.method( #deriveNotificationBip32Node, [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - }, ), - returnValue: _i23.Future<_i17.BIP32>.value(_FakeBIP32_15( + returnValue: _i23.Future<_i16.BIP32>.value(_FakeBIP32_14( this, Invocation.method( #deriveNotificationBip32Node, [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - }, ), )), - ) as _i23.Future<_i17.BIP32>); + ) as _i23.Future<_i16.BIP32>); @override - _i23.Future<_i17.BIP32> deriveReceivingPrivateKeyNode({ - required String? mnemonic, - required String? mnemonicPassphrase, - required int? index, - }) => - (super.noSuchMethod( - Invocation.method( - #deriveReceivingPrivateKeyNode, - [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - #index: index, - }, - ), - returnValue: _i23.Future<_i17.BIP32>.value(_FakeBIP32_15( - this, - Invocation.method( - #deriveReceivingPrivateKeyNode, - [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - #index: index, - }, - ), - )), - ) as _i23.Future<_i17.BIP32>); - @override - _i23.Future<_i18.PaymentCode> getPaymentCode( - _i27.DerivePathType? derivePathType, [ - _i17.BIP32? bip32Root, - ]) => + _i23.Future<_i18.PaymentCode> getPaymentCode({required bool? isSegwit}) => (super.noSuchMethod( Invocation.method( #getPaymentCode, - [ - derivePathType, - bip32Root, - ], + [], + {#isSegwit: isSegwit}, ), returnValue: _i23.Future<_i18.PaymentCode>.value(_FakePaymentCode_16( this, Invocation.method( #getPaymentCode, - [ - derivePathType, - bip32Root, - ], + [], + {#isSegwit: isSegwit}, ), )), ) as _i23.Future<_i18.PaymentCode>); @@ -1703,6 +1703,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { @override _i23.Future> preparePaymentCodeSend({ required _i18.PaymentCode? paymentCode, + required bool? isSegwit, required _i14.Amount? amount, Map? args, }) => @@ -1712,6 +1713,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { [], { #paymentCode: paymentCode, + #isSegwit: isSegwit, #amount: amount, #args: args, }, @@ -1720,9 +1722,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { _i23.Future>.value({}), ) as _i23.Future>); @override - _i23.Future<_i16.Address> nextUnusedSendAddressFrom({ + _i23.Future<_i17.Address> nextUnusedSendAddressFrom({ required _i18.PaymentCode? pCode, - required _i17.BIP32? privateKeyNode, + required bool? isSegwit, + required _i16.BIP32? privateKeyNode, int? startIndex = 0, }) => (super.noSuchMethod( @@ -1731,29 +1734,31 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { [], { #pCode: pCode, + #isSegwit: isSegwit, #privateKeyNode: privateKeyNode, #startIndex: startIndex, }, ), - returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14( + returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15( this, Invocation.method( #nextUnusedSendAddressFrom, [], { #pCode: pCode, + #isSegwit: isSegwit, #privateKeyNode: privateKeyNode, #startIndex: startIndex, }, ), )), - ) as _i23.Future<_i16.Address>); + ) as _i23.Future<_i17.Address>); @override _i23.Future> prepareNotificationTx({ required int? selectedTxFeeRate, required String? targetPaymentCodeString, int? additionalOutputs = 0, - List<_i16.UTXO>? utxos, + List<_i17.UTXO>? utxos, }) => (super.noSuchMethod( Invocation.method( @@ -1790,34 +1795,24 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValue: _i23.Future.value(false), ) as _i23.Future); @override - _i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransaction({ - required _i16.Transaction? transaction, - required _i16.Address? myNotificationAddress, - }) => + _i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransaction( + {required _i17.Transaction? transaction}) => (super.noSuchMethod( Invocation.method( #unBlindedPaymentCodeFromTransaction, [], - { - #transaction: transaction, - #myNotificationAddress: myNotificationAddress, - }, + {#transaction: transaction}, ), returnValue: _i23.Future<_i18.PaymentCode?>.value(), ) as _i23.Future<_i18.PaymentCode?>); @override - _i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransactionBad({ - required _i16.Transaction? transaction, - required _i16.Address? myNotificationAddress, - }) => + _i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransactionBad( + {required _i17.Transaction? transaction}) => (super.noSuchMethod( Invocation.method( #unBlindedPaymentCodeFromTransactionBad, [], - { - #transaction: transaction, - #myNotificationAddress: myNotificationAddress, - }, + {#transaction: transaction}, ), returnValue: _i23.Future<_i18.PaymentCode?>.value(), ) as _i23.Future<_i18.PaymentCode?>); @@ -1862,111 +1857,40 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override - _i23.Future restoreHistoryWith( - _i18.PaymentCode? other, - int? maxUnusedAddressGap, - int? maxNumberOfIndexesToCheck, - ) => + _i23.Future restoreHistoryWith({ + required _i18.PaymentCode? other, + required bool? checkSegwitAsWell, + required int? maxUnusedAddressGap, + required int? maxNumberOfIndexesToCheck, + }) => (super.noSuchMethod( Invocation.method( #restoreHistoryWith, - [ - other, - maxUnusedAddressGap, - maxNumberOfIndexesToCheck, - ], + [], + { + #other: other, + #checkSegwitAsWell: checkSegwitAsWell, + #maxUnusedAddressGap: maxUnusedAddressGap, + #maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck, + }, ), returnValue: _i23.Future.value(), returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override - _i23.Future<_i16.Address> generatePaynymSendAddressFromKeyPair({ - required _i13.ECPair? pair, - required int? derivationIndex, - required _i27.DerivePathType? derivePathType, - required _i18.PaymentCode? toPaymentCode, - }) => - (super.noSuchMethod( - Invocation.method( - #generatePaynymSendAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #toPaymentCode: toPaymentCode, - }, - ), - returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14( - this, - Invocation.method( - #generatePaynymSendAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #toPaymentCode: toPaymentCode, - }, - ), - )), - ) as _i23.Future<_i16.Address>); - @override - _i23.Future<_i16.Address> generatePaynymReceivingAddressFromKeyPair({ - required _i13.ECPair? pair, - required int? derivationIndex, - required _i27.DerivePathType? derivePathType, - required _i18.PaymentCode? fromPaymentCode, - }) => - (super.noSuchMethod( - Invocation.method( - #generatePaynymReceivingAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #fromPaymentCode: fromPaymentCode, - }, - ), - returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14( - this, - Invocation.method( - #generatePaynymReceivingAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #fromPaymentCode: fromPaymentCode, - }, - ), - )), - ) as _i23.Future<_i16.Address>); - @override - _i23.Future<_i16.Address> getMyNotificationAddress( - _i27.DerivePathType? derivePathType, [ - _i17.BIP32? bip32Root, - ]) => - (super.noSuchMethod( + _i23.Future<_i17.Address> getMyNotificationAddress() => (super.noSuchMethod( Invocation.method( #getMyNotificationAddress, - [ - derivePathType, - bip32Root, - ], + [], ), - returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14( + returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15( this, Invocation.method( #getMyNotificationAddress, - [ - derivePathType, - bip32Root, - ], + [], ), )), - ) as _i23.Future<_i16.Address>); + ) as _i23.Future<_i17.Address>); @override _i23.Future> lookupKey(String? paymentCodeString) => (super.noSuchMethod( @@ -2386,16 +2310,16 @@ class MockManager extends _i1.Mock implements _i6.Manager { ), ) as _i11.Balance); @override - _i23.Future> get transactions => (super.noSuchMethod( + _i23.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), returnValue: - _i23.Future>.value(<_i16.Transaction>[]), - ) as _i23.Future>); + _i23.Future>.value(<_i17.Transaction>[]), + ) as _i23.Future>); @override - _i23.Future> get utxos => (super.noSuchMethod( + _i23.Future> get utxos => (super.noSuchMethod( Invocation.getter(#utxos), - returnValue: _i23.Future>.value(<_i16.UTXO>[]), - ) as _i23.Future>); + returnValue: _i23.Future>.value(<_i17.UTXO>[]), + ) as _i23.Future>); @override set walletName(String? newName) => super.noSuchMethod( Invocation.setter( @@ -2754,16 +2678,16 @@ class MockCoinServiceAPI extends _i1.Mock implements _i20.CoinServiceAPI { ), ) as _i11.Balance); @override - _i23.Future> get transactions => (super.noSuchMethod( + _i23.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), returnValue: - _i23.Future>.value(<_i16.Transaction>[]), - ) as _i23.Future>); + _i23.Future>.value(<_i17.Transaction>[]), + ) as _i23.Future>); @override - _i23.Future> get utxos => (super.noSuchMethod( + _i23.Future> get utxos => (super.noSuchMethod( Invocation.getter(#utxos), - returnValue: _i23.Future>.value(<_i16.UTXO>[]), - ) as _i23.Future>); + returnValue: _i23.Future>.value(<_i17.UTXO>[]), + ) as _i23.Future>); @override set walletName(String? newName) => super.noSuchMethod( Invocation.setter( 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 1c5c1465c..38a6e1d91 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 @@ -7,7 +7,7 @@ import 'dart:async' as _i22; import 'dart:typed_data' as _i29; import 'dart:ui' as _i24; -import 'package:bip32/bip32.dart' as _i17; +import 'package:bip32/bip32.dart' as _i16; import 'package:bip47/bip47.dart' as _i18; import 'package:bitcoindart/bitcoindart.dart' as _i13; import 'package:flutter/foundation.dart' as _i4; @@ -17,7 +17,7 @@ import 'package:stackwallet/db/isar/main_db.dart' as _i12; import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i10; import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i9; import 'package:stackwallet/models/balance.dart' as _i11; -import 'package:stackwallet/models/isar/models/isar_models.dart' as _i16; +import 'package:stackwallet/models/isar/models/isar_models.dart' as _i17; import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i8; import 'package:stackwallet/models/signing_data.dart' as _i27; import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart' as _i25; @@ -192,8 +192,8 @@ class _FakeTuple2_13 extends _i1.SmartFake ); } -class _FakeAddress_14 extends _i1.SmartFake implements _i16.Address { - _FakeAddress_14( +class _FakeBIP32_14 extends _i1.SmartFake implements _i16.BIP32 { + _FakeBIP32_14( Object parent, Invocation parentInvocation, ) : super( @@ -202,8 +202,8 @@ class _FakeAddress_14 extends _i1.SmartFake implements _i16.Address { ); } -class _FakeBIP32_15 extends _i1.SmartFake implements _i17.BIP32 { - _FakeBIP32_15( +class _FakeAddress_15 extends _i1.SmartFake implements _i17.Address { + _FakeAddress_15( Object parent, Invocation parentInvocation, ) : super( @@ -766,16 +766,16 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { returnValue: _i21.Coin.bitcoin, ) as _i21.Coin); @override - _i22.Future> get utxos => (super.noSuchMethod( + _i22.Future> get utxos => (super.noSuchMethod( Invocation.getter(#utxos), - returnValue: _i22.Future>.value(<_i16.UTXO>[]), - ) as _i22.Future>); + returnValue: _i22.Future>.value(<_i17.UTXO>[]), + ) as _i22.Future>); @override - _i22.Future> get transactions => (super.noSuchMethod( + _i22.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), returnValue: - _i22.Future>.value(<_i16.Transaction>[]), - ) as _i22.Future>); + _i22.Future>.value(<_i17.Transaction>[]), + ) as _i22.Future>); @override _i22.Future get currentReceivingAddress => (super.noSuchMethod( Invocation.getter(#currentReceivingAddress), @@ -1184,7 +1184,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { required bool? coinControl, required bool? isSendAll, int? additionalOutputs = 0, - List<_i16.UTXO>? utxos, + List<_i17.UTXO>? utxos, }) => super.noSuchMethod(Invocation.method( #coinSelection, @@ -1201,7 +1201,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { )); @override _i22.Future> fetchBuildTxData( - List<_i16.UTXO>? utxosToUse) => + List<_i17.UTXO>? utxosToUse) => (super.noSuchMethod( Invocation.method( #fetchBuildTxData, @@ -1455,10 +1455,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { returnValueForMissingStub: null, ); @override - _i22.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>> parseTransaction( + _i22.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>> parseTransaction( Map? txData, dynamic electrumxClient, - List<_i16.Address>? myAddresses, + List<_i17.Address>? myAddresses, _i21.Coin? coin, int? minConfirms, String? walletId, @@ -1476,8 +1476,8 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { ], ), returnValue: - _i22.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>>.value( - _FakeTuple2_13<_i16.Transaction, _i16.Address>( + _i22.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>>.value( + _FakeTuple2_13<_i17.Transaction, _i17.Address>( this, Invocation.method( #parseTransaction, @@ -1491,7 +1491,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { ], ), )), - ) as _i22.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>>); + ) as _i22.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>>); @override void initPaynymWalletInterface({ required String? walletId, @@ -1501,6 +1501,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { required _i12.MainDB? db, required _i9.ElectrumX? electrumXClient, required _i28.SecureStorageInterface? secureStorage, + required int? dustLimit, required int? dustLimitP2PKH, required int? minConfirms, required _i22.Future Function()? getMnemonicString, @@ -1519,7 +1520,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { })? prepareSend, required _i22.Future Function({required String address})? getTxCount, - required _i22.Future> Function(List<_i16.UTXO>)? + required _i22.Future> Function(List<_i17.UTXO>)? fetchBuildTxData, required _i22.Future Function()? refresh, required _i22.Future Function()? checkChangeAddressForTransactions, @@ -1536,6 +1537,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { #db: db, #electrumXClient: electrumXClient, #secureStorage: secureStorage, + #dustLimit: dustLimit, #dustLimitP2PKH: dustLimitP2PKH, #minConfirms: minConfirms, #getMnemonicString: getMnemonicString, @@ -1554,28 +1556,74 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { returnValueForMissingStub: null, ); @override - _i22.Future<_i16.Address> currentReceivingPaynymAddress( - _i18.PaymentCode? sender) => + _i22.Future<_i16.BIP32> getBip47BaseNode() => (super.noSuchMethod( + Invocation.method( + #getBip47BaseNode, + [], + ), + returnValue: _i22.Future<_i16.BIP32>.value(_FakeBIP32_14( + this, + Invocation.method( + #getBip47BaseNode, + [], + ), + )), + ) as _i22.Future<_i16.BIP32>); + @override + _i22.Future<_i29.Uint8List> getPrivateKeyForPaynymReceivingAddress({ + required String? paymentCodeString, + required int? index, + }) => + (super.noSuchMethod( + Invocation.method( + #getPrivateKeyForPaynymReceivingAddress, + [], + { + #paymentCodeString: paymentCodeString, + #index: index, + }, + ), + returnValue: _i22.Future<_i29.Uint8List>.value(_i29.Uint8List(0)), + ) as _i22.Future<_i29.Uint8List>); + @override + _i22.Future<_i17.Address> currentReceivingPaynymAddress({ + required _i18.PaymentCode? sender, + required bool? isSegwit, + }) => (super.noSuchMethod( Invocation.method( #currentReceivingPaynymAddress, - [sender], + [], + { + #sender: sender, + #isSegwit: isSegwit, + }, ), - returnValue: _i22.Future<_i16.Address>.value(_FakeAddress_14( + returnValue: _i22.Future<_i17.Address>.value(_FakeAddress_15( this, Invocation.method( #currentReceivingPaynymAddress, - [sender], + [], + { + #sender: sender, + #isSegwit: isSegwit, + }, ), )), - ) as _i22.Future<_i16.Address>); + ) as _i22.Future<_i17.Address>); @override - _i22.Future checkCurrentPaynymReceivingAddressForTransactions( - _i18.PaymentCode? sender) => + _i22.Future checkCurrentPaynymReceivingAddressForTransactions({ + required _i18.PaymentCode? sender, + required bool? isSegwit, + }) => (super.noSuchMethod( Invocation.method( #checkCurrentPaynymReceivingAddressForTransactions, - [sender], + [], + { + #sender: sender, + #isSegwit: isSegwit, + }, ), returnValue: _i22.Future.value(), returnValueForMissingStub: _i22.Future.value(), @@ -1591,81 +1639,33 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { returnValueForMissingStub: _i22.Future.value(), ) as _i22.Future); @override - _i22.Future<_i17.BIP32> deriveNotificationBip32Node({ - required String? mnemonic, - required String? mnemonicPassphrase, - }) => - (super.noSuchMethod( + _i22.Future<_i16.BIP32> deriveNotificationBip32Node() => (super.noSuchMethod( Invocation.method( #deriveNotificationBip32Node, [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - }, ), - returnValue: _i22.Future<_i17.BIP32>.value(_FakeBIP32_15( + returnValue: _i22.Future<_i16.BIP32>.value(_FakeBIP32_14( this, Invocation.method( #deriveNotificationBip32Node, [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - }, ), )), - ) as _i22.Future<_i17.BIP32>); + ) as _i22.Future<_i16.BIP32>); @override - _i22.Future<_i17.BIP32> deriveReceivingPrivateKeyNode({ - required String? mnemonic, - required String? mnemonicPassphrase, - required int? index, - }) => - (super.noSuchMethod( - Invocation.method( - #deriveReceivingPrivateKeyNode, - [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - #index: index, - }, - ), - returnValue: _i22.Future<_i17.BIP32>.value(_FakeBIP32_15( - this, - Invocation.method( - #deriveReceivingPrivateKeyNode, - [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - #index: index, - }, - ), - )), - ) as _i22.Future<_i17.BIP32>); - @override - _i22.Future<_i18.PaymentCode> getPaymentCode( - _i26.DerivePathType? derivePathType, [ - _i17.BIP32? bip32Root, - ]) => + _i22.Future<_i18.PaymentCode> getPaymentCode({required bool? isSegwit}) => (super.noSuchMethod( Invocation.method( #getPaymentCode, - [ - derivePathType, - bip32Root, - ], + [], + {#isSegwit: isSegwit}, ), returnValue: _i22.Future<_i18.PaymentCode>.value(_FakePaymentCode_16( this, Invocation.method( #getPaymentCode, - [ - derivePathType, - bip32Root, - ], + [], + {#isSegwit: isSegwit}, ), )), ) as _i22.Future<_i18.PaymentCode>); @@ -1690,6 +1690,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { @override _i22.Future> preparePaymentCodeSend({ required _i18.PaymentCode? paymentCode, + required bool? isSegwit, required _i14.Amount? amount, Map? args, }) => @@ -1699,6 +1700,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { [], { #paymentCode: paymentCode, + #isSegwit: isSegwit, #amount: amount, #args: args, }, @@ -1707,9 +1709,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { _i22.Future>.value({}), ) as _i22.Future>); @override - _i22.Future<_i16.Address> nextUnusedSendAddressFrom({ + _i22.Future<_i17.Address> nextUnusedSendAddressFrom({ required _i18.PaymentCode? pCode, - required _i17.BIP32? privateKeyNode, + required bool? isSegwit, + required _i16.BIP32? privateKeyNode, int? startIndex = 0, }) => (super.noSuchMethod( @@ -1718,29 +1721,31 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { [], { #pCode: pCode, + #isSegwit: isSegwit, #privateKeyNode: privateKeyNode, #startIndex: startIndex, }, ), - returnValue: _i22.Future<_i16.Address>.value(_FakeAddress_14( + returnValue: _i22.Future<_i17.Address>.value(_FakeAddress_15( this, Invocation.method( #nextUnusedSendAddressFrom, [], { #pCode: pCode, + #isSegwit: isSegwit, #privateKeyNode: privateKeyNode, #startIndex: startIndex, }, ), )), - ) as _i22.Future<_i16.Address>); + ) as _i22.Future<_i17.Address>); @override _i22.Future> prepareNotificationTx({ required int? selectedTxFeeRate, required String? targetPaymentCodeString, int? additionalOutputs = 0, - List<_i16.UTXO>? utxos, + List<_i17.UTXO>? utxos, }) => (super.noSuchMethod( Invocation.method( @@ -1777,34 +1782,24 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { returnValue: _i22.Future.value(false), ) as _i22.Future); @override - _i22.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransaction({ - required _i16.Transaction? transaction, - required _i16.Address? myNotificationAddress, - }) => + _i22.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransaction( + {required _i17.Transaction? transaction}) => (super.noSuchMethod( Invocation.method( #unBlindedPaymentCodeFromTransaction, [], - { - #transaction: transaction, - #myNotificationAddress: myNotificationAddress, - }, + {#transaction: transaction}, ), 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, - }) => + _i22.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransactionBad( + {required _i17.Transaction? transaction}) => (super.noSuchMethod( Invocation.method( #unBlindedPaymentCodeFromTransactionBad, [], - { - #transaction: transaction, - #myNotificationAddress: myNotificationAddress, - }, + {#transaction: transaction}, ), returnValue: _i22.Future<_i18.PaymentCode?>.value(), ) as _i22.Future<_i18.PaymentCode?>); @@ -1849,111 +1844,40 @@ class MockBitcoinWallet extends _i1.Mock implements _i25.BitcoinWallet { returnValueForMissingStub: _i22.Future.value(), ) as _i22.Future); @override - _i22.Future restoreHistoryWith( - _i18.PaymentCode? other, - int? maxUnusedAddressGap, - int? maxNumberOfIndexesToCheck, - ) => + _i22.Future restoreHistoryWith({ + required _i18.PaymentCode? other, + required bool? checkSegwitAsWell, + required int? maxUnusedAddressGap, + required int? maxNumberOfIndexesToCheck, + }) => (super.noSuchMethod( Invocation.method( #restoreHistoryWith, - [ - other, - maxUnusedAddressGap, - maxNumberOfIndexesToCheck, - ], + [], + { + #other: other, + #checkSegwitAsWell: checkSegwitAsWell, + #maxUnusedAddressGap: maxUnusedAddressGap, + #maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck, + }, ), returnValue: _i22.Future.value(), returnValueForMissingStub: _i22.Future.value(), ) as _i22.Future); @override - _i22.Future<_i16.Address> generatePaynymSendAddressFromKeyPair({ - required _i13.ECPair? pair, - required int? derivationIndex, - required _i26.DerivePathType? derivePathType, - required _i18.PaymentCode? toPaymentCode, - }) => - (super.noSuchMethod( - Invocation.method( - #generatePaynymSendAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #toPaymentCode: toPaymentCode, - }, - ), - returnValue: _i22.Future<_i16.Address>.value(_FakeAddress_14( - this, - Invocation.method( - #generatePaynymSendAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #toPaymentCode: toPaymentCode, - }, - ), - )), - ) as _i22.Future<_i16.Address>); - @override - _i22.Future<_i16.Address> generatePaynymReceivingAddressFromKeyPair({ - required _i13.ECPair? pair, - required int? derivationIndex, - required _i26.DerivePathType? derivePathType, - required _i18.PaymentCode? fromPaymentCode, - }) => - (super.noSuchMethod( - Invocation.method( - #generatePaynymReceivingAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #fromPaymentCode: fromPaymentCode, - }, - ), - returnValue: _i22.Future<_i16.Address>.value(_FakeAddress_14( - this, - Invocation.method( - #generatePaynymReceivingAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #fromPaymentCode: fromPaymentCode, - }, - ), - )), - ) as _i22.Future<_i16.Address>); - @override - _i22.Future<_i16.Address> getMyNotificationAddress( - _i26.DerivePathType? derivePathType, [ - _i17.BIP32? bip32Root, - ]) => - (super.noSuchMethod( + _i22.Future<_i17.Address> getMyNotificationAddress() => (super.noSuchMethod( Invocation.method( #getMyNotificationAddress, - [ - derivePathType, - bip32Root, - ], + [], ), - returnValue: _i22.Future<_i16.Address>.value(_FakeAddress_14( + returnValue: _i22.Future<_i17.Address>.value(_FakeAddress_15( this, Invocation.method( #getMyNotificationAddress, - [ - derivePathType, - bip32Root, - ], + [], ), )), - ) as _i22.Future<_i16.Address>); + ) as _i22.Future<_i17.Address>); @override _i22.Future> lookupKey(String? paymentCodeString) => (super.noSuchMethod( @@ -2111,16 +2035,16 @@ class MockManager extends _i1.Mock implements _i6.Manager { ), ) as _i11.Balance); @override - _i22.Future> get transactions => (super.noSuchMethod( + _i22.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), returnValue: - _i22.Future>.value(<_i16.Transaction>[]), - ) as _i22.Future>); + _i22.Future>.value(<_i17.Transaction>[]), + ) as _i22.Future>); @override - _i22.Future> get utxos => (super.noSuchMethod( + _i22.Future> get utxos => (super.noSuchMethod( Invocation.getter(#utxos), - returnValue: _i22.Future>.value(<_i16.UTXO>[]), - ) as _i22.Future>); + returnValue: _i22.Future>.value(<_i17.UTXO>[]), + ) as _i22.Future>); @override set walletName(String? newName) => super.noSuchMethod( Invocation.setter( @@ -2479,16 +2403,16 @@ class MockCoinServiceAPI extends _i1.Mock implements _i19.CoinServiceAPI { ), ) as _i11.Balance); @override - _i22.Future> get transactions => (super.noSuchMethod( + _i22.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), returnValue: - _i22.Future>.value(<_i16.Transaction>[]), - ) as _i22.Future>); + _i22.Future>.value(<_i17.Transaction>[]), + ) as _i22.Future>); @override - _i22.Future> get utxos => (super.noSuchMethod( + _i22.Future> get utxos => (super.noSuchMethod( Invocation.getter(#utxos), - returnValue: _i22.Future>.value(<_i16.UTXO>[]), - ) as _i22.Future>); + returnValue: _i22.Future>.value(<_i17.UTXO>[]), + ) as _i22.Future>); @override set walletName(String? newName) => super.noSuchMethod( Invocation.setter( diff --git a/test/widget_tests/wallet_card_test.mocks.dart b/test/widget_tests/wallet_card_test.mocks.dart index 0e3a61dd1..908eef0dc 100644 --- a/test/widget_tests/wallet_card_test.mocks.dart +++ b/test/widget_tests/wallet_card_test.mocks.dart @@ -7,7 +7,7 @@ import 'dart:async' as _i21; import 'dart:typed_data' as _i28; import 'dart:ui' as _i23; -import 'package:bip32/bip32.dart' as _i17; +import 'package:bip32/bip32.dart' as _i16; import 'package:bip47/bip47.dart' as _i18; import 'package:bitcoindart/bitcoindart.dart' as _i13; import 'package:flutter/foundation.dart' as _i4; @@ -17,7 +17,7 @@ import 'package:stackwallet/db/isar/main_db.dart' as _i12; import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i10; import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i9; import 'package:stackwallet/models/balance.dart' as _i11; -import 'package:stackwallet/models/isar/models/isar_models.dart' as _i16; +import 'package:stackwallet/models/isar/models/isar_models.dart' as _i17; import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i8; import 'package:stackwallet/models/signing_data.dart' as _i26; import 'package:stackwallet/services/coins/bitcoin/bitcoin_wallet.dart' as _i24; @@ -192,8 +192,8 @@ class _FakeTuple2_13 extends _i1.SmartFake ); } -class _FakeAddress_14 extends _i1.SmartFake implements _i16.Address { - _FakeAddress_14( +class _FakeBIP32_14 extends _i1.SmartFake implements _i16.BIP32 { + _FakeBIP32_14( Object parent, Invocation parentInvocation, ) : super( @@ -202,8 +202,8 @@ class _FakeAddress_14 extends _i1.SmartFake implements _i16.Address { ); } -class _FakeBIP32_15 extends _i1.SmartFake implements _i17.BIP32 { - _FakeBIP32_15( +class _FakeAddress_15 extends _i1.SmartFake implements _i17.Address { + _FakeAddress_15( Object parent, Invocation parentInvocation, ) : super( @@ -521,16 +521,16 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet { returnValue: _i20.Coin.bitcoin, ) as _i20.Coin); @override - _i21.Future> get utxos => (super.noSuchMethod( + _i21.Future> get utxos => (super.noSuchMethod( Invocation.getter(#utxos), - returnValue: _i21.Future>.value(<_i16.UTXO>[]), - ) as _i21.Future>); + returnValue: _i21.Future>.value(<_i17.UTXO>[]), + ) as _i21.Future>); @override - _i21.Future> get transactions => (super.noSuchMethod( + _i21.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), returnValue: - _i21.Future>.value(<_i16.Transaction>[]), - ) as _i21.Future>); + _i21.Future>.value(<_i17.Transaction>[]), + ) as _i21.Future>); @override _i21.Future get currentReceivingAddress => (super.noSuchMethod( Invocation.getter(#currentReceivingAddress), @@ -939,7 +939,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet { required bool? coinControl, required bool? isSendAll, int? additionalOutputs = 0, - List<_i16.UTXO>? utxos, + List<_i17.UTXO>? utxos, }) => super.noSuchMethod(Invocation.method( #coinSelection, @@ -956,7 +956,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet { )); @override _i21.Future> fetchBuildTxData( - List<_i16.UTXO>? utxosToUse) => + List<_i17.UTXO>? utxosToUse) => (super.noSuchMethod( Invocation.method( #fetchBuildTxData, @@ -1210,10 +1210,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet { returnValueForMissingStub: null, ); @override - _i21.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>> parseTransaction( + _i21.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>> parseTransaction( Map? txData, dynamic electrumxClient, - List<_i16.Address>? myAddresses, + List<_i17.Address>? myAddresses, _i20.Coin? coin, int? minConfirms, String? walletId, @@ -1231,8 +1231,8 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet { ], ), returnValue: - _i21.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>>.value( - _FakeTuple2_13<_i16.Transaction, _i16.Address>( + _i21.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>>.value( + _FakeTuple2_13<_i17.Transaction, _i17.Address>( this, Invocation.method( #parseTransaction, @@ -1246,7 +1246,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet { ], ), )), - ) as _i21.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>>); + ) as _i21.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>>); @override void initPaynymWalletInterface({ required String? walletId, @@ -1256,6 +1256,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet { required _i12.MainDB? db, required _i9.ElectrumX? electrumXClient, required _i27.SecureStorageInterface? secureStorage, + required int? dustLimit, required int? dustLimitP2PKH, required int? minConfirms, required _i21.Future Function()? getMnemonicString, @@ -1274,7 +1275,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet { })? prepareSend, required _i21.Future Function({required String address})? getTxCount, - required _i21.Future> Function(List<_i16.UTXO>)? + required _i21.Future> Function(List<_i17.UTXO>)? fetchBuildTxData, required _i21.Future Function()? refresh, required _i21.Future Function()? checkChangeAddressForTransactions, @@ -1291,6 +1292,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet { #db: db, #electrumXClient: electrumXClient, #secureStorage: secureStorage, + #dustLimit: dustLimit, #dustLimitP2PKH: dustLimitP2PKH, #minConfirms: minConfirms, #getMnemonicString: getMnemonicString, @@ -1309,28 +1311,74 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet { returnValueForMissingStub: null, ); @override - _i21.Future<_i16.Address> currentReceivingPaynymAddress( - _i18.PaymentCode? sender) => + _i21.Future<_i16.BIP32> getBip47BaseNode() => (super.noSuchMethod( + Invocation.method( + #getBip47BaseNode, + [], + ), + returnValue: _i21.Future<_i16.BIP32>.value(_FakeBIP32_14( + this, + Invocation.method( + #getBip47BaseNode, + [], + ), + )), + ) as _i21.Future<_i16.BIP32>); + @override + _i21.Future<_i28.Uint8List> getPrivateKeyForPaynymReceivingAddress({ + required String? paymentCodeString, + required int? index, + }) => + (super.noSuchMethod( + Invocation.method( + #getPrivateKeyForPaynymReceivingAddress, + [], + { + #paymentCodeString: paymentCodeString, + #index: index, + }, + ), + returnValue: _i21.Future<_i28.Uint8List>.value(_i28.Uint8List(0)), + ) as _i21.Future<_i28.Uint8List>); + @override + _i21.Future<_i17.Address> currentReceivingPaynymAddress({ + required _i18.PaymentCode? sender, + required bool? isSegwit, + }) => (super.noSuchMethod( Invocation.method( #currentReceivingPaynymAddress, - [sender], + [], + { + #sender: sender, + #isSegwit: isSegwit, + }, ), - returnValue: _i21.Future<_i16.Address>.value(_FakeAddress_14( + returnValue: _i21.Future<_i17.Address>.value(_FakeAddress_15( this, Invocation.method( #currentReceivingPaynymAddress, - [sender], + [], + { + #sender: sender, + #isSegwit: isSegwit, + }, ), )), - ) as _i21.Future<_i16.Address>); + ) as _i21.Future<_i17.Address>); @override - _i21.Future checkCurrentPaynymReceivingAddressForTransactions( - _i18.PaymentCode? sender) => + _i21.Future checkCurrentPaynymReceivingAddressForTransactions({ + required _i18.PaymentCode? sender, + required bool? isSegwit, + }) => (super.noSuchMethod( Invocation.method( #checkCurrentPaynymReceivingAddressForTransactions, - [sender], + [], + { + #sender: sender, + #isSegwit: isSegwit, + }, ), returnValue: _i21.Future.value(), returnValueForMissingStub: _i21.Future.value(), @@ -1346,81 +1394,33 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet { returnValueForMissingStub: _i21.Future.value(), ) as _i21.Future); @override - _i21.Future<_i17.BIP32> deriveNotificationBip32Node({ - required String? mnemonic, - required String? mnemonicPassphrase, - }) => - (super.noSuchMethod( + _i21.Future<_i16.BIP32> deriveNotificationBip32Node() => (super.noSuchMethod( Invocation.method( #deriveNotificationBip32Node, [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - }, ), - returnValue: _i21.Future<_i17.BIP32>.value(_FakeBIP32_15( + returnValue: _i21.Future<_i16.BIP32>.value(_FakeBIP32_14( this, Invocation.method( #deriveNotificationBip32Node, [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - }, ), )), - ) as _i21.Future<_i17.BIP32>); + ) as _i21.Future<_i16.BIP32>); @override - _i21.Future<_i17.BIP32> deriveReceivingPrivateKeyNode({ - required String? mnemonic, - required String? mnemonicPassphrase, - required int? index, - }) => - (super.noSuchMethod( - Invocation.method( - #deriveReceivingPrivateKeyNode, - [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - #index: index, - }, - ), - returnValue: _i21.Future<_i17.BIP32>.value(_FakeBIP32_15( - this, - Invocation.method( - #deriveReceivingPrivateKeyNode, - [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - #index: index, - }, - ), - )), - ) as _i21.Future<_i17.BIP32>); - @override - _i21.Future<_i18.PaymentCode> getPaymentCode( - _i25.DerivePathType? derivePathType, [ - _i17.BIP32? bip32Root, - ]) => + _i21.Future<_i18.PaymentCode> getPaymentCode({required bool? isSegwit}) => (super.noSuchMethod( Invocation.method( #getPaymentCode, - [ - derivePathType, - bip32Root, - ], + [], + {#isSegwit: isSegwit}, ), returnValue: _i21.Future<_i18.PaymentCode>.value(_FakePaymentCode_16( this, Invocation.method( #getPaymentCode, - [ - derivePathType, - bip32Root, - ], + [], + {#isSegwit: isSegwit}, ), )), ) as _i21.Future<_i18.PaymentCode>); @@ -1445,6 +1445,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet { @override _i21.Future> preparePaymentCodeSend({ required _i18.PaymentCode? paymentCode, + required bool? isSegwit, required _i14.Amount? amount, Map? args, }) => @@ -1454,6 +1455,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet { [], { #paymentCode: paymentCode, + #isSegwit: isSegwit, #amount: amount, #args: args, }, @@ -1462,9 +1464,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet { _i21.Future>.value({}), ) as _i21.Future>); @override - _i21.Future<_i16.Address> nextUnusedSendAddressFrom({ + _i21.Future<_i17.Address> nextUnusedSendAddressFrom({ required _i18.PaymentCode? pCode, - required _i17.BIP32? privateKeyNode, + required bool? isSegwit, + required _i16.BIP32? privateKeyNode, int? startIndex = 0, }) => (super.noSuchMethod( @@ -1473,29 +1476,31 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet { [], { #pCode: pCode, + #isSegwit: isSegwit, #privateKeyNode: privateKeyNode, #startIndex: startIndex, }, ), - returnValue: _i21.Future<_i16.Address>.value(_FakeAddress_14( + returnValue: _i21.Future<_i17.Address>.value(_FakeAddress_15( this, Invocation.method( #nextUnusedSendAddressFrom, [], { #pCode: pCode, + #isSegwit: isSegwit, #privateKeyNode: privateKeyNode, #startIndex: startIndex, }, ), )), - ) as _i21.Future<_i16.Address>); + ) as _i21.Future<_i17.Address>); @override _i21.Future> prepareNotificationTx({ required int? selectedTxFeeRate, required String? targetPaymentCodeString, int? additionalOutputs = 0, - List<_i16.UTXO>? utxos, + List<_i17.UTXO>? utxos, }) => (super.noSuchMethod( Invocation.method( @@ -1532,34 +1537,24 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet { returnValue: _i21.Future.value(false), ) as _i21.Future); @override - _i21.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransaction({ - required _i16.Transaction? transaction, - required _i16.Address? myNotificationAddress, - }) => + _i21.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransaction( + {required _i17.Transaction? transaction}) => (super.noSuchMethod( Invocation.method( #unBlindedPaymentCodeFromTransaction, [], - { - #transaction: transaction, - #myNotificationAddress: myNotificationAddress, - }, + {#transaction: transaction}, ), returnValue: _i21.Future<_i18.PaymentCode?>.value(), ) as _i21.Future<_i18.PaymentCode?>); @override - _i21.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransactionBad({ - required _i16.Transaction? transaction, - required _i16.Address? myNotificationAddress, - }) => + _i21.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransactionBad( + {required _i17.Transaction? transaction}) => (super.noSuchMethod( Invocation.method( #unBlindedPaymentCodeFromTransactionBad, [], - { - #transaction: transaction, - #myNotificationAddress: myNotificationAddress, - }, + {#transaction: transaction}, ), returnValue: _i21.Future<_i18.PaymentCode?>.value(), ) as _i21.Future<_i18.PaymentCode?>); @@ -1604,111 +1599,40 @@ class MockBitcoinWallet extends _i1.Mock implements _i24.BitcoinWallet { returnValueForMissingStub: _i21.Future.value(), ) as _i21.Future); @override - _i21.Future restoreHistoryWith( - _i18.PaymentCode? other, - int? maxUnusedAddressGap, - int? maxNumberOfIndexesToCheck, - ) => + _i21.Future restoreHistoryWith({ + required _i18.PaymentCode? other, + required bool? checkSegwitAsWell, + required int? maxUnusedAddressGap, + required int? maxNumberOfIndexesToCheck, + }) => (super.noSuchMethod( Invocation.method( #restoreHistoryWith, - [ - other, - maxUnusedAddressGap, - maxNumberOfIndexesToCheck, - ], + [], + { + #other: other, + #checkSegwitAsWell: checkSegwitAsWell, + #maxUnusedAddressGap: maxUnusedAddressGap, + #maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck, + }, ), returnValue: _i21.Future.value(), returnValueForMissingStub: _i21.Future.value(), ) as _i21.Future); @override - _i21.Future<_i16.Address> generatePaynymSendAddressFromKeyPair({ - required _i13.ECPair? pair, - required int? derivationIndex, - required _i25.DerivePathType? derivePathType, - required _i18.PaymentCode? toPaymentCode, - }) => - (super.noSuchMethod( - Invocation.method( - #generatePaynymSendAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #toPaymentCode: toPaymentCode, - }, - ), - returnValue: _i21.Future<_i16.Address>.value(_FakeAddress_14( - this, - Invocation.method( - #generatePaynymSendAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #toPaymentCode: toPaymentCode, - }, - ), - )), - ) as _i21.Future<_i16.Address>); - @override - _i21.Future<_i16.Address> generatePaynymReceivingAddressFromKeyPair({ - required _i13.ECPair? pair, - required int? derivationIndex, - required _i25.DerivePathType? derivePathType, - required _i18.PaymentCode? fromPaymentCode, - }) => - (super.noSuchMethod( - Invocation.method( - #generatePaynymReceivingAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #fromPaymentCode: fromPaymentCode, - }, - ), - returnValue: _i21.Future<_i16.Address>.value(_FakeAddress_14( - this, - Invocation.method( - #generatePaynymReceivingAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #fromPaymentCode: fromPaymentCode, - }, - ), - )), - ) as _i21.Future<_i16.Address>); - @override - _i21.Future<_i16.Address> getMyNotificationAddress( - _i25.DerivePathType? derivePathType, [ - _i17.BIP32? bip32Root, - ]) => - (super.noSuchMethod( + _i21.Future<_i17.Address> getMyNotificationAddress() => (super.noSuchMethod( Invocation.method( #getMyNotificationAddress, - [ - derivePathType, - bip32Root, - ], + [], ), - returnValue: _i21.Future<_i16.Address>.value(_FakeAddress_14( + returnValue: _i21.Future<_i17.Address>.value(_FakeAddress_15( this, Invocation.method( #getMyNotificationAddress, - [ - derivePathType, - bip32Root, - ], + [], ), )), - ) as _i21.Future<_i16.Address>); + ) as _i21.Future<_i17.Address>); @override _i21.Future> lookupKey(String? paymentCodeString) => (super.noSuchMethod( 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 94ce87475..70954c6db 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 @@ -7,7 +7,7 @@ import 'dart:async' as _i23; import 'dart:typed_data' as _i29; import 'dart:ui' as _i25; -import 'package:bip32/bip32.dart' as _i17; +import 'package:bip32/bip32.dart' as _i16; import 'package:bip47/bip47.dart' as _i18; import 'package:bitcoindart/bitcoindart.dart' as _i13; import 'package:flutter/foundation.dart' as _i4; @@ -17,7 +17,7 @@ import 'package:stackwallet/db/isar/main_db.dart' as _i12; import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i10; import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i9; import 'package:stackwallet/models/balance.dart' as _i11; -import 'package:stackwallet/models/isar/models/isar_models.dart' as _i16; +import 'package:stackwallet/models/isar/models/isar_models.dart' as _i17; import 'package:stackwallet/models/node_model.dart' as _i30; import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i8; import 'package:stackwallet/models/signing_data.dart' as _i28; @@ -193,8 +193,8 @@ class _FakeTuple2_13 extends _i1.SmartFake ); } -class _FakeAddress_14 extends _i1.SmartFake implements _i16.Address { - _FakeAddress_14( +class _FakeBIP32_14 extends _i1.SmartFake implements _i16.BIP32 { + _FakeBIP32_14( Object parent, Invocation parentInvocation, ) : super( @@ -203,8 +203,8 @@ class _FakeAddress_14 extends _i1.SmartFake implements _i16.Address { ); } -class _FakeBIP32_15 extends _i1.SmartFake implements _i17.BIP32 { - _FakeBIP32_15( +class _FakeAddress_15 extends _i1.SmartFake implements _i17.Address { + _FakeAddress_15( Object parent, Invocation parentInvocation, ) : super( @@ -778,16 +778,16 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValue: _i22.Coin.bitcoin, ) as _i22.Coin); @override - _i23.Future> get utxos => (super.noSuchMethod( + _i23.Future> get utxos => (super.noSuchMethod( Invocation.getter(#utxos), - returnValue: _i23.Future>.value(<_i16.UTXO>[]), - ) as _i23.Future>); + returnValue: _i23.Future>.value(<_i17.UTXO>[]), + ) as _i23.Future>); @override - _i23.Future> get transactions => (super.noSuchMethod( + _i23.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), returnValue: - _i23.Future>.value(<_i16.Transaction>[]), - ) as _i23.Future>); + _i23.Future>.value(<_i17.Transaction>[]), + ) as _i23.Future>); @override _i23.Future get currentReceivingAddress => (super.noSuchMethod( Invocation.getter(#currentReceivingAddress), @@ -1196,7 +1196,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { required bool? coinControl, required bool? isSendAll, int? additionalOutputs = 0, - List<_i16.UTXO>? utxos, + List<_i17.UTXO>? utxos, }) => super.noSuchMethod(Invocation.method( #coinSelection, @@ -1213,7 +1213,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { )); @override _i23.Future> fetchBuildTxData( - List<_i16.UTXO>? utxosToUse) => + List<_i17.UTXO>? utxosToUse) => (super.noSuchMethod( Invocation.method( #fetchBuildTxData, @@ -1467,10 +1467,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValueForMissingStub: null, ); @override - _i23.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>> parseTransaction( + _i23.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>> parseTransaction( Map? txData, dynamic electrumxClient, - List<_i16.Address>? myAddresses, + List<_i17.Address>? myAddresses, _i22.Coin? coin, int? minConfirms, String? walletId, @@ -1488,8 +1488,8 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { ], ), returnValue: - _i23.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>>.value( - _FakeTuple2_13<_i16.Transaction, _i16.Address>( + _i23.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>>.value( + _FakeTuple2_13<_i17.Transaction, _i17.Address>( this, Invocation.method( #parseTransaction, @@ -1503,7 +1503,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { ], ), )), - ) as _i23.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>>); + ) as _i23.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>>); @override void initPaynymWalletInterface({ required String? walletId, @@ -1513,6 +1513,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { required _i12.MainDB? db, required _i9.ElectrumX? electrumXClient, required _i19.SecureStorageInterface? secureStorage, + required int? dustLimit, required int? dustLimitP2PKH, required int? minConfirms, required _i23.Future Function()? getMnemonicString, @@ -1531,7 +1532,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { })? prepareSend, required _i23.Future Function({required String address})? getTxCount, - required _i23.Future> Function(List<_i16.UTXO>)? + required _i23.Future> Function(List<_i17.UTXO>)? fetchBuildTxData, required _i23.Future Function()? refresh, required _i23.Future Function()? checkChangeAddressForTransactions, @@ -1548,6 +1549,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { #db: db, #electrumXClient: electrumXClient, #secureStorage: secureStorage, + #dustLimit: dustLimit, #dustLimitP2PKH: dustLimitP2PKH, #minConfirms: minConfirms, #getMnemonicString: getMnemonicString, @@ -1566,28 +1568,74 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValueForMissingStub: null, ); @override - _i23.Future<_i16.Address> currentReceivingPaynymAddress( - _i18.PaymentCode? sender) => + _i23.Future<_i16.BIP32> getBip47BaseNode() => (super.noSuchMethod( + Invocation.method( + #getBip47BaseNode, + [], + ), + returnValue: _i23.Future<_i16.BIP32>.value(_FakeBIP32_14( + this, + Invocation.method( + #getBip47BaseNode, + [], + ), + )), + ) as _i23.Future<_i16.BIP32>); + @override + _i23.Future<_i29.Uint8List> getPrivateKeyForPaynymReceivingAddress({ + required String? paymentCodeString, + required int? index, + }) => + (super.noSuchMethod( + Invocation.method( + #getPrivateKeyForPaynymReceivingAddress, + [], + { + #paymentCodeString: paymentCodeString, + #index: index, + }, + ), + returnValue: _i23.Future<_i29.Uint8List>.value(_i29.Uint8List(0)), + ) as _i23.Future<_i29.Uint8List>); + @override + _i23.Future<_i17.Address> currentReceivingPaynymAddress({ + required _i18.PaymentCode? sender, + required bool? isSegwit, + }) => (super.noSuchMethod( Invocation.method( #currentReceivingPaynymAddress, - [sender], + [], + { + #sender: sender, + #isSegwit: isSegwit, + }, ), - returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14( + returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15( this, Invocation.method( #currentReceivingPaynymAddress, - [sender], + [], + { + #sender: sender, + #isSegwit: isSegwit, + }, ), )), - ) as _i23.Future<_i16.Address>); + ) as _i23.Future<_i17.Address>); @override - _i23.Future checkCurrentPaynymReceivingAddressForTransactions( - _i18.PaymentCode? sender) => + _i23.Future checkCurrentPaynymReceivingAddressForTransactions({ + required _i18.PaymentCode? sender, + required bool? isSegwit, + }) => (super.noSuchMethod( Invocation.method( #checkCurrentPaynymReceivingAddressForTransactions, - [sender], + [], + { + #sender: sender, + #isSegwit: isSegwit, + }, ), returnValue: _i23.Future.value(), returnValueForMissingStub: _i23.Future.value(), @@ -1603,81 +1651,33 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override - _i23.Future<_i17.BIP32> deriveNotificationBip32Node({ - required String? mnemonic, - required String? mnemonicPassphrase, - }) => - (super.noSuchMethod( + _i23.Future<_i16.BIP32> deriveNotificationBip32Node() => (super.noSuchMethod( Invocation.method( #deriveNotificationBip32Node, [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - }, ), - returnValue: _i23.Future<_i17.BIP32>.value(_FakeBIP32_15( + returnValue: _i23.Future<_i16.BIP32>.value(_FakeBIP32_14( this, Invocation.method( #deriveNotificationBip32Node, [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - }, ), )), - ) as _i23.Future<_i17.BIP32>); + ) as _i23.Future<_i16.BIP32>); @override - _i23.Future<_i17.BIP32> deriveReceivingPrivateKeyNode({ - required String? mnemonic, - required String? mnemonicPassphrase, - required int? index, - }) => - (super.noSuchMethod( - Invocation.method( - #deriveReceivingPrivateKeyNode, - [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - #index: index, - }, - ), - returnValue: _i23.Future<_i17.BIP32>.value(_FakeBIP32_15( - this, - Invocation.method( - #deriveReceivingPrivateKeyNode, - [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - #index: index, - }, - ), - )), - ) as _i23.Future<_i17.BIP32>); - @override - _i23.Future<_i18.PaymentCode> getPaymentCode( - _i27.DerivePathType? derivePathType, [ - _i17.BIP32? bip32Root, - ]) => + _i23.Future<_i18.PaymentCode> getPaymentCode({required bool? isSegwit}) => (super.noSuchMethod( Invocation.method( #getPaymentCode, - [ - derivePathType, - bip32Root, - ], + [], + {#isSegwit: isSegwit}, ), returnValue: _i23.Future<_i18.PaymentCode>.value(_FakePaymentCode_16( this, Invocation.method( #getPaymentCode, - [ - derivePathType, - bip32Root, - ], + [], + {#isSegwit: isSegwit}, ), )), ) as _i23.Future<_i18.PaymentCode>); @@ -1702,6 +1702,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { @override _i23.Future> preparePaymentCodeSend({ required _i18.PaymentCode? paymentCode, + required bool? isSegwit, required _i14.Amount? amount, Map? args, }) => @@ -1711,6 +1712,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { [], { #paymentCode: paymentCode, + #isSegwit: isSegwit, #amount: amount, #args: args, }, @@ -1719,9 +1721,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { _i23.Future>.value({}), ) as _i23.Future>); @override - _i23.Future<_i16.Address> nextUnusedSendAddressFrom({ + _i23.Future<_i17.Address> nextUnusedSendAddressFrom({ required _i18.PaymentCode? pCode, - required _i17.BIP32? privateKeyNode, + required bool? isSegwit, + required _i16.BIP32? privateKeyNode, int? startIndex = 0, }) => (super.noSuchMethod( @@ -1730,29 +1733,31 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { [], { #pCode: pCode, + #isSegwit: isSegwit, #privateKeyNode: privateKeyNode, #startIndex: startIndex, }, ), - returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14( + returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15( this, Invocation.method( #nextUnusedSendAddressFrom, [], { #pCode: pCode, + #isSegwit: isSegwit, #privateKeyNode: privateKeyNode, #startIndex: startIndex, }, ), )), - ) as _i23.Future<_i16.Address>); + ) as _i23.Future<_i17.Address>); @override _i23.Future> prepareNotificationTx({ required int? selectedTxFeeRate, required String? targetPaymentCodeString, int? additionalOutputs = 0, - List<_i16.UTXO>? utxos, + List<_i17.UTXO>? utxos, }) => (super.noSuchMethod( Invocation.method( @@ -1789,34 +1794,24 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValue: _i23.Future.value(false), ) as _i23.Future); @override - _i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransaction({ - required _i16.Transaction? transaction, - required _i16.Address? myNotificationAddress, - }) => + _i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransaction( + {required _i17.Transaction? transaction}) => (super.noSuchMethod( Invocation.method( #unBlindedPaymentCodeFromTransaction, [], - { - #transaction: transaction, - #myNotificationAddress: myNotificationAddress, - }, + {#transaction: transaction}, ), returnValue: _i23.Future<_i18.PaymentCode?>.value(), ) as _i23.Future<_i18.PaymentCode?>); @override - _i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransactionBad({ - required _i16.Transaction? transaction, - required _i16.Address? myNotificationAddress, - }) => + _i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransactionBad( + {required _i17.Transaction? transaction}) => (super.noSuchMethod( Invocation.method( #unBlindedPaymentCodeFromTransactionBad, [], - { - #transaction: transaction, - #myNotificationAddress: myNotificationAddress, - }, + {#transaction: transaction}, ), returnValue: _i23.Future<_i18.PaymentCode?>.value(), ) as _i23.Future<_i18.PaymentCode?>); @@ -1861,111 +1856,40 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override - _i23.Future restoreHistoryWith( - _i18.PaymentCode? other, - int? maxUnusedAddressGap, - int? maxNumberOfIndexesToCheck, - ) => + _i23.Future restoreHistoryWith({ + required _i18.PaymentCode? other, + required bool? checkSegwitAsWell, + required int? maxUnusedAddressGap, + required int? maxNumberOfIndexesToCheck, + }) => (super.noSuchMethod( Invocation.method( #restoreHistoryWith, - [ - other, - maxUnusedAddressGap, - maxNumberOfIndexesToCheck, - ], + [], + { + #other: other, + #checkSegwitAsWell: checkSegwitAsWell, + #maxUnusedAddressGap: maxUnusedAddressGap, + #maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck, + }, ), returnValue: _i23.Future.value(), returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override - _i23.Future<_i16.Address> generatePaynymSendAddressFromKeyPair({ - required _i13.ECPair? pair, - required int? derivationIndex, - required _i27.DerivePathType? derivePathType, - required _i18.PaymentCode? toPaymentCode, - }) => - (super.noSuchMethod( - Invocation.method( - #generatePaynymSendAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #toPaymentCode: toPaymentCode, - }, - ), - returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14( - this, - Invocation.method( - #generatePaynymSendAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #toPaymentCode: toPaymentCode, - }, - ), - )), - ) as _i23.Future<_i16.Address>); - @override - _i23.Future<_i16.Address> generatePaynymReceivingAddressFromKeyPair({ - required _i13.ECPair? pair, - required int? derivationIndex, - required _i27.DerivePathType? derivePathType, - required _i18.PaymentCode? fromPaymentCode, - }) => - (super.noSuchMethod( - Invocation.method( - #generatePaynymReceivingAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #fromPaymentCode: fromPaymentCode, - }, - ), - returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14( - this, - Invocation.method( - #generatePaynymReceivingAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #fromPaymentCode: fromPaymentCode, - }, - ), - )), - ) as _i23.Future<_i16.Address>); - @override - _i23.Future<_i16.Address> getMyNotificationAddress( - _i27.DerivePathType? derivePathType, [ - _i17.BIP32? bip32Root, - ]) => - (super.noSuchMethod( + _i23.Future<_i17.Address> getMyNotificationAddress() => (super.noSuchMethod( Invocation.method( #getMyNotificationAddress, - [ - derivePathType, - bip32Root, - ], + [], ), - returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14( + returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15( this, Invocation.method( #getMyNotificationAddress, - [ - derivePathType, - bip32Root, - ], + [], ), )), - ) as _i23.Future<_i16.Address>); + ) as _i23.Future<_i17.Address>); @override _i23.Future> lookupKey(String? paymentCodeString) => (super.noSuchMethod( @@ -2323,16 +2247,16 @@ class MockManager extends _i1.Mock implements _i6.Manager { ), ) as _i11.Balance); @override - _i23.Future> get transactions => (super.noSuchMethod( + _i23.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), returnValue: - _i23.Future>.value(<_i16.Transaction>[]), - ) as _i23.Future>); + _i23.Future>.value(<_i17.Transaction>[]), + ) as _i23.Future>); @override - _i23.Future> get utxos => (super.noSuchMethod( + _i23.Future> get utxos => (super.noSuchMethod( Invocation.getter(#utxos), - returnValue: _i23.Future>.value(<_i16.UTXO>[]), - ) as _i23.Future>); + returnValue: _i23.Future>.value(<_i17.UTXO>[]), + ) as _i23.Future>); @override set walletName(String? newName) => super.noSuchMethod( Invocation.setter( @@ -2691,16 +2615,16 @@ class MockCoinServiceAPI extends _i1.Mock implements _i20.CoinServiceAPI { ), ) as _i11.Balance); @override - _i23.Future> get transactions => (super.noSuchMethod( + _i23.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), returnValue: - _i23.Future>.value(<_i16.Transaction>[]), - ) as _i23.Future>); + _i23.Future>.value(<_i17.Transaction>[]), + ) as _i23.Future>); @override - _i23.Future> get utxos => (super.noSuchMethod( + _i23.Future> get utxos => (super.noSuchMethod( Invocation.getter(#utxos), - returnValue: _i23.Future>.value(<_i16.UTXO>[]), - ) as _i23.Future>); + returnValue: _i23.Future>.value(<_i17.UTXO>[]), + ) as _i23.Future>); @override set walletName(String? newName) => super.noSuchMethod( Invocation.setter( 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 0856db274..40f033633 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 @@ -7,7 +7,7 @@ import 'dart:async' as _i23; import 'dart:typed_data' as _i29; import 'dart:ui' as _i25; -import 'package:bip32/bip32.dart' as _i17; +import 'package:bip32/bip32.dart' as _i16; import 'package:bip47/bip47.dart' as _i18; import 'package:bitcoindart/bitcoindart.dart' as _i13; import 'package:flutter/foundation.dart' as _i4; @@ -17,7 +17,7 @@ import 'package:stackwallet/db/isar/main_db.dart' as _i12; import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart' as _i10; import 'package:stackwallet/electrumx_rpc/electrumx.dart' as _i9; import 'package:stackwallet/models/balance.dart' as _i11; -import 'package:stackwallet/models/isar/models/isar_models.dart' as _i16; +import 'package:stackwallet/models/isar/models/isar_models.dart' as _i17; import 'package:stackwallet/models/node_model.dart' as _i30; import 'package:stackwallet/models/paymint/fee_object_model.dart' as _i8; import 'package:stackwallet/models/signing_data.dart' as _i28; @@ -193,8 +193,8 @@ class _FakeTuple2_13 extends _i1.SmartFake ); } -class _FakeAddress_14 extends _i1.SmartFake implements _i16.Address { - _FakeAddress_14( +class _FakeBIP32_14 extends _i1.SmartFake implements _i16.BIP32 { + _FakeBIP32_14( Object parent, Invocation parentInvocation, ) : super( @@ -203,8 +203,8 @@ class _FakeAddress_14 extends _i1.SmartFake implements _i16.Address { ); } -class _FakeBIP32_15 extends _i1.SmartFake implements _i17.BIP32 { - _FakeBIP32_15( +class _FakeAddress_15 extends _i1.SmartFake implements _i17.Address { + _FakeAddress_15( Object parent, Invocation parentInvocation, ) : super( @@ -778,16 +778,16 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValue: _i22.Coin.bitcoin, ) as _i22.Coin); @override - _i23.Future> get utxos => (super.noSuchMethod( + _i23.Future> get utxos => (super.noSuchMethod( Invocation.getter(#utxos), - returnValue: _i23.Future>.value(<_i16.UTXO>[]), - ) as _i23.Future>); + returnValue: _i23.Future>.value(<_i17.UTXO>[]), + ) as _i23.Future>); @override - _i23.Future> get transactions => (super.noSuchMethod( + _i23.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), returnValue: - _i23.Future>.value(<_i16.Transaction>[]), - ) as _i23.Future>); + _i23.Future>.value(<_i17.Transaction>[]), + ) as _i23.Future>); @override _i23.Future get currentReceivingAddress => (super.noSuchMethod( Invocation.getter(#currentReceivingAddress), @@ -1196,7 +1196,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { required bool? coinControl, required bool? isSendAll, int? additionalOutputs = 0, - List<_i16.UTXO>? utxos, + List<_i17.UTXO>? utxos, }) => super.noSuchMethod(Invocation.method( #coinSelection, @@ -1213,7 +1213,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { )); @override _i23.Future> fetchBuildTxData( - List<_i16.UTXO>? utxosToUse) => + List<_i17.UTXO>? utxosToUse) => (super.noSuchMethod( Invocation.method( #fetchBuildTxData, @@ -1467,10 +1467,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValueForMissingStub: null, ); @override - _i23.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>> parseTransaction( + _i23.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>> parseTransaction( Map? txData, dynamic electrumxClient, - List<_i16.Address>? myAddresses, + List<_i17.Address>? myAddresses, _i22.Coin? coin, int? minConfirms, String? walletId, @@ -1488,8 +1488,8 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { ], ), returnValue: - _i23.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>>.value( - _FakeTuple2_13<_i16.Transaction, _i16.Address>( + _i23.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>>.value( + _FakeTuple2_13<_i17.Transaction, _i17.Address>( this, Invocation.method( #parseTransaction, @@ -1503,7 +1503,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { ], ), )), - ) as _i23.Future<_i15.Tuple2<_i16.Transaction, _i16.Address>>); + ) as _i23.Future<_i15.Tuple2<_i17.Transaction, _i17.Address>>); @override void initPaynymWalletInterface({ required String? walletId, @@ -1513,6 +1513,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { required _i12.MainDB? db, required _i9.ElectrumX? electrumXClient, required _i19.SecureStorageInterface? secureStorage, + required int? dustLimit, required int? dustLimitP2PKH, required int? minConfirms, required _i23.Future Function()? getMnemonicString, @@ -1531,7 +1532,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { })? prepareSend, required _i23.Future Function({required String address})? getTxCount, - required _i23.Future> Function(List<_i16.UTXO>)? + required _i23.Future> Function(List<_i17.UTXO>)? fetchBuildTxData, required _i23.Future Function()? refresh, required _i23.Future Function()? checkChangeAddressForTransactions, @@ -1548,6 +1549,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { #db: db, #electrumXClient: electrumXClient, #secureStorage: secureStorage, + #dustLimit: dustLimit, #dustLimitP2PKH: dustLimitP2PKH, #minConfirms: minConfirms, #getMnemonicString: getMnemonicString, @@ -1566,28 +1568,74 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValueForMissingStub: null, ); @override - _i23.Future<_i16.Address> currentReceivingPaynymAddress( - _i18.PaymentCode? sender) => + _i23.Future<_i16.BIP32> getBip47BaseNode() => (super.noSuchMethod( + Invocation.method( + #getBip47BaseNode, + [], + ), + returnValue: _i23.Future<_i16.BIP32>.value(_FakeBIP32_14( + this, + Invocation.method( + #getBip47BaseNode, + [], + ), + )), + ) as _i23.Future<_i16.BIP32>); + @override + _i23.Future<_i29.Uint8List> getPrivateKeyForPaynymReceivingAddress({ + required String? paymentCodeString, + required int? index, + }) => + (super.noSuchMethod( + Invocation.method( + #getPrivateKeyForPaynymReceivingAddress, + [], + { + #paymentCodeString: paymentCodeString, + #index: index, + }, + ), + returnValue: _i23.Future<_i29.Uint8List>.value(_i29.Uint8List(0)), + ) as _i23.Future<_i29.Uint8List>); + @override + _i23.Future<_i17.Address> currentReceivingPaynymAddress({ + required _i18.PaymentCode? sender, + required bool? isSegwit, + }) => (super.noSuchMethod( Invocation.method( #currentReceivingPaynymAddress, - [sender], + [], + { + #sender: sender, + #isSegwit: isSegwit, + }, ), - returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14( + returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15( this, Invocation.method( #currentReceivingPaynymAddress, - [sender], + [], + { + #sender: sender, + #isSegwit: isSegwit, + }, ), )), - ) as _i23.Future<_i16.Address>); + ) as _i23.Future<_i17.Address>); @override - _i23.Future checkCurrentPaynymReceivingAddressForTransactions( - _i18.PaymentCode? sender) => + _i23.Future checkCurrentPaynymReceivingAddressForTransactions({ + required _i18.PaymentCode? sender, + required bool? isSegwit, + }) => (super.noSuchMethod( Invocation.method( #checkCurrentPaynymReceivingAddressForTransactions, - [sender], + [], + { + #sender: sender, + #isSegwit: isSegwit, + }, ), returnValue: _i23.Future.value(), returnValueForMissingStub: _i23.Future.value(), @@ -1603,81 +1651,33 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override - _i23.Future<_i17.BIP32> deriveNotificationBip32Node({ - required String? mnemonic, - required String? mnemonicPassphrase, - }) => - (super.noSuchMethod( + _i23.Future<_i16.BIP32> deriveNotificationBip32Node() => (super.noSuchMethod( Invocation.method( #deriveNotificationBip32Node, [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - }, ), - returnValue: _i23.Future<_i17.BIP32>.value(_FakeBIP32_15( + returnValue: _i23.Future<_i16.BIP32>.value(_FakeBIP32_14( this, Invocation.method( #deriveNotificationBip32Node, [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - }, ), )), - ) as _i23.Future<_i17.BIP32>); + ) as _i23.Future<_i16.BIP32>); @override - _i23.Future<_i17.BIP32> deriveReceivingPrivateKeyNode({ - required String? mnemonic, - required String? mnemonicPassphrase, - required int? index, - }) => - (super.noSuchMethod( - Invocation.method( - #deriveReceivingPrivateKeyNode, - [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - #index: index, - }, - ), - returnValue: _i23.Future<_i17.BIP32>.value(_FakeBIP32_15( - this, - Invocation.method( - #deriveReceivingPrivateKeyNode, - [], - { - #mnemonic: mnemonic, - #mnemonicPassphrase: mnemonicPassphrase, - #index: index, - }, - ), - )), - ) as _i23.Future<_i17.BIP32>); - @override - _i23.Future<_i18.PaymentCode> getPaymentCode( - _i27.DerivePathType? derivePathType, [ - _i17.BIP32? bip32Root, - ]) => + _i23.Future<_i18.PaymentCode> getPaymentCode({required bool? isSegwit}) => (super.noSuchMethod( Invocation.method( #getPaymentCode, - [ - derivePathType, - bip32Root, - ], + [], + {#isSegwit: isSegwit}, ), returnValue: _i23.Future<_i18.PaymentCode>.value(_FakePaymentCode_16( this, Invocation.method( #getPaymentCode, - [ - derivePathType, - bip32Root, - ], + [], + {#isSegwit: isSegwit}, ), )), ) as _i23.Future<_i18.PaymentCode>); @@ -1702,6 +1702,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { @override _i23.Future> preparePaymentCodeSend({ required _i18.PaymentCode? paymentCode, + required bool? isSegwit, required _i14.Amount? amount, Map? args, }) => @@ -1711,6 +1712,7 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { [], { #paymentCode: paymentCode, + #isSegwit: isSegwit, #amount: amount, #args: args, }, @@ -1719,9 +1721,10 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { _i23.Future>.value({}), ) as _i23.Future>); @override - _i23.Future<_i16.Address> nextUnusedSendAddressFrom({ + _i23.Future<_i17.Address> nextUnusedSendAddressFrom({ required _i18.PaymentCode? pCode, - required _i17.BIP32? privateKeyNode, + required bool? isSegwit, + required _i16.BIP32? privateKeyNode, int? startIndex = 0, }) => (super.noSuchMethod( @@ -1730,29 +1733,31 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { [], { #pCode: pCode, + #isSegwit: isSegwit, #privateKeyNode: privateKeyNode, #startIndex: startIndex, }, ), - returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14( + returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15( this, Invocation.method( #nextUnusedSendAddressFrom, [], { #pCode: pCode, + #isSegwit: isSegwit, #privateKeyNode: privateKeyNode, #startIndex: startIndex, }, ), )), - ) as _i23.Future<_i16.Address>); + ) as _i23.Future<_i17.Address>); @override _i23.Future> prepareNotificationTx({ required int? selectedTxFeeRate, required String? targetPaymentCodeString, int? additionalOutputs = 0, - List<_i16.UTXO>? utxos, + List<_i17.UTXO>? utxos, }) => (super.noSuchMethod( Invocation.method( @@ -1789,34 +1794,24 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValue: _i23.Future.value(false), ) as _i23.Future); @override - _i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransaction({ - required _i16.Transaction? transaction, - required _i16.Address? myNotificationAddress, - }) => + _i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransaction( + {required _i17.Transaction? transaction}) => (super.noSuchMethod( Invocation.method( #unBlindedPaymentCodeFromTransaction, [], - { - #transaction: transaction, - #myNotificationAddress: myNotificationAddress, - }, + {#transaction: transaction}, ), returnValue: _i23.Future<_i18.PaymentCode?>.value(), ) as _i23.Future<_i18.PaymentCode?>); @override - _i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransactionBad({ - required _i16.Transaction? transaction, - required _i16.Address? myNotificationAddress, - }) => + _i23.Future<_i18.PaymentCode?> unBlindedPaymentCodeFromTransactionBad( + {required _i17.Transaction? transaction}) => (super.noSuchMethod( Invocation.method( #unBlindedPaymentCodeFromTransactionBad, [], - { - #transaction: transaction, - #myNotificationAddress: myNotificationAddress, - }, + {#transaction: transaction}, ), returnValue: _i23.Future<_i18.PaymentCode?>.value(), ) as _i23.Future<_i18.PaymentCode?>); @@ -1861,111 +1856,40 @@ class MockBitcoinWallet extends _i1.Mock implements _i26.BitcoinWallet { returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override - _i23.Future restoreHistoryWith( - _i18.PaymentCode? other, - int? maxUnusedAddressGap, - int? maxNumberOfIndexesToCheck, - ) => + _i23.Future restoreHistoryWith({ + required _i18.PaymentCode? other, + required bool? checkSegwitAsWell, + required int? maxUnusedAddressGap, + required int? maxNumberOfIndexesToCheck, + }) => (super.noSuchMethod( Invocation.method( #restoreHistoryWith, - [ - other, - maxUnusedAddressGap, - maxNumberOfIndexesToCheck, - ], + [], + { + #other: other, + #checkSegwitAsWell: checkSegwitAsWell, + #maxUnusedAddressGap: maxUnusedAddressGap, + #maxNumberOfIndexesToCheck: maxNumberOfIndexesToCheck, + }, ), returnValue: _i23.Future.value(), returnValueForMissingStub: _i23.Future.value(), ) as _i23.Future); @override - _i23.Future<_i16.Address> generatePaynymSendAddressFromKeyPair({ - required _i13.ECPair? pair, - required int? derivationIndex, - required _i27.DerivePathType? derivePathType, - required _i18.PaymentCode? toPaymentCode, - }) => - (super.noSuchMethod( - Invocation.method( - #generatePaynymSendAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #toPaymentCode: toPaymentCode, - }, - ), - returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14( - this, - Invocation.method( - #generatePaynymSendAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #toPaymentCode: toPaymentCode, - }, - ), - )), - ) as _i23.Future<_i16.Address>); - @override - _i23.Future<_i16.Address> generatePaynymReceivingAddressFromKeyPair({ - required _i13.ECPair? pair, - required int? derivationIndex, - required _i27.DerivePathType? derivePathType, - required _i18.PaymentCode? fromPaymentCode, - }) => - (super.noSuchMethod( - Invocation.method( - #generatePaynymReceivingAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #fromPaymentCode: fromPaymentCode, - }, - ), - returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14( - this, - Invocation.method( - #generatePaynymReceivingAddressFromKeyPair, - [], - { - #pair: pair, - #derivationIndex: derivationIndex, - #derivePathType: derivePathType, - #fromPaymentCode: fromPaymentCode, - }, - ), - )), - ) as _i23.Future<_i16.Address>); - @override - _i23.Future<_i16.Address> getMyNotificationAddress( - _i27.DerivePathType? derivePathType, [ - _i17.BIP32? bip32Root, - ]) => - (super.noSuchMethod( + _i23.Future<_i17.Address> getMyNotificationAddress() => (super.noSuchMethod( Invocation.method( #getMyNotificationAddress, - [ - derivePathType, - bip32Root, - ], + [], ), - returnValue: _i23.Future<_i16.Address>.value(_FakeAddress_14( + returnValue: _i23.Future<_i17.Address>.value(_FakeAddress_15( this, Invocation.method( #getMyNotificationAddress, - [ - derivePathType, - bip32Root, - ], + [], ), )), - ) as _i23.Future<_i16.Address>); + ) as _i23.Future<_i17.Address>); @override _i23.Future> lookupKey(String? paymentCodeString) => (super.noSuchMethod( @@ -2323,16 +2247,16 @@ class MockManager extends _i1.Mock implements _i6.Manager { ), ) as _i11.Balance); @override - _i23.Future> get transactions => (super.noSuchMethod( + _i23.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), returnValue: - _i23.Future>.value(<_i16.Transaction>[]), - ) as _i23.Future>); + _i23.Future>.value(<_i17.Transaction>[]), + ) as _i23.Future>); @override - _i23.Future> get utxos => (super.noSuchMethod( + _i23.Future> get utxos => (super.noSuchMethod( Invocation.getter(#utxos), - returnValue: _i23.Future>.value(<_i16.UTXO>[]), - ) as _i23.Future>); + returnValue: _i23.Future>.value(<_i17.UTXO>[]), + ) as _i23.Future>); @override set walletName(String? newName) => super.noSuchMethod( Invocation.setter( @@ -2691,16 +2615,16 @@ class MockCoinServiceAPI extends _i1.Mock implements _i20.CoinServiceAPI { ), ) as _i11.Balance); @override - _i23.Future> get transactions => (super.noSuchMethod( + _i23.Future> get transactions => (super.noSuchMethod( Invocation.getter(#transactions), returnValue: - _i23.Future>.value(<_i16.Transaction>[]), - ) as _i23.Future>); + _i23.Future>.value(<_i17.Transaction>[]), + ) as _i23.Future>); @override - _i23.Future> get utxos => (super.noSuchMethod( + _i23.Future> get utxos => (super.noSuchMethod( Invocation.getter(#utxos), - returnValue: _i23.Future>.value(<_i16.UTXO>[]), - ) as _i23.Future>); + returnValue: _i23.Future>.value(<_i17.UTXO>[]), + ) as _i23.Future>); @override set walletName(String? newName) => super.noSuchMethod( Invocation.setter(