difftreelog
fix eth sponsoring test
in: master
1 file changed
tests/src/eth/sponsoring.test.tsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.161617import {SponsoringMode} from './util/helpers';17import {IKeyringPair} from '@polkadot/types/types';18import {itEth, expect} from '../eth/util/playgrounds';18import {itEth, expect, SponsoringMode} from '../eth/util/playgrounds';19import {usingPlaygrounds} from './../util/playgrounds/index';192020describe('EVM sponsoring', () => {21describe('EVM sponsoring', () => {22 let donor: IKeyringPair;2324 before(async () => {25 await usingPlaygrounds(async (helper, privateKey) => {26 donor = privateKey('//Alice');27 });28 });2921 itEth('Fee is deducted from contract if sponsoring is enabled', async ({helper, privateKey}) => {30 itEth('Fee is deducted from contract if sponsoring is enabled', async ({helper}) => {22 const alice = privateKey('//Alice');2324 const owner = await helper.eth.createAccountWithBalance(alice);31 const owner = await helper.eth.createAccountWithBalance(donor);25 const sponsor = await helper.eth.createAccountWithBalance(alice);32 const sponsor = await helper.eth.createAccountWithBalance(donor);26 const caller = await helper.eth.createAccount();33 const caller = helper.eth.createAccount();27 const originalCallerBalance = await helper.balance.getEthereum(caller);34 const originalCallerBalance = await helper.balance.getEthereum(caller);283529 expect(originalCallerBalance).to.be.equal(0n);36 expect(originalCallerBalance).to.be.equal(0n);303731 // const flipper = await deployFlipper(web3, owner);32 const flipper = await helper.eth.deployFlipper(owner);38 const flipper = await helper.eth.deployFlipper(owner);333934 const helpers = helper.ethNativeContract.contractHelpers(owner);40 const helpers = helper.ethNativeContract.contractHelpers(owner);55 expect(await helper.balance.getEthereum(sponsor)).to.be.not.equal(originalSponsorBalance);61 expect(await helper.balance.getEthereum(sponsor)).to.be.not.equal(originalSponsorBalance);56 });62 });576358 itEth('...but this doesn\'t applies to payable value', async ({helper, privateKey}) => {64 itEth('...but this doesn\'t applies to payable value', async ({helper}) => {59 const alice = privateKey('//Alice');6061 const owner = await helper.eth.createAccountWithBalance(alice);65 const owner = await helper.eth.createAccountWithBalance(donor);62 const sponsor = await helper.eth.createAccountWithBalance(alice);66 const sponsor = await helper.eth.createAccountWithBalance(donor);63 const caller = await helper.eth.createAccountWithBalance(alice);67 const caller = await helper.eth.createAccountWithBalance(donor);64 const originalCallerBalance = await helper.balance.getEthereum(caller);68 const originalCallerBalance = await helper.balance.getEthereum(caller);656966 expect(originalCallerBalance).to.be.not.equal(0n);70 expect(originalCallerBalance).to.be.not.equal(0n);