git.delta.rocks / unique-network / refs/commits / e2ee5ffc10f8

difftreelog

source

js-packages/tests/util/authorizeEnactUpgrade.ts744 Bsourcehistory
1import {readFile} from 'fs/promises';2import {u8aToHex} from '@polkadot/util';3import {usingPlaygrounds} from './index.js';4import {blake2AsHex} from '@polkadot/util-crypto';567const codePath = process.argv[2];8if(!codePath) throw new Error('missing code path argument');910const code = await readFile(codePath);1112await usingPlaygrounds(async (helper, privateKey) => {13  const alice = await privateKey('//Alice');14  const hex = blake2AsHex(code);15  await helper.getSudo().executeExtrinsic(alice, 'api.tx.parachainSystem.authorizeUpgrade', [hex, true]);16  await helper.getSudo().executeExtrinsicUncheckedWeight(alice, 'api.tx.parachainSystem.enactAuthorizedUpgrade', [u8aToHex(code)]);17});18// We miss disconnect/unref somewhere.19process.exit(0);