Skip to content

Commit

Permalink
[worker] run integration tests against paseo (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
clangenb authored Apr 10, 2024
1 parent 5d9a714 commit 0a575f0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
14 changes: 14 additions & 0 deletions packages/worker-api/src/testUtils/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@ export const localDockerNetwork = () => {
};
};

export const paseoNetwork = () => {
return {
chain: 'wss://rpc.ibp.network/paseo:443',
// reverse proxy to the worker
worker: 'wss://scv1.paseo.api.incognitee.io:443',
genesisHash: '',
mrenclave: '7RuM6U4DLEtrTnVntDjDPBCAN4LbCGRpnmcTYUGhLqc7',
// abused as shard vault
chosenCid: '5CBWPstfcW7dPYGdUG4kVDZSQq9Q9Ed65LT2Eu1inhJRoY8e',
customTypes: {},
palletOverrides: {}
};
};

// Type overrides needed for the v3.8 tag of the encointer-node repo.
const TypeOverrides_V3_8 = {
CurrencyIdentifier: 'Hash',
Expand Down
11 changes: 6 additions & 5 deletions packages/worker-api/src/worker.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Keyring } from '@polkadot/api';
import { cryptoWaitReady } from '@polkadot/util-crypto';
import { localDockerNetwork } from './testUtils/networks.js';
import { paseoNetwork } from './testUtils/networks.js';
import { Worker } from './worker.js';
import WS from 'websocket';

const {w3cwebsocket: WebSocket} = WS;

describe('worker', () => {
const network = localDockerNetwork();
const network = paseoNetwork();
let keyring: Keyring;
let worker: Worker;
beforeAll(async () => {
Expand All @@ -24,8 +24,9 @@ describe('worker', () => {
undefined,
undefined,
undefined,
// Allow the worker's self-signed certificate
{ rejectUnauthorized: false }
// Allow the worker's self-signed certificate, needed in non-reverse proxy setups
// where we talk to the worker directly.
// { rejectUnauthorized: false }
),
api: null,
});
Expand All @@ -34,7 +35,7 @@ describe('worker', () => {
// skip it, as this requires a worker (and hence a node) to be running
// To my knowledge jest does not have an option to run skipped tests specifically, does it?
// Todo: add proper CI to test this too.
describe.skip('needs worker and node running', () => {
describe('needs worker and node running', () => {
describe('getWorkerPubKey', () => {
it('should return value', async () => {
const result = await worker.getShieldingKey();
Expand Down

0 comments on commit 0a575f0

Please sign in to comment.