Skip to content

Commit 7ffc111

Browse files
author
Peter Anyaogu
committed
refactor(deps): update dependencies and improve error messages
update eip7579 dependency from local path to published version improve user operation error message to include OOG case remove unused web3dart import update README to reflect module package name change add warning log for webauthn validator usage
1 parent ccb6ccc commit 7ffc111

File tree

8 files changed

+11
-11
lines changed

8 files changed

+11
-11
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,11 @@ await wallet.send(
245245

246246
### Module Operations
247247

248-
> all modules can be installed from `variance_modules` package. simply run `flutter pub add variance_modules` to add the package to your project.
248+
> all modules can be installed from `eip7579` package. simply run `flutter pub add eip7579` to add the package to your project.
249249
> Additionally, you must already have an instance of the smart wallet.
250250

251251
```dart
252-
import 'package:variance_modules/modules.dart';
252+
import 'package:eip7579/modules.dart';
253253

254254
// required constructor parameters
255255
final threshold = BigInt.two;

example/lib/providers/module_provider.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ class ModuleProvider extends ChangeNotifier {
127127
} catch (e) {
128128
String errorMessage = parseUserOperationError(e);
129129

130+
Logger.warning(
131+
"Note: if using a webauthn validator, you should send a normal transaction first before attempting to install a module. This is because, the validator can only be used for validating user-op at this time. Module installation, as implemented in this example do not use the validator to validated the accompanying transaction.\n");
132+
130133
log('Failed to install module: ${e.toString()}');
131134
return (false, null, ModuleInstallationException(errorMessage, e));
132135
} finally {

example/lib/screens/home/home_widgets.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import 'package:qr_flutter/qr_flutter.dart';
88
import 'package:variancedemo/providers/wallet_provider.dart';
99
import 'package:variancedemo/variance_colors.dart';
1010
import 'package:web3_signers/web3_signers.dart';
11-
import 'package:web3dart/web3dart.dart';
1211

1312
import '../../utils/shorten_address.dart';
1413

example/lib/utils/exceptions.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ String parseUserOperationError(dynamic error) {
3535
case 'AA22':
3636
return 'UserOp expired';
3737
case 'AA23':
38-
return 'UserOp reverted';
38+
return 'UserOp reverted or (OOG)';
3939
case 'AA24':
4040
return 'UserOp signature check failed';
4141
case 'AA25':

example/pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ packages:
175175
path: "../../variance-modules"
176176
relative: true
177177
source: path
178-
version: "0.0.1"
178+
version: "1.0.0"
179179
fake_async:
180180
dependency: transitive
181181
description:
@@ -770,7 +770,7 @@ packages:
770770
path: ".."
771771
relative: true
772772
source: path
773-
version: "0.2.0"
773+
version: "0.2.1"
774774
vector_math:
775775
dependency: transitive
776776
description:

example/pubspec.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ dependencies:
2323
fluttertoast: ^8.2.4
2424
variance_dart:
2525
path: ../
26-
eip7579:
27-
path: ../../variance-modules
26+
eip7579: ^1.0.0
2827
web3_signers: ^0.2.1
2928
http: ^1.3.0
3029
flutter_dotenv: ^5.2.1

lib/src/interfaces/interfaces.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import 'package:flutter/foundation.dart';
1+
import 'dart:typed_data';
2+
23
import 'package:eip1559/eip1559.dart';
34
import 'package:web3_signers/web3_signers.dart'
45
show MSI, PassKeyPair, Uint256, Address;

lib/src/interfaces/smart_wallet.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ abstract class SmartWalletBase extends SmartContract {
116116
Chain get chain;
117117

118118
/// Retrieves the dummy signature required for gas estimation from the Smart Wallet.
119-
@protected
120119
String get dummySignature;
121120

122121
/// Returns the initialization code for deploying the Smart Wallet contract.
@@ -133,7 +132,6 @@ abstract class SmartWalletBase extends SmartContract {
133132
Future<bool> get isDeployed;
134133

135134
/// Returns the internal state of the wallet
136-
@protected
137135
SmartWalletState get state;
138136

139137
/// Builds a [UserOperation] instance with the specified parameters.

0 commit comments

Comments
 (0)