Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
pfeairheller committed Jan 18, 2024
1 parent 6982001 commit 6aa421a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 28 deletions.
19 changes: 8 additions & 11 deletions examples/integration-scripts/singlesig-dip.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,22 @@ describe('singlesig-dip', () => {
let delegate1 = await client2.identifiers().get('delegate1');
expect(op.name).toEqual(`delegation.${delegate1.prefix}`);


delegate1 = await client2.identifiers().get('delegate1');
let seal = {
i: delegate1.prefix,
s: '0',
d: delegate1.prefix,
};
result = await client1.identifiers().interact('name1', seal);
let op1 = await result.op()
let op1 = await result.op();

let op2 = await client2.keyStates().query(name1_id, '1');

await Promise.all([
op = await waitOperation(client2, op),
(op = await waitOperation(client2, op)),
waitOperation(client1, op1),
waitOperation(client2, op2)
])
waitOperation(client2, op2),
]);

delegate1 = await client2.identifiers().get('delegate1');
expect(delegate1.prefix).toEqual(op.response.i);
Expand All @@ -65,7 +64,6 @@ describe('singlesig-dip', () => {
let delegate2 = await client2.identifiers().get('delegate2');
expect(op.name).toEqual(`delegation.${delegate2.prefix}`);


// delegator approves delegate
delegate2 = await client2.identifiers().get('delegate2');
seal = {
Expand All @@ -74,19 +72,18 @@ describe('singlesig-dip', () => {
d: delegate2.prefix,
};
result = await client1.identifiers().interact('name1', seal);
op1 = await result.op()
op1 = await result.op();

op2 = await client2.keyStates().query(name1_id, '2');

await Promise.all([
op = await waitOperation(client2, op),
(op = await waitOperation(client2, op)),
waitOperation(client1, op1),
waitOperation(client2, op2)
])
waitOperation(client2, op2),
]);

// delegate waits for completion
delegate2 = await client2.identifiers().get('delegate2');
expect(delegate2.prefix).toEqual(op.response.i);

});
});
22 changes: 8 additions & 14 deletions examples/integration-scripts/singlesig-drt.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import {
CreateIdentiferArgs,
SignifyClient,
} from 'signify-ts';
import { CreateIdentiferArgs, SignifyClient } from 'signify-ts';
import {
getOrCreateClients,
getOrCreateContact,
getOrCreateIdentifier,
} from './utils/test-setup';
import {waitOperation} from './utils/test-util';
import { waitOperation } from './utils/test-util';

let delegator: SignifyClient, delegate: SignifyClient;
let name1_id: string, name1_oobi: string;
Expand Down Expand Up @@ -45,12 +42,11 @@ describe('singlesig-drt', () => {

let op2 = await delegate.keyStates().query(name1_id, '1');


await Promise.all([
waitOperation(delegate, op),
waitOperation(delegator, op1),
waitOperation(delegate, op2)
])
waitOperation(delegate, op2),
]);

kargs = {};
result = await delegate.identifiers().rotate('delegate1', kargs);
Expand All @@ -71,14 +67,12 @@ describe('singlesig-drt', () => {
op2 = await delegate.keyStates().query(name1_id, '2');

await Promise.all([
op = await waitOperation(delegate, op),
(op = await waitOperation(delegate, op)),
waitOperation(delegator, op1),
waitOperation(delegate, op2)
])
waitOperation(delegate, op2),
]);

expect(op.response.t).toEqual(`drt`);
expect(op.response.s).toEqual(`1`);


});
});
});
2 changes: 1 addition & 1 deletion examples/integration-scripts/utils/test-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function waitOperation<T = any>(
throw new Error(`Operation ${op.name} not done`);
}

console.log("DONE", op.name)
console.log('DONE', op.name);
return op;
}, options);
}
Expand Down
4 changes: 2 additions & 2 deletions src/keri/app/aiding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { SignifyClient } from './clienting';
import { Tier } from '../core/salter';
import { Algos } from '../core/manager';
import { incept, interact, reply, rotate } from '../core/eventing';
import {b, Ilks, Serials, Versionage} from '../core/core';
import { b, Ilks, Serials, Versionage } from '../core/core';
import { Tholder } from '../core/tholder';
import { MtrDex } from '../core/matter';
import { Serder } from '../core/serder';
Expand Down Expand Up @@ -287,7 +287,7 @@ export class Identifier {

const hab = await this.get(name);
const pre = hab.prefix;
const delegated = hab.state.di !== ''
const delegated = hab.state.di !== '';

const state = hab.state;
const count = state.k.length;
Expand Down

0 comments on commit 6aa421a

Please sign in to comment.