git.delta.rocks / unique-network / refs/commits / 7fa45b56518f

difftreelog

source

tests/src/util/createHrmp.ts1013 Bsourcehistory
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    case 'unique':20      await bidirOpen(1001, 1002);21      await bidirOpen(1001, 1003);22      await bidirOpen(1001, 1004);23      await bidirOpen(1001, 1005);24      break;25    default:26      throw new Error(`unknown hrmp config profile: ${profile}`);27  }28}, config.relayUrl);29// We miss disconnect/unref somewhere.30process.exit(0);