git.delta.rocks / unique-network / refs/commits / 5bf7ef40777d

difftreelog

fix reset sudo after elect sudo test

Daniel Shiposha2023-11-24parent: #0bc77a3.patch.diff
in: master

1 file changed

modifiedjs-packages/tests/sub/governance/electsudo.test.tsdiffbeforeafterboth
32 const [newAccount] = await helper.arrange.createAccounts([1000n], donor);32 const [newAccount] = await helper.arrange.createAccounts([1000n], donor);
33 const newSudoKey = newAccount.address;33 const newSudoKey = newAccount.address;
34
35 // Have to use `afterEach` here instead of `after` to ensure it will be executed before `describe.after`.
36 afterEach(async () => {
37 // For some reason, the outer helper API is not initialized inside `afterEach`.
38 await usingPlaygrounds(async (helper) => {
39 await helper.executeExtrinsic(
40 newAccount,
41 'api.tx.sudo.setKey',
42 [sudoer.address],
43 false,
44 );
45 });
46 });
3447
35 const democracyProposal = helper.constructApiCall('api.tx.utility.dispatchAs', [48 const democracyProposal = helper.constructApiCall('api.tx.utility.dispatchAs', [
36 {49 {
83 .then(k => k.toString());96 .then(k => k.toString());
84 expect(currentSudoKey).to.be.equal(newSudoKey);97 expect(currentSudoKey).to.be.equal(newSudoKey);
85
86 await helper.executeExtrinsic(newAccount, 'api.tx.sudo.setKey', [sudoer.address]);
87 });98 });
88});99});
89100