Skip to content

Commit

Permalink
p-929 Adding vcissued events listening for dr_vc test (#2925)
Browse files Browse the repository at this point in the history
* adding subscribeToEventsWithExtHash

* uncomment

* remove console

---------

Co-authored-by: Kai <[email protected]>
  • Loading branch information
0xverin and Kailai-Wang authored Jul 23, 2024
1 parent da4792b commit 761639b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tee-worker/ts-tests/integration-tests/dr_vc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import type { CorePrimitivesIdentity, WorkerRpcReturnValue } from 'parachain-api
import { mockBatchAssertion } from './common/utils/vc-helper';
import type { LitentryValidationData, Web3Network } from 'parachain-api';
import type { Vec, Bytes } from '@polkadot/types';
import { subscribeToEventsWithExtHash } from './common/transactions';
import { assert } from 'chai';

describe('Test Vc (direct request)', function () {
let context: IntegrationTestContext = undefined as any;
Expand Down Expand Up @@ -171,6 +173,7 @@ describe('Test Vc (direct request)', function () {
if (vcresponse.result.isOk) await assertVc(context, aliceSubstrateIdentity, vcresponse.result.asOk);
};

const eventsPromise = subscribeToEventsWithExtHash(requestIdentifier, context);
// the +res+ below is the last message with "do_watch: false" property and we may not need it at all
const res = await sendRequestFromTrustedCall(
context,
Expand All @@ -180,6 +183,9 @@ describe('Test Vc (direct request)', function () {
onMessageReceived
);

const events = (await eventsPromise).map(({ event }) => event);
assert.equal(events.length, Array.isArray(assertion) ? assertion.length : 1);

// @todo: assert batch vc response
});
});
Expand Down

0 comments on commit 761639b

Please sign in to comment.