diff --git a/examples/integration-scripts/singlesig-dip.test.ts b/examples/integration-scripts/singlesig-dip.test.ts index 626b494d..857f1e99 100644 --- a/examples/integration-scripts/singlesig-dip.test.ts +++ b/examples/integration-scripts/singlesig-dip.test.ts @@ -41,6 +41,7 @@ describe('singlesig-dip', () => { result = await client1.identifiers().interact('name1', seal); let op1 = await result.op(); + // refresh keystate to sn=1 let op2 = await client2.keyStates().query(name1_id, '1'); await Promise.all([ @@ -74,7 +75,8 @@ describe('singlesig-dip', () => { result = await client1.identifiers().interact('name1', seal); op1 = await result.op(); - op2 = await client2.keyStates().query(name1_id, '2'); + // refresh keystate to seal event + op2 = await client2.keyStates().query(name1_id, undefined, seal); await Promise.all([ (op = await waitOperation(client2, op)), @@ -85,5 +87,9 @@ describe('singlesig-dip', () => { // delegate waits for completion delegate2 = await client2.identifiers().get('delegate2'); expect(delegate2.prefix).toEqual(op.response.i); + + // make sure query with seal is idempotent + op = await client2.keyStates().query(name1_id, undefined, seal); + await waitOperation(client2, op); }); }); diff --git a/src/keri/app/coring.ts b/src/keri/app/coring.ts index f96901ef..3cfce93e 100644 --- a/src/keri/app/coring.ts +++ b/src/keri/app/coring.ts @@ -166,14 +166,14 @@ export class KeyStates { } /** - * Query the key state of an identifier for a given sequence number or anchor SAID + * Query the key state of an identifier for a given sequence number or anchor * @async * @param {string} pre Identifier prefix * @param {number} [sn] Optional sequence number - * @param {string} [anchor] Optional anchor SAID + * @param {any} [anchor] Optional anchor * @returns {Promise} A promise to the long-running operation */ - async query(pre: string, sn?: string, anchor?: string): Promise { + async query(pre: string, sn?: string, anchor?: any): Promise { const path = `/queries`; const data: any = { pre: pre,