mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 09:51:02 +00:00
Coretime Zombienet test (#2867)
This adds a Zombienet test for Coretime. Requires: https://github.com/paritytech/polkadot-sdk/pull/2862 --------- Co-authored-by: Javier Viola <javier@parity.io> Co-authored-by: Javier Viola <363911+pepoviola@users.noreply.github.com>
This commit is contained in:
@@ -1,18 +1,37 @@
|
||||
const assert = require("assert");
|
||||
|
||||
async function run(nodeName, networkInfo, _jsArgs) {
|
||||
const { wsUri, userDefinedTypes } = networkInfo.nodesByName[nodeName];
|
||||
const init = networkInfo.nodesByName[nodeName];
|
||||
let wsUri = init.wsUri;
|
||||
let userDefinedTypes = init.userDefinedTypes;
|
||||
const api = await zombie.connect(wsUri, userDefinedTypes);
|
||||
|
||||
const sec = networkInfo.nodesByName["collator-para-100"];
|
||||
wsUri = sec.wsUri;
|
||||
userDefinedTypes = sec.userDefinedTypes;
|
||||
|
||||
const api_collator = await zombie.connect(wsUri, userDefinedTypes);
|
||||
|
||||
await zombie.util.cryptoWaitReady();
|
||||
|
||||
// Get the genesis header and the validation code of parachain 100
|
||||
const genesis_header = await api_collator.rpc.chain.getHeader();
|
||||
const validation_code = await api_collator.rpc.state.getStorage("0x3A636F6465");
|
||||
|
||||
// account to submit tx
|
||||
const keyring = new zombie.Keyring({ type: "sr25519" });
|
||||
const alice = keyring.addFromUri("//Alice");
|
||||
|
||||
const calls = [
|
||||
api.tx.configuration.setCoretimeCores({ new: 1 }),
|
||||
api.tx.coretime.assignCore(0, 20,[[ { task: 1005 }, 57600 ]], null)
|
||||
api.tx.coretime.assignCore(0, 20,[[ { task: 1005 }, 57600 ]], null),
|
||||
api.tx.registrar.forceRegister(
|
||||
alice.address,
|
||||
0,
|
||||
100,
|
||||
genesis_header.toHex(),
|
||||
validation_code.toHex(),
|
||||
)
|
||||
];
|
||||
const sudo_batch = api.tx.sudo.sudo(api.tx.utility.batch(calls));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user