move remix-core code & tests to remix-debug

pull/7/head
Iuri Matias 7 years ago
parent e174d97bb0
commit 63a9299669
  1. 3
      .gitignore
  2. 3
      remix-core/test/tests.js
  3. 32
      remix-debug/index.js
  4. 17
      remix-debug/package.json
  5. 11
      remix-debug/src/Ethdebugger.js
  6. 0
      remix-debug/src/code/breakpointManager.js
  7. 0
      remix-debug/src/code/codeManager.js
  8. 0
      remix-debug/src/code/codeResolver.js
  9. 0
      remix-debug/src/code/codeUtils.js
  10. 0
      remix-debug/src/code/disassembler.js
  11. 0
      remix-debug/src/code/opcodes.js
  12. 0
      remix-debug/src/storage/mappingPreimages.js
  13. 0
      remix-debug/src/storage/storageResolver.js
  14. 0
      remix-debug/src/storage/storageViewer.js
  15. 0
      remix-debug/src/trace/traceAnalyser.js
  16. 0
      remix-debug/src/trace/traceCache.js
  17. 0
      remix-debug/src/trace/traceManager.js
  18. 0
      remix-debug/src/trace/traceRetriever.js
  19. 0
      remix-debug/src/trace/traceStepManager.js
  20. 0
      remix-debug/test/codeManager.js
  21. 0
      remix-debug/test/disassembler.js
  22. 0
      remix-debug/test/init.js
  23. 0
      remix-debug/test/resources/testWeb3.js
  24. 0
      remix-debug/test/resources/testWeb3.json
  25. 9
      remix-debug/test/tests.js
  26. 0
      remix-debug/test/traceManager.js

3
.gitignore vendored

@ -7,4 +7,5 @@ test-browser/reports/*
babelify-src babelify-src
docs/_build docs/_build
package-lock.json package-lock.json
.DS_Store .DS_Store
.tern-port

@ -1,3 +0,0 @@
require('./traceManager.js')
require('./codeManager.js')
require('./disassembler.js')

@ -2,6 +2,12 @@
var remixCore = require('remix-core') var remixCore = require('remix-core')
var EthDebugger = require('./src/Ethdebugger') var EthDebugger = require('./src/Ethdebugger')
var CodeManager = require('./src/code/codeManager')
var BreakpointManager = require('./src/code/breakpointManager')
var StorageViewer = require('./src/storage/storageViewer')
var StorageResolver = require('./src/storage/storageResolver')
var TraceManager = require('./src/trace/traceManager')
/* /*
Use of breakPointManager : Use of breakPointManager :
@ -12,11 +18,23 @@ var EthDebugger = require('./src/Ethdebugger')
*/ */
module.exports = { module.exports = {
EthDebugger: EthDebugger, EthDebugger: EthDebugger,
/** /**
* constructor * constructor
* *
* @param {Object} _debugger - type of EthDebugger * @param {Object} _debugger - type of EthDebugger
* @return {Function} _locationToRowConverter - function implemented by editor which return a column/line position for a char source location * @return {Function} _locationToRowConverter - function implemented by editor which return a column/line position for a char source location
*/ */
BreakpointManager: remixCore.code.BreakpointManager BreakpointManager: remixCore.code.BreakpointManager,
code: {
CodeManager: CodeManager,
BreakpointManager: BreakpointManager
},
storage: {
StorageViewer: StorageViewer,
StorageResolver: StorageResolver
},
trace: {
TraceManager: TraceManager
}
} }

@ -26,7 +26,7 @@
"ethereumjs-vm": "^2.3.3", "ethereumjs-vm": "^2.3.3",
"notify-error": "^1.2.0", "notify-error": "^1.2.0",
"npm-run-all": "^4.1.2", "npm-run-all": "^4.1.2",
"remix-core": "^0.0.15", "fast-async": "^6.1.2",
"remix-lib": "^0.2.9", "remix-lib": "^0.2.9",
"remix-solidity": "^0.1.11", "remix-solidity": "^0.1.11",
"solc": "https://github.com/ethereum/solc-js" "solc": "https://github.com/ethereum/solc-js"
@ -57,7 +57,8 @@
"node_modules/*", "node_modules/*",
"build/*", "build/*",
"test/resources/*" "test/resources/*"
] ],
"parser": "babel-eslint"
}, },
"babel": { "babel": {
"plugins": [ "plugins": [
@ -91,6 +92,18 @@
"sourceMaps": true, "sourceMaps": true,
"plugins": [ "plugins": [
[ [
[
"fast-async",
{
"runtimePatten": null,
"compiler": {
"promises": true,
"es7": true,
"noRuntime": true,
"wrapAwait": true
}
}
],
"transform-object-assign" "transform-object-assign"
] ]
], ],

@ -1,7 +1,10 @@
'use strict' 'use strict'
var remixCore = require('remix-core')
var TraceManager = remixCore.trace.TraceManager var CodeManager = require('./code/codeManager')
var StorageViewer = remixCore.storage.StorageViewer var StorageViewer = require('./storage/storageViewer')
var StorageResolver = require('./storage/storageResolver')
var TraceManager = require('./trace/traceManager')
var remixLib = require('remix-lib') var remixLib = require('remix-lib')
var traceHelper = remixLib.helpers.trace var traceHelper = remixLib.helpers.trace
var init = remixLib.init var init = remixLib.init
@ -9,13 +12,11 @@ var executionContext = remixLib.execution.executionContext
var EventManager = remixLib.EventManager var EventManager = remixLib.EventManager
var Web3Providers = remixLib.vm.Web3Providers var Web3Providers = remixLib.vm.Web3Providers
var DummyProvider = remixLib.vm.DummyProvider var DummyProvider = remixLib.vm.DummyProvider
var CodeManager = remixCore.code.CodeManager
var remixSolidity = require('remix-solidity') var remixSolidity = require('remix-solidity')
var SolidityProxy = remixSolidity.SolidityProxy var SolidityProxy = remixSolidity.SolidityProxy
var stateDecoder = remixSolidity.stateDecoder var stateDecoder = remixSolidity.stateDecoder
var localDecoder = remixSolidity.localDecoder var localDecoder = remixSolidity.localDecoder
var InternalCallTree = remixSolidity.InternalCallTree var InternalCallTree = remixSolidity.InternalCallTree
var StorageResolver = remixCore.storage.StorageResolver
/** /**
* Ethdebugger is a wrapper around a few classes that helps debugging a transaction * Ethdebugger is a wrapper around a few classes that helps debugging a transaction

@ -1,12 +1,17 @@
'use strict' 'use strict'
var tape = require('tape') var tape = require('tape')
var remixLib = require('remix-lib') var remixLib = require('remix-lib')
var remixCore = require('remix-core')
var compilerInput = remixLib.helpers.compiler.compilerInput var compilerInput = remixLib.helpers.compiler.compilerInput
var vmCall = require('./vmCall') var vmCall = require('./vmCall')
var Debugger = require('../src/Ethdebugger') var Debugger = require('../src/Ethdebugger')
var compiler = require('solc') var compiler = require('solc')
require('./traceManager.js')
require('./codeManager.js')
require('./disassembler.js')
var BreakpointManager = require('../src/code/breakpointManager')
tape('debug contract', function (t) { tape('debug contract', function (t) {
t.plan(12) t.plan(12)
var privateKey = new Buffer('dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a', 'hex') var privateKey = new Buffer('dae9801649ba2d95a21e688b56f77905e5667c44ce868ec83f82e838712a2c7a', 'hex')
@ -95,7 +100,7 @@ function testDebugging (t, debugManager) {
}) })
var sourceMappingDecoder = new remixLib.SourceMappingDecoder() var sourceMappingDecoder = new remixLib.SourceMappingDecoder()
var breakPointManager = new remixCore.code.BreakpointManager(debugManager, (rawLocation) => { var breakPointManager = new BreakpointManager(debugManager, (rawLocation) => {
return sourceMappingDecoder.convertOffsetToLineColumn(rawLocation, sourceMappingDecoder.getLinebreakPositions(ballot)) return sourceMappingDecoder.convertOffsetToLineColumn(rawLocation, sourceMappingDecoder.getLinebreakPositions(ballot))
}) })

Loading…
Cancel
Save