git.delta.rocks / unique-network / refs/commits / 59a15efbde76

difftreelog

source

js-packages/scripts/setCode.ts545 Bsourcehistory
1import {readFile} from 'fs/promises';2import {u8aToHex} from '@polkadot/util';3import {usingPlaygrounds} from '@unique/test-utils/util.js';45const codePath = process.argv[2];6if(!codePath) throw new Error('missing code path argument');78const code = await readFile(codePath);910await usingPlaygrounds(async (helper, privateKey) => {11  const alice = await privateKey('//Alice');12  await helper.getSudo().executeExtrinsicUncheckedWeight(alice, 'api.tx.system.setCode', [u8aToHex(code)]);13});14// We miss disconnect/unref somewhere.15process.exit(0);