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
ff6aa80d
Commit
ff6aa80d
authored
Aug 09, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use tx logger
parent
ad90b48c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
26 deletions
+22
-26
app.js
src/app.js
+22
-26
No files found.
src/app.js
View file @
ff6aa80d
...
...
@@ -32,6 +32,7 @@ var RighthandPanel = require('./app/panels/righthand-panel')
var
examples
=
require
(
'./app/editor/example-contracts'
)
var
modalDialogCustom
=
require
(
'./app/ui/modal-dialog-custom'
)
var
Txlistener
=
require
(
'./app/execution/txListener'
)
var
txLogger
=
require
(
'./app/execution/txLogger'
)
var
EventsDecoder
=
require
(
'./app/execution/eventsDecoder'
)
var
Web3VMProvider
=
remix
.
web3
.
web3VMProvider
...
...
@@ -812,33 +813,28 @@ function run () {
txlistener
.
startListening
()
txlistener
.
event
.
register
(
'newTransaction'
,
(
tx
)
=>
{
var
resolvedTransaction
=
txlistener
.
resolvedTransaction
(
tx
.
hash
)
var
address
=
null
if
(
resolvedTransaction
)
{
var
resolvedContract
address
=
resolvedTransaction
.
contractAddress
?
resolvedTransaction
.
contractAddress
:
tx
.
to
resolvedContract
=
txlistener
.
resolvedContract
(
address
)
if
(
resolvedContract
)
{
eventsDecoder
.
parseLogs
(
tx
,
resolvedContract
,
compiledContracts
(),
(
error
,
log
)
=>
{
console
.
log
({
tx
:
tx
,
resolvedTransaction
:
resolvedTransaction
,
resolvedContract
:
resolvedContract
,
resolvedEvents
:
(
!
error
?
log
:
error
)
})
})
}
else
{
console
.
log
({
tx
:
tx
,
resolvedTransaction
:
resolvedTransaction
})
txLogger
({
api
:
{
/**
* log the given transaction.
*
* @param {Object} tx - DOM element representing the transaction
*/
log
:
function
(
tx
)
{
// terminal.log(tx)
},
resolvedTransaction
:
function
(
hash
)
{
return
txlistener
.
resolvedTransaction
(
hash
)
},
parseLogs
:
function
(
tx
,
contractName
,
contracts
,
cb
)
{
eventsDecoder
.
parseLogs
(
tx
,
contractName
,
contracts
,
cb
)
},
compiledContracts
:
function
()
{
return
compiledContracts
()
}
}
else
{
// contract unknown - just displaying raw tx.
console
.
log
({
tx
:
tx
})
},
events
:
{
txListener
:
txlistener
.
event
}
})
...
...
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