From 050f804196e61bda302e02069b6bd5947c5e16e3 Mon Sep 17 00:00:00 2001 From: jeremy-then Date: Wed, 27 Nov 2024 10:43:51 -0400 Subject: [PATCH] Removes all pre tests since they are not needed anymore. --- ...01_01_02-pre_orchid_bridge_constant_fns.js | 3 - ...01_01_03-pre_orchid_lock_whitelist_fork.js | 63 ------------ tests/01_02_01-pre_wasabi_fed_pubkeys_fork.js | 71 ------------- tests/01_03_01-lock_whitelist_pre_papyrus.js | 99 ------------------- tests/01_03_02-pre_papyrus_locking_cap.js | 46 --------- ..._03_03-pre_papyrus_coinbase_information.js | 50 ---------- ...4_01-pre_iris_liquidity_bridge_contract.js | 71 ------------- ...is_register_fast_bridge_btc_transaction.js | 38 ------- .../01_04_03-pre_iris_call_receive_header.js | 35 ------- ...1_05_01-pre_hop_pegout_batching_methods.js | 40 -------- ..._02-pre_hop_active_powpeg_redeem_script.js | 23 ----- ...ated-fees-for-next-pegout_returned_zero.js | 29 ------ 12 files changed, 568 deletions(-) delete mode 100644 tests/01_01_02-pre_orchid_bridge_constant_fns.js delete mode 100644 tests/01_01_03-pre_orchid_lock_whitelist_fork.js delete mode 100644 tests/01_02_01-pre_wasabi_fed_pubkeys_fork.js delete mode 100644 tests/01_03_01-lock_whitelist_pre_papyrus.js delete mode 100644 tests/01_03_02-pre_papyrus_locking_cap.js delete mode 100644 tests/01_03_03-pre_papyrus_coinbase_information.js delete mode 100644 tests/01_04_01-pre_iris_liquidity_bridge_contract.js delete mode 100644 tests/01_04_02-pre_iris_register_fast_bridge_btc_transaction.js delete mode 100644 tests/01_04_03-pre_iris_call_receive_header.js delete mode 100644 tests/01_05_01-pre_hop_pegout_batching_methods.js delete mode 100644 tests/01_05_02-pre_hop_active_powpeg_redeem_script.js delete mode 100644 tests/01_06_03-pre-fingerroot500-get-estimated-fees-for-next-pegout_returned_zero.js diff --git a/tests/01_01_02-pre_orchid_bridge_constant_fns.js b/tests/01_01_02-pre_orchid_bridge_constant_fns.js deleted file mode 100644 index aac1a294..00000000 --- a/tests/01_01_02-pre_orchid_bridge_constant_fns.js +++ /dev/null @@ -1,3 +0,0 @@ -const bridgeCallsTests = require('../lib/tests/bridge-calls'); - -bridgeCallsTests.execute('Bridge calls and txs from contracts to constant fns (pre-orchid)', () => Runners.hosts.federate.host, false); diff --git a/tests/01_01_03-pre_orchid_lock_whitelist_fork.js b/tests/01_01_03-pre_orchid_lock_whitelist_fork.js deleted file mode 100644 index eb78d75e..00000000 --- a/tests/01_01_03-pre_orchid_lock_whitelist_fork.js +++ /dev/null @@ -1,63 +0,0 @@ -const whitelistingAssertions = require('../lib/assertions/whitelisting'); -const { getBridge } = require('../lib/bridge-provider'); -const contractMethodAssertions = require('../lib/assertions/contractMethods'); -const expect = require('chai').expect; -const CustomError = require('../lib/CustomError'); -const { getRskTransactionHelper } = require('../lib/rsk-tx-helper-provider'); - -let bridge; -let rskTxHelper; - -const WHITELIST_ADDRESSES = { - 'mq4w7mWwCtCURdbB3m3EVXqtJiVBdXcEaK' : 100000000000, - 'mx9PWbBKJxiR7xfV8i6TJnbVZoVLgv66vm' : 100000000000, - 'mnr8aGuc3tZb63gyssWssAz98LEojwTs9b' : 100000000000 - }; - - -describe('RFS-170 test before fork', () => { - const RFS_170_ACTIVATION_BLOCK = Runners.common.forks.orchid.activationHeight; - - before(async () => { - rskTxHelper = getRskTransactionHelper(); - bridge = getBridge(rskTxHelper.getClient()); - }); - - it(`should be at a height lower than ${RFS_170_ACTIVATION_BLOCK}`, async () => { - try{ - const blockNum = await rskTxHelper.getBlockNumber(); - expect(blockNum < RFS_170_ACTIVATION_BLOCK).to.be.true; - } - catch (err) { - throw new CustomError('Activation block height failure', err); - } - }); - - it('should add address to the whitelist using old addLockWhitelistAddress', () => { - const whitelistAddress = Object.entries(WHITELIST_ADDRESSES)[0]; - return whitelistingAssertions.assertAddLockWhitelistAddress(rskTxHelper, whitelistAddress[0], whitelistAddress[1]); - }); - - it('should NOT get the entry by address using new getLockWhitelistEntryByAddress', () => { - return contractMethodAssertions.assertContractCallFails( - bridge.methods.getLockWhitelistEntryByAddress(Object.entries(WHITELIST_ADDRESSES)[0][0]) - ); - }); - - it('should remove address from the whitelist', () => { - return whitelistingAssertions.assertRemoveWhitelistAddress(rskTxHelper, Object.entries(WHITELIST_ADDRESSES)[0][0]); - }); - - it('should NOT add addresses to the whitelist using UNLIMITED', () => { - return contractMethodAssertions.assertContractCallFails( - bridge.methods.addUnlimitedLockWhitelistAddress(Object.entries(WHITELIST_ADDRESSES)[0][0]) - ); - }); - - it('should NOT add addresses to the whitelist using ONE-OFF', () => { - const whitelistAddress = Object.entries(WHITELIST_ADDRESSES)[0]; - return contractMethodAssertions.assertContractCallFails( - bridge.methods.addOneOffLockWhitelistAddress(whitelistAddress[0], whitelistAddress[1]) - ); - }); -}); diff --git a/tests/01_02_01-pre_wasabi_fed_pubkeys_fork.js b/tests/01_02_01-pre_wasabi_fed_pubkeys_fork.js deleted file mode 100644 index f50f64d6..00000000 --- a/tests/01_02_01-pre_wasabi_fed_pubkeys_fork.js +++ /dev/null @@ -1,71 +0,0 @@ -const contractMethodAssertions = require('../lib/assertions/contractMethods'); -const expect = require('chai').expect; -const { assertIsPublicKey } = require('../lib/assertions/misc'); -const { KEY_TYPE_BTC } = require('../lib/constants/federation-constants'); -const CustomError = require('../lib/CustomError'); -const { getBridge } = require('../lib/bridge-provider'); -const { getRskTransactionHelper } = require('../lib/rsk-tx-helper-provider'); - -const RANDOM_PUBLIC_KEY = '0x02f9284f96eb093918a9da825111aec70a51152800e60249ac156ac35d2fa771ba'; -const FEDERATION_CHANGE_PK = 'c14991a187e185ca1442e75eb8f60a6a5efd4ca57ce31e50d6e841d9381e996b'; - -let rskTxHelper; -let fedChangeAddress; -let preWasabiBridge; -let postWasabiBridge; - -describe('Multiple federation member keys test before fork', () => { - - const ACTIVATION_BLOCK = Runners.common.forks.wasabi100.activationHeight; - - before(async () => { - rskTxHelper = getRskTransactionHelper(); - fedChangeAddress = await rskTxHelper.importAccount(FEDERATION_CHANGE_PK, ''); - preWasabiBridge = getBridge(rskTxHelper.getClient()); - postWasabiBridge = getBridge(rskTxHelper.getClient()); - }); - - it(`should be at a height lower than ${ACTIVATION_BLOCK}`, async () => { - try{ - const blockNumber = await rskTxHelper.getBlockNumber(); - expect(blockNumber < ACTIVATION_BLOCK).to.be.true; - } - catch (err) { - throw new CustomError('Activation block height failure', err); - } - }); - - it('method getFederatorPublicKey should work', () => { - return contractMethodAssertions.assertContractCallReturnsWithCallback( - preWasabiBridge.methods.getFederatorPublicKey(0), - assertIsPublicKey - ); - }); - - it('method getFederatorPublicKeyOfType should NOT work', () => { - return contractMethodAssertions.assertContractCallFails( - postWasabiBridge.methods.getFederatorPublicKeyOfType(0, KEY_TYPE_BTC) - ); - }); - - it('method addFederatorPublicKey should work', () => { - return contractMethodAssertions.assertContractCallReturnsWithCallback( - preWasabiBridge.methods.addFederatorPublicKey(RANDOM_PUBLIC_KEY), - (result) => { - expect(Number(result)).to.equal(-1); - }, { - from: fedChangeAddress - } - ); - }); - - it('method addFederatorPublicKeyMultikey should NOT work', () => { - return contractMethodAssertions.assertContractCallFails( - postWasabiBridge.methods.addFederatorPublicKeyMultikey( - RANDOM_PUBLIC_KEY, RANDOM_PUBLIC_KEY, RANDOM_PUBLIC_KEY - ), { - from: fedChangeAddress - } - ); - }); -}); diff --git a/tests/01_03_01-lock_whitelist_pre_papyrus.js b/tests/01_03_01-lock_whitelist_pre_papyrus.js deleted file mode 100644 index 478d99b1..00000000 --- a/tests/01_03_01-lock_whitelist_pre_papyrus.js +++ /dev/null @@ -1,99 +0,0 @@ -const expect = require('chai').expect -const { removePrefix0x } = require('../lib/utils'); -const { - assertAddUnlimitedWhitelistAddress, - assertAddOneOffWhitelistAddress, - assertRemoveWhitelistAddress, - WHITELIST_CHANGE_PK, - WHITELIST_CHANGE_ADDR -} = require('../lib/assertions/whitelisting'); -const rskUtils = require('../lib/rsk-utils'); -const { getRskTransactionHelpers } = require('../lib/rsk-tx-helper-provider'); -const { getBtcClient } = require('../lib/btc-client-provider'); -const { getBridge } = require('../lib/bridge-provider'); - -let rskTxHelpers; -let btcTxHelper; -let rskTxHelper; -let bridge; -let federationAddress; - -const EXPECTED_UNSUCCESSFUL_RESULT = -10; -const FUND_AMOUNT_IN_WEIS = 1000000000; - -const WHITELIST_ADDRESS_TO_REMOVE = 'mx9PWbBKJxiR7xfV8i6TJnbVZoVLgv66vm'; - -const WHITELIST_ADDRESSES = { - 'mq4w7mWwCtCURdbB3m3EVXqtJiVBdXcEaK': 100000000000, - [WHITELIST_ADDRESS_TO_REMOVE]: 100000000000, - 'mnr8aGuc3tZb63gyssWssAz98LEojwTs9b': 100000000000 -}; - -const WHITELIST_RANDOM_PUBLIC_KEY = 'msJRGyaYvT8YNjvU3q9nPgBpZj9umAgetn'; - -describe('Lock whitelisting', () => { - before(async () => { - rskTxHelpers = getRskTransactionHelpers(); - btcTxHelper = getBtcClient(); - rskTxHelper = rskTxHelpers[0]; - bridge = getBridge(rskTxHelper.getClient()); - - federationAddress = await bridge.methods.getFederationAddress().call(); - await btcTxHelper.importAddress(federationAddress, 'federations'); - }); - - it(`should prevent calling addOneOffLockWhitelistAddress without a correct key`, async () => { - const addOneOffLockWhitelistAddressMethod = bridge.methods.addOneOffLockWhitelistAddress(WHITELIST_RANDOM_PUBLIC_KEY, FUND_AMOUNT_IN_WEIS); - const rskTxSenderAddress = await rskTxHelper.newAccountWithSeed('test'); - await rskUtils.sendFromCow(rskTxHelper, rskTxSenderAddress, FUND_AMOUNT_IN_WEIS); - const checkCallback = callResult => { - expect(Number(callResult)).to.equal(EXPECTED_UNSUCCESSFUL_RESULT); - }; - await rskUtils.sendTxWithCheck(rskTxHelper, addOneOffLockWhitelistAddressMethod, rskTxSenderAddress, checkCallback); - }); - - it(`should prevent calling removeLockWhitelistAddress without a correct key`, async () => { - const removeLockWhitelistAddressMethod = bridge.methods.removeLockWhitelistAddress(WHITELIST_RANDOM_PUBLIC_KEY); - const rskTxSenderAddress = await rskTxHelper.newAccountWithSeed('test'); - await rskUtils.sendFromCow(rskTxHelper, rskTxSenderAddress, FUND_AMOUNT_IN_WEIS); - const checkCallback = callResult => { - expect(Number(callResult)).to.equal(EXPECTED_UNSUCCESSFUL_RESULT); - }; - await rskUtils.sendTxWithCheck(rskTxHelper, removeLockWhitelistAddressMethod, rskTxSenderAddress, checkCallback); - }); - - it('should return expected WHITELIST_CHANGE_ADDR when WHITELIST_CHANGE_PK is imported', async () => { - const whitelistChangeAddressResult = await rskTxHelper.importAccount(WHITELIST_CHANGE_PK); - expect(removePrefix0x(whitelistChangeAddressResult)).to.equal(WHITELIST_CHANGE_ADDR); - const unlocked = await rskTxHelper.unlockAccount(whitelistChangeAddressResult, ''); - expect(unlocked).to.be.true; - }); - - it('should add addresses to the whitelist using UNLIMITED', async () => { - const addresses = Object.keys(WHITELIST_ADDRESSES); - for (let address of addresses){ - await assertAddUnlimitedWhitelistAddress(rskTxHelper, address); - } - }); - - it('should remove addresses from the previously added addresses from the whitelist', async () => { - const addresses = Object.keys(WHITELIST_ADDRESSES); - for (let address of addresses) { - await assertRemoveWhitelistAddress(rskTxHelper, address); - } - }); - - it('should add addresses to the whitelist using ONE-OFF', async () => { - const addressesValueEntries = Object.entries(WHITELIST_ADDRESSES); - for (let addressValueEntry of addressesValueEntries){ - const address = addressValueEntry[0]; - const maxTransferValue = addressValueEntry[1]; - await assertAddOneOffWhitelistAddress(rskTxHelper, address, maxTransferValue); - } - }); - - it('should remove some of the addresses from the whitelist', async () => { - await assertRemoveWhitelistAddress(rskTxHelper, WHITELIST_ADDRESS_TO_REMOVE); - }); - -}); diff --git a/tests/01_03_02-pre_papyrus_locking_cap.js b/tests/01_03_02-pre_papyrus_locking_cap.js deleted file mode 100644 index f2dd7a21..00000000 --- a/tests/01_03_02-pre_papyrus_locking_cap.js +++ /dev/null @@ -1,46 +0,0 @@ -const chai = require('chai'); -chai.use(require('chai-as-promised')); -const expect = chai.expect; - -const peglib = require('peglib'); -const bitcoin = peglib.bitcoin; -const rsk = peglib.rsk; -const pegUtils = peglib.pegUtils; -const rskUtilsLegacy = require('../lib/rsk-utils-legacy'); -const CustomError = require('../lib/CustomError'); - -const NETWORK = bitcoin.networks.testnet; - -describe('Calling locking cap methods before papyrus200', function() { - - before(() => { - rskClient = rsk.getClient(Runners.hosts.federate.host); - btcClient = bitcoin.getClient( - Runners.hosts.bitcoin.rpcHost, - Runners.hosts.bitcoin.rpcUser, - Runners.hosts.bitcoin.rpcPassword, - NETWORK - ); - pegClient = pegUtils.using(btcClient, rskClient); - utils = rskUtilsLegacy.with(btcClient, rskClient, pegClient); - }); - - it('should return 0 when calling getLockingCap method', async () => { - try{ - await expect(rskClient.rsk.bridge.methods.getLockingCap().call()).to.be.rejected; - } - catch (err) { - throw new CustomError('getLockingCap call failure', err); - } - }) - - it('should return false when calling increaseLockingCap method', async () => { - try{ - var increaseLockingCap = 1001; - await expect(rskClient.rsk.bridge.methods.increaseLockingCap(increaseLockingCap).call()).to.be.rejected; - } - catch (err) { - throw new CustomError('increaseLockingCap call failure', err); - } - }) -}); diff --git a/tests/01_03_03-pre_papyrus_coinbase_information.js b/tests/01_03_03-pre_papyrus_coinbase_information.js deleted file mode 100644 index 0cfc659d..00000000 --- a/tests/01_03_03-pre_papyrus_coinbase_information.js +++ /dev/null @@ -1,50 +0,0 @@ -const chai = require('chai'); -chai.use(require('chai-as-promised')); -const expect = chai.expect; -const peglib = require('peglib'); -const bitcoin = peglib.bitcoin; -const rsk = peglib.rsk; -const pegUtils = peglib.pegUtils; -const rskUtilsLegacy = require('../lib/rsk-utils-legacy'); -const web3 = require('web3'); -const CustomError = require('../lib/CustomError'); - -const NETWORK = bitcoin.networks.testnet; - -describe('Calling coinbase information methods before papyrus', function() { - - before(() => { - rskClient = rsk.getClient(Runners.hosts.federate.host); - btcClient = bitcoin.getClient( - Runners.hosts.bitcoin.rpcHost, - Runners.hosts.bitcoin.rpcUser, - Runners.hosts.bitcoin.rpcPassword, - NETWORK - ); - pegClient = pegUtils.using(btcClient, rskClient); - utils = rskUtilsLegacy.with(btcClient, rskClient, pegClient); - }); - - it('should return empty object when calling registerBtcCoinbaseTransaction method', async () => { - try{ - let randomHex = web3.utils.randomHex; - let stringHex = randomHex(32); - let callResult = await rskClient.rsk.bridge.methods.registerBtcCoinbaseTransaction("0x", stringHex, stringHex, stringHex, stringHex).call(); - expect(callResult).to.be.empty; - } - catch (err) { - throw new CustomError('registerBtcCoinbaseTransaction call failure', err); - } - }) - - it('should return false when calling hasBtcBlockCoinbaseTransactionInformation method', async () => { - try{ - let randomHex = web3.utils.randomHex; - let stringHex = randomHex(32); - await expect(rskClient.rsk.bridge.methods.hasBtcBlockCoinbaseTransactionInformation(stringHex).call()).to.be.rejected; - } - catch (err) { - throw new CustomError('hasBtcBlockCoinbaseTransactionInformation call failure', err); - } - }) -}); \ No newline at end of file diff --git a/tests/01_04_01-pre_iris_liquidity_bridge_contract.js b/tests/01_04_01-pre_iris_liquidity_bridge_contract.js deleted file mode 100644 index 016a21bd..00000000 --- a/tests/01_04_01-pre_iris_liquidity_bridge_contract.js +++ /dev/null @@ -1,71 +0,0 @@ -const chai = require('chai'); -const expect = chai.expect; -chai.use(require('chai-as-promised')); -const CustomError = require('../lib/CustomError'); -const lbc = require('../lib/liquidity-bridge-contract'); - -let liquidityBridgeContract; - -describe('Call liquidity bridge contract before iris300', () => { - - it('should create the testing contract', async () => { - try { - liquidityBridgeContract = await lbc.getLiquidityBridgeContract(); - - let isAlive = await liquidityBridgeContract.methods.areYouAlive().call(); - expect(isAlive).to.equal('yes i am'); - } catch (err) { - throw new CustomError('Contract creation failure', err); - } - }); - - it('fails when calling registerFastBridgeBtcTransaction', async () => { - // Arrange - let fedBtcAddress = '0x0101'; - let liquidityProviderRskAddress = '0x0000000000000000000000000000000000000001'; - let callContract = '0x0000000000000000000000000000000000000002'; - let callContractArguments = '0x0202'; - let penaltyFee = 1; - let successFee = 2; - let gasLimit = 3; - let nonce = 0; - let valueToTransfer = 10; - - let preHash = await liquidityBridgeContract.methods.hash( - fedBtcAddress, - liquidityProviderRskAddress, - callContract, - callContractArguments, - penaltyFee, - successFee, - gasLimit, - nonce, - valueToTransfer - ).call(); - - let btcRawTransaction = '0x001001'; - let partialMerkleTree = '0x002001'; - let height = 100; - let userBtcRefundAddress = '0x0005'; - let liquidityProviderBtcAddress = '0x0006'; - - let derivationHash = await liquidityBridgeContract.methods.getDerivationHash( - preHash, - userBtcRefundAddress, - liquidityProviderBtcAddress - ).call(); - - let initialAmount = 90; - await liquidityBridgeContract.methods.setDerivationHashBalance(derivationHash, initialAmount); - - // Act - await expect(liquidityBridgeContract.methods.registerFastBridgeBtcTransaction( - btcRawTransaction, - partialMerkleTree, - height, - userBtcRefundAddress, - liquidityProviderBtcAddress, - preHash - ).call()).to.be.rejected; - }); -}); diff --git a/tests/01_04_02-pre_iris_register_fast_bridge_btc_transaction.js b/tests/01_04_02-pre_iris_register_fast_bridge_btc_transaction.js deleted file mode 100644 index 79bcb3e9..00000000 --- a/tests/01_04_02-pre_iris_register_fast_bridge_btc_transaction.js +++ /dev/null @@ -1,38 +0,0 @@ -const expect = require('chai').expect -const peglib = require('peglib'); -const bitcoin = peglib.bitcoin; -const rsk = peglib.rsk; -const pegUtils = peglib.pegUtils; -const rskUtilsLegacy = require('../lib/rsk-utils-legacy'); -const CustomError = require('../lib/CustomError'); - -const NETWORK = bitcoin.networks.testnet; - -describe('Calling registerFastBridgeBtcTransaction before iris', function() { - - before(() => { - rskClient = rsk.getClient(Runners.hosts.federate.host); - btcClient = bitcoin.getClient( - Runners.hosts.bitcoin.rpcHost, - Runners.hosts.bitcoin.rpcUser, - Runners.hosts.bitcoin.rpcPassword, - NETWORK - ); - pegClient = pegUtils.using(btcClient, rskClient); - utils = rskUtilsLegacy.with(btcClient, rskClient, pegClient); - }); - - it('should fail when calling registerFastBridgeBtcTransaction method', async () => { - try { - let randomHex = rskClient.utils.randomHex; - let stringHex = randomHex(32); - let randomAddress = randomHex(20); - await expect( - rskClient.rsk.bridge.methods.registerFastBridgeBtcTransaction("0x", 1, stringHex, stringHex, stringHex, randomAddress, stringHex, false).call() - ).to.be.rejected; - } - catch (err) { - throw new CustomError('registerFastBridgeBtcTransaction call failure', err); - } - }) -}); diff --git a/tests/01_04_03-pre_iris_call_receive_header.js b/tests/01_04_03-pre_iris_call_receive_header.js deleted file mode 100644 index cf05d69c..00000000 --- a/tests/01_04_03-pre_iris_call_receive_header.js +++ /dev/null @@ -1,35 +0,0 @@ -const chai = require('chai'); -chai.use(require('chai-as-promised')); -const expect = chai.expect; - -const peglib = require('peglib'); -const bitcoin = peglib.bitcoin; -const rsk = peglib.rsk; -const libUtils = require('../lib/utils'); -const CustomError = require('../lib/CustomError'); - -const NETWORK = bitcoin.networks.testnet; - -describe('Calling method receiveHeader before iris300', function() { - - before(() => { - rskClient = rsk.getClient(Runners.hosts.federate.host); - btcClient = bitcoin.getClient( - Runners.hosts.bitcoin.rpcHost, - Runners.hosts.bitcoin.rpcUser, - Runners.hosts.bitcoin.rpcPassword, - NETWORK - ); - }); - - it('should reject calling receiveHeader method before iris', async () => { - try { - let blockHash = await btcClient.generate(1); - let blockHeader = await btcClient.getBlockHeader(blockHash[0], false); - await expect(rskClient.rsk.bridge.methods.receiveHeader(libUtils.ensure0x(blockHeader)).call()).to.be.rejected; - } - catch (err) { - throw new CustomError('receiveHeader call failure', err); - } - }) -}); diff --git a/tests/01_05_01-pre_hop_pegout_batching_methods.js b/tests/01_05_01-pre_hop_pegout_batching_methods.js deleted file mode 100644 index 42729448..00000000 --- a/tests/01_05_01-pre_hop_pegout_batching_methods.js +++ /dev/null @@ -1,40 +0,0 @@ -const chai = require('chai'); -chai.use(require('chai-as-promised')); -const expect = chai.expect; - -const peglib = require('peglib'); -const rsk = peglib.rsk; -const CustomError = require('../lib/CustomError'); - -describe('Pegout Batching - Calling new bridge methods before hop400 activation', function () { - - before(() => { - rskClient = rsk.getClient(Runners.hosts.federate.host); - }); - - it('should reject when calling getEstimatedFeesForNextPegOutEvent method', async () => { - try { - await expect(rskClient.rsk.bridge.methods.getEstimatedFeesForNextPegOutEvent().call()).to.be.rejected; - } catch (err) { - throw new CustomError('getEstimatedFeesForNextPegOutEvent call failure', err); - } - }) - - - it('should reject when calling getNextPegoutCreationBlockNumber method', async () => { - try { - await expect(rskClient.rsk.bridge.methods.getNextPegoutCreationBlockNumber().call()).to.be.rejected; - } catch (err) { - throw new CustomError('getNextPegoutCreationBlockNumber call failure', err); - } - }) - - it('should reject when calling getQueuedPegoutsCount method', async () => { - try { - await expect(rskClient.rsk.bridge.methods.getQueuedPegoutsCount().call()).to.be.rejected; - } catch (err) { - throw new CustomError('getQueuedPegoutsCount call failure', err); - } - }) - -}); diff --git a/tests/01_05_02-pre_hop_active_powpeg_redeem_script.js b/tests/01_05_02-pre_hop_active_powpeg_redeem_script.js deleted file mode 100644 index ebec0e65..00000000 --- a/tests/01_05_02-pre_hop_active_powpeg_redeem_script.js +++ /dev/null @@ -1,23 +0,0 @@ -const chai = require('chai'); -chai.use(require('chai-as-promised')); -const expect = chai.expect; -const rsk = require('peglib').rsk; -const CustomError = require('../lib/CustomError'); - -let rskClient; - -describe('Calling getActivePowpegRedeemScript method before hop', function() { - - before(() => { - rskClient = rsk.getClient(Runners.hosts.federate.host); - }); - - it('should be rejected when calling getActivePowpegRedeemScript method', async () => { - try{ - await expect(rskClient.rsk.bridge.methods.getActivePowpegRedeemScript().call()).to.be.rejected; - } - catch (err) { - throw new CustomError('getActivePowpegRedeemScript call failure', err); - } - }) -}); diff --git a/tests/01_06_03-pre-fingerroot500-get-estimated-fees-for-next-pegout_returned_zero.js b/tests/01_06_03-pre-fingerroot500-get-estimated-fees-for-next-pegout_returned_zero.js deleted file mode 100644 index e793a55b..00000000 --- a/tests/01_06_03-pre-fingerroot500-get-estimated-fees-for-next-pegout_returned_zero.js +++ /dev/null @@ -1,29 +0,0 @@ -const expect = require('chai').expect; -const { getBridge } = require('../lib/bridge-provider'); -const CustomError = require('../lib/CustomError'); -const { getRskTransactionHelper } = require('../lib/rsk-tx-helper-provider'); - -let bridge; - -describe('getEstimatedFeesForNextPegOutEvent - pre fingerroot', () => { - before(async () => { - const rskTxHelper = getRskTransactionHelper(); - - bridge = getBridge(rskTxHelper.getClient()); - }); - - it('getEstimatedFeesForNextPegOutEvent bridge method returns zero when there are no pegout requests', async () => { - try { - const count = Number(await bridge.methods.getQueuedPegoutsCount().call()); - const expectedCount = 0; - expect(count).to.equal(expectedCount); - - const estimatedFees = Number(await bridge.methods.getEstimatedFeesForNextPegOutEvent().call()); - - const expectedEstimatedFee = 0; - expect(estimatedFees).to.equal(expectedEstimatedFee); - } catch (err) { - throw new CustomError('Error calling getEstimatedFeesForNextPegOutEvent', err); - } - }); -});