Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p-929 Adding vcissued events listening for dr_vc test #2925

Merged
merged 4 commits into from
Jul 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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