git.delta.rocks / unique-network / refs/commits / 0e311d1fa473

difftreelog

fix open unique htmp channels

Daniel Shiposha2023-10-23parent: #2b9fe52.patch.diff
in: master

1 file changed

modifiedtests/src/util/createHrmp.tsdiffbeforeafterboth
after · tests/src/util/createHrmp.ts
1import {usingPlaygrounds} from '.';2import config from '../config';34const profile = process.argv[2];5if(!profile) throw new Error('missing profile/relay argument');67await usingPlaygrounds(async (helper, privateKey) => {8  const bidirOpen = async (a: number, b: number) => {9    console.log(`Opening ${a} <=> ${b}`);10    await helper.getSudo().executeExtrinsic(alice, 'api.tx.hrmp.forceOpenHrmpChannel', [a, b, 8, 512]);11    await helper.getSudo().executeExtrinsic(alice, 'api.tx.hrmp.forceOpenHrmpChannel', [b, a, 8, 512]);12  };13  const alice = await privateKey('//Alice');14  switch (profile) {15    case 'opal':16      await bidirOpen(1001, 1002);17      break;18    case 'quartz':19      await bidirOpen(1001, 1002);20      await bidirOpen(1001, 1003);21      await bidirOpen(1001, 1004);22      await bidirOpen(1001, 1005);23      break;24    case 'unique':25      await bidirOpen(1001, 1002);26      await bidirOpen(1001, 1003);27      await bidirOpen(1001, 1004);28      await bidirOpen(1001, 1005);29      await bidirOpen(1001, 1006);30      break;31    default:32      throw new Error(`unknown hrmp config profile: ${profile}`);33  }34}, config.relayUrl);35// We miss disconnect/unref somewhere.36process.exit(0);