difftreelog
test fix sponsoring for updated logic
in: master
3 files changed
tests/src/eth/sponsoring.test.tsdiffbeforeafterboth17 await waitNewBlocks(api, 1);17 await waitNewBlocks(api, 1);18 18 19 const helpers = contractHelpers(web3Http, owner);19 const helpers = contractHelpers(web3Http, owner);20 await helpers.methods.toggleAllowlist(flipper.options.address, true).send({ from: owner });21 await waitNewBlocks(api, 1);22 await helpers.methods.toggleAllowed(flipper.options.address, caller, true).send({ from: owner });23 await waitNewBlocks(api, 1);2420 expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false;25 expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false;21 await helpers.methods.toggleSponsoring(flipper.options.address, true).send({from: owner});26 await helpers.methods.toggleSponsoring(flipper.options.address, true).send({from: owner});27 await waitNewBlocks(api, 1);28 await helpers.methods.setSponsoringRateLimit(flipper.options.address, 0).send({from: owner});22 await waitNewBlocks(api, 1);29 await waitNewBlocks(api, 1);23 expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.true;30 expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.true;243151 await waitNewBlocks(api, 1);58 await waitNewBlocks(api, 1);52 59 53 const helpers = contractHelpers(web3Http, owner);60 const helpers = contractHelpers(web3Http, owner);61 await helpers.methods.toggleAllowlist(collector.options.address, true).send({ from: owner });62 await waitNewBlocks(api, 1);63 await helpers.methods.toggleAllowed(collector.options.address, caller, true).send({ from: owner });64 await waitNewBlocks(api, 1);6554 expect(await helpers.methods.sponsoringEnabled(collector.options.address).call()).to.be.false;66 expect(await helpers.methods.sponsoringEnabled(collector.options.address).call()).to.be.false;55 await helpers.methods.toggleSponsoring(collector.options.address, true).send({from: owner});67 await helpers.methods.toggleSponsoring(collector.options.address, true).send({ from: owner });68 await waitNewBlocks(api, 1);69 await helpers.methods.setSponsoringRateLimit(collector.options.address, 0).send({ from: owner });56 await waitNewBlocks(api, 1);70 await waitNewBlocks(api, 1);57 expect(await helpers.methods.sponsoringEnabled(collector.options.address).call()).to.be.true;71 expect(await helpers.methods.sponsoringEnabled(collector.options.address).call()).to.be.true;5872tests/src/eth/util/contractHelpersAbi.jsondiffbeforeafterboth138 "outputs": [],138 "outputs": [],139 "stateMutability": "nonpayable",139 "stateMutability": "nonpayable",140 "type": "function"140 "type": "function"141 }141 },142 {143 "inputs": [144 {145 "internalType": "address",146 "name": "target",147 "type": "address"148 },149 {150 "internalType": "uint32",151 "name": "limit",152 "type": "uint32"153 }154 ],155 "name": "setSponsoringRateLimit",156 "outputs": [],157 "stateMutability": "nonpayable",158 "type": "function"159 }142]160]tests/src/eth/util/helpers.tsdiffbeforeafterboth18import privateKey from '../../substrate/privateKey';18import privateKey from '../../substrate/privateKey';19import contractHelpersAbi from './contractHelpersAbi.json';19import contractHelpersAbi from './contractHelpersAbi.json';202021export const GAS_ARGS = { gas: 0x10000000, gasPrice: '0x01' };21export const GAS_ARGS = { gas: 0x1000000, gasPrice: '0x01' };222223let web3Connected = false;23let web3Connected = false;24export async function usingWeb3<T>(cb: (web3: Web3) => Promise<T> | T): Promise<T> {24export async function usingWeb3<T>(cb: (web3: Web3) => Promise<T> | T): Promise<T> {