Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
06e7e3f5
Commit
06e7e3f5
authored
Sep 24, 2020
by
ioedeveloper
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor dropdown panel component
parent
fd22c579
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
41 additions
and
103 deletions
+41
-103
button-navigator.tsx
...debugger-ui/src/lib/button-navigator/button-navigator.tsx
+1
-1
debugger-ui.tsx
libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx
+2
-13
calldata-panel.tsx
...mix-ui/debugger-ui/src/lib/vm-debugger/calldata-panel.tsx
+1
-1
callstack-panel.tsx
...ix-ui/debugger-ui/src/lib/vm-debugger/callstack-panel.tsx
+1
-1
dropdown-panel.tsx
...mix-ui/debugger-ui/src/lib/vm-debugger/dropdown-panel.tsx
+13
-25
full-storages-changes.tsx
...debugger-ui/src/lib/vm-debugger/full-storages-changes.tsx
+2
-2
function-panel.tsx
...mix-ui/debugger-ui/src/lib/vm-debugger/function-panel.tsx
+1
-1
memory-panel.tsx
...remix-ui/debugger-ui/src/lib/vm-debugger/memory-panel.tsx
+1
-7
solidity-locals.tsx
...ix-ui/debugger-ui/src/lib/vm-debugger/solidity-locals.tsx
+1
-1
solidity-state.tsx
...mix-ui/debugger-ui/src/lib/vm-debugger/solidity-state.tsx
+1
-1
stack-panel.tsx
.../remix-ui/debugger-ui/src/lib/vm-debugger/stack-panel.tsx
+1
-1
step-detail.tsx
.../remix-ui/debugger-ui/src/lib/vm-debugger/step-detail.tsx
+1
-1
storage-panel.tsx
...emix-ui/debugger-ui/src/lib/vm-debugger/storage-panel.tsx
+1
-1
vm-debugger-head.tsx
...x-ui/debugger-ui/src/lib/vm-debugger/vm-debugger-head.tsx
+0
-18
vm-debugger.tsx
.../remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger.tsx
+14
-23
index.ts
libs/remix-ui/debugger-ui/src/types/index.ts
+0
-6
No files found.
libs/remix-ui/debugger-ui/src/lib/button-navigator/button-navigator.tsx
View file @
06e7e3f5
...
@@ -44,7 +44,7 @@ export const ButtonNavigation = ({ stepManager, revertedReason, stepState, jumpO
...
@@ -44,7 +44,7 @@ export const ButtonNavigation = ({ stepManager, revertedReason, stepState, jumpO
jumpPreviousBreakpointDisabled
:
stepState
===
'initial'
,
jumpPreviousBreakpointDisabled
:
stepState
===
'initial'
,
intoForwardDisabled
:
stepState
===
'end'
,
intoForwardDisabled
:
stepState
===
'end'
,
overForwardDisabled
:
stepState
===
'end'
,
overForwardDisabled
:
stepState
===
'end'
,
jumpNextBreakpointDisabled
:
jumpOutDisabled
?
jumpOutDisabled
:
stepState
===
'end'
,
jumpNextBreakpointDisabled
:
stepState
===
'end'
,
jumpOutDisabled
:
jumpOutDisabled
?
jumpOutDisabled
:
true
jumpOutDisabled
:
jumpOutDisabled
?
jumpOutDisabled
:
true
}
}
})
})
...
...
libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx
View file @
06e7e3f5
...
@@ -5,15 +5,10 @@ import VmDebugger from './vm-debugger/vm-debugger'
...
@@ -5,15 +5,10 @@ import VmDebugger from './vm-debugger/vm-debugger'
import
VmDebuggerHead
from
'./vm-debugger/vm-debugger-head'
import
VmDebuggerHead
from
'./vm-debugger/vm-debugger-head'
import
remixDebug
,
{
TransactionDebugger
as
Debugger
}
from
'@remix-project/remix-debug'
import
remixDebug
,
{
TransactionDebugger
as
Debugger
}
from
'@remix-project/remix-debug'
/* eslint-disable-next-line */
/* eslint-disable-next-line */
import
toaster
from
'../../../../../apps/remix-ide/src/app/ui/tooltip'
/* eslint-disable-next-line */
import
SourceHighlighter
from
'../../../../../apps/remix-ide/src/app/editor/sourceHighlighter'
/* eslint-disable-next-line */
import
globalRegistry
from
'../../../../../apps/remix-ide/src/global/registry'
import
globalRegistry
from
'../../../../../apps/remix-ide/src/global/registry'
import
'./debugger-ui.css'
import
'./debugger-ui.css'
export
const
DebuggerUI
=
({
debuggerModule
,
fetchContractAndCompile
,
debugHash
,
getTraceHash
,
removeHighlights
})
=>
{
export
const
DebuggerUI
=
({
debuggerModule
,
fetchContractAndCompile
,
debugHash
,
getTraceHash
,
removeHighlights
})
=>
{
const
sourceHighlighter
=
new
SourceHighlighter
()
const
init
=
remixDebug
.
init
const
init
=
remixDebug
.
init
const
[
state
,
setState
]
=
useState
({
const
[
state
,
setState
]
=
useState
({
isActive
:
false
,
isActive
:
false
,
...
@@ -144,6 +139,7 @@ export const DebuggerUI = ({ debuggerModule, fetchContractAndCompile, debugHash,
...
@@ -144,6 +139,7 @@ export const DebuggerUI = ({ debuggerModule, fetchContractAndCompile, debugHash,
}
}
const
startDebugging
=
async
(
blockNumber
,
txNumber
,
tx
)
=>
{
const
startDebugging
=
async
(
blockNumber
,
txNumber
,
tx
)
=>
{
if
(
state
.
debugger
)
unLoad
()
const
web3
=
await
getDebugWeb3
()
const
web3
=
await
getDebugWeb3
()
const
currentReceipt
=
await
web3
.
eth
.
getTransactionReceipt
(
txNumber
)
const
currentReceipt
=
await
web3
.
eth
.
getTransactionReceipt
(
txNumber
)
const
debuggerInstance
=
new
Debugger
({
const
debuggerInstance
=
new
Debugger
({
...
@@ -159,8 +155,6 @@ export const DebuggerUI = ({ debuggerModule, fetchContractAndCompile, debugHash,
...
@@ -159,8 +155,6 @@ export const DebuggerUI = ({ debuggerModule, fetchContractAndCompile, debugHash,
}
}
})
})
debuggerInstance
.
debug
(
blockNumber
,
txNumber
,
tx
,
()
=>
{
debuggerInstance
.
debug
(
blockNumber
,
txNumber
,
tx
,
()
=>
{
// this.stepManager = new StepManagerUI(this.debugger.step_manager)
// this.vmDebugger = new VmDebugger(this.debugger.vmDebuggerLogic)
listenToEvents
(
debuggerInstance
,
currentReceipt
)
listenToEvents
(
debuggerInstance
,
currentReceipt
)
setState
(
prevState
=>
{
setState
(
prevState
=>
{
return
{
return
{
...
@@ -172,9 +166,8 @@ export const DebuggerUI = ({ debuggerModule, fetchContractAndCompile, debugHash,
...
@@ -172,9 +166,8 @@ export const DebuggerUI = ({ debuggerModule, fetchContractAndCompile, debugHash,
debugger
:
debuggerInstance
debugger
:
debuggerInstance
}
}
})
})
// this.renderDebugger()
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
toaster
(
error
,
null
,
null
)
//
toaster(error, null, null)
unLoad
()
unLoad
()
})
})
}
}
...
@@ -244,10 +237,6 @@ if (state.ready.vmDebugger && state.ready.vmDebuggerHead) {
...
@@ -244,10 +237,6 @@ if (state.ready.vmDebugger && state.ready.vmDebuggerHead) {
state
.
debugger
.
vmDebuggerLogic
.
start
()
state
.
debugger
.
vmDebuggerLogic
.
start
()
}
}
// this.debuggerPanelsView = yo`<div class="px-2"></div>`
// this.debuggerHeadPanelsView = yo`<div class="px-2"></div>`
// this.stepManagerView = yo`<div class="px-2"></div>`
return
(
return
(
<
div
>
<
div
>
<
div
className=
"px-2"
>
<
div
className=
"px-2"
>
...
...
libs/remix-ui/debugger-ui/src/lib/vm-debugger/calldata-panel.tsx
View file @
06e7e3f5
...
@@ -4,7 +4,7 @@ import DropdownPanel from './dropdown-panel'
...
@@ -4,7 +4,7 @@ import DropdownPanel from './dropdown-panel'
export
const
CalldataPanel
=
({
calldata
})
=>
{
export
const
CalldataPanel
=
({
calldata
})
=>
{
return
(
return
(
<
div
id=
'calldatapanel'
>
<
div
id=
'calldatapanel'
>
<
DropdownPanel
dropdownName=
'Call Data'
opts=
{
{
json
:
true
}
}
calldata=
{
calldata
}
/>
<
DropdownPanel
dropdownName=
'Call Data'
calldata=
{
calldata
}
/>
</
div
>
</
div
>
)
)
}
}
...
...
libs/remix-ui/debugger-ui/src/lib/vm-debugger/callstack-panel.tsx
View file @
06e7e3f5
...
@@ -4,7 +4,7 @@ import DropdownPanel from './dropdown-panel'
...
@@ -4,7 +4,7 @@ import DropdownPanel from './dropdown-panel'
export
const
CallstackPanel
=
({
calldata
})
=>
{
export
const
CallstackPanel
=
({
calldata
})
=>
{
return
(
return
(
<
div
id=
'callstackpanel'
>
<
div
id=
'callstackpanel'
>
<
DropdownPanel
dropdownName=
'Call Stack'
opts=
{
{
json
:
true
}
}
calldata=
{
calldata
}
/>
<
DropdownPanel
dropdownName=
'Call Stack'
calldata=
{
calldata
}
/>
</
div
>
</
div
>
)
)
}
}
...
...
libs/remix-ui/debugger-ui/src/lib/vm-debugger/dropdown-panel.tsx
View file @
06e7e3f5
...
@@ -8,12 +8,10 @@ import { CopyToClipboard } from '@remix-ui/clipboard'
...
@@ -8,12 +8,10 @@ import { CopyToClipboard } from '@remix-ui/clipboard'
import
'./styles/dropdown-panel.css'
import
'./styles/dropdown-panel.css'
export
const
DropdownPanel
=
(
props
:
DropdownPanelProps
)
=>
{
export
const
DropdownPanel
=
(
props
:
DropdownPanelProps
)
=>
{
const
{
dropdownName
,
dropdownMessage
,
opts
,
calldata
,
header
,
loading
,
extractFunc
,
formatSelfFunc
}
=
props
const
{
dropdownName
,
dropdownMessage
,
calldata
,
header
,
loading
,
extractFunc
,
formatSelfFunc
}
=
props
const
data
=
useExtractData
(
calldata
,
extractFunc
)
const
data
=
useExtractData
(
calldata
,
extractFunc
)
const
dropdownRawEl
=
useRef
(
null
)
const
[
state
,
setState
]
=
useState
({
const
[
state
,
setState
]
=
useState
({
header
:
''
,
header
:
''
,
json
:
opts
.
json
,
toggleDropdown
:
true
,
toggleDropdown
:
true
,
message
:
{
message
:
{
innerText
:
''
,
innerText
:
''
,
...
@@ -52,10 +50,6 @@ export const DropdownPanel = (props: DropdownPanelProps) => {
...
@@ -52,10 +50,6 @@ export const DropdownPanel = (props: DropdownPanelProps) => {
})
})
}
}
const
copyClipboard
=
()
=>
{
return
dropdownRawEl
.
current
.
innerText
?
dropdownRawEl
.
current
.
innerText
:
dropdownRawEl
.
current
.
textContent
}
const
message
=
(
message
)
=>
{
const
message
=
(
message
)
=>
{
if
(
message
===
state
.
message
.
innerText
)
return
if
(
message
===
state
.
message
.
innerText
)
return
setState
(
prevState
=>
{
setState
(
prevState
=>
{
...
@@ -133,29 +127,23 @@ export const DropdownPanel = (props: DropdownPanelProps) => {
...
@@ -133,29 +127,23 @@ export const DropdownPanel = (props: DropdownPanelProps) => {
}
}
}
}
let
content
:
JSX
.
Element
|
JSX
.
Element
[]
=
<
div
>
Empty
</
div
>
if
(
state
.
json
)
{
content
=
(
data
).
map
((
item
,
index
)
=>
{
return
(
<
TreeView
id=
{
item
.
key
}
key=
{
index
}
>
{
renderData
(
item
.
data
,
item
.
key
)
}
</
TreeView
>
)
})
}
const
title
=
<
div
className=
"py-0 px-1 title"
>
<
div
className=
{
state
.
toggleDropdown
?
'icon fas fa-caret-down'
:
'icon fas fa-caret-right'
}
onClick=
{
handleToggle
}
></
div
>
<
div
className=
"name"
onClick=
{
handleToggle
}
>
{
dropdownName
}
</
div
><
span
className=
"nameDetail"
onClick=
{
handleToggle
}
>
{
header
}
</
span
>
<
CopyToClipboard
content=
{
state
.
copiableContent
}
/>
</
div
>
return
(
return
(
<
div
className=
"border rounded px-1 mt-1 bg-light"
>
<
div
className=
"border rounded px-1 mt-1 bg-light"
>
{
title
}
<
div
className=
"py-0 px-1 title"
>
<
div
className=
{
state
.
toggleDropdown
?
'icon fas fa-caret-down'
:
'icon fas fa-caret-right'
}
onClick=
{
handleToggle
}
></
div
>
<
div
className=
"name"
onClick=
{
handleToggle
}
>
{
dropdownName
}
</
div
><
span
className=
"nameDetail"
onClick=
{
handleToggle
}
>
{
header
}
</
span
>
<
CopyToClipboard
content=
{
state
.
copiableContent
}
/>
</
div
>
<
div
className=
'dropdownpanel'
style=
{
{
display
:
state
.
toggleDropdown
?
'block'
:
'none'
}
}
>
<
div
className=
'dropdownpanel'
style=
{
{
display
:
state
.
toggleDropdown
?
'block'
:
'none'
}
}
>
<
i
className=
"refresh fas fa-sync"
style=
{
{
display
:
state
.
updating
?
'inline-block'
:
'none'
}
}
aria
-
hidden=
"true"
></
i
>
<
i
className=
"refresh fas fa-sync"
style=
{
{
display
:
state
.
updating
?
'inline-block'
:
'none'
}
}
aria
-
hidden=
"true"
></
i
>
<
div
className=
'dropdowncontent'
style=
{
{
display
:
state
.
dropdownContent
.
display
}
}
>
<
div
className=
'dropdowncontent'
style=
{
{
display
:
state
.
dropdownContent
.
display
}
}
>
{
content
}
{
data
.
map
((
item
,
index
)
=>
{
return
(
<
TreeView
id=
{
item
.
key
}
key=
{
index
}
>
{
renderData
(
item
.
data
,
item
.
key
)
}
</
TreeView
>
)
})
}
</
div
>
</
div
>
<
div
className=
'message'
style=
{
{
display
:
state
.
message
.
display
}
}
>
{
state
.
message
.
innerText
}
</
div
>
<
div
className=
'message'
style=
{
{
display
:
state
.
message
.
display
}
}
>
{
state
.
message
.
innerText
}
</
div
>
</
div
>
</
div
>
...
...
libs/remix-ui/debugger-ui/src/lib/vm-debugger/full-storages-changes.tsx
View file @
06e7e3f5
import
React
from
'react'
import
React
from
'react'
import
{
DropdownPanel
}
from
'./dropdown-panel'
import
{
DropdownPanel
}
from
'./dropdown-panel'
export
const
FullStoragesChanges
=
({
storageD
ata
})
=>
{
export
const
FullStoragesChanges
=
({
calld
ata
})
=>
{
return
(
return
(
<
div
id=
'fullstorageschangespanel'
>
<
div
id=
'fullstorageschangespanel'
>
<
DropdownPanel
dropdownName=
'Full Storages Changes'
opts=
{
{
json
:
true
}
}
calldata=
{
storageD
ata
}
/>
<
DropdownPanel
dropdownName=
'Full Storages Changes'
calldata=
{
calld
ata
}
/>
</
div
>
</
div
>
)
)
}
}
...
...
libs/remix-ui/debugger-ui/src/lib/vm-debugger/function-panel.tsx
View file @
06e7e3f5
...
@@ -4,7 +4,7 @@ import DropdownPanel from './dropdown-panel'
...
@@ -4,7 +4,7 @@ import DropdownPanel from './dropdown-panel'
export
const
FunctionPanel
=
({
calldata
})
=>
{
export
const
FunctionPanel
=
({
calldata
})
=>
{
return
(
return
(
<
div
id=
"FunctionPanel"
>
<
div
id=
"FunctionPanel"
>
<
DropdownPanel
dropdownName=
'Function Stack'
opts=
{
{
json
:
true
}
}
calldata=
{
calldata
}
/>
<
DropdownPanel
dropdownName=
'Function Stack'
calldata=
{
calldata
}
/>
</
div
>
</
div
>
)
)
}
}
...
...
libs/remix-ui/debugger-ui/src/lib/vm-debugger/memory-panel.tsx
View file @
06e7e3f5
...
@@ -3,13 +3,7 @@ import DropdownPanel from './dropdown-panel'
...
@@ -3,13 +3,7 @@ import DropdownPanel from './dropdown-panel'
export
const
MemoryPanel
=
({
calldata
})
=>
{
export
const
MemoryPanel
=
({
calldata
})
=>
{
return
(
return
(
<
DropdownPanel
dropdownName=
'Memory'
opts=
{
{
<
DropdownPanel
dropdownName=
'Memory'
calldata=
{
calldata
}
/>
json
:
true
,
css
:
{
'font-family'
:
'monospace'
}}
}
calldata=
{
calldata
}
/>
)
)
}
}
...
...
libs/remix-ui/debugger-ui/src/lib/vm-debugger/solidity-locals.tsx
View file @
06e7e3f5
...
@@ -36,7 +36,7 @@ export const SolidityLocals = ({ calldata, message }) => {
...
@@ -36,7 +36,7 @@ export const SolidityLocals = ({ calldata, message }) => {
return
(
return
(
<
div
id=
'soliditylocals'
data
-
id=
"solidityLocals"
>
<
div
id=
'soliditylocals'
data
-
id=
"solidityLocals"
>
<
DropdownPanel
dropdownName=
'Solidity Locals'
dropdownMessage=
{
message
}
opts=
{
{
json
:
true
}
}
calldata=
{
calldata
}
extractFunc=
{
extractData
}
formatSelfFunc=
{
formatSelf
}
/>
<
DropdownPanel
dropdownName=
'Solidity Locals'
dropdownMessage=
{
message
}
calldata=
{
calldata
}
extractFunc=
{
extractData
}
formatSelfFunc=
{
formatSelf
}
/>
</
div
>
</
div
>
)
)
}
}
...
...
libs/remix-ui/debugger-ui/src/lib/vm-debugger/solidity-state.tsx
View file @
06e7e3f5
...
@@ -36,7 +36,7 @@ export const SolidityState = ({ calldata, message }) => {
...
@@ -36,7 +36,7 @@ export const SolidityState = ({ calldata, message }) => {
return
(
return
(
<
div
id=
'soliditylocals'
data
-
id=
'solidityLocals'
>
<
div
id=
'soliditylocals'
data
-
id=
'solidityLocals'
>
{
{
<
DropdownPanel
dropdownName=
'Solidity State'
dropdownMessage=
{
message
}
opts=
{
{
json
:
true
}
}
calldata=
{
calldata
}
formatSelfFunc=
{
formatSelf
}
extractFunc=
{
extractData
}
/>
<
DropdownPanel
dropdownName=
'Solidity State'
dropdownMessage=
{
message
}
calldata=
{
calldata
}
formatSelfFunc=
{
formatSelf
}
extractFunc=
{
extractData
}
/>
}
}
</
div
>
</
div
>
)
)
...
...
libs/remix-ui/debugger-ui/src/lib/vm-debugger/stack-panel.tsx
View file @
06e7e3f5
...
@@ -4,7 +4,7 @@ import DropdownPanel from './dropdown-panel'
...
@@ -4,7 +4,7 @@ import DropdownPanel from './dropdown-panel'
export
const
StackPanel
=
({
calldata
})
=>
{
export
const
StackPanel
=
({
calldata
})
=>
{
return
(
return
(
<
div
id=
"stackpanel"
>
<
div
id=
"stackpanel"
>
<
DropdownPanel
dropdownName=
'Stack'
opts=
{
{
json
:
true
}
}
calldata=
{
calldata
}
/>
<
DropdownPanel
dropdownName=
'Stack'
calldata=
{
calldata
}
/>
</
div
>
</
div
>
)
)
}
}
...
...
libs/remix-ui/debugger-ui/src/lib/vm-debugger/step-detail.tsx
View file @
06e7e3f5
...
@@ -50,7 +50,7 @@ export const StepDetail = (props: StepDetailProps) => {
...
@@ -50,7 +50,7 @@ export const StepDetail = (props: StepDetailProps) => {
return
(
return
(
<
div
id=
'stepdetail'
data
-
id=
"stepdetail"
>
<
div
id=
'stepdetail'
data
-
id=
"stepdetail"
>
<
DropdownPanel
dropdownName=
'Step details'
opts=
{
{
json
:
true
}
}
calldata=
{
detail
}
/>
<
DropdownPanel
dropdownName=
'Step details'
calldata=
{
detail
}
/>
</
div
>
</
div
>
)
)
}
}
...
...
libs/remix-ui/debugger-ui/src/lib/vm-debugger/storage-panel.tsx
View file @
06e7e3f5
...
@@ -4,7 +4,7 @@ import DropdownPanel from './dropdown-panel'
...
@@ -4,7 +4,7 @@ import DropdownPanel from './dropdown-panel'
export
const
StoragePanel
=
({
storage
,
header
})
=>
{
export
const
StoragePanel
=
({
storage
,
header
})
=>
{
return
(
return
(
<
div
id=
'storagepanel'
>
<
div
id=
'storagepanel'
>
<
DropdownPanel
dropdownName=
'Storage'
opts=
{
{
json
:
true
}
}
calldata=
{
storage
}
header=
{
header
}
/>
<
DropdownPanel
dropdownName=
'Storage'
calldata=
{
storage
}
header=
{
header
}
/>
</
div
>
</
div
>
)
)
}
}
...
...
libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger-head.tsx
View file @
06e7e3f5
...
@@ -6,14 +6,6 @@ import SolidityState from './solidity-state'
...
@@ -6,14 +6,6 @@ import SolidityState from './solidity-state'
import
SolidityLocals
from
'./solidity-locals'
import
SolidityLocals
from
'./solidity-locals'
export
const
VmDebuggerHead
=
({
vmDebuggerLogic
,
ready
})
=>
{
export
const
VmDebuggerHead
=
({
vmDebuggerLogic
,
ready
})
=>
{
const
[
panelVisibility
,
setPanelVisibility
]
=
useState
({
functionPanel
:
true
,
stepDetail
:
true
,
solidityState
:
true
,
solidityLocals
:
true
,
returnValuesPanel
:
true
,
fullStoragesChangesPanel
:
true
})
const
[
asm
,
setAsm
]
=
useState
({
const
[
asm
,
setAsm
]
=
useState
({
code
:
null
,
code
:
null
,
address
:
null
,
address
:
null
,
...
@@ -89,16 +81,6 @@ export const VmDebuggerHead = ({ vmDebuggerLogic, ready }) => {
...
@@ -89,16 +81,6 @@ export const VmDebuggerHead = ({ vmDebuggerLogic, ready }) => {
vmDebuggerLogic
.
event
.
register
(
'solidityLocalsMessage'
,
(
message
)
=>
{
vmDebuggerLogic
.
event
.
register
(
'solidityLocalsMessage'
,
(
message
)
=>
{
setSolidityLocals
({
...
solidityLocals
,
message
})
setSolidityLocals
({
...
solidityLocals
,
message
})
})
})
vmDebuggerLogic
.
event
.
register
(
'newTrace'
,
()
=>
{
setPanelVisibility
({
functionPanel
:
true
,
stepDetail
:
true
,
solidityState
:
true
,
solidityLocals
:
true
,
returnValuesPanel
:
true
,
fullStoragesChangesPanel
:
true
})
})
ready
()
ready
()
}
}
},
[
vmDebuggerLogic
])
},
[
vmDebuggerLogic
])
...
...
libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger.tsx
View file @
06e7e3f5
...
@@ -4,16 +4,10 @@ import MemoryPanel from './memory-panel'
...
@@ -4,16 +4,10 @@ import MemoryPanel from './memory-panel'
import
CallstackPanel
from
'./callstack-panel'
import
CallstackPanel
from
'./callstack-panel'
import
StackPanel
from
'./stack-panel'
import
StackPanel
from
'./stack-panel'
import
StoragePanel
from
'./storage-panel'
import
StoragePanel
from
'./storage-panel'
import
ReturnValuesPanel
from
'./dropdown-panel'
import
FullStoragesChangesPanel
from
'./full-storages-changes'
export
const
VmDebugger
=
({
vmDebuggerLogic
,
ready
})
=>
{
export
const
VmDebugger
=
({
vmDebuggerLogic
,
ready
})
=>
{
const
[
panelVisibility
,
setPanelVisibility
]
=
useState
({
asmCode
:
true
,
stackPanel
:
true
,
storagePanel
:
true
,
memoryPanel
:
true
,
calldataPanel
:
true
,
callstackPanel
:
true
,
})
const
[
calldataPanel
,
setCalldataPanel
]
=
useState
(
null
)
const
[
calldataPanel
,
setCalldataPanel
]
=
useState
(
null
)
const
[
memoryPanel
,
setMemoryPanel
]
=
useState
(
null
)
const
[
memoryPanel
,
setMemoryPanel
]
=
useState
(
null
)
const
[
callStackPanel
,
setCallStackPanel
]
=
useState
(
null
)
const
[
callStackPanel
,
setCallStackPanel
]
=
useState
(
null
)
...
@@ -22,6 +16,8 @@ export const VmDebugger = ({ vmDebuggerLogic, ready }) => {
...
@@ -22,6 +16,8 @@ export const VmDebugger = ({ vmDebuggerLogic, ready }) => {
calldata
:
null
,
calldata
:
null
,
header
:
null
header
:
null
})
})
const
[
returnValuesPanel
,
setReturnValuesPanel
]
=
useState
(
null
)
const
[
fullStoragesChangesPanel
,
setFullStoragesChangesPanel
]
=
useState
(
null
)
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
vmDebuggerLogic
)
{
if
(
vmDebuggerLogic
)
{
...
@@ -40,22 +36,15 @@ export const VmDebugger = ({ vmDebuggerLogic, ready }) => {
...
@@ -40,22 +36,15 @@ export const VmDebugger = ({ vmDebuggerLogic, ready }) => {
vmDebuggerLogic
.
event
.
register
(
'traceManagerStorageUpdate'
,
(
calldata
,
header
)
=>
{
vmDebuggerLogic
.
event
.
register
(
'traceManagerStorageUpdate'
,
(
calldata
,
header
)
=>
{
setStoragePanel
({
calldata
,
header
})
setStoragePanel
({
calldata
,
header
})
})
})
vmDebuggerLogic
.
event
.
register
(
'newTrace'
,
()
=>
{
vmDebuggerLogic
.
event
.
register
(
'traceReturnValueUpdate'
,
(
calldata
)
=>
{
setPanelVisibility
({
setReturnValuesPanel
(
calldata
)
asmCode
:
true
,
})
stackPanel
:
true
,
vmDebuggerLogic
.
event
.
register
(
'traceAddressesUpdate'
,
(
calldata
)
=>
{
storagePanel
:
true
,
setFullStoragesChangesPanel
({})
memoryPanel
:
true
,
})
calldataPanel
:
true
,
vmDebuggerLogic
.
event
.
register
(
'traceStorageUpdate'
,
(
calldata
)
=>
{
callstackPanel
:
true
,
setFullStoragesChangesPanel
(
calldata
)
})
})
})
// vmDebuggerLogic.event.register('newCallTree', () => {
// setPanelVisibility({
// ...panelVisibility,
// solidityPanel: false
// })
// })
ready
()
ready
()
}
}
},
[
vmDebuggerLogic
])
},
[
vmDebuggerLogic
])
...
@@ -68,6 +57,8 @@ export const VmDebugger = ({ vmDebuggerLogic, ready }) => {
...
@@ -68,6 +57,8 @@ export const VmDebugger = ({ vmDebuggerLogic, ready }) => {
<
StoragePanel
storage=
{
storagePanel
.
calldata
||
{}
}
header=
{
storagePanel
.
header
}
/>
<
StoragePanel
storage=
{
storagePanel
.
calldata
||
{}
}
header=
{
storagePanel
.
header
}
/>
<
CallstackPanel
calldata=
{
callStackPanel
||
{}
}
/>
<
CallstackPanel
calldata=
{
callStackPanel
||
{}
}
/>
<
CalldataPanel
calldata=
{
calldataPanel
||
{}
}
/>
<
CalldataPanel
calldata=
{
calldataPanel
||
{}
}
/>
<
ReturnValuesPanel
dropdownName=
"Return Value"
calldata=
{
returnValuesPanel
||
{}
}
/>
<
FullStoragesChangesPanel
calldata=
{
fullStoragesChangesPanel
||
{}
}
/>
</
div
>
</
div
>
</
div
>
</
div
>
)
)
...
...
libs/remix-ui/debugger-ui/src/types/index.ts
View file @
06e7e3f5
...
@@ -15,12 +15,6 @@ export type ExtractFunc = (json: any, parent?: any) => ExtractData
...
@@ -15,12 +15,6 @@ export type ExtractFunc = (json: any, parent?: any) => ExtractData
export
interface
DropdownPanelProps
{
export
interface
DropdownPanelProps
{
dropdownName
:
string
,
dropdownName
:
string
,
dropdownMessage
?:
string
,
dropdownMessage
?:
string
,
opts
:
{
json
:
boolean
,
css
?:
{
[
key
:
string
]:
string
}
},
calldata
?:
{
calldata
?:
{
[
key
:
string
]:
string
[
key
:
string
]:
string
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment