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
389b6ecc
Commit
389b6ecc
authored
Dec 27, 2019
by
Iuri Matias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use blockchain object in txlogger
parent
e65f3559
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
terminal.js
src/app/panels/terminal.js
+1
-1
txLogger.js
src/app/ui/txLogger.js
+10
-10
No files found.
src/app/panels/terminal.js
View file @
389b6ecc
...
@@ -438,7 +438,7 @@ class Terminal extends Plugin {
...
@@ -438,7 +438,7 @@ class Terminal extends Plugin {
self
.
_shell
(
'remix.help()'
,
self
.
commands
,
()
=>
{})
self
.
_shell
(
'remix.help()'
,
self
.
commands
,
()
=>
{})
self
.
commands
.
html
(
intro
)
self
.
commands
.
html
(
intro
)
self
.
_components
.
txLogger
=
new
TxLogger
(
self
.
_opts
.
eventsDecoder
,
self
.
_opts
.
txListener
,
this
,
self
.
executionContext
)
self
.
_components
.
txLogger
=
new
TxLogger
(
self
.
_opts
.
eventsDecoder
,
self
.
_opts
.
txListener
,
this
,
self
.
blockchain
)
self
.
_components
.
txLogger
.
event
.
register
(
'debuggingRequested'
,
(
hash
)
=>
{
self
.
_components
.
txLogger
.
event
.
register
(
'debuggingRequested'
,
(
hash
)
=>
{
// TODO should probably be in the run module
// TODO should probably be in the run module
if
(
!
self
.
_opts
.
appManager
.
isActive
(
'debugger'
))
self
.
_opts
.
appManager
.
activateOne
(
'debugger'
)
if
(
!
self
.
_opts
.
appManager
.
isActive
(
'debugger'
))
self
.
_opts
.
appManager
.
activateOne
(
'debugger'
)
...
...
src/app/ui/txLogger.js
View file @
389b6ecc
...
@@ -116,7 +116,7 @@ var css = csjs`
...
@@ -116,7 +116,7 @@ var css = csjs`
*
*
*/
*/
class
TxLogger
{
class
TxLogger
{
constructor
(
eventsDecoder
,
txListener
,
terminal
,
executionContext
)
{
constructor
(
eventsDecoder
,
txListener
,
terminal
,
blockchain
)
{
this
.
event
=
new
EventManager
()
this
.
event
=
new
EventManager
()
this
.
seen
=
{}
this
.
seen
=
{}
function
filterTx
(
value
,
query
)
{
function
filterTx
(
value
,
query
)
{
...
@@ -139,7 +139,7 @@ class TxLogger {
...
@@ -139,7 +139,7 @@ class TxLogger {
if
(
data
.
tx
.
isCall
)
{
if
(
data
.
tx
.
isCall
)
{
el
=
renderCall
(
this
,
data
)
el
=
renderCall
(
this
,
data
)
}
else
{
}
else
{
el
=
renderKnownTransaction
(
this
,
data
,
executionContext
)
el
=
renderKnownTransaction
(
this
,
data
,
blockchain
)
}
}
this
.
seen
[
data
.
tx
.
hash
]
=
el
this
.
seen
[
data
.
tx
.
hash
]
=
el
append
(
el
)
append
(
el
)
...
@@ -148,7 +148,7 @@ class TxLogger {
...
@@ -148,7 +148,7 @@ class TxLogger {
this
.
logUnknownTX
=
this
.
terminal
.
registerCommand
(
'unknownTransaction'
,
(
args
,
cmds
,
append
)
=>
{
this
.
logUnknownTX
=
this
.
terminal
.
registerCommand
(
'unknownTransaction'
,
(
args
,
cmds
,
append
)
=>
{
// triggered for transaction AND call
// triggered for transaction AND call
var
data
=
args
[
0
]
var
data
=
args
[
0
]
var
el
=
renderUnknownTransaction
(
this
,
data
,
executionContext
)
var
el
=
renderUnknownTransaction
(
this
,
data
,
blockchain
)
append
(
el
)
append
(
el
)
},
{
activate
:
false
,
filterFn
:
filterTx
})
},
{
activate
:
false
,
filterFn
:
filterTx
})
...
@@ -204,7 +204,7 @@ function log (self, tx, receipt) {
...
@@ -204,7 +204,7 @@ function log (self, tx, receipt) {
}
}
}
}
function
renderKnownTransaction
(
self
,
data
,
executionContext
)
{
function
renderKnownTransaction
(
self
,
data
,
blockchain
)
{
var
from
=
data
.
tx
.
from
var
from
=
data
.
tx
.
from
var
to
=
data
.
resolvedData
.
contractName
+
'.'
+
data
.
resolvedData
.
fn
var
to
=
data
.
resolvedData
.
contractName
+
'.'
+
data
.
resolvedData
.
fn
var
obj
=
{
from
,
to
}
var
obj
=
{
from
,
to
}
...
@@ -213,7 +213,7 @@ function renderKnownTransaction (self, data, executionContext) {
...
@@ -213,7 +213,7 @@ function renderKnownTransaction (self, data, executionContext) {
<span id="tx
${
data
.
tx
.
hash
}
">
<span id="tx
${
data
.
tx
.
hash
}
">
<div class="
${
css
.
log
}
" onclick=
${
e
=>
txDetails
(
e
,
tx
,
data
,
obj
)}
>
<div class="
${
css
.
log
}
" onclick=
${
e
=>
txDetails
(
e
,
tx
,
data
,
obj
)}
>
${
checkTxStatus
(
data
.
receipt
,
txType
)}
${
checkTxStatus
(
data
.
receipt
,
txType
)}
${
context
(
self
,
{
from
,
to
,
data
},
executionContext
)}
${
context
(
self
,
{
from
,
to
,
data
},
blockchain
)}
<div class=
${
css
.
buttons
}
>
<div class=
${
css
.
buttons
}
>
<button class="
${
css
.
debug
}
btn btn-primary btn-sm" onclick=
${(
e
)
=>
debug
(
e
,
data
,
self
)}
>Debug</div>
<button class="
${
css
.
debug
}
btn btn-primary btn-sm" onclick=
${(
e
)
=>
debug
(
e
,
data
,
self
)}
>Debug</div>
</div>
</div>
...
@@ -250,7 +250,7 @@ function renderCall (self, data) {
...
@@ -250,7 +250,7 @@ function renderCall (self, data) {
return
tx
return
tx
}
}
function
renderUnknownTransaction
(
self
,
data
,
executionContext
)
{
function
renderUnknownTransaction
(
self
,
data
,
blockchain
)
{
var
from
=
data
.
tx
.
from
var
from
=
data
.
tx
.
from
var
to
=
data
.
tx
.
to
var
to
=
data
.
tx
.
to
var
obj
=
{
from
,
to
}
var
obj
=
{
from
,
to
}
...
@@ -259,7 +259,7 @@ function renderUnknownTransaction (self, data, executionContext) {
...
@@ -259,7 +259,7 @@ function renderUnknownTransaction (self, data, executionContext) {
<span id="tx
${
data
.
tx
.
hash
}
">
<span id="tx
${
data
.
tx
.
hash
}
">
<div class="
${
css
.
log
}
" onclick=
${
e
=>
txDetails
(
e
,
tx
,
data
,
obj
)}
>
<div class="
${
css
.
log
}
" onclick=
${
e
=>
txDetails
(
e
,
tx
,
data
,
obj
)}
>
${
checkTxStatus
(
data
.
receipt
||
data
.
tx
,
txType
)}
${
checkTxStatus
(
data
.
receipt
||
data
.
tx
,
txType
)}
${
context
(
self
,
{
from
,
to
,
data
},
executionContext
)}
${
context
(
self
,
{
from
,
to
,
data
},
blockchain
)}
<div class=
${
css
.
buttons
}
>
<div class=
${
css
.
buttons
}
>
<div class="
${
css
.
debug
}
btn btn-primary btn-sm" onclick=
${(
e
)
=>
debug
(
e
,
data
,
self
)}
>Debug</div>
<div class="
${
css
.
debug
}
btn btn-primary btn-sm" onclick=
${(
e
)
=>
debug
(
e
,
data
,
self
)}
>Debug</div>
</div>
</div>
...
@@ -290,7 +290,7 @@ function checkTxStatus (tx, type) {
...
@@ -290,7 +290,7 @@ function checkTxStatus (tx, type) {
}
}
}
}
function
context
(
self
,
opts
,
executionContext
)
{
function
context
(
self
,
opts
,
blockchain
)
{
var
data
=
opts
.
data
||
''
var
data
=
opts
.
data
||
''
var
from
=
opts
.
from
?
helper
.
shortenHexData
(
opts
.
from
)
:
''
var
from
=
opts
.
from
?
helper
.
shortenHexData
(
opts
.
from
)
:
''
var
to
=
opts
.
to
var
to
=
opts
.
to
...
@@ -302,7 +302,7 @@ function context (self, opts, executionContext) {
...
@@ -302,7 +302,7 @@ function context (self, opts, executionContext) {
var
block
=
data
.
tx
.
blockNumber
||
''
var
block
=
data
.
tx
.
blockNumber
||
''
var
i
=
data
.
tx
.
transactionIndex
var
i
=
data
.
tx
.
transactionIndex
var
value
=
val
?
typeConversion
.
toInt
(
val
)
:
0
var
value
=
val
?
typeConversion
.
toInt
(
val
)
:
0
if
(
executionContext
.
getProvider
()
===
'vm'
)
{
if
(
blockchain
.
getProvider
()
===
'vm'
)
{
return
yo
`
return
yo
`
<div>
<div>
<span class=
${
css
.
txLog
}
>
<span class=
${
css
.
txLog
}
>
...
@@ -315,7 +315,7 @@ function context (self, opts, executionContext) {
...
@@ -315,7 +315,7 @@ function context (self, opts, executionContext) {
<div class=
${
css
.
txItem
}
><span class=
${
css
.
txItemTitle
}
>hash:</span>
${
hash
}
</div>
<div class=
${
css
.
txItem
}
><span class=
${
css
.
txItemTitle
}
>hash:</span>
${
hash
}
</div>
</span>
</span>
</div>`
</div>`
}
else
if
(
executionContext
.
getProvider
()
!==
'vm'
&&
data
.
resolvedData
)
{
}
else
if
(
blockchain
.
getProvider
()
!==
'vm'
&&
data
.
resolvedData
)
{
return
yo
`
return
yo
`
<div>
<div>
<span class=
${
css
.
txLog
}
>
<span class=
${
css
.
txLog
}
>
...
...
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