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
222a4f83
Commit
222a4f83
authored
Nov 14, 2016
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add more tests
parent
25da05dc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
2 deletions
+55
-2
decodeInfo.js
src/solidity/decodeInfo.js
+1
-1
contracts.js
test/solidity/contracts.js
+39
-1
storageLocation.js
test/solidity/storageLocation.js
+15
-0
No files found.
src/solidity/decodeInfo.js
View file @
222a4f83
...
...
@@ -200,7 +200,7 @@ function Struct (type, stateDefinitions) {
function
getEnum
(
type
,
stateDefinitions
)
{
for
(
var
k
in
stateDefinitions
)
{
var
dec
=
stateDefinitions
[
k
]
if
(
type
===
'enum '
+
dec
.
attributes
.
name
)
{
if
(
dec
.
attributes
&&
dec
.
attributes
.
name
&&
type
===
'enum '
+
dec
.
attributes
.
name
)
{
return
dec
}
}
...
...
test/solidity/contracts.js
View file @
222a4f83
...
...
@@ -38,5 +38,43 @@ module.exports = `
int32 i32;
uint ui32;
int16 i16;
}
}
contract testSimpleStorage1 {
uint32 uibase1;
}
contract testSimpleStorage is testSimpleStorage1 {
uint ui1;
uint ui2;
uint[1] ui3;
uint[][1][4] ui4;
int16 i16;
struct structDef {
uint ui;
string str;
}
structDef structDec;
structDef[3] arrayStructDec;
int32 i32;
int16 i16_2;
enum enumDef {
first,
second,
third
}
enumDef enumDec;
bool boolean;
uint[][2][][3] ui5;
string _string;
}
`
test/solidity/storageLocation.js
View file @
222a4f83
...
...
@@ -31,6 +31,21 @@ tape('solidity', function (t) {
checkLocation
(
st
,
stateDec
[
4
].
location
,
1
,
0
)
checkLocation
(
st
,
stateDec
[
5
].
location
,
2
,
0
)
stateDec
=
index
.
solidity
.
stateDecoder
.
extractStateVariables
(
'testSimpleStorage'
,
output
.
sources
)
checkLocation
(
st
,
stateDec
[
0
].
location
,
0
,
0
)
checkLocation
(
st
,
stateDec
[
1
].
location
,
1
,
0
)
checkLocation
(
st
,
stateDec
[
2
].
location
,
2
,
0
)
checkLocation
(
st
,
stateDec
[
3
].
location
,
3
,
0
)
checkLocation
(
st
,
stateDec
[
4
].
location
,
4
,
0
)
checkLocation
(
st
,
stateDec
[
5
].
location
,
8
,
0
)
checkLocation
(
st
,
stateDec
[
6
].
location
,
9
,
0
)
checkLocation
(
st
,
stateDec
[
8
].
location
,
17
,
0
)
checkLocation
(
st
,
stateDec
[
9
].
location
,
17
,
4
)
checkLocation
(
st
,
stateDec
[
10
].
location
,
17
,
6
)
checkLocation
(
st
,
stateDec
[
11
].
location
,
17
,
7
)
checkLocation
(
st
,
stateDec
[
12
].
location
,
18
,
0
)
checkLocation
(
st
,
stateDec
[
13
].
location
,
21
,
0
)
st
.
end
()
})
})
...
...
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