Skip to content

Commit

Permalink
Merge pull request #211 from WalletConnect/v2.1.8
Browse files Browse the repository at this point in the history
v2.1.8
  • Loading branch information
quetool committed Oct 26, 2023
2 parents fa11677 + caedd60 commit ef200e9
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 40 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.7
## 2.1.8

- Minor changes.

Expand Down
11 changes: 11 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,17 @@

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2023 Eucalyptus Labs, Inc.
Copyright 2023 Sterling Long
Copyright 2023 WalletConnect, Inc.
Expand Down
3 changes: 3 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ linter:
non_constant_identifier_names: false

analyzer:
exclude:
- "**/*.g.dart"
- "**/*.freezed.dart"
errors:
invalid_annotation_target: ignore

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.7';
static const SDK_VERSION = '2.1.8';

static const CORE_PROTOCOL = 'wc';
static const CORE_VERSION = 2;
Expand Down
19 changes: 19 additions & 0 deletions lib/apis/utils/namespace_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,25 @@ class NamespaceUtils {
return methods;
}

/// Gets the optional methods from a namespace map for the given chain
static List<String> getOptionalMethodsForChainId({
required String chainId,
required Map<String, RequiredNamespace> optionalNamespaces,
}) {
List<String> methods = [];
optionalNamespaces.forEach((String nsOrChain, RequiredNamespace rns) {
if (nsOrChain == chainId) {
methods.addAll(rns.methods);
} else {
if ((rns.chains ?? []).contains('$nsOrChain:$chainId')) {
methods.addAll(rns.methods);
}
}
});

return methods;
}

/// Gets the methods from a namespace map for the given chain id
static List<String> getNamespacesEventsForChain({
required String chainId,
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.7
version: 2.1.8
repository: https://github.com/WalletConnect/WalletConnectFlutterV2

environment:
Expand Down
36 changes: 0 additions & 36 deletions test/core_api/relay_client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ void main() {
group('Relay throws errors', () {
test('on init if there is no internet connection', () async {
final MockWebSocketHandler mockWebSocketHandler = MockWebSocketHandler();
// when(mockWebSocketHandler.setup(url: anyNamed('url'))).thenAnswer(
// (_) async => Future.value(),
// );
when(mockWebSocketHandler.connect()).thenThrow(const WalletConnectError(
code: -1,
message: 'No internet connection: test',
Expand All @@ -63,16 +60,9 @@ 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();
// try {} on WalletConnectError catch (e) {
// expect(e.message, 'No internet connection: test');
// }

verify(mockWebSocketHandler.setup(
url: argThat(
Expand Down Expand Up @@ -108,37 +98,11 @@ void main() {
completer.complete();
});

// when(WalletConnectUtils.getPackageName()).thenAnswer(
// (_) async => 'test',
// );
// when(core.relayClient.subscribeToHeartbeat()).thenThrow(Exception());

await core.start();

await completer.future;

core.relayClient.onRelayClientError.unsubscribeAll();

// expect(
// () async => await core.start(),
// throwsA(
// isA<WalletConnectError>().having(
// (e) => e.message,
// 'Invalid project id',
// 'WebSocket connection failed, this could be: 1. Missing project id, 2. Invalid project id, 3. Too many requests',
// ),
// ),
// );
// expect(
// () async => await core.start(),
// throwsA(
// isA<HttpException>().having(
// (e) => e.message,
// 'Invalid project id',
// WebSocketErrors.PROJECT_ID_NOT_FOUND_MESSAGE,
// ),
// ),
// );
});
});

Expand Down

0 comments on commit ef200e9

Please sign in to comment.