From 7c9cd9bdaff62074a68e6f6bf2863f3400dfce5b Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Wed, 20 Jun 2018 09:59:22 -0400 Subject: [PATCH] remove global web3 references from remix-solidity tests --- remix-solidity/test/decoder/localsTests/int.js | 3 +-- remix-solidity/test/decoder/localsTests/misc.js | 3 +-- remix-solidity/test/decoder/localsTests/misc2.js | 3 +-- remix-solidity/test/decoder/localsTests/structArray.js | 3 +-- remix-solidity/test/decoder/stateTests/mapping.js | 4 ++-- remix-solidity/test/decoder/vmCall.js | 2 +- 6 files changed, 7 insertions(+), 11 deletions(-) diff --git a/remix-solidity/test/decoder/localsTests/int.js b/remix-solidity/test/decoder/localsTests/int.js index 62cc201429..ac40bfd720 100644 --- a/remix-solidity/test/decoder/localsTests/int.js +++ b/remix-solidity/test/decoder/localsTests/int.js @@ -6,7 +6,6 @@ var vmCall = require('../vmCall') var remixLib = require('remix-lib') var traceHelper = remixLib.helpers.trace -var global = remixLib.global var SolidityProxy = require('../../../src/decoder/solidityProxy') var InternalCallTree = require('../../../src/decoder/internalCallTree') var EventManager = remixLib.EventManager @@ -17,7 +16,7 @@ module.exports = function (st, vm, privateKey, contractBytecode, compilationResu if (error) { st.fail(error) } else { - global.web3.getTransaction(txHash, function (error, tx) { + vm.web3.eth.getTransaction(txHash, function (error, tx) { if (error) { st.fail(error) } else { diff --git a/remix-solidity/test/decoder/localsTests/misc.js b/remix-solidity/test/decoder/localsTests/misc.js index 684e0812cc..1db78b16bb 100644 --- a/remix-solidity/test/decoder/localsTests/misc.js +++ b/remix-solidity/test/decoder/localsTests/misc.js @@ -5,7 +5,6 @@ var CodeManager = remixCore.code.CodeManager var vmCall = require('../vmCall') var remixLib = require('remix-lib') var traceHelper = remixLib.helpers.trace -var global = remixLib.global var SolidityProxy = require('../../../src/decoder/solidityProxy') var InternalCallTree = require('../../../src/decoder/internalCallTree') var EventManager = remixLib.EventManager @@ -16,7 +15,7 @@ module.exports = function (st, vm, privateKey, contractBytecode, compilationResu if (error) { st.fail(error) } else { - global.web3.getTransaction(txHash, function (error, tx) { + vm.web3.eth.getTransaction(txHash, function (error, tx) { if (error) { st.fail(error) } else { diff --git a/remix-solidity/test/decoder/localsTests/misc2.js b/remix-solidity/test/decoder/localsTests/misc2.js index 69d9bb0ccc..c7b6c83e61 100644 --- a/remix-solidity/test/decoder/localsTests/misc2.js +++ b/remix-solidity/test/decoder/localsTests/misc2.js @@ -5,7 +5,6 @@ var CodeManager = remixCore.code.CodeManager var vmCall = require('../vmCall') var remixLib = require('remix-lib') var traceHelper = remixLib.helpers.trace -var global = remixLib.global var SolidityProxy = require('../../../src/decoder/solidityProxy') var InternalCallTree = require('../../../src/decoder/internalCallTree') var EventManager = remixLib.EventManager @@ -16,7 +15,7 @@ module.exports = function (st, vm, privateKey, contractBytecode, compilationResu if (error) { st.fail(error) } else { - global.web3.getTransaction(txHash, function (error, tx) { + vm.web3.eth.getTransaction(txHash, function (error, tx) { if (error) { st.fail(error) } else { diff --git a/remix-solidity/test/decoder/localsTests/structArray.js b/remix-solidity/test/decoder/localsTests/structArray.js index 3a3d0014d6..e46d5d2956 100644 --- a/remix-solidity/test/decoder/localsTests/structArray.js +++ b/remix-solidity/test/decoder/localsTests/structArray.js @@ -5,7 +5,6 @@ var CodeManager = remixCore.code.CodeManager var vmCall = require('../vmCall') var remixLib = require('remix-lib') var traceHelper = remixLib.helpers.trace -var global = remixLib.global var SolidityProxy = require('../../../src/decoder/solidityProxy') var InternalCallTree = require('../../../src/decoder/internalCallTree') var EventManager = remixLib.EventManager @@ -16,7 +15,7 @@ module.exports = function (st, vm, privateKey, contractBytecode, compilationResu if (error) { st.fail(error) } else { - global.web3.getTransaction(txHash, function (error, tx) { + vm.web3.eth.getTransaction(txHash, function (error, tx) { if (error) { st.fail(error) } else { diff --git a/remix-solidity/test/decoder/stateTests/mapping.js b/remix-solidity/test/decoder/stateTests/mapping.js index 8c3cea1675..57ef0c8937 100644 --- a/remix-solidity/test/decoder/stateTests/mapping.js +++ b/remix-solidity/test/decoder/stateTests/mapping.js @@ -15,7 +15,7 @@ module.exports = function testMappingStorage (st, cb) { console.log(error) st.end(error) } else { - remixLib.global.web3.eth.getTransaction(txHash, (error, tx) => { + vm.web3.eth.getTransaction(txHash, (error, tx) => { if (error) { console.log(error) st.end(error) @@ -35,7 +35,7 @@ function testMapping (st, vm, privateKey, contractAddress, output, cb) { st.end(error) } else { console.log(txHash) - remixLib.global.web3.eth.getTransaction(txHash, (error, tx) => { + vm.web3.eth.getTransaction(txHash, (error, tx) => { if (error) { console.log(error) st.end(error) diff --git a/remix-solidity/test/decoder/vmCall.js b/remix-solidity/test/decoder/vmCall.js index 11abc857a0..4613ef3040 100644 --- a/remix-solidity/test/decoder/vmCall.js +++ b/remix-solidity/test/decoder/vmCall.js @@ -51,8 +51,8 @@ function initVM (st, privateKey) { console.log(mes) st.fail(mes) } else { - remixLib.global.web3 = obj remixLib.global.web3Debug = obj + vm.web3 = obj } }) return vm