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
62393c30
Commit
62393c30
authored
Nov 03, 2020
by
aniket-engg
Committed by
Aniket
Nov 04, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unit tests updated
parent
d5ea5bbf
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
11 deletions
+12
-11
debugger.js
libs/remix-debug/test/debugger.js
+4
-5
byteStorage.js
libs/remix-debug/test/decoder/contracts/byteStorage.js
+2
-2
misc.js
libs/remix-debug/test/decoder/localsTests/misc.js
+4
-4
storageDecoder.js
libs/remix-debug/test/decoder/storageDecoder.js
+2
-0
No files found.
libs/remix-debug/test/debugger.js
View file @
62393c30
...
@@ -258,13 +258,12 @@ function testDebugging (debugManager) {
...
@@ -258,13 +258,12 @@ function testDebugging (debugManager) {
tape
(
'traceManager.decodeLocalsAt'
,
async
(
t
)
=>
{
tape
(
'traceManager.decodeLocalsAt'
,
async
(
t
)
=>
{
t
.
plan
(
1
)
t
.
plan
(
1
)
const
tested
=
JSON
.
parse
(
'{"proposalNames":{"value":[{"value":"0x48656C6C6F20576F726C64210000000000000000000000000000000000000000","type":"bytes32"}],"length":"0x1","type":"bytes32[]","cursor":1,"hasNext":false}}'
)
const
tested
=
JSON
.
parse
(
'{"proposalNames":{"value":[{"value":"0x48656C6C6F20576F726C64210000000000000000000000000000000000000000","type":"bytes32"}],"length":"0x1","type":"bytes32[]","cursor":1,"hasNext":false}
,"p":{"value":"45","type":"uint256"},"addressLocal":{"value":"0x4B0897B0513FDC7C541B6D9D7E929C4E5364D2DB","type":"address"},"i":{"value":"2","type":"uint256"},"proposalsLocals":{"value":[{"value":{"name":{"value":"0x48656C6C6F20576F726C64210000000000000000000000000000000000000000","type":"bytes32"},"voteCount":{"value":"0","type":"uint256"}},"type":"struct Ballot.Proposal"}],"length":"0x1","type":"struct Ballot.Proposal[]"}
}'
)
try
{
try
{
const
address
=
debugManager
.
traceManager
.
getCurrentCalledAddressAt
(
3
30
)
const
address
=
debugManager
.
traceManager
.
getCurrentCalledAddressAt
(
3
27
)
const
location
=
await
debugManager
.
sourceLocationFromVMTraceIndex
(
address
,
3
30
)
const
location
=
await
debugManager
.
sourceLocationFromVMTraceIndex
(
address
,
3
27
)
debugManager
.
decodeLocalsAt
(
3
30
,
location
,
(
error
,
decodedlocals
)
=>
{
debugManager
.
decodeLocalsAt
(
3
27
,
location
,
(
error
,
decodedlocals
)
=>
{
if
(
error
)
return
t
.
end
(
error
)
if
(
error
)
return
t
.
end
(
error
)
t
.
ok
(
deepequal
(
decodedlocals
,
tested
),
`locals does not match. expected:
${
JSON
.
stringify
(
tested
)}
- current:
${
decodedlocals
}
`
)
t
.
ok
(
deepequal
(
decodedlocals
,
tested
),
`locals does not match. expected:
${
JSON
.
stringify
(
tested
)}
- current:
${
decodedlocals
}
`
)
})
})
}
catch
(
error
)
{
}
catch
(
error
)
{
...
...
libs/remix-debug/test/decoder/contracts/byteStorage.js
View file @
62393c30
...
@@ -44,7 +44,7 @@ module.exports = {
...
@@ -44,7 +44,7 @@ module.exports = {
bytes32 stab32 = hex"324324423432543543AB";
bytes32 stab32 = hex"324324423432543543AB";
enum1 enumDec = enum1.e240;
enum1 enumDec = enum1.e240;
string str1 = 'short';
string str1 = 'short';
string str12 =
'short2
';
string str12 =
unicode'шеллы
';
string str2 = 'long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long';
string str2 = 'long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long';
}
}
`
,
`
,
...
@@ -74,7 +74,7 @@ module.exports = {
...
@@ -74,7 +74,7 @@ module.exports = {
'0x0000000000000000000000000000000000000000000000000000000000000016'
:
'0x324324423432543543ab00000000000000000000000000000000000000000000'
,
'0x0000000000000000000000000000000000000000000000000000000000000016'
:
'0x324324423432543543ab00000000000000000000000000000000000000000000'
,
'0x0000000000000000000000000000000000000000000000000000000000000017'
:
'0x00000000000000000000000000000000000000000000000000000000000000f0'
,
'0x0000000000000000000000000000000000000000000000000000000000000017'
:
'0x00000000000000000000000000000000000000000000000000000000000000f0'
,
'0x0000000000000000000000000000000000000000000000000000000000000018'
:
'0x73686f727400000000000000000000000000000000000000000000000000000a'
,
'0x0000000000000000000000000000000000000000000000000000000000000018'
:
'0x73686f727400000000000000000000000000000000000000000000000000000a'
,
'0x0000000000000000000000000000000000000000000000000000000000000019'
:
'0x
73686f72743200000000
00000000000000000000000000000000000000000014'
,
'0x0000000000000000000000000000000000000000000000000000000000000019'
:
'0x
d188d0b5d0bbd0bbd18b
00000000000000000000000000000000000000000014'
,
'0x000000000000000000000000000000000000000000000000000000000000001a'
:
'0x000000000000000000000000000000000000000000000000000000000000023d'
,
'0x000000000000000000000000000000000000000000000000000000000000001a'
:
'0x000000000000000000000000000000000000000000000000000000000000023d'
,
'0x057c384a7d1c54f3a1b2e5e67b2617b8224fdfd1ea7234eea573a6ff665ff63e'
:
'0x6c6f6e675f5f6c6f6e675f5f6c6f6e675f5f6c6f6e675f5f6c6f6e675f5f6c6f'
,
'0x057c384a7d1c54f3a1b2e5e67b2617b8224fdfd1ea7234eea573a6ff665ff63e'
:
'0x6c6f6e675f5f6c6f6e675f5f6c6f6e675f5f6c6f6e675f5f6c6f6e675f5f6c6f'
,
'0x057c384a7d1c54f3a1b2e5e67b2617b8224fdfd1ea7234eea573a6ff665ff63f'
:
'0x6e675f5f6c6f6e675f5f6c6f6e675f5f6c6f6e675f5f6c6f6e675f5f6c6f6e67'
,
'0x057c384a7d1c54f3a1b2e5e67b2617b8224fdfd1ea7234eea573a6ff665ff63f'
:
'0x6e675f5f6c6f6e675f5f6c6f6e675f5f6c6f6e675f5f6c6f6e675f5f6c6f6e67'
,
...
...
libs/remix-debug/test/decoder/localsTests/misc.js
View file @
62393c30
...
@@ -30,7 +30,7 @@ module.exports = function (st, vm, privateKey, contractBytecode, compilationResu
...
@@ -30,7 +30,7 @@ module.exports = function (st, vm, privateKey, contractBytecode, compilationResu
st
.
fail
(
error
)
st
.
fail
(
error
)
})
})
callTree
.
event
.
register
(
'callTreeReady'
,
(
scopes
,
scopeStarts
)
=>
{
callTree
.
event
.
register
(
'callTreeReady'
,
(
scopes
,
scopeStarts
)
=>
{
helper
.
decodeLocals
(
st
,
7
3
,
traceManager
,
callTree
,
function
(
locals
)
{
helper
.
decodeLocals
(
st
,
7
0
,
traceManager
,
callTree
,
function
(
locals
)
{
try
{
try
{
st
.
equals
(
locals
[
'boolFalse'
].
value
,
false
)
st
.
equals
(
locals
[
'boolFalse'
].
value
,
false
)
st
.
equals
(
locals
[
'boolTrue'
].
value
,
true
)
st
.
equals
(
locals
[
'boolTrue'
].
value
,
true
)
...
@@ -46,9 +46,9 @@ module.exports = function (st, vm, privateKey, contractBytecode, compilationResu
...
@@ -46,9 +46,9 @@ module.exports = function (st, vm, privateKey, contractBytecode, compilationResu
st
.
equals
(
locals
[
'__bytes9'
].
value
,
'0x99156744AF00000000'
)
st
.
equals
(
locals
[
'__bytes9'
].
value
,
'0x99156744AF00000000'
)
st
.
equals
(
locals
[
'__bytes13'
].
value
,
'0x99123423425300000000000000'
)
st
.
equals
(
locals
[
'__bytes13'
].
value
,
'0x99123423425300000000000000'
)
st
.
equals
(
locals
[
'__bytes16'
].
value
,
'0x99AFAD23432400000000000000000000'
)
st
.
equals
(
locals
[
'__bytes16'
].
value
,
'0x99AFAD23432400000000000000000000'
)
//
st.equals(locals['__bytes24'].value, '0x99AFAD234324000000000000000000000000000000000000')
st
.
equals
(
locals
[
'__bytes24'
].
value
,
'0x99AFAD234324000000000000000000000000000000000000'
)
//
st.equals(locals['__bytes32'].value, '0x9999ABD41799ABD4170000000000000000000000000000000000000000000000')
st
.
equals
(
locals
[
'__bytes32'
].
value
,
'0x9999ABD41799ABD4170000000000000000000000000000000000000000000000'
)
st
.
equals
(
Object
.
keys
(
locals
).
length
,
1
4
)
st
.
equals
(
Object
.
keys
(
locals
).
length
,
1
6
)
}
catch
(
e
)
{
}
catch
(
e
)
{
st
.
fail
(
e
.
message
)
st
.
fail
(
e
.
message
)
}
}
...
...
libs/remix-debug/test/decoder/storageDecoder.js
View file @
62393c30
...
@@ -115,6 +115,7 @@ function testByteStorage (st, cb) {
...
@@ -115,6 +115,7 @@ function testByteStorage (st, cb) {
st
.
equal
(
decoded
[
'stab32'
].
value
,
'0x324324423432543543AB00000000000000000000000000000000000000000000'
)
st
.
equal
(
decoded
[
'stab32'
].
value
,
'0x324324423432543543AB00000000000000000000000000000000000000000000'
)
st
.
equal
(
decoded
[
'enumDec'
].
value
,
'e240'
)
st
.
equal
(
decoded
[
'enumDec'
].
value
,
'e240'
)
st
.
equal
(
decoded
[
'str1'
].
value
,
'short'
)
st
.
equal
(
decoded
[
'str1'
].
value
,
'short'
)
st
.
equal
(
decoded
[
'str12'
].
value
,
'шеллы'
)
st
.
equal
(
decoded
[
'str2'
].
value
,
'long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long'
)
st
.
equal
(
decoded
[
'str2'
].
value
,
'long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long__long'
)
})
})
}
}
...
@@ -163,6 +164,7 @@ function testByteStorage (st, cb) {
...
@@ -163,6 +164,7 @@ function testByteStorage (st, cb) {
st
.
equal
(
decoded
[
'str1'
].
length
,
'0x0'
)
st
.
equal
(
decoded
[
'str1'
].
length
,
'0x0'
)
st
.
equal
(
decoded
[
'str2'
].
length
,
'0x0'
)
st
.
equal
(
decoded
[
'str2'
].
length
,
'0x0'
)
st
.
equal
(
decoded
[
'str1'
].
value
,
''
)
st
.
equal
(
decoded
[
'str1'
].
value
,
''
)
st
.
equal
(
decoded
[
'str12'
].
value
,
''
)
st
.
equal
(
decoded
[
'str2'
].
value
,
''
)
st
.
equal
(
decoded
[
'str2'
].
value
,
''
)
cb
()
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