|
|
@ -31,7 +31,8 @@ export const DebuggerUI = (props: DebuggerUIProps) => { |
|
|
|
}, |
|
|
|
}, |
|
|
|
toastMessage: '', |
|
|
|
toastMessage: '', |
|
|
|
validationError: '', |
|
|
|
validationError: '', |
|
|
|
txNumberIsEmpty: true |
|
|
|
txNumberIsEmpty: true, |
|
|
|
|
|
|
|
isLocalNodeUsed: false |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
@ -62,6 +63,17 @@ export const DebuggerUI = (props: DebuggerUIProps) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
setEditor() |
|
|
|
setEditor() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const providerChanged = () => { |
|
|
|
|
|
|
|
debuggerModule.onEnvChanged((provider) => { |
|
|
|
|
|
|
|
setState(prevState => { |
|
|
|
|
|
|
|
const isLocalNodeUsed = provider !== 'vm' && provider !== 'injected' |
|
|
|
|
|
|
|
return { ...prevState, isLocalNodeUsed: isLocalNodeUsed } |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
providerChanged() |
|
|
|
}, [state.debugger]) |
|
|
|
}, [state.debugger]) |
|
|
|
|
|
|
|
|
|
|
|
const listenToEvents = (debuggerInstance, currentReceipt) => { |
|
|
|
const listenToEvents = (debuggerInstance, currentReceipt) => { |
|
|
@ -289,7 +301,7 @@ export const DebuggerUI = (props: DebuggerUIProps) => { |
|
|
|
}} type="checkbox" title="Debug with generated sources" /> |
|
|
|
}} type="checkbox" title="Debug with generated sources" /> |
|
|
|
<label data-id="debugGeneratedSourcesLabel" className="form-check-label custom-control-label" htmlFor="debugGeneratedSourcesInput">Use generated sources (from Solidity v0.7.2)</label> |
|
|
|
<label data-id="debugGeneratedSourcesLabel" className="form-check-label custom-control-label" htmlFor="debugGeneratedSourcesInput">Use generated sources (from Solidity v0.7.2)</label> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div className="mt-2 mb-2 debuggerConfig custom-control custom-checkbox"> |
|
|
|
{ state.isLocalNodeUsed && <div className="mt-2 mb-2 debuggerConfig custom-control custom-checkbox"> |
|
|
|
<input className="custom-control-input" id="debugWithLocalNodeInput" onChange={({ target: { checked } }) => { |
|
|
|
<input className="custom-control-input" id="debugWithLocalNodeInput" onChange={({ target: { checked } }) => { |
|
|
|
setState(prevState => { |
|
|
|
setState(prevState => { |
|
|
|
return { ...prevState, opt: { ...prevState.opt, debugWithLocalNode: checked } } |
|
|
|
return { ...prevState, opt: { ...prevState.opt, debugWithLocalNode: checked } } |
|
|
@ -297,6 +309,7 @@ export const DebuggerUI = (props: DebuggerUIProps) => { |
|
|
|
}} type="checkbox" title="Force the debugger to use the current local node" /> |
|
|
|
}} type="checkbox" title="Force the debugger to use the current local node" /> |
|
|
|
<label data-id="debugLocaNodeLabel" className="form-check-label custom-control-label" htmlFor="debugWithLocalNodeInput">Force using local node</label> |
|
|
|
<label data-id="debugLocaNodeLabel" className="form-check-label custom-control-label" htmlFor="debugWithLocalNodeInput">Force using local node</label> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
} |
|
|
|
{ state.validationError && <span className="w-100 py-1 text-danger validationError">{state.validationError}</span> } |
|
|
|
{ state.validationError && <span className="w-100 py-1 text-danger validationError">{state.validationError}</span> } |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<TxBrowser requestDebug={ requestDebug } unloadRequested={ unloadRequested } updateTxNumberFlag={ updateTxNumberFlag } transactionNumber={ state.txNumber } debugging={ state.debugging } /> |
|
|
|
<TxBrowser requestDebug={ requestDebug } unloadRequested={ unloadRequested } updateTxNumberFlag={ updateTxNumberFlag } transactionNumber={ state.txNumber } debugging={ state.debugging } /> |
|
|
|