diff --git a/CHANGELOG.md b/CHANGELOG.md index 334b3567..98cac07d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 2.1.6 +## 2.1.7 - Minor changes. diff --git a/lib/apis/core/relay_client/relay_client.dart b/lib/apis/core/relay_client/relay_client.dart index 1a6886fd..b889ab88 100644 --- a/lib/apis/core/relay_client/relay_client.dart +++ b/lib/apis/core/relay_client/relay_client.dart @@ -360,7 +360,6 @@ class RelayClient implements IRelayClient { } void _heartbeatSubscription(EventArgs? args) async { - core.logger.i('RelayClient heartbeat received'); if (_relayIsClosed) { await _handleRelayClose(10002, null); } diff --git a/lib/apis/utils/constants.dart b/lib/apis/utils/constants.dart index de7a408e..c9eda45e 100644 --- a/lib/apis/utils/constants.dart +++ b/lib/apis/utils/constants.dart @@ -1,5 +1,5 @@ class WalletConnectConstants { - static const SDK_VERSION = '2.1.6'; + static const SDK_VERSION = '2.1.7'; static const CORE_PROTOCOL = 'wc'; static const CORE_VERSION = 2; diff --git a/lib/src/version.dart b/lib/src/version.dart index 88c2f9fb..f39844c3 100644 --- a/lib/src/version.dart +++ b/lib/src/version.dart @@ -1,2 +1,2 @@ // Generated code. Do not modify. -const packageVersion = '2.1.6'; +const packageVersion = '2.1.7'; diff --git a/pubspec.yaml b/pubspec.yaml index d6beb4dd..80c4aae2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: walletconnect_flutter_v2 description: This repository contains oficial implementation of WalletConnect v2 protocols for Flutter applications. The communications protocol for web3. -version: 2.1.6 +version: 2.1.7 repository: https://github.com/WalletConnect/WalletConnectFlutterV2 environment: diff --git a/test/auth_api/auth_client_test.dart b/test/auth_api/auth_client_test.dart index 345fe25e..c3752eaf 100644 --- a/test/auth_api/auth_client_test.dart +++ b/test/auth_api/auth_client_test.dart @@ -3,6 +3,7 @@ import 'dart:typed_data'; import 'package:eth_sig_util/eth_sig_util.dart'; import 'package:flutter_test/flutter_test.dart'; +import 'package:package_info_plus/package_info_plus.dart'; import 'package:walletconnect_flutter_v2/apis/auth_api/auth_engine.dart'; import 'package:walletconnect_flutter_v2/apis/auth_api/i_auth_engine_app.dart'; import 'package:walletconnect_flutter_v2/apis/auth_api/i_auth_engine_wallet.dart'; @@ -17,6 +18,13 @@ import 'utils/signature_constants.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); + PackageInfo.setMockInitialValues( + appName: 'walletconnect_flutter_v2', + packageName: 'sdk.test', + version: '1.0', + buildNumber: '2', + buildSignature: 'buildSignature', + ); final List Function(PairingMetadata)> authAppCreators = [ diff --git a/test/core_api/core_test.dart b/test/core_api/core_test.dart index 8a910e30..00f72721 100644 --- a/test/core_api/core_test.dart +++ b/test/core_api/core_test.dart @@ -1,5 +1,6 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; +import 'package:package_info_plus/package_info_plus.dart'; import 'package:walletconnect_flutter_v2/apis/core/relay_client/relay_client.dart'; import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart'; @@ -8,6 +9,13 @@ import '../shared/shared_test_utils.mocks.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); + PackageInfo.setMockInitialValues( + appName: 'walletconnect_flutter_v2', + packageName: 'sdk.test', + version: '1.0', + buildNumber: '2', + buildSignature: 'buildSignature', + ); group('Core throws errors', () { test('on start if there is no internet connection', () async { diff --git a/test/core_api/pairing_store_test.dart b/test/core_api/pairing_store_test.dart index 11275651..c0e615f7 100644 --- a/test/core_api/pairing_store_test.dart +++ b/test/core_api/pairing_store_test.dart @@ -1,4 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; +import 'package:package_info_plus/package_info_plus.dart'; import 'package:walletconnect_flutter_v2/apis/core/core.dart'; import 'package:walletconnect_flutter_v2/apis/core/i_core.dart'; import 'package:walletconnect_flutter_v2/apis/core/pairing/i_json_rpc_history.dart'; @@ -17,6 +18,13 @@ import '../shared/shared_test_values.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); + PackageInfo.setMockInitialValues( + appName: 'walletconnect_flutter_v2', + packageName: 'sdk.test', + version: '1.0', + buildNumber: '2', + buildSignature: 'buildSignature', + ); group('Pairing store', () { late ICore coreA; diff --git a/test/core_api/pairing_test.dart b/test/core_api/pairing_test.dart index a2beeda4..41322129 100644 --- a/test/core_api/pairing_test.dart +++ b/test/core_api/pairing_test.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'package:flutter_test/flutter_test.dart'; +import 'package:package_info_plus/package_info_plus.dart'; import 'package:walletconnect_flutter_v2/apis/core/core.dart'; import 'package:walletconnect_flutter_v2/apis/core/i_core.dart'; import 'package:walletconnect_flutter_v2/apis/core/pairing/utils/pairing_models.dart'; @@ -17,6 +18,13 @@ import '../shared/shared_test_values.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); + PackageInfo.setMockInitialValues( + appName: 'walletconnect_flutter_v2', + packageName: 'sdk.test', + version: '1.0', + buildNumber: '2', + buildSignature: 'buildSignature', + ); test('Format and parses URI correctly', () { Uri response = WalletConnectUtils.formatUri( diff --git a/test/core_api/relay_auth_test.dart b/test/core_api/relay_auth_test.dart index fa53db54..3812e30c 100644 --- a/test/core_api/relay_auth_test.dart +++ b/test/core_api/relay_auth_test.dart @@ -1,6 +1,7 @@ import 'dart:convert'; import 'dart:typed_data'; import 'package:flutter_test/flutter_test.dart'; +import 'package:package_info_plus/package_info_plus.dart'; import 'package:walletconnect_flutter_v2/apis/core/relay_auth/relay_auth.dart'; import 'package:walletconnect_flutter_v2/apis/core/relay_auth/relay_auth_models.dart'; @@ -8,6 +9,13 @@ import 'package:walletconnect_flutter_v2/apis/utils/constants.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); + PackageInfo.setMockInitialValues( + appName: 'walletconnect_flutter_v2', + packageName: 'sdk.test', + version: '1.0', + buildNumber: '2', + buildSignature: 'buildSignature', + ); group('Relay Auth/API', () { // Client will sign a unique identifier as the subject diff --git a/test/core_api/relay_client_test.dart b/test/core_api/relay_client_test.dart index 0a716095..31bf759f 100644 --- a/test/core_api/relay_client_test.dart +++ b/test/core_api/relay_client_test.dart @@ -3,6 +3,7 @@ import 'dart:async'; import 'package:flutter_test/flutter_test.dart'; import 'package:http/http.dart'; import 'package:mockito/mockito.dart'; +import 'package:package_info_plus/package_info_plus.dart'; import 'package:walletconnect_flutter_v2/apis/core/relay_client/relay_client.dart'; import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart'; @@ -12,6 +13,13 @@ import '../shared/shared_test_utils.mocks.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); + PackageInfo.setMockInitialValues( + appName: 'walletconnect_flutter_v2', + packageName: 'sdk.test', + version: '1.0', + buildNumber: '2', + buildSignature: 'buildSignature', + ); const TEST_TOPIC = 'abc123'; const TEST_MESSAGE = 'swagmasterss'; @@ -55,6 +63,10 @@ void main() { errorCounter++; expect(args!.error.message, 'No internet connection: test'); }); + // when(WalletConnectUtils.getPackageName()).thenAnswer( + // (_) async => 'test', + // ); + // when(core.relayClient.subscribeToHeartbeat()).thenThrow(Exception()); await core.storage.init(); await core.crypto.init(); await core.relayClient.init(); @@ -96,6 +108,11 @@ void main() { completer.complete(); }); + // when(WalletConnectUtils.getPackageName()).thenAnswer( + // (_) async => 'test', + // ); + // when(core.relayClient.subscribeToHeartbeat()).thenThrow(Exception()); + await core.start(); await completer.future; diff --git a/test/sign_api/sign_client_test.dart b/test/sign_api/sign_client_test.dart index b5e91692..652dadd6 100644 --- a/test/sign_api/sign_client_test.dart +++ b/test/sign_api/sign_client_test.dart @@ -1,5 +1,6 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:logger/logger.dart'; +import 'package:package_info_plus/package_info_plus.dart'; import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart'; import '../shared/shared_test_utils.dart'; @@ -9,6 +10,13 @@ import 'utils/sign_client_test_wrapper.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); + PackageInfo.setMockInitialValues( + appName: 'walletconnect_flutter_v2', + packageName: 'sdk.test', + version: '1.0', + buildNumber: '2', + buildSignature: 'buildSignature', + ); signEngineTests( context: 'SignClient', diff --git a/test/sign_api/sign_engine_test.dart b/test/sign_api/sign_engine_test.dart index b9f38e41..aee94147 100644 --- a/test/sign_api/sign_engine_test.dart +++ b/test/sign_api/sign_engine_test.dart @@ -1,4 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; +import 'package:package_info_plus/package_info_plus.dart'; import 'package:walletconnect_flutter_v2/apis/core/store/generic_store.dart'; import 'package:walletconnect_flutter_v2/apis/sign_api/sign_engine.dart'; import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart'; @@ -9,6 +10,13 @@ import 'tests/sign_common.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); + PackageInfo.setMockInitialValues( + appName: 'walletconnect_flutter_v2', + packageName: 'sdk.test', + version: '1.0', + buildNumber: '2', + buildSignature: 'buildSignature', + ); signEngineTests( context: 'SignEngine', diff --git a/test/sign_api/web3wallet_sign_test.dart b/test/sign_api/web3wallet_sign_test.dart index ca7f5128..8d1b70fc 100644 --- a/test/sign_api/web3wallet_sign_test.dart +++ b/test/sign_api/web3wallet_sign_test.dart @@ -1,4 +1,5 @@ import 'package:flutter_test/flutter_test.dart'; +import 'package:package_info_plus/package_info_plus.dart'; import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart'; import '../shared/shared_test_utils.dart'; @@ -7,6 +8,13 @@ import 'tests/sign_common.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); + PackageInfo.setMockInitialValues( + appName: 'walletconnect_flutter_v2', + packageName: 'sdk.test', + version: '1.0', + buildNumber: '2', + buildSignature: 'buildSignature', + ); signEngineTests( context: 'Web3App/Wallet', diff --git a/test/web3wallet/web3wallet_test.dart b/test/web3wallet/web3wallet_test.dart index ea5116c1..960be7eb 100644 --- a/test/web3wallet/web3wallet_test.dart +++ b/test/web3wallet/web3wallet_test.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'package:flutter_test/flutter_test.dart'; +import 'package:package_info_plus/package_info_plus.dart'; import 'package:walletconnect_flutter_v2/walletconnect_flutter_v2.dart'; import '../shared/shared_test_utils.dart'; @@ -9,6 +10,13 @@ import 'web3wallet_helpers.dart'; void main() { TestWidgetsFlutterBinding.ensureInitialized(); + PackageInfo.setMockInitialValues( + appName: 'walletconnect_flutter_v2', + packageName: 'sdk.test', + version: '1.0', + buildNumber: '2', + buildSignature: 'buildSignature', + ); final List Function(PairingMetadata)> appCreators = [ (PairingMetadata metadata) async => await Web3App.createInstance( projectId: TEST_PROJECT_ID,