test files updated

pull/697/head
aniket-engg 4 years ago committed by Aniket
parent b8329729a7
commit d57f93a451
  1. 2
      libs/remix-debug/package.json
  2. 2
      libs/remix-debug/test/codeManager.ts
  3. 2
      libs/remix-debug/test/debugger.ts
  4. 38
      libs/remix-debug/test/decoder/decodeInfo.ts
  5. 2
      libs/remix-debug/test/decoder/localDecoder.ts
  6. 7
      libs/remix-debug/test/decoder/mockStorageResolver.ts
  7. 25
      libs/remix-debug/test/decoder/stateTests/mapping.ts
  8. 2
      libs/remix-debug/test/decoder/storageDecoder.ts
  9. 2
      libs/remix-debug/test/decoder/storageLocation.ts
  10. 2
      libs/remix-debug/test/disassembler.ts
  11. 6
      libs/remix-debug/test/helpers/compilerHelper.ts
  12. 4
      libs/remix-debug/test/init.ts
  13. 6
      libs/remix-debug/test/resources/ast.ts
  14. 12
      libs/remix-debug/test/resources/sourceMapping.ts
  15. 8
      libs/remix-debug/test/resources/testWeb3.ts
  16. 2
      libs/remix-debug/test/sourceLocationTracker.ts
  17. 18
      libs/remix-debug/test/tests.ts
  18. 4
      libs/remix-debug/test/traceManager.ts

@ -40,7 +40,7 @@
"tape": "^4.6.0"
},
"scripts": {
"test": "./../../node_modules/.bin/tape --require tsconfig-paths/register ./test/tests.ts"
"test": "./../../node_modules/.bin/ts-node --require tsconfig-paths/register ./../../node_modules/.bin/tape ./test/tests.ts"
},
"publishConfig": {
"access": "public"

@ -1,5 +1,5 @@
'use strict'
const tape = require('tape')
import tape from 'tape'
const TraceManager = require('../src/trace/traceManager')
const CodeManager = require('../src/code/codeManager')
const web3Test = require('./resources/testWeb3')

@ -1,4 +1,4 @@
var tape = require('tape')
import tape from 'tape'
var deepequal = require('deep-equal')
var remixLib = require('@remix-project/remix-lib')
var compilerInput = require('./helpers/compilerHelper').compilerInput

@ -1,21 +1,21 @@
'use strict'
var tape = require('tape')
var compiler = require('solc')
var astHelper = require('../../src/solidity-decoder/astHelper')
var decodeInfo = require('../../src/solidity-decoder/decodeInfo')
var stateDecoder = require('../../src/solidity-decoder/stateDecoder')
import tape from 'tape'
import { compile } from 'solc'
import * as astHelper from '../../src/solidity-decoder/astHelper'
import * as decodeInfo from '../../src/solidity-decoder/decodeInfo'
import * as stateDecoder from '../../src/solidity-decoder/stateDecoder'
var contracts = require('./contracts/miscContracts')
var simplecontracts = require('./contracts/simpleContract')
var compilerInput = require('../helpers/compilerHelper').compilerInput
var util = require('../../src/solidity-decoder/types/util')
import { compilerInput } from '../helpers/compilerHelper'
import * as util from '../../src/solidity-decoder/types/util'
tape('solidity', function (t) {
t.test('astHelper, decodeInfo', function (st) {
var output = compiler.compile(compilerInput(contracts))
var output = compile(compilerInput(contracts))
output = JSON.parse(output)
var state = astHelper.extractStateDefinitions('test.sol:contractUint', output.sources)
var states = astHelper.extractStatesDefinitions(output.sources)
var state: any = astHelper.extractStateDefinitions('test.sol:contractUint', output.sources, null)
var states = astHelper.extractStatesDefinitions(output.sources, null)
var stateDef = state.stateDefinitions
var parsedType = decodeInfo.parseType(stateDef[0].typeDescriptions.typeString, states, 'contractUint', util.extractLocationFromAstVariable(stateDef[0]))
checkDecodeInfo(st, parsedType, 1, 1, 'uint8')
@ -26,7 +26,7 @@ tape('solidity', function (t) {
parsedType = decodeInfo.parseType(stateDef[3].typeDescriptions.typeString, states, 'contractUint', util.extractLocationFromAstVariable(stateDef[3]))
checkDecodeInfo(st, parsedType, 1, 16, 'bytes16')
state = astHelper.extractStateDefinitions('test.sol:contractStructAndArray', output.sources)
state = astHelper.extractStateDefinitions('test.sol:contractStructAndArray', output.sources, null)
stateDef = state.stateDefinitions
parsedType = decodeInfo.parseType(stateDef[1].typeDescriptions.typeString, states, 'contractStructAndArray', util.extractLocationFromAstVariable(stateDef[1]))
checkDecodeInfo(st, parsedType, 2, 32, 'struct contractStructAndArray.structDef')
@ -35,7 +35,7 @@ tape('solidity', function (t) {
parsedType = decodeInfo.parseType(stateDef[3].typeDescriptions.typeString, states, 'contractStructAndArray', util.extractLocationFromAstVariable(stateDef[3]))
checkDecodeInfo(st, parsedType, 2, 32, 'bytes12[4]')
state = astHelper.extractStateDefinitions('test.sol:contractArray', output.sources)
state = astHelper.extractStateDefinitions('test.sol:contractArray', output.sources, null)
stateDef = state.stateDefinitions
parsedType = decodeInfo.parseType(stateDef[0].typeDescriptions.typeString, states, 'contractArray', util.extractLocationFromAstVariable(stateDef[0]))
checkDecodeInfo(st, parsedType, 1, 32, 'uint32[5]')
@ -44,12 +44,12 @@ tape('solidity', function (t) {
parsedType = decodeInfo.parseType(stateDef[2].typeDescriptions.typeString, states, 'contractArray', util.extractLocationFromAstVariable(stateDef[2]))
checkDecodeInfo(st, parsedType, 4, 32, 'int16[][3][][4]')
state = astHelper.extractStateDefinitions('test.sol:contractEnum', output.sources)
state = astHelper.extractStateDefinitions('test.sol:contractEnum', output.sources, null)
stateDef = state.stateDefinitions
parsedType = decodeInfo.parseType(stateDef[1].typeDescriptions.typeString, states, 'contractEnum')
parsedType = decodeInfo.parseType(stateDef[1].typeDescriptions.typeString, states, 'contractEnum', null)
checkDecodeInfo(st, parsedType, 1, 2, 'enum')
state = astHelper.extractStateDefinitions('test.sol:contractSmallVariable', output.sources)
state = astHelper.extractStateDefinitions('test.sol:contractSmallVariable', output.sources, null)
stateDef = state.stateDefinitions
parsedType = decodeInfo.parseType(stateDef[0].typeDescriptions.typeString, states, 'contractSmallVariable', util.extractLocationFromAstVariable(stateDef[0]))
checkDecodeInfo(st, parsedType, 1, 1, 'int8')
@ -64,10 +64,10 @@ tape('solidity', function (t) {
parsedType = decodeInfo.parseType(stateDef[5].typeDescriptions.typeString, states, 'contractSmallVariable', util.extractLocationFromAstVariable(stateDef[5]))
checkDecodeInfo(st, parsedType, 1, 2, 'int16')
output = compiler.compile(compilerInput(simplecontracts))
output = compile(compilerInput(simplecontracts))
output = JSON.parse(output)
state = astHelper.extractStateDefinitions('test.sol:simpleContract', output.sources)
states = astHelper.extractStatesDefinitions(output.sources)
state = astHelper.extractStateDefinitions('test.sol:simpleContract', output.sources, null)
states = astHelper.extractStatesDefinitions(output.sources, null)
stateDef = state.stateDefinitions
parsedType = decodeInfo.parseType(stateDef[2].typeDescriptions.typeString, states, 'simpleContract', util.extractLocationFromAstVariable(stateDef[2]))
checkDecodeInfo(st, parsedType, 2, 32, 'struct simpleContract.structDef')
@ -76,7 +76,7 @@ tape('solidity', function (t) {
parsedType = decodeInfo.parseType(stateDef[4].typeDescriptions.typeString, states, 'simpleContract', util.extractLocationFromAstVariable(stateDef[4]))
checkDecodeInfo(st, parsedType, 1, 1, 'enum')
state = astHelper.extractStateDefinitions('test.sol:test2', output.sources)
state = astHelper.extractStateDefinitions('test.sol:test2', output.sources, null)
stateDef = state.stateDefinitions
parsedType = decodeInfo.parseType(stateDef[0].typeDescriptions.typeString, states, 'test1', util.extractLocationFromAstVariable(stateDef[0]))
checkDecodeInfo(st, parsedType, 1, 32, 'struct test1.str')

@ -1,5 +1,5 @@
'use strict'
var tape = require('tape')
import tape from 'tape'
var compiler = require('solc')
var intLocal = require('./contracts/intLocal')
var miscLocal = require('./contracts/miscLocal')

@ -2,7 +2,10 @@
var remixLib = require('@remix-project/remix-lib')
var util = remixLib.util
class MockStorageResolver {
export class MockStorageResolver {
storage
constructor (_storage) {
this.storage = {}
for (var k in _storage) {
@ -35,5 +38,3 @@ class MockStorageResolver {
toCache (address, storage, complete) {
}
}
module.exports = MockStorageResolver

@ -1,20 +1,18 @@
var compilerInput = require('../../helpers/compilerHelper').compilerInput
var TraceManager = require('../../../src/trace/traceManager')
var compiler = require('solc')
var stateDecoder = require('../../../src/solidity-decoder/stateDecoder')
var vmCall = require('../vmCall')
var StorageResolver = require('../../../src/storage/storageResolver')
var StorageViewer = require('../../../src/storage/storageViewer')
import { compilerInput } from '../../helpers/compilerHelper'
import { TraceManager } from '../../../src/trace/traceManager'
import { compile } from 'solc'
import * as stateDecoder from '../../../src/solidity-decoder/stateDecoder'
import { sendTx, initVM } from '../vmCall'
import { StorageResolver } from '../../../src/storage/storageResolver'
import { StorageViewer } from '../../../src/storage/storageViewer'
module.exports = function testMappingStorage (st, cb) {
var mappingStorage = require('../contracts/mappingStorage')
var privateKey = Buffer.from('dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a', 'hex')
var vm = vmCall.initVM(st, privateKey)
var output = compiler.compile(compilerInput(mappingStorage.contract))
var vm = initVM(st, privateKey)
var output = compile(compilerInput(mappingStorage.contract))
output = JSON.parse(output)
vmCall.sendTx(vm, {nonce: 0, privateKey: privateKey}, null, 0, output.contracts['test.sol']['SimpleMappingState'].evm.bytecode.object, function (error, txHash) {
sendTx(vm, {nonce: 0, privateKey: privateKey}, null, 0, output.contracts['test.sol']['SimpleMappingState'].evm.bytecode.object, function (error, txHash) {
if (error) {
console.log(error)
st.end(error)
@ -32,7 +30,7 @@ module.exports = function testMappingStorage (st, cb) {
}
function testMapping (st, vm, privateKey, contractAddress, output, cb) {
vmCall.sendTx(vm, {nonce: 1, privateKey: privateKey}, contractAddress, 0, '2fd0a83a00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000001074686973206973206120737472696e6700000000000000000000000000000000',
sendTx(vm, {nonce: 1, privateKey: privateKey}, contractAddress, 0, '2fd0a83a00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000001074686973206973206120737472696e6700000000000000000000000000000000',
function (error, txHash) {
if (error) {
console.log(error)
@ -45,7 +43,6 @@ function testMapping (st, vm, privateKey, contractAddress, output, cb) {
st.end(error)
} else {
var traceManager = new TraceManager({web3: vm.web3})
traceManager.resolveTrace(tx).then(() => {
var storageViewer = new StorageViewer({
stepIndex: 268,

@ -1,5 +1,5 @@
'use strict'
var tape = require('tape')
import tape from 'tape'
var compiler = require('solc')
var stateDecoder = require('../../src/solidity-decoder/stateDecoder')
var MockStorageResolver = require('./mockStorageResolver')

@ -1,5 +1,5 @@
'use strict'
var tape = require('tape')
import tape from 'tape'
var compiler = require('solc')
var stateDecoder = require('../../src/solidity-decoder/stateDecoder')
var contracts = require('./contracts/miscContracts')

@ -1,6 +1,6 @@
'use strict'
const tape = require('tape')
import tape from 'tape'
const disassemble = require('../src/code/disassembler').disassemble
tape('Disassembler', function (t) {

@ -1,8 +1,4 @@
module.exports = {
compilerInput: compilerInput
}
function compilerInput (contracts) {
export function compilerInput (contracts) {
return JSON.stringify({
language: 'Solidity',
sources: {

@ -1,4 +1,4 @@
var init = {
export const init = {
overrideWeb3: function (web3, web3Override) {
web3.eth.getCode = web3Override.getCode
web3.debug.traceTransaction = web3Override.traceTransaction
@ -27,5 +27,3 @@ var init = {
}
}
}
module.exports = init

@ -1,8 +1,8 @@
const node = {}
node.ast = {"legacyAST":{"children":[{"attributes":{"fullyImplemented":true,"isLibrary":false,"linearizedBaseContracts":[5640396],"name":"test"},"children":[{"attributes":{"name":"x","type":"int256"},"children":[{"attributes":{"name":"int"},"id":5657860,"name":"ElementaryTypeName","src":"21:3:11"}],"id":5658100,"name":"VariableDeclaration","src":"21:5:11"},{"attributes":{"name":"y","type":"int256"},"children":[{"attributes":{"name":"int"},"id":5658180,"name":"ElementaryTypeName","src":"38:3:11"}],"id":5658268,"name":"VariableDeclaration","src":"38:5:11"},{"attributes":{"constant":false,"name":"set","public":true},"children":[{"children":[{"attributes":{"name":"_x","type":"int256"},"children":[{"attributes":{"name":"int"},"id":5658404,"name":"ElementaryTypeName","src":"68:3:11"}],"id":5658492,"name":"VariableDeclaration","src":"68:6:11"}],"id":5658572,"name":"ParameterList","src":"67:8:11"},{"children":[{"attributes":{"name":"_r","type":"int256"},"children":[{"attributes":{"name":"int"},"id":5658628,"name":"ElementaryTypeName","src":"85:3:11"}],"id":5658716,"name":"VariableDeclaration","src":"85:6:11"}],"id":5658796,"name":"ParameterList","src":"84:8:11"},{"children":[{"children":[{"attributes":{"operator":"=","type":"int256"},"children":[{"attributes":{"type":"int256","value":"x"},"id":5658900,"name":"Identifier","src":"108:1:11"},{"attributes":{"type":"int256","value":"_x"},"id":5658980,"name":"Identifier","src":"112:2:11"}],"id":5657492,"name":"Assignment","src":"108:6:11"}],"id":5659028,"name":"ExpressionStatement","src":"108:6:11"},{"children":[{"attributes":{"operator":"=","type":"int256"},"children":[{"attributes":{"type":"int256","value":"y"},"id":5659116,"name":"Identifier","src":"125:1:11"},{"attributes":{"string":null,"type":"int_const 10","value":"10"},"id":5659196,"name":"Literal","src":"129:2:11"}],"id":5659252,"name":"Assignment","src":"125:6:11"}],"id":5659316,"name":"ExpressionStatement","src":"125:6:11"},{"children":[{"attributes":{"operator":"=","type":"int256"},"children":[{"attributes":{"type":"int256","value":"_r"},"id":5659428,"name":"Identifier","src":"141:2:11"},{"attributes":{"type":"int256","value":"x"},"id":5639308,"name":"Identifier","src":"146:1:11"}],"id":5639356,"name":"Assignment","src":"141:6:11"}],"id":5639420,"name":"ExpressionStatement","src":"141:6:11"}],"id":5639516,"name":"Block","src":"97:57:11"}],"id":5639612,"name":"FunctionDefinition","src":"55:99:11"},{"attributes":{"constant":false,"name":"get","public":true},"children":[{"children":[],"id":5639764,"name":"ParameterList","src":"179:2:11"},{"children":[{"attributes":{"name":"x","type":"uint256"},"children":[{"attributes":{"name":"uint"},"id":5639820,"name":"ElementaryTypeName","src":"191:4:11"}],"id":5639908,"name":"VariableDeclaration","src":"191:6:11"},{"attributes":{"name":"y","type":"uint256"},"children":[{"attributes":{"name":"uint"},"id":5639988,"name":"ElementaryTypeName","src":"199:4:11"}],"id":5640076,"name":"VariableDeclaration","src":"199:6:11"}],"id":5640156,"name":"ParameterList","src":"190:16:11"},{"children":[],"id":5640212,"name":"Block","src":"212:17:11"}],"id":5640276,"name":"FunctionDefinition","src":"167:62:11"}],"id":5640396,"name":"ContractDefinition","src":"0:231:11"}],"name":"SourceUnit"}}
node['ast'] = {"legacyAST":{"children":[{"attributes":{"fullyImplemented":true,"isLibrary":false,"linearizedBaseContracts":[5640396],"name":"test"},"children":[{"attributes":{"name":"x","type":"int256"},"children":[{"attributes":{"name":"int"},"id":5657860,"name":"ElementaryTypeName","src":"21:3:11"}],"id":5658100,"name":"VariableDeclaration","src":"21:5:11"},{"attributes":{"name":"y","type":"int256"},"children":[{"attributes":{"name":"int"},"id":5658180,"name":"ElementaryTypeName","src":"38:3:11"}],"id":5658268,"name":"VariableDeclaration","src":"38:5:11"},{"attributes":{"constant":false,"name":"set","public":true},"children":[{"children":[{"attributes":{"name":"_x","type":"int256"},"children":[{"attributes":{"name":"int"},"id":5658404,"name":"ElementaryTypeName","src":"68:3:11"}],"id":5658492,"name":"VariableDeclaration","src":"68:6:11"}],"id":5658572,"name":"ParameterList","src":"67:8:11"},{"children":[{"attributes":{"name":"_r","type":"int256"},"children":[{"attributes":{"name":"int"},"id":5658628,"name":"ElementaryTypeName","src":"85:3:11"}],"id":5658716,"name":"VariableDeclaration","src":"85:6:11"}],"id":5658796,"name":"ParameterList","src":"84:8:11"},{"children":[{"children":[{"attributes":{"operator":"=","type":"int256"},"children":[{"attributes":{"type":"int256","value":"x"},"id":5658900,"name":"Identifier","src":"108:1:11"},{"attributes":{"type":"int256","value":"_x"},"id":5658980,"name":"Identifier","src":"112:2:11"}],"id":5657492,"name":"Assignment","src":"108:6:11"}],"id":5659028,"name":"ExpressionStatement","src":"108:6:11"},{"children":[{"attributes":{"operator":"=","type":"int256"},"children":[{"attributes":{"type":"int256","value":"y"},"id":5659116,"name":"Identifier","src":"125:1:11"},{"attributes":{"string":null,"type":"int_const 10","value":"10"},"id":5659196,"name":"Literal","src":"129:2:11"}],"id":5659252,"name":"Assignment","src":"125:6:11"}],"id":5659316,"name":"ExpressionStatement","src":"125:6:11"},{"children":[{"attributes":{"operator":"=","type":"int256"},"children":[{"attributes":{"type":"int256","value":"_r"},"id":5659428,"name":"Identifier","src":"141:2:11"},{"attributes":{"type":"int256","value":"x"},"id":5639308,"name":"Identifier","src":"146:1:11"}],"id":5639356,"name":"Assignment","src":"141:6:11"}],"id":5639420,"name":"ExpressionStatement","src":"141:6:11"}],"id":5639516,"name":"Block","src":"97:57:11"}],"id":5639612,"name":"FunctionDefinition","src":"55:99:11"},{"attributes":{"constant":false,"name":"get","public":true},"children":[{"children":[],"id":5639764,"name":"ParameterList","src":"179:2:11"},{"children":[{"attributes":{"name":"x","type":"uint256"},"children":[{"attributes":{"name":"uint"},"id":5639820,"name":"ElementaryTypeName","src":"191:4:11"}],"id":5639908,"name":"VariableDeclaration","src":"191:6:11"},{"attributes":{"name":"y","type":"uint256"},"children":[{"attributes":{"name":"uint"},"id":5639988,"name":"ElementaryTypeName","src":"199:4:11"}],"id":5640076,"name":"VariableDeclaration","src":"199:6:11"}],"id":5640156,"name":"ParameterList","src":"190:16:11"},{"children":[],"id":5640212,"name":"Block","src":"212:17:11"}],"id":5640276,"name":"FunctionDefinition","src":"167:62:11"}],"id":5640396,"name":"ContractDefinition","src":"0:231:11"}],"name":"SourceUnit"}}
node.ast.ast = {
node['ast'].ast = {
absolutePath: 'sample.sol',
exportedSymbols: { test: [ 33 ] },
id: 34,
@ -181,7 +181,7 @@ node.ast.ast = {
}
node.source = `contract test {
node['source'] = `contract test {
int x;
int y;

@ -1,6 +1,6 @@
const sourceRuntimeMapping = {}
sourceRuntimeMapping.mapping = '0:205:4:-;;;;;;;;;;;;;;;;;;;;;;55:74;;;;;;;;;;;;;;;;;;;;;;;;;;142:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;55:74;103:2;99:1;;:6;;;;;120:2;116:1;;:6;;;;;55:74;;;:::o;142:61::-;166:6;174;142:61;;;:::o'
sourceRuntimeMapping.source = `contract test {
sourceRuntimeMapping['mapping'] = '0:205:4:-;;;;;;;;;;;;;;;;;;;;;;55:74;;;;;;;;;;;;;;;;;;;;;;;;;;142:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;55:74;103:2;99:1;;:6;;;;;120:2;116:1;;:6;;;;;55:74;;;:::o;142:61::-;166:6;174;142:61;;;:::o'
sourceRuntimeMapping['source'] = `contract test {
int x;
int y;
@ -17,8 +17,8 @@ sourceRuntimeMapping.source = `contract test {
}
}`
sourceRuntimeMapping.tokenSaleChallengeSourceMap = '0:286:0:-:0;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;0:286:0;;;;;;;;;;;;;;;;;;;;;12:1:-1;9;2:12;34:44:0;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;34:44:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;161:123;;;:::i;:::-;;;;;;;;;;;;;;;;;;;34:44;;;;;;;;;;;;;;;;;:::o;161:123::-;192:7;211:10;:19;;:48;119:7;231:9;;:27;211:48;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;211:48:0;276:1;269:8;;161:123;:::o'
sourceRuntimeMapping.tokenSaleChallengeSource = `
sourceRuntimeMapping['tokenSaleChallengeSourceMap'] = '0:286:0:-:0;;;;5:9:-1;2:2;;;27:1;24;17:12;2:2;0:286:0;;;;;;;;;;;;;;;;;;;;;12:1:-1;9;2:12;34:44:0;;;;;;15:2:-1;10:3;7:11;4:2;;;31:1;28;21:12;4:2;34:44:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;161:123;;;:::i;:::-;;;;;;;;;;;;;;;;;;;34:44;;;;;;;;;;;;;;;;;:::o;161:123::-;192:7;211:10;:19;;:48;119:7;231:9;;:27;211:48;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;211:48:0;276:1;269:8;;161:123;:::o'
sourceRuntimeMapping['tokenSaleChallengeSource'] = `
contract TokenSaleChallenge {
mapping(address => uint256) public balanceOf;
uint256 constant PRICE_PER_TOKEN = 1 ether;
@ -31,8 +31,8 @@ contract TokenSaleChallenge {
}
`
sourceRuntimeMapping.ballotSourceMap = '33:1970:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;33:1970:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;712:577;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;712:577:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;1641:360;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;495:164;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;495:164:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;1349:286;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1349:286:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;712:577;759:20;782:6;:18;789:10;782:18;;;;;;;;;;;;;;;759:41;;835:6;:12;;;;;;;;;;;;831:25;;;849:7;;;831:25;865:115;903:1;872:33;;:6;:10;879:2;872:10;;;;;;;;;;;;;;;:19;;;;;;;;;;;;:33;;;;:70;;;;;932:10;909:33;;:6;:10;916:2;909:10;;;;;;;;;;;;;;;:19;;;;;;;;;;;;:33;;;;872:70;865:115;;;961:6;:10;968:2;961:10;;;;;;;;;;;;;;;:19;;;;;;;;;;;;956:24;;865:115;;;1000:10;994:16;;:2;:16;;;990:29;;;1012:7;;;990:29;1043:4;1028:6;:12;;;:19;;;;;;;;;;;;;;;;;;1075:2;1057:6;:15;;;:20;;;;;;;;;;;;;;;;;;1087:24;1114:6;:10;1121:2;1114:10;;;;;;;;;;;;;;;1087:37;;1138:10;:16;;;;;;;;;;;;1134:148;;;1208:6;:13;;;1168:9;1178:10;:15;;;;;;;;;;;;1168:26;;;;;;;;;;;;;;;;;:36;;;:53;;;;;;;;;;;1134:148;;;1269:6;:13;;;1248:10;:17;;;:34;;;;;;;;;;;1134:148;712:577;;;;:::o;1641:360::-;1689:22;1723:24;1750:1;1723:28;;1766:10;1779:1;1766:14;;1761:234;1789:9;:16;;;;1782:4;:23;;;1761:234;;;1859:16;1831:9;1841:4;1831:15;;;;;;;;;;;;;;;;;:25;;;:44;1827:168;;;1914:9;1924:4;1914:15;;;;;;;;;;;;;;;;;:25;;;1895:44;;1976:4;1957:23;;1827:168;1807:6;;;;;;;1761:234;;;;1641:360;;:::o;495:164::-;572:11;;;;;;;;;;;558:25;;:10;:25;;;;:50;;;;587:6;:15;594:7;587:15;;;;;;;;;;;;;;;:21;;;;;;;;;;;;558:50;554:63;;;610:7;;554:63;651:1;626:6;:15;633:7;626:15;;;;;;;;;;;;;;;:22;;:26;;;;495:164;;:::o;1349:286::-;1398:20;1421:6;:18;1428:10;1421:18;;;;;;;;;;;;;;;1398:41;;1453:6;:12;;;;;;;;;;;;:46;;;;1483:9;:16;;;;1469:10;:30;;;;1453:46;1449:59;;;1501:7;;;1449:59;1532:4;1517:6;:12;;;:19;;;;;;;;;;;;;;;;;;1560:10;1546:6;:11;;;:24;;;;;;;;;;;;;;;;;;1615:6;:13;;;1580:9;1590:10;1580:21;;;;;;;;;;;;;;;;;:31;;;:48;;;;;;;;;;;1349:286;;;:::o'
sourceRuntimeMapping.ballotSource = `
sourceRuntimeMapping['ballotSourceMap'] = '33:1970:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;33:1970:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;712:577;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;712:577:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;1641:360;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;495:164;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;495:164:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;1349:286;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1349:286:0;;;;;;;;;;;;;;;;;;;:::i;:::-;;712:577;759:20;782:6;:18;789:10;782:18;;;;;;;;;;;;;;;759:41;;835:6;:12;;;;;;;;;;;;831:25;;;849:7;;;831:25;865:115;903:1;872:33;;:6;:10;879:2;872:10;;;;;;;;;;;;;;;:19;;;;;;;;;;;;:33;;;;:70;;;;;932:10;909:33;;:6;:10;916:2;909:10;;;;;;;;;;;;;;;:19;;;;;;;;;;;;:33;;;;872:70;865:115;;;961:6;:10;968:2;961:10;;;;;;;;;;;;;;;:19;;;;;;;;;;;;956:24;;865:115;;;1000:10;994:16;;:2;:16;;;990:29;;;1012:7;;;990:29;1043:4;1028:6;:12;;;:19;;;;;;;;;;;;;;;;;;1075:2;1057:6;:15;;;:20;;;;;;;;;;;;;;;;;;1087:24;1114:6;:10;1121:2;1114:10;;;;;;;;;;;;;;;1087:37;;1138:10;:16;;;;;;;;;;;;1134:148;;;1208:6;:13;;;1168:9;1178:10;:15;;;;;;;;;;;;1168:26;;;;;;;;;;;;;;;;;:36;;;:53;;;;;;;;;;;1134:148;;;1269:6;:13;;;1248:10;:17;;;:34;;;;;;;;;;;1134:148;712:577;;;;:::o;1641:360::-;1689:22;1723:24;1750:1;1723:28;;1766:10;1779:1;1766:14;;1761:234;1789:9;:16;;;;1782:4;:23;;;1761:234;;;1859:16;1831:9;1841:4;1831:15;;;;;;;;;;;;;;;;;:25;;;:44;1827:168;;;1914:9;1924:4;1914:15;;;;;;;;;;;;;;;;;:25;;;1895:44;;1976:4;1957:23;;1827:168;1807:6;;;;;;;1761:234;;;;1641:360;;:::o;495:164::-;572:11;;;;;;;;;;;558:25;;:10;:25;;;;:50;;;;587:6;:15;594:7;587:15;;;;;;;;;;;;;;;:21;;;;;;;;;;;;558:50;554:63;;;610:7;;554:63;651:1;626:6;:15;633:7;626:15;;;;;;;;;;;;;;;:22;;:26;;;;495:164;;:::o;1349:286::-;1398:20;1421:6;:18;1428:10;1421:18;;;;;;;;;;;;;;;1398:41;;1453:6;:12;;;;;;;;;;;;:46;;;;1483:9;:16;;;;1469:10;:30;;;;1453:46;1449:59;;;1501:7;;;1449:59;1532:4;1517:6;:12;;;:19;;;;;;;;;;;;;;;;;;1560:10;1546:6;:11;;;:24;;;;;;;;;;;;;;;;;;1615:6;:13;;;1580:9;1590:10;1580:21;;;;;;;;;;;;;;;;;:31;;;:48;;;;;;;;;;;1349:286;;;:::o'
sourceRuntimeMapping['ballotSource'] = `
pragma solidity >=0.4.22 <0.6.0;
contract Ballot {

@ -1,12 +1,12 @@
'use strict'
var init = require('../init')
var web3Override = {}
import { init } from '../init'
var web3Override: Record<string, Record<string, unknown>> = {}
web3Override.eth = {}
web3Override.debug = {}
var data = init.readFile(require('path').resolve(__dirname, 'testWeb3.json'))
var data = init.readFile(require('path').resolve(__dirname, 'testWeb3.json'), null)
data = JSON.parse(data)
var traceWithABIEncoder = init.readFile(require('path').resolve(__dirname, 'traceWithABIEncoder.json'))
var traceWithABIEncoder = init.readFile(require('path').resolve(__dirname, 'traceWithABIEncoder.json'), null)
traceWithABIEncoder =
data.testTraces['0x20ef65b8b186ca942fcccd634f37074dde49b541c27994fc7596740ef44cfd53'] = JSON.parse(traceWithABIEncoder)

@ -1,5 +1,5 @@
'use strict'
const tape = require('tape')
import tape from 'tape'
const TraceManager = require('../src/trace/traceManager')
const CodeManager = require('../src/code/codeManager')
const web3Test = require('./resources/testWeb3')

@ -1,12 +1,12 @@
'use strict'
require('./traceManager.js')
require('./codeManager.js')
require('./disassembler.js')
require('./sourceMappingDecoder.js')
require('./sourceLocationTracker.js')
require('./decoder/decodeInfo.js')
require('./decoder/storageLocation.js')
require('./decoder/storageDecoder.js')
require('./decoder/localDecoder.js')
require('./traceManager')
require('./codeManager')
require('./disassembler')
require('./sourceMappingDecoder')
require('./sourceLocationTracker')
require('./decoder/decodeInfo')
require('./decoder/storageLocation')
require('./decoder/storageDecoder')
require('./decoder/localDecoder')
require('./debugger.js')

@ -1,6 +1,6 @@
'use strict'
const TraceManager = require('../src/trace/traceManager')
const tape = require('tape')
import { TraceManager } from '../src/trace/traceManager'
import tape from 'tape'
const web3Test = require('./resources/testWeb3')
tape('TraceManager', function (t) {

Loading…
Cancel
Save