1import {Pallets, usingPlaygrounds} from './src/util/playgrounds/index';23export async function mochaGlobalSetup() {4 await usingPlaygrounds(async (helper, privateKey) => {5 6 const missingPallets = helper.fetchMissingPalletNames([Pallets.AppPromotion]);7 if (missingPallets.length === 0) {8 const superuser = await privateKey('//Alice');9 const palletAddress = helper.arrange.calculatePalleteAddress('appstake');10 const palletAdmin = await privateKey('//PromotionAdmin');11 const api = helper.getApi();12 await helper.signTransaction(superuser, api.tx.sudo.sudo(api.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})));13 const nominal = helper.balance.getOneTokenNominal();14 await helper.balance.transferToSubstrate(superuser, palletAdmin.address, 1000n * nominal);15 await helper.balance.transferToSubstrate(superuser, palletAddress, 1000n * nominal);16 }17 });18}