Skip to content

Commit

Permalink
Merge pull request #210 from WalletConnect/v2.1.7
Browse files Browse the repository at this point in the history
v2.1.7
  • Loading branch information
quetool authored Oct 26, 2023
2 parents f716e30 + db1598f commit fa11677
Show file tree
Hide file tree
Showing 15 changed files with 93 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## 2.1.6
## 2.1.7

- Minor changes.

Expand Down
1 change: 0 additions & 1 deletion lib/apis/core/relay_client/relay_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/apis/utils/constants.dart
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/version.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
8 changes: 8 additions & 0 deletions test/auth_api/auth_client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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<Future<IAuthEngineApp> Function(PairingMetadata)> authAppCreators =
[
Expand Down
8 changes: 8 additions & 0 deletions test/core_api/core_test.dart
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -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 {
Expand Down
8 changes: 8 additions & 0 deletions test/core_api/pairing_store_test.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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;
Expand Down
8 changes: 8 additions & 0 deletions test/core_api/pairing_test.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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(
Expand Down
8 changes: 8 additions & 0 deletions test/core_api/relay_auth_test.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
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';
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
Expand Down
17 changes: 17 additions & 0 deletions test/core_api/relay_client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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';
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 8 additions & 0 deletions test/sign_api/sign_client_test.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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',
Expand Down
8 changes: 8 additions & 0 deletions test/sign_api/sign_engine_test.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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',
Expand Down
8 changes: 8 additions & 0 deletions test/sign_api/web3wallet_sign_test.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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',
Expand Down
8 changes: 8 additions & 0 deletions test/web3wallet/web3wallet_test.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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<Future<IWeb3App> Function(PairingMetadata)> appCreators = [
(PairingMetadata metadata) async => await Web3App.createInstance(
projectId: TEST_PROJECT_ID,
Expand Down

0 comments on commit fa11677

Please sign in to comment.