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
3e5d997f
Commit
3e5d997f
authored
Jun 27, 2018
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TxLogger
parent
7d232785
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
38 deletions
+36
-38
app.js
src/app.js
+3
-19
txLogger.js
src/app/execution/txLogger.js
+32
-18
test-tab.js
src/app/tabs/test-tab.js
+1
-1
No files found.
src/app.js
View file @
3e5d997f
...
...
@@ -382,7 +382,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
})
// ----------------- Compiler -----------------
self
.
_components
.
compiler
=
new
Compiler
(
self
.
importFileCb
)
self
.
_components
.
compiler
=
new
Compiler
(
(
url
,
cb
)
=>
self
.
importFileCb
(
url
,
cb
)
)
var
compiler
=
self
.
_components
.
compiler
registry
.
put
({
api
:
compiler
,
name
:
'compiler'
})
...
...
@@ -461,7 +461,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
}
}
})
registry
.
put
({
api
:
eventsDecoder
,
name
:
'events
D
ecoder'
})
registry
.
put
({
api
:
eventsDecoder
,
name
:
'events
d
ecoder'
})
txlistener
.
startListening
()
...
...
@@ -671,23 +671,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
self
.
_view
.
transactionDebugger
.
addProvider
(
'web3'
,
executionContext
.
internalWeb3
())
self
.
_view
.
transactionDebugger
.
switchProvider
(
executionContext
.
getProvider
())
var
txLogger
=
new
TxLogger
({
api
:
{
editorpanel
:
self
.
_components
.
editorpanel
,
resolvedTransaction
:
function
(
hash
)
{
return
txlistener
.
resolvedTransaction
(
hash
)
},
parseLogs
:
function
(
tx
,
contractName
,
contracts
,
cb
)
{
eventsDecoder
.
parseLogs
(
tx
,
contractName
,
contracts
,
cb
)
},
compiledContracts
:
function
()
{
return
compiledContracts
()
}
},
events
:
{
txListener
:
txlistener
.
event
}
})
var
txLogger
=
new
TxLogger
()
txLogger
.
event
.
register
(
'debugRequested'
,
(
hash
)
=>
{
self
.
startdebugging
(
hash
)
...
...
src/app/execution/txLogger.js
View file @
3e5d997f
...
...
@@ -13,6 +13,7 @@ var helper = require('../../lib/helper')
var
executionContext
=
require
(
'../../execution-context'
)
var
modalDialog
=
require
(
'../ui/modal-dialog-custom'
)
var
typeConversion
=
remixLib
.
execution
.
typeConversion
var
globlalRegistry
=
require
(
'../../global/registry'
)
var
css
=
csjs
`
.log {
...
...
@@ -123,9 +124,8 @@ var css = csjs`
*
*/
class
TxLogger
{
constructor
(
opts
=
{}
)
{
constructor
(
localRegistry
)
{
this
.
event
=
new
EventManager
()
this
.
opts
=
opts
this
.
seen
=
{}
function
filterTx
(
value
,
query
)
{
if
(
value
.
length
)
{
...
...
@@ -134,7 +134,17 @@ class TxLogger {
return
false
}
this
.
logKnownTX
=
opts
.
api
.
editorpanel
.
registerCommand
(
'knownTransaction'
,
(
args
,
cmds
,
append
)
=>
{
this
.
_components
=
{}
this
.
_components
.
registry
=
localRegistry
||
globlalRegistry
// dependencies
this
.
_deps
=
{
editorPanel
:
this
.
_components
.
registry
.
get
(
'editorpanel'
).
api
,
txListener
:
this
.
_components
.
registry
.
get
(
'txlistener'
).
api
,
eventsDecoder
:
this
.
_components
.
registry
.
get
(
'eventsdecoder'
).
api
,
compiler
:
this
.
_components
.
registry
.
get
(
'compiler'
).
api
}
this
.
logKnownTX
=
this
.
_deps
.
editorPanel
.
registerCommand
(
'knownTransaction'
,
(
args
,
cmds
,
append
)
=>
{
var
data
=
args
[
0
]
var
el
if
(
data
.
tx
.
isCall
)
{
...
...
@@ -146,46 +156,46 @@ class TxLogger {
append
(
el
)
},
{
activate
:
true
,
filterFn
:
filterTx
})
this
.
logUnknownTX
=
opts
.
api
.
editorp
anel
.
registerCommand
(
'unknownTransaction'
,
(
args
,
cmds
,
append
)
=>
{
this
.
logUnknownTX
=
this
.
_deps
.
editorP
anel
.
registerCommand
(
'unknownTransaction'
,
(
args
,
cmds
,
append
)
=>
{
var
data
=
args
[
0
]
var
el
=
renderUnknownTransaction
(
this
,
data
)
append
(
el
)
},
{
activate
:
false
,
filterFn
:
filterTx
})
this
.
logEmptyBlock
=
opts
.
api
.
editorp
anel
.
registerCommand
(
'emptyBlock'
,
(
args
,
cmds
,
append
)
=>
{
this
.
logEmptyBlock
=
this
.
_deps
.
editorP
anel
.
registerCommand
(
'emptyBlock'
,
(
args
,
cmds
,
append
)
=>
{
var
data
=
args
[
0
]
var
el
=
renderEmptyBlock
(
this
,
data
)
append
(
el
)
},
{
activate
:
true
})
opts
.
api
.
editorp
anel
.
event
.
register
(
'terminalFilterChanged'
,
(
type
,
label
)
=>
{
this
.
_deps
.
editorP
anel
.
event
.
register
(
'terminalFilterChanged'
,
(
type
,
label
)
=>
{
if
(
type
===
'deselect'
)
{
if
(
label
===
'only remix transactions'
)
{
opts
.
api
.
editorp
anel
.
updateTerminalFilter
({
type
:
'select'
,
value
:
'unknownTransaction'
})
this
.
_deps
.
editorP
anel
.
updateTerminalFilter
({
type
:
'select'
,
value
:
'unknownTransaction'
})
}
else
if
(
label
===
'all transactions'
)
{
opts
.
api
.
editorp
anel
.
updateTerminalFilter
({
type
:
'deselect'
,
value
:
'unknownTransaction'
})
this
.
_deps
.
editorP
anel
.
updateTerminalFilter
({
type
:
'deselect'
,
value
:
'unknownTransaction'
})
}
}
else
if
(
type
===
'select'
)
{
if
(
label
===
'only remix transactions'
)
{
opts
.
api
.
editorp
anel
.
updateTerminalFilter
({
type
:
'deselect'
,
value
:
'unknownTransaction'
})
this
.
_deps
.
editorP
anel
.
updateTerminalFilter
({
type
:
'deselect'
,
value
:
'unknownTransaction'
})
}
else
if
(
label
===
'all transactions'
)
{
opts
.
api
.
editorp
anel
.
updateTerminalFilter
({
type
:
'select'
,
value
:
'unknownTransaction'
})
this
.
_deps
.
editorP
anel
.
updateTerminalFilter
({
type
:
'select'
,
value
:
'unknownTransaction'
})
}
}
})
opts
.
events
.
txListener
.
register
(
'newBlock'
,
(
block
)
=>
{
this
.
_deps
.
txListener
.
event
.
register
(
'newBlock'
,
(
block
)
=>
{
if
(
!
block
.
transactions
.
length
)
{
this
.
logEmptyBlock
({
block
:
block
})
}
})
opts
.
events
.
txListener
.
register
(
'newTransaction'
,
(
tx
,
receipt
)
=>
{
log
(
this
,
tx
,
receipt
,
opts
.
api
)
this
.
_deps
.
txListener
.
event
.
register
(
'newTransaction'
,
(
tx
,
receipt
)
=>
{
log
(
this
,
tx
,
receipt
)
})
opts
.
events
.
txListener
.
register
(
'newCall'
,
(
tx
)
=>
{
log
(
this
,
tx
,
null
,
opts
.
api
)
this
.
_deps
.
txListener
.
event
.
register
(
'newCall'
,
(
tx
)
=>
{
log
(
this
,
tx
,
null
)
})
}
}
...
...
@@ -199,10 +209,14 @@ function debug (e, data, self) {
}
}
function
log
(
self
,
tx
,
receipt
,
api
)
{
var
resolvedTransaction
=
api
.
resolvedTransaction
(
tx
.
hash
)
function
log
(
self
,
tx
,
receipt
)
{
var
resolvedTransaction
=
self
.
_deps
.
txListener
.
resolvedTransaction
(
tx
.
hash
)
if
(
resolvedTransaction
)
{
api
.
parseLogs
(
tx
,
resolvedTransaction
.
contractName
,
api
.
compiledContracts
(),
(
error
,
logs
)
=>
{
var
compiledContracts
=
null
if
(
self
.
_deps
.
compiler
.
lastCompilationResult
&&
self
.
_deps
.
compiler
.
lastCompilationResult
.
data
)
{
compiledContracts
=
self
.
_deps
.
compiler
.
lastCompilationResult
.
data
.
contracts
}
self
.
_deps
.
eventsDecoder
.
parseLogs
(
tx
,
resolvedTransaction
.
contractName
,
compiledContracts
,
(
error
,
logs
)
=>
{
if
(
!
error
)
{
self
.
logKnownTX
({
tx
:
tx
,
receipt
:
receipt
,
resolvedData
:
resolvedTransaction
,
logs
:
logs
})
}
...
...
src/app/tabs/test-tab.js
View file @
3e5d997f
...
...
@@ -77,7 +77,7 @@ module.exports = class TestTab {
remixTests
.
runTestSources
(
runningTest
,
testCallback
,
resultsCallback
,
(
error
,
result
)
=>
{
updateFinalResult
(
error
,
result
)
callback
(
error
)
},
this
.
_deps
.
app
.
importFileCb
)
},
(
url
,
cb
)
=>
{
this
.
_deps
.
app
.
importFileCb
(
url
,
cb
)
}
)
}
})
}
...
...
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