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
ea2988ac
Commit
ea2988ac
authored
Oct 18, 2017
by
serapath
Committed by
yann300
Dec 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FIX recorder bugs
parent
04219939
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
14 deletions
+27
-14
run-tab.js
src/app/tabs/run-tab.js
+19
-9
recorder.js
src/recorder.js
+6
-3
universal-dapp.js
src/universal-dapp.js
+2
-2
No files found.
src/app/tabs/run-tab.js
View file @
ea2988ac
...
...
@@ -296,16 +296,26 @@ function makeRecorder (appAPI, appEvents) {
}
},
function
cancel
()
{
})
}
function
CALLBACK
(...
args
)
{
console
.
log
(
args
)
/*
at each callback call, if the transaction succeed and if this is a creation transaction,
we should call
function
CALLBACK
(
err
,
result
)
{
if
(
err
)
console
.
error
(
err
)
else
{
console
.
log
(
result
)
// {
// "result": {
// "gasUsed": "5318",
// "vm": { "exception": 1, "selfdestruct": {} },
// "bloom": { "bitvector": { "type": "Buffer", "data": [0, /* ... */ 0, 0] } },
// "amountSpent": "5318"
// },
// "transactionHash": "0x84f68f96944a47b27af4b4ed1986637aa1bc05fd7a6f5cb1d6a53f68058276d8"
// }
/*
at each callback call, if the transaction succeed and if this is a creation transaction, we should call
runtab.addInstance( ... ) // which basically do
:
instanceContainer.appendChild(appAPI.udapp().renderInstance(contract, address, selectContractNames.value))
*/
runtab.addInstance( ... ) // which basically does
:
instanceContainer.appendChild(appAPI.udapp().renderInstance(contract, address, selectContractNames.value))
*/
}
}
return
el
}
...
...
src/recorder.js
View file @
ea2988ac
...
...
@@ -24,8 +24,8 @@ class Recorder {
self
.
_api
.
getAccounts
(
function
(
err
,
accounts
=
[])
{
if
(
err
)
console
.
error
(
err
)
record
.
from
=
self
.
_addressCache
[
from
]
||
(
self
.
_addressCache
[
from
]
=
`<account -
${
getIndex
(
accounts
,
from
)}
>`
)
if
(
to
===
null
)
self
.
data
.
_pendingCreation
[
timestamp
]
=
record
else
record
.
to
=
self
.
_addressCache
[
to
]
||
(
self
.
_addressCache
[
to
]
=
`<account -
${
getIndex
(
accounts
,
to
)}
>`
)
if
(
to
)
record
.
to
=
self
.
_addressCache
[
to
]
||
(
self
.
_addressCache
[
to
]
=
`<account -
${
getIndex
(
accounts
,
to
)}
>`
)
else
self
.
data
.
_pendingCreation
[
timestamp
]
=
record
self
.
append
(
timestamp
,
record
)
})
})
...
...
@@ -38,7 +38,10 @@ class Recorder {
delete
self
.
data
.
_pendingCreation
[
timestamp
]
if
(
!
record
)
return
var
to
=
args
[
2
]
record
.
to
=
self
.
_addressCache
[
to
]
||
(
self
.
_addressCache
[
to
]
=
`<contract -
${
++
counter
}
>`
)
self
.
_api
.
getAccounts
(
function
(
err
,
accounts
=
[])
{
if
(
err
)
console
.
error
(
err
)
if
(
to
)
record
.
to
=
self
.
_addressCache
[
to
]
||
(
self
.
_addressCache
[
to
]
=
`<contract -
${
getIndex
(
accounts
,
to
)}
>`
)
})
})
}
append
(
timestamp
,
record
)
{
...
...
src/universal-dapp.js
View file @
ea2988ac
...
...
@@ -471,9 +471,9 @@ UniversalDApp.prototype.replayTx = function (args, cb) {
var
self
=
this
self
.
getAccounts
(
function
(
err
,
accounts
=
[])
{
if
(
err
)
console
.
error
(
err
)
if
(
args
.
to
[
0
]
===
'<'
)
args
.
to
=
accounts
[
args
.
to
.
split
(
'>'
)[
0
].
slice
(
11
)]
if
(
args
.
to
&&
args
.
to
[
0
]
===
'<'
)
args
.
to
=
accounts
[
args
.
to
.
split
(
'>'
)[
0
].
slice
(
11
)]
if
(
args
.
from
&&
args
.
from
[
0
]
===
'<'
)
args
.
from
=
accounts
[
args
.
from
.
split
(
'>'
)[
0
].
slice
(
11
)]
var
pipeline
=
[
runTransaction
]
var
pipeline
=
[
queryGasLimit
,
runTransaction
]
var
env
=
{
self
,
args
,
tx
:
{
to
:
args
.
to
,
from
:
args
.
from
,
data
:
args
.
data
,
useCall
:
args
.
useCall
}
}
execute
(
pipeline
,
env
,
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