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
53201354
Commit
53201354
authored
Oct 04, 2017
by
serapath
Committed by
yann300
Dec 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
REFACTOR names & FIX argument bugs
parent
f11b3e1e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
recorder.js
src/recorder.js
+10
-9
No files found.
src/recorder.js
View file @
53201354
...
@@ -6,26 +6,27 @@ class Recorder {
...
@@ -6,26 +6,27 @@ class Recorder {
var
self
=
this
var
self
=
this
self
.
_api
=
opts
.
api
self
.
_api
=
opts
.
api
self
.
event
=
new
EventManager
()
self
.
event
=
new
EventManager
()
self
.
data
=
{
journal
:
[],
_pending
:
{}
}
self
.
data
=
{
journal
:
[],
_pending
Creation
:
{}
}
opts
.
events
.
executioncontext
.
register
(
'contextChanged'
,
function
()
{
opts
.
events
.
executioncontext
.
register
(
'contextChanged'
,
function
()
{
self
.
clearAll
()
self
.
clearAll
()
})
})
var
counter
=
1
var
counter
=
0
self
.
_addressCache
=
{}
self
.
_addressCache
=
{}
opts
.
events
.
udapp
.
register
(
'initiatingTransaction'
,
(
stamp
,
tx
)
=>
{
opts
.
events
.
udapp
.
register
(
'initiatingTransaction'
,
(
time
stamp
,
tx
)
=>
{
var
{
from
,
to
,
value
,
gas
,
data
}
=
tx
var
{
from
,
to
,
value
,
gas
,
data
}
=
tx
var
record
=
{
value
,
gas
,
data
}
var
record
=
{
value
,
gas
,
data
}
record
.
from
=
self
.
_addressCache
[
from
]
||
(
self
.
_addressCache
[
from
]
=
`<account -
${(
++
counter
)}
>`
)
record
.
from
=
self
.
_addressCache
[
from
]
||
(
self
.
_addressCache
[
from
]
=
`<account -
${(
++
counter
)}
>`
)
if
(
to
===
null
)
self
.
data
.
_pending
[
stamp
]
=
record
if
(
to
===
null
)
self
.
data
.
_pending
Creation
[
time
stamp
]
=
record
else
record
.
to
=
self
.
_addressCache
[
to
]
||
(
self
.
_addressCache
[
to
]
=
`<account -
${(
++
counter
)}
>`
)
else
record
.
to
=
self
.
_addressCache
[
to
]
||
(
self
.
_addressCache
[
to
]
=
`<account -
${(
++
counter
)}
>`
)
self
.
append
(
stamp
,
record
)
self
.
append
(
time
stamp
,
record
)
})
})
opts
.
events
.
udapp
.
register
(
'transactionExecuted'
,
args
=>
{
opts
.
events
.
udapp
.
register
(
'transactionExecuted'
,
(...
args
)
=>
{
var
err
=
args
[
0
]
var
err
=
args
[
0
]
if
(
err
)
console
.
error
(
err
)
if
(
err
)
console
.
error
(
err
)
var
stamp
=
args
[
6
]
var
timestamp
=
args
[
6
]
var
record
=
self
.
_pending
[
stamp
]
// update transaction which was pending with correct `to` address
delete
self
.
_pending
[
stamp
]
var
record
=
self
.
_pendingCreation
[
timestamp
]
delete
self
.
_pendingCreation
[
timestamp
]
if
(
!
record
)
return
if
(
!
record
)
return
var
to
=
args
[
2
]
var
to
=
args
[
2
]
record
.
to
=
self
.
_addressCache
[
to
]
||
(
self
.
_addressCache
[
to
]
=
`<contract -
${
++
counter
}
>`
)
record
.
to
=
self
.
_addressCache
[
to
]
||
(
self
.
_addressCache
[
to
]
=
`<contract -
${
++
counter
}
>`
)
...
...
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