diff --git a/CHANGELOG.md b/CHANGELOG.md index bdcdb26f..271e405e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.16 + +- Updated error logs to be more descriptive + ## 2.0.15 - Added 1002 and 1005 to relay auto-reconnect diff --git a/lib/apis/sign_api/sign_engine.dart b/lib/apis/sign_api/sign_engine.dart index 7f62554f..49e5e92f 100644 --- a/lib/apis/sign_api/sign_engine.dart +++ b/lib/apis/sign_api/sign_engine.dart @@ -277,10 +277,6 @@ class SignEngine implements ISignEngine { relayProtocol ?? 'irn', ); - final int expiry = WalletConnectUtils.calculateExpiry( - WalletConnectConstants.SEVEN_DAYS, - ); - // Respond to the proposal await core.pairing.sendResult( id, @@ -303,6 +299,10 @@ class SignEngine implements ISignEngine { await core.relayClient.subscribe(topic: sessionTopic); + final int expiry = WalletConnectUtils.calculateExpiry( + WalletConnectConstants.SEVEN_DAYS, + ); + SessionData session = SessionData( topic: sessionTopic, pairingTopic: proposal.pairingTopic, diff --git a/lib/apis/sign_api/utils/sign_api_validator_utils.dart b/lib/apis/sign_api/utils/sign_api_validator_utils.dart index 6641aa02..c587e784 100644 --- a/lib/apis/sign_api/utils/sign_api_validator_utils.dart +++ b/lib/apis/sign_api/utils/sign_api_validator_utils.dart @@ -253,19 +253,19 @@ class SignApiValidatorUtils { throw Errors.getSdkError( Errors.UNSUPPORTED_CHAINS, context: - "$context namespaces chains don't satisfy requiredNamespaces chains for $key", + "$context namespaces chains don't satisfy requiredNamespaces chains for $key. Requested: $requiredNamespaceChains, Supported: $namespaceChains", ); } else if (!methodsOverlap) { throw Errors.getSdkError( Errors.UNSUPPORTED_METHODS, context: - "$context namespaces methods don't satisfy requiredNamespaces methods for $key", + "$context namespaces methods don't satisfy requiredNamespaces methods for $key. Requested: ${requiredNamespaces[key]!.methods}, Supported: ${namespaces[key]!.methods}", ); } else if (!eventsOverlap) { throw Errors.getSdkError( Errors.UNSUPPORTED_EVENTS, context: - "$context namespaces events don't satisfy requiredNamespaces events for $key", + "$context namespaces events don't satisfy requiredNamespaces events for $key. Requested: ${requiredNamespaces[key]!.events}, Supported: ${namespaces[key]!.events}", ); } } diff --git a/pubspec.yaml b/pubspec.yaml index 96a42e5c..c72065c1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: walletconnect_flutter_v2 description: WalletConnect v2 client made in dart for flutter. -version: 2.0.15 +version: 2.0.16 repository: https://github.com/WalletConnect/WalletConnectFlutterV2 environment: diff --git a/test/shared/namespace_utils_test.dart b/test/shared/namespace_utils_test.dart index c9d46728..0fa7141e 100644 --- a/test/shared/namespace_utils_test.dart +++ b/test/shared/namespace_utils_test.dart @@ -439,27 +439,27 @@ void main() { Errors.getSdkError( Errors.UNSUPPORTED_CHAINS, context: - " namespaces chains don't satisfy requiredNamespaces chains for namespace3", + " namespaces chains don't satisfy requiredNamespaces chains for namespace3. Requested: [namespace3:chain1], Supported: []", ).message, Errors.getSdkError( Errors.UNSUPPORTED_METHODS, context: - " namespaces methods don't satisfy requiredNamespaces methods for namespace1:chain1", + " namespaces methods don't satisfy requiredNamespaces methods for namespace1:chain1. Requested: [method1, method2, method3], Supported: [method1, method2]", ).message, Errors.getSdkError( Errors.UNSUPPORTED_METHODS, context: - " namespaces methods don't satisfy requiredNamespaces methods for namespace2", + " namespaces methods don't satisfy requiredNamespaces methods for namespace2. Requested: [method3, method4], Supported: [method3]", ).message, Errors.getSdkError( Errors.UNSUPPORTED_EVENTS, context: - " namespaces events don't satisfy requiredNamespaces events for namespace1:chain1", + " namespaces events don't satisfy requiredNamespaces events for namespace1:chain1. Requested: [event1, event2, event3], Supported: [event1, event2]", ).message, Errors.getSdkError( Errors.UNSUPPORTED_EVENTS, context: - " namespaces events don't satisfy requiredNamespaces events for namespace2", + " namespaces events don't satisfy requiredNamespaces events for namespace2. Requested: [event3, event4], Supported: [event3]", ).message, ];