Skip to content

Commit

Permalink
fix bug for polygon Id test
Browse files Browse the repository at this point in the history
  • Loading branch information
bibash28 committed Jun 3, 2024
1 parent 7c99007 commit cbe4d87
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions packages/polygonid/lib/src/polygonid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,12 @@ import 'package:web3dart/web3dart.dart';
/// A Very Good Project created by Very Good CLI.
/// {@endtemplate}
class PolygonId {
/// {@macro polygonid}
factory PolygonId({PolygonIdSdk? polygonIdSdk}) {
_instance.polygonIdSdk = polygonIdSdk ?? PolygonIdSdk.I;
return _instance;
}
PolygonId({this.sdk});

PolygonId._internal();
final PolygonIdSdk? sdk;

late PolygonIdSdk polygonIdSdk;

static final PolygonId _instance = PolygonId._internal();

/// blockchain
static const blockchain = 'polygon';

Expand Down Expand Up @@ -63,6 +57,8 @@ class PolygonId {
ipfsUrl: ipfsUrl,
),
);

polygonIdSdk = sdk ?? PolygonIdSdk.I;
isInitialized = true;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/polygonid/test/src/polygonid_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class MockPolygonIdSdk extends Mock implements PolygonIdSdk {}

void main() {
final MockPolygonIdSdk polygonIdSdk = MockPolygonIdSdk();
final PolygonId polygonId = PolygonId(polygonIdSdk: polygonIdSdk);
final PolygonId polygonId = PolygonId(sdk: polygonIdSdk);

final proof = MockProof();
final identity = MockIdentity();
Expand Down

0 comments on commit cbe4d87

Please sign in to comment.