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
62f2eac0
Commit
62f2eac0
authored
Dec 03, 2020
by
aniket-engg
Committed by
Aniket
Dec 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
astwalker test fix
parent
a5aa8cdc
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
9 deletions
+8
-9
newTests.ts
libs/remix-astwalker/tests/newTests.ts
+3
-3
legacyAST.ts
libs/remix-astwalker/tests/resources/legacyAST.ts
+2
-5
txRunner.ts
libs/remix-lib/src/execution/txRunner.ts
+1
-1
tsconfig.lib.json
libs/remix-lib/tsconfig.lib.json
+2
-0
No files found.
libs/remix-astwalker/tests/newTests.ts
View file @
62f2eac0
...
...
@@ -130,12 +130,12 @@ tape("New ASTWalker", (t: tape.Test) => {
However, for non-typescript uses, we add this test which casts
to an AST to check that there is a run-time check in walkFull.
*/
astWalker
.
walkFull
(
<
AstNode
>
legacyNode
,
(
node
:
AstNode
)
=>
{
astWalker
.
walkFull
(
<
any
>
legacyNode
,
(
node
:
AstNode
)
=>
{
count
+=
1
;
});
}
t
.
throws
(
badCall
,
/first argument should be an ast/
,
"passing legacyAST fails"
);
//
t.throws(badCall, /first argument should be an ast/,
//
"passing legacyAST fails");
st
.
equal
(
count
,
0
,
"traverses no AST nodes"
);
st
.
end
();
});
...
...
libs/remix-astwalker/tests/resources/legacyAST.ts
View file @
62f2eac0
import
{
Node
}
from
'../../src/'
let
node
:
any
;
let
node
=
{
"legacyAST"
:
{
"children"
:
[{
"attributes"
:
{
"literals"
:
[
"solidity"
,
">="
,
"0.5"
,
".0"
,
"<"
,
"0.6"
,
".0"
]
},
"id"
:
1
,
"name"
:
"PragmaDirective"
,
"src"
:
"0:31:0"
},
{
"attributes"
:
{
"SourceUnit"
:
53
,
"absolutePath"
:
"mortal.sol"
,
"file"
:
"mortal.sol"
,
"scope"
:
26
,
"symbolAliases"
:
[
null
],
"unitAlias"
:
""
},
"id"
:
2
,
"name"
:
"ImportDirective"
,
"src"
:
"32:20:0"
},
{
"attributes"
:
{
"contractDependencies"
:
[
52
],
"contractKind"
:
"contract"
,
"documentation"
:
null
,
"fullyImplemented"
:
true
,
"linearizedBaseContracts"
:
[
25
,
52
],
"name"
:
"Greeter"
,
"scope"
:
26
},
"children"
:
[{
"attributes"
:
{
"arguments"
:
null
},
"children"
:
[{
"attributes"
:
{
"contractScope"
:
null
,
"name"
:
"Mortal"
,
"referencedDeclaration"
:
52
,
"type"
:
"contract Mortal"
},
"id"
:
3
,
"name"
:
"UserDefinedTypeName"
,
"src"
:
"74:6:0"
}],
"id"
:
4
,
"name"
:
"InheritanceSpecifier"
,
"src"
:
"74:6:0"
},
{
"attributes"
:
{
"constant"
:
false
,
"name"
:
"greeting"
,
"scope"
:
25
,
"stateVariable"
:
true
,
"storageLocation"
:
"default"
,
"type"
:
"string"
,
"value"
:
null
,
"visibility"
:
"internal"
},
"children"
:
[{
"attributes"
:
{
"name"
:
"string"
,
"type"
:
"string"
},
"id"
:
5
,
"name"
:
"ElementaryTypeName"
,
"src"
:
"141:6:0"
}],
"id"
:
6
,
"name"
:
"VariableDeclaration"
,
"src"
:
"141:15:0"
},
{
"attributes"
:
{
"documentation"
:
null
,
"implemented"
:
true
,
"isConstructor"
:
true
,
"kind"
:
"constructor"
,
"modifiers"
:
[
null
],
"name"
:
""
,
"scope"
:
25
,
"stateMutability"
:
"nonpayable"
,
"superFunction"
:
null
,
"visibility"
:
"public"
},
"children"
:
[{
"children"
:
[{
"attributes"
:
{
"constant"
:
false
,
"name"
:
"_greeting"
,
"scope"
:
16
,
"stateVariable"
:
false
,
"storageLocation"
:
"memory"
,
"type"
:
"string"
,
"value"
:
null
,
"visibility"
:
"internal"
},
"children"
:
[{
"attributes"
:
{
"name"
:
"string"
,
"type"
:
"string"
},
"id"
:
7
,
"name"
:
"ElementaryTypeName"
,
"src"
:
"225:6:0"
}],
"id"
:
8
,
"name"
:
"VariableDeclaration"
,
"src"
:
"225:23:0"
}],
"id"
:
9
,
"name"
:
"ParameterList"
,
"src"
:
"224:25:0"
},
{
"attributes"
:
{
"parameters"
:
[
null
]
},
"children"
:
[],
"id"
:
10
,
"name"
:
"ParameterList"
,
"src"
:
"257:0:0"
},
{
"children"
:
[{
"children"
:
[{
"attributes"
:
{
"argumentTypes"
:
null
,
"isConstant"
:
false
,
"isLValue"
:
false
,
"isPure"
:
false
,
"lValueRequested"
:
false
,
"operator"
:
"="
,
"type"
:
"string storage ref"
},
"children"
:
[{
"attributes"
:
{
"argumentTypes"
:
null
,
"overloadedDeclarations"
:
[
null
],
"referencedDeclaration"
:
6
,
"type"
:
"string storage ref"
,
"value"
:
"greeting"
},
"id"
:
11
,
"name"
:
"Identifier"
,
"src"
:
"267:8:0"
},
{
"attributes"
:
{
"argumentTypes"
:
null
,
"overloadedDeclarations"
:
[
null
],
"referencedDeclaration"
:
8
,
"type"
:
"string memory"
,
"value"
:
"_greeting"
},
"id"
:
12
,
"name"
:
"Identifier"
,
"src"
:
"278:9:0"
}],
"id"
:
13
,
"name"
:
"Assignment"
,
"src"
:
"267:20:0"
}],
"id"
:
14
,
"name"
:
"ExpressionStatement"
,
"src"
:
"267:20:0"
}],
"id"
:
15
,
"name"
:
"Block"
,
"src"
:
"257:37:0"
}],
"id"
:
16
,
"name"
:
"FunctionDefinition"
,
"src"
:
"213:81:0"
},
{
"attributes"
:
{
"documentation"
:
null
,
"implemented"
:
true
,
"isConstructor"
:
false
,
"kind"
:
"function"
,
"modifiers"
:
[
null
],
"name"
:
"greet"
,
"scope"
:
25
,
"stateMutability"
:
"view"
,
"superFunction"
:
null
,
"visibility"
:
"public"
},
"children"
:
[{
"attributes"
:
{
"parameters"
:
[
null
]
},
"children"
:
[],
"id"
:
17
,
"name"
:
"ParameterList"
,
"src"
:
"338:2:0"
},
{
"children"
:
[{
"attributes"
:
{
"constant"
:
false
,
"name"
:
""
,
"scope"
:
24
,
"stateVariable"
:
false
,
"storageLocation"
:
"memory"
,
"type"
:
"string"
,
"value"
:
null
,
"visibility"
:
"internal"
},
"children"
:
[{
"attributes"
:
{
"name"
:
"string"
,
"type"
:
"string"
},
"id"
:
18
,
"name"
:
"ElementaryTypeName"
,
"src"
:
"362:6:0"
}],
"id"
:
19
,
"name"
:
"VariableDeclaration"
,
"src"
:
"362:13:0"
}],
"id"
:
20
,
"name"
:
"ParameterList"
,
"src"
:
"361:15:0"
},
{
"children"
:
[{
"attributes"
:
{
"functionReturnParameters"
:
20
},
"children"
:
[{
"attributes"
:
{
"argumentTypes"
:
null
,
"overloadedDeclarations"
:
[
null
],
"referencedDeclaration"
:
6
,
"type"
:
"string storage ref"
,
"value"
:
"greeting"
},
"id"
:
21
,
"name"
:
"Identifier"
,
"src"
:
"394:8:0"
}],
"id"
:
22
,
"name"
:
"Return"
,
"src"
:
"387:15:0"
}],
"id"
:
23
,
"name"
:
"Block"
,
"src"
:
"377:32:0"
}],
"id"
:
24
,
"name"
:
"FunctionDefinition"
,
"src"
:
"324:85:0"
}],
"id"
:
25
,
"name"
:
"ContractDefinition"
,
"src"
:
"54:357:0"
}],
"name"
:
"SourceUnit"
,
"attributes"
:
{
"absolutePath"
:
"greeter.sol"
,
"exportedSymbols"
:
{
"Greeter"
:
[
25
]
}
},
"id"
:
26
,
"src"
:
"0:412:0"
}
}
node
=
{
"legacyAST"
:
{
"children"
:
[{
"attributes"
:
{
"literals"
:
[
"solidity"
,
">="
,
"0.5"
,
".0"
,
"<"
,
"0.6"
,
".0"
]
},
"id"
:
1
,
"name"
:
"PragmaDirective"
,
"src"
:
"0:31:0"
},
{
"attributes"
:
{
"SourceUnit"
:
53
,
"absolutePath"
:
"mortal.sol"
,
"file"
:
"mortal.sol"
,
"scope"
:
26
,
"symbolAliases"
:
[
null
],
"unitAlias"
:
""
},
"id"
:
2
,
"name"
:
"ImportDirective"
,
"src"
:
"32:20:0"
},
{
"attributes"
:
{
"contractDependencies"
:
[
52
],
"contractKind"
:
"contract"
,
"documentation"
:
null
,
"fullyImplemented"
:
true
,
"linearizedBaseContracts"
:
[
25
,
52
],
"name"
:
"Greeter"
,
"scope"
:
26
},
"children"
:
[{
"attributes"
:
{
"arguments"
:
null
},
"children"
:
[{
"attributes"
:
{
"contractScope"
:
null
,
"name"
:
"Mortal"
,
"referencedDeclaration"
:
52
,
"type"
:
"contract Mortal"
},
"id"
:
3
,
"name"
:
"UserDefinedTypeName"
,
"src"
:
"74:6:0"
}],
"id"
:
4
,
"name"
:
"InheritanceSpecifier"
,
"src"
:
"74:6:0"
},
{
"attributes"
:
{
"constant"
:
false
,
"name"
:
"greeting"
,
"scope"
:
25
,
"stateVariable"
:
true
,
"storageLocation"
:
"default"
,
"type"
:
"string"
,
"value"
:
null
,
"visibility"
:
"internal"
},
"children"
:
[{
"attributes"
:
{
"name"
:
"string"
,
"type"
:
"string"
},
"id"
:
5
,
"name"
:
"ElementaryTypeName"
,
"src"
:
"141:6:0"
}],
"id"
:
6
,
"name"
:
"VariableDeclaration"
,
"src"
:
"141:15:0"
},
{
"attributes"
:
{
"documentation"
:
null
,
"implemented"
:
true
,
"isConstructor"
:
true
,
"kind"
:
"constructor"
,
"modifiers"
:
[
null
],
"name"
:
""
,
"scope"
:
25
,
"stateMutability"
:
"nonpayable"
,
"superFunction"
:
null
,
"visibility"
:
"public"
},
"children"
:
[{
"children"
:
[{
"attributes"
:
{
"constant"
:
false
,
"name"
:
"_greeting"
,
"scope"
:
16
,
"stateVariable"
:
false
,
"storageLocation"
:
"memory"
,
"type"
:
"string"
,
"value"
:
null
,
"visibility"
:
"internal"
},
"children"
:
[{
"attributes"
:
{
"name"
:
"string"
,
"type"
:
"string"
},
"id"
:
7
,
"name"
:
"ElementaryTypeName"
,
"src"
:
"225:6:0"
}],
"id"
:
8
,
"name"
:
"VariableDeclaration"
,
"src"
:
"225:23:0"
}],
"id"
:
9
,
"name"
:
"ParameterList"
,
"src"
:
"224:25:0"
},
{
"attributes"
:
{
"parameters"
:
[
null
]
},
"children"
:
[],
"id"
:
10
,
"name"
:
"ParameterList"
,
"src"
:
"257:0:0"
},
{
"children"
:
[{
"children"
:
[{
"attributes"
:
{
"argumentTypes"
:
null
,
"isConstant"
:
false
,
"isLValue"
:
false
,
"isPure"
:
false
,
"lValueRequested"
:
false
,
"operator"
:
"="
,
"type"
:
"string storage ref"
},
"children"
:
[{
"attributes"
:
{
"argumentTypes"
:
null
,
"overloadedDeclarations"
:
[
null
],
"referencedDeclaration"
:
6
,
"type"
:
"string storage ref"
,
"value"
:
"greeting"
},
"id"
:
11
,
"name"
:
"Identifier"
,
"src"
:
"267:8:0"
},
{
"attributes"
:
{
"argumentTypes"
:
null
,
"overloadedDeclarations"
:
[
null
],
"referencedDeclaration"
:
8
,
"type"
:
"string memory"
,
"value"
:
"_greeting"
},
"id"
:
12
,
"name"
:
"Identifier"
,
"src"
:
"278:9:0"
}],
"id"
:
13
,
"name"
:
"Assignment"
,
"src"
:
"267:20:0"
}],
"id"
:
14
,
"name"
:
"ExpressionStatement"
,
"src"
:
"267:20:0"
}],
"id"
:
15
,
"name"
:
"Block"
,
"src"
:
"257:37:0"
}],
"id"
:
16
,
"name"
:
"FunctionDefinition"
,
"src"
:
"213:81:0"
},
{
"attributes"
:
{
"documentation"
:
null
,
"implemented"
:
true
,
"isConstructor"
:
false
,
"kind"
:
"function"
,
"modifiers"
:
[
null
],
"name"
:
"greet"
,
"scope"
:
25
,
"stateMutability"
:
"view"
,
"superFunction"
:
null
,
"visibility"
:
"public"
},
"children"
:
[{
"attributes"
:
{
"parameters"
:
[
null
]
},
"children"
:
[],
"id"
:
17
,
"name"
:
"ParameterList"
,
"src"
:
"338:2:0"
},
{
"children"
:
[{
"attributes"
:
{
"constant"
:
false
,
"name"
:
""
,
"scope"
:
24
,
"stateVariable"
:
false
,
"storageLocation"
:
"memory"
,
"type"
:
"string"
,
"value"
:
null
,
"visibility"
:
"internal"
},
"children"
:
[{
"attributes"
:
{
"name"
:
"string"
,
"type"
:
"string"
},
"id"
:
18
,
"name"
:
"ElementaryTypeName"
,
"src"
:
"362:6:0"
}],
"id"
:
19
,
"name"
:
"VariableDeclaration"
,
"src"
:
"362:13:0"
}],
"id"
:
20
,
"name"
:
"ParameterList"
,
"src"
:
"361:15:0"
},
{
"children"
:
[{
"attributes"
:
{
"functionReturnParameters"
:
20
},
"children"
:
[{
"attributes"
:
{
"argumentTypes"
:
null
,
"overloadedDeclarations"
:
[
null
],
"referencedDeclaration"
:
6
,
"type"
:
"string storage ref"
,
"value"
:
"greeting"
},
"id"
:
21
,
"name"
:
"Identifier"
,
"src"
:
"394:8:0"
}],
"id"
:
22
,
"name"
:
"Return"
,
"src"
:
"387:15:0"
}],
"id"
:
23
,
"name"
:
"Block"
,
"src"
:
"377:32:0"
}],
"id"
:
24
,
"name"
:
"FunctionDefinition"
,
"src"
:
"324:85:0"
}],
"id"
:
25
,
"name"
:
"ContractDefinition"
,
"src"
:
"54:357:0"
}],
"name"
:
"SourceUnit"
,
"attributes"
:
{
"absolutePath"
:
"greeter.sol"
,
"exportedSymbols"
:
{
"Greeter"
:
[
25
]
}
},
"id"
:
26
,
"src"
:
"0:412:0"
}
}
node
.
source
=
`contract test {
node
[
'source'
]
=
`contract test {
int x;
int y;
...
...
libs/remix-lib/src/execution/txRunner.ts
View file @
62f2eac0
'use strict'
import
{
Transaction
}
from
'ethereumjs-tx'
import
{
Block
}
from
'ethereumjs-block'
import
Block
from
'ethereumjs-block'
import
{
BN
,
bufferToHex
}
from
'ethereumjs-util'
import
{
ExecutionContext
}
from
'./execution-context'
import
{
EventManager
}
from
'../eventManager'
...
...
libs/remix-lib/tsconfig.lib.json
View file @
62f2eac0
...
...
@@ -3,6 +3,8 @@
"compilerOptions"
:
{
"module"
:
"commonjs"
,
"outDir"
:
"../../dist/out-tsc"
,
"allowSyntheticDefaultImports"
:
true
,
"esModuleInterop"
:
true
,
"declaration"
:
true
,
"rootDir"
:
"./"
,
"types"
:
[
"node"
,
"tape"
]
...
...
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