mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 07:31:02 +00:00
Elastic scaling: add e2e test (#3929)
On top of https://github.com/paritytech/polkadot-sdk/pull/3879 I've also moved the previous test where we ensure multiple cores per para doesn't break non elastic parachains. --------- Signed-off-by: Andrei Sandu <andrei-mihail@parity.io> Co-authored-by: Javier Viola <363911+pepoviola@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
async function run(nodeName, networkInfo, args) {
|
||||
const { wsUri, userDefinedTypes } = networkInfo.nodesByName[nodeName];
|
||||
const api = await zombie.connect(wsUri, userDefinedTypes);
|
||||
|
||||
let para = Number(args[0]);
|
||||
let core = Number(args[1]);
|
||||
console.log(`Assigning para ${para} to core ${core}`);
|
||||
|
||||
await zombie.util.cryptoWaitReady();
|
||||
|
||||
// account to submit tx
|
||||
const keyring = new zombie.Keyring({ type: "sr25519" });
|
||||
const alice = keyring.addFromUri("//Alice");
|
||||
|
||||
await new Promise(async (resolve, reject) => {
|
||||
const unsub = await api.tx.sudo
|
||||
.sudo(api.tx.coretime.assignCore(core, 0, [[{ task: para }, 57600]], null))
|
||||
.signAndSend(alice, ({ status, isError }) => {
|
||||
if (status.isInBlock) {
|
||||
console.log(
|
||||
`Transaction included at blockhash ${status.asInBlock}`,
|
||||
);
|
||||
} else if (status.isFinalized) {
|
||||
console.log(
|
||||
`Transaction finalized at blockHash ${status.asFinalized}`,
|
||||
);
|
||||
unsub();
|
||||
return resolve();
|
||||
} else if (isError) {
|
||||
console.log(`Transaction error`);
|
||||
reject(`Transaction error`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
module.exports = { run };
|
||||
Reference in New Issue
Block a user