From 07968c347f7f870abcc3380ade0306752eef2f90 Mon Sep 17 00:00:00 2001 From: rzadp Date: Tue, 4 Jun 2019 10:28:11 +0200 Subject: [PATCH] Common generateNewBlock --- e2e-commons/scripts/blocks.js | 11 +---------- {oracle-e2e/utils => e2e-commons}/utils.js | 0 oracle-e2e/test/ercToErc.js | 2 +- oracle-e2e/test/ercToNative.js | 2 +- oracle-e2e/test/nativeToErc.js | 2 +- 5 files changed, 4 insertions(+), 13 deletions(-) rename {oracle-e2e/utils => e2e-commons}/utils.js (100%) diff --git a/e2e-commons/scripts/blocks.js b/e2e-commons/scripts/blocks.js index 59467a99..1fad990a 100644 --- a/e2e-commons/scripts/blocks.js +++ b/e2e-commons/scripts/blocks.js @@ -1,4 +1,5 @@ const Web3 = require('web3') +const { generateNewBlock } = require('../utils') const homeWeb3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8541')) const foreignWeb3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8542')) @@ -7,16 +8,6 @@ const privateKey = '0x460635eb4ac4287de2d2393985e19b4a9f948ac533453a1044ab8d5033 homeWeb3.eth.accounts.wallet.add(privateKey) foreignWeb3.eth.accounts.wallet.add(privateKey) -function generateNewBlock(web3, address) { - return web3.eth.sendTransaction({ - from: address, - to: '0x0000000000000000000000000000000000000000', - gasPrice: '1', - gas: '21000', - value: '1' - }) -} - function main() { setTimeout(async () => { generateNewBlock(homeWeb3, account) diff --git a/oracle-e2e/utils/utils.js b/e2e-commons/utils.js similarity index 100% rename from oracle-e2e/utils/utils.js rename to e2e-commons/utils.js diff --git a/oracle-e2e/test/ercToErc.js b/oracle-e2e/test/ercToErc.js index 23dd2e2d..8320b1f1 100644 --- a/oracle-e2e/test/ercToErc.js +++ b/oracle-e2e/test/ercToErc.js @@ -3,7 +3,7 @@ const Web3 = require('web3') const assert = require('assert') const promiseRetry = require('promise-retry') const { user, contractsPath } = require('../constants.json') -const { generateNewBlock } = require('../utils/utils') +const { generateNewBlock } = require('../../e2e-commons/utils') const abisDir = path.join(__dirname, '..', contractsPath, 'build/contracts') diff --git a/oracle-e2e/test/ercToNative.js b/oracle-e2e/test/ercToNative.js index 3d415f63..2e4263fb 100644 --- a/oracle-e2e/test/ercToNative.js +++ b/oracle-e2e/test/ercToNative.js @@ -3,7 +3,7 @@ const Web3 = require('web3') const assert = require('assert') const promiseRetry = require('promise-retry') const { user, contractsPath } = require('../constants.json') -const { generateNewBlock } = require('../utils/utils') +const { generateNewBlock } = require('../../e2e-commons/utils') const abisDir = path.join(__dirname, '..', contractsPath, 'build/contracts') diff --git a/oracle-e2e/test/nativeToErc.js b/oracle-e2e/test/nativeToErc.js index 76053e48..4e1ebfe1 100644 --- a/oracle-e2e/test/nativeToErc.js +++ b/oracle-e2e/test/nativeToErc.js @@ -3,7 +3,7 @@ const Web3 = require('web3') const assert = require('assert') const promiseRetry = require('promise-retry') const { user, validator, temp, contractsPath } = require('../constants.json') -const { generateNewBlock } = require('../utils/utils') +const { generateNewBlock } = require('../../e2e-commons/utils') const abisDir = path.join(__dirname, '..', contractsPath, '/build/contracts')