fix debugging

pull/3232/head
yann300 2 years ago committed by Aniket
parent fc1a7a6ebf
commit b7f2ae625c
  1. 2
      libs/remix-debug/src/Ethdebugger.ts
  2. 22
      libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx
  3. 22
      libs/remix-ui/debugger-ui/src/lib/vm-debugger/global-variables.tsx

@ -196,6 +196,6 @@ export class Ethdebugger {
if (this.breakpointManager && this.breakpointManager.hasBreakpoint()) {
this.breakpointManager.jumpNextBreakpoint(false)
}
this.storageResolver = new StorageResolver({ web3: this.traceManager.web3 })
this.storageResolver = new StorageResolver({ web3: this.traceManager.web3 })
}
}

@ -319,13 +319,21 @@ export const DebuggerUI = (props: DebuggerUIProps) => {
})
})
} catch (error) {
unLoad()
setState(prevState => {
return {
...prevState,
validationError: error.message || error
}
})
try {
unLoad()
setState(prevState => {
let errorMsg = error.message || error
if (typeof errorMsg !== 'string') {
errorMsg = JSON.stringify(errorMsg) + '. Possible error: the current endpoint does not support retrieving the trace of a transaction.'
}
return {
...prevState,
validationError: errorMsg
}
})
} catch (e) {
console.error(e)
}
}
}, 300)
handleResize()

@ -6,19 +6,19 @@ import Web3 from 'web3'
export const GlobalVariables = ({ block, receipt, tx, className }) => {
// see https://docs.soliditylang.org/en/latest/units-and-global-variables.html#block-and-transaction-properties
const globals = {
'block.chainid': tx.chainId,
'block.coinbase': block.miner,
'block.difficulty': block.difficulty,
'block.gaslimit': block.gasLimit,
'block.number': block.number,
'block.timestamp': block.timestamp,
'msg.sender': tx.from,
'msg.sig': tx.input.substring(0, 10),
'msg.value': tx.value + ' Wei',
'tx.origin': tx.from
'block.chainid': tx && tx.chainId,
'block.coinbase': block && block.miner,
'block.difficulty': block && block.difficulty,
'block.gaslimit': block && block.gasLimit,
'block.number': block && block.number,
'block.timestamp': block && block.timestamp,
'msg.sender': tx && tx.from,
'msg.sig': tx && tx.input && tx.input.substring(0, 10),
'msg.value': tx && (tx.value + ' Wei'),
'tx.origin': tx && tx.from
}
if (block.baseFeePerGas) {
globals['block.basefee'] = Web3.utils.toBN(block.baseFeePerGas).toString(10) + ` Wei (${block.baseFeePerGas})`
globals['block.basefee'] = block && (Web3.utils.toBN(block.baseFeePerGas).toString(10) + ` Wei (${block.baseFeePerGas})`)
}
return (

Loading…
Cancel
Save