diff --git a/lib/tests/bridge-calls.js b/lib/tests/bridge-calls.js index e17ec66b..786980ac 100644 --- a/lib/tests/bridge-calls.js +++ b/lib/tests/bridge-calls.js @@ -3,12 +3,10 @@ const expect = chai.expect; chai.use(require('chai-as-promised')); const fs = require('fs'); const CustomError = require('../CustomError'); -const { wait } = require('../utils'); const rskUtils = require('../rsk-utils'); const solUtils = require('../sol-utils'); const btcEthUnitConverter = require('@rsksmart/btc-eth-unit-converter'); -const { getRskTransactionHelpers, getRskTransactionHelper } = require('../rsk-tx-helper-provider'); - +const { getRskTransactionHelper } = require('../rsk-tx-helper-provider'); const { getBridge } = require('../bridge-provider'); const INITIAL_RSK_BALANCE_IN_BTC = 1; @@ -103,32 +101,11 @@ const testMethod = (bridgeCallsAllowed) => (methodSignature, args, expectedWhenF } }); - it(`${bridgeCallsAllowed ? '' : 'no '}contract calls allowed`, async () => { - if (bridgeCallsAllowed) { - const success = await contractCallsTester.methods.doCall(abi).call(); - expect(success).to.equal(bridgeCallsAllowed); - } else { - await expect(contractCallsTester.methods.doCall(abi).call()).to.be.rejected; - } + it(`contract calls allowed`, async () => { + const success = await contractCallsTester.methods.doCall(abi).call(); + expect(success).to.be.true; }); - if (bridgeCallsAllowed) { - it(`txs are mined and execution is reverted`, async () => { - try { - const txPromise = contractCallsTester.methods.doCall(abi).send({ - from: address - }); - - // TODO: Change this when instamining is enabled. txPromise should be await. - await wait(500); - await rskUtils.mineAndSync(getRskTransactionHelpers()); - - await expect(txPromise).to.be.rejected; - } catch (err) { - throw new CustomError('Txs are mined and execution reverted failure', err); - } - }); - } }); }; diff --git a/tests/01_01_51-post_orchid_bridge_constant_fns.js b/tests/01_01_02-calls-to-bridge-methods-work.js similarity index 68% rename from tests/01_01_51-post_orchid_bridge_constant_fns.js rename to tests/01_01_02-calls-to-bridge-methods-work.js index 47b4f561..61344248 100644 --- a/tests/01_01_51-post_orchid_bridge_constant_fns.js +++ b/tests/01_01_02-calls-to-bridge-methods-work.js @@ -1,3 +1,3 @@ const bridgeCallsTests = require('../lib/tests/bridge-calls'); -bridgeCallsTests.execute('Bridge calls and txs from contracts to constant fns', () => Runners.hosts.federate.host, true); +bridgeCallsTests.execute('Bridge calls and txs from contracts to constant fns', () => Runners.hosts.federate.host);