add debugging support

pull/4255/head
yann300 1 year ago
parent 4f65cb524f
commit 7e18d33da9
  1. 19
      apps/remix-ide/src/app/plugins/solidity-script.tsx
  2. 6
      libs/remix-core-plugin/src/lib/compiler-artefacts.ts

@ -55,6 +55,7 @@ export class SolidityScript extends Plugin {
})
}
await this.call('compilerArtefacts', 'saveCompilerAbstract', 'script.sol', compilation)
// get the contract
const contract = compilation.getContract('SolidityScript')
if (!contract) {
@ -73,13 +74,27 @@ export class SolidityScript extends Plugin {
from: accounts[0],
data: bytecode
}
const receipt = await web3.eth.sendTransaction(tx, null, { checkRevertBeforeSending: false, ignoreGasPricing: true })
let receipt
try {
receipt = await web3.eth.sendTransaction(tx, null, { checkRevertBeforeSending: false, ignoreGasPricing: true })
} catch (e) {
this.call('terminal', 'logHtml', e.message)
return
}
tx = {
from: accounts[0],
to: receipt.contractAddress,
data: '0x69d4394b' // function remixRun() public
}
const receiptCall = await web3.eth.sendTransaction(tx, null, { checkRevertBeforeSending: false, ignoreGasPricing: true })
let receiptCall
try {
receiptCall = await web3.eth.sendTransaction(tx, null, { checkRevertBeforeSending: false, ignoreGasPricing: true })
} catch (e) {
this.call('terminal', 'logHtml', e.message)
return
}
const hhlogs = await web3.remix.getHHLogsForTx(receiptCall.transactionHash)

@ -5,7 +5,7 @@ import { CompilerAbstract } from '@remix-project/remix-solidity'
const profile = {
name: 'compilerArtefacts',
methods: ['get', 'addResolvedContract', 'getCompilerAbstract', 'getAllContractDatas', 'getLastCompilationResult', 'getArtefactsByContractName', 'getContractDataFromAddress', 'getContractDataFromByteCode'],
methods: ['get', 'addResolvedContract', 'getCompilerAbstract', 'getAllContractDatas', 'getLastCompilationResult', 'getArtefactsByContractName', 'getContractDataFromAddress', 'getContractDataFromByteCode', 'saveCompilerAbstract'],
events: [],
version: '0.0.1'
}
@ -24,6 +24,10 @@ export class CompilerArtefacts extends Plugin {
this.compilersArtefactsPerFile = {}
}
saveCompilerAbstract (file: string, compilerAbstract: CompilerAbstract) {
this.compilersArtefactsPerFile[file] = compilerAbstract
}
onActivation () {
const saveCompilationPerFileResult = (file, source, languageVersion, data, input?) => {
this.compilersArtefactsPerFile[file] = new CompilerAbstract(languageVersion, data, source, input)

Loading…
Cancel
Save