From 4ab18dd77f524e90138b007abcf71441f0407129 Mon Sep 17 00:00:00 2001 From: Alfreedom <00tango.bromine@icloud.com> Date: Tue, 20 Aug 2024 23:12:12 +0200 Subject: [PATCH 01/22] Minor changes --- example/dapp/lib/pages/pairings_page.dart | 1 + example/dapp/lib/pages/sessions_page.dart | 2 +- example/dapp/lib/utils/constants.dart | 3 --- example/dapp/lib/utils/crypto/eip155.dart | 4 +-- example/dapp/web/index.html | 4 --- example/wallet/lib/pages/apps_page.dart | 7 ++++- example/wallet/lib/pages/settings_page.dart | 27 +++++++++++++++++++ .../lib/utils/namespace_model_builder.dart | 25 +---------------- .../wc_connection_request_widget.dart | 27 ++++++++++++++++--- .../lib/src/lifecycle_event_handler.dart | 1 - lib/apis/core/connectivity/connectivity.dart | 10 +++---- .../core/connectivity/i_connectivity.dart | 4 ++- lib/apis/core/crypto/crypto_models.dart | 1 + .../core/relay_auth/relay_auth_constants.dart | 6 ++--- .../utils/auth/auth_api_validators.dart | 8 +++--- .../sign_api/utils/auth/auth_constants.dart | 4 ++- .../sign_api/utils/auth/auth_signature.dart | 2 +- lib/apis/utils/extensions.dart | 12 ++++----- test/auth_api/validation_test.dart | 14 +++++----- 19 files changed, 93 insertions(+), 69 deletions(-) diff --git a/example/dapp/lib/pages/pairings_page.dart b/example/dapp/lib/pages/pairings_page.dart index eb5be822..0cd314ca 100644 --- a/example/dapp/lib/pages/pairings_page.dart +++ b/example/dapp/lib/pages/pairings_page.dart @@ -39,6 +39,7 @@ class PairingsPageState extends State { @override Widget build(BuildContext context) { + debugPrint('[$runtimeType] _pairings ${_pairings.length}'); final List pairingItems = _pairings .map( (PairingInfo pairing) => PairingItem( diff --git a/example/dapp/lib/pages/sessions_page.dart b/example/dapp/lib/pages/sessions_page.dart index eea88085..9f6305f0 100644 --- a/example/dapp/lib/pages/sessions_page.dart +++ b/example/dapp/lib/pages/sessions_page.dart @@ -41,7 +41,7 @@ class SessionsPageState extends State { @override Widget build(BuildContext context) { final List sessions = _activeSessions.values.toList(); - + debugPrint('[$runtimeType] sessions ${sessions.length}'); return Center( child: Container( constraints: const BoxConstraints( diff --git a/example/dapp/lib/utils/constants.dart b/example/dapp/lib/utils/constants.dart index 58db7a28..a17612da 100644 --- a/example/dapp/lib/utils/constants.dart +++ b/example/dapp/lib/utils/constants.dart @@ -2,9 +2,6 @@ import 'package:flutter/material.dart'; class Constants { static const smallScreen = 640; - - static const String aud = 'https://walletconnect.org/login'; - static const String domain = 'walletconnect.org'; } class StyleConstants { diff --git a/example/dapp/lib/utils/crypto/eip155.dart b/example/dapp/lib/utils/crypto/eip155.dart index 29b358c1..0b6b747a 100644 --- a/example/dapp/lib/utils/crypto/eip155.dart +++ b/example/dapp/lib/utils/crypto/eip155.dart @@ -1,6 +1,4 @@ import 'dart:convert'; -// ignore: depend_on_referenced_packages -import 'package:convert/convert.dart'; import 'package:walletconnect_flutter_v2_dapp/models/chain_metadata.dart'; import 'package:walletconnect_flutter_v2_dapp/utils/crypto/chain_data.dart'; @@ -156,7 +154,7 @@ class EIP155 { required String message, }) async { final bytes = utf8.encode(message); - final encoded = '0x${hex.encode(bytes)}'; + final encoded = bytesToHex(bytes); return await web3App.request( topic: topic, diff --git a/example/dapp/web/index.html b/example/dapp/web/index.html index 3bcca361..267bfd2d 100644 --- a/example/dapp/web/index.html +++ b/example/dapp/web/index.html @@ -38,10 +38,6 @@ - - - -