From dd2a57fee3820e4eb670b7dd259efb58d699db96 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Wed, 26 Jan 2022 05:50:01 +0000 Subject: [PATCH] fixup tests --- --- a/tests/src/eth/contractSponsoring.test.ts +++ b/tests/src/eth/contractSponsoring.test.ts @@ -35,7 +35,7 @@ expect(await helpers.methods.sponsoringEnabled(flipper.options.address).call()).to.be.false; }); - itWeb3('In generous mode, non-allowlisted user transaction will be sponsored', async ({ api, web3 }) => { + itWeb3('In generous mode, non-allowlisted user transaction will be sponsored', async ({api, web3}) => { const alice = privateKey('//Alice'); const owner = await createEthAccountWithBalance(api, web3); @@ -67,7 +67,7 @@ const alice = privateKey('//Alice'); const owner = await createEthAccountWithBalance(api, web3); - const caller = await createEthAccount(api); + const caller = createEthAccount(web3); const flipper = await deployFlipper(web3, owner); @@ -97,7 +97,7 @@ const alice = privateKey('//Alice'); const owner = await createEthAccountWithBalance(api, web3); - const caller = await createEthAccount(api); + const caller = createEthAccount(web3); const flipper = await deployFlipper(web3, owner); --- a/tests/src/eth/util/contractHelpersAbi.json +++ b/tests/src/eth/util/contractHelpersAbi.json @@ -147,6 +147,43 @@ "type": "address" }, { + "internalType": "uint8", + "name": "mode", + "type": "uint8" + } + ], + "name": "setSponsoringMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "sponsoringMode", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { "internalType": "uint32", "name": "limit", "type": "uint32" @@ -176,4 +213,4 @@ "stateMutability": "view", "type": "function" } -] \ No newline at end of file +] --- a/tests/src/eth/util/helpers.ts +++ b/tests/src/eth/util/helpers.ts @@ -22,9 +22,9 @@ export const GAS_ARGS = {gas: 2500000}; export enum SponsoringMode { - Disabled, - Allowlisted, - Generous, + Disabled = 0, + Allowlisted = 1, + Generous = 2, } let web3Connected = false; -- gitstuff