diff --git a/packages/at_lookup/example/bin/example.dart b/packages/at_lookup/example/bin/example.dart index 20588436..69c3a3b6 100644 --- a/packages/at_lookup/example/bin/example.dart +++ b/packages/at_lookup/example/bin/example.dart @@ -18,7 +18,8 @@ void main() async { /// To update a key into secondary server //Build update verb builder var updateVerbBuilder = UpdateVerbBuilder() - ..atKey = (AtKey.shared('phone', sharedBy: '@alice')..sharedWith('@bob')).build() + ..atKey = + (AtKey.shared('phone', sharedBy: '@alice')..sharedWith('@bob')).build() ..value = '+1 889 886 7879'; // Sends update command to secondary server @@ -38,12 +39,14 @@ void main() async { /// To retrieve the value of key created by self. var lLookupVerbBuilder = LLookupVerbBuilder() - ..atKey = (AtKey.shared('phone', sharedBy: '@alice')..sharedWith('@bob')).build(); + ..atKey = + (AtKey.shared('phone', sharedBy: '@alice')..sharedWith('@bob')).build(); await atLookupImpl.executeVerb(lLookupVerbBuilder); ///To remove a key from secondary server var deleteVerbBuilder = DeleteVerbBuilder() - ..atKey = (AtKey.shared('phone', sharedBy: '@alice')..sharedWith('@bob')).build(); + ..atKey = + (AtKey.shared('phone', sharedBy: '@alice')..sharedWith('@bob')).build(); await atLookupImpl.executeVerb(deleteVerbBuilder, sync: true); /// To retrieve keys from the secondary server @@ -52,7 +55,8 @@ void main() async { ///To notify key to another atSign var notifyVerbBuilder = NotifyVerbBuilder() - ..atKey = (AtKey.shared('phone', sharedBy: '@alice')..sharedWith('@bob')).build(); + ..atKey = + (AtKey.shared('phone', sharedBy: '@alice')..sharedWith('@bob')).build(); await atLookupImpl.executeVerb(notifyVerbBuilder); ///To retrieve the notifications received diff --git a/packages/at_lookup/lib/src/at_lookup_impl.dart b/packages/at_lookup/lib/src/at_lookup_impl.dart index 52cbd9af..550c1801 100644 --- a/packages/at_lookup/lib/src/at_lookup_impl.dart +++ b/packages/at_lookup/lib/src/at_lookup_impl.dart @@ -297,7 +297,7 @@ class AtLookupImpl implements AtLookUp { verbResult = await _notifyRemove(builder); } else if (builder is NotifyFetchVerbBuilder) { verbResult = await _notifyFetch(builder); - } else if (builder is EnrollVerbBuilder){ + } else if (builder is EnrollVerbBuilder) { verbResult = await _enroll(builder); } } on Exception catch (e) { @@ -412,7 +412,7 @@ class AtLookupImpl implements AtLookUp { Future _enroll(EnrollVerbBuilder builder) async { var atCommand = builder.buildCommand(); - if(builder.operation == EnrollOperationEnum.request){ + if (builder.operation == EnrollOperationEnum.request) { return _process(atCommand, auth: false); } return await _process(atCommand, auth: true); diff --git a/packages/at_lookup/test/at_lookup_test.dart b/packages/at_lookup/test/at_lookup_test.dart index e16cc497..c248089f 100644 --- a/packages/at_lookup/test/at_lookup_test.dart +++ b/packages/at_lookup/test/at_lookup_test.dart @@ -320,7 +320,6 @@ void main() { secureSocketFactory: mockSocketFactory, socketListenerFactory: mockSecureSocketListenerFactory, outboundConnectionFactory: mockOutboundConnectionFactory); - atLookup.atChops = mockAtChops; String appName = 'unit_test_1'; String deviceName = 'test_device'; @@ -403,8 +402,7 @@ void main() { EnrollVerbBuilder enrollVerbBuilder = EnrollVerbBuilder() ..operation = EnrollOperationEnum.revoke ..enrollmentId = enrollmentId; - String enrollCommand = - 'enroll:revoke:{"enrollmentId":"$enrollmentId"}\n'; + String enrollCommand = 'enroll:revoke:{"enrollmentId":"$enrollmentId"}\n'; String enrollResponse = 'data:{"enrollmentId":"$enrollmentId","status":"revoked"}'; @@ -436,8 +434,7 @@ void main() { EnrollVerbBuilder enrollVerbBuilder = EnrollVerbBuilder() ..operation = EnrollOperationEnum.deny ..enrollmentId = enrollmentId; - String enrollCommand = - 'enroll:deny:{"enrollmentId":"$enrollmentId"}\n'; + String enrollCommand = 'enroll:deny:{"enrollmentId":"$enrollmentId"}\n'; String enrollResponse = 'data:{"enrollmentId":"$enrollmentId","status":"denied"}';