Skip to content

Commit

Permalink
chore: run dart formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
srieteja committed Sep 12, 2024
1 parent a293b1f commit 786e3c9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
12 changes: 8 additions & 4 deletions packages/at_lookup/example/bin/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions packages/at_lookup/lib/src/at_lookup_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -412,7 +412,7 @@ class AtLookupImpl implements AtLookUp {

Future<String> _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);
Expand Down
7 changes: 2 additions & 5 deletions packages/at_lookup/test/at_lookup_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ void main() {
secureSocketFactory: mockSocketFactory,
socketListenerFactory: mockSecureSocketListenerFactory,
outboundConnectionFactory: mockOutboundConnectionFactory);
atLookup.atChops = mockAtChops;

String appName = 'unit_test_1';
String deviceName = 'test_device';
Expand Down Expand Up @@ -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"}';

Expand Down Expand Up @@ -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"}';

Expand Down

0 comments on commit 786e3c9

Please sign in to comment.