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
4a71d9d5
Unverified
Commit
4a71d9d5
authored
Apr 26, 2018
by
yann300
Committed by
GitHub
Apr 26, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1277 from ethereum/useEthersForAbiCoding
Use ethers for abi coding
parents
a8008743
55773aab
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
17 deletions
+41
-17
config.yml
.circleci/config.yml
+2
-2
txLogger.js
src/app/execution/txLogger.js
+1
-1
contracts.js
test-browser/helpers/contracts.js
+14
-2
compiling.js
test-browser/tests/compiling.js
+23
-11
testRecorder.js
test-browser/tests/units/testRecorder.js
+1
-1
No files found.
.circleci/config.yml
View file @
4a71d9d5
...
@@ -26,10 +26,10 @@ jobs:
...
@@ -26,10 +26,10 @@ jobs:
-
checkout
-
checkout
-
restore_cache
:
-
restore_cache
:
keys
:
keys
:
-
dep-bundle-
7
-{{ checksum "package.json" }}
-
dep-bundle-
10
-{{ checksum "package.json" }}
-
run
:
npm install
-
run
:
npm install
-
save_cache
:
-
save_cache
:
key
:
dep-bundle-
7
-{{ checksum "package.json" }}
key
:
dep-bundle-
10
-{{ checksum "package.json" }}
paths
:
paths
:
-
~/repo/node_modules
-
~/repo/node_modules
-
run
:
npm run lint && npm run test && npm run downloadsolc && npm run make-mock-compiler && npm run build
-
run
:
npm run lint && npm run test && npm run downloadsolc && npm run make-mock-compiler && npm run build
...
...
src/app/execution/txLogger.js
View file @
4a71d9d5
...
@@ -264,7 +264,7 @@ function context (self, opts) {
...
@@ -264,7 +264,7 @@ function context (self, opts) {
var
val
=
data
.
tx
.
value
var
val
=
data
.
tx
.
value
var
hash
=
data
.
tx
.
hash
?
helper
.
shortenHexData
(
data
.
tx
.
hash
)
:
''
var
hash
=
data
.
tx
.
hash
?
helper
.
shortenHexData
(
data
.
tx
.
hash
)
:
''
var
input
=
data
.
tx
.
input
?
helper
.
shortenHexData
(
data
.
tx
.
input
)
:
''
var
input
=
data
.
tx
.
input
?
helper
.
shortenHexData
(
data
.
tx
.
input
)
:
''
var
logs
=
data
.
logs
&&
data
.
logs
.
decoded
?
data
.
logs
.
decoded
.
length
:
0
var
logs
=
data
.
logs
&&
data
.
logs
.
decoded
&&
data
.
logs
.
decoded
.
length
?
data
.
logs
.
decoded
.
length
:
0
var
block
=
data
.
tx
.
blockNumber
||
''
var
block
=
data
.
tx
.
blockNumber
||
''
var
i
=
data
.
tx
.
transactionIndex
var
i
=
data
.
tx
.
transactionIndex
var
value
=
val
?
typeConversion
.
toInt
(
val
)
:
0
var
value
=
val
?
typeConversion
.
toInt
(
val
)
:
0
...
...
test-browser/helpers/contracts.js
View file @
4a71d9d5
...
@@ -135,13 +135,25 @@ function testFunction (fnFullName, txHash, log, expectedInput, expectedReturn, e
...
@@ -135,13 +135,25 @@ function testFunction (fnFullName, txHash, log, expectedInput, expectedReturn, e
.
click
(
'#editor-container div[class^="terminal"] span[id="tx'
+
txHash
+
'"] div[class^="log"]'
)
.
click
(
'#editor-container div[class^="terminal"] span[id="tx'
+
txHash
+
'"] div[class^="log"]'
)
.
perform
(
function
(
client
,
done
)
{
.
perform
(
function
(
client
,
done
)
{
if
(
expectedReturn
)
{
if
(
expectedReturn
)
{
client
.
assert
.
containsText
(
'#editor-container div[class^="terminal"] span[id="tx'
+
txHash
+
'"] table[class^="txTable"] #decodedoutput'
,
expectedReturn
)
client
.
getText
(
'#editor-container div[class^="terminal"] span[id="tx'
+
txHash
+
'"] table[class^="txTable"] #decodedoutput'
,
(
result
)
=>
{
console
.
log
(
result
)
var
equal
=
deepequal
(
JSON
.
parse
(
result
.
value
),
JSON
.
parse
(
expectedReturn
))
if
(
!
equal
)
{
client
.
assert
.
fail
(
'expected '
+
expectedReturn
+
' got '
+
result
.
value
,
'info about error'
,
''
)
}
})
}
}
done
()
done
()
})
})
.
perform
(
function
(
client
,
done
)
{
.
perform
(
function
(
client
,
done
)
{
if
(
expectedEvent
)
{
if
(
expectedEvent
)
{
client
.
assert
.
containsText
(
'#editor-container div[class^="terminal"] span[id="tx'
+
txHash
+
'"] table[class^="txTable"] #logs'
,
expectedEvent
)
client
.
getText
(
'#editor-container div[class^="terminal"] span[id="tx'
+
txHash
+
'"] table[class^="txTable"] #logs'
,
(
result
)
=>
{
console
.
log
(
result
)
var
equal
=
deepequal
(
JSON
.
parse
(
result
.
value
),
JSON
.
parse
(
expectedEvent
))
if
(
!
equal
)
{
client
.
assert
.
fail
(
'expected '
+
expectedEvent
+
' got '
+
result
.
value
,
'info about error'
,
''
)
}
})
}
}
done
()
done
()
if
(
callback
)
callback
()
if
(
callback
)
callback
()
...
...
test-browser/tests/compiling.js
View file @
4a71d9d5
...
@@ -78,7 +78,7 @@ function testReturnValues (browser, callback) {
...
@@ -78,7 +78,7 @@ function testReturnValues (browser, callback) {
"0": "bool: _b true",
"0": "bool: _b true",
"1": "uint256: _u 345",
"1": "uint256: _u 345",
"2": "int256: _i -345",
"2": "int256: _i -345",
"3": "address: _a 0x
ca35b7d915458ef540ade6068dfe2f44e
8fa733c"
"3": "address: _a 0x
CA35b7d915458EF540aDe6068dFe2F44E
8fa733c"
}`
)
}`
)
.
pause
(
500
)
.
pause
(
500
)
.
testFunction
(
'retunValues2 - transact (not payable)'
,
.
testFunction
(
'retunValues2 - transact (not payable)'
,
...
@@ -98,7 +98,7 @@ function testReturnValues (browser, callback) {
...
@@ -98,7 +98,7 @@ function testReturnValues (browser, callback) {
'0x7faab07aeaafc8afe6bf283bb83be70c000dff381dec04e779354e354da14aff'
,
'0x7faab07aeaafc8afe6bf283bb83be70c000dff381dec04e779354e354da14aff'
,
'[vm]
\
nfrom:0xca3...a733c
\
nto:testReturnValues.retunValues3() 0x5e7...26e9f
\
nvalue:0 wei
\
ndata:0x033...e0a7d
\
nlogs:0
\
nhash:0x7fa...14aff'
,
null
,
`{
'[vm]
\
nfrom:0xca3...a733c
\
nto:testReturnValues.retunValues3() 0x5e7...26e9f
\
nvalue:0 wei
\
ndata:0x033...e0a7d
\
nlogs:0
\
nhash:0x7fa...14aff'
,
null
,
`{
"0": "uint8: _en 2",
"0": "uint8: _en 2",
"1": "int256[5][]: _a1 1,-45,-78,56,60,
-1,42,334,-45455,-446,
1,10,-5435,45,-7"
"1": "int256[5][]: _a1 1,-45,-78,56,60,
-1,42,334,-45455,-446,
1,10,-5435,45,-7"
}`
).
click
(
'i[class^="clearinstance"]'
).
perform
(()
=>
{
callback
(
null
,
browser
)
})
}`
).
click
(
'i[class^="clearinstance"]'
).
perform
(()
=>
{
callback
(
null
,
browser
)
})
})
})
}
}
...
@@ -121,19 +121,31 @@ function testInputValues (browser, callback) {
...
@@ -121,19 +121,31 @@ function testInputValues (browser, callback) {
`[vm]\nfrom:0xca3...a733c\nto:test.inputValue2(uint256[3],bytes8[4]) 0x8c1...401f5\nvalue:0 wei\ndata:0x1b7...00000\nlogs:1\nhash:0x487...6ef7f`
,
`[vm]\nfrom:0xca3...a733c\nto:test.inputValue2(uint256[3],bytes8[4]) 0x8c1...401f5\nvalue:0 wei\ndata:0x1b7...00000\nlogs:1\nhash:0x487...6ef7f`
,
{
types
:
'uint256[3] _n, bytes8[4] _b8'
,
values
:
'[1,2,3], ["0x1234", "0x1234","0x1234","0x1234"]'
},
{
types
:
'uint256[3] _n, bytes8[4] _b8'
,
values
:
'[1,2,3], ["0x1234", "0x1234","0x1234","0x1234"]'
},
`{
`{
"0": "uint256[3]: _nret 1,
2,
3",
"0": "uint256[3]: _nret 1,
2,
3",
"1": "bytes8[4]: _b8ret 0x1234000000000000,
0x1234000000000000, 0x1234000000000000,
0x1234000000000000"
"1": "bytes8[4]: _b8ret 0x1234000000000000,
0x1234000000000000,0x1234000000000000,
0x1234000000000000"
}`
,
`[
}`
,
`[
{
{
"topic": "d30981760edbf605bda8689e945f622877f230c9a77cbfbd448aa4b7d8ac6e7f",
"topic": "d30981760edbf605bda8689e945f622877f230c9a77cbfbd448aa4b7d8ac6e7f",
"event": "event1",
"event": "event1",
"args": [
"args": {
"-123",
"0": "-123",
"000000000000000000000000000000000000000000000000000000000000007b",
"1": "123",
"9c22ff5f21f0b81b113e63f7db6da94fedef11b2119b4088b89664fb9a3cb658",
"2": {
"0x00001234",
"indexed": true,
"test _ test _ test _ test test _ test test _ test test _ test test _ test test _ test test _ test "
"hash": "0x9c22ff5f21f0b81b113e63f7db6da94fedef11b2119b4088b89664fb9a3cb658"
]
},
"3": "0x00001234",
"4": "test _ test _ test _ test test _ test test _ test test _ test test _ test test _ test test _ test ",
"_i": "-123",
"_u": "123",
"_str": {
"indexed": true,
"hash": "0x9c22ff5f21f0b81b113e63f7db6da94fedef11b2119b4088b89664fb9a3cb658"
},
"_b": "0x00001234",
"_notIndexed": "test _ test _ test _ test test _ test test _ test test _ test test _ test test _ test test _ test ",
"length": 5
}
}
}
]`
)
]`
)
.
click
(
'i[class^="clearinstance"]'
).
perform
(()
=>
{
callback
(
null
,
browser
)
})
.
click
(
'i[class^="clearinstance"]'
).
perform
(()
=>
{
callback
(
null
,
browser
)
})
...
...
test-browser/tests/units/testRecorder.js
View file @
4a71d9d5
...
@@ -16,7 +16,7 @@ module.exports = {
...
@@ -16,7 +16,7 @@ module.exports = {
.
clickFunction
(
'getFromLib - call'
)
.
clickFunction
(
'getFromLib - call'
)
.
waitForElementPresent
(
'div[class^="contractActionsContainer"] div[class^="value"] ul'
)
.
waitForElementPresent
(
'div[class^="contractActionsContainer"] div[class^="value"] ul'
)
.
perform
((
client
,
done
)
=>
{
.
perform
((
client
,
done
)
=>
{
contractHelper
.
verifyCallReturnValue
(
browser
,
'0x35ef07393b57464e93deb59175ff72e6499450cf'
,
[
'0: uint256: 1'
,
'0: uint256: 3456'
,
'0: address: 0x35e
f07393b57464e93deb59175ff72e6499450cf
'
],
()
=>
{
contractHelper
.
verifyCallReturnValue
(
browser
,
'0x35ef07393b57464e93deb59175ff72e6499450cf'
,
[
'0: uint256: 1'
,
'0: uint256: 3456'
,
'0: address: 0x35e
F07393b57464e93dEB59175fF72E6499450cF
'
],
()
=>
{
done
()
done
()
})
})
})
})
...
...
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