1234567891011121314151617import {expect} from 'chai';18import {createEthAccountWithBalance, deployFlipper, GAS_ARGS, itWeb3, subToEth, transferBalanceToEth} from './util/helpers';19import {scheduleExpectSuccess, waitNewBlocks, requirePallets, Pallets} from '../util/helpers';202122describe.skip('Scheduing EVM smart contracts', () => {23 before(async function() {24 await requirePallets(this, [Pallets.Scheduler]);25 });2627 itWeb3('Successfully schedules and periodically executes an EVM contract', async ({api, web3, privateKeyWrapper}) => {28 const deployer = await createEthAccountWithBalance(api, web3, privateKeyWrapper);29 const flipper = await deployFlipper(web3, deployer);30 const initialValue = await flipper.methods.getValue().call();31 const alice = privateKeyWrapper('//Alice');32 await transferBalanceToEth(api, alice, subToEth(alice.address));3334 {35 const tx = api.tx.evm.call(36 subToEth(alice.address),37 flipper.options.address,38 flipper.methods.flip().encodeABI(),39 '0',40 GAS_ARGS.gas,41 await web3.eth.getGasPrice(),42 null,43 null,44 [],45 );46 const waitForBlocks = 4;47 const periodBlocks = 2;4849 await scheduleExpectSuccess(tx, alice, waitForBlocks, '0x' + '0'.repeat(32), periodBlocks, 2);50 expect(await flipper.methods.getValue().call()).to.be.equal(initialValue);51 52 await waitNewBlocks(waitForBlocks - 1);53 expect(await flipper.methods.getValue().call()).to.be.not.equal(initialValue);54 55 await waitNewBlocks(periodBlocks);56 expect(await flipper.methods.getValue().call()).to.be.equal(initialValue);57 }58 });59});