pull/573/head
yann300 4 years ago
parent 2c6c4810a9
commit 2f103112c0
  1. 24
      apps/remix-ide-e2e/src/tests/debugger.test.ts
  2. 6
      apps/remix-ide/src/app/tabs/debugger-tab.js
  3. 2
      libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx

@ -182,10 +182,19 @@ module.exports = {
'Should call the debugger api: getTrace': function (browser: NightwatchBrowser) {
browser
.addFile('test_jsCompileWithOptimization.js', { content: jsDebug })
.addFile('test_jsGetTrace.js', { content: jsGetTrace })
.executeScript('remix.exeCurrent()')
.pause(3000)
.journalChildIncludes(`{ "gas": "0x2dc6c0", "return": "0x", "structLogs":`)
.journalChildIncludes(`{ "gas": "0x2dc6c0", "return": "0x", "structLogs":`)
},
'Should call the debugger api: debug': function (browser: NightwatchBrowser) {
browser
.addFile('test_jsDebug.js', { content: jsDebug })
.executeScript('remix.exeCurrent()')
.pause(3000)
.clickLaunchIcon('debugger')
.assert.containsText('*[data-id="stepdetail"]', 'vm trace step:\n92')
.end()
},
@ -344,7 +353,7 @@ const localVariable_step717_ABIEncoder = {
}
}
const jsDebug = `(async () => {
const jsGetTrace = `(async () => {
try {
const result = await remix.call('debugger', 'getTrace', '0xb175c3c9a9cd6bee3b6cc8be3369a945ac9611516005f8cba27a43486ff2bc50')
console.log('result ', result)
@ -352,3 +361,12 @@ const jsDebug = `(async () => {
console.log(e.message)
}
})()`
const jsDebug = `(async () => {
try {
const result = await remix.call('debugger', 'debug', '0xb175c3c9a9cd6bee3b6cc8be3369a945ac9611516005f8cba27a43486ff2bc50')
console.log('result ', result)
} catch (e) {
console.log(e.message)
}
})()`

@ -23,11 +23,11 @@ const profile = {
class DebuggerTab extends ViewPlugin {
constructor (blockchain, editor, offsettolinecolumnconverter) {
constructor (blockchain, editor, offsetToLineColumnConverter) {
super(profile)
this.el = null
this.editor = editor
this.offsetToLineColumnConverter = offsettolinecolumnconverter
this.offsetToLineColumnConverter = offsetToLineColumnConverter
this.blockchain = blockchain
this.debugHash = null
this.removeHighlights = false
@ -112,7 +112,7 @@ class DebuggerTab extends ViewPlugin {
const currentReceipt = await web3.eth.getTransactionReceipt(hash)
const debug = new Debugger({
web3,
offsetToLineColumnConverter: this.offsettolinecolumnconverter,
offsetToLineColumnConverter: this.offsetToLineColumnConverter,
compilationResult: async (address) => {
try {
return await this.fetchContractAndCompile(address, currentReceipt)

@ -147,7 +147,7 @@ export const DebuggerUI = ({ debuggerModule }) => {
const currentReceipt = await web3.eth.getTransactionReceipt(txNumber)
const debuggerInstance = new Debugger({
web3,
offsetToLineColumnConverter: debuggerModule.offsettolinecolumnconverter,
offsetToLineColumnConverter: debuggerModule.offsetToLineColumnConverter,
compilationResult: async (address) => {
try {
return await debuggerModule.fetchContractAndCompile(address, currentReceipt)

Loading…
Cancel
Save