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
772de893
Commit
772de893
authored
Aug 31, 2021
by
davidzagi93@gmail.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testing debugger
parent
61f2db6e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
24 deletions
+10
-24
journalLastChildIncludes.ts
apps/remix-ide-e2e/src/commands/journalLastChildIncludes.ts
+0
-1
debugger.spec.ts
apps/remix-ide-e2e/src/tests/debugger.spec.ts
+9
-0
terminalAction.ts
libs/remix-ui/terminal/src/lib/actions/terminalAction.ts
+1
-2
terminalReducer.ts
libs/remix-ui/terminal/src/lib/reducers/terminalReducer.ts
+0
-2
remix-ui-terminal.tsx
libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx
+0
-19
No files found.
apps/remix-ide-e2e/src/commands/journalLastChildIncludes.ts
View file @
772de893
...
...
@@ -12,7 +12,6 @@ class JournalLastChildIncludes extends EventEmitter {
.
getText
(
'*[data-id="terminalJournal"]'
,
(
result
)
=>
{
this
.
api
.
pause
(
5000
)
console
.
log
(
'JournalLastChildIncludes'
,
result
.
value
)
console
.
log
({
val
},
' JournalLastchildIncludes val'
)
if
(
typeof
result
.
value
===
'string'
&&
result
.
value
.
indexOf
(
val
)
===
-
1
)
return
this
.
api
.
assert
.
fail
(
`wait for
${
val
}
in
${
result
.
value
}
`
)
else
this
.
api
.
assert
.
ok
(
true
,
`<*[data-id="terminalJournal"]> contains
${
val
}
.`
)
this
.
emit
(
'complete'
)
...
...
apps/remix-ide-e2e/src/tests/debugger.spec.ts
View file @
772de893
...
...
@@ -187,6 +187,15 @@ module.exports = {
browser
.
addFile
(
'test_jsGetTrace.js'
,
{
content
:
jsGetTrace
})
.
executeScript
(
'remix.exeCurrent()'
)
.
pause
(
5000
)
.
execute
(
function
()
{
const
env
:
any
=
document
.
getElementById
(
'journal'
)
return
env
.
value
},
[],
function
(
result
)
{
console
.
log
({
result
})
browser
.
assert
.
ok
(
result
.
value
.
includes
(
'result { "gas": "0x575f", "return": "0x0000000000000000000000000000000000000000000000000000000000000000", "structLogs":'
),
'value not found'
)
})
.
pause
(
5000
)
.
waitForElementContainsText
(
'*[data-id="terminalJournal"]'
,
'result { "gas": "0x575f", "return": "0x0000000000000000000000000000000000000000000000000000000000000000", "structLogs":'
,
60000
)
},
...
...
libs/remix-ui/terminal/src/lib/actions/terminalAction.ts
View file @
772de893
...
...
@@ -140,8 +140,7 @@ export const initListeningOnNetwork = (props, dispatch) => {
dispatch
({
type
:
'emptyBlock'
,
payload
:
{
message
:
0
}
})
}
})
props
.
txListener
.
event
.
register
(
'knownTransaction'
,
(
block
)
=>
{
console
.
log
({
block
},
' is call transaction test'
)
props
.
txListener
.
event
.
register
(
'knownTransaction'
,
()
=>
{
})
props
.
txListener
.
event
.
register
(
'newCall'
,
(
tx
,
receipt
)
=>
{
log
(
props
,
tx
,
receipt
,
dispatch
)
...
...
libs/remix-ui/terminal/src/lib/reducers/terminalReducer.ts
View file @
772de893
...
...
@@ -73,7 +73,6 @@ export const registerCommandReducer = (state, action) => {
...
state
.
journalBlocks
.
splice
(
0
)
}
case
'listenOnNetWork'
:
console
.
log
({
action
:
action
.
payload
})
return
{
...
state
,
journalBlocks
:
initialState
.
journalBlocks
.
push
({
message
:
action
.
payload
.
message
,
style
:
'text-info'
})
...
...
@@ -119,7 +118,6 @@ export const registerFilterReducer = (state, action) => {
export
const
addCommandHistoryReducer
=
(
state
,
action
)
=>
{
switch
(
action
.
type
)
{
case
'cmdHistory'
:
console
.
log
({
action
},
{
state
},
'cmd history'
)
return
{
...
state
,
_commandHistory
:
initialState
.
_commandHistory
.
unshift
(
action
.
payload
.
script
)
...
...
libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx
View file @
772de893
...
...
@@ -125,11 +125,9 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
useEffect
(()
=>
{
scrollToBottom
()
console
.
log
({
messagesEndRef
:
messagesEndRef
.
current
},
' onScroll'
)
},
[
newstate
.
journalBlocks
.
length
,
props
.
logHtml
.
length
])
function
execute
(
file
,
cb
)
{
console
.
log
(
'called execute scriptRunner'
)
function
_execute
(
content
,
cb
)
{
if
(
!
content
)
{
// toolTip('no content to execute')
...
...
@@ -231,22 +229,17 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
try
{
const
cmds
=
vm
.
createContext
(
context
)
const
result
=
vm
.
runInContext
(
script
,
cmds
)
console
.
log
(
done
,
' done func'
)
return
done
(
null
,
result
)
}
catch
(
error
)
{
return
done
(
error
.
message
)
}
}
try
{
console
.
log
(
' remix command by david 2'
)
let
result
:
any
if
(
script
.
trim
().
startsWith
(
'git'
))
{
// result = await this.call('git', 'execute', script)
}
else
{
console
.
log
(
' remix command by david 3'
)
result
=
await
props
.
thisState
.
call
(
'scriptRunner'
,
'execute'
,
script
)
console
.
log
({
result
},
' me '
)
}
console
.
log
({
result
})
done
()
...
...
@@ -314,7 +307,6 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
event
.
preventDefault
()
event
.
stopPropagation
()
if
(
toggleDownUp
===
'fa-angle-double-down'
)
{
console
.
log
(
'clikced down'
)
setToggleDownUp
(
'fa-angle-double-up'
)
props
.
event
.
trigger
(
'resize'
,
[])
}
else
{
...
...
@@ -355,10 +347,8 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
if
(
autoCompletState
.
userInput
.
length
===
1
)
{
setAutoCompleteState
(
prevState
=>
({
...
prevState
,
activeSuggestion
:
0
,
showSuggestions
:
false
,
userInput
:
Object
.
keys
(
autoCompletState
.
data
.
_options
[
0
]).
toString
()
}))
}
else
{
console
.
log
(
autoCompletState
.
activeSuggestion
,
'autoCompletState.userInput.length'
)
setAutoCompleteState
(
prevState
=>
({
...
prevState
,
activeSuggestion
:
0
,
showSuggestions
:
false
,
userInput
:
inputEl
.
current
.
value
}))
}
console
.
log
({
autoCompletState
},
'autoCompletState'
)
}
if
(
event
.
which
===
13
&&
!
autoCompletState
.
showSuggestions
)
{
if
(
event
.
ctrlKey
)
{
// <ctrl+enter>
...
...
@@ -379,10 +369,8 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
setAutoCompleteState
(
prevState
=>
({
...
prevState
,
showSuggestions
:
false
}))
}
}
else
if
(
newstate
.
_commandHistory
.
length
&&
event
.
which
===
38
&&
!
autoCompletState
.
showSuggestions
&&
(
autoCompletState
.
userInput
===
''
))
{
console
.
log
(
'previous command up'
)
// if (autoCompletState.commandHistoryIndex < 1) {
event
.
preventDefault
()
console
.
log
(
newstate
.
_commandHistory
[
0
],
' up value'
)
setAutoCompleteState
(
prevState
=>
({
...
prevState
,
userInput
:
newstate
.
_commandHistory
[
0
]
}))
}
else
if
(
event
.
which
===
38
&&
autoCompletState
.
showSuggestions
)
{
event
.
preventDefault
()
...
...
@@ -390,14 +378,12 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
return
}
setAutoCompleteState
(
prevState
=>
({
...
prevState
,
activeSuggestion
:
suggestionCount
-
1
,
userInput
:
Object
.
keys
(
autoCompletState
.
data
.
_options
[
autoCompletState
.
activeSuggestion
]).
toString
()
}))
console
.
log
({
autoCompletState
},
'disable up an down key in input box'
)
}
else
if
(
event
.
which
===
38
&&
!
autoCompletState
.
showSuggestions
)
{
// <arrowUp>
// const len = _cmdHistory.length
// if (len === 0) event.preventDefault()
if
(
cmdHistory
.
length
-
1
>
_cmdIndex
)
{
setCmdIndex
(
prevState
=>
prevState
++
)
}
// console.log({ _cmdIndex }, 'history')
inputEl
.
current
.
innerText
=
cmdHistory
[
_cmdIndex
]
inputEl
.
current
.
focus
()
}
else
if
(
event
.
which
===
40
&&
autoCompletState
.
showSuggestions
)
{
...
...
@@ -585,7 +571,6 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
const
block
=
data
.
receipt
?
data
.
receipt
.
blockNumber
:
data
.
blockNumber
||
''
const
i
=
data
.
receipt
?
data
.
transactionIndex
:
data
.
transactionIndex
const
value
=
val
?
typeConversion
.
toInt
(
val
)
:
0
console
.
log
({
blockChainProvider
:
blockchain
.
getProvider
()
},
' blockChain Provider'
)
if
(
blockchain
.
getProvider
()
===
'vm'
)
{
return
(
<
div
>
...
...
@@ -1401,9 +1386,6 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
return
(
<
div
style=
{
{
height
:
'323px'
,
flexGrow
:
1
}
}
className=
'panel'
>
{
console
.
log
({
newstate
})
}
{
console
.
log
({
_cmdIndex
})
}
{
console
.
log
({
cmdHistory
})
}
<
div
className=
"bar"
>
{
/* ${self._view.dragbar} */
}
<
div
className=
"dragbarHorizontal"
onMouseDown=
{
mousedown
}
id=
'dragId'
></
div
>
...
...
@@ -1476,7 +1458,6 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
})
}
else
if
(
x
.
name
===
'knownTransaction'
)
{
return
x
.
message
.
map
((
trans
)
=>
{
console
.
log
({
trans
},
' resolveData'
)
return
(<
div
className=
'px-4 block'
data
-
id=
{
`block_tx${trans.tx.hash}`
}
key=
{
index
}
>
{
trans
.
tx
.
isCall
?
renderCall
(
trans
.
tx
,
trans
.
resolvedData
,
trans
.
logs
,
index
)
:
renderKnownTransactions
(
trans
.
tx
,
trans
.
receipt
,
trans
.
resolvedData
,
trans
.
logs
,
index
)
}
</
div
>)
})
}
else
{
...
...
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