From e5d8dff6cd9a4d6116fdd9a2336b6f8725582081 Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 30 May 2024 15:17:50 -0600 Subject: [PATCH] add debug log level value to enum --- lib/db/sqlite/firo_cache.dart | 2 +- lib/models/isar/models/log.g.dart | 2 + lib/utilities/enums/log_level_enum.dart | 3 +- test/cached_electrumx_test.mocks.dart | 8 ++-- ...allet_settings_view_screen_test.mocks.dart | 32 --------------- .../bitcoin/bitcoin_wallet_test.mocks.dart | 40 ++----------------- .../bitcoincash_wallet_test.mocks.dart | 40 ++----------------- .../dogecoin/dogecoin_wallet_test.mocks.dart | 40 ++----------------- .../namecoin/namecoin_wallet_test.mocks.dart | 40 ++----------------- .../particl/particl_wallet_test.mocks.dart | 40 ++----------------- 10 files changed, 29 insertions(+), 218 deletions(-) diff --git a/lib/db/sqlite/firo_cache.dart b/lib/db/sqlite/firo_cache.dart index a6c2882a0..63595316a 100644 --- a/lib/db/sqlite/firo_cache.dart +++ b/lib/db/sqlite/firo_cache.dart @@ -15,7 +15,7 @@ void _debugLog(Object? object) { if (kDebugMode) { Logging.instance.log( object, - level: LogLevel.Fatal, + level: LogLevel.Debug, ); } } diff --git a/lib/models/isar/models/log.g.dart b/lib/models/isar/models/log.g.dart index 332e91d3c..8a4cf22b1 100644 --- a/lib/models/isar/models/log.g.dart +++ b/lib/models/isar/models/log.g.dart @@ -124,12 +124,14 @@ const _LoglogLevelEnumValueMap = { r'Warning': r'Warning', r'Error': r'Error', r'Fatal': r'Fatal', + r'Debug': r'Debug', }; const _LoglogLevelValueEnumMap = { r'Info': LogLevel.Info, r'Warning': LogLevel.Warning, r'Error': LogLevel.Error, r'Fatal': LogLevel.Fatal, + r'Debug': LogLevel.Debug, }; Id _logGetId(Log object) { diff --git a/lib/utilities/enums/log_level_enum.dart b/lib/utilities/enums/log_level_enum.dart index 6e5e14a8f..5fb7f9e52 100644 --- a/lib/utilities/enums/log_level_enum.dart +++ b/lib/utilities/enums/log_level_enum.dart @@ -14,5 +14,6 @@ enum LogLevel { Info, Warning, Error, - Fatal; + Fatal, + Debug; } diff --git a/test/cached_electrumx_test.mocks.dart b/test/cached_electrumx_test.mocks.dart index 5ae1523da..e8bdc2e53 100644 --- a/test/cached_electrumx_test.mocks.dart +++ b/test/cached_electrumx_test.mocks.dart @@ -428,21 +428,21 @@ class MockElectrumXClient extends _i1.Mock implements _i5.ElectrumXClient { _i7.Future>.value({}), ) as _i7.Future>); @override - _i7.Future> getSparkUsedCoinsTags({ + _i7.Future> getSparkUnhashedUsedCoinsTags({ String? requestID, required int? startNumber, }) => (super.noSuchMethod( Invocation.method( - #getSparkUsedCoinsTags, + #getSparkUnhashedUsedCoinsTags, [], { #requestID: requestID, #startNumber: startNumber, }, ), - returnValue: _i7.Future>.value({}), - ) as _i7.Future>); + returnValue: _i7.Future>.value([]), + ) as _i7.Future>); @override _i7.Future>> getSparkMintMetaData({ String? requestID, diff --git a/test/screen_tests/settings_view/settings_subviews/wallet_settings_view_screen_test.mocks.dart b/test/screen_tests/settings_view/settings_subviews/wallet_settings_view_screen_test.mocks.dart index 446894293..e4c45b863 100644 --- a/test/screen_tests/settings_view/settings_subviews/wallet_settings_view_screen_test.mocks.dart +++ b/test/screen_tests/settings_view/settings_subviews/wallet_settings_view_screen_test.mocks.dart @@ -78,27 +78,6 @@ class MockCachedElectrumXClient extends _i1.Mock _i4.Future>.value({}), ) as _i4.Future>); @override - _i4.Future> getSparkAnonymitySet({ - required String? groupId, - String? blockhash = r'', - required _i5.CryptoCurrency? cryptoCurrency, - required bool? useOnlyCacheIfNotEmpty, - }) => - (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySet, - [], - { - #groupId: groupId, - #blockhash: blockhash, - #cryptoCurrency: cryptoCurrency, - #useOnlyCacheIfNotEmpty: useOnlyCacheIfNotEmpty, - }, - ), - returnValue: - _i4.Future>.value({}), - ) as _i4.Future>); - @override String base64ToHex(String? source) => (super.noSuchMethod( Invocation.method( #base64ToHex, @@ -162,17 +141,6 @@ class MockCachedElectrumXClient extends _i1.Mock returnValue: _i4.Future>.value([]), ) as _i4.Future>); @override - _i4.Future> getSparkUsedCoinsTags( - {required _i5.CryptoCurrency? cryptoCurrency}) => - (super.noSuchMethod( - Invocation.method( - #getSparkUsedCoinsTags, - [], - {#cryptoCurrency: cryptoCurrency}, - ), - returnValue: _i4.Future>.value({}), - ) as _i4.Future>); - @override _i4.Future clearSharedTransactionCache( {required _i5.CryptoCurrency? cryptoCurrency}) => (super.noSuchMethod( diff --git a/test/services/coins/bitcoin/bitcoin_wallet_test.mocks.dart b/test/services/coins/bitcoin/bitcoin_wallet_test.mocks.dart index 776e6874b..af94be20b 100644 --- a/test/services/coins/bitcoin/bitcoin_wallet_test.mocks.dart +++ b/test/services/coins/bitcoin/bitcoin_wallet_test.mocks.dart @@ -425,21 +425,21 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { _i6.Future>.value({}), ) as _i6.Future>); @override - _i6.Future> getSparkUsedCoinsTags({ + _i6.Future> getSparkUnhashedUsedCoinsTags({ String? requestID, required int? startNumber, }) => (super.noSuchMethod( Invocation.method( - #getSparkUsedCoinsTags, + #getSparkUnhashedUsedCoinsTags, [], { #requestID: requestID, #startNumber: startNumber, }, ), - returnValue: _i6.Future>.value({}), - ) as _i6.Future>); + returnValue: _i6.Future>.value([]), + ) as _i6.Future>); @override _i6.Future>> getSparkMintMetaData({ String? requestID, @@ -559,27 +559,6 @@ class MockCachedElectrumXClient extends _i1.Mock _i6.Future>.value({}), ) as _i6.Future>); @override - _i6.Future> getSparkAnonymitySet({ - required String? groupId, - String? blockhash = r'', - required _i2.CryptoCurrency? cryptoCurrency, - required bool? useOnlyCacheIfNotEmpty, - }) => - (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySet, - [], - { - #groupId: groupId, - #blockhash: blockhash, - #cryptoCurrency: cryptoCurrency, - #useOnlyCacheIfNotEmpty: useOnlyCacheIfNotEmpty, - }, - ), - returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); - @override String base64ToHex(String? source) => (super.noSuchMethod( Invocation.method( #base64ToHex, @@ -643,17 +622,6 @@ class MockCachedElectrumXClient extends _i1.Mock returnValue: _i6.Future>.value([]), ) as _i6.Future>); @override - _i6.Future> getSparkUsedCoinsTags( - {required _i2.CryptoCurrency? cryptoCurrency}) => - (super.noSuchMethod( - Invocation.method( - #getSparkUsedCoinsTags, - [], - {#cryptoCurrency: cryptoCurrency}, - ), - returnValue: _i6.Future>.value({}), - ) as _i6.Future>); - @override _i6.Future clearSharedTransactionCache( {required _i2.CryptoCurrency? cryptoCurrency}) => (super.noSuchMethod( diff --git a/test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart b/test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart index a2238f324..85565e3cf 100644 --- a/test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart +++ b/test/services/coins/bitcoincash/bitcoincash_wallet_test.mocks.dart @@ -425,21 +425,21 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { _i6.Future>.value({}), ) as _i6.Future>); @override - _i6.Future> getSparkUsedCoinsTags({ + _i6.Future> getSparkUnhashedUsedCoinsTags({ String? requestID, required int? startNumber, }) => (super.noSuchMethod( Invocation.method( - #getSparkUsedCoinsTags, + #getSparkUnhashedUsedCoinsTags, [], { #requestID: requestID, #startNumber: startNumber, }, ), - returnValue: _i6.Future>.value({}), - ) as _i6.Future>); + returnValue: _i6.Future>.value([]), + ) as _i6.Future>); @override _i6.Future>> getSparkMintMetaData({ String? requestID, @@ -559,27 +559,6 @@ class MockCachedElectrumXClient extends _i1.Mock _i6.Future>.value({}), ) as _i6.Future>); @override - _i6.Future> getSparkAnonymitySet({ - required String? groupId, - String? blockhash = r'', - required _i2.CryptoCurrency? cryptoCurrency, - required bool? useOnlyCacheIfNotEmpty, - }) => - (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySet, - [], - { - #groupId: groupId, - #blockhash: blockhash, - #cryptoCurrency: cryptoCurrency, - #useOnlyCacheIfNotEmpty: useOnlyCacheIfNotEmpty, - }, - ), - returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); - @override String base64ToHex(String? source) => (super.noSuchMethod( Invocation.method( #base64ToHex, @@ -643,17 +622,6 @@ class MockCachedElectrumXClient extends _i1.Mock returnValue: _i6.Future>.value([]), ) as _i6.Future>); @override - _i6.Future> getSparkUsedCoinsTags( - {required _i2.CryptoCurrency? cryptoCurrency}) => - (super.noSuchMethod( - Invocation.method( - #getSparkUsedCoinsTags, - [], - {#cryptoCurrency: cryptoCurrency}, - ), - returnValue: _i6.Future>.value({}), - ) as _i6.Future>); - @override _i6.Future clearSharedTransactionCache( {required _i2.CryptoCurrency? cryptoCurrency}) => (super.noSuchMethod( diff --git a/test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart b/test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart index f80e8a840..03e117e4b 100644 --- a/test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart +++ b/test/services/coins/dogecoin/dogecoin_wallet_test.mocks.dart @@ -425,21 +425,21 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { _i6.Future>.value({}), ) as _i6.Future>); @override - _i6.Future> getSparkUsedCoinsTags({ + _i6.Future> getSparkUnhashedUsedCoinsTags({ String? requestID, required int? startNumber, }) => (super.noSuchMethod( Invocation.method( - #getSparkUsedCoinsTags, + #getSparkUnhashedUsedCoinsTags, [], { #requestID: requestID, #startNumber: startNumber, }, ), - returnValue: _i6.Future>.value({}), - ) as _i6.Future>); + returnValue: _i6.Future>.value([]), + ) as _i6.Future>); @override _i6.Future>> getSparkMintMetaData({ String? requestID, @@ -559,27 +559,6 @@ class MockCachedElectrumXClient extends _i1.Mock _i6.Future>.value({}), ) as _i6.Future>); @override - _i6.Future> getSparkAnonymitySet({ - required String? groupId, - String? blockhash = r'', - required _i2.CryptoCurrency? cryptoCurrency, - required bool? useOnlyCacheIfNotEmpty, - }) => - (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySet, - [], - { - #groupId: groupId, - #blockhash: blockhash, - #cryptoCurrency: cryptoCurrency, - #useOnlyCacheIfNotEmpty: useOnlyCacheIfNotEmpty, - }, - ), - returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); - @override String base64ToHex(String? source) => (super.noSuchMethod( Invocation.method( #base64ToHex, @@ -643,17 +622,6 @@ class MockCachedElectrumXClient extends _i1.Mock returnValue: _i6.Future>.value([]), ) as _i6.Future>); @override - _i6.Future> getSparkUsedCoinsTags( - {required _i2.CryptoCurrency? cryptoCurrency}) => - (super.noSuchMethod( - Invocation.method( - #getSparkUsedCoinsTags, - [], - {#cryptoCurrency: cryptoCurrency}, - ), - returnValue: _i6.Future>.value({}), - ) as _i6.Future>); - @override _i6.Future clearSharedTransactionCache( {required _i2.CryptoCurrency? cryptoCurrency}) => (super.noSuchMethod( diff --git a/test/services/coins/namecoin/namecoin_wallet_test.mocks.dart b/test/services/coins/namecoin/namecoin_wallet_test.mocks.dart index 9f13d167b..4e57a7657 100644 --- a/test/services/coins/namecoin/namecoin_wallet_test.mocks.dart +++ b/test/services/coins/namecoin/namecoin_wallet_test.mocks.dart @@ -425,21 +425,21 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { _i6.Future>.value({}), ) as _i6.Future>); @override - _i6.Future> getSparkUsedCoinsTags({ + _i6.Future> getSparkUnhashedUsedCoinsTags({ String? requestID, required int? startNumber, }) => (super.noSuchMethod( Invocation.method( - #getSparkUsedCoinsTags, + #getSparkUnhashedUsedCoinsTags, [], { #requestID: requestID, #startNumber: startNumber, }, ), - returnValue: _i6.Future>.value({}), - ) as _i6.Future>); + returnValue: _i6.Future>.value([]), + ) as _i6.Future>); @override _i6.Future>> getSparkMintMetaData({ String? requestID, @@ -559,27 +559,6 @@ class MockCachedElectrumXClient extends _i1.Mock _i6.Future>.value({}), ) as _i6.Future>); @override - _i6.Future> getSparkAnonymitySet({ - required String? groupId, - String? blockhash = r'', - required _i2.CryptoCurrency? cryptoCurrency, - required bool? useOnlyCacheIfNotEmpty, - }) => - (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySet, - [], - { - #groupId: groupId, - #blockhash: blockhash, - #cryptoCurrency: cryptoCurrency, - #useOnlyCacheIfNotEmpty: useOnlyCacheIfNotEmpty, - }, - ), - returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); - @override String base64ToHex(String? source) => (super.noSuchMethod( Invocation.method( #base64ToHex, @@ -643,17 +622,6 @@ class MockCachedElectrumXClient extends _i1.Mock returnValue: _i6.Future>.value([]), ) as _i6.Future>); @override - _i6.Future> getSparkUsedCoinsTags( - {required _i2.CryptoCurrency? cryptoCurrency}) => - (super.noSuchMethod( - Invocation.method( - #getSparkUsedCoinsTags, - [], - {#cryptoCurrency: cryptoCurrency}, - ), - returnValue: _i6.Future>.value({}), - ) as _i6.Future>); - @override _i6.Future clearSharedTransactionCache( {required _i2.CryptoCurrency? cryptoCurrency}) => (super.noSuchMethod( diff --git a/test/services/coins/particl/particl_wallet_test.mocks.dart b/test/services/coins/particl/particl_wallet_test.mocks.dart index 5c6f92792..9cb9db169 100644 --- a/test/services/coins/particl/particl_wallet_test.mocks.dart +++ b/test/services/coins/particl/particl_wallet_test.mocks.dart @@ -425,21 +425,21 @@ class MockElectrumXClient extends _i1.Mock implements _i4.ElectrumXClient { _i6.Future>.value({}), ) as _i6.Future>); @override - _i6.Future> getSparkUsedCoinsTags({ + _i6.Future> getSparkUnhashedUsedCoinsTags({ String? requestID, required int? startNumber, }) => (super.noSuchMethod( Invocation.method( - #getSparkUsedCoinsTags, + #getSparkUnhashedUsedCoinsTags, [], { #requestID: requestID, #startNumber: startNumber, }, ), - returnValue: _i6.Future>.value({}), - ) as _i6.Future>); + returnValue: _i6.Future>.value([]), + ) as _i6.Future>); @override _i6.Future>> getSparkMintMetaData({ String? requestID, @@ -559,27 +559,6 @@ class MockCachedElectrumXClient extends _i1.Mock _i6.Future>.value({}), ) as _i6.Future>); @override - _i6.Future> getSparkAnonymitySet({ - required String? groupId, - String? blockhash = r'', - required _i2.CryptoCurrency? cryptoCurrency, - required bool? useOnlyCacheIfNotEmpty, - }) => - (super.noSuchMethod( - Invocation.method( - #getSparkAnonymitySet, - [], - { - #groupId: groupId, - #blockhash: blockhash, - #cryptoCurrency: cryptoCurrency, - #useOnlyCacheIfNotEmpty: useOnlyCacheIfNotEmpty, - }, - ), - returnValue: - _i6.Future>.value({}), - ) as _i6.Future>); - @override String base64ToHex(String? source) => (super.noSuchMethod( Invocation.method( #base64ToHex, @@ -643,17 +622,6 @@ class MockCachedElectrumXClient extends _i1.Mock returnValue: _i6.Future>.value([]), ) as _i6.Future>); @override - _i6.Future> getSparkUsedCoinsTags( - {required _i2.CryptoCurrency? cryptoCurrency}) => - (super.noSuchMethod( - Invocation.method( - #getSparkUsedCoinsTags, - [], - {#cryptoCurrency: cryptoCurrency}, - ), - returnValue: _i6.Future>.value({}), - ) as _i6.Future>); - @override _i6.Future clearSharedTransactionCache( {required _i2.CryptoCurrency? cryptoCurrency}) => (super.noSuchMethod(