diff --git a/embark-ui/package-lock.json b/embark-ui/package-lock.json
index ce78d3b5..1b5f3406 100644
--- a/embark-ui/package-lock.json
+++ b/embark-ui/package-lock.json
@@ -12194,14 +12194,6 @@
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
},
- "typedarray-to-buffer": {
- "version": "3.1.5",
- "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz",
- "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==",
- "requires": {
- "is-typedarray": "^1.0.0"
- }
- },
"ua-parser-js": {
"version": "0.7.18",
"resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.18.tgz",
@@ -12932,8 +12924,19 @@
"integrity": "sha512-wAnENuZx75T5ZSrT2De2LOaUuPf2yRjq1VfcbD7+Zd79F3DZZLBJcPyCNVQ1U0fAXt0wfgCKl7sVw5pffqR9Bw==",
"requires": {
"underscore": "1.8.3",
- "web3-core-helpers": "1.0.0-beta.36",
- "websocket": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2"
+ "web3-core-helpers": "1.0.0-beta.36"
+ },
+ "dependencies": {
+ "websocket": {
+ "version": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2",
+ "from": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2",
+ "requires": {
+ "debug": "^2.2.0",
+ "nan": "^2.3.3",
+ "typedarray-to-buffer": "^3.1.2",
+ "yaeti": "^0.0.6"
+ }
+ }
}
},
"web3-shh": {
@@ -13371,16 +13374,6 @@
"source-map": "~0.6.1"
}
},
- "websocket": {
- "version": "git://github.com/frozeman/WebSocket-Node.git#6c72925e3f8aaaea8dc8450f97627e85263999f2",
- "from": "git://github.com/frozeman/WebSocket-Node.git#browserifyCompatible",
- "requires": {
- "debug": "^2.2.0",
- "nan": "^2.3.3",
- "typedarray-to-buffer": "^3.1.2",
- "yaeti": "^0.0.6"
- }
- },
"websocket-driver": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.0.tgz",
@@ -13611,11 +13604,6 @@
"resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
"integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE="
},
- "yaeti": {
- "version": "0.0.6",
- "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz",
- "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc="
- },
"yallist": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
diff --git a/embark-ui/src/actions/index.js b/embark-ui/src/actions/index.js
index 4ee35715..e4a73dd7 100644
--- a/embark-ui/src/actions/index.js
+++ b/embark-ui/src/actions/index.js
@@ -349,6 +349,67 @@ export const web3EstimateGas = {
failure: (error, payload) => action(WEB3_ESTIMAGE_GAS[FAILURE], {web3Error: error, contract: payload.contract})
};
+export const START_DEBUG = createRequestTypes('START_DEBUG');
+export const startDebug = {
+ request: (txHash) => action(START_DEBUG[REQUEST], {txHash}),
+ success: () => action(START_DEBUG[SUCCESS]),
+ failure: (error) => action(START_DEBUG[FAILURE], {error})
+};
+
+export const DEBUG_JUMP_BACK = createRequestTypes('DEBUG_JUMP_BACK');
+export const debugJumpBack = {
+ request: () => action(DEBUG_JUMP_BACK[REQUEST], {}),
+ success: () => action(DEBUG_JUMP_BACK[SUCCESS]),
+ failure: (error) => action(DEBUG_JUMP_BACK[FAILURE], {error})
+};
+
+export const DEBUG_JUMP_FORWARD = createRequestTypes('DEBUG_JUMP_FORWARD');
+export const debugJumpForward = {
+ request: () => action(DEBUG_JUMP_FORWARD[REQUEST], {}),
+ success: () => action(DEBUG_JUMP_FORWARD[SUCCESS]),
+ failure: (error) => action(DEBUG_JUMP_FORWARD[FAILURE], {error})
+};
+
+export const DEBUG_STEP_OVER_BACKWARD = createRequestTypes('DEBUG_STEP_OVER_BACKWARD');
+export const debugStepOverBackward = {
+ request: () => action(DEBUG_STEP_OVER_BACKWARD[REQUEST], {}),
+ success: () => action(DEBUG_STEP_OVER_BACKWARD[SUCCESS]),
+ failure: (error) => action(DEBUG_STEP_OVER_BACKWARD[FAILURE], {error})
+};
+
+export const DEBUG_STEP_OVER_FORWARD = createRequestTypes('DEBUG_STEP_OVER_FORWARD');
+export const debugStepOverForward = {
+ request: () => action(DEBUG_STEP_OVER_FORWARD[REQUEST], {}),
+ success: () => action(DEBUG_STEP_OVER_FORWARD[SUCCESS]),
+ failure: (error) => action(DEBUG_STEP_OVER_FORWARD[FAILURE], {error})
+};
+
+export const DEBUG_STEP_INTO_BACKWARD = createRequestTypes('DEBUG_STEP_INTO_BACKWARD');
+export const debugStepIntoBackward = {
+ request: () => action(DEBUG_STEP_INTO_BACKWARD[REQUEST], {}),
+ success: () => action(DEBUG_STEP_INTO_BACKWARD[SUCCESS]),
+ failure: (error) => action(DEBUG_STEP_INTO_BACKWARD[FAILURE], {error})
+};
+
+export const DEBUG_STEP_INTO_FORWARD = createRequestTypes('DEBUG_STEP_INTO_FORWARD');
+export const debugStepIntoForward = {
+ request: () => action(DEBUG_STEP_INTO_FORWARD[REQUEST], {}),
+ success: () => action(DEBUG_STEP_INTO_FORWARD[SUCCESS]),
+ failure: (error) => action(DEBUG_STEP_INTO_FORWARD[FAILURE], {error})
+};
+
+export const TOGGLE_BREAKPOINT = createRequestTypes('TOGGLE_BREAKPOINT');
+export const toggleBreakpoint = {
+ request: (filename, lineNumber) => action(TOGGLE_BREAKPOINT[REQUEST], {filename, lineNumber}),
+ success: (data, payload) => action(TOGGLE_BREAKPOINT[SUCCESS], {payload}),
+ failure: (error) => action(TOGGLE_BREAKPOINT[FAILURE], {error})
+};
+
+export const DEBUGGER_INFO = createRequestTypes('DEBUGGER_INFO');
+export const debuggerInfo = {
+ success: (data) => action(DEBUGGER_INFO[SUCCESS], {data})
+};
+
// Web Socket
export const WATCH_NEW_PROCESS_LOGS = 'WATCH_NEW_PROCESS_LOGS';
export const STOP_NEW_PROCESS_LOGS = 'STOP_NEW_PROCESS_LOGS';
@@ -358,6 +419,7 @@ export const INIT_BLOCK_HEADER = 'INIT_BLOCK_HEADER';
export const STOP_BLOCK_HEADER = 'STOP_BLOCK_HEADER';
export const WATCH_GAS_ORACLE = 'WATCH_GAS_ORACLE';
export const STOP_GAS_ORACLE = 'STOP_GAS_ORACLE';
+export const STOP_DEBUGGER = 'STOP_DEBUGGER';
export function listenToProcessLogs(processName) {
return {
@@ -409,6 +471,12 @@ export function stopGasOracle(){
};
}
+export function stopDebugger(){
+ return {
+ type: STOP_DEBUGGER
+ }
+}
+
// Actions without Side Effect
export const UPDATE_BASE_ETHER = 'UPDATE_BASE_ETHER';
export function updateBaseEther(value) {
@@ -418,18 +486,10 @@ export function updateBaseEther(value) {
};
}
-export const TOGGLE_BREAKPOINT = 'TOGGLE_BREAKPOINT';
-export function toggleBreakpoint(filename, lineNumber) {
- return {
- type: TOGGLE_BREAKPOINT,
- payload: {filename, lineNumber}
- };
-}
-
export const UPDATE_DEPLOYMENT_PIPELINE = 'UPDATE_DEPLOYMENT_PIPELINE';
export function updateDeploymentPipeline(value) {
return {
type: UPDATE_DEPLOYMENT_PIPELINE,
payload: value
};
-}
\ No newline at end of file
+}
diff --git a/embark-ui/src/components/ContractDebugger.js b/embark-ui/src/components/ContractDebugger.js
new file mode 100644
index 00000000..b6f517ff
--- /dev/null
+++ b/embark-ui/src/components/ContractDebugger.js
@@ -0,0 +1,95 @@
+import PropTypes from "prop-types";
+import React, {Component} from 'react';
+import {
+ Row,
+ Col,
+ FormGroup,
+ Label,
+ Input,
+ Button,
+ Card,
+ CardBody,
+ CardHeader,
+ CardTitle,
+ CardFooter,
+ ListGroup,
+ ListGroupItem
+} from "reactstrap";
+import ReactJson from 'react-json-view';
+
+class ContractDebugger extends Component {
+
+ constructor(props) {
+ super(props);
+ }
+
+ handleChange(e) {
+ this.setState({txHash: e.target.value});
+ }
+
+ debug(e) {
+ this.props.startDebug(this.state.txHash);
+ }
+
+ debugJumpBack(e) {
+ this.props.debugJumpBack()
+ }
+
+ debugJumpForward(e) {
+ this.props.debugJumpForward()
+ }
+
+ debugStepOverForward(e) {
+ this.props.debugStepOverForward()
+ }
+
+ debugStepOverBackward(e) {
+ this.props.debugStepOverBackward()
+ }
+
+ debugStepIntoForward(e) {
+ this.props.debugStepIntoForward()
+ }
+
+ debugStepIntoBackward(e) {
+ this.props.debugStepIntoBackward()
+ }
+
+ render() {
+ return (
+
+
+
+ this.handleChange(e)}/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Scopes
+
+
+
+
+
+
+ );
+ }
+}
+
+ContractDebugger.propTypes = {
+ contract: PropTypes.object.isRequired,
+};
+
+export default ContractDebugger;
+
diff --git a/embark-ui/src/components/ContractLayout.js b/embark-ui/src/components/ContractLayout.js
index acf8d114..fbb32a94 100644
--- a/embark-ui/src/components/ContractLayout.js
+++ b/embark-ui/src/components/ContractLayout.js
@@ -6,6 +6,7 @@ import classnames from 'classnames';
import ContractDetail from '../components/ContractDetail';
import ContractLoggerContainer from '../containers/ContractLoggerContainer';
import ContractOverviewContainer from '../containers/ContractOverviewContainer';
+import ContractDebuggerContainer from '../containers/ContractDebuggerContainer';
class ContractLayout extends React.Component {
constructor(props) {
@@ -55,6 +56,14 @@ class ContractLayout extends React.Component {
Logger
+
+ { this.toggle('4'); }}
+ >
+ Debugger
+
+
@@ -66,6 +75,9 @@ class ContractLayout extends React.Component {
+
+
+
diff --git a/embark-ui/src/components/TextEditor.js b/embark-ui/src/components/TextEditor.js
index 1b9efc7a..07fa8393 100644
--- a/embark-ui/src/components/TextEditor.js
+++ b/embark-ui/src/components/TextEditor.js
@@ -97,8 +97,9 @@ class TextEditor extends React.Component {
}
));
- //TODO remove me when debuggerLine comes from the debugger API
- let debuggerLine = this.props.debuggerLine || 11;
+ let debuggerLine = this.props.debuggerLine;
+ console.dir("debuggerLine")
+ console.dir(debuggerLine)
newDecorations.push({
range: new monaco.Range(debuggerLine,1,debuggerLine,1),
options: {
@@ -116,9 +117,8 @@ class TextEditor extends React.Component {
}
this.updateMarkers();
- // TODO replace with const expectedDecorationsLength = this.props.debuggerLine ? this.props.breakpoints.length + 1 : this.props.breakpoints.length
- const expectedDecorationsLength = this.props.breakpoints.length + 1;
- if (expectedDecorationsLength !== this.state.decorations.length) {
+ const expectedDecorationsLength = this.props.debuggerLine ? this.props.breakpoints.length + 1 : this.props.breakpoints.length
+ if (expectedDecorationsLength !== this.state.decorations.length || this.props.debuggerLine !== prevProps.debuggerLine) {
this.updateDecorations();
}
this.updateLanguage();
@@ -142,4 +142,4 @@ TextEditor.propTypes = {
debuggerLine: PropTypes.number
};
-export default TextEditor;
\ No newline at end of file
+export default TextEditor;
diff --git a/embark-ui/src/components/TextEditorToolbar.js b/embark-ui/src/components/TextEditorToolbar.js
index 4eaf4305..61620828 100644
--- a/embark-ui/src/components/TextEditorToolbar.js
+++ b/embark-ui/src/components/TextEditorToolbar.js
@@ -41,6 +41,9 @@ const TextEditorToolbar = (props) => (
Logger
|
+
}