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
247bac87
Unverified
Commit
247bac87
authored
Jan 16, 2018
by
yann300
Committed by
GitHub
Jan 16, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #991 from ethereum/improverecorder
Recorder: resolve input parameters that might contains "created{address}"
parents
968f2bba
9a0aa3de
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
recorder.js
src/recorder.js
+20
-0
testRecorder.js
test-browser/tests/units/testRecorder.js
+2
-2
No files found.
src/recorder.js
View file @
247bac87
...
...
@@ -212,6 +212,26 @@ class Recorder {
cb
(
'cannot resolve abi'
)
return
}
if
(
tx
.
record
.
parameters
)
{
/* check if we have some params to resolve */
try
{
tx
.
record
.
parameters
.
forEach
((
value
,
index
)
=>
{
var
isString
=
true
if
(
typeof
value
!==
'string'
)
{
isString
=
false
value
=
JSON
.
stringify
(
value
)
}
for
(
var
timestamp
in
self
.
data
.
_createdContractsReverse
)
{
value
=
value
.
replace
(
new
RegExp
(
'created
\\
{'
+
timestamp
+
'
\\
}'
,
'g'
),
self
.
data
.
_createdContractsReverse
[
timestamp
])
}
if
(
!
isString
)
value
=
JSON
.
parse
(
value
)
tx
.
record
.
parameters
[
index
]
=
value
})
}
catch
(
e
)
{
modal
.
alert
(
'cannot resolve input parameters '
+
JSON
.
stringify
(
tx
.
record
.
parameters
)
+
'. Execution stopped at '
+
index
)
return
}
}
var
data
=
format
.
encodeData
(
fnABI
,
tx
.
record
.
parameters
,
tx
.
record
.
bytecode
)
if
(
data
.
error
)
{
modal
.
alert
(
data
.
error
+
'. Record:'
+
JSON
.
stringify
(
record
,
null
,
'
\
t'
)
+
'. Execution stopped at '
+
index
)
...
...
test-browser/tests/units/testRecorder.js
View file @
247bac87
...
...
@@ -16,7 +16,7 @@ module.exports = {
.
clickFunction
(
'getFromLib - call'
)
.
waitForElementPresent
(
'div[class^="contractProperty"] div[class^="value"]'
)
.
perform
((
client
,
done
)
=>
{
contractHelper
.
verifyCallReturnValue
(
browser
,
'0x35ef07393b57464e93deb59175ff72e6499450cf'
,
[
'0: uint256: 1'
,
'0: uint256: 3456'
,
'0: address: 0x
ca35b7d915458ef540ade6068dfe2f44e8fa733c
'
],
()
=>
{
contractHelper
.
verifyCallReturnValue
(
browser
,
'0x35ef07393b57464e93deb59175ff72e6499450cf'
,
[
'0: uint256: 1'
,
'0: uint256: 3456'
,
'0: address: 0x
35ef07393b57464e93deb59175ff72e6499450cf
'
],
()
=>
{
done
()
})
})
...
...
@@ -115,7 +115,7 @@ var records = `{
"value": "1000000000000000000",
"parameters": [
1,
"
0xca35b7d915458ef540ade6068dfe2f44e8fa733c
"
"
created{1512830015080}
"
],
"to": "created{1512830015080}",
"abi": "0xc41589e7559804ea4a2080dad19d876a024ccb05117835447d72ce08c1d020ec",
...
...
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