pull/3094/head
yann300 7 years ago
parent 954a1932f5
commit 9d2c032516
  1. 4
      remix-solidity/test/decoder/localDecoder.js
  2. 9
      remix-solidity/test/decoder/stateTests/mapping.js
  3. 3
      remix-solidity/test/decoder/vmCall.js

@ -32,7 +32,9 @@ function test (st, vm, privateKey) {
misc2LocalTest(st, vm, privateKey, output.contracts['test.sol']['miscLocal2'].evm.bytecode.object, output, function () {
output = compiler.compileStandardWrapper(compilerInput(structArrayLocal.contract))
output = JSON.parse(output)
structArrayLocalTest(st, vm, privateKey, output.contracts['test.sol']['structArrayLocal'].evm.bytecode.object, output, function () {})
structArrayLocalTest(st, vm, privateKey, output.contracts['test.sol']['structArrayLocal'].evm.bytecode.object, output, function () {
st.end()
})
})
})
})

@ -17,12 +17,10 @@ module.exports = function testMappingStorage (st, cb) {
} else {
remixLib.global.web3.eth.getTransaction(txHash, (error, tx) => {
if (error) {
console.log(error)
st.end(error)
} else {
testMapping(st, vm, privateKey, tx.contractAddress, output, (error) => {
st.end(error)
cb()
})
testMapping(st, vm, privateKey, tx.contractAddress, output, cb)
}
})
}
@ -39,6 +37,7 @@ function testMapping (st, vm, privateKey, contractAddress, output, cb) {
console.log(txHash)
remixLib.global.web3.eth.getTransaction(txHash, (error, tx) => {
if (error) {
console.log(error)
st.end(error)
} else {
var TraceManager = require('remix-core').trace.TraceManager
@ -62,7 +61,7 @@ function testMapping (st, vm, privateKey, contractAddress, output, cb) {
st.equal(result['_iBreakSolidityStateInt'].type, 'mapping(uint256 => uint256)')
st.equal(result['_iBreakSolidityStateInt'].value['0000000000000000000000000000000000000000000000000000000000000001'].value, '1')
st.equal(result['_iBreakSolidityStateInt'].value['0000000000000000000000000000000000000000000000000000000000000001'].type, 'uint256')
// st.end()
cb()
}, (reason) => {
console.log('fail')
st.end(reason)

@ -3,6 +3,7 @@ var utileth = require('ethereumjs-util')
var Tx = require('ethereumjs-tx')
var Block = require('ethereumjs-block')
var BN = require('ethereumjs-util').BN
var remixLib = require('remix-lib')
function sendTx (vm, from, to, value, data, cb) {
var tx = new Tx({
@ -33,7 +34,6 @@ function sendTx (vm, from, to, value, data, cb) {
Init VM / Send Transaction
*/
function initVM (st, privateKey) {
var remixLib = require('remix-lib')
var utileth = require('ethereumjs-util')
var VM = require('ethereumjs-vm')
var Web3Providers = remixLib.vm.Web3Providers
@ -52,7 +52,6 @@ function initVM (st, privateKey) {
st.fail(mes)
} else {
remixLib.global.web3 = obj
st.end()
}
})
return vm

Loading…
Cancel
Save