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
b5ac39fb
Commit
b5ac39fb
authored
Nov 14, 2016
by
Alex Beregszaszi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
compiler: add constructor/fallback to the ABI if using an old compiler
parent
63141ae9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
compiler.js
src/app/compiler.js
+51
-0
No files found.
src/app/compiler.js
View file @
b5ac39fb
...
@@ -123,6 +123,8 @@ function Compiler (editor, handleGithubCall) {
...
@@ -123,6 +123,8 @@ function Compiler (editor, handleGithubCall) {
// try compiling again with the new set of inputs
// try compiling again with the new set of inputs
internalCompile
(
source
.
sources
,
missingInputs
)
internalCompile
(
source
.
sources
,
missingInputs
)
}
else
{
}
else
{
data
=
updateInterface
(
data
)
self
.
lastCompilationResult
=
{
self
.
lastCompilationResult
=
{
data
:
data
,
data
:
data
,
source
:
source
source
:
source
...
@@ -270,6 +272,55 @@ function Compiler (editor, handleGithubCall) {
...
@@ -270,6 +272,55 @@ function Compiler (editor, handleGithubCall) {
}
while
(
reloop
)
}
while
(
reloop
)
cb
(
null
,
{
'sources'
:
files
})
cb
(
null
,
{
'sources'
:
files
})
}
}
function
updateInterface
(
data
)
{
console
.
log
(
data
)
for
(
var
contract
in
data
.
contracts
)
{
var
abi
=
JSON
.
parse
(
data
.
contracts
[
contract
].
interface
)
console
.
log
(
abi
)
var
hasConstructor
=
false
var
hasFallback
=
false
for
(
var
i
=
0
;
i
<
abi
.
length
;
i
++
)
{
var
item
=
abi
[
i
]
if
(
item
.
type
===
"constructor"
)
{
hasConstructor
=
true
}
else
if
(
item
.
type
===
"fallback"
)
{
hasFallback
=
true
}
// add "payable" to everything
// FIXME: only for compiler <0.4.0
item
.
payable
=
true
}
// FIXME: only for compiler <0.x.y
if
(
!
hasConstructor
)
{
abi
.
push
({
type
:
'constructor'
,
payable
:
true
,
inputs
:
[]
})
}
// FIXME: only for compiler <0.4.0
if
(
!
hasFallback
)
{
abi
.
push
({
type
:
'fallback'
,
payable
:
true
})
}
console
.
log
(
abi
)
data
.
contracts
[
contract
].
interface
=
JSON
.
stringify
(
abi
)
}
return
data
}
}
}
module
.
exports
=
Compiler
module
.
exports
=
Compiler
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